From nobody Mon Nov 15 14:07:37 2021 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 513E91896AB7; Mon, 15 Nov 2021 14:07: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ht9xj1vsTz4c3y; Mon, 15 Nov 2021 14:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 213C81AE61; Mon, 15 Nov 2021 14:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AFE7bYm006270; Mon, 15 Nov 2021 14:07:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AFE7b7E006269; Mon, 15 Nov 2021 14:07:37 GMT (envelope-from git) Date: Mon, 15 Nov 2021 14:07:37 GMT Message-Id: <202111151407.1AFE7b7E006269@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: d5ebaa6f8f85 - stable/13 - uma: Improve M_USE_RESERVE handling in keg_fetch_slab() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: d5ebaa6f8f850bb6f6273f01386832efcb295827 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d5ebaa6f8f850bb6f6273f01386832efcb295827 commit d5ebaa6f8f850bb6f6273f01386832efcb295827 Author: Mark Johnston AuthorDate: 2021-11-01 13:27:35 +0000 Commit: Mark Johnston CommitDate: 2021-11-15 14:06:54 +0000 uma: Improve M_USE_RESERVE handling in keg_fetch_slab() M_USE_RESERVE is used in a couple of places in the VM to avoid unbounded recursion when the direct map is not available, as is the case on 32-bit platforms or when certain kernel sanitizers (KASAN and KMSAN) are enabled. For example, to allocate KVA, the kernel might allocate a kernel map entry, which might require a new slab, which requires KVA. For these zones, we use uma_prealloc() to populate a reserve of items, and then in certain serialized contexts M_USE_RESERVE can be used to guarantee a successful allocation. uma_prealloc() allocates the requested number of items, distributing them evenly among NUMA domains. Thus, in a first-touch zone, to satisfy an M_USE_RESERVE allocation we might have to check the slab lists of other domains than the current one to provide the semantics expected by consumers. So, try harder to find an item if M_USE_RESERVE is specified and the keg doesn't have anything for current (first-touch) domain. Specifically, fall back to a round-robin slab allocation. This change fixes boot-time panics on NUMA systems with KASAN or KMSAN enabled.[1] Alternately we could have uma_prealloc() allocate the requested number of items for each domain, but for some existing consumers this would be quite wasteful. In general I think keg_fetch_slab() should try harder to find free slabs in other domains before trying to allocate fresh ones, but let's limit this to M_USE_RESERVE for now. Also fix a separate problem that I noticed: in a non-round-robin slab allocation with M_WAITOK, rather than sleeping after a failed slab allocation we simply try again. Call vm_wait_domain() before retrying. Reported by: mjg, tuexen [1] Reviewed by: alc Sponsored by: The FreeBSD Foundation (cherry picked from commit fab343a7168a2f033073bb5f65b5af17d9092c6f) --- sys/vm/uma_core.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 3e4e3c7c4ce1..1fb066d71762 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3858,6 +3858,9 @@ keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdomain, const int flags) int aflags, domain; bool rr; + KASSERT((flags & (M_WAITOK | M_NOVM)) != (M_WAITOK | M_NOVM), + ("%s: invalid flags %#x", __func__, flags)); + restart: /* * Use the keg's policy if upper layers haven't already specified a @@ -3883,17 +3886,29 @@ restart: return (slab); /* - * M_NOVM means don't ask at all! + * M_NOVM is used to break the recursion that can otherwise + * occur if low-level memory management routines use UMA. */ - if (flags & M_NOVM) - break; + if ((flags & M_NOVM) == 0) { + slab = keg_alloc_slab(keg, zone, domain, flags, aflags); + if (slab != NULL) + return (slab); + } - slab = keg_alloc_slab(keg, zone, domain, flags, aflags); - if (slab != NULL) - return (slab); - if (!rr && (flags & M_WAITOK) == 0) - break; - if (rr && vm_domainset_iter_policy(&di, &domain) != 0) { + if (!rr) { + if ((flags & M_USE_RESERVE) != 0) { + /* + * Drain reserves from other domains before + * giving up or sleeping. It may be useful to + * support per-domain reserves eventually. + */ + rdomain = UMA_ANYDOMAIN; + goto restart; + } + if ((flags & M_WAITOK) == 0) + break; + vm_wait_domain(domain); + } else if (vm_domainset_iter_policy(&di, &domain) != 0) { if ((flags & M_WAITOK) != 0) { vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask, 0); goto restart; From nobody Mon Nov 15 14:07:38 2021 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 ECD111896A38; Mon, 15 Nov 2021 14:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ht9xk4Rsqz4bvk; Mon, 15 Nov 2021 14:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C3071A8E4; Mon, 15 Nov 2021 14:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AFE7cPE006294; Mon, 15 Nov 2021 14:07:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AFE7cRE006293; Mon, 15 Nov 2021 14:07:38 GMT (envelope-from git) Date: Mon, 15 Nov 2021 14:07:38 GMT Message-Id: <202111151407.1AFE7cRE006293@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: ce9c3848ff36 - stable/13 - uma: Fix handling of reserves in zone_import() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: ce9c3848ff369467749f59fd24f8b9f1241e725c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ce9c3848ff369467749f59fd24f8b9f1241e725c commit ce9c3848ff369467749f59fd24f8b9f1241e725c Author: Mark Johnston AuthorDate: 2021-11-01 13:27:52 +0000 Commit: Mark Johnston CommitDate: 2021-11-15 14:07:10 +0000 uma: Fix handling of reserves in zone_import() Kegs with no items reserved have uk_reserve = 0. So the check keg->uk_reserve >= dom->ud_free_items will be true once all slabs are depleted. Then, rather than go and allocate a fresh slab, we return to the cache layer. The intent was to do this only when the keg actually has a reserve, so modify the check to verify this first. Another approach would be to make uk_reserve signed and set it to -1 until uma_zone_reserve() is called, but this requires a few casts elsewhere. Fixes: 1b2dcc8c54a8 ("uma: Avoid depleting keg reserves when filling a bucket") Sponsored by: The FreeBSD Foundation (cherry picked from commit 7585c5db25b700d19baebd7afd7a1b2e03c29cda) --- sys/vm/uma_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 1fb066d71762..3888ff26cca8 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3982,7 +3982,8 @@ zone_import(void *arg, void **bucket, int max, int domain, int flags) dom = &keg->uk_domain[slab->us_domain]; do { bucket[i++] = slab_alloc_item(keg, slab); - if (dom->ud_free_items <= keg->uk_reserve) { + if (keg->uk_reserve > 0 && + dom->ud_free_items <= keg->uk_reserve) { /* * Avoid depleting the reserve after a * successful item allocation, even if From nobody Mon Nov 15 15:16:46 2021 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 42026189F529; Mon, 15 Nov 2021 15:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtCTW12Mhz3HMX; Mon, 15 Nov 2021 15:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03BB71C11D; Mon, 15 Nov 2021 15:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AFFGkMd099416; Mon, 15 Nov 2021 15:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AFFGkTB099415; Mon, 15 Nov 2021 15:16:46 GMT (envelope-from git) Date: Mon, 15 Nov 2021 15:16:46 GMT Message-Id: <202111151516.1AFFGkTB099415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 5c2e6d9610f1 - stable/13 - hwpmc: initialize arm64 counter/interrupt state 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c2e6d9610f1b3f1d7c5d69b925212a7b1fd9391 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=5c2e6d9610f1b3f1d7c5d69b925212a7b1fd9391 commit 5c2e6d9610f1b3f1d7c5d69b925212a7b1fd9391 Author: Mitchell Horne AuthorDate: 2021-11-08 19:33:25 +0000 Commit: Mitchell Horne CommitDate: 2021-11-15 15:13:50 +0000 hwpmc: initialize arm64 counter/interrupt state Performance counters and overflow interrupts are assumed to be disabled by default, but this is not guaranteed. Ensure we disable both during per-cpu initialization, before enabling the PMU. Otherwise, some systems (such as the Ampere eMAG) would experience an interrupt storm upon loading the hwpmc module. Reviewed by: br MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32854 (cherry picked from commit b826cc3caf6abc6a5d1926bd478b464938d45697) --- sys/dev/hwpmc/hwpmc_arm64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index 8a149f5f508f..ea433ca191d2 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -484,6 +484,16 @@ arm64_pcpu_init(struct pmc_mdep *md, int cpu) pc->pc_hwpmcs[i + first_ri] = phw; } + /* + * Disable all counters and overflow interrupts. Upon reset they are in + * an undefined state. + * + * Don't issue an isb here, just wait for the one in arm64_pmcr_write() + * to make the writes visible. + */ + WRITE_SPECIALREG(pmcntenclr_el0, 0xffffffff); + WRITE_SPECIALREG(pmintenclr_el1, 0xffffffff); + /* Enable unit */ pmcr = arm64_pmcr_read(); pmcr |= PMCR_E; From nobody Mon Nov 15 15:22:55 2021 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 8F46D180BB57; Mon, 15 Nov 2021 15:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtCcb3XlCz3LW5; Mon, 15 Nov 2021 15:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A7651C1D2; Mon, 15 Nov 2021 15:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AFFMt0G012938; Mon, 15 Nov 2021 15:22:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AFFMtsf012937; Mon, 15 Nov 2021 15:22:55 GMT (envelope-from git) Date: Mon, 15 Nov 2021 15:22:55 GMT Message-Id: <202111151522.1AFFMtsf012937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: c8a4404da737 - stable/12 - hwpmc: initialize arm64 counter/interrupt state 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c8a4404da737ea7e859287094de38953a84bdd68 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c8a4404da737ea7e859287094de38953a84bdd68 commit c8a4404da737ea7e859287094de38953a84bdd68 Author: Mitchell Horne AuthorDate: 2021-11-08 19:33:25 +0000 Commit: Mitchell Horne CommitDate: 2021-11-15 15:22:35 +0000 hwpmc: initialize arm64 counter/interrupt state Performance counters and overflow interrupts are assumed to be disabled by default, but this is not guaranteed. Ensure we disable both during per-cpu initialization, before enabling the PMU. Otherwise, some systems (such as the Ampere eMAG) would experience an interrupt storm upon loading the hwpmc module. Reviewed by: br MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32854 (cherry picked from commit b826cc3caf6abc6a5d1926bd478b464938d45697) --- sys/dev/hwpmc/hwpmc_arm64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index af028d3fce94..919f588afff2 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -454,6 +454,16 @@ arm64_pcpu_init(struct pmc_mdep *md, int cpu) pc->pc_hwpmcs[i + first_ri] = phw; } + /* + * Disable all counters and overflow interrupts. Upon reset they are in + * an undefined state. + * + * Don't issue an isb here, just wait for the one in arm64_pmcr_write() + * to make the writes visible. + */ + WRITE_SPECIALREG(pmcntenclr_el0, 0xffffffff); + WRITE_SPECIALREG(pmintenclr_el1, 0xffffffff); + /* Enable unit */ pmcr = arm64_pmcr_read(); pmcr |= PMCR_E; From nobody Mon Nov 15 18:11:56 2021 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 B3D9A188F698; Mon, 15 Nov 2021 18:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtHMc4Jmvz3PD7; Mon, 15 Nov 2021 18:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 739311E6D0; Mon, 15 Nov 2021 18:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AFIBunp039663; Mon, 15 Nov 2021 18:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AFIBuiY039662; Mon, 15 Nov 2021 18:11:56 GMT (envelope-from git) Date: Mon, 15 Nov 2021 18:11:56 GMT Message-Id: <202111151811.1AFIBuiY039662@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: ab9866cc793d - stable/13 - pci: Implement pci_bar_enabled() for SR-IOV VFs 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: ab9866cc793ddd454dca4e85caa8475bde1baaa7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ab9866cc793ddd454dca4e85caa8475bde1baaa7 commit ab9866cc793ddd454dca4e85caa8475bde1baaa7 Author: Mark Johnston AuthorDate: 2021-11-09 18:07:57 +0000 Commit: Mark Johnston CommitDate: 2021-11-15 18:11:52 +0000 pci: Implement pci_bar_enabled() for SR-IOV VFs In a VF's configuration space, "memory space enable" is hard-wired to 0, so the existing implementation always returns false. We need to read the SR-IOV control register from the PF device to get the value of the MSE bit. Fix pci_bar_enabled() to read this register instead for VFs. I don't see any way to access the PF's config space without a backpointer in the pci device ivars, so I added one. This fixes a regression where bhyve(8) fails to map the MSI-X table after commit 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough") when a VF is passed through, since with that commit we use PCIOCBARMMAP to map the table and that ioctl always fails for VFs without this change. As a bonus, pciconf(8) now correctly reports the enablement of BARs for VFs. Reported and tested by: Raúl Muñoz Reviewed by: rstone, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 1f960e646b7280795766fdaa183e3b9bd4cea345) --- sys/dev/pci/pci.c | 10 ++++++++++ sys/dev/pci/pci_iov.c | 1 + sys/dev/pci/pci_iov_private.h | 1 + 3 files changed, 12 insertions(+) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 530526adb7b3..4c79d9260fc0 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -3150,6 +3150,16 @@ pci_bar_enabled(device_t dev, struct pci_map *pm) if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg) && !(pm->pm_value & PCIM_BIOS_ENABLE)) return (0); +#ifdef PCI_IOV + if ((dinfo->cfg.flags & PCICFG_VF) != 0) { + struct pcicfg_iov *iov; + + iov = dinfo->cfg.iov; + cmd = pci_read_config(iov->iov_pf, + iov->iov_pos + PCIR_SRIOV_CTL, 2); + return ((cmd & PCIM_SRIOV_VF_MSE) != 0); + } +#endif cmd = pci_read_config(dev, PCIR_COMMAND, 2); if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg) || PCI_BAR_MEM(pm->pm_value)) return ((cmd & PCIM_CMD_MEMEN) != 0); diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 6db2cf445843..f577640595a9 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -151,6 +151,7 @@ pci_iov_attach_method(device_t bus, device_t dev, nvlist_t *pf_schema, error = EBUSY; goto cleanup; } + iov->iov_pf = dev; iov->iov_pos = iov_pos; schema = pci_iov_build_schema(&pf_schema, &vf_schema); diff --git a/sys/dev/pci/pci_iov_private.h b/sys/dev/pci/pci_iov_private.h index 0d1dda871b44..be3456d4781f 100644 --- a/sys/dev/pci/pci_iov_private.h +++ b/sys/dev/pci/pci_iov_private.h @@ -37,6 +37,7 @@ struct pci_iov_bar { }; struct pcicfg_iov { + device_t iov_pf; struct cdev *iov_cdev; nvlist_t *iov_schema; From nobody Mon Nov 15 18:11:57 2021 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 DADB4188F784; Mon, 15 Nov 2021 18:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtHMd5PMBz3P35; Mon, 15 Nov 2021 18:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A49A1E900; Mon, 15 Nov 2021 18:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AFIBvuj039687; Mon, 15 Nov 2021 18:11:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AFIBvjs039686; Mon, 15 Nov 2021 18:11:57 GMT (envelope-from git) Date: Mon, 15 Nov 2021 18:11:57 GMT Message-Id: <202111151811.1AFIBvjs039686@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: e002d882ac20 - stable/13 - bhyve: Map the MSI-X table unconditionally for passthrough 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e002d882ac2094047a8d5a8bef9252e5006b5828 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e002d882ac2094047a8d5a8bef9252e5006b5828 commit e002d882ac2094047a8d5a8bef9252e5006b5828 Author: Mark Johnston AuthorDate: 2021-10-09 15:36:19 +0000 Commit: Mark Johnston CommitDate: 2021-11-15 18:11:52 +0000 bhyve: Map the MSI-X table unconditionally for passthrough It is possible for the PBA to reside in the same page as the MSI-X table. And, while devices are not supposed to do this, at least some Intel wifi devices place registers in a page shared with the MSI-X table. To handle the first case we currently map the PBA page using /dev/mem, and the second case is not handled. Kill two birds with one stone: map the MSI-X table BAR using the PCIOCBARMMAP ioctl instead of /dev/mem, and map the entire table so that accesses beyond the bounds of the table can be emulated. Regions of the BAR not containing the table are left unmapped. PR: 251046 Reviewed by: bz, grehan, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 7fa2335347362378322a4d27cb40f6e6cd5dd0fb) --- usr.sbin/bhyve/pci_emul.h | 4 +- usr.sbin/bhyve/pci_passthru.c | 186 +++++++++++++++++------------------------- 2 files changed, 76 insertions(+), 114 deletions(-) diff --git a/usr.sbin/bhyve/pci_emul.h b/usr.sbin/bhyve/pci_emul.h index 031a6113fac4..5b6a17119960 100644 --- a/usr.sbin/bhyve/pci_emul.h +++ b/usr.sbin/bhyve/pci_emul.h @@ -157,8 +157,8 @@ struct pci_devinst { int pba_size; int function_mask; struct msix_table_entry *table; /* allocated at runtime */ - void *pba_page; - int pba_page_offset; + uint8_t *mapped_addr; + size_t mapped_size; } pi_msix; void *pi_arg; /* devemu-private data */ diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c index 2c6a2ebd8dd9..bf99c646c480 100644 --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -43,7 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include +#include #ifndef WITHOUT_CAPSICUM #include @@ -69,17 +72,12 @@ __FBSDID("$FreeBSD$"); #define _PATH_DEVPCI "/dev/pci" #endif -#ifndef _PATH_MEM -#define _PATH_MEM "/dev/mem" -#endif - #define LEGACY_SUPPORT 1 #define MSIX_TABLE_COUNT(ctrl) (((ctrl) & PCIM_MSIXCTRL_TABLE_SIZE) + 1) #define MSIX_CAPLEN 12 static int pcifd = -1; -static int memfd = -1; struct passthru_softc { struct pci_devinst *psc_pi; @@ -290,30 +288,30 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size) uint64_t *src64; uint64_t data; size_t entry_offset; - int index; + uint32_t table_offset; + int index, table_count; pi = sc->psc_pi; - if (pi->pi_msix.pba_page != NULL && offset >= pi->pi_msix.pba_offset && - offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) { - switch(size) { + + table_offset = pi->pi_msix.table_offset; + table_count = pi->pi_msix.table_count; + if (offset < table_offset || + offset >= table_offset + table_count * MSIX_TABLE_ENTRY_SIZE) { + switch (size) { case 1: - src8 = (uint8_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src8 = (uint8_t *)(pi->pi_msix.mapped_addr + offset); data = *src8; break; case 2: - src16 = (uint16_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src16 = (uint16_t *)(pi->pi_msix.mapped_addr + offset); data = *src16; break; case 4: - src32 = (uint32_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src32 = (uint32_t *)(pi->pi_msix.mapped_addr + offset); data = *src32; break; case 8: - src64 = (uint64_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src64 = (uint64_t *)(pi->pi_msix.mapped_addr + offset); data = *src64; break; default: @@ -322,32 +320,28 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size) return (data); } - if (offset < pi->pi_msix.table_offset) - return (-1); - - offset -= pi->pi_msix.table_offset; + offset -= table_offset; index = offset / MSIX_TABLE_ENTRY_SIZE; - if (index >= pi->pi_msix.table_count) - return (-1); + assert(index < table_count); entry = &pi->pi_msix.table[index]; entry_offset = offset % MSIX_TABLE_ENTRY_SIZE; - switch(size) { + switch (size) { case 1: - src8 = (uint8_t *)((void *)entry + entry_offset); + src8 = (uint8_t *)((uint8_t *)entry + entry_offset); data = *src8; break; case 2: - src16 = (uint16_t *)((void *)entry + entry_offset); + src16 = (uint16_t *)((uint8_t *)entry + entry_offset); data = *src16; break; case 4: - src32 = (uint32_t *)((void *)entry + entry_offset); + src32 = (uint32_t *)((uint8_t *)entry + entry_offset); data = *src32; break; case 8: - src64 = (uint64_t *)((void *)entry + entry_offset); + src64 = (uint64_t *)((uint8_t *)entry + entry_offset); data = *src64; break; default: @@ -368,46 +362,39 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc, uint32_t *dest32; uint64_t *dest64; size_t entry_offset; - uint32_t vector_control; - int index; + uint32_t table_offset, vector_control; + int index, table_count; pi = sc->psc_pi; - if (pi->pi_msix.pba_page != NULL && offset >= pi->pi_msix.pba_offset && - offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) { - switch(size) { + + table_offset = pi->pi_msix.table_offset; + table_count = pi->pi_msix.table_count; + if (offset < table_offset || + offset >= table_offset + table_count * MSIX_TABLE_ENTRY_SIZE) { + switch (size) { case 1: - dest8 = (uint8_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest8 = (uint8_t *)(pi->pi_msix.mapped_addr + offset); *dest8 = data; break; case 2: - dest16 = (uint16_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest16 = (uint16_t *)(pi->pi_msix.mapped_addr + offset); *dest16 = data; break; case 4: - dest32 = (uint32_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest32 = (uint32_t *)(pi->pi_msix.mapped_addr + offset); *dest32 = data; break; case 8: - dest64 = (uint64_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest64 = (uint64_t *)(pi->pi_msix.mapped_addr + offset); *dest64 = data; break; - default: - break; } return; } - if (offset < pi->pi_msix.table_offset) - return; - - offset -= pi->pi_msix.table_offset; + offset -= table_offset; index = offset / MSIX_TABLE_ENTRY_SIZE; - if (index >= pi->pi_msix.table_count) - return; + assert(index < table_count); entry = &pi->pi_msix.table[index]; entry_offset = offset % MSIX_TABLE_ENTRY_SIZE; @@ -435,13 +422,10 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc, static int init_msix_table(struct vmctx *ctx, struct passthru_softc *sc, uint64_t base) { + struct pci_devinst *pi = sc->psc_pi; + struct pci_bar_mmap pbm; int b, s, f; - int idx; - size_t remaining; uint32_t table_size, table_offset; - uint32_t pba_size, pba_offset; - vm_paddr_t start; - struct pci_devinst *pi = sc->psc_pi; assert(pci_msix_table_bar(pi) >= 0 && pci_msix_pba_bar(pi) >= 0); @@ -449,55 +433,48 @@ init_msix_table(struct vmctx *ctx, struct passthru_softc *sc, uint64_t base) s = sc->psc_sel.pc_dev; f = sc->psc_sel.pc_func; - /* - * If the MSI-X table BAR maps memory intended for - * other uses, it is at least assured that the table - * either resides in its own page within the region, - * or it resides in a page shared with only the PBA. + /* + * Map the region of the BAR containing the MSI-X table. This is + * necessary for two reasons: + * 1. The PBA may reside in the first or last page containing the MSI-X + * table. + * 2. While PCI devices are not supposed to use the page(s) containing + * the MSI-X table for other purposes, some do in practice. */ + memset(&pbm, 0, sizeof(pbm)); + pbm.pbm_sel = sc->psc_sel; + pbm.pbm_flags = PCIIO_BAR_MMAP_RW; + pbm.pbm_reg = PCIR_BAR(pi->pi_msix.pba_bar); + pbm.pbm_memattr = VM_MEMATTR_DEVICE; + + if (ioctl(pcifd, PCIOCBARMMAP, &pbm) != 0) { + warn("Failed to map MSI-X table BAR on %d/%d/%d", b, s, f); + return (-1); + } + assert(pbm.pbm_bar_off == 0); + pi->pi_msix.mapped_addr = (uint8_t *)(uintptr_t)pbm.pbm_map_base; + pi->pi_msix.mapped_size = pbm.pbm_map_length; + table_offset = rounddown2(pi->pi_msix.table_offset, 4096); table_size = pi->pi_msix.table_offset - table_offset; table_size += pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; table_size = roundup2(table_size, 4096); - idx = pi->pi_msix.table_bar; - start = pi->pi_bar[idx].addr; - remaining = pi->pi_bar[idx].size; - - if (pi->pi_msix.pba_bar == pi->pi_msix.table_bar) { - pba_offset = pi->pi_msix.pba_offset; - pba_size = pi->pi_msix.pba_size; - if (pba_offset >= table_offset + table_size || - table_offset >= pba_offset + pba_size) { - /* - * If the PBA does not share a page with the MSI-x - * tables, no PBA emulation is required. - */ - pi->pi_msix.pba_page = NULL; - pi->pi_msix.pba_page_offset = 0; - } else { - /* - * The PBA overlaps with either the first or last - * page of the MSI-X table region. Map the - * appropriate page. - */ - if (pba_offset <= table_offset) - pi->pi_msix.pba_page_offset = table_offset; - else - pi->pi_msix.pba_page_offset = table_offset + - table_size - 4096; - pi->pi_msix.pba_page = mmap(NULL, 4096, PROT_READ | - PROT_WRITE, MAP_SHARED, memfd, start + - pi->pi_msix.pba_page_offset); - if (pi->pi_msix.pba_page == MAP_FAILED) { - warn( - "Failed to map PBA page for MSI-X on %d/%d/%d", - b, s, f); - return (-1); - } - } - } + /* + * Unmap any pages not covered by the table, we do not need to emulate + * accesses to them. Avoid releasing address space to help ensure that + * a buggy out-of-bounds access causes a crash. + */ + if (table_offset != 0) + if (mprotect(pi->pi_msix.mapped_addr, table_offset, + PROT_NONE) != 0) + warn("Failed to unmap MSI-X table BAR region"); + if (table_offset + table_size != pi->pi_msix.mapped_size) + if (mprotect(pi->pi_msix.mapped_addr, + pi->pi_msix.mapped_size - (table_offset + table_size), + PROT_NONE) != 0) + warn("Failed to unmap MSI-X table BAR region"); return (0); } @@ -645,7 +622,7 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) #ifndef WITHOUT_CAPSICUM cap_rights_t rights; cap_ioctl_t pci_ioctls[] = - { PCIOCREAD, PCIOCWRITE, PCIOCGETBAR, PCIOCBARIO }; + { PCIOCREAD, PCIOCWRITE, PCIOCGETBAR, PCIOCBARIO, PCIOCBARMMAP }; #endif sc = NULL; @@ -676,21 +653,6 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif - if (memfd < 0) { - memfd = open(_PATH_MEM, O_RDWR, 0); - if (memfd < 0) { - warn("failed to open %s", _PATH_MEM); - return (error); - } - } - -#ifndef WITHOUT_CAPSICUM - cap_rights_clear(&rights, CAP_IOCTL); - cap_rights_set(&rights, CAP_MMAP_RW); - if (caph_rights_limit(memfd, &rights) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); -#endif - #define GET_INT_CONFIG(var, name) do { \ value = get_config_value_node(nvl, name); \ if (value == NULL) { \ From nobody Mon Nov 15 18:11:58 2021 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 4CDAF188F69D; Mon, 15 Nov 2021 18:11:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtHMf6f3nz3P0X; Mon, 15 Nov 2021 18:11:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB0D31E784; Mon, 15 Nov 2021 18:11:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AFIBwSR039711; Mon, 15 Nov 2021 18:11:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AFIBwhl039710; Mon, 15 Nov 2021 18:11:58 GMT (envelope-from git) Date: Mon, 15 Nov 2021 18:11:58 GMT Message-Id: <202111151811.1AFIBwhl039710@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: de957de09785 - stable/13 - bhyve: Fix the WITH_BHYVE_SNAPSHOT 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: de957de097857fabb69a59a9ba36276c5e735de5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=de957de097857fabb69a59a9ba36276c5e735de5 commit de957de097857fabb69a59a9ba36276c5e735de5 Author: Mark Johnston AuthorDate: 2021-10-16 17:13:26 +0000 Commit: Mark Johnston CommitDate: 2021-11-15 18:11:53 +0000 bhyve: Fix the WITH_BHYVE_SNAPSHOT build Note, this breaks compatibility with snapshots generated by older builds of bhyve(8). Fixes: 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough") Reported by: Greg V Reviewed by: grehan, bz Sponsored by: The FreeBSD Foundation (cherry picked from commit 77bc75c7abd29de69d3ef35b66c23c7baba95094) --- usr.sbin/bhyve/pci_emul.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index 113ac5121238..d155029d269f 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -2079,7 +2079,6 @@ pci_snapshot_pci_dev(struct vm_snapshot_meta *meta) SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.pba_offset, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.pba_size, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.function_mask, meta, ret, done); - SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.pba_page_offset, meta, ret, done); SNAPSHOT_BUF_OR_LEAVE(pi->pi_cfgdata, sizeof(pi->pi_cfgdata), meta, ret, done); From nobody Tue Nov 16 00:45:59 2021 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 EDD931857D7F; Tue, 16 Nov 2021 00:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtS6H43G1z4ZBm; Tue, 16 Nov 2021 00:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6714C23F07; Tue, 16 Nov 2021 00:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AG0jxaU060314; Tue, 16 Nov 2021 00:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AG0jx4d060313; Tue, 16 Nov 2021 00:45:59 GMT (envelope-from git) Date: Tue, 16 Nov 2021 00:45:59 GMT Message-Id: <202111160045.1AG0jx4d060313@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: 6c34f4cd2f9e - stable/13 - amd64/ia32/ia32_signal.c: Use ANSI C functions definitions 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6c34f4cd2f9e348416ef4addec9e4bc454653cdd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6c34f4cd2f9e348416ef4addec9e4bc454653cdd commit 6c34f4cd2f9e348416ef4addec9e4bc454653cdd Author: Konstantin Belousov AuthorDate: 2021-11-12 17:11:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-16 00:45:30 +0000 amd64/ia32/ia32_signal.c: Use ANSI C functions definitions (cherry picked from commit c5658876b416c1f8206bd8d269af85239e8467aa) --- sys/amd64/ia32/ia32_signal.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index 6c879eccfc77..52a9af0f64d2 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -742,15 +742,9 @@ ofreebsd32_sigreturn(struct thread *td, struct ofreebsd32_sigreturn_args *uap) #endif #ifdef COMPAT_FREEBSD4 -/* - * MPSAFE - */ int -freebsd4_freebsd32_sigreturn(td, uap) - struct thread *td; - struct freebsd4_freebsd32_sigreturn_args /* { - const struct freebsd4_freebsd32_ucontext *sigcntxp; - } */ *uap; +freebsd4_freebsd32_sigreturn(struct thread *td, + struct freebsd4_freebsd32_sigreturn_args *uap) { struct ia32_ucontext4 uc; struct trapframe *regs; @@ -816,15 +810,8 @@ freebsd4_freebsd32_sigreturn(td, uap) } #endif /* COMPAT_FREEBSD4 */ -/* - * MPSAFE - */ int -freebsd32_sigreturn(td, uap) - struct thread *td; - struct freebsd32_sigreturn_args /* { - const struct freebsd32_ucontext *sigcntxp; - } */ *uap; +freebsd32_sigreturn(struct thread *td, struct freebsd32_sigreturn_args *uap) { struct ia32_ucontext uc; struct trapframe *regs; From nobody Tue Nov 16 08:09:54 2021 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 180F71894387; Tue, 16 Nov 2021 08:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtdyW08F1z4n5m; Tue, 16 Nov 2021 08:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6A061B2E; Tue, 16 Nov 2021 08:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AG89s8C050623; Tue, 16 Nov 2021 08:09:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AG89sKE050622; Tue, 16 Nov 2021 08:09:54 GMT (envelope-from git) Date: Tue, 16 Nov 2021 08:09:54 GMT Message-Id: <202111160809.1AG89sKE050622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 7d95b0f32832 - stable/13 - snd_uaudio(4): Fix string index computations for iFeature. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7d95b0f32832c30e7191d6c3694025652de0cb1e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=7d95b0f32832c30e7191d6c3694025652de0cb1e commit 7d95b0f32832c30e7191d6c3694025652de0cb1e Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:07:36 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-16 08:09:09 +0000 snd_uaudio(4): Fix string index computations for iFeature. This allows the iFeature strings to be properly read by the snd_uaudio(4) driver, when parsing the audio feature unit descriptors. Submitted by: Zhichao1.Li@dell.com Sponsored by: NVIDIA Networking (cherry picked from commit 11f09b17fe2cf0b5489601aee548a06486f0b749) --- sys/dev/sound/usb/uaudio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 3a7d4189b9ef..bc5b0d04c020 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -3648,18 +3648,18 @@ uaudio_mixer_add_feature(struct uaudio_softc *sc, cmask |= uaudio_mixer_feature_get_bmaControls(d, chan); } - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); - i = d->bmaControls[d->bControlSize]; + i = d->bmaControls[nchan * d->bControlSize]; if (i == 0 || usbd_req_get_string_any(sc->sc_udev, NULL, MIX(sc).desc, sizeof(MIX(sc).desc), i) != 0) { MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 1; ctl <= LOUDNESS_CONTROL; ctl++) { fumask = FU_MASK(ctl); @@ -3782,9 +3782,6 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, for (chan = 1; chan < nchan; chan++) cmask |= UGETDW(d->bmaControls[chan]); - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); i = d->bmaControls[nchan][0]; @@ -3794,6 +3791,9 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 3; ctl != 0; ctl <<= 2) { mixernumber = uaudio20_mixer_determine_class(&iot[id]); From nobody Tue Nov 16 08:11:01 2021 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 19C1618945C6; Tue, 16 Nov 2021 08:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Htdzp0CF8z4nV1; Tue, 16 Nov 2021 08:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB7141D8D; Tue, 16 Nov 2021 08:11:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AG8B1j4059778; Tue, 16 Nov 2021 08:11:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AG8B1nQ059777; Tue, 16 Nov 2021 08:11:01 GMT (envelope-from git) Date: Tue, 16 Nov 2021 08:11:01 GMT Message-Id: <202111160811.1AG8B1nQ059777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 43a03be0bb50 - stable/12 - snd_uaudio(4): Fix string index computations for iFeature. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 43a03be0bb5070b445b1c16d17b1791d345ec5d0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=43a03be0bb5070b445b1c16d17b1791d345ec5d0 commit 43a03be0bb5070b445b1c16d17b1791d345ec5d0 Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:07:36 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-16 08:10:42 +0000 snd_uaudio(4): Fix string index computations for iFeature. This allows the iFeature strings to be properly read by the snd_uaudio(4) driver, when parsing the audio feature unit descriptors. Submitted by: Zhichao1.Li@dell.com Sponsored by: NVIDIA Networking (cherry picked from commit 11f09b17fe2cf0b5489601aee548a06486f0b749) --- sys/dev/sound/usb/uaudio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 221f4d3d1bd7..d620d5fd1cce 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -3666,18 +3666,18 @@ uaudio_mixer_add_feature(struct uaudio_softc *sc, cmask |= uaudio_mixer_feature_get_bmaControls(d, chan); } - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); - i = d->bmaControls[d->bControlSize]; + i = d->bmaControls[nchan * d->bControlSize]; if (i == 0 || usbd_req_get_string_any(sc->sc_udev, NULL, MIX(sc).desc, sizeof(MIX(sc).desc), i) != 0) { MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 1; ctl <= LOUDNESS_CONTROL; ctl++) { fumask = FU_MASK(ctl); @@ -3801,9 +3801,6 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, for (chan = 1; chan < nchan; chan++) cmask |= UGETDW(d->bmaControls[chan]); - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); i = d->bmaControls[nchan][0]; @@ -3813,6 +3810,9 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 3; ctl != 0; ctl <<= 2) { mixernumber = uaudio20_mixer_determine_class(&iot[id]); From nobody Tue Nov 16 08:15:33 2021 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 E179F18972F1; Tue, 16 Nov 2021 08:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Htf515yQ5z4qHs; Tue, 16 Nov 2021 08:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A61281CFB; Tue, 16 Nov 2021 08:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AG8FXbj063769; Tue, 16 Nov 2021 08:15:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AG8FXMk063768; Tue, 16 Nov 2021 08:15:33 GMT (envelope-from git) Date: Tue, 16 Nov 2021 08:15:33 GMT Message-Id: <202111160815.1AG8FXMk063768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 6511b6ed285d - stable/11 - snd_uaudio(4): Fix string index computations for iFeature. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 6511b6ed285d349f28452b6dbe0d4f46aff47956 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/11 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=6511b6ed285d349f28452b6dbe0d4f46aff47956 commit 6511b6ed285d349f28452b6dbe0d4f46aff47956 Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:07:36 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-16 08:15:14 +0000 snd_uaudio(4): Fix string index computations for iFeature. This allows the iFeature strings to be properly read by the snd_uaudio(4) driver, when parsing the audio feature unit descriptors. Submitted by: Zhichao1.Li@dell.com Sponsored by: NVIDIA Networking (cherry picked from commit 11f09b17fe2cf0b5489601aee548a06486f0b749) --- sys/dev/sound/usb/uaudio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index cd6037faaa0d..03356f6c06b3 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -3664,18 +3664,18 @@ uaudio_mixer_add_feature(struct uaudio_softc *sc, cmask |= uaudio_mixer_feature_get_bmaControls(d, chan); } - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); - i = d->bmaControls[d->bControlSize]; + i = d->bmaControls[nchan * d->bControlSize]; if (i == 0 || usbd_req_get_string_any(sc->sc_udev, NULL, MIX(sc).desc, sizeof(MIX(sc).desc), i) != 0) { MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 1; ctl <= LOUDNESS_CONTROL; ctl++) { fumask = FU_MASK(ctl); @@ -3799,9 +3799,6 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, for (chan = 1; chan < nchan; chan++) cmask |= UGETDW(d->bmaControls[chan]); - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); i = d->bmaControls[nchan][0]; @@ -3811,6 +3808,9 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 3; ctl != 0; ctl <<= 2) { mixernumber = uaudio20_mixer_determine_class(&iot[id]); From nobody Tue Nov 16 21:59:48 2021 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 E7E64188DAFC; Tue, 16 Nov 2021 21:59:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv0N46CK1z4gZ8; Tue, 16 Nov 2021 21:59:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0EB11543C; Tue, 16 Nov 2021 21:59:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AGLxm2Z059198; Tue, 16 Nov 2021 21:59:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AGLxmvo059197; Tue, 16 Nov 2021 21:59:48 GMT (envelope-from git) Date: Tue, 16 Nov 2021 21:59:48 GMT Message-Id: <202111162159.1AGLxmvo059197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Oskar Holmlund Subject: git: 09f907eb0cc0 - stable/12 - release: fix git clone command if /usr/ports does not exist 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oh X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 09f907eb0cc009a83b47225bf18222237b34aa44 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by oh: URL: https://cgit.FreeBSD.org/src/commit/?id=09f907eb0cc009a83b47225bf18222237b34aa44 commit 09f907eb0cc009a83b47225bf18222237b34aa44 Author: Oskar Holmlund AuthorDate: 2021-11-16 23:41:33 +0000 Commit: Oskar Holmlund CommitDate: 2021-11-16 23:41:33 +0000 release: fix git clone command if /usr/ports does not exist Approved by: manu (mentor) Reviewed by: gjb Differential revision: https://reviews.freebsd.org/D32995 --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 86e3592d068b..ef666689eca1 100755 --- a/release/release.sh +++ b/release/release.sh @@ -224,7 +224,7 @@ chroot_setup() { if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then git -C ${CHROOTDIR}/usr/ports pull -q else - git -C ${CHROOTDIR}/usr/ports -b ${PORTBRANCH} clone + git clone -b ${PORTBRANCH} ${GITROOT}/${GITPORTS} ${CHROOTDIR}/usr/ports fi fi From nobody Tue Nov 16 23:56:48 2021 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 457B91857AF3; Tue, 16 Nov 2021 23:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv2z41ZDmz3qNS; Tue, 16 Nov 2021 23:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15CCF16CF8; Tue, 16 Nov 2021 23:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AGNum6o019258; Tue, 16 Nov 2021 23:56:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AGNumOJ019257; Tue, 16 Nov 2021 23:56:48 GMT (envelope-from git) Date: Tue, 16 Nov 2021 23:56:48 GMT Message-Id: <202111162356.1AGNumOJ019257@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: fa8d8f299ba1 - stable/13 - nfscl: Use a smaller initial delay time for NFSERR_DELAY 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: fa8d8f299ba1eb2dcfd763e096e90dbc57066c57 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=fa8d8f299ba1eb2dcfd763e096e90dbc57066c57 commit fa8d8f299ba1eb2dcfd763e096e90dbc57066c57 Author: Rick Macklem AuthorDate: 2021-11-02 00:21:31 +0000 Commit: Rick Macklem CommitDate: 2021-11-16 23:52:17 +0000 nfscl: Use a smaller initial delay time for NFSERR_DELAY For NFS RPCs that receive a NFSERR_DELAY reply, the delay time is initially 1sec and then increases exponentially to NFS_TRYLATERDEL. It was found that this delay time is excessive for some NFSv4 servers, which work well with a 1msec delay. A 1sec delay resulted in very slow performance for Remove and Rename when delegations and pNFS were enabled. This patch decreases the initial delay time to 1msec. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit 5a95a6e8e4d9e947b3bb4b4755a7242e1ddd72e7) --- sys/fs/nfs/nfs_commonkrpc.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 423ddb52494f..2235f1077a03 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -107,6 +107,10 @@ static int nfs_reconnects; static int nfs3_jukebox_delay = 10; static int nfs_skip_wcc_data_onerr = 1; static int nfs_dsretries = 2; +static struct timespec nfs_trylater_max = { + .tv_sec = NFS_TRYLATERDEL, + .tv_nsec = 0, +}; SYSCTL_DECL(_vfs_nfs); @@ -584,12 +588,11 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, u_char *retsum, int toplevel, u_int64_t *xidp, struct nfsclsession *dssep) { uint32_t retseq, retval, slotseq, *tl; - time_t waituntil; int i = 0, j = 0, opcnt, set_sigset = 0, slot; int error = 0, usegssname = 0, secflavour = AUTH_SYS; int freeslot, maxslot, reterr, slotpos, timeo; u_int16_t procnum; - u_int nextconn, trylater_delay = 1; + u_int nextconn; struct nfs_feedback_arg nf; struct timeval timo; AUTH *auth; @@ -602,7 +605,11 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, struct nfsclsession *sep; uint8_t sessionid[NFSX_V4SESSIONID]; bool nextconn_set; + struct timespec trylater_delay, ts, waituntil; + /* Initially 1msec. */ + trylater_delay.tv_sec = 0; + trylater_delay.tv_nsec = 1000000; sep = dssep; if (xidp != NULL) *xidp = 0; @@ -1144,12 +1151,19 @@ tryagain: (nd->nd_repstat == NFSERR_DELAY && (nd->nd_flag & ND_NFSV4) == 0) || nd->nd_repstat == NFSERR_RESOURCE) { - if (trylater_delay > NFS_TRYLATERDEL) - trylater_delay = NFS_TRYLATERDEL; - waituntil = NFSD_MONOSEC + trylater_delay; - while (NFSD_MONOSEC < waituntil) - (void) nfs_catnap(PZERO, 0, "nfstry"); - trylater_delay *= 2; + /* Clip at NFS_TRYLATERDEL. */ + if (timespeccmp(&trylater_delay, + &nfs_trylater_max, >)) + trylater_delay = nfs_trylater_max; + getnanouptime(&waituntil); + timespecadd(&waituntil, &trylater_delay, + &waituntil); + do { + nfs_catnap(PZERO, 0, "nfstry"); + getnanouptime(&ts); + } while (timespeccmp(&ts, &waituntil, <)); + timespecadd(&trylater_delay, &trylater_delay, + &trylater_delay); /* Double each time. */ if (slot != -1) { mtx_lock(&sep->nfsess_mtx); sep->nfsess_slotseq[slot]++; From nobody Wed Nov 17 01:21:59 2021 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 09ABD1856FCF; Wed, 17 Nov 2021 01:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv4sM6KRWz4l2h; Wed, 17 Nov 2021 01:21:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6F791821F; Wed, 17 Nov 2021 01:21:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH1LxL7038882; Wed, 17 Nov 2021 01:21:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH1LxO7038881; Wed, 17 Nov 2021 01:21:59 GMT (envelope-from git) Date: Wed, 17 Nov 2021 01:21:59 GMT Message-Id: <202111170121.1AH1LxO7038881@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: 6fc80c13284f - stable/13 - nfscl: Check for a forced dismount in nfscl_getref() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6fc80c13284fd3c7e53a273a7ef001e66fe7f7be Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6fc80c13284fd3c7e53a273a7ef001e66fe7f7be commit 6fc80c13284fd3c7e53a273a7ef001e66fe7f7be Author: Rick Macklem AuthorDate: 2021-11-03 00:28:13 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 01:18:34 +0000 nfscl: Check for a forced dismount in nfscl_getref() The nfscl_getref() function is called within nfscl_doiods() when the NFSv4.1/4.2 pNFS client is doing I/O on a DS. As such, nfscl_getref() needs to check for a forced dismount. This patch adds that check. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit 331883a2f2e9ae5567085e4cd3a7ae3db2a2b022) --- sys/fs/nfsclient/nfs_clstate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index f1d661e7c90a..51f901bf14fc 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -4909,6 +4909,7 @@ int nfscl_getref(struct nfsmount *nmp) { struct nfsclclient *clp; + int ret; NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); @@ -4916,9 +4917,12 @@ nfscl_getref(struct nfsmount *nmp) NFSUNLOCKCLSTATE(); return (0); } - nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, NULL); + nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, nmp->nm_mountp); + ret = 1; + if (NFSCL_FORCEDISM(nmp->nm_mountp)) + ret = 0; NFSUNLOCKCLSTATE(); - return (1); + return (ret); } /* From nobody Wed Nov 17 01:23:46 2021 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 CB8C21857803; Wed, 17 Nov 2021 01:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv4vQ54ZGz4lgt; Wed, 17 Nov 2021 01:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E11318488; Wed, 17 Nov 2021 01:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH1Nk4Y039122; Wed, 17 Nov 2021 01:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH1Nk3L039121; Wed, 17 Nov 2021 01:23:46 GMT (envelope-from git) Date: Wed, 17 Nov 2021 01:23:46 GMT Message-Id: <202111170123.1AH1Nk3L039121@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: 4a03ae8d17dd - stable/13 - nfscl: Fix use after free for forced dismount 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 4a03ae8d17ddf3d3b57ca281000fd98e200b92cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4a03ae8d17ddf3d3b57ca281000fd98e200b92cc commit 4a03ae8d17ddf3d3b57ca281000fd98e200b92cc Author: Rick Macklem AuthorDate: 2021-11-03 19:15:40 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 01:20:01 +0000 nfscl: Fix use after free for forced dismount When a forced dismount is done and delegations are being issued by the server (disabled by default for FreeBSD servers), the delegation structure is free'd before the loop calling vflush(). This could result in a use after free of the delegation structure. This patch changes the code so that the delegation structures are not free'd until after the vflush() loop for forced dismounts. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit 441222585968517c595ef7f39e5c71a42d238acd) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clstate.c | 16 +++++++++++----- sys/fs/nfsclient/nfs_clvfsops.c | 13 +++++++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 44aedec09a96..b45143067c46 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -592,7 +592,7 @@ void nfscl_lockrelease(struct nfscllockowner *, int, int); void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t); void nfscl_filllockowner(void *, u_int8_t *, int); void nfscl_freeopen(struct nfsclopen *, int, bool); -void nfscl_umount(struct nfsmount *, NFSPROC_T *); +void nfscl_umount(struct nfsmount *, NFSPROC_T *, struct nfscldeleghead *); void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *); void nfscl_initiate_recovery(struct nfsclclient *); int nfscl_hasexpired(struct nfsclclient *, u_int32_t, NFSPROC_T *); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 51f901bf14fc..4392ed6cbcb2 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -119,7 +119,8 @@ static void nfscl_insertlock(struct nfscllockowner *, struct nfscllock *, struct nfscllock *, int); static int nfscl_updatelock(struct nfscllockowner *, struct nfscllock **, struct nfscllock **, int); -static void nfscl_delegreturnall(struct nfsclclient *, NFSPROC_T *); +static void nfscl_delegreturnall(struct nfsclclient *, NFSPROC_T *, + struct nfscldeleghead *); static u_int32_t nfscl_nextcbident(void); static mount_t nfscl_getmnt(int, uint8_t *, u_int32_t, struct nfsclclient **); static struct nfsclclient *nfscl_getclnt(u_int32_t); @@ -1987,7 +1988,7 @@ static int fake_global; /* Used to force visibility of MNTK_UNMOUNTF */ * Called from nfs umount to free up the clientid. */ void -nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p) +nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p, struct nfscldeleghead *dhp) { struct nfsclclient *clp; struct ucred *cred; @@ -2049,7 +2050,7 @@ nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p) * the server throws it away? */ LIST_REMOVE(clp, nfsc_list); - nfscl_delegreturnall(clp, p); + nfscl_delegreturnall(clp, p, dhp); cred = newnfs_getcred(); if (NFSHASNFSV4N(nmp)) { (void)nfsrpc_destroysession(nmp, clp, cred, p); @@ -3440,7 +3441,8 @@ lookformore: * (Must be called with client sleep lock.) */ static void -nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p) +nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p, + struct nfscldeleghead *dhp) { struct nfscldeleg *dp, *ndp; struct ucred *cred; @@ -3449,7 +3451,11 @@ nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p) TAILQ_FOREACH_SAFE(dp, &clp->nfsc_deleg, nfsdl_list, ndp) { nfscl_cleandeleg(dp); (void) nfscl_trydelegreturn(dp, cred, clp->nfsc_nmp, p); - nfscl_freedeleg(&clp->nfsc_deleg, dp, true); + if (dhp != NULL) { + nfscl_freedeleg(&clp->nfsc_deleg, dp, false); + TAILQ_INSERT_HEAD(dhp, dp, nfsdl_list); + } else + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } NFSFREECRED(cred); } diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 57ac7f59f38d..55941170fc69 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1765,8 +1765,11 @@ nfs_unmount(struct mount *mp, int mntflags) struct nfsmount *nmp; int error, flags = 0, i, trycnt = 0; struct nfsclds *dsp, *tdsp; + struct nfscldeleg *dp, *ndp; + struct nfscldeleghead dh; td = curthread; + TAILQ_INIT(&dh); if (mntflags & MNT_FORCE) flags |= FORCECLOSE; @@ -1790,7 +1793,7 @@ nfs_unmount(struct mount *mp, int mntflags) if (error) goto out; /* For a forced close, get rid of the renew thread now */ - nfscl_umount(nmp, td); + nfscl_umount(nmp, td, &dh); } /* We hold 1 extra ref on the root vnode; see comment in mountnfs(). */ do { @@ -1805,7 +1808,7 @@ nfs_unmount(struct mount *mp, int mntflags) * We are now committed to the unmount. */ if ((mntflags & MNT_FORCE) == 0) - nfscl_umount(nmp, td); + nfscl_umount(nmp, td, NULL); else { mtx_lock(&nmp->nm_mtx); nmp->nm_privflag |= NFSMNTP_FORCEDISM; @@ -1847,6 +1850,12 @@ nfs_unmount(struct mount *mp, int mntflags) } free(nmp->nm_tlscertname, M_NEWNFSMNT); free(nmp, M_NEWNFSMNT); + + /* Free up the delegation structures for forced dismounts. */ + TAILQ_FOREACH_SAFE(dp, &dh, nfsdl_list, ndp) { + TAILQ_REMOVE(&dh, dp, nfsdl_list); + free(dp, M_NFSCLDELEG); + } out: return (error); } From nobody Wed Nov 17 01:28:55 2021 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 CF8A0188ABE6; Wed, 17 Nov 2021 01:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv51M5Tgjz4nNG; Wed, 17 Nov 2021 01:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C81118233; Wed, 17 Nov 2021 01:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH1StYg039571; Wed, 17 Nov 2021 01:28:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH1St4d039570; Wed, 17 Nov 2021 01:28:55 GMT (envelope-from git) Date: Wed, 17 Nov 2021 01:28:55 GMT Message-Id: <202111170128.1AH1St4d039570@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: 19f780169c43 - stable/13 - nfscl: Fix forced dismount from looping on commit 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 19f780169c43f017f4786ccf0b6f9a4637bd2c31 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=19f780169c43f017f4786ccf0b6f9a4637bd2c31 commit 19f780169c43f017f4786ccf0b6f9a4637bd2c31 Author: Rick Macklem AuthorDate: 2021-11-03 21:25:44 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 01:25:29 +0000 nfscl: Fix forced dismount from looping on commit When a forced dismount is in progress, it is possible to end up looping, retrying commits that fail. This patch fixes the problem by pretending that commits succeeded when a forced dismount is in prgress. (cherry picked from commit 6b67753488cb506f05694c5f6d2e74cf53497c54) --- sys/fs/nfsclient/nfs_clbio.c | 2 +- sys/fs/nfsclient/nfs_clvnops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 250d01d88948..73f559ad82f8 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1738,7 +1738,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td, off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff; retv = ncl_commit(vp, off, bp->b_dirtyend-bp->b_dirtyoff, bp->b_wcred, td); - if (retv == 0) { + if (NFSCL_FORCEDISM(vp->v_mount) || retv == 0) { bp->b_dirtyoff = bp->b_dirtyend = 0; bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK); bp->b_resid = 0; diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index eab6eed82830..cd8077e243ea 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3045,7 +3045,7 @@ again: for (i = 0; i < bvecpos; i++) { bp = bvec[i]; bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK); - if (retv) { + if (!NFSCL_FORCEDISM(vp->v_mount) && retv) { /* * Error, leave B_DELWRI intact */ From nobody Wed Nov 17 01:30:06 2021 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 7E313188AF64; Wed, 17 Nov 2021 01:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv52k36cVz4ntk; Wed, 17 Nov 2021 01:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BFA41848A; Wed, 17 Nov 2021 01:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH1U6XE042343; Wed, 17 Nov 2021 01:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH1U632042340; Wed, 17 Nov 2021 01:30:06 GMT (envelope-from git) Date: Wed, 17 Nov 2021 01:30:06 GMT Message-Id: <202111170130.1AH1U632042340@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: aff57157db04 - stable/13 - nfscl: Fix forced dismount when "nconnect" is specified 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: aff57157db04d67b2c8d2516021a17575a8c7041 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=aff57157db04d67b2c8d2516021a17575a8c7041 commit aff57157db04d67b2c8d2516021a17575a8c7041 Author: Rick Macklem AuthorDate: 2021-11-03 20:26:38 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 01:27:06 +0000 nfscl: Fix forced dismount when "nconnect" is specified When a forced dismount is done and the "nconnect" mount option was used, the additional connections must be closed. This patch does that. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit ae49051c033a2468af2f1f0079ecaf069b993245) --- sys/fs/nfs/nfs_commonkrpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 2235f1077a03..358d77fe5b30 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1298,9 +1298,13 @@ newnfs_nmcancelreqs(struct nfsmount *nmp) { struct nfsclds *dsp; struct __rpc_client *cl; + int i; if (nmp->nm_sockreq.nr_client != NULL) CLNT_CLOSE(nmp->nm_sockreq.nr_client); + for (i = 0; i < nmp->nm_aconnect; i++) + if (nmp->nm_aconn[i] != NULL) + CLNT_CLOSE(nmp->nm_aconn[i]); lookformore: NFSLOCKMNT(nmp); TAILQ_FOREACH(dsp, &nmp->nm_sess, nfsclds_list) { From nobody Wed Nov 17 01:36:54 2021 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 EAD46188ED08; Wed, 17 Nov 2021 01:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv5BZ6J6Fz4qh1; Wed, 17 Nov 2021 01:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1C2718424; Wed, 17 Nov 2021 01:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH1asOM052936; Wed, 17 Nov 2021 01:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH1asdm052935; Wed, 17 Nov 2021 01:36:54 GMT (envelope-from git) Date: Wed, 17 Nov 2021 01:36:54 GMT Message-Id: <202111170136.1AH1asdm052935@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: 00e9bc2d937f - stable/12 - nfscl: Fix forced dismount from looping on commit 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 00e9bc2d937fd8de6638c4a5669e78f04cd94110 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=00e9bc2d937fd8de6638c4a5669e78f04cd94110 commit 00e9bc2d937fd8de6638c4a5669e78f04cd94110 Author: Rick Macklem AuthorDate: 2021-11-03 21:25:44 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 01:33:19 +0000 nfscl: Fix forced dismount from looping on commit When a forced dismount is in progress, it is possible to end up looping, retrying commits that fail. This patch fixes the problem by pretending that commits succeeded when a forced dismount is in prgress. (cherry picked from commit 6b67753488cb506f05694c5f6d2e74cf53497c54) --- sys/fs/nfsclient/nfs_clbio.c | 2 +- sys/fs/nfsclient/nfs_clvnops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index c61cb1db9b95..52eb879caafb 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1726,7 +1726,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td, off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff; retv = ncl_commit(vp, off, bp->b_dirtyend-bp->b_dirtyoff, bp->b_wcred, td); - if (retv == 0) { + if (NFSCL_FORCEDISM(vp->v_mount) || retv == 0) { bp->b_dirtyoff = bp->b_dirtyend = 0; bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK); bp->b_resid = 0; diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 17859a16424b..ffa8e41ec578 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -2934,7 +2934,7 @@ again: for (i = 0; i < bvecpos; i++) { bp = bvec[i]; bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK); - if (retv) { + if (!NFSCL_FORCEDISM(vp->v_mount) && retv) { /* * Error, leave B_DELWRI intact */ From nobody Wed Nov 17 01:42:50 2021 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 EF2D5189205C; Wed, 17 Nov 2021 01:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv5KQ630vz4shQ; Wed, 17 Nov 2021 01:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AED5418823; Wed, 17 Nov 2021 01:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH1goiO066334; Wed, 17 Nov 2021 01:42:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH1gogk066333; Wed, 17 Nov 2021 01:42:50 GMT (envelope-from git) Date: Wed, 17 Nov 2021 01:42:50 GMT Message-Id: <202111170142.1AH1gogk066333@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: 8ca2474ce604 - stable/12 - nfscl: Check for a forced dismount in nfscl_getref() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 8ca2474ce6043d1536591495a0969a48df72a5cd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8ca2474ce6043d1536591495a0969a48df72a5cd commit 8ca2474ce6043d1536591495a0969a48df72a5cd Author: Rick Macklem AuthorDate: 2021-11-03 00:28:13 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 01:39:46 +0000 nfscl: Check for a forced dismount in nfscl_getref() The nfscl_getref() function is called within nfscl_doiods() when the NFSv4.1/4.2 pNFS client is doing I/O on a DS. As such, nfscl_getref() needs to check for a forced dismount. This patch adds that check. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit 331883a2f2e9ae5567085e4cd3a7ae3db2a2b022) --- sys/fs/nfsclient/nfs_clstate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 5f35e4e708e9..dd4eae5a0d2d 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -4707,6 +4707,7 @@ int nfscl_getref(struct nfsmount *nmp) { struct nfsclclient *clp; + int ret; NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); @@ -4714,9 +4715,12 @@ nfscl_getref(struct nfsmount *nmp) NFSUNLOCKCLSTATE(); return (0); } - nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, NULL); + nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, nmp->nm_mountp); + ret = 1; + if (NFSCL_FORCEDISM(nmp->nm_mountp)) + ret = 0; NFSUNLOCKCLSTATE(); - return (1); + return (ret); } /* From nobody Wed Nov 17 01:47:02 2021 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 C19ED1895537; Wed, 17 Nov 2021 01:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv5QG53nNz4vGs; Wed, 17 Nov 2021 01:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DD4118444; Wed, 17 Nov 2021 01:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH1l26Z066760; Wed, 17 Nov 2021 01:47:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH1l2hi066759; Wed, 17 Nov 2021 01:47:02 GMT (envelope-from git) Date: Wed, 17 Nov 2021 01:47:02 GMT Message-Id: <202111170147.1AH1l2hi066759@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: 04c2ce41e3fc - stable/12 - nfscl: Fix use after free for forced dismount 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 04c2ce41e3fcdef045eeea9f338f6b0eb547f64d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=04c2ce41e3fcdef045eeea9f338f6b0eb547f64d commit 04c2ce41e3fcdef045eeea9f338f6b0eb547f64d Author: Rick Macklem AuthorDate: 2021-11-03 19:15:40 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 01:43:30 +0000 nfscl: Fix use after free for forced dismount When a forced dismount is done and delegations are being issued by the server (disabled by default for FreeBSD servers), the delegation structure is free'd before the loop calling vflush(). This could result in a use after free of the delegation structure. This patch changes the code so that the delegation structures are not free'd until after the vflush() loop for forced dismounts. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit 441222585968517c595ef7f39e5c71a42d238acd) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clstate.c | 16 +++++++++++----- sys/fs/nfsclient/nfs_clvfsops.c | 13 +++++++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 5177a1c2c065..91914314970d 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -563,7 +563,7 @@ void nfscl_lockrelease(struct nfscllockowner *, int, int); void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t); void nfscl_filllockowner(void *, u_int8_t *, int); void nfscl_freeopen(struct nfsclopen *, int); -void nfscl_umount(struct nfsmount *, NFSPROC_T *); +void nfscl_umount(struct nfsmount *, NFSPROC_T *, struct nfscldeleghead *); void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *); void nfscl_initiate_recovery(struct nfsclclient *); int nfscl_hasexpired(struct nfsclclient *, u_int32_t, NFSPROC_T *); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index dd4eae5a0d2d..ad4f16df8be8 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -113,7 +113,8 @@ static void nfscl_insertlock(struct nfscllockowner *, struct nfscllock *, struct nfscllock *, int); static int nfscl_updatelock(struct nfscllockowner *, struct nfscllock **, struct nfscllock **, int); -static void nfscl_delegreturnall(struct nfsclclient *, NFSPROC_T *); +static void nfscl_delegreturnall(struct nfsclclient *, NFSPROC_T *, + struct nfscldeleghead *); static u_int32_t nfscl_nextcbident(void); static mount_t nfscl_getmnt(int, uint8_t *, u_int32_t, struct nfsclclient **); static struct nfsclclient *nfscl_getclnt(u_int32_t); @@ -1880,7 +1881,7 @@ static int fake_global; /* Used to force visibility of MNTK_UNMOUNTF */ * Called from nfs umount to free up the clientid. */ void -nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p) +nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p, struct nfscldeleghead *dhp) { struct nfsclclient *clp; struct ucred *cred; @@ -1942,7 +1943,7 @@ nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p) * the server throws it away? */ LIST_REMOVE(clp, nfsc_list); - nfscl_delegreturnall(clp, p); + nfscl_delegreturnall(clp, p, dhp); cred = newnfs_getcred(); if (NFSHASNFSV4N(nmp)) { (void)nfsrpc_destroysession(nmp, clp, cred, p); @@ -3280,7 +3281,8 @@ lookformore: * (Must be called with client sleep lock.) */ static void -nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p) +nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p, + struct nfscldeleghead *dhp) { struct nfscldeleg *dp, *ndp; struct ucred *cred; @@ -3289,7 +3291,11 @@ nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p) TAILQ_FOREACH_SAFE(dp, &clp->nfsc_deleg, nfsdl_list, ndp) { nfscl_cleandeleg(dp); (void) nfscl_trydelegreturn(dp, cred, clp->nfsc_nmp, p); - nfscl_freedeleg(&clp->nfsc_deleg, dp, true); + if (dhp != NULL) { + nfscl_freedeleg(&clp->nfsc_deleg, dp, false); + TAILQ_INSERT_HEAD(dhp, dp, nfsdl_list); + } else + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } NFSFREECRED(cred); } diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 49a08e3787b4..b839ad347696 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1666,8 +1666,11 @@ nfs_unmount(struct mount *mp, int mntflags) struct nfsmount *nmp; int error, flags = 0, i, trycnt = 0; struct nfsclds *dsp, *tdsp; + struct nfscldeleg *dp, *ndp; + struct nfscldeleghead dh; td = curthread; + TAILQ_INIT(&dh); if (mntflags & MNT_FORCE) flags |= FORCECLOSE; @@ -1691,7 +1694,7 @@ nfs_unmount(struct mount *mp, int mntflags) if (error) goto out; /* For a forced close, get rid of the renew thread now */ - nfscl_umount(nmp, td); + nfscl_umount(nmp, td, &dh); } /* We hold 1 extra ref on the root vnode; see comment in mountnfs(). */ do { @@ -1706,7 +1709,7 @@ nfs_unmount(struct mount *mp, int mntflags) * We are now committed to the unmount. */ if ((mntflags & MNT_FORCE) == 0) - nfscl_umount(nmp, td); + nfscl_umount(nmp, td, NULL); else { mtx_lock(&nmp->nm_mtx); nmp->nm_privflag |= NFSMNTP_FORCEDISM; @@ -1747,6 +1750,12 @@ nfs_unmount(struct mount *mp, int mntflags) nfscl_freenfsclds(dsp); } free(nmp, M_NEWNFSMNT); + + /* Free up the delegation structures for forced dismounts. */ + TAILQ_FOREACH_SAFE(dp, &dh, nfsdl_list, ndp) { + TAILQ_REMOVE(&dh, dp, nfsdl_list); + free(dp, M_NFSCLDELEG); + } out: return (error); } From nobody Wed Nov 17 14:27:27 2021 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 32B7B18502B9; Wed, 17 Nov 2021 14:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvQHh0vk3z4mCD; Wed, 17 Nov 2021 14:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F343122660; Wed, 17 Nov 2021 14:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AHERR6p079986; Wed, 17 Nov 2021 14:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AHERR3q079985; Wed, 17 Nov 2021 14:27:27 GMT (envelope-from git) Date: Wed, 17 Nov 2021 14:27:27 GMT Message-Id: <202111171427.1AHERR3q079985@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: 3a15ccadf87e - stable/13 - kasan: Disable validation of function parameters passed by value 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 3a15ccadf87ec55068656e6a87c8b19eea1fd390 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3a15ccadf87ec55068656e6a87c8b19eea1fd390 commit 3a15ccadf87ec55068656e6a87c8b19eea1fd390 Author: Mark Johnston AuthorDate: 2021-11-03 16:28:48 +0000 Commit: Mark Johnston CommitDate: 2021-11-17 14:27:16 +0000 kasan: Disable validation of function parameters passed by value It appears that the emitted code in the caller does not update shadow state for values passed on the stack to the callee, which it seemingly ought to do after pushing values on the stack and prior to the call itself. This leaves open a window where an interrupt handler can cause regions of the stack containing these values to be poisoned, resulting in rare false positive reports. This happens particularly in the amd64 TLB invalidation code, where we liberally pass cpuset_t's around by value. LLVM has a flag to disable validation of accesses of function parameters passed by value. Such validation is itself a relatively new feature. Turn it off for now. Reported by: pho, syzkaller Sponsored by: The FreeBSD Foundation (cherry picked from commit 2a519c3b14c29688e42d11f916655318b13c8409) --- sys/conf/kern.pre.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index daba78135c79..e57c187f940d 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -114,7 +114,8 @@ SAN_CFLAGS+= -fsanitize=kernel-address \ -mllvm -asan-instrument-dynamic-allocas=true \ -mllvm -asan-globals=true \ -mllvm -asan-use-after-scope=true \ - -mllvm -asan-instrumentation-with-call-threshold=0 + -mllvm -asan-instrumentation-with-call-threshold=0 \ + -mllvm -asan-instrument-byval=false .endif KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo From nobody Thu Nov 18 00:04:55 2021 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 750C2188B75E; Thu, 18 Nov 2021 00:04: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hvg602cN6z3qtD; Thu, 18 Nov 2021 00:04:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDDCA294A; Thu, 18 Nov 2021 00:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AI04tR4054864; Thu, 18 Nov 2021 00:04:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AI04to0054863; Thu, 18 Nov 2021 00:04:55 GMT (envelope-from git) Date: Thu, 18 Nov 2021 00:04:55 GMT Message-Id: <202111180004.1AI04to0054863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 53f057b3f46b - releng/12.3 - 12.3: update to RC2 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 53f057b3f46bb5ae9941591fba7066b3a8f53d4e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=53f057b3f46bb5ae9941591fba7066b3a8f53d4e commit 53f057b3f46bb5ae9941591fba7066b3a8f53d4e Author: Glen Barber AuthorDate: 2021-11-18 00:04:36 +0000 Commit: Glen Barber CommitDate: 2021-11-18 00:04:36 +0000 12.3: update to RC2 Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b6c4ba9491e6..e6ab77045930 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.3" -BRANCH="RC1" +BRANCH="RC2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Nov 18 00:21:30 2021 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 3CBAA1893FB1; Thu, 18 Nov 2021 00:21:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvgT70zjTz4SJ2; Thu, 18 Nov 2021 00:21:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02A4E2D8D; Thu, 18 Nov 2021 00:21:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AI0LULa080707; Thu, 18 Nov 2021 00:21:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AI0LUQO080706; Thu, 18 Nov 2021 00:21:30 GMT (envelope-from git) Date: Thu, 18 Nov 2021 00:21:30 GMT Message-Id: <202111180021.1AI0LUQO080706@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: ca826694e3b0 - stable/12 - nfscl: Fix a race between Setattr of size and Lookup 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: ca826694e3b08133b9e16744e1178863cfc4c16b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ca826694e3b08133b9e16744e1178863cfc4c16b commit ca826694e3b08133b9e16744e1178863cfc4c16b Author: Rick Macklem AuthorDate: 2021-10-30 23:35:02 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 23:07:11 +0000 nfscl: Fix a race between Setattr of size and Lookup PR#259071 provides a test program that fails for the NFS client. Testing with it, there appears to be a race between Lookup and VOPs like Setattr-of-size, where Lookup ends up loading stale attributes (including what might be the wrong file size) into the NFS vnode's attribute cache. The race occurs when the modifying VOP (which holds a lock on the vnode), blocks the acquisition of the vnode in Lookup, after the RPC (with now potentially stale attributes). Here's what seems to happen: Child Parent does stat(), which does VOP_LOOKUP(), doing the Lookup RPC with the directory vnode locked, acquiring file attributes valid at this point in time blocks waiting for locked file does ftruncate(), which vnode does VOP_SETATTR() of Size, changing the file's size while holding an exclusive lock on the file's vnode releases the vnode lock acquires file vnode and fills in now stale attributes including the old wrong Size does a read() which returns wrong data size This patch fixes the problem by saving a timestamp in the NFS vnode in the VOPs that modify the file (Setattr-of-size, Allocate). Then lookup/readdirplus compares that timestamp with the time just before starting the RPC after it has acquired the file's vnode. If the modifying RPC occurred during the Lookup, the attributes in the RPC reply are discarded, since they might be stale. With this patch the test program works as expected. Note that the test program does not fail on a July stable/12, although this race is in the NFS client code. I suspect a fairly recent change to the name caching code exposed this bug. PR: 259071 (cherry picked from commit 2be417843a04f25e631e99d5188eb2652b13d80d) --- sys/fs/nfsclient/nfs_clrpcops.c | 29 ++++++++++++++-- sys/fs/nfsclient/nfs_clvnops.c | 73 +++++++++++++++++++++++++++++++++++++---- sys/fs/nfsclient/nfsnode.h | 1 + 3 files changed, 93 insertions(+), 10 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 50f26a5d70c3..d6072bf2523e 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3308,7 +3308,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, nfsattrbit_t attrbits, dattrbits; size_t tresid; u_int32_t *tl2 = NULL, rderr; - struct timespec dctime; + struct timespec dctime, ts; + bool attr_ok; KASSERT(uiop->uio_iovcnt == 1 && (uio_uio_resid(uiop) & (DIRBLKSIZ - 1)) == 0, @@ -3488,6 +3489,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, *tl = txdr_unsigned(NFSV4OP_GETATTR); (void) nfsrv_putattrbit(nd, &dattrbits); } + nanouptime(&ts); error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); @@ -3641,6 +3643,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ncookie.lval[1]; if (nfhp != NULL) { + attr_ok = true; if (NFSRV_CMPFH(nfhp->nfh_fh, nfhp->nfh_len, dnp->n_fhp->nfh_fh, dnp->n_fhp->nfh_len)) { VREF(vp); @@ -3670,12 +3673,32 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, if (!error) { newvp = NFSTOV(np); unlocknewvp = 1; + /* + * If n_localmodtime >= time before RPC, + * then a file modification operation, + * such as VOP_SETATTR() of size, has + * occurred while the Lookup RPC and + * acquisition of the vnode happened. As + * such, the attributes might be stale, + * with possibly an incorrect size. + */ + NFSLOCKNODE(np); + if (timespecisset( + &np->n_localmodtime) && + timespeccmp(&np->n_localmodtime, + &ts, >=)) { + NFSCL_DEBUG(4, "nfsrpc_readdirplus:" + " localmod stale attributes\n"); + attr_ok = false; + } + NFSUNLOCKNODE(np); } } nfhp = NULL; if (newvp != NULLVP) { - error = nfscl_loadattrcache(&newvp, - &nfsva, NULL, NULL, 0, 0); + if (attr_ok) + error = nfscl_loadattrcache(&newvp, + &nfsva, NULL, NULL, 0, 0); if (error) { if (unlocknewvp) vput(newvp); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index ffa8e41ec578..b4cbde91c664 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -962,6 +962,7 @@ nfs_setattr(struct vop_setattr_args *ap) struct vattr *vap = ap->a_vap; int error = 0; u_quad_t tsize; + struct timespec ts; #ifndef nolint tsize = (u_quad_t)0; @@ -1053,11 +1054,18 @@ nfs_setattr(struct vop_setattr_args *ap) NFSUNLOCKNODE(np); } error = nfs_setattrrpc(vp, vap, ap->a_cred, td); - if (error && vap->va_size != VNOVAL) { - NFSLOCKNODE(np); - np->n_size = np->n_vattr.na_size = tsize; - vnode_pager_setsize(vp, tsize); - NFSUNLOCKNODE(np); + if (vap->va_size != VNOVAL) { + if (error == 0) { + nanouptime(&ts); + NFSLOCKNODE(np); + np->n_localmodtime = ts; + NFSUNLOCKNODE(np); + } else { + NFSLOCKNODE(np); + np->n_size = np->n_vattr.na_size = tsize; + vnode_pager_setsize(vp, tsize); + NFSUNLOCKNODE(np); + } } return (error); } @@ -1114,8 +1122,8 @@ nfs_lookup(struct vop_lookup_args *ap) struct nfsfh *nfhp; struct nfsvattr dnfsva, nfsva; struct vattr vattr; - struct timespec nctime; - + struct timespec nctime, ts; + *vpp = NULLVP; if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) @@ -1219,6 +1227,7 @@ nfs_lookup(struct vop_lookup_args *ap) error = 0; newvp = NULLVP; NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses); + nanouptime(&ts); error = nfsrpc_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_cred, td, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL); @@ -1285,6 +1294,22 @@ nfs_lookup(struct vop_lookup_args *ap) if (error) return (error); newvp = NFSTOV(np); + /* + * If n_localmodtime >= time before RPC, then + * a file modification operation, such as + * VOP_SETATTR() of size, has occurred while + * the Lookup RPC and acquisition of the vnode + * happened. As such, the attributes might + * be stale, with possibly an incorrect size. + */ + NFSLOCKNODE(np); + if (timespecisset(&np->n_localmodtime) && + timespeccmp(&np->n_localmodtime, &ts, >=)) { + NFSCL_DEBUG(4, "nfs_lookup: rename localmod " + "stale attributes\n"); + attrflag = 0; + } + NFSUNLOCKNODE(np); if (attrflag) (void) nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL, 0, 1); @@ -1344,6 +1369,22 @@ nfs_lookup(struct vop_lookup_args *ap) if (error) return (error); newvp = NFSTOV(np); + /* + * If n_localmodtime >= time before RPC, then + * a file modification operation, such as + * VOP_SETATTR() of size, has occurred while + * the Lookup RPC and acquisition of the vnode + * happened. As such, the attributes might + * be stale, with possibly an incorrect size. + */ + NFSLOCKNODE(np); + if (timespecisset(&np->n_localmodtime) && + timespeccmp(&np->n_localmodtime, &ts, >=)) { + NFSCL_DEBUG(4, "nfs_lookup: localmod " + "stale attributes\n"); + attrflag = 0; + } + NFSUNLOCKNODE(np); if (attrflag) (void) nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL, 0, 1); @@ -2561,7 +2602,9 @@ nfs_lookitup(struct vnode *dvp, char *name, int len, struct ucred *cred, struct componentname cn; int error = 0, attrflag, dattrflag; u_int hash; + struct timespec ts; + nanouptime(&ts); error = nfsrpc_lookup(dvp, name, len, cred, td, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL); if (dattrflag) @@ -2622,6 +2665,22 @@ printf("replace=%s\n",nnn); if (error) return (error); newvp = NFSTOV(np); + /* + * If n_localmodtime >= time before RPC, then + * a file modification operation, such as + * VOP_SETATTR() of size, has occurred while + * the Lookup RPC and acquisition of the vnode + * happened. As such, the attributes might + * be stale, with possibly an incorrect size. + */ + NFSLOCKNODE(np); + if (timespecisset(&np->n_localmodtime) && + timespeccmp(&np->n_localmodtime, &ts, >=)) { + NFSCL_DEBUG(4, "nfs_lookitup: localmod " + "stale attributes\n"); + attrflag = 0; + } + NFSUNLOCKNODE(np); } if (!attrflag && *npp == NULL) { if (newvp == dvp) diff --git a/sys/fs/nfsclient/nfsnode.h b/sys/fs/nfsclient/nfsnode.h index 66a2de31551a..c3ddcafa9d6f 100644 --- a/sys/fs/nfsclient/nfsnode.h +++ b/sys/fs/nfsclient/nfsnode.h @@ -128,6 +128,7 @@ struct nfsnode { u_int64_t n_change; /* old Change attribute */ struct nfsv4node *n_v4; /* extra V4 stuff */ struct ucred *n_writecred; /* Cred. for putpages */ + struct timespec n_localmodtime; /* Last local modify */ }; #define n_atim n_un1.nf_atim From nobody Thu Nov 18 00:55:59 2021 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 F2A3F185531B; Thu, 18 Nov 2021 00:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvhDv6Ytkz4fF7; Thu, 18 Nov 2021 00:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1AF1342E; Thu, 18 Nov 2021 00:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AI0txk0021653; Thu, 18 Nov 2021 00:55:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AI0txB0021652; Thu, 18 Nov 2021 00:55:59 GMT (envelope-from git) Date: Thu, 18 Nov 2021 00:55:59 GMT Message-Id: <202111180055.1AI0txB0021652@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: 5bd64640f779 - stable/13 - start_init: use 'p' 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 5bd64640f7797e0938c567e5fe98f4809d345310 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5bd64640f7797e0938c567e5fe98f4809d345310 commit 5bd64640f7797e0938c567e5fe98f4809d345310 Author: Konstantin Belousov AuthorDate: 2021-11-14 20:47:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-18 00:32:32 +0000 start_init: use 'p' (cherry picked from commit 8660813153d02e9e681ae083edc7f1d574cb62ca) --- sys/kern/init_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index e46f8f74c83d..4def00f8a018 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -766,7 +766,7 @@ start_init(void *dummy) */ KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); - oldvmspace = td->td_proc->p_vmspace; + oldvmspace = p->p_vmspace; error = kern_execve(td, &args, NULL, oldvmspace); KASSERT(error != 0, ("kern_execve returned success, not EJUSTRETURN")); From nobody Thu Nov 18 01:01:11 2021 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 45A661888DE4; Thu, 18 Nov 2021 01:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvhLv6pv7z4hV0; Thu, 18 Nov 2021 01:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B40CA33B6; Thu, 18 Nov 2021 01:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AI11BAP034533; Thu, 18 Nov 2021 01:01:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AI11BEZ034532; Thu, 18 Nov 2021 01:01:11 GMT (envelope-from git) Date: Thu, 18 Nov 2021 01:01:11 GMT Message-Id: <202111180101.1AI11BEZ034532@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: d472d0358e8f - stable/12 - nfscl: Add setting n_localmodtime to the Write RPC 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: d472d0358e8fe27c1b1050564cdbd9082bd06a05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d472d0358e8fe27c1b1050564cdbd9082bd06a05 commit d472d0358e8fe27c1b1050564cdbd9082bd06a05 Author: Rick Macklem AuthorDate: 2021-10-31 00:08:28 +0000 Commit: Rick Macklem CommitDate: 2021-11-18 00:19:50 +0000 nfscl: Add setting n_localmodtime to the Write RPC code Similar to commit 2be417843a, I believe there could be a race between the NFS client VOP_LOOKUP() and file Writing that could result in stale file attributes being loaded into the NFS vnode by VOP_LOOKUP(). I have not been able to reproduce a failure due to this race, but I believe that there are two possibilities: The Lookup RPC happens while VOP_WRITE() is being executed and loads stale file attributes after VOP_WRITE() returns when it has already completed the Write/Commit RPC(s). --> For this case, setting the local modify timestamp at the end of VOP_WRITE() should ensure that stale file attributes are not loaded. The Lookup RPC occurs after VOP_WRITE() has returned, while asynchronous Write/Commit RPCs are in progress and then is blocked by the vnode held by VOP_OPEN/VOP_CLOSE/VOP_FSYNC which will flush writes via ncl_flush() or ncl_vinvalbuf(), clearing the NMODIFIED flag (which indicates Writes-in-progress). The VOP_LOOKUP() then acquires the NFS vnode lock and fills in stale file attributes. --> Setting the local modify timestamp in ncl_flsuh() and ncl_vinvalbuf() when they clear NMODIFIED should ensure that stale file attributes are not loaded. This patch does the above. PR: 259071 (cherry picked from commit 50dcff0816e5e4aa94f51ce27da5121e49902996) --- sys/fs/nfsclient/nfs_clbio.c | 18 +++++++++++++++--- sys/fs/nfsclient/nfs_clvnops.c | 7 +++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 52eb879caafb..90d98da478b4 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -907,6 +907,7 @@ ncl_write(struct vop_write_args *ap) int bp_cached, n, on, error = 0, error1, save2, wouldcommit; size_t orig_resid, local_resid; off_t orig_size, tmp_off; + struct timespec ts; KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, @@ -1284,7 +1285,12 @@ again: break; } while (uio->uio_resid > 0 && n > 0); - if (error != 0) { + if (error == 0) { + nanouptime(&ts); + NFSLOCKNODE(np); + np->n_localmodtime = ts; + NFSUNLOCKNODE(np); + } else { if (ioflag & IO_UNIT) { VATTR_NULL(&vattr); vattr.va_size = orig_size; @@ -1356,6 +1362,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) struct nfsmount *nmp = VFSTONFS(vp->v_mount); int error = 0, slpflag, slptimeo; bool old_lock; + struct timespec ts; ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf"); @@ -1400,16 +1407,21 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) } if (NFSHASPNFS(nmp)) { nfscl_layoutcommit(vp, td); + nanouptime(&ts); /* * Invalidate the attribute cache, since writes to a DS * won't update the size attribute. */ NFSLOCKNODE(np); np->n_attrstamp = 0; - } else + } else { + nanouptime(&ts); NFSLOCKNODE(np); - if (np->n_directio_asyncwr == 0) + } + if (np->n_directio_asyncwr == 0 && (np->n_flag & NMODIFIED) != 0) { + np->n_localmodtime = ts; np->n_flag &= ~NMODIFIED; + } NFSUNLOCKNODE(np); out: ncl_excl_finish(vp, old_lock); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index b4cbde91c664..e37827deb723 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -2841,6 +2841,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct thread *td, #endif struct buf *bvec_on_stack[NFS_COMMITBVECSIZ]; u_int bvecsize = 0, bveccount; + struct timespec ts; if (called_from_renewthread != 0) slptimeo = hz; @@ -3164,6 +3165,12 @@ done: vn_printf(vp, "ncl_flush failed"); error = called_from_renewthread != 0 ? EIO : EBUSY; } + if (error == 0) { + nanouptime(&ts); + NFSLOCKNODE(np); + np->n_localmodtime = ts; + NFSUNLOCKNODE(np); + } return (error); } From nobody Thu Nov 18 06:47:43 2021 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 829AA1835A08; Thu, 18 Nov 2021 06:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hvr2l3CHBz3pYx; Thu, 18 Nov 2021 06:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E6F910892; Thu, 18 Nov 2021 06:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AI6lhkv088010; Thu, 18 Nov 2021 06:47:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AI6lhXU088009; Thu, 18 Nov 2021 06:47:43 GMT (envelope-from git) Date: Thu, 18 Nov 2021 06:47:43 GMT Message-Id: <202111180647.1AI6lhXU088009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 05514f66684c - stable/13 - bsdinstall: Fix mirror selection 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05514f66684cdf30e23933566f798dff5d26c5cf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=05514f66684cdf30e23933566f798dff5d26c5cf commit 05514f66684cdf30e23933566f798dff5d26c5cf Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-10 15:39:09 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-18 06:46:25 +0000 bsdinstall: Fix mirror selection This is a follow-up to 2697622687708bffd4c3dcfc44f0c977a78e506d, which fixed 2 out of 3 broken uses of the mirrorselect script. Reviewed by: emaste Approved by: emaste (src) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D32927 (cherry picked from commit 4042b356a00e12d6888a4e15e2373453804c5121) --- usr.sbin/bsdinstall/scripts/jail | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail index ecfbb78357d9..13a6de0846a9 100755 --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -95,7 +95,7 @@ FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$BSDINSTALL_DISTSITE" ]; then exec 3>&1 - BSDINSTALL_DISTSITE=`bsdinstall mirrorselect 2>&1 1>&3` + BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3) MIRROR_BUTTON=$? exec 3>&- test $MIRROR_BUTTON -eq 0 || error "No mirror selected" From nobody Thu Nov 18 07:09:44 2021 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 A4DB11888DA8; Thu, 18 Nov 2021 07:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvrX84DGZz3vvw; Thu, 18 Nov 2021 07:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71B90107EB; Thu, 18 Nov 2021 07:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AI79i3X015624; Thu, 18 Nov 2021 07:09:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AI79iNR015623; Thu, 18 Nov 2021 07:09:44 GMT (envelope-from git) Date: Thu, 18 Nov 2021 07:09:44 GMT Message-Id: <202111180709.1AI79iNR015623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: c6d3831e5492 - stable/12 - bsdinstall: Fix mirror selection 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c6d3831e54921c55c8297f5fcccf31f62b8bf324 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c6d3831e54921c55c8297f5fcccf31f62b8bf324 commit c6d3831e54921c55c8297f5fcccf31f62b8bf324 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-10 15:39:09 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-18 07:09:00 +0000 bsdinstall: Fix mirror selection This is a follow-up to 2697622687708bffd4c3dcfc44f0c977a78e506d, which fixed 2 out of 3 broken uses of the mirrorselect script. Reviewed by: emaste Approved by: emaste (src) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D32927 (cherry picked from commit 4042b356a00e12d6888a4e15e2373453804c5121) --- usr.sbin/bsdinstall/scripts/jail | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail index ecfbb78357d9..13a6de0846a9 100755 --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -95,7 +95,7 @@ FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$BSDINSTALL_DISTSITE" ]; then exec 3>&1 - BSDINSTALL_DISTSITE=`bsdinstall mirrorselect 2>&1 1>&3` + BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3) MIRROR_BUTTON=$? exec 3>&- test $MIRROR_BUTTON -eq 0 || error "No mirror selected" From nobody Thu Nov 18 22:40:27 2021 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 F0F04188E1E0; Thu, 18 Nov 2021 22:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwFB36SrSz4T36; Thu, 18 Nov 2021 22:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE22C1D071; Thu, 18 Nov 2021 22:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AIMeRr6061248; Thu, 18 Nov 2021 22:40:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AIMeRiJ061247; Thu, 18 Nov 2021 22:40:27 GMT (envelope-from git) Date: Thu, 18 Nov 2021 22:40:27 GMT Message-Id: <202111182240.1AIMeRiJ061247@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: e785923ade1b - stable/12 - nfscl: Use a smaller initial delay time for NFSERR_DELAY 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: e785923ade1b23dda1004978abc5b239f7882b8d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e785923ade1b23dda1004978abc5b239f7882b8d commit e785923ade1b23dda1004978abc5b239f7882b8d Author: Rick Macklem AuthorDate: 2021-11-02 00:21:31 +0000 Commit: Rick Macklem CommitDate: 2021-11-18 22:03:11 +0000 nfscl: Use a smaller initial delay time for NFSERR_DELAY For NFS RPCs that receive a NFSERR_DELAY reply, the delay time is initially 1sec and then increases exponentially to NFS_TRYLATERDEL. It was found that this delay time is excessive for some NFSv4 servers, which work well with a 1msec delay. A 1sec delay resulted in very slow performance for Remove and Rename when delegations and pNFS were enabled. This patch decreases the initial delay time to 1msec. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit 5a95a6e8e4d9e947b3bb4b4755a7242e1ddd72e7) --- sys/fs/nfs/nfs_commonkrpc.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index d583b1c80c3c..12c2787b1eda 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -107,6 +107,10 @@ static int nfs_reconnects; static int nfs3_jukebox_delay = 10; static int nfs_skip_wcc_data_onerr = 1; static int nfs_dsretries = 2; +static struct timespec nfs_trylater_max = { + .tv_sec = NFS_TRYLATERDEL, + .tv_nsec = 0, +}; SYSCTL_DECL(_vfs_nfs); @@ -541,12 +545,10 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, u_char *retsum, int toplevel, u_int64_t *xidp, struct nfsclsession *dssep) { uint32_t retseq, retval, slotseq, *tl; - time_t waituntil; int i = 0, j = 0, opcnt, set_sigset = 0, slot; int error = 0, usegssname = 0, secflavour = AUTH_SYS; int freeslot, maxslot, reterr, slotpos, timeo; u_int16_t procnum; - u_int trylater_delay = 1; struct nfs_feedback_arg nf; struct timeval timo; AUTH *auth; @@ -558,7 +560,11 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, struct ucred *authcred; struct nfsclsession *sep; uint8_t sessionid[NFSX_V4SESSIONID]; + struct timespec trylater_delay, ts, waituntil; + /* Initially 1msec. */ + trylater_delay.tv_sec = 0; + trylater_delay.tv_nsec = 1000000; sep = dssep; if (xidp != NULL) *xidp = 0; @@ -1075,12 +1081,19 @@ tryagain: (nd->nd_repstat == NFSERR_DELAY && (nd->nd_flag & ND_NFSV4) == 0) || nd->nd_repstat == NFSERR_RESOURCE) { - if (trylater_delay > NFS_TRYLATERDEL) - trylater_delay = NFS_TRYLATERDEL; - waituntil = NFSD_MONOSEC + trylater_delay; - while (NFSD_MONOSEC < waituntil) - (void) nfs_catnap(PZERO, 0, "nfstry"); - trylater_delay *= 2; + /* Clip at NFS_TRYLATERDEL. */ + if (timespeccmp(&trylater_delay, + &nfs_trylater_max, >)) + trylater_delay = nfs_trylater_max; + getnanouptime(&waituntil); + timespecadd(&waituntil, &trylater_delay, + &waituntil); + do { + nfs_catnap(PZERO, 0, "nfstry"); + getnanouptime(&ts); + } while (timespeccmp(&ts, &waituntil, <)); + timespecadd(&trylater_delay, &trylater_delay, + &trylater_delay); /* Double each time. */ if (slot != -1) { mtx_lock(&sep->nfsess_mtx); sep->nfsess_slotseq[slot]++; From nobody Thu Nov 18 22:59:38 2021 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 6C89E18981A5; Thu, 18 Nov 2021 22:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwFcB2cpRz4ZXl; Thu, 18 Nov 2021 22:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35ACC1D6EA; Thu, 18 Nov 2021 22:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AIMxcWQ078816; Thu, 18 Nov 2021 22:59:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AIMxc52078815; Thu, 18 Nov 2021 22:59:38 GMT (envelope-from git) Date: Thu, 18 Nov 2021 22:59:38 GMT Message-Id: <202111182259.1AIMxc52078815@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: 5d9215b315a9 - stable/12 - nfscl: Move release of the clientID lock into nfscl_doclose() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 5d9215b315a9e2b90d36ba90c4a8c84306bcfee4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5d9215b315a9e2b90d36ba90c4a8c84306bcfee4 commit 5d9215b315a9e2b90d36ba90c4a8c84306bcfee4 Author: Rick Macklem AuthorDate: 2021-10-16 22:49:38 +0000 Commit: Rick Macklem CommitDate: 2021-11-18 22:55:24 +0000 nfscl: Move release of the clientID lock into nfscl_doclose() This patch moves release of the shared clientID lock from nfsrpc_close() just after the nfscl_doclose() call to the end of nfscl_doclose() call. This does make the code cleaner, since the shared lock is acquired at the beginning of nfscl_doclose(). The only semantics change is that the code no longer drops and reaquires the NFSCLSTATELOCK() mutex, which I do not believe will have a negative effect on the NFSv4 client. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. (cherry picked from commit e2aab5e2d73486aa76bb861d583bbce021661601) --- sys/fs/nfsclient/nfs_clrpcops.c | 11 +++++------ sys/fs/nfsclient/nfs_clstate.c | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index d6072bf2523e..f2eb3af5f101 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -716,13 +716,12 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) return (0); if (doclose) error = nfscl_doclose(vp, &clp, p); - else + else { error = nfscl_getclose(vp, &clp); - if (error) - return (error); - - nfscl_clientrelease(clp); - return (0); + if (error == 0) + nfscl_clientrelease(clp); + } + return (error); } /* diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index ad4f16df8be8..9bd9b8759c51 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3267,6 +3267,7 @@ lookformore: op = LIST_NEXT(op, nfso_list); } } + nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); /* * recallp has been set NULL by nfscl_retoncloselayout() if it was From nobody Fri Nov 19 00:00:30 2021 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 517F9188E936; Fri, 19 Nov 2021 00:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwGyQ1cl3z4v6X; Fri, 19 Nov 2021 00:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 188C31E0BE; Fri, 19 Nov 2021 00:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ00UEZ067629; Fri, 19 Nov 2021 00:00:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ00UCC067628; Fri, 19 Nov 2021 00:00:30 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:00:30 GMT Message-Id: <202111190000.1AJ00UCC067628@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: 82d04e93821d - stable/12 - nfscl: Do pNFS layout return_on_close synchronously 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 82d04e93821d537ab5776c90f73855d5b0367b13 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=82d04e93821d537ab5776c90f73855d5b0367b13 commit 82d04e93821d537ab5776c90f73855d5b0367b13 Author: Rick Macklem AuthorDate: 2021-10-31 23:31:31 +0000 Commit: Rick Macklem CommitDate: 2021-11-18 23:55:39 +0000 nfscl: Do pNFS layout return_on_close synchronously For pNFS servers that specify that Layouts are to be returned upon close, they may expect that LayoutReturn to happen before the associated Close. This patch modifies the NFSv4.1/4.2 pNFS client so that this is done. This only affects a pNFS mount against a non-FreeBSD NFSv4.1/4.2 server that specifies return_on_close in LayoutGet replies. Found during a recent IETF NFSv4 working group testing event. (cherry picked from commit d5d2ce1c8550a41e7374893ccd864c172461221f) --- sys/fs/nfs/nfsclstate.h | 1 + sys/fs/nfsclient/nfs_clstate.c | 63 ++++++++++++++++++++++++++++++------------ 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h index 2ada4bfc5540..7f10c058697a 100644 --- a/sys/fs/nfs/nfsclstate.h +++ b/sys/fs/nfs/nfsclstate.h @@ -263,6 +263,7 @@ struct nfscllayout { #define NFSLY_RETONCLOSE 0x0080 #define NFSLY_WRITTEN 0x0100 /* Has been used to write to a DS. */ #define NFSLY_FLEXFILE 0x0200 +#define NFSLY_RETURNED 0x0400 /* * Flex file layout mirror specific stuff for nfsclflayout. diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9bd9b8759c51..279f7e38c346 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -122,7 +122,7 @@ static struct nfsclclient *nfscl_getclntsess(uint8_t *); static struct nfscldeleg *nfscl_finddeleg(struct nfsclclient *, u_int8_t *, int); static void nfscl_retoncloselayout(vnode_t, struct nfsclclient *, uint8_t *, - int, struct nfsclrecalllayout **); + int, struct nfsclrecalllayout **, struct nfscllayout **); static void nfscl_reldevinfo_locked(struct nfscldevinfo *); static struct nfscllayout *nfscl_findlayout(struct nfsclclient *, u_int8_t *, int); @@ -2817,7 +2817,8 @@ tryagain2: while (lyp != NULL) { nlyp = TAILQ_PREV(lyp, nfscllayouthead, nfsly_list); if (lyp->nfsly_timestamp < NFSD_MONOSEC && - (lyp->nfsly_flags & NFSLY_RECALL) == 0 && + (lyp->nfsly_flags & (NFSLY_RECALL | + NFSLY_RETONCLOSE)) == 0 && lyp->nfsly_lock.nfslock_usecnt == 0 && lyp->nfsly_lock.nfslock_lock == 0) { NFSCL_DEBUG(4, "ret stale lay=%d\n", @@ -2852,7 +2853,13 @@ tryagain2: TAILQ_REMOVE(&rlh, lyp, nfsly_list); NFSCL_DEBUG(4, "ret layout\n"); nfscl_layoutreturn(clp->nfsc_nmp, lyp, cred, p); - nfscl_freelayout(lyp); + if ((lyp->nfsly_flags & NFSLY_RETONCLOSE) != 0) { + NFSLOCKCLSTATE(); + lyp->nfsly_flags |= NFSLY_RETURNED; + wakeup(lyp); + NFSUNLOCKCLSTATE(); + } else + nfscl_freelayout(lyp); } /* @@ -3217,6 +3224,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) struct nfscldeleg *dp; struct nfsfh *nfhp; struct nfsclrecalllayout *recallp; + struct nfscllayout *lyp; int error; error = nfscl_getcl(vnode_mount(vp), NULL, NULL, 1, true, &clp); @@ -3245,7 +3253,8 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) } /* Return any layouts marked return on close. */ - nfscl_retoncloselayout(vp, clp, nfhp->nfh_fh, nfhp->nfh_len, &recallp); + nfscl_retoncloselayout(vp, clp, nfhp->nfh_fh, nfhp->nfh_len, &recallp, + &lyp); /* Now process the opens against the server. */ lookformore: @@ -3268,6 +3277,20 @@ lookformore: } } nfscl_clrelease(clp); + + /* Now, wait for any layout that is returned upon close. */ + if (lyp != NULL) { + while ((lyp->nfsly_flags & NFSLY_RETURNED) == 0) { + if (NFSCL_FORCEDISM(vnode_mount(vp))) { + lyp = NULL; + break; + } + msleep(lyp, NFSCLSTATEMUTEXPTR, PZERO, "nfslroc", hz); + } + if (lyp != NULL) + nfscl_freelayout(lyp); + } + NFSUNLOCKCLSTATE(); /* * recallp has been set NULL by nfscl_retoncloselayout() if it was @@ -5054,28 +5077,34 @@ nfscl_getlayout(struct nfsclclient *clp, uint8_t *fhp, int fhlen, */ static void nfscl_retoncloselayout(vnode_t vp, struct nfsclclient *clp, uint8_t *fhp, - int fhlen, struct nfsclrecalllayout **recallpp) + int fhlen, struct nfsclrecalllayout **recallpp, struct nfscllayout **lypp) { struct nfscllayout *lyp; uint32_t iomode; + *lypp = NULL; if (vp->v_type != VREG || !NFSHASPNFS(VFSTONFS(vnode_mount(vp))) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 || (VTONFS(vp)->n_flag & NNOLAYOUT) != 0) return; lyp = nfscl_findlayout(clp, fhp, fhlen); - if (lyp != NULL && (lyp->nfsly_flags & (NFSLY_RETONCLOSE | - NFSLY_RECALL)) == NFSLY_RETONCLOSE) { - iomode = 0; - if (!LIST_EMPTY(&lyp->nfsly_flayread)) - iomode |= NFSLAYOUTIOMODE_READ; - if (!LIST_EMPTY(&lyp->nfsly_flayrw)) - iomode |= NFSLAYOUTIOMODE_RW; - (void)nfscl_layoutrecall(NFSLAYOUTRETURN_FILE, lyp, iomode, - 0, UINT64_MAX, lyp->nfsly_stateid.seqid, 0, 0, NULL, - *recallpp); - NFSCL_DEBUG(4, "retoncls recall iomode=%d\n", iomode); - *recallpp = NULL; + if (lyp != NULL && (lyp->nfsly_flags & NFSLY_RETONCLOSE) != 0) { + if ((lyp->nfsly_flags & NFSLY_RECALL) == 0) { + iomode = 0; + if (!LIST_EMPTY(&lyp->nfsly_flayread)) + iomode |= NFSLAYOUTIOMODE_READ; + if (!LIST_EMPTY(&lyp->nfsly_flayrw)) + iomode |= NFSLAYOUTIOMODE_RW; + nfscl_layoutrecall(NFSLAYOUTRETURN_FILE, lyp, iomode, + 0, UINT64_MAX, lyp->nfsly_stateid.seqid, 0, 0, NULL, + *recallpp); + NFSCL_DEBUG(4, "retoncls recall iomode=%d\n", iomode); + *recallpp = NULL; + } + + /* Now, wake up renew thread to do LayoutReturn. */ + wakeup(clp); + *lypp = lyp; } } From nobody Fri Nov 19 00:02:15 2021 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 50E0D188EDAB; Fri, 19 Nov 2021 00:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0S1G1Dz4vfs; Fri, 19 Nov 2021 00:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C6F61E534; Fri, 19 Nov 2021 00:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02FQ2072001; Fri, 19 Nov 2021 00:02:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02FUJ072000; Fri, 19 Nov 2021 00:02:15 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:15 GMT Message-Id: <202111190002.1AJ02FUJ072000@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: 79bc96d1fbee - stable/13 - LinuxKPI: add nexthdr definitions for IPv6 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 79bc96d1fbee646211e1f605a4951ce81e7a0b53 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=79bc96d1fbee646211e1f605a4951ce81e7a0b53 commit 79bc96d1fbee646211e1f605a4951ce81e7a0b53 Author: Bjoern A. Zeeb AuthorDate: 2021-07-27 13:39:15 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:22 +0000 LinuxKPI: add nexthdr definitions for IPv6 Add the nexthdr definitions for IPv6 which are used by wireless drivers and were previously placed in an 80211 header file by accident. Obtained from: bz_iwlwifi Sponsored by: The FreeBSD Foundation (cherry picked from commit b9d984e2c5dcef277c49a576ccefada6519d9b53) --- sys/compat/linuxkpi/common/include/net/ipv6.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/net/ipv6.h b/sys/compat/linuxkpi/common/include/net/ipv6.h index 37c30ed6e793..dfe77ef1c6ed 100644 --- a/sys/compat/linuxkpi/common/include/net/ipv6.h +++ b/sys/compat/linuxkpi/common/include/net/ipv6.h @@ -38,6 +38,11 @@ #define IPV6_DEFAULT_HOPLIMIT 64 +#define NEXTHDR_HOP IPPROTO_HOPOPTS +#define NEXTHDR_ROUTING IPPROTO_ROUTING +#define NEXTHDR_NONE IPPROTO_NONE +#define NEXTHDR_DEST IPPROTO_DSTOPTS + #define ipv6_addr_loopback(addr) IN6_IS_ADDR_LOOPBACK(addr) #define ipv6_addr_any(addr) IN6_IS_ADDR_UNSPECIFIED(addr) From nobody Fri Nov 19 00:02:17 2021 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 078B4188F08A; Fri, 19 Nov 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0T368Mz4vln; Fri, 19 Nov 2021 00:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 222391E6DD; Fri, 19 Nov 2021 00:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02HnB072031; Fri, 19 Nov 2021 00:02:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02HbH072030; Fri, 19 Nov 2021 00:02:17 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:17 GMT Message-Id: <202111190002.1AJ02HbH072030@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: e41baaefc46a - stable/13 - LinuxKPI: dmi.h do not rely on implicit includes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e41baaefc46a88becda14236b66bcba34b366b75 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e41baaefc46a88becda14236b66bcba34b366b75 commit e41baaefc46a88becda14236b66bcba34b366b75 Author: Bjoern A. Zeeb AuthorDate: 2021-07-28 13:28:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:22 +0000 LinuxKPI: dmi.h do not rely on implicit includes Add sys/types.h to dmi.h and do not rely on other files to include all needed headers in Linux land. I ran into compile problems with rtw88 otherwise. (cherry picked from commit ac134e762e6908dcadd0c7cb7bcb3de0ed967f59) --- sys/compat/linuxkpi/common/include/linux/dmi.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/dmi.h b/sys/compat/linuxkpi/common/include/linux/dmi.h index b921cc906917..6e450e156b73 100644 --- a/sys/compat/linuxkpi/common/include/linux/dmi.h +++ b/sys/compat/linuxkpi/common/include/linux/dmi.h @@ -31,6 +31,7 @@ #ifndef __LINUX_DMI_H__ #define __LINUX_DMI_H__ +#include #include int linux_dmi_check_system(const struct dmi_system_id *); From nobody Fri Nov 19 00:02:18 2021 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 71D1A188ED5C; Fri, 19 Nov 2021 00:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0V46L8z4vjZ; Fri, 19 Nov 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 539D91E0DE; Fri, 19 Nov 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02I26072056; Fri, 19 Nov 2021 00:02:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02IEw072055; Fri, 19 Nov 2021 00:02:18 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:18 GMT Message-Id: <202111190002.1AJ02IEw072055@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: 2314243b4a29 - stable/13 - LinuxKPI: bitfield.h cleanup 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2314243b4a2949d1bdddefcdd43e44bebe5dab50 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2314243b4a2949d1bdddefcdd43e44bebe5dab50 commit 2314243b4a2949d1bdddefcdd43e44bebe5dab50 Author: Bjoern A. Zeeb AuthorDate: 2021-07-29 21:24:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:23 +0000 LinuxKPI: bitfield.h cleanup Add a missing tab and remove an unnecessary return. No functional changes. (cherry picked from commit 4c8af633d10104c793673ee1f6e7b96f113cce5a) --- sys/compat/linuxkpi/common/include/linux/bitfield.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/bitfield.h b/sys/compat/linuxkpi/common/include/linux/bitfield.h index 4749cc4454e7..27082cbd4886 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitfield.h +++ b/sys/compat/linuxkpi/common/include/linux/bitfield.h @@ -77,7 +77,7 @@ _uX_encode_bits(8) #define _leX_encode_bits(_n) \ static __inline uint ## _n ## _t \ - le ## _n ## _encode_bits(__le ## _n v, uint ## _n ## _t f)\ + le ## _n ## _encode_bits(__le ## _n v, uint ## _n ## _t f) \ { \ return (cpu_to_le ## _n((v & ___bitmask(f)) * ___lsb(f))); \ } @@ -91,7 +91,6 @@ le32p_replace_bits(uint32_t *p, uint32_t v, uint32_t f) { *p = (*p & ~(cpu_to_le32(v))) | le32_encode_bits(v, f); - return; } #define __bf_shf(x) (__builtin_ffsll(x) - 1) From nobody Fri Nov 19 00:02:19 2021 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 4A743188EF58; Fri, 19 Nov 2021 00:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0W4WY0z4vd0; Fri, 19 Nov 2021 00:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6743C1E536; Fri, 19 Nov 2021 00:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02JJS072080; Fri, 19 Nov 2021 00:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02J6Q072079; Fri, 19 Nov 2021 00:02:19 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:19 GMT Message-Id: <202111190002.1AJ02J6Q072079@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: 3ce981ee8ef7 - stable/13 - LinuxKPI: fix bug in le32p_replace_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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 3ce981ee8ef7b343779f445ba833d93596edf5d9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3ce981ee8ef7b343779f445ba833d93596edf5d9 commit 3ce981ee8ef7b343779f445ba833d93596edf5d9 Author: Bjoern A. Zeeb AuthorDate: 2021-07-29 21:27:21 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:23 +0000 LinuxKPI: fix bug in le32p_replace_bits() Fix a bug that slipped in in 90707c4e44de03ea36be183ef2226601c66169cb using the correct field in le32p_replace_bits(). Sponsored by: The FreeBSD Foundation (cherry picked from commit 22e20d852ff400a486da24e5d1d92c841a3e39d9) --- sys/compat/linuxkpi/common/include/linux/bitfield.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/bitfield.h b/sys/compat/linuxkpi/common/include/linux/bitfield.h index 27082cbd4886..a805c1bca5a1 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitfield.h +++ b/sys/compat/linuxkpi/common/include/linux/bitfield.h @@ -90,7 +90,7 @@ static __inline void le32p_replace_bits(uint32_t *p, uint32_t v, uint32_t f) { - *p = (*p & ~(cpu_to_le32(v))) | le32_encode_bits(v, f); + *p = (*p & ~(cpu_to_le32(f))) | le32_encode_bits(v, f); } #define __bf_shf(x) (__builtin_ffsll(x) - 1) From nobody Fri Nov 19 00:02:20 2021 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 9B773188ED73; Fri, 19 Nov 2021 00:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0Y0K06z4vV1; Fri, 19 Nov 2021 00:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D9D01E6DF; Fri, 19 Nov 2021 00:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02KEN072104; Fri, 19 Nov 2021 00:02:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02KIu072103; Fri, 19 Nov 2021 00:02:20 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:20 GMT Message-Id: <202111190002.1AJ02KIu072103@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: 034475d66c7c - stable/13 - LinuxKPI: add sign_extend32() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 034475d66c7c52211636522f2f44de7e64d36a6b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=034475d66c7c52211636522f2f44de7e64d36a6b commit 034475d66c7c52211636522f2f44de7e64d36a6b Author: Bjoern A. Zeeb AuthorDate: 2021-07-01 13:14:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:23 +0000 LinuxKPI: add sign_extend32() Add sign_extend32() replicating the 64 version. This is needed by the rtw88 driver. (cherry picked from commit ea4dea83944ac6334d31e0364dd674eda250adde) --- sys/compat/linuxkpi/common/include/linux/bitops.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index 49bfc4cc7414..0d7ab376e02d 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -412,4 +412,12 @@ sign_extend64(uint64_t value, int index) return ((int64_t)(value << shift) >> shift); } +static inline uint32_t +sign_extend32(uint32_t value, int index) +{ + uint8_t shift = 31 - index; + + return ((int32_t)(value << shift) >> shift); +} + #endif /* _LINUX_BITOPS_H_ */ From nobody Fri Nov 19 00:02:21 2021 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 77788188EDD1; Fri, 19 Nov 2021 00:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0Y6zN7z4vm9; Fri, 19 Nov 2021 00:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFFE11E2CC; Fri, 19 Nov 2021 00:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02Lr8072128; Fri, 19 Nov 2021 00:02:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02LXW072127; Fri, 19 Nov 2021 00:02:21 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:21 GMT Message-Id: <202111190002.1AJ02LXW072127@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: 4c8e29637456 - stable/13 - LinuxKPI: add module_pci_driver() and pci_alloc_irq_vectors() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 4c8e29637456bbbe709425f691f637914658009f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4c8e29637456bbbe709425f691f637914658009f commit 4c8e29637456bbbe709425f691f637914658009f Author: Bjoern A. Zeeb AuthorDate: 2021-07-01 13:33:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:23 +0000 LinuxKPI: add module_pci_driver() and pci_alloc_irq_vectors() Add the two new functions needed by rtw88 to register the driver and handle the module bits as well as a version of pci_alloc_irq_vectors() for what is needed. (cherry picked from commit 366d68f283793df22392f9fb992c5029dfc293bb) --- sys/compat/linuxkpi/common/include/linux/pci.h | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 5b3c7c292921..4914bc247ebc 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -186,6 +186,10 @@ typedef int pci_power_t; #define PCI_EXT_CAP_ID_ERR PCIZ_AER +#define PCI_IRQ_LEGACY 0x01 +#define PCI_IRQ_MSI 0x02 +#define PCI_IRQ_MSIX 0x04 + struct pci_dev; struct pci_driver { @@ -221,6 +225,25 @@ extern spinlock_t pci_lock; #define __devexit_p(x) x +#define module_pci_driver(_driver) \ + \ +static inline int \ +_pci_init(void) \ +{ \ + \ + return (linux_pci_register_driver(&_driver)); \ +} \ + \ +static inline void \ +_pci_exit(void) \ +{ \ + \ + linux_pci_unregister_driver(&_driver); \ +} \ + \ +module_init(_pci_init); \ +module_exit(_pci_exit) + /* * If we find drivers accessing this from multiple KPIs we may have to * refcount objects of this structure. @@ -829,6 +852,42 @@ pci_enable_msi(struct pci_dev *pdev) return (0); } +static inline int +pci_alloc_irq_vectors(struct pci_dev *pdev, int minv, int maxv, + unsigned int flags) +{ + int error; + + if (flags & PCI_IRQ_MSIX) { + struct msix_entry *entries; + int i; + + entries = kcalloc(maxv, sizeof(*entries), GFP_KERNEL); + if (entries == NULL) { + error = -ENOMEM; + goto out; + } + for (i = 0; i < maxv; ++i) + entries[i].entry = i; + error = pci_enable_msix(pdev, entries, maxv); +out: + kfree(entries); + if (error == 0 && pdev->msix_enabled) + return (pdev->dev.irq_end - pdev->dev.irq_start); + } + if (flags & PCI_IRQ_MSI) { + error = pci_enable_msi(pdev); + if (error == 0 && pdev->msi_enabled) + return (pdev->dev.irq_end - pdev->dev.irq_start); + } + if (flags & PCI_IRQ_LEGACY) { + if (pdev->irq) + return (1); + } + + return (-EINVAL); +} + static inline int pci_channel_offline(struct pci_dev *pdev) { From nobody Fri Nov 19 00:02:24 2021 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 74DE4188F1CA; Fri, 19 Nov 2021 00:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0d2JhHz4vtk; Fri, 19 Nov 2021 00:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 097981E539; Fri, 19 Nov 2021 00:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02O9Z072206; Fri, 19 Nov 2021 00:02:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02OiU072205; Fri, 19 Nov 2021 00:02:24 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:24 GMT Message-Id: <202111190002.1AJ02OiU072205@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: f9002b78d070 - stable/13 - net80211: comments and whitespace 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: f9002b78d070e2603299e9ff7084ab79e8faaa55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f9002b78d070e2603299e9ff7084ab79e8faaa55 commit f9002b78d070e2603299e9ff7084ab79e8faaa55 Author: Bjoern A. Zeeb AuthorDate: 2021-09-04 09:16:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 net80211: comments and whitespace Add a missing '.', fix spelling of "failed" and unwrap a closing ); No functional changes. Sponsored by: The FreeBSD Foundation (cherry picked from commit 49c220b021d5855652ecb2803c969dfa47bdd306) --- sys/net80211/ieee80211_input.h | 2 +- sys/net80211/ieee80211_output.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/net80211/ieee80211_input.h b/sys/net80211/ieee80211_input.h index 810dcbde7978..7456fc68b365 100644 --- a/sys/net80211/ieee80211_input.h +++ b/sys/net80211/ieee80211_input.h @@ -178,7 +178,7 @@ ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs) * * The routine only eliminates packets whose sequence/fragment * match or are less than the last seen sequence/fragment number - * AND are retransmits It doesn't try to eliminate out of order packets. + * AND are retransmits. It doesn't try to eliminate out of order packets. * * Since all frames after sequence number 4095 will be less than 4095 * (as the seqnum wraps), handle that special case so packets aren't diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index ab3e3142ad2c..4f9e9614f732 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -2590,7 +2590,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni, ret = ieee80211_probereq_ie(vap, ic, &frm, &frmlen, ssid, ssidlen, false); KASSERT(ret == 0, - ("%s: ieee80211_probereq_ie railed: %d\n", __func__, ret)); + ("%s: ieee80211_probereq_ie failed: %d\n", __func__, ret)); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ieee80211_frame), @@ -2725,8 +2725,7 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int type, int arg) ic->ic_headroom + sizeof(struct ieee80211_frame), 3 * sizeof(uint16_t) + (has_challenge && status == IEEE80211_STATUS_SUCCESS ? - sizeof(uint16_t)+IEEE80211_CHALLENGE_LEN : 0) - ); + sizeof(uint16_t)+IEEE80211_CHALLENGE_LEN : 0)); if (m == NULL) senderr(ENOMEM, is_tx_nobuf); From nobody Fri Nov 19 00:02:22 2021 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 0F534188F165; Fri, 19 Nov 2021 00:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0b4M4bz4vmJ; Fri, 19 Nov 2021 00:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9E071E6E1; Fri, 19 Nov 2021 00:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02M8s072152; Fri, 19 Nov 2021 00:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02Mso072151; Fri, 19 Nov 2021 00:02:22 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:22 GMT Message-Id: <202111190002.1AJ02Mso072151@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: 9342ec5077f4 - stable/13 - LinuxKPI: add read_poll_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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 9342ec5077f4e198394ec8648a3834524c684d6d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9342ec5077f4e198394ec8648a3834524c684d6d commit 9342ec5077f4e198394ec8648a3834524c684d6d Author: Bjoern A. Zeeb AuthorDate: 2021-07-01 13:29:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:23 +0000 LinuxKPI: add read_poll_timeout() Add an implementation of read_poll_timeout() and the atomic variant which I did at some point last year for rtw88 and now updated based on feedback. (cherry picked from commit fed248a6acb33cf6d51880be8d5c774d89e75110) --- sys/compat/linuxkpi/common/include/linux/iopoll.h | 91 +++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/iopoll.h b/sys/compat/linuxkpi/common/include/linux/iopoll.h new file mode 100644 index 000000000000..ea876042eab6 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/iopoll.h @@ -0,0 +1,91 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUXKPI_LINUX_IOPOLL_H +#define __LINUXKPI_LINUX_IOPOLL_H + +#include +#include +#include + +#define read_poll_timeout(_pollfp, _var, _cond, _us, _to, _early_sleep, ...) \ +({ \ + struct timeval __now, __end; \ + if (_to) { \ + __end.tv_sec = (_to) / USEC_PER_SEC; \ + __end.tv_usec = (_to) % USEC_PER_SEC; \ + microtime(&__now); \ + timevaladd(&__end, &__now); \ + } \ + \ + if ((_early_sleep) && (_us) > 0) \ + usleep_range(_us, _us); \ + do { \ + (_var) = _pollfp(__VA_ARGS__); \ + if (_cond) \ + break; \ + if (_to) { \ + microtime(&__now); \ + if (timevalcmp(&__now, &__end, >)) \ + break; \ + } \ + if ((_us) != 0) \ + usleep_range(_us, _us); \ + } while (1); \ + (_cond) ? 0 : (-ETIMEDOUT); \ +}) + +#define read_poll_timeout_atomic(_pollfp, _var, _cond, _us, _to, _early_sleep, ...) \ +({ \ + struct timeval __now, __end; \ + if (_to) { \ + __end.tv_sec = (_to) / USEC_PER_SEC; \ + __end.tv_usec = (_to) % USEC_PER_SEC; \ + microtime(&__now); \ + timevaladd(&__end, &__now); \ + } \ + \ + if ((_early_sleep) && (_us) > 0) \ + DELAY(_us); \ + do { \ + (_var) = _pollfp(__VA_ARGS__); \ + if (_cond) \ + break; \ + if (_to) { \ + microtime(&__now); \ + if (timevalcmp(&__now, &__end, >)) \ + break; \ + } \ + if ((_us) != 0) \ + DELAY(_us); \ + } while (1); \ + (_cond) ? 0 : (-ETIMEDOUT); \ +}) + +#endif /* __LINUXKPI_LINUX_IOPOLL_H */ From nobody Fri Nov 19 00:02:26 2021 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 528D1188F39C; Fri, 19 Nov 2021 00:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0f39Qyz4vgg; Fri, 19 Nov 2021 00:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31A6F1E700; Fri, 19 Nov 2021 00:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02QXR072230; Fri, 19 Nov 2021 00:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02QwV072229; Fri, 19 Nov 2021 00:02:26 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:26 GMT Message-Id: <202111190002.1AJ02QwV072229@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: bb989b92edd9 - stable/13 - net80211: add func/line information to IEEE80211_DISCARD* macros 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: bb989b92edd9eba7f80148378858ee0759d4dd13 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bb989b92edd9eba7f80148378858ee0759d4dd13 commit bb989b92edd9eba7f80148378858ee0759d4dd13 Author: Bjoern A. Zeeb AuthorDate: 2021-09-04 09:24:51 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 net80211: add func/line information to IEEE80211_DISCARD* macros While debugging is very good in net80211, some log messages are repeated in multiple places 1:1. In order to distinguish where the discard happened and to speed up analysis, add __func__:__LINE__ information to all these messages. Sponsored by: The FreeBSD Foundation (cherry picked from commit cb5c07649aa005abb1e847c2cd5f816d762efb93) --- sys/net80211/ieee80211_var.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 350c9b98441d..e70b7f8e2bb6 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -1067,15 +1067,18 @@ void ieee80211_note_frame(const struct ieee80211vap *, */ #define IEEE80211_DISCARD(_vap, _m, _wh, _type, _fmt, ...) do { \ if ((_vap)->iv_debug & (_m)) \ - ieee80211_discard_frame(_vap, _wh, _type, _fmt, __VA_ARGS__);\ + ieee80211_discard_frame(_vap, _wh, _type, \ + "%s:%d: " _fmt, __func__, __LINE__, __VA_ARGS__); \ } while (0) #define IEEE80211_DISCARD_IE(_vap, _m, _wh, _type, _fmt, ...) do { \ if ((_vap)->iv_debug & (_m)) \ - ieee80211_discard_ie(_vap, _wh, _type, _fmt, __VA_ARGS__);\ + ieee80211_discard_ie(_vap, _wh, _type, \ + "%s:%d: " _fmt, __func__, __LINE__, __VA_ARGS__); \ } while (0) #define IEEE80211_DISCARD_MAC(_vap, _m, _mac, _type, _fmt, ...) do { \ if ((_vap)->iv_debug & (_m)) \ - ieee80211_discard_mac(_vap, _mac, _type, _fmt, __VA_ARGS__);\ + ieee80211_discard_mac(_vap, _mac, _type, \ + "%s:%d: " _fmt, __func__, __LINE__, __VA_ARGS__); \ } while (0) void ieee80211_discard_frame(const struct ieee80211vap *, From nobody Fri Nov 19 00:02:23 2021 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 8A108188F318; Fri, 19 Nov 2021 00:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0c5RtLz4vVS; Fri, 19 Nov 2021 00:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB3B21E4A8; Fri, 19 Nov 2021 00:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02N2a072182; Fri, 19 Nov 2021 00:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02NBv072181; Fri, 19 Nov 2021 00:02:23 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:23 GMT Message-Id: <202111190002.1AJ02NBv072181@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: 20c9dcd2edf3 - stable/13 - LinuxKPI: add fsleep() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 20c9dcd2edf35f9c4cc52d48ea4d3b10af6d8091 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=20c9dcd2edf35f9c4cc52d48ea4d3b10af6d8091 commit 20c9dcd2edf35f9c4cc52d48ea4d3b10af6d8091 Author: Bjoern A. Zeeb AuthorDate: 2021-07-27 15:22:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:23 +0000 LinuxKPI: add fsleep() Add fsleep() function now required by rtw88. This seems to be making a decision depending on time to sleep on how to sleep. Given our compat framework already is lenient on how long to sleep, this is a cut down version. (cherry picked from commit cc2723370b482b923b2adeac3ad359d485f0bd82) --- sys/compat/linuxkpi/common/include/linux/delay.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/delay.h b/sys/compat/linuxkpi/common/include/linux/delay.h index 860d36368a8e..d2fea37699c3 100644 --- a/sys/compat/linuxkpi/common/include/linux/delay.h +++ b/sys/compat/linuxkpi/common/include/linux/delay.h @@ -73,4 +73,14 @@ usleep_range(unsigned long min, unsigned long max) extern unsigned int linux_msleep_interruptible(unsigned int ms); +static inline void +fsleep(unsigned long us) +{ + + if (us < 10) + udelay(us); + else + usleep_range(us, us); +} + #endif /* _LINUX_DELAY_H_ */ From nobody Fri Nov 19 00:02:28 2021 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 01354188F688; Fri, 19 Nov 2021 00:02:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0j0fSRz4vdk; Fri, 19 Nov 2021 00:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E70B1E2D1; Fri, 19 Nov 2021 00:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02S7Q072278; Fri, 19 Nov 2021 00:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02S2B072277; Fri, 19 Nov 2021 00:02:28 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:28 GMT Message-Id: <202111190002.1AJ02S2B072277@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: d005c4c6de6b - stable/13 - LinuxKPI: dma-mapping.h unify "mask" and "dma_mask" 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: d005c4c6de6b314d6e83811c01df035bd5d511fc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d005c4c6de6b314d6e83811c01df035bd5d511fc commit d005c4c6de6b314d6e83811c01df035bd5d511fc Author: Bjoern A. Zeeb AuthorDate: 2021-09-27 20:48:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 LinuxKPI: dma-mapping.h unify "mask" and "dma_mask" In some places we are using "mask" and others "dma_mask" for the same thing. Harmonize the various places to "dma_mask" as used in linux_pci.c. For the declaration remove the argument names to avoid the entire problem. This is in preparation for an upcoming change. No functional changes intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit 72c89ce97ba3f023463930578c6df7f0374cbf17) --- sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 5b5bc9e90815..554d4bd4e695 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -91,7 +91,7 @@ struct dma_map_ops { #define DMA_BIT_MASK(n) ((2ULL << ((n) - 1)) - 1ULL) -int linux_dma_tag_init(struct device *dev, u64 mask); +int linux_dma_tag_init(struct device *, u64); void *linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); @@ -104,7 +104,7 @@ void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, unsigned long attrs __unused); static inline int -dma_supported(struct device *dev, u64 mask) +dma_supported(struct device *dev, u64 dma_mask) { /* XXX busdma takes care of this elsewhere. */ @@ -122,23 +122,23 @@ dma_set_mask(struct device *dev, u64 dma_mask) } static inline int -dma_set_coherent_mask(struct device *dev, u64 mask) +dma_set_coherent_mask(struct device *dev, u64 dma_mask) { - if (!dma_supported(dev, mask)) + if (!dma_supported(dev, dma_mask)) return -EIO; /* XXX Currently we don't support a separate coherent mask. */ return 0; } static inline int -dma_set_mask_and_coherent(struct device *dev, u64 mask) +dma_set_mask_and_coherent(struct device *dev, u64 dma_mask) { int r; - r = dma_set_mask(dev, mask); + r = dma_set_mask(dev, dma_mask); if (r == 0) - dma_set_coherent_mask(dev, mask); + dma_set_coherent_mask(dev, dma_mask); return (r); } From nobody Fri Nov 19 00:02:29 2021 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 EF152188F3FE; Fri, 19 Nov 2021 00:02:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0k51fJz3Blt; Fri, 19 Nov 2021 00:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A10A41E53C; Fri, 19 Nov 2021 00:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02TIf072308; Fri, 19 Nov 2021 00:02:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02TiS072307; Fri, 19 Nov 2021 00:02:29 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:29 GMT Message-Id: <202111190002.1AJ02TiS072307@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: 37b2cf4e6a97 - stable/13 - LinuxKPI: implement dma_set_coherent_mask() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 37b2cf4e6a978dbea35009e361dfecab8efc0775 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=37b2cf4e6a978dbea35009e361dfecab8efc0775 commit 37b2cf4e6a978dbea35009e361dfecab8efc0775 Author: Bjoern A. Zeeb AuthorDate: 2021-09-27 22:50:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 LinuxKPI: implement dma_set_coherent_mask() Coherent is lower 32bit only by default in Linux and our only default dma mask is 64bit currently which violates expectations unless dma_set_coherent_mask() was called explicitly with a different mask. Implement coherent by creating a second tag, and storing the tags in the objects and use the tag from the object wherever possible. This currently does not update the scatterlist or pool (both could be converted but S/G cannot be MFCed as easily). There is a 2nd change embedded in the updated logic of linux_dma_alloc_coherent() to always zero the allocation as otherwise some drivers get cranky on uninialised garbage. Sponsored by: The FreeBSD Foundation (cherry picked from commit c39eefe715b3c835ce3d91a1c1932197c23c1f3c) (cherry picked from commit 1269873159c7fa0db3b9dbf8dadc54eec5dc0d58) --- .../linuxkpi/common/include/linux/dma-mapping.h | 7 +- sys/compat/linuxkpi/common/src/linux_pci.c | 194 +++++++++++++-------- 2 files changed, 129 insertions(+), 72 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 554d4bd4e695..c86a24d1270a 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -92,6 +92,7 @@ struct dma_map_ops { #define DMA_BIT_MASK(n) ((2ULL << ((n) - 1)) - 1ULL) int linux_dma_tag_init(struct device *, u64); +int linux_dma_tag_init_coherent(struct device *, u64); void *linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); @@ -125,10 +126,10 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 dma_mask) { - if (!dma_supported(dev, dma_mask)) + if (!dev->dma_priv || !dma_supported(dev, dma_mask)) return -EIO; - /* XXX Currently we don't support a separate coherent mask. */ - return 0; + + return (linux_dma_tag_init_coherent(dev, dma_mask)); } static inline int diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index c8f473205ede..780ba38d18dd 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -110,13 +110,31 @@ static device_method_t pci_methods[] = { struct linux_dma_priv { uint64_t dma_mask; - struct mtx lock; bus_dma_tag_t dmat; + uint64_t dma_coherent_mask; + bus_dma_tag_t dmat_coherent; + struct mtx lock; struct pctrie ptree; }; #define DMA_PRIV_LOCK(priv) mtx_lock(&(priv)->lock) #define DMA_PRIV_UNLOCK(priv) mtx_unlock(&(priv)->lock) +static int +linux_pdev_dma_uninit(struct pci_dev *pdev) +{ + struct linux_dma_priv *priv; + + priv = pdev->dev.dma_priv; + if (priv->dmat) + bus_dma_tag_destroy(priv->dmat); + if (priv->dmat_coherent) + bus_dma_tag_destroy(priv->dmat_coherent); + mtx_destroy(&priv->lock); + pdev->dev.dma_priv = NULL; + free(priv, M_DEVBUF); + return (0); +} + static int linux_pdev_dma_init(struct pci_dev *pdev) { @@ -124,34 +142,26 @@ linux_pdev_dma_init(struct pci_dev *pdev) int error; priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); - pdev->dev.dma_priv = priv; mtx_init(&priv->lock, "lkpi-priv-dma", NULL, MTX_DEF); - pctrie_init(&priv->ptree); - /* create a default DMA tag */ + pdev->dev.dma_priv = priv; + + /* Create a default DMA tags. */ error = linux_dma_tag_init(&pdev->dev, DMA_BIT_MASK(64)); - if (error) { - mtx_destroy(&priv->lock); - free(priv, M_DEVBUF); - pdev->dev.dma_priv = NULL; - } - return (error); -} + if (error != 0) + goto err; + /* Coherent is lower 32bit only by default in Linux. */ + error = linux_dma_tag_init_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (error != 0) + goto err; -static int -linux_pdev_dma_uninit(struct pci_dev *pdev) -{ - struct linux_dma_priv *priv; + return (error); - priv = pdev->dev.dma_priv; - if (priv->dmat) - bus_dma_tag_destroy(priv->dmat); - mtx_destroy(&priv->lock); - free(priv, M_DEVBUF); - pdev->dev.dma_priv = NULL; - return (0); +err: + linux_pdev_dma_uninit(pdev); + return (error); } int @@ -185,6 +195,37 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) return (-error); } +int +linux_dma_tag_init_coherent(struct device *dev, u64 dma_mask) +{ + struct linux_dma_priv *priv; + int error; + + priv = dev->dma_priv; + + if (priv->dmat_coherent) { + if (priv->dma_coherent_mask == dma_mask) + return (0); + + bus_dma_tag_destroy(priv->dmat_coherent); + } + + priv->dma_coherent_mask = dma_mask; + + error = bus_dma_tag_create(bus_get_dma_tag(dev->bsddev), + 1, 0, /* alignment, boundary */ + dma_mask, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + BUS_SPACE_MAXSIZE, /* maxsize */ + 1, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsz */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &priv->dmat_coherent); + return (-error); +} + static struct pci_driver * linux_pci_find(device_t dev, const struct pci_device_id **idp) { @@ -723,6 +764,7 @@ struct linux_dma_obj { void *vaddr; uint64_t dma_addr; bus_dmamap_t dmamap; + bus_dma_tag_t dmat; }; static uma_zone_t linux_dma_trie_zone; @@ -768,44 +810,10 @@ linux_dma_trie_free(struct pctrie *ptree, void *node) PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, linux_dma_trie_alloc, linux_dma_trie_free); -void * -linux_dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t flag) -{ - struct linux_dma_priv *priv; - vm_paddr_t high; - size_t align; - void *mem; - - if (dev == NULL || dev->dma_priv == NULL) { - *dma_handle = 0; - return (NULL); - } - priv = dev->dma_priv; - if (priv->dma_mask) - high = priv->dma_mask; - else if (flag & GFP_DMA32) - high = BUS_SPACE_MAXADDR_32BIT; - else - high = BUS_SPACE_MAXADDR; - align = PAGE_SIZE << get_order(size); - mem = (void *)kmem_alloc_contig(size, flag & GFP_NATIVE_MASK, 0, high, - align, 0, VM_MEMATTR_DEFAULT); - if (mem != NULL) { - *dma_handle = linux_dma_map_phys(dev, vtophys(mem), size); - if (*dma_handle == 0) { - kmem_free((vm_offset_t)mem, size); - mem = NULL; - } - } else { - *dma_handle = 0; - } - return (mem); -} - #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) -dma_addr_t -linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +static dma_addr_t +linux_dma_map_phys_common(struct device *dev, vm_paddr_t phys, size_t len, + bus_dma_tag_t dmat) { struct linux_dma_priv *priv; struct linux_dma_obj *obj; @@ -820,25 +828,26 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) * bus_dma API. This avoids tracking collisions in the pctrie * with the additional benefit of reducing overhead. */ - if (bus_dma_id_mapped(priv->dmat, phys, len)) + if (bus_dma_id_mapped(dmat, phys, len)) return (phys); obj = uma_zalloc(linux_dma_obj_zone, M_NOWAIT); if (obj == NULL) { return (0); } + obj->dmat = dmat; DMA_PRIV_LOCK(priv); - if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + if (bus_dmamap_create(obj->dmat, 0, &obj->dmamap) != 0) { DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } nseg = -1; - if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, + if (_bus_dmamap_load_phys(obj->dmat, obj->dmamap, phys, len, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); @@ -849,8 +858,8 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); if (error != 0) { - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(obj->dmat, obj->dmamap); + bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); @@ -859,13 +868,23 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) return (obj->dma_addr); } #else -dma_addr_t -linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +static dma_addr_t +linux_dma_map_phys_common(struct device *dev __unused, vm_paddr_t phys, + size_t len __unused, bus_dma_tag_t dmat __unused) { return (phys); } #endif +dma_addr_t +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +{ + struct linux_dma_priv *priv; + + priv = dev->dma_priv; + return (linux_dma_map_phys_common(dev, phys, len, priv->dmat)); +} + #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) @@ -885,8 +904,8 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, dma_addr); - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(obj->dmat, obj->dmamap); + bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); @@ -898,6 +917,43 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) } #endif +void * +linux_dma_alloc_coherent(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t flag) +{ + struct linux_dma_priv *priv; + vm_paddr_t high; + size_t align; + void *mem; + + if (dev == NULL || dev->dma_priv == NULL) { + *dma_handle = 0; + return (NULL); + } + priv = dev->dma_priv; + if (priv->dma_coherent_mask) + high = priv->dma_coherent_mask; + else + /* Coherent is lower 32bit only by default in Linux. */ + high = BUS_SPACE_MAXADDR_32BIT; + align = PAGE_SIZE << get_order(size); + /* Always zero the allocation. */ + flag |= M_ZERO; + mem = (void *)kmem_alloc_contig(size, flag & GFP_NATIVE_MASK, 0, high, + align, 0, VM_MEMATTR_DEFAULT); + if (mem != NULL) { + *dma_handle = linux_dma_map_phys_common(dev, vtophys(mem), size, + priv->dmat_coherent); + if (*dma_handle == 0) { + kmem_free((vm_offset_t)mem, size); + mem = NULL; + } + } else { + *dma_handle = 0; + } + return (mem); +} + int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, enum dma_data_direction dir __unused, unsigned long attrs __unused) From nobody Fri Nov 19 00:02:27 2021 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 D06AD188F4C8; Fri, 19 Nov 2021 00:02:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0h2nKXz4vtt; Fri, 19 Nov 2021 00:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FFB11E2CF; Fri, 19 Nov 2021 00:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02RD3072254; Fri, 19 Nov 2021 00:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02RuP072253; Fri, 19 Nov 2021 00:02:27 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:27 GMT Message-Id: <202111190002.1AJ02RuP072253@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: 870e31d839c6 - stable/13 - LinuxKPI: disable device_release_driver() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 870e31d839c69a5d90e56399a55a7d30d556c126 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=870e31d839c69a5d90e56399a55a7d30d556c126 commit 870e31d839c69a5d90e56399a55a7d30d556c126 Author: Bjoern A. Zeeb AuthorDate: 2021-09-27 17:38:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 LinuxKPI: disable device_release_driver() As reported by multiple people testing iwlwifi, device_release_driver() can lead to a panic on secondary errors (usually during attach). Disable device_release_driver() for the short-term to prevent the panic but leave it in place so it can be re-worked and fixed properly for the long-term more easily. Sponsored by: The FreeBSD Foundation (cherry picked from commit 93b14194acaf2c2d80df9c4900a90c6644dcd92b) --- sys/compat/linuxkpi/common/include/linux/device.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 4bdc3b831e58..abafcd7ba5c4 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -506,6 +506,9 @@ static inline void device_release_driver(struct device *dev) { +#if 0 + /* This leads to panics. Disable temporarily. Keep to rework. */ + /* We also need to cleanup LinuxKPI bits. What else? */ lkpi_devres_release_free_list(dev); dev_set_drvdata(dev, NULL); @@ -515,6 +518,7 @@ device_release_driver(struct device *dev) if (device_is_attached(dev->bsddev)) device_detach(dev->bsddev); mtx_unlock(&Giant); +#endif } static inline int From nobody Fri Nov 19 00:02:31 2021 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 BBB80188F63B; Fri, 19 Nov 2021 00:02:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0m16lPz4vpn; Fri, 19 Nov 2021 00:02:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAD911E2D2; Fri, 19 Nov 2021 00:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02VSK072356; Fri, 19 Nov 2021 00:02:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02V5v072355; Fri, 19 Nov 2021 00:02:31 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:31 GMT Message-Id: <202111190002.1AJ02V5v072355@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: 41ca1d50a865 - stable/13 - net80211: mitigation against A-MSDU design flaw 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 41ca1d50a8657959df2009daa300dda56a090d5e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=41ca1d50a8657959df2009daa300dda56a090d5e commit 41ca1d50a8657959df2009daa300dda56a090d5e Author: Mathy Vanhoef AuthorDate: 2021-06-06 22:10:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 net80211: mitigation against A-MSDU design flaw Mitigate A-MSDU injection attacks by detecting if the destination address of a subframe equals an RFC1042 (i.e., LLC/SNAP) header, and if so dropping the complete A-MSDU frame. This mitigates known attacks, although new (unknown) aggregation-based attacks may remain possible. This defense works because in A-MSDU aggregation injection attacks, a normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042 header. In other words, the destination MAC address of the first A-MSDU subframe contains the start of an RFC1042 header during an aggregation attack. We can detect this and thereby prevent this specific attack. This relates to section 7.2 in the 2021 Usenix "FragAttacks" (Fragment and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation) paper. Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be) Security: CVE-2020-24588 PR: 256119 (cherry picked from commit f024bdf1155f36d2d8c4caa533b66e4040c4c469) --- sys/net80211/ieee80211_adhoc.c | 2 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_input.c | 20 ++++++++++++++++++-- sys/net80211/ieee80211_input.h | 3 ++- sys/net80211/ieee80211_sta.c | 2 +- sys/net80211/ieee80211_wds.c | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index a23f138802dc..e2164bbb46a1 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -558,7 +558,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 15d42a682355..75fa1c0f7b31 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -744,7 +744,7 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index eaeceb9d228e..66a5ba1c4035 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -309,7 +309,8 @@ ieee80211_deliver_data(struct ieee80211vap *vap, } struct mbuf * -ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen) +ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen, + uint8_t qos) { struct ieee80211_qosframe_addr4 wh; struct ether_header *eh; @@ -331,7 +332,9 @@ ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen) llc->llc_snap.org_code[1] == 0 && llc->llc_snap.org_code[2] == 0 && /* NB: preserve AppleTalk frames that have a native SNAP hdr */ !(llc->llc_snap.ether_type == htons(ETHERTYPE_AARP) || - llc->llc_snap.ether_type == htons(ETHERTYPE_IPX))) { + llc->llc_snap.ether_type == htons(ETHERTYPE_IPX)) && + /* Do not want to touch A-MSDU frames. */ + !(qos & IEEE80211_QOS_AMSDU)) { m_adj(m, hdrlen + sizeof(struct llc) - sizeof(*eh)); llc = NULL; } else { @@ -379,6 +382,10 @@ ieee80211_decap1(struct mbuf *m, int *framelen) #define FF_LLC_SIZE (sizeof(struct ether_header) + sizeof(struct llc)) struct ether_header *eh; struct llc *llc; + const uint8_t llc_hdr_mac[ETHER_ADDR_LEN] = { + /* MAC address matching the 802.2 LLC header */ + LLC_SNAP_LSAP, LLC_SNAP_LSAP, LLC_UI, 0, 0, 0 + }; /* * The frame has an 802.3 header followed by an 802.2 @@ -391,6 +398,15 @@ ieee80211_decap1(struct mbuf *m, int *framelen) if (m->m_len < FF_LLC_SIZE && (m = m_pullup(m, FF_LLC_SIZE)) == NULL) return NULL; eh = mtod(m, struct ether_header *); /* 802.3 header is first */ + + /* + * Detect possible attack where a single 802.11 frame is processed + * as an A-MSDU frame due to an adversary setting the A-MSDU present + * bit in the 802.11 QoS header. [FragAttacks] + */ + if (memcmp(eh->ether_dhost, llc_hdr_mac, ETHER_ADDR_LEN) == 0) + return NULL; + llc = (struct llc *)&eh[1]; /* 802.2 header follows */ *framelen = ntohs(eh->ether_type) /* encap'd frame size */ + sizeof(struct ether_header) - sizeof(struct llc); diff --git a/sys/net80211/ieee80211_input.h b/sys/net80211/ieee80211_input.h index 61e3099cb0a4..2192bba405d2 100644 --- a/sys/net80211/ieee80211_input.h +++ b/sys/net80211/ieee80211_input.h @@ -311,7 +311,8 @@ void ieee80211_deliver_data(struct ieee80211vap *, struct mbuf *ieee80211_defrag(struct ieee80211_node *, struct mbuf *, int, int); struct mbuf *ieee80211_realign(struct ieee80211vap *, struct mbuf *, size_t); -struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int); +struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int, + uint8_t); struct mbuf *ieee80211_decap1(struct mbuf *, int *); int ieee80211_setup_rates(struct ieee80211_node *ni, const uint8_t *rates, const uint8_t *xrates, int flags); diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 6d24eadc11a6..60a5ea100556 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -827,7 +827,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index f59a92b992d7..f88871ca4ae6 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -621,7 +621,7 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = ieee80211_decap(vap, m, hdrspace, qos); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ From nobody Fri Nov 19 00:02:30 2021 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 A82C9188F456; Fri, 19 Nov 2021 00:02:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0l3jBSz4vdt; Fri, 19 Nov 2021 00:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F0B1E53E; Fri, 19 Nov 2021 00:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02USp072332; Fri, 19 Nov 2021 00:02:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02UII072331; Fri, 19 Nov 2021 00:02:30 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:30 GMT Message-Id: <202111190002.1AJ02UII072331@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: e13d483c5677 - stable/13 - net80211: reject mixed plaintext/encrypted fragments 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e13d483c5677d12b52f1c81537d54faa85ed43b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e13d483c5677d12b52f1c81537d54faa85ed43b9 commit e13d483c5677d12b52f1c81537d54faa85ed43b9 Author: Mathy Vanhoef AuthorDate: 2021-06-06 22:10:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 net80211: reject mixed plaintext/encrypted fragments ieee80211_defrag() accepts fragmented 802.11 frames in a protected Wi-Fi network even when some of the fragments are not encrypted. Track whether the fragments are encrypted or not and only accept successive ones if they match the state of the first fragment. This relates to section 6.3 in the 2021 Usenix "FragAttacks" (Fragment and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation) paper. Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be) Security: CVE-2020-26147 PR: 256118 (cherry picked from commit 11572d7d7fb9802ceb46ea9dc6cbe3bb95373e55) --- sys/net80211/ieee80211_adhoc.c | 2 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_input.c | 21 ++++++++++++++++++--- sys/net80211/ieee80211_input.h | 2 +- sys/net80211/ieee80211_mesh.c | 2 +- sys/net80211/ieee80211_sta.c | 2 +- sys/net80211/ieee80211_wds.c | 2 +- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index ea1519b3381d..a23f138802dc 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -531,7 +531,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 16a3d97ae7f2..15d42a682355 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -719,7 +719,7 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index aa557fc1ec24..eaeceb9d228e 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -170,7 +170,8 @@ ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m) * XXX should handle 3 concurrent reassemblies per-spec. */ struct mbuf * -ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) +ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace, + int has_decrypted) { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); @@ -189,6 +190,11 @@ ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) if (!more_frag && fragno == 0 && ni->ni_rxfrag[0] == NULL) return m; + /* Temporarily set flag to remember if fragment was encrypted. */ + /* XXX use a non-packet altering storage for this in the future. */ + if (has_decrypted) + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; + /* * Remove frag to insure it doesn't get reaped by timer. */ @@ -219,10 +225,14 @@ ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) lwh = mtod(mfrag, struct ieee80211_frame *); last_rxseq = le16toh(*(uint16_t *)lwh->i_seq); - /* NB: check seq # and frag together */ + /* + * NB: check seq # and frag together. Also check that both + * fragments are plaintext or that both are encrypted. + */ if (rxseq == last_rxseq+1 && IEEE80211_ADDR_EQ(wh->i_addr1, lwh->i_addr1) && - IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2)) { + IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2) && + !((wh->i_fc[1] ^ lwh->i_fc[1]) & IEEE80211_FC1_PROTECTED)) { /* XXX clear MORE_FRAG bit? */ /* track last seqnum and fragno */ *(uint16_t *) lwh->i_seq = *(uint16_t *) wh->i_seq; @@ -253,6 +263,11 @@ ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace) ni->ni_rxfrag[0] = mfrag; mfrag = NULL; } + /* Remember to clear protected flag that was temporarily set. */ + if (mfrag != NULL) { + wh = mtod(mfrag, struct ieee80211_frame *); + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; + } return mfrag; } diff --git a/sys/net80211/ieee80211_input.h b/sys/net80211/ieee80211_input.h index 7456fc68b365..61e3099cb0a4 100644 --- a/sys/net80211/ieee80211_input.h +++ b/sys/net80211/ieee80211_input.h @@ -309,7 +309,7 @@ fail: void ieee80211_deliver_data(struct ieee80211vap *, struct ieee80211_node *, struct mbuf *); struct mbuf *ieee80211_defrag(struct ieee80211_node *, - struct mbuf *, int); + struct mbuf *, int, int); struct mbuf *ieee80211_realign(struct ieee80211vap *, struct mbuf *, size_t); struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int); struct mbuf *ieee80211_decap1(struct mbuf *, int *); diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 48a3590d0cf3..63c207d7900b 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -1642,7 +1642,7 @@ mesh_input(struct ieee80211_node *ni, struct mbuf *m, */ hdrspace = ieee80211_hdrspace(ic, wh); if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, 0); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 43dc8b6dfeca..6d24eadc11a6 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -795,7 +795,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index 8eaffcf87733..f59a92b992d7 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -594,7 +594,7 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, * Next up, any fragmentation. */ if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); + m = ieee80211_defrag(ni, m, hdrspace, has_decrypted); if (m == NULL) { /* Fragment dropped or frame not complete yet */ goto out; From nobody Fri Nov 19 00:02:34 2021 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 78DDB188F64A; Fri, 19 Nov 2021 00:02:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0p28vCz4vf6; Fri, 19 Nov 2021 00:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2147B1E4A9; Fri, 19 Nov 2021 00:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02YH0072404; Fri, 19 Nov 2021 00:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02Y1r072403; Fri, 19 Nov 2021 00:02:34 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:34 GMT Message-Id: <202111190002.1AJ02Y1r072403@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: ab5678c6c0d0 - stable/13 - net80211: proper ssid length check in setmlme_assoc_adhoc() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: ab5678c6c0d0b28feafdb2fd397866d6088f37d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ab5678c6c0d0b28feafdb2fd397866d6088f37d8 commit ab5678c6c0d0b28feafdb2fd397866d6088f37d8 Author: Bjoern A. Zeeb AuthorDate: 2021-10-06 18:41:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:25 +0000 net80211: proper ssid length check in setmlme_assoc_adhoc() A user supplied SSID length is used without proper checks in setmlme_assoc_adhoc() which can lead to copies beyond the end of the user supplied buffer. The ssid is a fixed size array for the ioctl and the argument to setmlme_assoc_adhoc(). In addition to an ssid_len check of 0 also error in case the ssid_len is larger than the size of the ssid array to prevent problems. PR: 254737 Reported by: Tommaso (cutesmilee.research protonmail.com) (cherry picked from commit 526370fb85db4b659cff4625eb2f379acaa4a1a8) (cherry picked from commit 0525ece3554edce14fa68a7fb61078ae2110c44b) --- sys/net80211/ieee80211_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 2fef9ac0084a..419518eb1224 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1591,7 +1591,7 @@ setmlme_assoc_adhoc(struct ieee80211vap *vap, ("expected opmode IBSS or AHDEMO not %s", ieee80211_opmode_name[vap->iv_opmode])); - if (ssid_len == 0) + if (ssid_len == 0 || ssid_len > IEEE80211_NWID_LEN) return EINVAL; sr = IEEE80211_MALLOC(sizeof(*sr), M_TEMP, From nobody Fri Nov 19 00:02:32 2021 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 CE821188F46B; Fri, 19 Nov 2021 00:02:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0p11C6z4vf4; Fri, 19 Nov 2021 00:02:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11F1C1E2D4; Fri, 19 Nov 2021 00:02:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02W2n072380; Fri, 19 Nov 2021 00:02:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02WYv072379; Fri, 19 Nov 2021 00:02:32 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:32 GMT Message-Id: <202111190002.1AJ02WYv072379@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: 8b2ba742cc2c - stable/13 - net80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 8b2ba742cc2c732bc4bc1d43f8256adce06657d0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8b2ba742cc2c732bc4bc1d43f8256adce06657d0 commit 8b2ba742cc2c732bc4bc1d43f8256adce06657d0 Author: Mathy Vanhoef AuthorDate: 2021-06-06 22:10:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:25 +0000 net80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames No longer accept plaintext A-MSDU frames that start with an RFC1042 header with EtherType EAPOL. This is done by only accepting EAPOL packets that are included in non-aggregated 802.11 frames. Note that before this patch, FreeBSD also only accepted EAPOL frames that are sent in a non-aggregated 802.11 frame due to bugs in processing EAPOL packets inside A-MSDUs. In other words, compatibility with legitimate devices remains the same. This relates to section 6.5 in the 2021 Usenix "FragAttacks" (Fragment and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation) paper. Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be) Security: CVE-2020-26144 PR: 256120 (cherry picked from commit ffc19cf52da5546973965f78cf32aa0f2c9657f8) --- sys/net80211/ieee80211_adhoc.c | 18 ++++++++++++------ sys/net80211/ieee80211_hostap.c | 18 ++++++++++++------ sys/net80211/ieee80211_sta.c | 18 ++++++++++++------ sys/net80211/ieee80211_wds.c | 18 ++++++++++++------ 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index e2164bbb46a1..150515222268 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -571,7 +571,10 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -581,11 +584,13 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -598,7 +603,8 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 75fa1c0f7b31..4fa9c6a72145 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -757,7 +757,10 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -767,11 +770,13 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -784,7 +789,8 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 60a5ea100556..cd62266ab942 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -840,7 +840,10 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -850,11 +853,13 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -867,7 +872,8 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index f88871ca4ae6..b73988b10d5e 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -634,7 +634,10 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - eh = mtod(m, struct ether_header *); + if (!(qos & IEEE80211_QOS_AMSDU)) + eh = mtod(m, struct ether_header *); + else + eh = NULL; if (!ieee80211_node_is_authorized(ni)) { /* * Deny any non-PAE frames received prior to @@ -644,11 +647,13 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, * the port is not marked authorized by the * authenticator until the handshake has completed. */ - if (eh->ether_type != htons(ETHERTYPE_PAE)) { + if (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, - eh->ether_shost, "data", - "unauthorized port: ether type 0x%x len %u", - eh->ether_type, m->m_pkthdr.len); + ni->ni_macaddr, "data", "unauthorized or " + "unknown port: ether type 0x%x len %u", + eh == NULL ? -1 : eh->ether_type, + m->m_pkthdr.len); vap->iv_stats.is_rx_unauth++; IEEE80211_NODE_STAT(ni, rx_unauth); goto err; @@ -661,7 +666,8 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, if ((vap->iv_flags & IEEE80211_F_DROPUNENC) && ((has_decrypted == 0) && (m->m_flags & M_WEP) == 0) && (is_hw_decrypted == 0) && - eh->ether_type != htons(ETHERTYPE_PAE)) { + (eh == NULL || + eh->ether_type != htons(ETHERTYPE_PAE))) { /* * Drop unencrypted frames. */ From nobody Fri Nov 19 00:02:35 2021 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 D9F76188F47C; Fri, 19 Nov 2021 00:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0r4HY2z3BmQ; Fri, 19 Nov 2021 00:02:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B2C31E4AA; Fri, 19 Nov 2021 00:02:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02ZPF072432; Fri, 19 Nov 2021 00:02:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02Z4x072431; Fri, 19 Nov 2021 00:02:35 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:35 GMT Message-Id: <202111190002.1AJ02Z4x072431@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: 32c2c00e3f90 - stable/13 - net80211: correct length check in ieee80211_ies_expand() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 32c2c00e3f90d3a01a03ebdf7131c7e300da034c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=32c2c00e3f90d3a01a03ebdf7131c7e300da034c commit 32c2c00e3f90d3a01a03ebdf7131c7e300da034c Author: Bjoern A. Zeeb AuthorDate: 2021-10-06 18:09:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:25 +0000 net80211: correct length check in ieee80211_ies_expand() In ieee80211_ies_expand() we are looping over Elements (also known as Information Elements or IEs). The comment suggests that we assume well-formedness of the IEs themselves. Checking the buffer length being least 2 (1 byte Element ID and 1 byte Length fields) rather than just 1 before accessing ie[1] is still good practise and can prevent and out-of-bounds read in case the input is not behaving according to the comment. Reported by: (coypu sdf.org) admbugs: 857 (cherry picked from commit 09dd08f167812a5fdb516fc98f14dbb43221432f) --- sys/net80211/ieee80211_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 5a9677836dbd..3ddb82343efe 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1133,7 +1133,7 @@ ieee80211_ies_expand(struct ieee80211_ies *ies) ie = ies->data; ielen = ies->len; - while (ielen > 0) { + while (ielen > 1) { switch (ie[0]) { case IEEE80211_ELEMID_VENDOR: if (iswpaoui(ie)) From nobody Fri Nov 19 00:02:36 2021 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 17250188F6EA; Fri, 19 Nov 2021 00:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0s4gFDz3BpR; Fri, 19 Nov 2021 00:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74E6A1E59C; Fri, 19 Nov 2021 00:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02afm072458; Fri, 19 Nov 2021 00:02:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02aLk072457; Fri, 19 Nov 2021 00:02:36 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:36 GMT Message-Id: <202111190002.1AJ02aLk072457@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: 8a5ff0163853 - stable/13 - net80211: correct input_sta length checks and control frame 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 8a5ff0163853a4ccda3aaf5bbce33dfc6bbff4b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8a5ff0163853a4ccda3aaf5bbce33dfc6bbff4b8 commit 8a5ff0163853a4ccda3aaf5bbce33dfc6bbff4b8 Author: Bjoern A. Zeeb AuthorDate: 2021-09-30 16:41:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:25 +0000 net80211: correct input_sta length checks and control frame handling Correct input_sta "assertion" checks. CTS/ACK CTRL frames are shorter then sizeof(struct ieee80211_frame_min) and were thus running into the is_rx_tooshort error case. Use ieee80211_anyhdrsize() to handle this better but make sure we do at least have the first 2 octets needed for that. While here move the safety checks before any code which may not obey them later, just for good style. The non-scanning check further down assumes a frame format also not matching control frames. For now skip the checks for control frames which allows us to deal with some of them at least now. Sponsored by: The FreeBSD Foundation Obtained from: 20210906 wireless v0.91 code drop (cherry picked from commit 3dc7a1897e0bb9e4b529c01cb3f88e1c387af5e8) --- sys/net80211/ieee80211_sta.c | 66 +++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index cd62266ab942..7ea6187332b1 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -552,6 +552,35 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, int is_hw_decrypted = 0; int has_decrypted = 0; + KASSERT(ni != NULL, ("%s: null node, mbuf %p", __func__, m)); + + /* Early init in case of early error case. */ + type = -1; + + /* + * Bit of a cheat here, we use a pointer for a 3-address + * frame format but don't reference fields past outside + * ieee80211_frame_min (or other shorter frames) w/o first + * validating the data is present. + */ + wh = mtod(m, struct ieee80211_frame *); + + if (m->m_pkthdr.len < 2 || m->m_pkthdr.len < ieee80211_anyhdrsize(wh)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, + ni->ni_macaddr, NULL, + "too short (1): len %u", m->m_pkthdr.len); + vap->iv_stats.is_rx_tooshort++; + goto err; + } + if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != + IEEE80211_FC0_VERSION_0) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); + vap->iv_stats.is_rx_badversion++; + goto err; + } + /* * Some devices do hardware decryption all the way through * to pretending the frame wasn't encrypted in the first place. @@ -569,7 +598,6 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, * with the M_AMPDU_MPDU flag and we can bypass most of * the normal processing. */ - wh = mtod(m, struct ieee80211_frame *); type = IEEE80211_FC0_TYPE_DATA; dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; subtype = IEEE80211_FC0_SUBTYPE_QOS; @@ -577,39 +605,19 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, goto resubmit_ampdu; } - KASSERT(ni != NULL, ("null node")); ni->ni_inact = ni->ni_inact_reload; - type = -1; /* undefined */ - - if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, - "too short (1): len %u", m->m_pkthdr.len); - vap->iv_stats.is_rx_tooshort++; - goto out; - } - /* - * Bit of a cheat here, we use a pointer for a 3-address - * frame format but don't reference fields past outside - * ieee80211_frame_min w/o first validating the data is - * present. - */ - wh = mtod(m, struct ieee80211_frame *); - - if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != - IEEE80211_FC0_VERSION_0) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", - wh->i_fc[0], wh->i_fc[1]); - vap->iv_stats.is_rx_badversion++; - goto err; - } - dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { + /* + * Control frames are not folowing the header scheme of data and mgmt + * frames so we do not apply extra checks here. + * We probably should do checks on RA (+TA) where available for those + * too, but for now do not drop them. + */ + if (type != IEEE80211_FC0_TYPE_CTL && + (ic->ic_flags & IEEE80211_F_SCAN) == 0) { bssid = wh->i_addr2; if (!IEEE80211_ADDR_EQ(bssid, ni->ni_bssid)) { /* not interested in */ From nobody Fri Nov 19 00:02:37 2021 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 A8CFA188F82A; Fri, 19 Nov 2021 00:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0v6k5mz4vnM; Fri, 19 Nov 2021 00:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90C931E4AB; Fri, 19 Nov 2021 00:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02bRR072482; Fri, 19 Nov 2021 00:02:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02bVD072481; Fri, 19 Nov 2021 00:02:37 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:37 GMT Message-Id: <202111190002.1AJ02bVD072481@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: 6acb9d5f955b - stable/13 - net80211/drivers: improve ieee80211_rx_stats for band 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6acb9d5f955b8b431c223be3910aa6dcacf1d457 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6acb9d5f955b8b431c223be3910aa6dcacf1d457 commit 6acb9d5f955b8b431c223be3910aa6dcacf1d457 Author: Bjoern A. Zeeb AuthorDate: 2021-06-06 21:14:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:25 +0000 net80211/drivers: improve ieee80211_rx_stats for band While IEEE80211_R_BAND was defined, there was no place to store the band. Add a field for that, adjust ieee80211_lookup_channel_rxstatus() to require it, and update drivers passing "R_{FREQ|IEEE}" in already to provide the band as well. For the moment keep the fall-back code requiring all three fields. Sponsored by: The FreeBSD Foundation (cherry picked from commit 9a6695532b3997e4e2bc3fe57481cc49be5e9e93) --- sys/dev/iwm/if_iwm.c | 5 +++++ sys/dev/rtwn/rtl8188e/r88e_rx.c | 2 ++ sys/dev/rtwn/rtl8812a/r12a_rx.c | 2 ++ sys/dev/usb/wlan/if_rsu.c | 2 ++ sys/net80211/_ieee80211.h | 3 +++ sys/net80211/ieee80211.c | 17 ++++++++++++++--- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index b89c895efb50..f994e8e75307 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -3303,12 +3303,15 @@ iwm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, */ bzero(&rxs, sizeof(rxs)); rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_BAND; rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; rxs.c_ieee = le16toh(phy_info->channel); if (le16toh(phy_info->phy_flags & IWM_RX_RES_PHY_FLAGS_BAND_24)) { rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ); + rxs.c_band = IEEE80211_CHAN_2GHZ; } else { rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ); + rxs.c_band = IEEE80211_CHAN_5GHZ; } /* rssi is in 1/2db units */ @@ -3414,10 +3417,12 @@ iwm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, */ bzero(&rxs, sizeof(rxs)); rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_BAND; rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; rxs.c_ieee = channel; rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ); + rxs.c_band = channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ; /* rssi is in 1/2db units */ rxs.c_rssi = rssi * 2; diff --git a/sys/dev/rtwn/rtl8188e/r88e_rx.c b/sys/dev/rtwn/rtl8188e/r88e_rx.c index dad1bc56446a..16510839bd44 100644 --- a/sys/dev/rtwn/rtl8188e/r88e_rx.c +++ b/sys/dev/rtwn/rtl8188e/r88e_rx.c @@ -240,8 +240,10 @@ r88e_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, if (!sc->sc_ht40) { /* XXX center channel */ rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs->r_flags |= IEEE80211_R_BAND; rxs->c_ieee = physt->chan; rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee, IEEE80211_CHAN_2GHZ); + rxs->c_band = IEEE80211_CHAN_2GHZ; } } diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c index d8dcb3de12c5..98e0cabdff7c 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_rx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c @@ -321,8 +321,10 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, */ #if 0 rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs->r_flags |= IEEE80211_R_BAND; rxs->c_ieee = MS(le16toh(physt->phyw1), R12A_PHYW1_CHAN); rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee, (rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ); + rxs->c_band = (rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ; #endif } diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c index f2dc6657026e..ff0ec77b476c 100644 --- a/sys/dev/usb/wlan/if_rsu.c +++ b/sys/dev/usb/wlan/if_rsu.c @@ -2081,9 +2081,11 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) /* Set channel flags for input path */ bzero(&rxs, sizeof(rxs)); rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_BAND; rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; rxs.c_ieee = le32toh(bss->config.dsconfig); rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ); + rxs.c_band = IEEE80211_CHAN_2GHZ; /* This is a number from 0..100; so let's just divide it down a bit */ rxs.c_rssi = le32toh(bss->rssi) / 2; rxs.c_nf = -96; diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index dc6773afac09..754e4647e82f 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -612,6 +612,9 @@ struct ieee80211_rx_stats { uint8_t c_ieee; /* Channel */ uint8_t c_width; /* channel width, FW flags above */ + /* 32 bits */ + uint32_t c_band; /* Band; XXX we do not have a real band. */ + /* Force alignment to DWORD */ union { uint8_t evm[IEEE80211_MAX_CHAINS][IEEE80211_MAX_EVM_PILOTS]; diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 2e98e67edc47..35cf7abdbf3b 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1818,6 +1818,8 @@ ieee80211_lookup_channel_rxstatus(struct ieee80211vap *vap, return (NULL); if ((rxs->r_flags & IEEE80211_R_IEEE) == 0) return (NULL); + if ((rxs->r_flags & IEEE80211_R_BAND) == 0) + return (NULL); /* * If the rx status contains a valid ieee/freq, then @@ -1828,11 +1830,20 @@ ieee80211_lookup_channel_rxstatus(struct ieee80211vap *vap, */ /* Determine a band */ - /* XXX should be done by the driver? */ - if (rxs->c_freq < 3000) { + switch (rxs->c_band) { + case IEEE80211_CHAN_2GHZ: flags = IEEE80211_CHAN_G; - } else { + break; + case IEEE80211_CHAN_5GHZ: flags = IEEE80211_CHAN_A; + break; + default: + if (rxs->c_freq < 3000) { + flags = IEEE80211_CHAN_G; + } else { + flags = IEEE80211_CHAN_A; + } + break; } /* Channel lookup */ From nobody Fri Nov 19 00:02:38 2021 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 1B0CB188F997; Fri, 19 Nov 2021 00:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0w3Bfhz3Bpc; Fri, 19 Nov 2021 00:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE2C91E6E7; Fri, 19 Nov 2021 00:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02cpF072506; Fri, 19 Nov 2021 00:02:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02csk072505; Fri, 19 Nov 2021 00:02:38 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:38 GMT Message-Id: <202111190002.1AJ02csk072505@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: aaf336415117 - stable/13 - LinuxKPI: add netdev_features.h 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: aaf336415117e128e770dee26b8227b641af1902 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=aaf336415117e128e770dee26b8227b641af1902 commit aaf336415117e128e770dee26b8227b641af1902 Author: Bjoern A. Zeeb AuthorDate: 2021-10-25 16:50:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:25 +0000 LinuxKPI: add netdev_features.h Add netdev_features.h as a spearate file from the future netdevice.h implementation to avoid include problems with a future skbuff.h. Sponsored by: The FreeBSD Foundation (cherry picked from commit 490f9d8f0e7ce8c5b268fcd0806c5e00214eb5a7) --- .../common/include/linux/netdev_features.h | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/netdev_features.h b/sys/compat/linuxkpi/common/include/linux/netdev_features.h new file mode 100644 index 000000000000..a4901f4d48c3 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/netdev_features.h @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2020-2021 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __LKPI_LINUX_NETDEV_FEATURES_H_ +#define __LKPI_LINUX_NETDEV_FEATURES_H_ + +#include +#include + +typedef uint32_t netdev_features_t; + +#define NETIF_F_HIGHDMA BIT(0) +#define NETIF_F_SG BIT(1) +#define NETIF_F_IP_CSUM BIT(2) +#define NETIF_F_IPV6_CSUM BIT(3) +#define NETIF_F_TSO BIT(4) +#define NETIF_F_TSO6 BIT(5) +#define NETIF_F_RXCSUM BIT(6) + +#define NETIF_F_CSUM_MASK (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM) + +#endif /* __LKPI_LINUX_NETDEV_FEATURES_H_ */ From nobody Fri Nov 19 00:02:39 2021 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 1D094188F762; Fri, 19 Nov 2021 00:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0w3TNwz3Brr; Fri, 19 Nov 2021 00:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C60E11E705; Fri, 19 Nov 2021 00:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02d06072530; Fri, 19 Nov 2021 00:02:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02dXt072529; Fri, 19 Nov 2021 00:02:39 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:39 GMT Message-Id: <202111190002.1AJ02dXt072529@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: dc70c937b1d6 - stable/13 - LinuxKPI: pci.h / linux_pci.c rename pci_driver field 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: dc70c937b1d6972d8774cea69da7983bb447622c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dc70c937b1d6972d8774cea69da7983bb447622c commit dc70c937b1d6972d8774cea69da7983bb447622c Author: Bjoern A. Zeeb AuthorDate: 2021-10-25 17:15:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:26 +0000 LinuxKPI: pci.h / linux_pci.c rename pci_driver field Rename the struct pci_driver {} field to the list_head from links to node as a driver is actually initialsing this to {} which seems questionable but it will at least make us match the Linux structure field name. Reviewed by: manu, hselasky (cherry picked from commit cf899348420ce8839e32ddc30247b5d1c2b384f4) --- sys/compat/linuxkpi/common/include/linux/pci.h | 2 +- sys/compat/linuxkpi/common/src/linux_pci.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 4914bc247ebc..b2b87f993c1f 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -193,7 +193,7 @@ typedef int pci_power_t; struct pci_dev; struct pci_driver { - struct list_head links; + struct list_head node; char *name; const struct pci_device_id *id_table; int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 780ba38d18dd..db94bc08239e 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -242,7 +242,7 @@ linux_pci_find(device_t dev, const struct pci_device_id **idp) subdevice = pci_get_subdevice(dev); spin_lock(&pci_lock); - list_for_each_entry(pdrv, &pci_drivers, links) { + list_for_each_entry(pdrv, &pci_drivers, node) { for (id = pdrv->id_table; id->vendor != 0; id++) { if (vendor == id->vendor && (PCI_ANY_ID == id->device || device == id->device) && @@ -640,7 +640,7 @@ _linux_pci_register_driver(struct pci_driver *pdrv, devclass_t dc) linux_set_current(curthread); spin_lock(&pci_lock); - list_add(&pdrv->links, &pci_drivers); + list_add(&pdrv->node, &pci_drivers); spin_unlock(&pci_lock); pdrv->bsddriver.name = pdrv->name; pdrv->bsddriver.methods = pci_methods; @@ -734,7 +734,7 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) bus = devclass_find("pci"); spin_lock(&pci_lock); - list_del(&pdrv->links); + list_del(&pdrv->node); spin_unlock(&pci_lock); mtx_lock(&Giant); if (bus != NULL) @@ -750,7 +750,7 @@ linux_pci_unregister_drm_driver(struct pci_driver *pdrv) bus = devclass_find("vgapci"); spin_lock(&pci_lock); - list_del(&pdrv->links); + list_del(&pdrv->node); spin_unlock(&pci_lock); mtx_lock(&Giant); if (bus != NULL) From nobody Fri Nov 19 00:02:41 2021 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 8C36B188FA81; Fri, 19 Nov 2021 00:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0z20Kyz3Bmn; Fri, 19 Nov 2021 00:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111E61E2D5; Fri, 19 Nov 2021 00:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02f8k072584; Fri, 19 Nov 2021 00:02:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02f1T072583; Fri, 19 Nov 2021 00:02:41 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:41 GMT Message-Id: <202111190002.1AJ02f1T072583@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: 378083e18812 - stable/13 - mlx4: rename conflicting netdev_priv() to mlx4_netdev_priv() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 378083e18812e0a3537887cbab5a51a573cde802 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=378083e18812e0a3537887cbab5a51a573cde802 commit 378083e18812e0a3537887cbab5a51a573cde802 Author: Bjoern A. Zeeb AuthorDate: 2021-10-25 16:18:11 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:26 +0000 mlx4: rename conflicting netdev_priv() to mlx4_netdev_priv() netdev_priv() is a LinuxKPI function which was used with the old ifnet linux/netdevice.h implementation which was not adaptable to modern Linux drviers unless rewriting them for ifnet in first place which defeats the purpose. Rename the netdev_priv() calls in mlx4 to mlx4_netdev_priv() returning the ifnet softc to avoid conflicting symbol names with different implementations in the future. (cherry picked from commit 9d593d5a76f22a315d7c6ab99e5e76003ec2b3f5) --- sys/dev/mlx4/mlx4_en/en.h | 13 ++++++++++--- sys/dev/mlx4/mlx4_en/mlx4_en_main.c | 2 +- sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c | 34 +++++++++++++++++----------------- sys/dev/mlx4/mlx4_en/mlx4_en_port.c | 8 ++++---- sys/dev/mlx4/mlx4_en/mlx4_en_rx.c | 6 +++--- sys/dev/mlx4/mlx4_en/mlx4_en_tx.c | 16 ++++++++-------- sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c | 2 +- 7 files changed, 44 insertions(+), 37 deletions(-) diff --git a/sys/dev/mlx4/mlx4_en/en.h b/sys/dev/mlx4/mlx4_en/en.h index 4a8b4fbd5fd4..440b9a340221 100644 --- a/sys/dev/mlx4/mlx4_en/en.h +++ b/sys/dev/mlx4/mlx4_en/en.h @@ -39,13 +39,20 @@ #include #include #include -#include #include #include #ifdef CONFIG_MLX4_EN_DCB #include #endif +#include +#include + +#include +#include +#include +#include + #include #include #include @@ -655,7 +662,7 @@ struct mlx4_mac_entry { }; static inline void * -netdev_priv(const struct ifnet *dev) +mlx4_netdev_priv(const struct ifnet *dev) { return (dev->if_softc); } @@ -710,7 +717,7 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) spin_lock_bh(&cq->poll_lock); if ((cq->state & MLX4_CQ_LOCKED)) { struct ifnet *dev = cq->dev; - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_main.c b/sys/dev/mlx4/mlx4_en/mlx4_en_main.c index fe3adfe9c162..e328fb228982 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_main.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_main.c @@ -119,7 +119,7 @@ static void mlx4_en_event(struct mlx4_dev *dev, void *endev_ptr, case MLX4_DEV_EVENT_PORT_DOWN: if (!mdev->pndev[port]) return; - priv = netdev_priv(mdev->pndev[port]); + priv = mlx4_netdev_priv(mdev->pndev[port]); /* To prevent races, we poll the link state in a separate task rather than changing it here */ priv->link_state = event; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c index 672affcce623..14289cb20e13 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c @@ -65,7 +65,7 @@ static int mlx4_en_low_latency_recv(struct napi_struct *napi) { struct mlx4_en_cq *cq = container_of(napi, struct mlx4_en_cq, napi); struct ifnet *dev = cq->dev; - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; int done; @@ -291,7 +291,7 @@ static int mlx4_en_filter_rfs(struct ifnet *net_dev, const struct sk_buff *skb, u16 rxq_index, u32 flow_id) { - struct mlx4_en_priv *priv = netdev_priv(net_dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(net_dev); struct mlx4_en_filter *filter; const struct iphdr *ip; const __be16 *ports; @@ -402,7 +402,7 @@ static void mlx4_en_filter_rfs_expire(struct mlx4_en_priv *priv) static void mlx4_en_vlan_rx_add_vid(void *arg, struct ifnet *dev, u16 vid) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; int err; int idx; @@ -429,7 +429,7 @@ static void mlx4_en_vlan_rx_add_vid(void *arg, struct ifnet *dev, u16 vid) static void mlx4_en_vlan_rx_kill_vid(void *arg, struct ifnet *dev, u16 vid) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; int err; @@ -608,7 +608,7 @@ static void mlx4_en_put_qp(struct mlx4_en_priv *priv) static void mlx4_en_clear_uclist(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_addr_list *tmp, *uc_to_del; list_for_each_entry_safe(uc_to_del, tmp, &priv->uc_list, list) { @@ -637,7 +637,7 @@ static u_int mlx4_copy_addr(void *arg, struct sockaddr_dl *sdl, u_int cnt) static void mlx4_en_cache_uclist(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); mlx4_en_clear_uclist(dev); if_foreach_lladdr(dev, mlx4_copy_addr, priv); @@ -645,7 +645,7 @@ static void mlx4_en_cache_uclist(struct ifnet *dev) static void mlx4_en_clear_mclist(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_addr_list *tmp, *mc_to_del; list_for_each_entry_safe(mc_to_del, tmp, &priv->mc_list, list) { @@ -673,7 +673,7 @@ static u_int mlx4_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int count) static void mlx4_en_cache_mclist(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); mlx4_en_clear_mclist(dev); if_foreach_llmaddr(dev, mlx4_copy_maddr, priv); @@ -730,7 +730,7 @@ static void update_addr_list_flags(struct mlx4_en_priv *priv, static void mlx4_en_set_rx_mode(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); if (!priv->port_up) return; @@ -1260,7 +1260,7 @@ static void mlx4_en_linkstate(struct work_struct *work) int mlx4_en_start_port(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_cq *cq; struct mlx4_en_tx_ring *tx_ring; @@ -1453,7 +1453,7 @@ cq_err: void mlx4_en_stop_port(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_addr_list *addr_list, *tmp; int i; @@ -1603,7 +1603,7 @@ reset: static void mlx4_en_clear_stats(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; int i; @@ -1762,7 +1762,7 @@ struct en_port_attribute en_port_attr_##_name = __ATTR(_name, _mode, _show, _sto void mlx4_en_destroy_netdev(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; en_dbg(DRV, priv, "Destroying netdev on port:%d\n", priv->port); @@ -1817,7 +1817,7 @@ void mlx4_en_destroy_netdev(struct ifnet *dev) static int mlx4_en_change_mtu(struct ifnet *dev, int new_mtu) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; int err = 0; @@ -2353,7 +2353,7 @@ out: static int mlx4_en_set_ring_size(struct ifnet *dev, int rx_size, int tx_size) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; int port_up = 0; int err = 0; @@ -2427,7 +2427,7 @@ static int mlx4_en_set_tx_ring_size(SYSCTL_HANDLER_ARGS) static int mlx4_en_get_module_info(struct ifnet *dev, struct ethtool_modinfo *modinfo) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; int ret; u8 data[4]; @@ -2475,7 +2475,7 @@ static int mlx4_en_get_module_eeprom(struct ifnet *dev, struct ethtool_eeprom *ee, u8 *data) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; int offset = ee->offset; int i = 0, ret; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c index 9a0edac109f4..2e19130b9e96 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c @@ -74,7 +74,7 @@ int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv) int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port) { struct mlx4_en_query_port_context *qport_context; - struct mlx4_en_priv *priv = netdev_priv(mdev->pndev[port]); + struct mlx4_en_priv *priv = mlx4_netdev_priv(mdev->pndev[port]); struct mlx4_en_port_state *state = &priv->port_state; struct mlx4_cmd_mailbox *mailbox; int err; @@ -151,7 +151,7 @@ static u64 en_stats_adder(__be64 *start, __be64 *next, int num) static void mlx4_en_fold_software_stats(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; u64 packets, bytes; int i; @@ -188,7 +188,7 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) struct mlx4_en_stat_out_mbox *mlx4_en_stats; struct mlx4_en_stat_out_flow_control_mbox *flowstats; struct ifnet *dev = mdev->pndev[port]; - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_vport_stats *vport_stats = &priv->vport_stats; struct mlx4_cmd_mailbox *mailbox; u64 in_mod = reset << 8 | port; @@ -436,7 +436,7 @@ out: int mlx4_en_get_vport_stats(struct mlx4_en_dev *mdev, u8 port) { - struct mlx4_en_priv *priv = netdev_priv(mdev->pndev[port]); + struct mlx4_en_priv *priv = mlx4_netdev_priv(mdev->pndev[port]); struct mlx4_counter tmp_vport_stats; struct mlx4_en_vf_stats *vf_stats = &priv->vf_stats; int err, i, counter_index; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c index 8e7c410d1c55..56e8711c6599 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c @@ -340,7 +340,7 @@ void mlx4_en_set_num_rx_rings(struct mlx4_en_dev *mdev) void mlx4_en_calc_rx_buf(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); int eff_mtu = dev->if_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN + MLX4_NET_IP_ALIGN; @@ -737,7 +737,7 @@ mlx4_en_rss_hash(__be16 status, int udp_rss) #define CQE_FACTOR_INDEX(index, factor) (((index) << (factor)) + (factor)) int mlx4_en_process_rx_cq(struct ifnet *dev, struct mlx4_en_cq *cq, int budget) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_cqe *cqe; struct mlx4_en_rx_ring *ring = priv->rx_ring[cq->ring]; struct mlx4_en_rx_mbuf *mb_list; @@ -880,7 +880,7 @@ static int mlx4_en_poll_rx_cq(struct mlx4_en_cq *cq, int budget) void mlx4_en_rx_irq(struct mlx4_cq *mcq) { struct mlx4_en_cq *cq = container_of(mcq, struct mlx4_en_cq, mcq); - struct mlx4_en_priv *priv = netdev_priv(cq->dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(cq->dev); int done; // Shoot one within the irq context diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c index f3a41a15f8b6..34af99ae0340 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c @@ -310,7 +310,7 @@ done: int mlx4_en_free_tx_buf(struct ifnet *dev, struct mlx4_en_tx_ring *ring) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); int cnt = 0; /* Skip last polled descriptor */ @@ -347,7 +347,7 @@ mlx4_en_tx_ring_is_full(struct mlx4_en_tx_ring *ring) static int mlx4_en_process_tx_cq(struct ifnet *dev, struct mlx4_en_cq *cq) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_cq *mcq = &cq->mcq; struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring]; struct mlx4_cqe *cqe; @@ -423,7 +423,7 @@ static int mlx4_en_process_tx_cq(struct ifnet *dev, void mlx4_en_tx_irq(struct mlx4_cq *mcq) { struct mlx4_en_cq *cq = container_of(mcq, struct mlx4_en_cq, mcq); - struct mlx4_en_priv *priv = netdev_priv(cq->dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(cq->dev); struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring]; if (priv->port_up == 0 || !spin_trylock(&ring->comp_lock)) @@ -436,7 +436,7 @@ void mlx4_en_tx_irq(struct mlx4_cq *mcq) void mlx4_en_poll_tx_cq(unsigned long data) { struct mlx4_en_cq *cq = (struct mlx4_en_cq *) data; - struct mlx4_en_priv *priv = netdev_priv(cq->dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(cq->dev); struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring]; u32 inflight; @@ -606,7 +606,7 @@ SYSINIT(hashrandom_init, SI_SUB_RANDOM, SI_ORDER_ANY, &hashrandom_init, NULL); u16 mlx4_en_select_queue(struct ifnet *dev, struct mbuf *mb) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); u32 rings_p_up = priv->num_tx_rings_p_up; u32 up = 0; u32 queue_index; @@ -929,7 +929,7 @@ tx_drop: static int mlx4_en_transmit_locked(struct ifnet *ifp, int tx_ind, struct mbuf *mb) { - struct mlx4_en_priv *priv = netdev_priv(ifp); + struct mlx4_en_priv *priv = mlx4_netdev_priv(ifp); struct mlx4_en_tx_ring *ring = priv->tx_ring[tx_ind]; int err = 0; @@ -954,7 +954,7 @@ mlx4_en_transmit_locked(struct ifnet *ifp, int tx_ind, struct mbuf *mb) int mlx4_en_transmit(struct ifnet *dev, struct mbuf *m) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_tx_ring *ring; int i, err = 0; @@ -994,7 +994,7 @@ mlx4_en_transmit(struct ifnet *dev, struct mbuf *m) void mlx4_en_qflush(struct ifnet *dev) { - struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); if (priv->port_up == 0) return; diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c index 635040e723e2..78650726d291 100644 --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c @@ -148,7 +148,7 @@ static struct ifnet *mlx4_ib_get_netdev(struct ib_device *device, u8 port_num) if (upper) { struct ifnet *active; - active = bond_option_active_slave_get_rcu(netdev_priv(upper)); + active = bond_option_active_slave_get_rcu(mlx4_netdev_priv(upper)); if (active) dev = active; } From nobody Fri Nov 19 00:02:44 2021 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 B706C188F9B1; Fri, 19 Nov 2021 00:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH106Qd5z4vtD; Fri, 19 Nov 2021 00:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E3931E543; Fri, 19 Nov 2021 00:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02i1K072632; Fri, 19 Nov 2021 00:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02iLv072631; Fri, 19 Nov 2021 00:02:44 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:44 GMT Message-Id: <202111190002.1AJ02iLv072631@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: a6a1ab040f95 - stable/13 - LinuxKPI: add simple_open() to fs.h 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: a6a1ab040f95b8bd05a2c9172f68211a166b072b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a6a1ab040f95b8bd05a2c9172f68211a166b072b commit a6a1ab040f95b8bd05a2c9172f68211a166b072b Author: Bjoern A. Zeeb AuthorDate: 2021-10-25 16:44:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:26 +0000 LinuxKPI: add simple_open() to fs.h Add a dummy simple_open() to fs.h as we have for other (unsupported) functions. This is needed by a wireless driver. (cherry picked from commit 41dee251ee9ead2e5c7a33b1457db5742c584354) --- sys/compat/linuxkpi/common/include/linux/fs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index eaf806b6732c..f1892352d598 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -245,6 +245,12 @@ nonseekable_open(struct inode *inode, struct file *filp) return 0; } +static inline int +simple_open(struct inode *inode, struct file *filp) +{ + return 0; +} + extern unsigned int linux_iminor(struct inode *); #define iminor(...) linux_iminor(__VA_ARGS__) From nobody Fri Nov 19 00:02:40 2021 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 9A65D188F930; Fri, 19 Nov 2021 00:02:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH0y0jCFz4vnW; Fri, 19 Nov 2021 00:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8A061E541; Fri, 19 Nov 2021 00:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02ekg072554; Fri, 19 Nov 2021 00:02:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02eh5072553; Fri, 19 Nov 2021 00:02:40 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:40 GMT Message-Id: <202111190002.1AJ02eh5072553@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: c7fc9ca77946 - stable/13 - LinuxKPI: pci.h make pci_dev argument const for pci_{read,write}_config*() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: c7fc9ca779468264028e20912f3e7cb2ff984641 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c7fc9ca779468264028e20912f3e7cb2ff984641 commit c7fc9ca779468264028e20912f3e7cb2ff984641 Author: Bjoern A. Zeeb AuthorDate: 2021-10-25 17:06:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:26 +0000 LinuxKPI: pci.h make pci_dev argument const for pci_{read,write}_config*() Make the struct pci_dev argument to the pci_{read,write}_config*() functions "const" to match the Linux definition as some drivers try to pass in a const argument which we currently fail to honor. Sponsored by: The FreeBSD Foundation (cherry picked from commit ed5600f5329fad8b167bed0a5ae8a5f60d12258e) --- sys/compat/linuxkpi/common/include/linux/pci.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index b2b87f993c1f..c6737b7b2311 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -696,7 +696,7 @@ pci_disable_link_state(struct pci_dev *pdev, uint32_t flags) } static inline int -pci_read_config_byte(struct pci_dev *pdev, int where, u8 *val) +pci_read_config_byte(const struct pci_dev *pdev, int where, u8 *val) { *val = (u8)pci_read_config(pdev->dev.bsddev, where, 1); @@ -704,7 +704,7 @@ pci_read_config_byte(struct pci_dev *pdev, int where, u8 *val) } static inline int -pci_read_config_word(struct pci_dev *pdev, int where, u16 *val) +pci_read_config_word(const struct pci_dev *pdev, int where, u16 *val) { *val = (u16)pci_read_config(pdev->dev.bsddev, where, 2); @@ -712,7 +712,7 @@ pci_read_config_word(struct pci_dev *pdev, int where, u16 *val) } static inline int -pci_read_config_dword(struct pci_dev *pdev, int where, u32 *val) +pci_read_config_dword(const struct pci_dev *pdev, int where, u32 *val) { *val = (u32)pci_read_config(pdev->dev.bsddev, where, 4); @@ -720,7 +720,7 @@ pci_read_config_dword(struct pci_dev *pdev, int where, u32 *val) } static inline int -pci_write_config_byte(struct pci_dev *pdev, int where, u8 val) +pci_write_config_byte(const struct pci_dev *pdev, int where, u8 val) { pci_write_config(pdev->dev.bsddev, where, val, 1); @@ -728,7 +728,7 @@ pci_write_config_byte(struct pci_dev *pdev, int where, u8 val) } static inline int -pci_write_config_word(struct pci_dev *pdev, int where, u16 val) +pci_write_config_word(const struct pci_dev *pdev, int where, u16 val) { pci_write_config(pdev->dev.bsddev, where, val, 2); @@ -736,7 +736,7 @@ pci_write_config_word(struct pci_dev *pdev, int where, u16 val) } static inline int -pci_write_config_dword(struct pci_dev *pdev, int where, u32 val) +pci_write_config_dword(const struct pci_dev *pdev, int where, u32 val) { pci_write_config(pdev->dev.bsddev, where, val, 4); From nobody Fri Nov 19 00:02:43 2021 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 9F5EC188F7D4; Fri, 19 Nov 2021 00:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH102dLXz4vnc; Fri, 19 Nov 2021 00:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3458B1E542; Fri, 19 Nov 2021 00:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02htc072608; Fri, 19 Nov 2021 00:02:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02hwr072607; Fri, 19 Nov 2021 00:02:43 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:43 GMT Message-Id: <202111190002.1AJ02hwr072607@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: 009e6b6e71cb - stable/13 - LinuxKPI: module.h add MODULE_SUPPORTED_DEVICE() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 009e6b6e71cbfccfd935ee456cad4e547baee678 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=009e6b6e71cbfccfd935ee456cad4e547baee678 commit 009e6b6e71cbfccfd935ee456cad4e547baee678 Author: Bjoern A. Zeeb AuthorDate: 2021-10-25 16:39:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:26 +0000 LinuxKPI: module.h add MODULE_SUPPORTED_DEVICE() Add a dummy MODULE_SUPPORTED_DEVICE define as we do for other MODULE_* macros. This is needed by a wireless driver. (cherry picked from commit c5eec7b57c39b1dc4a63fea115a93d8d1628ff08) --- sys/compat/linuxkpi/common/include/linux/module.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/module.h b/sys/compat/linuxkpi/common/include/linux/module.h index cd5366bc52d0..2a4fdc5a11a9 100644 --- a/sys/compat/linuxkpi/common/include/linux/module.h +++ b/sys/compat/linuxkpi/common/include/linux/module.h @@ -50,6 +50,7 @@ #define MODULE_LICENSE(name) #define MODULE_INFO(tag, info) #define MODULE_FIRMWARE(firmware) +#define MODULE_SUPPORTED_DEVICE(name) #define THIS_MODULE ((struct module *)0) From nobody Fri Nov 19 00:02:47 2021 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 EB260188F97D; Fri, 19 Nov 2021 00:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH151GLQz3BsT; Fri, 19 Nov 2021 00:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8CC71E6E8; Fri, 19 Nov 2021 00:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02laP072710; Fri, 19 Nov 2021 00:02:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02lH0072709; Fri, 19 Nov 2021 00:02:47 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:47 GMT Message-Id: <202111190002.1AJ02lH0072709@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: 67efa8b29930 - stable/13 - net80211: add a driver-private pointer to struct ieee80211_node 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 67efa8b29930f12dae2bf237fa7c2ce1dafbd6b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=67efa8b29930f12dae2bf237fa7c2ce1dafbd6b1 commit 67efa8b29930f12dae2bf237fa7c2ce1dafbd6b1 Author: Bjoern A. Zeeb AuthorDate: 2021-10-31 19:08:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:27 +0000 net80211: add a driver-private pointer to struct ieee80211_node Add a void *ni_drv_data field to struct ieee80211_node that drivers can use to backtrack to their internal state from a net80211 node. Sponsored by: The FreeBSD Foundation (cherry picked from commit 917181dddf66a02958cf0a28e0c7c69e13e21af0) --- sys/net80211/ieee80211_node.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 07144fa0adb3..0e885440687c 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -260,6 +260,8 @@ struct ieee80211_node { /* U-APSD */ uint8_t ni_uapsd; /* U-APSD per-node flags matching WMM STA QoS Info field */ + void *ni_drv_data; /* driver specific */ + uint64_t ni_spare[3]; }; MALLOC_DECLARE(M_80211_NODE); From nobody Fri Nov 19 00:02:45 2021 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 65A03188F94E; Fri, 19 Nov 2021 00:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH136pnjz3Bvd; Fri, 19 Nov 2021 00:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83D4D1E545; Fri, 19 Nov 2021 00:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02jes072656; Fri, 19 Nov 2021 00:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02jUv072655; Fri, 19 Nov 2021 00:02:45 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:45 GMT Message-Id: <202111190002.1AJ02jUv072655@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: 4459c162792b - stable/13 - LinuxKPI: add kstrtou8() and kstrtou8_from_user() to kernel.h 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 4459c162792bd50296ccaf664f86fe7b748fc81a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4459c162792bd50296ccaf664f86fe7b748fc81a commit 4459c162792bd50296ccaf664f86fe7b748fc81a Author: Bjoern A. Zeeb AuthorDate: 2021-10-22 11:04:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:26 +0000 LinuxKPI: add kstrtou8() and kstrtou8_from_user() to kernel.h Analogous to the other sized version of kstrto[u]() and kstrtobool_from_user() add the "u8" versions needed by a driver. (cherry picked from commit b382b78503b56ad6b787b995b46418db27adaa61) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 0909e7fb78f3..c67a9b8e22b0 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -396,6 +396,24 @@ kstrtouint(const char *cp, unsigned int base, unsigned int *res) return (0); } +static inline int +kstrtou8(const char *cp, unsigned int base, u8 *res) +{ + char *end; + unsigned long temp; + + *res = temp = strtoul(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + if (temp != (u8)temp) + return (-ERANGE); + return (0); +} + static inline int kstrtou16(const char *cp, unsigned int base, u16 *res) { @@ -487,6 +505,21 @@ kstrtobool_from_user(const char __user *s, size_t count, bool *res) return (kstrtobool(buf, res)); } +static inline int +kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, + u8 *p) +{ + char buf[8] = {}; + + if (count > (sizeof(buf) - 1)) + count = (sizeof(buf) - 1); + + if (copy_from_user(buf, s, count)) + return (-EFAULT); + + return (kstrtou8(buf, base, p)); +} + #define min(x, y) ((x) < (y) ? (x) : (y)) #define max(x, y) ((x) > (y) ? (x) : (y)) From nobody Fri Nov 19 00:02:46 2021 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 EFC8C188FAAB; Fri, 19 Nov 2021 00:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH1472KMz3Bn9; Fri, 19 Nov 2021 00:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A309E1E706; Fri, 19 Nov 2021 00:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02khW072680; Fri, 19 Nov 2021 00:02:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02k7C072679; Fri, 19 Nov 2021 00:02:46 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:46 GMT Message-Id: <202111190002.1AJ02k7C072679@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: 9d2d8a27d017 - stable/13 - LinuxKPI: add strreplace() to string.h 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 9d2d8a27d017c19e685c78a9cb7c6802ea793749 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9d2d8a27d017c19e685c78a9cb7c6802ea793749 commit 9d2d8a27d017c19e685c78a9cb7c6802ea793749 Author: Bjoern A. Zeeb AuthorDate: 2021-10-22 11:00:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:26 +0000 LinuxKPI: add strreplace() to string.h Add strreplace() needed by a driver. (cherry picked from commit a5e2a27dca4bd5f4795b42ac598d4fff1c3a6eae) --- sys/compat/linuxkpi/common/include/linux/string.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 659a48d93596..a757464bf02b 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -167,6 +167,19 @@ str_has_prefix(const char *str, const char *prefix) return (strncmp(str, prefix, len) == 0 ? len : 0); } +static inline char * +strreplace(char *str, char old, char new) +{ + char *p; + + p = strchrnul(str, old); + while (p != NULL && *p != '\0') { + *p = new; + p = strchrnul(str, old); + } + return (p); +} + static inline ssize_t strscpy(char* dst, const char* src, size_t len) { From nobody Fri Nov 19 00:02:48 2021 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 F0916188FA53; Fri, 19 Nov 2021 00:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH160803z4vwL; Fri, 19 Nov 2021 00:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 096BB1E2D6; Fri, 19 Nov 2021 00:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02mfL072734; Fri, 19 Nov 2021 00:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02meM072733; Fri, 19 Nov 2021 00:02:48 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:48 GMT Message-Id: <202111190002.1AJ02meM072733@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: f74147e26999 - stable/13 - bhyve: net_backends, automatically IFF_UP tap 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: f74147e26999838e03a522bf59ea33bef470d356 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f74147e26999838e03a522bf59ea33bef470d356 commit f74147e26999838e03a522bf59ea33bef470d356 Author: Bjoern A. Zeeb AuthorDate: 2021-07-28 22:53:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:27 +0000 bhyve: net_backends, automatically IFF_UP tap devices If you want communications with the outside world and tell bhyve to create an interfaces then it should be usable as well. Rather than relying on the sysctl net.link.tap.up_on_open automatically try to IFF_UP the opened tap device. (cherry picked from commit 56be282bc999cc05dcd1ccb163b108d54f3ff448) --- usr.sbin/bhyve/net_backends.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/usr.sbin/bhyve/net_backends.c b/usr.sbin/bhyve/net_backends.c index 30c26aea458b..cb1730fc77df 100644 --- a/usr.sbin/bhyve/net_backends.c +++ b/usr.sbin/bhyve/net_backends.c @@ -46,6 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(INET6) || defined(INET) +#include +#endif #include #include #define NETMAP_WITH_LIBS @@ -179,6 +182,17 @@ SET_DECLARE(net_backend_set, struct net_backend); * The tap backend */ +#if defined(INET6) || defined(INET) +const int pf_list[] = { +#if defined(INET6) + PF_INET6, +#endif +#if defined(INET) + PF_INET, +#endif +}; +#endif + struct tap_priv { struct mevent *mevp; /* @@ -211,6 +225,10 @@ tap_init(struct net_backend *be, const char *devname, struct tap_priv *priv = (struct tap_priv *)be->opaque; char tbuf[80]; int opt = 1; +#if defined(INET6) || defined(INET) + struct ifreq ifrq; + int i, s; +#endif #ifndef WITHOUT_CAPSICUM cap_rights_t rights; #endif @@ -238,6 +256,39 @@ tap_init(struct net_backend *be, const char *devname, goto error; } +#if defined(INET6) || defined(INET) + /* + * Try to UP the interface rather than relying on + * net.link.tap.up_on_open. + */ + bzero(&ifrq, sizeof(ifrq)); + if (ioctl(be->fd, TAPGIFNAME, &ifrq) < 0) { + WPRINTF(("Could not get interface name")); + goto error; + } + + s = -1; + for (i = 0; s == -1 && i < nitems(pf_list); i++) + s = socket(pf_list[i], SOCK_DGRAM, 0); + if (s == -1) { + WPRINTF(("Could open socket")); + goto error; + } + + if (ioctl(s, SIOCGIFFLAGS, &ifrq) < 0) { + (void)close(s); + WPRINTF(("Could not get interface flags")); + goto error; + } + ifrq.ifr_flags |= IFF_UP; + if (ioctl(s, SIOCSIFFLAGS, &ifrq) < 0) { + (void)close(s); + WPRINTF(("Could not set interface flags")); + goto error; + } + (void)close(s); +#endif + #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); if (caph_rights_limit(be->fd, &rights) == -1) From nobody Fri Nov 19 00:02:51 2021 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 E1251188FAF6; Fri, 19 Nov 2021 00:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH193Fx1z3Bnb; Fri, 19 Nov 2021 00:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BA221E6EA; Fri, 19 Nov 2021 00:02:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02pmJ072782; Fri, 19 Nov 2021 00:02:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02pMZ072781; Fri, 19 Nov 2021 00:02:51 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:51 GMT Message-Id: <202111190002.1AJ02pMZ072781@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: 64c69419a96c - stable/13 - arm64/gicv3: improve a panic message 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 64c69419a96c03a17c2efc8816fe3e332edacded Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=64c69419a96c03a17c2efc8816fe3e332edacded commit 64c69419a96c03a17c2efc8816fe3e332edacded Author: Bjoern A. Zeeb AuthorDate: 2021-11-09 22:11:15 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:27 +0000 arm64/gicv3: improve a panic message Print the device/unit in the panic message for which we cannot get the MSI device ID to have a clue where to start looking. While here use __func__ instead of hardcoding the function name. (cherry picked from commit fad51d34f21359c5b94ca94842381c3e000f475e) --- sys/arm64/arm64/gicv3_its.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 9c058dbe7f99..84b1a574f02f 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -1110,7 +1110,8 @@ its_get_devid(device_t pci_dev) uintptr_t id; if (pci_get_id(pci_dev, PCI_ID_MSI, &id) != 0) - panic("its_get_devid: Unable to get the MSI DeviceID"); + panic("%s: %s: Unable to get the MSI DeviceID", __func__, + device_get_nameunit(pci_dev)); return (id); } From nobody Fri Nov 19 00:02:50 2021 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 E1489188FC26; Fri, 19 Nov 2021 00:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH192FgYz3Bvy; Fri, 19 Nov 2021 00:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2E31E6E9; Fri, 19 Nov 2021 00:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02oeW072758; Fri, 19 Nov 2021 00:02:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02oUd072757; Fri, 19 Nov 2021 00:02:50 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:50 GMT Message-Id: <202111190002.1AJ02oUd072757@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: 151d59e386d7 - stable/13 - Parse named nodes from IORT ACPI on arm64 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 151d59e386d7e1a70b5279e0de5d9ee99259f65c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=151d59e386d7e1a70b5279e0de5d9ee99259f65c commit 151d59e386d7e1a70b5279e0de5d9ee99259f65c Author: Dmitry Salychev AuthorDate: 2021-08-07 17:17:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:27 +0000 Parse named nodes from IORT ACPI on arm64 Add the ability to map named components from IORT to their SMMU or ITS node in order to setup interrupts. It is now possible to find a node by its name (substring) and resource ID similar to PCI nodes. This is needed by work on a driver for NXP's Second Generation Data Path Acceleration Architecture (DPAA2). Reviewed by: andrew (cherry picked from commit d178b1f878ae5b1b4e574bcf34d21b60855bf5a0) --- sys/arm64/acpica/acpi_iort.c | 138 ++++++++++++++++++++++++++++++++++++++----- sys/dev/acpica/acpivar.h | 4 ++ 2 files changed, 126 insertions(+), 16 deletions(-) diff --git a/sys/arm64/acpica/acpi_iort.c b/sys/arm64/acpica/acpi_iort.c index ec5cf799b333..e35531731251 100644 --- a/sys/arm64/acpica/acpi_iort.c +++ b/sys/arm64/acpica/acpi_iort.c @@ -77,6 +77,14 @@ struct iort_its_entry { int pxm; }; +struct iort_named_component +{ + UINT32 NodeFlags; + UINT64 MemoryProperties; + UINT8 MemoryAddressLimit; + char DeviceName[32]; /* Path of namespace object */ +}; + /* * IORT node. Each node has some device specific data depending on the * type of the node. The node can also have a set of mappings, OR in @@ -91,9 +99,10 @@ struct iort_node { u_int usecount; /* for bookkeeping */ u_int revision; /* node revision */ union { - ACPI_IORT_ROOT_COMPLEX pci_rc; /* PCI root complex */ - ACPI_IORT_SMMU smmu; - ACPI_IORT_SMMU_V3 smmu_v3; + ACPI_IORT_ROOT_COMPLEX pci_rc; /* PCI root complex */ + ACPI_IORT_SMMU smmu; + ACPI_IORT_SMMU_V3 smmu_v3; + struct iort_named_component named_comp; } data; union { struct iort_map_entry *mappings; /* node mappings */ @@ -105,6 +114,7 @@ struct iort_node { static TAILQ_HEAD(, iort_node) pci_nodes = TAILQ_HEAD_INITIALIZER(pci_nodes); static TAILQ_HEAD(, iort_node) smmu_nodes = TAILQ_HEAD_INITIALIZER(smmu_nodes); static TAILQ_HEAD(, iort_node) its_groups = TAILQ_HEAD_INITIALIZER(its_groups); +static TAILQ_HEAD(, iort_node) named_nodes = TAILQ_HEAD_INITIALIZER(named_nodes); static int iort_entry_get_id_mapping_index(struct iort_node *node) @@ -166,6 +176,29 @@ iort_entry_lookup(struct iort_node *node, u_int id, u_int *outid) return (entry->out_node); } +/* + * Perform an additional lookup in case of SMMU node and ITS outtype. + */ +static struct iort_node * +iort_smmu_trymap(struct iort_node *node, u_int outtype, u_int *outid) +{ + /* Original node can be not found. */ + if (!node) + return (NULL); + + /* Node can be SMMU or ITS. If SMMU, we need another lookup. */ + if (outtype == ACPI_IORT_NODE_ITS_GROUP && + (node->type == ACPI_IORT_NODE_SMMU_V3 || + node->type == ACPI_IORT_NODE_SMMU)) { + node = iort_entry_lookup(node, *outid, outid); + if (node == NULL) + return (NULL); + } + + KASSERT(node->type == outtype, ("mapping fail")); + return (node); +} + /* * Map a PCI RID to a SMMU node or an ITS node, based on outtype. */ @@ -184,21 +217,35 @@ iort_pci_rc_map(u_int seg, u_int rid, u_int outtype, u_int *outid) break; } - /* Could not find a PCI RC node with segment and device ID. */ - if (out_node == NULL) - return (NULL); + out_node = iort_smmu_trymap(out_node, outtype, &nxtid); + if (out_node) + *outid = nxtid; - /* Node can be SMMU or ITS. If SMMU, we need another lookup. */ - if (outtype == ACPI_IORT_NODE_ITS_GROUP && - (out_node->type == ACPI_IORT_NODE_SMMU_V3 || - out_node->type == ACPI_IORT_NODE_SMMU)) { - out_node = iort_entry_lookup(out_node, nxtid, &nxtid); - if (out_node == NULL) - return (NULL); + return (out_node); +} + +/* + * Map a named component node to a SMMU node or an ITS node, based on outtype. + */ +static struct iort_node * +iort_named_comp_map(const char *devname, u_int rid, u_int outtype, u_int *outid) +{ + struct iort_node *node, *out_node; + u_int nxtid; + + out_node = NULL; + TAILQ_FOREACH(node, &named_nodes, next) { + if (strstr(node->data.named_comp.DeviceName, devname) == NULL) + continue; + out_node = iort_entry_lookup(node, rid, &nxtid); + if (out_node != NULL) + break; } - KASSERT(out_node->type == outtype, ("mapping fail")); - *outid = nxtid; + out_node = iort_smmu_trymap(out_node, outtype, &nxtid); + if (out_node) + *outid = nxtid; + return (out_node); } @@ -279,6 +326,7 @@ iort_add_nodes(ACPI_IORT_NODE *node_entry, u_int node_offset) ACPI_IORT_ROOT_COMPLEX *pci_rc; ACPI_IORT_SMMU *smmu; ACPI_IORT_SMMU_V3 *smmu_v3; + ACPI_IORT_NAMED_COMPONENT *named_comp; struct iort_node *node; node = malloc(sizeof(*node), M_DEVBUF, M_WAITOK | M_ZERO); @@ -310,6 +358,19 @@ iort_add_nodes(ACPI_IORT_NODE *node_entry, u_int node_offset) iort_copy_its(node, node_entry); TAILQ_INSERT_TAIL(&its_groups, node, next); break; + case ACPI_IORT_NODE_NAMED_COMPONENT: + named_comp = (ACPI_IORT_NAMED_COMPONENT *)node_entry->NodeData; + memcpy(&node->data.named_comp, named_comp, sizeof(*named_comp)); + + /* Copy name of the node separately. */ + strncpy(node->data.named_comp.DeviceName, + named_comp->DeviceName, + sizeof(node->data.named_comp.DeviceName)); + node->data.named_comp.DeviceName[31] = 0; + + iort_copy_data(node, node_entry); + TAILQ_INSERT_TAIL(&named_nodes, node, next); + break; default: printf("ACPI: IORT: Dropping unhandled type %u\n", node_entry->Type); @@ -368,7 +429,9 @@ iort_post_process_mappings(void) TAILQ_FOREACH(node, &smmu_nodes, next) for (i = 0; i < node->nentries; i++) iort_resolve_node(&node->entries.mappings[i], FALSE); - /* TODO: named nodes */ + TAILQ_FOREACH(node, &named_nodes, next) + for (i = 0; i < node->nentries; i++) + iort_resolve_node(&node->entries.mappings[i], TRUE); } /* @@ -587,3 +650,46 @@ acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *sid) return (0); } + +/* + * Finds mapping for a named node given name and resource ID and returns the + * XREF for MSI interrupt setup and the device ID to use for the interrupt setup. + */ +int +acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref, + u_int *devid) +{ + struct iort_node *node; + + node = iort_named_comp_map(devname, rid, ACPI_IORT_NODE_ITS_GROUP, + devid); + if (node == NULL) + return (ENOENT); + + /* This should be an ITS node */ + KASSERT(node->type == ACPI_IORT_NODE_ITS_GROUP, ("bad group")); + + /* Return first node, we don't handle more than that now. */ + *xref = node->entries.its[0].xref; + return (0); +} + +int +acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref, + u_int *devid) +{ + ACPI_IORT_SMMU_V3 *smmu; + struct iort_node *node; + + node = iort_named_comp_map(devname, rid, ACPI_IORT_NODE_SMMU_V3, devid); + if (node == NULL) + return (ENOENT); + + /* This should be an SMMU node. */ + KASSERT(node->type == ACPI_IORT_NODE_SMMU_V3, ("bad node")); + + smmu = (ACPI_IORT_SMMU_V3 *)&node->data.smmu_v3; + *xref = smmu->BaseAddress; + + return (0); +} diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index fb196c2f4713..fb568169cf28 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -578,6 +578,10 @@ int acpi_get_domain(device_t dev, device_t child, int *domain); int acpi_iort_map_pci_msi(u_int seg, u_int rid, u_int *xref, u_int *devid); int acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *devid); int acpi_iort_its_lookup(u_int its_id, u_int *xref, int *pxm); +int acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref, + u_int *devid); +int acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref, + u_int *devid); #endif #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ From nobody Fri Nov 19 00:02:52 2021 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 1F240188FC2C; Fri, 19 Nov 2021 00:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH1B26DJz3BqY; Fri, 19 Nov 2021 00:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C3521E547; Fri, 19 Nov 2021 00:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02qUX072806; Fri, 19 Nov 2021 00:02:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02qlS072805; Fri, 19 Nov 2021 00:02:52 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:52 GMT Message-Id: <202111190002.1AJ02qlS072805@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: 54aa95f082de - stable/13 - mii: update URL for OUIs 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 54aa95f082de6df70d692134c603451b16750c3f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=54aa95f082de6df70d692134c603451b16750c3f commit 54aa95f082de6df70d692134c603451b16750c3f Author: Bjoern A. Zeeb AuthorDate: 2021-11-09 21:35:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:27 +0000 mii: update URL for OUIs Update the URL for OUIs as the old one is 404 not even 301 anymore. (cherry picked from commit 8e902c1d21a74c82ffef9f104eb31b213f79f1db) --- sys/dev/mii/miidevs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mii/miidevs b/sys/dev/mii/miidevs index 87035e1b7392..259718303ee5 100644 --- a/sys/dev/mii/miidevs +++ b/sys/dev/mii/miidevs @@ -33,7 +33,7 @@ $FreeBSD$ /* * List of known MII OUIs. - * For a complete list see http://standards.ieee.org/regauth/oui/ + * For a complete list see http://standards-oui.ieee.org/ * * XXX Vendors do obviously not agree how OUIs (24 bit) are mapped * to the 22 bits available in the id registers. From nobody Fri Nov 19 00:02:53 2021 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 AAA1B188FB5E; Fri, 19 Nov 2021 00:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH1B4PN9z3Bsp; Fri, 19 Nov 2021 00:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B94F71E548; Fri, 19 Nov 2021 00:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ02rgc072836; Fri, 19 Nov 2021 00:02:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02rjq072835; Fri, 19 Nov 2021 00:02:53 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:53 GMT Message-Id: <202111190002.1AJ02rjq072835@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: 9806b36deeee - stable/13 - epair: remove "All rights reserved" 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 9806b36deeeef8df2cc2a5d6122c3aafc478b1f0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9806b36deeeef8df2cc2a5d6122c3aafc478b1f0 commit 9806b36deeeef8df2cc2a5d6122c3aafc478b1f0 Author: Bjoern A. Zeeb AuthorDate: 2021-11-02 16:48:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:27 +0000 epair: remove "All rights reserved" Remove "All rights reserved" from The FreeBSD Foundation owned copyrights on epair code and documentation. Approved by: emaste (FreeBSD Foundation) (cherry picked from commit 1a8f198fa66518e6d249fa8aa765ec6e50a4fbab) --- share/man/man4/epair.4 | 1 - sys/net/if_epair.c | 1 - 2 files changed, 2 deletions(-) diff --git a/share/man/man4/epair.4 b/share/man/man4/epair.4 index 3ea706cb02ac..e1018e4b177f 100644 --- a/share/man/man4/epair.4 +++ b/share/man/man4/epair.4 @@ -1,6 +1,5 @@ .\"- .\" Copyright (c) 2008 The FreeBSD Foundation -.\" All rights reserved. .\" .\" This software was developed by CK Software GmbH under sponsorship .\" from the FreeBSD Foundation. diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 7f62cdb427ff..3cef6c76a2e2 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -3,7 +3,6 @@ * * Copyright (c) 2008 The FreeBSD Foundation * Copyright (c) 2009-2010 Bjoern A. Zeeb - * All rights reserved. * * This software was developed by CK Software GmbH under sponsorship * from the FreeBSD Foundation. From nobody Fri Nov 19 00:10:30 2021 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 C26BF189873E; Fri, 19 Nov 2021 00:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwH9z1Szcz3KbH; Fri, 19 Nov 2021 00:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF3FA1E552; Fri, 19 Nov 2021 00:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ0AUXO081848; Fri, 19 Nov 2021 00:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ0AU7w081847; Fri, 19 Nov 2021 00:10:30 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:10:30 GMT Message-Id: <202111190010.1AJ0AU7w081847@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: 29745cf91cfc - stable/13 - Bump __FreeBSD_version to 1300521. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 29745cf91cfc22afa94da0ce43e07a6dc377f631 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=29745cf91cfc22afa94da0ce43e07a6dc377f631 commit 29745cf91cfc22afa94da0ce43e07a6dc377f631 Author: Bjoern A. Zeeb AuthorDate: 2021-11-19 00:09:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:09:37 +0000 Bump __FreeBSD_version to 1300521. Bump __FreeBSD_version to 1300521 after merging LinuxKPI and net80211 changes. --- UPDATING | 6 ++++++ sys/sys/param.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 46212b9047a2..7837566e82a7 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20211119: + Bump __FreeBSD_version to 1300521 after merging LinuxKPI and + net80211 changes in order to support building various wireless + drivers. This is to help other external consumers of LinuxKPI + and net80211 to deal accordingly. + 20211003: Commit a599f9f7620b deleted the variable called nfs_maxcopyrange from nfscommon.ko, since it no longer needs to be global. As such, diff --git a/sys/sys/param.h b/sys/sys/param.h index fa3bc1544a4a..8baeb865e158 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300520 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300521 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Nov 19 01:53:17 2021 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 9C52A1852A4C; Fri, 19 Nov 2021 01:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwKSY2qfTz4hJh; Fri, 19 Nov 2021 01:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23CA21FC30; Fri, 19 Nov 2021 01:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ1rHcW018759; Fri, 19 Nov 2021 01:53:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ1rHN6018758; Fri, 19 Nov 2021 01:53:17 GMT (envelope-from git) Date: Fri, 19 Nov 2021 01:53:17 GMT Message-Id: <202111190153.1AJ1rHN6018758@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: ec5691aa2f96 - stable/13 - net: Allow binding of unspecified address without address existance 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: ec5691aa2f96d27c8f000486a9e3297c2dce31b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ec5691aa2f96d27c8f000486a9e3297c2dce31b9 commit ec5691aa2f96d27c8f000486a9e3297c2dce31b9 Author: Roy Marples AuthorDate: 2021-10-20 15:47:29 +0000 Commit: Ed Maste CommitDate: 2021-11-19 00:28:56 +0000 net: Allow binding of unspecified address without address existance Previously in_pcbbind_setup returned EADDRNOTAVAIL for empty V_in_ifaddrhead (i.e., no IPv4 addresses configured) and in6_pcbbind did the same for empty V_in6_ifaddrhead (no IPv6 addresses). An equivalent test has existed since 4.4-Lite. It was presumably done to avoid extra work (assuming the address isn't going to be found later). In normal system operation *_ifaddrhead will not be empty: they will at least have the loopback address(es). In practice no work will be avoided. Further, this case caused net/dhcpd to fail when run early in boot before assignment of any addresses. It should be possible to bind the unspecified address even if no addresses have been configured yet, so just remove the tests. The now-removed "XXX broken" comments were added in 59562606b9d3, which converted the ifaddr lists to TAILQs. As far as I (emaste) can tell the brokenness is the issue described above, not some aspect of the TAILQ conversion. PR: 253166 Reviewed by: ae, bz, donner, emaste, glebius MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D32563 (cherry picked from commit 5c5340108e9c2e384ca646720e17d037c69acc4c) --- sys/netinet/in_pcb.c | 2 -- sys/netinet6/in6_pcb.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 8b109bce9dff..c3ad7e9b6bc6 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -932,8 +932,6 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, INP_LOCK_ASSERT(inp); INP_HASH_LOCK_ASSERT(pcbinfo); - if (CK_STAILQ_EMPTY(&V_in_ifaddrhead)) /* XXX broken! */ - return (EADDRNOTAVAIL); laddr.s_addr = *laddrp; if (nam != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 1c36b4386030..bc7c0a2bebf5 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -134,8 +134,6 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); - if (CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) /* XXX broken! */ - return (EADDRNOTAVAIL); if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) From nobody Fri Nov 19 01:53:27 2021 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 521581852CF0; Fri, 19 Nov 2021 01:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwKSm1Knfz4hVD; Fri, 19 Nov 2021 01:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05DD01FA59; Fri, 19 Nov 2021 01:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ1rRUl018886; Fri, 19 Nov 2021 01:53:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ1rRhF018885; Fri, 19 Nov 2021 01:53:27 GMT (envelope-from git) Date: Fri, 19 Nov 2021 01:53:27 GMT Message-Id: <202111190153.1AJ1rRhF018885@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: e20aa51503b5 - stable/12 - net: Allow binding of unspecified address without address existance 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: e20aa51503b5960c9514492d0746ce05e8eca8a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e20aa51503b5960c9514492d0746ce05e8eca8a6 commit e20aa51503b5960c9514492d0746ce05e8eca8a6 Author: Roy Marples AuthorDate: 2021-10-20 15:47:29 +0000 Commit: Ed Maste CommitDate: 2021-11-19 00:29:31 +0000 net: Allow binding of unspecified address without address existance Previously in_pcbbind_setup returned EADDRNOTAVAIL for empty V_in_ifaddrhead (i.e., no IPv4 addresses configured) and in6_pcbbind did the same for empty V_in6_ifaddrhead (no IPv6 addresses). An equivalent test has existed since 4.4-Lite. It was presumably done to avoid extra work (assuming the address isn't going to be found later). In normal system operation *_ifaddrhead will not be empty: they will at least have the loopback address(es). In practice no work will be avoided. Further, this case caused net/dhcpd to fail when run early in boot before assignment of any addresses. It should be possible to bind the unspecified address even if no addresses have been configured yet, so just remove the tests. The now-removed "XXX broken" comments were added in 59562606b9d3, which converted the ifaddr lists to TAILQs. As far as I (emaste) can tell the brokenness is the issue described above, not some aspect of the TAILQ conversion. PR: 253166 Reviewed by: ae, bz, donner, emaste, glebius MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D32563 (cherry picked from commit 5c5340108e9c2e384ca646720e17d037c69acc4c) --- sys/netinet/in_pcb.c | 2 -- sys/netinet6/in6_pcb.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index b8f06a96fe27..5a8076f1171a 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -845,8 +845,6 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, INP_LOCK_ASSERT(inp); INP_HASH_LOCK_ASSERT(pcbinfo); - if (CK_STAILQ_EMPTY(&V_in_ifaddrhead)) /* XXX broken! */ - return (EADDRNOTAVAIL); laddr.s_addr = *laddrp; if (nam != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index ee38e52c57f2..855d469da8ac 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -131,8 +131,6 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); - if (CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) /* XXX broken! */ - return (EADDRNOTAVAIL); if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) From nobody Fri Nov 19 02:02:42 2021 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 1AF301888D18; Fri, 19 Nov 2021 02:02:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwKgQ6Y04z4lKF; Fri, 19 Nov 2021 02:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C06FE1F6F0; Fri, 19 Nov 2021 02:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ22gC9033284; Fri, 19 Nov 2021 02:02:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ22gxo033283; Fri, 19 Nov 2021 02:02:42 GMT (envelope-from git) Date: Fri, 19 Nov 2021 02:02:42 GMT Message-Id: <202111190202.1AJ22gxo033283@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: 11d1d20e3721 - stable/12 - nfscl: Make nfscl_getlayout() acquire the correct pNFS layout 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 11d1d20e372173288f9ddb35d049277b3fe20cd7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=11d1d20e372173288f9ddb35d049277b3fe20cd7 commit 11d1d20e372173288f9ddb35d049277b3fe20cd7 Author: Rick Macklem AuthorDate: 2021-10-13 22:48:54 +0000 Commit: Rick Macklem CommitDate: 2021-11-19 01:59:02 +0000 nfscl: Make nfscl_getlayout() acquire the correct pNFS layout Without this patch, if a pNFS read layout has already been acquired for a file, writes would be redirected to the Metadata Server (MDS), because nfscl_getlayout() would not acquire a read/write layout for the file. This happened because there was no "mode" argument to nfscl_getlayout() to indicate whether reading or writing was being done. Since doing I/O through the Metadata Server is not encouraged for some pNFS servers, it is preferable to get a read/write layout for writes instead of redirecting the write to the MDS. This patch adds a access mode argument to nfscl_getlayout() and nfsrpc_getlayout(), so that nfscl_getlayout() knows to acquire a read/write layout for writing, even if a read layout has already been acquired. This patch only affects NFSv4.1/4.2 client behaviour when pNFS ("pnfs" mount option against a server that supports pNFS) is in use. This problem was detected during a recent NFSv4 interoperability testing event held by the IETF working group. (cherry picked from commit 24af0fcdfc4983fd3cef10f9d949aca79476c2c2) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 14 +++++++------- sys/fs/nfsclient/nfs_clstate.c | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 91914314970d..e93d6e9bdf27 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -602,7 +602,7 @@ int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t *, int, nfsv4stateid_t *, int, int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, NFSPROC_T *); struct nfscllayout *nfscl_getlayout(struct nfsclclient *, uint8_t *, int, - uint64_t, struct nfsclflayout **, int *); + uint64_t, uint32_t, struct nfsclflayout **, int *); void nfscl_dserr(uint32_t, uint32_t, struct nfscldevinfo *, struct nfscllayout *, struct nfsclds *); void nfscl_cancelreqs(struct nfsclds *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index f2eb3af5f101..992b8ad8bdcd 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -138,7 +138,7 @@ static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, static int nfsrpc_setaclrpc(vnode_t, struct ucred *, NFSPROC_T *, struct acl *, nfsv4stateid_t *, void *); static int nfsrpc_getlayout(struct nfsmount *, vnode_t, struct nfsfh *, int, - uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, + uint32_t, uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, struct ucred *, NFSPROC_T *); static int nfsrpc_fillsa(struct nfsmount *, struct sockaddr_in *, struct sockaddr_in6 *, sa_family_t, int, struct nfsclds **, NFSPROC_T *); @@ -5345,8 +5345,8 @@ nfsmout: */ static int nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, struct nfsfh *nfhp, - int iomode, uint32_t *notifybitsp, nfsv4stateid_t *stateidp, uint64_t off, - struct nfscllayout **lypp, struct ucred *cred, NFSPROC_T *p) + int iomode, uint32_t rw, uint32_t *notifybitsp, nfsv4stateid_t *stateidp, + uint64_t off, struct nfscllayout **lypp, struct ucred *cred, NFSPROC_T *p) { struct nfscllayout *lyp; struct nfsclflayout *flp; @@ -5366,7 +5366,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, struct nfsfh *nfhp, * flp == NULL. */ lyp = nfscl_getlayout(nmp->nm_clp, nfhp->nfh_fh, nfhp->nfh_len, - off, &flp, &recalled); + off, rw, &flp, &recalled); islocked = 0; if (lyp == NULL || flp == NULL) { if (recalled != 0) @@ -5690,7 +5690,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, /* Search for a layout for this file. */ off = uiop->uio_offset; layp = nfscl_getlayout(nmp->nm_clp, np->n_fhp->nfh_fh, - np->n_fhp->nfh_len, off, &rflp, &recalled); + np->n_fhp->nfh_len, off, rwaccess, &rflp, &recalled); if (layp == NULL || rflp == NULL) { if (recalled != 0) { NFSFREECRED(newcred); @@ -5710,7 +5710,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, else iolaymode = NFSLAYOUTIOMODE_READ; error = nfsrpc_getlayout(nmp, vp, np->n_fhp, iolaymode, - NULL, &stateid, off, &layp, newcred, p); + rwaccess, NULL, &stateid, off, &layp, newcred, p); if (error != 0) { NFSLOCKNODE(np); np->n_flag |= NNOLAYOUT; @@ -7124,7 +7124,7 @@ nfsrpc_getopenlayout(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, * on it, iff flp != NULL or a lock (exclusive lock) on it iff * flp == NULL. */ - lyp = nfscl_getlayout(nmp->nm_clp, newfhp, newfhlen, 0, &flp, + lyp = nfscl_getlayout(nmp->nm_clp, newfhp, newfhlen, 0, mode, &flp, &recalled); NFSCL_DEBUG(4, "nfsrpc_getopenlayout nfscl_getlayout lyp=%p\n", lyp); if (lyp == NULL) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 279f7e38c346..9eeb2ca10865 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5030,7 +5030,8 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, */ struct nfscllayout * nfscl_getlayout(struct nfsclclient *clp, uint8_t *fhp, int fhlen, - uint64_t off, struct nfsclflayout **retflpp, int *recalledp) + uint64_t off, uint32_t rwaccess, struct nfsclflayout **retflpp, + int *recalledp) { struct nfscllayout *lyp; mount_t mp; @@ -5046,8 +5047,8 @@ nfscl_getlayout(struct nfsclclient *clp, uint8_t *fhp, int fhlen, TAILQ_REMOVE(&clp->nfsc_layout, lyp, nfsly_list); TAILQ_INSERT_HEAD(&clp->nfsc_layout, lyp, nfsly_list); lyp->nfsly_timestamp = NFSD_MONOSEC + 120; - error = nfscl_findlayoutforio(lyp, off, - NFSV4OPEN_ACCESSREAD, retflpp); + error = nfscl_findlayoutforio(lyp, off, rwaccess, + retflpp); if (error == 0) nfsv4_getref(&lyp->nfsly_lock, NULL, NFSCLSTATEMUTEXPTR, mp); From nobody Fri Nov 19 02:48:54 2021 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 43045189F4EC; Fri, 19 Nov 2021 02:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwLhl10l8z508T; Fri, 19 Nov 2021 02:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03379204D8; Fri, 19 Nov 2021 02:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ2msw7086516; Fri, 19 Nov 2021 02:48:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ2msJR086515; Fri, 19 Nov 2021 02:48:54 GMT (envelope-from git) Date: Fri, 19 Nov 2021 02:48:54 GMT Message-Id: <202111190248.1AJ2msJR086515@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: a715704e53bd - stable/12 - nfscl: Restructure nfscl_freeopen() slightly 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: a715704e53bd84215469f21cd03d5ece9c6c220e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a715704e53bd84215469f21cd03d5ece9c6c220e commit a715704e53bd84215469f21cd03d5ece9c6c220e Author: Rick Macklem AuthorDate: 2021-10-15 00:28:01 +0000 Commit: Rick Macklem CommitDate: 2021-11-19 02:45:13 +0000 nfscl: Restructure nfscl_freeopen() slightly This patch factors the unlinking of the nfsclopen structure out of nfscl_freeopen() into a separate function called nfscl_unlinkopen(). It also adds a new argument to nfscl_freeopen() to conditionally do the unlink. Since this new argument is always passed in as "true" at this time, no semantics change should occur. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. (cherry picked from commit 6495766acfb242048a80d58956b2cebbd885d8cc) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- sys/fs/nfsclient/nfs_clstate.c | 38 +++++++++++++++++++++++++------------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index e93d6e9bdf27..536f3634dcff 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -562,7 +562,7 @@ int nfscl_checkwritelocked(vnode_t, struct flock *, void nfscl_lockrelease(struct nfscllockowner *, int, int); void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t); void nfscl_filllockowner(void *, u_int8_t *, int); -void nfscl_freeopen(struct nfsclopen *, int); +void nfscl_freeopen(struct nfsclopen *, int, bool); void nfscl_umount(struct nfsmount *, NFSPROC_T *, struct nfscldeleghead *); void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *); void nfscl_initiate_recovery(struct nfsclclient *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 992b8ad8bdcd..5da95f850856 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -816,7 +816,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) nfscl_freelockowner(lp, 0); - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); } diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9eeb2ca10865..ad8770950f56 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -103,6 +103,7 @@ static int nfscl_layoutcnt = 0; static int nfscl_getopen(struct nfsclownerhead *, u_int8_t *, int, u_int8_t *, u_int8_t *, u_int32_t, struct nfscllockowner **, struct nfsclopen **); static void nfscl_clrelease(struct nfsclclient *); +static void nfscl_unlinkopen(struct nfsclopen *); static void nfscl_cleanclient(struct nfsclclient *); static void nfscl_expireclient(struct nfsclclient *, struct nfsmount *, struct ucred *, NFSPROC_T *); @@ -760,7 +761,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, nfscl_lockunlock(&owp->nfsow_rwlock); clp = owp->nfsow_clp; if (error && candelete && op->nfso_opencnt == 0) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); } @@ -1459,14 +1460,25 @@ nfscl_lockrelease(struct nfscllockowner *lp, int error, int candelete) NFSUNLOCKCLSTATE(); } +/* + * Unlink the open structure. + */ +static void +nfscl_unlinkopen(struct nfsclopen *op) +{ + + LIST_REMOVE(op, nfso_list); +} + /* * Free up an open structure and any associated byte range lock structures. */ void -nfscl_freeopen(struct nfsclopen *op, int local) +nfscl_freeopen(struct nfsclopen *op, int local, bool unlink) { - LIST_REMOVE(op, nfso_list); + if (unlink) + nfscl_unlinkopen(op); nfscl_freealllocks(&op->nfso_lock, local); free(op, M_NFSCLOPEN); if (local) @@ -1537,7 +1549,7 @@ nfscl_expireopen(struct nfsclclient *clp, struct nfsclopen *op, * If a byte range lock or Share deny or couldn't re-open, free it. */ if (mustdelete) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); return (mustdelete); } @@ -1604,7 +1616,7 @@ nfscl_cleandeleg(struct nfscldeleg *dp) if (op != NULL) { if (LIST_NEXT(op, nfso_list) != NULL) panic("nfscleandel"); - nfscl_freeopen(op, 1); + nfscl_freeopen(op, 1, true); } nfscl_freeopenowner(owp, 1); } @@ -1646,7 +1658,7 @@ nfscl_cleanclient(struct nfsclclient *clp) /* Now, all the OpenOwners, etc. */ LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { LIST_FOREACH_SAFE(op, &owp->nfsow_open, nfso_list, nop) { - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); } nfscl_freeopenowner(owp, 0); } @@ -2166,7 +2178,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) } } if (error != 0 && error != NFSERR_BADSESSION) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); op = nop; } owp = nowp; @@ -3246,7 +3258,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) if (op != NULL) { KASSERT((op->nfso_opencnt == 0), ("nfscl: bad open cnt on deleg")); - nfscl_freeopen(op, 1); + nfscl_freeopen(op, 1, true); } nfscl_freeopenowner(owp, 1); } @@ -4105,7 +4117,7 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, ret == NFSERR_BADSESSION) return (ret); if (ret) { - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); if (!error) error = ret; } @@ -4134,7 +4146,7 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, ret == NFSERR_BADSESSION) return (ret); if (ret) { - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); if (!error) error = ret; } @@ -4186,7 +4198,7 @@ nfscl_moveopen(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp, op->nfso_fhlen == lop->nfso_fhlen && !NFSBCMP(op->nfso_fh, lop->nfso_fh, op->nfso_fhlen)) { op->nfso_opencnt += lop->nfso_opencnt; - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); return (0); } } @@ -4204,11 +4216,11 @@ nfscl_moveopen(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp, NFS4NODENAME(np->n_v4), np->n_v4->n4_namelen, &ndp, 0, 0, cred, p); if (error) { if (newone) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); } else { op->nfso_mode |= lop->nfso_mode; op->nfso_opencnt += lop->nfso_opencnt; - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); } if (nop != NULL) free(nop, M_NFSCLOPEN); From nobody Fri Nov 19 03:22:20 2021 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 D12961888A48; Fri, 19 Nov 2021 03:22:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwMRJ5F8nz59MH; Fri, 19 Nov 2021 03:22:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93D0B2108F; Fri, 19 Nov 2021 03:22:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ3MKfQ040606; Fri, 19 Nov 2021 03:22:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ3MKhu040605; Fri, 19 Nov 2021 03:22:20 GMT (envelope-from git) Date: Fri, 19 Nov 2021 03:22:20 GMT Message-Id: <202111190322.1AJ3MKhu040605@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: 27cac1948263 - stable/12 - nfscl: Add an argument to nfscl_tryclose() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 27cac1948263d7d2f7e820478658d029264f6554 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=27cac1948263d7d2f7e820478658d029264f6554 commit 27cac1948263d7d2f7e820478658d029264f6554 Author: Rick Macklem AuthorDate: 2021-10-15 21:25:38 +0000 Commit: Rick Macklem CommitDate: 2021-11-19 02:47:31 +0000 nfscl: Add an argument to nfscl_tryclose() This patch adds a new argument to nfscl_tryclose() to indicate whether or not it should loop when a NFSERR_DELAY reply is received from the NFSv4 server. Since this new argument is always passed in as "true" at this time, no semantics change should occur. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. (cherry picked from commit 77c595ce33a37d321ef35fd840948a2e5fd17c84) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- sys/fs/nfsclient/nfs_clstate.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 536f3634dcff..d10aa05a6b6f 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -596,7 +596,7 @@ void nfscl_newnode(vnode_t); void nfscl_delegmodtime(vnode_t); void nfscl_deleggetmodtime(vnode_t, struct timespec *); int nfscl_tryclose(struct nfsclopen *, struct ucred *, - struct nfsmount *, NFSPROC_T *); + struct nfsmount *, NFSPROC_T *, bool); void nfscl_cleanup(NFSPROC_T *); int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t *, int, nfsv4stateid_t *, int, int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 5da95f850856..78594cffc3ec 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -807,7 +807,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); NFSUNLOCKCLSTATE(); do { - error = nfscl_tryclose(op, tcred, nmp, p); + error = nfscl_tryclose(op, tcred, nmp, p, true); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfs_close"); } while (error == NFSERR_GRACE); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index ad8770950f56..1825b56eabd0 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -2298,7 +2298,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) LIST_FOREACH_SAFE(op, &extra_open, nfso_list, nop) { do { newnfs_copycred(&op->nfso_cred, tcred); - error = nfscl_tryclose(op, tcred, nmp, p); + error = nfscl_tryclose(op, tcred, nmp, p, true); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfsexcls"); } while (error == NFSERR_GRACE); @@ -4415,24 +4415,24 @@ nfscl_trydelegreturn(struct nfscldeleg *dp, struct ucred *cred, */ int nfscl_tryclose(struct nfsclopen *op, struct ucred *cred, - struct nfsmount *nmp, NFSPROC_T *p) + struct nfsmount *nmp, NFSPROC_T *p, bool loop_on_delayed) { struct nfsrv_descript nfsd, *nd = &nfsd; int error; do { error = nfsrpc_closerpc(nd, nmp, op, cred, p, 0); - if (error == NFSERR_DELAY) + if (loop_on_delayed && error == NFSERR_DELAY) (void) nfs_catnap(PZERO, error, "nfstrycl"); - } while (error == NFSERR_DELAY); + } while (loop_on_delayed && error == NFSERR_DELAY); if (error == EAUTH || error == EACCES) { /* Try again using system credentials */ newnfs_setroot(cred); do { error = nfsrpc_closerpc(nd, nmp, op, cred, p, 1); - if (error == NFSERR_DELAY) + if (loop_on_delayed && error == NFSERR_DELAY) (void) nfs_catnap(PZERO, error, "nfstrycl"); - } while (error == NFSERR_DELAY); + } while (loop_on_delayed && error == NFSERR_DELAY); } return (error); } From nobody Fri Nov 19 04:36:36 2021 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 5CF04188DE0F; Fri, 19 Nov 2021 04:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP502Fjpz3pkB; Fri, 19 Nov 2021 04:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 298D922024; Fri, 19 Nov 2021 04:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4aaDj034183; Fri, 19 Nov 2021 04:36:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4aa59034182; Fri, 19 Nov 2021 04:36:36 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:36 GMT Message-Id: <202111190436.1AJ4aa59034182@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: ec3bd288b6e9 - stable/13 - rtld: add rtld_fdprintfx() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: ec3bd288b6e96b6008377cafd87de71a7f84b884 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ec3bd288b6e96b6008377cafd87de71a7f84b884 commit ec3bd288b6e96b6008377cafd87de71a7f84b884 Author: Konstantin Belousov AuthorDate: 2021-11-13 01:49:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:27 +0000 rtld: add rtld_fdprintfx() (cherry picked from commit 77c088ab2109a376b71decce80e89d4f20ef8223) --- libexec/rtld-elf/rtld_printf.c | 12 ++++++++++++ libexec/rtld-elf/rtld_printf.h | 1 + 2 files changed, 13 insertions(+) diff --git a/libexec/rtld-elf/rtld_printf.c b/libexec/rtld-elf/rtld_printf.c index aedaf5104e31..48a148f72dff 100644 --- a/libexec/rtld-elf/rtld_printf.c +++ b/libexec/rtld-elf/rtld_printf.c @@ -489,6 +489,18 @@ rtld_fdprintf(int fd, const char *fmt, ...) return (retval); } +int +rtld_fdprintfx(int fd, const char *fmt, ...) +{ + va_list ap; + int retval; + + va_start(ap, fmt); + retval = rtld_vfdprintf(fd, fmt, ap); + va_end(ap); + return (retval); +} + void rtld_fdputstr(int fd, const char *str) { diff --git a/libexec/rtld-elf/rtld_printf.h b/libexec/rtld-elf/rtld_printf.h index 3d3a0480ecce..e2fac948dc53 100644 --- a/libexec/rtld-elf/rtld_printf.h +++ b/libexec/rtld-elf/rtld_printf.h @@ -39,6 +39,7 @@ int rtld_snprintf(char *buf, size_t bufsize, const char *fmt, ...) int rtld_vsnprintf(char *buf, size_t bufsize, const char *fmt, va_list ap); int rtld_vfdprintf(int fd, const char *fmt, va_list ap); int rtld_fdprintf(int fd, const char *fmt, ...) __printflike(2, 3); +int rtld_fdprintfx(int fd, const char *fmt, ...); void rtld_fdputstr(int fd, const char *str); void rtld_fdputchar(int fd, int c); From nobody Fri Nov 19 04:36:37 2021 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 C4495188DDB1; Fri, 19 Nov 2021 04:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP513D0Pz3px3; Fri, 19 Nov 2021 04:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C85121EA6; Fri, 19 Nov 2021 04:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4ab8Q034210; Fri, 19 Nov 2021 04:36:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4abw8034209; Fri, 19 Nov 2021 04:36:37 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:37 GMT Message-Id: <202111190436.1AJ4abw8034209@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: 8ade0046f60b - stable/13 - rtld: Implement LD_SHOW_AUXV 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 8ade0046f60bfc5491662ae363736638aaaf6640 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ade0046f60bfc5491662ae363736638aaaf6640 commit 8ade0046f60bfc5491662ae363736638aaaf6640 Author: Konstantin Belousov AuthorDate: 2021-11-13 01:18:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:27 +0000 rtld: Implement LD_SHOW_AUXV (cherry picked from commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168) --- libexec/rtld-elf/rtld.1 | 7 +++++- libexec/rtld-elf/rtld.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 187dc105667a..66aa2bdabd17 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2021 +.Dd November 13, 2021 .Dt RTLD 1 .Os .Sh NAME @@ -309,6 +309,11 @@ will process the filtee dependencies of the loaded objects immediately, instead of postponing it until required. Normally, the filtees are opened at the time of the first symbol resolution from the filter object. +.It Ev LD_SHOW_AUXV +If set, causes +.Nm +to dump content of the aux vector to standard output, before passing +control to any user code. .El .Sh DIRECT EXECUTION MODE .Nm diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index c173c5a6e22e..0475134b0d96 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); +static void dump_auxv(Elf_Auxinfo **aux_info); static void errmsg_restore(struct dlerror_save *); static struct dlerror_save *errmsg_save(void); static void *fill_search_info(const char *, size_t, void *); @@ -364,6 +365,7 @@ enum { LD_TRACE_LOADED_OBJECTS_FMT1, LD_TRACE_LOADED_OBJECTS_FMT2, LD_TRACE_LOADED_OBJECTS_ALL, + LD_SHOW_AUXV, }; struct ld_env_var_desc { @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), + LD_ENV_DESC(SHOW_AUXV, false), }; static const char * @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) if (rtld_verify_versions(&list_main) == -1 && !ld_tracing) rtld_die(); + if (ld_get_env_var(LD_SHOW_AUXV) != NULL) + dump_auxv(aux_info); + if (ld_tracing) { /* We're done */ trace_loaded_objects(obj_main); exit(0); @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) " Arguments to the executed process\n", argv0); } +#define AUXFMT(at, xfmt) [at] = { .name = #at, .fmt = xfmt } +static const struct auxfmt { + const char *name; + const char *fmt; +} auxfmts[] = { + AUXFMT(AT_NULL, NULL), + AUXFMT(AT_IGNORE, NULL), + AUXFMT(AT_EXECFD, "%d"), + AUXFMT(AT_PHDR, "%p"), + AUXFMT(AT_PHENT, "%u"), + AUXFMT(AT_PHNUM, "%u"), + AUXFMT(AT_PAGESZ, "%u"), + AUXFMT(AT_BASE, "%#lx"), + AUXFMT(AT_FLAGS, "%#lx"), + AUXFMT(AT_ENTRY, "%p"), + AUXFMT(AT_NOTELF, NULL), + AUXFMT(AT_UID, "%d"), + AUXFMT(AT_EUID, "%d"), + AUXFMT(AT_GID, "%d"), + AUXFMT(AT_EGID, "%d"), + AUXFMT(AT_EXECPATH, "%s"), + AUXFMT(AT_CANARY, "%p"), + AUXFMT(AT_CANARYLEN, "%u"), + AUXFMT(AT_OSRELDATE, "%u"), + AUXFMT(AT_NCPUS, "%u"), + AUXFMT(AT_PAGESIZES, "%p"), + AUXFMT(AT_PAGESIZESLEN, "%u"), + AUXFMT(AT_TIMEKEEP, "%p"), + AUXFMT(AT_STACKPROT, "%#x"), + AUXFMT(AT_EHDRFLAGS, "%#lx"), + AUXFMT(AT_HWCAP, "%#lx"), + AUXFMT(AT_HWCAP2, "%#lx"), + AUXFMT(AT_BSDFLAGS, "%#lx"), + AUXFMT(AT_ARGC, "%u"), + AUXFMT(AT_ARGV, "%p"), + AUXFMT(AT_ENVC, "%p"), + AUXFMT(AT_ENVV, "%p"), + AUXFMT(AT_PS_STRINGS, "%p"), + AUXFMT(AT_FXRNG, "%p"), +}; + +static void +dump_auxv(Elf_Auxinfo **aux_info) +{ + Elf_Auxinfo *auxp; + const struct auxfmt *fmt; + int i; + + for (i = 0; i < AT_COUNT; i++) { + auxp = aux_info[i]; + if (auxp == NULL) + continue; + fmt = &auxfmts[i]; + if (fmt->fmt == NULL) + continue; + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); + rtld_fdprintf(STDOUT_FILENO, "\n"); + } +} + /* * Overrides for libc_pic-provided functions. */ From nobody Fri Nov 19 04:36:38 2021 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 140BE188DCC4; Fri, 19 Nov 2021 04:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP525GJgz3ppM; Fri, 19 Nov 2021 04:36:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D2CA2219B; Fri, 19 Nov 2021 04:36:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4acGw034234; Fri, 19 Nov 2021 04:36:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4ac64034233; Fri, 19 Nov 2021 04:36:38 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:38 GMT Message-Id: <202111190436.1AJ4ac64034233@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: f363b08c6d5f - stable/13 - rtld dump_auxv: consistently use long modifier for non-pointer auxv vals 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: f363b08c6d5f3f3df0f6f301b08348cf003beac1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f363b08c6d5f3f3df0f6f301b08348cf003beac1 commit f363b08c6d5f3f3df0f6f301b08348cf003beac1 Author: Konstantin Belousov AuthorDate: 2021-11-13 19:03:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:27 +0000 rtld dump_auxv: consistently use long modifier for non-pointer auxv vals (cherry picked from commit 3a902ef253853e367bd755222ed8fe4f101fbf2c) --- libexec/rtld-elf/rtld.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 0475134b0d96..4c3762ee1ab9 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6071,33 +6071,33 @@ static const struct auxfmt { } auxfmts[] = { AUXFMT(AT_NULL, NULL), AUXFMT(AT_IGNORE, NULL), - AUXFMT(AT_EXECFD, "%d"), + AUXFMT(AT_EXECFD, "%ld"), AUXFMT(AT_PHDR, "%p"), - AUXFMT(AT_PHENT, "%u"), - AUXFMT(AT_PHNUM, "%u"), - AUXFMT(AT_PAGESZ, "%u"), + AUXFMT(AT_PHENT, "%lu"), + AUXFMT(AT_PHNUM, "%lu"), + AUXFMT(AT_PAGESZ, "%lu"), AUXFMT(AT_BASE, "%#lx"), AUXFMT(AT_FLAGS, "%#lx"), AUXFMT(AT_ENTRY, "%p"), AUXFMT(AT_NOTELF, NULL), - AUXFMT(AT_UID, "%d"), - AUXFMT(AT_EUID, "%d"), - AUXFMT(AT_GID, "%d"), - AUXFMT(AT_EGID, "%d"), + AUXFMT(AT_UID, "%ld"), + AUXFMT(AT_EUID, "%ld"), + AUXFMT(AT_GID, "%ld"), + AUXFMT(AT_EGID, "%ld"), AUXFMT(AT_EXECPATH, "%s"), AUXFMT(AT_CANARY, "%p"), - AUXFMT(AT_CANARYLEN, "%u"), - AUXFMT(AT_OSRELDATE, "%u"), - AUXFMT(AT_NCPUS, "%u"), + AUXFMT(AT_CANARYLEN, "%lu"), + AUXFMT(AT_OSRELDATE, "%lu"), + AUXFMT(AT_NCPUS, "%lu"), AUXFMT(AT_PAGESIZES, "%p"), - AUXFMT(AT_PAGESIZESLEN, "%u"), + AUXFMT(AT_PAGESIZESLEN, "%lu"), AUXFMT(AT_TIMEKEEP, "%p"), - AUXFMT(AT_STACKPROT, "%#x"), + AUXFMT(AT_STACKPROT, "%#lx"), AUXFMT(AT_EHDRFLAGS, "%#lx"), AUXFMT(AT_HWCAP, "%#lx"), AUXFMT(AT_HWCAP2, "%#lx"), AUXFMT(AT_BSDFLAGS, "%#lx"), - AUXFMT(AT_ARGC, "%u"), + AUXFMT(AT_ARGC, "%lu"), AUXFMT(AT_ARGV, "%p"), AUXFMT(AT_ENVC, "%p"), AUXFMT(AT_ENVV, "%p"), From nobody Fri Nov 19 04:36:39 2021 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 923CF188DC59; Fri, 19 Nov 2021 04:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP540HjDz3ps3; Fri, 19 Nov 2021 04:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EBD721FA6; Fri, 19 Nov 2021 04:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4ad2E034258; Fri, 19 Nov 2021 04:36:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4adLs034257; Fri, 19 Nov 2021 04:36:39 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:39 GMT Message-Id: <202111190436.1AJ4adLs034257@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: b26ac07d6c6c - stable/13 - rtld dump_auxv: be pedantic and distiguish between auxv union members based on format 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: b26ac07d6c6cba8447b9ae597473b6777a843c27 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b26ac07d6c6cba8447b9ae597473b6777a843c27 commit b26ac07d6c6cba8447b9ae597473b6777a843c27 Author: Konstantin Belousov AuthorDate: 2021-11-13 19:04:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:27 +0000 rtld dump_auxv: be pedantic and distiguish between auxv union members based on format (cherry picked from commit b61bce17f346d79cecfd8f195a64b10f77be43b1) --- libexec/rtld-elf/rtld.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 4c3762ee1ab9..d5c3d2893582 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6105,6 +6105,15 @@ static const struct auxfmt { AUXFMT(AT_FXRNG, "%p"), }; +static bool +is_ptr_fmt(const char *fmt) +{ + char last; + + last = fmt[strlen(fmt) - 1]; + return (last == 'p' || last == 's'); +} + static void dump_auxv(Elf_Auxinfo **aux_info) { @@ -6120,7 +6129,13 @@ dump_auxv(Elf_Auxinfo **aux_info) if (fmt->fmt == NULL) continue; rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); + if (is_ptr_fmt(fmt->fmt)) { + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, + auxp->a_un.a_ptr); + } else { + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, + auxp->a_un.a_val); + } rtld_fdprintf(STDOUT_FILENO, "\n"); } } From nobody Fri Nov 19 04:36:40 2021 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 ADC4A188DDE0; Fri, 19 Nov 2021 04:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP552kHzz3pmV; Fri, 19 Nov 2021 04:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0EB721EA7; Fri, 19 Nov 2021 04:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4aeuC034282; Fri, 19 Nov 2021 04:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4aeWB034281; Fri, 19 Nov 2021 04:36:40 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:40 GMT Message-Id: <202111190436.1AJ4aeWB034281@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: e631f3e04e40 - stable/13 - procstat auxv: print out FXRNG 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e631f3e04e4083b456d24cd0d2679d6a04900c33 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e631f3e04e4083b456d24cd0d2679d6a04900c33 commit e631f3e04e4083b456d24cd0d2679d6a04900c33 Author: Konstantin Belousov AuthorDate: 2021-11-13 20:55:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:27 +0000 procstat auxv: print out FXRNG (cherry picked from commit 0864ab3d3235f22c45f3790b2eb94974a51af062) --- usr.bin/procstat/procstat_auxv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.bin/procstat/procstat_auxv.c b/usr.bin/procstat/procstat_auxv.c index 0b540de973de..f868b7ed2381 100644 --- a/usr.bin/procstat/procstat_auxv.c +++ b/usr.bin/procstat/procstat_auxv.c @@ -233,6 +233,12 @@ procstat_auxv(struct procstat *procstat, struct kinfo_proc *kipp) xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_PS_STRINGS/%p}\n", prefix, "AT_PS_STRINGS", auxv[i].a_un.a_ptr); break; +#endif +#ifdef AT_FXRNG + case AT_FXRNG: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_FXRNG/%p}\n", + prefix, "AT_FXRNG", auxv[i].a_un.a_ptr); + break; #endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", From nobody Fri Nov 19 04:36:41 2021 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 6ACB0188DD70; Fri, 19 Nov 2021 04:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP560CVcz3pkf; Fri, 19 Nov 2021 04:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7DA721EA8; Fri, 19 Nov 2021 04:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4afjW034306; Fri, 19 Nov 2021 04:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4afx7034305; Fri, 19 Nov 2021 04:36:41 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:41 GMT Message-Id: <202111190436.1AJ4afx7034305@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: e8b954f136a7 - stable/13 - ldd: also use exec mode for -a 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e8b954f136a7af19c44e16c11335abb9fb5fa7d1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e8b954f136a7af19c44e16c11335abb9fb5fa7d1 commit e8b954f136a7af19c44e16c11335abb9fb5fa7d1 Author: Konstantin Belousov AuthorDate: 2021-11-15 20:45:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:28 +0000 ldd: also use exec mode for -a PR: 259069 (cherry picked from commit 7d20a08076b4c9d4513585a01fc57c39be654edf) --- usr.bin/ldd/ldd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index 492e29dff211..c16b6f5e8496 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.c @@ -236,7 +236,7 @@ main(int argc, char *argv[]) if (is_shlib == 0) { execl(*argv, *argv, (char *)NULL); warn("%s", *argv); - } else if (fmt1 == NULL && fmt2 == NULL) { + } else if (fmt1 == NULL && fmt2 == NULL && !aflag) { dlopen(*argv, RTLD_TRACE); warnx("%s: %s", *argv, dlerror()); } else { From nobody Fri Nov 19 04:36:45 2021 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 880F1188DEBB; Fri, 19 Nov 2021 04:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP596T8Vz3q0t; Fri, 19 Nov 2021 04:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B5D021D69; Fri, 19 Nov 2021 04:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4ajUk034386; Fri, 19 Nov 2021 04:36:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4ajQV034385; Fri, 19 Nov 2021 04:36:45 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:45 GMT Message-Id: <202111190436.1AJ4ajQV034385@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: defbe7a7ca21 - stable/13 - ffs: Remove assertions about locked um_devvp in several 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: defbe7a7ca212fd93fc367f0d02ffa340635c4c4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=defbe7a7ca212fd93fc367f0d02ffa340635c4c4 commit defbe7a7ca212fd93fc367f0d02ffa340635c4c4 Author: Konstantin Belousov AuthorDate: 2021-11-01 08:04:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:28 +0000 ffs: Remove assertions about locked um_devvp in several places (cherry picked from commit 76b05e3e399133b59fc3e740cab9ae362358c9d6) --- sys/ufs/ffs/ffs_alloc.c | 7 +++++-- sys/ufs/ffs/ffs_vfsops.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6a262a798d1b..42708e3dce71 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -2251,9 +2251,12 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) MPASS(devvp->v_mount->mnt_data == ump); dev = ump->um_devvp->v_rdev; } else if (devvp->v_type == VCHR) { - /* devvp is a normal disk device */ + /* + * devvp is a normal disk device + * XXXKIB: devvp is not locked there, v_rdev access depends on + * busy mount, which prevents mntfs devvp from reclamation. + */ dev = devvp->v_rdev; - ASSERT_VOP_LOCKED(devvp, "ffs_blkfree_cg"); } else return; #ifdef INVARIANTS diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0b96edff12ff..b8f7c3821bf7 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1544,7 +1544,7 @@ ffs_flushfiles(mp, flags, td) */ } #endif - ASSERT_VOP_LOCKED(ump->um_devvp, "ffs_flushfiles"); + /* devvp is not locked there */ if (ump->um_devvp->v_vflag & VV_COPYONWRITE) { if ((error = vflush(mp, 0, SKIPSYSTEM | flags, td)) != 0) return (error); From nobody Fri Nov 19 04:36:43 2021 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 40EF8188DCEF; Fri, 19 Nov 2021 04:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP583gP2z3q0j; Fri, 19 Nov 2021 04:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05CAE218ED; Fri, 19 Nov 2021 04:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4ahpk034362; Fri, 19 Nov 2021 04:36:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4ahjr034361; Fri, 19 Nov 2021 04:36:43 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:43 GMT Message-Id: <202111190436.1AJ4ahjr034361@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: 4c04226222e4 - stable/13 - getblk(): do not require devvp vnodes to be locked 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 4c04226222e499a47dd89988bcbd6df1362c6f4f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4c04226222e499a47dd89988bcbd6df1362c6f4f commit 4c04226222e499a47dd89988bcbd6df1362c6f4f Author: Konstantin Belousov AuthorDate: 2021-11-01 07:14:01 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:28 +0000 getblk(): do not require devvp vnodes to be locked (cherry picked from commit a7b4a54d2c02822d36bb51b1e4450e1bc14ba73a) --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 6ce445cbf2ee..1e58339446a9 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3902,7 +3902,8 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int slpflag, CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size); KASSERT((flags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_KVAALLOC, ("GB_KVAALLOC only makes sense with GB_UNMAPPED")); - ASSERT_VOP_LOCKED(vp, "getblk"); + if (vp->v_type != VCHR) + ASSERT_VOP_LOCKED(vp, "getblk"); if (size > maxbcachebuf) panic("getblk: size(%d) > maxbcachebuf(%d)\n", size, maxbcachebuf); From nobody Fri Nov 19 04:36:46 2021 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 4F867188DFEA; Fri, 19 Nov 2021 04:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5B6Qrgz3pdq; Fri, 19 Nov 2021 04:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 502BF2219C; Fri, 19 Nov 2021 04:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4akC0034410; Fri, 19 Nov 2021 04:36:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4ak7L034409; Fri, 19 Nov 2021 04:36:46 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:46 GMT Message-Id: <202111190436.1AJ4ak7L034409@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: c4585660d2bf - stable/13 - mntfs: lock mntfs pseudo devfs vnode properly 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: c4585660d2bf58de2f32a19885e1d98bfd835439 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c4585660d2bf58de2f32a19885e1d98bfd835439 commit c4585660d2bf58de2f32a19885e1d98bfd835439 Author: Konstantin Belousov AuthorDate: 2021-11-01 12:28:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:28 +0000 mntfs: lock mntfs pseudo devfs vnode properly (cherry picked from commit 25809a018db3c9f3be838c10576d2bb070cc055a) --- sys/fs/mntfs/mntfs_vnops.c | 4 ++-- sys/ufs/ffs/ffs_vfsops.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/mntfs/mntfs_vnops.c b/sys/fs/mntfs/mntfs_vnops.c index 2708bc5d319f..4eb12a679590 100644 --- a/sys/fs/mntfs/mntfs_vnops.c +++ b/sys/fs/mntfs/mntfs_vnops.c @@ -89,7 +89,7 @@ mntfs_allocvp(struct mount *mp, struct vnode *ovp) void mntfs_freevp(struct vnode *vp) { - + ASSERT_VOP_ELOCKED(vp, "mntfs_freevp"); vgone(vp); - vrele(vp); + vput(vp); } diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index b8f7c3821bf7..8d0d00bb0231 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -956,6 +956,7 @@ ffs_mountfs(odevvp, mp, td) devvp = mntfs_allocvp(mp, odevvp); VOP_UNLOCK(odevvp); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); KASSERT(devvp->v_type == VCHR, ("reclaimed devvp")); dev = devvp->v_rdev; KASSERT(dev->si_snapdata == NULL, ("non-NULL snapshot data")); @@ -977,6 +978,7 @@ ffs_mountfs(odevvp, mp, td) BO_LOCK(&odevvp->v_bufobj); odevvp->v_bufobj.bo_flag |= BO_NOBUFS; BO_UNLOCK(&odevvp->v_bufobj); + VOP_UNLOCK(devvp); if (dev->si_iosize_max != 0) mp->mnt_iosize_max = dev->si_iosize_max; if (mp->mnt_iosize_max > maxphys) @@ -1264,6 +1266,7 @@ out: odevvp->v_bufobj.bo_flag &= ~BO_NOBUFS; BO_UNLOCK(&odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); mntfs_freevp(devvp); dev_rel(dev); return (error); @@ -1466,6 +1469,7 @@ ffs_unmount(mp, mntflags) ump->um_odevvp->v_bufobj.bo_flag &= ~BO_NOBUFS; BO_UNLOCK(&ump->um_odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); mntfs_freevp(ump->um_devvp); vrele(ump->um_odevvp); dev_rel(ump->um_dev); From nobody Fri Nov 19 04:36:48 2021 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 D3D61188DECE; Fri, 19 Nov 2021 04:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5D5WJPz3pqC; Fri, 19 Nov 2021 04:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CD8F21D6A; Fri, 19 Nov 2021 04:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4am3X034466; Fri, 19 Nov 2021 04:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4amTr034465; Fri, 19 Nov 2021 04:36:48 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:48 GMT Message-Id: <202111190436.1AJ4amTr034465@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: 43215144c041 - stable/13 - g_vfs_close(): vp is unused 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 43215144c041b8f8502c268c72c3041b44e05540 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43215144c041b8f8502c268c72c3041b44e05540 commit 43215144c041b8f8502c268c72c3041b44e05540 Author: Konstantin Belousov AuthorDate: 2021-11-18 03:02:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:29 +0000 g_vfs_close(): vp is unused (cherry picked from commit 4fdc5b8494b46007549b1932c64e11cf634599a1) --- sys/geom/geom_vfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index ab9d4a001c76..f01765b8ee30 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -286,13 +286,11 @@ g_vfs_close(struct g_consumer *cp) { struct g_geom *gp; struct g_vfs_softc *sc; - struct vnode *vp; g_topology_assert(); gp = cp->geom; sc = gp->softc; - vp = cp->private; bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0); sc->sc_bo->bo_private = cp->private; gp->softc = NULL; From nobody Fri Nov 19 04:36:42 2021 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 2720B188E01F; Fri, 19 Nov 2021 04:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP574JcGz3pxc; Fri, 19 Nov 2021 04:36:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEFD4218EC; Fri, 19 Nov 2021 04:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4agXL034338; Fri, 19 Nov 2021 04:36:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4ag31034337; Fri, 19 Nov 2021 04:36:42 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:42 GMT Message-Id: <202111190436.1AJ4ag31034337@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: 77ddf3808b60 - stable/13 - geom_vfs: lock devvp in g_vfs_close() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 77ddf3808b60e1e1fb521e14462561055d00ba58 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=77ddf3808b60e1e1fb521e14462561055d00ba58 commit 77ddf3808b60e1e1fb521e14462561055d00ba58 Author: Konstantin Belousov AuthorDate: 2021-11-01 05:46:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:28 +0000 geom_vfs: lock devvp in g_vfs_close() (cherry picked from commit 8db7d16526debbca6bc7a32a57fd0378e48e37de) --- sys/geom/geom_vfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index f01765b8ee30..b69610c4615e 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -286,12 +286,16 @@ g_vfs_close(struct g_consumer *cp) { struct g_geom *gp; struct g_vfs_softc *sc; + struct vnode *vp; g_topology_assert(); gp = cp->geom; sc = gp->softc; + vp = cp->private; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0); + VOP_UNLOCK(vp); sc->sc_bo->bo_private = cp->private; gp->softc = NULL; mtx_destroy(&sc->sc_mtx); From nobody Fri Nov 19 04:36:47 2021 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 B2384188E20D; Fri, 19 Nov 2021 04:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5D2Lccz3py4; Fri, 19 Nov 2021 04:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C29721EA9; Fri, 19 Nov 2021 04:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4alZj034436; Fri, 19 Nov 2021 04:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4alAf034433; Fri, 19 Nov 2021 04:36:47 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:47 GMT Message-Id: <202111190436.1AJ4alAf034433@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: 8d194cc56d93 - stable/13 - ffs: fix newly introduced LOR between mntfs vnode lock and topology lock 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 8d194cc56d935734ff47ad187ffe99601658d0ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8d194cc56d935734ff47ad187ffe99601658d0ac commit 8d194cc56d935734ff47ad187ffe99601658d0ac Author: Konstantin Belousov AuthorDate: 2021-11-16 17:31:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:28 +0000 ffs: fix newly introduced LOR between mntfs vnode lock and topology lock (cherry picked from commit c34a5148e8f21e9be28330c4ae4884b6f31193dd) --- sys/geom/geom_vfs.c | 2 -- sys/ufs/ffs/ffs_vfsops.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index b69610c4615e..ab9d4a001c76 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -293,9 +293,7 @@ g_vfs_close(struct g_consumer *cp) gp = cp->geom; sc = gp->softc; vp = cp->private; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0); - VOP_UNLOCK(vp); sc->sc_bo->bo_private = cp->private; gp->softc = NULL; mtx_destroy(&sc->sc_mtx); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 8d0d00bb0231..507f0b148fc5 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1462,6 +1462,7 @@ ffs_unmount(mp, mntflags) taskqueue_free(ump->um_trim_tq); free (ump->um_trimhash, M_TRIM); } + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); g_topology_lock(); g_vfs_close(ump->um_cp); g_topology_unlock(); @@ -1469,7 +1470,6 @@ ffs_unmount(mp, mntflags) ump->um_odevvp->v_bufobj.bo_flag &= ~BO_NOBUFS; BO_UNLOCK(&ump->um_odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); mntfs_freevp(ump->um_devvp); vrele(ump->um_odevvp); dev_rel(ump->um_dev); From nobody Fri Nov 19 04:36:53 2021 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 2AEA4188E24B; Fri, 19 Nov 2021 04:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5K5QbFz3q5y; Fri, 19 Nov 2021 04:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CA8A21FA8; Fri, 19 Nov 2021 04:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4arAQ034565; Fri, 19 Nov 2021 04:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4arjM034564; Fri, 19 Nov 2021 04:36:53 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:53 GMT Message-Id: <202111190436.1AJ4arjM034564@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: ccea961fcc83 - stable/13 - nfsclient: upgrade vnode lock in VOP_OPEN()/VOP_CLOSE() if we need to flush buffers 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: ccea961fcc83b0d9011d75c488216cf6770042c7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ccea961fcc83b0d9011d75c488216cf6770042c7 commit ccea961fcc83b0d9011d75c488216cf6770042c7 Author: Konstantin Belousov AuthorDate: 2021-11-15 20:24:46 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:29 +0000 nfsclient: upgrade vnode lock in VOP_OPEN()/VOP_CLOSE() if we need to flush buffers (cherry picked from commit 8ef0c11e7ce79106130012cb929a8324045f7ff9) --- sys/fs/nfsclient/nfs_clvnops.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index cd8077e243ea..5ae731d1b5e3 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -645,6 +645,11 @@ nfs_open(struct vop_open_args *ap) NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { NFSUNLOCKNODE(np); + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp)) + return (EBADF); + } error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) @@ -681,6 +686,11 @@ nfs_open(struct vop_open_args *ap) if (vp->v_type == VDIR) np->n_direofoffset = 0; NFSUNLOCKNODE(np); + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp)) + return (EBADF); + } error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) @@ -701,6 +711,11 @@ nfs_open(struct vop_open_args *ap) (vp->v_type == VREG)) { if (np->n_directio_opens == 0) { NFSUNLOCKNODE(np); + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp)) + return (EBADF); + } error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error) { if (NFS_ISV4(vp)) @@ -746,6 +761,11 @@ nfs_open(struct vop_open_args *ap) if (vp->v_writecount <= -1) { if ((obj = vp->v_object) != NULL && vm_object_mightbedirty(obj)) { + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp)) + return (EBADF); + } VM_OBJECT_WLOCK(obj); vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); VM_OBJECT_WUNLOCK(obj); @@ -829,6 +849,11 @@ nfs_close(struct vop_close_args *ap) * mmap'ed writes or via write(). */ if (nfs_clean_pages_on_close && vp->v_object) { + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp) && ap->a_fflag != FNONBLOCK) + return (EBADF); + } VM_OBJECT_WLOCK(vp->v_object); vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); @@ -853,11 +878,22 @@ nfs_close(struct vop_close_args *ap) * traditional vnode locking implemented for Vnode Ops. */ int cm = newnfs_commit_on_close ? 1 : 0; + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp) && ap->a_fflag != FNONBLOCK) + return (EBADF); + } error = ncl_flush(vp, MNT_WAIT, ap->a_td, cm, 0); /* np->n_flag &= ~NMODIFIED; */ } else if (NFS_ISV4(vp)) { if (nfscl_mustflush(vp) != 0) { int cm = newnfs_commit_on_close ? 1 : 0; + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp) && ap->a_fflag != + FNONBLOCK) + return (EBADF); + } error = ncl_flush(vp, MNT_WAIT, ap->a_td, cm, 0); /* @@ -867,6 +903,12 @@ nfs_close(struct vop_close_args *ap) */ } } else { + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); + if (VN_IS_DOOMED(vp) && ap->a_fflag != + FNONBLOCK) + return (EBADF); + } error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); } NFSLOCKNODE(np); From nobody Fri Nov 19 04:36:51 2021 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 AFC24188E1C0; Fri, 19 Nov 2021 04:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5J3m0nz3q1L; Fri, 19 Nov 2021 04:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFD94218EE; Fri, 19 Nov 2021 04:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4apsV034540; Fri, 19 Nov 2021 04:36:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4aphv034539; Fri, 19 Nov 2021 04:36:51 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:51 GMT Message-Id: <202111190436.1AJ4aphv034539@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: b9283ea323b2 - stable/13 - Make locking assertions for VOP_FSYNC() and VOP_FDATASYNC() more correct 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: b9283ea323b202579ce9e59c811672bcfc2eda53 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b9283ea323b202579ce9e59c811672bcfc2eda53 commit b9283ea323b202579ce9e59c811672bcfc2eda53 Author: Konstantin Belousov AuthorDate: 2021-11-03 22:28:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:29 +0000 Make locking assertions for VOP_FSYNC() and VOP_FDATASYNC() more correct (cherry picked from commit 47b248ac651683650f7852485c594e76ca375573) --- sys/kern/vfs_subr.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/vnode_if.src | 8 ++++++-- sys/sys/vnode.h | 8 ++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ce1f4ed6126e..ff208926be16 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5580,6 +5580,54 @@ vop_fplookup_symlink_debugpost(void *ap __unused, int rc __unused) VFS_SMR_ASSERT_ENTERED(); } + +static void +vop_fsync_debugprepost(struct vnode *vp, const char *name) +{ + if (vp->v_type == VCHR) + ; + else if (MNT_EXTENDED_SHARED(vp->v_mount)) + ASSERT_VOP_LOCKED(vp, name); + else + ASSERT_VOP_ELOCKED(vp, name); +} + +void +vop_fsync_debugpre(void *a) +{ + struct vop_fsync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + +void +vop_fsync_debugpost(void *a, int rc __unused) +{ + struct vop_fsync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + +void +vop_fdatasync_debugpre(void *a) +{ + struct vop_fdatasync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + +void +vop_fdatasync_debugpost(void *a, int rc __unused) +{ + struct vop_fdatasync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + void vop_strategy_debugpre(void *ap) { diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index b506237f385d..ef4eef7f55f3 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -296,7 +296,9 @@ vop_revoke { }; -%% fsync vp L L L +%% fsync vp - - - +%! fsync pre vop_fsync_debugpre +%! fsync post vop_fsync_debugpost vop_fsync { IN struct vnode *vp; @@ -768,7 +770,9 @@ vop_add_writecount { }; -%% fdatasync vp L L L +%% fdatasync vp - - - +%! fdatasync pre vop_fdatasync_debugpre +%! fdatasync post vop_fdatasync_debugpost vop_fdatasync { IN struct vnode *vp; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index ebd9577004fc..ba5eafc80d4b 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -920,10 +920,14 @@ void vop_symlink_post(void *a, int rc); int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); #ifdef DEBUG_VFS_LOCKS +void vop_fdatasync_debugpre(void *a); +void vop_fdatasync_debugpost(void *a, int rc); void vop_fplookup_vexec_debugpre(void *a); void vop_fplookup_vexec_debugpost(void *a, int rc); void vop_fplookup_symlink_debugpre(void *a); void vop_fplookup_symlink_debugpost(void *a, int rc); +void vop_fsync_debugpre(void *a); +void vop_fsync_debugpost(void *a, int rc); void vop_strategy_debugpre(void *a); void vop_lock_debugpre(void *a); void vop_lock_debugpost(void *a, int rc); @@ -932,10 +936,14 @@ void vop_need_inactive_debugpre(void *a); void vop_need_inactive_debugpost(void *a, int rc); void vop_mkdir_debugpost(void *a, int rc); #else +#define vop_fdatasync_debugpre(x) do { } while (0) +#define vop_fdatasync_debugpost(x, y) do { } while (0) #define vop_fplookup_vexec_debugpre(x) do { } while (0) #define vop_fplookup_vexec_debugpost(x, y) do { } while (0) #define vop_fplookup_symlink_debugpre(x) do { } while (0) #define vop_fplookup_symlink_debugpost(x, y) do { } while (0) +#define vop_fsync_debugpre(x) do { } while (0) +#define vop_fsync_debugpost(x, y) do { } while (0) #define vop_strategy_debugpre(x) do { } while (0) #define vop_lock_debugpre(x) do { } while (0) #define vop_lock_debugpost(x, y) do { } while (0) From nobody Fri Nov 19 04:36:54 2021 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 ACE55188E25D; Fri, 19 Nov 2021 04:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5M4CRkz3pqk; Fri, 19 Nov 2021 04:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 487DC21F35; Fri, 19 Nov 2021 04:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4asDt034595; Fri, 19 Nov 2021 04:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4asRT034594; Fri, 19 Nov 2021 04:36:54 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:54 GMT Message-Id: <202111190436.1AJ4asRT034594@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: 19f2755d9ed1 - stable/13 - DEBUG_VFS_LOCKS: stop excluding devfs and doomed vnode from asserts 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 19f2755d9ed1890c8c6a3a66b2493d69c6e0d0ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=19f2755d9ed1890c8c6a3a66b2493d69c6e0d0ee commit 19f2755d9ed1890c8c6a3a66b2493d69c6e0d0ee Author: Konstantin Belousov AuthorDate: 2021-10-31 21:34:57 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:29 +0000 DEBUG_VFS_LOCKS: stop excluding devfs and doomed vnode from asserts (cherry picked from commit d032cda0d047869139f03cb6d34a18216a166735) --- sys/kern/vfs_subr.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ff208926be16..f56bedecaf15 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5407,13 +5407,6 @@ extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, } #ifdef DEBUG_VFS_LOCKS -/* - * This only exists to suppress warnings from unlocked specfs accesses. It is - * no longer ok to have an unlocked VFS. - */ -#define IGNORE_LOCK(vp) (KERNEL_PANICKED() || (vp) == NULL || \ - (vp)->v_type == VCHR || (vp)->v_type == VBAD) - int vfs_badlock_ddb = 1; /* Drop into debugger on violation. */ SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_ddb, CTLFLAG_RW, &vfs_badlock_ddb, 0, "Drop into debugger on lock violation"); @@ -5473,26 +5466,31 @@ assert_vop_locked(struct vnode *vp, const char *str) { int locked; - if (!IGNORE_LOCK(vp)) { - locked = VOP_ISLOCKED(vp); - if (locked == 0 || locked == LK_EXCLOTHER) - vfs_badlock("is not locked but should be", str, vp); - } + if (KERNEL_PANICKED() || vp == NULL) + return; + + locked = VOP_ISLOCKED(vp); + if (locked == 0 || locked == LK_EXCLOTHER) + vfs_badlock("is not locked but should be", str, vp); } void assert_vop_unlocked(struct vnode *vp, const char *str) { + if (KERNEL_PANICKED() || vp == NULL) + return; - if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) == LK_EXCLUSIVE) + if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) vfs_badlock("is locked but should not be", str, vp); } void assert_vop_elocked(struct vnode *vp, const char *str) { + if (KERNEL_PANICKED() || vp == NULL) + return; - if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vfs_badlock("is not exclusive locked but should be", str, vp); } #endif /* DEBUG_VFS_LOCKS */ From nobody Fri Nov 19 04:36:49 2021 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 059F6188E22B; Fri, 19 Nov 2021 04:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5G0JDQz3pnM; Fri, 19 Nov 2021 04:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A124021FA7; Fri, 19 Nov 2021 04:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4ana1034490; Fri, 19 Nov 2021 04:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4anZu034489; Fri, 19 Nov 2021 04:36:49 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:49 GMT Message-Id: <202111190436.1AJ4anZu034489@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: bd625dc3e676 - stable/13 - ffs_snapshot: do not assert that um_devvp is locked 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: bd625dc3e6767f405d78dd1d5c23bb90fd36627f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd625dc3e6767f405d78dd1d5c23bb90fd36627f commit bd625dc3e6767f405d78dd1d5c23bb90fd36627f Author: Konstantin Belousov AuthorDate: 2021-11-01 23:47:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:29 +0000 ffs_snapshot: do not assert that um_devvp is locked (cherry picked from commit eede22d66d0043bf46e0aeac9496bec0a52f87a1) --- sys/ufs/ffs/ffs_snapshot.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 5855a679ab84..a0d16d9eccef 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -2124,7 +2124,6 @@ ffs_snapshot_mount(mp) } VOP_UNLOCK(vp); VI_LOCK(devvp); - ASSERT_VOP_LOCKED(devvp, "ffs_snapshot_mount"); sn->sn_listsize = snaplistsize; sn->sn_blklist = (daddr_t *)snapblklist; devvp->v_vflag |= VV_COPYONWRITE; @@ -2172,7 +2171,6 @@ ffs_snapshot_unmount(mp) sn = devvp->v_rdev->si_snapdata; } try_free_snapdata(devvp); - ASSERT_VOP_LOCKED(devvp, "ffs_snapshot_unmount"); } /* From nobody Fri Nov 19 04:36:50 2021 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 C4D01188E395; Fri, 19 Nov 2021 04:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwP5H1fVdz3pvk; Fri, 19 Nov 2021 04:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C91332219D; Fri, 19 Nov 2021 04:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4aofb034515; Fri, 19 Nov 2021 04:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4aocR034514; Fri, 19 Nov 2021 04:36:50 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:36:50 GMT Message-Id: <202111190436.1AJ4aocR034514@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: 3a12ea648f3b - stable/13 - freevnode(): lock the freeing vnode around destroy_vpollinfo() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 3a12ea648f3b9a7de4fe08a3a9d3ea6d025e8f07 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3a12ea648f3b9a7de4fe08a3a9d3ea6d025e8f07 commit 3a12ea648f3b9a7de4fe08a3a9d3ea6d025e8f07 Author: Konstantin Belousov AuthorDate: 2021-11-02 02:49:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-19 04:25:29 +0000 freevnode(): lock the freeing vnode around destroy_vpollinfo() (cherry picked from commit d1d675cb304c3cca824fbc9f932dc9d655b1ad24) --- sys/kern/vfs_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index da2f90a44d86..ce1f4ed6126e 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1920,7 +1920,9 @@ freevnode(struct vnode *vp) mac_vnode_destroy(vp); #endif if (vp->v_pollinfo != NULL) { + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); destroy_vpollinfo(vp->v_pollinfo); + VOP_UNLOCK(vp); vp->v_pollinfo = NULL; } vp->v_mountedhere = NULL; From nobody Fri Nov 19 04:53:21 2021 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 C78F11897AD7; Fri, 19 Nov 2021 04:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSK5Hq6z4Ths; Fri, 19 Nov 2021 04:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96E8722513; Fri, 19 Nov 2021 04:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rLEc061088; Fri, 19 Nov 2021 04:53:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rLeD061087; Fri, 19 Nov 2021 04:53:21 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:21 GMT Message-Id: <202111190453.1AJ4rLeD061087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 8d7e5c90e989 - stable/13 - arm64: Spell BeagleBone correctly in config 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d7e5c90e9894fec4a71d2f653344ae5aea4fabd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8d7e5c90e9894fec4a71d2f653344ae5aea4fabd commit 8d7e5c90e9894fec4a71d2f653344ae5aea4fabd Author: Tom Hukins AuthorDate: 2021-11-19 04:51:12 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:21 +0000 arm64: Spell BeagleBone correctly in config file. Pull Request: https://github.com/freebsd/freebsd-src/pull/545 (cherry picked from commit 202692b1a733322540723c718288eff3a8054d42) --- sys/arm/conf/GENERIC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 165f707106f4..ac8cbab997ec 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -184,7 +184,7 @@ device ti_adc device pwm # Watchdog support -# If we don't enable the watchdog driver, the BealeBone could potentially +# If we don't enable the watchdog driver, the BeagleBone could potentially # reboot automatically because the boot loader might have enabled the # watchdog. device ti_wdt From nobody Fri Nov 19 04:53:22 2021 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 176DF1897578; Fri, 19 Nov 2021 04:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSL6hnxz4TKr; Fri, 19 Nov 2021 04:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB17622078; Fri, 19 Nov 2021 04:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rM92061112; Fri, 19 Nov 2021 04:53:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rMVC061111; Fri, 19 Nov 2021 04:53:22 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:22 GMT Message-Id: <202111190453.1AJ4rMVC061111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2a5fe2c98181 - stable/13 - src/bin/ps: Fix spelling error 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a5fe2c9818170ea8a853405522add3d2994984c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2a5fe2c9818170ea8a853405522add3d2994984c commit 2a5fe2c9818170ea8a853405522add3d2994984c Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:51:12 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:21 +0000 src/bin/ps: Fix spelling error Spell interruptible correctly. Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 3fe686f25a0d0844dc3afd0b3b067ec46abdbc99) --- bin/ps/print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ps/print.c b/bin/ps/print.c index 2b61c6b0a15a..d4dbd9624011 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -236,7 +236,7 @@ state(KINFO *k, VARENT *ve __unused) break; case SSLEEP: - if (tdflags & TDF_SINTR) /* interruptable (long) */ + if (tdflags & TDF_SINTR) /* interruptible (long) */ *cp = k->ki_p->ki_slptime >= MAXSLP ? 'I' : 'S'; else *cp = 'D'; From nobody Fri Nov 19 04:53:23 2021 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 D7C681897F19; Fri, 19 Nov 2021 04:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSN1bL4z4Td6; Fri, 19 Nov 2021 04:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D65072249E; Fri, 19 Nov 2021 04:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rNHS061136; Fri, 19 Nov 2021 04:53:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rNC1061135; Fri, 19 Nov 2021 04:53:23 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:23 GMT Message-Id: <202111190453.1AJ4rNC1061135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: fa99313f30f9 - stable/13 - src/bin/pax: Fix spelling error 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa99313f30f9348f2c97346e6e94b0d50380b0e7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fa99313f30f9348f2c97346e6e94b0d50380b0e7 commit fa99313f30f9348f2c97346e6e94b0d50380b0e7 Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:51:12 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:21 +0000 src/bin/pax: Fix spelling error "whats" -> "what's" Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 8db446034e3e53969db8b211fb8635dd911d1133) --- bin/pax/buf_subs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c index 153b599193d8..6d50a280f29c 100644 --- a/bin/pax/buf_subs.c +++ b/bin/pax/buf_subs.c @@ -540,7 +540,7 @@ rd_wrbuf(char *in, int cpcnt) } /* - * calculate how much data to copy based on whats left and + * calculate how much data to copy based on what's left and * state of buffer */ cnt = MIN(cnt, incnt); From nobody Fri Nov 19 04:53:24 2021 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 E87A51897B5D; Fri, 19 Nov 2021 04:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSP238Jz4TdJ; Fri, 19 Nov 2021 04:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BEEB226A2; Fri, 19 Nov 2021 04:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rOE6061160; Fri, 19 Nov 2021 04:53:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rOgW061159; Fri, 19 Nov 2021 04:53:24 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:24 GMT Message-Id: <202111190453.1AJ4rOgW061159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: d57d56b8ab07 - stable/13 - src/bin/mkdir: Spell occur correctly. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d57d56b8ab070b8671f9127385201c4022a21373 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d57d56b8ab070b8671f9127385201c4022a21373 commit d57d56b8ab070b8671f9127385201c4022a21373 Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:51:12 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:21 +0000 src/bin/mkdir: Spell occur correctly. Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 28c3c137f64a7176d0ca877fb4f35ae17c7c5202) --- bin/mkdir/mkdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index 122ec4458858..cc699d3893dc 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -163,7 +163,7 @@ build(char *path, mode_t omode) * POSIX 1003.2: * For each dir operand that does not name an existing * directory, effects equivalent to those caused by the - * following command shall occcur: + * following command shall occur: * * mkdir -p -m $(umask -S),u+wx $(dirname dir) && * mkdir [-m mode] dir From nobody Fri Nov 19 04:53:26 2021 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 2D4DB1897B71; Fri, 19 Nov 2021 04:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSQ55LXz4Tfx; Fri, 19 Nov 2021 04:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EDE5226A3; Fri, 19 Nov 2021 04:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rQLQ061184; Fri, 19 Nov 2021 04:53:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rQIM061183; Fri, 19 Nov 2021 04:53:26 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:26 GMT Message-Id: <202111190453.1AJ4rQIM061183@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: d88a3fe466de - stable/13 - src/bin/sh: Fix spelling errors 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d88a3fe466de8d7f424b28df20319c3eed7c2c45 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d88a3fe466de8d7f424b28df20319c3eed7c2c45 commit d88a3fe466de8d7f424b28df20319c3eed7c2c45 Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:51:13 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:21 +0000 src/bin/sh: Fix spelling errors Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 48556dff3d028da85b864c6662534e1388a255c8) --- bin/sh/error.c | 2 +- bin/sh/eval.c | 2 +- bin/sh/nodetypes | 2 +- bin/sh/shell.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/sh/error.c b/bin/sh/error.c index bee2a4fe703b..a6b407907e20 100644 --- a/bin/sh/error.c +++ b/bin/sh/error.c @@ -74,7 +74,7 @@ static void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __d * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". * - * Interrupts are disabled; they should be reenabled when the exception is + * Interrupts are disabled; they should be re-enabled when the exception is * caught. */ diff --git a/bin/sh/eval.c b/bin/sh/eval.c index b95689bce006..58cfc522bb14 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -900,7 +900,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd) * the hash table isn't filled with items * from the temporary setting. * - * It would be better to forbit using and + * It would be better to forbid using and * updating the table while this command * runs, by the command finding mechanism * is heavily integrated with hash handling, diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes index 496ffba05924..0d0d657d67e8 100644 --- a/bin/sh/nodetypes +++ b/bin/sh/nodetypes @@ -64,7 +64,7 @@ NPIPE npipe # a pipeline backgnd int # set to run pipeline in background cmdlist nodelist # the commands in the pipeline -NREDIR nredir # redirection (of a compex command) +NREDIR nredir # redirection (of a complex command) type int n nodeptr # the command redirect nodeptr # list of file redirections diff --git a/bin/sh/shell.h b/bin/sh/shell.h index c06e737e658f..536efe6ce228 100644 --- a/bin/sh/shell.h +++ b/bin/sh/shell.h @@ -55,7 +55,7 @@ /* #define DEBUG 1 */ /* - * Type of used arithmetics. SUSv3 requires us to have at least signed long. + * Type of used arithmetic. SUSv3 requires us to have at least signed long. */ typedef intmax_t arith_t; #define ARITH_FORMAT_STR "%" PRIdMAX From nobody Fri Nov 19 04:53:27 2021 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 85AD91897DDC; Fri, 19 Nov 2021 04:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSR51hrz4TRl; Fri, 19 Nov 2021 04:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39A592270B; Fri, 19 Nov 2021 04:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rRij061217; Fri, 19 Nov 2021 04:53:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rRoa061216; Fri, 19 Nov 2021 04:53:27 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:27 GMT Message-Id: <202111190453.1AJ4rRoa061216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 3161a62f2d86 - stable/13 - arm: Remove unused items 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3161a62f2d866b9bba5ce462c2f50f5af7ce0ba7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3161a62f2d866b9bba5ce462c2f50f5af7ce0ba7 commit 3161a62f2d866b9bba5ce462c2f50f5af7ce0ba7 Author: Warner Losh AuthorDate: 2021-11-19 04:51:13 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:21 +0000 arm: Remove unused items Remote detritis copied, apparently, from sparc. utrap has never been used on arm, so it's safe to just remove it. Sponsored by: Netflix (cherry picked from commit c47a4a23756167e40c6a9d1dfd0bf64258620171) --- sys/arm/include/proc.h | 10 +---- sys/arm/include/utrap.h | 112 ------------------------------------------------ 2 files changed, 1 insertion(+), 121 deletions(-) diff --git a/sys/arm/include/proc.h b/sys/arm/include/proc.h index a37ccd8f621c..cdd64479c851 100644 --- a/sys/arm/include/proc.h +++ b/sys/arm/include/proc.h @@ -40,13 +40,6 @@ #ifndef _MACHINE_PROC_H_ #define _MACHINE_PROC_H_ -#include - -struct md_utrap { - utrap_entry_t *ut_precise[UT_MAX]; /* must be first */ - int ut_refcnt; -}; - struct mdthread { int md_spinlock_count; /* (k) */ register_t md_saved_cspr; /* (k) */ @@ -58,8 +51,7 @@ struct mdthread { }; struct mdproc { - struct md_utrap *md_utrap; - void *md_sigtramp; + long md_dummy; }; #define KINFO_PROC_SIZE 816 diff --git a/sys/arm/include/utrap.h b/sys/arm/include/utrap.h deleted file mode 100644 index b261d87d566f..000000000000 --- a/sys/arm/include/utrap.h +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2001 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _MACHINE_UTRAP_H_ -#define _MACHINE_UTRAP_H_ - -#define UT_INSTRUCTION_EXCEPTION 1 -#define UT_INSTRUCTION_ERROR 2 -#define UT_INSTRUCTION_PROTECTION 3 -#define UT_ILLTRAP_INSTRUCTION 4 -#define UT_ILLEGAL_INSTRUCTION 5 -#define UT_PRIVILEGED_OPCODE 6 -#define UT_FP_DISABLED 7 -#define UT_FP_EXCEPTION_IEEE_754 8 -#define UT_FP_EXCEPTION_OTHER 9 -#define UT_TAG_OFERFLOW 10 -#define UT_DIVISION_BY_ZERO 11 -#define UT_DATA_EXCEPTION 12 -#define UT_DATA_ERROR 13 -#define UT_DATA_PROTECTION 14 -#define UT_MEM_ADDRESS_NOT_ALIGNED 15 -#define UT_PRIVILEGED_ACTION 16 -#define UT_ASYNC_DATA_ERROR 17 -#define UT_TRAP_INSTRUCTION_16 18 -#define UT_TRAP_INSTRUCTION_17 19 -#define UT_TRAP_INSTRUCTION_18 20 -#define UT_TRAP_INSTRUCTION_19 21 -#define UT_TRAP_INSTRUCTION_20 22 -#define UT_TRAP_INSTRUCTION_21 23 -#define UT_TRAP_INSTRUCTION_22 24 -#define UT_TRAP_INSTRUCTION_23 25 -#define UT_TRAP_INSTRUCTION_24 26 -#define UT_TRAP_INSTRUCTION_25 27 -#define UT_TRAP_INSTRUCTION_26 28 -#define UT_TRAP_INSTRUCTION_27 29 -#define UT_TRAP_INSTRUCTION_28 30 -#define UT_TRAP_INSTRUCTION_29 31 -#define UT_TRAP_INSTRUCTION_30 32 -#define UT_TRAP_INSTRUCTION_31 33 -#define UT_INSTRUCTION_MISS 34 -#define UT_DATA_MISS 35 -#define UT_MAX 36 - -#define ST_SUNOS_SYSCALL 0 -#define ST_BREAKPOINT 1 -#define ST_DIVISION_BY_ZERO 2 -#define ST_FLUSH_WINDOWS 3 /* XXX implement! */ -#define ST_CLEAN_WINDOW 4 -#define ST_RANGE_CHECK 5 -#define ST_FIX_ALIGNMENT 6 -#define ST_INTEGER_OVERFLOW 7 -/* 8 is 32-bit ABI syscall (old solaris syscall?) */ -#define ST_BSD_SYSCALL 9 -#define ST_FP_RESTORE 10 -/* 11-15 are available */ -/* 16 is linux 32 bit syscall (but supposed to be reserved, grr) */ -/* 17 is old linux 64 bit syscall (but supposed to be reserved, grr) */ -/* 16-31 are reserved for user applications (utraps) */ -#define ST_GETCC 32 /* XXX implement! */ -#define ST_SETCC 33 /* XXX implement! */ -#define ST_GETPSR 34 /* XXX implement! */ -#define ST_SETPSR 35 /* XXX implement! */ -/* 36-63 are available */ -#define ST_SOLARIS_SYSCALL 64 -#define ST_SYSCALL 65 -#define ST_SYSCALL32 66 -/* 67 is reserved to OS source licensee */ -/* 68 is return from deferred trap (not supported) */ -/* 69-95 are reserved to SPARC international */ -/* 96-108 are available */ -/* 109 is linux 64 bit syscall */ -/* 110 is linux 64 bit getcontext (?) */ -/* 111 is linux 64 bit setcontext (?) */ -/* 112-255 are available */ - -#define UTH_NOCHANGE (-1) - -#ifndef __ASM__ - -typedef int utrap_entry_t; -typedef void *utrap_handler_t; - -#endif - -#endif From nobody Fri Nov 19 04:53:28 2021 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 0A9701897F43; Fri, 19 Nov 2021 04:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSS4NwXz4Tdf; Fri, 19 Nov 2021 04:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66BEF22514; Fri, 19 Nov 2021 04:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rS3V061241; Fri, 19 Nov 2021 04:53:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rSmI061240; Fri, 19 Nov 2021 04:53:28 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:28 GMT Message-Id: <202111190453.1AJ4rSmI061240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: dca9c7b0aad7 - stable/13 - cam_periph: style change 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dca9c7b0aad7d7fcc82dae5a62e8c65bb225a4a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dca9c7b0aad7d7fcc82dae5a62e8c65bb225a4a6 commit dca9c7b0aad7d7fcc82dae5a62e8c65bb225a4a6 Author: Warner Losh AuthorDate: 2021-11-19 04:51:13 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:21 +0000 cam_periph: style change wrap a long line at 80 columns Sponsored by: Netflix Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D32679 (cherry picked from commit dbfe5dd3f95148dd14b95025182da371029c2e90) --- sys/cam/cam_periph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 98b9264f1069..d08adca0ea1c 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -279,7 +279,8 @@ cam_periph_alloc(periph_ctor_t *periph_ctor, && cur_periph->unit_number < periph->unit_number) cur_periph = TAILQ_NEXT(cur_periph, unit_links); if (cur_periph != NULL) { - KASSERT(cur_periph->unit_number != periph->unit_number, ("duplicate units on periph list")); + KASSERT(cur_periph->unit_number != periph->unit_number, + ("duplicate units on periph list")); TAILQ_INSERT_BEFORE(cur_periph, periph, unit_links); } else { TAILQ_INSERT_TAIL(&(*p_drv)->units, periph, unit_links); From nobody Fri Nov 19 04:53:30 2021 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 7FE5E1897FDA; Fri, 19 Nov 2021 04:53:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSX26Bfz4Tjf; Fri, 19 Nov 2021 04:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACFFE226A4; Fri, 19 Nov 2021 04:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rUoX061289; Fri, 19 Nov 2021 04:53:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rU16061288; Fri, 19 Nov 2021 04:53:30 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:30 GMT Message-Id: <202111190453.1AJ4rU16061288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 534fb4b8aec0 - stable/13 - vt(4): Connect to teken's TP_SETBELLPD 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 534fb4b8aec07d97bbd414a390fe1a6c5b169af8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=534fb4b8aec07d97bbd414a390fe1a6c5b169af8 commit 534fb4b8aec07d97bbd414a390fe1a6c5b169af8 Author: Warner Losh AuthorDate: 2021-11-19 04:51:13 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:22 +0000 vt(4): Connect to teken's TP_SETBELLPD Add the glue needed to listen to TP_SETBELLPD which teken uses to inform its client drivers about the results of parsing \e[=;B. It converts these to a Hz value for the tone/pitch of the bell and a duration in ms. There's some loss of precision because in the escape seuquence is defined to be (1193182 / pitch) Hz and is in 10ms units. Also note that kbdcontrol also parses 'off' but then doesn't send the proper escape sequence, leading me to wonder if that's another bug since teken appears to parse that sequence properly and I've added code here to treat that as the same as quiet or disabled. In general, Hz from 100 to 2000 is good. Outside that range is possible, but even at 100Hz the square wave is starting to sound bad and above 2000Hz the speaker may not respond. Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32620 (cherry picked from commit 2533eca1c2b9d561c42d28bcb6f1c1c35562fbcc) --- sys/dev/vt/vt.h | 2 ++ sys/dev/vt/vt_core.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h index 2d671d692384..ad3cb310b510 100644 --- a/sys/dev/vt/vt.h +++ b/sys/dev/vt/vt.h @@ -309,6 +309,8 @@ struct vt_window { struct vt_mode vw_smode; /* switch mode */ struct callout vw_proc_dead_timer; struct vt_window *vw_switch_to; + int vw_bell_pitch; /* (?) Bell pitch */ + sbintime_t vw_bell_duration; /* (?) Bell duration */ }; #define VT_AUTO 0 /* switching is automatic */ diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 708e5ba70f15..ebcb4fc8f103 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -258,6 +258,8 @@ static struct vt_window vt_conswindow = { .vw_terminal = &vt_consterm, .vw_kbdmode = K_XLATE, .vw_grabbed = 0, + .vw_bell_pitch = VT_BELLPITCH, + .vw_bell_duration = VT_BELLDURATION, }; struct terminal vt_consterm = { .tm_class = &vt_termclass, @@ -1101,7 +1103,11 @@ vtterm_bell(struct terminal *tm) if (vd->vd_flags & VDF_QUIET_BELL) return; - sysbeep(VT_BELLPITCH, VT_BELLDURATION); + if (vw->vw_bell_pitch == 0 || + vw->vw_bell_duration == 0) + return; + + sysbeep(vw->vw_bell_pitch, vw->vw_bell_duration); } static void @@ -1178,6 +1184,11 @@ vtterm_param(struct terminal *tm, int cmd, unsigned int arg) case TP_MOUSE: vw->vw_mouse_level = arg; break; + case TP_SETBELLPD: + vw->vw_bell_pitch = TP_SETBELLPD_PITCH(arg); + vw->vw_bell_duration = + TICKS_2_MSEC(TP_SETBELLPD_DURATION(arg)) * SBT_1MS; + break; } } From nobody Fri Nov 19 04:53:29 2021 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 0A5C41898041; Fri, 19 Nov 2021 04:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSV3Nzsz4Tlj; Fri, 19 Nov 2021 04:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CAF422447; Fri, 19 Nov 2021 04:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rT9a061265; Fri, 19 Nov 2021 04:53:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rTr8061264; Fri, 19 Nov 2021 04:53:29 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:29 GMT Message-Id: <202111190453.1AJ4rTr8061264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 87586bff11ec - stable/13 - sysbeep: Adjust interface to take a duration as a sbt 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 87586bff11ec0a84eba3b83b68030f9e0db429bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=87586bff11ec0a84eba3b83b68030f9e0db429bf commit 87586bff11ec0a84eba3b83b68030f9e0db429bf Author: Warner Losh AuthorDate: 2021-11-19 04:51:13 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:22 +0000 sysbeep: Adjust interface to take a duration as a sbt Change the 'period' argument to 'duration' and change its type to sbintime_t so we can more easily express different durations. Reviewed by: tsoome, glebius Differential Revision: https://reviews.freebsd.org/D32619 (cherry picked from commit 072d5b98c4318e20248a6fbea4a5ca7c96992cac) --- sys/dev/mlx/mlx.c | 6 +++--- sys/dev/syscons/syscons.c | 7 ++++++- sys/dev/vt/vt_core.c | 8 ++++---- sys/i386/i386/trap.c | 4 ++-- sys/kern/kern_cons.c | 13 +++++++------ sys/sys/systm.h | 2 +- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index bafd0902e09a..f5b023eafc9c 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -1083,7 +1083,7 @@ mlx_periodic(void *data) mlx_pause_action(sc); /* pause is running */ sc->mlx_pause.mp_when = 0; - sysbeep(500, hz); + sysbeep(500, SBT_1S); /* * Bus pause still running? @@ -1095,9 +1095,9 @@ mlx_periodic(void *data) if (time_second >= sc->mlx_pause.mp_howlong) { mlx_pause_action(sc); sc->mlx_pause.mp_which = 0; /* pause is complete */ - sysbeep(500, hz); + sysbeep(500, SBT_1S); } else { - sysbeep((time_second % 5) * 100 + 500, hz/8); + sysbeep((time_second % 5) * 100 + 500, SBT_1S / 8); } /* diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 6a389604d3ab..6c349668410d 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -4258,6 +4258,11 @@ sc_respond(scr_stat *scp, const u_char *p, int count, int wakeup) } } +/* + * pitch is the divisor for 1.193182MHz PIT clock. By dividing 1193172 / pitch, + * we convert it back to Hz. + * duration is in ticks of 1/hz. + */ void sc_bell(scr_stat *scp, int pitch, int duration) { @@ -4277,7 +4282,7 @@ sc_bell(scr_stat *scp, int pitch, int duration) } else if (duration != 0 && pitch != 0) { if (scp != scp->sc->cur_scp) pitch *= 2; - sysbeep(1193182 / pitch, duration); + sysbeep(1193182 / pitch, SBT_1S * duration / hz); } } diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 884050f4f0c5..708e5ba70f15 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -119,8 +119,8 @@ const struct terminal_class vt_termclass = { #define VT_TIMERFREQ 25 /* Bell pitch/duration. */ -#define VT_BELLDURATION ((5 * hz + 99) / 100) -#define VT_BELLPITCH 800 +#define VT_BELLDURATION (SBT_1S / 20) +#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */ #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) @@ -1101,7 +1101,7 @@ vtterm_bell(struct terminal *tm) if (vd->vd_flags & VDF_QUIET_BELL) return; - sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); + sysbeep(VT_BELLPITCH, VT_BELLDURATION); } static void @@ -1117,7 +1117,7 @@ vtterm_beep(struct terminal *tm, u_int param) return; } - period = ((param >> 16) & 0xffff) * hz / 1000; + period = ((param >> 16) & 0xffff) * SBT_1MS; freq = 1193182 / (param & 0xffff); sysbeep(freq, period); diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 045478149be5..6f70a88b62b8 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -414,7 +414,7 @@ user_trctrap_out: #endif if (time_second - lastalert > 10) { log(LOG_WARNING, "NMI: power fail\n"); - sysbeep(880, hz); + sysbeep(880, SBT_1S); lastalert = time_second; } return; @@ -671,7 +671,7 @@ kernel_trctrap: #ifdef POWERFAIL_NMI if (time_second - lastalert > 10) { log(LOG_WARNING, "NMI: power fail\n"); - sysbeep(880, hz); + sysbeep(880, SBT_1S); lastalert = time_second; } return; diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index 780fce00387d..d33811f1e3c8 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -658,7 +658,7 @@ constty_timeout(void *arg) #ifdef HAS_TIMER_SPKR -static int beeping; +static bool beeping; static struct callout beeping_timer; static void @@ -666,11 +666,11 @@ sysbeepstop(void *chan) { timer_spkr_release(); - beeping = 0; + beeping = false; } int -sysbeep(int pitch, int period) +sysbeep(int pitch, sbintime_t duration) { if (timer_spkr_acquire()) { @@ -681,8 +681,9 @@ sysbeep(int pitch, int period) } timer_spkr_setfreq(pitch); if (!beeping) { - beeping = period; - callout_reset(&beeping_timer, period, sysbeepstop, NULL); + beeping = true; + callout_reset_sbt(&beeping_timer, duration, 0, sysbeepstop, + NULL, C_PREL(5)); } return (0); } @@ -701,7 +702,7 @@ SYSINIT(sysbeep, SI_SUB_SOFTINTR, SI_ORDER_ANY, sysbeep_init, NULL); */ int -sysbeep(int pitch __unused, int period __unused) +sysbeep(int pitch __unused, sbintime_t duration __unused) { return (ENODEV); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 8080f22266e2..619de40a20e8 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -445,7 +445,7 @@ int casueword(volatile u_long *p, u_long oldval, u_long *oldvalp, void realitexpire(void *); -int sysbeep(int hertz, int period); +int sysbeep(int hertz, sbintime_t duration); void hardclock(int cnt, int usermode); void hardclock_sync(int cpu); From nobody Fri Nov 19 04:53:31 2021 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 952BE1898605; Fri, 19 Nov 2021 04:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPSY1NCkz4TS4; Fri, 19 Nov 2021 04:53:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE3E7222C3; Fri, 19 Nov 2021 04:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ4rVwN061313; Fri, 19 Nov 2021 04:53:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ4rVY8061312; Fri, 19 Nov 2021 04:53:31 GMT (envelope-from git) Date: Fri, 19 Nov 2021 04:53:31 GMT Message-Id: <202111190453.1AJ4rVY8061312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: a82d7aeb3f26 - stable/13 - vt: Add devctl message for bells 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a82d7aeb3f2647cc148b5367e02831572d6cd2d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a82d7aeb3f2647cc148b5367e02831572d6cd2d4 commit a82d7aeb3f2647cc148b5367e02831572d6cd2d4 Author: Warner Losh AuthorDate: 2021-11-19 04:51:13 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:52:22 +0000 vt: Add devctl message for bells Generate VT events when the bell beeps. When coupled with disabling the bell,this allows custom bells to be rung when we'd otherwise beep. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D32656 (cherry picked from commit 4ac3d08a9693c27c1bd2ddd67b2808ac9e18f4c5) --- sbin/devd/devd.conf.5 | 9 +++++++++ share/man/man4/vt.4 | 14 ++++++++++++++ sys/dev/vt/vt_core.c | 36 ++++++++++++++++++++++++++++++++---- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 1a1071584f70..a4d0c95b5930 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -598,6 +598,15 @@ Notification of a filesystem being unmounted. .Pp .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li VT Ta BELL Ta RING Ta +Notifcation that the console bell has run. +See +.Xr vt 4 +for details. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ZFS Ta ZFS Ta Ta Events about the ZFS subsystem. See diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4 index 8584706dc1aa..d0672ff9e5a0 100644 --- a/share/man/man4/vt.4 +++ b/share/man/man4/vt.4 @@ -297,6 +297,20 @@ console fonts .It Pa /usr/share/vt/keymaps/*.kbd keyboard layouts .El +.Sh DEVCTL MESSAGES +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li VT Ta BELL Ta RING Ta +Notifcation that the console bell has run. +.El +.Pp +.Bl -column "Variable" "Meaning" -compact +.Sy "Variable" Ta Sy "Meaning" +.It Li duration_ms Ta Length of time the bell was requested to ring in milliseconds. +.It Li enabled Ta true or false indicating whether or not the bell was enabled when rung. +.It Li hz Ta Tone that was requested in Hz. +.El +.Pp .Sh EXAMPLES This example changes the default color of normal text to green on a black background, or black on a green background when reversed. diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index ebcb4fc8f103..1bbb12d52ec3 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -52,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1091,12 +1093,35 @@ vt_allocate_keyboard(struct vt_device *vd) return (idx0); } +#define DEVCTL_LEN 64 +static void +vtterm_devctl(bool enabled, int hz, sbintime_t duration) +{ + struct sbuf sb; + char *buf; + + buf = malloc(DEVCTL_LEN, M_VT, M_NOWAIT); + if (buf == NULL) + return; + sbuf_new(&sb, buf, DEVCTL_LEN, SBUF_FIXEDLEN); + sbuf_printf(&sb, "enabled=%s hz=%d duration_ms=%d", + enabled ? "true" : "false", hz, (int)(duration / SBT_1MS)); + sbuf_finish(&sb); + if (sbuf_error(&sb) == 0) + devctl_notify("VT", "BELL", "RING", sbuf_data(&sb)); + sbuf_delete(&sb); + free(buf, M_VT); +} + static void vtterm_bell(struct terminal *tm) { struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; + vtterm_devctl(vt_enable_bell, vw->vw_bell_pitch, + vw->vw_bell_duration); + if (!vt_enable_bell) return; @@ -1113,10 +1138,8 @@ vtterm_bell(struct terminal *tm) static void vtterm_beep(struct terminal *tm, u_int param) { - u_int freq, period; - - if (!vt_enable_bell) - return; + u_int freq; + sbintime_t period; if ((param == 0) || ((param & 0xffff) == 0)) { vtterm_bell(tm); @@ -1126,6 +1149,11 @@ vtterm_beep(struct terminal *tm, u_int param) period = ((param >> 16) & 0xffff) * SBT_1MS; freq = 1193182 / (param & 0xffff); + vtterm_devctl(vt_enable_bell, freq, period); + + if (!vt_enable_bell) + return; + sysbeep(freq, period); } From nobody Fri Nov 19 05:00:39 2021 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 5C492189D383; Fri, 19 Nov 2021 05:00:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPcl2Ch0z4ZZT; Fri, 19 Nov 2021 05:00:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C86E2270F; Fri, 19 Nov 2021 05:00:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ50dSY071919; Fri, 19 Nov 2021 05:00:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ50dnZ071918; Fri, 19 Nov 2021 05:00:39 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:00:39 GMT Message-Id: <202111190500.1AJ50dnZ071918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 291b4ff9fc05 - stable/12 - arm: Remove unused items 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 291b4ff9fc05947aceaf942b4fa50450f6c9671c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=291b4ff9fc05947aceaf942b4fa50450f6c9671c commit 291b4ff9fc05947aceaf942b4fa50450f6c9671c Author: Warner Losh AuthorDate: 2021-11-19 04:59:40 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:59:40 +0000 arm: Remove unused items Remote detritis copied, apparently, from sparc. utrap has never been used on arm, so it's safe to just remove it. Sponsored by: Netflix (cherry picked from commit c47a4a23756167e40c6a9d1dfd0bf64258620171) --- sys/arm/include/proc.h | 10 +---- sys/arm/include/utrap.h | 112 ------------------------------------------------ 2 files changed, 1 insertion(+), 121 deletions(-) diff --git a/sys/arm/include/proc.h b/sys/arm/include/proc.h index 94855b6f60e7..d70c7c3df17e 100644 --- a/sys/arm/include/proc.h +++ b/sys/arm/include/proc.h @@ -40,13 +40,6 @@ #ifndef _MACHINE_PROC_H_ #define _MACHINE_PROC_H_ -#include - -struct md_utrap { - utrap_entry_t *ut_precise[UT_MAX]; /* must be first */ - int ut_refcnt; -}; - struct mdthread { int md_spinlock_count; /* (k) */ register_t md_saved_cspr; /* (k) */ @@ -63,8 +56,7 @@ struct mdthread { }; struct mdproc { - struct md_utrap *md_utrap; - void *md_sigtramp; + long md_dummy; }; #define KINFO_PROC_SIZE 816 diff --git a/sys/arm/include/utrap.h b/sys/arm/include/utrap.h deleted file mode 100644 index b261d87d566f..000000000000 --- a/sys/arm/include/utrap.h +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2001 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _MACHINE_UTRAP_H_ -#define _MACHINE_UTRAP_H_ - -#define UT_INSTRUCTION_EXCEPTION 1 -#define UT_INSTRUCTION_ERROR 2 -#define UT_INSTRUCTION_PROTECTION 3 -#define UT_ILLTRAP_INSTRUCTION 4 -#define UT_ILLEGAL_INSTRUCTION 5 -#define UT_PRIVILEGED_OPCODE 6 -#define UT_FP_DISABLED 7 -#define UT_FP_EXCEPTION_IEEE_754 8 -#define UT_FP_EXCEPTION_OTHER 9 -#define UT_TAG_OFERFLOW 10 -#define UT_DIVISION_BY_ZERO 11 -#define UT_DATA_EXCEPTION 12 -#define UT_DATA_ERROR 13 -#define UT_DATA_PROTECTION 14 -#define UT_MEM_ADDRESS_NOT_ALIGNED 15 -#define UT_PRIVILEGED_ACTION 16 -#define UT_ASYNC_DATA_ERROR 17 -#define UT_TRAP_INSTRUCTION_16 18 -#define UT_TRAP_INSTRUCTION_17 19 -#define UT_TRAP_INSTRUCTION_18 20 -#define UT_TRAP_INSTRUCTION_19 21 -#define UT_TRAP_INSTRUCTION_20 22 -#define UT_TRAP_INSTRUCTION_21 23 -#define UT_TRAP_INSTRUCTION_22 24 -#define UT_TRAP_INSTRUCTION_23 25 -#define UT_TRAP_INSTRUCTION_24 26 -#define UT_TRAP_INSTRUCTION_25 27 -#define UT_TRAP_INSTRUCTION_26 28 -#define UT_TRAP_INSTRUCTION_27 29 -#define UT_TRAP_INSTRUCTION_28 30 -#define UT_TRAP_INSTRUCTION_29 31 -#define UT_TRAP_INSTRUCTION_30 32 -#define UT_TRAP_INSTRUCTION_31 33 -#define UT_INSTRUCTION_MISS 34 -#define UT_DATA_MISS 35 -#define UT_MAX 36 - -#define ST_SUNOS_SYSCALL 0 -#define ST_BREAKPOINT 1 -#define ST_DIVISION_BY_ZERO 2 -#define ST_FLUSH_WINDOWS 3 /* XXX implement! */ -#define ST_CLEAN_WINDOW 4 -#define ST_RANGE_CHECK 5 -#define ST_FIX_ALIGNMENT 6 -#define ST_INTEGER_OVERFLOW 7 -/* 8 is 32-bit ABI syscall (old solaris syscall?) */ -#define ST_BSD_SYSCALL 9 -#define ST_FP_RESTORE 10 -/* 11-15 are available */ -/* 16 is linux 32 bit syscall (but supposed to be reserved, grr) */ -/* 17 is old linux 64 bit syscall (but supposed to be reserved, grr) */ -/* 16-31 are reserved for user applications (utraps) */ -#define ST_GETCC 32 /* XXX implement! */ -#define ST_SETCC 33 /* XXX implement! */ -#define ST_GETPSR 34 /* XXX implement! */ -#define ST_SETPSR 35 /* XXX implement! */ -/* 36-63 are available */ -#define ST_SOLARIS_SYSCALL 64 -#define ST_SYSCALL 65 -#define ST_SYSCALL32 66 -/* 67 is reserved to OS source licensee */ -/* 68 is return from deferred trap (not supported) */ -/* 69-95 are reserved to SPARC international */ -/* 96-108 are available */ -/* 109 is linux 64 bit syscall */ -/* 110 is linux 64 bit getcontext (?) */ -/* 111 is linux 64 bit setcontext (?) */ -/* 112-255 are available */ - -#define UTH_NOCHANGE (-1) - -#ifndef __ASM__ - -typedef int utrap_entry_t; -typedef void *utrap_handler_t; - -#endif - -#endif From nobody Fri Nov 19 05:00:40 2021 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 D3178189D2CD; Fri, 19 Nov 2021 05:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPcm42Pzz4Z7X; Fri, 19 Nov 2021 05:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EB8722266; Fri, 19 Nov 2021 05:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ50eoA071943; Fri, 19 Nov 2021 05:00:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ50eX6071942; Fri, 19 Nov 2021 05:00:40 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:00:40 GMT Message-Id: <202111190500.1AJ50eX6071942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 664676054d8b - stable/12 - cam_periph: style change 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 664676054d8b0c16ee18fedd4b095cec538dc2bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=664676054d8b0c16ee18fedd4b095cec538dc2bf commit 664676054d8b0c16ee18fedd4b095cec538dc2bf Author: Warner Losh AuthorDate: 2021-11-19 04:59:41 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:59:41 +0000 cam_periph: style change wrap a long line at 80 columns Sponsored by: Netflix Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D32679 (cherry picked from commit dbfe5dd3f95148dd14b95025182da371029c2e90) --- sys/cam/cam_periph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index c53be6d61fa7..2744541097dd 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -280,7 +280,8 @@ cam_periph_alloc(periph_ctor_t *periph_ctor, && cur_periph->unit_number < periph->unit_number) cur_periph = TAILQ_NEXT(cur_periph, unit_links); if (cur_periph != NULL) { - KASSERT(cur_periph->unit_number != periph->unit_number, ("duplicate units on periph list")); + KASSERT(cur_periph->unit_number != periph->unit_number, + ("duplicate units on periph list")); TAILQ_INSERT_BEFORE(cur_periph, periph, unit_links); } else { TAILQ_INSERT_TAIL(&(*p_drv)->units, periph, unit_links); From nobody Fri Nov 19 05:00:41 2021 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 2F159189D1BE; Fri, 19 Nov 2021 05:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPcn6wvfz4ZWX; Fri, 19 Nov 2021 05:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DE4B226A7; Fri, 19 Nov 2021 05:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ50fqf071967; Fri, 19 Nov 2021 05:00:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ50fLW071966; Fri, 19 Nov 2021 05:00:41 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:00:41 GMT Message-Id: <202111190500.1AJ50fLW071966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6fd36eb5b489 - stable/12 - arm64: Spell BeagleBone correctly in config 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6fd36eb5b48989e469f324f173b3945914c9d603 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6fd36eb5b48989e469f324f173b3945914c9d603 commit 6fd36eb5b48989e469f324f173b3945914c9d603 Author: Tom Hukins AuthorDate: 2021-11-19 04:59:41 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:59:41 +0000 arm64: Spell BeagleBone correctly in config file. Pull Request: https://github.com/freebsd/freebsd-src/pull/545 (cherry picked from commit 202692b1a733322540723c718288eff3a8054d42) --- sys/arm/conf/GENERIC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 9c7901c6addf..da46173493bf 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -179,7 +179,7 @@ device ti_adc device pwm # Watchdog support -# If we don't enable the watchdog driver, the BealeBone could potentially +# If we don't enable the watchdog driver, the BeagleBone could potentially # reboot automatically because the boot loader might have enabled the # watchdog. device ti_wdt From nobody Fri Nov 19 05:00:42 2021 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 560E5189D13D; Fri, 19 Nov 2021 05:00:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPcp6XFlz4ZgF; Fri, 19 Nov 2021 05:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FCED22711; Fri, 19 Nov 2021 05:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ50gjW071997; Fri, 19 Nov 2021 05:00:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ50gsp071996; Fri, 19 Nov 2021 05:00:42 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:00:42 GMT Message-Id: <202111190500.1AJ50gsp071996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5b61930f590a - stable/12 - src/bin/ps: Fix spelling error 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5b61930f590aa4c02204dc02e869f1d280b85bcc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b61930f590aa4c02204dc02e869f1d280b85bcc commit 5b61930f590aa4c02204dc02e869f1d280b85bcc Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:59:41 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:59:41 +0000 src/bin/ps: Fix spelling error Spell interruptible correctly. Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 3fe686f25a0d0844dc3afd0b3b067ec46abdbc99) --- bin/ps/print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ps/print.c b/bin/ps/print.c index 6c061aee67df..6850666c757b 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -236,7 +236,7 @@ state(KINFO *k, VARENT *ve __unused) break; case SSLEEP: - if (tdflags & TDF_SINTR) /* interruptable (long) */ + if (tdflags & TDF_SINTR) /* interruptible (long) */ *cp = k->ki_p->ki_slptime >= MAXSLP ? 'I' : 'S'; else *cp = 'D'; From nobody Fri Nov 19 05:00:43 2021 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 E3B69189D2F4; Fri, 19 Nov 2021 05:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPcr48Ndz4ZSK; Fri, 19 Nov 2021 05:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B90AD22451; Fri, 19 Nov 2021 05:00:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ50hqO072022; Fri, 19 Nov 2021 05:00:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ50hio072021; Fri, 19 Nov 2021 05:00:43 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:00:43 GMT Message-Id: <202111190500.1AJ50hio072021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 34bc6f6dd0ed - stable/12 - src/bin/pax: Fix spelling error 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 34bc6f6dd0edc523ea820e34a1408e03e061a2d5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=34bc6f6dd0edc523ea820e34a1408e03e061a2d5 commit 34bc6f6dd0edc523ea820e34a1408e03e061a2d5 Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:59:41 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:59:41 +0000 src/bin/pax: Fix spelling error "whats" -> "what's" Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 8db446034e3e53969db8b211fb8635dd911d1133) --- bin/pax/buf_subs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c index 153b599193d8..6d50a280f29c 100644 --- a/bin/pax/buf_subs.c +++ b/bin/pax/buf_subs.c @@ -540,7 +540,7 @@ rd_wrbuf(char *in, int cpcnt) } /* - * calculate how much data to copy based on whats left and + * calculate how much data to copy based on what's left and * state of buffer */ cnt = MIN(cnt, incnt); From nobody Fri Nov 19 05:00:44 2021 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 037E4189D586; Fri, 19 Nov 2021 05:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPct07tPz4ZXb; Fri, 19 Nov 2021 05:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7981226AB; Fri, 19 Nov 2021 05:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ50iYk072046; Fri, 19 Nov 2021 05:00:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ50iOi072045; Fri, 19 Nov 2021 05:00:44 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:00:44 GMT Message-Id: <202111190500.1AJ50iOi072045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 61c051ff3ba3 - stable/12 - src/bin/mkdir: Spell occur correctly. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 61c051ff3ba3f3af76a692a55539f43db6d3f994 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=61c051ff3ba3f3af76a692a55539f43db6d3f994 commit 61c051ff3ba3f3af76a692a55539f43db6d3f994 Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:59:41 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:59:41 +0000 src/bin/mkdir: Spell occur correctly. Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 28c3c137f64a7176d0ca877fb4f35ae17c7c5202) --- bin/mkdir/mkdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index 122ec4458858..cc699d3893dc 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -163,7 +163,7 @@ build(char *path, mode_t omode) * POSIX 1003.2: * For each dir operand that does not name an existing * directory, effects equivalent to those caused by the - * following command shall occcur: + * following command shall occur: * * mkdir -p -m $(umask -S),u+wx $(dirname dir) && * mkdir [-m mode] dir From nobody Fri Nov 19 05:00:45 2021 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 D17C5189D26A; Fri, 19 Nov 2021 05:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPct4Ks2z4Zgg; Fri, 19 Nov 2021 05:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D48822519; Fri, 19 Nov 2021 05:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ50jGv072070; Fri, 19 Nov 2021 05:00:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ50jBe072069; Fri, 19 Nov 2021 05:00:45 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:00:45 GMT Message-Id: <202111190500.1AJ50jBe072069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: d1230690019a - stable/12 - src/bin/sh: Fix spelling errors 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d1230690019a36c3d545135721b955e2b62dcf51 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d1230690019a36c3d545135721b955e2b62dcf51 commit d1230690019a36c3d545135721b955e2b62dcf51 Author: Elyes HAOUAS AuthorDate: 2021-11-19 04:59:41 +0000 Commit: Warner Losh CommitDate: 2021-11-19 04:59:41 +0000 src/bin/sh: Fix spelling errors Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS (cherry picked from commit 48556dff3d028da85b864c6662534e1388a255c8) --- bin/sh/error.c | 2 +- bin/sh/eval.c | 2 +- bin/sh/nodetypes | 2 +- bin/sh/shell.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/sh/error.c b/bin/sh/error.c index 784d2a9eb91a..1dee56fcbfa7 100644 --- a/bin/sh/error.c +++ b/bin/sh/error.c @@ -74,7 +74,7 @@ static void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". * - * Interrupts are disabled; they should be reenabled when the exception is + * Interrupts are disabled; they should be re-enabled when the exception is * caught. */ diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 6adc3ac6426d..ab8d331393b4 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -903,7 +903,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd) * the hash table isn't filled with items * from the temporary setting. * - * It would be better to forbit using and + * It would be better to forbid using and * updating the table while this command * runs, by the command finding mechanism * is heavily integrated with hash handling, diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes index 496ffba05924..0d0d657d67e8 100644 --- a/bin/sh/nodetypes +++ b/bin/sh/nodetypes @@ -64,7 +64,7 @@ NPIPE npipe # a pipeline backgnd int # set to run pipeline in background cmdlist nodelist # the commands in the pipeline -NREDIR nredir # redirection (of a compex command) +NREDIR nredir # redirection (of a complex command) type int n nodeptr # the command redirect nodeptr # list of file redirections diff --git a/bin/sh/shell.h b/bin/sh/shell.h index c06e737e658f..536efe6ce228 100644 --- a/bin/sh/shell.h +++ b/bin/sh/shell.h @@ -55,7 +55,7 @@ /* #define DEBUG 1 */ /* - * Type of used arithmetics. SUSv3 requires us to have at least signed long. + * Type of used arithmetic. SUSv3 requires us to have at least signed long. */ typedef intmax_t arith_t; #define ARITH_FORMAT_STR "%" PRIdMAX From nobody Fri Nov 19 05:11:03 2021 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 44BCB18A4C24; Fri, 19 Nov 2021 05:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPrm1M8rz4gWy; Fri, 19 Nov 2021 05:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08DFB224D3; Fri, 19 Nov 2021 05:11:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ5B3QW084937; Fri, 19 Nov 2021 05:11:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ5B3iO084936; Fri, 19 Nov 2021 05:11:03 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:11:03 GMT Message-Id: <202111190511.1AJ5B3iO084936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1076b8d267b3 - stable/13 - vt: 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1076b8d267b3b99e848780e02b07933b358adda2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1076b8d267b3b99e848780e02b07933b358adda2 commit 1076b8d267b3b99e848780e02b07933b358adda2 Author: Warner Losh AuthorDate: 2021-11-19 05:10:07 +0000 Commit: Warner Losh CommitDate: 2021-11-19 05:10:07 +0000 vt: fix typo Notifcation -> Notification (cherry picked from commit cc48eb70d10da7310750930a153616f38afe28d6) --- sbin/devd/devd.conf.5 | 2 +- share/man/man4/vt.4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index a4d0c95b5930..18de1f60fdd5 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -599,7 +599,7 @@ Notification of a filesystem being unmounted. .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VT Ta BELL Ta RING Ta -Notifcation that the console bell has run. +Notification that the console bell has run. See .Xr vt 4 for details. diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4 index d0672ff9e5a0..1ed344237eb9 100644 --- a/share/man/man4/vt.4 +++ b/share/man/man4/vt.4 @@ -301,7 +301,7 @@ keyboard layouts .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VT Ta BELL Ta RING Ta -Notifcation that the console bell has run. +Notification that the console bell has run. .El .Pp .Bl -column "Variable" "Meaning" -compact From nobody Fri Nov 19 05:11:05 2021 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 84A7018A4D2B; Fri, 19 Nov 2021 05:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwPrn2L4bz4gNg; Fri, 19 Nov 2021 05:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DDAC2298D; Fri, 19 Nov 2021 05:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ5B5lh084961; Fri, 19 Nov 2021 05:11:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ5B50e084960; Fri, 19 Nov 2021 05:11:05 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:11:05 GMT Message-Id: <202111190511.1AJ5B50e084960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 706f4f705bf2 - stable/13 - vt: fix git mismerge 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 706f4f705bf2bdfe7b03647feb21639996c6bcee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=706f4f705bf2bdfe7b03647feb21639996c6bcee commit 706f4f705bf2bdfe7b03647feb21639996c6bcee Author: Warner Losh AuthorDate: 2021-11-19 05:10:07 +0000 Commit: Warner Losh CommitDate: 2021-11-19 05:10:07 +0000 vt: fix git mismerge I made a mistaking in merging the final commits for the devctl changes. This adds the 'hushed' variable and has the correct dates for the manuals. Pointy hat to: imp (cherry picked from commit 80f21bb039cef279e50e1b791b2808b916009bf6) --- sbin/devd/devd.conf.5 | 4 ++-- share/man/man4/vt.4 | 7 ++++--- sys/dev/vt/vt_core.c | 16 ++++++++++------ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 18de1f60fdd5..e1da5f334f9f 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -40,7 +40,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd October 12, 2020 +.Dd November 3, 2021 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -599,7 +599,7 @@ Notification of a filesystem being unmounted. .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VT Ta BELL Ta RING Ta -Notification that the console bell has run. +Notification that the console bell has rung. See .Xr vt 4 for details. diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4 index 1ed344237eb9..c31eae0ec274 100644 --- a/share/man/man4/vt.4 +++ b/share/man/man4/vt.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2020 +.Dd November 3, 2021 .Dt "VT" 4 .Os .Sh NAME @@ -301,13 +301,14 @@ keyboard layouts .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VT Ta BELL Ta RING Ta -Notification that the console bell has run. +Notification that the console bell has rung. .El .Pp .Bl -column "Variable" "Meaning" -compact .Sy "Variable" Ta Sy "Meaning" .It Li duration_ms Ta Length of time the bell was requested to ring in milliseconds. -.It Li enabled Ta true or false indicating whether or not the bell was enabled when rung. +.It Li enabled Ta true or false indicating whether or not the bell was administratively enabled when rung. +.It Li hushed Ta true or false indicating whether or not the bell was quieted by the user when rung. .It Li hz Ta Tone that was requested in Hz. .El .Pp diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 1bbb12d52ec3..c65c6cb62ea1 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1095,7 +1095,7 @@ vt_allocate_keyboard(struct vt_device *vd) #define DEVCTL_LEN 64 static void -vtterm_devctl(bool enabled, int hz, sbintime_t duration) +vtterm_devctl(bool enabled, bool hushed, int hz, sbintime_t duration) { struct sbuf sb; char *buf; @@ -1104,8 +1104,9 @@ vtterm_devctl(bool enabled, int hz, sbintime_t duration) if (buf == NULL) return; sbuf_new(&sb, buf, DEVCTL_LEN, SBUF_FIXEDLEN); - sbuf_printf(&sb, "enabled=%s hz=%d duration_ms=%d", - enabled ? "true" : "false", hz, (int)(duration / SBT_1MS)); + sbuf_printf(&sb, "enabled=%s hushed=%s hz=%d duration_ms=%d", + enabled ? "true" : "false", hushed ? "true" : "false", + hz, (int)(duration / SBT_1MS)); sbuf_finish(&sb); if (sbuf_error(&sb) == 0) devctl_notify("VT", "BELL", "RING", sbuf_data(&sb)); @@ -1119,8 +1120,8 @@ vtterm_bell(struct terminal *tm) struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; - vtterm_devctl(vt_enable_bell, vw->vw_bell_pitch, - vw->vw_bell_duration); + vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL, + vw->vw_bell_pitch, vw->vw_bell_duration); if (!vt_enable_bell) return; @@ -1140,6 +1141,8 @@ vtterm_beep(struct terminal *tm, u_int param) { u_int freq; sbintime_t period; + struct vt_window *vw = tm->tm_softc; + struct vt_device *vd = vw->vw_device; if ((param == 0) || ((param & 0xffff) == 0)) { vtterm_bell(tm); @@ -1149,7 +1152,8 @@ vtterm_beep(struct terminal *tm, u_int param) period = ((param >> 16) & 0xffff) * SBT_1MS; freq = 1193182 / (param & 0xffff); - vtterm_devctl(vt_enable_bell, freq, period); + vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL, + freq, period); if (!vt_enable_bell) return; From nobody Fri Nov 19 05:27:18 2021 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 A11CD1854066; Fri, 19 Nov 2021 05:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwQCV47PQz4lSJ; Fri, 19 Nov 2021 05:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 698E222943; Fri, 19 Nov 2021 05:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ5RIb8002458; Fri, 19 Nov 2021 05:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ5RI2x002457; Fri, 19 Nov 2021 05:27:18 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:27:18 GMT Message-Id: <202111190527.1AJ5RI2x002457@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: 6df0510839d0 - stable/12 - nfscl: Modify Close RPC so that it does not use "owner" for NFSv4.1/4.2 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 6df0510839d03991520f711b01d8d18b3fcfea95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6df0510839d03991520f711b01d8d18b3fcfea95 commit 6df0510839d03991520f711b01d8d18b3fcfea95 Author: Rick Macklem AuthorDate: 2021-10-18 00:50:56 +0000 Commit: Rick Macklem CommitDate: 2021-11-19 05:24:29 +0000 nfscl: Modify Close RPC so that it does not use "owner" for NFSv4.1/4.2 This patch modifies the function that does the Close RPC (nfsrpc_closerpc) so that it does not use the open_owner (nfso_own) for NFSv4.1/4.2. Use of the seqid in the open_owner structure is only needed for NFSv4.0. Same applies to a NFSERR_STALESTATEID reply, which should only happen for NFSv4.0. This allows nfsrpc_closerpc() to be called when nfso_own is no longer valid. This, in turn, allows nfsrpc_closerpc() to be called after the shared lock on the clientID is released, for NFSv4.1/4.2. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. (cherry picked from commit d95c0a12a2dd58b4b13cbc2d1a9fccd848f8ac5e) --- sys/fs/nfsclient/nfs_clrpcops.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 78594cffc3ec..615b48abe6bb 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -835,11 +835,13 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, op->nfso_fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); - *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); - if (NFSHASNFSV4N(nmp)) + if (NFSHASNFSV4N(nmp)) { *tl++ = 0; - else + *tl++ = 0; + } else { + *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); *tl++ = op->nfso_stateid.seqid; + } *tl++ = op->nfso_stateid.other[0]; *tl++ = op->nfso_stateid.other[1]; *tl = op->nfso_stateid.other[2]; @@ -849,11 +851,12 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); if (error) return (error); - NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd); + if (!NFSHASNFSV4N(nmp)) + NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd); if (nd->nd_repstat == 0) NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID); error = nd->nd_repstat; - if (error == NFSERR_STALESTATEID) + if (!NFSHASNFSV4N(nmp) && error == NFSERR_STALESTATEID) nfscl_initiate_recovery(op->nfso_own->nfsow_clp); nfsmout: mbuf_freem(nd->nd_mrep); From nobody Fri Nov 19 05:32:55 2021 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 35E4418579F6; Fri, 19 Nov 2021 05:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwQL011HWz4nDp; Fri, 19 Nov 2021 05:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03763227D8; Fri, 19 Nov 2021 05:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ5WtTk015253; Fri, 19 Nov 2021 05:32:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ5WtbT015252; Fri, 19 Nov 2021 05:32:55 GMT (envelope-from git) Date: Fri, 19 Nov 2021 05:32:55 GMT Message-Id: <202111190532.1AJ5WtbT015252@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: 69e838e971cd - stable/12 - nfscl: Handle NFSv4.1/4.2 Close RPC NFSERR_DELAY replies better 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 69e838e971cda85da388369fa3bc6169bc44c45d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=69e838e971cda85da388369fa3bc6169bc44c45d commit 69e838e971cda85da388369fa3bc6169bc44c45d Author: Rick Macklem AuthorDate: 2021-10-18 22:02:21 +0000 Commit: Rick Macklem CommitDate: 2021-11-19 05:28:07 +0000 nfscl: Handle NFSv4.1/4.2 Close RPC NFSERR_DELAY replies better Without this patch, if a NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation, the client loops retrying the Close while holding a shared lock on the clientID. This shared lock blocks returns of delegations, even though the server has issued a CB_RECALL to request the delegation return. This patch delays doing a retry of a Close that received a reply of NFSERR_DELAY until after the shared lock on the clientID is released, for NFSv4.1/4.2. To fix this for NFSv4.0 would be very difficult and since the only known NFSv4 server to reply NFSERR_DELAY to Close only does NFSv4.1/4.2, this fix is hoped to be sufficient. This problem was detected during a recent IETF working group NFSv4 testing event. (cherry picked from commit 52dee2bc035545f7ae2b838d8a0449f65043cd8a) --- sys/fs/nfs/nfs_var.h | 3 ++- sys/fs/nfsclient/nfs_clrpcops.c | 11 +++++++---- sys/fs/nfsclient/nfs_clstate.c | 27 ++++++++++++++++++++++++--- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index d10aa05a6b6f..24702dab442a 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -571,7 +571,8 @@ void nfscl_dumpstate(struct nfsmount *, int, int, int, int); void nfscl_dupopen(vnode_t, int); int nfscl_getclose(vnode_t, struct nfsclclient **); int nfscl_doclose(vnode_t, struct nfsclclient **, NFSPROC_T *); -void nfsrpc_doclose(struct nfsmount *, struct nfsclopen *, NFSPROC_T *); +int nfsrpc_doclose(struct nfsmount *, struct nfsclopen *, NFSPROC_T *, bool, + bool); int nfscl_deleg(mount_t, struct nfsclclient *, u_int8_t *, int, struct ucred *, NFSPROC_T *, struct nfscldeleg **); void nfscl_lockinit(struct nfsv4lock *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 615b48abe6bb..9cfab016eecb 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -727,8 +727,9 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) /* * Close the open. */ -void -nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) +int +nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p, + bool loop_on_delayed, bool freeop) { struct nfsrv_descript nfsd, *nd = &nfsd; struct nfscllockowner *lp, *nlp; @@ -807,7 +808,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); NFSUNLOCKCLSTATE(); do { - error = nfscl_tryclose(op, tcred, nmp, p, true); + error = nfscl_tryclose(op, tcred, nmp, p, loop_on_delayed); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfs_close"); } while (error == NFSERR_GRACE); @@ -816,9 +817,11 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) nfscl_freelockowner(lp, 0); - nfscl_freeopen(op, 0, true); + if (freeop && error != NFSERR_DELAY) + nfscl_freeopen(op, 0, true); NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); + return (error); } /* diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 1825b56eabd0..387d043b4dbd 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3231,8 +3231,10 @@ int nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) { struct nfsclclient *clp; + struct nfsmount *nmp; struct nfsclowner *owp, *nowp; - struct nfsclopen *op; + struct nfsclopen *op, *nop; + struct nfsclopenhead delayed; struct nfscldeleg *dp; struct nfsfh *nfhp; struct nfsclrecalllayout *recallp; @@ -3244,6 +3246,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) return (error); *clpp = clp; + nmp = VFSTONFS(vnode_mount(vp)); nfhp = VTONFS(vp)->n_fhp; recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_WAITOK); NFSLOCKCLSTATE(); @@ -3269,6 +3272,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) &lyp); /* Now process the opens against the server. */ + LIST_INIT(&delayed); lookformore: LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { op = LIST_FIRST(&owp->nfsow_open); @@ -3280,9 +3284,19 @@ lookformore: KASSERT((op->nfso_opencnt == 0), ("nfscl: bad open cnt on server")); NFSUNLOCKCLSTATE(); - nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op, - p); + if (NFSHASNFSV4N(nmp)) + nfsrpc_doclose(nmp, op, p, false, + true); + else + nfsrpc_doclose(nmp, op, p, true, + true); NFSLOCKCLSTATE(); + if (error == NFSERR_DELAY) { + nfscl_unlinkopen(op); + op->nfso_own = NULL; + LIST_INSERT_HEAD(&delayed, op, + nfso_list); + } goto lookformore; } op = LIST_NEXT(op, nfso_list); @@ -3309,6 +3323,13 @@ lookformore: * used by the function, but calling free() with a NULL pointer is ok. */ free(recallp, M_NFSLAYRECALL); + + /* Now, loop retrying the delayed closes. */ + LIST_FOREACH_SAFE(op, &delayed, nfso_list, nop) { + nfsrpc_doclose(nmp, op, p, true, false); + LIST_REMOVE(op, nfso_list); + nfscl_freeopen(op, 0, false); + } return (0); } From nobody Fri Nov 19 06:39:18 2021 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 37896188BC51; Fri, 19 Nov 2021 06:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwRpb1056z3jM8; Fri, 19 Nov 2021 06:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F328C23ACD; Fri, 19 Nov 2021 06:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ6dI5l097028; Fri, 19 Nov 2021 06:39:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ6dI3Q097027; Fri, 19 Nov 2021 06:39:18 GMT (envelope-from git) Date: Fri, 19 Nov 2021 06:39:18 GMT Message-Id: <202111190639.1AJ6dI3Q097027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ae23f081c5c7 - stable/12 - if_epair: delete mbuf tags 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ae23f081c5c741b9f3019ed8a84226548ec15308 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ae23f081c5c741b9f3019ed8a84226548ec15308 commit ae23f081c5c741b9f3019ed8a84226548ec15308 Author: Kristof Provost AuthorDate: 2021-10-26 07:57:56 +0000 Commit: Kristof Provost CommitDate: 2021-11-19 06:35:58 +0000 if_epair: delete mbuf tags Remove all (non-persistent) tags when we transmit a packet. Real network interfaces do not carry any tags either, and leaving tags attached can produce unexpected results. Reviewed by: bz, glebius MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32663 (cherry picked from commit 62d2dcafb7f33fe8f47e9d5dd519d665f7af140e) --- sys/net/if_epair.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 376bdbe9117f..cd11036ad028 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -194,6 +194,12 @@ struct epair_dpcpu { }; DPCPU_DEFINE(struct epair_dpcpu, epair_dpcpu); +static void +epair_clear_mbuf(struct mbuf *m) +{ + m_tag_delete_nonpersistent(m); +} + static void epair_dpcpu_init(void) { @@ -433,6 +439,8 @@ epair_start_locked(struct ifnet *ifp) } DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); + epair_clear_mbuf(m); + /* * Add a reference so the interface cannot go while the * packet is in transit as we rely on rcvif to stay valid. @@ -554,6 +562,9 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) (void)epair_add_ifp_for_draining(ifp); return (error); } + + epair_clear_mbuf(m); + sc = oifp->if_softc; /* * Add a reference so the interface cannot go while the From nobody Fri Nov 19 06:39:19 2021 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 B9DA3188B96C; Fri, 19 Nov 2021 06:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwRpb47sLz3jJh; Fri, 19 Nov 2021 06:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55AFE23ACE; Fri, 19 Nov 2021 06:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ6dJmI097104; Fri, 19 Nov 2021 06:39:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ6dJHU097103; Fri, 19 Nov 2021 06:39:19 GMT (envelope-from git) Date: Fri, 19 Nov 2021 06:39:19 GMT Message-Id: <202111190639.1AJ6dJHU097103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 6d20b6de6ae2 - stable/13 - if_epair: delete mbuf tags 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d20b6de6ae219114049a8fd14e3bd70c10876c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6d20b6de6ae219114049a8fd14e3bd70c10876c0 commit 6d20b6de6ae219114049a8fd14e3bd70c10876c0 Author: Kristof Provost AuthorDate: 2021-10-26 07:57:56 +0000 Commit: Kristof Provost CommitDate: 2021-11-19 05:51:58 +0000 if_epair: delete mbuf tags Remove all (non-persistent) tags when we transmit a packet. Real network interfaces do not carry any tags either, and leaving tags attached can produce unexpected results. Reviewed by: bz, glebius MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32663 (cherry picked from commit 62d2dcafb7f33fe8f47e9d5dd519d665f7af140e) --- sys/net/if_epair.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 3cef6c76a2e2..2feefedb3cd9 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -195,6 +195,19 @@ struct epair_dpcpu { }; DPCPU_DEFINE(struct epair_dpcpu, epair_dpcpu); +static void +epair_clear_mbuf(struct mbuf *m) +{ + /* Remove any CSUM_SND_TAG as ether_input will barf. */ + if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { + m_snd_tag_rele(m->m_pkthdr.snd_tag); + m->m_pkthdr.snd_tag = NULL; + m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; + } + + m_tag_delete_nonpersistent(m); +} + static void epair_dpcpu_init(void) { @@ -434,6 +447,8 @@ epair_start_locked(struct ifnet *ifp) } DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); + epair_clear_mbuf(m); + /* * Add a reference so the interface cannot go while the * packet is in transit as we rely on rcvif to stay valid. @@ -555,6 +570,9 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) (void)epair_add_ifp_for_draining(ifp); return (error); } + + epair_clear_mbuf(m); + sc = oifp->if_softc; /* * Add a reference so the interface cannot go while the From nobody Fri Nov 19 06:39:20 2021 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 CD728188BB42; Fri, 19 Nov 2021 06:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwRpc3Z3nz3jJj; Fri, 19 Nov 2021 06:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 230A1238F2; Fri, 19 Nov 2021 06:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ6dKZV097128; Fri, 19 Nov 2021 06:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ6dKXb097127; Fri, 19 Nov 2021 06:39:20 GMT (envelope-from git) Date: Fri, 19 Nov 2021 06:39:20 GMT Message-Id: <202111190639.1AJ6dKXb097127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4f524ecb040b - stable/12 - mbuf: PACKET_TAG_PF should not be persistent 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4f524ecb040b532bebef69e943bb110b018daf21 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f524ecb040b532bebef69e943bb110b018daf21 commit 4f524ecb040b532bebef69e943bb110b018daf21 Author: Kristof Provost AuthorDate: 2021-10-26 07:51:33 +0000 Commit: Kristof Provost CommitDate: 2021-11-19 06:35:58 +0000 mbuf: PACKET_TAG_PF should not be persistent We should clear firewall tags on loopback, icmp reflection, or if_epair transmission. Left over tags can produce unexpected behaviour, especially on if_epair where a and b interfaces can be in different vnets, and have different firewall policies set. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32664 (cherry picked from commit 7fe0c3f8d3303b67e55e3abcd66cbd4a9eaa1a0d) --- sys/sys/mbuf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 127dae75726f..7d3bc98eb5f6 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1150,7 +1150,7 @@ extern int nmbclusters; /* Maximum number of clusters */ #define PACKET_TAG_DIVERT 17 /* divert info */ #define PACKET_TAG_IPFORWARD 18 /* ipforward info */ #define PACKET_TAG_MACLABEL (19 | MTAG_PERSISTENT) /* MAC label */ -#define PACKET_TAG_PF (21 | MTAG_PERSISTENT) /* PF/ALTQ information */ +#define PACKET_TAG_PF 21 /* PF/ALTQ information */ #define PACKET_TAG_RTSOCKFAM 25 /* rtsock sa family */ #define PACKET_TAG_IPOPTIONS 27 /* Saved IP options */ #define PACKET_TAG_CARP 28 /* CARP info */ From nobody Fri Nov 19 06:39:20 2021 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 417A2188BB46; Fri, 19 Nov 2021 06:39: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwRpc5jcvz3jGj; Fri, 19 Nov 2021 06:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7797E238F3; Fri, 19 Nov 2021 06:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJ6dKWJ097152; Fri, 19 Nov 2021 06:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ6dKno097151; Fri, 19 Nov 2021 06:39:20 GMT (envelope-from git) Date: Fri, 19 Nov 2021 06:39:20 GMT Message-Id: <202111190639.1AJ6dKno097151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 2036a3a8a168 - stable/13 - mbuf: PACKET_TAG_PF should not be persistent 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2036a3a8a16832974b529d601a124ac52dfeb7d1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2036a3a8a16832974b529d601a124ac52dfeb7d1 commit 2036a3a8a16832974b529d601a124ac52dfeb7d1 Author: Kristof Provost AuthorDate: 2021-10-26 07:51:33 +0000 Commit: Kristof Provost CommitDate: 2021-11-19 05:51:58 +0000 mbuf: PACKET_TAG_PF should not be persistent We should clear firewall tags on loopback, icmp reflection, or if_epair transmission. Left over tags can produce unexpected behaviour, especially on if_epair where a and b interfaces can be in different vnets, and have different firewall policies set. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32664 (cherry picked from commit 7fe0c3f8d3303b67e55e3abcd66cbd4a9eaa1a0d) --- sys/sys/mbuf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 9f84d0758bc6..2182a6c7679c 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1327,7 +1327,7 @@ extern bool mb_use_ext_pgs; /* Use ext_pgs for sendfile */ #define PACKET_TAG_DIVERT 17 /* divert info */ #define PACKET_TAG_IPFORWARD 18 /* ipforward info */ #define PACKET_TAG_MACLABEL (19 | MTAG_PERSISTENT) /* MAC label */ -#define PACKET_TAG_PF (21 | MTAG_PERSISTENT) /* PF/ALTQ information */ +#define PACKET_TAG_PF 21 /* PF/ALTQ information */ #define PACKET_TAG_RTSOCKFAM 25 /* rtsock sa family */ #define PACKET_TAG_IPOPTIONS 27 /* Saved IP options */ #define PACKET_TAG_CARP 28 /* CARP info */ From nobody Fri Nov 19 22:44:28 2021 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 36584189ECD9; Fri, 19 Nov 2021 22:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwsDF10WTz4fDR; Fri, 19 Nov 2021 22:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 043EF10E27; Fri, 19 Nov 2021 22:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJMiS5I090113; Fri, 19 Nov 2021 22:44:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJMiSLO090112; Fri, 19 Nov 2021 22:44:28 GMT (envelope-from git) Date: Fri, 19 Nov 2021 22:44:28 GMT Message-Id: <202111192244.1AJMiSLO090112@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: 81c9491a5b4c - stable/12 - nfscl: Fix two more cases for forced dismount 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 81c9491a5b4c81e50e88967a977c8674fd580f25 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=81c9491a5b4c81e50e88967a977c8674fd580f25 commit 81c9491a5b4c81e50e88967a977c8674fd580f25 Author: Rick Macklem AuthorDate: 2021-11-05 22:33:19 +0000 Commit: Rick Macklem CommitDate: 2021-11-19 22:39:56 +0000 nfscl: Fix two more cases for forced dismount Although I was not able to cause a failure during testing, there are places in nfscl_removedeleg() and nfscl_renamedeleg() where I think a forced dismount could get hung. This patch fixes those. This patch only affects forced dismount and only if the NFSv4 server is issuing delegations to the client. Found by code inspection. (cherry picked from commit f5d5164fb607ab9c51c52ace4ec241f6cac7cc5c) --- sys/fs/nfsclient/nfs_clstate.c | 54 +++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 387d043b4dbd..c7b9608da1ba 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -4538,6 +4538,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) struct nfsclowner *owp; struct nfscllockowner *lp; struct nfsmount *nmp; + struct mount *mp; struct ucred *cred; struct nfsnode *np; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; @@ -4546,6 +4547,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) if (NFSHASPNFS(nmp)) return (retcnt); np = VTONFS(vp); + mp = nmp->nm_mountp; NFSLOCKCLSTATE(); /* * Loop around waiting for: @@ -4572,8 +4574,13 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) igotlock = 0; } dp->nfsdl_rwlock.nfslock_lock |= NFSV4LOCK_WANTED; - (void) nfsmsleep(&dp->nfsdl_rwlock, - NFSCLSTATEMUTEXPTR, PZERO, "nfscld", NULL); + msleep(&dp->nfsdl_rwlock, NFSCLSTATEMUTEXPTR, PZERO, + "nfscld", hz); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + NFSUNLOCKCLSTATE(); + return (0); + } continue; } needsrecall = 0; @@ -4596,7 +4603,14 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) islept = 0; while (!igotlock) { igotlock = nfsv4_lock(&clp->nfsc_lock, 1, - &islept, NFSCLSTATEMUTEXPTR, NULL); + &islept, NFSCLSTATEMUTEXPTR, mp); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + if (igotlock) + nfsv4_unlock(&clp->nfsc_lock, 0); + NFSUNLOCKCLSTATE(); + return (0); + } if (islept) break; } @@ -4637,6 +4651,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, struct nfsclowner *owp; struct nfscllockowner *lp; struct nfsmount *nmp; + struct mount *mp; struct ucred *cred; struct nfsnode *np; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; @@ -4646,6 +4661,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, *gottdp = 0; if (NFSHASPNFS(nmp)) return (retcnt); + mp = nmp->nm_mountp; NFSLOCKCLSTATE(); /* * Loop around waiting for: @@ -4673,8 +4689,15 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, igotlock = 0; } dp->nfsdl_rwlock.nfslock_lock |= NFSV4LOCK_WANTED; - (void) nfsmsleep(&dp->nfsdl_rwlock, - NFSCLSTATEMUTEXPTR, PZERO, "nfscld", NULL); + msleep(&dp->nfsdl_rwlock, NFSCLSTATEMUTEXPTR, PZERO, + "nfscld", hz); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + NFSUNLOCKCLSTATE(); + *gotfdp = 0; + *gottdp = 0; + return (0); + } continue; } needsrecall = 0; @@ -4697,7 +4720,16 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, islept = 0; while (!igotlock) { igotlock = nfsv4_lock(&clp->nfsc_lock, 1, - &islept, NFSCLSTATEMUTEXPTR, NULL); + &islept, NFSCLSTATEMUTEXPTR, mp); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + if (igotlock) + nfsv4_unlock(&clp->nfsc_lock, 0); + NFSUNLOCKCLSTATE(); + *gotfdp = 0; + *gottdp = 0; + return (0); + } if (islept) break; } @@ -4734,8 +4766,14 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, */ if (dp->nfsdl_rwlock.nfslock_usecnt > 0) { dp->nfsdl_rwlock.nfslock_lock |= NFSV4LOCK_WANTED; - (void) nfsmsleep(&dp->nfsdl_rwlock, - NFSCLSTATEMUTEXPTR, PZERO, "nfscld", NULL); + msleep(&dp->nfsdl_rwlock, NFSCLSTATEMUTEXPTR, PZERO, + "nfscld", hz); + if (NFSCL_FORCEDISM(mp)) { + NFSUNLOCKCLSTATE(); + *gotfdp = 0; + *gottdp = 0; + return (0); + } continue; } LIST_FOREACH(owp, &dp->nfsdl_owner, nfsow_list) { From nobody Fri Nov 19 22:53:42 2021 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 6D4FA18A4BE3; Fri, 19 Nov 2021 22:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwsQt2ZGxz4jXN; Fri, 19 Nov 2021 22:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 386D81120F; Fri, 19 Nov 2021 22:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AJMrgsP003157; Fri, 19 Nov 2021 22:53:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJMrgYi003156; Fri, 19 Nov 2021 22:53:42 GMT (envelope-from git) Date: Fri, 19 Nov 2021 22:53:42 GMT Message-Id: <202111192253.1AJMrgYi003156@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: 65ecc964f800 - stable/13 - nfscl: Fix two more cases for forced dismount 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 65ecc964f80042b0100891602eec5561d315edcb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=65ecc964f80042b0100891602eec5561d315edcb commit 65ecc964f80042b0100891602eec5561d315edcb Author: Rick Macklem AuthorDate: 2021-11-05 22:33:19 +0000 Commit: Rick Macklem CommitDate: 2021-11-19 22:49:43 +0000 nfscl: Fix two more cases for forced dismount Although I was not able to cause a failure during testing, there are places in nfscl_removedeleg() and nfscl_renamedeleg() where I think a forced dismount could get hung. This patch fixes those. This patch only affects forced dismount and only if the NFSv4 server is issuing delegations to the client. Found by code inspection. (cherry picked from commit f5d5164fb607ab9c51c52ace4ec241f6cac7cc5c) --- sys/fs/nfsclient/nfs_clstate.c | 54 +++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 4392ed6cbcb2..1e2feef19d63 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -4671,6 +4671,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) struct nfsclowner *owp; struct nfscllockowner *lp; struct nfsmount *nmp; + struct mount *mp; struct ucred *cred; struct nfsnode *np; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; @@ -4685,6 +4686,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) } NFSUNLOCKMNT(nmp); np = VTONFS(vp); + mp = nmp->nm_mountp; NFSLOCKCLSTATE(); /* * Loop around waiting for: @@ -4711,8 +4713,13 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) igotlock = 0; } dp->nfsdl_rwlock.nfslock_lock |= NFSV4LOCK_WANTED; - (void) nfsmsleep(&dp->nfsdl_rwlock, - NFSCLSTATEMUTEXPTR, PZERO, "nfscld", NULL); + msleep(&dp->nfsdl_rwlock, NFSCLSTATEMUTEXPTR, PZERO, + "nfscld", hz); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + NFSUNLOCKCLSTATE(); + return (0); + } continue; } needsrecall = 0; @@ -4735,7 +4742,14 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) islept = 0; while (!igotlock) { igotlock = nfsv4_lock(&clp->nfsc_lock, 1, - &islept, NFSCLSTATEMUTEXPTR, NULL); + &islept, NFSCLSTATEMUTEXPTR, mp); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + if (igotlock) + nfsv4_unlock(&clp->nfsc_lock, 0); + NFSUNLOCKCLSTATE(); + return (0); + } if (islept) break; } @@ -4776,6 +4790,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, struct nfsclowner *owp; struct nfscllockowner *lp; struct nfsmount *nmp; + struct mount *mp; struct ucred *cred; struct nfsnode *np; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; @@ -4791,6 +4806,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, return (retcnt); } NFSUNLOCKMNT(nmp); + mp = nmp->nm_mountp; NFSLOCKCLSTATE(); /* * Loop around waiting for: @@ -4818,8 +4834,15 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, igotlock = 0; } dp->nfsdl_rwlock.nfslock_lock |= NFSV4LOCK_WANTED; - (void) nfsmsleep(&dp->nfsdl_rwlock, - NFSCLSTATEMUTEXPTR, PZERO, "nfscld", NULL); + msleep(&dp->nfsdl_rwlock, NFSCLSTATEMUTEXPTR, PZERO, + "nfscld", hz); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + NFSUNLOCKCLSTATE(); + *gotfdp = 0; + *gottdp = 0; + return (0); + } continue; } needsrecall = 0; @@ -4842,7 +4865,16 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, islept = 0; while (!igotlock) { igotlock = nfsv4_lock(&clp->nfsc_lock, 1, - &islept, NFSCLSTATEMUTEXPTR, NULL); + &islept, NFSCLSTATEMUTEXPTR, mp); + if (NFSCL_FORCEDISM(mp)) { + dp->nfsdl_flags &= ~NFSCLDL_DELEGRET; + if (igotlock) + nfsv4_unlock(&clp->nfsc_lock, 0); + NFSUNLOCKCLSTATE(); + *gotfdp = 0; + *gottdp = 0; + return (0); + } if (islept) break; } @@ -4879,8 +4911,14 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, */ if (dp->nfsdl_rwlock.nfslock_usecnt > 0) { dp->nfsdl_rwlock.nfslock_lock |= NFSV4LOCK_WANTED; - (void) nfsmsleep(&dp->nfsdl_rwlock, - NFSCLSTATEMUTEXPTR, PZERO, "nfscld", NULL); + msleep(&dp->nfsdl_rwlock, NFSCLSTATEMUTEXPTR, PZERO, + "nfscld", hz); + if (NFSCL_FORCEDISM(mp)) { + NFSUNLOCKCLSTATE(); + *gotfdp = 0; + *gottdp = 0; + return (0); + } continue; } LIST_FOREACH(owp, &dp->nfsdl_owner, nfsow_list) { From nobody Sat Nov 20 00:26:50 2021 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 F0C9A1889CF5; Sat, 20 Nov 2021 00:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwvVL6Twvz3hj3; Sat, 20 Nov 2021 00:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEA9312583; Sat, 20 Nov 2021 00:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AK0QoAq023821; Sat, 20 Nov 2021 00:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AK0Qo4T023820; Sat, 20 Nov 2021 00:26:50 GMT (envelope-from git) Date: Sat, 20 Nov 2021 00:26:50 GMT Message-Id: <202111200026.1AK0Qo4T023820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 7fd7b6b4a5dd - stable/13 - Prefer CPUID leaf 1Fh for Intel CPU topology detection. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7fd7b6b4a5dd6e32a50966e7c7d0ae6e6e34beba Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7fd7b6b4a5dd6e32a50966e7c7d0ae6e6e34beba commit 7fd7b6b4a5dd6e32a50966e7c7d0ae6e6e34beba Author: Alexander Motin AuthorDate: 2021-11-06 04:48:37 +0000 Commit: Alexander Motin CommitDate: 2021-11-20 00:26:29 +0000 Prefer CPUID leaf 1Fh for Intel CPU topology detection. Leaf 1Fh is a prefered extended version of 0Bh. It is supported by new Lader Lake CPUs, though does not report anything new so far. MFC after: 2 weeks (cherry picked from commit 6badb512a94df667f0df1484fb288ece186305bd) --- sys/x86/x86/mp_x86.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index ca1125886619..7724370c2c93 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -380,7 +380,7 @@ topo_probe_intel_0x4(void) /* * Determine topology of processing units for Intel CPUs - * using CPUID Leaf 11, if supported. + * using CPUID Leaf 1Fh or 0Bh, if supported. * See: * - Intel 64 Architecture Processor Topology Enumeration * - Intel 64 and IA-32 ArchitecturesSoftware Developer’s Manual, @@ -390,13 +390,23 @@ topo_probe_intel_0x4(void) static void topo_probe_intel_0xb(void) { - u_int p[4]; + u_int leaf; + u_int p[4] = { 0 }; int bits; int type; int i; - /* Fall back if CPU leaf 11 doesn't really exist. */ - cpuid_count(0x0b, 0, p); + /* Prefer leaf 1Fh (V2 Extended Topology Enumeration). */ + if (cpu_high >= 0x1f) { + leaf = 0x1f; + cpuid_count(leaf, 0, p); + } + /* Fall back to leaf 0Bh (Extended Topology Enumeration). */ + if (p[1] == 0) { + leaf = 0x0b; + cpuid_count(leaf, 0, p); + } + /* Fall back to leaf 04h (Deterministic Cache Parameters). */ if (p[1] == 0) { topo_probe_intel_0x4(); return; @@ -404,7 +414,7 @@ topo_probe_intel_0xb(void) /* We only support three levels for now. */ for (i = 0; ; i++) { - cpuid_count(0x0b, i, p); + cpuid_count(leaf, i, p); bits = p[0] & 0x1f; type = (p[2] >> 8) & 0xff; @@ -412,13 +422,12 @@ topo_probe_intel_0xb(void) if (type == 0) break; - /* TODO: check for duplicate (re-)assignment */ if (type == CPUID_TYPE_SMT) core_id_shift = bits; else if (type == CPUID_TYPE_CORE) pkg_id_shift = bits; - else - printf("unknown CPU level type %d\n", type); + else if (bootverbose) + printf("Topology level type %d shift: %d\n", type, bits); } if (pkg_id_shift < core_id_shift) { From nobody Sat Nov 20 00:40:47 2021 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 27461189048A; Sat, 20 Nov 2021 00:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwvpS0gZ0z3m3H; Sat, 20 Nov 2021 00:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB2121252B; Sat, 20 Nov 2021 00:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AK0elDf046184; Sat, 20 Nov 2021 00:40:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AK0eluA046183; Sat, 20 Nov 2021 00:40:47 GMT (envelope-from git) Date: Sat, 20 Nov 2021 00:40:47 GMT Message-Id: <202111200040.1AK0eluA046183@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 1ae5513db3b2 - stable/12 - Prefer CPUID leaf 1Fh for Intel CPU topology detection. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1ae5513db3b28e929d487d954d4e1c8a4c70fde9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1ae5513db3b28e929d487d954d4e1c8a4c70fde9 commit 1ae5513db3b28e929d487d954d4e1c8a4c70fde9 Author: Alexander Motin AuthorDate: 2021-11-06 04:48:37 +0000 Commit: Alexander Motin CommitDate: 2021-11-20 00:32:54 +0000 Prefer CPUID leaf 1Fh for Intel CPU topology detection. Leaf 1Fh is a prefered extended version of 0Bh. It is supported by new Lader Lake CPUs, though does not report anything new so far. MFC after: 2 weeks (cherry picked from commit 6badb512a94df667f0df1484fb288ece186305bd) --- sys/x86/x86/mp_x86.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 73565360007b..41dc36672135 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -366,7 +366,7 @@ topo_probe_intel_0x4(void) /* * Determine topology of processing units for Intel CPUs - * using CPUID Leaf 11, if supported. + * using CPUID Leaf 1Fh or 0Bh, if supported. * See: * - Intel 64 Architecture Processor Topology Enumeration * - Intel 64 and IA-32 ArchitecturesSoftware Developer’s Manual, @@ -376,13 +376,23 @@ topo_probe_intel_0x4(void) static void topo_probe_intel_0xb(void) { - u_int p[4]; + u_int leaf; + u_int p[4] = { 0 }; int bits; int type; int i; - /* Fall back if CPU leaf 11 doesn't really exist. */ - cpuid_count(0x0b, 0, p); + /* Prefer leaf 1Fh (V2 Extended Topology Enumeration). */ + if (cpu_high >= 0x1f) { + leaf = 0x1f; + cpuid_count(leaf, 0, p); + } + /* Fall back to leaf 0Bh (Extended Topology Enumeration). */ + if (p[1] == 0) { + leaf = 0x0b; + cpuid_count(leaf, 0, p); + } + /* Fall back to leaf 04h (Deterministic Cache Parameters). */ if (p[1] == 0) { topo_probe_intel_0x4(); return; @@ -390,7 +400,7 @@ topo_probe_intel_0xb(void) /* We only support three levels for now. */ for (i = 0; ; i++) { - cpuid_count(0x0b, i, p); + cpuid_count(leaf, i, p); bits = p[0] & 0x1f; type = (p[2] >> 8) & 0xff; @@ -398,13 +408,12 @@ topo_probe_intel_0xb(void) if (type == 0) break; - /* TODO: check for duplicate (re-)assignment */ if (type == CPUID_TYPE_SMT) core_id_shift = bits; else if (type == CPUID_TYPE_CORE) pkg_id_shift = bits; - else - printf("unknown CPU level type %d\n", type); + else if (bootverbose) + printf("Topology level type %d shift: %d\n", type, bits); } if (pkg_id_shift < core_id_shift) { From nobody Sat Nov 20 01:08:32 2021 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 E4591189E2F7; Sat, 20 Nov 2021 01:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HwwQS60bkz3w6t; Sat, 20 Nov 2021 01:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEAD112D25; Sat, 20 Nov 2021 01:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AK18W32077702; Sat, 20 Nov 2021 01:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AK18WfM077701; Sat, 20 Nov 2021 01:08:32 GMT (envelope-from git) Date: Sat, 20 Nov 2021 01:08:32 GMT Message-Id: <202111200108.1AK18WfM077701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang Subject: git: ffc00e9db94d - stable/13 - bridge(4): Fix spelling 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ffc00e9db94dce45d332651ec538672f211760c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ffc00e9db94dce45d332651ec538672f211760c3 commit ffc00e9db94dce45d332651ec538672f211760c3 Author: Tom Marcoen AuthorDate: 2021-11-17 17:47:33 +0000 Commit: Guangyuan Yang CommitDate: 2021-11-20 01:08:14 +0000 bridge(4): Fix spelling PR: 237725 (cherry picked from commit 8406182dbeb972698775e2468902bc5f6e593d72) --- share/man/man4/bridge.4 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 7e5376556c57..c79e5da69837 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 1, 2020 +.Dd November 17, 2021 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -96,20 +96,20 @@ If .Xr sysctl 8 node .Va net.link.bridge.inherit_mac -has non-zero value, a newly created bridge will inherit its MAC address -from its first member instead of choosing a random link-level address. -This provides a more predictable bridge MAC without any -additional configuration, but currently this feature is known -to break some L2 protocols, for example PPPoE that is provided -by +has a non-zero value, the newly created bridge will inherit the MAC +address from its first member instead of choosing a random link-level +address. +This will provide more predictable bridge MAC addresses without any +additional configuration, but currently this feature is known to break +some L2 protocols, for example PPPoE that is provided by .Xr ng_pppoe 4 and .Xr ppp 8 . -Currently this feature is considered experimental and is turned off +Currently this feature is considered as experimental and is turned off by default. .Pp A bridge can be used to provide several services, such as a simple -802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. +802.11-to-Ethernet bridge for wireless hosts, or traffic isolation. .Pp A bridge works like a switch, forwarding traffic from one interface to another. @@ -130,7 +130,7 @@ The MTU of the first member interface to be added is used as the bridge MTU. All additional members are required to have exactly the same MTU value. .Pp The TOE, TSO, TXCSUM and TXCSUM6 capabilities on all interfaces added to the -bridge are disabled if any of the interfaces doesn't support/enable them. +bridge are disabled if any of the interfaces do not support/enable them. The LRO capability is always disabled. All the capabilities are restored when the interface is removed from the bridge. Changing capabilities at run-time may cause NIC reinit and a link flap. @@ -180,7 +180,7 @@ This situation is clearly against the description in Section 5, RFC 4007. Although it works in most cases, -it can cause some counterintuitive or undesirable behavior in some +it can cause some counterintuitive or undesirable behaviour in some edge cases when both, the .Nm interface and one of the member interfaces, have an IPv6 address @@ -198,7 +198,7 @@ interface has IPv6 addresses, IPv6 addresses on the member interface will be automatically removed before the interface is added. .Pp -This behavior can be disabled by setting +This behaviour can be disabled by setting .Xr sysctl 8 variable .Va net.link.bridge.allow_llz_overlap From nobody Sat Nov 20 15:58:07 2021 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 145721899551; Sat, 20 Nov 2021 15:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxJ8v6gk0z4p8b; Sat, 20 Nov 2021 15:58:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B53471E9AD; Sat, 20 Nov 2021 15:58:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AKFw7NO063267; Sat, 20 Nov 2021 15:58:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AKFw7Ax063266; Sat, 20 Nov 2021 15:58:07 GMT (envelope-from git) Date: Sat, 20 Nov 2021 15:58:07 GMT Message-Id: <202111201558.1AKFw7Ax063266@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: 87c8d2853971 - stable/13 - nfscl: Fix NFSv4.1/4.2 pnfs mounts using nconnect 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 87c8d2853971cb69845b230f530e82702f1e19ef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=87c8d2853971cb69845b230f530e82702f1e19ef commit 87c8d2853971cb69845b230f530e82702f1e19ef Author: Rick Macklem AuthorDate: 2021-11-05 00:06:34 +0000 Commit: Rick Macklem CommitDate: 2021-11-20 15:54:38 +0000 nfscl: Fix NFSv4.1/4.2 pnfs mounts using nconnect When a mount with the "pnfs" and "nconnect" options specified does an I/O operation, it erroneously uses a TCP connection to the MDS when it is meant to be a DS operation and, as such, needs to use a TCP connection to the DS. This patch fixes this. When the "pnfs" and "nconnect" options are specified for a NFSv4.1/4.2 mount, there probably should be N connections established to each DS for I/O RPCs. This is a fair amount of work and may be done in a future commit. This problem was found during a recent IETF NFSv4 working group testing event. (cherry picked from commit 80e5955b085af20e65ef84066a164936413748e3) --- sys/fs/nfs/nfs_commonkrpc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 358d77fe5b30..c1a5fab2a358 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -639,8 +639,17 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, if (nrp->nr_client == NULL) newnfs_connect(nmp, nrp, cred, td, 0, false, &nrp->nr_client); + /* + * If the "nconnect" mount option was specified and this RPC is + * one that can have a large RPC message and is being done through + * the NFS/MDS server, use an additional connection. (When the RPC is + * being done through the server/MDS, nrp == &nmp->nm_sockreq.) + * The "nconnect" mount option normally has minimal effect when the + * "pnfs" mount option is specified, since only Readdir RPCs are + * normally done through the NFS/MDS server. + */ nextconn_set = false; - if (nmp != NULL && nmp->nm_aconnect > 0 && + if (nmp != NULL && nmp->nm_aconnect > 0 && nrp == &nmp->nm_sockreq && (nd->nd_procnum == NFSPROC_READ || nd->nd_procnum == NFSPROC_READDIR || nd->nd_procnum == NFSPROC_READDIRPLUS || From nobody Sat Nov 20 18:33:51 2021 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 D7D3918A253F; Sat, 20 Nov 2021 18:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxMcb5jjdz4hTn; Sat, 20 Nov 2021 18:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A440A20BC0; Sat, 20 Nov 2021 18:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AKIXpIG076209; Sat, 20 Nov 2021 18:33:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AKIXpDv076208; Sat, 20 Nov 2021 18:33:51 GMT (envelope-from git) Date: Sat, 20 Nov 2021 18:33:51 GMT Message-Id: <202111201833.1AKIXpDv076208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: f8145bd4bcc0 - stable/12 - fsck_ufs: fix segfault with gjournal 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f8145bd4bcc025fbb1750d9daf75e92916db4192 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=f8145bd4bcc025fbb1750d9daf75e92916db4192 commit f8145bd4bcc025fbb1750d9daf75e92916db4192 Author: Robert Wing AuthorDate: 2021-06-03 01:41:31 +0000 Commit: Robert Wing CommitDate: 2021-11-20 18:24:06 +0000 fsck_ufs: fix segfault with gjournal The segfault was being hit in closedisk() while trying to free a non-pointer. The fix for this bug differs between stable/12 and stable/13. PR: 245907 Submitted by: longwitz@incore.de Differential Revision: https://reviews.freebsd.org/D30537 (cherry picked from commit 441e69e419effac0225a45f4cdb948280b8ce5ab) --- sbin/fsck_ffs/gjournal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sbin/fsck_ffs/gjournal.c b/sbin/fsck_ffs/gjournal.c index b9bfd1bfcced..dca08278569d 100644 --- a/sbin/fsck_ffs/gjournal.c +++ b/sbin/fsck_ffs/gjournal.c @@ -246,7 +246,6 @@ closedisk(void) err(1, "sbwrite(%s)", devnam); if (ufs_disk_close(diskp) == -1) err(1, "ufs_disk_close(%s)", devnam); - free(diskp); diskp = NULL; fs = NULL; } From nobody Sat Nov 20 21:20:45 2021 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 23E141891FCD; Sat, 20 Nov 2021 21:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxRK95ph3z4gRG; Sat, 20 Nov 2021 21:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A84162318D; Sat, 20 Nov 2021 21:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AKLKjLQ001917; Sat, 20 Nov 2021 21:20:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AKLKjEF001915; Sat, 20 Nov 2021 21:20:45 GMT (envelope-from git) Date: Sat, 20 Nov 2021 21:20:45 GMT Message-Id: <202111202120.1AKLKjEF001915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 92b40444d07a - stable/12 - MFC: rc.d/rctl: unbreak for distinct /usr filesystem 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 92b40444d07aeef2bf4b20109f3f90ac343b90df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=92b40444d07aeef2bf4b20109f3f90ac343b90df commit 92b40444d07aeef2bf4b20109f3f90ac343b90df Author: Eugene Grosbein AuthorDate: 2021-11-20 08:54:39 +0000 Commit: Eugene Grosbein CommitDate: 2021-11-20 21:17:28 +0000 MFC: rc.d/rctl: unbreak for distinct /usr filesystem Both rctl and used xargs utility live in /usr/bin so add REQUIRE: FILESYSTEMS This trivial change to stable/12 violates "3 days MFC policy" because of imminent upcoming 12.3-RELESE deadline. Approved by: re (cperciva) Reported by: Peter (cherry picked from commit 0c54fe172ad365e7e60d6249484a7579c18b7d2d) --- libexec/rc/rc.d/rctl | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc.d/rctl b/libexec/rc/rc.d/rctl index ed5665454dde..f1b001a6ad79 100755 --- a/libexec/rc/rc.d/rctl +++ b/libexec/rc/rc.d/rctl @@ -4,6 +4,7 @@ # # PROVIDE: rctl +# REQUIRE: FILESYSTEMS # BEFORE: LOGIN # KEYWORD: nojail From nobody Sat Nov 20 22:56:14 2021 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 5D81F18A3CCA; Sat, 20 Nov 2021 22:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxTRL2848z3kxj; Sat, 20 Nov 2021 22:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 259802459A; Sat, 20 Nov 2021 22:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AKMuED9024547; Sat, 20 Nov 2021 22:56:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AKMuEAi024546; Sat, 20 Nov 2021 22:56:14 GMT (envelope-from git) Date: Sat, 20 Nov 2021 22:56:14 GMT Message-Id: <202111202256.1AKMuEAi024546@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: 53cff1d4ddb9 - stable/12 - nfsd: Fix f_bavail and f_ffree for NFSv4 when negative 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 53cff1d4ddb9f46d9c68eb3ec1f81717f7a8767c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=53cff1d4ddb9f46d9c68eb3ec1f81717f7a8767c commit 53cff1d4ddb9f46d9c68eb3ec1f81717f7a8767c Author: Rick Macklem AuthorDate: 2021-11-08 20:59:31 +0000 Commit: Rick Macklem CommitDate: 2021-11-20 21:49:57 +0000 nfsd: Fix f_bavail and f_ffree for NFSv4 when negative Since the NFS Space_available and Files_available are unsigned, the NFSv3 server sets them to 0 when negative, so that they do not appear to be large positive values for non-FreeBSD clients. This patch fixes the NFSv4 server to do the same. Found during a recent IEFT NFSv4 working group testing event. (cherry picked from commit d70ca5b00eede3367ce659a03b2f9cc9729cd0dd) --- sys/fs/nfs/nfs_commonsubs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 390d6e91535f..e4120d4d9e78 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -2482,6 +2482,17 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, } NFSCLRSTATFS_ATTRBIT(retbitp); } + /* + * Since NFS handles these values as unsigned on the + * wire, there is no way to represent negative values, + * so set them to 0. Without this, they will appear + * to be very large positive values for clients like + * Solaris10. + */ + if (fs->f_bavail < 0) + fs->f_bavail = 0; + if (fs->f_ffree < 0) + fs->f_ffree = 0; } #endif From nobody Sat Nov 20 22:58:45 2021 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 1331E18A5C93; Sat, 20 Nov 2021 22:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxTVF4dCMz3mCH; Sat, 20 Nov 2021 22:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B24D2441C; Sat, 20 Nov 2021 22:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AKMwj8D024956; Sat, 20 Nov 2021 22:58:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AKMwj2R024955; Sat, 20 Nov 2021 22:58:45 GMT (envelope-from git) Date: Sat, 20 Nov 2021 22:58:45 GMT Message-Id: <202111202258.1AKMwj2R024955@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: ca2b9574aa42 - stable/13 - libarchive: cherry-pick bugfix from vendor 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: ca2b9574aa42f1bca7a4d611bf32a997a31e2e9a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=ca2b9574aa42f1bca7a4d611bf32a997a31e2e9a commit ca2b9574aa42f1bca7a4d611bf32a997a31e2e9a Author: Martin Matuska AuthorDate: 2021-11-17 21:21:19 +0000 Commit: Martin Matuska CommitDate: 2021-11-20 22:33:10 +0000 libarchive: cherry-pick bugfix from vendor Vendor commit message (ede459d2e): archive_write_disk_posix: fix writing fflags broken in 8a1bd5c The fixup list was erroneously assumed to be directories only. Only in the case of critical file flags modification (e.g. SF_IMMUTABLE on BSD systems), other file types (e.g. regular files or symbolic links) may be added to the fixup list. We still need to verify that we are writing to the correct file type, so compare the archive entry file type with the file type of the file to be modified. Fixes vendor issue #1617: Immutable flag no longer preserved during tar extraction on FreeBSD Reported by: markjdb Libarchive commit: ede459d2ebb879f5eedb6f7abea203be0b334230 (cherry picked from commit 201d0ebee321fb1a5501e17a4f150aa211020c5c) --- .../libarchive/archive_write_disk_posix.c | 87 +++++++++++++++++++--- 1 file changed, 75 insertions(+), 12 deletions(-) diff --git a/contrib/libarchive/libarchive/archive_write_disk_posix.c b/contrib/libarchive/libarchive/archive_write_disk_posix.c index a554679bfd10..1aa00840bf4c 100644 --- a/contrib/libarchive/libarchive/archive_write_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_write_disk_posix.c @@ -173,6 +173,7 @@ struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; mode_t mode; + __LA_MODE_T filetype; int64_t atime; int64_t birthtime; int64_t mtime; @@ -357,6 +358,7 @@ struct archive_write_disk { static int la_opendirat(int, const char *); static int la_mktemp(struct archive_write_disk *); +static int la_verify_filetype(mode_t, __LA_MODE_T); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -464,6 +466,39 @@ la_opendirat(int fd, const char *path) { #endif } +static int +la_verify_filetype(mode_t mode, __LA_MODE_T filetype) { + int ret = 0; + + switch (filetype) { + case AE_IFREG: + ret = (S_ISREG(mode)); + break; + case AE_IFDIR: + ret = (S_ISDIR(mode)); + break; + case AE_IFLNK: + ret = (S_ISLNK(mode)); + break; + case AE_IFSOCK: + ret = (S_ISSOCK(mode)); + break; + case AE_IFCHR: + ret = (S_ISCHR(mode)); + break; + case AE_IFBLK: + ret = (S_ISBLK(mode)); + break; + case AE_IFIFO: + ret = (S_ISFIFO(mode)); + break; + default: + break; + } + + return (ret); +} + static int lazy_stat(struct archive_write_disk *a) { @@ -822,6 +857,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_MODE_BASE; fe->mode = a->mode; } @@ -832,6 +868,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mode = a->mode; fe->fixup |= TODO_TIMES; if (archive_entry_atime_is_set(entry)) { @@ -865,6 +902,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_ACLS; archive_acl_copy(&fe->acl, archive_entry_acl(entry)); } @@ -877,6 +915,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { memcpy(fe->mac_metadata, metadata, @@ -891,6 +930,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_FFLAGS; /* TODO: Complete this.. defer fflags from below. */ } @@ -2463,7 +2503,7 @@ _archive_write_disk_close(struct archive *_a) struct fixup_entry *next, *p; struct stat st; char *c; - int fd, ret; + int fd, ret, openflags; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2490,32 +2530,53 @@ _archive_write_disk_close(struct archive *_a) if (p->fixup == 0) goto skip_fixup_entry; else { - fd = open(p->name, O_BINARY | O_NOFOLLOW | O_RDONLY + /* + * We need to verify if the type of the file + * we are going to open matches the file type + * of the fixup entry. + */ + openflags = O_BINARY | O_NOFOLLOW | O_RDONLY + | O_CLOEXEC; #if defined(O_DIRECTORY) - | O_DIRECTORY + if (p->filetype == AE_IFDIR) + openflags |= O_DIRECTORY; #endif - | O_CLOEXEC); + fd = open(p->name, openflags); + +#if defined(O_DIRECTORY) /* - ` * If we don't support O_DIRECTORY, - * or open() has failed, we must stat() - * to verify that we are opening a directory + * If we support O_DIRECTORY and open was + * successful we can skip the file type check + * for directories. For other file types + * we need to verify via fstat() or lstat() */ -#if defined(O_DIRECTORY) - if (fd == -1) { + if (fd == -1 || p->filetype != AE_IFDIR) { +#if HAVE_FSTAT + if (fd > 0 && ( + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { + goto skip_fixup_entry; + } else +#endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } } #else #if HAVE_FSTAT if (fd > 0 && ( - fstat(fd, &st) != 0 || !S_ISDIR(st.st_mode))) { + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { goto skip_fixup_entry; } else #endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } #endif @@ -2689,6 +2750,7 @@ new_fixup(struct archive_write_disk *a, const char *pathname) fe->next = a->fixup_list; a->fixup_list = fe; fe->fixup = 0; + fe->filetype = 0; fe->name = strdup(pathname); return (fe); } @@ -3811,6 +3873,7 @@ set_fflags(struct archive_write_disk *a) le = current_fixup(a, a->name); if (le == NULL) return (ARCHIVE_FATAL); + le->filetype = archive_entry_filetype(a->entry); le->fixup |= TODO_FFLAGS; le->fflags_set = set; /* Store the mode if it's not already there. */ From nobody Sat Nov 20 23:15:43 2021 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 ABFCD18AD1DC; Sat, 20 Nov 2021 23:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxTsq4X1jz3rfS; Sat, 20 Nov 2021 23:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BC7C24742; Sat, 20 Nov 2021 23:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AKNFhsf052538; Sat, 20 Nov 2021 23:15:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AKNFh2V052537; Sat, 20 Nov 2021 23:15:43 GMT (envelope-from git) Date: Sat, 20 Nov 2021 23:15:43 GMT Message-Id: <202111202315.1AKNFh2V052537@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: f2b106ec4e5a - stable/12 - libarchive: cherry-pick bugfix from vendor 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: f2b106ec4e5a8488883c58480cf576d18010d263 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=f2b106ec4e5a8488883c58480cf576d18010d263 commit f2b106ec4e5a8488883c58480cf576d18010d263 Author: Martin Matuska AuthorDate: 2021-11-17 21:21:19 +0000 Commit: Martin Matuska CommitDate: 2021-11-20 23:00:24 +0000 libarchive: cherry-pick bugfix from vendor Vendor commit message (ede459d2e): archive_write_disk_posix: fix writing fflags broken in 8a1bd5c The fixup list was erroneously assumed to be directories only. Only in the case of critical file flags modification (e.g. SF_IMMUTABLE on BSD systems), other file types (e.g. regular files or symbolic links) may be added to the fixup list. We still need to verify that we are writing to the correct file type, so compare the archive entry file type with the file type of the file to be modified. Fixes vendor issue #1617: Immutable flag no longer preserved during tar extraction on FreeBSD Reported by: markjdb Libarchive commit: ede459d2ebb879f5eedb6f7abea203be0b334230 (cherry picked from commit 201d0ebee321fb1a5501e17a4f150aa211020c5c) --- .../libarchive/archive_write_disk_posix.c | 87 +++++++++++++++++++--- 1 file changed, 75 insertions(+), 12 deletions(-) diff --git a/contrib/libarchive/libarchive/archive_write_disk_posix.c b/contrib/libarchive/libarchive/archive_write_disk_posix.c index a554679bfd10..1aa00840bf4c 100644 --- a/contrib/libarchive/libarchive/archive_write_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_write_disk_posix.c @@ -173,6 +173,7 @@ struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; mode_t mode; + __LA_MODE_T filetype; int64_t atime; int64_t birthtime; int64_t mtime; @@ -357,6 +358,7 @@ struct archive_write_disk { static int la_opendirat(int, const char *); static int la_mktemp(struct archive_write_disk *); +static int la_verify_filetype(mode_t, __LA_MODE_T); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -464,6 +466,39 @@ la_opendirat(int fd, const char *path) { #endif } +static int +la_verify_filetype(mode_t mode, __LA_MODE_T filetype) { + int ret = 0; + + switch (filetype) { + case AE_IFREG: + ret = (S_ISREG(mode)); + break; + case AE_IFDIR: + ret = (S_ISDIR(mode)); + break; + case AE_IFLNK: + ret = (S_ISLNK(mode)); + break; + case AE_IFSOCK: + ret = (S_ISSOCK(mode)); + break; + case AE_IFCHR: + ret = (S_ISCHR(mode)); + break; + case AE_IFBLK: + ret = (S_ISBLK(mode)); + break; + case AE_IFIFO: + ret = (S_ISFIFO(mode)); + break; + default: + break; + } + + return (ret); +} + static int lazy_stat(struct archive_write_disk *a) { @@ -822,6 +857,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_MODE_BASE; fe->mode = a->mode; } @@ -832,6 +868,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mode = a->mode; fe->fixup |= TODO_TIMES; if (archive_entry_atime_is_set(entry)) { @@ -865,6 +902,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_ACLS; archive_acl_copy(&fe->acl, archive_entry_acl(entry)); } @@ -877,6 +915,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { memcpy(fe->mac_metadata, metadata, @@ -891,6 +930,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_FFLAGS; /* TODO: Complete this.. defer fflags from below. */ } @@ -2463,7 +2503,7 @@ _archive_write_disk_close(struct archive *_a) struct fixup_entry *next, *p; struct stat st; char *c; - int fd, ret; + int fd, ret, openflags; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2490,32 +2530,53 @@ _archive_write_disk_close(struct archive *_a) if (p->fixup == 0) goto skip_fixup_entry; else { - fd = open(p->name, O_BINARY | O_NOFOLLOW | O_RDONLY + /* + * We need to verify if the type of the file + * we are going to open matches the file type + * of the fixup entry. + */ + openflags = O_BINARY | O_NOFOLLOW | O_RDONLY + | O_CLOEXEC; #if defined(O_DIRECTORY) - | O_DIRECTORY + if (p->filetype == AE_IFDIR) + openflags |= O_DIRECTORY; #endif - | O_CLOEXEC); + fd = open(p->name, openflags); + +#if defined(O_DIRECTORY) /* - ` * If we don't support O_DIRECTORY, - * or open() has failed, we must stat() - * to verify that we are opening a directory + * If we support O_DIRECTORY and open was + * successful we can skip the file type check + * for directories. For other file types + * we need to verify via fstat() or lstat() */ -#if defined(O_DIRECTORY) - if (fd == -1) { + if (fd == -1 || p->filetype != AE_IFDIR) { +#if HAVE_FSTAT + if (fd > 0 && ( + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { + goto skip_fixup_entry; + } else +#endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } } #else #if HAVE_FSTAT if (fd > 0 && ( - fstat(fd, &st) != 0 || !S_ISDIR(st.st_mode))) { + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { goto skip_fixup_entry; } else #endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } #endif @@ -2689,6 +2750,7 @@ new_fixup(struct archive_write_disk *a, const char *pathname) fe->next = a->fixup_list; a->fixup_list = fe; fe->fixup = 0; + fe->filetype = 0; fe->name = strdup(pathname); return (fe); } @@ -3811,6 +3873,7 @@ set_fflags(struct archive_write_disk *a) le = current_fixup(a, a->name); if (le == NULL) return (ARCHIVE_FATAL); + le->filetype = archive_entry_filetype(a->entry); le->fixup |= TODO_FFLAGS; le->fflags_set = set; /* Store the mode if it's not already there. */ From nobody Sat Nov 20 23:38:15 2021 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 D9BBE188EC1D; Sat, 20 Nov 2021 23:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxVMq5p1dz4RwX; Sat, 20 Nov 2021 23:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A72D524E17; Sat, 20 Nov 2021 23:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AKNcFS7079294; Sat, 20 Nov 2021 23:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AKNcFZ8079293; Sat, 20 Nov 2021 23:38:15 GMT (envelope-from git) Date: Sat, 20 Nov 2021 23:38:15 GMT Message-Id: <202111202338.1AKNcFZ8079293@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: 50f03cd45ed6 - stable/11 - libarchive: cherry-pick bugfix from vendor 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/11 X-Git-Reftype: branch X-Git-Commit: 50f03cd45ed69802778aeeece504ab718ff10238 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/11 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=50f03cd45ed69802778aeeece504ab718ff10238 commit 50f03cd45ed69802778aeeece504ab718ff10238 Author: Martin Matuska AuthorDate: 2021-11-17 21:21:19 +0000 Commit: Martin Matuska CommitDate: 2021-11-20 23:16:35 +0000 libarchive: cherry-pick bugfix from vendor Vendor commit message (ede459d2e): archive_write_disk_posix: fix writing fflags broken in 8a1bd5c The fixup list was erroneously assumed to be directories only. Only in the case of critical file flags modification (e.g. SF_IMMUTABLE on BSD systems), other file types (e.g. regular files or symbolic links) may be added to the fixup list. We still need to verify that we are writing to the correct file type, so compare the archive entry file type with the file type of the file to be modified. Fixes vendor issue #1617: Immutable flag no longer preserved during tar extraction on FreeBSD Reported by: markjdb Libarchive commit: ede459d2ebb879f5eedb6f7abea203be0b334230 (cherry picked from commit 201d0ebee321fb1a5501e17a4f150aa211020c5c) --- .../libarchive/archive_write_disk_posix.c | 87 +++++++++++++++++++--- 1 file changed, 75 insertions(+), 12 deletions(-) diff --git a/contrib/libarchive/libarchive/archive_write_disk_posix.c b/contrib/libarchive/libarchive/archive_write_disk_posix.c index a554679bfd10..1aa00840bf4c 100644 --- a/contrib/libarchive/libarchive/archive_write_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_write_disk_posix.c @@ -173,6 +173,7 @@ struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; mode_t mode; + __LA_MODE_T filetype; int64_t atime; int64_t birthtime; int64_t mtime; @@ -357,6 +358,7 @@ struct archive_write_disk { static int la_opendirat(int, const char *); static int la_mktemp(struct archive_write_disk *); +static int la_verify_filetype(mode_t, __LA_MODE_T); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -464,6 +466,39 @@ la_opendirat(int fd, const char *path) { #endif } +static int +la_verify_filetype(mode_t mode, __LA_MODE_T filetype) { + int ret = 0; + + switch (filetype) { + case AE_IFREG: + ret = (S_ISREG(mode)); + break; + case AE_IFDIR: + ret = (S_ISDIR(mode)); + break; + case AE_IFLNK: + ret = (S_ISLNK(mode)); + break; + case AE_IFSOCK: + ret = (S_ISSOCK(mode)); + break; + case AE_IFCHR: + ret = (S_ISCHR(mode)); + break; + case AE_IFBLK: + ret = (S_ISBLK(mode)); + break; + case AE_IFIFO: + ret = (S_ISFIFO(mode)); + break; + default: + break; + } + + return (ret); +} + static int lazy_stat(struct archive_write_disk *a) { @@ -822,6 +857,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_MODE_BASE; fe->mode = a->mode; } @@ -832,6 +868,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mode = a->mode; fe->fixup |= TODO_TIMES; if (archive_entry_atime_is_set(entry)) { @@ -865,6 +902,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_ACLS; archive_acl_copy(&fe->acl, archive_entry_acl(entry)); } @@ -877,6 +915,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { memcpy(fe->mac_metadata, metadata, @@ -891,6 +930,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_FFLAGS; /* TODO: Complete this.. defer fflags from below. */ } @@ -2463,7 +2503,7 @@ _archive_write_disk_close(struct archive *_a) struct fixup_entry *next, *p; struct stat st; char *c; - int fd, ret; + int fd, ret, openflags; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2490,32 +2530,53 @@ _archive_write_disk_close(struct archive *_a) if (p->fixup == 0) goto skip_fixup_entry; else { - fd = open(p->name, O_BINARY | O_NOFOLLOW | O_RDONLY + /* + * We need to verify if the type of the file + * we are going to open matches the file type + * of the fixup entry. + */ + openflags = O_BINARY | O_NOFOLLOW | O_RDONLY + | O_CLOEXEC; #if defined(O_DIRECTORY) - | O_DIRECTORY + if (p->filetype == AE_IFDIR) + openflags |= O_DIRECTORY; #endif - | O_CLOEXEC); + fd = open(p->name, openflags); + +#if defined(O_DIRECTORY) /* - ` * If we don't support O_DIRECTORY, - * or open() has failed, we must stat() - * to verify that we are opening a directory + * If we support O_DIRECTORY and open was + * successful we can skip the file type check + * for directories. For other file types + * we need to verify via fstat() or lstat() */ -#if defined(O_DIRECTORY) - if (fd == -1) { + if (fd == -1 || p->filetype != AE_IFDIR) { +#if HAVE_FSTAT + if (fd > 0 && ( + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { + goto skip_fixup_entry; + } else +#endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } } #else #if HAVE_FSTAT if (fd > 0 && ( - fstat(fd, &st) != 0 || !S_ISDIR(st.st_mode))) { + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { goto skip_fixup_entry; } else #endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } #endif @@ -2689,6 +2750,7 @@ new_fixup(struct archive_write_disk *a, const char *pathname) fe->next = a->fixup_list; a->fixup_list = fe; fe->fixup = 0; + fe->filetype = 0; fe->name = strdup(pathname); return (fe); } @@ -3811,6 +3873,7 @@ set_fflags(struct archive_write_disk *a) le = current_fixup(a, a->name); if (le == NULL) return (ARCHIVE_FATAL); + le->filetype = archive_entry_filetype(a->entry); le->fixup |= TODO_FFLAGS; le->fflags_set = set; /* Store the mode if it's not already there. */ From nobody Sun Nov 21 00:28:09 2021 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 B8A5B1889713; Sun, 21 Nov 2021 00:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxWTP4rT5z4jdf; Sun, 21 Nov 2021 00:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86EB52579C; Sun, 21 Nov 2021 00:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AL0S9Tm045621; Sun, 21 Nov 2021 00:28:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AL0S9Ja045620; Sun, 21 Nov 2021 00:28:09 GMT (envelope-from git) Date: Sun, 21 Nov 2021 00:28:09 GMT Message-Id: <202111210028.1AL0S9Ja045620@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: 7dab2a7cf5b9 - stable/13 - Kernel linkers: some style 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 7dab2a7cf5b9c9c00435ee7709e8f7b3c19be870 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7dab2a7cf5b9c9c00435ee7709e8f7b3c19be870 commit 7dab2a7cf5b9c9c00435ee7709e8f7b3c19be870 Author: Konstantin Belousov AuthorDate: 2021-11-07 09:03:45 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-21 00:27:44 +0000 Kernel linkers: some style (cherry picked from commit a7e4eb14229845c0857caf91bc3364f9e7075b00) --- sys/kern/link_elf.c | 10 +++++----- sys/kern/link_elf_obj.c | 36 ++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 2faaa003380a..4114bd46f0c0 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -1596,12 +1596,12 @@ static int link_elf_search_symbol(linker_file_t lf, caddr_t value, c_linker_sym_t *sym, long *diffp) { - elf_file_t ef = (elf_file_t) lf; - u_long off = (uintptr_t) (void *) value; + elf_file_t ef = (elf_file_t)lf; + u_long off = (uintptr_t) (void *)value; u_long diff = off; u_long st_value; - const Elf_Sym* es; - const Elf_Sym* best = NULL; + const Elf_Sym *es; + const Elf_Sym *best = NULL; int i; for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) { @@ -1711,7 +1711,7 @@ link_elf_each_function_nameval(linker_file_t file, { linker_symval_t symval; elf_file_t ef = (elf_file_t)file; - const Elf_Sym* symp; + const Elf_Sym *symp; int i, error; /* Exhaustive search */ diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 91852939e5e8..5c6db11e1937 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -1421,7 +1421,7 @@ link_elf_lookup_symbol(linker_file_t lf, const char *name, c_linker_sym_t *sym) return 0; } } - return ENOENT; + return (ENOENT); } static int @@ -1442,17 +1442,17 @@ link_elf_symbol_values(linker_file_t lf, c_linker_sym_t sym, val = ((caddr_t (*)(void))val)(); symval->value = val; symval->size = es->st_size; - return 0; + return (0); } - return ENOENT; + return (ENOENT); } static int link_elf_search_symbol(linker_file_t lf, caddr_t value, c_linker_sym_t *sym, long *diffp) { - elf_file_t ef = (elf_file_t) lf; - u_long off = (uintptr_t) (void *) value; + elf_file_t ef = (elf_file_t)lf; + u_long off = (uintptr_t)(void *)value; u_long diff = off; u_long st_value; const Elf_Sym *es; @@ -1480,7 +1480,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value, *diffp = diff; *sym = (c_linker_sym_t) best; - return 0; + return (0); } /* @@ -1779,25 +1779,21 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) static long link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab) { - elf_file_t ef = (elf_file_t)lf; - - *symtab = ef->ddbsymtab; - - if (*symtab == NULL) - return (0); + elf_file_t ef = (elf_file_t)lf; - return (ef->ddbsymcnt); + *symtab = ef->ddbsymtab; + if (*symtab == NULL) + return (0); + return (ef->ddbsymcnt); } static long link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) { - elf_file_t ef = (elf_file_t)lf; - - *strtab = ef->ddbstrtab; - - if (*strtab == NULL) - return (0); + elf_file_t ef = (elf_file_t)lf; - return (ef->ddbstrcnt); + *strtab = ef->ddbstrtab; + if (*strtab == NULL) + return (0); + return (ef->ddbstrcnt); } From nobody Sun Nov 21 01:31:24 2021 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 3FBF518A8708; Sun, 21 Nov 2021 01:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxXtP15nrz3K1r; Sun, 21 Nov 2021 01:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 032E226748; Sun, 21 Nov 2021 01:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AL1VO3X034057; Sun, 21 Nov 2021 01:31:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AL1VOt3034056; Sun, 21 Nov 2021 01:31:24 GMT (envelope-from git) Date: Sun, 21 Nov 2021 01:31:24 GMT Message-Id: <202111210131.1AL1VOt3034056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: de0af6442023 - stable/13 - wpa: Remove duplicate options definitions 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: de0af6442023254f759c5acc4edd0b4bf0709597 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=de0af6442023254f759c5acc4edd0b4bf0709597 commit de0af6442023254f759c5acc4edd0b4bf0709597 Author: Cy Schubert AuthorDate: 2021-11-09 00:16:46 +0000 Commit: Cy Schubert CommitDate: 2021-11-21 01:30:49 +0000 wpa: Remove duplicate options definitions Global options are defined in usr.sbin/wpa/Makefile.inc. Those in usr.sbin/wpa/src/crypto/Makefile are duplicates of those found above. Remove them. (cherry picked from commit 3332f1b444d4a73238e9f59cca27bfc95fe936bd) --- usr.sbin/wpa/src/crypto/Makefile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index c95834279c21..eede671aa7db 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -139,20 +139,6 @@ SRCS+= dh_groups.c .endif .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" -CFLAGS+=-DCONFIG_WPS \ - -DCONFIG_HS20 \ - -DCONFIG_INTERWORKING \ - -DEAP_GTC \ - -DEAP_LEAP \ - -DEAP_MD5 \ - -DEAP_MSCHAPv2 \ - -DEAP_OTP \ - -DEAP_PEAP \ - -DEAP_PSK \ - -DEAP_TLS \ - -DEAP_TTLS \ - -DEAP_WSC \ - -DIEEE8021X_EAPOL SRCS+= ms_funcs.c .endif From nobody Sun Nov 21 01:31:26 2021 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 42DFC18A8446; Sun, 21 Nov 2021 01:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxXtQ3qWqz3Jqh; Sun, 21 Nov 2021 01:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E9C1266AB; Sun, 21 Nov 2021 01:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AL1VQOc034081; Sun, 21 Nov 2021 01:31:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AL1VQgF034080; Sun, 21 Nov 2021 01:31:26 GMT (envelope-from git) Date: Sun, 21 Nov 2021 01:31:26 GMT Message-Id: <202111210131.1AL1VQgF034080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9ed6f73bfba3 - stable/13 - Revert "wpa: Fix WITHOUT_CRYPT 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ed6f73bfba3dac47252e905bee8a81c90f7124b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9ed6f73bfba3dac47252e905bee8a81c90f7124b commit 9ed6f73bfba3dac47252e905bee8a81c90f7124b Author: Cy Schubert AuthorDate: 2021-11-09 22:17:01 +0000 Commit: Cy Schubert CommitDate: 2021-11-21 01:30:49 +0000 Revert "wpa: Fix WITHOUT_CRYPT build" This reverts commit a30e8044aa4753858c189f3384dae2b2f25a150b. WITHOUT_OPENSSL build is a subset of WITHOUT_CRYPT build. It was incorrect to label this patch as fixing WITHOUT_CRYPT when in fact it fixes WITHOUT_OPENSSL. The build failure will be addressed in a fix for WITHOUT_OPENSSL build. (cherry picked from commit 96e2ac9c48baae6a352eb5574af87f81e01ff021) --- usr.sbin/wpa/Makefile.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index e43a6f539d92..915b5312f02f 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -56,6 +56,7 @@ CFLAGS+=-DCONFIG_TDLS CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF CFLAGS+=-DCONFIG_TLS=openssl CFLAGS+=-DCONFIG_MATCH_IFACE +CFLAGS+=-DCONFIG_PASN CFLAGS+=-DCONFIG_PTKSA_CACHE CFLAGS+=-DEAP_SERVER CFLAGS+=-DEAP_SERVER_GTC @@ -90,10 +91,6 @@ NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif -.if ${MK_CRYPT} != "no" -CFLAGS+=-DCONFIG_PASN -.endif - .if !empty(CFLAGS:M*-DEAP_AKA) NEED_SIM_COMMON=y NEED_AES_CBC=y From nobody Sun Nov 21 01:31:27 2021 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 BD47D18A84D1; Sun, 21 Nov 2021 01:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxXtR63Whz3KCS; Sun, 21 Nov 2021 01:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44A1026619; Sun, 21 Nov 2021 01:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AL1VRM8034105; Sun, 21 Nov 2021 01:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AL1VReo034104; Sun, 21 Nov 2021 01:31:27 GMT (envelope-from git) Date: Sun, 21 Nov 2021 01:31:27 GMT Message-Id: <202111210131.1AL1VReo034104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c2ab6e36ec1d - stable/13 - wpa: Fix WITHOUT_OPENSSL 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2ab6e36ec1d5eac86fea8dbe3b5ebf2300f6f76 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c2ab6e36ec1d5eac86fea8dbe3b5ebf2300f6f76 commit c2ab6e36ec1d5eac86fea8dbe3b5ebf2300f6f76 Author: Cy Schubert AuthorDate: 2021-11-09 22:52:44 +0000 Commit: Cy Schubert CommitDate: 2021-11-21 01:30:49 +0000 wpa: Fix WITHOUT_OPENSSL build PR: 259517 Reported by: emaste, FreeBSD Build Option Survey https://callfortesting.org/results/bos-2021-11-04/ Fixes: c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 (cherry picked from commit ba5de3c2b3b84fd547ddcc0e678a013e5df87db1) --- usr.sbin/wpa/Makefile.inc | 5 ++++- usr.sbin/wpa/src/tls/Makefile | 9 +++++---- usr.sbin/wpa/wpa_supplicant/Makefile | 5 ++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 915b5312f02f..5c5a6b403225 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -56,7 +56,6 @@ CFLAGS+=-DCONFIG_TDLS CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF CFLAGS+=-DCONFIG_TLS=openssl CFLAGS+=-DCONFIG_MATCH_IFACE -CFLAGS+=-DCONFIG_PASN CFLAGS+=-DCONFIG_PTKSA_CACHE CFLAGS+=-DEAP_SERVER CFLAGS+=-DEAP_SERVER_GTC @@ -91,6 +90,10 @@ NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif +.if ${MK_OPENSSL} != "no" +CFLAGS+=-DCONFIG_PASN +.endif + .if !empty(CFLAGS:M*-DEAP_AKA) NEED_SIM_COMMON=y NEED_AES_CBC=y diff --git a/usr.sbin/wpa/src/tls/Makefile b/usr.sbin/wpa/src/tls/Makefile index e5fdf96444d6..fbb57b9c4c10 100644 --- a/usr.sbin/wpa/src/tls/Makefile +++ b/usr.sbin/wpa/src/tls/Makefile @@ -29,13 +29,14 @@ SRCS+= asn1.c \ tlsv1_server_read.c \ tlsv1_server_write.c \ x509v3.c -.endif -.endif CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ - -DCONFIG_CRYPTO_INTERNAL \ - -DCONFIG_TLSV11 \ + -DCONFIG_CRYPTO_INTERNAL +.else +CFLAGS+=-DCONFIG_TLSV11 \ -DCONFIG_TLSV12 +.endif +.endif # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 8e7edfcf7720..fb045f804977 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -27,7 +27,6 @@ SRCS= bss.c \ notify.c \ op_classes.c \ offchannel.c \ - pasn_supplicant.c \ robust_av.c \ rrm.c \ scan.c \ @@ -37,6 +36,10 @@ SRCS= bss.c \ wpa_supplicant.c \ wpas_glue.c +.if ${MK_OPENSSL} != "no" +SRCS+= pasn_supplicant.c +.endif + MAN= wpa_supplicant.8 wpa_supplicant.conf.5 .if ${MK_EXAMPLES} != "no" From nobody Sun Nov 21 01:31:28 2021 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 2954F18A83F4; Sun, 21 Nov 2021 01:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxXtS72PRz3Jc7; Sun, 21 Nov 2021 01:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D94E26521; Sun, 21 Nov 2021 01:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AL1VSX6034131; Sun, 21 Nov 2021 01:31:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AL1VSl5034130; Sun, 21 Nov 2021 01:31:28 GMT (envelope-from git) Date: Sun, 21 Nov 2021 01:31:28 GMT Message-Id: <202111210131.1AL1VSl5034130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: ec9a2f80fcc7 - stable/13 - wpa: Fix WITHOUT_WPA_SUPPLICANT_EAPOL 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ec9a2f80fcc7d7b74f6ac50f4e36933e437e15ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ec9a2f80fcc7d7b74f6ac50f4e36933e437e15ee commit ec9a2f80fcc7d7b74f6ac50f4e36933e437e15ee Author: Cy Schubert AuthorDate: 2021-11-10 03:05:03 +0000 Commit: Cy Schubert CommitDate: 2021-11-21 01:30:49 +0000 wpa: Fix WITHOUT_WPA_SUPPLICANT_EAPOL build Reported by: FreeBSD Build Option Survey https://callfortesting.org/results/bos-2021-11-04/ Fixes: c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 (cherry picked from commit c9516b83c14f2dcec57bd175e418c152a0cec947) --- usr.sbin/wpa/Makefile.inc | 12 ++++++------ usr.sbin/wpa/src/ap/Makefile | 9 ++++++--- usr.sbin/wpa/src/crypto/Makefile | 2 -- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 5c5a6b403225..5ce7dee4d2c5 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -42,11 +42,6 @@ CFLAGS+=-DCONFIG_IEEE80211R CFLAGS+=-DCONFIG_IEEE80211W CFLAGS+=-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" CFLAGS+=-DCONFIG_DEBUG_SYSLOG -CFLAGS+=-DCONFIG_WPS -CFLAGS+=-DCONFIG_WPS2 -CFLAGS+=-DCONFIG_WPS_UPNP -CFLAGS+=-DCONFIG_WPS_OOB -CFLAGS+=-DCONFIG_INTERWORKING CFLAGS+=-DPKCS12_FUNCS CFLAGS+=-DCONFIG_GAS CFLAGS+=-DCONFIG_PEERKEY @@ -84,7 +79,12 @@ CFLAGS+=-DCONFIG_HS20 \ -DEAP_TLS \ -DEAP_TTLS \ -DEAP_WSC \ - -DIEEE8021X_EAPOL + -DIEEE8021X_EAPOL \ + -DCONFIG_INTERWORKING \ + -DCONFIG_WPS \ + -DCONFIG_WPS2 \ + -DCONFIG_WPS_UPNP \ + -DCONFIG_WPS_OOB NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile index 162b8b5444aa..801f45fca8a6 100644 --- a/usr.sbin/wpa/src/ap/Makefile +++ b/usr.sbin/wpa/src/ap/Makefile @@ -20,9 +20,7 @@ SRCS= accounting.c \ dfs.c \ drv_callbacks.c \ eap_user_db.c \ - gas_serv.c \ hostapd.c \ - hs20.c \ ieee802_11_auth.c \ ieee802_11_ht.c \ ieee802_11_shared.c \ @@ -43,8 +41,13 @@ SRCS= accounting.c \ wnm_ap.c \ wpa_auth.c \ wpa_auth_glue.c \ - wpa_auth_ie.c \ + wpa_auth_ie.c + +.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" +SRCS+= gas_serv.c \ + hs20.c \ wps_hostapd.c +.endif CFLAGS+=-DHOSTAPD diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index eede671aa7db..d71b740bb816 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -138,9 +138,7 @@ SRCS+= dh_group5.c SRCS+= dh_groups.c .endif -.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" SRCS+= ms_funcs.c -.endif CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_TLS_INTERNAL_CLIENT \ From nobody Sun Nov 21 10:04:18 2021 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 AAA9D189D9B5; Sun, 21 Nov 2021 10:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxmGB1q6Fz3rYY; Sun, 21 Nov 2021 10:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AE5356AA; Sun, 21 Nov 2021 10:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALA4Ina017171; Sun, 21 Nov 2021 10:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALA4I2g017170; Sun, 21 Nov 2021 10:04:18 GMT (envelope-from git) Date: Sun, 21 Nov 2021 10:04:18 GMT Message-Id: <202111211004.1ALA4I2g017170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: ad235cff36a1 - stable/12 - camcontrol: dump received data for MMC command even if it is unknown 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ad235cff36a132bb21a9cef78afcabb1a14140e7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ad235cff36a132bb21a9cef78afcabb1a14140e7 commit ad235cff36a132bb21a9cef78afcabb1a14140e7 Author: Andriy Gapon AuthorDate: 2021-11-06 10:23:55 +0000 Commit: Andriy Gapon CommitDate: 2021-11-21 10:02:51 +0000 camcontrol: dump received data for MMC command even if it is unknown For example, EXT_CSD can be read like this: # camcontrol mmcsdcmd 2:0:0 -c 8 -a 0 -f 0x35 -l 512 CMD 8 arg 0 flags 35 MMCIO: error 0, 00000900 00000000 00000000 00000000 No command-specific decoder for CMD 8 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0010 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |9...............| ... 0100 00 00 00 00 00 00 00 00 01 08 00 01 02 02 00 00 |................| ... 01e0 00 00 00 00 00 00 00 00 00 81 c7 00 00 01 03 07 |................| 01f0 05 00 03 01 3f 3f 01 01 01 00 00 00 00 00 00 00 |....??..........| (cherry picked from commit c01a46d4acab923961dfb7e4605b9ca6e775e616) --- sbin/camcontrol/camcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 0b8b9e57fb43..a6cadfd20978 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -8118,6 +8118,8 @@ mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, break; default: printf("No command-specific decoder for CMD %d\n", mmc_opcode); + if (mmc_data_len > 0) + hexdump(mmc_data, mmc_data_len, NULL, 0); } } mmccmd_bailout: From nobody Sun Nov 21 10:05:42 2021 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 28CDC189F38F; Sun, 21 Nov 2021 10:05:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxmHq0bS7z3srt; Sun, 21 Nov 2021 10:05:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9B10581C; Sun, 21 Nov 2021 10:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALA5gox017388; Sun, 21 Nov 2021 10:05:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALA5g7L017387; Sun, 21 Nov 2021 10:05:42 GMT (envelope-from git) Date: Sun, 21 Nov 2021 10:05:42 GMT Message-Id: <202111211005.1ALA5g7L017387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: ee82e15cd9fc - stable/13 - pcf8574: driver for 8-pin quasi-bidirectional GPIO over I2C 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee82e15cd9fc8387c06295bc59839ab0cf2f8e10 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ee82e15cd9fc8387c06295bc59839ab0cf2f8e10 commit ee82e15cd9fc8387c06295bc59839ab0cf2f8e10 Author: Andriy Gapon AuthorDate: 2020-10-01 09:48:56 +0000 Commit: Andriy Gapon CommitDate: 2021-11-21 09:59:34 +0000 pcf8574: driver for 8-pin quasi-bidirectional GPIO over I2C (cherry picked from commit 6354154ef520d359492badf0de9c8ae5d7080ae7) --- share/man/man4/Makefile | 1 + share/man/man4/pcf8574.4 | 98 +++++++++ sys/conf/files | 1 + sys/dev/iicbus/gpio/pcf8574.c | 425 +++++++++++++++++++++++++++++++++++++++ sys/modules/i2c/Makefile | 1 + sys/modules/i2c/pcf8574/Makefile | 18 ++ 6 files changed, 544 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index f5aaa2b616a6..e8c0a5651ff8 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -425,6 +425,7 @@ MAN= aac.4 \ pccard.4 \ pccbb.4 \ pcf.4 \ + pcf8574.4 \ pcf8591.4 \ ${_pchtherm.4} \ pci.4 \ diff --git a/share/man/man4/pcf8574.4 b/share/man/man4/pcf8574.4 new file mode 100644 index 000000000000..9fdf71874063 --- /dev/null +++ b/share/man/man4/pcf8574.4 @@ -0,0 +1,98 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Andriy Gapon +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 6, 2021 +.Dt PCF8574 4 +.Os +.Sh NAME +.Nm pcf8574 +.Nd driver for the PCF8574 8-bit I2C IO expander +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pcf8574" +.Cd "device gpio" +.Cd "device iicbus" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +pcf8574_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr gpiobus 4 +control over 8 GPIO pins. +The pins are quasi-bidirectional. +Only low output can be actively driven. +High output is equivalent to input. +.Pp +On an +.Xr FDT 4 +based system the following properties must be set: +.Bl -tag -width "compatible" +.It Va compatible +Must be set to "nxp,pcf8574". +.It Va reg +The I2C address of +.Nm . +.El +.Pp +The DTS part for a +.Nm +device usually looks like: +.Bd -literal +/ { + + ... + pcf8574@27 { + compatible = "nxp,pcf8574"; + reg = <0x27>; + }; +}; +.Ed +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpiobus 4 , +.Xr iicbus 4 +.Sh HISTORY +The +.Nm +driver and this manual page was written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . +.Sh BUGS +The +.Nm +driver does not support the input change interrupt +that the hardware provides. diff --git a/sys/conf/files b/sys/conf/files index a9f67bcf46f7..5051a38b2997 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1886,6 +1886,7 @@ dev/iicbus/mux/iic_gpiomux.c optional iic_gpiomux fdt dev/iicbus/mux/ltc430x.c optional ltc430x dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus +dev/iicbus/pcf8574.c optional pcf8574 dev/iicbus/pcf8591.c optional pcf8591 dev/iicbus/rtc8583.c optional rtc8583 dev/iicbus/rtc/rx8803.c optional rx8803 iicbus fdt diff --git a/sys/dev/iicbus/gpio/pcf8574.c b/sys/dev/iicbus/gpio/pcf8574.c new file mode 100644 index 000000000000..6fa544ac3283 --- /dev/null +++ b/sys/dev/iicbus/gpio/pcf8574.c @@ -0,0 +1,425 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) Andriy Gapon + * + * 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. + * + */ + +/* + * Driver for PCF8574 / PCF8574A 8-bit I/O expander + * with quasi-bidirectional I/O. + * There is no separate mode / configuration register. + * Pins are set and queried via a single register. + * Because of that we have to maintain the state in the driver + * and assume that there is no outside meddling with the device. + * See the datasheet for details. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include + +#include + +#include "gpio_if.h" + +#define NUM_PINS 8 +#define PIN_CAPS (GPIO_PIN_OUTPUT | GPIO_PIN_INPUT) + +#define dbg_dev_printf(dev, fmt, args...) \ + if (bootverbose) device_printf(dev, fmt, ##args) + +struct pcf8574_softc { + device_t dev; + device_t busdev; + struct sx lock; + uint8_t addr; + uint8_t output_mask; + uint8_t output_state; +}; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + { "nxp,pcf8574", 1 }, + { "nxp,pcf8574a", 1 }, + { NULL, 0 } +}; +#endif + +static int +pcf8574_read(struct pcf8574_softc *sc, uint8_t *val) +{ + struct iic_msg msg; + int error; + + msg.slave = sc->addr; + msg.flags = IIC_M_RD; + msg.len = 1; + msg.buf = val; + + error = iicbus_transfer_excl(sc->dev, &msg, 1, IIC_WAIT); + return (iic2errno(error)); +} + +static int +pcf8574_write(struct pcf8574_softc *sc, uint8_t val) +{ + struct iic_msg msg; + int error; + + msg.slave = sc->addr; + msg.flags = IIC_M_WR; + msg.len = 1; + msg.buf = &val; + + error = iicbus_transfer_excl(sc->dev, &msg, 1, IIC_WAIT); + return (iic2errno(error)); +} + +static int +pcf8574_probe(device_t dev) +{ + +#ifdef FDT + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); +#endif + device_set_desc(dev, "PCF8574 I/O expander"); + return (BUS_PROBE_DEFAULT); +} + +static int +pcf8574_attach(device_t dev) +{ + struct pcf8574_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->addr = iicbus_get_addr(dev); + + /* Treat everything as input because there is no way to tell. */ + sc->output_mask = 0; + sc->output_state = 0xff; + + /* Put the device to a safe, known state. */ + (void)pcf8574_write(sc, 0xff); + + sx_init(&sc->lock, "pcf8574"); + sc->busdev = gpiobus_attach_bus(dev); + if (sc->busdev == NULL) { + device_printf(dev, "Could not create busdev child\n"); + sx_destroy(&sc->lock); + return (ENXIO); + } + return (0); +} + +static int +pcf8574_detach(device_t dev) +{ + struct pcf8574_softc *sc; + + sc = device_get_softc(dev); + + if (sc->busdev != NULL) + gpiobus_detach_bus(sc->busdev); + + sx_destroy(&sc->lock); + return (0); +} + +static device_t +pcf8574_get_bus(device_t dev) +{ + struct pcf8574_softc *sc; + + sc = device_get_softc(dev); + return (sc->busdev); +} + +static int +pcf8574_pin_max(device_t dev __unused, int *maxpin) +{ + *maxpin = NUM_PINS - 1; + return (0); +} + +static int +pcf8574_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + + if (pin >= NUM_PINS) + return (EINVAL); + *caps = PIN_CAPS; + return (0); +} + +static int +pcf8574_pin_getflags(device_t dev, uint32_t pin, uint32_t *pflags) +{ + struct pcf8574_softc *sc; + uint8_t val, stale; + int error; + + sc = device_get_softc(dev); + + if (pin >= NUM_PINS) + return (EINVAL); + + sx_xlock(&sc->lock); + error = pcf8574_read(sc, &val); + if (error != 0) { + dbg_dev_printf(dev, "failed to read from device: %d\n", + error); + sx_xunlock(&sc->lock); + return (error); + } + + /* + * Check for pins whose read value is one, but they are configured + * as outputs with low signal. This is an impossible combination, + * so change their view to be inputs. + */ + stale = val & sc->output_mask & ~sc->output_state; + sc->output_mask &= ~stale; + sc->output_state |= stale; + + if ((sc->output_mask & (1 << pin)) != 0) + *pflags = GPIO_PIN_OUTPUT; + else + *pflags = GPIO_PIN_INPUT; + sx_xunlock(&sc->lock); + + return (0); +} + +static int +pcf8574_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct pcf8574_softc *sc; + int error; + uint8_t val; + bool update_needed; + + sc = device_get_softc(dev); + + if (pin >= NUM_PINS) + return (EINVAL); + if ((flags & ~PIN_CAPS) != 0) + return (EINVAL); + + sx_xlock(&sc->lock); + if ((flags & GPIO_PIN_OUTPUT) != 0) { + sc->output_mask |= 1 << pin; + update_needed = false; + } else if ((flags & GPIO_PIN_INPUT) != 0) { + sc->output_mask &= ~(1 << pin); + sc->output_state |= 1 << pin; + update_needed = true; + } else { + KASSERT(false, ("both input and output modes requested")); + update_needed = false; + } + + if (update_needed) { + val = sc->output_state | ~sc->output_mask; + error = pcf8574_write(sc, val); + if (error != 0) + dbg_dev_printf(dev, "failed to write to device: %d\n", + error); + } + sx_xunlock(&sc->lock); + + return (0); +} + +static int +pcf8574_pin_getname(device_t dev, uint32_t pin, char *name) +{ + + if (pin >= NUM_PINS) + return (EINVAL); + snprintf(name, GPIOMAXNAME, "P%d", pin); + return (0); +} + +static int +pcf8574_pin_get(device_t dev, uint32_t pin, unsigned int *on) +{ + struct pcf8574_softc *sc; + uint8_t val; + int error; + + sc = device_get_softc(dev); + + sx_xlock(&sc->lock); + if ((sc->output_mask & (1 << pin)) != 0) { + *on = (sc->output_state & (1 << pin)) != 0; + sx_xunlock(&sc->lock); + return (0); + } + + error = pcf8574_read(sc, &val); + if (error != 0) { + dbg_dev_printf(dev, "failed to read from device: %d\n", error); + sx_xunlock(&sc->lock); + return (error); + } + sx_xunlock(&sc->lock); + + *on = (val & (1 << pin)) != 0; + return (0); +} + +static int +pcf8574_pin_set(device_t dev, uint32_t pin, unsigned int on) +{ + struct pcf8574_softc *sc; + uint8_t val; + int error; + + sc = device_get_softc(dev); + + if (pin >= NUM_PINS) + return (EINVAL); + + sx_xlock(&sc->lock); + + if ((sc->output_mask & (1 << pin)) == 0) { + sx_xunlock(&sc->lock); + return (EINVAL); + } + + /* + * Algorithm: + * - set all outputs to their recorded state; + * - set all inputs to the high state; + * - apply the requested change. + */ + val = sc->output_state | ~sc->output_mask; + val &= ~(1 << pin); + val |= (on != 0) << pin; + + error = pcf8574_write(sc, val); + if (error != 0) { + dbg_dev_printf(dev, "failed to write to device: %d\n", error); + sx_xunlock(&sc->lock); + return (error); + } + + /* + * NB: we can record anything as "output" state of input pins. + * By convention and for convenience it will be recorded as 1. + */ + sc->output_state = val; + sx_xunlock(&sc->lock); + return (0); +} + +static int +pcf8574_pin_toggle(device_t dev, uint32_t pin) +{ + struct pcf8574_softc *sc; + uint8_t val; + int error; + + sc = device_get_softc(dev); + + if (pin >= NUM_PINS) + return (EINVAL); + + sx_xlock(&sc->lock); + + if ((sc->output_mask & (1 << pin)) == 0) { + sx_xunlock(&sc->lock); + return (EINVAL); + } + + val = sc->output_state | ~sc->output_mask; + val ^= 1 << pin; + + error = pcf8574_write(sc, val); + if (error != 0) { + dbg_dev_printf(dev, "failed to write to device: %d\n", error); + sx_xunlock(&sc->lock); + return (error); + } + + sc->output_state = val; + sx_xunlock(&sc->lock); + return (0); +} + +static device_method_t pcf8574_methods[] = { + DEVMETHOD(device_probe, pcf8574_probe), + DEVMETHOD(device_attach, pcf8574_attach), + DEVMETHOD(device_detach, pcf8574_detach), + + /* GPIO methods */ + DEVMETHOD(gpio_get_bus, pcf8574_get_bus), + DEVMETHOD(gpio_pin_max, pcf8574_pin_max), + DEVMETHOD(gpio_pin_getcaps, pcf8574_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, pcf8574_pin_getflags), + DEVMETHOD(gpio_pin_setflags, pcf8574_pin_setflags), + DEVMETHOD(gpio_pin_getname, pcf8574_pin_getname), + DEVMETHOD(gpio_pin_get, pcf8574_pin_get), + DEVMETHOD(gpio_pin_set, pcf8574_pin_set), + DEVMETHOD(gpio_pin_toggle, pcf8574_pin_toggle), + + DEVMETHOD_END +}; + +static driver_t pcf8574_driver = { + "gpio", + pcf8574_methods, + sizeof(struct pcf8574_softc) +}; + +static devclass_t pcf8574_devclass; + +DRIVER_MODULE(pcf8574, iicbus, pcf8574_driver, pcf8574_devclass, 0, 0); +MODULE_DEPEND(pcf8574, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_DEPEND(pcf8574, gpiobus, 1, 1, 1); +MODULE_VERSION(pcf8574, 1); +#ifdef FDT +IICBUS_FDT_PNP_INFO(compat_data); +#endif diff --git a/sys/modules/i2c/Makefile b/sys/modules/i2c/Makefile index 483eb012bb95..9fea714975f7 100644 --- a/sys/modules/i2c/Makefile +++ b/sys/modules/i2c/Makefile @@ -21,6 +21,7 @@ SUBDIR = \ max44009 \ mux \ nxprtc \ + pcf8574 \ pcf8591 \ rtc8583 \ s35390a \ diff --git a/sys/modules/i2c/pcf8574/Makefile b/sys/modules/i2c/pcf8574/Makefile new file mode 100644 index 000000000000..7c4fe37297e4 --- /dev/null +++ b/sys/modules/i2c/pcf8574/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus/gpio/ +KMOD = pcf8574 +SRCS = pcf8574.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + gpio_if.h \ + iicbus_if.h \ + opt_platform.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif + +.include From nobody Sun Nov 21 10:05:43 2021 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 8DA05189EF7E; Sun, 21 Nov 2021 10:05:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxmHr2Kshz3ss2; Sun, 21 Nov 2021 10:05:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20106581D; Sun, 21 Nov 2021 10:05:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALA5hBb017418; Sun, 21 Nov 2021 10:05:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALA5hiB017417; Sun, 21 Nov 2021 10:05:43 GMT (envelope-from git) Date: Sun, 21 Nov 2021 10:05:43 GMT Message-Id: <202111211005.1ALA5hiB017417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 128a6d31f2dc - stable/13 - camcontrol: dump received data for MMC command even if it is unknown 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 128a6d31f2dc59a9869dd852ab2a2343406e53c6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=128a6d31f2dc59a9869dd852ab2a2343406e53c6 commit 128a6d31f2dc59a9869dd852ab2a2343406e53c6 Author: Andriy Gapon AuthorDate: 2021-11-06 10:23:55 +0000 Commit: Andriy Gapon CommitDate: 2021-11-21 10:00:42 +0000 camcontrol: dump received data for MMC command even if it is unknown For example, EXT_CSD can be read like this: # camcontrol mmcsdcmd 2:0:0 -c 8 -a 0 -f 0x35 -l 512 CMD 8 arg 0 flags 35 MMCIO: error 0, 00000900 00000000 00000000 00000000 No command-specific decoder for CMD 8 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0010 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |9...............| ... 0100 00 00 00 00 00 00 00 00 01 08 00 01 02 02 00 00 |................| ... 01e0 00 00 00 00 00 00 00 00 00 81 c7 00 00 01 03 07 |................| 01f0 05 00 03 01 3f 3f 01 01 01 00 00 00 00 00 00 00 |....??..........| (cherry picked from commit c01a46d4acab923961dfb7e4605b9ca6e775e616) --- sbin/camcontrol/camcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 27d545d924b3..35272bcdc8ed 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -8170,6 +8170,8 @@ mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, break; default: printf("No command-specific decoder for CMD %d\n", mmc_opcode); + if (mmc_data_len > 0) + hexdump(mmc_data, mmc_data_len, NULL, 0); } } mmccmd_bailout: From nobody Sun Nov 21 10:05:45 2021 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 3DDCB189F480; Sun, 21 Nov 2021 10:05:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxmHs5C85z3sl0; Sun, 21 Nov 2021 10:05:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34D9C56AD; Sun, 21 Nov 2021 10:05:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALA5jdA017443; Sun, 21 Nov 2021 10:05:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALA5jLp017442; Sun, 21 Nov 2021 10:05:45 GMT (envelope-from git) Date: Sun, 21 Nov 2021 10:05:45 GMT Message-Id: <202111211005.1ALA5jLp017442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 9d7c92dbb9bf - stable/13 - add rk3328 overlay for enabling analog sound 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d7c92dbb9bffae557d572c14eb43015e00b8259 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=9d7c92dbb9bffae557d572c14eb43015e00b8259 commit 9d7c92dbb9bffae557d572c14eb43015e00b8259 Author: Andriy Gapon AuthorDate: 2021-06-09 07:43:39 +0000 Commit: Andriy Gapon CommitDate: 2021-11-21 10:04:42 +0000 add rk3328 overlay for enabling analog sound (cherry picked from commit 00c06804a87c5ddbd91f188280331e3076c1b81c) --- sys/dts/arm64/overlays/rk3328-analog-sound.dtso | 12 ++++++++++++ sys/modules/dtb/rockchip/Makefile | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/dts/arm64/overlays/rk3328-analog-sound.dtso b/sys/dts/arm64/overlays/rk3328-analog-sound.dtso new file mode 100644 index 000000000000..c73635ce3b4e --- /dev/null +++ b/sys/dts/arm64/overlays/rk3328-analog-sound.dtso @@ -0,0 +1,12 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "rockchip,rk3328"; +}; + +&{/analog-sound} { + status = "okay"; +}; + +/* vim: set ft=dts: */ diff --git a/sys/modules/dtb/rockchip/Makefile b/sys/modules/dtb/rockchip/Makefile index 20df656bd148..7722a56df023 100644 --- a/sys/modules/dtb/rockchip/Makefile +++ b/sys/modules/dtb/rockchip/Makefile @@ -15,7 +15,8 @@ DTS= \ rockchip/rk3399-firefly.dts \ rockchip/rk3399-rockpro64.dts -DTSO= rk3328-dwc3.dtso \ +DTSO= rk3328-analog-sound.dtso \ + rk3328-dwc3.dtso \ rk3399-mmc0-disable.dtso \ rk3399-mmc1-disable.dtso \ rk3399-sdhci-disable.dtso From nobody Sun Nov 21 10:05:46 2021 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 486DD189F32D; Sun, 21 Nov 2021 10:05:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxmHt54Mtz3ssC; Sun, 21 Nov 2021 10:05:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62BD757D6; Sun, 21 Nov 2021 10:05:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALA5kFi017467; Sun, 21 Nov 2021 10:05:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALA5kam017466; Sun, 21 Nov 2021 10:05:46 GMT (envelope-from git) Date: Sun, 21 Nov 2021 10:05:46 GMT Message-Id: <202111211005.1ALA5kam017466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 1f39ef9fa810 - stable/13 - rk805: add system poweroff support 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f39ef9fa810201e64f2f1fcd306d6d991bfc58b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=1f39ef9fa810201e64f2f1fcd306d6d991bfc58b commit 1f39ef9fa810201e64f2f1fcd306d6d991bfc58b Author: Andriy Gapon AuthorDate: 2021-11-06 17:58:43 +0000 Commit: Andriy Gapon CommitDate: 2021-11-21 10:05:18 +0000 rk805: add system poweroff support On my Rock64 neither EFI nor PSCI shutdown actually power off the board. RK805 does the job. (cherry picked from commit cc0b35259aed73747721718415fa1854108a276a) --- sys/arm64/rockchip/rk805.c | 36 ++++++++++++++++++++++++++++++++++++ sys/arm64/rockchip/rk805reg.h | 4 ++++ 2 files changed, 40 insertions(+) diff --git a/sys/arm64/rockchip/rk805.c b/sys/arm64/rockchip/rk805.c index d3e04081aeb2..39755fa5ce87 100644 --- a/sys/arm64/rockchip/rk805.c +++ b/sys/arm64/rockchip/rk805.c @@ -31,8 +31,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -737,6 +739,29 @@ rk805_settime(device_t dev, struct timespec *ts) return (error); } +static void +rk805_poweroff(void *arg, int howto) +{ + device_t dev = arg; + int error; + uint8_t val; + + if ((howto & RB_POWEROFF) == 0) + return; + + device_printf(dev, "Powering off...\n"); + error = rk805_read(dev, RK805_DEV_CTRL, &val, 1); + if (error == 0) { + val |= RK805_DEV_CTRL_OFF; + error = rk805_write(dev, RK805_DEV_CTRL, &val, 1); + + /* Wait a bit for the command to take effect. */ + if (error == 0) + DELAY(100); + } + device_printf(dev, "Power off failed\n"); +} + static int rk805_attach(device_t dev) { @@ -797,6 +822,17 @@ rk805_attach(device_t dev) } } + if (OF_hasprop(ofw_bus_get_node(dev), + "rockchip,system-power-controller")) { + /* + * The priority is chosen to override PSCI and EFI shutdown + * methods as those two just hang without powering off on Rock64 + * at least. + */ + EVENTHANDLER_REGISTER(shutdown_final, rk805_poweroff, dev, + SHUTDOWN_PRI_LAST - 2); + } + return (0); } diff --git a/sys/arm64/rockchip/rk805reg.h b/sys/arm64/rockchip/rk805reg.h index b1f4481a5b68..61c6f49abd2c 100644 --- a/sys/arm64/rockchip/rk805reg.h +++ b/sys/arm64/rockchip/rk805reg.h @@ -93,6 +93,10 @@ #define RK808_LDO8_ON_VSEL 0x49 #define RK808_LDO8_SLEEP_VSEL 0x4A +#define RK805_DEV_CTRL 0x4B +#define RK805_DEV_CTRL_OFF (1 << 0) +#define RK805_DEV_CTRL_SLP (1 << 1) + enum rk805_regulator { RK805_DCDC1 = 0, RK805_DCDC2, From nobody Sun Nov 21 16:03:18 2021 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 3E4DE189ACFD; Sun, 21 Nov 2021 16:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxwDR1FF4z3m6W; Sun, 21 Nov 2021 16:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026A91262E; Sun, 21 Nov 2021 16:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALG3IND095824; Sun, 21 Nov 2021 16:03:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALG3ILj095823; Sun, 21 Nov 2021 16:03:18 GMT (envelope-from git) Date: Sun, 21 Nov 2021 16:03:18 GMT Message-Id: <202111211603.1ALG3ILj095823@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: 529957726679 - stable/13 - nfsd: Fix the NFSv4 pNFS MDS server for DS NFSERR_NOSPC 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 5299577266790d1da58db29ada5082550287ce55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5299577266790d1da58db29ada5082550287ce55 commit 5299577266790d1da58db29ada5082550287ce55 Author: Rick Macklem AuthorDate: 2021-11-07 19:43:03 +0000 Commit: Rick Macklem CommitDate: 2021-11-21 15:59:49 +0000 nfsd: Fix the NFSv4 pNFS MDS server for DS NFSERR_NOSPC If a pNFS server's DS runs out of disk space, it replies NFSERR_NOSPC to the client doing writing. For the Linux client, it then sends a LayoutError RPC to the server to tell it about the error and keeps retrying, doing repeated LayoutGet and Write RPCs to the DS. The Linux client is "stuck" until disk space on the DS is free'd up. For a mirrored server configuration, the first mirror that ran out of space was taken offline. This does not make much sense, since the other mirror(s) will run out of space soon and the fix is a manual cleanup up disk space. This patch changes the pNFS server to not disable a mirror for the mirrored case when this occurs. Further work is needed, since the Linux client expects the MDS to reply NFSERR_NOSPC to LayoutGets once the DS is out of space. Without this further change, the above mentioned looping occurs. Found during a recent IEFT NFSv4 working group testing event. (cherry picked from commit a7e014eee5d47d6eb13bc98c71e65d00a6de8ed3) --- sys/fs/nfsserver/nfs_nfsdserv.c | 7 ++++--- sys/fs/nfsserver/nfs_nfsdstate.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 7ca766c99069..0e447778d639 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -5046,10 +5046,11 @@ nfsrvd_layouterror(struct nfsrv_descript *nd, __unused int isdgram, opnum = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "nfsrvd_layouterr op=%d stat=%d\n", opnum, stat); /* - * Except for NFSERR_ACCES and NFSERR_STALE errors, - * disable the mirror. + * Except for NFSERR_ACCES, NFSERR_STALE and NFSERR_NOSPC + * errors, disable the mirror. */ - if (stat != NFSERR_ACCES && stat != NFSERR_STALE) + if (stat != NFSERR_ACCES && stat != NFSERR_STALE && + stat != NFSERR_NOSPC) nfsrv_delds(devid, curthread); } nfsmout: diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 750eda2027ec..797b9b0a466e 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -7009,10 +7009,11 @@ nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_t *layp, int maxcnt, NFSD_DEBUG(4, "flexlayouterr op=%d stat=%d\n", opnum, stat); /* - * Except for NFSERR_ACCES and NFSERR_STALE errors, - * disable the mirror. + * Except for NFSERR_ACCES, NFSERR_STALE and + * NFSERR_NOSPC errors, disable the mirror. */ - if (stat != NFSERR_ACCES && stat != NFSERR_STALE) + if (stat != NFSERR_ACCES && stat != NFSERR_STALE && + stat != NFSERR_NOSPC) nfsrv_delds(devid, p); } } From nobody Sun Nov 21 18:04:48 2021 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 62282188FFCE; Sun, 21 Nov 2021 18:04:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hxywd2Mxdz4vZv; Sun, 21 Nov 2021 18:04:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E40C13867; Sun, 21 Nov 2021 18:04:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALI4m0N055458; Sun, 21 Nov 2021 18:04:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALI4mqh055457; Sun, 21 Nov 2021 18:04:48 GMT (envelope-from git) Date: Sun, 21 Nov 2021 18:04:48 GMT Message-Id: <202111211804.1ALI4mqh055457@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: 43040454e985 - releng/12.3 - libarchive: cherry-pick bugfix from vendor 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 43040454e985c8c8e1269f2a736bc174d79de3c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=43040454e985c8c8e1269f2a736bc174d79de3c5 commit 43040454e985c8c8e1269f2a736bc174d79de3c5 Author: Martin Matuska AuthorDate: 2021-11-17 21:21:19 +0000 Commit: Martin Matuska CommitDate: 2021-11-21 18:03:56 +0000 libarchive: cherry-pick bugfix from vendor Vendor commit message (ede459d2e): archive_write_disk_posix: fix writing fflags broken in 8a1bd5c The fixup list was erroneously assumed to be directories only. Only in the case of critical file flags modification (e.g. SF_IMMUTABLE on BSD systems), other file types (e.g. regular files or symbolic links) may be added to the fixup list. We still need to verify that we are writing to the correct file type, so compare the archive entry file type with the file type of the file to be modified. Fixes vendor issue #1617: Immutable flag no longer preserved during tar extraction on FreeBSD Approved by: re (gjb) Reported by: markj Libarchive commit: ede459d2ebb879f5eedb6f7abea203be0b334230 (cherry picked from commit 201d0ebee321fb1a5501e17a4f150aa211020c5c) (cherry picked from commit f2b106ec4e5a8488883c58480cf576d18010d263) --- .../libarchive/archive_write_disk_posix.c | 87 +++++++++++++++++++--- 1 file changed, 75 insertions(+), 12 deletions(-) diff --git a/contrib/libarchive/libarchive/archive_write_disk_posix.c b/contrib/libarchive/libarchive/archive_write_disk_posix.c index a554679bfd10..1aa00840bf4c 100644 --- a/contrib/libarchive/libarchive/archive_write_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_write_disk_posix.c @@ -173,6 +173,7 @@ struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; mode_t mode; + __LA_MODE_T filetype; int64_t atime; int64_t birthtime; int64_t mtime; @@ -357,6 +358,7 @@ struct archive_write_disk { static int la_opendirat(int, const char *); static int la_mktemp(struct archive_write_disk *); +static int la_verify_filetype(mode_t, __LA_MODE_T); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -464,6 +466,39 @@ la_opendirat(int fd, const char *path) { #endif } +static int +la_verify_filetype(mode_t mode, __LA_MODE_T filetype) { + int ret = 0; + + switch (filetype) { + case AE_IFREG: + ret = (S_ISREG(mode)); + break; + case AE_IFDIR: + ret = (S_ISDIR(mode)); + break; + case AE_IFLNK: + ret = (S_ISLNK(mode)); + break; + case AE_IFSOCK: + ret = (S_ISSOCK(mode)); + break; + case AE_IFCHR: + ret = (S_ISCHR(mode)); + break; + case AE_IFBLK: + ret = (S_ISBLK(mode)); + break; + case AE_IFIFO: + ret = (S_ISFIFO(mode)); + break; + default: + break; + } + + return (ret); +} + static int lazy_stat(struct archive_write_disk *a) { @@ -822,6 +857,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_MODE_BASE; fe->mode = a->mode; } @@ -832,6 +868,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mode = a->mode; fe->fixup |= TODO_TIMES; if (archive_entry_atime_is_set(entry)) { @@ -865,6 +902,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_ACLS; archive_acl_copy(&fe->acl, archive_entry_acl(entry)); } @@ -877,6 +915,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { memcpy(fe->mac_metadata, metadata, @@ -891,6 +930,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) fe = current_fixup(a, archive_entry_pathname(entry)); if (fe == NULL) return (ARCHIVE_FATAL); + fe->filetype = archive_entry_filetype(entry); fe->fixup |= TODO_FFLAGS; /* TODO: Complete this.. defer fflags from below. */ } @@ -2463,7 +2503,7 @@ _archive_write_disk_close(struct archive *_a) struct fixup_entry *next, *p; struct stat st; char *c; - int fd, ret; + int fd, ret, openflags; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2490,32 +2530,53 @@ _archive_write_disk_close(struct archive *_a) if (p->fixup == 0) goto skip_fixup_entry; else { - fd = open(p->name, O_BINARY | O_NOFOLLOW | O_RDONLY + /* + * We need to verify if the type of the file + * we are going to open matches the file type + * of the fixup entry. + */ + openflags = O_BINARY | O_NOFOLLOW | O_RDONLY + | O_CLOEXEC; #if defined(O_DIRECTORY) - | O_DIRECTORY + if (p->filetype == AE_IFDIR) + openflags |= O_DIRECTORY; #endif - | O_CLOEXEC); + fd = open(p->name, openflags); + +#if defined(O_DIRECTORY) /* - ` * If we don't support O_DIRECTORY, - * or open() has failed, we must stat() - * to verify that we are opening a directory + * If we support O_DIRECTORY and open was + * successful we can skip the file type check + * for directories. For other file types + * we need to verify via fstat() or lstat() */ -#if defined(O_DIRECTORY) - if (fd == -1) { + if (fd == -1 || p->filetype != AE_IFDIR) { +#if HAVE_FSTAT + if (fd > 0 && ( + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { + goto skip_fixup_entry; + } else +#endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } } #else #if HAVE_FSTAT if (fd > 0 && ( - fstat(fd, &st) != 0 || !S_ISDIR(st.st_mode))) { + fstat(fd, &st) != 0 || + la_verify_filetype(st.st_mode, + p->filetype) == 0)) { goto skip_fixup_entry; } else #endif if (lstat(p->name, &st) != 0 || - !S_ISDIR(st.st_mode)) { + la_verify_filetype(st.st_mode, + p->filetype) == 0) { goto skip_fixup_entry; } #endif @@ -2689,6 +2750,7 @@ new_fixup(struct archive_write_disk *a, const char *pathname) fe->next = a->fixup_list; a->fixup_list = fe; fe->fixup = 0; + fe->filetype = 0; fe->name = strdup(pathname); return (fe); } @@ -3811,6 +3873,7 @@ set_fflags(struct archive_write_disk *a) le = current_fixup(a, a->name); if (le == NULL) return (ARCHIVE_FATAL); + le->filetype = archive_entry_filetype(a->entry); le->fixup |= TODO_FFLAGS; le->fflags_set = set; /* Store the mode if it's not already there. */ From nobody Sun Nov 21 18:20:38 2021 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 6365E1897B4E; Sun, 21 Nov 2021 18:20:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxzGt2DTxz3G52; Sun, 21 Nov 2021 18:20:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B2C0140D1; Sun, 21 Nov 2021 18:20:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALIKcHN077026; Sun, 21 Nov 2021 18:20:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALIKcUb077024; Sun, 21 Nov 2021 18:20:38 GMT (envelope-from git) Date: Sun, 21 Nov 2021 18:20:38 GMT Message-Id: <202111211820.1ALIKcUb077024@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: 111619ff70f0 - stable/13 - LinuxKPI: add bcd.h 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 111619ff70f081f244336bfb82cba71b59551d60 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=111619ff70f081f244336bfb82cba71b59551d60 commit 111619ff70f081f244336bfb82cba71b59551d60 Author: Bjoern A. Zeeb AuthorDate: 2021-10-25 18:14:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-21 18:15:58 +0000 LinuxKPI: add bcd.h Add bcd2bin() in bcd.h. Libkern does provide a bcd2bin() which cannot be used cirectly leaving us with a conflict (see comment in file). Rather than having code to re-define bcd2bin() for the LinuxKPI make sure libkern.h is always included before the LinuxKPI version. Then only re-define our local LinuxKPI implementation. [1] From the argument truncating wrapper call the libkern version. If we change our libkern implementation in the future we can save us the remainder of the hassle. [2]. Suggested by: Johannes Berg (johannes sipsolutions.net) [1] Suggested by: ian [2] Sponsored by: The FreeBSD Foundation (cherry picked from commit 548ada00e54a9e7745d041b1ec7f68f3bd493365) (cherry picked from commit ae2268efd5f8aaa6aba27dfc4e34b3225f211901) --- sys/compat/linuxkpi/common/include/linux/bcd.h | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/bcd.h b/sys/compat/linuxkpi/common/include/linux/bcd.h new file mode 100644 index 000000000000..8a40da1a330b --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/bcd.h @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_BCD_H +#define _LINUXKPI_LINUX_BCD_H + +#include +#include + +/* Compared to the libkern version this one truncates the argument. */ +static inline uint8_t linuxkpi_bcd2bin(uint8_t x) +{ + + return (bcd2bin(x)); +} + +#define bcd2bin(_x) linuxkpi_bcd2bin(_x) + +#endif /* _LINUXKPI_LINUX_BCD_H */ From nobody Mon Nov 22 00:32:35 2021 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 2568F18A97F6; Mon, 22 Nov 2021 00:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy7X407CTz4VfD; Mon, 22 Nov 2021 00:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D83471941E; Mon, 22 Nov 2021 00:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM0WZ90084661; Mon, 22 Nov 2021 00:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM0WZe9084660; Mon, 22 Nov 2021 00:32:35 GMT (envelope-from git) Date: Mon, 22 Nov 2021 00:32:35 GMT Message-Id: <202111220032.1AM0WZe9084660@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: cf09094e3983 - stable/13 - growfs: do not error if filesystem is already requested size 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: cf09094e3983298ee8f69a0011012e55e71fde30 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cf09094e3983298ee8f69a0011012e55e71fde30 commit cf09094e3983298ee8f69a0011012e55e71fde30 Author: Ed Maste AuthorDate: 2021-11-15 20:37:34 +0000 Commit: Ed Maste CommitDate: 2021-11-22 00:30:18 +0000 growfs: do not error if filesystem is already requested size For some cloud/virtualization use cases it can be convenient to grow the filesystem on boot any time the disk/partition happens to be larger, but not fail if it remains the same size. Continue to emit a message if we have no action to take, but exit with status 0 if the size remains the same. Reviewed by: trasz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32856 (cherry picked from commit 3f9acedb020b4bcac850eee8a60c75e0880d3e3f) --- sbin/growfs/growfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 510192dada0b..1f1bcf82c965 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1503,7 +1503,10 @@ main(int argc, char **argv) humanize_number(newsizebuf, sizeof(newsizebuf), size, "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - errx(1, "requested size %s is not larger than the current " + if (size == (uint64_t)(osblock.fs_size * osblock.fs_fsize)) + errx(0, "requested size %s is equal to the current " + "filesystem size %s", newsizebuf, oldsizebuf); + errx(1, "requested size %s is smaller than the current " "filesystem size %s", newsizebuf, oldsizebuf); } From nobody Mon Nov 22 00:33:42 2021 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 051DA18A9B30; Mon, 22 Nov 2021 00:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy7YL6kv4z4WWm; Mon, 22 Nov 2021 00:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C72411941F; Mon, 22 Nov 2021 00:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM0XgBC084897; Mon, 22 Nov 2021 00:33:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM0Xg0c084896; Mon, 22 Nov 2021 00:33:42 GMT (envelope-from git) Date: Mon, 22 Nov 2021 00:33:42 GMT Message-Id: <202111220033.1AM0Xg0c084896@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: 11f45b8f8009 - stable/12 - growfs: do not error if filesystem is already requested size 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 11f45b8f800975e0484940430b988b2006caf1e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=11f45b8f800975e0484940430b988b2006caf1e4 commit 11f45b8f800975e0484940430b988b2006caf1e4 Author: Ed Maste AuthorDate: 2021-11-15 20:37:34 +0000 Commit: Ed Maste CommitDate: 2021-11-22 00:33:15 +0000 growfs: do not error if filesystem is already requested size For some cloud/virtualization use cases it can be convenient to grow the filesystem on boot any time the disk/partition happens to be larger, but not fail if it remains the same size. Continue to emit a message if we have no action to take, but exit with status 0 if the size remains the same. Reviewed by: trasz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32856 (cherry picked from commit 3f9acedb020b4bcac850eee8a60c75e0880d3e3f) --- sbin/growfs/growfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index d1e42ed7c3d0..c47352e64079 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1485,7 +1485,10 @@ main(int argc, char **argv) humanize_number(newsizebuf, sizeof(newsizebuf), size, "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - errx(1, "requested size %s is not larger than the current " + if (size == (uint64_t)(osblock.fs_size * osblock.fs_fsize)) + errx(0, "requested size %s is equal to the current " + "filesystem size %s", newsizebuf, oldsizebuf); + errx(1, "requested size %s is smaller than the current " "filesystem size %s", newsizebuf, oldsizebuf); } From nobody Mon Nov 22 00:43:49 2021 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 090E418AFD0B; Mon, 22 Nov 2021 00:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy7n16hc6z4bD8; Mon, 22 Nov 2021 00:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7B5918E63; Mon, 22 Nov 2021 00:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM0hnPi098527; Mon, 22 Nov 2021 00:43:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM0hnm2098526; Mon, 22 Nov 2021 00:43:49 GMT (envelope-from git) Date: Mon, 22 Nov 2021 00:43:49 GMT Message-Id: <202111220043.1AM0hnm2098526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang Subject: git: c8342584596a - stable/13 - uuid(3): Document return values 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8342584596a0354df6414a0747afe0dfed485e0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c8342584596a0354df6414a0747afe0dfed485e0 commit c8342584596a0354df6414a0747afe0dfed485e0 Author: Felix Johnson AuthorDate: 2021-11-19 08:42:49 +0000 Commit: Guangyuan Yang CommitDate: 2021-11-22 00:43:31 +0000 uuid(3): Document return values PR: 204449 Reported by: Michael Cress (cherry picked from commit f6842865d3367217f2df3e5ae7ecb5b66caf9451) --- lib/libc/uuid/uuid.3 | 63 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/lib/libc/uuid/uuid.3 b/lib/libc/uuid/uuid.3 index 4fa41dec98bd..108ee34f213c 100644 --- a/lib/libc/uuid/uuid.3 +++ b/lib/libc/uuid/uuid.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2012 +.Dd November 19, 2021 .Dt UUID 3 .Os .Sh NAME @@ -68,20 +68,12 @@ The and .Fn uuid_create_nil functions create UUIDs. -The -.Fn uuid_compare , -.Fn uuid_equal -and -.Fn uuid_is_nil -functions can be used to test UUIDs. To convert from the binary representation to the string representation or vice versa, use .Fn uuid_to_string or .Fn uuid_from_string respectively. -A 16-bit hash value can be obtained by calling -.Fn uuid_hash . .Pp The .Fn uuid_to_string @@ -111,6 +103,49 @@ functions decode a UUID from an octet stream in little-endian and big-endian byte-order, respectively. These routines are not part of the DCE RPC API. They are provided for convenience. +.Pp +The +.Fn uuid_compare +and +.Fn uuid_equal +functions compare two UUIDs for equality. +UUIDs are equal if pointers +.Fa a +and +.Fa b +are equal or both +.Dv NULL , +or if the structures +.Fa a +and +.Fa b +point to are equal. +.Fn uuid_compare +returns 0 if the UUIDs are equal, -1 if +.Fa a +is less than +.Fa b , +and 1 if +.Fa a +is greater than +.Fa b . +.Fn uuid_equal +returns 1 if the UUIDs are equal, 0 if they are +not equal. +.Pp +The +.Fn uuid_is_nil +function compares a UUID to +.Dv NULL . +The function returns 1 if +.Fa u +is +.Dv NULL +or if the UUID consists of all zeros, and zero otherwise. +.Pp +The +.Fn uuid_hash +function returns a 16-bit hash value for the specified UUID. .Sh RETURN VALUES The successful or unsuccessful completion of the function is returned in the @@ -127,6 +162,16 @@ The string representation of an UUID is not valid. .It Dv uuid_s_no_memory The function can not allocate memory to store an UUID representation. .El +.Pp +.Fn uuid_compare , +.Fn uuid_equal , +.Fn uuid_is_nil , +and +.Fn uuid_hash +always set +.Fa status +to +.Dv uuid_s_ok . .Sh SEE ALSO .Xr uuidgen 1 , .Xr uuidgen 2 From nobody Mon Nov 22 00:46:13 2021 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 42D0C18880FD; Mon, 22 Nov 2021 00:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy7qp1RKpz4bdJ; Mon, 22 Nov 2021 00:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1112318E64; Mon, 22 Nov 2021 00:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM0kDL4098840; Mon, 22 Nov 2021 00:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM0kDxx098839; Mon, 22 Nov 2021 00:46:13 GMT (envelope-from git) Date: Mon, 22 Nov 2021 00:46:13 GMT Message-Id: <202111220046.1AM0kDxx098839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 532cfa69cf13 - stable/13 - Document that 13.x is the end of the line for FreeBSD/mips 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 532cfa69cf13051a848a2d224d0bf7de04a5c6ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=532cfa69cf13051a848a2d224d0bf7de04a5c6ee commit 532cfa69cf13051a848a2d224d0bf7de04a5c6ee Author: Warner Losh AuthorDate: 2021-11-19 04:21:46 +0000 Commit: Warner Losh CommitDate: 2021-11-22 00:45:28 +0000 Document that 13.x is the end of the line for FreeBSD/mips MFC After: 3 days Sponsored by: Netflix Reviewed by: brooks, jhb, emaste Differential Revision: https://reviews.freebsd.org/D32852 (cherry picked from commit a721ac948e9bec965a8a0434acede2a672b41a51) --- share/man/man7/arch.7 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 45df736b8a37..2a1ad6917a8c 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -97,15 +97,15 @@ architectures, the final release. .It armv7 Ta 12.0 .It ia64 Ta 5.0 Ta 10.4 .It i386 Ta 1.0 -.It mips Ta 8.0 -.It mipsel Ta 9.0 -.It mipselhf Ta 12.0 -.It mipshf Ta 12.0 -.It mipsn32 Ta 9.0 -.It mips64 Ta 9.0 -.It mips64el Ta 9.0 -.It mips64elhf Ta 12.0 -.It mips64hf Ta 12.0 +.It mips Ta 8.0 Ta 13.x +.It mipsel Ta 9.0 Ta 13.x +.It mipselhf Ta 12.0 Ta 13.x +.It mipshf Ta 12.0 Ta 13.x +.It mipsn32 Ta 9.0 Ta 13.x +.It mips64 Ta 9.0 Ta 13.x +.It mips64el Ta 9.0 Ta 13.x +.It mips64elhf Ta 12.0 Ta 13.x +.It mips64hf Ta 12.0 Ta 13.x .It pc98 Ta 2.2 Ta 11.4 .It powerpc Ta 6.0 .It powerpcspe Ta 12.0 From nobody Mon Nov 22 00:46:15 2021 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 82A171888242; Mon, 22 Nov 2021 00:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy7qq2qMdz4bVX; Mon, 22 Nov 2021 00:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32574196CB; Mon, 22 Nov 2021 00:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM0kFM8098864; Mon, 22 Nov 2021 00:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM0kF17098863; Mon, 22 Nov 2021 00:46:15 GMT (envelope-from git) Date: Mon, 22 Nov 2021 00:46:15 GMT Message-Id: <202111220046.1AM0kF17098863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 8d5fd8e04f3c - stable/13 - Add warning that MIPS is being removed in FreeBSD 14.0 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d5fd8e04f3ce014b8f83bdebdb27dddccea3dda Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8d5fd8e04f3ce014b8f83bdebdb27dddccea3dda commit 8d5fd8e04f3ce014b8f83bdebdb27dddccea3dda Author: Warner Losh AuthorDate: 2021-11-19 04:21:55 +0000 Commit: Warner Losh CommitDate: 2021-11-22 00:45:28 +0000 Add warning that MIPS is being removed in FreeBSD 14.0 MFC After: 3 days Sponsored by: Netflix Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D32853 (cherry picked from commit 27a04f59646bea70e8461095eb835e92066702ef) --- Makefile.inc1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 4fa955779c1f..4439b9ef67d4 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1182,6 +1182,10 @@ _ncpu_cmd=sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown buildworld_prologue: .PHONY @echo "--------------------------------------------------------------" @echo ">>> World build started on `LC_ALL=C date`" +.if ${TARGET:Mmips} + @echo "--------------------------------------------------------------" + @echo "WARNING: MIPS architecture is gone in FreeBSD 14.0" +.endif @echo "--------------------------------------------------------------" buildworld_epilogue: .PHONY @@ -1191,6 +1195,10 @@ buildworld_epilogue: .PHONY @seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \ echo -n ">>> World built in $$seconds seconds, "; \ echo "ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}" +.if ${TARGET:Mmips} + @echo "--------------------------------------------------------------" + @echo "WARNING: MIPS architecture is gone in FreeBSD 14.0" +.endif @echo "--------------------------------------------------------------" # From nobody Mon Nov 22 00:46:28 2021 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 29D5D18885C2; Mon, 22 Nov 2021 00:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy7r50Vmwz4byn; Mon, 22 Nov 2021 00:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E586819541; Mon, 22 Nov 2021 00:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM0kSGh099001; Mon, 22 Nov 2021 00:46:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM0kSEK099000; Mon, 22 Nov 2021 00:46:28 GMT (envelope-from git) Date: Mon, 22 Nov 2021 00:46:28 GMT Message-Id: <202111220046.1AM0kSEK099000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 117dd8828432 - stable/12 - Document that 13.x is the end of the line for FreeBSD/mips 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 117dd8828432e54a4684d78c1d23753c7515ee67 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=117dd8828432e54a4684d78c1d23753c7515ee67 commit 117dd8828432e54a4684d78c1d23753c7515ee67 Author: Warner Losh AuthorDate: 2021-11-19 04:21:46 +0000 Commit: Warner Losh CommitDate: 2021-11-22 00:43:30 +0000 Document that 13.x is the end of the line for FreeBSD/mips MFC After: 3 days Sponsored by: Netflix Reviewed by: brooks, jhb, emaste Differential Revision: https://reviews.freebsd.org/D32852 (cherry picked from commit a721ac948e9bec965a8a0434acede2a672b41a51) --- share/man/man7/arch.7 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 3f2456f4f14d..7bf8923b5ac7 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -99,15 +99,15 @@ architectures, the final release. .It armv7 Ta 12.0 .It ia64 Ta 5.0 Ta 10.4 .It i386 Ta 1.0 -.It mips Ta 8.0 -.It mipsel Ta 9.0 -.It mipselhf Ta 12.0 -.It mipshf Ta 12.0 -.It mipsn32 Ta 9.0 -.It mips64 Ta 9.0 -.It mips64el Ta 9.0 -.It mips64elhf Ta 12.0 -.It mips64hf Ta 12.0 +.It mips Ta 8.0 Ta 13.x +.It mipsel Ta 9.0 Ta 13.x +.It mipselhf Ta 12.0 Ta 13.x +.It mipshf Ta 12.0 Ta 13.x +.It mipsn32 Ta 9.0 Ta 13.x +.It mips64 Ta 9.0 Ta 13.x +.It mips64el Ta 9.0 Ta 13.x +.It mips64elhf Ta 12.0 Ta 13.x +.It mips64hf Ta 12.0 Ta 13.x .It pc98 Ta 2.2 Ta 11.4 .It powerpc Ta 6.0 .It powerpcspe Ta 12.0 From nobody Mon Nov 22 00:46:29 2021 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 EE0FC1888648; Mon, 22 Nov 2021 00:46:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy7r63cDtz4bw9; Mon, 22 Nov 2021 00:46:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1292619595; Mon, 22 Nov 2021 00:46:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM0kTwW099029; Mon, 22 Nov 2021 00:46:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM0kTnP099028; Mon, 22 Nov 2021 00:46:29 GMT (envelope-from git) Date: Mon, 22 Nov 2021 00:46:29 GMT Message-Id: <202111220046.1AM0kTnP099028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 46f1cb6cd485 - stable/12 - Add warning that MIPS is being removed in FreeBSD 14.0 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 46f1cb6cd485ab3566596609fedf20ff22001070 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=46f1cb6cd485ab3566596609fedf20ff22001070 commit 46f1cb6cd485ab3566596609fedf20ff22001070 Author: Warner Losh AuthorDate: 2021-11-19 04:21:55 +0000 Commit: Warner Losh CommitDate: 2021-11-22 00:43:30 +0000 Add warning that MIPS is being removed in FreeBSD 14.0 MFC After: 3 days Sponsored by: Netflix Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D32853 (cherry picked from commit 27a04f59646bea70e8461095eb835e92066702ef) --- Makefile.inc1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index c5b903e8ed90..1b1f8b162d92 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1186,12 +1186,20 @@ buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY buildworld_prologue: .PHONY @echo "--------------------------------------------------------------" @echo ">>> World build started on `LC_ALL=C date`" +.if ${TARGET:Mmips} + @echo "--------------------------------------------------------------" + @echo "WARNING: MIPS architecture is gone in FreeBSD 14.0" +.endif @echo "--------------------------------------------------------------" buildworld_epilogue: .PHONY @echo @echo "--------------------------------------------------------------" @echo ">>> World build completed on `LC_ALL=C date`" +.if ${TARGET:Mmips} + @echo "--------------------------------------------------------------" + @echo "WARNING: MIPS architecture is gone in FreeBSD 14.0" +.endif @echo "--------------------------------------------------------------" # From nobody Mon Nov 22 01:54:21 2021 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 8D698188B401; Mon, 22 Nov 2021 01:54: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy9LP3ZsRz4xh8; Mon, 22 Nov 2021 01:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AAE61A49B; Mon, 22 Nov 2021 01:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM1sLo8091174; Mon, 22 Nov 2021 01:54:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM1sLhS091173; Mon, 22 Nov 2021 01:54:21 GMT (envelope-from git) Date: Mon, 22 Nov 2021 01:54:21 GMT Message-Id: <202111220154.1AM1sLhS091173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a00f531cc28b - stable/13 - pf: Remove duplicate declaration of pf_ioctl_maxcount. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a00f531cc28be227c1d86e4546c9fe2c14f75b1b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a00f531cc28be227c1d86e4546c9fe2c14f75b1b commit a00f531cc28be227c1d86e4546c9fe2c14f75b1b Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: Kristof Provost CommitDate: 2021-11-22 01:53:33 +0000 pf: Remove duplicate declaration of pf_ioctl_maxcount. Fixes a -Wredundant-decls warning with GCC 9. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D31944 (cherry picked from commit df005aa9b3d8d5bf78bff749b261e9ae5bea80a3) --- sys/netpfil/pf/pf_ioctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 7b68110b0f99..6fdce31ad308 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -274,8 +274,6 @@ pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; -extern u_long pf_ioctl_maxcount; - #define ERROUT_FUNCTION(target, x) \ do { \ error = (x); \ From nobody Mon Nov 22 01:54:23 2021 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 39545188B584; Mon, 22 Nov 2021 01:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy9LR5l5Mz4xSt; Mon, 22 Nov 2021 01:54:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E3DE19F6D; Mon, 22 Nov 2021 01:54:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM1sNBo091283; Mon, 22 Nov 2021 01:54:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM1sNjt091282; Mon, 22 Nov 2021 01:54:23 GMT (envelope-from git) Date: Mon, 22 Nov 2021 01:54:23 GMT Message-Id: <202111220154.1AM1sNjt091282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 2107407b25ee - stable/12 - pf: Remove duplicate declaration of pf_ioctl_maxcount. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2107407b25eeeab89556c36ad789a4b23ec9a5f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2107407b25eeeab89556c36ad789a4b23ec9a5f7 commit 2107407b25eeeab89556c36ad789a4b23ec9a5f7 Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: Kristof Provost CommitDate: 2021-11-22 01:53:41 +0000 pf: Remove duplicate declaration of pf_ioctl_maxcount. Fixes a -Wredundant-decls warning with GCC 9. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D31944 (cherry picked from commit df005aa9b3d8d5bf78bff749b261e9ae5bea80a3) --- sys/netpfil/pf/pf_ioctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index ff7e4d4235a6..f5d7626c6754 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -274,8 +274,6 @@ pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; -extern u_long pf_ioctl_maxcount; - #define ERROUT_FUNCTION(target, x) \ do { \ error = (x); \ From nobody Mon Nov 22 05:16:00 2021 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 43DCD18AA912; Mon, 22 Nov 2021 05:16:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyFq43KN5z4k3L; Mon, 22 Nov 2021 05:16:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E4051CB41; Mon, 22 Nov 2021 05:16:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM5G0nV059271; Mon, 22 Nov 2021 05:16:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM5G0Hg059270; Mon, 22 Nov 2021 05:16:00 GMT (envelope-from git) Date: Mon, 22 Nov 2021 05:16:00 GMT Message-Id: <202111220516.1AM5G0Hg059270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 0909e05779ee - stable/13 - carp: deal with negative net.inet.carp.demotion 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0909e05779eed325fa0c2d4c1daa6916dbbc83e3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0909e05779eed325fa0c2d4c1daa6916dbbc83e3 commit 0909e05779eed325fa0c2d4c1daa6916dbbc83e3 Author: Marius Halden AuthorDate: 2021-10-31 20:18:42 +0000 Commit: Kristof Provost CommitDate: 2021-11-22 01:55:02 +0000 carp: deal with negative net.inet.carp.demotion Given nodes 1 and 2, where node 1 has an advskew of 0 and node 2 has an advskew of 100, making them master and backup respectively. If net.inet.carp.demotion is set to a negative value on node 1, node 2 might become master while node 1 still retains it master status. Wether or not node 2 becomes master seems to depend on the nodes advskew and what the demotion sysctl was set to on node 1. The reason for node 2 becoming master seems to be that the calculated advskew taking demotion into account is truncated to a single unsigned byte when copied into the carp header for sending, and node 1 stays master since it takes uses the whole non-truncated calculated advskew when deciding wether to stay master. PR: 259528 Reviewed by: donner, glebius MFC after: 3 weeks Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32759 (cherry picked from commit 1019354b54161c140d10a8203ff1e849c09c8010) --- sys/netinet/ip_carp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 9a551a70c3ad..7554becb974e 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -304,7 +304,9 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_carp, OID_AUTO, stats, struct carpstats, #define DEMOTE_ADVSKEW(sc) \ (((sc)->sc_advskew + V_carp_demotion > CARP_MAXSKEW) ? \ - CARP_MAXSKEW : ((sc)->sc_advskew + V_carp_demotion)) + CARP_MAXSKEW : \ + (((sc)->sc_advskew + V_carp_demotion < 0) ? \ + 0 : ((sc)->sc_advskew + V_carp_demotion))) static void carp_input_c(struct mbuf *, struct carp_header *, sa_family_t); static struct carp_softc From nobody Mon Nov 22 05:16:00 2021 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 43E2918AA88E; Mon, 22 Nov 2021 05:16:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyFq51X4pz4k0w; Mon, 22 Nov 2021 05:16:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111871CAFA; Mon, 22 Nov 2021 05:16:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM5G08T059358; Mon, 22 Nov 2021 05:16:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM5G0YY059357; Mon, 22 Nov 2021 05:16:00 GMT (envelope-from git) Date: Mon, 22 Nov 2021 05:16:00 GMT Message-Id: <202111220516.1AM5G0YY059357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 1c16de99bd7d - stable/12 - carp: deal with negative net.inet.carp.demotion 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1c16de99bd7ddddad9d5877ba0f91aa2a2f57eb3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1c16de99bd7ddddad9d5877ba0f91aa2a2f57eb3 commit 1c16de99bd7ddddad9d5877ba0f91aa2a2f57eb3 Author: Marius Halden AuthorDate: 2021-10-31 20:18:42 +0000 Commit: Kristof Provost CommitDate: 2021-11-22 01:55:13 +0000 carp: deal with negative net.inet.carp.demotion Given nodes 1 and 2, where node 1 has an advskew of 0 and node 2 has an advskew of 100, making them master and backup respectively. If net.inet.carp.demotion is set to a negative value on node 1, node 2 might become master while node 1 still retains it master status. Wether or not node 2 becomes master seems to depend on the nodes advskew and what the demotion sysctl was set to on node 1. The reason for node 2 becoming master seems to be that the calculated advskew taking demotion into account is truncated to a single unsigned byte when copied into the carp header for sending, and node 1 stays master since it takes uses the whole non-truncated calculated advskew when deciding wether to stay master. PR: 259528 Reviewed by: donner, glebius MFC after: 3 weeks Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32759 (cherry picked from commit 1019354b54161c140d10a8203ff1e849c09c8010) --- sys/netinet/ip_carp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index f4f051d14fee..acf819df694a 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -301,7 +301,9 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_carp, OID_AUTO, stats, struct carpstats, #define DEMOTE_ADVSKEW(sc) \ (((sc)->sc_advskew + V_carp_demotion > CARP_MAXSKEW) ? \ - CARP_MAXSKEW : ((sc)->sc_advskew + V_carp_demotion)) + CARP_MAXSKEW : \ + (((sc)->sc_advskew + V_carp_demotion < 0) ? \ + 0 : ((sc)->sc_advskew + V_carp_demotion))) static void carp_input_c(struct mbuf *, struct carp_header *, sa_family_t); static struct carp_softc From nobody Mon Nov 22 05:16:01 2021 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 4596D18AA5EB; Mon, 22 Nov 2021 05:16:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyFq54cqzz4kLr; Mon, 22 Nov 2021 05:16:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 714B61CFBE; Mon, 22 Nov 2021 05:16:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM5G1Im059382; Mon, 22 Nov 2021 05:16:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM5G1LM059381; Mon, 22 Nov 2021 05:16:01 GMT (envelope-from git) Date: Mon, 22 Nov 2021 05:16:01 GMT Message-Id: <202111220516.1AM5G1LM059381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b6237b80891f - stable/13 - carp tests: negative demotion 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b6237b80891f1a6e9808f630a4626eab6ea203bc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b6237b80891f1a6e9808f630a4626eab6ea203bc commit b6237b80891f1a6e9808f630a4626eab6ea203bc Author: Marius Halden AuthorDate: 2021-10-31 20:22:10 +0000 Commit: Kristof Provost CommitDate: 2021-11-22 01:55:07 +0000 carp tests: negative demotion PR: 259528 Reviewed by: donner MFC after: 3 weeks Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32760 (cherry picked from commit 847b0d07c43c1190f0015c4c93a9e8fd953e3ab5) --- tests/sys/netinet/carp.sh | 67 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index 30ae79c93c8d..267e70ebf0dc 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -48,6 +48,15 @@ wait_for_carp() done } +carp_init() +{ + if ! kldstat -q -m carp; then + atf_skip "This test requires carp" + fi + + vnet_init +} + atf_test_case "basic_v4" "cleanup" basic_v4_head() { @@ -57,11 +66,8 @@ basic_v4_head() basic_v4_body() { - if ! kldstat -q -m carp; then - atf_skip "This test requires carp" - fi + carp_init - vnet_init bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) @@ -104,11 +110,8 @@ basic_v6_head() basic_v6_body() { - if ! kldstat -q -m carp; then - atf_skip "This test requires carp" - fi + carp_init - vnet_init bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) @@ -145,8 +148,56 @@ basic_v6_cleanup() vnet_cleanup } +atf_test_case "negative_demotion" "cleanup" +negative_demotion_head() +{ + atf_set descr 'Test PR #259528' + atf_set require.user root +} + +negative_demotion_body() +{ + carp_init + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one sysctl net.inet.carp.preempt=1 + jexec one ifconfig ${epair}a 192.0.2.1/24 up + jexec one ifconfig ${epair}a add vhid 1 192.0.2.254/24 \ + advskew 0 pass foobar + + vnet_mkjail two ${epair}b + jexec two sysctl net.inet.carp.preempt=1 + jexec two ifconfig ${epair}b 192.0.2.2/24 up + jexec two ifconfig ${epair}b add vhid 1 192.0.2.254/24 \ + advskew 100 pass foobar + + # Allow things to settle + wait_for_carp one ${epair}a two ${epair}b + + if is_master one ${epair}a && is_master two ${epair}b + then + atf_fail "Two masters!" + fi + + jexec one sysctl net.inet.carp.demotion=-1 + sleep 3 + + if is_master one ${epair}a && is_master two ${epair}b + then + atf_fail "Two masters!" + fi +} + +negative_demotion_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "negative_demotion" } From nobody Mon Nov 22 05:16:02 2021 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 B02F918AA669; Mon, 22 Nov 2021 05:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyFq62Dfdz4k0x; Mon, 22 Nov 2021 05:16:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BB951CAFB; Mon, 22 Nov 2021 05:16:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM5G2lE059406; Mon, 22 Nov 2021 05:16:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM5G2sQ059405; Mon, 22 Nov 2021 05:16:02 GMT (envelope-from git) Date: Mon, 22 Nov 2021 05:16:02 GMT Message-Id: <202111220516.1AM5G2sQ059405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 64bb05e04fc3 - stable/12 - carp tests: Basic functionality test 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 64bb05e04fc3ec16541b6c1fb2074c4df207f173 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=64bb05e04fc3ec16541b6c1fb2074c4df207f173 commit 64bb05e04fc3ec16541b6c1fb2074c4df207f173 Author: Kristof Provost AuthorDate: 2020-04-12 16:13:05 +0000 Commit: Kristof Provost CommitDate: 2021-11-22 01:57:50 +0000 carp tests: Basic functionality test Set up three vnet jails, bridged together. Run carp between two of them. Attempt to provoke locking / epoch issues. Reviewed by: mav (previous version), melifaro, asomers Differential Revision: https://reviews.freebsd.org/D24303 (cherry picked from commit 47308803e7b92c15326707f76739bcb6dc1383c7) --- tests/sys/netinet/Makefile | 2 +- tests/sys/netinet/carp.sh | 152 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+), 1 deletion(-) diff --git a/tests/sys/netinet/Makefile b/tests/sys/netinet/Makefile index f5b465557282..47f32e46aae9 100644 --- a/tests/sys/netinet/Makefile +++ b/tests/sys/netinet/Makefile @@ -8,7 +8,7 @@ TESTS_SUBDIRS+= libalias ATF_TESTS_C= ip_reass_test \ so_reuseport_lb_test -ATF_TESTS_SH= fibs_test arp +ATF_TESTS_SH= carp fibs_test arp PROGS= udp_dontroute tcp_user_cookie diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh new file mode 100755 index 000000000000..4c7dbaa022a8 --- /dev/null +++ b/tests/sys/netinet/carp.sh @@ -0,0 +1,152 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Kristof Provost +# +# 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. + +. $(atf_get_srcdir)/../common/vnet.subr + +is_master() +{ + jail=$1 + itf=$2 + + jexec ${jail} ifconfig ${itf} | grep carp | grep MASTER +} + +wait_for_carp() +{ + jail1=$1 + itf1=$2 + jail2=$3 + itf2=$4 + + while [ -z "$(is_master ${jail1} ${itf1})" ] && + [ -z "$(is_master ${jail2} ${itf2})" ]; do + sleep 1 + done +} + +atf_test_case "basic_v4" "cleanup" +basic_v4_head() +{ + atf_set descr 'Basic CARP test (IPv4)' + atf_set require.user root +} + +basic_v4_body() +{ + if ! kldstat -q -m carp; then + atf_skip "This test requires carp" + fi + + vnet_init + bridge=$(vnet_mkbridge) + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + vnet_mkjail carp_basic_v4_one ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_basic_v4_two ${epair_one}b + vnet_mkjail carp_basic_v4_three ${epair_two}b + + jexec carp_basic_v4_one ifconfig ${bridge} 192.0.2.4/29 up + jexec carp_basic_v4_one ifconfig ${bridge} addm ${epair_one}a \ + addm ${epair_two}a + jexec carp_basic_v4_one ifconfig ${epair_one}a up + jexec carp_basic_v4_one ifconfig ${epair_two}a up + + jexec carp_basic_v4_two ifconfig ${epair_one}b 192.0.2.202/29 up + jexec carp_basic_v4_two ifconfig ${epair_one}b add vhid 1 192.0.2.1/29 + + jexec carp_basic_v4_three ifconfig ${epair_two}b 192.0.2.203/29 up + jexec carp_basic_v4_three ifconfig ${epair_two}b add vhid 1 \ + 192.0.2.1/29 + + wait_for_carp carp_basic_v4_two ${epair_one}b \ + carp_basic_v4_three ${epair_two}b + + atf_check -s exit:0 -o ignore jexec carp_basic_v4_one \ + ping -c 3 192.0.2.1 +} + +basic_v4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "basic_v6" "cleanup" +basic_v6_head() +{ + atf_set descr 'Basic CARP test (IPv6)' + atf_set require.user root +} + +basic_v6_body() +{ + if ! kldstat -q -m carp; then + atf_skip "This test requires carp" + fi + + vnet_init + bridge=$(vnet_mkbridge) + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + vnet_mkjail carp_basic_v6_one ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_basic_v6_two ${epair_one}b + vnet_mkjail carp_basic_v6_three ${epair_two}b + + jexec carp_basic_v6_one ifconfig ${bridge} inet6 2001:db8::0:4/64 up \ + no_dad + jexec carp_basic_v6_one ifconfig ${bridge} addm ${epair_one}a \ + addm ${epair_two}a + jexec carp_basic_v6_one ifconfig ${epair_one}a up + jexec carp_basic_v6_one ifconfig ${epair_two}a up + + jexec carp_basic_v6_two ifconfig ${epair_one}b inet6 \ + 2001:db8::1:2/64 up no_dad + jexec carp_basic_v6_two ifconfig ${epair_one}b inet6 add vhid 1 \ + 2001:db8::0:1/64 + + jexec carp_basic_v6_three ifconfig ${epair_two}b inet6 2001:db8::1:3/64 up no_dad + jexec carp_basic_v6_three ifconfig ${epair_two}b inet6 add vhid 1 \ + 2001:db8::0:1/64 + + wait_for_carp carp_basic_v6_two ${epair_one}b \ + carp_basic_v6_three ${epair_two}b + + atf_check -s exit:0 -o ignore jexec carp_basic_v6_one \ + ping6 -c 3 2001:db8::0:1 +} + +basic_v6_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic_v4" + atf_add_test_case "basic_v6" +} From nobody Mon Nov 22 05:16:03 2021 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 CFECA18AA939; Mon, 22 Nov 2021 05:16:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyFq84WMnz4k5n; Mon, 22 Nov 2021 05:16:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E0CF1CEB8; Mon, 22 Nov 2021 05:16:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM5G3jA059477; Mon, 22 Nov 2021 05:16:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM5G3rj059476; Mon, 22 Nov 2021 05:16:03 GMT (envelope-from git) Date: Mon, 22 Nov 2021 05:16:03 GMT Message-Id: <202111220516.1AM5G3rj059476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: d42231181626 - stable/12 - carp tests: negative demotion 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d42231181626b2fe0f75514c9b5753083cdf362b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d42231181626b2fe0f75514c9b5753083cdf362b commit d42231181626b2fe0f75514c9b5753083cdf362b Author: Marius Halden AuthorDate: 2021-10-31 20:22:10 +0000 Commit: Kristof Provost CommitDate: 2021-11-22 01:58:10 +0000 carp tests: negative demotion PR: 259528 Reviewed by: donner MFC after: 3 weeks Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32760 (cherry picked from commit 847b0d07c43c1190f0015c4c93a9e8fd953e3ab5) --- tests/sys/netinet/carp.sh | 67 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index 4c7dbaa022a8..76fc483cd4a4 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -48,6 +48,15 @@ wait_for_carp() done } +carp_init() +{ + if ! kldstat -q -m carp; then + atf_skip "This test requires carp" + fi + + vnet_init +} + atf_test_case "basic_v4" "cleanup" basic_v4_head() { @@ -57,11 +66,8 @@ basic_v4_head() basic_v4_body() { - if ! kldstat -q -m carp; then - atf_skip "This test requires carp" - fi + carp_init - vnet_init bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) @@ -104,11 +110,8 @@ basic_v6_head() basic_v6_body() { - if ! kldstat -q -m carp; then - atf_skip "This test requires carp" - fi + carp_init - vnet_init bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) @@ -145,8 +148,56 @@ basic_v6_cleanup() vnet_cleanup } +atf_test_case "negative_demotion" "cleanup" +negative_demotion_head() +{ + atf_set descr 'Test PR #259528' + atf_set require.user root +} + +negative_demotion_body() +{ + carp_init + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one sysctl net.inet.carp.preempt=1 + jexec one ifconfig ${epair}a 192.0.2.1/24 up + jexec one ifconfig ${epair}a add vhid 1 192.0.2.254/24 \ + advskew 0 pass foobar + + vnet_mkjail two ${epair}b + jexec two sysctl net.inet.carp.preempt=1 + jexec two ifconfig ${epair}b 192.0.2.2/24 up + jexec two ifconfig ${epair}b add vhid 1 192.0.2.254/24 \ + advskew 100 pass foobar + + # Allow things to settle + wait_for_carp one ${epair}a two ${epair}b + + if is_master one ${epair}a && is_master two ${epair}b + then + atf_fail "Two masters!" + fi + + jexec one sysctl net.inet.carp.demotion=-1 + sleep 3 + + if is_master one ${epair}a && is_master two ${epair}b + then + atf_fail "Two masters!" + fi +} + +negative_demotion_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "negative_demotion" } From nobody Mon Nov 22 07:36:47 2021 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 DEC2A189ECEB; Mon, 22 Nov 2021 07:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyJxW5zz1z3trF; Mon, 22 Nov 2021 07:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAD151E578; Mon, 22 Nov 2021 07:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AM7alQH044914; Mon, 22 Nov 2021 07:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AM7albM044913; Mon, 22 Nov 2021 07:36:47 GMT (envelope-from git) Date: Mon, 22 Nov 2021 07:36:47 GMT Message-Id: <202111220736.1AM7albM044913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: f266886dd0bc - releng/12.3 - MFC: rc.d/rctl: unbreak for distinct /usr filesystem 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: f266886dd0bcf052ea5e4f85505b75df06dd2ab3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=f266886dd0bcf052ea5e4f85505b75df06dd2ab3 commit f266886dd0bcf052ea5e4f85505b75df06dd2ab3 Author: Eugene Grosbein AuthorDate: 2021-11-20 08:54:39 +0000 Commit: Eugene Grosbein CommitDate: 2021-11-22 07:36:39 +0000 MFC: rc.d/rctl: unbreak for distinct /usr filesystem Both rctl and used xargs utility live in /usr/bin so add REQUIRE: FILESYSTEMS Approved by: re (gjb) Reported by: Peter (cherry picked from commit 0c54fe172ad365e7e60d6249484a7579c18b7d2d) (cherry picked from commit 92b40444d07aeef2bf4b20109f3f90ac343b90df) --- libexec/rc/rc.d/rctl | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc.d/rctl b/libexec/rc/rc.d/rctl index ed5665454dde..f1b001a6ad79 100755 --- a/libexec/rc/rc.d/rctl +++ b/libexec/rc/rc.d/rctl @@ -4,6 +4,7 @@ # # PROVIDE: rctl +# REQUIRE: FILESYSTEMS # BEFORE: LOGIN # KEYWORD: nojail From nobody Mon Nov 22 13:46:21 2021 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 67DC818A0FC6; Mon, 22 Nov 2021 13:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyT7x2S00z3lSt; Mon, 22 Nov 2021 13:46:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 361EF23BDB; Mon, 22 Nov 2021 13:46:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMDkLGN037509; Mon, 22 Nov 2021 13:46:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMDkLbQ037508; Mon, 22 Nov 2021 13:46:21 GMT (envelope-from git) Date: Mon, 22 Nov 2021 13:46:21 GMT Message-Id: <202111221346.1AMDkLbQ037508@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: 0d900a16d0df - stable/13 - vm_pager: Optimize an assertion 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 0d900a16d0df1334be01f2dd6313cd5103ede8d2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0d900a16d0df1334be01f2dd6313cd5103ede8d2 commit 0d900a16d0df1334be01f2dd6313cd5103ede8d2 Author: Mark Johnston AuthorDate: 2021-11-15 16:33:30 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 13:44:08 +0000 vm_pager: Optimize an assertion Obtained from: jeff (object_concurrency patches) Reviewed by: kib (cherry picked from commit b0acc3f11ba31f0aea8ca5ce2720b481dfa79d1b) --- sys/vm/vm_pager.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 640e3d977e99..791fc1ebfe11 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -329,12 +329,11 @@ vm_pager_get_pages(vm_object_t object, vm_page_t *m, int count, int *rbehind, * updated the array. */ #ifdef INVARIANTS - VM_OBJECT_RLOCK(object); - KASSERT(m[i] == vm_page_lookup(object, pindex++), + KASSERT(m[i] == vm_page_relookup(object, pindex++), ("%s: mismatch page %p pindex %ju", __func__, m[i], (uintmax_t )pindex - 1)); - VM_OBJECT_RUNLOCK(object); #endif + /* * Zero out partially filled data. */ From nobody Mon Nov 22 13:46:22 2021 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 E70DA18A0EE1; Mon, 22 Nov 2021 13:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyT7y47WYz3lbg; Mon, 22 Nov 2021 13:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DFA8238D2; Mon, 22 Nov 2021 13:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMDkMLn037533; Mon, 22 Nov 2021 13:46:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMDkMAY037532; Mon, 22 Nov 2021 13:46:22 GMT (envelope-from git) Date: Mon, 22 Nov 2021 13:46:22 GMT Message-Id: <202111221346.1AMDkMAY037532@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: 291166ab493a - stable/13 - amd64: Annotate an unlikely condition in smp_targeted_tlb_shootdown() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 291166ab493aed7fdc08dc43dc91be739f68c5e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=291166ab493aed7fdc08dc43dc91be739f68c5e4 commit 291166ab493aed7fdc08dc43dc91be739f68c5e4 Author: Mark Johnston AuthorDate: 2021-11-15 17:40:00 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 13:44:27 +0000 amd64: Annotate an unlikely condition in smp_targeted_tlb_shootdown() Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 42c2cd1ffbdfa706764362eca1b7bf5eeeee2aef) --- sys/amd64/amd64/mp_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index cf8408c2afb0..cbc4b33841ba 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -625,7 +625,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap, vm_offset_t addr1, * It is not necessary to signal other CPUs while booting or * when in the debugger. */ - if (kdb_active || KERNEL_PANICKED() || !smp_started) + if (__predict_false(kdb_active || KERNEL_PANICKED() || !smp_started)) goto local_cb; KASSERT(curthread->td_pinned > 0, ("curthread not pinned")); From nobody Mon Nov 22 13:46:23 2021 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 4A49E18A1300; Mon, 22 Nov 2021 13:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyT7z5Ztfz3lTC; Mon, 22 Nov 2021 13:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71D54235F7; Mon, 22 Nov 2021 13:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMDkNYf037557; Mon, 22 Nov 2021 13:46:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMDkNFk037556; Mon, 22 Nov 2021 13:46:23 GMT (envelope-from git) Date: Mon, 22 Nov 2021 13:46:23 GMT Message-Id: <202111221346.1AMDkNFk037556@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: 686b143f37c5 - stable/13 - timecounter: Initialize tc_lock earlier 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 686b143f37c501c79c0ddbbcb55ce852cc0bc846 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=686b143f37c501c79c0ddbbcb55ce852cc0bc846 commit 686b143f37c501c79c0ddbbcb55ce852cc0bc846 Author: Mark Johnston AuthorDate: 2021-11-19 22:29:28 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 13:44:49 +0000 timecounter: Initialize tc_lock earlier Hyper-V wants to register its MSR-based timecounter during SI_SUB_HYPERVISOR, before SI_SUB_LOCK, since an emulated 8254 may not be available for DELAY(). So we cannot use MTX_SYSINIT to initialize the timecounter lock. PR: 259878 Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 3339950117bedb5f880f6c08982dcc5dd43f9c34) --- sys/kern/kern_tc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 135279d48a22..989457b82434 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -100,7 +100,6 @@ static struct timecounter *timecounters = &dummy_timecounter; /* Mutex to protect the timecounter list. */ static struct mtx tc_lock; -MTX_SYSINIT(tc_lock, &tc_lock, "tc", MTX_DEF); int tc_min_ticktock_freq = 1; @@ -1982,6 +1981,8 @@ inittimehands(void *dummy) TUNABLE_STR_FETCH("kern.timecounter.hardware", tc_from_tunable, sizeof(tc_from_tunable)); + + mtx_init(&tc_lock, "tc", NULL, MTX_DEF); } SYSINIT(timehands, SI_SUB_TUNABLES, SI_ORDER_ANY, inittimehands, NULL); From nobody Mon Nov 22 13:46:24 2021 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 5BD8618A1196; Mon, 22 Nov 2021 13:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyT806XtPz3lYT; Mon, 22 Nov 2021 13:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 958F523BDC; Mon, 22 Nov 2021 13:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMDkOCA037581; Mon, 22 Nov 2021 13:46:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMDkONK037580; Mon, 22 Nov 2021 13:46:24 GMT (envelope-from git) Date: Mon, 22 Nov 2021 13:46:24 GMT Message-Id: <202111221346.1AMDkONK037580@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: 200d47320207 - stable/13 - hyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISOR 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 200d4732020742eb17f51b6e1c553cfac878a559 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=200d4732020742eb17f51b6e1c553cfac878a559 commit 200d4732020742eb17f51b6e1c553cfac878a559 Author: Mark Johnston AuthorDate: 2021-11-19 22:30:05 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 13:45:34 +0000 hyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISOR This reverts commit 9ef7df022a46 ("hyperv: Register hyperv_timecounter later during boot") and adds a comment explaining why the timecounter needs to be registered as early as it is. PR: 259878 Fixes: 9ef7df022a46 ("hyperv: Register hyperv_timecounter later during boot") Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit ed6a9452be01c1b7805d0a7311211b8cf381a9dd) --- sys/dev/hyperv/vmbus/hyperv.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sys/dev/hyperv/vmbus/hyperv.c b/sys/dev/hyperv/vmbus/hyperv.c index 2c413664cd07..01e0ad9610d9 100644 --- a/sys/dev/hyperv/vmbus/hyperv.c +++ b/sys/dev/hyperv/vmbus/hyperv.c @@ -247,15 +247,12 @@ hyperv_init(void *dummy __unused) /* Set guest id */ wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); -} -SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, - NULL); - -static void -hyperv_tc_init(void *arg __unused) -{ if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { - /* Register Hyper-V timecounter */ + /* + * Register Hyper-V timecounter. This should be done as early + * as possible to let DELAY() work, since the 8254 PIT is not + * reliably emulated or even available. + */ tc_init(&hyperv_timecounter); /* @@ -265,7 +262,8 @@ hyperv_tc_init(void *arg __unused) hyperv_tc64 = hyperv_tc64_rdmsr; } } -SYSINIT(hyperv_tc_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, hyperv_tc_init, NULL); +SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, + NULL); static void hypercall_memfree(void) From nobody Mon Nov 22 13:46:25 2021 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 132A618A1329; Mon, 22 Nov 2021 13:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyT826z5Lz3lc4; Mon, 22 Nov 2021 13:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2DBA23C13; Mon, 22 Nov 2021 13:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMDkPIR037609; Mon, 22 Nov 2021 13:46:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMDkPrW037608; Mon, 22 Nov 2021 13:46:25 GMT (envelope-from git) Date: Mon, 22 Nov 2021 13:46:25 GMT Message-Id: <202111221346.1AMDkPrW037608@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: d16fbc488e60 - stable/13 - clock: Group the "clocks" SYSINIT with the function definition 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: d16fbc488e604d5bad295c2951aa67da885a62f5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d16fbc488e604d5bad295c2951aa67da885a62f5 commit d16fbc488e604d5bad295c2951aa67da885a62f5 Author: Mark Johnston AuthorDate: 2021-11-15 20:31:03 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 13:45:47 +0000 clock: Group the "clocks" SYSINIT with the function definition This is how most SYSINITs are defined. Also annotate the dummy parameter with __unused. No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit 2287ced2f5686aeda69676342d6a1ff6257f5f6d) --- sys/kern/kern_clock.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index c215471ab2d9..3998ffd2a607 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -90,9 +90,6 @@ PMC_SOFT_DEFINE_EX( , , clock, prof, \ extern void hardclock_device_poll(void); #endif /* DEVICE_POLLING */ -static void initclocks(void *dummy); -SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL); - /* Spin-lock protecting profiling statistics. */ static struct mtx time_lock; @@ -391,9 +388,8 @@ static int devpoll_run = 0; /* * Initialize clock frequencies and start both clocks running. */ -/* ARGSUSED*/ static void -initclocks(void *dummy) +initclocks(void *dummy __unused) { int i; @@ -421,6 +417,7 @@ initclocks(void *dummy) wdog_software_attach = watchdog_attach; #endif } +SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL); static __noinline void hardclock_itimer(struct thread *td, struct pstats *pstats, int cnt, int usermode) From nobody Mon Nov 22 16:03:01 2021 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 D321918A29F5; Mon, 22 Nov 2021 16:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyX9d5bMmz3LFK; Mon, 22 Nov 2021 16:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A061C25B1C; Mon, 22 Nov 2021 16:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMG31YC024690; Mon, 22 Nov 2021 16:03:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMG31h8024689; Mon, 22 Nov 2021 16:03:01 GMT (envelope-from git) Date: Mon, 22 Nov 2021 16:03:01 GMT Message-Id: <202111221603.1AMG31h8024689@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: 4faff19d6305 - stable/12 - When copying types from one CTF container to another, ensure that we always copy intrinsic data types before copying bitfields which are based on those types. This ensures the type ordering in the destination CTF container matches the assumption made elsewhere in the CTF code that instrinsic data types will always appear before bitfields based on those types. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 4faff19d63053defffe707312c6208c2b1e934ef Auto-Submitted: auto-generated X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4faff19d63053defffe707312c6208c2b1e934ef commit 4faff19d63053defffe707312c6208c2b1e934ef Author: Jonathan T. Looney AuthorDate: 2020-11-17 14:07:27 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 16:02:42 +0000 When copying types from one CTF container to another, ensure that we always copy intrinsic data types before copying bitfields which are based on those types. This ensures the type ordering in the destination CTF container matches the assumption made elsewhere in the CTF code that instrinsic data types will always appear before bitfields based on those types. This resolves the following error message some users have seen after r366908: "/usr/lib/dtrace/ipfw.d", line 121: failed to copy type of 'ip6p': Conflicting type is already defined Reviewed by: markj Sponsored by: Netflix (cherry picked from commit 3cbb4cc200f8a0ad7ed08233425ea54524a21f1c) --- cddl/contrib/opensolaris/common/ctf/ctf_create.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_create.c b/cddl/contrib/opensolaris/common/ctf/ctf_create.c index bf9b3b26b200..2f9d4b1c7953 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_create.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_create.c @@ -1312,7 +1312,7 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) uint_t kind, flag, vlen; ctf_bundle_t src, dst; - ctf_encoding_t src_en, dst_en; + ctf_encoding_t src_en, main_en, dst_en; ctf_arinfo_t src_ar, dst_ar; ctf_dtdef_t *dtd; @@ -1427,6 +1427,27 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) if (ctf_type_encoding(src_fp, src_type, &src_en) != 0) return (ctf_set_errno(dst_fp, ctf_errno(src_fp))); + /* + * This could be a bitfield, and the CTF library assumes + * intrinsics will appear before bitfields. Therefore, + * try to copy over the intrinsic prior to copying the + * bitfield. + */ + if (dst_type == CTF_ERR && name[0] != '\0' && + (hep = ctf_hash_lookup(&src_fp->ctf_names, src_fp, name, + strlen(name))) != NULL && + src_type != (ctf_id_t)hep->h_type) { + if (ctf_type_encoding(src_fp, (ctf_id_t)hep->h_type, + &main_en) != 0) { + return (ctf_set_errno(dst_fp, + ctf_errno(src_fp))); + } + if (bcmp(&src_en, &main_en, sizeof (ctf_encoding_t)) && + ctf_add_type(dst_fp, src_fp, + (ctf_id_t)hep->h_type) == CTF_ERR) + return (CTF_ERR); /* errno is set for us */ + } + if (dst_type != CTF_ERR) { if (ctf_type_encoding(dst_fp, dst_type, &dst_en) != 0) return (CTF_ERR); /* errno is set for us */ From nobody Mon Nov 22 16:34:49 2021 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 88A3E1889886; Mon, 22 Nov 2021 16:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyXtK3DWMz3lY5; Mon, 22 Nov 2021 16:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F880261EC; Mon, 22 Nov 2021 16:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMGYnil064343; Mon, 22 Nov 2021 16:34:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMGYncN064342; Mon, 22 Nov 2021 16:34:49 GMT (envelope-from git) Date: Mon, 22 Nov 2021 16:34:49 GMT Message-Id: <202111221634.1AMGYncN064342@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: 22082f15f9bb - releng/12.3 - When copying types from one CTF container to another, ensure that we always copy intrinsic data types before copying bitfields which are based on those types. This ensures the type ordering in the destination CTF container matches the assumption made elsewhere in the CTF code that instrinsic data types will always appear before bitfields based on those types. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 22082f15f9bbc06c43cdc75a5c77a92ac96f612c Auto-Submitted: auto-generated X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=22082f15f9bbc06c43cdc75a5c77a92ac96f612c commit 22082f15f9bbc06c43cdc75a5c77a92ac96f612c Author: Jonathan T. Looney AuthorDate: 2020-11-17 14:07:27 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 16:31:45 +0000 When copying types from one CTF container to another, ensure that we always copy intrinsic data types before copying bitfields which are based on those types. This ensures the type ordering in the destination CTF container matches the assumption made elsewhere in the CTF code that instrinsic data types will always appear before bitfields based on those types. This resolves the following error message some users have seen after r366908: "/usr/lib/dtrace/ipfw.d", line 121: failed to copy type of 'ip6p': Conflicting type is already defined Reviewed by: markj Approved by: re (gjb) Sponsored by: Netflix (cherry picked from commit 3cbb4cc200f8a0ad7ed08233425ea54524a21f1c) (cherry picked from commit 4faff19d63053defffe707312c6208c2b1e934ef) --- cddl/contrib/opensolaris/common/ctf/ctf_create.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_create.c b/cddl/contrib/opensolaris/common/ctf/ctf_create.c index a2ca81960f73..46e2b7faf437 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_create.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_create.c @@ -1258,7 +1258,7 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) uint_t kind, flag, vlen; ctf_bundle_t src, dst; - ctf_encoding_t src_en, dst_en; + ctf_encoding_t src_en, main_en, dst_en; ctf_arinfo_t src_ar, dst_ar; ctf_dtdef_t *dtd; @@ -1373,6 +1373,27 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) if (ctf_type_encoding(src_fp, src_type, &src_en) != 0) return (ctf_set_errno(dst_fp, ctf_errno(src_fp))); + /* + * This could be a bitfield, and the CTF library assumes + * intrinsics will appear before bitfields. Therefore, + * try to copy over the intrinsic prior to copying the + * bitfield. + */ + if (dst_type == CTF_ERR && name[0] != '\0' && + (hep = ctf_hash_lookup(&src_fp->ctf_names, src_fp, name, + strlen(name))) != NULL && + src_type != (ctf_id_t)hep->h_type) { + if (ctf_type_encoding(src_fp, (ctf_id_t)hep->h_type, + &main_en) != 0) { + return (ctf_set_errno(dst_fp, + ctf_errno(src_fp))); + } + if (bcmp(&src_en, &main_en, sizeof (ctf_encoding_t)) && + ctf_add_type(dst_fp, src_fp, + (ctf_id_t)hep->h_type) == CTF_ERR) + return (CTF_ERR); /* errno is set for us */ + } + if (dst_type != CTF_ERR) { if (ctf_type_encoding(dst_fp, dst_type, &dst_en) != 0) return (CTF_ERR); /* errno is set for us */ From nobody Mon Nov 22 16:34:50 2021 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 CB9A81889892; Mon, 22 Nov 2021 16:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyXtL4Zqkz3lCD; Mon, 22 Nov 2021 16:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BF3C2609A; Mon, 22 Nov 2021 16:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMGYopm064367; Mon, 22 Nov 2021 16:34:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMGYoK4064366; Mon, 22 Nov 2021 16:34:50 GMT (envelope-from git) Date: Mon, 22 Nov 2021 16:34:50 GMT Message-Id: <202111221634.1AMGYoK4064366@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: 68396709e73a - releng/12.3 - libctf: Improve check for duplicate SOU definitions in ctf_add_type() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 68396709e73a4cd392ffc06fde6bfa44d79118a7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=68396709e73a4cd392ffc06fde6bfa44d79118a7 commit 68396709e73a4cd392ffc06fde6bfa44d79118a7 Author: Mark Johnston AuthorDate: 2021-10-04 16:28:22 +0000 Commit: Mark Johnston CommitDate: 2021-11-22 16:32:18 +0000 libctf: Improve check for duplicate SOU definitions in ctf_add_type() When copying a struct or union from one CTF container to another, ctf_add_type() checks whether it matches an existing type in the destination container. It does so by looking for a type with the same name and kind as the new type, and if one exists, it iterates over all members of the source type and checks whether a member with matching name and offset exists in the matched destination type. This can produce false positives, for example because member types are not compared, but this is not expected to arise in practice. If the match fails, ctf_add_type() returns an error. The procedure used for member comparison breaks down in the face of anonymous struct and union members. ctf_member_iter() visits each member in the source definition and looks up the corresponding member in the desination definition by name using ctf_member_info(), but this function will descend into anonymous members and thus fail to match. Fix the problem by introducing a custom comparison routine which does not assume member names are unique. This should also be faster for types with many members; in the previous scheme, membcmp() would perform a linear scan of the desination type's members to perform a lookup by name. The new routine steps through the members of both types in a single loop. Approved by: re (gjb) PR: 258763 Sponsored by: The FreeBSD Foundation (cherry picked from commit 105fd928b0b5b35ab529e5f6914788dc49582901) (cherry picked from commit 39545ce06ca8088aecc68b92c028b78bcae888a2) --- cddl/contrib/opensolaris/common/ctf/ctf_create.c | 100 +++++++++++++++++------ 1 file changed, 73 insertions(+), 27 deletions(-) diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_create.c b/cddl/contrib/opensolaris/common/ctf/ctf_create.c index 46e2b7faf437..2f9d4b1c7953 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_create.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_create.c @@ -1196,17 +1196,6 @@ enumadd(const char *name, int value, void *arg) name, value) == CTF_ERR); } -/*ARGSUSED*/ -static int -membcmp(const char *name, ctf_id_t type, ulong_t offset, void *arg) -{ - ctf_bundle_t *ctb = arg; - ctf_membinfo_t ctm; - - return (ctf_member_info(ctb->ctb_file, ctb->ctb_type, - name, &ctm) == CTF_ERR || ctm.ctm_offset != offset); -} - static int membadd(const char *name, ctf_id_t type, ulong_t offset, void *arg) { @@ -1240,6 +1229,71 @@ membadd(const char *name, ctf_id_t type, ulong_t offset, void *arg) return (0); } +static long +soucmp(ctf_file_t *src_fp, ctf_id_t src_type, ctf_file_t *dst_fp, + ctf_id_t dst_type) +{ + const struct ctf_type *src_tp, *dst_tp; + const char *src_name, *dst_name; + ssize_t src_sz, dst_sz, src_inc, dst_inc; + uint_t kind, n; + + if ((src_type = ctf_type_resolve(src_fp, src_type)) == CTF_ERR) + return (CTF_ERR); + if ((dst_type = ctf_type_resolve(dst_fp, dst_type)) == CTF_ERR) + return (CTF_ERR); + + if ((src_tp = ctf_lookup_by_id(&src_fp, src_type)) == NULL) + return (CTF_ERR); + if ((dst_tp = ctf_lookup_by_id(&dst_fp, dst_type)) == NULL) + return (CTF_ERR); + + if ((kind = LCTF_INFO_KIND(src_fp, src_tp->ctt_info)) != + LCTF_INFO_KIND(dst_fp, dst_tp->ctt_info)) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + if (kind != CTF_K_STRUCT && kind != CTF_K_UNION) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + if ((n = LCTF_INFO_VLEN(src_fp, src_tp->ctt_info)) != + LCTF_INFO_VLEN(dst_fp, dst_tp->ctt_info)) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + + (void) ctf_get_ctt_size(src_fp, src_tp, &src_sz, &src_inc); + (void) ctf_get_ctt_size(dst_fp, dst_tp, &dst_sz, &dst_inc); + if (src_sz != dst_sz || src_inc != dst_inc) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + + if (src_sz < CTF_LSTRUCT_THRESH) { + const ctf_member_t *src_mp, *dst_mp; + + src_mp = (const ctf_member_t *)((uintptr_t)src_tp + src_inc); + dst_mp = (const ctf_member_t *)((uintptr_t)dst_tp + dst_inc); + for (; n != 0; n--, src_mp++, dst_mp++) { + if (src_mp->ctm_offset != dst_mp->ctm_offset) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + src_name = ctf_strptr(src_fp, src_mp->ctm_name); + dst_name = ctf_strptr(dst_fp, dst_mp->ctm_name); + if (strcmp(src_name, dst_name) != 0) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } + } else { + const ctf_lmember_t *src_mp, *dst_mp; + + src_mp = (const ctf_lmember_t *)((uintptr_t)src_tp + src_inc); + dst_mp = (const ctf_lmember_t *)((uintptr_t)dst_tp + dst_inc); + for (; n != 0; n--, src_mp++, dst_mp++) { + if (src_mp->ctlm_offsethi != dst_mp->ctlm_offsethi || + src_mp->ctlm_offsetlo != dst_mp->ctlm_offsetlo) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + src_name = ctf_strptr(src_fp, src_mp->ctlm_name); + dst_name = ctf_strptr(dst_fp, dst_mp->ctlm_name); + if (strcmp(src_name, dst_name) != 0) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } + } + + return (0); +} + /* * The ctf_add_type routine is used to copy a type from a source CTF container * to a dynamic destination container. This routine operates recursively by @@ -1460,23 +1514,15 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) ctf_dmdef_t *dmd; int errs = 0; - /* - * Technically to match a struct or union we need to check both - * ways (src members vs. dst, dst members vs. src) but we make - * this more optimal by only checking src vs. dst and comparing - * the total size of the structure (which we must do anyway) - * which covers the possibility of dst members not in src. - * This optimization can be defeated for unions, but is so - * pathological as to render it irrelevant for our purposes. - */ if (dst_type != CTF_ERR && dst_kind != CTF_K_FORWARD) { - if (ctf_type_size(src_fp, src_type) != - ctf_type_size(dst_fp, dst_type)) - return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); - - if (ctf_member_iter(src_fp, src_type, membcmp, &dst)) - return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); - + /* + * Compare the sizes and fields of the two types. + * The field comparisons only check the names and + * offsets, so this is not perfect but is good enough + * for scenarios that we care about. + */ + if (soucmp(src_fp, src_type, dst_fp, dst_type) != 0) + return (CTF_ERR); /* errno is set for us */ break; } From nobody Mon Nov 22 17:25:44 2021 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 C66D618A789E for ; Mon, 22 Nov 2021 17:25:46 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyZ164wdvz4bnY for ; Mon, 22 Nov 2021 17:25:46 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82b.google.com with SMTP id 8so17271770qtx.5 for ; Mon, 22 Nov 2021 09:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=l3Tp6AKMR0e55GDgrU79P/yJxcwdPCOmAAkhYbVICl4=; b=B7ha8e9m9rHyq8cDBNIkxmHO6cyKSODeaQ+at8/aHcf2zNoK/qCWDyMMLXl3jmGNcc OwCslhuoMFzJipRKx3V7I0NWvF/DchJFVY/1vwOGzzEA05k+KGyXWya8Qq2zRTLktWhA eIYFwt7NUeir0HFgNMdeUtF5JD/PJyskyRXAKGE4Jgw6I3xNMR3dRcxTH8fkQ4in9x7x /e3+2TFZLyWO3i/A+WoQhhffrRC7jpVobYZr1eGD8iXLdSww6xG4CyPOKebKATWB3BzC W9hFt5eUROVbnvN2+dj/AOsVnJAxp2yYv+gkVcSQZ5BaLp1zKe8Z49jaIK1vgr0z+VAK YIYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=l3Tp6AKMR0e55GDgrU79P/yJxcwdPCOmAAkhYbVICl4=; b=UkFDh2Bi2MtEdUshmrtXtSYihZfFFWH+dXUGn0ugOnJ4oidi1w+oGje1RqeBZFHtpA gsErNLE2EqIiAXTBUQ3T8aDMpZftWchpvnhSsDbU3tmY8lwUrUCYXZC36LJ69UIf+b8V noQ6KB0M0vVfua8zG0YKWP7JSHpLHKv9n/QRLJMm8XNiF4VzE5YfT9yadb1cnR/H4hXd ooyir1rsRlR7IrimFM20rLDtebrJ25rBaET+1yniE2zZSW9zJm0jWJHlF5f7Owsw27aI iQWLZAXkZwyOKyNy9G7xQ/Y1SJC88gVeENetxh1fzvmeAxvy6ldL2RaiJDCAIqGClo1c 1jFw== X-Gm-Message-State: AOAM531izAgtsQtdzaWv21IA4sAfDdRzJd0TOCvKY+WwmG6a7cJ3kefA tkX4j3gQUhv8u2yMEc2rn2/klg== X-Google-Smtp-Source: ABdhPJxsI7WTEjqtd1rzl1yAfsLa1sJEZaKuX8zoofIH2fo039zlz4ukcqidChrqm0Fh8euYBncwqg== X-Received: by 2002:ac8:7d46:: with SMTP id h6mr33059613qtb.379.1637601946150; Mon, 22 Nov 2021 09:25:46 -0800 (PST) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id k16sm4623559qtx.92.2021.11.22.09.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 09:25:45 -0800 (PST) Date: Mon, 22 Nov 2021 12:25:44 -0500 From: Shawn Webb To: Mark Johnston Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 68396709e73a - releng/12.3 - libctf: Improve check for duplicate SOU definitions in ctf_add_type() Message-ID: <20211122172544.a3wi636tajsnsfme@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202111221634.1AMGYoK4064366@gitrepo.freebsd.org> 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6n2yojvmhxmacvco" Content-Disposition: inline In-Reply-To: <202111221634.1AMGYoK4064366@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HyZ164wdvz4bnY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --6n2yojvmhxmacvco Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 22, 2021 at 04:34:50PM +0000, Mark Johnston wrote: > The branch releng/12.3 has been updated by markj: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D68396709e73a4cd392ffc06fde= 6bfa44d79118a7 >=20 > commit 68396709e73a4cd392ffc06fde6bfa44d79118a7 > Author: Mark Johnston > AuthorDate: 2021-10-04 16:28:22 +0000 > Commit: Mark Johnston > CommitDate: 2021-11-22 16:32:18 +0000 >=20 > libctf: Improve check for duplicate SOU definitions in ctf_add_type() > =20 > When copying a struct or union from one CTF container to another, > ctf_add_type() checks whether it matches an existing type in the > destination container. It does so by looking for a type with the same > name and kind as the new type, and if one exists, it iterates over all > members of the source type and checks whether a member with matching > name and offset exists in the matched destination type. This can > produce false positives, for example because member types are not > compared, but this is not expected to arise in practice. If the match > fails, ctf_add_type() returns an error. > =20 > The procedure used for member comparison breaks down in the face of > anonymous struct and union members. ctf_member_iter() visits each > member in the source definition and looks up the corresponding member= in > the desination definition by name using ctf_member_info(), but this > function will descend into anonymous members and thus fail to match. > Fix the problem by introducing a custom comparison routine which does > not assume member names are unique. This should also be faster for > types with many members; in the previous scheme, membcmp() would perf= orm > a linear scan of the desination type's members to perform a lookup by > name. The new routine steps through the members of both types in a > single loop. Hey Mark, Out of curiosity, would commits to releng branches necessitate an EN? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --6n2yojvmhxmacvco Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmGb0pUACgkQ/y5nonf4 4foDzQ//X8YXxXyUOJW4tZd8G/YkAjFYeGrEKZebnhb5HWBjZMlaM62jZ4HngxQA hw7C5biyZk9AWsghnvbuccLOzFn7IXV2CHJTDFWeNKLxfZ9xdwigBOVf9omAw0kE A6Zif1OT3QysH4YmrK5I3JuOhc02MIVP4lwjCH040c/k+fwgA5WToMO8MpDULuRk k9U2UbATWkZKpvKLrWD9m36/BkmmpfwjLot+3RpQXeDy9lwLrgEiA8gOO21holAt igyxJj/aqW3qB4wOsKIazCbW+aV654EUrQB1Sr7nzXyigEwg9+z8QSztAM86s7RG bZYBkQb8EZqDyKajHF+kuBcGZI8QhFs4S5AZrMHew1UuB2wD39fwHHhcOTpcdttT eGF2jrr3hpr3L3L0zFZgRuCHuucONm5pGClmTpTi69woFe4dQn4431bPpGkVj6vb BOMO5YynK729WPX0qA5jkq0gI+Yt/4pm8Oej+NUNbmq6XjTUTXXNhppNS+LXfHwd Ws6s49xVlqv4bwv7/SUaJPcdJ1HHbco6ZFB7Yd4lJ/RhirOw+NmkF3bUflKK2lyg r5xMfnK7Y+EJcSvFBJVEVD3utEVZ+lFc3Qbp1Fjh/ko6IJezHNI4FimJJMBiiKq8 rDf8kJ6paZoIdZ4MlZgGu4JSIi832L0JSCj03worELN4NM0sBjY= =64oi -----END PGP SIGNATURE----- --6n2yojvmhxmacvco-- From nobody Mon Nov 22 17:58:19 2021 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 7D7DD1890DAC; Mon, 22 Nov 2021 17:58:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyZkv2wLnz4qwG; Mon, 22 Nov 2021 17:58:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 38F589630; Mon, 22 Nov 2021 17:58:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f48.google.com with SMTP id b17so13031718qvl.9; Mon, 22 Nov 2021 09:58:31 -0800 (PST) X-Gm-Message-State: AOAM533jHtAuxFtQhSuVxAkJFL3/h9JQlvef4NUceoK5H0MTgh4Skh6W /4E3D0ZzSJLWdlr+sOTtU7ZAKsfUyLL1JCYGfVo= X-Google-Smtp-Source: ABdhPJyc+6XdnL9lpc9IurF8KNhQ9/chXr9g2fF5waqrUn/cv6ZtX5XJboxu9VsBzfszzjI+8rJrl/wdZ8x9guZrJqc= X-Received: by 2002:a0c:fa07:: with SMTP id q7mr102838644qvn.18.1637603910671; Mon, 22 Nov 2021 09:58:30 -0800 (PST) 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 References: <202111221634.1AMGYoK4064366@gitrepo.freebsd.org> <20211122172544.a3wi636tajsnsfme@mutt-hbsd> In-Reply-To: <20211122172544.a3wi636tajsnsfme@mutt-hbsd> From: Kyle Evans Date: Mon, 22 Nov 2021 11:58:19 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 68396709e73a - releng/12.3 - libctf: Improve check for duplicate SOU definitions in ctf_add_type() To: Shawn Webb Cc: Mark Johnston , src-committers , "" , dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-ThisMailContainsUnwantedMimeParts: N On Mon, Nov 22, 2021 at 11:25 AM Shawn Webb wrote: > > On Mon, Nov 22, 2021 at 04:34:50PM +0000, Mark Johnston wrote: > > The branch releng/12.3 has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=68396709e73a4cd392ffc06fde6bfa44d79118a7 > > > > commit 68396709e73a4cd392ffc06fde6bfa44d79118a7 > > Author: Mark Johnston > > AuthorDate: 2021-10-04 16:28:22 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-11-22 16:32:18 +0000 > > > > libctf: Improve check for duplicate SOU definitions in ctf_add_type() > > > > When copying a struct or union from one CTF container to another, > > ctf_add_type() checks whether it matches an existing type in the > > destination container. It does so by looking for a type with the same > > name and kind as the new type, and if one exists, it iterates over all > > members of the source type and checks whether a member with matching > > name and offset exists in the matched destination type. This can > > produce false positives, for example because member types are not > > compared, but this is not expected to arise in practice. If the match > > fails, ctf_add_type() returns an error. > > > > The procedure used for member comparison breaks down in the face of > > anonymous struct and union members. ctf_member_iter() visits each > > member in the source definition and looks up the corresponding member in > > the desination definition by name using ctf_member_info(), but this > > function will descend into anonymous members and thus fail to match. > > Fix the problem by introducing a custom comparison routine which does > > not assume member names are unique. This should also be faster for > > types with many members; in the previous scheme, membcmp() would perform > > a linear scan of the desination type's members to perform a lookup by > > name. The new routine steps through the members of both types in a > > single loop. > > Hey Mark, > > Out of curiosity, would commits to releng branches necessitate an EN? > > Thanks, > This is just the in-progress release branch, so not here, at least. From nobody Mon Nov 22 18:14:13 2021 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 0C010189B870; Mon, 22 Nov 2021 18:14:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hyb516rDlz3DsC; Mon, 22 Nov 2021 18:14:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA94F27722; Mon, 22 Nov 2021 18:14:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIEDxg098243; Mon, 22 Nov 2021 18:14:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIED8D098242; Mon, 22 Nov 2021 18:14:13 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:14:13 GMT Message-Id: <202111221814.1AMIED8D098242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 32a2fed6e71f896266d4c695754104d82a72c60d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=32a2fed6e71f896266d4c695754104d82a72c60d commit 32a2fed6e71f896266d4c695754104d82a72c60d Author: Allan Jude AuthorDate: 2021-11-19 15:14:30 +0000 Commit: Allan Jude CommitDate: 2021-11-22 18:12:20 +0000 openssl: Fix detection of ARMv7 and ARM64 CPU features OpenSSL assumes the same value for AT_HWCAP=16 (Linux) So it ends up calling elf_auxv_info() with AT_CANARY which returns ENOENT, and all acceleration features are disabled. With this, my ARM64 test machine runs the benchmark `openssl speed -evp aes-256-gcm` nearly 20x faster going from 100 MB/sec to 2000 MB/sec It also improves sha256 from 300 MB/sec to 1800 MB/sec This fix has been accepted but not yet merged upstream: https://github.com/openssl/openssl/pull/17082 PR: 259937 Reviewed by: manu, imp MFC after: immediate Relnotes: yes Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j") Sponsored by: Ampere Computing LLC Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D33060 (cherry picked from commit d9bb798725cfce9c72b80440659b48e8668eb10d) --- crypto/openssl/crypto/armcap.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crypto/openssl/crypto/armcap.c b/crypto/openssl/crypto/armcap.c index c5685bde5891..48c5d4d64e32 100644 --- a/crypto/openssl/crypto/armcap.c +++ b/crypto/openssl/crypto/armcap.c @@ -106,20 +106,23 @@ static unsigned long getauxval(unsigned long key) * ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas * AArch64 used AT_HWCAP. */ +# ifndef AT_HWCAP +# define AT_HWCAP 16 +# endif +# ifndef AT_HWCAP2 +# define AT_HWCAP2 26 +# endif # if defined(__arm__) || defined (__arm) -# define HWCAP 16 - /* AT_HWCAP */ +# define HWCAP AT_HWCAP # define HWCAP_NEON (1 << 12) -# define HWCAP_CE 26 - /* AT_HWCAP2 */ +# define HWCAP_CE AT_HWCAP2 # define HWCAP_CE_AES (1 << 0) # define HWCAP_CE_PMULL (1 << 1) # define HWCAP_CE_SHA1 (1 << 2) # define HWCAP_CE_SHA256 (1 << 3) # elif defined(__aarch64__) -# define HWCAP 16 - /* AT_HWCAP */ +# define HWCAP AT_HWCAP # define HWCAP_NEON (1 << 1) # define HWCAP_CE HWCAP From nobody Mon Nov 22 18:16:14 2021 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 B644D189BF62 for ; Mon, 22 Nov 2021 18:16:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hyb7T46vcz3FS7 for ; Mon, 22 Nov 2021 18:16:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82a.google.com with SMTP id n15so17456778qta.0 for ; Mon, 22 Nov 2021 10:16:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wWoZkPpLfahSZA+1EzULmiSKQcNOmq6SLUuMzur7IF0=; b=cAUoolXnHJwS2PR5dZFe9KysVyDWB8RgpcOTjt/YadUIQBxZbuoRQ3rHWOCWy2jlg+ 7R30gwEqwVRbiYGHLru2sLhj52RPaoonn0Ly5tkcS/ygXYnUXOfxygyLpeXAHG2iatEk Ul6SmdSEBk4Z/dIjHJvWRVlrpQF8T1WebYEa0+gKn7jCWj0lgFy24aCy5Racx40ks+m4 U+I4gTzZzNSqCGUZI3J9ZeFkcFDHSoDgxxRIZ9blHvMFMsCWcROfZ8jm01M6O04Rz8o7 ph+LEz09YzWlk1fTh++TAvrFmVz7w/hCaUVrg9oIFFFk2uHxxTw0d3psQOmeiK4tHlDW ehJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wWoZkPpLfahSZA+1EzULmiSKQcNOmq6SLUuMzur7IF0=; b=1JfVx7Ms9OhQr8sYjcX0nYABJT66FiW/fNYpUFiPYMQpemyA2ASDLz0VOja8E+PCn6 to6q4i7aYCPUJnFPBSb3BlvqQG3wpjGf+gfaMLuHv0FAnx8rQBPrwh1+3pcC72CTfTao tszFDTL+ivrrcG1gksJS3yUAUXZJYdMEkDcJUyVprlESmf/IjQw2YR+RED0eWqm3NVkM uHCjdQUU7BCaMnzxOAALarTiA30akUX0ZxSzIykul/VpFOVdzCLnoljVmO1c+8gtf9+m oiGS8AZ2m+xZVy3UUMDhUE0QjUDJ2Cy0KBvkqA2AJ/rQjTOyS4NuT/HFF8jr5xzhnmnk c6Fw== X-Gm-Message-State: AOAM533afKIx6HfYcepF9Nd3Hfa0xMJwhlxyMmJVIOi+gqfuLWs2xiZl zSwhs5cERE68ynToFF4SafkH2Q== X-Google-Smtp-Source: ABdhPJzsfSUKW5WJChOnFwurBNAEUH6yxdw05ZaZk0YQ9ZJNxO7bOKlXmqw8UijQUIhcf5tB5bQtiQ== X-Received: by 2002:a05:622a:590:: with SMTP id c16mr33411716qtb.289.1637604975667; Mon, 22 Nov 2021 10:16:15 -0800 (PST) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id bk25sm4760284qkb.13.2021.11.22.10.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 10:16:15 -0800 (PST) Date: Mon, 22 Nov 2021 13:16:14 -0500 From: Shawn Webb To: Kyle Evans Cc: Mark Johnston , src-committers , "" , dev-commits-src-branches@freebsd.org Subject: Re: git: 68396709e73a - releng/12.3 - libctf: Improve check for duplicate SOU definitions in ctf_add_type() Message-ID: <20211122181614.qiprd2oawy3h5ysa@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202111221634.1AMGYoK4064366@gitrepo.freebsd.org> <20211122172544.a3wi636tajsnsfme@mutt-hbsd> 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nvehbcspcrnalesi" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Hyb7T46vcz3FS7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --nvehbcspcrnalesi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 22, 2021 at 11:58:19AM -0600, Kyle Evans wrote: > On Mon, Nov 22, 2021 at 11:25 AM Shawn Webb = wrote: > > > > On Mon, Nov 22, 2021 at 04:34:50PM +0000, Mark Johnston wrote: > > > The branch releng/12.3 has been updated by markj: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D68396709e73a4cd392ffc0= 6fde6bfa44d79118a7 > > > > > > commit 68396709e73a4cd392ffc06fde6bfa44d79118a7 > > > Author: Mark Johnston > > > AuthorDate: 2021-10-04 16:28:22 +0000 > > > Commit: Mark Johnston > > > CommitDate: 2021-11-22 16:32:18 +0000 > > > > > > libctf: Improve check for duplicate SOU definitions in ctf_add_ty= pe() > > > > > > When copying a struct or union from one CTF container to another, > > > ctf_add_type() checks whether it matches an existing type in the > > > destination container. It does so by looking for a type with the= same > > > name and kind as the new type, and if one exists, it iterates ove= r all > > > members of the source type and checks whether a member with match= ing > > > name and offset exists in the matched destination type. This can > > > produce false positives, for example because member types are not > > > compared, but this is not expected to arise in practice. If the = match > > > fails, ctf_add_type() returns an error. > > > > > > The procedure used for member comparison breaks down in the face = of > > > anonymous struct and union members. ctf_member_iter() visits each > > > member in the source definition and looks up the corresponding me= mber in > > > the desination definition by name using ctf_member_info(), but th= is > > > function will descend into anonymous members and thus fail to mat= ch. > > > Fix the problem by introducing a custom comparison routine which = does > > > not assume member names are unique. This should also be faster f= or > > > types with many members; in the previous scheme, membcmp() would = perform > > > a linear scan of the desination type's members to perform a looku= p by > > > name. The new routine steps through the members of both types in= a > > > single loop. > > > > Hey Mark, > > > > Out of curiosity, would commits to releng branches necessitate an EN? > > > > Thanks, > > >=20 > This is just the in-progress release branch, so not here, at least. Ah. I should've paid closer attention. Thanks for the clarification. :-) --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --nvehbcspcrnalesi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmGb3mwACgkQ/y5nonf4 4fp8OQ//ZRMSX8uWU9qOGlTlvRxuoQrv09MexQAkHCpSa26Q0oR+zu+HoNggnsuX 7L+4i7JLoU46Qi4fgCtjRKdUOgFWT9nidc4/WnnWPasFKvthpE7a+3XEzvmXu53W cg1tviXkVSZpx7uR4SO0VQwgiJoiCpohKq5sD7hdDFmxivN+u/RPdr4/3iPKjs+C hPHYBfO+lsAhVDnyVvgLRxRnvo8J9gHCU4dgcTODNTQtD3vjs39xlzP54b03AH/u e5GyrPsuEGBn/Lc6osOWFvfIMENCE+/Sg3HEobu/fZfbVEkoMISKiytB/j6wNoFI QSSukNu7p6aj8+vBwovcCxiz3Y5fJ5vGKX6+jZ4ToWI/OgqE49UBIfPXGpCXnD/l c3vzSf5GYUA73HmKWUOqoEBKg99N+siA9EB4IhZZpZ+ol2tg4NtywH6BFKNymU66 X8FnIb0Oq0habX0SQrBt/nyOzVaGmvUZ3dxZDJJQXYWm6efmQ49SVHg8yZ7pRWm3 J+HjaKP4v9k25MOfMplttxOTfaL9Iwebxl0s4BpTYbXY11/B0Wf63LI3cXCjVUV0 DVl83hqGYc2v79nAW2IUHY7SGQAK+xde6UIrj4EGyhXLKA9jDrBQO00m+Mp9tXF3 z90CcyLnya7O3ckVdNMSqYzjnUtP+NrgH1sX/qum14744ZskQZM= =4mFH -----END PGP SIGNATURE----- --nvehbcspcrnalesi-- From nobody Mon Nov 22 18:19:58 2021 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 DCFCC189FC5E; Mon, 22 Nov 2021 18:20:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCh5vbHz3HQ5; Mon, 22 Nov 2021 18:20:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABE96273F8; Mon, 22 Nov 2021 18:20:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK0QW099528; Mon, 22 Nov 2021 18:20:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIJwq2098785; Mon, 22 Nov 2021 18:19:58 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:19:58 GMT Message-Id: <202111221819.1AMIJwq2098785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: ffd3ed2b58fb - stable/12 - wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ffd3ed2b58fb09435a08d4e32df3181038990a1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ffd3ed2b58fb09435a08d4e32df3181038990a1f commit ffd3ed2b58fb09435a08d4e32df3181038990a1f Author: Cy Schubert AuthorDate: 2021-09-03 13:07:19 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:30 +0000 wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff Merge vendor commits 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a, efec8223892b3e677acb46eae84ec3534989971f, and 2f6c3ea9600b494d24cac5a38c1cea0ac192245e. Tested by: philip (cherry picked from commit c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5) --- contrib/wpa/CONTRIBUTIONS | 5 +- contrib/wpa/hostapd/Android.mk | 1152 ++ contrib/wpa/hostapd/ChangeLog | 4 +- contrib/wpa/hostapd/Makefile | 1375 +++ contrib/wpa/hostapd/android.config | 214 + contrib/wpa/hostapd/config_file.c | 453 +- contrib/wpa/hostapd/ctrl_iface.c | 908 +- contrib/wpa/hostapd/defconfig | 35 +- contrib/wpa/hostapd/hostapd.android.rc | 19 + contrib/wpa/hostapd/hostapd.conf | 367 +- contrib/wpa/hostapd/hostapd.wpa_psk | 6 + contrib/wpa/hostapd/hostapd_cli.c | 128 +- contrib/wpa/hostapd/main.c | 22 +- contrib/wpa/hostapd/sae_pk_gen.c | 196 + contrib/wpa/hs20/client/Makefile | 55 +- contrib/wpa/hs20/client/est.c | 7 +- contrib/wpa/hs20/client/oma_dm_client.c | 2 +- contrib/wpa/hs20/client/osu_client.c | 27 +- contrib/wpa/hs20/client/osu_client.h | 2 + contrib/wpa/hs20/client/spp_client.c | 2 +- contrib/wpa/hs20/server/Makefile | 42 + contrib/wpa/hs20/server/ca/clean.sh | 13 + contrib/wpa/hs20/server/ca/est-csrattrs.cnf | 17 + contrib/wpa/hs20/server/ca/est-csrattrs.sh | 4 + contrib/wpa/hs20/server/ca/hs20.oid | 7 + contrib/wpa/hs20/server/ca/ocsp-req.sh | 11 + contrib/wpa/hs20/server/ca/ocsp-responder-ica.sh | 3 + contrib/wpa/hs20/server/ca/ocsp-responder.sh | 3 + contrib/wpa/hs20/server/ca/ocsp-update-cache.sh | 11 + contrib/wpa/hs20/server/ca/openssl-root.cnf | 125 + contrib/wpa/hs20/server/ca/openssl.cnf | 200 + contrib/wpa/hs20/server/ca/setup.sh | 209 + contrib/wpa/hs20/server/ca/w1fi_logo.png | Bin 0 -> 7549 bytes contrib/wpa/hs20/server/hs20-osu-server.txt | 262 + contrib/wpa/hs20/server/hs20_spp_server.c | 207 + contrib/wpa/hs20/server/spp_server.c | 2933 +++++ contrib/wpa/hs20/server/spp_server.h | 36 + contrib/wpa/hs20/server/sql-example.txt | 17 + contrib/wpa/hs20/server/sql.txt | 108 + contrib/wpa/hs20/server/www/add-free.php | 50 + contrib/wpa/hs20/server/www/add-mo.php | 56 + contrib/wpa/hs20/server/www/cert-enroll.php | 39 + contrib/wpa/hs20/server/www/config.php | 7 + contrib/wpa/hs20/server/www/est.php | 232 + contrib/wpa/hs20/server/www/free-remediation.php | 19 + contrib/wpa/hs20/server/www/free.php | 23 + contrib/wpa/hs20/server/www/redirect.php | 32 + contrib/wpa/hs20/server/www/remediation-pw.php | 41 + contrib/wpa/hs20/server/www/remediation.php | 55 + contrib/wpa/hs20/server/www/signup.php | 59 + contrib/wpa/hs20/server/www/spp.php | 168 + contrib/wpa/hs20/server/www/terms.php | 87 + contrib/wpa/hs20/server/www/users.php | 377 + contrib/wpa/src/Makefile | 12 + contrib/wpa/src/ap/Makefile | 60 + contrib/wpa/src/ap/acs.c | 357 +- contrib/wpa/src/ap/airtime_policy.c | 12 +- contrib/wpa/src/ap/ap_config.c | 298 +- contrib/wpa/src/ap/ap_config.h | 135 +- contrib/wpa/src/ap/ap_drv_ops.c | 158 +- contrib/wpa/src/ap/ap_drv_ops.h | 51 +- contrib/wpa/src/ap/ap_list.c | 4 - contrib/wpa/src/ap/authsrv.c | 87 +- contrib/wpa/src/ap/beacon.c | 609 +- contrib/wpa/src/ap/beacon.h | 2 + contrib/wpa/src/ap/ctrl_iface_ap.c | 85 +- contrib/wpa/src/ap/dfs.c | 330 +- contrib/wpa/src/ap/dfs.h | 3 + contrib/wpa/src/ap/dhcp_snoop.c | 8 +- contrib/wpa/src/ap/dpp_hostapd.c | 1025 +- contrib/wpa/src/ap/dpp_hostapd.h | 11 + contrib/wpa/src/ap/drv_callbacks.c | 362 +- contrib/wpa/src/ap/fils_hlp.c | 36 +- contrib/wpa/src/ap/gas_serv.c | 10 +- contrib/wpa/src/ap/hostapd.c | 282 +- contrib/wpa/src/ap/hostapd.h | 59 +- contrib/wpa/src/ap/hs20.c | 6 +- contrib/wpa/src/ap/hw_features.c | 373 +- contrib/wpa/src/ap/hw_features.h | 22 +- contrib/wpa/src/ap/ieee802_11.c | 2516 +++- contrib/wpa/src/ap/ieee802_11.h | 24 +- contrib/wpa/src/ap/ieee802_11_auth.c | 172 +- contrib/wpa/src/ap/ieee802_11_auth.h | 17 +- contrib/wpa/src/ap/ieee802_11_he.c | 189 +- contrib/wpa/src/ap/ieee802_11_ht.c | 30 +- contrib/wpa/src/ap/ieee802_11_shared.c | 189 +- contrib/wpa/src/ap/ieee802_11_vht.c | 176 +- contrib/wpa/src/ap/ieee802_1x.c | 482 +- contrib/wpa/src/ap/ieee802_1x.h | 7 +- contrib/wpa/src/ap/neighbor_db.c | 58 +- contrib/wpa/src/ap/neighbor_db.h | 1 + contrib/wpa/src/ap/pmksa_cache_auth.c | 6 + contrib/wpa/src/ap/preauth_auth.c | 2 +- contrib/wpa/src/ap/sta_info.c | 111 +- contrib/wpa/src/ap/sta_info.h | 54 +- contrib/wpa/src/ap/utils.c | 4 + contrib/wpa/src/ap/vlan_init.c | 5 +- contrib/wpa/src/ap/wmm.c | 14 +- contrib/wpa/src/ap/wnm_ap.c | 83 +- contrib/wpa/src/ap/wpa_auth.c | 1415 ++- contrib/wpa/src/ap/wpa_auth.h | 103 +- contrib/wpa/src/ap/wpa_auth_ft.c | 385 +- contrib/wpa/src/ap/wpa_auth_glue.c | 343 +- contrib/wpa/src/ap/wpa_auth_i.h | 71 +- contrib/wpa/src/ap/wpa_auth_ie.c | 444 +- contrib/wpa/src/ap/wpa_auth_ie.h | 35 - contrib/wpa/src/ap/wpa_auth_kay.c | 12 +- contrib/wpa/src/ap/wps_hostapd.c | 237 +- contrib/wpa/src/build.rules | 109 + contrib/wpa/src/common/Makefile | 16 + contrib/wpa/src/common/brcm_vendor.h | 156 + contrib/wpa/src/common/common_module_tests.c | 513 +- contrib/wpa/src/common/defs.h | 86 +- contrib/wpa/src/common/dhcp.h | 2 +- contrib/wpa/src/common/dpp.c | 11695 +++++------------- contrib/wpa/src/common/dpp.h | 248 +- contrib/wpa/src/common/dpp_auth.c | 1977 +++ contrib/wpa/src/common/dpp_backup.c | 1265 ++ contrib/wpa/src/common/dpp_crypto.c | 3329 +++++ contrib/wpa/src/common/dpp_i.h | 160 + contrib/wpa/src/common/dpp_pkex.c | 1324 ++ contrib/wpa/src/common/dpp_reconfig.c | 958 ++ contrib/wpa/src/common/dpp_tcp.c | 1824 +++ contrib/wpa/src/common/gas_server.c | 140 +- contrib/wpa/src/common/gas_server.h | 9 +- contrib/wpa/src/common/hw_features_common.c | 427 +- contrib/wpa/src/common/hw_features_common.h | 26 +- contrib/wpa/src/common/ieee802_11_common.c | 789 +- contrib/wpa/src/common/ieee802_11_common.h | 70 +- contrib/wpa/src/common/ieee802_11_defs.h | 249 +- contrib/wpa/src/common/linux_bridge.h | 39 + contrib/wpa/src/common/linux_vlan.h | 52 + contrib/wpa/src/common/ocv.c | 39 +- contrib/wpa/src/common/ocv.h | 13 +- contrib/wpa/src/common/privsep_commands.h | 1 + contrib/wpa/src/common/ptksa_cache.c | 321 + contrib/wpa/src/common/ptksa_cache.h | 79 + contrib/wpa/src/common/qca-vendor.h | 4187 ++++++- contrib/wpa/src/common/sae.c | 1387 ++- contrib/wpa/src/common/sae.h | 109 +- contrib/wpa/src/common/sae_pk.c | 884 ++ contrib/wpa/src/common/version.h | 2 +- contrib/wpa/src/common/wpa_common.c | 1240 +- contrib/wpa/src/common/wpa_common.h | 207 +- contrib/wpa/src/common/wpa_ctrl.c | 5 +- contrib/wpa/src/common/wpa_ctrl.h | 41 +- contrib/wpa/src/crypto/Makefile | 60 + contrib/wpa/src/crypto/crypto.h | 49 +- contrib/wpa/src/crypto/crypto_module_tests.c | 150 + contrib/wpa/src/crypto/crypto_openssl.c | 250 + contrib/wpa/src/crypto/crypto_wolfssl.c | 77 +- contrib/wpa/src/crypto/sha256.c | 6 +- contrib/wpa/src/crypto/sha384-tlsprf.c | 71 + contrib/wpa/src/crypto/sha384.c | 6 +- contrib/wpa/src/crypto/sha384.h | 3 + contrib/wpa/src/crypto/sha512.c | 6 +- contrib/wpa/src/crypto/tls.h | 14 + contrib/wpa/src/crypto/tls_openssl.c | 304 +- contrib/wpa/src/crypto/tls_wolfssl.c | 65 +- contrib/wpa/src/drivers/Makefile | 9 + contrib/wpa/src/drivers/android_drv.h | 56 + contrib/wpa/src/drivers/driver.h | 716 +- contrib/wpa/src/drivers/driver_atheros.c | 41 +- contrib/wpa/src/drivers/driver_bsd.c | 659 +- contrib/wpa/src/drivers/driver_common.c | 21 + contrib/wpa/src/drivers/driver_hostap.c | 24 +- contrib/wpa/src/drivers/driver_hostap.h | 210 + contrib/wpa/src/drivers/driver_macsec_linux.c | 87 +- contrib/wpa/src/drivers/driver_macsec_qca.c | 34 +- contrib/wpa/src/drivers/driver_ndis.c | 47 +- contrib/wpa/src/drivers/driver_nl80211.c | 12229 +++++++++++++++++++ contrib/wpa/src/drivers/driver_nl80211.h | 65 +- contrib/wpa/src/drivers/driver_nl80211_android.c | 4 +- contrib/wpa/src/drivers/driver_nl80211_capa.c | 579 +- contrib/wpa/src/drivers/driver_nl80211_event.c | 580 +- contrib/wpa/src/drivers/driver_nl80211_monitor.c | 3 + contrib/wpa/src/drivers/driver_nl80211_scan.c | 51 +- contrib/wpa/src/drivers/driver_none.c | 77 + contrib/wpa/src/drivers/driver_openbsd.c | 10 +- contrib/wpa/src/drivers/driver_privsep.c | 18 +- contrib/wpa/src/drivers/driver_roboswitch.c | 487 + contrib/wpa/src/drivers/driver_wext.c | 2499 ++++ contrib/wpa/src/drivers/driver_wext.h | 77 + contrib/wpa/src/drivers/drivers.mak | 220 + contrib/wpa/src/drivers/drivers.mk | 196 + contrib/wpa/src/drivers/linux_ioctl.c | 237 + contrib/wpa/src/drivers/linux_ioctl.h | 23 + contrib/wpa/src/drivers/linux_wext.h | 45 + contrib/wpa/src/drivers/netlink.c | 226 + contrib/wpa/src/drivers/netlink.h | 28 + contrib/wpa/src/drivers/nl80211_copy.h | 973 +- contrib/wpa/src/drivers/priv_netlink.h | 109 + contrib/wpa/src/drivers/rfkill.c | 224 + contrib/wpa/src/drivers/rfkill.h | 25 + contrib/wpa/src/eap_common/Makefile | 18 + contrib/wpa/src/eap_common/eap_common.c | 8 +- contrib/wpa/src/eap_common/eap_common.h | 8 +- contrib/wpa/src/eap_common/eap_defs.h | 4 +- contrib/wpa/src/eap_common/eap_sim_common.c | 28 + contrib/wpa/src/eap_common/eap_teap_common.c | 72 +- contrib/wpa/src/eap_common/eap_teap_common.h | 22 +- contrib/wpa/src/eap_peer/Makefile | 7 + contrib/wpa/src/eap_peer/eap.c | 220 +- contrib/wpa/src/eap_peer/eap.h | 13 +- contrib/wpa/src/eap_peer/eap_aka.c | 48 +- contrib/wpa/src/eap_peer/eap_config.h | 408 +- contrib/wpa/src/eap_peer/eap_eke.c | 16 +- contrib/wpa/src/eap_peer/eap_fast.c | 54 +- contrib/wpa/src/eap_peer/eap_gpsk.c | 14 +- contrib/wpa/src/eap_peer/eap_gtc.c | 8 +- contrib/wpa/src/eap_peer/eap_i.h | 42 +- contrib/wpa/src/eap_peer/eap_ikev2.c | 28 +- contrib/wpa/src/eap_peer/eap_leap.c | 44 +- contrib/wpa/src/eap_peer/eap_md5.c | 12 +- contrib/wpa/src/eap_peer/eap_methods.c | 12 +- contrib/wpa/src/eap_peer/eap_methods.h | 14 +- contrib/wpa/src/eap_peer/eap_mschapv2.c | 32 +- contrib/wpa/src/eap_peer/eap_otp.c | 8 +- contrib/wpa/src/eap_peer/eap_pax.c | 50 +- contrib/wpa/src/eap_peer/eap_peap.c | 71 +- contrib/wpa/src/eap_peer/eap_psk.c | 22 +- contrib/wpa/src/eap_peer/eap_pwd.c | 22 +- contrib/wpa/src/eap_peer/eap_sake.c | 26 +- contrib/wpa/src/eap_peer/eap_sim.c | 44 +- contrib/wpa/src/eap_peer/eap_teap.c | 201 +- contrib/wpa/src/eap_peer/eap_tls.c | 42 +- contrib/wpa/src/eap_peer/eap_tls_common.c | 103 +- contrib/wpa/src/eap_peer/eap_tls_common.h | 10 +- contrib/wpa/src/eap_peer/eap_tnc.c | 32 +- contrib/wpa/src/eap_peer/eap_ttls.c | 88 +- contrib/wpa/src/eap_peer/eap_vendor_test.c | 16 +- contrib/wpa/src/eap_peer/eap_wsc.c | 24 +- contrib/wpa/src/eap_peer/ikev2.c | 10 +- contrib/wpa/src/eap_peer/tncc.c | 5 +- contrib/wpa/src/eap_server/Makefile | 8 + contrib/wpa/src/eap_server/eap.h | 172 +- contrib/wpa/src/eap_server/eap_i.h | 67 +- contrib/wpa/src/eap_server/eap_methods.h | 9 +- contrib/wpa/src/eap_server/eap_server.c | 291 +- contrib/wpa/src/eap_server/eap_server_aka.c | 74 +- contrib/wpa/src/eap_server/eap_server_eke.c | 39 +- contrib/wpa/src/eap_server/eap_server_fast.c | 106 +- contrib/wpa/src/eap_server/eap_server_gpsk.c | 37 +- contrib/wpa/src/eap_server/eap_server_gtc.c | 12 +- contrib/wpa/src/eap_server/eap_server_identity.c | 14 +- contrib/wpa/src/eap_server/eap_server_ikev2.c | 22 +- contrib/wpa/src/eap_server/eap_server_md5.c | 14 +- contrib/wpa/src/eap_server/eap_server_methods.c | 10 +- contrib/wpa/src/eap_server/eap_server_mschapv2.c | 22 +- contrib/wpa/src/eap_server/eap_server_pax.c | 32 +- contrib/wpa/src/eap_server/eap_server_peap.c | 103 +- contrib/wpa/src/eap_server/eap_server_psk.c | 34 +- contrib/wpa/src/eap_server/eap_server_pwd.c | 22 +- contrib/wpa/src/eap_server/eap_server_sake.c | 38 +- contrib/wpa/src/eap_server/eap_server_sim.c | 66 +- contrib/wpa/src/eap_server/eap_server_teap.c | 309 +- contrib/wpa/src/eap_server/eap_server_tls.c | 54 +- contrib/wpa/src/eap_server/eap_server_tls_common.c | 93 +- contrib/wpa/src/eap_server/eap_server_tnc.c | 26 +- contrib/wpa/src/eap_server/eap_server_ttls.c | 96 +- .../wpa/src/eap_server/eap_server_vendor_test.c | 12 +- contrib/wpa/src/eap_server/eap_server_wsc.c | 32 +- contrib/wpa/src/eap_server/eap_tls_common.h | 2 +- contrib/wpa/src/eap_server/tncs.c | 5 +- contrib/wpa/src/eapol_auth/Makefile | 2 + contrib/wpa/src/eapol_auth/eapol_auth_sm.c | 206 +- contrib/wpa/src/eapol_auth/eapol_auth_sm.h | 26 +- contrib/wpa/src/eapol_auth/eapol_auth_sm_i.h | 40 +- contrib/wpa/src/eapol_supp/Makefile | 5 + contrib/wpa/src/eapol_supp/eapol_supp_sm.c | 218 +- contrib/wpa/src/eapol_supp/eapol_supp_sm.h | 29 +- contrib/wpa/src/fst/fst.c | 25 +- contrib/wpa/src/fst/fst.h | 23 +- contrib/wpa/src/fst/fst_ctrl_aux.h | 4 +- contrib/wpa/src/fst/fst_ctrl_iface.c | 48 +- contrib/wpa/src/fst/fst_ctrl_iface.h | 2 +- contrib/wpa/src/fst/fst_group.c | 10 +- contrib/wpa/src/fst/fst_group.h | 4 +- contrib/wpa/src/fst/fst_iface.c | 8 +- contrib/wpa/src/fst/fst_iface.h | 8 +- contrib/wpa/src/fst/fst_session.c | 96 +- contrib/wpa/src/fst/fst_session.h | 12 +- contrib/wpa/src/l2_packet/Makefile | 3 + contrib/wpa/src/l2_packet/l2_packet.h | 4 + contrib/wpa/src/l2_packet/l2_packet_freebsd.c | 5 +- contrib/wpa/src/l2_packet/l2_packet_linux.c | 515 + contrib/wpa/src/l2_packet/l2_packet_ndis.c | 3 +- contrib/wpa/src/l2_packet/l2_packet_none.c | 4 +- contrib/wpa/src/l2_packet/l2_packet_pcap.c | 400 + contrib/wpa/src/l2_packet/l2_packet_privsep.c | 3 +- contrib/wpa/src/l2_packet/l2_packet_winpcap.c | 350 + contrib/wpa/src/lib.rules | 29 + contrib/wpa/src/objs.mk | 3 + contrib/wpa/src/p2p/Makefile | 16 + contrib/wpa/src/p2p/p2p.c | 147 +- contrib/wpa/src/p2p/p2p.h | 31 +- contrib/wpa/src/p2p/p2p_go_neg.c | 9 + contrib/wpa/src/p2p/p2p_i.h | 5 + contrib/wpa/src/p2p/p2p_invitation.c | 5 +- contrib/wpa/src/p2p/p2p_utils.c | 39 + contrib/wpa/src/pae/ieee802_1x_cp.c | 177 +- contrib/wpa/src/pae/ieee802_1x_cp.h | 10 +- contrib/wpa/src/pae/ieee802_1x_kay.c | 608 +- contrib/wpa/src/pae/ieee802_1x_kay.h | 68 +- contrib/wpa/src/pae/ieee802_1x_kay_i.h | 40 +- contrib/wpa/src/pae/ieee802_1x_secy_ops.c | 22 +- contrib/wpa/src/pae/ieee802_1x_secy_ops.h | 8 +- contrib/wpa/src/radius/Makefile | 9 + contrib/wpa/src/radius/radius.c | 2 +- contrib/wpa/src/radius/radius.h | 3 + contrib/wpa/src/radius/radius_client.c | 55 +- contrib/wpa/src/radius/radius_client.h | 5 + contrib/wpa/src/radius/radius_server.c | 283 +- contrib/wpa/src/radius/radius_server.h | 142 +- contrib/wpa/src/rsn_supp/Makefile | 14 + contrib/wpa/src/rsn_supp/pmksa_cache.c | 54 +- contrib/wpa/src/rsn_supp/pmksa_cache.h | 7 +- contrib/wpa/src/rsn_supp/preauth.c | 24 +- contrib/wpa/src/rsn_supp/tdls.c | 71 +- contrib/wpa/src/rsn_supp/wpa.c | 759 +- contrib/wpa/src/rsn_supp/wpa.h | 93 +- contrib/wpa/src/rsn_supp/wpa_ft.c | 399 +- contrib/wpa/src/rsn_supp/wpa_i.h | 88 +- contrib/wpa/src/rsn_supp/wpa_ie.c | 317 +- contrib/wpa/src/rsn_supp/wpa_ie.h | 52 +- contrib/wpa/src/tls/Makefile | 25 + contrib/wpa/src/tls/asn1.c | 396 +- contrib/wpa/src/tls/asn1.h | 146 +- contrib/wpa/src/tls/pkcs1.c | 55 +- contrib/wpa/src/tls/pkcs5.c | 78 +- contrib/wpa/src/tls/pkcs8.c | 59 +- contrib/wpa/src/tls/rsa.c | 23 +- contrib/wpa/src/tls/tlsv1_client.c | 29 +- contrib/wpa/src/tls/tlsv1_client_i.h | 4 +- contrib/wpa/src/tls/tlsv1_client_ocsp.c | 180 +- contrib/wpa/src/tls/tlsv1_client_read.c | 10 +- contrib/wpa/src/tls/tlsv1_client_write.c | 18 +- contrib/wpa/src/tls/tlsv1_cred.c | 247 +- contrib/wpa/src/tls/x509v3.c | 419 +- contrib/wpa/src/tls/x509v3.h | 7 + contrib/wpa/src/utils/Makefile | 30 + contrib/wpa/src/utils/base64.c | 59 +- contrib/wpa/src/utils/base64.h | 13 +- contrib/wpa/src/utils/browser-android.c | 2 +- contrib/wpa/src/utils/browser-system.c | 2 +- contrib/wpa/src/utils/browser-wpadebug.c | 2 +- contrib/wpa/src/utils/browser.c | 210 +- contrib/wpa/src/utils/browser.h | 4 +- contrib/wpa/src/utils/common.c | 38 +- contrib/wpa/src/utils/common.h | 8 +- contrib/wpa/src/utils/config.c | 97 + contrib/wpa/src/utils/config.h | 29 + contrib/wpa/src/utils/eloop.c | 47 +- contrib/wpa/src/utils/eloop_win.c | 8 +- contrib/wpa/src/utils/ext_password.c | 3 + contrib/wpa/src/utils/ext_password_file.c | 136 + contrib/wpa/src/utils/ext_password_i.h | 4 + contrib/wpa/src/utils/http-utils.h | 6 +- contrib/wpa/src/utils/includes.h | 1 + contrib/wpa/src/utils/json.c | 122 +- contrib/wpa/src/utils/json.h | 15 + contrib/wpa/src/utils/list.h | 8 +- contrib/wpa/src/utils/os_internal.c | 6 + contrib/wpa/src/utils/os_unix.c | 46 +- contrib/wpa/src/utils/platform.h | 23 +- contrib/wpa/src/utils/radiotap.c | 12 +- contrib/wpa/src/utils/radiotap.h | 407 +- contrib/wpa/src/utils/state_machine.h | 8 +- contrib/wpa/src/utils/trace.c | 11 + contrib/wpa/src/utils/utils_module_tests.c | 39 +- contrib/wpa/src/utils/wpa_debug.c | 147 +- contrib/wpa/src/utils/wpa_debug.h | 3 - contrib/wpa/src/utils/wpabuf.h | 27 + contrib/wpa/src/utils/xml_libxml2.c | 2 +- contrib/wpa/src/wps/Makefile | 28 + contrib/wpa/src/wps/upnp_xml.c | 2 +- contrib/wpa/src/wps/wps.h | 23 +- contrib/wpa/src/wps/wps_attr_build.c | 15 +- contrib/wpa/src/wps/wps_attr_process.c | 9 +- contrib/wpa/src/wps/wps_dev_attr.c | 17 + contrib/wpa/src/wps/wps_dev_attr.h | 1 + contrib/wpa/src/wps/wps_enrollee.c | 11 + contrib/wpa/src/wps/wps_er.c | 4 +- contrib/wpa/src/wps/wps_registrar.c | 139 +- contrib/wpa/src/wps/wps_upnp.c | 28 +- contrib/wpa/src/wps/wps_upnp_ap.c | 4 +- contrib/wpa/src/wps/wps_upnp_event.c | 27 +- contrib/wpa/src/wps/wps_upnp_i.h | 9 +- contrib/wpa/src/wps/wps_upnp_web.c | 4 +- contrib/wpa/wpa_supplicant/Android.mk | 114 +- contrib/wpa/wpa_supplicant/ChangeLog | 10 +- contrib/wpa/wpa_supplicant/Makefile | 2073 ++++ contrib/wpa/wpa_supplicant/README | 4 +- contrib/wpa/wpa_supplicant/README-DPP | 71 +- contrib/wpa/wpa_supplicant/README-HS20 | 2 +- contrib/wpa/wpa_supplicant/android.config | 16 +- contrib/wpa/wpa_supplicant/ap.c | 257 +- contrib/wpa/wpa_supplicant/binder/binder.h | 2 +- contrib/wpa/wpa_supplicant/bss.c | 145 +- contrib/wpa/wpa_supplicant/bss.h | 25 +- contrib/wpa/wpa_supplicant/bssid_ignore.c | 221 + contrib/wpa/wpa_supplicant/bssid_ignore.h | 33 + contrib/wpa/wpa_supplicant/config.c | 644 +- contrib/wpa/wpa_supplicant/config.h | 129 +- contrib/wpa/wpa_supplicant/config_file.c | 243 +- contrib/wpa/wpa_supplicant/config_ssid.h | 155 +- contrib/wpa/wpa_supplicant/config_winreg.c | 1061 ++ contrib/wpa/wpa_supplicant/ctrl_iface.c | 1375 ++- contrib/wpa/wpa_supplicant/ctrl_iface.h | 16 +- contrib/wpa/wpa_supplicant/ctrl_iface_named_pipe.c | 7 +- contrib/wpa/wpa_supplicant/ctrl_iface_udp.c | 63 +- contrib/wpa/wpa_supplicant/ctrl_iface_unix.c | 73 +- contrib/wpa/wpa_supplicant/dbus/dbus_common.c | 23 +- contrib/wpa/wpa_supplicant/dbus/dbus_new.c | 76 +- .../wpa/wpa_supplicant/dbus/dbus_new_handlers.c | 424 +- .../wpa/wpa_supplicant/dbus/dbus_new_handlers.h | 6 + .../wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 84 +- .../wpa/wpa_supplicant/dbus/dbus_new_introspect.c | 2 +- contrib/wpa/wpa_supplicant/defconfig | 45 +- contrib/wpa/wpa_supplicant/doc/docbook/Makefile | 28 + .../wpa/wpa_supplicant/doc/docbook/eapol_test.sgml | 209 + .../wpa_supplicant/doc/docbook/wpa_background.sgml | 105 + .../wpa/wpa_supplicant/doc/docbook/wpa_cli.sgml | 360 + .../wpa/wpa_supplicant/doc/docbook/wpa_gui.sgml | 106 + .../wpa_supplicant/doc/docbook/wpa_passphrase.sgml | 77 + .../wpa/wpa_supplicant/doc/docbook/wpa_priv.sgml | 152 + .../doc/docbook/wpa_supplicant.conf.sgml | 243 + .../wpa_supplicant/doc/docbook/wpa_supplicant.sgml | 764 ++ contrib/wpa/wpa_supplicant/dpp_supplicant.c | 1808 ++- contrib/wpa/wpa_supplicant/dpp_supplicant.h | 15 + contrib/wpa/wpa_supplicant/driver_i.h | 109 +- contrib/wpa/wpa_supplicant/eapol_test.c | 15 +- contrib/wpa/wpa_supplicant/events.c | 1537 ++- contrib/wpa/wpa_supplicant/examples/dpp-nfc.py | 1186 ++ .../wpa_supplicant/examples/p2p-action-udhcp.sh | 4 +- contrib/wpa/wpa_supplicant/examples/p2p-action.sh | 4 +- .../wpa/wpa_supplicant/examples/p2p/p2p_connect.py | 18 +- .../wpa_supplicant/examples/p2p/p2p_disconnect.py | 2 +- .../wpa/wpa_supplicant/examples/p2p/p2p_find.py | 2 +- .../wpa/wpa_supplicant/examples/p2p/p2p_flush.py | 2 +- .../wpa_supplicant/examples/p2p/p2p_group_add.py | 14 +- .../wpa/wpa_supplicant/examples/p2p/p2p_invite.py | 10 +- .../wpa/wpa_supplicant/examples/p2p/p2p_listen.py | 2 +- .../wpa_supplicant/examples/p2p/p2p_stop_find.py | 2 +- .../wpa/wpa_supplicant/examples/udhcpd-p2p.conf | 12 +- contrib/wpa/wpa_supplicant/gas_query.c | 62 +- contrib/wpa/wpa_supplicant/gas_query.h | 2 +- contrib/wpa/wpa_supplicant/hs20_supplicant.c | 30 +- contrib/wpa/wpa_supplicant/ibss_rsn.c | 45 +- contrib/wpa/wpa_supplicant/interworking.c | 66 +- contrib/wpa/wpa_supplicant/interworking.h | 2 +- contrib/wpa/wpa_supplicant/main.c | 10 +- contrib/wpa/wpa_supplicant/main_winmain.c | 78 + contrib/wpa/wpa_supplicant/main_winsvc.c | 458 + contrib/wpa/wpa_supplicant/mbo.c | 30 + contrib/wpa/wpa_supplicant/mesh.c | 243 +- contrib/wpa/wpa_supplicant/mesh.h | 6 +- contrib/wpa/wpa_supplicant/mesh_mpm.c | 49 +- contrib/wpa/wpa_supplicant/mesh_rsn.c | 27 +- contrib/wpa/wpa_supplicant/nmake.mak | 2 +- contrib/wpa/wpa_supplicant/notify.c | 10 +- contrib/wpa/wpa_supplicant/offchannel.c | 6 +- contrib/wpa/wpa_supplicant/op_classes.c | 239 +- contrib/wpa/wpa_supplicant/p2p_supplicant.c | 667 +- contrib/wpa/wpa_supplicant/p2p_supplicant.h | 32 +- contrib/wpa/wpa_supplicant/pasn_supplicant.c | 1714 +++ contrib/wpa/wpa_supplicant/preauth_test.c | 20 +- contrib/wpa/wpa_supplicant/robust_av.c | 155 + contrib/wpa/wpa_supplicant/rrm.c | 91 +- contrib/wpa/wpa_supplicant/scan.c | 703 +- contrib/wpa/wpa_supplicant/scan.h | 33 + contrib/wpa/wpa_supplicant/sme.c | 531 +- contrib/wpa/wpa_supplicant/sme.h | 8 +- .../systemd/wpa_supplicant-nl80211.service.arg.in | 2 +- .../systemd/wpa_supplicant-wired.service.arg.in | 2 +- .../systemd/wpa_supplicant.service.arg.in | 2 +- contrib/wpa/wpa_supplicant/twt.c | 142 + .../vs2005/eapol_test/eapol_test.vcproj | 6 +- .../vs2005/wpa_supplicant/wpa_supplicant.vcproj | 6 +- .../wpa/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj | 6 +- contrib/wpa/wpa_supplicant/wmm_ac.c | 2 +- contrib/wpa/wpa_supplicant/wnm_sta.c | 33 +- contrib/wpa/wpa_supplicant/wpa_cli.c | 339 +- contrib/wpa/wpa_supplicant/wpa_passphrase.c | 8 +- contrib/wpa/wpa_supplicant/wpa_priv.c | 32 +- contrib/wpa/wpa_supplicant/wpa_supplicant.c | 1283 +- contrib/wpa/wpa_supplicant/wpa_supplicant.conf | 196 +- contrib/wpa/wpa_supplicant/wpa_supplicant_i.h | 249 +- contrib/wpa/wpa_supplicant/wpas_glue.c | 222 +- contrib/wpa/wpa_supplicant/wpas_glue.h | 2 + contrib/wpa/wpa_supplicant/wpas_kay.c | 12 +- contrib/wpa/wpa_supplicant/wpas_module_tests.c | 85 +- contrib/wpa/wpa_supplicant/wps_supplicant.c | 85 +- contrib/wpa/wpa_supplicant/wps_supplicant.h | 5 + usr.sbin/wpa/src/common/Makefile | 2 + usr.sbin/wpa/src/crypto/Makefile | 5 +- usr.sbin/wpa/src/utils/Makefile | 2 + usr.sbin/wpa/wpa_supplicant/Makefile | 7 +- 498 files changed, 92625 insertions(+), 20522 deletions(-) diff --git a/contrib/wpa/CONTRIBUTIONS b/contrib/wpa/CONTRIBUTIONS index c81ad640995a..1b4caf7ac811 100644 --- a/contrib/wpa/CONTRIBUTIONS +++ b/contrib/wpa/CONTRIBUTIONS @@ -56,6 +56,9 @@ In general, the best way of generating a suitable formatted patch file is by committing the changes to a cloned git repository and using git format-patch. The patch can then be sent, e.g., with git send-email. +A list of pending patches waiting for review is available in +Patchwork: https://patchwork.ozlabs.org/project/hostap/list/ + History of license and contributions terms ------------------------------------------ @@ -140,7 +143,7 @@ The license terms used for hostap.git files Modified BSD license (no advertisement clause): -Copyright (c) 2002-2019, Jouni Malinen and contributors +Copyright (c) 2002-2021, Jouni Malinen and contributors All Rights Reserved. Redistribution and use in source and binary forms, with or without diff --git a/contrib/wpa/hostapd/Android.mk b/contrib/wpa/hostapd/Android.mk new file mode 100644 index 000000000000..dd8aa2450d7e --- /dev/null +++ b/contrib/wpa/hostapd/Android.mk @@ -0,0 +1,1152 @@ +# Copyright (C) 2008 The Android Open Source Project +# +# This software may be distributed under the terms of the BSD license. +# See README for more details. +# + +LOCAL_PATH := $(call my-dir) + +WPA_BUILD_HOSTAPD := false +ifneq ($(BOARD_HOSTAPD_DRIVER),) + WPA_BUILD_HOSTAPD := true + CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y +endif + +ifeq ($(WPA_BUILD_HOSTAPD),true) + +include $(LOCAL_PATH)/android.config + +# To ignore possible wrong network configurations +L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS + +L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\" + +# Set Android log name +L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\" + +# Disable unused parameter warnings +L_CFLAGS += -Wno-unused-parameter + +# Set Android extended P2P functionality +L_CFLAGS += -DANDROID_P2P + +ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),) +L_CFLAGS += -DANDROID_LIB_STUB +endif + +ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB_EVENT),) +L_CFLAGS += -DANDROID_LIB_EVENT +endif + +# Use Android specific directory for control interface sockets +L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\" +L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/hostapd\" + +# Use Android specific directory for hostapd_cli command completion history +L_CFLAGS += -DCONFIG_HOSTAPD_CLI_HISTORY_DIR=\"/data/misc/wifi\" + +# To force sizeof(enum) = 4 +ifeq ($(TARGET_ARCH),arm) +L_CFLAGS += -mabi=aapcs-linux +endif + +INCLUDES = $(LOCAL_PATH) +INCLUDES += $(LOCAL_PATH)/src +INCLUDES += $(LOCAL_PATH)/src/utils +INCLUDES += system/security/keystore/include +ifdef CONFIG_DRIVER_NL80211 +ifneq ($(wildcard external/libnl),) +INCLUDES += external/libnl/include +else +INCLUDES += external/libnl-headers +endif +endif + + +ifndef CONFIG_OS +ifdef CONFIG_NATIVE_WINDOWS +CONFIG_OS=win32 +else +CONFIG_OS=unix +endif +endif + +ifeq ($(CONFIG_OS), internal) +L_CFLAGS += -DOS_NO_C_LIB_DEFINES +endif + +ifdef CONFIG_NATIVE_WINDOWS +L_CFLAGS += -DCONFIG_NATIVE_WINDOWS +LIBS += -lws2_32 +endif + +OBJS = main.c +OBJS += config_file.c + +OBJS += src/ap/hostapd.c +OBJS += src/ap/wpa_auth_glue.c +OBJS += src/ap/drv_callbacks.c +OBJS += src/ap/ap_drv_ops.c +OBJS += src/ap/utils.c +OBJS += src/ap/authsrv.c +OBJS += src/ap/ieee802_1x.c +OBJS += src/ap/ap_config.c +OBJS += src/ap/eap_user_db.c +OBJS += src/ap/ieee802_11_auth.c +OBJS += src/ap/sta_info.c +OBJS += src/ap/wpa_auth.c +OBJS += src/ap/tkip_countermeasures.c +OBJS += src/ap/ap_mlme.c +OBJS += src/ap/wpa_auth_ie.c +OBJS += src/ap/preauth_auth.c +OBJS += src/ap/pmksa_cache_auth.c +OBJS += src/ap/ieee802_11_shared.c +OBJS += src/ap/beacon.c +OBJS += src/ap/bss_load.c +OBJS += src/ap/neighbor_db.c +OBJS += src/ap/rrm.c +OBJS_d = +OBJS_p = +LIBS = +LIBS_c = +HOBJS = +LIBS_h = + +NEED_RC4=y +NEED_AES=y +NEED_MD5=y +NEED_SHA1=y + +OBJS += src/drivers/drivers.c +L_CFLAGS += -DHOSTAPD + +ifdef CONFIG_WPA_TRACE +L_CFLAGS += -DWPA_TRACE +OBJS += src/utils/trace.c +HOBJS += src/utils/trace.c +LDFLAGS += -rdynamic +L_CFLAGS += -funwind-tables +ifdef CONFIG_WPA_TRACE_BFD +L_CFLAGS += -DWPA_TRACE_BFD +LIBS += -lbfd +LIBS_c += -lbfd +LIBS_h += -lbfd +endif +endif + +OBJS += src/utils/eloop.c + +ifdef CONFIG_ELOOP_POLL +L_CFLAGS += -DCONFIG_ELOOP_POLL +endif + +ifdef CONFIG_ELOOP_EPOLL +L_CFLAGS += -DCONFIG_ELOOP_EPOLL +endif + +OBJS += src/utils/common.c +OBJS += src/utils/wpa_debug.c +OBJS += src/utils/wpabuf.c +OBJS += src/utils/os_$(CONFIG_OS).c +OBJS += src/utils/ip_addr.c +OBJS += src/utils/crc32.c + +OBJS += src/common/ieee802_11_common.c +OBJS += src/common/wpa_common.c +OBJS += src/common/hw_features_common.c + +OBJS += src/eapol_auth/eapol_auth_sm.c + + +ifndef CONFIG_NO_DUMP_STATE +# define HOSTAPD_DUMP_STATE to include support for dumping internal state +# through control interface commands (undefine it, if you want to save in +# binary size) +L_CFLAGS += -DHOSTAPD_DUMP_STATE +OBJS += src/eapol_auth/eapol_auth_dump.c +endif + +ifdef CONFIG_NO_RADIUS +L_CFLAGS += -DCONFIG_NO_RADIUS +CONFIG_NO_ACCOUNTING=y +else +OBJS += src/radius/radius.c +OBJS += src/radius/radius_client.c +OBJS += src/radius/radius_das.c +endif + +ifdef CONFIG_NO_ACCOUNTING +L_CFLAGS += -DCONFIG_NO_ACCOUNTING +else +OBJS += src/ap/accounting.c +endif + +ifdef CONFIG_NO_VLAN +L_CFLAGS += -DCONFIG_NO_VLAN +else +OBJS += src/ap/vlan_init.c +OBJS += src/ap/vlan_ifconfig.c +OBJS += src/ap/vlan.c +ifdef CONFIG_FULL_DYNAMIC_VLAN +# Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges +# and VLAN interfaces for the VLAN feature. +L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN +OBJS += src/ap/vlan_full.c +ifdef CONFIG_VLAN_NETLINK +OBJS += src/ap/vlan_util.c +else +OBJS += src/ap/vlan_ioctl.c +endif +endif +endif + +ifdef CONFIG_NO_CTRL_IFACE +L_CFLAGS += -DCONFIG_NO_CTRL_IFACE +else +OBJS += src/common/ctrl_iface_common.c +OBJS += ctrl_iface.c +OBJS += src/ap/ctrl_iface_ap.c +endif + +L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX + +ifdef CONFIG_RSN_PREAUTH +L_CFLAGS += -DCONFIG_RSN_PREAUTH +CONFIG_L2_PACKET=y +endif + +ifdef CONFIG_HS20 +CONFIG_PROXYARP=y +endif + +ifdef CONFIG_PROXYARP +CONFIG_L2_PACKET=y +endif + +ifdef CONFIG_SUITEB +L_CFLAGS += -DCONFIG_SUITEB +endif + +ifdef CONFIG_SUITEB192 +L_CFLAGS += -DCONFIG_SUITEB192 +NEED_SHA384=y +endif + +ifdef CONFIG_OCV +L_CFLAGS += -DCONFIG_OCV +OBJS += src/common/ocv.c +endif + +ifdef CONFIG_IEEE80211R +L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP +OBJS += src/ap/wpa_auth_ft.c +NEED_AES_UNWRAP=y +NEED_AES_SIV=y +NEED_ETH_P_OUI=y +NEED_HMAC_SHA256_KDF=y +endif + +ifdef NEED_ETH_P_OUI +L_CFLAGS += -DCONFIG_ETH_P_OUI +OBJS += src/ap/eth_p_oui.c +endif + +ifdef CONFIG_SAE +L_CFLAGS += -DCONFIG_SAE +OBJS += src/common/sae.c +ifdef CONFIG_SAE_PK +L_CFLAGS += -DCONFIG_SAE_PK +OBJS += src/common/sae_pk.c +endif +NEED_ECC=y +NEED_DH_GROUPS=y +NEED_HMAC_SHA256_KDF=y +NEED_DRAGONFLY=y +endif + +ifdef CONFIG_OWE +L_CFLAGS += -DCONFIG_OWE +NEED_ECC=y +NEED_HMAC_SHA256_KDF=y +NEED_HMAC_SHA384_KDF=y +NEED_HMAC_SHA512_KDF=y +NEED_SHA384=y +NEED_SHA512=y +endif + +ifdef CONFIG_FILS +L_CFLAGS += -DCONFIG_FILS +OBJS += src/ap/fils_hlp.c +NEED_SHA384=y +NEED_AES_SIV=y +ifdef CONFIG_FILS_SK_PFS +L_CFLAGS += -DCONFIG_FILS_SK_PFS +NEED_ECC=y +endif +endif + +ifdef CONFIG_WNM +L_CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP +OBJS += src/ap/wnm_ap.c +endif + +ifdef CONFIG_IEEE80211AC +L_CFLAGS += -DCONFIG_IEEE80211AC +endif + +ifdef CONFIG_IEEE80211AX +L_CFLAGS += -DCONFIG_IEEE80211AX +endif + +ifdef CONFIG_MBO +L_CFLAGS += -DCONFIG_MBO +OBJS += src/ap/mbo_ap.c +endif + +ifdef CONFIG_FST +L_CFLAGS += -DCONFIG_FST +OBJS += src/fst/fst.c +OBJS += src/fst/fst_group.c +OBJS += src/fst/fst_iface.c +OBJS += src/fst/fst_session.c +OBJS += src/fst/fst_ctrl_aux.c +ifdef CONFIG_FST_TEST +L_CFLAGS += -DCONFIG_FST_TEST +endif +ifndef CONFIG_NO_CTRL_IFACE +OBJS += src/fst/fst_ctrl_iface.c +endif +endif + +ifdef CONFIG_WEP +L_CFLAGS += -DCONFIG_WEP +endif + +ifdef CONFIG_NO_TKIP +L_CFLAGS += -DCONFIG_NO_TKIP +endif + + +include $(LOCAL_PATH)/src/drivers/drivers.mk + +OBJS += $(DRV_AP_OBJS) +L_CFLAGS += $(DRV_AP_CFLAGS) +LDFLAGS += $(DRV_AP_LDFLAGS) +LIBS += $(DRV_AP_LIBS) + +ifdef CONFIG_L2_PACKET +ifdef CONFIG_DNET_PCAP +ifdef CONFIG_L2_FREEBSD +LIBS += -lpcap +OBJS += src/l2_packet/l2_packet_freebsd.c +else +LIBS += -ldnet -lpcap +OBJS += src/l2_packet/l2_packet_pcap.c +endif +else +OBJS += src/l2_packet/l2_packet_linux.c +endif +else +OBJS += src/l2_packet/l2_packet_none.c +endif + + +ifdef CONFIG_EAP_MD5 +L_CFLAGS += -DEAP_SERVER_MD5 +OBJS += src/eap_server/eap_server_md5.c +CHAP=y +endif + +ifdef CONFIG_EAP_TLS +L_CFLAGS += -DEAP_SERVER_TLS +OBJS += src/eap_server/eap_server_tls.c +TLS_FUNCS=y +endif + +ifdef CONFIG_EAP_UNAUTH_TLS +L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS +ifndef CONFIG_EAP_TLS +OBJS += src/eap_server/eap_server_tls.c +TLS_FUNCS=y +endif +endif + +ifdef CONFIG_EAP_PEAP +L_CFLAGS += -DEAP_SERVER_PEAP +OBJS += src/eap_server/eap_server_peap.c +OBJS += src/eap_common/eap_peap_common.c +TLS_FUNCS=y +CONFIG_EAP_MSCHAPV2=y +endif + +ifdef CONFIG_EAP_TTLS +L_CFLAGS += -DEAP_SERVER_TTLS +OBJS += src/eap_server/eap_server_ttls.c +TLS_FUNCS=y +CHAP=y +endif + +ifdef CONFIG_EAP_MSCHAPV2 +L_CFLAGS += -DEAP_SERVER_MSCHAPV2 +OBJS += src/eap_server/eap_server_mschapv2.c +MS_FUNCS=y +endif + +ifdef CONFIG_EAP_GTC +L_CFLAGS += -DEAP_SERVER_GTC +OBJS += src/eap_server/eap_server_gtc.c +endif + +ifdef CONFIG_EAP_SIM +L_CFLAGS += -DEAP_SERVER_SIM +OBJS += src/eap_server/eap_server_sim.c +CONFIG_EAP_SIM_COMMON=y +NEED_AES_CBC=y +endif + +ifdef CONFIG_EAP_AKA +L_CFLAGS += -DEAP_SERVER_AKA +OBJS += src/eap_server/eap_server_aka.c +CONFIG_EAP_SIM_COMMON=y +NEED_AES_CBC=y +endif + +ifdef CONFIG_EAP_AKA_PRIME +L_CFLAGS += -DEAP_SERVER_AKA_PRIME +endif + +ifdef CONFIG_EAP_SIM_COMMON +OBJS += src/eap_common/eap_sim_common.c +# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be +# replaced with another file implementing the interface specified in +# eap_sim_db.h. +OBJS += src/eap_server/eap_sim_db.c +NEED_FIPS186_2_PRF=y +endif + +ifdef CONFIG_EAP_PAX +L_CFLAGS += -DEAP_SERVER_PAX +OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c +endif + +ifdef CONFIG_EAP_PSK +L_CFLAGS += -DEAP_SERVER_PSK +OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c +NEED_AES_ENCBLOCK=y +NEED_AES_EAX=y +endif + *** 156373 LINES SKIPPED *** From nobody Mon Nov 22 18:20:01 2021 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 0DA31189FCEC; Mon, 22 Nov 2021 18:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCj6hN0z3HXd; Mon, 22 Nov 2021 18:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C39F12772B; Mon, 22 Nov 2021 18:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK1J5000620; Mon, 22 Nov 2021 18:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK1W6000618; Mon, 22 Nov 2021 18:20:01 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:01 GMT Message-Id: <202111221820.1AMIK1W6000618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 4f5592a6f45b - stable/12 - wpa: Enable MBO 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4f5592a6f45b6274d7fcde25ba3eb90172ba6db2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4f5592a6f45b6274d7fcde25ba3eb90172ba6db2 commit 4f5592a6f45b6274d7fcde25ba3eb90172ba6db2 Author: Cy Schubert AuthorDate: 2021-09-03 13:14:01 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:31 +0000 wpa: Enable MBO Enable WiFi 6 MBO (Multi Band Operation). MBO is a prereq to 802.11ax. MBO allows the efficient use of multiple frequency bands (channels). To facilitate MBO, WNM (Wireless Network Monitoring) is a prerequisite. It is required to build. Tested by: philip (cherry picked from commit 3968b47cd974e503df303265f3be9ba5865499ab) --- usr.sbin/wpa/Makefile.inc | 3 +++ usr.sbin/wpa/src/ap/Makefile | 2 ++ usr.sbin/wpa/wpa_supplicant/Makefile | 2 ++ 3 files changed, 7 insertions(+) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index a6d54812f5f9..16b2e94959f3 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -66,6 +66,9 @@ CFLAGS+=-DEAP_SERVER_TLS CFLAGS+=-DEAP_SERVER_TTLS CFLAGS+=-DEAP_SERVER_WSC CFLAGS+=-DEAP_TLS_FUNCS +CFLAGS+=-DCONFIG_WNM +CFLAGS+=-DCONFIG_WNM_AP +CFLAGS+=-DCONFIG_MBO .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" CFLAGS+=-DCONFIG_HS20 \ diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile index b6d53b0d5dbb..162b8b5444aa 100644 --- a/usr.sbin/wpa/src/ap/Makefile +++ b/usr.sbin/wpa/src/ap/Makefile @@ -28,6 +28,7 @@ SRCS= accounting.c \ ieee802_11_shared.c \ ieee802_11_vht.c \ ieee802_1x.c \ + mbo_ap.c \ neighbor_db.c \ pmksa_cache_auth.c \ preauth_auth.c \ @@ -39,6 +40,7 @@ SRCS= accounting.c \ vlan_ifconfig.c \ vlan_init.c \ wmm.c \ + wnm_ap.c \ wpa_auth.c \ wpa_auth_glue.c \ wpa_auth_ie.c \ diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index edebe05b4515..e71b491ebe8b 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -22,6 +22,7 @@ SRCS= bss.c \ events.c \ gas_query.c \ main.c \ + mbo.c \ notify.c \ op_classes.c \ offchannel.c \ @@ -31,6 +32,7 @@ SRCS= bss.c \ scan.c \ twt.c \ wmm_ac.c \ + wnm_sta.c \ wpa_supplicant.c \ wpas_glue.c From nobody Mon Nov 22 18:20:02 2021 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 82B9A189FD69; Mon, 22 Nov 2021 18:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCl1Jp9z3HbC; Mon, 22 Nov 2021 18:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE64F2778E; Mon, 22 Nov 2021 18:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK2eC000834; Mon, 22 Nov 2021 18:20:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK25e000832; Mon, 22 Nov 2021 18:20:02 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:02 GMT Message-Id: <202111221820.1AMIK25e000832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: f8fe2b8c5f61 - stable/12 - wpa: Enable RSN Preauthentication 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f8fe2b8c5f613e11e6fe89534547e99244cbd512 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f8fe2b8c5f613e11e6fe89534547e99244cbd512 commit f8fe2b8c5f613e11e6fe89534547e99244cbd512 Author: Cy Schubert AuthorDate: 2021-09-03 13:14:59 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:31 +0000 wpa: Enable RSN Preauthentication RSN Preauthentication allows a station autnetnicate to an AP that it is not associated with yet while associated with a different AP. This allows athentication to multiple APs simulteneously. Tested by: philip (cherry picked from commit bd452dcbede69b1862c769f244948f94b86448b5) --- usr.sbin/wpa/Makefile.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 16b2e94959f3..e9a2053c6095 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -69,6 +69,7 @@ CFLAGS+=-DEAP_TLS_FUNCS CFLAGS+=-DCONFIG_WNM CFLAGS+=-DCONFIG_WNM_AP CFLAGS+=-DCONFIG_MBO +CFLAGS+=-DCONFIG_RSN_PREAUTH .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" CFLAGS+=-DCONFIG_HS20 \ From nobody Mon Nov 22 18:20:03 2021 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 4AC1B189FF0E; Mon, 22 Nov 2021 18:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCm50FRz3HdM; Mon, 22 Nov 2021 18:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 005BE2780E; Mon, 22 Nov 2021 18:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK3C9001048; Mon, 22 Nov 2021 18:20:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK3Lj001046; Mon, 22 Nov 2021 18:20:03 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:03 GMT Message-Id: <202111221820.1AMIK3Lj001046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 3c24623a825f - stable/12 - wpa: Address CTRL-EVENT-SCAN-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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3c24623a825f9b01b37f9fb48db0085c75d5b8ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=3c24623a825f9b01b37f9fb48db0085c75d5b8ac commit 3c24623a825f9b01b37f9fb48db0085c75d5b8ac Author: Cy Schubert AuthorDate: 2021-09-07 01:48:39 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:31 +0000 wpa: Address CTRL-EVENT-SCAN-FAILED Some installations may experience CTRL-EVENT-SCAN-FAILED when associating to an AP. Installations that specify ifconfig_wlan0="WPA ... up" in rc.conf do not experience the problem whereas those which specify ifconfig_wlan0="WPA" without the "up" will experience CTRL-EVENT-SCAN_FAILED. However those that specify "up" in ifconfig_wlan0 will be able to reproduce this problem by service netif stop wlan0; service netif start wlan0. Interestingly The service netif stop/start problem is reproducible on the older wpa 2.9 as well. Reported by: dhw Reported by: "Oleg V. Nauman" Reported by: Filipe da Silva Santos Reported by: Jakob Alvermark (cherry picked from commit 5fcdc19a81115d975e238270754e28557a2fcfc5) --- libexec/rc/rc.d/wpa_supplicant | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rc/rc.d/wpa_supplicant b/libexec/rc/rc.d/wpa_supplicant index 8a86fec90e4d..3c5c9d243f68 100755 --- a/libexec/rc/rc.d/wpa_supplicant +++ b/libexec/rc/rc.d/wpa_supplicant @@ -12,6 +12,7 @@ name="wpa_supplicant" desc="WPA/802.11i Supplicant for wireless network devices" +start_postcmd="wpa_poststart" rcvar= ifn="$2" @@ -27,6 +28,10 @@ is_ndis_interface() esac } +wpa_poststart() { + ifconfig ${ifn} up +} + if is_wired_interface ${ifn} ; then driver="wired" elif is_ndis_interface ${ifn} ; then From nobody Mon Nov 22 18:20:04 2021 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 0F47A18A008D; Mon, 22 Nov 2021 18:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCn245Qz3HbV; Mon, 22 Nov 2021 18:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1576C273F9; Mon, 22 Nov 2021 18:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK4nv001261; Mon, 22 Nov 2021 18:20:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK4bc001259; Mon, 22 Nov 2021 18:20:04 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:04 GMT Message-Id: <202111221820.1AMIK4bc001259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 354f82a53a68 - stable/12 - wpa: Address CTRL-EVENT-SCAN-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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 354f82a53a68c0383a49abdbef01a047b371a2e6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=354f82a53a68c0383a49abdbef01a047b371a2e6 commit 354f82a53a68c0383a49abdbef01a047b371a2e6 Author: Cy Schubert AuthorDate: 2021-09-09 00:20:52 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:31 +0000 wpa: Address CTRL-EVENT-SCAN-FAILED 5fcdc19a8111 didn't fully resolve the issue. There remains a report that an ifconfig wlan0 up by itself is insufficient. Ifconfig down must precede it. Reported by: Filipe da Silva Santos Fixes: 5fcdc19a8111 (cherry picked from commit d06d7eb09131edea666bf049d6c0c55672726f76) --- libexec/rc/rc.d/wpa_supplicant | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/rc/rc.d/wpa_supplicant b/libexec/rc/rc.d/wpa_supplicant index 3c5c9d243f68..9e5f64a5373f 100755 --- a/libexec/rc/rc.d/wpa_supplicant +++ b/libexec/rc/rc.d/wpa_supplicant @@ -29,6 +29,8 @@ is_ndis_interface() } wpa_poststart() { + ifconfig ${ifn} down + sleep 2 ifconfig ${ifn} up } From nobody Mon Nov 22 18:20:06 2021 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 3EAB2189FF24; Mon, 22 Nov 2021 18:20:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCp3rg5z3HQV; Mon, 22 Nov 2021 18:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F1332772C; Mon, 22 Nov 2021 18:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK6q8001478; Mon, 22 Nov 2021 18:20:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK6oO001476; Mon, 22 Nov 2021 18:20:06 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:06 GMT Message-Id: <202111221820.1AMIK6oO001476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: d8b607c5a9a3 - stable/12 - wpa: Fix WITHOUT_CRYPT 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d8b607c5a9a36fbac6ee4e97314869a7f5306832 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d8b607c5a9a36fbac6ee4e97314869a7f5306832 commit d8b607c5a9a36fbac6ee4e97314869a7f5306832 Author: Cy Schubert AuthorDate: 2021-10-28 23:55:48 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:31 +0000 wpa: Fix WITHOUT_CRYPT build PASN requires CRYPT and when built WITHOUT_CRYPT buildworld fails. Only enable PASN when MK_CRYPT is enabled (default). PR: 259517 Reported by: emaste Fixes: c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 (cherry picked from commit a30e8044aa4753858c189f3384dae2b2f25a150b) --- usr.sbin/wpa/Makefile.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index e9a2053c6095..013973dde14e 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -54,7 +54,6 @@ CFLAGS+=-DCONFIG_TDLS CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF CFLAGS+=-DCONFIG_TLS=openssl CFLAGS+=-DCONFIG_MATCH_IFACE -CFLAGS+=-DCONFIG_PASN CFLAGS+=-DCONFIG_PTKSA_CACHE CFLAGS+=-DEAP_SERVER CFLAGS+=-DEAP_SERVER_GTC @@ -89,6 +88,10 @@ NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif +.if ${MK_CRYPT} != "no" +CFLAGS+=-DCONFIG_PASN +.endif + .if !empty(CFLAGS:M*-DEAP_AKA) NEED_SIM_COMMON=y NEED_AES_CBC=y From nobody Mon Nov 22 18:20:07 2021 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 D7D0918A0133; Mon, 22 Nov 2021 18:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCq43VLz3HT3; Mon, 22 Nov 2021 18:20:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D8C2271EE; Mon, 22 Nov 2021 18:20:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK7wS001692; Mon, 22 Nov 2021 18:20:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK7mN001690; Mon, 22 Nov 2021 18:20:07 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:07 GMT Message-Id: <202111221820.1AMIK7mN001690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 33ec402fce28 - stable/12 - wpa: Remove duplicate options definitions 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 33ec402fce2806ffda0095b48dc56d8c5450fd6c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=33ec402fce2806ffda0095b48dc56d8c5450fd6c commit 33ec402fce2806ffda0095b48dc56d8c5450fd6c Author: Cy Schubert AuthorDate: 2021-11-09 00:16:46 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:31 +0000 wpa: Remove duplicate options definitions Global options are defined in usr.sbin/wpa/Makefile.inc. Those in usr.sbin/wpa/src/crypto/Makefile are duplicates of those found above. Remove them. (cherry picked from commit 3332f1b444d4a73238e9f59cca27bfc95fe936bd) --- usr.sbin/wpa/src/crypto/Makefile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index c95834279c21..eede671aa7db 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -139,20 +139,6 @@ SRCS+= dh_groups.c .endif .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" -CFLAGS+=-DCONFIG_WPS \ - -DCONFIG_HS20 \ - -DCONFIG_INTERWORKING \ - -DEAP_GTC \ - -DEAP_LEAP \ - -DEAP_MD5 \ - -DEAP_MSCHAPv2 \ - -DEAP_OTP \ - -DEAP_PEAP \ - -DEAP_PSK \ - -DEAP_TLS \ - -DEAP_TTLS \ - -DEAP_WSC \ - -DIEEE8021X_EAPOL SRCS+= ms_funcs.c .endif From nobody Mon Nov 22 18:20:08 2021 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 E329F18A0204; Mon, 22 Nov 2021 18:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCr67XTz3HNF; Mon, 22 Nov 2021 18:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53FC8273FA; Mon, 22 Nov 2021 18:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK8Yi001907; Mon, 22 Nov 2021 18:20:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK8dM001905; Mon, 22 Nov 2021 18:20:08 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:08 GMT Message-Id: <202111221820.1AMIK8dM001905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 6aa78e230fa9 - stable/12 - Revert "wpa: Fix WITHOUT_CRYPT 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6aa78e230fa953f99e3defb9a7f956ef80794da7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6aa78e230fa953f99e3defb9a7f956ef80794da7 commit 6aa78e230fa953f99e3defb9a7f956ef80794da7 Author: Cy Schubert AuthorDate: 2021-11-09 22:17:01 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:32 +0000 Revert "wpa: Fix WITHOUT_CRYPT build" This reverts commit a30e8044aa4753858c189f3384dae2b2f25a150b. WITHOUT_OPENSSL build is a subset of WITHOUT_CRYPT build. It was incorrect to label this patch as fixing WITHOUT_CRYPT when in fact it fixes WITHOUT_OPENSSL. The build failure will be addressed in a fix for WITHOUT_OPENSSL build. (cherry picked from commit 96e2ac9c48baae6a352eb5574af87f81e01ff021) --- usr.sbin/wpa/Makefile.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 013973dde14e..e9a2053c6095 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -54,6 +54,7 @@ CFLAGS+=-DCONFIG_TDLS CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF CFLAGS+=-DCONFIG_TLS=openssl CFLAGS+=-DCONFIG_MATCH_IFACE +CFLAGS+=-DCONFIG_PASN CFLAGS+=-DCONFIG_PTKSA_CACHE CFLAGS+=-DEAP_SERVER CFLAGS+=-DEAP_SERVER_GTC @@ -88,10 +89,6 @@ NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif -.if ${MK_CRYPT} != "no" -CFLAGS+=-DCONFIG_PASN -.endif - .if !empty(CFLAGS:M*-DEAP_AKA) NEED_SIM_COMMON=y NEED_AES_CBC=y From nobody Mon Nov 22 18:20:09 2021 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 E7F0518A0213; Mon, 22 Nov 2021 18:20:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCt1sCrz3HW3; Mon, 22 Nov 2021 18:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CEBA27885; Mon, 22 Nov 2021 18:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIK9hu002120; Mon, 22 Nov 2021 18:20:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIK9H1002117; Mon, 22 Nov 2021 18:20:09 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:09 GMT Message-Id: <202111221820.1AMIK9H1002117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 4e67a8cc1c3d - stable/12 - wpa: Fix WITHOUT_OPENSSL 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4e67a8cc1c3dcb2cd27c6dc8c254d62a5ef0d509 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4e67a8cc1c3dcb2cd27c6dc8c254d62a5ef0d509 commit 4e67a8cc1c3dcb2cd27c6dc8c254d62a5ef0d509 Author: Cy Schubert AuthorDate: 2021-11-09 22:52:44 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:32 +0000 wpa: Fix WITHOUT_OPENSSL build PR: 259517 Reported by: emaste, FreeBSD Build Option Survey https://callfortesting.org/results/bos-2021-11-04/ Fixes: c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 (cherry picked from commit ba5de3c2b3b84fd547ddcc0e678a013e5df87db1) --- usr.sbin/wpa/Makefile.inc | 5 ++++- usr.sbin/wpa/src/tls/Makefile | 9 +++++---- usr.sbin/wpa/wpa_supplicant/Makefile | 5 ++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index e9a2053c6095..71ec3f8510d1 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -54,7 +54,6 @@ CFLAGS+=-DCONFIG_TDLS CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF CFLAGS+=-DCONFIG_TLS=openssl CFLAGS+=-DCONFIG_MATCH_IFACE -CFLAGS+=-DCONFIG_PASN CFLAGS+=-DCONFIG_PTKSA_CACHE CFLAGS+=-DEAP_SERVER CFLAGS+=-DEAP_SERVER_GTC @@ -89,6 +88,10 @@ NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif +.if ${MK_OPENSSL} != "no" +CFLAGS+=-DCONFIG_PASN +.endif + .if !empty(CFLAGS:M*-DEAP_AKA) NEED_SIM_COMMON=y NEED_AES_CBC=y diff --git a/usr.sbin/wpa/src/tls/Makefile b/usr.sbin/wpa/src/tls/Makefile index e5fdf96444d6..fbb57b9c4c10 100644 --- a/usr.sbin/wpa/src/tls/Makefile +++ b/usr.sbin/wpa/src/tls/Makefile @@ -29,13 +29,14 @@ SRCS+= asn1.c \ tlsv1_server_read.c \ tlsv1_server_write.c \ x509v3.c -.endif -.endif CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ - -DCONFIG_CRYPTO_INTERNAL \ - -DCONFIG_TLSV11 \ + -DCONFIG_CRYPTO_INTERNAL +.else +CFLAGS+=-DCONFIG_TLSV11 \ -DCONFIG_TLSV12 +.endif +.endif # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index e71b491ebe8b..bd31338243ff 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -26,7 +26,6 @@ SRCS= bss.c \ notify.c \ op_classes.c \ offchannel.c \ - pasn_supplicant.c \ robust_av.c \ rrm.c \ scan.c \ @@ -36,6 +35,10 @@ SRCS= bss.c \ wpa_supplicant.c \ wpas_glue.c +.if ${MK_OPENSSL} != "no" +SRCS+= pasn_supplicant.c +.endif + MAN= wpa_supplicant.8 wpa_supplicant.conf.5 .if ${MK_EXAMPLES} != "no" From nobody Mon Nov 22 18:20:10 2021 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 39BD718A0314; Mon, 22 Nov 2021 18:20:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybCw3Skfz3HTV; Mon, 22 Nov 2021 18:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83F0A271EF; Mon, 22 Nov 2021 18:20:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIKAsN002334; Mon, 22 Nov 2021 18:20:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIKArV002332; Mon, 22 Nov 2021 18:20:10 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:20:10 GMT Message-Id: <202111221820.1AMIKArV002332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: d90f00d7ee70 - stable/12 - wpa: Fix WITHOUT_WPA_SUPPLICANT_EAPOL 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d90f00d7ee70e88384154730cf7d1e5921235de9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d90f00d7ee70e88384154730cf7d1e5921235de9 commit d90f00d7ee70e88384154730cf7d1e5921235de9 Author: Cy Schubert AuthorDate: 2021-11-10 03:05:03 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:19:32 +0000 wpa: Fix WITHOUT_WPA_SUPPLICANT_EAPOL build Reported by: FreeBSD Build Option Survey https://callfortesting.org/results/bos-2021-11-04/ Fixes: c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 (cherry picked from commit c9516b83c14f2dcec57bd175e418c152a0cec947) --- usr.sbin/wpa/Makefile.inc | 12 ++++++------ usr.sbin/wpa/src/ap/Makefile | 9 ++++++--- usr.sbin/wpa/src/crypto/Makefile | 2 -- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 71ec3f8510d1..cee89dfc4a82 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -40,11 +40,6 @@ CFLAGS+=-DCONFIG_IEEE80211R CFLAGS+=-DCONFIG_IEEE80211W CFLAGS+=-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" CFLAGS+=-DCONFIG_DEBUG_SYSLOG -CFLAGS+=-DCONFIG_WPS -CFLAGS+=-DCONFIG_WPS2 -CFLAGS+=-DCONFIG_WPS_UPNP -CFLAGS+=-DCONFIG_WPS_OOB -CFLAGS+=-DCONFIG_INTERWORKING CFLAGS+=-DPKCS12_FUNCS CFLAGS+=-DCONFIG_GAS CFLAGS+=-DCONFIG_PEERKEY @@ -82,7 +77,12 @@ CFLAGS+=-DCONFIG_HS20 \ -DEAP_TLS \ -DEAP_TTLS \ -DEAP_WSC \ - -DIEEE8021X_EAPOL + -DIEEE8021X_EAPOL \ + -DCONFIG_INTERWORKING \ + -DCONFIG_WPS \ + -DCONFIG_WPS2 \ + -DCONFIG_WPS_UPNP \ + -DCONFIG_WPS_OOB NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile index 162b8b5444aa..801f45fca8a6 100644 --- a/usr.sbin/wpa/src/ap/Makefile +++ b/usr.sbin/wpa/src/ap/Makefile @@ -20,9 +20,7 @@ SRCS= accounting.c \ dfs.c \ drv_callbacks.c \ eap_user_db.c \ - gas_serv.c \ hostapd.c \ - hs20.c \ ieee802_11_auth.c \ ieee802_11_ht.c \ ieee802_11_shared.c \ @@ -43,8 +41,13 @@ SRCS= accounting.c \ wnm_ap.c \ wpa_auth.c \ wpa_auth_glue.c \ - wpa_auth_ie.c \ + wpa_auth_ie.c + +.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" +SRCS+= gas_serv.c \ + hs20.c \ wps_hostapd.c +.endif CFLAGS+=-DHOSTAPD diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index eede671aa7db..d71b740bb816 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -138,9 +138,7 @@ SRCS+= dh_group5.c SRCS+= dh_groups.c .endif -.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" SRCS+= ms_funcs.c -.endif CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_TLS_INTERNAL_CLIENT \ From nobody Mon Nov 22 18:22:44 2021 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 2510C18A2442; Mon, 22 Nov 2021 18:22:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybGr4kRpz3Lbl; Mon, 22 Nov 2021 18:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8248427754; Mon, 22 Nov 2021 18:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIMioC011810; Mon, 22 Nov 2021 18:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIMiYn011809; Mon, 22 Nov 2021 18:22:44 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:22:44 GMT Message-Id: <202111221822.1AMIMiYn011809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: 0ed191d116f5 - stable/12 - openssl: Fix detection of ARMv7 and ARM64 CPU features 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0ed191d116f511c1e67338f05386d87aad53076f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=0ed191d116f511c1e67338f05386d87aad53076f commit 0ed191d116f511c1e67338f05386d87aad53076f Author: Allan Jude AuthorDate: 2021-11-19 15:14:30 +0000 Commit: Allan Jude CommitDate: 2021-11-22 18:22:36 +0000 openssl: Fix detection of ARMv7 and ARM64 CPU features OpenSSL assumes the same value for AT_HWCAP=16 (Linux) So it ends up calling elf_auxv_info() with AT_CANARY which returns ENOENT, and all acceleration features are disabled. With this, my ARM64 test machine runs the benchmark `openssl speed -evp aes-256-gcm` nearly 20x faster going from 100 MB/sec to 2000 MB/sec It also improves sha256 from 300 MB/sec to 1800 MB/sec This fix has been accepted but not yet merged upstream: https://github.com/openssl/openssl/pull/17082 PR: 259937 Reviewed by: manu, imp MFC after: immediate Relnotes: yes Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j") Sponsored by: Ampere Computing LLC Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D33060 (cherry picked from commit d9bb798725cfce9c72b80440659b48e8668eb10d) --- crypto/openssl/crypto/armcap.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crypto/openssl/crypto/armcap.c b/crypto/openssl/crypto/armcap.c index c5685bde5891..48c5d4d64e32 100644 --- a/crypto/openssl/crypto/armcap.c +++ b/crypto/openssl/crypto/armcap.c @@ -106,20 +106,23 @@ static unsigned long getauxval(unsigned long key) * ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas * AArch64 used AT_HWCAP. */ +# ifndef AT_HWCAP +# define AT_HWCAP 16 +# endif +# ifndef AT_HWCAP2 +# define AT_HWCAP2 26 +# endif # if defined(__arm__) || defined (__arm) -# define HWCAP 16 - /* AT_HWCAP */ +# define HWCAP AT_HWCAP # define HWCAP_NEON (1 << 12) -# define HWCAP_CE 26 - /* AT_HWCAP2 */ +# define HWCAP_CE AT_HWCAP2 # define HWCAP_CE_AES (1 << 0) # define HWCAP_CE_PMULL (1 << 1) # define HWCAP_CE_SHA1 (1 << 2) # define HWCAP_CE_SHA256 (1 << 3) # elif defined(__aarch64__) -# define HWCAP 16 - /* AT_HWCAP */ +# define HWCAP AT_HWCAP # define HWCAP_NEON (1 << 1) # define HWCAP_CE HWCAP From nobody Mon Nov 22 18:42:26 2021 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 EFD4C18AD905; Mon, 22 Nov 2021 18:42:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HybjZ6W6Hz3kYd; Mon, 22 Nov 2021 18:42:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF501279D0; Mon, 22 Nov 2021 18:42:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMIgQ4F037955; Mon, 22 Nov 2021 18:42:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMIgQVp037954; Mon, 22 Nov 2021 18:42:26 GMT (envelope-from git) Date: Mon, 22 Nov 2021 18:42:26 GMT Message-Id: <202111221842.1AMIgQVp037954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 7ae7d3862ece - stable/13 - RELNOTES: Add comment about WiFi 6 support 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ae7d3862ece7c62cb2bf8c725ac6b69b8b91ed5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7ae7d3862ece7c62cb2bf8c725ac6b69b8b91ed5 commit 7ae7d3862ece7c62cb2bf8c725ac6b69b8b91ed5 Author: Cy Schubert AuthorDate: 2021-11-22 18:42:11 +0000 Commit: Cy Schubert CommitDate: 2021-11-22 18:42:11 +0000 RELNOTES: Add comment about WiFi 6 support --- RELNOTES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELNOTES b/RELNOTES index 72d2d5282645..30dcf22c52f4 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +0a6760a1de32, 3f3676a71266, 580c04df4db6: + Add WiFi 6 support. + various: Add support for the HiFive Unmatched RISC-V board. From nobody Mon Nov 22 19:00:02 2021 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 1E5241890901; Mon, 22 Nov 2021 19:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hyc5v0NjRz3s9F; Mon, 22 Nov 2021 19:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E221127CCC; Mon, 22 Nov 2021 19:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AMJ02pe055002; Mon, 22 Nov 2021 19:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AMJ02MB054999; Mon, 22 Nov 2021 19:00:02 GMT (envelope-from git) Date: Mon, 22 Nov 2021 19:00:02 GMT Message-Id: <202111221900.1AMJ02MB054999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: 8ffcfb399b20 - releng/12.3 - openssl: Fix detection of ARMv7 and ARM64 CPU features 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 8ffcfb399b20f027cb50afe41c7f83c52c008191 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=8ffcfb399b20f027cb50afe41c7f83c52c008191 commit 8ffcfb399b20f027cb50afe41c7f83c52c008191 Author: Allan Jude AuthorDate: 2021-11-19 15:14:30 +0000 Commit: Allan Jude CommitDate: 2021-11-22 18:59:32 +0000 openssl: Fix detection of ARMv7 and ARM64 CPU features OpenSSL assumes the same value for AT_HWCAP=16 (Linux) So it ends up calling elf_auxv_info() with AT_CANARY which returns ENOENT, and all acceleration features are disabled. With this, my ARM64 test machine runs the benchmark `openssl speed -evp aes-256-gcm` nearly 20x faster going from 100 MB/sec to 2000 MB/sec It also improves sha256 from 300 MB/sec to 1800 MB/sec This fix has been accepted but not yet merged upstream: https://github.com/openssl/openssl/pull/17082 PR: 259937 Reviewed by: manu, imp Approved by: re (gjb) Relnotes: yes Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j") Sponsored by: Ampere Computing LLC Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D33060 (cherry picked from commit d9bb798725cfce9c72b80440659b48e8668eb10d) (cherry picked from commit 0ed191d116f511c1e67338f05386d87aad53076f) --- crypto/openssl/crypto/armcap.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crypto/openssl/crypto/armcap.c b/crypto/openssl/crypto/armcap.c index c5685bde5891..48c5d4d64e32 100644 --- a/crypto/openssl/crypto/armcap.c +++ b/crypto/openssl/crypto/armcap.c @@ -106,20 +106,23 @@ static unsigned long getauxval(unsigned long key) * ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas * AArch64 used AT_HWCAP. */ +# ifndef AT_HWCAP +# define AT_HWCAP 16 +# endif +# ifndef AT_HWCAP2 +# define AT_HWCAP2 26 +# endif # if defined(__arm__) || defined (__arm) -# define HWCAP 16 - /* AT_HWCAP */ +# define HWCAP AT_HWCAP # define HWCAP_NEON (1 << 12) -# define HWCAP_CE 26 - /* AT_HWCAP2 */ +# define HWCAP_CE AT_HWCAP2 # define HWCAP_CE_AES (1 << 0) # define HWCAP_CE_PMULL (1 << 1) # define HWCAP_CE_SHA1 (1 << 2) # define HWCAP_CE_SHA256 (1 << 3) # elif defined(__aarch64__) -# define HWCAP 16 - /* AT_HWCAP */ +# define HWCAP AT_HWCAP # define HWCAP_NEON (1 << 1) # define HWCAP_CE HWCAP From nobody Tue Nov 23 08:30:04 2021 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 2A5CE1899D36; Tue, 23 Nov 2021 08:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hyy4X488tz4f3S; Tue, 23 Nov 2021 08:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B3CD132D4; Tue, 23 Nov 2021 08:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AN8U4M7046632; Tue, 23 Nov 2021 08:30:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AN8U4r9046629; Tue, 23 Nov 2021 08:30:04 GMT (envelope-from git) Date: Tue, 23 Nov 2021 08:30:04 GMT Message-Id: <202111230830.1AN8U4r9046629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: f085bb0e6219 - stable/13 - rc.d/rctl: unbreak for distinct /usr filesystem 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f085bb0e6219f024e1f78b11b6015687148aff29 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637656204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=09yyMC6ZFnLNbw0evV0yOxklGF0F60lYiok37IR8b9k=; b=xsnMA+C4hfHy/BVsVKCWqaC3bMXOTkmrpHPAwjlGA6b7lfDH3q8lK/PLu7myCWbrD/5Gow U4yN/5dovdiB0CsMlXAZgljE7a5fPWlGbrREo+stO6YLR5ohNAyQS8kBXfekndyTjRJ/U3 Jg1xl9KPAaHXauneEmS7NjslxQgpl2uh3vTm4WwuwZtw0Jl0yyzDyHIMwEm81m5jttjFZd 9/e/7IvI+4RazrKcdJyMoC8A0NfsiioTOKwkYu40q5qjPxWMy02aaSy4J7pfRRmnVwTgi6 Jhj0M88+9QmeXJCKql4gcfaJYniWxuC2a3K0tEGhG21xYTCb5vHfEotfymDEWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637656204; a=rsa-sha256; cv=none; b=o2fCeLR4EaoAbgzVAy8dxqrYPVKckmm1UoaNptnFuDC7Q0dEoLFenUac3b8dPn9JsEo+0s i0sp03FLd8tfO49f1Lne2WeP8H9itAkI5r6yu3lkAU+LFryVsjeiRiTargUqcuCa/cnfCR ZA1wttp38pLiumk4FvHs6elKNln4W/6jENFobQu2H/mhiTkuhMNqbf0gBTtVhhmoMWEGTh u8W5HE6LtUY8x2TJYClMSlpk+XfmxyjsC1fGW7TWbet9vEd9wtkZgxNLfImbRrQF3pwhtN VFv/C/OkFQNWLZ6eM5/wwh9g+Tkj4pVUwk2w9SOMJnYj8jI4zzusqDqrFuyggQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=f085bb0e6219f024e1f78b11b6015687148aff29 commit f085bb0e6219f024e1f78b11b6015687148aff29 Author: Eugene Grosbein AuthorDate: 2021-11-20 08:54:39 +0000 Commit: Eugene Grosbein CommitDate: 2021-11-23 08:29:41 +0000 rc.d/rctl: unbreak for distinct /usr filesystem Both rctl and used xargs utility live in /usr/bin so add REQUIRE: FILESYSTEMS Reported by: Peter (cherry picked from commit 0c54fe172ad365e7e60d6249484a7579c18b7d2d) --- libexec/rc/rc.d/rctl | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc.d/rctl b/libexec/rc/rc.d/rctl index ed5665454dde..f1b001a6ad79 100755 --- a/libexec/rc/rc.d/rctl +++ b/libexec/rc/rc.d/rctl @@ -4,6 +4,7 @@ # # PROVIDE: rctl +# REQUIRE: FILESYSTEMS # BEFORE: LOGIN # KEYWORD: nojail From nobody Tue Nov 23 08:32:15 2021 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 F2DBB189A819; Tue, 23 Nov 2021 08:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hyy734MGhz4fJM; Tue, 23 Nov 2021 08:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7758B132FC; Tue, 23 Nov 2021 08:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AN8WFpZ057244; Tue, 23 Nov 2021 08:32:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AN8WFJK057243; Tue, 23 Nov 2021 08:32:15 GMT (envelope-from git) Date: Tue, 23 Nov 2021 08:32:15 GMT Message-Id: <202111230832.1AN8WFJK057243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 9738f62caca6 - stable/11 - MFC: rc.d/rctl: unbreak for distinct /usr filesystem 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 9738f62caca6d14061e9003c8e69c502fe08fbf6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637656335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MwamfTQj7VhkJW5chJ/Qx8LPHXdgcxY5gV47SWnXK2c=; b=jHVVENEsEkH/4XNYnbLRqdaEjPLRhwLtHKOh9OMznEHk67e4x/chOJrRJy8BHuNQHiZt9K VuEIoMjnSKbuemmG6HvgyBExD0wGhfHDMVgNUTfjjVBj9xAaJ7uGXXAp5HoMuIzPpBsT26 NVdPrabwKBm3iecWV/C5LXsUiiEXnKdgS9S8/DlEP+NI4Z+n0u4cwAufQu/cfoo88y2NDY WjB51aR2OdRaImMifWM0wrNbQhrVFYrP0B4zi/fPFUJHte0+5opd+kSXe9zzINV1xNtRRw mViOhEd1YcbpqswHLQOSfAq1IXq6v0dscOtWxtSfTVBNLasjP87TbgksABtPTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637656335; a=rsa-sha256; cv=none; b=CWoimMb3YKOYnq/We4uqkFqQJLSLbVEu1c5rhw1XKrEI0WoA1NmU70fNrHZgHFDI4B8Aak wytrAp7kk1bbCQ7oE9tHhxIoorDPn9RpeymdNUdzdPSqIhsC9ElTe+dEj58R2g3s4HVd/x G7iQSPFnJEraI3AfKiRGWuWGyP2W6jhVS1il+6U3QtZoO0G3l858FO76h0Prqy3TEH0NZl 1Xzph5uBqIoqSovdo68jKhp5J0foJltGQTWURlm9Z5yIRjNA1A7xL5YwKTQTdtexuHA+DC D7w3c7S29S2c+ch0UXejL1vIPKkqvMJaeQJFbcIl+FMObU58LneyeqkbVPTAVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/11 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=9738f62caca6d14061e9003c8e69c502fe08fbf6 commit 9738f62caca6d14061e9003c8e69c502fe08fbf6 Author: Eugene Grosbein AuthorDate: 2021-11-23 08:31:04 +0000 Commit: Eugene Grosbein CommitDate: 2021-11-23 08:32:05 +0000 MFC: rc.d/rctl: unbreak for distinct /usr filesystem Both rctl and used xargs utility live in /usr/bin so add REQUIRE: FILESYSTEMS Reported by: Peter --- etc/rc.d/rctl | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/rc.d/rctl b/etc/rc.d/rctl index ed5665454dde..f1b001a6ad79 100755 --- a/etc/rc.d/rctl +++ b/etc/rc.d/rctl @@ -4,6 +4,7 @@ # # PROVIDE: rctl +# REQUIRE: FILESYSTEMS # BEFORE: LOGIN # KEYWORD: nojail From nobody Tue Nov 23 10:00:42 2021 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 2B58D18AC3CA; Tue, 23 Nov 2021 10:00:56 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hz05J1DrPz3jtY; Tue, 23 Nov 2021 10:00:51 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.17.1/8.17.1/hmo17dec20) with ESMTPS id 1ANA0gEu055389 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 23 Nov 2021 11:00:42 +0100 (CET) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.1/8.17.1/Submit) id 1ANA0g3x055387; Tue, 23 Nov 2021 11:00:42 +0100 (CET) (envelope-from freebsd@oldach.net) Message-Id: <202111231000.1ANA0g3x055387@nuc.oldach.net> Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features In-Reply-To: <202111221814.1AMIED8D098242@gitrepo.freebsd.org> from Allan Jude at "22 Nov 2021 18:14:13" To: allanjude@FreeBSD.org (Allan Jude) Date: Tue, 23 Nov 2021 11:00:42 +0100 (CET) Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) Sender: freebsd@oldach.net X-No-Archive: Yes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Tue, 23 Nov 2021 11:00:42 +0100 (CET) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Rspamd-Queue-Id: 4Hz05J1DrPz3jtY X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net X-Spamd-Result: default: False [-3.29 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[oldach.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.995]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N Hi, Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET): > The branch stable/13 has been updated by allanjude: > > URL: https://cgit.FreeBSD.org/src/commit/?id=32a2fed6e71f896266d4c695754104d82a72c60d > > commit 32a2fed6e71f896266d4c695754104d82a72c60d > Author: Allan Jude > AuthorDate: 2021-11-19 15:14:30 +0000 > Commit: Allan Jude > CommitDate: 2021-11-22 18:12:20 +0000 > > openssl: Fix detection of ARMv7 and ARM64 CPU features > > OpenSSL assumes the same value for AT_HWCAP=16 (Linux) > So it ends up calling elf_auxv_info() with AT_CANARY which > returns ENOENT, and all acceleration features are disabled. > > With this, my ARM64 test machine runs the benchmark > `openssl speed -evp aes-256-gcm` nearly 20x faster > going from 100 MB/sec to 2000 MB/sec > > It also improves sha256 from 300 MB/sec to 1800 MB/sec > > This fix has been accepted but not yet merged upstream: > https://github.com/openssl/openssl/pull/17082 > > PR: 259937 > Reviewed by: manu, imp > MFC after: immediate > Relnotes: yes > Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j") > Sponsored by: Ampere Computing LLC > Sponsored by: Klara Inc. > Differential Revision: https://reviews.freebsd.org/D33060 > > (cherry picked from commit d9bb798725cfce9c72b80440659b48e8668eb10d) Hmmm. On a RPi4/8G: Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6): | Doing aes-256-gcm for 3s on 16 size blocks: 6710997 aes-256-gcm's in 3.00s | Doing aes-256-gcm for 3s on 64 size blocks: 1806261 aes-256-gcm's in 3.00s | Doing aes-256-gcm for 3s on 256 size blocks: 468595 aes-256-gcm's in 3.00s | Doing aes-256-gcm for 3s on 1024 size blocks: 121282 aes-256-gcm's in 3.00s | Doing aes-256-gcm for 3s on 8192 size blocks: 14590 aes-256-gcm's in 3.00s | Doing aes-256-gcm for 3s on 16384 size blocks: 7258 aes-256-gcm's in 3.00s | OpenSSL 1.1.1l-freebsd 24 Aug 2021 | built on: reproducible build, date unspecified | options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) | compiler: clang | The 'numbers' are in 1000s of bytes per second processed. | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes | aes-256-gcm 35791.98k 38533.57k 39986.77k 41397.59k 39840.43k 39638.36k After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621) | Doing aes-256-gcm for 3s on 16 size blocks: 3999944 aes-256-gcm's in 3.01s | Doing aes-256-gcm for 3s on 64 size blocks: 1102925 aes-256-gcm's in 3.04s | Doing aes-256-gcm for 3s on 256 size blocks: 279608 aes-256-gcm's in 3.03s | Doing aes-256-gcm for 3s on 1024 size blocks: 69397 aes-256-gcm's in 3.00s | Doing aes-256-gcm for 3s on 8192 size blocks: 9160 aes-256-gcm's in 3.14s | Doing aes-256-gcm for 3s on 16384 size blocks: 4385 aes-256-gcm's in 3.00s | OpenSSL 1.1.1l-freebsd 24 Aug 2021 | built on: reproducible build, date unspecified | options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) | compiler: clang | The 'numbers' are in 1000s of bytes per second processed. | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes | aes-256-gcm 21277.62k 23226.64k 23613.90k 23687.51k 23892.93k 23947.95k It seems that AES throughput is actually cut by almost half? Kind regards Helge From nobody Tue Nov 23 14:32:57 2021 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 C4852189F385; Tue, 23 Nov 2021 14:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hz67F3LH6z4bfJ; Tue, 23 Nov 2021 14:32:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5261218352; Tue, 23 Nov 2021 14:32:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANEWv43039009; Tue, 23 Nov 2021 14:32:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANEWvv2039008; Tue, 23 Nov 2021 14:32:57 GMT (envelope-from git) Date: Tue, 23 Nov 2021 14:32:57 GMT Message-Id: <202111231432.1ANEWvv2039008@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: 8c29b0eeb0ce - stable/13 - aesni: Avoid a potential out-of-bounds load in AES_GCM_encrypt() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 8c29b0eeb0ce4b7e6df524004d5edfbb6146e35b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637677977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zs3jNvqu3cip+f0COhZ9/m7lgx0FRCEhce/CzzpewMA=; b=WwtCdazZwwg7Sq1K4bT284ejPxTl5q5thJsWvQ1yAE30fwjjj6/KnQvvsXiXg1wXFNoV4j PdOnDycFxvpT52p8rCf5glvCRghffa3NmlPfO6v7vTQR1kbyXSIqzF/O48VQbbYUlp11kW CYurM12pL6+2obP34yEWbUu97nxUjmcDpRc7i0IjMZi6uko4U1vBwu4fpCovXvqIT1twV9 bRHO3rj8V0vUZQ6bIrSBSGeIwqNXEqpkRdwuvJDEfR+LnZduV4YBtlSDP1BXlznEWhfzGL 3sD2wDy4PuUHYoguNkD92SB4za0stlIYRN+EVR4SLIb4zrBMLZILVRLL+Tw5dg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637677977; a=rsa-sha256; cv=none; b=cNe1FP7+uRoyHZcIWHV53pEGSneIzwMpiZOjVDlftTYzGpFgF7MZe3b4RFhlegplj4oouH 6R3+DBmlw/iDWRqiTTEJGUdbMWYM7Y5h6lOyPpSLEgaBAIEsYnXSD0uVcAbSklSN/0qpu4 2bY3+lBUE1p95uR71c5yGyAmXaBexVJfHiVBmV5Ks5M2udovISYDxgEqqnoPq6H646Iq1d q+mPRpXYtj2vErTgJRKgp5QzgAdc4TK1SUmtSF70rYC0pKkGsXOOuMj7wfD0MBYUrT3v8i aINQMhArrLAk9hkZ6cwHcuyj1QOlLi50ig8zHOOcZCxlNmtNQCnJRCkKbVBuSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8c29b0eeb0ce4b7e6df524004d5edfbb6146e35b commit 8c29b0eeb0ce4b7e6df524004d5edfbb6146e35b Author: Mark Johnston AuthorDate: 2021-11-16 14:16:16 +0000 Commit: Mark Johnston CommitDate: 2021-11-23 14:32:33 +0000 aesni: Avoid a potential out-of-bounds load in AES_GCM_encrypt() Reported by: Jenkins (KASAN job) Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 4285655adb7480336857bf8e051365d73db18011) --- sys/crypto/aesni/aesni_ghash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/crypto/aesni/aesni_ghash.c b/sys/crypto/aesni/aesni_ghash.c index b0d1b6137ec6..a1295b6ccbda 100644 --- a/sys/crypto/aesni/aesni_ghash.c +++ b/sys/crypto/aesni/aesni_ghash.c @@ -504,9 +504,10 @@ AES_GCM_encrypt(const unsigned char *in, unsigned char *out, } tmp1 = _mm_aesenc_si128(tmp1, KEY[nr-1]); tmp1 = _mm_aesenclast_si128(tmp1, KEY[nr]); - tmp1 = _mm_xor_si128(tmp1, - _mm_loadu_si128(&((const __m128i *)in)[k])); - last_block = tmp1; + last_block = _mm_setzero_si128(); + memcpy(&last_block, &((const __m128i *)in)[k], + nbytes % 16); + last_block = _mm_xor_si128(last_block, tmp1); for (j=0; j To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 35dfdb88eafd - stable/13 - unix: Remove a write-only local variable 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 35dfdb88eafdb00f93dee35fabedc7212340b295 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637677978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dOdRKchDwSpr6q8H+Pa4rKRbbzsmJwma1YpLBVpr/Oc=; b=FXmsEZpKTVgkRJPPOFVH0PotjF7rg/MeLip0UztDyRrYmvav66mjJ2UBRs90hsXoBV3lek nMkHnkqS0/0AcOaxXX6fkZGHcnZQnJHs0invZOFHNKuObibKHPTvMLBpnIiYFzUbtXSKLh EVez/8n8emN7M7fXHsDg/+SOpXpY1Ds+tFii1WmZh8J2Uzc+r3QGaxJ5O0ByK7US6ISUgX lU8h78I/mww2gBz9z9p+kTlSrhGg8t/sFRnDMAMxHzKzUPvBP/KNQur+dY9y5AXcsuUTLn QrXOFV9BHwwHmEaJemLRB3XuQCGJfO5Mo9EfZpxA3FPbS1gb8TRUnHs7LhpTdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637677978; a=rsa-sha256; cv=none; b=yhpjYAR7O8bhRdUawpaVdPM8RVSYVoxtiyeaC9+gkW3TU3U3KIPfbcXadTnBrCXERn0sv7 jliM2aMX39TeIP988/rSwg1Bj9O0VkUinXbWFN60l2ctq62Qpja2WPVbEHZmQaWCXUq4vu 82eOzENr5OZys3xwO6q+G4aP4PbVEqZHZ6dTP476Q8YxPtZDC1qxVIxrQsqNUtDMkUK8TL KUyK4prMFgBoofNRCSlucMyV/uq1hzzYdKKrpKbbeC6Y7xOhTr8UXuR6hg17lh4GhSFh+7 15YAVC6TZDx8eqIbfOD2qzanQJVaH3YtbI9hs4SSnWpZT+GWCRAduVBxJLeY2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=35dfdb88eafdb00f93dee35fabedc7212340b295 commit 35dfdb88eafdb00f93dee35fabedc7212340b295 Author: Mark Johnston AuthorDate: 2021-11-16 14:43:33 +0000 Commit: Mark Johnston CommitDate: 2021-11-23 14:32:46 +0000 unix: Remove a write-only local variable Reported by: clang Sponsored by: The FreeBSD Foundation (cherry picked from commit 42188bb5c118f456af0606a2ce6ae26378716415) --- sys/kern/uipc_usrreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 5dca0714c400..35f2de7dbeb8 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1001,7 +1001,7 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct unpcb *unp, *unp2; struct socket *so2; u_int mbcnt, sbcc; - int freed, error; + int error; unp = sotounpcb(so); KASSERT(unp != NULL, ("%s: unp == NULL", __func__)); @@ -1009,7 +1009,7 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, so->so_type == SOCK_SEQPACKET, ("%s: socktype %d", __func__, so->so_type)); - freed = error = 0; + error = 0; if (flags & PRUS_OOB) { error = EOPNOTSUPP; goto release; From nobody Tue Nov 23 14:34:38 2021 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 96AB518A0A57; Tue, 23 Nov 2021 14:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hz69C1vNFz4cb8; Tue, 23 Nov 2021 14:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 182D2181EA; Tue, 23 Nov 2021 14:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANEYcff039322; Tue, 23 Nov 2021 14:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANEYcVm039321; Tue, 23 Nov 2021 14:34:38 GMT (envelope-from git) Date: Tue, 23 Nov 2021 14:34:38 GMT Message-Id: <202111231434.1ANEYcVm039321@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: 83d0a7763a92 - stable/12 - aesni: Avoid a potential out-of-bounds load in AES_GCM_encrypt() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 83d0a7763a92b893875548812d2a3aea651e971f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637678079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iCWjERb+Dr+mPO7U3L2EcGUj5oOhjVrwlWmcdv4lVek=; b=Co9VwF51Izm0gxqhBsymbQkoLvzD/LONxqmPUNtcdpRceuXYPKRmVgg9RKP+BtNvak3SOi Rv+oZmqebwTi9g/FH0PGnrNUcs/OXzFZxB/hAXKAxBIJ7jwh1snBYpi8/jjwdxEUqg6hj3 BCsbIoyaE8BRVTDd7jb/4y1O5hdCerLKYDBd3SmlhN2Csdkl6e4W4sTQaMmPy5yJ50NUtY e6SkYwIDc09T6ew/N5FDunbNLQcBzQJpxWdlI07C2D6NfQd5irCTkqLPFY71PdLXoObDa9 kAy9mJ3Sx2bhHf0H3F5GuANU9+NG5jZs7uuwpCBZb96pG6NESIth0019+oEyfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637678079; a=rsa-sha256; cv=none; b=tnDtDhnymLXkCDyIsQx0xkdZMn9Bg+pUjL4kdksa3H+v5bhtOA7oFncbpuGI8yjnUimTjb xpivd2mp/0MHxy4iiyqEHnk5nWDNwVzU06FkgbOz2sXmKasMvMFbRq7DcabKK4S3ejPorS UHqhga1wy4Gr6vhuePc2rYZHCpSNxsIZlZlN0GQ8Ayq2dlgq+P3IXcW3b3aONa+oOZKQhJ tjBq7tqT8M6x3fATWR/CeP8BAxEaThxuaBt/YvMi+Zt96HOl9h7HeWqFj7PqI/t2G7yMVN Pc2XaW6/s9olUVekcJTUqzgCKS1AZcLNIRygXTw6iDcEEFF0kjds8xcwQcOJTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=83d0a7763a92b893875548812d2a3aea651e971f commit 83d0a7763a92b893875548812d2a3aea651e971f Author: Mark Johnston AuthorDate: 2021-11-16 14:16:16 +0000 Commit: Mark Johnston CommitDate: 2021-11-23 14:33:38 +0000 aesni: Avoid a potential out-of-bounds load in AES_GCM_encrypt() Reported by: Jenkins (KASAN job) Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 4285655adb7480336857bf8e051365d73db18011) --- sys/crypto/aesni/aesni_ghash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/crypto/aesni/aesni_ghash.c b/sys/crypto/aesni/aesni_ghash.c index b0d1b6137ec6..a1295b6ccbda 100644 --- a/sys/crypto/aesni/aesni_ghash.c +++ b/sys/crypto/aesni/aesni_ghash.c @@ -504,9 +504,10 @@ AES_GCM_encrypt(const unsigned char *in, unsigned char *out, } tmp1 = _mm_aesenc_si128(tmp1, KEY[nr-1]); tmp1 = _mm_aesenclast_si128(tmp1, KEY[nr]); - tmp1 = _mm_xor_si128(tmp1, - _mm_loadu_si128(&((const __m128i *)in)[k])); - last_block = tmp1; + last_block = _mm_setzero_si128(); + memcpy(&last_block, &((const __m128i *)in)[k], + nbytes % 16); + last_block = _mm_xor_si128(last_block, tmp1); for (j=0; j To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: f4aba8c9f0cb - stable/13 - if_epair: rework 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f4aba8c9f0cb55faa9201819614458afb64d68d1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637683972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zu6aO+HCy9o9tCT6GSXY7Anpv8+DaXK9XelgpWBXH2c=; b=CK4lkJLZCw11AaTZRFNUKesHJXc5xaIAnr7lBbMnnGRZu+tVgd1qSkuHEUwSR0yRFSzgK/ D0WTHu7Cn19PlTSoIGDBMjwOTe70xMRKDDcsAW9CVB1CI9GleS+o9icCQuMjPqtFSZ0Jfp t4CiIhfkMVUarQnO/HR33XS8Vr4OeJlD3c1e/kFIBQ1TDtB503HA2oQw17ha8+FEsu7ymL H4F7QfXgyx++4IWw7wlrL+re9kqWWWf8ojauxEawPs7+dx5dLFWSY8G/3QFrkBFS1yUfkv E8wOFHKPNY3cy2g9LS/IA8h0AuppRteA51TQpF1C3KKej9MxUapE+/c1nxmbuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637683972; a=rsa-sha256; cv=none; b=qgtXCCpJAXW4hYKC+6hQrsBkyPBoM578Gzij4CwpJQ5PqU+61Yl28z/j9xb6UOQjl7DmC4 kVlbk8Ib4pjICUq/lONeTHkGmHecAHzo0FUap5amj6K1BxYT1Q3t/RlPPMKo6c53XQs465 mg1+Y/N17BUIUe4wOkYe9Uhl4mAVVtDXh/OJ1MnzWxmI4BbT3QS7xPwS8kU//5q8UDxOAT 0xHdSNHK+DQ1cbZLnbllMb3bkF/3jA4kfg0D17VW+O83o20PL70aKpncdv1NGFR91/3w3O KpKvVwZNgbYYdBO5QDUZ9H22gPiZbqFP7gh8mEpM9VLr7HICE10ztD5m8weBEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f4aba8c9f0cb55faa9201819614458afb64d68d1 commit f4aba8c9f0cb55faa9201819614458afb64d68d1 Author: Bjoern A. Zeeb AuthorDate: 2021-10-09 14:09:04 +0000 Commit: Kristof Provost CommitDate: 2021-11-23 15:50:51 +0000 if_epair: rework Rework if_epair(4) to no longer use netisr and dpcpu. Instead use mbufq and swi_net. This simplifies the code and seems to make it work better and no longer hang. Work largely by bz@, with minor tweaks by kp@. Reviewed by: bz, kp MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D31077 (cherry picked from commit 3dd5760aa5f876f8a3f0735afeebdf9ee414e1f5) --- sys/net/if_epair.c | 746 +++++++++++++++++------------------------------------ 1 file changed, 240 insertions(+), 506 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 2feefedb3cd9..89483db46337 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2008 The FreeBSD Foundation - * Copyright (c) 2009-2010 Bjoern A. Zeeb + * Copyright (c) 2009-2021 Bjoern A. Zeeb * * This software was developed by CK Software GmbH under sponsorship * from the FreeBSD Foundation. @@ -36,17 +36,6 @@ * This is mostly intended to be used to provide connectivity between * different virtual network stack instances. */ -/* - * Things to re-think once we have more experience: - * - ifp->if_reassign function once we can test with vimage. Depending on - * how if_vmove() is going to be improved. - * - Real random etheraddrs that are checked to be uniquish; we would need - * to re-do them in case we move the interface between network stacks - * in a private if_reassign function. - * In case we bridge to a real interface/network or between indepedent - * epairs on multiple stacks/machines, we may need this. - * For now let the user handle that case. - */ #include __FBSDID("$FreeBSD$"); @@ -60,13 +49,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include #include +#include +#include +#include #include #include @@ -79,122 +70,41 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, OID_AUTO, epair, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, - "epair sysctl"); - -#ifdef EPAIR_DEBUG -static int epair_debug = 0; -SYSCTL_INT(_net_link_epair, OID_AUTO, epair_debug, CTLFLAG_RW, - &epair_debug, 0, "if_epair(4) debugging."); -#define DPRINTF(fmt, arg...) \ - if (epair_debug) \ - printf("[%s:%d] " fmt, __func__, __LINE__, ##arg) -#else -#define DPRINTF(fmt, arg...) -#endif - -static void epair_nh_sintr(struct mbuf *); -static struct mbuf *epair_nh_m2cpuid(struct mbuf *, uintptr_t, u_int *); -static void epair_nh_drainedcpu(u_int); - -static void epair_start_locked(struct ifnet *); -static int epair_media_change(struct ifnet *); -static void epair_media_status(struct ifnet *, struct ifmediareq *); - static int epair_clone_match(struct if_clone *, const char *); static int epair_clone_create(struct if_clone *, char *, size_t, caddr_t); static int epair_clone_destroy(struct if_clone *, struct ifnet *); static const char epairname[] = "epair"; -static unsigned int next_index = 0; +#define RXRSIZE 4096 /* Probably overkill by 4-8x. */ -/* Netisr related definitions and sysctl. */ -static struct netisr_handler epair_nh = { - .nh_name = epairname, - .nh_proto = NETISR_EPAIR, - .nh_policy = NETISR_POLICY_CPU, - .nh_handler = epair_nh_sintr, - .nh_m2cpuid = epair_nh_m2cpuid, - .nh_drainedcpu = epair_nh_drainedcpu, -}; +static MALLOC_DEFINE(M_EPAIR, epairname, + "Pair of virtual cross-over connected Ethernet-like interfaces"); -static int -sysctl_epair_netisr_maxqlen(SYSCTL_HANDLER_ARGS) -{ - int error, qlimit; +VNET_DEFINE_STATIC(struct if_clone *, epair_cloner); +#define V_epair_cloner VNET(epair_cloner) - netisr_getqlimit(&epair_nh, &qlimit); - error = sysctl_handle_int(oidp, &qlimit, 0, req); - if (error || !req->newptr) - return (error); - if (qlimit < 1) - return (EINVAL); - return (netisr_setqlimit(&epair_nh, qlimit)); -} -SYSCTL_PROC(_net_link_epair, OID_AUTO, netisr_maxqlen, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, - sysctl_epair_netisr_maxqlen, "I", - "Maximum if_epair(4) netisr \"hw\" queue length"); +static unsigned int next_index = 0; +#define EPAIR_LOCK_INIT() mtx_init(&epair_n_index_mtx, "epairidx", \ + NULL, MTX_DEF) +#define EPAIR_LOCK_DESTROY() mtx_destroy(&epair_n_index_mtx) +#define EPAIR_LOCK() mtx_lock(&epair_n_index_mtx) +#define EPAIR_UNLOCK() mtx_unlock(&epair_n_index_mtx) + +static void *swi_cookie[MAXCPU]; /* swi(9). */ +static STAILQ_HEAD(, epair_softc) swi_sc[MAXCPU]; +static struct mtx epair_n_index_mtx; struct epair_softc { struct ifnet *ifp; /* This ifp. */ struct ifnet *oifp; /* other ifp of pair. */ + void *swi_cookie; /* swi(9). */ + struct buf_ring *rxring[2]; + volatile int ridx; /* 0 || 1 */ struct ifmedia media; /* Media config (fake). */ - u_int refcount; /* # of mbufs in flight. */ - u_int cpuid; /* CPU ID assigned upon creation. */ - void (*if_qflush)(struct ifnet *); - /* Original if_qflush routine. */ + uint32_t cpuidx; + STAILQ_ENTRY(epair_softc) entry; }; -/* - * Per-CPU list of ifps with data in the ifq that needs to be flushed - * to the netisr ``hw'' queue before we allow any further direct queuing - * to the ``hw'' queue. - */ -struct epair_ifp_drain { - STAILQ_ENTRY(epair_ifp_drain) ifp_next; - struct ifnet *ifp; -}; -STAILQ_HEAD(eid_list, epair_ifp_drain); - -#define EPAIR_LOCK_INIT(dpcpu) mtx_init(&(dpcpu)->if_epair_mtx, \ - "if_epair", NULL, MTX_DEF) -#define EPAIR_LOCK_DESTROY(dpcpu) mtx_destroy(&(dpcpu)->if_epair_mtx) -#define EPAIR_LOCK_ASSERT(dpcpu) mtx_assert(&(dpcpu)->if_epair_mtx, \ - MA_OWNED) -#define EPAIR_LOCK(dpcpu) mtx_lock(&(dpcpu)->if_epair_mtx) -#define EPAIR_UNLOCK(dpcpu) mtx_unlock(&(dpcpu)->if_epair_mtx) - -#ifdef INVARIANTS -#define EPAIR_REFCOUNT_INIT(r, v) refcount_init((r), (v)) -#define EPAIR_REFCOUNT_AQUIRE(r) refcount_acquire((r)) -#define EPAIR_REFCOUNT_RELEASE(r) refcount_release((r)) -#define EPAIR_REFCOUNT_ASSERT(a, p) KASSERT(a, p) -#else -#define EPAIR_REFCOUNT_INIT(r, v) -#define EPAIR_REFCOUNT_AQUIRE(r) -#define EPAIR_REFCOUNT_RELEASE(r) -#define EPAIR_REFCOUNT_ASSERT(a, p) -#endif - -static MALLOC_DEFINE(M_EPAIR, epairname, - "Pair of virtual cross-over connected Ethernet-like interfaces"); - -VNET_DEFINE_STATIC(struct if_clone *, epair_cloner); -#define V_epair_cloner VNET(epair_cloner) - -/* - * DPCPU area and functions. - */ -struct epair_dpcpu { - struct mtx if_epair_mtx; /* Per-CPU locking. */ - int epair_drv_flags; /* Per-CPU ``hw'' drv flags. */ - struct eid_list epair_ifp_drain_list; /* Per-CPU list of ifps with - * data in the ifq. */ -}; -DPCPU_DEFINE(struct epair_dpcpu, epair_dpcpu); - static void epair_clear_mbuf(struct mbuf *m) { @@ -209,313 +119,179 @@ epair_clear_mbuf(struct mbuf *m) } static void -epair_dpcpu_init(void) +epair_if_input(struct epair_softc *sc, int ridx) { - struct epair_dpcpu *epair_dpcpu; - struct eid_list *s; - u_int cpuid; - - CPU_FOREACH(cpuid) { - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); - - /* Initialize per-cpu lock. */ - EPAIR_LOCK_INIT(epair_dpcpu); - - /* Driver flags are per-cpu as are our netisr "hw" queues. */ - epair_dpcpu->epair_drv_flags = 0; - - /* - * Initialize per-cpu drain list. - * Manually do what STAILQ_HEAD_INITIALIZER would do. - */ - s = &epair_dpcpu->epair_ifp_drain_list; - s->stqh_first = NULL; - s->stqh_last = &s->stqh_first; - } -} + struct epoch_tracker et; + struct ifnet *ifp; + struct mbuf *m; -static void -epair_dpcpu_detach(void) -{ - struct epair_dpcpu *epair_dpcpu; - u_int cpuid; + ifp = sc->ifp; + NET_EPOCH_ENTER(et); + do { + m = buf_ring_dequeue_sc(sc->rxring[ridx]); + if (m == NULL) + break; - CPU_FOREACH(cpuid) { - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); + (*ifp->if_input)(ifp, m); - /* Destroy per-cpu lock. */ - EPAIR_LOCK_DESTROY(epair_dpcpu); - } + } while (1); + NET_EPOCH_EXIT(et); } -/* - * Helper functions. - */ -static u_int -cpuid_from_ifp(struct ifnet *ifp) +static void +epair_sintr(struct epair_softc *sc) { - struct epair_softc *sc; + int ridx, nidx; - if (ifp == NULL) - return (0); - sc = ifp->if_softc; + if_ref(sc->ifp); + do { + ridx = sc->ridx; + nidx = (ridx == 0) ? 1 : 0; + } while (!atomic_cmpset_int(&sc->ridx, ridx, nidx)); + epair_if_input(sc, ridx); - return (sc->cpuid); + if_rele(sc->ifp); } -/* - * Netisr handler functions. - */ static void -epair_nh_sintr(struct mbuf *m) -{ - struct ifnet *ifp; - struct epair_softc *sc __unused; - - ifp = m->m_pkthdr.rcvif; - (*ifp->if_input)(ifp, m); - sc = ifp->if_softc; - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, ifp, sc->refcount)); - DPRINTF("ifp=%p refcount=%u\n", ifp, sc->refcount); -} - -static struct mbuf * -epair_nh_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) +epair_intr(void *arg) { + struct epair_softc *sc; + uint32_t cpuidx; + + cpuidx = (uintptr_t)arg; + /* If this is a problem, this is a read-mostly situation. */ + EPAIR_LOCK(); + STAILQ_FOREACH(sc, &swi_sc[cpuidx], entry) { + /* Do this lockless. */ + if (buf_ring_empty(sc->rxring[sc->ridx])) + continue; + epair_sintr(sc); + } + EPAIR_UNLOCK(); - *cpuid = cpuid_from_ifp(m->m_pkthdr.rcvif); - - return (m); + return; } -static void -epair_nh_drainedcpu(u_int cpuid) +static int +epair_menq(struct mbuf *m, struct epair_softc *osc) { - struct epair_dpcpu *epair_dpcpu; - struct epair_ifp_drain *elm, *tvar; - struct ifnet *ifp; + struct ifnet *ifp, *oifp; + int len, ret; + int ridx; + short mflags; + bool was_empty; - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); /* - * Assume our "hw" queue and possibly ifq will be emptied - * again. In case we will overflow the "hw" queue while - * draining, epair_start_locked will set IFF_DRV_OACTIVE - * again and we will stop and return. + * I know this looks weird. We pass the "other sc" as we need that one + * and can get both ifps from it as well. */ - STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, - ifp_next, tvar) { - ifp = elm->ifp; - epair_dpcpu->epair_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - epair_start_locked(ifp); - - IFQ_LOCK(&ifp->if_snd); - if (IFQ_IS_EMPTY(&ifp->if_snd)) { - struct epair_softc *sc __unused; - - STAILQ_REMOVE(&epair_dpcpu->epair_ifp_drain_list, - elm, epair_ifp_drain, ifp_next); - /* The cached ifp goes off the list. */ - sc = ifp->if_softc; - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, ifp, sc->refcount)); - free(elm, M_EPAIR); - } - IFQ_UNLOCK(&ifp->if_snd); + oifp = osc->ifp; + ifp = osc->oifp; - if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { - /* Our "hw"q overflew again. */ - epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; - DPRINTF("hw queue length overflow at %u\n", - epair_nh.nh_qlimit); - break; - } - } - EPAIR_UNLOCK(epair_dpcpu); -} + M_ASSERTPKTHDR(m); + epair_clear_mbuf(m); + if_setrcvif(m, oifp); + M_SETFIB(m, oifp->if_fib); -/* - * Network interface (`if') related functions. - */ -static void -epair_remove_ifp_from_draining(struct ifnet *ifp) -{ - struct epair_dpcpu *epair_dpcpu; - struct epair_ifp_drain *elm, *tvar; - u_int cpuid; - - CPU_FOREACH(cpuid) { - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); - STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, - ifp_next, tvar) { - if (ifp == elm->ifp) { - struct epair_softc *sc __unused; - - STAILQ_REMOVE( - &epair_dpcpu->epair_ifp_drain_list, elm, - epair_ifp_drain, ifp_next); - /* The cached ifp goes off the list. */ - sc = ifp->if_softc; - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, ifp, sc->refcount)); - free(elm, M_EPAIR); - } - } - EPAIR_UNLOCK(epair_dpcpu); - } -} + /* Save values as once the mbuf is queued, it's not ours anymore. */ + len = m->m_pkthdr.len; + mflags = m->m_flags; -static int -epair_add_ifp_for_draining(struct ifnet *ifp) -{ - struct epair_dpcpu *epair_dpcpu; - struct epair_softc *sc; - struct epair_ifp_drain *elm = NULL; + MPASS(m->m_nextpkt == NULL); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); - sc = ifp->if_softc; - epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); - EPAIR_LOCK_ASSERT(epair_dpcpu); - STAILQ_FOREACH(elm, &epair_dpcpu->epair_ifp_drain_list, ifp_next) - if (elm->ifp == ifp) - break; - /* If the ifp is there already, return success. */ - if (elm != NULL) + ridx = atomic_load_int(&osc->ridx); + was_empty = buf_ring_empty(osc->rxring[ridx]); + ret = buf_ring_enqueue(osc->rxring[ridx], m); + if (ret != 0) { + /* Ring is full. */ + m_freem(m); return (0); + } - elm = malloc(sizeof(struct epair_ifp_drain), M_EPAIR, M_NOWAIT|M_ZERO); - if (elm == NULL) - return (ENOMEM); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + /* + * IFQ_HANDOFF_ADJ/ip_handoff() update statistics, + * but as we bypass all this we have to duplicate + * the logic another time. + */ + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if (mflags & (M_BCAST|M_MCAST)) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + /* Someone else received the packet. */ + if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - elm->ifp = ifp; - /* Add a reference for the ifp pointer on the list. */ - EPAIR_REFCOUNT_AQUIRE(&sc->refcount); - STAILQ_INSERT_TAIL(&epair_dpcpu->epair_ifp_drain_list, elm, ifp_next); + /* Kick the interrupt handler for the first packet. */ + if (was_empty && osc->swi_cookie != NULL) + swi_sched(osc->swi_cookie, 0); return (0); } static void -epair_start_locked(struct ifnet *ifp) +epair_start(struct ifnet *ifp) { - struct epair_dpcpu *epair_dpcpu; struct mbuf *m; struct epair_softc *sc; struct ifnet *oifp; - int error; - - DPRINTF("ifp=%p\n", ifp); - sc = ifp->if_softc; - epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); - EPAIR_LOCK_ASSERT(epair_dpcpu); - - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - return; - if ((ifp->if_flags & IFF_UP) == 0) - return; /* * We get packets here from ether_output via if_handoff() * and need to put them into the input queue of the oifp - * and call oifp->if_input() via netisr/epair_sintr(). + * and will put the packet into the receive-queue (rxq) of the + * other interface (oifp) of our pair. */ + sc = ifp->if_softc; oifp = sc->oifp; sc = oifp->if_softc; for (;;) { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; + M_ASSERTPKTHDR(m); BPF_MTAP(ifp, m); - /* - * In case the outgoing interface is not usable, - * drop the packet. - */ - if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || - (oifp->if_flags & IFF_UP) ==0) { - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + /* In case either interface is not usable drop the packet. */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (ifp->if_flags & IFF_UP) == 0 || + (oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (oifp->if_flags & IFF_UP) == 0) { m_freem(m); continue; } - DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); - - epair_clear_mbuf(m); - - /* - * Add a reference so the interface cannot go while the - * packet is in transit as we rely on rcvif to stay valid. - */ - EPAIR_REFCOUNT_AQUIRE(&sc->refcount); - m->m_pkthdr.rcvif = oifp; - CURVNET_SET_QUIET(oifp->if_vnet); - error = netisr_queue(NETISR_EPAIR, m); - CURVNET_RESTORE(); - if (!error) { - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - /* Someone else received the packet. */ - if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - } else { - /* The packet was freed already. */ - epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - (void) epair_add_ifp_for_draining(ifp); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, oifp, sc->refcount)); - } - } -} -static void -epair_start(struct ifnet *ifp) -{ - struct epair_dpcpu *epair_dpcpu; - - epair_dpcpu = DPCPU_ID_PTR(cpuid_from_ifp(ifp), epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); - epair_start_locked(ifp); - EPAIR_UNLOCK(epair_dpcpu); + (void) epair_menq(m, sc); + } } static int -epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) +epair_transmit(struct ifnet *ifp, struct mbuf *m) { - struct epair_dpcpu *epair_dpcpu; struct epair_softc *sc; struct ifnet *oifp; int error, len; short mflags; - DPRINTF("ifp=%p m=%p\n", ifp, m); - sc = ifp->if_softc; - epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); - EPAIR_LOCK_ASSERT(epair_dpcpu); - if (m == NULL) return (0); + M_ASSERTPKTHDR(m); /* * We are not going to use the interface en/dequeue mechanism * on the TX side. We are called from ether_output_frame() - * and will put the packet into the incoming queue of the - * other interface of our pair via the netsir. + * and will put the packet into the receive-queue (rxq) of the + * other interface (oifp) of our pair. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENXIO); } if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENETDOWN); } @@ -525,16 +301,16 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) * In case the outgoing interface is not usable, * drop the packet. */ + sc = ifp->if_softc; oifp = sc->oifp; if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || - (oifp->if_flags & IFF_UP) ==0) { + (oifp->if_flags & IFF_UP) == 0) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (0); } len = m->m_pkthdr.len; mflags = m->m_flags; - DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); #ifdef ALTQ /* Support ALTQ via the classic if_start() path. */ @@ -548,99 +324,17 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) if_inc_counter(ifp, IFCOUNTER_OBYTES, len); if (mflags & (M_BCAST|M_MCAST)) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - - if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) - epair_start_locked(ifp); - else - (void)epair_add_ifp_for_draining(ifp); + epair_start(ifp); } return (error); } IF_UNLOCK(&ifp->if_snd); #endif - if ((epair_dpcpu->epair_drv_flags & IFF_DRV_OACTIVE) != 0) { - /* - * Our hardware queue is full, try to fall back - * queuing to the ifq but do not call ifp->if_start. - * Either we are lucky or the packet is gone. - */ - IFQ_ENQUEUE(&ifp->if_snd, m, error); - if (!error) - (void)epair_add_ifp_for_draining(ifp); - return (error); - } - - epair_clear_mbuf(m); - - sc = oifp->if_softc; - /* - * Add a reference so the interface cannot go while the - * packet is in transit as we rely on rcvif to stay valid. - */ - EPAIR_REFCOUNT_AQUIRE(&sc->refcount); - m->m_pkthdr.rcvif = oifp; - CURVNET_SET_QUIET(oifp->if_vnet); - error = netisr_queue(NETISR_EPAIR, m); - CURVNET_RESTORE(); - if (!error) { - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - /* - * IFQ_HANDOFF_ADJ/ip_handoff() update statistics, - * but as we bypass all this we have to duplicate - * the logic another time. - */ - if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mflags & (M_BCAST|M_MCAST)) - if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - /* Someone else received the packet. */ - if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - } else { - /* The packet was freed already. */ - epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, oifp, sc->refcount)); - } - - return (error); -} - -static int -epair_transmit(struct ifnet *ifp, struct mbuf *m) -{ - struct epair_dpcpu *epair_dpcpu; - int error; - - epair_dpcpu = DPCPU_ID_PTR(cpuid_from_ifp(ifp), epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); - error = epair_transmit_locked(ifp, m); - EPAIR_UNLOCK(epair_dpcpu); + error = epair_menq(m, oifp->if_softc); return (error); } -static void -epair_qflush(struct ifnet *ifp) -{ - struct epair_softc *sc; - - sc = ifp->if_softc; - KASSERT(sc != NULL, ("%s: ifp=%p, epair_softc gone? sc=%p\n", - __func__, ifp, sc)); - /* - * Remove this ifp from all backpointer lists. The interface will not - * usable for flushing anyway nor should it have anything to flush - * after if_qflush(). - */ - epair_remove_ifp_from_draining(ifp); - - if (sc->if_qflush) - sc->if_qflush(ifp); -} - static int epair_media_change(struct ifnet *ifp __unused) { @@ -708,8 +402,6 @@ epair_clone_match(struct if_clone *ifc, const char *name) { const char *cp; - DPRINTF("name='%s'\n", name); - /* * Our base name is epair. * Our interfaces will be named epair[ab]. @@ -798,16 +490,16 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) /* Allocate memory for both [ab] interfaces */ sca = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); - EPAIR_REFCOUNT_INIT(&sca->refcount, 1); sca->ifp = if_alloc(IFT_ETHER); if (sca->ifp == NULL) { free(sca, M_EPAIR); ifc_free_unit(ifc, unit); return (ENOSPC); } + sca->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK,NULL); + sca->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); scb = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); - EPAIR_REFCOUNT_INIT(&scb->refcount, 1); scb->ifp = if_alloc(IFT_ETHER); if (scb->ifp == NULL) { free(scb, M_EPAIR); @@ -816,6 +508,8 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifc_free_unit(ifc, unit); return (ENOSPC); } + scb->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); + scb->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); /* * Cross-reference the interfaces so we will be able to free both. @@ -823,16 +517,49 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) sca->oifp = scb->ifp; scb->oifp = sca->ifp; - /* - * Calculate the cpuid for netisr queueing based on the - * ifIndex of the interfaces. As long as we cannot configure - * this or use cpuset information easily we cannot guarantee - * cache locality but we can at least allow parallelism. - */ - sca->cpuid = - netisr_get_cpuid(sca->ifp->if_index); - scb->cpuid = - netisr_get_cpuid(scb->ifp->if_index); + EPAIR_LOCK(); +#ifdef SMP + /* Get an approximate distribution. */ + hash = next_index % mp_ncpus; +#else + hash = 0; +#endif + if (swi_cookie[hash] == NULL) { + void *cookie; + + EPAIR_UNLOCK(); + error = swi_add(NULL, epairname, + epair_intr, (void *)(uintptr_t)hash, + SWI_NET, INTR_MPSAFE, &cookie); + if (error) { + buf_ring_free(scb->rxring[0], M_EPAIR); + buf_ring_free(scb->rxring[1], M_EPAIR); + if_free(scb->ifp); + free(scb, M_EPAIR); + buf_ring_free(sca->rxring[0], M_EPAIR); + buf_ring_free(sca->rxring[1], M_EPAIR); + if_free(sca->ifp); + free(sca, M_EPAIR); + ifc_free_unit(ifc, unit); + return (ENOSPC); + } + EPAIR_LOCK(); + /* Recheck under lock even though a race is very unlikely. */ + if (swi_cookie[hash] == NULL) { + swi_cookie[hash] = cookie; + } else { + EPAIR_UNLOCK(); + (void) swi_remove(cookie); + EPAIR_LOCK(); + } + } + sca->cpuidx = hash; + STAILQ_INSERT_TAIL(&swi_sc[hash], sca, entry); + sca->swi_cookie = swi_cookie[hash]; + scb->cpuidx = hash; + STAILQ_INSERT_TAIL(&swi_sc[hash], scb, entry); + scb->swi_cookie = swi_cookie[hash]; + EPAIR_UNLOCK(); /* Initialise pseudo media types. */ ifmedia_init(&sca->media, 0, epair_media_change, epair_media_status); @@ -849,6 +576,7 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifp->if_dname = epairname; ifp->if_dunit = unit; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_flags |= IFF_KNOWSEPOCH; ifp->if_capabilities = IFCAP_VLAN_MTU; ifp->if_capenable = IFCAP_VLAN_MTU; ifp->if_start = epair_start; @@ -869,12 +597,14 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) if (hostid == 0) arc4rand(&hostid, sizeof(hostid), 0); + EPAIR_LOCK(); if (ifp->if_index > next_index) next_index = ifp->if_index; else next_index++; key[0] = (uint32_t)next_index; + EPAIR_UNLOCK(); key[1] = (uint32_t)(hostid & 0xffffffff); key[2] = (uint32_t)((hostid >> 32) & 0xfffffffff); hash = jenkins_hash32(key, 3, 0); @@ -883,10 +613,8 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) memcpy(&eaddr[1], &hash, 4); eaddr[5] = 0x0a; ether_ifattach(ifp, eaddr); - sca->if_qflush = ifp->if_qflush; - ifp->if_qflush = epair_qflush; - ifp->if_transmit = epair_transmit; ifp->if_baudrate = IF_Gbps(10); /* arbitrary maximum */ + ifp->if_transmit = epair_transmit; /* Swap the name and finish initialization of interface b. */ *dp = 'b'; @@ -911,27 +639,40 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) strlcpy(name, scb->ifp->if_xname, len); epair_clone_add(ifc, scb); - scb->if_qflush = ifp->if_qflush; - ifp->if_qflush = epair_qflush; - ifp->if_transmit = epair_transmit; ifp->if_baudrate = IF_Gbps(10); /* arbitrary maximum */ + ifp->if_transmit = epair_transmit; /* * Restore name to a as the ifp for this will go into the * cloner list for the initial call. */ strlcpy(name, sca->ifp->if_xname, len); - DPRINTF("name='%s/%db' created sca=%p scb=%p\n", name, unit, sca, scb); /* Tell the world, that we are ready to rock. */ sca->ifp->if_drv_flags |= IFF_DRV_RUNNING; - scb->ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(sca->ifp, LINK_STATE_UP); + scb->ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(scb->ifp, LINK_STATE_UP); return (0); } +static void +epair_drain_rings(struct epair_softc *sc) +{ + int ridx; + struct mbuf *m; + + for (ridx = 0; ridx < 2; ridx++) { + do { + m = buf_ring_dequeue_sc(sc->rxring[ridx]); + if (m == NULL) + break; + m_freem(m); + } while (1); + } +} + static int epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) { @@ -939,8 +680,6 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) struct epair_softc *sca, *scb; int unit, error; - DPRINTF("ifp=%p\n", ifp); - /* * In case we called into if_clone_destroyif() ourselves * again to remove the second interface, the softc will be @@ -954,27 +693,26 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) oifp = sca->oifp; scb = oifp->if_softc; - DPRINTF("ifp=%p oifp=%p\n", ifp, oifp); + /* Frist get the interfaces down and detached. */ if_link_state_change(ifp, LINK_STATE_DOWN); - if_link_state_change(oifp, LINK_STATE_DOWN); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(oifp, LINK_STATE_DOWN); oifp->if_drv_flags &= ~IFF_DRV_RUNNING; - /* - * Get rid of our second half. As the other of the two - * interfaces may reside in a different vnet, we need to - * switch before freeing them. - */ - CURVNET_SET_QUIET(oifp->if_vnet); + ether_ifdetach(ifp); ether_ifdetach(oifp); - /* - * Wait for all packets to be dispatched to if_input. - * The numbers can only go down as the interface is - * detached so there is no need to use atomics. - */ - DPRINTF("scb refcnt=%u\n", scb->refcount); - EPAIR_REFCOUNT_ASSERT(scb->refcount == 1, - ("%s: ifp=%p scb->refcount!=1: %d", __func__, oifp, scb->refcount)); + + /* Second stop interrupt handler. */ + EPAIR_LOCK(); + STAILQ_REMOVE(&swi_sc[sca->cpuidx], sca, epair_softc, entry); + STAILQ_REMOVE(&swi_sc[scb->cpuidx], scb, epair_softc, entry); + EPAIR_UNLOCK(); + sca->swi_cookie = NULL; + scb->swi_cookie = NULL; + + /* Third free any queued packets and all the resources. */ + CURVNET_SET_QUIET(oifp->if_vnet); + epair_drain_rings(scb); oifp->if_softc = NULL; error = if_clone_destroyif(ifc, oifp); if (error) @@ -982,19 +720,19 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) __func__, error); if_free(oifp); ifmedia_removeall(&scb->media); + buf_ring_free(scb->rxring[0], M_EPAIR); *** 104 LINES SKIPPED *** From nobody Tue Nov 23 16:12:52 2021 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 D2B9A18AC181; Tue, 23 Nov 2021 16:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hz8LX3s5xz3PWn; Tue, 23 Nov 2021 16:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64210194E6; Tue, 23 Nov 2021 16:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANGCqWj074096; Tue, 23 Nov 2021 16:12:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANGCqdM074095; Tue, 23 Nov 2021 16:12:52 GMT (envelope-from git) Date: Tue, 23 Nov 2021 16:12:52 GMT Message-Id: <202111231612.1ANGCqdM074095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 7c2b681b33fc - stable/12 - if_epair: rework 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7c2b681b33fc78ed06c7e9e65eeebb2ab5420586 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637683972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBpPZuOJNlMn58SmSbT9kONpSsPoar1yTm6S2Nectyc=; b=Bvz248ldyB8Fb3Ykcrr+Ywg6xOLhheWDVVdhGq4BK72sqxXREMLCbK+rBbg7L/Xw4hIlgw EAb0znkfTLcoKjjHuta8JzJ/Qdo/mPS/MamBq3Dc6vTLymN7QJrJ2bvs1mSYjfssz8hLu0 5r84o//uNBcAc0inqxud5gm8SIJ1VKnOO4iWlWowcbzrMhVuOspSLPG6/h1xXEZVzuJTU/ BTkHylUHdM9bCq5YuGjLSUBi/53WbABfKeUu/EpsCqG3zdd8wyB6H41Zj22WNpYeDFeEvf isKDifRjOz19PQBYycdfbNtwFCOo57CmXAgKvpFnI4KATeFydPkq06AMMDFNRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637683972; a=rsa-sha256; cv=none; b=Ygg29V87fdmZI+8P1aYhQdp1xGGtCLW6RYGRU0WyToquNX+jPFK+lsJE0Q+YpGyCqkxUOy +BvedcrUw//H9Hcshv3ZNoL/QP93vdt+ZqoOxsIGYj0SVNQqfgVwAQO2/4/iXNwvqrV3hF OuFgOrr5Jygxed6rX7vAjAy/CUoE6Rv7EbSxPvpEK4IyDYAh90SEVIRHRjVwoZA9LN5jPI P7eG28wg4Cvw9c73PzTwYWFJQPuvzJLBvoJtNA9DtO7yP9DdLHBf0kv/yMA6gPbZot5QPo cpp3ic/NoMKg/9AEIRZ41Qp0+/381JiKiEjSh3a28UTM15qqXIGPlwfS/+V7WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7c2b681b33fc78ed06c7e9e65eeebb2ab5420586 commit 7c2b681b33fc78ed06c7e9e65eeebb2ab5420586 Author: Bjoern A. Zeeb AuthorDate: 2021-10-09 14:09:04 +0000 Commit: Kristof Provost CommitDate: 2021-11-23 16:11:46 +0000 if_epair: rework Rework if_epair(4) to no longer use netisr and dpcpu. Instead use mbufq and swi_net. This simplifies the code and seems to make it work better and no longer hang. Work largely by bz@, with minor tweaks by kp@. Reviewed by: bz, kp MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D31077 (cherry picked from commit 3dd5760aa5f876f8a3f0735afeebdf9ee414e1f5) --- sys/net/if_epair.c | 749 +++++++++++++++++------------------------------------ 1 file changed, 243 insertions(+), 506 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index cd11036ad028..a182b336bcec 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -2,8 +2,8 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2008 The FreeBSD Foundation - * Copyright (c) 2009-2010 Bjoern A. Zeeb * All rights reserved. + * Copyright (c) 2009-2021 Bjoern A. Zeeb * * This software was developed by CK Software GmbH under sponsorship * from the FreeBSD Foundation. @@ -37,17 +37,6 @@ * This is mostly intended to be used to provide connectivity between * different virtual network stack instances. */ -/* - * Things to re-think once we have more experience: - * - ifp->if_reassign function once we can test with vimage. Depending on - * how if_vmove() is going to be improved. - * - Real random etheraddrs that are checked to be uniquish; we would need - * to re-do them in case we move the interface between network stacks - * in a private if_reassign function. - * In case we bridge to a real interface/network or between indepedent - * epairs on multiple stacks/machines, we may need this. - * For now let the user handle that case. - */ #include __FBSDID("$FreeBSD$"); @@ -61,13 +50,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include #include +#include +#include +#include #include #include @@ -80,120 +71,41 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, OID_AUTO, epair, CTLFLAG_RW, 0, "epair sysctl"); - -#ifdef EPAIR_DEBUG -static int epair_debug = 0; -SYSCTL_INT(_net_link_epair, OID_AUTO, epair_debug, CTLFLAG_RW, - &epair_debug, 0, "if_epair(4) debugging."); -#define DPRINTF(fmt, arg...) \ - if (epair_debug) \ - printf("[%s:%d] " fmt, __func__, __LINE__, ##arg) -#else -#define DPRINTF(fmt, arg...) -#endif - -static void epair_nh_sintr(struct mbuf *); -static struct mbuf *epair_nh_m2cpuid(struct mbuf *, uintptr_t, u_int *); -static void epair_nh_drainedcpu(u_int); - -static void epair_start_locked(struct ifnet *); -static int epair_media_change(struct ifnet *); -static void epair_media_status(struct ifnet *, struct ifmediareq *); - static int epair_clone_match(struct if_clone *, const char *); static int epair_clone_create(struct if_clone *, char *, size_t, caddr_t); static int epair_clone_destroy(struct if_clone *, struct ifnet *); static const char epairname[] = "epair"; -static unsigned int next_index = 0; +#define RXRSIZE 4096 /* Probably overkill by 4-8x. */ -/* Netisr related definitions and sysctl. */ -static struct netisr_handler epair_nh = { - .nh_name = epairname, - .nh_proto = NETISR_EPAIR, - .nh_policy = NETISR_POLICY_CPU, - .nh_handler = epair_nh_sintr, - .nh_m2cpuid = epair_nh_m2cpuid, - .nh_drainedcpu = epair_nh_drainedcpu, -}; +static MALLOC_DEFINE(M_EPAIR, epairname, + "Pair of virtual cross-over connected Ethernet-like interfaces"); -static int -sysctl_epair_netisr_maxqlen(SYSCTL_HANDLER_ARGS) -{ - int error, qlimit; +VNET_DEFINE_STATIC(struct if_clone *, epair_cloner); +#define V_epair_cloner VNET(epair_cloner) - netisr_getqlimit(&epair_nh, &qlimit); - error = sysctl_handle_int(oidp, &qlimit, 0, req); - if (error || !req->newptr) - return (error); - if (qlimit < 1) - return (EINVAL); - return (netisr_setqlimit(&epair_nh, qlimit)); -} -SYSCTL_PROC(_net_link_epair, OID_AUTO, netisr_maxqlen, CTLTYPE_INT|CTLFLAG_RW, - 0, 0, sysctl_epair_netisr_maxqlen, "I", - "Maximum if_epair(4) netisr \"hw\" queue length"); +static unsigned int next_index = 0; +#define EPAIR_LOCK_INIT() mtx_init(&epair_n_index_mtx, "epairidx", \ + NULL, MTX_DEF) +#define EPAIR_LOCK_DESTROY() mtx_destroy(&epair_n_index_mtx) +#define EPAIR_LOCK() mtx_lock(&epair_n_index_mtx) +#define EPAIR_UNLOCK() mtx_unlock(&epair_n_index_mtx) + +static void *swi_cookie[MAXCPU]; /* swi(9). */ +static STAILQ_HEAD(, epair_softc) swi_sc[MAXCPU]; +static struct mtx epair_n_index_mtx; struct epair_softc { struct ifnet *ifp; /* This ifp. */ struct ifnet *oifp; /* other ifp of pair. */ + void *swi_cookie; /* swi(9). */ + struct buf_ring *rxring[2]; + volatile int ridx; /* 0 || 1 */ struct ifmedia media; /* Media config (fake). */ - u_int refcount; /* # of mbufs in flight. */ - u_int cpuid; /* CPU ID assigned upon creation. */ - void (*if_qflush)(struct ifnet *); - /* Original if_qflush routine. */ + uint32_t cpuidx; + STAILQ_ENTRY(epair_softc) entry; }; -/* - * Per-CPU list of ifps with data in the ifq that needs to be flushed - * to the netisr ``hw'' queue before we allow any further direct queuing - * to the ``hw'' queue. - */ -struct epair_ifp_drain { - STAILQ_ENTRY(epair_ifp_drain) ifp_next; - struct ifnet *ifp; -}; -STAILQ_HEAD(eid_list, epair_ifp_drain); - -#define EPAIR_LOCK_INIT(dpcpu) mtx_init(&(dpcpu)->if_epair_mtx, \ - "if_epair", NULL, MTX_DEF) -#define EPAIR_LOCK_DESTROY(dpcpu) mtx_destroy(&(dpcpu)->if_epair_mtx) -#define EPAIR_LOCK_ASSERT(dpcpu) mtx_assert(&(dpcpu)->if_epair_mtx, \ - MA_OWNED) -#define EPAIR_LOCK(dpcpu) mtx_lock(&(dpcpu)->if_epair_mtx) -#define EPAIR_UNLOCK(dpcpu) mtx_unlock(&(dpcpu)->if_epair_mtx) - -#ifdef INVARIANTS -#define EPAIR_REFCOUNT_INIT(r, v) refcount_init((r), (v)) -#define EPAIR_REFCOUNT_AQUIRE(r) refcount_acquire((r)) -#define EPAIR_REFCOUNT_RELEASE(r) refcount_release((r)) -#define EPAIR_REFCOUNT_ASSERT(a, p) KASSERT(a, p) -#else -#define EPAIR_REFCOUNT_INIT(r, v) -#define EPAIR_REFCOUNT_AQUIRE(r) -#define EPAIR_REFCOUNT_RELEASE(r) -#define EPAIR_REFCOUNT_ASSERT(a, p) -#endif - -static MALLOC_DEFINE(M_EPAIR, epairname, - "Pair of virtual cross-over connected Ethernet-like interfaces"); - -VNET_DEFINE_STATIC(struct if_clone *, epair_cloner); -#define V_epair_cloner VNET(epair_cloner) - -/* - * DPCPU area and functions. - */ -struct epair_dpcpu { - struct mtx if_epair_mtx; /* Per-CPU locking. */ - int epair_drv_flags; /* Per-CPU ``hw'' drv flags. */ - struct eid_list epair_ifp_drain_list; /* Per-CPU list of ifps with - * data in the ifq. */ -}; -DPCPU_DEFINE(struct epair_dpcpu, epair_dpcpu); - static void epair_clear_mbuf(struct mbuf *m) { @@ -201,313 +113,180 @@ epair_clear_mbuf(struct mbuf *m) } static void -epair_dpcpu_init(void) +epair_if_input(struct epair_softc *sc, int ridx) { - struct epair_dpcpu *epair_dpcpu; - struct eid_list *s; - u_int cpuid; - - CPU_FOREACH(cpuid) { - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); - - /* Initialize per-cpu lock. */ - EPAIR_LOCK_INIT(epair_dpcpu); - - /* Driver flags are per-cpu as are our netisr "hw" queues. */ - epair_dpcpu->epair_drv_flags = 0; - - /* - * Initialize per-cpu drain list. - * Manually do what STAILQ_HEAD_INITIALIZER would do. - */ - s = &epair_dpcpu->epair_ifp_drain_list; - s->stqh_first = NULL; - s->stqh_last = &s->stqh_first; - } -} + struct epoch_tracker et; + struct ifnet *ifp; + struct mbuf *m; -static void -epair_dpcpu_detach(void) -{ - struct epair_dpcpu *epair_dpcpu; - u_int cpuid; + ifp = sc->ifp; + NET_EPOCH_ENTER_ET(et); + do { + m = buf_ring_dequeue_sc(sc->rxring[ridx]); + if (m == NULL) + break; - CPU_FOREACH(cpuid) { - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); + (*ifp->if_input)(ifp, m); - /* Destroy per-cpu lock. */ - EPAIR_LOCK_DESTROY(epair_dpcpu); - } + } while (1); + NET_EPOCH_EXIT_ET(et); } -/* - * Helper functions. - */ -static u_int -cpuid_from_ifp(struct ifnet *ifp) +static void +epair_sintr(struct epair_softc *sc) { - struct epair_softc *sc; + int ridx, nidx; - if (ifp == NULL) - return (0); - sc = ifp->if_softc; + if_ref(sc->ifp); + do { + ridx = sc->ridx; + nidx = (ridx == 0) ? 1 : 0; + } while (!atomic_cmpset_int(&sc->ridx, ridx, nidx)); + epair_if_input(sc, ridx); - return (sc->cpuid); + if_rele(sc->ifp); } -/* - * Netisr handler functions. - */ static void -epair_nh_sintr(struct mbuf *m) -{ - struct ifnet *ifp; - struct epair_softc *sc __unused; - - ifp = m->m_pkthdr.rcvif; - (*ifp->if_input)(ifp, m); - sc = ifp->if_softc; - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, ifp, sc->refcount)); - DPRINTF("ifp=%p refcount=%u\n", ifp, sc->refcount); -} - -static struct mbuf * -epair_nh_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) +epair_intr(void *arg) { + struct epair_softc *sc; + uint32_t cpuidx; + + cpuidx = (uintptr_t)arg; + /* If this is a problem, this is a read-mostly situation. */ + EPAIR_LOCK(); + STAILQ_FOREACH(sc, &swi_sc[cpuidx], entry) { + /* Do this lockless. */ + if (buf_ring_empty(sc->rxring[sc->ridx])) + continue; + epair_sintr(sc); + } + EPAIR_UNLOCK(); - *cpuid = cpuid_from_ifp(m->m_pkthdr.rcvif); - - return (m); + return; } -static void -epair_nh_drainedcpu(u_int cpuid) +static int +epair_menq(struct mbuf *m, struct epair_softc *osc) { - struct epair_dpcpu *epair_dpcpu; - struct epair_ifp_drain *elm, *tvar; - struct ifnet *ifp; + struct ifnet *ifp, *oifp; + int len, ret; + int ridx; + short mflags; + bool was_empty; - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); /* - * Assume our "hw" queue and possibly ifq will be emptied - * again. In case we will overflow the "hw" queue while - * draining, epair_start_locked will set IFF_DRV_OACTIVE - * again and we will stop and return. + * I know this looks weird. We pass the "other sc" as we need that one + * and can get both ifps from it as well. */ - STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, - ifp_next, tvar) { - ifp = elm->ifp; - epair_dpcpu->epair_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - epair_start_locked(ifp); - - IFQ_LOCK(&ifp->if_snd); - if (IFQ_IS_EMPTY(&ifp->if_snd)) { - struct epair_softc *sc __unused; - - STAILQ_REMOVE(&epair_dpcpu->epair_ifp_drain_list, - elm, epair_ifp_drain, ifp_next); - /* The cached ifp goes off the list. */ - sc = ifp->if_softc; - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, ifp, sc->refcount)); - free(elm, M_EPAIR); - } - IFQ_UNLOCK(&ifp->if_snd); + oifp = osc->ifp; + ifp = osc->oifp; - if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { - /* Our "hw"q overflew again. */ - epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; - DPRINTF("hw queue length overflow at %u\n", - epair_nh.nh_qlimit); - break; - } - } - EPAIR_UNLOCK(epair_dpcpu); -} + M_ASSERTPKTHDR(m); + epair_clear_mbuf(m); + if_setrcvif(m, oifp); + M_SETFIB(m, oifp->if_fib); -/* - * Network interface (`if') related functions. - */ -static void -epair_remove_ifp_from_draining(struct ifnet *ifp) -{ - struct epair_dpcpu *epair_dpcpu; - struct epair_ifp_drain *elm, *tvar; - u_int cpuid; - - CPU_FOREACH(cpuid) { - epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); - STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, - ifp_next, tvar) { - if (ifp == elm->ifp) { - struct epair_softc *sc __unused; - - STAILQ_REMOVE( - &epair_dpcpu->epair_ifp_drain_list, elm, - epair_ifp_drain, ifp_next); - /* The cached ifp goes off the list. */ - sc = ifp->if_softc; - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, ifp, sc->refcount)); - free(elm, M_EPAIR); - } - } - EPAIR_UNLOCK(epair_dpcpu); - } -} + /* Save values as once the mbuf is queued, it's not ours anymore. */ + len = m->m_pkthdr.len; + mflags = m->m_flags; -static int -epair_add_ifp_for_draining(struct ifnet *ifp) -{ - struct epair_dpcpu *epair_dpcpu; - struct epair_softc *sc; - struct epair_ifp_drain *elm = NULL; + MPASS(m->m_nextpkt == NULL); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); - sc = ifp->if_softc; - epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); - EPAIR_LOCK_ASSERT(epair_dpcpu); - STAILQ_FOREACH(elm, &epair_dpcpu->epair_ifp_drain_list, ifp_next) - if (elm->ifp == ifp) - break; - /* If the ifp is there already, return success. */ - if (elm != NULL) + ridx = atomic_load_int(&osc->ridx); + was_empty = buf_ring_empty(osc->rxring[ridx]); + ret = buf_ring_enqueue(osc->rxring[ridx], m); + if (ret != 0) { + /* Ring is full. */ + m_freem(m); return (0); + } - elm = malloc(sizeof(struct epair_ifp_drain), M_EPAIR, M_NOWAIT|M_ZERO); - if (elm == NULL) - return (ENOMEM); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + /* + * IFQ_HANDOFF_ADJ/ip_handoff() update statistics, + * but as we bypass all this we have to duplicate + * the logic another time. + */ + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if (mflags & (M_BCAST|M_MCAST)) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + /* Someone else received the packet. */ + if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - elm->ifp = ifp; - /* Add a reference for the ifp pointer on the list. */ - EPAIR_REFCOUNT_AQUIRE(&sc->refcount); - STAILQ_INSERT_TAIL(&epair_dpcpu->epair_ifp_drain_list, elm, ifp_next); + /* Kick the interrupt handler for the first packet. */ + if (was_empty && osc->swi_cookie != NULL) + swi_sched(osc->swi_cookie, 0); return (0); } static void -epair_start_locked(struct ifnet *ifp) +epair_start(struct ifnet *ifp) { - struct epair_dpcpu *epair_dpcpu; struct mbuf *m; struct epair_softc *sc; struct ifnet *oifp; - int error; - - DPRINTF("ifp=%p\n", ifp); - sc = ifp->if_softc; - epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); - EPAIR_LOCK_ASSERT(epair_dpcpu); - - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - return; - if ((ifp->if_flags & IFF_UP) == 0) - return; /* * We get packets here from ether_output via if_handoff() * and need to put them into the input queue of the oifp - * and call oifp->if_input() via netisr/epair_sintr(). + * and will put the packet into the receive-queue (rxq) of the + * other interface (oifp) of our pair. */ + sc = ifp->if_softc; oifp = sc->oifp; sc = oifp->if_softc; for (;;) { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; + M_ASSERTPKTHDR(m); BPF_MTAP(ifp, m); - /* - * In case the outgoing interface is not usable, - * drop the packet. - */ - if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || - (oifp->if_flags & IFF_UP) ==0) { - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + /* In case either interface is not usable drop the packet. */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (ifp->if_flags & IFF_UP) == 0 || + (oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (oifp->if_flags & IFF_UP) == 0) { m_freem(m); continue; } - DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); - - epair_clear_mbuf(m); - - /* - * Add a reference so the interface cannot go while the - * packet is in transit as we rely on rcvif to stay valid. - */ - EPAIR_REFCOUNT_AQUIRE(&sc->refcount); - m->m_pkthdr.rcvif = oifp; - CURVNET_SET_QUIET(oifp->if_vnet); - error = netisr_queue(NETISR_EPAIR, m); - CURVNET_RESTORE(); - if (!error) { - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - /* Someone else received the packet. */ - if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - } else { - /* The packet was freed already. */ - epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - (void) epair_add_ifp_for_draining(ifp); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, oifp, sc->refcount)); - } - } -} -static void -epair_start(struct ifnet *ifp) -{ - struct epair_dpcpu *epair_dpcpu; - - epair_dpcpu = DPCPU_ID_PTR(cpuid_from_ifp(ifp), epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); - epair_start_locked(ifp); - EPAIR_UNLOCK(epair_dpcpu); + (void) epair_menq(m, sc); + } } static int -epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) +epair_transmit(struct ifnet *ifp, struct mbuf *m) { - struct epair_dpcpu *epair_dpcpu; struct epair_softc *sc; struct ifnet *oifp; int error, len; short mflags; - DPRINTF("ifp=%p m=%p\n", ifp, m); - sc = ifp->if_softc; - epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); - EPAIR_LOCK_ASSERT(epair_dpcpu); - if (m == NULL) return (0); - + + M_ASSERTPKTHDR(m); + /* * We are not going to use the interface en/dequeue mechanism * on the TX side. We are called from ether_output_frame() - * and will put the packet into the incoming queue of the - * other interface of our pair via the netsir. + * and will put the packet into the receive-queue (rxq) of the + * other interface (oifp) of our pair. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENXIO); } if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENETDOWN); } @@ -517,16 +296,16 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) * In case the outgoing interface is not usable, * drop the packet. */ + sc = ifp->if_softc; oifp = sc->oifp; if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || - (oifp->if_flags & IFF_UP) ==0) { + (oifp->if_flags & IFF_UP) == 0) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (0); } len = m->m_pkthdr.len; mflags = m->m_flags; - DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); #ifdef ALTQ /* Support ALTQ via the classic if_start() path. */ @@ -540,99 +319,17 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) if_inc_counter(ifp, IFCOUNTER_OBYTES, len); if (mflags & (M_BCAST|M_MCAST)) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - - if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) - epair_start_locked(ifp); - else - (void)epair_add_ifp_for_draining(ifp); + epair_start(ifp); } return (error); } IF_UNLOCK(&ifp->if_snd); #endif - if ((epair_dpcpu->epair_drv_flags & IFF_DRV_OACTIVE) != 0) { - /* - * Our hardware queue is full, try to fall back - * queuing to the ifq but do not call ifp->if_start. - * Either we are lucky or the packet is gone. - */ - IFQ_ENQUEUE(&ifp->if_snd, m, error); - if (!error) - (void)epair_add_ifp_for_draining(ifp); - return (error); - } - - epair_clear_mbuf(m); - - sc = oifp->if_softc; - /* - * Add a reference so the interface cannot go while the - * packet is in transit as we rely on rcvif to stay valid. - */ - EPAIR_REFCOUNT_AQUIRE(&sc->refcount); - m->m_pkthdr.rcvif = oifp; - CURVNET_SET_QUIET(oifp->if_vnet); - error = netisr_queue(NETISR_EPAIR, m); - CURVNET_RESTORE(); - if (!error) { - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - /* - * IFQ_HANDOFF_ADJ/ip_handoff() update statistics, - * but as we bypass all this we have to duplicate - * the logic another time. - */ - if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mflags & (M_BCAST|M_MCAST)) - if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - /* Someone else received the packet. */ - if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - } else { - /* The packet was freed already. */ - epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - EPAIR_REFCOUNT_RELEASE(&sc->refcount); - EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, - ("%s: ifp=%p sc->refcount not >= 1: %d", - __func__, oifp, sc->refcount)); - } - + error = epair_menq(m, oifp->if_softc); return (error); } -static int -epair_transmit(struct ifnet *ifp, struct mbuf *m) -{ - struct epair_dpcpu *epair_dpcpu; - int error; - - epair_dpcpu = DPCPU_ID_PTR(cpuid_from_ifp(ifp), epair_dpcpu); - EPAIR_LOCK(epair_dpcpu); - error = epair_transmit_locked(ifp, m); - EPAIR_UNLOCK(epair_dpcpu); - return (error); -} - -static void -epair_qflush(struct ifnet *ifp) -{ - struct epair_softc *sc; - - sc = ifp->if_softc; - KASSERT(sc != NULL, ("%s: ifp=%p, epair_softc gone? sc=%p\n", - __func__, ifp, sc)); - /* - * Remove this ifp from all backpointer lists. The interface will not - * usable for flushing anyway nor should it have anything to flush - * after if_qflush(). - */ - epair_remove_ifp_from_draining(ifp); - - if (sc->if_qflush) - sc->if_qflush(ifp); -} - static int epair_media_change(struct ifnet *ifp __unused) { @@ -701,8 +398,6 @@ epair_clone_match(struct if_clone *ifc, const char *name) { const char *cp; - DPRINTF("name='%s'\n", name); - /* * Our base name is epair. * Our interfaces will be named epair[ab]. @@ -791,16 +486,16 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) /* Allocate memory for both [ab] interfaces */ sca = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); - EPAIR_REFCOUNT_INIT(&sca->refcount, 1); sca->ifp = if_alloc(IFT_ETHER); if (sca->ifp == NULL) { free(sca, M_EPAIR); ifc_free_unit(ifc, unit); return (ENOSPC); } + sca->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK,NULL); + sca->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); scb = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); - EPAIR_REFCOUNT_INIT(&scb->refcount, 1); scb->ifp = if_alloc(IFT_ETHER); if (scb->ifp == NULL) { free(scb, M_EPAIR); @@ -809,23 +504,59 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifc_free_unit(ifc, unit); return (ENOSPC); } - + + scb->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); + scb->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); + /* * Cross-reference the interfaces so we will be able to free both. */ sca->oifp = scb->ifp; scb->oifp = sca->ifp; - /* - * Calculate the cpuid for netisr queueing based on the - * ifIndex of the interfaces. As long as we cannot configure - * this or use cpuset information easily we cannot guarantee - * cache locality but we can at least allow parallelism. - */ - sca->cpuid = - netisr_get_cpuid(sca->ifp->if_index); - scb->cpuid = - netisr_get_cpuid(scb->ifp->if_index); + EPAIR_LOCK(); +#ifdef SMP + /* Get an approximate distribution. */ + hash = next_index % mp_ncpus; +#else + hash = 0; +#endif + if (swi_cookie[hash] == NULL) { + void *cookie; + + EPAIR_UNLOCK(); + error = swi_add(NULL, epairname, + epair_intr, (void *)(uintptr_t)hash, + SWI_NET, INTR_MPSAFE, &cookie); + if (error) { + buf_ring_free(scb->rxring[0], M_EPAIR); + buf_ring_free(scb->rxring[1], M_EPAIR); + if_free(scb->ifp); + free(scb, M_EPAIR); + buf_ring_free(sca->rxring[0], M_EPAIR); + buf_ring_free(sca->rxring[1], M_EPAIR); + if_free(sca->ifp); + free(sca, M_EPAIR); + ifc_free_unit(ifc, unit); + return (ENOSPC); + } + EPAIR_LOCK(); + /* Recheck under lock even though a race is very unlikely. */ + if (swi_cookie[hash] == NULL) { + swi_cookie[hash] = cookie; + } else { + EPAIR_UNLOCK(); + (void) swi_remove(cookie); + EPAIR_LOCK(); + } + } + sca->cpuidx = hash; + STAILQ_INSERT_TAIL(&swi_sc[hash], sca, entry); + sca->swi_cookie = swi_cookie[hash]; + scb->cpuidx = hash; + STAILQ_INSERT_TAIL(&swi_sc[hash], scb, entry); + scb->swi_cookie = swi_cookie[hash]; + EPAIR_UNLOCK(); /* Initialise pseudo media types. */ ifmedia_init(&sca->media, 0, epair_media_change, epair_media_status); @@ -862,12 +593,14 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) if (hostid == 0) arc4rand(&hostid, sizeof(hostid), 0); + EPAIR_LOCK(); if (ifp->if_index > next_index) next_index = ifp->if_index; else next_index++; key[0] = (uint32_t)next_index; + EPAIR_UNLOCK(); key[1] = (uint32_t)(hostid & 0xffffffff); key[2] = (uint32_t)((hostid >> 32) & 0xfffffffff); hash = jenkins_hash32(key, 3, 0); @@ -876,10 +609,8 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) memcpy(&eaddr[1], &hash, 4); eaddr[5] = 0x0a; ether_ifattach(ifp, eaddr); - sca->if_qflush = ifp->if_qflush; - ifp->if_qflush = epair_qflush; - ifp->if_transmit = epair_transmit; ifp->if_baudrate = IF_Gbps(10); /* arbitrary maximum */ + ifp->if_transmit = epair_transmit; /* Swap the name and finish initialization of interface b. */ *dp = 'b'; @@ -904,27 +635,40 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) strlcpy(name, scb->ifp->if_xname, len); epair_clone_add(ifc, scb); - scb->if_qflush = ifp->if_qflush; - ifp->if_qflush = epair_qflush; - ifp->if_transmit = epair_transmit; ifp->if_baudrate = IF_Gbps(10); /* arbitrary maximum */ + ifp->if_transmit = epair_transmit; /* * Restore name to a as the ifp for this will go into the * cloner list for the initial call. */ strlcpy(name, sca->ifp->if_xname, len); - DPRINTF("name='%s/%db' created sca=%p scb=%p\n", name, unit, sca, scb); /* Tell the world, that we are ready to rock. */ sca->ifp->if_drv_flags |= IFF_DRV_RUNNING; - scb->ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(sca->ifp, LINK_STATE_UP); + scb->ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(scb->ifp, LINK_STATE_UP); return (0); } +static void +epair_drain_rings(struct epair_softc *sc) +{ + int ridx; + struct mbuf *m; + + for (ridx = 0; ridx < 2; ridx++) { + do { + m = buf_ring_dequeue_sc(sc->rxring[ridx]); + if (m == NULL) + break; + m_freem(m); + } while (1); + } +} + static int epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) { @@ -932,8 +676,6 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) struct epair_softc *sca, *scb; int unit, error; - DPRINTF("ifp=%p\n", ifp); - /* * In case we called into if_clone_destroyif() ourselves * again to remove the second interface, the softc will be @@ -947,27 +689,26 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) oifp = sca->oifp; scb = oifp->if_softc; - DPRINTF("ifp=%p oifp=%p\n", ifp, oifp); + /* Frist get the interfaces down and detached. */ if_link_state_change(ifp, LINK_STATE_DOWN); - if_link_state_change(oifp, LINK_STATE_DOWN); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(oifp, LINK_STATE_DOWN); oifp->if_drv_flags &= ~IFF_DRV_RUNNING; - /* - * Get rid of our second half. As the other of the two - * interfaces may reside in a different vnet, we need to - * switch before freeing them. - */ - CURVNET_SET_QUIET(oifp->if_vnet); + ether_ifdetach(ifp); ether_ifdetach(oifp); - /* - * Wait for all packets to be dispatched to if_input. - * The numbers can only go down as the interface is - * detached so there is no need to use atomics. - */ - DPRINTF("scb refcnt=%u\n", scb->refcount); - EPAIR_REFCOUNT_ASSERT(scb->refcount == 1, - ("%s: ifp=%p scb->refcount!=1: %d", __func__, oifp, scb->refcount)); + + /* Second stop interrupt handler. */ + EPAIR_LOCK(); + STAILQ_REMOVE(&swi_sc[sca->cpuidx], sca, epair_softc, entry); + STAILQ_REMOVE(&swi_sc[scb->cpuidx], scb, epair_softc, entry); + EPAIR_UNLOCK(); + sca->swi_cookie = NULL; + scb->swi_cookie = NULL; + + /* Third free any queued packets and all the resources. */ + CURVNET_SET_QUIET(oifp->if_vnet); + epair_drain_rings(scb); oifp->if_softc = NULL; error = if_clone_destroyif(ifc, oifp); if (error) @@ -975,19 +716,19 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) __func__, error); if_free(oifp); ifmedia_removeall(&scb->media); + buf_ring_free(scb->rxring[0], M_EPAIR); + buf_ring_free(scb->rxring[1], M_EPAIR); free(scb, M_EPAIR); CURVNET_RESTORE(); - ether_ifdetach(ifp); *** 99 LINES SKIPPED *** From nobody Tue Nov 23 19:14:53 2021 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 EA69618951E3; Tue, 23 Nov 2021 19:15:00 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from tor1-11.mx.scaleengine.net (tor1-11.mx.scaleengine.net [209.51.186.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzDNh6H1gz3hGb; Tue, 23 Nov 2021 19:15:00 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.3] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by tor1-11.mx.scaleengine.net (Postfix) with ESMTPSA id 5B6A529872; Tue, 23 Nov 2021 19:14:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 tor1-11.mx.scaleengine.net 5B6A529872 Message-ID: Date: Tue, 23 Nov 2021 14:14:53 -0500 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features Content-Language: en-US To: Helge Oldach Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202111231000.1ANA0g3x055387@nuc.oldach.net> From: Allan Jude In-Reply-To: <202111231000.1ANA0g3x055387@nuc.oldach.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HzDNh6H1gz3hGb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/23/2021 5:00 AM, Helge Oldach wrote: > Hi, > > Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET): >> The branch stable/13 has been updated by allanjude: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=32a2fed6e71f896266d4c695754104d82a72c60d >> >> commit 32a2fed6e71f896266d4c695754104d82a72c60d >> Author: Allan Jude >> AuthorDate: 2021-11-19 15:14:30 +0000 >> Commit: Allan Jude >> CommitDate: 2021-11-22 18:12:20 +0000 >> >> openssl: Fix detection of ARMv7 and ARM64 CPU features >> >> OpenSSL assumes the same value for AT_HWCAP=16 (Linux) >> So it ends up calling elf_auxv_info() with AT_CANARY which >> returns ENOENT, and all acceleration features are disabled. >> >> With this, my ARM64 test machine runs the benchmark >> `openssl speed -evp aes-256-gcm` nearly 20x faster >> going from 100 MB/sec to 2000 MB/sec >> >> It also improves sha256 from 300 MB/sec to 1800 MB/sec >> >> This fix has been accepted but not yet merged upstream: >> https://github.com/openssl/openssl/pull/17082 >> >> PR: 259937 >> Reviewed by: manu, imp >> MFC after: immediate >> Relnotes: yes >> Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j") >> Sponsored by: Ampere Computing LLC >> Sponsored by: Klara Inc. >> Differential Revision: https://reviews.freebsd.org/D33060 >> >> (cherry picked from commit d9bb798725cfce9c72b80440659b48e8668eb10d) > > Hmmm. On a RPi4/8G: > > Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6): > > | Doing aes-256-gcm for 3s on 16 size blocks: 6710997 aes-256-gcm's in 3.00s > | Doing aes-256-gcm for 3s on 64 size blocks: 1806261 aes-256-gcm's in 3.00s > | Doing aes-256-gcm for 3s on 256 size blocks: 468595 aes-256-gcm's in 3.00s > | Doing aes-256-gcm for 3s on 1024 size blocks: 121282 aes-256-gcm's in 3.00s > | Doing aes-256-gcm for 3s on 8192 size blocks: 14590 aes-256-gcm's in 3.00s > | Doing aes-256-gcm for 3s on 16384 size blocks: 7258 aes-256-gcm's in 3.00s > | OpenSSL 1.1.1l-freebsd 24 Aug 2021 > | built on: reproducible build, date unspecified > | options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) > | compiler: clang > | The 'numbers' are in 1000s of bytes per second processed. > | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > | aes-256-gcm 35791.98k 38533.57k 39986.77k 41397.59k 39840.43k 39638.36k > > After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621) > > | Doing aes-256-gcm for 3s on 16 size blocks: 3999944 aes-256-gcm's in 3.01s > | Doing aes-256-gcm for 3s on 64 size blocks: 1102925 aes-256-gcm's in 3.04s > | Doing aes-256-gcm for 3s on 256 size blocks: 279608 aes-256-gcm's in 3.03s > | Doing aes-256-gcm for 3s on 1024 size blocks: 69397 aes-256-gcm's in 3.00s > | Doing aes-256-gcm for 3s on 8192 size blocks: 9160 aes-256-gcm's in 3.14s > | Doing aes-256-gcm for 3s on 16384 size blocks: 4385 aes-256-gcm's in 3.00s > | OpenSSL 1.1.1l-freebsd 24 Aug 2021 > | built on: reproducible build, date unspecified > | options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) > | compiler: clang > | The 'numbers' are in 1000s of bytes per second processed. > | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > | aes-256-gcm 21277.62k 23226.64k 23613.90k 23687.51k 23892.93k 23947.95k > > It seems that AES throughput is actually cut by almost half? > > Kind regards > Helge > Do you know which of the CPU optimizations your RPi4 supports? You can set the environment variable OPENSSL_armcap to override OpenSSL's detection. Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm And see if it gets a different result. -- Allan Jude From nobody Tue Nov 23 19:36:40 2021 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 92FD418A03E8; Tue, 23 Nov 2021 19:36:44 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzDsl5GmSz3nhM; Tue, 23 Nov 2021 19:36:43 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.17.1/8.17.1/hmo17dec20) with ESMTPS id 1ANJaepX011756 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 23 Nov 2021 20:36:41 +0100 (CET) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.1/8.17.1/Submit) id 1ANJaeDT011754; Tue, 23 Nov 2021 20:36:40 +0100 (CET) (envelope-from freebsd@oldach.net) Message-Id: <202111231936.1ANJaeDT011754@nuc.oldach.net> Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features In-Reply-To: from Allan Jude at "23 Nov 2021 14:14:53" To: allanjude@freebsd.org (Allan Jude) Date: Tue, 23 Nov 2021 20:36:40 +0100 (CET) Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Tue, 23 Nov 2021 20:36:41 +0100 (CET) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Rspamd-Queue-Id: 4HzDsl5GmSz3nhM X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net X-Spamd-Result: default: False [-3.26 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[oldach.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.956]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N Allan Jude wrote on Tue, 23 Nov 2021 20:14:53 +0100 (CET): > On 11/23/2021 5:00 AM, Helge Oldach wrote: > > Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET): > > Hmmm. On a RPi4/8G: > > > > Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6): > > | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > > | aes-256-gcm 35791.98k 38533.57k 39986.77k 41397.59k 39840.43k 39638.36k > > > > After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621) > > > > | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > > | aes-256-gcm 21277.62k 23226.64k 23613.90k 23687.51k 23892.93k 23947.95k > > > > It seems that AES throughput is actually cut by almost half? > > Do you know which of the CPU optimizations your RPi4 supports? Is this what you need? Instruction Set Attributes 0 = Instruction Set Attributes 1 = <> Processor Features 0 = Processor Features 1 = <> Memory Model Features 0 = Memory Model Features 1 = <8bit VMID> Memory Model Features 2 = <32bit CCIDX,48bit VA> Debug Features 0 = Debug Features 1 = <> Auxiliary Features 0 = <> Auxiliary Features 1 = <> AArch32 Instruction Set Attributes 5 = AArch32 Media and VFP Features 0 = AArch32 Media and VFP Features 1 = > You can set the environment variable OPENSSL_armcap to override > OpenSSL's detection. > > Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm On FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621 again (i.e. after this commit): hmo@p48 ~ $ env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm Doing aes-256-gcm for 3s on 16 size blocks: 6445704 aes-256-gcm's in 3.08s Doing aes-256-gcm for 3s on 64 size blocks: 1861149 aes-256-gcm's in 3.00s Doing aes-256-gcm for 3s on 256 size blocks: 479664 aes-256-gcm's in 3.01s Doing aes-256-gcm for 3s on 1024 size blocks: 122853 aes-256-gcm's in 3.04s Doing aes-256-gcm for 3s on 8192 size blocks: 15181 aes-256-gcm's in 3.00s Doing aes-256-gcm for 3s on 16384 size blocks: 7796 aes-256-gcm's in 3.07s OpenSSL 1.1.1l-freebsd 24 Aug 2021 built on: reproducible build, date unspecified options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) compiler: clang The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes aes-256-gcm 33504.57k 39704.51k 40825.01k 41394.83k 41454.25k 41601.52k hmo@p48 ~ $ openssl speed -evp aes-256-gcm Doing aes-256-gcm for 3s on 16 size blocks: 4066201 aes-256-gcm's in 3.00s Doing aes-256-gcm for 3s on 64 size blocks: 1087387 aes-256-gcm's in 3.00s Doing aes-256-gcm for 3s on 256 size blocks: 280110 aes-256-gcm's in 3.03s Doing aes-256-gcm for 3s on 1024 size blocks: 70412 aes-256-gcm's in 3.04s Doing aes-256-gcm for 3s on 8192 size blocks: 8762 aes-256-gcm's in 3.00s Doing aes-256-gcm for 3s on 16384 size blocks: 4402 aes-256-gcm's in 3.02s OpenSSL 1.1.1l-freebsd 24 Aug 2021 built on: reproducible build, date unspecified options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) compiler: clang The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes aes-256-gcm 21686.41k 23197.59k 23656.30k 23725.04k 23926.10k 23916.23k hmo@p48 ~ $ Kind regards, Helge From nobody Tue Nov 23 19:50:48 2021 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 E831D18A7883; Tue, 23 Nov 2021 19:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzFB04V2xz3s7y; Tue, 23 Nov 2021 19:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A0A51C911; Tue, 23 Nov 2021 19:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANJom9F064832; Tue, 23 Nov 2021 19:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANJomSE064831; Tue, 23 Nov 2021 19:50:48 GMT (envelope-from git) Date: Tue, 23 Nov 2021 19:50:48 GMT Message-Id: <202111231950.1ANJomSE064831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: a0fc5094bf4c - stable/13 - rtsol/rtsold: Add option to skip random delay 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a0fc5094bf4c594f2717cd1b757b1b5daca61d3f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637697048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cnj1cDPfIPlvH29Yksb+o9C53cR7EMWrEo2Y0rUaWEs=; b=C0Q/ybGUE5tW9IXk6H4i3kTRc0WVpQbvvVHmB6BhcakL+k8YUBZDiCEI0vfkQJBhwwJQFd f8ey5mLPsp0VX+iU5L646p6mXSbs+uu0RgQaQbmEVe86dPF/XrMQ/PoHBkmFp6SLqjJ5PM LZ/rvL90LPS7OyUEDyCmDY6mdDTh1xgfo6X+a/l/YzWm2BIQ3/qrZduquj3NhCCTZpLgCn /KNCBF39W7kchOMhASRY0QK2ZUvDNHt4PaeMa4sK+gQGPDdeYDUeXxVnBRt7tbfJyiT68v 6N7CLABEeeV5nSVfNYYjRXiGY3SppipM+oZ8r3+Dcmrd9JiUGx+2KIoxKxYcHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637697048; a=rsa-sha256; cv=none; b=rwuRr/No3fiqh5lSyvzHygQGYlad+/Pn3+2a+D3k19At2/IPASlmsjIRHGNLFBWHqHjiEq IT1hPgHeATZjG/ksJH2UgK09qMobsVK3cwZx0cS9spXxfdhpUhqx9wT8u/YUEs85ZwqWr8 A1Md2/cOUu3gGn7UFbap6FcpQOvz9LoNh6jOR4GQtflh2gj+U1xbJxv3ra72q6+z1Crwhu eBbZCYomT/VaScNPA453HVEtwvNlZHIGgNEMkKnVavU4Y3EIXMnZGTrbyo4N+9qrBTLnM5 9agkfQbuAz+fSdc5DE0EB62hHSW4aj17pqSYmR3trSi6nKRzMm5oCjHE23C9aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=a0fc5094bf4c594f2717cd1b757b1b5daca61d3f commit a0fc5094bf4c594f2717cd1b757b1b5daca61d3f Author: Colin Percival AuthorDate: 2021-11-16 18:24:05 +0000 Commit: Colin Percival CommitDate: 2021-11-23 19:48:50 +0000 rtsol/rtsold: Add option to skip random delay In accordance with a SHOULD in RFC 4861, rtsol and rtsold wait a random time between zero and one (aka MAX_RTR_SOLICITATION_DELAY) seconds before sending a Router Solicitation, in order to avoid network congestion if many hosts come online at once. (The question of how many hosts would be required to cause congestion by each sending a single packet on a Gbps+ network is left to the reader.) The new option -i disables this wait and instructs rtsol and rtsold to send the Router Solicitation immediately. Relnotes: yes Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32956 (cherry picked from commit 231bac4ccc431381d70c966a5bd5a95fbfc1f163) --- usr.sbin/rtsold/rtsold.8 | 16 +++++++++++----- usr.sbin/rtsold/rtsold.c | 13 ++++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/usr.sbin/rtsold/rtsold.8 b/usr.sbin/rtsold/rtsold.8 index 84e4d3013ef4..6b0e64ab0fac 100644 --- a/usr.sbin/rtsold/rtsold.8 +++ b/usr.sbin/rtsold/rtsold.8 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2021 +.Dd November 12, 2021 .Dt RTSOLD 8 .Os .\" @@ -39,27 +39,27 @@ .\" .Sh SYNOPSIS .Nm -.Op Fl dDfFmu1 +.Op Fl dDfFimu1 .Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl p Ar pidfile .Op Fl R Ar script-name .Ar interface ... .Nm -.Op Fl dDfFmu1 +.Op Fl dDfFimu1 .Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl p Ar pidfile .Op Fl R Ar script-name .Fl a .Nm rtsol -.Op Fl dDu +.Op Fl dDiu .Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl R Ar script-name .Ar interface ... .Nm rtsol -.Op Fl dDu +.Op Fl dDiu .Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl R Ar script-name @@ -194,6 +194,12 @@ The settings may be changed manually with .Xr sysctl 8 and .Xr ifconfig 8 . +.It Fl i +Transmit Router Solicitation packets immediately, without waiting the +normal random (between 0 and 1 second) delay. +This option should not be used on networks where it might result in +congestion due to many hosts simultaneously (re)connecting and +sending such packets. .It Fl m Enable mobility support. If this option is specified, diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index f58574cec731..8aad8a7b95f2 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -99,6 +99,7 @@ cap_channel_t *capllflags, *capscript, *capsendmsg, *capsyslog; /* static variables and functions */ static int mobile_node = 0; +static int no_solicitation_delay = 0; static sig_atomic_t do_dump, do_exit; static struct pidfh *pfh; @@ -125,11 +126,11 @@ main(int argc, char **argv) progname = basename(argv[0]); if (strcmp(progname, "rtsold") == 0) { - opts = "adDfFm1M:O:p:R:u"; + opts = "adDfFim1M:O:p:R:u"; once = 0; pidfilepath = NULL; } else { - opts = "adDFM:O:R:u"; + opts = "adDFiM:O:R:u"; fflag = 1; once = 1; } @@ -151,6 +152,9 @@ main(int argc, char **argv) case 'F': Fflag = 1; break; + case 'i': + no_solicitation_delay = 1; + break; case 'm': mobile_node = 1; break; @@ -720,7 +724,10 @@ rtsol_timer_update(struct ifinfo *ifi) ifi->timer = tm_max; /* stop timer(valid?) */ break; case IFS_DELAY: - interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION); + if (no_solicitation_delay) + interval = 0; + else + interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION); ifi->timer.tv_sec = interval / MILLION; ifi->timer.tv_nsec = (interval % MILLION) * 1000; break; From nobody Tue Nov 23 23:05:17 2021 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 05A6F189C535; Tue, 23 Nov 2021 23:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKVP3Xf4z3r26; Tue, 23 Nov 2021 23:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 527931F34D; Tue, 23 Nov 2021 23:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANN5Hdq023707; Tue, 23 Nov 2021 23:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANN5Hbf023706; Tue, 23 Nov 2021 23:05:17 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:05:17 GMT Message-Id: <202111232305.1ANN5Hbf023706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 0fdc76eaabb7 - stable/13 - Allow GEOM utilities to specify a -v option. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0fdc76eaabb7d4760723dbb1c63d15d7d4f792f6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637708717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4y7UlC2OZsYv2Te6b08tJFbYFnIILMEwbsslQ/nkyJQ=; b=Ozpj8aOP+8zi3kbBrfBCwtgII6B6yG3pDben0vPRjAiK3aORTOuyHWBiiBba3h+lT9J22L LlbAEeRlqL4Na7imRgWEeprLu2Alax3KiAY6TwAEonCh8Bib6yFhe2FGcAQPHGlOEm+MqF xnK3bReTL2niQvHvF9ywrxByAs/IIIpQ7/FdOWQTJ9qvUax6T2daZCorNq0K0hiXDkZets I5pa1o5A4A591ujWK+fNHA9Y5NPbLbPxgWZ1PWAUpUScvcI4VGqESiPWTFrdfb7qTAk225 mzNRIsun5q/H3907Y4SJAZgNkmU152ADZmGd8IeGxii41W1h7FdDq8FHhkNDHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637708717; a=rsa-sha256; cv=none; b=NT2tnJnjzImryttlA16ap0PujYY+n/DoHWWOl5SILb/U1NAgJ5MwMtiA4yR6+eAT/Nybmo 4UaMSMdrkh0JyHr2wr/+RvLufFRV7/N7MKDXvK6K8btzY9AK0ImdWe7D2s043/uvi4rnlw eylo8hbfgUwuHC9/S5P2JgMAoJ0Dt35Uh05EpjQYxKijHOrFtKFZ2adBtMu4LyJWhR3V6d oIFLxAfScI+8isljPMBwE8DpPIYL61VWNCY//metoSbKtRppoJAo/lhBI77IElSJ2oSRG7 1b1CJksqL+2PKYDyOVFcek6tUBwhpEIYK75OZlFm+TbPHPKaCDKntx861+e/GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=0fdc76eaabb7d4760723dbb1c63d15d7d4f792f6 commit 0fdc76eaabb7d4760723dbb1c63d15d7d4f792f6 Author: Kirk McKusick AuthorDate: 2021-10-29 05:49:48 +0000 Commit: Kirk McKusick CommitDate: 2021-11-23 23:04:33 +0000 Allow GEOM utilities to specify a -v option. (cherry picked from commit 68bff4a07e3fa6c30a0c0ff6cf5f0bef95dcbd72) --- sbin/geom/core/geom.c | 19 ++++++++++++------- sbin/geom/core/geom.h | 13 +++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 58b33a067700..2e0d8683df49 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -314,7 +314,7 @@ parse_arguments(struct g_command *cmd, struct gctl_req *req, int *argc, struct g_option *opt; char opts[64]; unsigned i; - int ch; + int ch, vcount; *opts = '\0'; if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) @@ -336,17 +336,22 @@ parse_arguments(struct g_command *cmd, struct gctl_req *req, int *argc, /* * Add specified arguments. */ + vcount = 0; while ((ch = getopt(*argc, *argv, opts)) != -1) { /* Standard (not passed to kernel) options. */ - switch (ch) { - case 'v': + if (ch == 'v' && (cmd->gc_flags & G_FLAG_VERBOSE) != 0) verbose = 1; - continue; - } /* Options passed to kernel. */ opt = find_option(cmd, ch); - if (opt == NULL) + if (opt == NULL) { + if (ch == 'v' && (cmd->gc_flags & G_FLAG_VERBOSE) != 0){ + if (++vcount < 2) + continue; + else + warnx("Option 'v' specified twice."); + } usage(); + } if (!G_OPT_ISMULTI(opt) && G_OPT_ISDONE(opt)) { warnx("Option '%c' specified twice.", opt->go_char); usage(); @@ -440,7 +445,7 @@ set_flags(struct g_command *cmd) { unsigned flags = 0; - if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0 && verbose) + if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) flags |= G_FLAG_VERBOSE; return (flags); diff --git a/sbin/geom/core/geom.h b/sbin/geom/core/geom.h index 89c5828c6429..38a99032f692 100644 --- a/sbin/geom/core/geom.h +++ b/sbin/geom/core/geom.h @@ -32,6 +32,19 @@ #define _GEOM_H_ #define G_LIB_VERSION 5 +/* + * The G_FLAG_VERBOSE flag on a command specification means that the + * comand will accept a -v option and the GEOM framework will print + * out status information after the command when it is run with -v. + * Additionally a GEOM command can explicitly specify a -v option and + * handle it as it would any other option. If both a -v option and + * G_FLAG_VERBOSE are specified for a command then both types of verbose + * information will be output when that command is run with -v. + * + * When the G_FLAG_LOADKLD is specified for a command, the GEOM kernel + * module will be loaded when that command is run if it has not yet been + * loaded. This flag is typically specified for the `create' command. + */ #define G_FLAG_NONE 0x0000 #define G_FLAG_VERBOSE 0x0001 #define G_FLAG_LOADKLD 0x0002 From nobody Tue Nov 23 23:05:18 2021 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 EEC56189C54A; Tue, 23 Nov 2021 23:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKVQ3vXWz3rWQ; Tue, 23 Nov 2021 23:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F1A21F260; Tue, 23 Nov 2021 23:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANN5IE7023731; Tue, 23 Nov 2021 23:05:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANN5IE0023730; Tue, 23 Nov 2021 23:05:18 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:05:18 GMT Message-Id: <202111232305.1ANN5IE0023730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 8b495114eaa2 - stable/13 - Allow GEOM utilities to specify a -v option. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8b495114eaa23f448a0a5c5b34d7495880d2e2b8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637708718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fVyntxlaOPsfaifLvY0fkSmq8iYGBdZCfrrPSPdPjOY=; b=F29gBS+BqQ3CzkB2VPf/c65XAOLI7FV99fDHEotltvFQr+iv8t4FeIZFwUkRZZvY3nybzJ PMGiLMBiAvnNuNLzJVe4RGk8atWzrLGxbh6tkouYMVSxLifEXnV1V7icTy2EelUD9Z3psp 2wOY4t/9N8m/FA3Hw36pWDXh/sG024+bPd27AFqqv/05y1KN8K+EDxH53ZVG9AVgGqXPzt IkJ6cmtmyHOaXmE8Z7D7oaFr3xMjKdysyGek8rkmFJlOFHq0YvVfEm7Tft9zy+LW8FkRy8 vCEWvI82dhVaxMVaKAVZAlqVF1C7PwEkQ4vhi0SA1eY4+18t3GWYGIPzgphgUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637708718; a=rsa-sha256; cv=none; b=KiftHRx6hCbI906akAaffMydjhv2AsRaJ973n1FD4r7HdvC+NsYIlJR/YlyGtZCMa6zeTw KzHA2hlvWykbMQoy/uh2UlgS8s21Uj0XNppEF/ojVPpMkxFHrBkuUYtRBlFETGrupWJbRX DWztljUs2/8TcdqIv6wa9pmz/ZwyBzOT9caqHnfYGFO9XR4oc2g5nKCCKbmt5ZwWOacUyl o6sLaseDImXtMwVHSRFXk+bzooxOpSxwxIgOHpUIrGIQ6shrKETbdMDYdNWzrFzojISe1z skdIlaSfGG+a/W4cfDLpX+gdWCjyzu9bgOfewuBUyfo0mFNz0Gjqr5LFX1JBXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=8b495114eaa23f448a0a5c5b34d7495880d2e2b8 commit 8b495114eaa23f448a0a5c5b34d7495880d2e2b8 Author: Kirk McKusick AuthorDate: 2021-11-11 20:10:28 +0000 Commit: Kirk McKusick CommitDate: 2021-11-23 23:04:33 +0000 Allow GEOM utilities to specify a -v option. Follow up for 3c8192eb8267 (cherry picked from commit e38717c1282f8bc8b16389839bea015359413df8) --- sbin/geom/core/geom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 2e0d8683df49..0202be9a063e 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -445,7 +445,7 @@ set_flags(struct g_command *cmd) { unsigned flags = 0; - if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) + if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0 && verbose) flags |= G_FLAG_VERBOSE; return (flags); From nobody Tue Nov 23 23:12:41 2021 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 6431918A115D; Tue, 23 Nov 2021 23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKfy029Qz3vgG; Tue, 23 Nov 2021 23:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D61F71F721; Tue, 23 Nov 2021 23:12:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCfPi037410; Tue, 23 Nov 2021 23:12:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCfDe037409; Tue, 23 Nov 2021 23:12:41 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:41 GMT Message-Id: <202111232312.1ANNCfDe037409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7ec9f24cdb88 - stable/13 - crypto: Don't assert on valid IV length for Chacha20-Poly1305. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ec9f24cdb8835dbd383c0b04e2cfda5ccccc38d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=49r0hzhHimXpPYsZzRaJm8qxU/cb9VSB/SA5Swd4dBs=; b=in1rBahYEZJAQLM0zssjgzLTsd6RMTbp+mw2NsMc7KIwZNNa1CS63lhjFhsHb1DRq6F1SX jMr+4dxgJRCPfH946zCxX1GNSS9LguMVZAfctS+V4NhFy08RlyhKpk8+68pVY2AL1X98Qi HE+zu9Biu8IsTPag7A/LD6ApP2dpd82wpyG7GQm6o3Txy9E+uyRyHA7aRZVWzCFxW5vhnb +BgHbmwSxgIzd+k+mvVQcrxuf4PPNfKi21Nk/Uhe7J1nFbqhHUgBu3PKJZN9OwszEeVEkY IdKxb4hePNlDlnuToiGNL86Qdsfq1xf6N0IWIiA5O+s1wPEX3eBXFUF7LGfZlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709162; a=rsa-sha256; cv=none; b=vYhCYZz1y+8pamDEmLy6Q094h5hEBuslawo1HpjkuQkTzWEgNRItRiMVjlV0nXrhBWUakV S08QxGUeM95nO4D3r8ZYcaBixabbCV8AZYVrYTnZ3DOh9DnLTcr9WIWgGet6kOnYiFQ2+Q 6A9qWYjVIyPnJPDZ24Dx1L/kXmg79WMuPQMbyiLqeFNsTGlwBd0SuIGWoKsGK6MY56Y7a0 cO9gbT4c7LFGT0Tu8tVLUoowc1Z2FFyNC1uKJ0yLG2XfObQtMqjkEjF33sdOhYTyrNR6y2 gdOeaNH23W871qsZF45XIOeBgWamminc/FjwbobFTQkjHiS0WAPZrBQszwDi5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7ec9f24cdb8835dbd383c0b04e2cfda5ccccc38d commit 7ec9f24cdb8835dbd383c0b04e2cfda5ccccc38d Author: John Baldwin AuthorDate: 2021-11-09 18:52:30 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:34 +0000 crypto: Don't assert on valid IV length for Chacha20-Poly1305. The assertion checking for valid IV lengths added in 1833d6042c9a was not properly updated to permit an IV length of 8 in commit 42dcd39528c6. Reported by: syzbot+f0c0559b8be1d6eb28c7@syzkaller.appspotmail.com Reviewed by: markj Fixes: 42dcd39528c6 crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32860 (cherry picked from commit 442ad83e38e8fda46d9facbd1ddd92bc23e3773e) --- sys/opencrypto/xform_chacha20_poly1305.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/opencrypto/xform_chacha20_poly1305.c b/sys/opencrypto/xform_chacha20_poly1305.c index f593faa9b5ef..9e3414887efc 100644 --- a/sys/opencrypto/xform_chacha20_poly1305.c +++ b/sys/opencrypto/xform_chacha20_poly1305.c @@ -55,7 +55,7 @@ chacha20_poly1305_reinit(void *vctx, const uint8_t *iv, size_t ivlen) { struct chacha20_poly1305_cipher_ctx *ctx = vctx; - KASSERT(ivlen == sizeof(ctx->nonce), + KASSERT(ivlen == 8 || ivlen == sizeof(ctx->nonce), ("%s: invalid nonce length", __func__)); /* Block 0 is used for the poly1305 key. */ From nobody Tue Nov 23 23:12:42 2021 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 6D4A118A124A; Tue, 23 Nov 2021 23:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKfz35bXz3vVP; Tue, 23 Nov 2021 23:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 135261F54C; Tue, 23 Nov 2021 23:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCgLW037434; Tue, 23 Nov 2021 23:12:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCg0X037433; Tue, 23 Nov 2021 23:12:42 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:42 GMT Message-Id: <202111232312.1ANNCg0X037433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b07b1f890e47 - stable/13 - Stop creating socket aio kprocs during boot. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b07b1f890e473591b66e2ccbb0d776dc5334e09a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DsKDi3UwXiLdFIQLRRmt0vdsfz+6sE66bo3gw9xaI48=; b=qrcZUY+gCfeZTLZsH3Tu7kgXqKi8YpSCfuH0i1IsAS3cO8G7y3JDV8oxh/SqJ9p8SsuUR5 4FMAeOzbip+t8Aa/1brZD9NEXFFJ999ENoWN/LkgXSsHAhTDXBhhboqKmv2HCW8VeVJeYJ MVYkSVxTfeIUMrxhLxEuAonWOOSZKKnhotFM2/j9iwvY7ErkNfsdMR6kt1IFffMvTk7yP3 izJKkz7pyddgit9mJE7okOFNUSeH/8ZgQER/SURcI+CljoyBP/XFoqitJlppvJy9bESCB9 uvamtbTH/sg5v/rQqUcv5eQRGYtE4b4HCLQ6+XaW+PfQbm/epUVRx1EcGmqvXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709163; a=rsa-sha256; cv=none; b=NGU3oayX/cE+aC0/9+tIBE8gEivB1j+2ZbpRkLFCGkyfQQrsn5EJ9tAfoDO3n+uw76nm2h xzQ98ZSg2LlVx0Zd8gSnGulZsQrztHF5yLE/PuPXmnVsvR03FseAfHtHK/NfJQxWN61YZG q9WYGaL7Sw9Qgxqilb+RF2HBi++0C/gQnHkkqh/UHX85lKvX97cnnVp1ba52qOlzQA19i6 z5Rz6YY3bpBOxt90/+mAH0XHI0ZGOoSkU5+unygQFUfb9DVDxQOeElfDpgHKH3cVpO2JOx oNlS4HIkT8E35T2c2GxUb3mTIhUk3eqU/VwP8GruwJAEQi+kTXA02m6QL9CNeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b07b1f890e473591b66e2ccbb0d776dc5334e09a commit b07b1f890e473591b66e2ccbb0d776dc5334e09a Author: John Baldwin AuthorDate: 2021-10-12 21:03:07 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:43 +0000 Stop creating socket aio kprocs during boot. Create the initial pool of kprocs on demand when the first socket AIO request is submitted instead. The pool of kprocs used for other AIO requests is similarly created on first use. Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32468 (cherry picked from commit d1b6fef0751b70819e632d7d4722efbc8f94b80b) --- sys/kern/sys_socket.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index e53b0367960b..8ac24a048093 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -583,8 +583,6 @@ soaio_init(void) mtx_init(&soaio_jobs_lock, "soaio jobs", NULL, MTX_DEF); soaio_kproc_unr = new_unrhdr(1, INT_MAX, NULL); TASK_INIT(&soaio_kproc_task, 0, soaio_kproc_create, NULL); - if (soaio_target_procs > 0) - taskqueue_enqueue(taskqueue_thread, &soaio_kproc_task); } SYSINIT(soaio, SI_SUB_VFS, SI_ORDER_ANY, soaio_init, NULL); From nobody Tue Nov 23 23:12:44 2021 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 D2AE918A1260; Tue, 23 Nov 2021 23:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg033Qrz3vSP; Tue, 23 Nov 2021 23:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F63A1F722; Tue, 23 Nov 2021 23:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCi14037458; Tue, 23 Nov 2021 23:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCikt037457; Tue, 23 Nov 2021 23:12:44 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:44 GMT Message-Id: <202111232312.1ANNCikt037457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5f6c2bd03bc3 - stable/13 - bhyve: Support setting the disk serial number for VirtIO block 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f6c2bd03bc35d8ffae3bd7a0ffe38822441b0c8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sG+2cZI9pcpf3ThyW8zWD9CWXZsebkj6Yx8itNvVQMA=; b=b+mDrJPRrYaEeEipDJWkemeP0lbYBL44NC46PBFnQ19cvuZHtZbcFWaihXUyyKJlt8hO8U E+w+Opg9o2Blp6lU5/ysG4NsZcpwbzTfUXQb5fgvm6z6PIedfBF9eR0FsHSgQ/8iCX6Tv2 Tbgow/19q5ym420ZI5DbR8vBc1M3ZYJzsqc6cMghiI0aKQcj48Frh+Zy41+GZe7zggDmj/ XNQR7s5T0p/hOvsF2q98ZDcraaLtZBmuZB3FlLxfZIUBwSzuFinjvcwpCri1KCi1qgQVNZ tORj/3LHd6soaYneDoQtpMGMzzpxsWEecyWw1/gjwxi8gETtD65PqIKaYpnHdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709164; a=rsa-sha256; cv=none; b=a6geY7YnZWmRRCBTf4jv8ElVpf/MS1L0Sh0rvZEeNnMgeqwB3a0v6r8/CbDjpXXMNPGJB3 Nty/z3U6kF4LuSF9ehDutU3N86yp5Hvr1w+uVtWQ6Kq32/2ZYl/RN5MojxjkN2sLWhNKKv f7hkEGflqWV1BmCcdsrT6e+noPjOWx2YYRAXemy3XefiF+NohJEXSigRT0FIoCbvZTAHl7 3XMGE17bvFOYHmHezMyqh2EKZtme9ntPObKV3/ZyxG6L21sAFNItZl8dnt2kr12LpriT9x 9VSksOrwOBKqaaP8E7iHbx7CMtADidq4XUbrfB+JuOndmqSO6rxpoPI6ZY9hWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5f6c2bd03bc35d8ffae3bd7a0ffe38822441b0c8 commit 5f6c2bd03bc35d8ffae3bd7a0ffe38822441b0c8 Author: John Baldwin AuthorDate: 2021-09-17 16:55:06 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:43 +0000 bhyve: Support setting the disk serial number for VirtIO block devices. Reviewed by: allanjude Obtained from: illumos Differential Revision: https://reviews.freebsd.org/D31983 (cherry picked from commit c6efcb1281f3518a92fdc579d2c3c3c74eb6070c) --- usr.sbin/bhyve/bhyve_config.5 | 12 +++++++++++- usr.sbin/bhyve/pci_virtio_block.c | 27 +++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index 1a77b1bbacb4..a9cea3849c01 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 20, 2021 +.Dd September 17, 2021 .Dt BHYVE_CONFIG 5 .Os .Sh NAME @@ -512,6 +512,16 @@ The path of a directory on the host to export to the guest. .It Va ro Ta bool Ta false Ta If true, the guest filesystem is read-only. .El +.Ss VirtIO Block Device Settings +In addition to the block device settings described above, each +VirtIO block device supports the following settings: +.Bl -column "model" "integer" "generated" +.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description +.It Va ser Ta string Ta generated Ta +Serial number of up to twenty characters. +A default serial number is generated using a hash of the backing +store's pathname. +.El .Ss VirtIO Console Device Settings Each VirtIO Console device contains one or more console ports. Each port stores its settings in a node named diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c index 3718b2d7eff0..385b812be84c 100644 --- a/usr.sbin/bhyve/pci_virtio_block.c +++ b/usr.sbin/bhyve/pci_virtio_block.c @@ -453,7 +453,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) { char bident[sizeof("XX:X:X")]; struct blockif_ctxt *bctxt; - const char *path; + const char *path, *serial; MD5_CTX mdctx; u_char digest[16]; struct pci_vtblk_softc *sc; @@ -498,16 +498,23 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) /* sc->vbsc_vq.vq_notify = we have no per-queue notify */ /* - * Create an identifier for the backing file. Use parts of the - * md5 sum of the filename + * If an explicit identifier is not given, create an + * identifier using parts of the md5 sum of the filename. */ - path = get_config_value_node(nvl, "path"); - MD5Init(&mdctx); - MD5Update(&mdctx, path, strlen(path)); - MD5Final(digest, &mdctx); - snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, - "BHYVE-%02X%02X-%02X%02X-%02X%02X", - digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); + bzero(sc->vbsc_ident, VTBLK_BLK_ID_BYTES); + if ((serial = get_config_value_node(nvl, "serial")) != NULL || + (serial = get_config_value_node(nvl, "ser")) != NULL) { + strlcpy(sc->vbsc_ident, serial, VTBLK_BLK_ID_BYTES); + } else { + path = get_config_value_node(nvl, "path"); + MD5Init(&mdctx); + MD5Update(&mdctx, path, strlen(path)); + MD5Final(digest, &mdctx); + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], + digest[5]); + } /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / VTBLK_BSIZE; /* 512-byte units */ From nobody Tue Nov 23 23:12:45 2021 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 B3F4318A1369; Tue, 23 Nov 2021 23:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg20HVGz3vd8; Tue, 23 Nov 2021 23:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 598C11F59A; Tue, 23 Nov 2021 23:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCjtX037489; Tue, 23 Nov 2021 23:12:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCj2l037488; Tue, 23 Nov 2021 23:12:45 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:45 GMT Message-Id: <202111232312.1ANNCj2l037488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ff590791ff6d - stable/13 - cxgbe: Only run ktls_tick when NIC TLS is enabled. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff590791ff6d69c65118cf396c431f2f07b50a75 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n0xfiBkRl5YkZAlyq+IR9in/xNdk1Pa0wG4/C/k7KD4=; b=e7a5P44PzIkCIMcn2Sa1M4NP6YON5cJFcXlFuqYbM17d4ycW1akyHluT3b8GPKdbkDXX12 lCsqIvgJm2t1P8FU7A7epuhKLI4TciRJRr8ifdeLBbWHddr+nfJ+4eXYpW0BQurUv0KX4L 4iArN/j8h3rz918wqN8FmLCS/JDOlS7zrF0r8HYZijN8QdzYCCfcIJ1Ma1R7xP2EOGeoM+ 2HWDGgVnUcfCWm6YfDdA1pE5OffjC/aXOkIIJhnRA8pyiyv2jdTrn1G0nTO7iGIVh08k6S KhC0hAtpV21hAvHa+93ydhwU2++kAE+mzO+KWVyEvhQMO4nFOwMMBTb2stmc6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709166; a=rsa-sha256; cv=none; b=J/AcR/WUvcUfOOdQygROVyJkleUn1GDx2NDdlvxp7/1Scrfzx1jCfUk5eU6lSFgC0cqe1M HtrH7UueUClOYl4xpIB7rtYFqBV3vocM1bFon/BgcxiKmFTIyIurxchjlxdxDgQPSxBIsd o46ZMYo6iYKgjzQSVRRWDmRerqxx5JemjpHkZGO239kkzBWkKzSEIbbKOAnaz2tTgYNHZW VNjaSos/Ro1y31Tk3UJ1qnaWMqz5/gox/eubx9V/O/mUg1csTwL8yaQGyBnfu4O+ahMx/d 5FBFxnBa05CJvsrTJI3bw+t3SQJ+zk+sLnZX2kj98iFViB53hEojKW1Q4ks6BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ff590791ff6d69c65118cf396c431f2f07b50a75 commit ff590791ff6d69c65118cf396c431f2f07b50a75 Author: John Baldwin AuthorDate: 2021-10-14 17:59:16 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:43 +0000 cxgbe: Only run ktls_tick when NIC TLS is enabled. Previously the body of ktls_tick was a nop when NIC TLS was disabled, but the callout was still scheduled consuming power on otherwise-idle systems with Chelsio T6 adapters. Now the callout only runs while NIC TLS is enabled on at least one interface of an adapter. Reported by: mav Reviewed by: np, mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32491 (cherry picked from commit ef3f98ae4778a8d4463166c5ff3c7831099c6048) --- sys/dev/cxgbe/t4_main.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 71877a571982..1522b500c496 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5452,11 +5452,9 @@ ktls_tick(void *arg) uint32_t tstamp; sc = arg; - if (sc->flags & KERN_TLS_ON) { - tstamp = tcp_ts_getticks(); - t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); - t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); - } + tstamp = tcp_ts_getticks(); + t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); + t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); callout_schedule_sbt(&sc->ktls_tick, SBT_1MS, 0, C_HARDCLOCK); } @@ -5476,10 +5474,14 @@ t4_config_kern_tls(struct adapter *sc, bool enable) return (rc); } - if (enable) + if (enable) { sc->flags |= KERN_TLS_ON; - else + callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, + C_HARDCLOCK); + } else { sc->flags &= ~KERN_TLS_ON; + callout_stop(&sc->ktls_tick); + } return (rc); } @@ -6527,11 +6529,6 @@ adapter_full_init(struct adapter *sc) write_global_rss_key(sc); t4_intr_enable(sc); } -#ifdef KERN_TLS - if (is_ktls(sc)) - callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, - C_HARDCLOCK); -#endif return (0); } From nobody Tue Nov 23 23:12:47 2021 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 E213318A1795; Tue, 23 Nov 2021 23:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg51KrSz3vVt; Tue, 23 Nov 2021 23:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 915881F2B7; Tue, 23 Nov 2021 23:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNClYt037537; Tue, 23 Nov 2021 23:12:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNClBV037536; Tue, 23 Nov 2021 23:12:47 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:47 GMT Message-Id: <202111232312.1ANNClBV037536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 98641c00a3ae - stable/13 - Add Chacha20-Poly1305 support in the OCF backend for KTLS. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 98641c00a3aef5d82da653b9a50c734fb4b08d87 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rjloV9SmKSdgGX41x/RrknxyqaXxEvrf4i/H/zm0b4Y=; b=ozwxRDgU0ITcknB8CsMQzCsD2w8hFhV0OTqAUeC2CHVsRYaQQCB7hU+Q/oKtHFL67wYqsi T9dJsUyEJJ8qYPjbtTJaHBdbYz0HQ6UerhKCFpMsteI1Jf/e1T89icCFxxDp2Z8UZLb3rs Lj0crt5/nrBhvR17jNPcCByMJpS0MoG7StpFXBQmUPv/VdA6+jQIQXfuXLTgHYwFYWpfVC 7pbAYrG1yZ9Qz8VqG4VEnLCJLrsMhCuhPB1hhvaHw+sN7k4TmqxlX+z8otyLH7gqUQetd1 VCqHLiM+OCO1LVN3vZS2JJ0HzYGDeVphlBF6uLM1k0UkvOmpXMKAOn72o1pA8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709170; a=rsa-sha256; cv=none; b=Ez2Fy5i3tzx/gdyGwkAhxhdDwAJD6Jvc9lTjPtRadKka9xpQ9kU2udolADZCTeQgQv+7mr 2f2j/BwSDevCQ2jb2+3s2qSTQIcj5mSx0IcmLrsFJF3X/+gKkgOlBWMV0CIhdzH/7RND9Z hXgMhkuUbCUt0Gj4EqZDS8QVYdxqJdAqP6fBTbNtym9TTFDyBN+0IiiVBOg2SgJjXVli3M +qTmMnS9d56MXp7rywtaa4oyE4hJ6L01U0ddTKB3bcVs/AeB7ytNHK5/I/Dl8RtEgL3O3L AGWTezIrIsroZPQhAqSNKxfnDs64TXFci1/gvgYEApbbjeuWkyA0rt+nL+DidA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=98641c00a3aef5d82da653b9a50c734fb4b08d87 commit 98641c00a3aef5d82da653b9a50c734fb4b08d87 Author: John Baldwin AuthorDate: 2021-02-18 17:24:26 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 Add Chacha20-Poly1305 support in the OCF backend for KTLS. This supports Chacha20-Poly1305 for both send and receive for TLS 1.2 and for send in TLS 1.3. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27841 (cherry picked from commit 4dd6800e22b08fa1f756115600e9436818abb168) --- sys/opencrypto/ktls_ocf.c | 116 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 95 insertions(+), 21 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 7f9ece99ccb1..1d5dce83b376 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -87,11 +87,21 @@ SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_crypts, CTLFLAG_RD, &ocf_tls12_gcm_crypts, "Total number of OCF TLS 1.2 GCM encryption operations"); +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_chacha20_crypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_chacha20_crypts, + CTLFLAG_RD, &ocf_tls12_chacha20_crypts, + "Total number of OCF TLS 1.2 Chacha20-Poly1305 encryption operations"); + static COUNTER_U64_DEFINE_EARLY(ocf_tls13_gcm_crypts); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_gcm_crypts, CTLFLAG_RD, &ocf_tls13_gcm_crypts, "Total number of OCF TLS 1.3 GCM encryption operations"); +static COUNTER_U64_DEFINE_EARLY(ocf_tls13_chacha20_crypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_chacha20_crypts, + CTLFLAG_RD, &ocf_tls13_chacha20_crypts, + "Total number of OCF TLS 1.3 Chacha20-Poly1305 encryption operations"); + static COUNTER_U64_DEFINE_EARLY(ocf_inplace); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, inplace, CTLFLAG_RD, &ocf_inplace, @@ -315,7 +325,7 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, } static int -ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, +ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, struct iovec *outiov, int iovcnt, uint64_t seqno, uint8_t record_type __unused) @@ -346,12 +356,26 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, crypto_initreq(&crp, os->sid); /* Setup the IV. */ - memcpy(crp.crp_iv, tls->params.iv, TLS_AEAD_GCM_LEN); - memcpy(crp.crp_iv + TLS_AEAD_GCM_LEN, hdr + 1, sizeof(uint64_t)); + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) { + memcpy(crp.crp_iv, tls->params.iv, TLS_AEAD_GCM_LEN); + memcpy(crp.crp_iv + TLS_AEAD_GCM_LEN, hdr + 1, + sizeof(uint64_t)); + } else { + /* + * Chacha20-Poly1305 constructs the IV for TLS 1.2 + * identically to constructing the IV for AEAD in TLS + * 1.3. + */ + memcpy(crp.crp_iv, tls->params.iv, tls->params.iv_len); + *(uint64_t *)(crp.crp_iv + 4) ^= htobe64(seqno); + } /* Setup the AAD. */ - tls_comp_len = ntohs(hdr->tls_length) - - (AES_GMAC_HASH_LEN + sizeof(uint64_t)); + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + tls_comp_len = ntohs(hdr->tls_length) - + (AES_GMAC_HASH_LEN + sizeof(uint64_t)); + else + tls_comp_len = ntohs(hdr->tls_length) - POLY1305_HASH_LEN; ad.seq = htobe64(seqno); ad.type = hdr->tls_type; ad.tls_vmajor = hdr->tls_vmajor; @@ -391,7 +415,10 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, if (!inplace) crypto_use_output_uio(&crp, &out_uio); - counter_u64_add(ocf_tls12_gcm_crypts, 1); + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + counter_u64_add(ocf_tls12_gcm_crypts, 1); + else + counter_u64_add(ocf_tls12_chacha20_crypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else @@ -403,7 +430,7 @@ ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, } static int -ktls_ocf_tls12_gcm_decrypt(struct ktls_session *tls, +ktls_ocf_tls12_aead_decrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, struct mbuf *m, uint64_t seqno, int *trailer_len) { @@ -422,12 +449,26 @@ ktls_ocf_tls12_gcm_decrypt(struct ktls_session *tls, crypto_initreq(&crp, os->sid); /* Setup the IV. */ - memcpy(crp.crp_iv, tls->params.iv, TLS_AEAD_GCM_LEN); - memcpy(crp.crp_iv + TLS_AEAD_GCM_LEN, hdr + 1, sizeof(uint64_t)); + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) { + memcpy(crp.crp_iv, tls->params.iv, TLS_AEAD_GCM_LEN); + memcpy(crp.crp_iv + TLS_AEAD_GCM_LEN, hdr + 1, + sizeof(uint64_t)); + } else { + /* + * Chacha20-Poly1305 constructs the IV for TLS 1.2 + * identically to constructing the IV for AEAD in TLS + * 1.3. + */ + memcpy(crp.crp_iv, tls->params.iv, tls->params.iv_len); + *(uint64_t *)(crp.crp_iv + 4) ^= htobe64(seqno); + } /* Setup the AAD. */ - tls_comp_len = ntohs(hdr->tls_length) - - (AES_GMAC_HASH_LEN + sizeof(uint64_t)); + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + tls_comp_len = ntohs(hdr->tls_length) - + (AES_GMAC_HASH_LEN + sizeof(uint64_t)); + else + tls_comp_len = ntohs(hdr->tls_length) - POLY1305_HASH_LEN; ad.seq = htobe64(seqno); ad.type = hdr->tls_type; ad.tls_vmajor = hdr->tls_vmajor; @@ -444,7 +485,10 @@ ktls_ocf_tls12_gcm_decrypt(struct ktls_session *tls, crp.crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; crypto_use_mbuf(&crp, m); - counter_u64_add(ocf_tls12_gcm_crypts, 1); + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + counter_u64_add(ocf_tls12_gcm_crypts, 1); + else + counter_u64_add(ocf_tls12_chacha20_crypts, 1); error = ktls_ocf_dispatch(os, &crp); crypto_destroyreq(&crp); @@ -453,7 +497,7 @@ ktls_ocf_tls12_gcm_decrypt(struct ktls_session *tls, } static int -ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, +ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, struct iovec *outiov, int iovcnt, uint64_t seqno, uint8_t record_type) { @@ -503,11 +547,11 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, */ memcpy(iov, iniov, iovcnt * sizeof(*iov)); iov[iovcnt].iov_base = trailer; - iov[iovcnt].iov_len = AES_GMAC_HASH_LEN + 1; + iov[iovcnt].iov_len = tls->params.tls_tlen; uio.uio_iov = iov; uio.uio_iovcnt = iovcnt + 1; uio.uio_offset = 0; - uio.uio_resid = crp.crp_payload_length + AES_GMAC_HASH_LEN; + uio.uio_resid = crp.crp_payload_length + tls->params.tls_tlen - 1; uio.uio_segflg = UIO_SYSSPACE; uio.uio_td = curthread; crypto_use_uio(&crp, &uio); @@ -521,7 +565,7 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, out_uio.uio_iovcnt = iovcnt + 1; out_uio.uio_offset = 0; out_uio.uio_resid = crp.crp_payload_length + - AES_GMAC_HASH_LEN; + tls->params.tls_tlen - 1; out_uio.uio_segflg = UIO_SYSSPACE; out_uio.uio_td = curthread; crypto_use_output_uio(&crp, &out_uio); @@ -532,7 +576,10 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, memcpy(crp.crp_iv, nonce, sizeof(nonce)); - counter_u64_add(ocf_tls13_gcm_crypts, 1); + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + counter_u64_add(ocf_tls13_gcm_crypts, 1); + else + counter_u64_add(ocf_tls13_chacha20_crypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else @@ -640,6 +687,32 @@ ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) mac_csp.csp_auth_key = tls->params.auth_key; mac_csp.csp_auth_klen = tls->params.auth_key_len; break; + case CRYPTO_CHACHA20_POLY1305: + switch (tls->params.cipher_key_len) { + case 256 / 8: + break; + default: + return (EINVAL); + } + + /* Only TLS 1.2 and 1.3 are supported. */ + if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || + tls->params.tls_vminor < TLS_MINOR_VER_TWO || + tls->params.tls_vminor > TLS_MINOR_VER_THREE) + return (EPROTONOSUPPORT); + + /* TLS 1.3 is not yet supported for receive. */ + if (direction == KTLS_RX && + tls->params.tls_vminor == TLS_MINOR_VER_THREE) + return (EPROTONOSUPPORT); + + csp.csp_flags |= CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD; + csp.csp_mode = CSP_MODE_AEAD; + csp.csp_cipher_alg = CRYPTO_CHACHA20_POLY1305; + csp.csp_cipher_key = tls->params.cipher_key; + csp.csp_cipher_klen = tls->params.cipher_key_len; + csp.csp_ivlen = CHACHA20_POLY1305_IV_LEN; + break; default: return (EPROTONOSUPPORT); } @@ -668,14 +741,15 @@ ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) mtx_init(&os->lock, "ktls_ocf", NULL, MTX_DEF); tls->cipher = os; - if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) { + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16 || + tls->params.cipher_algorithm == CRYPTO_CHACHA20_POLY1305) { if (direction == KTLS_TX) { if (tls->params.tls_vminor == TLS_MINOR_VER_THREE) - tls->sw_encrypt = ktls_ocf_tls13_gcm_encrypt; + tls->sw_encrypt = ktls_ocf_tls13_aead_encrypt; else - tls->sw_encrypt = ktls_ocf_tls12_gcm_encrypt; + tls->sw_encrypt = ktls_ocf_tls12_aead_encrypt; } else { - tls->sw_decrypt = ktls_ocf_tls12_gcm_decrypt; + tls->sw_decrypt = ktls_ocf_tls12_aead_decrypt; } } else { tls->sw_encrypt = ktls_ocf_tls_cbc_encrypt; From nobody Tue Nov 23 23:12:46 2021 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 EB63818A14DF; Tue, 23 Nov 2021 23:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg420Yrz3vXm; Tue, 23 Nov 2021 23:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79C511F54D; Tue, 23 Nov 2021 23:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCkm0037513; Tue, 23 Nov 2021 23:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCkLH037512; Tue, 23 Nov 2021 23:12:46 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:46 GMT Message-Id: <202111232312.1ANNCkLH037512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b7f27a60ac72 - stable/13 - Add Chacha20-Poly1305 as a KTLS cipher suite. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b7f27a60ac72c4d0f7740a6d48356c3fc68360d5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k8ojffiWCme8afONt7qfcIKg1qQaH13OjTqLgkm24ZA=; b=reEj94sAYT7jq8vU2+hGUySN1yGqL0ZDRggAHx/DwmEn7ldXPKOiCwwH99HKK0A06Vbi52 dOkAb8dGkxZp9kjSuWTkJRy9ADVP8JkWg6k1ZjAq2XdvXwbyS6nLw0IwEeSSwjg+0sFCyw IU/U+UWKWtwQA27xNpbAaElWLIb2Cxq9rCO92ateuKAdKsn7r7o41oDKKVM1AV357HEbYJ wuODUUj/eusy9O9OEvfaqKtH2N61MpgJ/p5Zg4gyZKtW4Aj+5InQ8UvIOUBswouU/m8Igz niEk+QVzKg/eKB1FEU84jqc7ybMFkYzWjriBmcBwCGCMqs+Ije+3Bw8b0e2erw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709168; a=rsa-sha256; cv=none; b=c03z5K9mcBwxNFnEr76+4xTeKujfUgHG6iIJJ3Guj0M6vPUXD0bUN2VdQnk1t8q6eQqoOl hmM9cIULZd85e0vmltnwfnGwP/dZhAWuQBozCQeVPG5B8JdkgL2cp3Z6tdfY91PRdLNfCD TsAeg2KFuuA7c9d7pkSENNmPpznl3EAMAsp6/Sa87+w33ZFrkiY6Oh9k3bk40lVc/HWc0E rYsWhj7AEIIhQ35EmpK/LX2yPUOk+1NCMa+hD0zh8+Xetz6HqtYifksXWjG9/QMun7IzGe puEuvD91xN4dzIdU2LrAr49Qh26k5UnS6FvYnmiC9lfdMdYCt19Wu5vQJ1K/CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b7f27a60ac72c4d0f7740a6d48356c3fc68360d5 commit b7f27a60ac72c4d0f7740a6d48356c3fc68360d5 Author: John Baldwin AuthorDate: 2021-02-18 17:23:59 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 Add Chacha20-Poly1305 as a KTLS cipher suite. Chacha20-Poly1305 for TLS is an AEAD cipher suite for both TLS 1.2 and TLS 1.3 (RFCs 7905 and 8446). For both versions, Chacha20 uses the server and client IVs as implicit nonces xored with the record sequence number to generate the per-record nonce matching the construction used with AES-GCM for TLS 1.3. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27839 (cherry picked from commit 9c64fc40290e08f6dc6b75aa04084b04e48a61af) --- sys/kern/uipc_ktls.c | 76 ++++++++++++++++++++++++++++++++++++++++++---------- sys/sys/ktls.h | 1 + 2 files changed, 63 insertions(+), 14 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 17c199230d0a..567d3d04a6f0 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -199,6 +199,11 @@ static COUNTER_U64_DEFINE_EARLY(ktls_sw_gcm); SYSCTL_COUNTER_U64(_kern_ipc_tls_sw, OID_AUTO, gcm, CTLFLAG_RD, &ktls_sw_gcm, "Active number of software TLS sessions using AES-GCM"); +static COUNTER_U64_DEFINE_EARLY(ktls_sw_chacha20); +SYSCTL_COUNTER_U64(_kern_ipc_tls_sw, OID_AUTO, chacha20, CTLFLAG_RD, + &ktls_sw_chacha20, + "Active number of software TLS sessions using Chacha20-Poly1305"); + static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_cbc); SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, cbc, CTLFLAG_RD, &ktls_ifnet_cbc, @@ -209,6 +214,11 @@ SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, gcm, CTLFLAG_RD, &ktls_ifnet_gcm, "Active number of ifnet TLS sessions using AES-GCM"); +static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_chacha20); +SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, chacha20, CTLFLAG_RD, + &ktls_ifnet_chacha20, + "Active number of ifnet TLS sessions using Chacha20-Poly1305"); + static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_reset); SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, reset, CTLFLAG_RD, &ktls_ifnet_reset, "TLS sessions updated to a new ifnet send tag"); @@ -238,6 +248,11 @@ static COUNTER_U64_DEFINE_EARLY(ktls_toe_gcm); SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, gcm, CTLFLAG_RD, &ktls_toe_gcm, "Active number of TOE TLS sessions using AES-GCM"); + +static counter_u64_t ktls_toe_chacha20; +SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, chacha20, CTLFLAG_RD, + &ktls_toe_chacha20, + "Active number of TOE TLS sessions using Chacha20-Poly1305"); #endif static MALLOC_DEFINE(M_KTLS, "ktls", "Kernel TLS"); @@ -508,6 +523,15 @@ ktls_create_session(struct socket *so, struct tls_enable *en, if (en->auth_key_len == 0) return (EINVAL); break; + case CRYPTO_CHACHA20_POLY1305: + if (en->auth_algorithm != 0 || en->auth_key_len != 0) + return (EINVAL); + if (en->tls_vminor != TLS_MINOR_VER_TWO && + en->tls_vminor != TLS_MINOR_VER_THREE) + return (EINVAL); + if (en->iv_len != TLS_CHACHA20_IV_LEN) + return (EINVAL); + break; default: return (EINVAL); } @@ -539,15 +563,6 @@ ktls_create_session(struct socket *so, struct tls_enable *en, if (en->tls_vminor < TLS_MINOR_VER_THREE) tls->params.tls_hlen += sizeof(uint64_t); tls->params.tls_tlen = AES_GMAC_HASH_LEN; - - /* - * TLS 1.3 includes optional padding which we - * do not support, and also puts the "real" record - * type at the end of the encrypted data. - */ - if (en->tls_vminor == TLS_MINOR_VER_THREE) - tls->params.tls_tlen += sizeof(uint8_t); - tls->params.tls_bs = 1; break; case CRYPTO_AES_CBC: @@ -576,10 +591,25 @@ ktls_create_session(struct socket *so, struct tls_enable *en, } tls->params.tls_bs = AES_BLOCK_LEN; break; + case CRYPTO_CHACHA20_POLY1305: + /* + * Chacha20 uses a 12 byte implicit IV. + */ + tls->params.tls_tlen = POLY1305_HASH_LEN; + tls->params.tls_bs = 1; + break; default: panic("invalid cipher"); } + /* + * TLS 1.3 includes optional padding which we do not support, + * and also puts the "real" record type at the end of the + * encrypted data. + */ + if (en->tls_vminor == TLS_MINOR_VER_THREE) + tls->params.tls_tlen += sizeof(uint8_t); + KASSERT(tls->params.tls_hlen <= MBUF_PEXT_HDR_LEN, ("TLS header length too long: %d", tls->params.tls_hlen)); KASSERT(tls->params.tls_tlen <= MBUF_PEXT_TRAIL_LEN, @@ -603,9 +633,9 @@ ktls_create_session(struct socket *so, struct tls_enable *en, goto out; /* - * This holds the implicit portion of the nonce for GCM and - * the initial implicit IV for TLS 1.0. The explicit portions - * of the IV are generated in ktls_frame(). + * This holds the implicit portion of the nonce for AEAD + * ciphers and the initial implicit IV for TLS 1.0. The + * explicit portions of the IV are generated in ktls_frame(). */ if (en->iv_len != 0) { tls->params.iv_len = en->iv_len; @@ -614,8 +644,8 @@ ktls_create_session(struct socket *so, struct tls_enable *en, goto out; /* - * For TLS 1.2, generate an 8-byte nonce as a counter - * to generate unique explicit IVs. + * For TLS 1.2 with GCM, generate an 8-byte nonce as a + * counter to generate unique explicit IVs. * * Store this counter in the last 8 bytes of the IV * array so that it is 8-byte aligned. @@ -681,6 +711,9 @@ ktls_cleanup(struct ktls_session *tls) case CRYPTO_AES_NIST_GCM_16: counter_u64_add(ktls_sw_gcm, -1); break; + case CRYPTO_CHACHA20_POLY1305: + counter_u64_add(ktls_sw_chacha20, -1); + break; } tls->free(tls); break; @@ -692,6 +725,9 @@ ktls_cleanup(struct ktls_session *tls) case CRYPTO_AES_NIST_GCM_16: counter_u64_add(ktls_ifnet_gcm, -1); break; + case CRYPTO_CHACHA20_POLY1305: + counter_u64_add(ktls_ifnet_chacha20, -1); + break; } if (tls->snd_tag != NULL) m_snd_tag_rele(tls->snd_tag); @@ -705,6 +741,9 @@ ktls_cleanup(struct ktls_session *tls) case CRYPTO_AES_NIST_GCM_16: counter_u64_add(ktls_toe_gcm, -1); break; + case CRYPTO_CHACHA20_POLY1305: + counter_u64_add(ktls_toe_chacha20, -1); + break; } break; #endif @@ -763,6 +802,9 @@ ktls_try_toe(struct socket *so, struct ktls_session *tls, int direction) case CRYPTO_AES_NIST_GCM_16: counter_u64_add(ktls_toe_gcm, 1); break; + case CRYPTO_CHACHA20_POLY1305: + counter_u64_add(ktls_toe_chacha20, 1); + break; } } return (error); @@ -885,6 +927,9 @@ ktls_try_ifnet(struct socket *so, struct ktls_session *tls, bool force) case CRYPTO_AES_NIST_GCM_16: counter_u64_add(ktls_ifnet_gcm, 1); break; + case CRYPTO_CHACHA20_POLY1305: + counter_u64_add(ktls_ifnet_chacha20, 1); + break; } } return (error); @@ -928,6 +973,9 @@ ktls_try_sw(struct socket *so, struct ktls_session *tls, int direction) case CRYPTO_AES_NIST_GCM_16: counter_u64_add(ktls_sw_gcm, 1); break; + case CRYPTO_CHACHA20_POLY1305: + counter_u64_add(ktls_sw_chacha20, 1); + break; } return (0); } diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 2f15cce3fc55..3cde75f9edf6 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -46,6 +46,7 @@ struct tls_record_layer { #define TLS_MAX_PARAM_SIZE 1024 /* Max key/mac/iv in sockopt */ #define TLS_AEAD_GCM_LEN 4 #define TLS_1_3_GCM_IV_LEN 12 +#define TLS_CHACHA20_IV_LEN 12 #define TLS_CBC_IMPLICIT_IV_LEN 16 /* Type values for the record layer */ From nobody Tue Nov 23 23:12:48 2021 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 BC8B318A13E1; Tue, 23 Nov 2021 23:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg56nmkz3vgh; Tue, 23 Nov 2021 23:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F3041F59B; Tue, 23 Nov 2021 23:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCmJc037561; Tue, 23 Nov 2021 23:12:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCmor037560; Tue, 23 Nov 2021 23:12:48 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:48 GMT Message-Id: <202111232312.1ANNCmor037560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6afc00ed139d - stable/13 - ktls: Use COUNTER_U64_DEFINE_EARLY for the ktls_toe_chacha20 counter. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6afc00ed139d9cfa63d6f99a24d34622e1b6b792 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxE5L7AUAQsvHc10wDQKULGFzec/1skZkal+93kAXJs=; b=NUw3cmcPs4ciuqjRi4N1mD4QimW/NQBciU9BGzvR6xUJ/y4bCNZpyg9gM5p7cdVL8Nz7Oz gpy6xklc8ULYlpZZywbd1JJRHiH5np8wEfL7ZFqz3GBuDrKpZI7/ArnColSdcqFy6IiuJ4 N/eBnfmuBN0T2wGt0/h1GQGb30DgSVJk03TQQvxC08fFFNR8dl+IL5BM4/ZzizpYKUGwWj 107NiMC8P/PENZqrhbruKhssz30lHEjeUgAaNdfAXpweekPnJu6+LoTIYoMcGkgd6BPM8Q UzRIsU5vFAnjfA1emff4lBG6+rt+9farBXeLu5ZQqSePIHmHXl3xJc3wEC1GzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709170; a=rsa-sha256; cv=none; b=UfhpXcuuY5D0pc0nIs0VxS9u6M0/0HozcCEg1EDDaVk3lJ9xZq4TeNnJSx13uT9uvJftQE sLw3L8o/z3IWH2m14Po3snmd+UIPicGvcZMONXs6qmFEiQzkjGEnOEfEm7/1ksxhHpES/6 gnQYrre/pvbVo7/UxxuyDJjWU2nbQIq/+Kuyvj4w9GhjSzN7EY/Nm9Y0hEchfwT04z002c iLBidgELWJdl0pwmHXSueI3WdgUNAXCIg8oCl/TOttsiikLMi12QWsTWw4XQVPBYdUzsgg Yox/nOSLK/iLZa7DMVA/AqlDC48BdQwHTM8SIWl9+4kZT9wgB7CFeNSUJzPerw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6afc00ed139d9cfa63d6f99a24d34622e1b6b792 commit 6afc00ed139d9cfa63d6f99a24d34622e1b6b792 Author: John Baldwin AuthorDate: 2021-02-20 00:33:46 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 ktls: Use COUNTER_U64_DEFINE_EARLY for the ktls_toe_chacha20 counter. I missed updating this counter when rebasing the changes in 9c64fc40290e08f6dc6b75aa04084b04e48a61af after the switch to COUNTER_U64_DEFINE_EARLY in 1755b2b9891bb1bfa7a58383ef5126821f7e46e3. Fixes: 9c64fc40290e Add Chacha20-Poly1305 as a KTLS cipher suite. Sponsored by: Netflix (cherry picked from commit 90972f04026a2248d616d7466053ff53cf8fdf9d) --- sys/kern/uipc_ktls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 567d3d04a6f0..0cb5343b6a2a 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -249,7 +249,7 @@ SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, gcm, CTLFLAG_RD, &ktls_toe_gcm, "Active number of TOE TLS sessions using AES-GCM"); -static counter_u64_t ktls_toe_chacha20; +static COUNTER_U64_DEFINE_EARLY(ktls_toe_chacha20); SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, chacha20, CTLFLAG_RD, &ktls_toe_chacha20, "Active number of TOE TLS sessions using Chacha20-Poly1305"); From nobody Tue Nov 23 23:12:49 2021 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 CA87318A165B; Tue, 23 Nov 2021 23:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg61Yhpz3vVx; Tue, 23 Nov 2021 23:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C53521F59C; Tue, 23 Nov 2021 23:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCnNO037585; Tue, 23 Nov 2021 23:12:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCn4B037584; Tue, 23 Nov 2021 23:12:49 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:49 GMT Message-Id: <202111232312.1ANNCn4B037584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5ce0850641a3 - stable/13 - ktls_ocf: Fix a few places to not hardcode the GMAC hash length. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ce0850641a3224e999c501030df08d8f1dd994d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sEgNu8rT9PuXXDZXykJQkU82XUTFPRvPVusC849BNnw=; b=ct0+VlnjUr5HgXbMuHCb094cx3OzDtS2Ml0GWKJIWza7AEDTKmzTwLjW027ZN1CORLFQJn Y3k2b01xkfLt7T4ZD4+NFzugrHYqnyVCNXNihIkskE+Y5oLvLTiJRVKSE1wdVszO1qgJfU 7nCA7d1HEb0WtKXA/W5NcngNeMKDNUFIhd9sx2IltTK7lunnwaBNr8wF089WZQD2JTdDiW uisGWd9n0a0/iRkjc47ByT/QPEhS5lAxVTLOq2T8rzQUdpbzioNfoIrP9xXj8TvO4PmdrU z4RNLJ2Gx1Jx6QmL4gYYSj8RzfWar7O7Q58JAVBrF1paGe83Wh4PLx14yzuFxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709171; a=rsa-sha256; cv=none; b=qLP3Fyfe/MRFS1dj5qWZnwtscKyyS2XfiGr937u/+Jin3ZMrM2rEDF0kpq9iIThCAn1ZXT OpQZZT1qbw0cFVRJzgMu8NUnQoSBV87PZBO7/IK94k3jMaGzmWOLWNxWa7KlGX09TFXIzE zjPoLcrvKVG02g6OfTgLtSqIz4qX9ligRW8Aegth1GVSVr5VWH2b1RowYDPoNHqPfZzpQj yZfgf1CEe4lraUs0KCdp/Z7q+JmeBwJHx1+PAjN+FOsuj/SRGMjTOz5SbPj2evvk0Hi6OU Fg58BLUqwtAknmVWlLGSMqOgYKknlbQqoJJFE+l3MaIElU2bCBTbmgHxYyQsHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5ce0850641a3224e999c501030df08d8f1dd994d commit 5ce0850641a3224e999c501030df08d8f1dd994d Author: John Baldwin AuthorDate: 2021-05-25 23:59:18 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 ktls_ocf: Fix a few places to not hardcode the GMAC hash length. This is not a functional change as the Poly1305 hash is the same length as the GMAC hash length. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30137 (cherry picked from commit 4a92afae7fcbb0a8453712dfec5de086aaf5cba4) --- sys/opencrypto/ktls_ocf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 1d5dce83b376..78331b76abd7 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -403,11 +403,11 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, /* Duplicate iovec and append vector for tag. */ memcpy(iov, tag_uio->uio_iov, iovcnt * sizeof(struct iovec)); iov[iovcnt].iov_base = trailer; - iov[iovcnt].iov_len = AES_GMAC_HASH_LEN; + iov[iovcnt].iov_len = tls->params.tls_tlen; tag_uio->uio_iov = iov; tag_uio->uio_iovcnt++; crp.crp_digest_start = tag_uio->uio_resid; - tag_uio->uio_resid += AES_GMAC_HASH_LEN; + tag_uio->uio_resid += tls->params.tls_tlen; crp.crp_op = CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST; crp.crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; @@ -492,7 +492,7 @@ ktls_ocf_tls12_aead_decrypt(struct ktls_session *tls, error = ktls_ocf_dispatch(os, &crp); crypto_destroyreq(&crp); - *trailer_len = AES_GMAC_HASH_LEN; + *trailer_len = tls->params.tls_tlen; return (error); } From nobody Tue Nov 23 23:12:51 2021 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 8A50B18A16E4; Tue, 23 Nov 2021 23:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg86FT4z3vbM; Tue, 23 Nov 2021 23:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16C831F0CB; Tue, 23 Nov 2021 23:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCppd037639; Tue, 23 Nov 2021 23:12:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCpfp037638; Tue, 23 Nov 2021 23:12:51 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:51 GMT Message-Id: <202111232312.1ANNCpfp037638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9811763b417a - stable/13 - iscsi: Validate DataSN values in Data-In PDUs in the initiator. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9811763b417a36ca66c8512bbe09fcaec4407514 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m6HK26YYXXsgcl/vwWb2O13Mz4FstyTTxvacUtQaHSg=; b=MFBYC3faeJC5uu7iD262qtVJFakeBhyn41A1XJc5hu3V9/a5mBrxVdCSJkomymwzjxcIYG 8l4WaphN7/5otIPW+xZV/E3bKq5nRI7bGRz6j7yo8LKcOIqY8g+2BZ4Lmqb2kuXnNbRkXZ hawkwAJAJVk1ex9YhkQdBOzromRNj/7/9vE6YakjcazmjdBG1sEa1Bz9KLAA30vp7S0K/j P3eFpUarcpNFnTqZxx0cls7X/O0ZzKp6lIPvwdvEnQY0q7vl5ef2mlcHfEXhG9r6lDMmRa BWou04rSZiopQxtFxDg8MxgF6X8HzQp/wqAq2UxeGuinuEcaIIYXHDpokR2PAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709173; a=rsa-sha256; cv=none; b=DlAcubFW8xt6+WiOinaB3f46tFnbyFVdsX/hwdnjzupTcxyRR6lxCZ0I0FV2kxmUpOQtbN KJ51Fq3lhz+aRZOIzM2R+ay+BJUkY2PVbIKwrtEUeS7KYwhuD8RVN6GfaMhSqqoiBeWlcS +Yxvx3Wf16+mhuA2g0R4xOZT34OI3nyzpZrpVaEZ9jivUSbUar+UmWFt+xfNlY7WVFf5Ns FzWuVLzQiNGspSUo3nJZ4OPQHFsJg3DOtIFpmEQGGUwxqnD2FqkMbFEz1xDwM+otdJ5X9L iSPz9Xu6dGIgu0D0NoNQX1lHOb4AvT2lCLwzipmN1/pOBHht0eKaBhR4LMm4Lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9811763b417a36ca66c8512bbe09fcaec4407514 commit 9811763b417a36ca66c8512bbe09fcaec4407514 Author: John Baldwin AuthorDate: 2021-08-24 21:58:34 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 iscsi: Validate DataSN values in Data-In PDUs in the initiator. As is done in the target, require that DataSN values are consecutive and in-order. If an out of order Data-In PDU is received, force a session reconnect. In addition, when a SCSI Response PDU is received, verify that the ExpDataSN field matches the count of Data-In PDUs received for this command. If not, force a session reconnect. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31594 (cherry picked from commit 4f0f5bf99591ad9907822082270523ac919e3b8c) --- sys/dev/iscsi/iscsi.c | 21 ++++++++++++++++++++- sys/dev/iscsi/iscsi.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index f60904bb3de0..093ba51d265e 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -892,6 +892,15 @@ iscsi_pdu_handle_scsi_response(struct icl_pdu *response) } ccb = io->io_ccb; + if (ntohl(bhssr->bhssr_expdatasn) != io->io_datasn) { + ISCSI_SESSION_WARN(is, + "ExpDataSN mismatch in SCSI Response (%u vs %u)", + ntohl(bhssr->bhssr_expdatasn), io->io_datasn); + icl_pdu_free(response); + iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); + return; + } /* * With iSER, after getting good response we can be sure @@ -1047,6 +1056,17 @@ iscsi_pdu_handle_data_in(struct icl_pdu *response) return; } + if (io->io_datasn != ntohl(bhsdi->bhsdi_datasn)) { + ISCSI_SESSION_WARN(is, "received Data-In PDU with " + "DataSN %u, while expected %u; dropping connection", + ntohl(bhsdi->bhsdi_datasn), io->io_datasn); + icl_pdu_free(response); + iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); + return; + } + io->io_datasn += response->ip_additional_pdus + 1; + data_segment_len = icl_pdu_data_segment_length(response); if (data_segment_len == 0) { /* @@ -1096,7 +1116,6 @@ iscsi_pdu_handle_data_in(struct icl_pdu *response) icl_pdu_get_data(response, 0, csio->data_ptr + oreceived, data_segment_len); /* - * XXX: Check DataSN. * XXX: Check F. */ if ((bhsdi->bhsdi_flags & BHSDI_FLAGS_S) == 0) { diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h index fe1cc64f88db..871fc6fc90e9 100644 --- a/sys/dev/iscsi/iscsi.h +++ b/sys/dev/iscsi/iscsi.h @@ -44,6 +44,7 @@ struct iscsi_outstanding { TAILQ_ENTRY(iscsi_outstanding) io_next; union ccb *io_ccb; size_t io_received; + uint32_t io_datasn; uint32_t io_initiator_task_tag; uint32_t io_referenced_task_tag; void *io_icl_prv; From nobody Tue Nov 23 23:12:50 2021 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 9083718A1676; Tue, 23 Nov 2021 23:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg72d5wz3vW3; Tue, 23 Nov 2021 23:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F04D71F59D; Tue, 23 Nov 2021 23:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCoON037615; Tue, 23 Nov 2021 23:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNColL037614; Tue, 23 Nov 2021 23:12:50 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:50 GMT Message-Id: <202111232312.1ANNColL037614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b3d02f0be3ec - stable/13 - ctld: Always declare MaxRecvDataSegmentLength. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b3d02f0be3ecd4a08fcd4b9ca366f9cf56418356 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TJAqs6mYDTsoTlJeB7cw3Pb8fl07l0/6ZWj30iyfGoE=; b=OaS9MeU48/xNJjtX/lxeAtT/abW2ZN+dibkHZVhOrg2GoYZZ9RFr2SmB+wM0i11yxbPY+/ NCtYJG1SuDdtXC4gicOI+FBLveXBcSE++i8GNBPp9UgWcDrln7d2npT1SBsUTsDH0xwsRo mF7a/wbBmQCcQkF8dd4EZZZ+KKylAphJMmMjwaCdojhq6ohN51Wo3cFSqPE8lZvcUnOhff w/EPQCwAiuHi7hEALC5LmAiM0m0oQbcXiB5TGMiyj+jncf2Adnj7kynSuYb7gmK632IMqs dy1aXgLvc/pMv5OJws7QuRL+/1WV4l9V4HNz9Q276m5PMbKKSjuqTnR63ZXSrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709171; a=rsa-sha256; cv=none; b=TT2b/nrHkRYGYtJRhgh25LQapiMbwoRG/2wI696a2DtI97kzSEKVc1gOd/rzhoh7bbrtl0 s/z+6Jla6lECj3IgXZkMWyv+zIB/J9yB/y/alq0CzUM2Pf7CG+OqjiAeKnxni3a7VL/dZC 8NwGxM+fPgsYLfI6doc86R4Ad2Qb8aJJKpGaHF45gOhBfHGC4n55KGAvJJciuAJGQGu+Kb SZg06SofX5/1th/6WUchYYHDd1YgF5gSO6vN8n7R5BakFc3Ib9vSHS3vZAsOyaQexyGG7t T5K8GQsCXus3UqWbsaYMs7wxWx0CsoF4nnCbUX0wzPx2PaqIeguLSYoNID8V1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b3d02f0be3ecd4a08fcd4b9ca366f9cf56418356 commit b3d02f0be3ecd4a08fcd4b9ca366f9cf56418356 Author: John Baldwin AuthorDate: 2021-10-26 21:52:40 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 ctld: Always declare MaxRecvDataSegmentLength. This key is Declarative and should always be sent even if the initiator did not send it's own limit. This is similar to the fix in fc79cf4fea72 but for the target side. However, unlike that fix, failure to send the key simply results in reduced performance. PR: 259439 Reviewed by: mav, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32651 (cherry picked from commit 7ef7b252adc0152e5f726d00640124c5de0909a9) --- usr.sbin/ctld/login.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ctld/login.c b/usr.sbin/ctld/login.c index f219a3044586..63b2cfd51d92 100644 --- a/usr.sbin/ctld/login.c +++ b/usr.sbin/ctld/login.c @@ -565,10 +565,6 @@ login_negotiate_key(struct pdu *request, const char *name, tmp = conn->conn_max_send_data_segment_limit; } conn->conn_max_send_data_segment_length = tmp; - conn->conn_max_recv_data_segment_length = - conn->conn_max_recv_data_segment_limit; - keys_add_int(response_keys, name, - conn->conn_max_recv_data_segment_length); } else if (strcmp(name, "MaxBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) { @@ -796,6 +792,11 @@ login_negotiate(struct connection *conn, struct pdu *request) log_errx(1, "initiator sent FirstBurstLength > MaxBurstLength"); } + conn->conn_max_recv_data_segment_length = + conn->conn_max_recv_data_segment_limit; + keys_add_int(response_keys, "MaxRecvDataSegmentLength", + conn->conn_max_recv_data_segment_length); + log_debugx("operational parameter negotiation done; " "transitioning to Full Feature Phase"); From nobody Tue Nov 23 23:12:54 2021 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 224BB18A1C01; Tue, 23 Nov 2021 23:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgC500Bz3vY9; Tue, 23 Nov 2021 23:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C62A1F148; Tue, 23 Nov 2021 23:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCs1a037687; Tue, 23 Nov 2021 23:12:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCsVi037686; Tue, 23 Nov 2021 23:12:54 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:54 GMT Message-Id: <202111232312.1ANNCsVi037686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0053fedc1b47 - stable/13 - ktls: Reject attempts to enable AES-CBC with TLS 1.3. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0053fedc1b4790f2e094c326adef95302c105f8b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aliLs6Qr9UhH9kKXABszquHcTcXicH00mrlmCDxREoQ=; b=Gq9nolw38xXcTmcy+Vfph+VRpJUbDKfvNAtteVxzf9UqH/72d2jpC0tFMnHRcqMMN1TwL2 Gx3ZzhcgVRYNvn0mqyECQTPND5gi/ik+E2x2pa7kDt/YhSAbGxN9I9+hsqeWibam60A8Sw qoFMEsJ+gqmRqz/CQdCdsUNwHdkI62IdDyDTwokzR+6fEktCi0IhpsOwWW19vkA+lyDpSN WzYDYUoag7reLZL+E6EwFRVIEpQ+eMHMaLXha98Ze5wh2FccDueKrSpj7C1oMZE5FDD5Ti 9C/vrK7rX1KlY16yEw6ycgOq5/iA7y4ktdWPzj9bQa8HU/6ENLUwcR3OxInN6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709176; a=rsa-sha256; cv=none; b=da2aAKbDZXtRVmwvkwCebP75dQ87tfQQIszs4sUFUAo6FeFXdfMhiJLC15Jw8DI4aQFw5V i7Dq4WKrL1dCQ6hKmweYVLRlDCFEvy4+6wBG6u2wQSNqW15vkj5iyzVh4F3KGcqNMgVJiA Wh8Dho2vVkLBzpsHMIu+L1aNYnQlqksMWaHw1WHVmzTiQhsAt0S0fxX0rhFw2BiSJEvQRr e9AR2s9AXuVn0pycIUzKd1XhoW2I0HO/ftqZZHi0RKF9xqHFHHZQx76ddVNhf/Y3jTXuoy SyXqd9R6OvV0vKWsCIiaTQAWtZn1Ap3B9dtYjEl32VisLEK3oyhuMxhoSn+mdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0053fedc1b4790f2e094c326adef95302c105f8b commit 0053fedc1b4790f2e094c326adef95302c105f8b Author: John Baldwin AuthorDate: 2021-10-13 19:12:58 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 ktls: Reject attempts to enable AES-CBC with TLS 1.3. AES-CBC cipher suites are not supported in TLS 1.3. Reported by: syzbot+ab501c50033ec01d53c6@syzkaller.appspotmail.com Reviewed by: tuexen, markj Differential Revision: https://reviews.freebsd.org/D32404 (cherry picked from commit a63752cce6462d08bbec08cad931d70dec2f5b4c) --- sys/kern/uipc_ktls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 0cb5343b6a2a..73915600779c 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -522,6 +522,10 @@ ktls_create_session(struct socket *so, struct tls_enable *en, } if (en->auth_key_len == 0) return (EINVAL); + if (en->tls_vminor != TLS_MINOR_VER_ZERO && + en->tls_vminor != TLS_MINOR_VER_ONE && + en->tls_vminor != TLS_MINOR_VER_TWO) + return (EINVAL); break; case CRYPTO_CHACHA20_POLY1305: if (en->auth_algorithm != 0 || en->auth_key_len != 0) From nobody Tue Nov 23 23:12:53 2021 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 156E118A1994; Tue, 23 Nov 2021 23:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgB4rSPz3vkH; Tue, 23 Nov 2021 23:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33F371F147; Tue, 23 Nov 2021 23:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCr2B037663; Tue, 23 Nov 2021 23:12:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCr33037662; Tue, 23 Nov 2021 23:12:53 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:53 GMT Message-Id: <202111232312.1ANNCr33037662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 412a8b92d9c0 - stable/13 - Further refine the ExpDataSN checks for SCSI Response PDUs. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 412a8b92d9c0490ba700f5ea4f676a16778643bd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNIHUwHRrT1fdFwQvprt2xfzuVByq/1so2bThIIdH8Y=; b=iv+vGQhUrBNjqB6g0MXXmNil+Y77kpkxKdakksVk3CNLqj/B90BY3uP9zRVaivgwRgf6l+ x3dL3LH2XuaisH+86QoIw1dzkZ3ka69+knaVppgHMcckRVSejbx35bHuPi7J7XFtTe4YuS 6g3jLKueNUYsH03gB5dCOwCtn1ivdv8fHX+MDwbuWUyaWHEfkSv77fXQpeFDFKBk478OGj YUotyedm39yikSLJfce5RV9iWLn+d1HzKXcJ+voAu7MoSEFRS7HbtSl+vIvvoWOrwV9UfK ol8ZYAf/6Vb5K19FxNd/OsKZPwAxX0CLkTe0FgUBHWQYDJbyFgYoKgB2+0uFkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709176; a=rsa-sha256; cv=none; b=pvrcBXBox6Edj69TUGWKb/mdHRFDJXmw+umcTfW7qag1xD8NFXFZrRHgfQUCg31he5PFjp rZdkDGhInKMfwN7oukDooaCgtonKArMdJt4tcodf/XFmyOTklNhw0YBCRAs7iipHORjDyY D1Fvm+4IxjIjNPCRYdJ6cEW9LXptzApSB4OEsAYR8fs7vJxygbudbUshU1aNtlysGUB9a6 BEvcUMj0AoSb14gOjl6h4vy5j3Xp/kePYLxbJRmXj6GhuyTdHz17AbW0YMH2x0iOdS46o5 JFqxF3p1ndVlkHW7n0OAzNeUeQnX2sO1y2DIjCa96JxSb04em3fpII2s+DRgFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=412a8b92d9c0490ba700f5ea4f676a16778643bd commit 412a8b92d9c0490ba700f5ea4f676a16778643bd Author: John Baldwin AuthorDate: 2021-10-26 21:50:05 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 Further refine the ExpDataSN checks for SCSI Response PDUs. According to 11.4.8 in RFC 7143, ExpDataSN MUST be 0 if the response code is not Command Completed, but we were requiring it to always be the count of DataIn PDUs regardless of the response code. In addition, at least one target (OCI Oracle iSCSI block device) returns an ExpDataSN of 0 when returning a valid completion with an error status (Check Condition) in response to a SCSI Inquiry. As a workaround for this target, only warn without resetting the connection for a 0 ExpDataSN for responses with a non-zero error status. PR: 259152 Reported by: dch Reviewed by: dch, mav, emaste Fixes: 4f0f5bf99591 iscsi: Validate DataSN values in Data-In PDUs in the initiator. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32650 (cherry picked from commit cdbc4a074bec094dc7f1dfde0773a9417d118ffa) --- sys/dev/iscsi/iscsi.c | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 093ba51d265e..cc860e3f68a8 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -892,15 +892,39 @@ iscsi_pdu_handle_scsi_response(struct icl_pdu *response) } ccb = io->io_ccb; - if (ntohl(bhssr->bhssr_expdatasn) != io->io_datasn) { - ISCSI_SESSION_WARN(is, - "ExpDataSN mismatch in SCSI Response (%u vs %u)", - ntohl(bhssr->bhssr_expdatasn), io->io_datasn); - icl_pdu_free(response); - iscsi_session_reconnect(is); - ISCSI_SESSION_UNLOCK(is); - return; + if (bhssr->bhssr_response == BHSSR_RESPONSE_COMMAND_COMPLETED) { + if (ntohl(bhssr->bhssr_expdatasn) != io->io_datasn) { + ISCSI_SESSION_WARN(is, + "ExpDataSN mismatch in SCSI Response (%u vs %u)", + ntohl(bhssr->bhssr_expdatasn), io->io_datasn); + + /* + * XXX: Permit an ExpDataSN of zero for errors. + * + * This doesn't conform to RFC 7143, but some + * targets seem to do this. + */ + if (bhssr->bhssr_status != 0 && + bhssr->bhssr_expdatasn == htonl(0)) + goto skip_expdatasn; + + icl_pdu_free(response); + iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); + return; + } + } else { + if (bhssr->bhssr_expdatasn != htonl(0)) { + ISCSI_SESSION_WARN(is, + "ExpDataSN mismatch in SCSI Response (%u vs 0)", + ntohl(bhssr->bhssr_expdatasn)); + icl_pdu_free(response); + iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); + return; + } } +skip_expdatasn: /* * With iSER, after getting good response we can be sure From nobody Tue Nov 23 23:12:56 2021 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 ADDB718A19D5; Tue, 23 Nov 2021 23:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgG174qz3vYH; Tue, 23 Nov 2021 23:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A79D21F54F; Tue, 23 Nov 2021 23:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCu9t037741; Tue, 23 Nov 2021 23:12:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCu3f037740; Tue, 23 Nov 2021 23:12:56 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:56 GMT Message-Id: <202111232312.1ANNCu3f037740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 81b6dba1a08b - stable/13 - ktls: Fix assertion for TLS 1.0 CBC when using non-zero starting seqno. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 81b6dba1a08b031bdf7463c1704d27ae1e0daa0f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OSG11pQmayKoQ6xBWGvXxyFRZohzYzbDnu5Dwr3LZKg=; b=qXYDZqD7XpUa+agf1zYW67FUAU4V/FIh9n9tUMKMFcH/68dOKgg0Qjz10yA6rVH2dwmya6 sPV6kexHGre/154qL2wdyB3Y8VISS5dKAoWuCMGc5whg79xxy5iN118y2k3kGmxaQSkxx3 Zlew8F7uQFtO+70aa8lQ8YBSreApUO/QlGal7oBHBv/LnDOOBP2O2EsU7kNxi+T4Ni3K62 q6CWWWAdXK0iIqh18LJXEVWM9d2vhYB7iBfLuLSYBHgCZjH4EKBANn0Sb1Q9h0jDdzwH82 8HTYh93s8BzjAaTBu5GziNQiDfcpdM+IUMHYKRtI6arC43v0mn1naGuL3tv5aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709178; a=rsa-sha256; cv=none; b=ECv9ipk5N85ilMPwyY7bGZmWHtDHoY6USBYhfPnQ8UQ9UDf/HNHEXQXMqdc0rPgc8uQvOX WyiXAL1lSnmgRnzqi36/rkOt98tBI9Ie1r3tus+R85PagaKCKxm0hL6Je7FF+Cw2J33Agj 3E6Q1Erf9m4LGyeGuI00/A8gZnrk7WXwRXkqAtCyoNRoiOsD8am6Y3hotPfT/Bl8G8U7tw 4YlUPEb0U1EvK+ostZ8yUGaOqMnOR1BD4cgy2/j1aPoQW8+C+dPyofGFc16/igPSZY8Oiv FJAAXyKOy7XqQLDC2uuYjARZjvO/c6dhtfV8mRsxmVWG2NcstYxF4lBt0qdgtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=81b6dba1a08b031bdf7463c1704d27ae1e0daa0f commit 81b6dba1a08b031bdf7463c1704d27ae1e0daa0f Author: John Baldwin AuthorDate: 2021-10-27 23:35:56 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:45 +0000 ktls: Fix assertion for TLS 1.0 CBC when using non-zero starting seqno. The starting sequence number used to verify that TLS 1.0 CBC records are encrypted in-order in the OCF layer was always set to 0 and not to the initial sequence number from the struct tls_enable. In practice, OpenSSL always starts TLS transmit offload with a sequence number of zero, so this only matters for tests that use a random starting sequence number. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32676 (cherry picked from commit 4827bf76bce8814b9d9a0d883467a3d2366e59a2) --- sys/opencrypto/ktls_ocf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 78331b76abd7..71f6339e02ad 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -756,6 +756,9 @@ ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) if (tls->params.tls_vminor == TLS_MINOR_VER_ZERO) { os->implicit_iv = true; memcpy(os->iv, tls->params.iv, AES_BLOCK_LEN); +#ifdef INVARIANTS + os->next_seqno = tls->next_seqno; +#endif } } tls->free = ktls_ocf_free; From nobody Tue Nov 23 23:12:55 2021 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 495A818A1B48; Tue, 23 Nov 2021 23:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgD6sPNz3vmX; Tue, 23 Nov 2021 23:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 807A11F149; Tue, 23 Nov 2021 23:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCtse037711; Tue, 23 Nov 2021 23:12:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCtpu037710; Tue, 23 Nov 2021 23:12:55 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:55 GMT Message-Id: <202111232312.1ANNCtpu037710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ba6b771d1732 - stable/13 - ktls: Ensure FIFO encryption order for TLS 1.0. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ba6b771d1732eda0546d187b1397b1bcded3208d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e9ilAIy8JKe+rjTySFbBFfagIh2m2moi/eQerqLHp6w=; b=eAOpfi4rl3ibPXADhdadePnbjYgr8zGLhJkrYfoeYwD/N9prvbzZ0wbFmARoZJPPmK3i2C 2cspeI6oGirL5lS/c92gpCeCAbpBz9gg0NoVQBJZXiC/nTqJ0757ZvMEXHeCuD5olGsJw9 tiAVs05JOHhY/KGgx+tFja/4WJV1BAlWqh/QWQs7wxUMy15N82/153VE2ugKGGfxIazAIo ml6uz3xTBSeQx7XwD/qIENSuT2v7AapEHR1W4bR8tktw5uvGb7Z7c4CnBB+WnA6B5Vej67 RXRoI2HkVG0nwgKYpQsZ4AjXU0d4wSb/+y2WfeFHk1uLVn8gM3NQs0Qwb8QUrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709177; a=rsa-sha256; cv=none; b=mJHoLB4POJZvkHjc6JD4Oll/uTs/YbPtviMVl6gZLubY3xXs5+eWeEEUIAUBndzAsW0n01 V0b4NY823gpjFtfz1+S5Wtjhmhd7KaSHdy55rUQnog7GzVyzEkUSK1EmG6Xd6tqPtAsQLb nNkA9xEV18f93sk5uJRgI+kiYmHyA4piMmAkqlwCOXxDH6OfWr74uiVkWcr/RhfpaQJjwB LBKhyFvMAYdLq7sFDkJMT6Rh0cgvTJWaiWZkGEWCTApdFX2sDWYirMT6OkDWGBgfG8HLbi etMH4Y2o4IS8LPMvsFri65u1/BrNXrJrIlgwlGQc+R+lUDSgUsOYDHNqXaK4Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ba6b771d1732eda0546d187b1397b1bcded3208d commit ba6b771d1732eda0546d187b1397b1bcded3208d Author: John Baldwin AuthorDate: 2021-10-13 19:30:15 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 ktls: Ensure FIFO encryption order for TLS 1.0. TLS 1.0 records are encrypted as one continuous CBC chain where the last block of the previous record is used as the IV for the next record. As a result, TLS 1.0 records cannot be encrypted out of order but must be encrypted as a FIFO. If the later pages of a sendfile(2) request complete before the first pages, then TLS records can be encrypted out of order. For TLS 1.1 and later this is fine, but this can break for TLS 1.0. To cope, add a queue in each TLS session to hold TLS records that contain valid unencrypted data but are waiting for an earlier TLS record to be encrypted first. - In ktls_enqueue(), check if a TLS record being queued is the next record expected for a TLS 1.0 session. If not, it is placed in sorted order in the pending_records queue in the TLS session. If it is the next expected record, queue it for SW encryption like normal. In addition, check if this new record (really a potential batch of records) was holding up any previously queued records in the pending_records queue. Any of those records that are now in order are also placed on the queue for SW encryption. - In ktls_destroy(), free any TLS records on the pending_records queue. These mbufs are marked M_NOTREADY so were not freed when the socket buffer was purged in sbdestroy(). Instead, they must be freed explicitly. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32381 (cherry picked from commit 9f03d2c00167c8047416e0048e3b7f89d73baf8e) --- sys/kern/uipc_ktls.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++-- sys/sys/ktls.h | 5 +++ 2 files changed, 115 insertions(+), 3 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 73915600779c..e9585d06841c 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -138,6 +138,11 @@ static COUNTER_U64_DEFINE_EARLY(ktls_tasks_active); SYSCTL_COUNTER_U64(_kern_ipc_tls, OID_AUTO, tasks_active, CTLFLAG_RD, &ktls_tasks_active, "Number of active tasks"); +static COUNTER_U64_DEFINE_EARLY(ktls_cnt_tx_pending); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_tx_pending, CTLFLAG_RD, + &ktls_cnt_tx_pending, + "Number of TLS 1.0 records waiting for earlier TLS records"); + static COUNTER_U64_DEFINE_EARLY(ktls_cnt_tx_queued); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_tx_inqueue, CTLFLAG_RD, &ktls_cnt_tx_queued, @@ -574,6 +579,9 @@ ktls_create_session(struct socket *so, struct tls_enable *en, case CRYPTO_SHA1_HMAC: if (en->tls_vminor == TLS_MINOR_VER_ZERO) { /* Implicit IV, no nonce. */ + tls->sequential_records = true; + tls->next_seqno = be64dec(en->rec_seq); + STAILQ_INIT(&tls->pending_records); } else { tls->params.tls_hlen += AES_BLOCK_LEN; } @@ -1481,6 +1489,20 @@ ktls_destroy(struct ktls_session *tls) { struct rm_priotracker prio; + if (tls->sequential_records) { + struct mbuf *m, *n; + int page_count; + + STAILQ_FOREACH_SAFE(m, &tls->pending_records, m_epg_stailq, n) { + page_count = m->m_epg_enc_cnt; + while (page_count > 0) { + KASSERT(page_count >= m->m_epg_nrdy, + ("%s: too few pages", __func__)); + page_count -= m->m_epg_nrdy; + m = m_free(m); + } + } + } ktls_cleanup(tls); if (tls->be != NULL && ktls_allow_unload) { rm_rlock(&ktls_backends_lock, &prio); @@ -1982,10 +2004,29 @@ ktls_enqueue_to_free(struct mbuf *m) wakeup(wq); } +/* Number of TLS records in a batch passed to ktls_enqueue(). */ +static u_int +ktls_batched_records(struct mbuf *m) +{ + int page_count, records; + + records = 0; + page_count = m->m_epg_enc_cnt; + while (page_count > 0) { + records++; + page_count -= m->m_epg_nrdy; + m = m->m_next; + } + KASSERT(page_count == 0, ("%s: mismatched page count", __func__)); + return (records); +} + void ktls_enqueue(struct mbuf *m, struct socket *so, int page_count) { + struct ktls_session *tls; struct ktls_wq *wq; + int queued; bool running; KASSERT(((m->m_flags & (M_EXTPG | M_NOTREADY)) == @@ -2003,14 +2044,80 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int page_count) */ m->m_epg_so = so; - wq = &ktls_wq[m->m_epg_tls->wq_index]; + queued = 1; + tls = m->m_epg_tls; + wq = &ktls_wq[tls->wq_index]; mtx_lock(&wq->mtx); - STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); + if (__predict_false(tls->sequential_records)) { + /* + * For TLS 1.0, records must be encrypted + * sequentially. For a given connection, all records + * queued to the associated work queue are processed + * sequentially. However, sendfile(2) might complete + * I/O requests spanning multiple TLS records out of + * order. Here we ensure TLS records are enqueued to + * the work queue in FIFO order. + * + * tls->next_seqno holds the sequence number of the + * next TLS record that should be enqueued to the work + * queue. If this next record is not tls->next_seqno, + * it must be a future record, so insert it, sorted by + * TLS sequence number, into tls->pending_records and + * return. + * + * If this TLS record matches tls->next_seqno, place + * it in the work queue and then check + * tls->pending_records to see if any + * previously-queued records are now ready for + * encryption. + */ + if (m->m_epg_seqno != tls->next_seqno) { + struct mbuf *n, *p; + + p = NULL; + STAILQ_FOREACH(n, &tls->pending_records, m_epg_stailq) { + if (n->m_epg_seqno > m->m_epg_seqno) + break; + p = n; + } + if (n == NULL) + STAILQ_INSERT_TAIL(&tls->pending_records, m, + m_epg_stailq); + else if (p == NULL) + STAILQ_INSERT_HEAD(&tls->pending_records, m, + m_epg_stailq); + else + STAILQ_INSERT_AFTER(&tls->pending_records, p, m, + m_epg_stailq); + mtx_unlock(&wq->mtx); + counter_u64_add(ktls_cnt_tx_pending, 1); + return; + } + + tls->next_seqno += ktls_batched_records(m); + STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); + + while (!STAILQ_EMPTY(&tls->pending_records)) { + struct mbuf *n; + + n = STAILQ_FIRST(&tls->pending_records); + if (n->m_epg_seqno != tls->next_seqno) + break; + + queued++; + STAILQ_REMOVE_HEAD(&tls->pending_records, m_epg_stailq); + tls->next_seqno += ktls_batched_records(n); + STAILQ_INSERT_TAIL(&wq->m_head, n, m_epg_stailq); + } + counter_u64_add(ktls_cnt_tx_pending, -(queued - 1)); + } else + STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); + running = wq->running; mtx_unlock(&wq->mtx); if (!running) wakeup(wq); - counter_u64_add(ktls_cnt_tx_queued, 1); + counter_u64_add(ktls_cnt_tx_queued, queued); } static __noinline void diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 3cde75f9edf6..e9cae34035c6 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -208,6 +208,11 @@ struct ktls_session { struct task reset_tag_task; struct inpcb *inp; bool reset_pending; + bool sequential_records; + + /* Only used for TLS 1.0. */ + uint64_t next_seqno; + STAILQ_HEAD(, mbuf) pending_records; } __aligned(CACHE_LINE_SIZE); void ktls_check_rx(struct sockbuf *sb); From nobody Tue Nov 23 23:12:58 2021 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 C817D18A1C2A; Tue, 23 Nov 2021 23:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgH0vHKz3vml; Tue, 23 Nov 2021 23:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4FBC1F0CC; Tue, 23 Nov 2021 23:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCw5i037789; Tue, 23 Nov 2021 23:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCwrK037788; Tue, 23 Nov 2021 23:12:58 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:58 GMT Message-Id: <202111232312.1ANNCwrK037788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 64ecbc0cd352 - stable/13 - tests: do not build ktls_test if WITHOUT_OPENSSL 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 64ecbc0cd3524d1c5782910547253644be6ebbd7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DvETttCMz4I16G7l2r3+atnGsUi0h8Ii8Zik/XX2qQ=; b=BHgFmAtuH4v1VSWyNxxIBqD8+6ahDMT08G2fikV2M+i+l21MPXGHod7VYUUM7SQ217OD3S cM69PAONaQzWI7fI5QTSpUa+VsMrLG/wsf0WjNvS5txD3CoTNzd3ZHW4GN5TgpOI5r7n3r iUVYxWxpn6BdX5xE7BGXn4+3QKYEa5C7cFbC8Qj6N2AJD/uFjN7lqPu+X42Cr0sSc402qI knUPVa3Fk8VU7hPKUEGhPUkKyg85NVVt6Nl1bqpJJeReTIVmiGQsThHeb6j6dUpOVgrT5k NZFem7sOYjIf1IkPZtpUHely2rHlvxF3B1gScoANQ2EtDbSyqyPkMgiR5U0vhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709180; a=rsa-sha256; cv=none; b=e6XiXZeUCIwD33QRxhPlHmDGOkOqBiYwpLxCqSdmLuGJeTOccMt6SxuoyoFIuVdE6wmrhJ N47DbzU13K+G9oQxC9x+31UXAI6ht/m3Y+yKxQPM5H7Em1srk0sxaszKeOV77clwpJB7Be eGLiyj8PlZKlf0uWMEkBrv/3S4v7eyK1906vQtXkOwIe1b1RtTSY10Ss2NrNAHo4Y2VjYy 7eCdz84OqwDSb9fe/ow2dUri7b2rA5lKDHuiHwZCP90P73FROV4R8FW+7za5NpU0QYKPQW lw/2lhx7fEqO/y/EqWM7E4UtQnlCkcPCjex9baGEnqPIq/TMohqyIYO+fkWRcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=64ecbc0cd3524d1c5782910547253644be6ebbd7 commit 64ecbc0cd3524d1c5782910547253644be6ebbd7 Author: Ed Maste AuthorDate: 2021-11-08 17:08:34 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:45 +0000 tests: do not build ktls_test if WITHOUT_OPENSSL ktls_test requires libcrypto to build, and fails if it is not available (which is the case when building WITHOUT_OPENSSL). Reported by: Michael Dexter, Build Option Survey Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32895 (cherry picked from commit e818178e3a597922ce77bee874e441a1b7df0099) --- tests/sys/kern/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index ee9decac518c..b0f83b97db41 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE= tests TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel @@ -12,7 +14,9 @@ ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= fdgrowtable_test ATF_TESTS_C+= kill_zombie +.if ${MK_OPENSSL} != "no" ATF_TESTS_C+= ktls_test +.endif ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" ATF_TESTS_C+= reaper From nobody Tue Nov 23 23:12:57 2021 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 C7DD418A1D04; Tue, 23 Nov 2021 23:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgH0Pzvz3vbh; Tue, 23 Nov 2021 23:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C277B1F724; Tue, 23 Nov 2021 23:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCvCB037765; Tue, 23 Nov 2021 23:12:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCv1F037764; Tue, 23 Nov 2021 23:12:57 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:57 GMT Message-Id: <202111232312.1ANNCv1F037764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 71e6792cbe81 - stable/13 - ktls: Add simple transmit tests of kernel TLS. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71e6792cbe81f6fcbfdf545ea7c04b2ae3bfda50 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LpFkWL/vx0Judni8QkjQ86e9WSW/OI30WgC2On8Bctg=; b=Q1CliJJguGc7kTWnKn4/hOa3ocQOS1LuokJEA83vQdxxFkJrPUtkFRFoDtGeuykz05ngUV /ho9VVvj9iM4AquC/JSFIzZU6mI5eH6gQYfN/4DQilUQWaFxd/Hb1lP7NGVVFefuDMsGzL /1DMgt+7pox1NL4M78+n2Y6FPCrRqFaZrlaKTwBGD9/1XiBt3BE0Vqk0iCYroa3jmLdDrT Krap0dHU2d9bLtH26xw8zJRGpsAG0IS97WGOk5kVPQo9g6k5d4pCsAPSYHTfTHpdbkj7+t Gpi3Yw+29eAZmGQjscrdb17B0DR3w0zsZw9XZwGwpEonHmmsDLB+zIHQ7uqBzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709180; a=rsa-sha256; cv=none; b=oZJPMH5KbqSiF93cHtzOs3hgHLaqyB2YljhEa1rZBbLO2c3DdDr5ck6pLvn77ee5U+dxtc OCoKRiqrDYMyLSpim3shEuQzuGdNyTp39wmr3P2VXH32dmf/GDLseh85YJ8a5P/9nCY7Bq FQFRp8wYUnLzPEJQrYfcCkOXZUmFVgZYgcztIjtWuoMfW0RkxaBsW+JJe4vll2PcptgkqN 8/7KmQY/k4qnjeC+tApowFiZv6PRdeZhWraoMF948dSkdmbPVuDqO/CCD33afsKaWlkv4+ tcim1kWxspQYX+O77n2cBmk9cau70T35TmvhdbWm/JqLGjsHnk6W1Dl1NoYS9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=71e6792cbe81f6fcbfdf545ea7c04b2ae3bfda50 commit 71e6792cbe81f6fcbfdf545ea7c04b2ae3bfda50 Author: John Baldwin AuthorDate: 2021-11-01 18:28:10 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:45 +0000 ktls: Add simple transmit tests of kernel TLS. Note that these tests test the kernel TLS functionality directly. Rather than using OpenSSL to perform negotiation and generate keys, these tests generate random keys send data over a pair of TCP sockets manually decrypting the TLS records generated by the kernel. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32652 (cherry picked from commit a10482ea7476d68d1ab028145ae6d97cef747b49) --- tests/sys/kern/Makefile | 2 + tests/sys/kern/ktls_test.c | 1033 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1035 insertions(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 6746812d9b4a..ee9decac518c 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -12,6 +12,7 @@ ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= fdgrowtable_test ATF_TESTS_C+= kill_zombie +ATF_TESTS_C+= ktls_test ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" ATF_TESTS_C+= reaper @@ -46,6 +47,7 @@ LIBADD.sys_getrandom+= pthread LIBADD.ptrace_test+= pthread LIBADD.unix_seqpacket_test+= pthread LIBADD.kcov+= pthread +LIBADD.ktls_test+= crypto LIBADD.sendfile_helper+= pthread LIBADD.fdgrowtable_test+= util pthread kvm procstat diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c new file mode 100644 index 000000000000..908f7f1818a2 --- /dev/null +++ b/tests/sys/kern/ktls_test.c @@ -0,0 +1,1033 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Netflix Inc. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static void +require_ktls(void) +{ + size_t len; + bool enable; + + len = sizeof(enable); + if (sysctlbyname("kern.ipc.tls.enable", &enable, &len, NULL, 0) == -1) { + if (errno == ENOENT) + atf_tc_skip("kernel does not support TLS offload"); + atf_libc_error(errno, "Failed to read kern.ipc.tls.enable"); + } + + if (!enable) + atf_tc_skip("Kernel TLS is disabled"); +} + +#define ATF_REQUIRE_KTLS() require_ktls() + +static char +rdigit(void) +{ + /* ASCII printable values between 0x20 and 0x7e */ + return (0x20 + random() % (0x7f - 0x20)); +} + +static char * +alloc_buffer(size_t len) +{ + char *buf; + size_t i; + + if (len == 0) + return (NULL); + buf = malloc(len); + for (i = 0; i < len; i++) + buf[i] = rdigit(); + return (buf); +} + +static bool +socketpair_tcp(int *sv) +{ + struct pollfd pfd; + struct sockaddr_in sin; + socklen_t len; + int as, cs, ls; + + ls = socket(PF_INET, SOCK_STREAM, 0); + if (ls == -1) { + warn("socket() for listen"); + return (false); + } + + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + if (bind(ls, (struct sockaddr *)&sin, sizeof(sin)) == -1) { + warn("bind"); + close(ls); + return (false); + } + + if (listen(ls, 1) == -1) { + warn("listen"); + close(ls); + return (false); + } + + len = sizeof(sin); + if (getsockname(ls, (struct sockaddr *)&sin, &len) == -1) { + warn("getsockname"); + close(ls); + return (false); + } + + cs = socket(PF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0); + if (cs == -1) { + warn("socket() for connect"); + close(ls); + return (false); + } + + if (connect(cs, (struct sockaddr *)&sin, sizeof(sin)) == -1) { + if (errno != EINPROGRESS) { + warn("connect"); + close(ls); + close(cs); + return (false); + } + } + + as = accept4(ls, NULL, NULL, SOCK_NONBLOCK); + if (as == -1) { + warn("accept4"); + close(ls); + close(cs); + return (false); + } + + close(ls); + + pfd.fd = cs; + pfd.events = POLLOUT; + pfd.revents = 0; + ATF_REQUIRE(poll(&pfd, 1, INFTIM) == 1); + ATF_REQUIRE(pfd.revents == POLLOUT); + + sv[0] = cs; + sv[1] = as; + return (true); +} + +static void +fd_set_blocking(int fd) +{ + int flags; + + ATF_REQUIRE((flags = fcntl(fd, F_GETFL)) != -1); + flags &= ~O_NONBLOCK; + ATF_REQUIRE(fcntl(fd, F_SETFL, flags) != -1); +} + +static bool +cbc_decrypt(const EVP_CIPHER *cipher, const char *key, const char *iv, + const char *input, char *output, size_t size) +{ + EVP_CIPHER_CTX *ctx; + int outl, total; + + ctx = EVP_CIPHER_CTX_new(); + if (ctx == NULL) { + warnx("EVP_CIPHER_CTX_new failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + return (false); + } + if (EVP_CipherInit_ex(ctx, cipher, NULL, (const u_char *)key, + (const u_char *)iv, 0) != 1) { + warnx("EVP_CipherInit_ex failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + EVP_CIPHER_CTX_set_padding(ctx, 0); + if (EVP_CipherUpdate(ctx, (u_char *)output, &outl, + (const u_char *)input, size) != 1) { + warnx("EVP_CipherUpdate failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + total = outl; + if (EVP_CipherFinal_ex(ctx, (u_char *)output + outl, &outl) != 1) { + warnx("EVP_CipherFinal_ex failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + total += outl; + if ((size_t)total != size) { + warnx("decrypt size mismatch: %zu vs %d", size, total); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + EVP_CIPHER_CTX_free(ctx); + return (true); +} + +static bool +verify_hash(const EVP_MD *md, const void *key, size_t key_len, const void *aad, + size_t aad_len, const void *buffer, size_t len, const void *digest) +{ + HMAC_CTX *ctx; + unsigned char digest2[EVP_MAX_MD_SIZE]; + u_int digest_len; + + ctx = HMAC_CTX_new(); + if (ctx == NULL) { + warnx("HMAC_CTX_new failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + return (false); + } + if (HMAC_Init_ex(ctx, key, key_len, md, NULL) != 1) { + warnx("HMAC_Init_ex failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + HMAC_CTX_free(ctx); + return (false); + } + if (HMAC_Update(ctx, aad, aad_len) != 1) { + warnx("HMAC_Update (aad) failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + HMAC_CTX_free(ctx); + return (false); + } + if (HMAC_Update(ctx, buffer, len) != 1) { + warnx("HMAC_Update (payload) failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + HMAC_CTX_free(ctx); + return (false); + } + if (HMAC_Final(ctx, digest2, &digest_len) != 1) { + warnx("HMAC_Final failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + HMAC_CTX_free(ctx); + return (false); + } + HMAC_CTX_free(ctx); + if (memcmp(digest, digest2, digest_len) != 0) { + warnx("HMAC mismatch"); + return (false); + } + return (true); +} + +static bool +aead_decrypt(const EVP_CIPHER *cipher, const char *key, const char *nonce, + const void *aad, size_t aad_len, const char *input, char *output, + size_t size, const char *tag, size_t tag_len) +{ + EVP_CIPHER_CTX *ctx; + int outl, total; + bool valid; + + ctx = EVP_CIPHER_CTX_new(); + if (ctx == NULL) { + warnx("EVP_CIPHER_CTX_new failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + return (false); + } + if (EVP_DecryptInit_ex(ctx, cipher, NULL, (const u_char *)key, + (const u_char *)nonce) != 1) { + warnx("EVP_DecryptInit_ex failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + EVP_CIPHER_CTX_set_padding(ctx, 0); + if (aad != NULL) { + if (EVP_DecryptUpdate(ctx, NULL, &outl, (const u_char *)aad, + aad_len) != 1) { + warnx("EVP_DecryptUpdate for AAD failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + } + if (EVP_DecryptUpdate(ctx, (u_char *)output, &outl, + (const u_char *)input, size) != 1) { + warnx("EVP_DecryptUpdate failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + total = outl; + if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, tag_len, + __DECONST(char *, tag)) != 1) { + warnx("EVP_CIPHER_CTX_ctrl(EVP_CTRL_AEAD_SET_TAG) failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + valid = (EVP_DecryptFinal_ex(ctx, (u_char *)output + outl, &outl) == 1); + total += outl; + if ((size_t)total != size) { + warnx("decrypt size mismatch: %zu vs %d", size, total); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + if (!valid) + warnx("tag mismatch"); + EVP_CIPHER_CTX_free(ctx); + return (valid); +} + +static void +build_tls_enable(int cipher_alg, size_t cipher_key_len, int auth_alg, + int minor, uint64_t seqno, struct tls_enable *en) +{ + u_int auth_key_len, iv_len; + + memset(en, 0, sizeof(*en)); + + switch (cipher_alg) { + case CRYPTO_AES_CBC: + if (minor == TLS_MINOR_VER_ZERO) + iv_len = AES_BLOCK_LEN; + else + iv_len = 0; + break; + case CRYPTO_AES_NIST_GCM_16: + if (minor == TLS_MINOR_VER_TWO) + iv_len = TLS_AEAD_GCM_LEN; + else + iv_len = TLS_1_3_GCM_IV_LEN; + break; + case CRYPTO_CHACHA20_POLY1305: + iv_len = TLS_CHACHA20_IV_LEN; + break; + default: + iv_len = 0; + break; + } + switch (auth_alg) { + case CRYPTO_SHA1_HMAC: + auth_key_len = SHA1_HASH_LEN; + break; + case CRYPTO_SHA2_256_HMAC: + auth_key_len = SHA2_256_HASH_LEN; + break; + case CRYPTO_SHA2_384_HMAC: + auth_key_len = SHA2_384_HASH_LEN; + break; + default: + auth_key_len = 0; + break; + } + en->cipher_key = alloc_buffer(cipher_key_len); + en->iv = alloc_buffer(iv_len); + en->auth_key = alloc_buffer(auth_key_len); + en->cipher_algorithm = cipher_alg; + en->cipher_key_len = cipher_key_len; + en->iv_len = iv_len; + en->auth_algorithm = auth_alg; + en->auth_key_len = auth_key_len; + en->tls_vmajor = TLS_MAJOR_VER_ONE; + en->tls_vminor = minor; + be64enc(en->rec_seq, seqno); +} + +static void +free_tls_enable(struct tls_enable *en) +{ + free(__DECONST(void *, en->cipher_key)); + free(__DECONST(void *, en->iv)); + free(__DECONST(void *, en->auth_key)); +} + +static const EVP_CIPHER * +tls_EVP_CIPHER(const struct tls_enable *en) +{ + switch (en->cipher_algorithm) { + case CRYPTO_AES_CBC: + switch (en->cipher_key_len) { + case 128 / 8: + return (EVP_aes_128_cbc()); + case 256 / 8: + return (EVP_aes_256_cbc()); + default: + return (NULL); + } + break; + case CRYPTO_AES_NIST_GCM_16: + switch (en->cipher_key_len) { + case 128 / 8: + return (EVP_aes_128_gcm()); + case 256 / 8: + return (EVP_aes_256_gcm()); + default: + return (NULL); + } + break; + case CRYPTO_CHACHA20_POLY1305: + return (EVP_chacha20_poly1305()); + default: + return (NULL); + } +} + +static const EVP_MD * +tls_EVP_MD(const struct tls_enable *en) +{ + switch (en->auth_algorithm) { + case CRYPTO_SHA1_HMAC: + return (EVP_sha1()); + case CRYPTO_SHA2_256_HMAC: + return (EVP_sha256()); + case CRYPTO_SHA2_384_HMAC: + return (EVP_sha384()); + default: + return (NULL); + } +} + +static size_t +tls_header_len(struct tls_enable *en) +{ + size_t len; + + len = sizeof(struct tls_record_layer); + switch (en->cipher_algorithm) { + case CRYPTO_AES_CBC: + if (en->tls_vminor != TLS_MINOR_VER_ZERO) + len += AES_BLOCK_LEN; + return (len); + case CRYPTO_AES_NIST_GCM_16: + if (en->tls_vminor == TLS_MINOR_VER_TWO) + len += sizeof(uint64_t); + return (len); + case CRYPTO_CHACHA20_POLY1305: + return (len); + default: + return (0); + } +} + +static size_t +tls_mac_len(struct tls_enable *en) +{ + switch (en->cipher_algorithm) { + case CRYPTO_AES_CBC: + switch (en->auth_algorithm) { + case CRYPTO_SHA1_HMAC: + return (SHA1_HASH_LEN); + case CRYPTO_SHA2_256_HMAC: + return (SHA2_256_HASH_LEN); + case CRYPTO_SHA2_384_HMAC: + return (SHA2_384_HASH_LEN); + default: + return (0); + } + case CRYPTO_AES_NIST_GCM_16: + return (AES_GMAC_HASH_LEN); + case CRYPTO_CHACHA20_POLY1305: + return (POLY1305_HASH_LEN); + default: + return (0); + } +} + +/* Includes maximum padding for MTE. */ +static size_t +tls_trailer_len(struct tls_enable *en) +{ + size_t len; + + len = tls_mac_len(en); + if (en->cipher_algorithm == CRYPTO_AES_CBC) + len += AES_BLOCK_LEN; + if (en->tls_vminor == TLS_MINOR_VER_THREE) + len++; + return (len); +} + +/* 'len' is the length of the payload application data. */ +static void +tls_mte_aad(struct tls_enable *en, size_t len, + const struct tls_record_layer *hdr, uint64_t seqno, struct tls_mac_data *ad) +{ + ad->seq = htobe64(seqno); + ad->type = hdr->tls_type; + ad->tls_vmajor = hdr->tls_vmajor; + ad->tls_vminor = hdr->tls_vminor; + ad->tls_length = htons(len); +} + +static void +tls_12_aead_aad(struct tls_enable *en, size_t len, + const struct tls_record_layer *hdr, uint64_t seqno, + struct tls_aead_data *ad) +{ + ad->seq = htobe64(seqno); + ad->type = hdr->tls_type; + ad->tls_vmajor = hdr->tls_vmajor; + ad->tls_vminor = hdr->tls_vminor; + ad->tls_length = htons(len); +} + +static void +tls_13_aad(struct tls_enable *en, const struct tls_record_layer *hdr, + uint64_t seqno, struct tls_aead_data_13 *ad) +{ + ad->type = hdr->tls_type; + ad->tls_vmajor = hdr->tls_vmajor; + ad->tls_vminor = hdr->tls_vminor; + ad->tls_length = hdr->tls_length; +} + +static void +tls_12_gcm_nonce(struct tls_enable *en, const struct tls_record_layer *hdr, + char *nonce) +{ + memcpy(nonce, en->iv, TLS_AEAD_GCM_LEN); + memcpy(nonce + TLS_AEAD_GCM_LEN, hdr + 1, sizeof(uint64_t)); +} + +static void +tls_13_nonce(struct tls_enable *en, uint64_t seqno, char *nonce) +{ + static_assert(TLS_1_3_GCM_IV_LEN == TLS_CHACHA20_IV_LEN, + "TLS 1.3 nonce length mismatch"); + memcpy(nonce, en->iv, TLS_1_3_GCM_IV_LEN); + *(uint64_t *)(nonce + 4) ^= htobe64(seqno); +} + +/* + * Decrypt a TLS record 'len' bytes long at 'src' and store the result at + * 'dst'. If the TLS record header length doesn't match or 'dst' doesn't + * have sufficient room ('avail'), fail the test. + */ +static size_t +decrypt_tls_aes_cbc_mte(struct tls_enable *en, uint64_t seqno, const void *src, + size_t len, void *dst, size_t avail, uint8_t *record_type) +{ + const struct tls_record_layer *hdr; + struct tls_mac_data aad; + const char *iv; + char *buf; + size_t hdr_len, mac_len, payload_len; + int padding; + + hdr = src; + hdr_len = tls_header_len(en); + mac_len = tls_mac_len(en); + ATF_REQUIRE(hdr->tls_vmajor == TLS_MAJOR_VER_ONE); + ATF_REQUIRE(hdr->tls_vminor == en->tls_vminor); + + /* First, decrypt the outer payload into a temporary buffer. */ + payload_len = len - hdr_len; + buf = malloc(payload_len); + if (en->tls_vminor == TLS_MINOR_VER_ZERO) + iv = en->iv; + else + iv = (void *)(hdr + 1); + ATF_REQUIRE(cbc_decrypt(tls_EVP_CIPHER(en), en->cipher_key, iv, + (const u_char *)src + hdr_len, buf, payload_len)); + + /* + * Copy the last encrypted block to use as the IV for the next + * record for TLS 1.0. + */ + if (en->tls_vminor == TLS_MINOR_VER_ZERO) + memcpy(__DECONST(uint8_t *, en->iv), (const u_char *)src + + (len - AES_BLOCK_LEN), AES_BLOCK_LEN); + + /* + * Verify trailing padding and strip. + * + * The kernel always generates the smallest amount of padding. + */ + padding = buf[payload_len - 1] + 1; + ATF_REQUIRE(padding > 0 && padding <= AES_BLOCK_LEN); + ATF_REQUIRE(payload_len >= mac_len + padding); + payload_len -= padding; + + /* Verify HMAC. */ + payload_len -= mac_len; + tls_mte_aad(en, payload_len, hdr, seqno, &aad); + ATF_REQUIRE(verify_hash(tls_EVP_MD(en), en->auth_key, en->auth_key_len, + &aad, sizeof(aad), buf, payload_len, buf + payload_len)); + + ATF_REQUIRE(payload_len <= avail); + memcpy(dst, buf, payload_len); + *record_type = hdr->tls_type; + return (payload_len); +} + +static size_t +decrypt_tls_12_aead(struct tls_enable *en, uint64_t seqno, const void *src, + size_t len, void *dst, uint8_t *record_type) +{ + const struct tls_record_layer *hdr; + struct tls_aead_data aad; + char nonce[12]; + size_t hdr_len, mac_len, payload_len; + + hdr = src; + + hdr_len = tls_header_len(en); + mac_len = tls_mac_len(en); + payload_len = len - (hdr_len + mac_len); + ATF_REQUIRE(hdr->tls_vmajor == TLS_MAJOR_VER_ONE); + ATF_REQUIRE(hdr->tls_vminor == TLS_MINOR_VER_TWO); + + tls_12_aead_aad(en, payload_len, hdr, seqno, &aad); + if (en->cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + tls_12_gcm_nonce(en, hdr, nonce); + else + tls_13_nonce(en, seqno, nonce); + + ATF_REQUIRE(aead_decrypt(tls_EVP_CIPHER(en), en->cipher_key, nonce, + &aad, sizeof(aad), (const char *)src + hdr_len, dst, payload_len, + (const char *)src + hdr_len + payload_len, mac_len)); + + *record_type = hdr->tls_type; + return (payload_len); +} + +static size_t +decrypt_tls_13_aead(struct tls_enable *en, uint64_t seqno, const void *src, + size_t len, void *dst, uint8_t *record_type) +{ + const struct tls_record_layer *hdr; + struct tls_aead_data_13 aad; + char nonce[12]; + char *buf; + size_t hdr_len, mac_len, payload_len; + + hdr = src; + + hdr_len = tls_header_len(en); + mac_len = tls_mac_len(en); + payload_len = len - (hdr_len + mac_len); + ATF_REQUIRE(payload_len >= 1); + ATF_REQUIRE(hdr->tls_type == TLS_RLTYPE_APP); + ATF_REQUIRE(hdr->tls_vmajor == TLS_MAJOR_VER_ONE); + ATF_REQUIRE(hdr->tls_vminor == TLS_MINOR_VER_TWO); + + tls_13_aad(en, hdr, seqno, &aad); + tls_13_nonce(en, seqno, nonce); + + /* + * Have to use a temporary buffer for the output due to the + * record type as the last byte of the trailer. + */ + buf = malloc(payload_len); + + ATF_REQUIRE(aead_decrypt(tls_EVP_CIPHER(en), en->cipher_key, nonce, + &aad, sizeof(aad), (const char *)src + hdr_len, buf, payload_len, + (const char *)src + hdr_len + payload_len, mac_len)); + + /* Trim record type. */ + *record_type = buf[payload_len - 1]; + payload_len--; + + memcpy(dst, buf, payload_len); + free(buf); + + return (payload_len); +} + +static size_t +decrypt_tls_aead(struct tls_enable *en, uint64_t seqno, const void *src, + size_t len, void *dst, size_t avail, uint8_t *record_type) +{ + const struct tls_record_layer *hdr; + size_t payload_len; + + hdr = src; + ATF_REQUIRE(ntohs(hdr->tls_length) + sizeof(*hdr) == len); + + payload_len = len - (tls_header_len(en) + tls_trailer_len(en)); + ATF_REQUIRE(payload_len <= avail); + + if (en->tls_vminor == TLS_MINOR_VER_TWO) { + ATF_REQUIRE(decrypt_tls_12_aead(en, seqno, src, len, dst, + record_type) == payload_len); + } else { + ATF_REQUIRE(decrypt_tls_13_aead(en, seqno, src, len, dst, + record_type) == payload_len); + } + + return (payload_len); +} + +static size_t +decrypt_tls_record(struct tls_enable *en, uint64_t seqno, const void *src, + size_t len, void *dst, size_t avail, uint8_t *record_type) +{ + if (en->cipher_algorithm == CRYPTO_AES_CBC) + return (decrypt_tls_aes_cbc_mte(en, seqno, src, len, dst, avail, + record_type)); + else + return (decrypt_tls_aead(en, seqno, src, len, dst, avail, + record_type)); +} + +static void +test_ktls_transmit_app_data(struct tls_enable *en, uint64_t seqno, size_t len) +{ + struct kevent ev; + struct tls_record_layer *hdr; + char *plaintext, *decrypted, *outbuf; + size_t decrypted_len, outbuf_len, outbuf_cap, record_len, written; + ssize_t rv; + int kq, sockets[2]; + uint8_t record_type; + + plaintext = alloc_buffer(len); + decrypted = malloc(len); + outbuf_cap = tls_header_len(en) + TLS_MAX_MSG_SIZE_V10_2 + + tls_trailer_len(en); + outbuf = malloc(outbuf_cap); + hdr = (struct tls_record_layer *)outbuf; + + ATF_REQUIRE((kq = kqueue()) != -1); + + ATF_REQUIRE_MSG(socketpair_tcp(sockets), "failed to create sockets"); + + ATF_REQUIRE(setsockopt(sockets[1], IPPROTO_TCP, TCP_TXTLS_ENABLE, en, + sizeof(*en)) == 0); + + EV_SET(&ev, sockets[0], EVFILT_READ, EV_ADD, 0, 0, NULL); + ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) == 0); + EV_SET(&ev, sockets[1], EVFILT_WRITE, EV_ADD, 0, 0, NULL); + ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) == 0); + + decrypted_len = 0; + outbuf_len = 0; + written = 0; + + while (decrypted_len != len) { + ATF_REQUIRE(kevent(kq, NULL, 0, &ev, 1, NULL) == 1); + + switch (ev.filter) { + case EVFILT_WRITE: + /* Try to write any remaining data. */ + rv = write(ev.ident, plaintext + written, + len - written); + ATF_REQUIRE_MSG(rv > 0, + "failed to write to socket"); + written += rv; + if (written == len) { + ev.flags = EV_DISABLE; + ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, + NULL) == 0); + } + break; + + case EVFILT_READ: + ATF_REQUIRE((ev.flags & EV_EOF) == 0); + + /* + * Try to read data for the next TLS record + * into outbuf. Start by reading the header + * to determine how much additional data to + * read. + */ + if (outbuf_len < sizeof(struct tls_record_layer)) { + rv = read(ev.ident, outbuf + outbuf_len, + sizeof(struct tls_record_layer) - + outbuf_len); + ATF_REQUIRE_MSG(rv > 0, + "failed to read from socket"); + outbuf_len += rv; + } + + if (outbuf_len < sizeof(struct tls_record_layer)) + break; + + record_len = sizeof(struct tls_record_layer) + + ntohs(hdr->tls_length); + assert(record_len <= outbuf_cap); + assert(record_len > outbuf_len); + rv = read(ev.ident, outbuf + outbuf_len, + record_len - outbuf_len); + if (rv == -1 && errno == EAGAIN) + break; + ATF_REQUIRE_MSG(rv > 0, "failed to read from socket"); + + outbuf_len += rv; + if (outbuf_len == record_len) { + decrypted_len += decrypt_tls_record(en, seqno, + outbuf, outbuf_len, + decrypted + decrypted_len, + len - decrypted_len, &record_type); + ATF_REQUIRE(record_type == TLS_RLTYPE_APP); + + seqno++; + outbuf_len = 0; + } + break; + } + } + + ATF_REQUIRE_MSG(written == decrypted_len, + "read %zu decrypted bytes, but wrote %zu", decrypted_len, written); + + ATF_REQUIRE(memcmp(plaintext, decrypted, len) == 0); + + free(outbuf); + free(decrypted); + free(plaintext); + + close(sockets[1]); + close(sockets[0]); + close(kq); +} + +static void +ktls_send_control_message(int fd, uint8_t type, void *data, size_t len) +{ + struct msghdr msg; + struct cmsghdr *cmsg; + char cbuf[CMSG_SPACE(sizeof(type))]; + struct iovec iov; + + memset(&msg, 0, sizeof(msg)); + + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_TCP; + cmsg->cmsg_type = TLS_SET_RECORD_TYPE; + cmsg->cmsg_len = CMSG_LEN(sizeof(type)); + *(uint8_t *)CMSG_DATA(cmsg) = type; + + iov.iov_base = data; + iov.iov_len = len; + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + + ATF_REQUIRE(sendmsg(fd, &msg, 0) == (ssize_t)len); +} + +static void +test_ktls_transmit_control(struct tls_enable *en, uint64_t seqno, uint8_t type, + size_t len) +{ + struct tls_record_layer *hdr; + char *plaintext, *decrypted, *outbuf; + size_t outbuf_cap, payload_len, record_len; + ssize_t rv; + int sockets[2]; + uint8_t record_type; + + ATF_REQUIRE(len <= TLS_MAX_MSG_SIZE_V10_2); + + plaintext = alloc_buffer(len); + decrypted = malloc(len); + outbuf_cap = tls_header_len(en) + len + tls_trailer_len(en); + outbuf = malloc(outbuf_cap); + hdr = (struct tls_record_layer *)outbuf; + + ATF_REQUIRE_MSG(socketpair_tcp(sockets), "failed to create sockets"); + + ATF_REQUIRE(setsockopt(sockets[1], IPPROTO_TCP, TCP_TXTLS_ENABLE, en, + sizeof(*en)) == 0); + + fd_set_blocking(sockets[0]); + fd_set_blocking(sockets[1]); + + ktls_send_control_message(sockets[1], type, plaintext, len); + + /* + * First read the header to determine how much additional data + * to read. + */ + rv = read(sockets[0], outbuf, sizeof(struct tls_record_layer)); + ATF_REQUIRE(rv == sizeof(struct tls_record_layer)); + payload_len = ntohs(hdr->tls_length); + record_len = payload_len + sizeof(struct tls_record_layer); + assert(record_len <= outbuf_cap); + rv = read(sockets[0], outbuf + sizeof(struct tls_record_layer), + payload_len); + ATF_REQUIRE(rv == (ssize_t)payload_len); + + rv = decrypt_tls_record(en, seqno, outbuf, record_len, decrypted, len, + &record_type); + + ATF_REQUIRE_MSG((ssize_t)len == rv, + "read %zd decrypted bytes, but wrote %zu", rv, len); + ATF_REQUIRE(record_type == type); + + ATF_REQUIRE(memcmp(plaintext, decrypted, len) == 0); + + free(outbuf); + free(decrypted); + free(plaintext); + + close(sockets[1]); + close(sockets[0]); +} + +#define AES_CBC_TESTS(M) \ + M(aes128_cbc_1_0_sha1, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA1_HMAC, TLS_MINOR_VER_ZERO) \ + M(aes256_cbc_1_0_sha1, CRYPTO_AES_CBC, 256 / 8, \ + CRYPTO_SHA1_HMAC, TLS_MINOR_VER_ZERO) \ + M(aes128_cbc_1_1_sha1, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA1_HMAC, TLS_MINOR_VER_ONE) \ + M(aes256_cbc_1_1_sha1, CRYPTO_AES_CBC, 256 / 8, \ + CRYPTO_SHA1_HMAC, TLS_MINOR_VER_ONE) \ + M(aes128_cbc_1_2_sha1, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA1_HMAC, TLS_MINOR_VER_TWO) \ + M(aes256_cbc_1_2_sha1, CRYPTO_AES_CBC, 256 / 8, \ + CRYPTO_SHA1_HMAC, TLS_MINOR_VER_TWO) \ + M(aes128_cbc_1_2_sha256, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_256_HMAC, TLS_MINOR_VER_TWO) \ + M(aes256_cbc_1_2_sha256, CRYPTO_AES_CBC, 256 / 8, \ + CRYPTO_SHA2_256_HMAC, TLS_MINOR_VER_TWO) \ + M(aes128_cbc_1_2_sha384, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_384_HMAC, TLS_MINOR_VER_TWO) \ + M(aes256_cbc_1_2_sha384, CRYPTO_AES_CBC, 256 / 8, \ + CRYPTO_SHA2_384_HMAC, TLS_MINOR_VER_TWO) \ *** 99 LINES SKIPPED *** From nobody Tue Nov 23 23:12:59 2021 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 8E46A18A1C7A; Tue, 23 Nov 2021 23:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgK2cW3z3vq8; Tue, 23 Nov 2021 23:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 197D81F550; Tue, 23 Nov 2021 23:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCxT0037813; Tue, 23 Nov 2021 23:12:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCxIa037812; Tue, 23 Nov 2021 23:12:59 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:59 GMT Message-Id: <202111232312.1ANNCxIa037812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 351541661ce0 - stable/13 - crypto: Use a single "crypto" kproc for all of the OCF kthreads. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 351541661ce00f78873e693331433f48c6161ee0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wK0LfxDH1b5sXcykR1EfznWtKNr+XmsbCXyjbEE7N48=; b=ybK29N0PX52j+bTU2enJbI+blpCjVtOZkzSnBG/j1WLxH3POVL6eb12goEDpwtSGRR5xnp 4/NlJBnjhhEnu/3iaMpk2f0iYpl4r+yvnYBf/GiDgPkx+bukwMeEFCRxYX75a+S0JOdk2j JnaIow7l+AyVZ/hj6IPUnJADp9FWx9R/5a2h2hBkFXHFPG3EZ/z8LJEsGFqWb8Oy4JoX9d XTSBUk02+oQqklxjKJVEbhy3T2h28VTYE8xJ6TdvPsgBhw33l+Io1lHQQmtHLVZoXCMJos gNUBjS2bZvP5f3QlVUIbFKd5WT0NDw5VLt04T/3p6TePIw2Wy0CILWvAFwRZJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709182; a=rsa-sha256; cv=none; b=WMI3PgrVbqRsrGWGmbT26ZJLQJUJThqe9jb4bhiFWSknST9/3LWlxuSJT+wNABpAWUda0D zzC4qesX7g3yLxI+0JntTPWqwy5psT2KVA5fDJKobh+n9vTOPsY6Xc6CuE3bM2k/nQDqM0 P1bNRkCiKu8oHupl0K/zhCgM7U1VhShI+pAEOO17x9PKMRlUEMQTXgb2rsIxjsKosofLbP Rg+AP9xEU22IaN8FOKwzKoG/8pRNzkEQdtSimUTrmKZrux/og1lJjP0GpKS1dvoSa1PD+l PtWyxKLX2T7007ccUj4379LcryxpkUynP3xsjpLgjuuihLVf+4dpvucDJfWy/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=351541661ce00f78873e693331433f48c6161ee0 commit 351541661ce00f78873e693331433f48c6161ee0 Author: John Baldwin AuthorDate: 2021-11-02 18:26:21 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:45 +0000 crypto: Use a single "crypto" kproc for all of the OCF kthreads. Reported by: julian Reviewed by: markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32739 (cherry picked from commit 717857819223d9c0f81eb38abd0df200532e1cdc) --- sys/opencrypto/crypto.c | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index f0fd3fe662a9..a151ee21dce7 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -181,7 +181,7 @@ struct crypto_ret_worker { uint32_t reorder_ops; /* total ordered sym jobs received */ uint32_t reorder_cur_seq; /* current sym job dispatched */ - struct proc *cryptoretproc; + struct thread *td; }; static struct crypto_ret_worker *crypto_ret_workers = NULL; @@ -229,9 +229,9 @@ SYSCTL_INT(_kern, OID_AUTO, cryptodevallowsoft, CTLFLAG_RWTUN, MALLOC_DEFINE(M_CRYPTO_DATA, "crypto", "crypto session records"); -static void crypto_proc(void); -static struct proc *cryptoproc; -static void crypto_ret_proc(struct crypto_ret_worker *ret_worker); +static void crypto_dispatch_thread(void *arg); +static struct thread *cryptotd; +static void crypto_ret_thread(void *arg); static void crypto_destroy(void); static int crypto_invoke(struct cryptocap *cap, struct cryptop *crp, int hint); static int crypto_kinvoke(struct cryptkop *krp); @@ -324,6 +324,7 @@ static int crypto_init(void) { struct crypto_ret_worker *ret_worker; + struct proc *p; int error; mtx_init(&crypto_drivers_mtx, "crypto", "crypto driver table", @@ -350,8 +351,9 @@ crypto_init(void) taskqueue_start_threads(&crypto_tq, crypto_workers_num, PRI_MIN_KERN, "crypto"); - error = kproc_create((void (*)(void *)) crypto_proc, NULL, - &cryptoproc, 0, 0, "crypto"); + p = NULL; + error = kproc_kthread_add(crypto_dispatch_thread, NULL, &p, &cryptotd, + 0, 0, "crypto", "crypto"); if (error) { printf("crypto_init: cannot start crypto thread; error %d", error); @@ -371,8 +373,9 @@ crypto_init(void) mtx_init(&ret_worker->crypto_ret_mtx, "crypto", "crypto return queues", MTX_DEF); - error = kproc_create((void (*)(void *)) crypto_ret_proc, ret_worker, - &ret_worker->cryptoretproc, 0, 0, "crypto returns %td", CRYPTO_RETW_ID(ret_worker)); + error = kthread_add(crypto_ret_thread, ret_worker, p, + &ret_worker->td, 0, 0, "crypto returns %td", + CRYPTO_RETW_ID(ret_worker)); if (error) { printf("crypto_init: cannot start cryptoret thread; error %d", error); @@ -396,20 +399,16 @@ bad: * for the other half of this song-and-dance. */ static void -crypto_terminate(struct proc **pp, void *q) +crypto_terminate(struct thread **tdp, void *q) { - struct proc *p; + struct thread *td; mtx_assert(&crypto_drivers_mtx, MA_OWNED); - p = *pp; - *pp = NULL; - if (p) { + td = *tdp; + *tdp = NULL; + if (td != NULL) { wakeup_one(q); - PROC_LOCK(p); /* NB: insure we don't miss wakeup */ - CRYPTO_DRIVER_UNLOCK(); /* let crypto_finis progress */ - msleep(p, &p->p_mtx, PWAIT, "crypto_destroy", 0); - PROC_UNLOCK(p); - CRYPTO_DRIVER_LOCK(); + mtx_sleep(td, &crypto_drivers_mtx, PWAIT, "crypto_destroy", 0); } } @@ -472,9 +471,9 @@ crypto_destroy(void) if (crypto_tq != NULL) taskqueue_drain_all(crypto_tq); CRYPTO_DRIVER_LOCK(); - crypto_terminate(&cryptoproc, &crp_q); + crypto_terminate(&cryptotd, &crp_q); FOREACH_CRYPTO_RETW(ret_worker) - crypto_terminate(&ret_worker->cryptoretproc, &ret_worker->crp_ret_q); + crypto_terminate(&ret_worker->td, &ret_worker->crp_ret_q); CRYPTO_DRIVER_UNLOCK(); /* XXX flush queues??? */ @@ -1987,14 +1986,14 @@ crypto_finis(void *chan) CRYPTO_DRIVER_LOCK(); wakeup_one(chan); CRYPTO_DRIVER_UNLOCK(); - kproc_exit(0); + kthread_exit(); } /* * Crypto thread, dispatches crypto requests. */ static void -crypto_proc(void) +crypto_dispatch_thread(void *arg __unused) { struct cryptop *crp, *submit; struct cryptkop *krp; @@ -2126,7 +2125,7 @@ crypto_proc(void) crp_sleep = 1; msleep(&crp_q, &crypto_q_mtx, PWAIT, "crypto_wait", 0); crp_sleep = 0; - if (cryptoproc == NULL) + if (cryptotd == NULL) break; CRYPTOSTAT_INC(cs_intrs); } @@ -2142,8 +2141,9 @@ crypto_proc(void) * callbacks typically are expensive and would slow interrupt handling. */ static void -crypto_ret_proc(struct crypto_ret_worker *ret_worker) +crypto_ret_thread(void *arg) { + struct crypto_ret_worker *ret_worker = arg; struct cryptop *crpt; struct cryptkop *krpt; @@ -2187,7 +2187,7 @@ crypto_ret_proc(struct crypto_ret_worker *ret_worker) */ msleep(&ret_worker->crp_ret_q, &ret_worker->crypto_ret_mtx, PWAIT, "crypto_ret_wait", 0); - if (ret_worker->cryptoretproc == NULL) + if (ret_worker->td == NULL) break; CRYPTOSTAT_INC(cs_rets); } From nobody Tue Nov 23 23:13:01 2021 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 5D03918A2040; Tue, 23 Nov 2021 23:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgM11v1z3vqH; Tue, 23 Nov 2021 23:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 350FF1F4F7; Tue, 23 Nov 2021 23:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND1Sj037837; Tue, 23 Nov 2021 23:13:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND11M037836; Tue, 23 Nov 2021 23:13:01 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:01 GMT Message-Id: <202111232313.1ANND11M037836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aa7aa23171c8 - stable/13 - crypto: Cleanup mtx_init() calls. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa7aa23171c86d0f05a90cef646ae6d1a3d1200e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fq+5/oqZGNw1CPHfK0Mmksyf0nkpuzNbdI8tPiFCT/8=; b=Ji7rTsv4D16S7PqYmcxPERwU+n8a5WYFUVd7cR8XCXTuBxX2Dh0UMk5yfSuiwgac/3kArU Ub1quiNuFYLjFFN0EtXxvbvXVwz73rg1PQW6b44KYpPajt/v1/L8GFlqUVmZY29RcNMD73 ft6W3gjUflaSSuR2vmdMTHY/cnWV+07J1IYSzn2Z52t0BGcuSJCoNp1Yipt4GRpIqJAO/8 UTj/0lMrTMhQ3jntrXXP38ROiKCeRg24NWWahfnDNsyMOZqQ4CHTR+RCvukmm1iw6kzwvy xAyiuKpPR16ioosaj6y4wjPNYZ2j+gKulhhVfnDfE2UxqsXPApkegqig+R9sBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709186; a=rsa-sha256; cv=none; b=lABt/mAdBDn8ZS3rVoyDh8NuJN4MF/jPOy5FG7yHZNTIWTQArkfjGsC3OavQo5OBP5FbJB joXYlJXg9wEtPRnshIi0bQKRWV3qEp39g3+VFOkvnftfQw7npH3rYYFN4LkEDzf2wdFjtE uqFocqBBGs0hM+ocCuwgMcmtMorBaTPsy4tsLLghBIWWbSfqdRlta/BO2TifNDNlu2j5N7 jUOAhPOKY2ABE+qQPYUJ8rtiabsseOx70jPh6wsjFbjdMusR2Z0LBZmD6mqFNGQkGkdfDa QUJnOhk5JtxxHA/gXIoTLn17wO+3t+GhL5VNvgJ6m3mj6dghtbilk8feWwnfsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aa7aa23171c86d0f05a90cef646ae6d1a3d1200e commit aa7aa23171c86d0f05a90cef646ae6d1a3d1200e Author: John Baldwin AuthorDate: 2021-11-02 18:27:20 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:49 +0000 crypto: Cleanup mtx_init() calls. Don't pass the same name to multiple mutexes while using unique types for WITNESS. Just use the unique types as the mutex names. Reviewed by: markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32740 (cherry picked from commit 4e057806cf56b238a0a3ef7af140f447d7b67ab5) --- sys/opencrypto/crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index a151ee21dce7..576382406d88 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -327,12 +327,11 @@ crypto_init(void) struct proc *p; int error; - mtx_init(&crypto_drivers_mtx, "crypto", "crypto driver table", - MTX_DEF|MTX_QUIET); + mtx_init(&crypto_drivers_mtx, "crypto driver table", NULL, MTX_DEF); TAILQ_INIT(&crp_q); TAILQ_INIT(&crp_kq); - mtx_init(&crypto_q_mtx, "crypto", "crypto op queues", MTX_DEF); + mtx_init(&crypto_q_mtx, "crypto op queues", NULL, MTX_DEF); cryptop_zone = uma_zcreate("cryptop", sizeof(struct cryptop), NULL, NULL, NULL, NULL, @@ -371,7 +370,8 @@ crypto_init(void) ret_worker->reorder_ops = 0; ret_worker->reorder_cur_seq = 0; - mtx_init(&ret_worker->crypto_ret_mtx, "crypto", "crypto return queues", MTX_DEF); + mtx_init(&ret_worker->crypto_ret_mtx, "crypto return queues", + NULL, MTX_DEF); error = kthread_add(crypto_ret_thread, ret_worker, p, &ret_worker->td, 0, 0, "crypto returns %td", From nobody Tue Nov 23 23:13:02 2021 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 EC9E018A1E72; Tue, 23 Nov 2021 23:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgN1GlYz3vYd; Tue, 23 Nov 2021 23:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5850C1F4F8; Tue, 23 Nov 2021 23:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND2lW037865; Tue, 23 Nov 2021 23:13:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND20v037864; Tue, 23 Nov 2021 23:13:02 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:02 GMT Message-Id: <202111232313.1ANND20v037864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d8feb950a6c4 - stable/13 - Move the ICL_CONN_*LOCK* macros to . 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d8feb950a6c411b1d118b42e1dfb9072cd480585 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N4bgwRORPzelGqfN59ZLGbrRySfvgnEifs0dnSATHcQ=; b=yWlidgpP4fdpi5mtrXBrkdQWWWFvCjF4W6c+WaeJ4uYjM9vWGPlKlOIBEfeuo5gmliXWYf +P4P87RsQjvolZtfqlCNtFKzFMzotuH3dyT9+ylTnm2DQ8UEnqkYZYD9sP7XC2pO7IBEe8 uboe5uklElsdrwumRYStrHOe8Dq0yfWeV1fylw3xOHsSDfSr8/jsZsFQooyvG0hvZ527Dx 9CPc1ZdZ9ol6H29ItWu1/r09t3joNDsOFIseWyJKN8vZd703ucun2AF/4KLg4VHTQ7EsH6 pO28wdbP8GgV7zrMvT2vwAiY07ObwDlnDrRWB8yo/Fp9+2nXYfoijZMZ3ZX8yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709185; a=rsa-sha256; cv=none; b=OM4Y2K5lUcpaRRQ687Sp4x/1DIEkBnLuo6+Vbl4S3mAiMVJfCGoanpDSG2f3IsnMy+roEE MXGA9k3zks4myyhtmdI7CMZRsmcITRGamJx0Hu/IjioiPOEKStE9MD1TjHV+V1oEFSK+v9 rZ0mJmo93IZVhValTcYdDj47RZ4wIm132xcteHaFgg2Uk4AwOWQGY5wsAqJsa/ylLqmK1u noAQrGiyk7OM7pdYZNJlMCabjTbTJd56++zqcJV9F0RVWncBhlUeCE5Kwrx+2nto6GTpSD BUiFkyppayGu0fnUD4BmaaauT9AmCKIQ3qlpeTXNDj8rmqxPEVu2jkmvXEFLcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d8feb950a6c411b1d118b42e1dfb9072cd480585 commit d8feb950a6c411b1d118b42e1dfb9072cd480585 Author: John Baldwin AuthorDate: 2021-11-05 23:38:25 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:53 +0000 Move the ICL_CONN_*LOCK* macros to . These macros are not backend-specific but reference a backend-independent field in struct icl_conn. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32858 (cherry picked from commit e900338c0987603456df8d9a8aeec5c239106d0b) --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 5 ----- sys/dev/iscsi/icl.h | 5 +++++ sys/dev/iscsi/icl_soft.c | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index cf1032f2a3a2..de8f2547f29a 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -129,11 +129,6 @@ SYSCTL_INT(_kern_icl_cxgbei, OID_AUTO, recvspace, CTLFLAG_RWTUN, static volatile u_int icl_cxgbei_ncons; -#define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) -#define ICL_CONN_UNLOCK(X) mtx_unlock(X->ic_lock) -#define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) -#define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) - static icl_conn_new_pdu_t icl_cxgbei_conn_new_pdu; static icl_conn_pdu_data_segment_length_t icl_cxgbei_conn_pdu_data_segment_length; diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h index 07dcbbf2a0b5..edd43a45ba2e 100644 --- a/sys/dev/iscsi/icl.h +++ b/sys/dev/iscsi/icl.h @@ -120,6 +120,11 @@ struct icl_conn { void *ic_prv0; }; +#define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) +#define ICL_CONN_UNLOCK(X) mtx_unlock(X->ic_lock) +#define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) +#define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) + struct icl_drv_limits { int idl_max_recv_data_segment_length; int idl_max_send_data_segment_length; diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 95c4c87dd6f3..37f3911204c4 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -123,11 +123,6 @@ static uma_zone_t icl_soft_pdu_zone; static volatile u_int icl_ncons; -#define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) -#define ICL_CONN_UNLOCK(X) mtx_unlock(X->ic_lock) -#define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) -#define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) - STAILQ_HEAD(icl_pdu_stailq, icl_pdu); static icl_conn_new_pdu_t icl_soft_conn_new_pdu; From nobody Tue Nov 23 23:13:03 2021 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 E9D8A18A1FA5; Tue, 23 Nov 2021 23:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgN66vlz3vsR; Tue, 23 Nov 2021 23:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CD451F2B8; Tue, 23 Nov 2021 23:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND3p1037891; Tue, 23 Nov 2021 23:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND37n037890; Tue, 23 Nov 2021 23:13:03 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:03 GMT Message-Id: <202111232313.1ANND37n037890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 93074f595e7e - stable/13 - Drop "All rights reserved" from a Netflix copyright. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 93074f595e7e28e605eeed28e188707fe7619a9f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GPVlt6z8VBqGGnU/pCs3DGUQ6onTLumUuolDnA6/P5s=; b=uf8WSm4J/nmfzU2Y+LewcTtslaSo8lqNQclxV2EDCCcyCQv02ZJYJTH5IKSPxs567byAnB NqD4l+lA+2rCZbbH22vxp+fY8b86yeiwgAFc0hb7vGJXcaplIDH0iYXBjD+0V2zUC5Ympc zZIoJetIU/T3PK5/+YoGm7MscGZcSb671oFkWDO+qFPdCwdItacQdZKs9PiMy/mGut+TKr I1hs1lAArB/mOY6TULu+djKAK7ovBCfADHcNonsBYkSwtrkrJrpGkmhqDgxImdJJaFuUD5 8tMQD9N8oOPzc9aTEE6s/88wN0936O+J3AY+05EU8gvqmOFDUVTkVX5+SIKqOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709185; a=rsa-sha256; cv=none; b=LUm+rHEcjN+jvaeijM2LaYttTaaHhvOHz2sOfDfTcnfJeD+QeHvlOZuf6w0NV3cbNFVCaV hVQrC7r8y0gDJGjm+6Icad094MPaSx1t7yy/C2AdARYas0GB3tKbosS6ykJlVBBY+VKRax RpJZOWwbhdlwX6c6Y5i3NsEVMZLVexb0cm55BSRyLdpFHH/IOOcv6KK6VwTV2IyzTiPIdE SeZPkTb4OGuIoFt33uoAqDm8u+ogdZeb7RhOnlSXxGPhrz2Ra/1Ia5W0eUo+rCjtHjPLkD gHMVqWgx41sugbbTzmTQjPfdCAG0lLnFv6ttpl4ho6Jwoa6lsK8VHx3wHsxLWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=93074f595e7e28e605eeed28e188707fe7619a9f commit 93074f595e7e28e605eeed28e188707fe7619a9f Author: John Baldwin AuthorDate: 2021-11-11 22:41:16 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:53 +0000 Drop "All rights reserved" from a Netflix copyright. Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32778 (cherry picked from commit 522a2aa7613aa43f4d3bb5bdd1d87f966304be34) --- sys/opencrypto/ktls_ocf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 71f6339e02ad..f33af68dde8f 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Netflix Inc. - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From nobody Tue Nov 23 23:13:06 2021 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 A248318A2282; Tue, 23 Nov 2021 23:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgR1hJPz3vn4; Tue, 23 Nov 2021 23:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E78431F725; Tue, 23 Nov 2021 23:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND6k1037963; Tue, 23 Nov 2021 23:13:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND6cB037962; Tue, 23 Nov 2021 23:13:06 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:06 GMT Message-Id: <202111232313.1ANND6cB037962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 94280c58116f - stable/13 - ktls: Reject some invalid cipher suites. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 94280c58116f91f77436d8bb50f312492c1bb221 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RCIUOyJ5Ro/0WYU6DwWMYjoV4zFlW4gr7CJVvsi5Gic=; b=SLBAl1PotofYLg1B4xGBlZqbjetI2luJ0x9zyvrpPcd6tmRoXxSKLg/l9TIqNtlPCLSDp5 7hDd8Dk2UeA+X2D2rOJlBdZMbQCJDGgY0Mk4/1xn0AzwpQOfMsx2McSj4+xzp0yWyS+CcW uiBsns0dzK0dIOUhKh0O/lSPSXrSIPfAnLbqFlzEIEJp/w+GrtzpWzoIROz01uS/nj+fEq YJpBH686OOgW6qgQIh0hYpi+BVYKjp/+ZZbMBPweBlcIZFj7UJBOfOtfaX5Q7bObcVLxrY 6JG9m1yaIYyoUras8zUkSDWKnDCT9iDhG8zH5hWcwaH29GUHjfR26lcVXAWgSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709188; a=rsa-sha256; cv=none; b=I93ue/ntl1m1NFK1DjGsW8ceGrrtBYfQjgS4h5M0y/9PbX1eVq6Lmw4k0EUWypJThmiEGB XN3lO1Z+zlbdJl40bxjDlcymbJHYIEgHaXTwCz3HLY/wuSZQmRNc9kLL+ZrGu64vyIxpyx 1s3eMHUMrmswNU0NGh05+J5P8ZxJsPzgdMT2A23mgWkB8v6UaHAUgfznprXfw974BkXNnD vB+2Zof5DoxcCGGC2wQWCP/378+cFTZAjbTxGztSEAwte20DK3gHmyfCgdBtin+gw/p/xn il0FcP1nzVldXNrsP/hcDZ6wfwZWzHI7Le0Jsa8WXsovsp+f+mqH8bg8ezMk+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=94280c58116f91f77436d8bb50f312492c1bb221 commit 94280c58116f91f77436d8bb50f312492c1bb221 Author: John Baldwin AuthorDate: 2021-11-15 19:28:56 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:53 +0000 ktls: Reject some invalid cipher suites. - Reject AES-CBC cipher suites for TLS 1.0 and TLS 1.1 using auth algorithms other than SHA1-HMAC. - Reject AES-GCM cipher suites for TLS versions older than 1.2. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32842 (cherry picked from commit 900a28fe33ef998aaee55cb243f4efa35471da07) --- sys/kern/uipc_ktls.c | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index e9585d06841c..db4ab69e06cf 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -497,40 +497,51 @@ ktls_create_session(struct socket *so, struct tls_enable *en, } if (en->auth_key_len != 0) return (EINVAL); - if ((en->tls_vminor == TLS_MINOR_VER_TWO && - en->iv_len != TLS_AEAD_GCM_LEN) || - (en->tls_vminor == TLS_MINOR_VER_THREE && - en->iv_len != TLS_1_3_GCM_IV_LEN)) + switch (en->tls_vminor) { + case TLS_MINOR_VER_TWO: + if (en->iv_len != TLS_AEAD_GCM_LEN) + return (EINVAL); + break; + case TLS_MINOR_VER_THREE: + if (en->iv_len != TLS_1_3_GCM_IV_LEN) + return (EINVAL); + break; + default: return (EINVAL); + } break; case CRYPTO_AES_CBC: switch (en->auth_algorithm) { case CRYPTO_SHA1_HMAC: - /* - * TLS 1.0 requires an implicit IV. TLS 1.1+ - * all use explicit IVs. - */ - if (en->tls_vminor == TLS_MINOR_VER_ZERO) { - if (en->iv_len != TLS_CBC_IMPLICIT_IV_LEN) - return (EINVAL); - break; - } - - /* FALLTHROUGH */ + break; case CRYPTO_SHA2_256_HMAC: case CRYPTO_SHA2_384_HMAC: - /* Ignore any supplied IV. */ - en->iv_len = 0; + if (en->tls_vminor != TLS_MINOR_VER_TWO) + return (EINVAL); break; default: return (EINVAL); } if (en->auth_key_len == 0) return (EINVAL); - if (en->tls_vminor != TLS_MINOR_VER_ZERO && - en->tls_vminor != TLS_MINOR_VER_ONE && - en->tls_vminor != TLS_MINOR_VER_TWO) + + /* + * TLS 1.0 requires an implicit IV. TLS 1.1 and 1.2 + * use explicit IVs. + */ + switch (en->tls_vminor) { + case TLS_MINOR_VER_ZERO: + if (en->iv_len != TLS_CBC_IMPLICIT_IV_LEN) + return (EINVAL); + break; + case TLS_MINOR_VER_ONE: + case TLS_MINOR_VER_TWO: + /* Ignore any supplied IV. */ + en->iv_len = 0; + break; + default: return (EINVAL); + } break; case CRYPTO_CHACHA20_POLY1305: if (en->auth_algorithm != 0 || en->auth_key_len != 0) From nobody Tue Nov 23 23:13:05 2021 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 9595A18A1FD2; Tue, 23 Nov 2021 23:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgQ4mlDz3vky; Tue, 23 Nov 2021 23:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C23651F14A; Tue, 23 Nov 2021 23:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND52I037939; Tue, 23 Nov 2021 23:13:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND5mM037938; Tue, 23 Nov 2021 23:13:05 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:05 GMT Message-Id: <202111232313.1ANND5mM037938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 27d29db0fa81 - stable/13 - ktls: Add tests for sending empty fragments for TLS 1.0 connections. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 27d29db0fa81c98f3263294986a83969eb2e1913 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lNJsKlZe+D/CY4x2ca89ZkoUUJAo90Je6WK9GD9tmDs=; b=avlYlqtx9rGAVuCsL8wGxQ1g6f+1u5Q77//JSAje4MKCJ1BG0KIMR507SOfI7zxHWCYkYP hfvLXxJGql+m+7QEW16Jh+jn5l+X7Rcb1MYuRNta18OGJHkfvam5MgVsdgOadQmwa9/fZc Pj/ayL6CNIzIHRgufZHjrnJFtXhgmS3bZl6c6AR0xKcT9JkgmnKD3I3QuANeW+Y22PhNEU lEPSe/FVBN7ewsZaWQnkmTILUVTHT64Oy3DKxF9sA412iwAZ07X/S0GvBDS49PNkgrgj+y DtqnHx+I0/FNFsqfumICrCF52AALEbM9jHpuV/8nPVgkC6OLh9I/ITiRxZKZ7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709187; a=rsa-sha256; cv=none; b=N3e6OqNZu07BuO+oWrh5KXzS9VDj6f5B96VkQ5timWmth3aKjQAEgaL7sLOENqvls3tT02 r22zLDUUC6gUamCf3DDFmy7ZveQxDg/3Fc8QZNU/JmX/sXa0mbcQD4wiRzTP9lnQet8Ieu tlFusAQ05PtsM9PHOw7Lvtgjzb039UX+kOsDqxCuA9z/8z/6FLHtEJSnhtQjJ0pqyY+O6l Iwak8Do3ZqeJtS7pDjcYDaiuMdY46tjcqJKQVVqIQXRQ9iF6PCMDulihaO7IWUCQgwbZRq LfzD/8hFeFHwVKiIxAWtIkXF+JFAcAHxt5g9n5PYSnxW7NCuZZWP6HT6KeTJkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=27d29db0fa81c98f3263294986a83969eb2e1913 commit 27d29db0fa81c98f3263294986a83969eb2e1913 Author: John Baldwin AuthorDate: 2021-11-15 19:27:15 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:53 +0000 ktls: Add tests for sending empty fragments for TLS 1.0 connections. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32841 (cherry picked from commit 0ff2a12ae32a3a88be63f4036599c1324ce04f78) --- tests/sys/kern/ktls_test.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index bf2b81645d31..423ccf65cb0c 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -911,6 +911,64 @@ test_ktls_transmit_control(struct tls_enable *en, uint64_t seqno, uint8_t type, close(sockets[0]); } +static void +test_ktls_transmit_empty_fragment(struct tls_enable *en, uint64_t seqno) +{ + struct tls_record_layer *hdr; + char *outbuf; + size_t outbuf_cap, payload_len, record_len; + ssize_t rv; + int sockets[2]; + uint8_t record_type; + + outbuf_cap = tls_header_len(en) + tls_trailer_len(en); + outbuf = malloc(outbuf_cap); + hdr = (struct tls_record_layer *)outbuf; + + ATF_REQUIRE_MSG(socketpair_tcp(sockets), "failed to create sockets"); + + ATF_REQUIRE(setsockopt(sockets[1], IPPROTO_TCP, TCP_TXTLS_ENABLE, en, + sizeof(*en)) == 0); + + fd_set_blocking(sockets[0]); + fd_set_blocking(sockets[1]); + + /* A write of zero bytes should send an empty fragment. */ + rv = write(sockets[1], NULL, 0); + ATF_REQUIRE(rv == 0); + + /* + * First read the header to determine how much additional data + * to read. + */ + rv = read(sockets[0], outbuf, sizeof(struct tls_record_layer)); + ATF_REQUIRE(rv == sizeof(struct tls_record_layer)); + payload_len = ntohs(hdr->tls_length); + record_len = payload_len + sizeof(struct tls_record_layer); + ATF_REQUIRE(record_len <= outbuf_cap); + rv = read(sockets[0], outbuf + sizeof(struct tls_record_layer), + payload_len); + ATF_REQUIRE(rv == (ssize_t)payload_len); + + rv = decrypt_tls_record(en, seqno, outbuf, record_len, NULL, 0, + &record_type); + + ATF_REQUIRE_MSG(rv == 0, + "read %zd decrypted bytes for an empty fragment", rv); + ATF_REQUIRE(record_type == TLS_RLTYPE_APP); + + free(outbuf); + + close(sockets[1]); + close(sockets[0]); +} + +#define TLS_10_TESTS(M) \ + M(aes128_cbc_1_0_sha1, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA1_HMAC) \ + M(aes256_cbc_1_0_sha1, CRYPTO_AES_CBC, 256 / 8, \ + CRYPTO_SHA1_HMAC) + #define AES_CBC_TESTS(M) \ M(aes128_cbc_1_0_sha1, CRYPTO_AES_CBC, 128 / 8, \ CRYPTO_SHA1_HMAC, TLS_MINOR_VER_ZERO) \ @@ -989,6 +1047,26 @@ ATF_TC_BODY(ktls_transmit_##cipher_name##_##name, tc) \ auth_alg, minor, name) \ ATF_TP_ADD_TC(tp, ktls_transmit_##cipher_name##_##name); +#define GEN_TRANSMIT_EMPTY_FRAGMENT_TEST(cipher_name, cipher_alg, \ + key_size, auth_alg) \ +ATF_TC_WITHOUT_HEAD(ktls_transmit_##cipher_name##_empty_fragment); \ +ATF_TC_BODY(ktls_transmit_##cipher_name##_empty_fragment, tc) \ +{ \ + struct tls_enable en; \ + uint64_t seqno; \ + \ + ATF_REQUIRE_KTLS(); \ + seqno = random(); \ + build_tls_enable(cipher_alg, key_size, auth_alg, \ + TLS_MINOR_VER_ZERO, seqno, &en); \ + test_ktls_transmit_empty_fragment(&en, seqno); \ + free_tls_enable(&en); \ +} + +#define ADD_TRANSMIT_EMPTY_FRAGMENT_TEST(cipher_name, cipher_alg, \ + key_size, auth_alg) \ + ATF_TP_ADD_TC(tp, ktls_transmit_##cipher_name##_empty_fragment); + #define GEN_TRANSMIT_TESTS(cipher_name, cipher_alg, key_size, auth_alg, \ minor) \ GEN_TRANSMIT_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ @@ -1103,12 +1181,19 @@ CHACHA20_TESTS(GEN_TRANSMIT_TESTS); */ AES_CBC_TESTS(GEN_TRANSMIT_PADDING_TESTS); +/* + * Test "empty fragments" which are TLS records with no payload that + * OpenSSL can send for TLS 1.0 connections. + */ +TLS_10_TESTS(GEN_TRANSMIT_EMPTY_FRAGMENT_TEST); + ATF_TP_ADD_TCS(tp) { AES_CBC_TESTS(ADD_TRANSMIT_TESTS); AES_GCM_TESTS(ADD_TRANSMIT_TESTS); CHACHA20_TESTS(ADD_TRANSMIT_TESTS); AES_CBC_TESTS(ADD_TRANSMIT_PADDING_TESTS); + TLS_10_TESTS(ADD_TRANSMIT_EMPTY_FRAGMENT_TEST); return (atf_no_error()); } From nobody Tue Nov 23 23:13:04 2021 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 87A9418A1F56; Tue, 23 Nov 2021 23:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgP3vbrz3vkw; Tue, 23 Nov 2021 23:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FC011F619; Tue, 23 Nov 2021 23:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND4Gk037915; Tue, 23 Nov 2021 23:13:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND4f6037914; Tue, 23 Nov 2021 23:13:04 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:04 GMT Message-Id: <202111232313.1ANND4f6037914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9b6f4b35d2c2 - stable/13 - ktls: Add padding tests for AES-CBC MTE cipher suites. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b6f4b35d2c27e0bdb15d8c70426540d78e3f6c9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4g1BUPKEatQoxeUvwfQPdxvC9GVfWaRdY2Pk/pojrFQ=; b=lPkFgHNO9zLM1Ux1xknO+ukCSWmU9RImgv+0gL4lNT4gkfki26i7ApvN7xUXGNDhWZB/iy bbrd+seiNCHIQg4ysCXIVDZX9sSLqP1pDx48Nq71JuQI62CTajOZyUv4kJf+ZttrZslLZE NhwUvYcxVpfkadkwpxN7ErBzYZemVIT9TGIbKpeBDkvNagc3HCS0whLyY0neAP1khYjTpY iFbcB+VlB5Dd6Dftx0t1Fh+Lambjk1XUp3+eW1nQnYFt0Ta1lGnoUlKfKZbVbNDbjWO+WH Rall3cKTTF3Y3xQVH0uQnkSSXDQB4z3kyRSctmMHg39GEK17dZwe9THjAW2urw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709186; a=rsa-sha256; cv=none; b=ljTybHddi1JCMnTlENL3GMaRHc19CUQxVTAfasx+RwxykRmSqAUR0hHeq2P2S+EqQx0B3f u9CFYdS0Uqk6514QZkZAIxWhS1xMFDMx+zrA3A0+vk8glOKCdvaRvEISOR1W2F/NrtPCRQ VpqQYEG6E9Mj1XyReJTIvg5bQ4urRAjNbj83oqLXus/EC5N06dqJe1j8G9py5rCMyGFEXD cmu6shGfyVHt10Xvd8VDpXNkhYj9W2eR9ii4fntim0vHPF+H7NlHTGX2hyWTDxrEPJDoRz oXu26RTd1aKO/W1oBeGZIsuAsklWYl7R3p/XnsU6oH74zyN6aFirqDFfqpT9eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9b6f4b35d2c27e0bdb15d8c70426540d78e3f6c9 commit 9b6f4b35d2c27e0bdb15d8c70426540d78e3f6c9 Author: John Baldwin AuthorDate: 2021-11-15 19:26:45 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:53 +0000 ktls: Add padding tests for AES-CBC MTE cipher suites. For each AES-CBC MTE cipher suite, test sending records with 1 to 16 bytes of payload. This ensures that all of the potential padding values are covered. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32840 (cherry picked from commit 44265dc3dae1d373f33f474244b5c9811471080b) --- tests/sys/kern/ktls_test.c | 95 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 7 deletions(-) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 908f7f1818a2..bf2b81645d31 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -970,9 +970,9 @@ ATF_TC_BODY(ktls_transmit_##cipher_name##_##name, tc) \ ATF_TP_ADD_TC(tp, ktls_transmit_##cipher_name##_##name); #define GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ - auth_alg, minor, type, len) \ -ATF_TC_WITHOUT_HEAD(ktls_transmit_##cipher_name##_control); \ -ATF_TC_BODY(ktls_transmit_##cipher_name##_control, tc) \ + auth_alg, minor, name, type, len) \ +ATF_TC_WITHOUT_HEAD(ktls_transmit_##cipher_name##_##name); \ +ATF_TC_BODY(ktls_transmit_##cipher_name##_##name, tc) \ { \ struct tls_enable en; \ uint64_t seqno; \ @@ -986,8 +986,8 @@ ATF_TC_BODY(ktls_transmit_##cipher_name##_control, tc) \ } #define ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ - auth_alg, minor) \ - ATF_TP_ADD_TC(tp, ktls_transmit_##cipher_name##_control); + auth_alg, minor, name) \ + ATF_TP_ADD_TC(tp, ktls_transmit_##cipher_name##_##name); #define GEN_TRANSMIT_TESTS(cipher_name, cipher_alg, key_size, auth_alg, \ minor) \ @@ -996,7 +996,7 @@ ATF_TC_BODY(ktls_transmit_##cipher_name##_control, tc) \ GEN_TRANSMIT_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ auth_alg, minor, long, 64 * 1024) \ GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ - auth_alg, minor, 0x21 /* Alert */, 32) + auth_alg, minor, control, 0x21 /* Alert */, 32) #define ADD_TRANSMIT_TESTS(cipher_name, cipher_alg, key_size, auth_alg, \ minor) \ @@ -1005,7 +1005,7 @@ ATF_TC_BODY(ktls_transmit_##cipher_name##_control, tc) \ ADD_TRANSMIT_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ auth_alg, minor, long) \ ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ - auth_alg, minor) + auth_alg, minor, control) /* * For each supported cipher suite, run three transmit tests: @@ -1023,11 +1023,92 @@ AES_CBC_TESTS(GEN_TRANSMIT_TESTS); AES_GCM_TESTS(GEN_TRANSMIT_TESTS); CHACHA20_TESTS(GEN_TRANSMIT_TESTS); +#define GEN_TRANSMIT_PADDING_TESTS(cipher_name, cipher_alg, key_size, \ + auth_alg, minor) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_1, 0x21 /* Alert */, 1) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_2, 0x21 /* Alert */, 2) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_3, 0x21 /* Alert */, 3) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_4, 0x21 /* Alert */, 4) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_5, 0x21 /* Alert */, 5) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_6, 0x21 /* Alert */, 6) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_7, 0x21 /* Alert */, 7) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_8, 0x21 /* Alert */, 8) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_9, 0x21 /* Alert */, 9) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_10, 0x21 /* Alert */, 10) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_11, 0x21 /* Alert */, 11) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_12, 0x21 /* Alert */, 12) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_13, 0x21 /* Alert */, 13) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_14, 0x21 /* Alert */, 14) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_15, 0x21 /* Alert */, 15) \ + GEN_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_16, 0x21 /* Alert */, 16) + +#define ADD_TRANSMIT_PADDING_TESTS(cipher_name, cipher_alg, key_size, \ + auth_alg, minor) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_1) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_2) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_3) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_4) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_5) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_6) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_7) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_8) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_9) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_10) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_11) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_12) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_13) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_14) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_15) \ + ADD_TRANSMIT_CONTROL_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, padding_16) + +/* + * For AES-CBC MTE cipher suites using padding, add tests of messages + * with each possible padding size. Note that the padding_ tests + * do not necessarily test bytes of padding as the padding is a + * function of the cipher suite's MAC length. However, cycling + * through all of the payload sizes from 1 to 16 should exercise all + * of the possible padding lengths for each suite. + */ +AES_CBC_TESTS(GEN_TRANSMIT_PADDING_TESTS); + ATF_TP_ADD_TCS(tp) { AES_CBC_TESTS(ADD_TRANSMIT_TESTS); AES_GCM_TESTS(ADD_TRANSMIT_TESTS); CHACHA20_TESTS(ADD_TRANSMIT_TESTS); + AES_CBC_TESTS(ADD_TRANSMIT_PADDING_TESTS); return (atf_no_error()); } From nobody Tue Nov 23 23:13:07 2021 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 B367618A229B; Tue, 23 Nov 2021 23:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgS6gJnz3vsj; Tue, 23 Nov 2021 23:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 122981F726; Tue, 23 Nov 2021 23:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND72e037989; Tue, 23 Nov 2021 23:13:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND7Mk037988; Tue, 23 Nov 2021 23:13:07 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:07 GMT Message-Id: <202111232313.1ANND7Mk037988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 32993b8e581c - stable/13 - ktls: Add tests ensuring various invalid cipher suites are rejected. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 32993b8e581c9c92a9ff81fa7b5d5e3f2c1018f4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBYyiktHqGc3OXtRH7qAY3bhYSO0cAXwbyJ0E0ToKLE=; b=SwAmMiSjTeQKTbX5Cr+TMUq2IM+w3hPrTNJXFF8J1K+FMNt2xalhUqEWU2rKVO19aoepld rezVMppL8UGDLBjGM+aFUSxVm+s4AAbL6VrZ9yV42gINiZm7F1msO7uvXTDIkHY3rAoIQ8 7HDgsGa7nFuBQ3LynV9ZGb5WVzMe6W4k2qXOc+jkNKSMKNdLGdWXAnJtmcIyKoOIRqfz4i 1AzgiOCsdTjIdWdbggFaF3xv1M+1k41Amfhfa4caKfCf2SnRDCPIKnk9ulBgVX1Kbp7OHm GeXmszC1XK+ew3S1vb4Lyoo2FNyu63jJIvdL1Lv+Yq6dl9EnQHW8ZtexR6eFbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709189; a=rsa-sha256; cv=none; b=SOLTAtdHJLoIhVDaiIt8vaeA7R7qi2WAzt+CpHKJ1UMLkeFjfsFcBTENusXSeCxzNIA93I b4q9uHAz96Ik324hdZxw2RVJP1BRWHzmKQ5IyeaZpKYxMrFoMTWBOdlXpS3NV4SKNS18cM /tR0eSIfCkhioImqiUmMS2K6Yln8/Lbs45gazUxRsuX8gsk7HSqtfN1B/1VxU0ok4esOP3 nFLz0wr0Icr2bsoohlp/vhgwNYTRDNP2J1tbav1qMI85sqUG+W+SXEuE5K4ZQp1KJp7Ijs zjdDhUvl77s2/WaF015jgQl+rlVvxFfdc4TQ/0jtHaF3PNOn0mtgpYb8OlZTZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=32993b8e581c9c92a9ff81fa7b5d5e3f2c1018f4 commit 32993b8e581c9c92a9ff81fa7b5d5e3f2c1018f4 Author: John Baldwin AuthorDate: 2021-11-15 19:30:48 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:53 +0000 ktls: Add tests ensuring various invalid cipher suites are rejected. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32843 (cherry picked from commit d1c369f926e7d04354d044cc13d8ecfb3e325636) --- tests/sys/kern/ktls_test.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 423ccf65cb0c..ef0f7405b3fd 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -1187,6 +1187,70 @@ AES_CBC_TESTS(GEN_TRANSMIT_PADDING_TESTS); */ TLS_10_TESTS(GEN_TRANSMIT_EMPTY_FRAGMENT_TEST); +static void +test_ktls_invalid_transmit_cipher_suite(struct tls_enable *en) +{ + int sockets[2]; + + ATF_REQUIRE_MSG(socketpair_tcp(sockets), "failed to create sockets"); + + ATF_REQUIRE(setsockopt(sockets[1], IPPROTO_TCP, TCP_TXTLS_ENABLE, en, + sizeof(*en)) == -1); + ATF_REQUIRE(errno == EINVAL); + + close(sockets[1]); + close(sockets[0]); +} + +#define GEN_INVALID_TRANSMIT_TEST(name, cipher_alg, key_size, auth_alg, \ + minor) \ +ATF_TC_WITHOUT_HEAD(ktls_transmit_invalid_##name); \ +ATF_TC_BODY(ktls_transmit_invalid_##name, tc) \ +{ \ + struct tls_enable en; \ + uint64_t seqno; \ + \ + ATF_REQUIRE_KTLS(); \ + seqno = random(); \ + build_tls_enable(cipher_alg, key_size, auth_alg, minor, seqno, \ + &en); \ + test_ktls_invalid_transmit_cipher_suite(&en); \ + free_tls_enable(&en); \ +} + +#define ADD_INVALID_TRANSMIT_TEST(name, cipher_alg, key_size, auth_alg, \ + minor) \ + ATF_TP_ADD_TC(tp, ktls_transmit_invalid_##name); + +#define INVALID_CIPHER_SUITES(M) \ + M(aes128_cbc_1_0_sha256, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_256_HMAC, TLS_MINOR_VER_ZERO) \ + M(aes128_cbc_1_0_sha384, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_384_HMAC, TLS_MINOR_VER_ZERO) \ + M(aes128_gcm_1_0, CRYPTO_AES_NIST_GCM_16, 128 / 8, 0, \ + TLS_MINOR_VER_ZERO) \ + M(chacha20_poly1305_1_0, CRYPTO_CHACHA20_POLY1305, 256 / 8, 0, \ + TLS_MINOR_VER_ZERO) \ + M(aes128_cbc_1_1_sha256, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_256_HMAC, TLS_MINOR_VER_ONE) \ + M(aes128_cbc_1_1_sha384, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_384_HMAC, TLS_MINOR_VER_ONE) \ + M(aes128_gcm_1_1, CRYPTO_AES_NIST_GCM_16, 128 / 8, 0, \ + TLS_MINOR_VER_ONE) \ + M(chacha20_poly1305_1_1, CRYPTO_CHACHA20_POLY1305, 256 / 8, 0, \ + TLS_MINOR_VER_ONE) \ + M(aes128_cbc_1_3_sha1, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA1_HMAC, TLS_MINOR_VER_THREE) \ + M(aes128_cbc_1_3_sha256, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_256_HMAC, TLS_MINOR_VER_THREE) \ + M(aes128_cbc_1_3_sha384, CRYPTO_AES_CBC, 128 / 8, \ + CRYPTO_SHA2_384_HMAC, TLS_MINOR_VER_THREE) + +/* + * Ensure that invalid cipher suites are rejected for transmit. + */ +INVALID_CIPHER_SUITES(GEN_INVALID_TRANSMIT_TEST); + ATF_TP_ADD_TCS(tp) { AES_CBC_TESTS(ADD_TRANSMIT_TESTS); @@ -1194,6 +1258,7 @@ ATF_TP_ADD_TCS(tp) CHACHA20_TESTS(ADD_TRANSMIT_TESTS); AES_CBC_TESTS(ADD_TRANSMIT_PADDING_TESTS); TLS_10_TESTS(ADD_TRANSMIT_EMPTY_FRAGMENT_TEST); + INVALID_CIPHER_SUITES(ADD_INVALID_TRANSMIT_TEST); return (atf_no_error()); } From nobody Tue Nov 23 23:13:09 2021 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 B6B1818A2326; Tue, 23 Nov 2021 23:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgV3D0gz3vqv; Tue, 23 Nov 2021 23:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34DA31F14B; Tue, 23 Nov 2021 23:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANND9hS038017; Tue, 23 Nov 2021 23:13:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANND92I038016; Tue, 23 Nov 2021 23:13:09 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:09 GMT Message-Id: <202111232313.1ANND92I038016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 38b44748ab2f - stable/13 - ktls: Add simple receive tests of kernel TLS. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 38b44748ab2f42c23d1e84cb5b82be322701cc29 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ELb+VDCcDKUE7GMKXqhCqR3i32tgeO+diYb++iEWvtQ=; b=ck/DyO1Rn+oQDti00RXiA81c4H/oTKfplySvqA3XZmKyWKxGX3vew/SUs7KRn1PWK2bPcY aohd5f+hiNRUyihgrr+cBgVKPFPlroF5i+NOVjX6tDNTLS/bTygxXNTeSTvtaSeJfgiaHM OI/VA6aX2NTL8UvfIkBR6YTeeTcZJEix6yZHwdsUtrkf9iIMeOZS2SmAc2tF7lgjYBPGhS e94D3cK6Md6/XLzRRrdURZqWLt0h2qsr1wwNZvkrCFwI0JnZnyxu0WmRuXKZAIC4cPxuyA RniFt8ppvZRzzfrsEIG4m52nn4QoZmbMhMeRg969bVxs6WCbtGvhWI41565W3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709190; a=rsa-sha256; cv=none; b=TiB1cjjyTuSZPBkc3QXbqHlJr6AZAvGM8pP+K4L2IObCPL44OJkVGWLMsaFTX8tLSXkpf7 Ss1ZG3cJXsMkOb1VWb+fqacZgSMKGb2vCyhZv733kimLG0ueryiKMa3ZB2twmhFGmOdMnX od/rEmUObE9P/vdb1/XMuqI6c3TOiIKjX/aMEgxn/x4llfO3zC9fzo3xXL5Fw75pVVWDk7 PKZZGvjP2XkYYQ/S6PbZMFvP8rsS/wTfgh3bjkhg7tw6mCEPdWISpV/MZclbo6JroBJhCS 5/JFifnTXicBQLufeVk5B5YYaRCIg7zEGQHKusW/SY3dqNSkfV9Y37r/QVzKJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=38b44748ab2f42c23d1e84cb5b82be322701cc29 commit 38b44748ab2f42c23d1e84cb5b82be322701cc29 Author: John Baldwin AuthorDate: 2021-11-15 19:31:16 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:53 +0000 ktls: Add simple receive tests of kernel TLS. Similar to the simple transmit tests added in a10482ea7476d68d1ab028145ae6d97cef747b49, these tests test the kernel TLS functionality directly by manually encrypting TLS records using randomly generated keys and writing them to a socket to be processed by the kernel. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32980 (cherry picked from commit 3e7f8a8da254cfa97af90c3aae1cb827da55fc9d) --- tests/sys/kern/ktls_test.c | 319 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 319 insertions(+) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index ef0f7405b3fd..bdd2e62a546c 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -262,6 +262,68 @@ verify_hash(const EVP_MD *md, const void *key, size_t key_len, const void *aad, return (true); } +static bool +aead_encrypt(const EVP_CIPHER *cipher, const char *key, const char *nonce, + const void *aad, size_t aad_len, const char *input, char *output, + size_t size, char *tag, size_t tag_len) +{ + EVP_CIPHER_CTX *ctx; + int outl, total; + + ctx = EVP_CIPHER_CTX_new(); + if (ctx == NULL) { + warnx("EVP_CIPHER_CTX_new failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + return (false); + } + if (EVP_EncryptInit_ex(ctx, cipher, NULL, (const u_char *)key, + (const u_char *)nonce) != 1) { + warnx("EVP_EncryptInit_ex failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + EVP_CIPHER_CTX_set_padding(ctx, 0); + if (aad != NULL) { + if (EVP_EncryptUpdate(ctx, NULL, &outl, (const u_char *)aad, + aad_len) != 1) { + warnx("EVP_EncryptUpdate for AAD failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + } + if (EVP_EncryptUpdate(ctx, (u_char *)output, &outl, + (const u_char *)input, size) != 1) { + warnx("EVP_EncryptUpdate failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + total = outl; + if (EVP_EncryptFinal_ex(ctx, (u_char *)output + outl, &outl) != 1) { + warnx("EVP_EncryptFinal_ex failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + total += outl; + if ((size_t)total != size) { + warnx("encrypt size mismatch: %zu vs %d", size, total); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, tag_len, tag) != + 1) { + warnx("EVP_CIPHER_CTX_ctrl(EVP_CTRL_AEAD_GET_TAG) failed: %s", + ERR_error_string(ERR_get_error(), NULL)); + EVP_CIPHER_CTX_free(ctx); + return (false); + } + EVP_CIPHER_CTX_free(ctx); + return (true); +} + static bool aead_decrypt(const EVP_CIPHER *cipher, const char *key, const char *nonce, const void *aad, size_t aad_len, const char *input, char *output, @@ -714,6 +776,68 @@ decrypt_tls_record(struct tls_enable *en, uint64_t seqno, const void *src, record_type)); } +/* + * Encrypt a TLS record of type 'record_type' with payload 'len' bytes + * long at 'src' and store the result at 'dst'. If 'dst' doesn't have + * sufficient room ('avail'), fail the test. + */ +static size_t +encrypt_tls_12_aead(struct tls_enable *en, uint8_t record_type, uint64_t seqno, + const void *src, size_t len, void *dst) +{ + struct tls_record_layer *hdr; + struct tls_aead_data aad; + char nonce[12]; + size_t hdr_len, mac_len, record_len; + + hdr = dst; + + hdr_len = tls_header_len(en); + mac_len = tls_mac_len(en); + record_len = hdr_len + len + mac_len; + + hdr->tls_type = record_type; + hdr->tls_vmajor = TLS_MAJOR_VER_ONE; + hdr->tls_vminor = TLS_MINOR_VER_TWO; + hdr->tls_length = htons(record_len - sizeof(*hdr)); + if (en->cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + memcpy(hdr + 1, &seqno, sizeof(seqno)); + + tls_12_aead_aad(en, len, hdr, seqno, &aad); + if (en->cipher_algorithm == CRYPTO_AES_NIST_GCM_16) + tls_12_gcm_nonce(en, hdr, nonce); + else + tls_13_nonce(en, seqno, nonce); + + ATF_REQUIRE(aead_encrypt(tls_EVP_CIPHER(en), en->cipher_key, nonce, + &aad, sizeof(aad), src, (char *)dst + hdr_len, len, + (char *)dst + hdr_len + len, mac_len)); + + return (record_len); +} + +static size_t +encrypt_tls_aead(struct tls_enable *en, uint8_t record_type, uint64_t seqno, + const void *src, size_t len, void *dst, size_t avail) +{ + size_t record_len; + + record_len = tls_header_len(en) + len + tls_trailer_len(en); + ATF_REQUIRE(record_len <= avail); + + ATF_REQUIRE(encrypt_tls_12_aead(en, record_type, seqno, src, len, + dst) == record_len); + + return (record_len); +} + +static size_t +encrypt_tls_record(struct tls_enable *en, uint8_t record_type, uint64_t seqno, + const void *src, size_t len, void *dst, size_t avail) +{ + return (encrypt_tls_aead(en, record_type, seqno, src, len, dst, avail)); +} + static void test_ktls_transmit_app_data(struct tls_enable *en, uint64_t seqno, size_t len) { @@ -963,12 +1087,156 @@ test_ktls_transmit_empty_fragment(struct tls_enable *en, uint64_t seqno) close(sockets[0]); } +static size_t +ktls_receive_tls_record(struct tls_enable *en, int fd, uint8_t record_type, + void *data, size_t len) +{ + struct msghdr msg; + struct cmsghdr *cmsg; + struct tls_get_record *tgr; + char cbuf[CMSG_SPACE(sizeof(*tgr))]; + struct iovec iov; + ssize_t rv; + + memset(&msg, 0, sizeof(msg)); + + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + iov.iov_base = data; + iov.iov_len = len; + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + + ATF_REQUIRE((rv = recvmsg(fd, &msg, 0)) > 0); + + ATF_REQUIRE((msg.msg_flags & (MSG_EOR | MSG_CTRUNC)) == MSG_EOR); + + cmsg = CMSG_FIRSTHDR(&msg); + ATF_REQUIRE(cmsg != NULL); + ATF_REQUIRE(cmsg->cmsg_level == IPPROTO_TCP); + ATF_REQUIRE(cmsg->cmsg_type == TLS_GET_RECORD); + ATF_REQUIRE(cmsg->cmsg_len == CMSG_LEN(sizeof(*tgr))); + + tgr = (struct tls_get_record *)CMSG_DATA(cmsg); + ATF_REQUIRE(tgr->tls_type == record_type); + ATF_REQUIRE(tgr->tls_vmajor == en->tls_vmajor); + ATF_REQUIRE(tgr->tls_vminor == en->tls_vminor); + ATF_REQUIRE(tgr->tls_length == htons(rv)); + + return (rv); +} + +static void +test_ktls_receive_app_data(struct tls_enable *en, uint64_t seqno, size_t len) +{ + struct kevent ev; + char *plaintext, *received, *outbuf; + size_t outbuf_cap, outbuf_len, outbuf_sent, received_len, todo, written; + ssize_t rv; + int kq, sockets[2]; + + plaintext = alloc_buffer(len); + received = malloc(len); + outbuf_cap = tls_header_len(en) + TLS_MAX_MSG_SIZE_V10_2 + + tls_trailer_len(en); + outbuf = malloc(outbuf_cap); + + ATF_REQUIRE((kq = kqueue()) != -1); + + ATF_REQUIRE_MSG(socketpair_tcp(sockets), "failed to create sockets"); + + ATF_REQUIRE(setsockopt(sockets[0], IPPROTO_TCP, TCP_RXTLS_ENABLE, en, + sizeof(*en)) == 0); + + EV_SET(&ev, sockets[0], EVFILT_READ, EV_ADD, 0, 0, NULL); + ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) == 0); + EV_SET(&ev, sockets[1], EVFILT_WRITE, EV_ADD, 0, 0, NULL); + ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) == 0); + + received_len = 0; + outbuf_len = 0; + written = 0; + + while (received_len != len) { + ATF_REQUIRE(kevent(kq, NULL, 0, &ev, 1, NULL) == 1); + + switch (ev.filter) { + case EVFILT_WRITE: + /* + * Compose the next TLS record to send. + */ + if (outbuf_len == 0) { + ATF_REQUIRE(written < len); + todo = len - written; + if (todo > TLS_MAX_MSG_SIZE_V10_2) + todo = TLS_MAX_MSG_SIZE_V10_2; + outbuf_len = encrypt_tls_record(en, + TLS_RLTYPE_APP, seqno, plaintext + written, + todo, outbuf, outbuf_cap); + outbuf_sent = 0; + written += todo; + seqno++; + } + + /* + * Try to write the remainder of the current + * TLS record. + */ + rv = write(ev.ident, outbuf + outbuf_sent, + outbuf_len - outbuf_sent); + ATF_REQUIRE_MSG(rv > 0, + "failed to write to socket"); + outbuf_sent += rv; + if (outbuf_sent == outbuf_len) { + outbuf_len = 0; + if (written == len) { + ev.flags = EV_DISABLE; + ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, + NULL) == 0); + } + } + break; + + case EVFILT_READ: + ATF_REQUIRE((ev.flags & EV_EOF) == 0); + + rv = ktls_receive_tls_record(en, ev.ident, + TLS_RLTYPE_APP, received + received_len, + len - received_len); + received_len += rv; + break; + } + } + + ATF_REQUIRE_MSG(written == received_len, + "read %zu decrypted bytes, but wrote %zu", received_len, written); + + ATF_REQUIRE(memcmp(plaintext, received, len) == 0); + + free(outbuf); + free(received); + free(plaintext); + + close(sockets[1]); + close(sockets[0]); + close(kq); +} + #define TLS_10_TESTS(M) \ M(aes128_cbc_1_0_sha1, CRYPTO_AES_CBC, 128 / 8, \ CRYPTO_SHA1_HMAC) \ M(aes256_cbc_1_0_sha1, CRYPTO_AES_CBC, 256 / 8, \ CRYPTO_SHA1_HMAC) +#define TLS_12_TESTS(M) \ + M(aes128_gcm_1_2, CRYPTO_AES_NIST_GCM_16, 128 / 8, 0, \ + TLS_MINOR_VER_TWO) \ + M(aes256_gcm_1_2, CRYPTO_AES_NIST_GCM_16, 256 / 8, 0, \ + TLS_MINOR_VER_TWO) \ + M(chacha20_poly1305_1_2, CRYPTO_CHACHA20_POLY1305, 256 / 8, 0, \ + TLS_MINOR_VER_TWO) + #define AES_CBC_TESTS(M) \ M(aes128_cbc_1_0_sha1, CRYPTO_AES_CBC, 128 / 8, \ CRYPTO_SHA1_HMAC, TLS_MINOR_VER_ZERO) \ @@ -1251,8 +1519,57 @@ ATF_TC_BODY(ktls_transmit_invalid_##name, tc) \ */ INVALID_CIPHER_SUITES(GEN_INVALID_TRANSMIT_TEST); +#define GEN_RECEIVE_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, name, len) \ +ATF_TC_WITHOUT_HEAD(ktls_receive_##cipher_name##_##name); \ +ATF_TC_BODY(ktls_receive_##cipher_name##_##name, tc) \ +{ \ + struct tls_enable en; \ + uint64_t seqno; \ + \ + ATF_REQUIRE_KTLS(); \ + seqno = random(); \ + build_tls_enable(cipher_alg, key_size, auth_alg, minor, seqno, \ + &en); \ + test_ktls_receive_app_data(&en, seqno, len); \ + free_tls_enable(&en); \ +} + +#define ADD_RECEIVE_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, name) \ + ATF_TP_ADD_TC(tp, ktls_receive_##cipher_name##_##name); + +#define GEN_RECEIVE_TESTS(cipher_name, cipher_alg, key_size, auth_alg, \ + minor) \ + GEN_RECEIVE_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, short, 64) \ + GEN_RECEIVE_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, long, 64 * 1024) + +#define ADD_RECEIVE_TESTS(cipher_name, cipher_alg, key_size, auth_alg, \ + minor) \ + ADD_RECEIVE_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, short) \ + ADD_RECEIVE_APP_DATA_TEST(cipher_name, cipher_alg, key_size, \ + auth_alg, minor, long) + +/* + * For each supported cipher suite, run two receive tests: + * + * - a short test which sends 64 bytes of application data (likely as + * a single TLS record) + * + * - a long test which sends 64KB of application data (split across + * multiple TLS records) + * + * Note that receive is currently only supported for TLS 1.2 AEAD + * cipher suites. + */ +TLS_12_TESTS(GEN_RECEIVE_TESTS); + ATF_TP_ADD_TCS(tp) { + /* Transmit tests */ AES_CBC_TESTS(ADD_TRANSMIT_TESTS); AES_GCM_TESTS(ADD_TRANSMIT_TESTS); CHACHA20_TESTS(ADD_TRANSMIT_TESTS); @@ -1260,5 +1577,7 @@ ATF_TP_ADD_TCS(tp) TLS_10_TESTS(ADD_TRANSMIT_EMPTY_FRAGMENT_TEST); INVALID_CIPHER_SUITES(ADD_INVALID_TRANSMIT_TEST); + /* Receive tests */ + TLS_12_TESTS(ADD_RECEIVE_TESTS); return (atf_no_error()); } From nobody Tue Nov 23 23:13:10 2021 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 BDCAC18A2279; Tue, 23 Nov 2021 23:13:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgX5yHpz3vr2; Tue, 23 Nov 2021 23:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 467D71F2B9; Tue, 23 Nov 2021 23:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNDArV038041; Tue, 23 Nov 2021 23:13:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNDA3c038040; Tue, 23 Nov 2021 23:13:10 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:10 GMT Message-Id: <202111232313.1ANNDA3c038040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e91446cd84b3 - stable/13 - ktls: Add tests ensuring invalid receive cipher suites are rejected. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e91446cd84b3d03eb14d5c6dbd585057d0977a53 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x88n0YIT5lUWrkENbQnrxgzIhquo2J5+tEccxs3hDHU=; b=myY3Sc95oK0EKIi14tq0P1UYwP2fEJ6LMhkX/Ye6WvMcZfkHsm+jngiYNr7dljLxek3omB KsGx8ZqY4SEoRpr7VpWW1cs2d72m0K+pBdB80OT3sPOczMMyxTo6o6u93LJW3Enf5mS+Mf SNQgGQRp0/k9Qte9OyJ8FBMs+oEtxDqPcn1G+EK8cgAfi+quourESqHWV6qgqShX0G8ebE Tw+yAJDzdDa1LuopwiHAeRcd3Xq1ozsaICFhpMnVbrIb3hj3tNkS5lLbyNGzGkNtV56bSr THCnSmWTf85Su31jV88RKzhaes2zYEIEChI4HA59uOnGupDcay8hZISLu7NPTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709193; a=rsa-sha256; cv=none; b=mtDKM6UvUWQxW68UQHwWLSsPnwFwgyJe4Rtn6Hcd1dtgTlypujeNYRkKSO/cF4MyJVvAvC zE8GUGGaBdP5xS2Fdvr/dR4+9+eA3Ax5X8eqs3BFfjL66BpOZTp9cLdM1Tyf4D2JH3qcsg RnNohVF57neD7QSA2e0c0KUVfasWJy0449GI4nlItVSq3C+41ZUgpaV4pWhOUGdeqGNm/1 M51+wIXuIrhftoDXiKYEpIGdNA8qIC/18evP+5ZwQlfZ6GmSw9z3ZuvFpncwjmJsaLXQlQ qIV5Kxk2WBsgkEaMfU5Ute6vbTje2iaVxDVX43iOtLlLPgv8JpOYZg40a2umOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e91446cd84b3d03eb14d5c6dbd585057d0977a53 commit e91446cd84b3d03eb14d5c6dbd585057d0977a53 Author: John Baldwin AuthorDate: 2021-11-15 19:32:15 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:54 +0000 ktls: Add tests ensuring invalid receive cipher suites are rejected. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32981 (cherry picked from commit 233ce578a424a7a3e5cf21ea6ba2b2036950d54f) --- tests/sys/kern/ktls_test.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index bdd2e62a546c..5aea56baa91f 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -1567,6 +1567,51 @@ ATF_TC_BODY(ktls_receive_##cipher_name##_##name, tc) \ */ TLS_12_TESTS(GEN_RECEIVE_TESTS); +static void +test_ktls_invalid_receive_cipher_suite(struct tls_enable *en) +{ + int sockets[2]; + + ATF_REQUIRE_MSG(socketpair_tcp(sockets), "failed to create sockets"); + + ATF_REQUIRE(setsockopt(sockets[1], IPPROTO_TCP, TCP_RXTLS_ENABLE, en, + sizeof(*en)) == -1); + + /* + * XXX: TLS 1.3 fails with ENOTSUP before checking for invalid + * ciphers. + */ + ATF_REQUIRE(errno == EINVAL || errno == ENOTSUP); + + close(sockets[1]); + close(sockets[0]); +} + +#define GEN_INVALID_RECEIVE_TEST(name, cipher_alg, key_size, auth_alg, \ + minor) \ +ATF_TC_WITHOUT_HEAD(ktls_receive_invalid_##name); \ +ATF_TC_BODY(ktls_receive_invalid_##name, tc) \ +{ \ + struct tls_enable en; \ + uint64_t seqno; \ + \ + ATF_REQUIRE_KTLS(); \ + seqno = random(); \ + build_tls_enable(cipher_alg, key_size, auth_alg, minor, seqno, \ + &en); \ + test_ktls_invalid_receive_cipher_suite(&en); \ + free_tls_enable(&en); \ +} + +#define ADD_INVALID_RECEIVE_TEST(name, cipher_alg, key_size, auth_alg, \ + minor) \ + ATF_TP_ADD_TC(tp, ktls_receive_invalid_##name); + +/* + * Ensure that invalid cipher suites are rejected for receive. + */ +INVALID_CIPHER_SUITES(GEN_INVALID_RECEIVE_TEST); + ATF_TP_ADD_TCS(tp) { /* Transmit tests */ @@ -1579,5 +1624,7 @@ ATF_TP_ADD_TCS(tp) /* Receive tests */ TLS_12_TESTS(ADD_RECEIVE_TESTS); + INVALID_CIPHER_SUITES(ADD_INVALID_RECEIVE_TEST); + return (atf_no_error()); } From nobody Tue Nov 23 23:13:11 2021 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 55C9418A24C0; Tue, 23 Nov 2021 23:13:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgZ1Wywz3w1X; Tue, 23 Nov 2021 23:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7050F1F727; Tue, 23 Nov 2021 23:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNDBhf038065; Tue, 23 Nov 2021 23:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNDBXa038064; Tue, 23 Nov 2021 23:13:11 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:11 GMT Message-Id: <202111232313.1ANNDBXa038064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6987f78ea136 - stable/13 - ktls: Add tests ensuring unsupported receive cipher suites are rejected. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6987f78ea136389bfc0c117273e75ee68ee445f0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cquyAvb+lRmAbSM8tQ3ep+Z+O76zMJeAENFsF6GEjlw=; b=uS0sSWVPDb9ugRtwqs5vvIym53oEVWfD5JCJ7xrP1U4CBsXOkG5lTLpKE3KJmZzzXAjUXz A4fi6uKX5iDjjaq/M3/qoiYdEY/97bGlShyu1Flf12P62C2MR8H3raVLA7xjZVx693OSVD 4u1B0HlYpHGZ17E9gP4gze4nfnIzJ99T8HdfHF0jWHPR7v5ZB+OJqqeAFVQdSjQVTCSuGy U9zg22CTqEfEdcHveKtapjF+OkRcF2sLTT8Dwq6lAvfxHWdvsRj0s+N6jQyjq083dryl7y 3/gBkNaX/3dtfmwqSAnn5gVc4zsNVzPEdmQ6dztyXUEvOldANK7xO5TQ4oSRrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709195; a=rsa-sha256; cv=none; b=s1jtlTLmQB3mrXGOjTYlYYtcGXJukh38YbbPW9CYC4dWxWDVVsF3pNskoQNWgQ9LafPSyp KJjUB4A1qiSM+DzDAFCsTSwuuPHqXrT22xB8pLks304R7nM0PsUSg9LhSthSzn+8ypHz+G gdIGzmB1zyV3WIpnbhbwV3huvqYGlDSSh29o/m8kZo1l1Tuj2xQVWG8Zsgs+ZPJy+Hnrzh xym9Gx+SQ0Ns2FXaBiEKQOrAnJTluhWs1lDgCUbLSyOfuAswZASRzyxPpfa6w4REuSm2LU Uh5aXeftAWdG/uMvCQLRgMWs40E9hQK8CtEcKsWgSWgxFc56FmCC23/YCKQ2fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6987f78ea136389bfc0c117273e75ee68ee445f0 commit 6987f78ea136389bfc0c117273e75ee68ee445f0 Author: John Baldwin AuthorDate: 2021-11-15 19:32:49 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:54 +0000 ktls: Add tests ensuring unsupported receive cipher suites are rejected. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32982 (cherry picked from commit 83a54b582f89ff63f9076eb7d50b5cdbd009905f) --- tests/sys/kern/ktls_test.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 5aea56baa91f..21e3213a8634 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -1237,6 +1237,14 @@ test_ktls_receive_app_data(struct tls_enable *en, uint64_t seqno, size_t len) M(chacha20_poly1305_1_2, CRYPTO_CHACHA20_POLY1305, 256 / 8, 0, \ TLS_MINOR_VER_TWO) +#define TLS_13_TESTS(M) \ + M(aes128_gcm_1_3, CRYPTO_AES_NIST_GCM_16, 128 / 8, 0, \ + TLS_MINOR_VER_THREE) \ + M(aes256_gcm_1_3, CRYPTO_AES_NIST_GCM_16, 256 / 8, 0, \ + TLS_MINOR_VER_THREE) \ + M(chacha20_poly1305_1_3, CRYPTO_CHACHA20_POLY1305, 256 / 8, 0, \ + TLS_MINOR_VER_THREE) + #define AES_CBC_TESTS(M) \ M(aes128_cbc_1_0_sha1, CRYPTO_AES_CBC, 128 / 8, \ CRYPTO_SHA1_HMAC, TLS_MINOR_VER_ZERO) \ @@ -1612,6 +1620,48 @@ ATF_TC_BODY(ktls_receive_invalid_##name, tc) \ */ INVALID_CIPHER_SUITES(GEN_INVALID_RECEIVE_TEST); +static void +test_ktls_unsupported_receive_cipher_suite(struct tls_enable *en) +{ + int sockets[2]; + + ATF_REQUIRE_MSG(socketpair_tcp(sockets), "failed to create sockets"); + + ATF_REQUIRE(setsockopt(sockets[1], IPPROTO_TCP, TCP_RXTLS_ENABLE, en, + sizeof(*en)) == -1); + ATF_REQUIRE(errno == EPROTONOSUPPORT || errno == ENOTSUP); + + close(sockets[1]); + close(sockets[0]); +} + +#define GEN_UNSUPPORTED_RECEIVE_TEST(name, cipher_alg, key_size, \ + auth_alg, minor) \ +ATF_TC_WITHOUT_HEAD(ktls_receive_unsupported_##name); \ +ATF_TC_BODY(ktls_receive_unsupported_##name, tc) \ +{ \ + struct tls_enable en; \ + uint64_t seqno; \ + \ + ATF_REQUIRE_KTLS(); \ + seqno = random(); \ + build_tls_enable(cipher_alg, key_size, auth_alg, minor, seqno, \ + &en); \ + test_ktls_unsupported_receive_cipher_suite(&en); \ + free_tls_enable(&en); \ +} + +#define ADD_UNSUPPORTED_RECEIVE_TEST(name, cipher_alg, key_size, \ + auth_alg, minor) \ + ATF_TP_ADD_TC(tp, ktls_receive_unsupported_##name); + +/* + * Ensure that valid cipher suites not supported for receive are + * rejected. + */ +AES_CBC_TESTS(GEN_UNSUPPORTED_RECEIVE_TEST); +TLS_13_TESTS(GEN_UNSUPPORTED_RECEIVE_TEST); + ATF_TP_ADD_TCS(tp) { /* Transmit tests */ @@ -1623,7 +1673,9 @@ ATF_TP_ADD_TCS(tp) INVALID_CIPHER_SUITES(ADD_INVALID_TRANSMIT_TEST); /* Receive tests */ + AES_CBC_TESTS(ADD_UNSUPPORTED_RECEIVE_TEST); TLS_12_TESTS(ADD_RECEIVE_TESTS); + TLS_13_TESTS(ADD_UNSUPPORTED_RECEIVE_TEST); INVALID_CIPHER_SUITES(ADD_INVALID_RECEIVE_TEST); return (atf_no_error()); From nobody Tue Nov 23 23:13:12 2021 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 BA74318A2529; Tue, 23 Nov 2021 23:13:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgZ1Xx7z3vtC; Tue, 23 Nov 2021 23:13:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 937D01F728; Tue, 23 Nov 2021 23:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNDC81038089; Tue, 23 Nov 2021 23:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNDCDV038088; Tue, 23 Nov 2021 23:13:12 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:12 GMT Message-Id: <202111232313.1ANNDCDV038088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b2d704ea8820 - stable/13 - ktls: Use ATF_REQUIRE instead of assert() for validating TLS header lengths. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b2d704ea882031204c41ecf472200e9bf5c629eb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VibIGNa9gxF/LZelh6rOgRKpSN5edx0BWPSCzhP5OUQ=; b=yKQEF1xo7Ez8zZjxVrc2Dc0ZnIaeoSFdoXCLRnnnX9yONB+LFJV1zds01m2pBux3MrDF9K 8X1/t1A/VmWzQZW+DzK6yAUdWeDpq2g91Pi+bJ538c6QtUJHQb7Oempaz0jalpTkCNeuju O4ubWFO5/NdIQ9I+ViUAurvZ5SBlMZjitcsRVX+1c0IUTXVz/E+2MMthOkobZKB5lwSMBH LpTXtFJHMn8wnyCpgcG86QpC1UnI/S4iSkfZej/zzyZq0n6lYqvfXsPVOLNGpWF33I9Jjb ZTWjSjA6bev3jgtGkNQNOv/o2lXVsuqF2vMJj+B4zT9L1nedikOJ0582xpsW/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709195; a=rsa-sha256; cv=none; b=FMSNV3DEqg1ptcKKLNHA39Hv9MbuqlrGGHktP8I9cJ/ndotT8bnN0/78scBAmIbTVeRjD0 vDyz5EITIbkU3GD9wxlUguAxZIDOY8mTurnrexpgm04AP9AZt+xVVOWGE6ZkRwUwaBlvT7 fz2PfKWpfHdQky/hMYem4X6kulODWd6eSacLkc3/GYEx+pD3xUEMS5QdQGVuIc3EbbmkX2 p30WI+IMitCm2xT5Hbvzsh5+rG7B2g3RgUjNX2iYZ2R+nNLND4UD+R2MmSYjJ9k0S4FxA9 4cugJrVhBD4exhe2nsETI/8y0Rzg98zN1JEFOVJwSfl4FuQ4m+lmHC0DSUt4Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b2d704ea882031204c41ecf472200e9bf5c629eb commit b2d704ea882031204c41ecf472200e9bf5c629eb Author: John Baldwin AuthorDate: 2021-11-16 17:56:15 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:54 +0000 ktls: Use ATF_REQUIRE instead of assert() for validating TLS header lengths. The TLS header length field is set by the kernel, so if it is incorrect that is an indication of a kernel bug, not an internal error in the tests. Prompted by: markj (comment in an earlier review) Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33003 (cherry picked from commit d71830cdf0df6dbc4bd3332daa95d9ecd7d64060) --- tests/sys/kern/ktls_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 21e3213a8634..64e26bb27f37 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -913,8 +913,8 @@ test_ktls_transmit_app_data(struct tls_enable *en, uint64_t seqno, size_t len) record_len = sizeof(struct tls_record_layer) + ntohs(hdr->tls_length); - assert(record_len <= outbuf_cap); - assert(record_len > outbuf_len); + ATF_REQUIRE(record_len <= outbuf_cap); + ATF_REQUIRE(record_len > outbuf_len); rv = read(ev.ident, outbuf + outbuf_len, record_len - outbuf_len); if (rv == -1 && errno == EAGAIN) @@ -1013,7 +1013,7 @@ test_ktls_transmit_control(struct tls_enable *en, uint64_t seqno, uint8_t type, ATF_REQUIRE(rv == sizeof(struct tls_record_layer)); payload_len = ntohs(hdr->tls_length); record_len = payload_len + sizeof(struct tls_record_layer); - assert(record_len <= outbuf_cap); + ATF_REQUIRE(record_len <= outbuf_cap); rv = read(sockets[0], outbuf + sizeof(struct tls_record_layer), payload_len); ATF_REQUIRE(rv == (ssize_t)payload_len); From nobody Tue Nov 23 23:13:13 2021 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 408E218A25C2; Tue, 23 Nov 2021 23:13:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgc1C2qz3vjG; Tue, 23 Nov 2021 23:13:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B16831F0CD; Tue, 23 Nov 2021 23:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNDDJF038113; Tue, 23 Nov 2021 23:13:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNDDHk038112; Tue, 23 Nov 2021 23:13:13 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:13 GMT Message-Id: <202111232313.1ANNDDHk038112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: abb212fe13df - stable/13 - ktls tests: Check the return values of close(). 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: abb212fe13df3ed967e5aabc38c5e5f0fcf499a0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m9dI/T3sRzHw8gNOCTJctPyWaAeLnTzQE8/JMhbNT/c=; b=QrfAoq5PARNYfAJZLqCxRFI4r+YE9JeFb07YhJdv6z3PjGO4lJOn5O8goNNiECqf1FCzm+ 32vdR2qegW4C0XIcO23Yj2sNgO6aavVYW4Z3K/CLfOA7vq1axga3fe7laSDtil2SpU6Hj1 XEZKN34tA7ezyztmKaqmH+9xFSiYvwxP1wx+ybBXm42mXrhvfyKhiqjRquQ9Cnw3JR0K8r HARLPD1v6d8Ysrds/IkNYLdg3gaXtBemKRywSouWfhmGBke28VZcqSeJLyeOaqiFkTQ9uO 3ubrdaXDwNfcn+kqlCE03CJjgQ5SE8YQru9ruAZDLNLt8YZ4G1YkF87rBSPuxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709196; a=rsa-sha256; cv=none; b=fg6IRWyDKCWQDqL6KyiyjZ01J89Dv2bqZY24I0a9FtnYA/YXnb3NbJdTEKGg9Ne3j22rwK MhPd+e+S/dkgVDvEGir61p/sT2jiUwqP1JFk/yQ40qNmVvSWmTuAyTNCKmD99o/Hk1oPlU +7wyl2Wwk0KioimkUBAQ1JP+4HOX2f7xF2NncYIKO3HNwRXVIxPDDadDMaPYVcCoc5VLt6 zLWCAwEZp8tFj8I/ne4FplkNONNO81qnRYJOVzslg2o5eo+Hf1YN9MAo1Mi4d0Wu8Ll7CL rUBBJgu77EHKtxOivSxpqJj1z7OGHFIS7TvCU+5ZoMQQTsbYylwYyAvsZWiAvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=abb212fe13df3ed967e5aabc38c5e5f0fcf499a0 commit abb212fe13df3ed967e5aabc38c5e5f0fcf499a0 Author: John Baldwin AuthorDate: 2021-11-16 17:56:15 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:54 +0000 ktls tests: Check the return values of close(). Suggested by: markj Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33004 (cherry picked from commit 694c708d6a0d00f84fa53357a1cc8a72272a26e3) --- tests/sys/kern/ktls_test.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 64e26bb27f37..9942e78091b1 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -945,9 +945,9 @@ test_ktls_transmit_app_data(struct tls_enable *en, uint64_t seqno, size_t len) free(decrypted); free(plaintext); - close(sockets[1]); - close(sockets[0]); - close(kq); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); + ATF_REQUIRE(close(kq) == 0); } static void @@ -1031,8 +1031,8 @@ test_ktls_transmit_control(struct tls_enable *en, uint64_t seqno, uint8_t type, free(decrypted); free(plaintext); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } static void @@ -1083,8 +1083,8 @@ test_ktls_transmit_empty_fragment(struct tls_enable *en, uint64_t seqno) free(outbuf); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } static size_t @@ -1218,9 +1218,9 @@ test_ktls_receive_app_data(struct tls_enable *en, uint64_t seqno, size_t len) free(received); free(plaintext); - close(sockets[1]); - close(sockets[0]); - close(kq); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); + ATF_REQUIRE(close(kq) == 0); } #define TLS_10_TESTS(M) \ @@ -1474,8 +1474,8 @@ test_ktls_invalid_transmit_cipher_suite(struct tls_enable *en) sizeof(*en)) == -1); ATF_REQUIRE(errno == EINVAL); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } #define GEN_INVALID_TRANSMIT_TEST(name, cipher_alg, key_size, auth_alg, \ @@ -1591,8 +1591,8 @@ test_ktls_invalid_receive_cipher_suite(struct tls_enable *en) */ ATF_REQUIRE(errno == EINVAL || errno == ENOTSUP); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } #define GEN_INVALID_RECEIVE_TEST(name, cipher_alg, key_size, auth_alg, \ @@ -1631,8 +1631,8 @@ test_ktls_unsupported_receive_cipher_suite(struct tls_enable *en) sizeof(*en)) == -1); ATF_REQUIRE(errno == EPROTONOSUPPORT || errno == ENOTSUP); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } #define GEN_UNSUPPORTED_RECEIVE_TEST(name, cipher_alg, key_size, \ From nobody Tue Nov 23 23:13:14 2021 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 69E3518A2641; Tue, 23 Nov 2021 23:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKgd4fqCz3vvt; Tue, 23 Nov 2021 23:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D19E41F4F9; Tue, 23 Nov 2021 23:13:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNDEvm038143; Tue, 23 Nov 2021 23:13:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNDE4d038142; Tue, 23 Nov 2021 23:13:14 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:14 GMT Message-Id: <202111232313.1ANNDE4d038142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d7b47e163dc7 - stable/13 - ktls: Split encrypt vs decrypt OCF counters. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7b47e163dc7bed63e10e231e0c38451f8787d1b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FU13Jdg/WhQNPM7hhVpg/OgWu3Ts23gKd2WB8tXdyp4=; b=icyK+Z5Be5hte/7mx4DIFS4Rpaf5XDaL/s6BcMknIXLWV0TTkfa5Ek+xAm+28p+d2HD/ar HCaSxcEJbp/KNeqht+O5i7MDeZEpa7XXJpW9odNNTY4XMh/0iFGxW7si/0w0HITVUj0xz/ sc/PAEkqLCJSfMxC0Ii2Yg5a2AO6RAazMdnh7t05k2//SuwkGCY0ZszEKyDbzeP+o6So/z DQiN1+F4rnK9JzHrmgB00Rl49+7/ARjMJ+bzBWgsbrG9hSH1vemEiSBFIx9XG9jxOQFEjq GD86c6jL9YCutHoQYmb3x4ht0cOiWZd1wM6O4bpMgAOsgZnjmQLdPp2bi58vqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709198; a=rsa-sha256; cv=none; b=TITJ2OOnNpDEb2tGEJ6uJzIY67tNmoAvXjRXa3oZxEQ/jzZWUeWT8vtw51/bPMokmRxWQT BJ+ekUsrO/RFBfErwHtgZfVyBjNrE3OeKzYqRZC0y0N2W6Oo3Dxcu/AXnFb/hENSUvGUEq RFyqvRGcQnctNP0dxc++CbcNfm3X+F3DkHuU1UGcMIb4yQiadYrQNq4Zo/qJiapIu70ywE WUvlqGcfRxdb7ZVjeChyHcbXs+V0z2HuwJbUpWbEHDo4ri87VlQroSqT8jLFZwlmht+rT3 0x8C0kOMZ8reJzStDi2aUWcJ//IcnCfe/CAWX5Z7RQZo60UOeti+BNi/ZaebaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d7b47e163dc7bed63e10e231e0c38451f8787d1b commit d7b47e163dc7bed63e10e231e0c38451f8787d1b Author: John Baldwin AuthorDate: 2021-11-16 17:58:52 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:54 +0000 ktls: Split encrypt vs decrypt OCF counters. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33006 (cherry picked from commit 16bea05ac3275d41663939da0d5c26d89f15cd53) --- sys/opencrypto/ktls_ocf.c | 62 +++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index f33af68dde8f..cbd1af6c6341 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -71,34 +71,44 @@ static SYSCTL_NODE(_kern_ipc_tls_stats, OID_AUTO, ocf, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Kernel TLS offload via OCF stats"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls10_cbc_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls10_cbc_crypts, - CTLFLAG_RD, &ocf_tls10_cbc_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls10_cbc_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls10_cbc_encrypts, + CTLFLAG_RD, &ocf_tls10_cbc_encrypts, "Total number of OCF TLS 1.0 CBC encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls11_cbc_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls11_cbc_crypts, - CTLFLAG_RD, &ocf_tls11_cbc_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls11_cbc_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls11_cbc_encrypts, + CTLFLAG_RD, &ocf_tls11_cbc_encrypts, "Total number of OCF TLS 1.1/1.2 CBC encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls12_gcm_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_crypts, - CTLFLAG_RD, &ocf_tls12_gcm_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_gcm_decrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_decrypts, + CTLFLAG_RD, &ocf_tls12_gcm_decrypts, + "Total number of OCF TLS 1.2 GCM decryption operations"); + +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_gcm_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_encrypts, + CTLFLAG_RD, &ocf_tls12_gcm_encrypts, "Total number of OCF TLS 1.2 GCM encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls12_chacha20_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_chacha20_crypts, - CTLFLAG_RD, &ocf_tls12_chacha20_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_chacha20_decrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_chacha20_decrypts, + CTLFLAG_RD, &ocf_tls12_chacha20_decrypts, + "Total number of OCF TLS 1.2 Chacha20-Poly1305 decryption operations"); + +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_chacha20_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_chacha20_encrypts, + CTLFLAG_RD, &ocf_tls12_chacha20_encrypts, "Total number of OCF TLS 1.2 Chacha20-Poly1305 encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls13_gcm_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_gcm_crypts, - CTLFLAG_RD, &ocf_tls13_gcm_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls13_gcm_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_gcm_encrypts, + CTLFLAG_RD, &ocf_tls13_gcm_encrypts, "Total number of OCF TLS 1.3 GCM encryption operations"); -static COUNTER_U64_DEFINE_EARLY(ocf_tls13_chacha20_crypts); -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_chacha20_crypts, - CTLFLAG_RD, &ocf_tls13_chacha20_crypts, +static COUNTER_U64_DEFINE_EARLY(ocf_tls13_chacha20_encrypts); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_chacha20_encrypts, + CTLFLAG_RD, &ocf_tls13_chacha20_encrypts, "Total number of OCF TLS 1.3 Chacha20-Poly1305 encryption operations"); static COUNTER_U64_DEFINE_EARLY(ocf_inplace); @@ -297,9 +307,9 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, } if (os->implicit_iv) - counter_u64_add(ocf_tls10_cbc_crypts, 1); + counter_u64_add(ocf_tls10_cbc_encrypts, 1); else - counter_u64_add(ocf_tls11_cbc_crypts, 1); + counter_u64_add(ocf_tls11_cbc_encrypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else @@ -415,9 +425,9 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, crypto_use_output_uio(&crp, &out_uio); if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) - counter_u64_add(ocf_tls12_gcm_crypts, 1); + counter_u64_add(ocf_tls12_gcm_encrypts, 1); else - counter_u64_add(ocf_tls12_chacha20_crypts, 1); + counter_u64_add(ocf_tls12_chacha20_encrypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else @@ -485,9 +495,9 @@ ktls_ocf_tls12_aead_decrypt(struct ktls_session *tls, crypto_use_mbuf(&crp, m); if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) - counter_u64_add(ocf_tls12_gcm_crypts, 1); + counter_u64_add(ocf_tls12_gcm_decrypts, 1); else - counter_u64_add(ocf_tls12_chacha20_crypts, 1); + counter_u64_add(ocf_tls12_chacha20_decrypts, 1); error = ktls_ocf_dispatch(os, &crp); crypto_destroyreq(&crp); @@ -576,9 +586,9 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, memcpy(crp.crp_iv, nonce, sizeof(nonce)); if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) - counter_u64_add(ocf_tls13_gcm_crypts, 1); + counter_u64_add(ocf_tls13_gcm_encrypts, 1); else - counter_u64_add(ocf_tls13_chacha20_crypts, 1); + counter_u64_add(ocf_tls13_chacha20_encrypts, 1); if (inplace) counter_u64_add(ocf_inplace, 1); else From nobody Tue Nov 23 23:48:54 2021 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 38F9D189136F; Tue, 23 Nov 2021 23:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzLSk6QJRz4mxC; Tue, 23 Nov 2021 23:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC8491FC13; Tue, 23 Nov 2021 23:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNmsk3077849; Tue, 23 Nov 2021 23:48:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNmsxr077848; Tue, 23 Nov 2021 23:48:54 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:48:54 GMT Message-Id: <202111232348.1ANNmsxr077848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e1d8f7fc1d94 - stable/13 - riscv: Clear SUM in SSTATUS for supervisor mode exceptions. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e1d8f7fc1d9457c5db18d1639f1fdfb244476106 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637711334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyrtDF/UAqvytzOj/qf7s7arHb62GHzE/wJEWhqtC4Y=; b=WCC7EyC17ZRZcokkdB709FERKRO30QvhorFOOcjbZ+sJE/KfQuIkR5wkJLzuGeMxXz1VHe ucDB3mQ00/Zrs7e1tUS0yvZLf/r7NLH0zyJ1tzXNgyMKL0/ybxP4zsI/NnL707X5na06dG c+lj2sJOrGBIALZfIPvcKYCiRRMGeBrZf8kDZxcrCaYV/PSaOIYtPRqG+hbHNeDlYINztg cCQNX6uox3MK5K8Hl6VTr0fymsZJL4M3IPEeTmgYFUFBRzQBetS/Lt5MAi2J6Rg2yf+SyP dLPj20c6A4Kd0qbwwingW7qb6RY0ZmSGidDmikdDpu0KAgEuI3fRDsTZ9ay5GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637711334; a=rsa-sha256; cv=none; b=Qxvblscnp256n1OzaWVrkR8nyccUxLTWKYQi8U0CKzZU9To+Nm2VcaObljxmCblTa4r8W/ JvQ3CNsRHjN/2DhfJJ6G3Hsk05x9W9Y0OfUEgoud7a5IXJZOWdwqzCZ5ykWqYGpwSE1Vkm NuTspGDIccM+BWgbPyP1KrVIQVyB8o+AQEE2WX1aV+++Zlr0os4tEdDR7riGySw3VwY2wX JJNnyg+C9mIa2OuILPlArEisil8+BLMv6Ufh5b4bYEEbg1QY5SAvUOzRgATo0HdE9Wr3ev jhHieuMjswHjsWBT3d9Xv8f76um6aiSw0XM1HGZAqKZkt9mhpjXI+rLkmNUG3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e1d8f7fc1d9457c5db18d1639f1fdfb244476106 commit e1d8f7fc1d9457c5db18d1639f1fdfb244476106 Author: John Baldwin AuthorDate: 2021-04-21 20:57:04 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:47:52 +0000 riscv: Clear SUM in SSTATUS for supervisor mode exceptions. Previously, a page fault taken during copyin/out and related functions would run the entire fault handler while permitting direct access to user addresses. This could also leak across context switches (e.g. if the page fault handler was preempted by an interrupt or slept for disk I/O). To fix, clear SUM in assembly after saving the original version of SSTATUS in the supervisor mode trapframe. Reviewed by: mhorne, jrtc27 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D29763 (cherry picked from commit 753bcca440a4d2c95f48536b586131b84c0bb87e) --- sys/riscv/riscv/exception.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S index 50134980c7af..abd1307174f1 100644 --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -104,6 +104,11 @@ __FBSDID("$FreeBSD$"); sd t0, (TF_SEPC)(sp) csrr t0, sstatus sd t0, (TF_SSTATUS)(sp) +.if \mode == 1 + /* Disable user address access for supervisor mode exceptions. */ + li t0, SSTATUS_SUM + csrc sstatus, t0 +.endif csrr t0, stval sd t0, (TF_STVAL)(sp) csrr t0, scause From nobody Tue Nov 23 23:48:55 2021 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 D8B66189168C; Tue, 23 Nov 2021 23:48:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzLSm0CS5z4n59; Tue, 23 Nov 2021 23:48:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB8EF1F9F6; Tue, 23 Nov 2021 23:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNmt2S077873; Tue, 23 Nov 2021 23:48:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNmtqj077872; Tue, 23 Nov 2021 23:48:55 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:48:55 GMT Message-Id: <202111232348.1ANNmtqj077872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 05504819e39d - stable/13 - riscv: Assert that SUM is not set in SSTATUS for exceptions. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05504819e39d12cbb0772f69e06ceb49a10fd580 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637711336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v96ome54zzjwZeADWBK8WiMDju4EpyUDvKvFC3O0WEM=; b=uy4R0ennhdmEjWsnN0K7AIu/cjsXfrFxb5HelxANZTTeCN5Cdc0hYULu0FNGijwRP0vhwe PK/gfmptD58oXkKwoMZQDUDWjGfgicUgaDuEOGO4A1KFypyy2bHtKPUhczjoC0/sgTk/ix Eme+alpwcS3kMwZxxzehWezh6l2Nro1F+DDUhbAQg0YiATZGtVgtdLlNtTgGDeeE2UlBde RhP8bGj4iCdgdHeV6ySE7pMXIOhLvVa1SjWGYTP5xdRFmZoWxixBKYA5WTHgr3dl9WwrP0 g6jNbZyZWeWeJ7PJeoO1wG+fRQdZNnCcC0kCOqFFUS0Z/+RPmjNfM4P/WEJrXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637711336; a=rsa-sha256; cv=none; b=SePCsFBMJGr7d7Qiy2yFtl6wim1JBiUBmG0uhvWbOs2BXyGpiRO5LZR67EJKRB500ZT//y JfTKMBGT28Zdo94q6AoJ/HSSPKH94GySxBMJXBIOQGDVu8Tz/CsP1/wW2z6O4buriZ4eLb RW3i7OKZvLOdPqUIXj8HClbEm4wXdvC6pfgflFROyYO/s6XwL/jUaiDV/MSEaK9u0ItKwl 26jZqwGKMS7Rcj9Unhh6ZvV1auMqH11wEyTb2Jge0QeiWm0iJyO+jii50z0WCunZnDJN6I IAgUNgm0AuKWcTU84TwR2Hj9iE4nqKdblEczal9Wj44wUX6/WDuoD4RHYTyqzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=05504819e39d12cbb0772f69e06ceb49a10fd580 commit 05504819e39d12cbb0772f69e06ceb49a10fd580 Author: John Baldwin AuthorDate: 2021-04-21 20:57:20 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:47:57 +0000 riscv: Assert that SUM is not set in SSTATUS for exceptions. Reviewed by: mhorne Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D29764 (cherry picked from commit 6a3a6fe34bf36b6e745b3e9ad1a991de057729c7) --- sys/riscv/riscv/trap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c index abf527b2ef13..d378bfe1383d 100644 --- a/sys/riscv/riscv/trap.c +++ b/sys/riscv/riscv/trap.c @@ -280,6 +280,9 @@ do_trap_supervisor(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == SSTATUS_SPP, ("Came from S mode with interrupts enabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SUM)) == 0, + ("Came from S mode with SUM enabled")); + exception = frame->tf_scause & SCAUSE_CODE; if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ @@ -348,6 +351,9 @@ do_trap_user(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, ("Came from U mode with interrupts enabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SUM)) == 0, + ("Came from U mode with SUM enabled")); + exception = frame->tf_scause & SCAUSE_CODE; if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ From nobody Tue Nov 23 23:48:56 2021 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 CE73E189147C; Tue, 23 Nov 2021 23:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzLSn31p3z4mrb; Tue, 23 Nov 2021 23:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D76A1F9F7; Tue, 23 Nov 2021 23:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNmufu077897; Tue, 23 Nov 2021 23:48:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNmup0077896; Tue, 23 Nov 2021 23:48:56 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:48:56 GMT Message-Id: <202111232348.1ANNmup0077896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c8c2d908dd47 - stable/13 - arm64, riscv: Fix TRAF_PC() to return the PC, not the return address. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8c2d908dd477d6413eaf1f788df88c73ae73c5b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637711337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4OompjYSN/2KqJHVos5IougF2nl2bpSs+GF9SdqwGzU=; b=jUE1KX7ErI/MDSB4AdHBiIYn8JoVcoy2XR7Fn2JYjcc2o0wWcUt2iaKCvs+MFkfI3VTnPy I5VgVZ1UUQNUDcibGRgENCxxxGszHCc4Q9paoMo25eFun5zmjd8lg5v4H1At9x7BjCKxv1 DfLXCVlcJNIvuRPmrqxDpGc0PKKSZKb2LQIvaKDdE/Dlg5h1hY6vq29SVBKde3iT9AOajl MJBNPV1sg98sDPr9VeHT4hQscfCUQWDxQPzq+vgL+jR3ZRRHWUOelxsS4XqJuMsgKXoVMy 80UO0mLHjdQnmDs+JpB7BKu2B/udW0yA+LH3mQd/CXgIpAupTLngar5BOcobUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637711337; a=rsa-sha256; cv=none; b=w5Nszqt6//f4lzM0HyCxQzaRwPASDUy/GnYFdWbygXK8gLcrQW2kU5pEWxL6FUTN2PfY+W 6OXuyewDw5i1/wm85tmYTaLxxz7dmTAa6ZKhu8n4CQhc7MpAo5f0cWp/SOHhJnv2lW4sM1 2TJt3+SbDno16hrPqDkd4yeLdS1kZlDOVwelykTvQmofr426699X1CaP9PvMk8so8338LZ bv77hzWb60A/8OzhLUuS5PwWZrET5apXVYKUKPMD8NlHh8B3KUzWHZOiG1dmVCFwCdCtpO G2IS/QEiIhwnzuHF6SwAiOe9m5YlQhkpcvB+AqFf2TvvZvHENchCTIuTcvRbpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c8c2d908dd477d6413eaf1f788df88c73ae73c5b commit c8c2d908dd477d6413eaf1f788df88c73ae73c5b Author: John Baldwin AuthorDate: 2021-10-01 18:53:12 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:48:07 +0000 arm64, riscv: Fix TRAF_PC() to return the PC, not the return address. Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D31969 (cherry picked from commit 0177102173f39e17366a32eb22653aeb5248c355) --- sys/arm64/include/cpu.h | 2 +- sys/riscv/include/cpu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 0b1aa2d93b03..c926372a0ec6 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -45,7 +45,7 @@ #include #include -#define TRAPF_PC(tfp) ((tfp)->tf_lr) +#define TRAPF_PC(tfp) ((tfp)->tf_elr) #define TRAPF_USERMODE(tfp) (((tfp)->tf_spsr & PSR_M_MASK) == PSR_M_EL0t) #define cpu_getstack(td) ((td)->td_frame->tf_sp) diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h index 79c6f730f2a6..453a6af1a0f8 100644 --- a/sys/riscv/include/cpu.h +++ b/sys/riscv/include/cpu.h @@ -41,7 +41,7 @@ #include #include -#define TRAPF_PC(tfp) ((tfp)->tf_ra) +#define TRAPF_PC(tfp) ((tfp)->tf_sepc) #define TRAPF_USERMODE(tfp) (((tfp)->tf_sstatus & SSTATUS_SPP) == 0) #define cpu_getstack(td) ((td)->td_frame->tf_sp) From nobody Wed Nov 24 08:30:16 2021 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 91B4A1896F1C; Wed, 24 Nov 2021 08:30:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzZ2T0S6nz4RkN; Wed, 24 Nov 2021 08:30:24 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1637742617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tYiEr10/6+7jno9c8vHWRPpN5+CSDeuoI/200KavUV0=; b=MOur7XlbaYcI9uiPa9YFpdX1XthTOxfKMz42FICeh6BOHKlDJJ/APE7D1hiK/nMgGSLeOG KpWoj5OKkjtM/+7fg9VJzm775SY3EFTDBlEJESo6/krPu5PJzzVeYUEdkcEXqzwhsPuzQz 76qiFgzXRp3+JCkZANX7Q8vbOE4Yc/8= Received: from skull.home.blih.net (lfbn-idf2-1-1163-183.w90-92.abo.wanadoo.fr [90.92.222.183]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 3ca87efe (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Nov 2021 08:30:17 +0000 (UTC) Date: Wed, 24 Nov 2021 09:30:16 +0100 From: Emmanuel Vadot To: freebsd@oldach.net (Helge Oldach) Cc: allanjude@freebsd.org (Allan Jude), src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features Message-Id: <20211124093016.e031bc2e2e935d1c67dbc0ae@bidouilliste.com> In-Reply-To: <202111231936.1ANJaeDT011754@nuc.oldach.net> References: <202111231936.1ANJaeDT011754@nuc.oldach.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HzZ2T0S6nz4RkN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, 23 Nov 2021 20:36:40 +0100 (CET) freebsd@oldach.net (Helge Oldach) wrote: > Allan Jude wrote on Tue, 23 Nov 2021 20:14:53 +0100 (CET): > > On 11/23/2021 5:00 AM, Helge Oldach wrote: > > > Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET): > > > Hmmm. On a RPi4/8G: > > > > > > Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6): > > > | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > > > | aes-256-gcm 35791.98k 38533.57k 39986.77k 41397.59k 39840.43k 39638.36k > > > > > > After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621) > > > > > > | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > > > | aes-256-gcm 21277.62k 23226.64k 23613.90k 23687.51k 23892.93k 23947.95k > > > > > > It seems that AES throughput is actually cut by almost half? > > > > Do you know which of the CPU optimizations your RPi4 supports? > > Is this what you need? > > Instruction Set Attributes 0 = So there is no AES+PMULL instruction set on RPI4, I guess that openssl uses them for aes-gcm. I wonder what it uses before that make it have this boost. On my rockpro64 I do see the improvement btw : root@generic:~ # cpuset -l 4,5 openssl speed -evp aes-256-gcm ... aes-256-gcm 122861.59k 337938.39k 565408.44k 661223.09k 709175.19k 712327.25k root@generic:~ # cpuset -l 4,5 env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm ... aes-256-gcm 34068.11k 38068.62k 39435.24k 39818.75k 39905.34k 39922.35k Running on the big cores at max freq. > Instruction Set Attributes 1 = <> > Processor Features 0 = > Processor Features 1 = <> > Memory Model Features 0 = > Memory Model Features 1 = <8bit VMID> > Memory Model Features 2 = <32bit CCIDX,48bit VA> > Debug Features 0 = > Debug Features 1 = <> > Auxiliary Features 0 = <> > Auxiliary Features 1 = <> > AArch32 Instruction Set Attributes 5 = > AArch32 Media and VFP Features 0 = > AArch32 Media and VFP Features 1 = > > > You can set the environment variable OPENSSL_armcap to override > > OpenSSL's detection. > > > > Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm > > On FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621 again (i.e. after this commit): > > hmo@p48 ~ $ env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm > Doing aes-256-gcm for 3s on 16 size blocks: 6445704 aes-256-gcm's in 3.08s > Doing aes-256-gcm for 3s on 64 size blocks: 1861149 aes-256-gcm's in 3.00s > Doing aes-256-gcm for 3s on 256 size blocks: 479664 aes-256-gcm's in 3.01s > Doing aes-256-gcm for 3s on 1024 size blocks: 122853 aes-256-gcm's in 3.04s > Doing aes-256-gcm for 3s on 8192 size blocks: 15181 aes-256-gcm's in 3.00s > Doing aes-256-gcm for 3s on 16384 size blocks: 7796 aes-256-gcm's in 3.07s > OpenSSL 1.1.1l-freebsd 24 Aug 2021 > built on: reproducible build, date unspecified > options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) > compiler: clang > The 'numbers' are in 1000s of bytes per second processed. > type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > aes-256-gcm 33504.57k 39704.51k 40825.01k 41394.83k 41454.25k 41601.52k > hmo@p48 ~ $ openssl speed -evp aes-256-gcm > Doing aes-256-gcm for 3s on 16 size blocks: 4066201 aes-256-gcm's in 3.00s > Doing aes-256-gcm for 3s on 64 size blocks: 1087387 aes-256-gcm's in 3.00s > Doing aes-256-gcm for 3s on 256 size blocks: 280110 aes-256-gcm's in 3.03s > Doing aes-256-gcm for 3s on 1024 size blocks: 70412 aes-256-gcm's in 3.04s > Doing aes-256-gcm for 3s on 8192 size blocks: 8762 aes-256-gcm's in 3.00s > Doing aes-256-gcm for 3s on 16384 size blocks: 4402 aes-256-gcm's in 3.02s > OpenSSL 1.1.1l-freebsd 24 Aug 2021 > built on: reproducible build, date unspecified > options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) > compiler: clang > The 'numbers' are in 1000s of bytes per second processed. > type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > aes-256-gcm 21686.41k 23197.59k 23656.30k 23725.04k 23926.10k 23916.23k > hmo@p48 ~ $ > > Kind regards, > Helge -- Emmanuel Vadot From nobody Wed Nov 24 14:22:10 2021 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 485B118957BB; Wed, 24 Nov 2021 14:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzjrL6Rs8z4Yj8; Wed, 24 Nov 2021 14:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEBDA33F1; Wed, 24 Nov 2021 14:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOEMA2O057823; Wed, 24 Nov 2021 14:22:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOEMA3v057822; Wed, 24 Nov 2021 14:22:10 GMT (envelope-from git) Date: Wed, 24 Nov 2021 14:22:10 GMT Message-Id: <202111241422.1AOEMA3v057822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: f1d2f22b34ab - stable/13 - pca954x: driver for PCA954x / TCA954x I2C switches 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f1d2f22b34ab6c7216fcc980c57b60d5ef8f21d2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637763731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ukstGtGWg1f5mdTI/yNII5iQw45syjs0lnud1PZrvSU=; b=FSNYJPFixxrqyrddAvPpXj4cGb68qspDWF67cGnB0dW1BLF21J1DV4SWsZJlOMVDeVZRzL Sj5Jl5S55iVKTcUKJ0JbiBomCaFDYbsDO7DzkXeMi5nm/6Eha9QUThaXzRoYlEyYAwuYII Nb8VcOcIMlMmNtZY3HZjMBwURP1cDt5p3dkiwIevspJ8yV8wOgsInwkHpsQUIVc5Zr7P1I FS7mnwZqB2Uq6zX4XFpsH3jn6aGxix1CmDNxkazUWhNxLWkZJyabrmpTlyGWcHsDIWiEIi ewsYXx8krPIDLp7yCwnCLP/anKfLcE/I4HY2DkaFRrP9fVtNEXrFtQpgcbpgsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637763731; a=rsa-sha256; cv=none; b=krhzQxfjPT0P1YJAeDccd0DffBtsEuEv1fw8TZYNB0IYq6suwTecCysLVu0hN1Qj5BS4tK tvN9A0EAklQ+8U3b7fxB08sRl4ml2Y0NMSa/Q1gcg3/LCZiufuzz7QS1pAdZn/Csk9RzbF WYZu6rxgRbyfN01IW9fUeaF3BnKXtcGNPCFKMt3H6AiwHxvLs2cNecLivLahBBPs0vC7t5 eoSOiaSnI6IwZWj9vkN9oRR7TcoRgdFwjGeDPLqVvzn83Cmn4sx/t29RB8k8nNhcdELzT4 hZiY6VjT+fA4LTPVy31RXAbmy+2wM/Hsfqs7bYmgxnUUQNEXfR5m7fcE0wNm4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=f1d2f22b34ab6c7216fcc980c57b60d5ef8f21d2 commit f1d2f22b34ab6c7216fcc980c57b60d5ef8f21d2 Author: Andriy Gapon AuthorDate: 2020-08-18 09:16:28 +0000 Commit: Andriy Gapon CommitDate: 2021-11-24 14:19:09 +0000 pca954x: driver for PCA954x / TCA954x I2C switches At the moment only PCA9548A is supported and has been tested. (cherry picked from commit c0525ab1d1ce69ab3d589e95733caedb04e0dcbd) --- share/man/man4/Makefile | 1 + share/man/man4/pca954x.4 | 119 +++++++++++++++++++ sys/conf/files | 1 + sys/dev/iicbus/mux/pca954x.c | 214 +++++++++++++++++++++++++++++++++++ sys/modules/i2c/mux/Makefile | 1 + sys/modules/i2c/mux/pca954x/Makefile | 20 ++++ 6 files changed, 356 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index e8c0a5651ff8..be66bf02e9f7 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -422,6 +422,7 @@ MAN= aac.4 \ owc.4 \ ${_padlock.4} \ pass.4 \ + pca954x.4 \ pccard.4 \ pccbb.4 \ pcf.4 \ diff --git a/share/man/man4/pca954x.4 b/share/man/man4/pca954x.4 new file mode 100644 index 000000000000..d845740f9b6c --- /dev/null +++ b/share/man/man4/pca954x.4 @@ -0,0 +1,119 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Andriy Gapon +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 13, 2021 +.Dt PCA954X 4 +.Os +.Sh NAME +.Nm pca954x +.Nd driver for PCA9548A I2C switch +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pca954x" +.Cd "device iicmux" +.Cd "device iicbus" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +pca954x_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports the PCA9548A I2C bus switch and compatible chips such as +TCA9548A. +It automatically connects an upstream I2C bus to one of several downstream +buses as needed when slave devices on the downstream buses initiate I/O. +More information on the automatic switching behavior is available in +.Xr iicmux 4 . +.Sh FDT CONFIGURATION +On an +.Xr FDT 4 +based system, an +.Nm +device node is defined as a child node of its upstream I2C bus. +The children of the +.Nm +node are additional I2C buses, which will have their own I2C slave +devices described in their child nodes. +.Pp +The +.Nm +driver attaches to nodes where the +.Va compatible +property is set to one of +.Bl -bullet +.It +.Qq nxp,pca9548 +.El +.Pp +The +.Nm +driver supports the following optional properties in addition to the standard +I2C mux properties: +.Bl -tag -width i2c-mux-idle-disconnect +.It Va i2c-mux-idle-disconnect +if defined, forces the switch to disconnect all children in idle state. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, these values are configurable for +.Nm : +.Bl -tag -width hint.pca954x..chip_type +.It Va hint.pca954x..at +The upstream +.Xr iicbus 4 +the +.Nm +instance is attached to. +.It Va hint.pca954x..chip_type +The type of the chip. +At present, only +.Qq pca9548 +is supported. +.El +.Pp +When configured via hints, the driver automatically adds an +.Xr iicbus 4 +instance for every downstream bus supported by the chip. +There is currently no way to indicate used versus unused channels. +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicmux 4 +.Sh HISTORY +The +.Nm +driver and this manual page was written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . diff --git a/sys/conf/files b/sys/conf/files index 5051a38b2997..3dc1caf8b53a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1884,6 +1884,7 @@ dev/iicbus/mux/iicmux.c optional iicmux dev/iicbus/mux/iicmux_if.m optional iicmux dev/iicbus/mux/iic_gpiomux.c optional iic_gpiomux fdt dev/iicbus/mux/ltc430x.c optional ltc430x +dev/iicbus/mux/pca954x.c optional pca954x dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus dev/iicbus/pcf8574.c optional pcf8574 diff --git a/sys/dev/iicbus/mux/pca954x.c b/sys/dev/iicbus/mux/pca954x.c new file mode 100644 index 000000000000..44c81539691e --- /dev/null +++ b/sys/dev/iicbus/mux/pca954x.c @@ -0,0 +1,214 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) Andriy Gapon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include +#include "iicbus_if.h" +#include "iicmux_if.h" +#include + +struct pca954x_descr { + const char *partname; + const char *description; + int numchannels; +}; + +static struct pca954x_descr pca9548_descr = { + .partname = "pca9548", + .description = "PCA9548A I2C Mux", + .numchannels = 8, +}; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + { "nxp,pca9548", (uintptr_t)&pca9548_descr }, + { NULL, 0 }, +}; +#else +static struct pca954x_descr *part_descrs[] = { + &pca9548_descr, +}; +#endif + +struct pca954x_softc { + struct iicmux_softc mux; + uint8_t addr; + bool idle_disconnect; +}; + +static int +pca954x_bus_select(device_t dev, int busidx, struct iic_reqbus_data *rd) +{ + struct iic_msg msg; + struct pca954x_softc *sc = device_get_softc(dev); + uint8_t busbits; + int error; + + /* + * The iicmux caller ensures busidx is between 0 and the number of buses + * we passed to iicmux_init_softc(), no need for validation here. If + * the fdt data has the idle_disconnect property we idle the bus by + * selecting no downstream buses, otherwise we just leave the current + * bus active. + */ + if (busidx == IICMUX_SELECT_IDLE) { + if (sc->idle_disconnect) + busbits = 0; + else + return (0); + } else { + busbits = 1u << busidx; + } + + msg.slave = sc->addr; + msg.flags = IIC_M_WR; + msg.len = 1; + msg.buf = &busbits; + error = iicbus_transfer(dev, &msg, 1); + return (error); +} + +static const struct pca954x_descr * +pca954x_find_chip(device_t dev) +{ +#ifdef FDT + const struct ofw_compat_data *compat; + + compat = ofw_bus_search_compatible(dev, compat_data); + if (compat == NULL) + return (NULL); + return ((const struct pca954x_descr *)compat->ocd_data); +#else + const char *type; + int i; + + if (resource_string_value(device_get_name(dev), device_get_unit(dev), + "chip_type", &type) == 0) { + for (i = 0; i < nitems(part_descrs) - 1; ++i) { + if (strcasecmp(type, part_descrs[i]->partname) == 0) + return (part_descrs[i]); + } + } + return (NULL); +#endif +} + +static int +pca954x_probe(device_t dev) +{ + const struct pca954x_descr *descr; + + descr = pca954x_find_chip(dev); + if (descr == NULL) + return (ENXIO); + + device_set_desc(dev, descr->description); + return (BUS_PROBE_DEFAULT); +} + +static int +pca954x_attach(device_t dev) +{ +#ifdef FDT + phandle_t node; +#endif + struct pca954x_softc *sc; + const struct pca954x_descr *descr; + int err; + + sc = device_get_softc(dev); + sc->addr = iicbus_get_addr(dev); +#ifdef FDT + node = ofw_bus_get_node(dev); + sc->idle_disconnect = OF_hasprop(node, "i2c-mux-idle-disconnect"); +#endif + + descr = pca954x_find_chip(dev); + err = iicmux_attach(dev, device_get_parent(dev), descr->numchannels); + if (err == 0) + bus_generic_attach(dev); + return (err); +} + +static int +pca954x_detach(device_t dev) +{ + int err; + + err = iicmux_detach(dev); + return (err); +} + +static device_method_t pca954x_methods[] = { + /* device methods */ + DEVMETHOD(device_probe, pca954x_probe), + DEVMETHOD(device_attach, pca954x_attach), + DEVMETHOD(device_detach, pca954x_detach), + + /* iicmux methods */ + DEVMETHOD(iicmux_bus_select, pca954x_bus_select), + + DEVMETHOD_END +}; + +static devclass_t pca954x_devclass; + +DEFINE_CLASS_1(pca9548, pca954x_driver, pca954x_methods, + sizeof(struct pca954x_softc), iicmux_driver); +DRIVER_MODULE(pca9548, iicbus, pca954x_driver, pca954x_devclass, 0, 0); + +#ifdef FDT +DRIVER_MODULE(ofw_iicbus, pca9548, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); +#else +DRIVER_MODULE(iicbus, pca9548, iicbus_driver, iicbus_devclass, 0, 0); +#endif + +MODULE_DEPEND(pca9548, iicmux, 1, 1, 1); +MODULE_DEPEND(pca9548, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(pca9548, 1); + +#ifdef FDT +IICBUS_FDT_PNP_INFO(compat_data); +#endif diff --git a/sys/modules/i2c/mux/Makefile b/sys/modules/i2c/mux/Makefile index 8e228a7a7fef..a972a00a3b3a 100644 --- a/sys/modules/i2c/mux/Makefile +++ b/sys/modules/i2c/mux/Makefile @@ -3,6 +3,7 @@ SUBDIR = \ iicmux \ ltc430x \ + pca954x \ .if !empty(OPT_FDT) SUBDIR+= iic_gpiomux diff --git a/sys/modules/i2c/mux/pca954x/Makefile b/sys/modules/i2c/mux/pca954x/Makefile new file mode 100644 index 000000000000..622b327204c5 --- /dev/null +++ b/sys/modules/i2c/mux/pca954x/Makefile @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus/mux + +KMOD= pca954x +SRCS= pca954x.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + iicbus_if.h \ + iicmux_if.h \ + opt_platform.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif + + +.include From nobody Wed Nov 24 15:55:50 2021 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 AE1AC18B1847; Wed, 24 Nov 2021 15:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzlwQ2wLkz3QD5; Wed, 24 Nov 2021 15:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4401E4BEE; Wed, 24 Nov 2021 15:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOFtosk078324; Wed, 24 Nov 2021 15:55:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOFtod5078323; Wed, 24 Nov 2021 15:55:50 GMT (envelope-from git) Date: Wed, 24 Nov 2021 15:55:50 GMT Message-Id: <202111241555.1AOFtod5078323@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: f69572733023 - stable/13 - Export symbols from opensolaris.ko and dtrace.ko 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: f69572733023aa8017bddc5bed24358d3bc14847 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637769350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GD/21h7dyyUrkk+r7BseuLpJNYueszJpF3ls5m0ZCbs=; b=YshPssfnM07lO7DvT8tJoFaAi05wDdNAlWeOWnAghFXRlzukMitz4Uxoa6fTy0r2G1eECA YQTwZSom/lkp4sTswgWIODiYdbMHE3uKxoBDo919x5/YDFcM9TKO/9aUVkNgqDY7X8C+So gf+Kz02yai7h6wuZtyuzpM0/IPCXPVX5jA1icLdH2IaILaydaNVsOaXJFUFxJ9TsAGwlwv XyUYMqDWEljimCODvazD4OQDyg8fb8YM1wYpw910ZPPKxU1ClF/reZdTuUXt2iOt63TXll Nd/kYjjCQroB07UiaNnWHVPW2O2EMieHUrdrhB0pCgHkud6PKm9RJvjsy9S7Ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637769350; a=rsa-sha256; cv=none; b=CLjOTuFlmL5bFlbeOIEVYiJXs3YQHboEBAaV41BP2kkmresnZbD2JtSMC2pswdu7iZOZNl Y7kYtrPyr4EIbQBeOIgNwwYc/bH8Mfv3mmsw7EoWhjTqLNDMl5+rzVuAWtEr7icA1RYcRq 6raQB9hMg8amxKEXoyzJTA1yT6GJQd7BxsGjloRmwGtrnUP15S2HjASnlWiyzfCQsqMILV KZYCwLLN6CCRp69qOes02P8jKtnwfsvUKkpxfGOeunnz8pM9erjsRzPihxn20mhYBvunDh zl+3kjOM2Q84vK+Emw5xQnRtlOu/JtO8BOKX3voaFpBKfXKDxw4hj280UvSQ9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f69572733023aa8017bddc5bed24358d3bc14847 commit f69572733023aa8017bddc5bed24358d3bc14847 Author: Mark Johnston AuthorDate: 2021-11-17 16:01:59 +0000 Commit: Mark Johnston CommitDate: 2021-11-24 15:55:37 +0000 Export symbols from opensolaris.ko and dtrace.ko Both modules provide many symbols used by various DTrace provider modules, so just export everything. Sponsored by: The FreeBSD Foundation (cherry picked from commit 8a693ccf86f90469910c5b2425ddb8a75e298487) --- sys/modules/dtrace/dtrace/Makefile | 4 +--- sys/modules/opensolaris/Makefile | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile index 55f9f4f66f36..712e10331a38 100644 --- a/sys/modules/dtrace/dtrace/Makefile +++ b/sys/modules/dtrace/dtrace/Makefile @@ -49,9 +49,7 @@ CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/common/util \ -I${SYSDIR} -DDIS_MEM -EXPORT_SYMS= dtrace_register \ - dtrace_unregister \ - dtrace_probe_lookup +EXPORT_SYMS= YES dtrace_asm.o: assym.inc diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile index 536b9637cd3c..7010485b0ee7 100644 --- a/sys/modules/opensolaris/Makefile +++ b/sys/modules/opensolaris/Makefile @@ -27,7 +27,7 @@ SRCS+= opensolaris_atomic.c CFLAGS+= ${OPENZFS_CFLAGS} -EXPORT_SYMS= cpu_core +EXPORT_SYMS= YES IGNORE_PRAGMA= 1 From nobody Wed Nov 24 16:03:50 2021 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 A0D0E18B46EA; Wed, 24 Nov 2021 16:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzm5f2Wfbz3hyn; Wed, 24 Nov 2021 16:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 365924E52; Wed, 24 Nov 2021 16:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOG3oBv092691; Wed, 24 Nov 2021 16:03:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOG3or8092690; Wed, 24 Nov 2021 16:03:50 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:03:50 GMT Message-Id: <202111241603.1AOG3or8092690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 615b3385c990 - stable/13 - top: Sort flags in usage message 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 615b3385c9906a2f476ff3962639c41b1c61b321 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637769830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bfth+NRKZ520kLYFg22kw69uwJG6H3eEwYgYfx/tzTo=; b=m0rqRRlHFSjcZ/quVOHGwDop+pCZh359Hs58uhoeIgoX5St/ZdRIgH5QSGnPqapK2CVMIv WG7BaWXDaMmMdgTGtWc3G88LGrCIzCnCACsudhYT5SB2pZAUaGA18sinJqltx9H9SCfWNA pLSmcdKdpAlgZ9I6VXnP7gKVBnPfnFN3toXND4cNbyppk5jbU/GZ5PZOVlC7lLy9YStnWF irdnwqpVIacgXuAwZ0mDvqVelsEUpVn4jz81P2bCzLj20XO9a2porImSe+EB3SU89oA4jr 2K+EppflY98rgAnan1oz1xZ9gYwlCYzLQzdU74uan/uYWylfgU5z8seQJ2UMOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637769830; a=rsa-sha256; cv=none; b=gwTgzxCQXjv0/aKNHcfeMidVp2QSGQT6e5Dqv3cOM7s6jurj3nQzKU8Jn3yUHeD6iaSAHU dsU+RUmE4/9AnMbJYePtgRffkw7ytJyQu52uHTA6rtSLZNQRSCw+W4Ff2Jm5K8SICND9el SrfIezvJySkaIoAXUh8BrJTuUZL/TXgCtHLZSSiPzcuQsNcAloo4n28Ac0CIn7hwjaLNLh VqHXu7abvOEBI6qcWazqZf+Hk2b+SNYQzcKKhfUR26YrQv8nmMMsbS7hDvm1dckTAfhTTJ C3ko9f5lz63Yx8T1zKUEEnrO6me3mDRw4PLUp7qK0Vlt5SxtxdD1J03tHlS+0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=615b3385c9906a2f476ff3962639c41b1c61b321 commit 615b3385c9906a2f476ff3962639c41b1c61b321 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 13:21:34 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:03:37 +0000 top: Sort flags in usage message While here, fix the indentation of the second line in the message. MFC after: 3 days (cherry picked from commit 82d0f865ee9a93213876c14342b147e31b7ade0d) --- usr.bin/top/top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 08248911e99a..68b7bdf1dfb5 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -465,8 +465,8 @@ main(int argc, const char *argv[]) default: errx(1, -"[-abCHIijnPqStuvwz] [-d count] [-m io | cpu] [-o field] [-p pid]\n" -" [-s time] [-J jail] [-U username] [number]"); +"[-abCHIijnPqStuvwz] [-d count] [-J jail] [-m cpu | io] [-o field]\n" +" [-p pid] [-s time] [-U username] [number]"); } } From nobody Wed Nov 24 16:04:45 2021 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 C714718B4D4E; Wed, 24 Nov 2021 16:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzm6j39F3z3j4H; Wed, 24 Nov 2021 16:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C8D74768; Wed, 24 Nov 2021 16:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOG4j4R092860; Wed, 24 Nov 2021 16:04:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOG4jR0092859; Wed, 24 Nov 2021 16:04:45 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:04:45 GMT Message-Id: <202111241604.1AOG4jR0092859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6d20d6e5d887 - stable/12 - top: Sort flags in usage message 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6d20d6e5d887221d8b5cfd6322995560add6b999 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637769885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dfyBXSI4X2GGhADrYJZ07Dedd8+ItFYqqptwcxqsQwg=; b=ppHH+NFKhbOkKvpTwolFGa1pmjKYZ5J/wLAp3JWeZSoJnyG2eAQ6lDWeftwKorbgd92LR4 pp1jPeM8nl+oFAhFU7Bbe+TkPCiaRFIzxP4A2ryLetKyK8yeenxTxFtDZ3eBkgVL9y6pv9 Fo2hQ3Ha8ewXdxYmh4Jtg7V0J3q8sjxAJr+NFPWdwOS+u0SmhoQCIzFownITj2vUUB5ZZP E+7X6U08vBRJguNCej5Cl4VZE4Ka1t6m0NwsX2hYZ6Y39y8qWk1D3qPDTnc5Y4RgekSAqV mxl4BGonAbb2unwWL0CdYDECjPYY4SMl3T2T8CTF7f+dOd835wjP/Do8vk0+lA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637769885; a=rsa-sha256; cv=none; b=n8AVsPHM+Hf2MlIsBvDhOn3hOZgAgTxrMqfelhBJCcKqD29KaUNtKvMBdQ4RUs2UXczScX 5ysDIqRsjMZjZ7pGALkCLMVrY5LIuTkWHpGVY/X9gtoetVCcOwDDU2SyJ7Ynxi/dUuWJ6p Ugd6FE3Ak+sGMb6takZtmHZVHUR+r4FnoiVeYgi2U7a1tb3/PgYSsHBMU6Jl0kneF06riw q8uAqx41VlpP0LuQl2Fen/NEtit6fZ4dpLeBWqvK/vAeaFwUNVJfJpLNjOd9Xh7mY60SJ5 8ayzix4CZ9E+Rygcie0VQgupfk+I6cYuxUf9+GEcRyKzNUA4o8IZ2VJ5Esuzew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6d20d6e5d887221d8b5cfd6322995560add6b999 commit 6d20d6e5d887221d8b5cfd6322995560add6b999 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 13:21:34 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:04:15 +0000 top: Sort flags in usage message While here, fix the indentation of the second line in the message. MFC after: 3 days (cherry picked from commit 82d0f865ee9a93213876c14342b147e31b7ade0d) --- usr.bin/top/top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 4b624aacb6b0..50e199ba71d0 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -459,8 +459,8 @@ main(int argc, const char *argv[]) default: errx(1, -"[-abCHIijnPqStuvwz] [-d count] [-m io | cpu] [-o field] [-p pid]\n" -" [-s time] [-J jail] [-U username] [number]"); +"[-abCHIijnPqStuvwz] [-d count] [-J jail] [-m cpu | io] [-o field]\n" +" [-p pid] [-s time] [-U username] [number]"); } } From nobody Wed Nov 24 16:11:20 2021 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 3502218900EA; Wed, 24 Nov 2021 16:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGJ6nNRz3lQV; Wed, 24 Nov 2021 16:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8D844AF4; Wed, 24 Nov 2021 16:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBKhY001769; Wed, 24 Nov 2021 16:11:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBKhv001768; Wed, 24 Nov 2021 16:11:20 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:20 GMT Message-Id: <202111241611.1AOGBKhv001768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: cd66a1b1c8c5 - stable/13 - top.1: Sort options alphabetically 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cd66a1b1c8c5afb995e13534e4c818a5df78013e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vca5WgUMD3B9RmZ6oqY1NsrgJ66b/Ir9mOMgprYPeFQ=; b=ou0m72xxHeIUKMHqWiLi/CvUQdJ6U0WnDKMDMHU4sbfU+goqlFkpEGL+GGfTIzO/IgGHQ2 LLCLgYf2jZ6ljdbB2di5x4G/Lnm6O17Z5lSrpsRv+TMYjXE5dJN8uIJahYZqc+HniCrx62 MHM7/xxJqP06e/HIg8W1Y7C81Jg6WsG1UwshiDJFqqCmadtlKrdnmrHjfJCSWqh9qhS5f2 ilXh/Z3QIuzU2BrBkaqbs7gSnFBzVYGgbEtflws3KUiWjr84fHjsl5JRf0Y3Y9bodxm6BO 4Ymvnil0ihlzBhg7+xB9YWWxL7L1vzApv6/c5tqGT49NobXl710B/HrVznUnFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770281; a=rsa-sha256; cv=none; b=uaERJpfciqH3vDwVFcKxQJxAPtMEBfaP1abC+7EnziMkoAen1GPMHsRtbq4LPMDGDfaC4T PMryA3tWzSYcQhzsbB9zXuRdMt+/tG/tUwjirlssYzrkxD3Zz9UclbFFITI5l6XlWZhrva p8TYIlFvqgoU7L4qzDi/zH2diYlQL20gC/HYu9pvY4y+NjWr71RVf4hxKkpojvppDcVMB6 F8yF0pXfQfMltdMG2hQJlY5kILG+RTuPSdX8xZDyxE+jANwvkqZkKy6iY+kky29QnLTq7X ciNLa8Yh27v3HbRlmN+8r4sIkyziPxnkOZ4pGuSKv78b4pe644cTNlsNLPc2CQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cd66a1b1c8c5afb995e13534e4c818a5df78013e commit cd66a1b1c8c5afb995e13534e4c818a5df78013e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 13:11:23 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:07:02 +0000 top.1: Sort options alphabetically While here, add a short sentence introducing the options. MFC after: 3 days (cherry picked from commit 112539041590259a9d1e34999a80dc607c69f4db) --- usr.bin/top/top.1 | 155 +++++++++++++++++++++++++++--------------------------- 1 file changed, 77 insertions(+), 78 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index 42282bebdafe..f435cfe5e206 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -7,14 +7,14 @@ .Nd display and update information about the top cpu processes .Sh SYNOPSIS .Nm -.Op Fl CHIPSTabijnpqtuvxz -.Op Fl J Ar jail -.Op Fl U Ar uid +.Op Fl abCHIijnPpqSTtuvxz .Op Fl d Ar count +.Op Fl J Ar jail .Op Fl m Ar cpu|io -.Op Fl s Ar time .Op Fl o Ar field .Op Fl p Ar pid +.Op Fl s Ar time +.Op Fl U Ar uid .Op Ar number .Sh DESCRIPTION .Nm @@ -43,22 +43,9 @@ If the output of .Nm is redirected to a file, it acts as if it were being run on a dumb terminal. -.Bl -tag -width indent -compact -.It Fl C -Toggle CPU display mode. -By default top displays the weighted CPU percentage in the WCPU column -(this is the same value that -.Xr ps 1 -displays as CPU). -Each time -.Fl C -flag is passed it toggles between \*(lqraw cpu\*(rq mode -and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or -the \*(lqWCPU\*(rq column respectively. -.It Fl S -Show system processes in the display. -Normally, system processes such as the pager and the swapper are not shown. -This option makes them visible. +.Pp +The options are as follows: +.Bl -tag -width indent .It Fl a Display command names derived from the argv[] vector, rather than real executable name. @@ -75,9 +62,34 @@ In this mode, all input from the terminal is ignored. Interrupt characters (such as ^C and ^\e) still have an effect. This is the default on a dumb terminal, or when the output is not a terminal. +.It Fl C +Toggle CPU display mode. +By default top displays the weighted CPU percentage in the WCPU column +(this is the same value that +.Xr ps 1 +displays as CPU). +Each time +.Fl C +flag is passed it toggles between \*(lqraw cpu\*(rq mode +and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or +the \*(lqWCPU\*(rq column respectively. +.It Fl d Ar count +Show only +.Ar count +displays, then exit. +A display is considered to be one update of the +screen. +The default is 1 for dumb terminals. +Note that for +.Ar count += 1 +no information is available about the percentage of time spent by the CPU in every state. .It Fl H Display each thread for a multithreaded process individually. By default a single summary line is displayed for each process. +.It Fl I +Do not display idle processes. +By default, top displays both active and idle processes. .It Fl i Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately @@ -90,19 +102,23 @@ screen will immediately be updated, even if the command was not understood. This mode is the default when standard output is an intelligent terminal. -.It Fl I -Do not display idle processes. -By default, top displays both active and idle processes. +.It Fl J Ar jail +Show only those processes owned by +.Ar jail . +This may be either the +.Ar jid +or +.Ar name +of the jail. +Use +0 +to limit to host processes. +Using this option implies +.Fl j . .It Fl j Display the .Xr jail 8 ID. -.It Fl T -Toggle displaying thread ID (tid) instead of process id (pid). -.It Fl t -Do not display the -.Nm -process itself. .It Fl m Ar display Display either 'cpu' or 'io' statistics. Default is 'cpu'. @@ -110,8 +126,19 @@ Default is 'cpu'. Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq mode. +.It Fl o Ar field +Sort the process display area on the specified field. +The field name +is the name of the column as seen in the output, but in lower case: +\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq, +\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq, +\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq, +\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq. .It Fl P Display per-cpu CPU usage statistics. +.It Fl p Ar pid +Show only the process +.Ar pid . .It Fl q Renice .Nm @@ -119,6 +146,26 @@ to -20 so that it will run faster. This can be used when the system is being very sluggish to improve the possibility of discovering the problem. This option can only be used by root. +.It Fl S +Show system processes in the display. +Normally, system processes such as the pager and the swapper are not shown. +This option makes them visible. +.It Fl s Ar time +Set the delay between screen updates to +.Ar time +seconds, which may be fractional. +The default delay between updates is 1 second. +.It Fl T +Toggle displaying thread ID (tid) instead of process id (pid). +.It Fl t +Do not display the +.Nm +process itself. +.It Fl U Ar username +Show only those processes owned by +.Ar username . +This option currently only accepts usernames and will not understand +uid numbers. .It Fl u Do not map uid numbers to usernames. Normally, @@ -133,52 +180,6 @@ Write version number information to stderr then exit immediately. Display approximate swap usage for each process. .It Fl z Do not display the system idle process. -.It Fl d Ar count -Show only -.Ar count -displays, then exit. -A display is considered to be one update of the -screen. -The default is 1 for dumb terminals. -Note that for -.Ar count -= 1 -no information is available about the percentage of time spent by the CPU in every state. -.It Fl s Ar time -Set the delay between screen updates to -.Ar time -seconds, which may be fractional. -The default delay between updates is 1 second. -.It Fl o Ar field -Sort the process display area on the specified field. -The field name -is the name of the column as seen in the output, but in lower case: -\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq, -\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq, -\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq, -\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq. -.It Fl p Ar pid -Show only the process -.Ar pid . -.It Fl J Ar jail -Show only those processes owned by -.Ar jail . -This may be either the -.Ar jid -or -.Ar name -of the jail. -Use -0 -to limit to host processes. -Using this option implies -.Fl j . -.Pp -.It Fl U Ar username -Show only those processes owned by -.Ar username . -This option currently only accepts usernames and will not understand -uid numbers. .El .Pp Both @@ -238,9 +239,7 @@ Quit .Nm .It d Change the number of displays to show (prompt for new number). -Remember that the next display counts as one, so typing -.It d1 -will make +Remember that the next display counts as one, so typing 'd1' will make .Nm show one final display and then immediately exit. .It / From nobody Wed Nov 24 16:11:21 2021 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 AB0A91890075; Wed, 24 Nov 2021 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGL25JVz3lDv; Wed, 24 Nov 2021 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E9A94D64; Wed, 24 Nov 2021 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBLnt001846; Wed, 24 Nov 2021 16:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBL5g001839; Wed, 24 Nov 2021 16:11:21 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:21 GMT Message-Id: <202111241611.1AOGBL5g001839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5f3b6ce64f99 - stable/13 - top.1: Fix a typo in description of H interactive command 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f3b6ce64f99b110f2ba7595c7d680b843efc3e8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cnpMdfKmUDDLo+ZCbYaTxAXEHknC1PXL4luJYvu7mkU=; b=ACxEVt2oBUSkYF5IJx8SFhvI8naF78y0fvbYmYjrMg5lQFVErRBamBx0OxnKoNt+auagCy 3iRfTE7vmUfYHXXNjVkq31j1K4FhMb3rGffCfS8+QKvQM7PIuSO2wyoucCCYwBEzEx8TQF V11GWb26hXPZQZIxAiIexy4naU5aWYih8ldvOIYQ80jadh4V2shnE28csF/J5pNi5utKF4 YwJOb+VgZ1QefUdJV/0DtsterUDeYvI2ZBj/rn7x/4p5hi56uSB5wi4+PD1+11cyx9Lav6 ZxixxVD01bmfw+Iuj+f6Cv/VgjS3t1DEiabvtpNyVYLhaMxSEqrdjFlleeytwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770282; a=rsa-sha256; cv=none; b=b176pc7Es3GTOAjfzQkaqt7kflffBSlml4jl80CoWIBnA9+P4/AOxzg8LHio4DwW0EaHC/ baUzqSYIjVaKzXD4AkdVHFpJSqI/OwbUsetj6o607W/v+4BuHvWXLotXZtQt7jNO/TFuYq sStQWBz3YXg4Wbk9eQ5NsswAhco+YajuymmTqxoPY+wx1jC7qp+8anuMy0LqzDf+egvx9+ hOz+cAqbsbvRxKoR+WZ/BPoFIDaL1XEDDeFS/++/xwd4MwtJ2t2nLIC2IzfXPzhQiPPbhW h0PsJv4hEP7JvErl0fUnM3J1eLZBLs054Gi6qqFJIKloh7XgF5YhBW0YjNJeVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5f3b6ce64f99b110f2ba7595c7d680b843efc3e8 commit 5f3b6ce64f99b110f2ba7595c7d680b843efc3e8 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 12:50:56 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:09:31 +0000 top.1: Fix a typo in description of H interactive command B is listed as an interactive command to toggle the display of threads. This is a typo introduced during the conversion of the manual page to mdoc. Fixes: 9d6cce02a78c967e69b603d503545c4b43d7765f MFC after: 3 days (cherry picked from commit b8135ed67ce86e40fa7b46653ff54c769f2e7c98) --- usr.bin/top/top.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index f435cfe5e206..5989831fe8a9 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd September 21, 2019 +.Dd November 18, 2021 .Dt TOP 1 .Os .Sh NAME @@ -286,7 +286,7 @@ If the pid specified is simply \*(lq+\*(rq, then show all processes. .It e Display a list of system errors (if any) generated by the last command. -.It B H +.It H Toggle the display of threads. .It i or I Toggle the display of idle processes. From nobody Wed Nov 24 16:11:21 2021 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 A6EBD18900F8; Wed, 24 Nov 2021 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGL2WlKz3ldv; Wed, 24 Nov 2021 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20E994C6E; Wed, 24 Nov 2021 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBLqh001886; Wed, 24 Nov 2021 16:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBL05001885; Wed, 24 Nov 2021 16:11:21 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:21 GMT Message-Id: <202111241611.1AOGBL05001885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a9bfcefbdb6b - stable/12 - top.1: Sort options alphabetically 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a9bfcefbdb6bc58949292c505aad98b35d57c897 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u3q87qqiPqeG8KhiD9eGdo54DD7+LDYMjA+ql7y2KPE=; b=MTkreNrSQ674Wu/k63gkIKESvDmrBhzmvTN6/YUfETVpMeYtcTDgTYSrn23zvnYjU+cmUR 2+XD/bdaA265fmhP+4UUTep78jQ8WRvT5IbhrqIIaUUQ3/aRC8JOzbgxp5EP6176F8zU4g UsigXsYuiak6OJNyk9kM8KUBLL8YXlh/fGWyxHSQ0yuZnlNqm751pt8wxglFS0uF8KSiBo 5figeflGGmLAOb1K4RehcvxhLSDRNBzQI/Avd5GMLQg/rpMMX1yTwZV4P5ENbpnB2JX+w6 V3V0JoqADQxLg9I8o+swRRxSq9XdDVlUnEaVbPpPVqitVQLon502ZLXS8T6kMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770282; a=rsa-sha256; cv=none; b=FwcRV8l2cMpx+pRwFCxfK5wrhnubS9yUeyAPVFKUs8TCQSVy6ZmqBwQF+xMoCShXBMiIDP 44w4FQbK+uQtrfp2EFOvuUNHeVw8gASKVgIoBN+hW/eFuuHyIMmem5BX6ZWBJe0QYYvxkj g7gUAY2uM02OTRGtbPLvQ0g0nbTs+vk5TdAo3WDWpmsk6wc1vfXMccOM35DHce4Mtngw5/ e+004XD6tQY5pPAPHdnPGt/coTiNFnqkCpXKg5cqmUhaw5LAKuNhBeKubeSZhaFl0motL3 IG+rUC3JCQIu853FLjlWXzFupMf+xNKiSkpqOh2YvJLaGSRYohrMteBBTOmphA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a9bfcefbdb6bc58949292c505aad98b35d57c897 commit a9bfcefbdb6bc58949292c505aad98b35d57c897 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 13:11:23 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:07:12 +0000 top.1: Sort options alphabetically While here, add a short sentence introducing the options. MFC after: 3 days (cherry picked from commit 112539041590259a9d1e34999a80dc607c69f4db) --- usr.bin/top/top.1 | 155 +++++++++++++++++++++++++++--------------------------- 1 file changed, 77 insertions(+), 78 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index 104b979abd00..e70c3c022d43 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -7,14 +7,14 @@ .Nd display and update information about the top cpu processes .Sh SYNOPSIS .Nm -.Op Fl CHIPSTabijnpqtuvxz -.Op Fl J Ar jail -.Op Fl U Ar uid +.Op Fl abCHIijnPpqSTtuvxz .Op Fl d Ar count +.Op Fl J Ar jail .Op Fl m Ar cpu|io -.Op Fl s Ar time .Op Fl o Ar field .Op Fl p Ar pid +.Op Fl s Ar time +.Op Fl U Ar uid .Op Ar number .Sh DESCRIPTION .Nm @@ -43,22 +43,9 @@ If the output of .Nm is redirected to a file, it acts as if it were being run on a dumb terminal. -.Bl -tag -width indent -compact -.It Fl C -Toggle CPU display mode. -By default top displays the weighted CPU percentage in the WCPU column -(this is the same value that -.Xr ps 1 -displays as CPU). -Each time -.Fl C -flag is passed it toggles between \*(lqraw cpu\*(rq mode -and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or -the \*(lqWCPU\*(rq column respectively. -.It Fl S -Show system processes in the display. -Normally, system processes such as the pager and the swapper are not shown. -This option makes them visible. +.Pp +The options are as follows: +.Bl -tag -width indent .It Fl a Display command names derived from the argv[] vector, rather than real executable name. @@ -72,9 +59,34 @@ In this mode, all input from the terminal is ignored. Interrupt characters (such as ^C and ^\e) still have an effect. This is the default on a dumb terminal, or when the output is not a terminal. +.It Fl C +Toggle CPU display mode. +By default top displays the weighted CPU percentage in the WCPU column +(this is the same value that +.Xr ps 1 +displays as CPU). +Each time +.Fl C +flag is passed it toggles between \*(lqraw cpu\*(rq mode +and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or +the \*(lqWCPU\*(rq column respectively. +.It Fl d Ar count +Show only +.Ar count +displays, then exit. +A display is considered to be one update of the +screen. +The default is 1 for dumb terminals. +Note that for +.Ar count += 1 +no information is available about the percentage of time spent by the CPU in every state. .It Fl H Display each thread for a multithreaded process individually. By default a single summary line is displayed for each process. +.It Fl I +Do not display idle processes. +By default, top displays both active and idle processes. .It Fl i Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately @@ -87,19 +99,23 @@ screen will immediately be updated, even if the command was not understood. This mode is the default when standard output is an intelligent terminal. -.It Fl I -Do not display idle processes. -By default, top displays both active and idle processes. +.It Fl J Ar jail +Show only those processes owned by +.Ar jail . +This may be either the +.Ar jid +or +.Ar name +of the jail. +Use +0 +to limit to host processes. +Using this option implies +.Fl j . .It Fl j Display the .Xr jail 8 ID. -.It Fl T -Toggle displaying thread ID (tid) instead of process id (pid). -.It Fl t -Do not display the -.Nm -process itself. .It Fl m Ar display Display either 'cpu' or 'io' statistics. Default is 'cpu'. @@ -107,8 +123,19 @@ Default is 'cpu'. Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq mode. +.It Fl o Ar field +Sort the process display area on the specified field. +The field name +is the name of the column as seen in the output, but in lower case: +\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq, +\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq, +\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq, +\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq. .It Fl P Display per-cpu CPU usage statistics. +.It Fl p Ar pid +Show only the process +.Ar pid . .It Fl q Renice .Nm @@ -116,6 +143,26 @@ to -20 so that it will run faster. This can be used when the system is being very sluggish to improve the possibility of discovering the problem. This option can only be used by root. +.It Fl S +Show system processes in the display. +Normally, system processes such as the pager and the swapper are not shown. +This option makes them visible. +.It Fl s Ar time +Set the delay between screen updates to +.Ar time +seconds, which may be fractional. +The default delay between updates is 1 second. +.It Fl T +Toggle displaying thread ID (tid) instead of process id (pid). +.It Fl t +Do not display the +.Nm +process itself. +.It Fl U Ar username +Show only those processes owned by +.Ar username . +This option currently only accepts usernames and will not understand +uid numbers. .It Fl u Do not map uid numbers to usernames. Normally, @@ -130,52 +177,6 @@ Write version number information to stderr then exit immediately. Display approximate swap usage for each process. .It Fl z Do not display the system idle process. -.It Fl d Ar count -Show only -.Ar count -displays, then exit. -A display is considered to be one update of the -screen. -The default is 1 for dumb terminals. -Note that for -.Ar count -= 1 -no information is available about the percentage of time spent by the CPU in every state. -.It Fl s Ar time -Set the delay between screen updates to -.Ar time -seconds, which may be fractional. -The default delay between updates is 1 second. -.It Fl o Ar field -Sort the process display area on the specified field. -The field name -is the name of the column as seen in the output, but in lower case: -\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq, -\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq, -\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq, -\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq. -.It Fl p Ar pid -Show only the process -.Ar pid . -.It Fl J Ar jail -Show only those processes owned by -.Ar jail . -This may be either the -.Ar jid -or -.Ar name -of the jail. -Use -0 -to limit to host processes. -Using this option implies -.Fl j . -.Pp -.It Fl U Ar username -Show only those processes owned by -.Ar username . -This option currently only accepts usernames and will not understand -uid numbers. .El .Pp Both @@ -235,9 +236,7 @@ Quit .Nm .It d Change the number of displays to show (prompt for new number). -Remember that the next display counts as one, so typing -.It d1 -will make +Remember that the next display counts as one, so typing 'd1' will make .Nm show one final display and then immediately exit. .It / From nobody Wed Nov 24 16:11:23 2021 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 E4DE2189007A; Wed, 24 Nov 2021 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGM2zFTz3lQn; Wed, 24 Nov 2021 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27B474C70; Wed, 24 Nov 2021 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBNPW001932; Wed, 24 Nov 2021 16:11:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBNrY001925; Wed, 24 Nov 2021 16:11:23 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:23 GMT Message-Id: <202111241611.1AOGBNrY001925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 745ffe0ee867 - stable/13 - top.1: Improve description of -m 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 745ffe0ee86751541867e90af262ac355d061827 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U1rnFK7SZKs3XuFi+uLUNLTzUwE176arptBBtZhEmp0=; b=XENs9Ik2VjHjM4BW/T2ObFkEuHPGw4XMy8JqZoPss60ns2P+rcZvMTiF+Se62/AA9gvD9L eeSKoIXazfURYz6l8N4MqAf4iDSeOxYtJtbx1YrvfGvgnk8IqN0kDZJZ7veRBg19SMyaFC 0LOPUCfjDUk2G36mUT34qevTF8HI8/kIivdJYPKvFBXi/5fgv2NxkW8kVqWUKh68QAqeql ep87QBcPja8sLxQ1rih0prxBXaMs+vw1QBn1Sipzumr8GBEqh+bC39QMtIqTVSKXhdkEYX umBeW4apGWqhfFHQkGPobX8+GTAfNy7OnV2iyKKnZe1oiHlHfXrExoQLWnZXkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770283; a=rsa-sha256; cv=none; b=lE8rsfBwBH94iaNBAuQqXO36fNmrxcHuI2O1qFlDhcpbZOwAkU22OrvQsiDmsRfgaNk5FW hGjNSp3L5tSQgYMy/zGZbjj7Y62FR0SQHrfKzlb/SHE43Yyg23ohXS88XnUAYBd052n0UK xRqgBqSklVNmJG3VHtk1HdyaTC65G4mvetw1u/u0s0fFFWvcFBX4bpcyqUNRi3cIyFtWtj unXGgnueHPOm5JHB67aq9G98T0WA0dObZUc1ld288l1hJ10YHNR979S0hDSkW2l8DH03ge S1N92u5Ex0wuFBOpGrwQMhd2UmFa4a6A7PB4l1ouN4zeJ0otff7lBlVTf+yeqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=745ffe0ee86751541867e90af262ac355d061827 commit 745ffe0ee86751541867e90af262ac355d061827 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 14:31:48 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:10:04 +0000 top.1: Improve description of -m Describe -m argument as "mode" instead of "display". MFC after: 3 days (cherry picked from commit c947fc5fae31c5935a57abcaa76f40fc8950ce59) --- usr.bin/top/top.1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index 5989831fe8a9..892ee8307e27 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -10,7 +10,7 @@ .Op Fl abCHIijnPpqSTtuvxz .Op Fl d Ar count .Op Fl J Ar jail -.Op Fl m Ar cpu|io +.Op Fl m Ar mode .Op Fl o Ar field .Op Fl p Ar pid .Op Fl s Ar time @@ -119,9 +119,15 @@ Using this option implies Display the .Xr jail 8 ID. -.It Fl m Ar display -Display either 'cpu' or 'io' statistics. -Default is 'cpu'. +.It Fl m Ar mode +Display statistics in the specified +.Ar mode . +Available modes are +.Cm cpu +and +.Cm io . +Default is +.Cm cpu . .It Fl n Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq From nobody Wed Nov 24 16:11:23 2021 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 1C9EB18B7F55; Wed, 24 Nov 2021 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGM43Djz3lBg; Wed, 24 Nov 2021 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3045A4D67; Wed, 24 Nov 2021 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBNSw001933; Wed, 24 Nov 2021 16:11:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBN2Y001931; Wed, 24 Nov 2021 16:11:23 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:23 GMT Message-Id: <202111241611.1AOGBN2Y001931@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 14454e662a6b - stable/12 - top.1: Fix a typo in description of H interactive command 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 14454e662a6b3fd6e4b4cf2261132efd6dd231d3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nq5RLqdcVvkyKbY52cSYTL304wF6B7pdpryi3lYU9zY=; b=SFGHIcSAsjrmQ41uaCxWVaZbriFy2RsVEVjgls86LR/OoDVZXBuC07hHVn9jQgNzhdZCTy SBAYZqJDB2ov+btpw9H4VQ55eMPvgth0vB9FfXSJ76MqGdDqLMAHtEXDWicJ99zMQ8XBcD MMJjYCHg98CY26U2kVPjsZS3xhmvOZC3TXcnzwPjtQdOyepNggZyvNzYJ+2dejr4jEQosc 2srW3N0gTJPmnvjumM+sSPCxk6yXSUEOp+NC60gda7o7VKDiWdF0/aaoDEG4zvad+Voplt ubBnBicCVOsriHvI1m4iTka479Zmx+tvyj+Y0Z6dYTXzZ2wo42qaW9wQ59lKdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770283; a=rsa-sha256; cv=none; b=IJznkC5HuamHcX5zMPhkxbALcnEOM8Z2LLN6XgCv3ndwio9NSUhyRtluNaudIcMlwnpDBQ uwJtcg8JdQKiqGYiCKsBsScNi3VcNXUrHONraK2C1bUddBLH9XJLD5x+pyVWPR9+kajZse G6E18ENK+t3eiEoGbV1oCIRwWcWSJu2q6kA4ivmLVnp9+VipYGk3IlISrSoqveJ2T+0+QQ GIsxv0ff4CVHd4dtCTpAzr5aB609Wx2GtnfjWCSf8j+94Od+2sz6WOKGvd99EdAtXz1VtA Q1Q+XNJfBtomYiZoUdVi2Jl1KDvRVegCvRLuAM85rHUG47Nb3Jl0pCv1oPjGAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=14454e662a6b3fd6e4b4cf2261132efd6dd231d3 commit 14454e662a6b3fd6e4b4cf2261132efd6dd231d3 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 12:50:56 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:09:02 +0000 top.1: Fix a typo in description of H interactive command B is listed as an interactive command to toggle the display of threads. This is a typo introduced during the conversion of the manual page to mdoc. Fixes: 9d6cce02a78c967e69b603d503545c4b43d7765f MFC after: 3 days (cherry picked from commit b8135ed67ce86e40fa7b46653ff54c769f2e7c98) --- usr.bin/top/top.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index e70c3c022d43..1f0be330ddc8 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd October 2, 2018 +.Dd November 18, 2021 .Dt TOP 1 .Os .Sh NAME @@ -283,7 +283,7 @@ If the pid specified is simply \*(lq+\*(rq, then show all processes. .It e Display a list of system errors (if any) generated by the last command. -.It B H +.It H Toggle the display of threads. .It i or I Toggle the display of idle processes. From nobody Wed Nov 24 16:11:24 2021 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 4D72718B7F73; Wed, 24 Nov 2021 16:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGN51C5z3lBs; Wed, 24 Nov 2021 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B7834AF6; Wed, 24 Nov 2021 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBOEd001989; Wed, 24 Nov 2021 16:11:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBOVB001987; Wed, 24 Nov 2021 16:11:24 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:24 GMT Message-Id: <202111241611.1AOGBOVB001987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 4614bc803462 - stable/12 - top.1: Improve description of -m 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4614bc803462366cb64b4a0609989fa2e3205b28 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0CPuO/YcMAf2b2fpWX+44MwhJbACeTWYtkTv+7IsTs=; b=rwf0OrhR9eifB33e9lbDSkh7pju1xTzR2dJGwRlHJNgMKyN5/Z3IVSk8DutbeWMKNQdM2p mBGVP+Mlhv6a16awkGcCV4M6Ic/KRdv28+4A2un039uwQgbJn8Iu/Rmb/l7L6SMR3Hj4HP xEVf8+qvG3UUseU7iPOdlf27tDCdcZO7DgVoxl2s7mNCOK28xWku5MDeUqW4FBl1ST1e+S QXMKbrTKdcuwB1dbifFvxLEt8n4pzWPgarFH+Jgh+RDZ97T88L0LSENhCMiR/l1oosn0+2 oIQD27xpmNLllSDyX/3Ywho6ca3O8YI3f6uTMxkCz/WP9plYRRVqfKrYlTs+wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770285; a=rsa-sha256; cv=none; b=OW51HblVvckRhrW8JOfgla3EgllPHJepO90HHI3Fy0S9pXZWC4Yb8kdCY3n/o3yjKOYfgk m9JTKN7EOxBunLyRHEBu7VLJJQoYmeFROVqvl+Q7Vi0ktMB0LRYbRCJ687dp/fBZX4MgmE I55SuH8lrBD2jzpAwa4KzyORIkPm6uYTUTqocCn/O3hEH+c40EGm7V+I6xw0PiyGCVfrGF ZI44qY1AmXR5OeDvs/vU50y9MyBJzW4J2xPN0FhW3n+WhQS/sGT4i4OQ5jjxYm5ZuxY9uY F+Lsfy48vHuAzQ7bIG59pClLoIqbdRZJRx7TVrwsT+hZgbqKjTvt7x4UPk63mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4614bc803462366cb64b4a0609989fa2e3205b28 commit 4614bc803462366cb64b4a0609989fa2e3205b28 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 14:31:48 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:10:10 +0000 top.1: Improve description of -m Describe -m argument as "mode" instead of "display". MFC after: 3 days (cherry picked from commit c947fc5fae31c5935a57abcaa76f40fc8950ce59) --- usr.bin/top/top.1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index 1f0be330ddc8..deda87a973f0 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -10,7 +10,7 @@ .Op Fl abCHIijnPpqSTtuvxz .Op Fl d Ar count .Op Fl J Ar jail -.Op Fl m Ar cpu|io +.Op Fl m Ar mode .Op Fl o Ar field .Op Fl p Ar pid .Op Fl s Ar time @@ -116,9 +116,15 @@ Using this option implies Display the .Xr jail 8 ID. -.It Fl m Ar display -Display either 'cpu' or 'io' statistics. -Default is 'cpu'. +.It Fl m Ar mode +Display statistics in the specified +.Ar mode . +Available modes are +.Cm cpu +and +.Cm io . +Default is +.Cm cpu . .It Fl n Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq From nobody Wed Nov 24 16:11:24 2021 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 3316F1890420; Wed, 24 Nov 2021 16:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGN4R9pz3lBr; Wed, 24 Nov 2021 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 541775109; Wed, 24 Nov 2021 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBO0D001988; Wed, 24 Nov 2021 16:11:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBOPY001984; Wed, 24 Nov 2021 16:11:24 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:24 GMT Message-Id: <202111241611.1AOGBOPY001984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 51f4d6a6bcf9 - stable/13 - top.1: Use the Dq macros instead of \*lq and \*rq 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51f4d6a6bcf905c20f661302461e87c798f668ab Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tlOgDTVj/kkc7beRRqodu9Sooxj7/EzA2t5augA4vZA=; b=ULqsoSGTWKSmDFUKpoqcoA1d/edrasg6Nkt2NxXX6GjTVQPwBcy/KKv0jUwgd5BBSYlIo3 AsFlIqtG3GoalaX7yWy8V345663RMZ/12zbO1CF7BeqwR0cg+W6j2RVdrjeqe9t+1QJUHH jTp3MM6NZ+91BBg+8UD4gyED+yrFi8tyzXW6E0ur4Jly3HaQizIWIOqHypEdokUdNkM879 qZWGuW4spYaVDliZRflXqjF3BrzHz867WcUrmSfS4JaAPXfYA6+L4T48WIJG0GX7J8yIRU U26wBQ4cDsSYXxEfWfdeBPbKAO+f4IlnNcsOHeP+QZIXUhkPROjSBgGwXrSvEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770285; a=rsa-sha256; cv=none; b=TkC6rjRP7cvuiWZOG1PUA6rlajZHYrN/UB6R4sNuUa8Ya+jp1LgKmgvqOVKtLMp/mtgdxp EdUNUkr4Ye0jHb6+L+8BDUiJr1pfdLzOHp4K5kjhxROjAKeHVNlUFClK57tBg4OQ8ZoX/l RvwDoJbfuiitPrrwM3hy6D8twS544H+9mTmT6Xo07ELne1pVLx3K3j/JYnalGNfGfVPDYM PzeB8aOUbmOdtCDvdsrkof/m1jSPC2HDYmZQRgLmBmMHJ9CbjYkVzltgggGrguRsdMUAfX /+iS7g3YhQ8m29bl5+6u6BTJP1qSushh8DuzUtbq8TushRl0RlNi+T0Py0Wz4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=51f4d6a6bcf905c20f661302461e87c798f668ab commit 51f4d6a6bcf905c20f661302461e87c798f668ab Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 14:55:27 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:10:31 +0000 top.1: Use the Dq macros instead of \*lq and \*rq MFC after: 3 days (cherry picked from commit 01e3140571bab1a7283e33669de171865cdb8028) --- usr.bin/top/top.1 | 144 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 37 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index 892ee8307e27..3aff7012f3d8 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -35,9 +35,13 @@ processes will be displayed instead of the default. makes a distinction between terminals that support advanced capabilities and those that do not. This distinction affects the choice of defaults for certain options. -In the remainder of this document, an \*(lqintelligent\*(rq terminal is one that +In the remainder of this document, an +.Dq intelligent +terminal is one that supports cursor addressing, clear screen, and clear to end of line. -Conversely, a \*(lqdumb\*(rq terminal is one that does not support such +Conversely, a +.Dq dumb +terminal is one that does not support such features. If the output of .Nm @@ -57,7 +61,9 @@ Non-printable characters in the command line are encoded in C-style backslash sequences or a three digit octal sequences. .It Fl b -Use \*(lqbatch\*(rq mode. +Use +.Dq batch +mode. In this mode, all input from the terminal is ignored. Interrupt characters (such as ^C and ^\e) still have an effect. @@ -70,9 +76,15 @@ By default top displays the weighted CPU percentage in the WCPU column displays as CPU). Each time .Fl C -flag is passed it toggles between \*(lqraw cpu\*(rq mode -and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or -the \*(lqWCPU\*(rq column respectively. +flag is passed it toggles between +.Dq raw cpu +mode and +.Dq weighted cpu +mode, showing the +.Dq CPU +or the +.Dq WCPU +column respectively. .It Fl d Ar count Show only .Ar count @@ -91,10 +103,13 @@ By default a single summary line is displayed for each process. Do not display idle processes. By default, top displays both active and idle processes. .It Fl i -Use \*(lqinteractive\*(rq mode. +Use +.Dq interactive +mode. In this mode, any input is immediately read for processing. -See the section on \*(lqInteractive Mode\*(rq +See the section on +.Dq Interactive Mode for an explanation of which keys perform what functions. After the command is processed, the @@ -129,17 +144,32 @@ and Default is .Cm cpu . .It Fl n -Use \*(lqnon-interactive\*(rq mode. -This is identical to \*(lqbatch\*(rq +Use +.Dq non-interactive +mode. +This is identical to +.Dq batch mode. .It Fl o Ar field Sort the process display area on the specified field. The field name is the name of the column as seen in the output, but in lower case: -\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq, -\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq, -\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq, -\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq. +.Dq cpu , +.Dq size , +.Dq res , +.Dq time , +.Dq pri , +.Dq threads , +.Dq total , +.Dq read , +.Dq write , +.Dq fault , +.Dq vcsw , +.Dq ivcsw , +.Dq jid , +.Dq swap , +or +.Dq pid . .It Fl P Display per-cpu CPU usage statistics. .It Fl p Ar pid @@ -176,7 +206,9 @@ uid numbers. Do not map uid numbers to usernames. Normally, .Nm -will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map +will read as much of the file +.Pa /etc/passwd +as is necessary to map all the user id numbers it encounters into login names. This option disables all that, while possibly decreasing execution time. The uid numbers are displayed instead of the names. @@ -192,23 +224,29 @@ Both .Ar count and .Ar number -fields can be specified as \*(lqinfinite\*(rq, indicating that they can +fields can be specified as +.Dq infinite , +indicating that they can stretch as far as possible. This is accomplished by using any proper prefix of the keywords -\*(lqinfinity\*(rq, -\*(lqmaximum\*(rq, +.Dq infinity , +.Dq maximum , or -\*(lqall\*(rq. +.Dq all . Boolean flags are toggles. A second specification of any of these options will negate the first. .Sh "INTERACTIVE MODE" When .Nm -is running in \*(lqinteractive mode\*(rq, it reads commands from the +is running in +.Dq interactive mode , +it reads commands from the terminal and acts upon them accordingly. In this mode, the terminal is -put in \*(lqCBREAK\*(rq, so that a character will be +put in +.Dq CBREAK , +so that a character will be processed as soon as it is typed. Almost always, a key will be pressed when @@ -265,30 +303,45 @@ Toggle the display of system processes. .It a Toggle the display of process titles. .It k -Send a signal (\*(lqkill\*(rq by default) to a list of processes. +Send a signal +.Pq SIGKILL by default +to a list of processes. This acts similarly to the command .Xr kill 1 . .It r -Change the priority (the \*(lqnice\*(rq) of a list of processes. +Change the priority +.Pq the Dq nice +of a list of processes. This acts similarly to .Xr renice 8 . .It u Display only processes owned by a specific set of usernames (prompt for username). -If the username specified is simply \*(lq+\*(rq or \*(lq-\*(rq, +If the username specified is simply +.Dq + +or +.Dq - , then processes belonging to all users will be displayed. Usernames can be added -to and removed from the set by prepending them with \*(lq+\*(rq and -\*(lq-\*(rq, respectively. +to and removed from the set by prepending them with +.Dq + +and +.Dq - , +respectively. .It o Change the order in which the display is sorted. The sort key names include -\*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq, -\*(lqtime\*(rq. +.Dq cpu , +.Dq res , +.Dq size , +and +.Dq time. The default is cpu. .It p Display a specific process (prompt for pid). -If the pid specified is simply \*(lq+\*(rq, then show all processes. +If the pid specified is simply +.Dq + , +then show all processes. .It e Display a list of system errors (if any) generated by the last command. @@ -302,7 +355,9 @@ Toggle the display of ID. .It J Display only processes owned by a specific jail (prompt for jail). -If the jail specified is simply \*(lq+\*(rq, then processes belonging +If the jail specified is simply +.Dq + , +then processes belonging to all jails and the host will be displayed. This will also enable the display of JID. .It P @@ -351,10 +406,18 @@ SIZE is the total size of the process (text, data, and stack), RES is the current amount of resident memory, SWAP is the approximate amount of swap, if enabled (SIZE, RES and SWAP are given in kilobytes), -STATE is the current state (one of \*(lqSTART\*(rq, \*(lqRUN\*(rq -(shown as \*(lqCPUn\*(rq on SMP systems), \*(lqSLEEP\*(rq, \*(lqSTOP\*(rq, -\*(lqZOMB\*(rq, \*(lqWAIT\*(rq, \*(lqLOCK\*(rq or the event on which the -process waits), +STATE is the current state (one of +.Dq START , +.Dq RUN +(shown as +.Dq CPUn +on SMP systems), +.Dq SLEEP , +.Dq STOP , +.Dq ZOMB , +.Dq WAIT , +.Dq LOCK , +or the event on which the process waits), C is the processor number on which the process is executing (visible only on SMP systems), TIME is the number of system and user cpu seconds that the process has used, @@ -365,12 +428,19 @@ displays as CPU), CPU is the raw percentage and is the field that is sorted to determine the order of the processes, and COMMAND is the name of the command that the process is currently running -(if the process is swapped out, this column is marked \*(lq\*(rq). +(if the process is swapped out, this column is marked +.Dq ) . .Pp -If a process is in the \*(lqSLEEP\*(rq or \*(lqLOCK\*(rq state, +If a process is in the +.Dq SLEEP +or +.Dq LOCK +state, the state column will report the name of the event or lock on which the process is waiting. -Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep events +Lock names are prefixed with an asterisk +.Dq * +while sleep events are not. .Sh DESCRIPTION OF MEMORY .Bd -literal From nobody Wed Nov 24 16:11:25 2021 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 AE0BE1890519; Wed, 24 Nov 2021 16:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzmGP6TSkz3lTj; Wed, 24 Nov 2021 16:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60C3A4AF8; Wed, 24 Nov 2021 16:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGBPDI002034; Wed, 24 Nov 2021 16:11:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGBPoV002030; Wed, 24 Nov 2021 16:11:25 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:11:25 GMT Message-Id: <202111241611.1AOGBPoV002030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: cf1f1f91e914 - stable/12 - top.1: Use the Dq macros instead of \*lq and \*rq 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cf1f1f91e91425c8796b1af4263e98d280ee7e0a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637770286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i1p0ofc/akoScUgRjEKJoBqCueK0gOBegUlSxBieX48=; b=ZlkQ5Eydru/QqTIN+asIS9YFNon9xqW8cWJbtFz0b1SzHFp45fZGMpap9EDvI/iacayMHW Qhyo4U/AUOl3O1z5QuJ07VENgAup9Tvidp3u0AIunw1CFFVqsDzY1HTP+gggQOL44MKacB EHY8+3AXaEXtYyXhwOEKTsoYZ1Z20XlO5TzQ9wo68UJxNNqiLM9orPuDPFavGlAcVVGAsg SNC9RLe2LOuJDw7Y/gQp/5AlSQIQFENnR7P22TqSIGTxaAVWxypmvwXvaUzDqPjQZowz+E GuihpZiAnnxroXlTNzfY1RYI8z4W5oSlgTb6lF5GCWXdoo4XbMUOg9rgLttxqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637770286; a=rsa-sha256; cv=none; b=fyaiib6zPcd02GlmNOqEfm9IZ44SkMSA9KoUFfEZFfyRwkEDstvaUfLCkqiuwkOSeQKH0j Q0H4nu1xfZWp8LCPF2F6xld8mXH1yWc2n0iLWV4KOW/Er5pJxQy/AHTks/ZkdT3cibd2Dq HPVWCfRh3JTxXy27tf5EMefs07o7pP7r3oAxx3xHlQ+EZEXLPeqzQ4zTfQxzmsSXN+nq/2 tZgTNBiWe14xZ0qs4jyLOMprsVgMRuO27ccPq5laFq8wwE+0LqZmVtSQ86LaejeZO/EFhJ Jog1yZ2vHzKjgFY5C2R9+CNZusyeRZkJhYcryk4A/7OJUykYiWI8WxLMO4LmjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cf1f1f91e91425c8796b1af4263e98d280ee7e0a commit cf1f1f91e91425c8796b1af4263e98d280ee7e0a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 14:55:27 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-24 16:10:24 +0000 top.1: Use the Dq macros instead of \*lq and \*rq MFC after: 3 days (cherry picked from commit 01e3140571bab1a7283e33669de171865cdb8028) --- usr.bin/top/top.1 | 144 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 37 deletions(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index deda87a973f0..4a587877dba6 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -35,9 +35,13 @@ processes will be displayed instead of the default. makes a distinction between terminals that support advanced capabilities and those that do not. This distinction affects the choice of defaults for certain options. -In the remainder of this document, an \*(lqintelligent\*(rq terminal is one that +In the remainder of this document, an +.Dq intelligent +terminal is one that supports cursor addressing, clear screen, and clear to end of line. -Conversely, a \*(lqdumb\*(rq terminal is one that does not support such +Conversely, a +.Dq dumb +terminal is one that does not support such features. If the output of .Nm @@ -54,7 +58,9 @@ puts their status information there. If the real name differs from argv[0], it will be displayed in parenthesis. .It Fl b -Use \*(lqbatch\*(rq mode. +Use +.Dq batch +mode. In this mode, all input from the terminal is ignored. Interrupt characters (such as ^C and ^\e) still have an effect. @@ -67,9 +73,15 @@ By default top displays the weighted CPU percentage in the WCPU column displays as CPU). Each time .Fl C -flag is passed it toggles between \*(lqraw cpu\*(rq mode -and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or -the \*(lqWCPU\*(rq column respectively. +flag is passed it toggles between +.Dq raw cpu +mode and +.Dq weighted cpu +mode, showing the +.Dq CPU +or the +.Dq WCPU +column respectively. .It Fl d Ar count Show only .Ar count @@ -88,10 +100,13 @@ By default a single summary line is displayed for each process. Do not display idle processes. By default, top displays both active and idle processes. .It Fl i -Use \*(lqinteractive\*(rq mode. +Use +.Dq interactive +mode. In this mode, any input is immediately read for processing. -See the section on \*(lqInteractive Mode\*(rq +See the section on +.Dq Interactive Mode for an explanation of which keys perform what functions. After the command is processed, the @@ -126,17 +141,32 @@ and Default is .Cm cpu . .It Fl n -Use \*(lqnon-interactive\*(rq mode. -This is identical to \*(lqbatch\*(rq +Use +.Dq non-interactive +mode. +This is identical to +.Dq batch mode. .It Fl o Ar field Sort the process display area on the specified field. The field name is the name of the column as seen in the output, but in lower case: -\*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq, -\*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq, -\*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq, -\*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq. +.Dq cpu , +.Dq size , +.Dq res , +.Dq time , +.Dq pri , +.Dq threads , +.Dq total , +.Dq read , +.Dq write , +.Dq fault , +.Dq vcsw , +.Dq ivcsw , +.Dq jid , +.Dq swap , +or +.Dq pid . .It Fl P Display per-cpu CPU usage statistics. .It Fl p Ar pid @@ -173,7 +203,9 @@ uid numbers. Do not map uid numbers to usernames. Normally, .Nm -will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map +will read as much of the file +.Pa /etc/passwd +as is necessary to map all the user id numbers it encounters into login names. This option disables all that, while possibly decreasing execution time. The uid numbers are displayed instead of the names. @@ -189,23 +221,29 @@ Both .Ar count and .Ar number -fields can be specified as \*(lqinfinite\*(rq, indicating that they can +fields can be specified as +.Dq infinite , +indicating that they can stretch as far as possible. This is accomplished by using any proper prefix of the keywords -\*(lqinfinity\*(rq, -\*(lqmaximum\*(rq, +.Dq infinity , +.Dq maximum , or -\*(lqall\*(rq. +.Dq all . Boolean flags are toggles. A second specification of any of these options will negate the first. .Sh "INTERACTIVE MODE" When .Nm -is running in \*(lqinteractive mode\*(rq, it reads commands from the +is running in +.Dq interactive mode , +it reads commands from the terminal and acts upon them accordingly. In this mode, the terminal is -put in \*(lqCBREAK\*(rq, so that a character will be +put in +.Dq CBREAK , +so that a character will be processed as soon as it is typed. Almost always, a key will be pressed when @@ -262,30 +300,45 @@ Toggle the display of system processes. .It a Toggle the display of process titles. .It k -Send a signal (\*(lqkill\*(rq by default) to a list of processes. +Send a signal +.Pq SIGKILL by default +to a list of processes. This acts similarly to the command .Xr kill 1 . .It r -Change the priority (the \*(lqnice\*(rq) of a list of processes. +Change the priority +.Pq the Dq nice +of a list of processes. This acts similarly to .Xr renice 8 . .It u Display only processes owned by a specific set of usernames (prompt for username). -If the username specified is simply \*(lq+\*(rq or \*(lq-\*(rq, +If the username specified is simply +.Dq + +or +.Dq - , then processes belonging to all users will be displayed. Usernames can be added -to and removed from the set by prepending them with \*(lq+\*(rq and -\*(lq-\*(rq, respectively. +to and removed from the set by prepending them with +.Dq + +and +.Dq - , +respectively. .It o Change the order in which the display is sorted. The sort key names include -\*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq, -\*(lqtime\*(rq. +.Dq cpu , +.Dq res , +.Dq size , +and +.Dq time. The default is cpu. .It p Display a specific process (prompt for pid). -If the pid specified is simply \*(lq+\*(rq, then show all processes. +If the pid specified is simply +.Dq + , +then show all processes. .It e Display a list of system errors (if any) generated by the last command. @@ -299,7 +352,9 @@ Toggle the display of ID. .It J Display only processes owned by a specific jail (prompt for jail). -If the jail specified is simply \*(lq+\*(rq, then processes belonging +If the jail specified is simply +.Dq + , +then processes belonging to all jails and the host will be displayed. This will also enable the display of JID. .It P @@ -348,10 +403,18 @@ SIZE is the total size of the process (text, data, and stack), RES is the current amount of resident memory, SWAP is the approximate amount of swap, if enabled (SIZE, RES and SWAP are given in kilobytes), -STATE is the current state (one of \*(lqSTART\*(rq, \*(lqRUN\*(rq -(shown as \*(lqCPUn\*(rq on SMP systems), \*(lqSLEEP\*(rq, \*(lqSTOP\*(rq, -\*(lqZOMB\*(rq, \*(lqWAIT\*(rq, \*(lqLOCK\*(rq or the event on which the -process waits), +STATE is the current state (one of +.Dq START , +.Dq RUN +(shown as +.Dq CPUn +on SMP systems), +.Dq SLEEP , +.Dq STOP , +.Dq ZOMB , +.Dq WAIT , +.Dq LOCK , +or the event on which the process waits), C is the processor number on which the process is executing (visible only on SMP systems), TIME is the number of system and user cpu seconds that the process has used, @@ -362,12 +425,19 @@ displays as CPU), CPU is the raw percentage and is the field that is sorted to determine the order of the processes, and COMMAND is the name of the command that the process is currently running -(if the process is swapped out, this column is marked \*(lq\*(rq). +(if the process is swapped out, this column is marked +.Dq ) . .Pp -If a process is in the \*(lqSLEEP\*(rq or \*(lqLOCK\*(rq state, +If a process is in the +.Dq SLEEP +or +.Dq LOCK +state, the state column will report the name of the event or lock on which the process is waiting. -Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep events +Lock names are prefixed with an asterisk +.Dq * +while sleep events are not. .Sh DESCRIPTION OF MEMORY .Bd -literal From nobody Wed Nov 24 16:58:45 2021 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 0BE7218AC883; Wed, 24 Nov 2021 16:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HznK15J6Vz4djf; Wed, 24 Nov 2021 16:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9614D5467; Wed, 24 Nov 2021 16:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGwjZq059572; Wed, 24 Nov 2021 16:58:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGwjkp059571; Wed, 24 Nov 2021 16:58:45 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:58:45 GMT Message-Id: <202111241658.1AOGwjkp059571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: eaab06d53dfa - stable/13 - devfs.rules: Correctly unhide pf in vnet jails 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eaab06d53dfa7fbf926a2c19aa00a6804b5e6349 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637773125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bJGb2/pIWW1JtG9uuWE4R/eTYmyJDpJ3wGgjZMAI54Q=; b=lec5BiuUy51RjCxiueAG7JQGLg8u75zfOd51vujyke+Xr9FUH8T1Ul+EQxkaXI800q2+8H QjPdxvehcCA+exJ0lSfwyvBaIyo+4iLxRB8VtSaxbK5DQxWY8XAWGBkOGYK/MyzQIJmtcj ul3DRe3VFzUnFZcEzCDjFylNHwTcsA8U+UshVpHBFMDqo52Jeoq88qy+MW+ugljozB3Vxn IOCWui1QxmnCPlrebIP5VPvjX/MriK0lyJoxMw4jko5G5otP/FFXd3yJK8nzfWSZqy970/ NBrnSVj4HBX/Eq0UOY+nRVJSjprOqHBh4iutQ5uwVH7WJcI+8zhN8guqi8hBhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637773125; a=rsa-sha256; cv=none; b=SLc7G1Sm7PDFRgEHrJzgSdVvS0ZSD5qaFKu405nBupOfoOVnxUQWjevNHMsGkADFNffLm/ 22TRxzelEYTbn+/wsPmvzH9l0ng0M2Q+M/sOQIbIw6/LlEXB25goIjGvNvzuVDgAeWMx3U tUam8+R5iyKJ+bS+b3mpu7JusMCJix6VaQH42NIBvS4UEZnwOHdpq2f+LEccQZgD0gDRyy piQighnset5N5Rs+zesK8R+QWvp5mxX9FEjUWNGYFH2+0LP9yvMPFI6JVijghI4StDNIYk WfuJkhwFrzz46t9+SLk3/XAF5padCHPQClvdywZTjdQ0U1nhVZY0NJ07x9gIjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=eaab06d53dfa7fbf926a2c19aa00a6804b5e6349 commit eaab06d53dfa7fbf926a2c19aa00a6804b5e6349 Author: Zhenlei Huang AuthorDate: 2021-11-03 11:46:48 +0000 Commit: Kristof Provost CommitDate: 2021-11-24 16:45:51 +0000 devfs.rules: Correctly unhide pf in vnet jails Revision 9e9be081d8 introduced a new devfs rule devfsrules_jail_vnet. It includes rule devfsrules_jail which include other rules. Unfortunately devfs could not recursively parse the action include and thus devfsrules_jail_vnet will expose all nodes. PR: 255660 Reviewed by: kp Obtained from: Gijs Peskens MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D32814 (cherry picked from commit 7acd322ebe2072b1d73b1d19c14ab12a300ba8e8) --- sbin/devfs/devfs.rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/devfs/devfs.rules b/sbin/devfs/devfs.rules index 01d8e5194c17..9543e20947d9 100644 --- a/sbin/devfs/devfs.rules +++ b/sbin/devfs/devfs.rules @@ -88,5 +88,8 @@ add path fuse unhide add path zfs unhide [devfsrules_jail_vnet=5] +add include $devfsrules_hide_all +add include $devfsrules_unhide_basic +add include $devfsrules_unhide_login add include $devfsrules_jail add path pf unhide From nobody Wed Nov 24 16:58:46 2021 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 0F91318AC6A1; Wed, 24 Nov 2021 16:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HznK254R9z4dvw; Wed, 24 Nov 2021 16:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EBA85935; Wed, 24 Nov 2021 16:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGwkDS059662; Wed, 24 Nov 2021 16:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGwkFj059660; Wed, 24 Nov 2021 16:58:46 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:58:46 GMT Message-Id: <202111241658.1AOGwkFj059660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c31b7fd8b294 - stable/12 - riscv: add COMPAT_FREEBSD12 option 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c31b7fd8b294e64b285898ffbfb613b178948126 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637773126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uZ0vm1LfZ9PEBLKJ391NYXC2N7XHwXep0pS5L/nhktc=; b=pD3o/XjS3JO17v5SlM5FfyOHUECy20UpXDkN988yCEP/SzS8qTgvq42f5SihY04BtsHAw2 gGpwwRppuJ9NTkdnYJUoV652yctXhx+hSdkSRd/lmUbrkJWcFisswRf7654k6pQjplSSjV vYZlW2w81WcugSpBX6ZY00WyDaVkPKkTXc66KdMd647ALd+Ggk0O6rrzn3/qXzRolQoOM4 uyHGu/NIEdzrL6vvaZeUimRI2ra6m9+S0FXyv2MrwIHwhC6VG5n1UkHwUpKo7pXk2KSYlQ VlrXNTCrWQ06TRk2Eumr6NcgZKBAlJyQttsEj8a2e98pMXUThZpZkRm2pphQ1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637773126; a=rsa-sha256; cv=none; b=dSApYXuccmLycxX/nfLvQ5tZaq0gD2TxaJWIBlt14qDRLWegOMhAATKp+RVzhya58xowO2 /Q6bBXq/E3wqY5FRx8XOVOo046Izl2GB/Mvq0tdQTRkTcihngY60RTl+ElJ2dufINAK9Ud 24Q0AeC5zgBS6KiVEDJvDZmQfsWprxWiS0ztl6972yqMO64f/BRGOgfSxIob4Zd6MiszpG sgl33gVim5sjJ9IJ99Z9apB8m2liDvepJcwiVBGq1peXa9AjoKlR8asOIoBHct1bK6W6E4 AV/LRwgwdPBJdHwiT1IpeF/nbqacDnhdtjS3dZlkP1aXNXeCS/mTDsceD26A7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c31b7fd8b294e64b285898ffbfb613b178948126 commit c31b7fd8b294e64b285898ffbfb613b178948126 Author: Kristof Provost AuthorDate: 2021-11-16 19:46:26 +0000 Commit: Kristof Provost CommitDate: 2021-11-24 16:57:23 +0000 riscv: add COMPAT_FREEBSD12 option Turn on compat option for older FreeBSD versions (i.e. 12). We do not enable the compat options for 11 or older because riscv was never supported in those versions. Reviewed by: jrtc27 (previous version) MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33015 (cherry picked from commit 23e1961e78b0ac4d1cf03426d1a642962069f2b9) --- sys/riscv/conf/GENERIC | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 4982c48ece39..5cba4cc2f94f 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -51,6 +51,7 @@ options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From nobody Wed Nov 24 16:58:46 2021 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 95B5018AC6A4; Wed, 24 Nov 2021 16:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HznK26NZTz4djj; Wed, 24 Nov 2021 16:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B24895936; Wed, 24 Nov 2021 16:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGwkEx059686; Wed, 24 Nov 2021 16:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGwkJY059685; Wed, 24 Nov 2021 16:58:46 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:58:46 GMT Message-Id: <202111241658.1AOGwkJY059685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 576d71e383f1 - stable/13 - riscv: add COMPAT_FREEBSD12 option 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 576d71e383f10cde0de14da16baf98835d51ecec Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637773126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k+9MNHV7NR/O4zJr54ncG09bwSHexqdwqnGuoN4d2Yg=; b=NecWWjIWsvcDJodKF+JmWAnVPcOldFqJ8h+u5lhAQzP5NjZ1wW3yXd5dA9UwkPBl+QcB8T EDVm0gM4/xOBkn6hjOgOnfD2YlY6kX+6gJg3p3YWZ+NAjZs2ebZbfrjMu/ju4QRBI1ALRu QF8yQ6Y6RglDFkfVWuyiROR2XbJ0wx4dbqCMEDE2AKnHYygHA+u7KzCvV5lIGT79GKLsmj 2o939ursBo5W5Qh8+1cPHpv6o9FGuOYGZgYjhqTeFl03KiP0JkCMTYLCZqpEO2CbhVwaCq dVHtffPJQEBy02kQ/uCa/iMymFqTaohUGEa80dL3ujJX1gJ7A+dZPWVjWkeQ9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637773126; a=rsa-sha256; cv=none; b=sS93jLdMM46jqu+IF3yNxhwZIVxVyJikLq9b4sN+NLKYBhZUtCssDXhJUBrvvRkpHd/GbQ cJ+uF3/PjTzZ/35+hJS+UfVAEYetpndINLh2ky+cIAV0LLacxxzPLr4DENcgYCKPmPeWuP NGoKsPvFnvmAGCKYN6LQju4P/RxqeYt5zBivQca8Hv6gfwK11sXEMaG4yvOdzdJIJVqt9D ixGeaxmZCYc/moOfKTOe/Z++k/Nh5BaDT2iI/Lo/lTE21cK/00AmWJMoE8lMGHK85OshxL Q170lghXrd17z6K5Aaq5WXodImnZzXZG7mGsrlwiV61RccMWwc5ciIhaiGuDZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=576d71e383f10cde0de14da16baf98835d51ecec commit 576d71e383f10cde0de14da16baf98835d51ecec Author: Kristof Provost AuthorDate: 2021-11-16 19:46:26 +0000 Commit: Kristof Provost CommitDate: 2021-11-24 16:45:51 +0000 riscv: add COMPAT_FREEBSD12 option Turn on compat option for older FreeBSD versions (i.e. 12). We do not enable the compat options for 11 or older because riscv was never supported in those versions. Reviewed by: jrtc27 (previous version) MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33015 (cherry picked from commit 23e1961e78b0ac4d1cf03426d1a642962069f2b9) --- sys/riscv/conf/GENERIC | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 8c3162d6ae1e..4ce3ffe059ba 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -52,6 +52,7 @@ options TMPFS # Efficient memory filesystem options GEOM_PART_GPT # GUID Partition Tables. options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From nobody Wed Nov 24 16:58:47 2021 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 A52E418AC810; Wed, 24 Nov 2021 16:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HznK36vpZz4dw4; Wed, 24 Nov 2021 16:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC74A5937; Wed, 24 Nov 2021 16:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGwlHj059710; Wed, 24 Nov 2021 16:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGwlEC059709; Wed, 24 Nov 2021 16:58:47 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:58:47 GMT Message-Id: <202111241658.1AOGwlEC059709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b991674ba5af - stable/12 - pf tests: route_to:icmp_nat_head requires scapy 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b991674ba5afeb11b7c4eb70028cce4a4e0ad41f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637773128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=02lEwtKXtTVV3mKUXVSPRYPQvcbU7c9xv6rTauupHGw=; b=rUViEihrMaK9b8DhNnDV04UBDpppU0IvomA4fRg4MnNsgdJWbBxgDKHMff2kZozE3I/sOd ZUZ9MQ1ftMxchoI9dFh/oE/SOUi97HWwNUBYPmrdCsInNL4NG5xKKqq0cHjXJHNe2iUQnV QOhE3Cn9lybPKCzW2+hROHCrRD0akCaLRbK/xAcoEfp4XDcI3q2ZMO33pIb1nnUjHHzkv6 9RHAckZ9KsO+Krd/deVgnhHRO78M9aXWuukjKjUtIyPaYmlbV59DVCr1GxYkBHB4VEc5US D2pajoa21q1jM8H0wJCA9jgA4RjC1iPWdyP15h6or1NudZ4oatifS5v5KuM5zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637773128; a=rsa-sha256; cv=none; b=v1iI3Feo8gdVzEXS7fyOPRKnoUD2mZ97Lvyhc40eJw18RnhvgT5fNorFC1HijoIIa0Ddq/ NR1EW33Pafdy1jicketwY7/BtrtcOAzwX5DB63pzq0pvONM4pZpVsd060SW+5NvJjZroln CiLSfObI7A7fCv+uVCXZzRKOhwP3YB1l6VgAVCq2kgUjug1mgFutbnw9oVmfdGcV6HJ/y1 6/oG3K1a/V2a/RtN1b/Gbut16iOJqrTsa33hIJx5SejSb63kcz7pJBXgCAH769I7darjHg ay//kXfn4WrE2K3Aj+Cd4ewBXq3+cmXT29234EtZ1hW5OGQKjOwxJkYGGG+oPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b991674ba5afeb11b7c4eb70028cce4a4e0ad41f commit b991674ba5afeb11b7c4eb70028cce4a4e0ad41f Author: Kristof Provost AuthorDate: 2021-11-03 09:34:20 +0000 Commit: Kristof Provost CommitDate: 2021-11-24 16:57:23 +0000 pf tests: route_to:icmp_nat_head requires scapy Document the requirement so the test is skipped if scapy is not installed. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 11703705c2f77498246b9523aae44040bd346c00) --- tests/sys/netpfil/pf/route_to.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index e7646a5fb7f7..570d1feb36ff 100755 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -257,6 +257,7 @@ icmp_nat_head() { atf_set descr 'Test that ICMP packets are correct for route-to + NAT' atf_set require.user root + atf_set require.progs scapy } icmp_nat_body() From nobody Wed Nov 24 16:58:47 2021 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 1825418AC814; Wed, 24 Nov 2021 16:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HznK42WrLz4dqg; Wed, 24 Nov 2021 16:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC21A5A8E; Wed, 24 Nov 2021 16:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOGwl05059734; Wed, 24 Nov 2021 16:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOGwlGD059733; Wed, 24 Nov 2021 16:58:47 GMT (envelope-from git) Date: Wed, 24 Nov 2021 16:58:47 GMT Message-Id: <202111241658.1AOGwlGD059733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 094b79ea7342 - stable/13 - pf tests: route_to:icmp_nat_head requires scapy 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 094b79ea7342c3c6e5b698816d9486bb80e9518b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637773128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=22in+5qYPmx4mJ20QoVrWQGvMaTEofBlPDFklCjpHYI=; b=edrWMx8jCcWO5GD0FvuaLdMy4wR17tEVVfzag7jn+wQtX3mGvMHXDwOgY6c1QhUWqpzI8R vr3cj8vv3PkoTCvrZug59BK320O2oO8/J//WNLllAXuBbC9789T5e/uaieExhnfSSMnNfM u5jhCCQKWEO4CS9ifLBfFvhmNvxTjjSmSifAEc/FNTleYO1dgkzPQK3D0RYc1oZ8h0sop5 iFjKQowVjIAcC5iEots/NmCoFsHjt/iX3EY+k9onKVi8WUFK3YQRyhBLqSnDFoquwQ+4MT QQdRHlF0PmY0XhQ9bWs/co1BffClGASfz4E6Tp4dnANhA8oRpN3JFCiPU5KZMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637773128; a=rsa-sha256; cv=none; b=oBDwRzLtdEWDS3CSTG1RXCYiwK8tvGcTfe3J5knttRqNwwaRqYTx5x5Wig/RSREQsY4Al9 SeIKZOcEiVMiDpvB/FShs3vVZcmiw1fNmIVwApnoi3MdyqwwyMy3K0U5xYes+3s1pgH3R5 KyaKaHytQ4LPKtKVhCi/czzOZbLaaPRIw79xMQX2Jw8iGUYZB4Nk4AwDI6fKj1JRyhOCuZ GtRSRlDA3VotztlokuCeE1vGViYx6W3RIz08Newgync8nXaazU03ZWZmEmyaPdJgcoqStM bLWLqDYexgCFDin0UrgmLqY252KF+ZfU96+1SJzifzk31C+oFkSXI5XV+PAUXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=094b79ea7342c3c6e5b698816d9486bb80e9518b commit 094b79ea7342c3c6e5b698816d9486bb80e9518b Author: Kristof Provost AuthorDate: 2021-11-03 09:34:20 +0000 Commit: Kristof Provost CommitDate: 2021-11-24 16:45:51 +0000 pf tests: route_to:icmp_nat_head requires scapy Document the requirement so the test is skipped if scapy is not installed. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 11703705c2f77498246b9523aae44040bd346c00) --- tests/sys/netpfil/pf/route_to.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index e7646a5fb7f7..570d1feb36ff 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -257,6 +257,7 @@ icmp_nat_head() { atf_set descr 'Test that ICMP packets are correct for route-to + NAT' atf_set require.user root + atf_set require.progs scapy } icmp_nat_body() From nobody Wed Nov 24 18:02:47 2021 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 F2DA718A83E4; Wed, 24 Nov 2021 18:02:48 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from tor1-11.mx.scaleengine.net (tor1-11.mx.scaleengine.net [209.51.186.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzpkw5RRyz3K27; Wed, 24 Nov 2021 18:02:48 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.3] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by tor1-11.mx.scaleengine.net (Postfix) with ESMTPSA id 3DE6C2EEBD; Wed, 24 Nov 2021 18:02:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 tor1-11.mx.scaleengine.net 3DE6C2EEBD Message-ID: <8664c9a1-f000-d07f-5f48-3b18d3e5f629@freebsd.org> Date: Wed, 24 Nov 2021 13:02:47 -0500 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features Content-Language: en-US To: Emmanuel Vadot , Helge Oldach Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202111231936.1ANJaeDT011754@nuc.oldach.net> <20211124093016.e031bc2e2e935d1c67dbc0ae@bidouilliste.com> From: Allan Jude In-Reply-To: <20211124093016.e031bc2e2e935d1c67dbc0ae@bidouilliste.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Hzpkw5RRyz3K27 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/24/2021 3:30 AM, Emmanuel Vadot wrote: > On Tue, 23 Nov 2021 20:36:40 +0100 (CET) > freebsd@oldach.net (Helge Oldach) wrote: > >> Allan Jude wrote on Tue, 23 Nov 2021 20:14:53 +0100 (CET): >>> On 11/23/2021 5:00 AM, Helge Oldach wrote: >>>> Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET): >>>> Hmmm. On a RPi4/8G: >>>> >>>> Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6): >>>> | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >>>> | aes-256-gcm 35791.98k 38533.57k 39986.77k 41397.59k 39840.43k 39638.36k >>>> >>>> After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621) >>>> >>>> | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >>>> | aes-256-gcm 21277.62k 23226.64k 23613.90k 23687.51k 23892.93k 23947.95k >>>> >>>> It seems that AES throughput is actually cut by almost half? >>> >>> Do you know which of the CPU optimizations your RPi4 supports? >> >> Is this what you need? >> >> Instruction Set Attributes 0 = > > So there is no AES+PMULL instruction set on RPI4, I guess that openssl > uses them for aes-gcm. > > I wonder what it uses before that make it have this boost. > > On my rockpro64 I do see the improvement btw : > root@generic:~ # cpuset -l 4,5 openssl speed -evp aes-256-gcm > ... > aes-256-gcm 122861.59k 337938.39k 565408.44k 661223.09k 709175.19k 712327.25k > root@generic:~ # cpuset -l 4,5 env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm > ... > aes-256-gcm 34068.11k 38068.62k 39435.24k 39818.75k 39905.34k 39922.35k > > Running on the big cores at max freq. > >> Instruction Set Attributes 1 = <> >> Processor Features 0 = >> Processor Features 1 = <> >> Memory Model Features 0 = >> Memory Model Features 1 = <8bit VMID> >> Memory Model Features 2 = <32bit CCIDX,48bit VA> >> Debug Features 0 = >> Debug Features 1 = <> >> Auxiliary Features 0 = <> >> Auxiliary Features 1 = <> >> AArch32 Instruction Set Attributes 5 = >> AArch32 Media and VFP Features 0 = >> AArch32 Media and VFP Features 1 = >> >>> You can set the environment variable OPENSSL_armcap to override >>> OpenSSL's detection. >>> >>> Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm >> >> On FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621 again (i.e. after this commit): >> >> hmo@p48 ~ $ env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm >> Doing aes-256-gcm for 3s on 16 size blocks: 6445704 aes-256-gcm's in 3.08s >> Doing aes-256-gcm for 3s on 64 size blocks: 1861149 aes-256-gcm's in 3.00s >> Doing aes-256-gcm for 3s on 256 size blocks: 479664 aes-256-gcm's in 3.01s >> Doing aes-256-gcm for 3s on 1024 size blocks: 122853 aes-256-gcm's in 3.04s >> Doing aes-256-gcm for 3s on 8192 size blocks: 15181 aes-256-gcm's in 3.00s >> Doing aes-256-gcm for 3s on 16384 size blocks: 7796 aes-256-gcm's in 3.07s >> OpenSSL 1.1.1l-freebsd 24 Aug 2021 >> built on: reproducible build, date unspecified >> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) >> compiler: clang >> The 'numbers' are in 1000s of bytes per second processed. >> type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >> aes-256-gcm 33504.57k 39704.51k 40825.01k 41394.83k 41454.25k 41601.52k >> hmo@p48 ~ $ openssl speed -evp aes-256-gcm >> Doing aes-256-gcm for 3s on 16 size blocks: 4066201 aes-256-gcm's in 3.00s >> Doing aes-256-gcm for 3s on 64 size blocks: 1087387 aes-256-gcm's in 3.00s >> Doing aes-256-gcm for 3s on 256 size blocks: 280110 aes-256-gcm's in 3.03s >> Doing aes-256-gcm for 3s on 1024 size blocks: 70412 aes-256-gcm's in 3.04s >> Doing aes-256-gcm for 3s on 8192 size blocks: 8762 aes-256-gcm's in 3.00s >> Doing aes-256-gcm for 3s on 16384 size blocks: 4402 aes-256-gcm's in 3.02s >> OpenSSL 1.1.1l-freebsd 24 Aug 2021 >> built on: reproducible build, date unspecified >> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) >> compiler: clang >> The 'numbers' are in 1000s of bytes per second processed. >> type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >> aes-256-gcm 21686.41k 23197.59k 23656.30k 23725.04k 23926.10k 23916.23k >> hmo@p48 ~ $ >> >> Kind regards, >> Helge > > So based on results from Manu, and Mark Millard, it seems almost every ARM platform is faster when it takes advantage of the CPU features, except the RPi4(B). As Manu pointed out, it doesn't appear to have the AES+PMULL feature, which means it must be something else that is slowing it down. What might help, is to try each feature in turn, and figure out which one is causing slower results. #define HWCAP_FP 0x00000001 #define HWCAP_ASIMD 0x00000002 #define HWCAP_EVTSTRM 0x00000004 #define HWCAP_AES 0x00000008 #define HWCAP_PMULL 0x00000010 #define HWCAP_SHA1 0x00000020 #define HWCAP_SHA2 0x00000040 #define HWCAP_CRC32 0x00000080 So try: env OPENSSL_armcap=1 openssl speed -evp aes-256-gcm as well as with armcap=2, 3 (both FP and ASIMD), 8 (just AES) etc. For ones where the CPU lacks the feature, it will crash with 'Illegal instruction' Separately, it might also be interesting to see the results of `openssl speed -evp sha256` before/after/with the different OPENSSL_armcap values -- Allan Jude From nobody Wed Nov 24 20:19:50 2021 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 7791518AA900; Wed, 24 Nov 2021 20:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzsn31KX8z3Cwl; Wed, 24 Nov 2021 20:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D27F10796; Wed, 24 Nov 2021 20:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOKJomL029390; Wed, 24 Nov 2021 20:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOKJoLs029389; Wed, 24 Nov 2021 20:19:50 GMT (envelope-from git) Date: Wed, 24 Nov 2021 20:19:50 GMT Message-Id: <202111242019.1AOKJoLs029389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: b0c7681ed739 - stable/12 - iser: Remove redundant linuxkpi MODULE_DEPEND 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b0c7681ed7398182de7b9026714c24ec20982796 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637785191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VmTa61eP4mwbByCpQ1UqA3untf7+Zp81zgfVaAqbY/s=; b=RDz5o/mnwwfGUYrffVBuyKKxHpbgYFBhSGRgC6f4aABrVoDbZMDKq6aXWmbQm1EJg0sFBO mASU/ctBaE9QWYullccMYpqKaI+kGTqfO4HI85/MLMVe0/gJ88vt+P0XyKBKYXuOzrw0Mh nPGBMrRwqlB1MY8OXA+Q9vUipwpRXdBzyedcq6aYJjzkArqFOiR49XZ/nU4AGD6TJoHl8o 2KTNDZCrp1Jbb+/zbX7wZDhCLo/c8yEpUj/McMAvc0ZIraHdwJ5dK2d9RF8V8yoZ3WLgRs c+a9VxmCEB30CmlnKUXaUaXyE1tC9/TaxCgn9WrOq9FuOKpnZCtBnmfs7Dd/zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637785191; a=rsa-sha256; cv=none; b=Llu0dG9HucMwrosdmctj2wByxRLxDzKn9ww3h/yQJIZyzvjXgJ4pL5gws4yZkuAWRPjg/l dFUK+uzt7jPTiAXqnJ+jX9GJ0JTiWKjYP9r94ODiYPv8lU9D9UdXKDJlwFgoio+CwENfhh VJoF2OiCpsdOUjOmCH81ET8izfTIdbCeoYZn8YrycM8MAJHGLxcmbcZKcdMthyQVQnmS78 ZMoxz2layhj0lnj50PSuBkiV5wRPCnhp0ZV2KAw0NOtBQWJ5AoWAhYu1A0fQIPcaKkJ/Qd GSTfflwsNaXEC7wpKOM1558Q+Zuqm5Wcrm/WT5lcrues4bZ0C86gLJRKEuYrgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=b0c7681ed7398182de7b9026714c24ec20982796 commit b0c7681ed7398182de7b9026714c24ec20982796 Author: Ka Ho Ng AuthorDate: 2021-11-15 06:04:08 +0000 Commit: Ka Ho Ng CommitDate: 2021-11-24 20:18:12 +0000 iser: Remove redundant linuxkpi MODULE_DEPEND Since ibcore depends on linuxkpi, there is no need to pull in the linuxkpi dependency in iser. Sponsored by: The FreeBSD Foundation Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D32977 (cherry picked from commit f7523c8a19d008412ccc969b12eeb756613f3678) --- sys/dev/iser/icl_iser.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/iser/icl_iser.c b/sys/dev/iser/icl_iser.c index 622178ab4dd3..dba3eaeb8587 100644 --- a/sys/dev/iser/icl_iser.c +++ b/sys/dev/iser/icl_iser.c @@ -565,5 +565,4 @@ moduledata_t icl_iser_data = { DECLARE_MODULE(icl_iser, icl_iser_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); MODULE_DEPEND(icl_iser, icl, 1, 1, 1); MODULE_DEPEND(icl_iser, ibcore, 1, 1, 1); -MODULE_DEPEND(icl_iser, linuxkpi, 1, 1, 1); MODULE_VERSION(icl_iser, 1); From nobody Wed Nov 24 20:20:03 2021 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 1997F18AA74B; Wed, 24 Nov 2021 20:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzsnH3bdwz3Csj; Wed, 24 Nov 2021 20:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DB97106EE; Wed, 24 Nov 2021 20:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOKK329031441; Wed, 24 Nov 2021 20:20:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOKK39a031439; Wed, 24 Nov 2021 20:20:03 GMT (envelope-from git) Date: Wed, 24 Nov 2021 20:20:03 GMT Message-Id: <202111242020.1AOKK39a031439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 35f26bdf5948 - stable/13 - iser: Remove redundant linuxkpi MODULE_DEPEND 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 35f26bdf5948bc8439a210292018738ea42ad3b0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637785203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zR61mkTv+tu0J3Ofq8X/nag+y/nbe8j1wCIwX3sqMaA=; b=Wrns/6/22knMRpQSebV8bndXuJlrNlsRQrNFgSD5dX8t0CxUES/6NWw6j5ToMlH+RzGwnE PwamH5MtMmTx+1+1PTy6W/1sor5amQm1iNOZ072mw8aI27BV3wED7NF99LgJyUCXiqqjM2 mazDlcm88T5UP0+EBRypHSc9NUeIQQdHdUwXHWzKN0/WDKQZ5kkRPW+OSP18GE9h3WMZ0h 3pp9mLJYOqvvZt63dCja3f7i194o1TBFuGF/TuAO28Y3Rum77hFxqs0RMRjqd7ki4rAUxw K+/atnXfLQ7FFo+pbsf452yUa45151E8vBjgqcO/JcnBJkHXeAPi8GtSgaMg7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637785203; a=rsa-sha256; cv=none; b=tH4yrJVlKep6ZVXWmWjuTBxaS2M5FpSWfyVXhxh/FOLiSeJ32YJgtOUjDAn/AeJ7hfwqNG LaksIOTqpy1ylBj4co4JWKaj2UCENrPPKJ05GlncfhIB5uiyzMiEf9ZSb7erdWYg4xGf82 O/dOtn2Ss10rg73s67kQjh9rosp4lFN2paT7UE0TrBqr28Q2lD8crRH+sFIXQC8dAbhQBS 1ILG9CSsq3gXduu74NpFMozlppaTak63PhSVQErrtfW3IuxWQepJFRSfD8UhLlRIa4ymXa 0wkrF2ZlqnEur2YGhUFbltmKiWLI+uN7xmIu/rLGo57//81ttakcaZHb8l9Tcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=35f26bdf5948bc8439a210292018738ea42ad3b0 commit 35f26bdf5948bc8439a210292018738ea42ad3b0 Author: Ka Ho Ng AuthorDate: 2021-11-15 06:04:08 +0000 Commit: Ka Ho Ng CommitDate: 2021-11-24 20:17:26 +0000 iser: Remove redundant linuxkpi MODULE_DEPEND Since ibcore depends on linuxkpi, there is no need to pull in the linuxkpi dependency in iser. Sponsored by: The FreeBSD Foundation Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D32977 (cherry picked from commit f7523c8a19d008412ccc969b12eeb756613f3678) --- sys/dev/iser/icl_iser.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/iser/icl_iser.c b/sys/dev/iser/icl_iser.c index be09a3649dd9..f3780a441e01 100644 --- a/sys/dev/iser/icl_iser.c +++ b/sys/dev/iser/icl_iser.c @@ -566,5 +566,4 @@ moduledata_t icl_iser_data = { DECLARE_MODULE(icl_iser, icl_iser_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); MODULE_DEPEND(icl_iser, icl, 1, 1, 1); MODULE_DEPEND(icl_iser, ibcore, 1, 1, 1); -MODULE_DEPEND(icl_iser, linuxkpi, 1, 1, 1); MODULE_VERSION(icl_iser, 1); From nobody Wed Nov 24 22:34:53 2021 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 B548518AF08A; Wed, 24 Nov 2021 22:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzwms2cB3z4rXM; Wed, 24 Nov 2021 22:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 397AF123B6; Wed, 24 Nov 2021 22:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOMYrfw016415; Wed, 24 Nov 2021 22:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOMYrwY016414; Wed, 24 Nov 2021 22:34:53 GMT (envelope-from git) Date: Wed, 24 Nov 2021 22:34:53 GMT Message-Id: <202111242234.1AOMYrwY016414@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: 3f539826e12e - stable/13 - nfsd: Fix f_bavail and f_ffree for NFSv4 when negative 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 3f539826e12e3177655add03f6297f49019ac08b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637793293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r7lwS9BumkqJVAHZ9TS954/+iyQUE2r1/NKRm71HD7g=; b=e/xuSIX2MgMTfqPozMofMT5oFn3wtFjSjNTh+dWPXmAditex1iCSn9Xv5qNPv3JtTmywwr WfsQhZoGwq4YhtT6oEWuPljQztiSPS5Tnh28eBilQtymS7qEXyqrj/VbP6F2lk3Lh2vRvw L29a1wc1AErKXaq1XDrGlDUg9JbTC6TENAb5AlYWzu+rgzL9JFzH5OLVTvOt6OS1uwYlaq dT1KWzkRFWcTdn6RT8ZY8krAsXjPoz5RNxj9xNKAlVvTsDyzdrhjUe6L+y40XSvqACqIlt YtKPgWoufkbeKX/yW9h6DSiLs09/cUePC5Bv1I5hQcf55WjAGe5VFEkAvYVrMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637793293; a=rsa-sha256; cv=none; b=T2/kjxoPAfQf3bIFm2piW6/+ZJAWdz0Z74pxXuAb6SAkBFQQABhLYFgG1yR1VFs2+bmq9n hOVxsJz+GYZesSYwLXK8C6I4TuvGfzxHRj/Z8QolaFmmKsw97NMhQ4XAjkgVN/zU6Xf0HA HxaOu7f0Pkm3Be40PvaGAYNiRtPoZZ6Wt8mabFucDynsATswyXvPs7CfxrxDp34oLhbUQD cHpnJUpCB4JXnfBCkzv7DZrYiI5zQmCClX4jeQm+rvfZ8sA3yITpgIh0V6Og4GZdJmBbfy NqTQouNXtlSvT6QWrl/7325VNS0T53ZZnSauwskrg7TkLg6kv9IlfuG89GJwlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3f539826e12e3177655add03f6297f49019ac08b commit 3f539826e12e3177655add03f6297f49019ac08b Author: Rick Macklem AuthorDate: 2021-11-08 20:59:31 +0000 Commit: Rick Macklem CommitDate: 2021-11-24 22:31:55 +0000 nfsd: Fix f_bavail and f_ffree for NFSv4 when negative Since the NFS Space_available and Files_available are unsigned, the NFSv3 server sets them to 0 when negative, so that they do not appear to be large positive values for non-FreeBSD clients. This patch fixes the NFSv4 server to do the same. Found during a recent IEFT NFSv4 working group testing event. (cherry picked from commit d70ca5b00eede3367ce659a03b2f9cc9729cd0dd) --- sys/fs/nfs/nfs_commonsubs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index c8534982ee0e..144b2e215496 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -2511,6 +2511,17 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, } NFSCLRSTATFS_ATTRBIT(retbitp); } + /* + * Since NFS handles these values as unsigned on the + * wire, there is no way to represent negative values, + * so set them to 0. Without this, they will appear + * to be very large positive values for clients like + * Solaris10. + */ + if (fs->f_bavail < 0) + fs->f_bavail = 0; + if (fs->f_ffree < 0) + fs->f_ffree = 0; } #endif From nobody Wed Nov 24 22:38:53 2021 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 94B7E18B20A5; Wed, 24 Nov 2021 22:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzwsT2bSWz4tMt; Wed, 24 Nov 2021 22:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35A5712522; Wed, 24 Nov 2021 22:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOMcrTb016837; Wed, 24 Nov 2021 22:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOMcrkl016836; Wed, 24 Nov 2021 22:38:53 GMT (envelope-from git) Date: Wed, 24 Nov 2021 22:38:53 GMT Message-Id: <202111242238.1AOMcrkl016836@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: 354988ca3f9d - stable/13 - nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 354988ca3f9db745ce0734ef1bda2daba584f723 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637793533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QnEoioRmOq4m0kxphxCSUugkn92UKTAa/PF5vB0KFR0=; b=dZjYEF9B3L/H6tdATj5tU+h0yrf9rMcFOZZ4Q+nnS6ealtEjB3ltlj1Eb9nF629jkOW73m Lzo5aAoaXSab98SBJuI5QqEmpC5OvH9uQp2+ossFEK9z+G/xBksk5iFcjOh7KVQd/eZyf4 uKwGsf5ZNx+Gch1iRInO4nF9gBZc5xJBa8Z548lUFe6yiXNeF8w4qydRVKTo6hOPS0YUVB rVpri5yEn7VfDCDhaDZM5S3Ws6SnS2hxGAW7B7cTRAWdtBogSsWXQhomni5FfQgfNMR2yO R+BYn/x3x4ELVal4v537wZlo9oFTvArmlR+ji/Yab6UJo+z03IGOKPIQpZuUVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637793533; a=rsa-sha256; cv=none; b=UbSkQn9Pr7Jr0dWhx25PkBkJ7j7XquwZFi2NnHP+HFfjTj94KbeuCmVTtn1u6muT3RJvE6 gITs7qPuAGJ4qNgn8dujB2dhKXHDyvvDZjtBHjOLmSBw4zov/DJ2/Phn0xYMGHe2U08AMe cugbz69nTj4kG+U5RxTFu1uF4XBc84d78qx+1dyr8zqiwmPJIsDSpBJ/tq85EZNB0UEtFQ UahMrg/dx/o1MscJbr4JBQBR/qrtK9mR4GBTX0lK4rviWM6qYhSMbkMKWfiQrQ9wiStQrq l+k9+VNHiywW7/F2RElJmdojpCMGz1mUo9SYGFQTgJWdFLnJ1c4IdwByfQKHtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=354988ca3f9db745ce0734ef1bda2daba584f723 commit 354988ca3f9db745ce0734ef1bda2daba584f723 Author: Rick Macklem AuthorDate: 2021-11-08 23:58:00 +0000 Commit: Rick Macklem CommitDate: 2021-11-24 22:35:03 +0000 nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError If a pNFS server's DS runs out of disk space, it replies NFSERR_NOSPC to the client doing writing. For the Linux client, it then sends a LayoutError RPC to the MDS server to tell it about the error and keeps retrying, doing repeated LayoutGets to the MDS and Write RPCs to the DS. The Linux client is "stuck" until disk space on the DS is free'd up unless a subsequent LayoutGet request is sent a NFSERR_NOSPC reply. The looping problem still occurs for NFSv4.1 mounts, but no fix for this is known at this time. This patch changes the pNFS MDS server to reply to LayoutGet operations with NFSERR_NOSPC once a LayoutError reports the problem, until the DS has available space. This keeps the Linux NFSv4.2 from looping. Found during recent testing because of issues w.r.t. a DS being out of space found during a recent IEFT NFSv4 working group testing event. (cherry picked from commit f8dc06303bac39be53872de7429aa54694b3f86a) --- sys/fs/nfs/nfs_var.h | 2 ++ sys/fs/nfs/nfsrvstate.h | 3 +++ sys/fs/nfsserver/nfs_nfsdport.c | 53 +++++++++++++++++++++++++++++++++++++++ sys/fs/nfsserver/nfs_nfsdserv.c | 4 +++ sys/fs/nfsserver/nfs_nfsdsocket.c | 3 +++ sys/fs/nfsserver/nfs_nfsdstate.c | 53 +++++++++++++++++++++++++++++++++++++-- 6 files changed, 116 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index b45143067c46..1f20c1cb76a8 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -170,6 +170,7 @@ int nfsrv_copymr(vnode_t, vnode_t, vnode_t, struct nfsdevice *, int nfsrv_mdscopymr(char *, char *, char *, char *, int *, char *, NFSPROC_T *, struct vnode **, struct vnode **, struct pnfsdsfile **, struct nfsdevice **, struct nfsdevice **); +void nfsrv_marknospc(char *, bool); /* nfs_nfsdserv.c */ int nfsrvd_access(struct nfsrv_descript *, int, @@ -762,6 +763,7 @@ int nfsvno_listxattr(struct vnode *, uint64_t, struct ucred *, struct thread *, void nfsm_trimtrailing(struct nfsrv_descript *, struct mbuf *, char *, int, int); bool nfsrv_checkwrongsec(struct nfsrv_descript *, int, enum vtype); +void nfsrv_checknospc(void); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 427d5b132281..9eebeece9727 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -132,6 +132,7 @@ struct nfslayout { nfsv4stateid_t lay_stateid; nfsquad_t lay_clientid; fhandle_t lay_fh; + char lay_deviceid[NFSX_V4DEVICEID]; fsid_t lay_fsid; uint32_t lay_layoutlen; uint16_t lay_mirrorcnt; @@ -147,6 +148,7 @@ struct nfslayout { #define NFSLAY_RECALL 0x0004 #define NFSLAY_RETURNED 0x0008 #define NFSLAY_CALLB 0x0010 +#define NFSLAY_NOSPC 0x0020 /* * Structure for an NFSv4.1 session. @@ -353,6 +355,7 @@ struct nfsdevice { char *nfsdev_host; fsid_t nfsdev_mdsfsid; uint32_t nfsdev_nextdir; + bool nfsdev_nospc; vnode_t nfsdev_dsdir[0]; }; diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index f48e57e449c9..bd833f1c375a 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -6733,6 +6733,59 @@ nfsrv_checkwrongsec(struct nfsrv_descript *nd, int nextop, enum vtype vtyp) return (true); } +/* + * Check DSs marked no space. + */ +void +nfsrv_checknospc(void) +{ + struct statfs *tsf; + struct nfsdevice *ds; + struct vnode **dvpp, **tdvpp, *dvp; + char *devid, *tdevid; + int cnt, error = 0, i; + + if (nfsrv_devidcnt <= 0) + return; + dvpp = mallocarray(nfsrv_devidcnt, sizeof(*dvpp), M_TEMP, M_WAITOK); + devid = malloc(nfsrv_devidcnt * NFSX_V4DEVICEID, M_TEMP, M_WAITOK); + tsf = malloc(sizeof(*tsf), M_TEMP, M_WAITOK); + + /* Get an array of the dvps for the DSs. */ + tdvpp = dvpp; + tdevid = devid; + i = 0; + NFSDDSLOCK(); + /* First, search for matches for same file system. */ + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (ds->nfsdev_nmp != NULL && ds->nfsdev_nospc) { + if (++i > nfsrv_devidcnt) + break; + *tdvpp++ = ds->nfsdev_dvp; + NFSBCOPY(ds->nfsdev_deviceid, tdevid, NFSX_V4DEVICEID); + tdevid += NFSX_V4DEVICEID; + } + } + NFSDDSUNLOCK(); + + /* Do a VFS_STATFS() for each of the DSs and clear no space. */ + cnt = i; + tdvpp = dvpp; + tdevid = devid; + for (i = 0; i < cnt && error == 0; i++) { + dvp = *tdvpp++; + error = VFS_STATFS(dvp->v_mount, tsf); + if (error == 0 && tsf->f_bavail > 0) { + NFSD_DEBUG(1, "nfsrv_checknospc: reset nospc\n"); + nfsrv_marknospc(tdevid, false); + } + tdevid += NFSX_V4DEVICEID; + } + free(tsf, M_TEMP); + free(dvpp, M_TEMP); + free(devid, M_TEMP); +} + extern int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *); /* diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 0e447778d639..f5ff9f8fab83 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -5052,6 +5052,10 @@ nfsrvd_layouterror(struct nfsrv_descript *nd, __unused int isdgram, if (stat != NFSERR_ACCES && stat != NFSERR_STALE && stat != NFSERR_NOSPC) nfsrv_delds(devid, curthread); + + /* For NFSERR_NOSPC, mark all deviceids and layouts. */ + if (stat == NFSERR_NOSPC) + nfsrv_marknospc(devid, true); } nfsmout: vput(vp); diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index 85771974be2f..002236113068 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -722,6 +722,9 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, p = curthread; + /* Check for and optionally clear the no space flags for DSs. */ + nfsrv_checknospc(); + NFSVNO_EXINIT(&vpnes); NFSVNO_EXINIT(&savevpnes); /* diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 797b9b0a466e..e6a919093738 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -6817,9 +6817,14 @@ nfsrv_layoutget(struct nfsrv_descript *nd, vnode_t vp, struct nfsexstuff *exp, NFSD_DEBUG(1, "ret layout too small\n"); return (NFSERR_TOOSMALL); } - if (*iomode == NFSLAYOUTIOMODE_RW) + if (*iomode == NFSLAYOUTIOMODE_RW) { + if ((lyp->lay_flags & NFSLAY_NOSPC) != 0) { + NFSUNLOCKLAYOUT(lhyp); + NFSD_DEBUG(1, "ret layout nospace\n"); + return (NFSERR_NOSPC); + } lyp->lay_flags |= NFSLAY_RW; - else + } else lyp->lay_flags |= NFSLAY_READ; NFSBCOPY(lyp->lay_xdr, layp, lyp->lay_layoutlen); *layoutlenp = lyp->lay_layoutlen; @@ -6892,6 +6897,7 @@ nfsrv_filelayout(struct nfsrv_descript *nd, int iomode, fhandle_t *fhp, NFSBCOPY(fhp, &lyp->lay_fh, sizeof(*fhp)); lyp->lay_clientid.qval = nd->nd_clientid.qval; lyp->lay_fsid = fs; + NFSBCOPY(devid, lyp->lay_deviceid, NFSX_V4DEVICEID); /* Fill in the xdr for the files layout. */ tl = (uint32_t *)lyp->lay_xdr; @@ -6941,6 +6947,7 @@ nfsrv_flexlayout(struct nfsrv_descript *nd, int iomode, int mirrorcnt, lyp->lay_clientid.qval = nd->nd_clientid.qval; lyp->lay_fsid = fs; lyp->lay_mirrorcnt = mirrorcnt; + NFSBCOPY(devid, lyp->lay_deviceid, NFSX_V4DEVICEID); /* Fill in the xdr for the files layout. */ tl = (uint32_t *)lyp->lay_xdr; @@ -7015,6 +7022,10 @@ nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_t *layp, int maxcnt, if (stat != NFSERR_ACCES && stat != NFSERR_STALE && stat != NFSERR_NOSPC) nfsrv_delds(devid, p); + + /* For NFSERR_NOSPC, mark all devids and layouts. */ + if (stat == NFSERR_NOSPC) + nfsrv_marknospc(devid, true); } } } @@ -8773,3 +8784,41 @@ nfsrv_findmirroredds(struct nfsmount *nmp) } return (fndds); } + +/* + * Mark the appropriate devid and all associated layout as "out of space". + */ +void +nfsrv_marknospc(char *devid, bool setit) +{ + struct nfsdevice *ds; + struct nfslayout *lyp; + struct nfslayouthash *lhyp; + int i; + + NFSDDSLOCK(); + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (NFSBCMP(ds->nfsdev_deviceid, devid, NFSX_V4DEVICEID) == 0) { + NFSD_DEBUG(1, "nfsrv_marknospc: devid %d\n", setit); + ds->nfsdev_nospc = setit; + } + } + NFSDDSUNLOCK(); + + for (i = 0; i < nfsrv_layouthashsize; i++) { + lhyp = &nfslayouthash[i]; + NFSLOCKLAYOUT(lhyp); + TAILQ_FOREACH(lyp, &lhyp->list, lay_list) { + if (NFSBCMP(lyp->lay_deviceid, devid, + NFSX_V4DEVICEID) == 0) { + NFSD_DEBUG(1, "nfsrv_marknospc: layout %d\n", + setit); + if (setit) + lyp->lay_flags |= NFSLAY_NOSPC; + else + lyp->lay_flags &= ~NFSLAY_NOSPC; + } + } + NFSUNLOCKLAYOUT(lhyp); + } +} From nobody Thu Nov 25 00:36:13 2021 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 3EA9118A3E2D; Thu, 25 Nov 2021 00:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzzSs6fpxz4hyN; Thu, 25 Nov 2021 00:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0B6E13C24; Thu, 25 Nov 2021 00:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AP0aDln075680; Thu, 25 Nov 2021 00:36:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AP0aDEN075679; Thu, 25 Nov 2021 00:36:13 GMT (envelope-from git) Date: Thu, 25 Nov 2021 00:36:13 GMT Message-Id: <202111250036.1AP0aDEN075679@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: 6e8e261f0d4e - stable/13 - nfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6e8e261f0d4e8b71e2a7ab74a05e0ed7cae5704a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637800573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OUKh27L1MEORK3Fn/WplBZX96NWC0R9OXUi0NdzTIfc=; b=wBTzM7gwNjMiVRPWwkxwNrAtXyUCo1o7/tWu3Finyq1fxEoZyKbdTOoJEXYTbmSIKekx2k 4M5Os96KwPBKItZHd9kJ6WqRgBe+wKego+Xcg3TybsbTFdtj+7kRX/XZAc93PpsaBDmOBI kmegzxF4g7MmnQy6jNeBzO4vA1WIu4CkiyXI86uVl7cDAE+UakCqx6O585NiYu0xdY+ZMb dWroQkPWtyJasOKVBwhfO7gWUwp//yw9ZgpbfYkNJy+K9A4UsNHl8TY3a1iV/d5AEADLrt kfHupau7vNsfIvcODyKUKREBf44zRZ5Ugpd1rcYm8m8zgKwmdy/noTI0V5uKIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637800573; a=rsa-sha256; cv=none; b=SdDbBe2z/LZRHwnjPYNDxua4CJ+sxAVwN2BA4sTh6yokfRQqiRMR936Bb2ivxJJZZbH1td ohpala+irnW5BqzYQGMuDR7T5dI48N7pauV3lNRDOT7s5Cy9jKC36CfrAfVHclmTdh+Rb9 XukExV2o6uvdZ3NCimzBhM9yxz8gU3XQIf6iOcdQjjtDgGuC2weFOGQg3de/LBhnaRwttD BkqRTXwheCEnF+YS8puaXuw2CgPI1QPZyazmvQfLWM+/bTgEJsm27dJfjiGxnDTKnotTZN GvRVlVIkBM91u/cXMhZTxPEVcpHmrEqF6ESS+QsuUo3VMeNjWYmwscKZy8Suow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6e8e261f0d4e8b71e2a7ab74a05e0ed7cae5704a commit 6e8e261f0d4e8b71e2a7ab74a05e0ed7cae5704a Author: Rick Macklem AuthorDate: 2021-11-11 23:43:58 +0000 Commit: Rick Macklem CommitDate: 2021-11-25 00:32:09 +0000 nfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts If a pNFS server's DS runs out of disk space, it replies NFSERR_NOSPC to the client doing writing. For the Linux client, it then sends a LayoutError RPC to the MDS server to tell it about the error. This patch adds the same to the FreeBSD NFSv4.2 pNFS client, to maintain Linux compatible behaviour, particlularily for non-FreeBSD pNFS servers. (cherry picked from commit 44744f75386e2102584acbca24fbe67de16051ca) --- sys/fs/nfs/nfs_commonsubs.c | 8 ++++-- sys/fs/nfs/nfsport.h | 15 ++++++++--- sys/fs/nfs/nfsproto.h | 11 +++++++- sys/fs/nfsclient/nfs_clrpcops.c | 56 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 144b2e215496..58d517b0b13d 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -215,7 +215,7 @@ static struct nfsrv_lughash *nfsgroupnamehash; static int nfs_bigreply[NFSV42_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0 }; + 1, 0, 0, 1, 0, 0, 0, 0 }; /* local functions */ static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep); @@ -299,6 +299,9 @@ static struct { { NFSV4OP_REMOVEXATTR, 2, "Rmxattr", 7, }, { NFSV4OP_LISTXATTRS, 2, "Listxattr", 9, }, { NFSV4OP_BINDCONNTOSESS, 1, "BindConSess", 11, }, + { NFSV4OP_LOOKUP, 5, "LookupOpen", 10, }, + { NFSV4OP_DEALLOCATE, 2, "Deallocate", 10, }, + { NFSV4OP_LAYOUTERROR, 1, "LayoutError", 11, }, }; /* @@ -307,7 +310,8 @@ static struct { static int nfs_bigrequest[NFSV42_NPROCS] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0 }; /* diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index cb82666ab397..5dcce15f7f64 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -415,10 +415,19 @@ /* BindConnectionToSession, done by the krpc for a new connection. */ #define NFSPROC_BINDCONNTOSESS 65 +/* Do a Lookup+Open for "oneopenown". */ +#define NFSPROC_LOOKUPOPEN 66 + +/* Do an NFSv4.2 Deallocate. */ +#define NFSPROC_DEALLOCATE 67 + +/* Do an NFSv4.2 LayoutError. */ +#define NFSPROC_LAYOUTERROR 68 + /* * Must be defined as one higher than the last NFSv4.2 Proc# above. */ -#define NFSV42_NPROCS 66 +#define NFSV42_NPROCS 69 #endif /* NFS_V3NPROCS */ @@ -447,7 +456,7 @@ struct nfsstatsv1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV42_NPROCS + 14]; + uint64_t rpccnt[NFSV42_NPROCS + 11]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; uint64_t reserved_0; @@ -512,7 +521,7 @@ struct nfsstatsov1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV42_NPROCS + 3]; + uint64_t rpccnt[NFSV42_NPROCS]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; uint64_t reserved_0; diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index 13e146154805..968cc6a41cc3 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -396,10 +396,19 @@ /* BindConnectionToSession, done by the krpc for a new connection. */ #define NFSPROC_BINDCONNTOSESS 65 +/* Do a Lookup+Open for "oneopenown". */ +#define NFSPROC_LOOKUPOPEN 66 + +/* Do an NFSv4.2 Deallocate. */ +#define NFSPROC_DEALLOCATE 67 + +/* Do an NFSv4.2 LayoutError. */ +#define NFSPROC_LAYOUTERROR 68 + /* * Must be defined as one higher than the last NFSv4.2 Proc# above. */ -#define NFSV42_NPROCS 66 +#define NFSV42_NPROCS 69 #endif /* NFS_V3NPROCS */ diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 6489569f8acf..b616cd729ab1 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -147,6 +147,9 @@ static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, u_int32_t, struct ucred *, NFSPROC_T *, int); static int nfsrpc_setaclrpc(vnode_t, struct ucred *, NFSPROC_T *, struct acl *, nfsv4stateid_t *, void *); +static int nfsrpc_layouterror(struct nfsmount *, uint8_t *, int, uint64_t, + uint64_t, nfsv4stateid_t *, struct ucred *, NFSPROC_T *, uint32_t, + uint32_t, char *); static int nfsrpc_getlayout(struct nfsmount *, vnode_t, struct nfsfh *, int, uint32_t, uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, struct ucred *, NFSPROC_T *); @@ -5459,6 +5462,44 @@ nfsmout: return (error); } +/* + * Do the NFSv4.2 LayoutError. + */ +static int +nfsrpc_layouterror(struct nfsmount *nmp, uint8_t *fh, int fhlen, uint64_t offset, + uint64_t len, nfsv4stateid_t *stateidp, struct ucred *cred, NFSPROC_T *p, + uint32_t stat, uint32_t op, char *devid) +{ + uint32_t *tl; + struct nfsrv_descript nfsd, *nd = &nfsd; + int error; + + nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, + 0, 0); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + + NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); + txdr_hyper(offset, tl); tl += 2; + txdr_hyper(len, tl); tl += 2; + *tl++ = txdr_unsigned(stateidp->seqid); + *tl++ = stateidp->other[0]; + *tl++ = stateidp->other[1]; + *tl++ = stateidp->other[2]; + *tl++ = txdr_unsigned(1); + NFSBCOPY(devid, tl, NFSX_V4DEVICEID); + tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); + *tl++ = txdr_unsigned(stat); + *tl = txdr_unsigned(op); + nd->nd_flag |= ND_USEGSSNAME; + error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, + NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); + if (error != 0) + return (error); + if (nd->nd_repstat != 0) + error = nd->nd_repstat; + m_freem(nd->nd_mrep); + return (error); +} + /* * Acquire a layout and devinfo, if possible. The caller must have acquired * a reference count on the nfsclclient structure before calling this. @@ -5798,6 +5839,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, size_t iovlen = 0; off_t offs = 0; ssize_t resid = 0; + uint32_t op; if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 || (np->n_flag & NNOLAYOUT) != 0) @@ -5977,6 +6019,20 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, NFSLOCKMNT(nmp); nmp->nm_state |= NFSSTA_OPENMODE; NFSUNLOCKMNT(nmp); + } else if ((error == NFSERR_NOSPC || + error == NFSERR_IO || error == NFSERR_NXIO) && + nmp->nm_minorvers == NFSV42_MINORVERSION) { + if (docommit != 0) + op = NFSV4OP_COMMIT; + else if (rwaccess == NFSV4OPEN_ACCESSREAD) + op = NFSV4OP_READ; + else + op = NFSV4OP_WRITE; + nfsrpc_layouterror(nmp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len, off, xfer, + &layp->nfsly_stateid, newcred, p, error, op, + dip->nfsdi_deviceid); + error = EIO; } else error = EIO; if (error == 0) From nobody Thu Nov 25 00:42:57 2021 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 C013418A7AFE; Thu, 25 Nov 2021 00:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzzcd3QXgz4lb1; Thu, 25 Nov 2021 00:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55AB513DAF; Thu, 25 Nov 2021 00:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AP0gvuY088622; Thu, 25 Nov 2021 00:42:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AP0gvCH088621; Thu, 25 Nov 2021 00:42:57 GMT (envelope-from git) Date: Thu, 25 Nov 2021 00:42:57 GMT Message-Id: <202111250042.1AP0gvCH088621@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: 0c8684ae2001 - stable/13 - param.h: Bump __FreeBSD_version to 1300522 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 0c8684ae20019b63c6672cc9fa40e1426708b007 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637800977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWnIN8M88EA5tmUKc37gb64Pdzasve2DmwJk4GYaodw=; b=lXc2qxCS5AkzhIaanCQnfCrSEWlFaGRUL3zvCEKLfEUComRTgseqNw9dozMtW+dnF6xOdz 9IMZyXqFb06r3bLaadbvyebtqV/P3RcSvq0orLCWNkeFz4hahlRNEt5ozTO/UMBipm1Zp+ pTZ/z6+BsRInsIlkrcn5lkauKeue+M6mR72WMxGP/JzNyU4boIoyKOpHSu0e3A8WEmaQMa iGlJXSHySdAXqyNra0xpgKB0QhQY/nDAEP17WUi/MGwpwVCn6LWGWDmH0ulhsRN+O9F1D1 rFE8LzEAEQPQdDM4VEEzqvBJj3MR9aXJ0bdFzgIyr67ujI0HOA7aFUf66yvCdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637800977; a=rsa-sha256; cv=none; b=DKvYdZp1n41F5czNjfM6oEQNkFtWkqGTmPEMWHmTHeGqAPcaU06Oa3QtU0jkhAGZwzvINx op9FGD/huVuW0hEBK2lArDIaUJExzbeG22DeRvrofCxC/dsNPE2HHx5cGgtBFSQPD17HA0 YKjIobFc6qXAkaZVm45oJHvuwismYhAEmwubvo0h3td71TbA4FboTbxq6hR/5MHXaI8gtl xMl0WtEr5RfAhw7DpbS9V9txc2NWUd+x8pjfD2p362D5ATz/h61WryUEk917mnydRcH11W qvwKE3MIros6ypc7VKc+UgiAj9QUd29SjAHJh/8YGxf2pQOjkf5vFqx2gCOGbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0c8684ae20019b63c6672cc9fa40e1426708b007 commit 0c8684ae20019b63c6672cc9fa40e1426708b007 Author: Rick Macklem AuthorDate: 2021-11-25 00:39:52 +0000 Commit: Rick Macklem CommitDate: 2021-11-25 00:39:52 +0000 param.h: Bump __FreeBSD_version to 1300522 Commit 6e8e261f0d4e changed the internal KAPI between the NFS modules. Bump __FreeBSD_version to 1300522. This is a direct commit. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 8baeb865e158..66133b80f262 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300521 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300522 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Nov 25 00:50:01 2021 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 ED06D18ABD52; Thu, 25 Nov 2021 00:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzzmn4sVqz4p9n; Thu, 25 Nov 2021 00:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88CE3140CF; Thu, 25 Nov 2021 00:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AP0o1kk090895; Thu, 25 Nov 2021 00:50:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AP0o1gc090884; Thu, 25 Nov 2021 00:50:01 GMT (envelope-from git) Date: Thu, 25 Nov 2021 00:50:01 GMT Message-Id: <202111250050.1AP0o1gc090884@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: f4e3699069b3 - stable/13 - UPDATING: Add an entry for commit 6e8e261f0d4e 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: f4e3699069b3c3a50b7d1072bdb5ba116b4249b1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637801401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dGPLK1O3HulLAiBgYyVuimHsYMj0A1T60H7I8PXNitM=; b=ck+JYaUdC8lX2Z7XJYvw1S+mig3OYf9HefuJ/AY6fbtcaYLUH+iHcWdo+jH6EKa3EE1FbG V/eswwTh5RDrjkAl9TBYnfpBUcubvVsTgevFCzbjPUK0KVWG1thO8fn64FiQd1u7bvn3Wc TCK5dR3wjFD5T0EXexgtcUgET1RvZTJiDFMonwHcwhFGPsCQNT3ZmfVLHKAR13T1DUoLrO d9lx4SvKxGjWRHy/rjLnEDb9PYfs9TcHNU8+yePfsXk8TLl8WiexGR6DjQKDVBiUYSEcpZ dJfznmnPCBj2GJ/PVZXArlzUJGg1TgW/mbQR8i1xmP7FtvpqHuJdzsmXFNtoCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637801401; a=rsa-sha256; cv=none; b=WncAvUmIoONTZSOIwkIy36uq/15JGv+phkeQEV/pcj0w593Z5XBkXFnoHy7IzDGdk5II4p P49zylg5VeXZGxUqdL9D1mJDqzj78YG1bkwGRg1gJhPdRLe4Kp4WUGK1qrPR2Skw542pLp j30Atd763doJtObfNH+Aws9PCKm8uVfa2KgVI9xEf92uyW7SVx/Na39f6ERJDj38TbwjF9 RrRWY3YUUvkXsWWgVZOyWc2zmq+5fKffauDljHKz4cPmmXErzexNCdZGMrz1OWaDlWl4ff pe2yMWwc90SiOMiJp9/rchbwAcQFllRsA9MAJgPwMy5uvGiEZH3vinZpAbTCDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f4e3699069b3c3a50b7d1072bdb5ba116b4249b1 commit f4e3699069b3c3a50b7d1072bdb5ba116b4249b1 Author: Rick Macklem AuthorDate: 2021-11-25 00:47:03 +0000 Commit: Rick Macklem CommitDate: 2021-11-25 00:47:03 +0000 UPDATING: Add an entry for commit 6e8e261f0d4e This is a direct commit. --- UPDATING | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPDATING b/UPDATING index 7837566e82a7..291037901387 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20211124: + Commit 6e8e261f0d4e changed the internal KAPI between the NFS + modules. As such, all the modules must be rebuilt from sources. + __FreeBSD_version has been bumped to 1300522. + 20211119: Bump __FreeBSD_version to 1300521 after merging LinuxKPI and net80211 changes in order to support building various wireless From nobody Thu Nov 25 01:09:39 2021 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 6A8C818B594E; Thu, 25 Nov 2021 01:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J00CS0Z8tz4wDq; Thu, 25 Nov 2021 01:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E75DF14258; Thu, 25 Nov 2021 01:09:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AP19dUR017078; Thu, 25 Nov 2021 01:09:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AP19dGj017077; Thu, 25 Nov 2021 01:09:39 GMT (envelope-from git) Date: Thu, 25 Nov 2021 01:09:39 GMT Message-Id: <202111250109.1AP19dGj017077@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: 83271c68c4f4 - stable/13 - Fix some modules to export more used symbols 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 83271c68c4f4697ba15d49cc3f31912a5d04ff4b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637802580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tb0a+SVg+cDXLjW1T6Iw4LlqLaiQTEs+6P/hy4o2HeE=; b=oJHctXltWsdrRzwob4g0duQiFLP3qBsaEwyd2W3Fhet/UqpL3w+VKneJipKERYJThAVUD3 hNYE3uiesWygTwNcI43MMOniPMczTPFleZIGtXBCToNoYtqhXbQjk5wOmguSqL2rzBDB7I aN9hnRtx0AaOsJW65WQcc7XicAqS3Ns/OupJtGleTHuakbKKuEyHS5uBt3B3+zNY5O4MBH o6050Edhvrg30+iqSjdl4j4H/ZS4jeERdNGFVY5TBG7DzBHRn1qrUUfaJDhVcI+0m5HuUu AvbjeH541ksqMlKFF5c6/h2JFyogBkZytwFNXgYEY1qxEPze1pKkrUW6qoo+kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637802580; a=rsa-sha256; cv=none; b=FjCltf30Dhq8SbQpFPeHuUgTBJd0Qios3BOp36hftaSIpyEpmY0HSCUP6dgPh6/ITVzw9s 32aLlzduMa3BImn8mQoWXifXsG/VyyJZ9qxlsNqBspKc89AS584hWWMRIuc9Ypi6Altr7D XAbuRXpmCj9TeTwFwDAq17PE8suFJUXE+VeQe79K4kha3+eS6li3zpl5RBR6gxtf/ZVdV6 Ka2moANw1Dxc+Qs8A1KRPG4zwl7wCP4FYbkn3T+naRgwagLqHXW8+CzDMP+y42LpdJd9LJ 7nJ4ErqmSa1S33ZKuQmKvQxLxFhZI8dKbqcnhcB2iTOw5NxjTIrJ1sRV4/e9Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=83271c68c4f4697ba15d49cc3f31912a5d04ff4b commit 83271c68c4f4697ba15d49cc3f31912a5d04ff4b Author: Konstantin Belousov AuthorDate: 2021-11-07 08:42:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-25 01:09:21 +0000 Fix some modules to export more used symbols (cherry picked from commit 5bb3134a8c21cb87b30e135ef168483f0333dabb) --- sys/modules/aic7xxx/ahc/Makefile | 2 ++ sys/modules/alq/Makefile | 2 ++ sys/modules/amdsmn/Makefile | 2 ++ sys/modules/amr/Makefile | 2 ++ sys/modules/ata/atacore/Makefile | 2 ++ sys/modules/ata/atapci/Makefile | 2 ++ sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile | 2 ++ sys/modules/ath_hal/Makefile | 2 ++ sys/modules/backlight/Makefile | 2 ++ sys/modules/bhnd/Makefile | 4 +++- sys/modules/bhnd/bhndb/Makefile | 2 ++ sys/modules/bridgestp/Makefile | 2 ++ sys/modules/ctl/Makefile | 2 ++ sys/modules/cxgbe/if_cxgbe/Makefile | 2 ++ sys/modules/dcons/Makefile | 2 ++ sys/modules/efirt/Makefile | 2 ++ sys/modules/evdev/Makefile | 2 ++ sys/modules/exca/Makefile | 2 ++ sys/modules/firewire/firewire/Makefile | 2 ++ sys/modules/firmware/Makefile | 2 ++ sys/modules/geom/geom_flashmap/Makefile | 2 ++ sys/modules/gpio/gpiobus/Makefile | 2 ++ sys/modules/hid/hconf/Makefile | 2 ++ sys/modules/hid/hid/Makefile | 2 ++ sys/modules/hid/hidbus/Makefile | 2 ++ sys/modules/hid/hidmap/Makefile | 2 ++ sys/modules/hyperv/vmbus/Makefile | 2 ++ sys/modules/i2c/iicbb/Makefile | 2 ++ sys/modules/i2c/iicbus/Makefile | 2 ++ sys/modules/i2c/mux/iicmux/Makefile | 2 ++ sys/modules/i2c/smbus/Makefile | 2 ++ sys/modules/ibcore/Makefile | 2 ++ sys/modules/if_gif/Makefile | 2 ++ sys/modules/if_infiniband/Makefile | 2 ++ sys/modules/iflib/Makefile | 2 ++ sys/modules/ipfw/Makefile | 2 ++ sys/modules/iscsi/Makefile | 2 ++ sys/modules/ixl/Makefile | 2 ++ sys/modules/kgssapi/Makefile | 2 ++ sys/modules/krpc/Makefile | 2 ++ sys/modules/libalias/libalias/Makefile | 2 ++ sys/modules/linux/Makefile | 2 ++ sys/modules/linux64/Makefile | 2 ++ sys/modules/linux_common/Makefile | 4 ++-- sys/modules/linuxkpi/Makefile | 2 ++ sys/modules/mfi/Makefile | 2 ++ sys/modules/mii/Makefile | 8 +------- sys/modules/mlx4/Makefile | 2 ++ sys/modules/mlx5/Makefile | 2 ++ sys/modules/mlxfw/Makefile | 2 ++ sys/modules/netgraph/atm/atmbase/Makefile | 2 ++ sys/modules/netgraph/bluetooth/bluetooth/Makefile | 2 ++ sys/modules/netgraph/bluetooth/socket/Makefile | 2 ++ sys/modules/netgraph/netgraph/Makefile | 2 ++ sys/modules/nfscommon/Makefile | 2 ++ sys/modules/nfssvc/Makefile | 2 ++ sys/modules/ntb/ntb/Makefile | 2 ++ sys/modules/ntb/ntb_transport/Makefile | 2 ++ sys/modules/nvme/Makefile | 2 ++ sys/modules/ow/owc/Makefile | 2 ++ sys/modules/pf/Makefile | 2 ++ sys/modules/ppbus/Makefile | 7 +++++-- sys/modules/procfs/Makefile | 2 +- sys/modules/pseudofs/Makefile | 5 ++--- sys/modules/pwm/pwmbus/Makefile | 2 ++ sys/modules/rc4/Makefile | 2 ++ sys/modules/rtwn/Makefile | 2 ++ sys/modules/sdhci/Makefile | 2 ++ sys/modules/sound/driver/sbc/Makefile | 2 ++ sys/modules/sound/driver/spicds/Makefile | 2 ++ sys/modules/spi/spibus/Makefile | 2 ++ sys/modules/spigen/Makefile | 2 ++ sys/modules/superio/Makefile | 2 ++ sys/modules/sysvipc/sysvmsg/Makefile | 2 ++ sys/modules/sysvipc/sysvsem/Makefile | 2 ++ sys/modules/sysvipc/sysvshm/Makefile | 2 ++ sys/modules/toecore/Makefile | 2 ++ sys/modules/ufs/Makefile | 2 ++ sys/modules/usb/ucom/Makefile | 2 ++ sys/modules/usb/uether/Makefile | 2 ++ sys/modules/usb/uhid/Makefile | 2 ++ sys/modules/usb/usb/Makefile | 2 ++ sys/modules/virtio/virtio/Makefile | 2 ++ sys/modules/wlan/Makefile | 2 ++ sys/modules/xdr/Makefile | 2 ++ sys/modules/xz/Makefile | 2 ++ 86 files changed, 174 insertions(+), 16 deletions(-) diff --git a/sys/modules/aic7xxx/ahc/Makefile b/sys/modules/aic7xxx/ahc/Makefile index 41bf2d70c9a2..57451e77f2a1 100644 --- a/sys/modules/aic7xxx/ahc/Makefile +++ b/sys/modules/aic7xxx/ahc/Makefile @@ -52,4 +52,6 @@ cleanfirmware: clean CLEANFILES= ${GENSRCS} .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/alq/Makefile b/sys/modules/alq/Makefile index 911eeca73880..858f2a55ded7 100644 --- a/sys/modules/alq/Makefile +++ b/sys/modules/alq/Makefile @@ -4,4 +4,6 @@ KMOD= alq SRCS= opt_mac.h vnode_if.h kern_alq.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/amdsmn/Makefile b/sys/modules/amdsmn/Makefile index 1f030270e792..0e5e1b182548 100644 --- a/sys/modules/amdsmn/Makefile +++ b/sys/modules/amdsmn/Makefile @@ -5,4 +5,6 @@ KMOD= amdsmn SRCS= amdsmn.c bus_if.h device_if.h pci_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/amr/Makefile b/sys/modules/amr/Makefile index 1ee2ece51a16..a17ed246b8c7 100644 --- a/sys/modules/amr/Makefile +++ b/sys/modules/amr/Makefile @@ -16,4 +16,6 @@ SRCS= amr.c amr_pci.c amr_disk.c device_if.h bus_if.h pci_if.h # Debugging #CFLAGS+= -DAMR_DEBUG=3 +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ata/atacore/Makefile b/sys/modules/ata/atacore/Makefile index 9ecd03ed0ba5..f0cd0b4349d3 100644 --- a/sys/modules/ata/atacore/Makefile +++ b/sys/modules/ata/atacore/Makefile @@ -6,4 +6,6 @@ KMOD= ata SRCS= ata-all.c ata_if.c ata-lowlevel.c SRCS+= ata_if.h bus_if.h device_if.h opt_cam.h pci_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ata/atapci/Makefile b/sys/modules/ata/atapci/Makefile index 5aaa265000cf..bc00b57728ee 100644 --- a/sys/modules/ata/atapci/Makefile +++ b/sys/modules/ata/atapci/Makefile @@ -8,4 +8,6 @@ KMOD= atapci SRCS= ata-pci.c ata-dma.c ata-sata.c SRCS+= ata_if.h bus_if.h device_if.h pci_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile b/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile index 7e44778bc165..52e806366d0e 100644 --- a/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile +++ b/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile @@ -6,4 +6,6 @@ KMOD= atasiliconimage SRCS= ata-siliconimage.c SRCS+= ata_if.h bus_if.h device_if.h pci_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ath_hal/Makefile b/sys/modules/ath_hal/Makefile index 6b604c6e9dbb..902c32a95b19 100644 --- a/sys/modules/ath_hal/Makefile +++ b/sys/modules/ath_hal/Makefile @@ -44,4 +44,6 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include +EXPORT_SYMS= YES + CWARNFLAGS.ah_regdomain.c= ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} diff --git a/sys/modules/backlight/Makefile b/sys/modules/backlight/Makefile index 1c49d7b55138..31de4e804127 100644 --- a/sys/modules/backlight/Makefile +++ b/sys/modules/backlight/Makefile @@ -10,4 +10,6 @@ SRCS+= bus_if.h \ backlight_if.h \ backlight_if.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/bhnd/Makefile b/sys/modules/bhnd/Makefile index 18e5ad4c2149..54a72a11e28d 100644 --- a/sys/modules/bhnd/Makefile +++ b/sys/modules/bhnd/Makefile @@ -22,7 +22,7 @@ SRCS+= opt_platform.h SRCS+= bhnd_sprom_chipc.c \ bhnd_pmu_chipc.c - + SRCS+= bhnd_pwrctl.c \ bhnd_pwrctl_subr.c \ bhnd_pwrctl_if.c \ @@ -71,5 +71,7 @@ SUBDIR= bcma \ siba \ siba_bhndb +EXPORT_SYMS= YES + .include .include diff --git a/sys/modules/bhnd/bhndb/Makefile b/sys/modules/bhnd/bhndb/Makefile index 87ac5ef231bd..12fcde7e049f 100644 --- a/sys/modules/bhnd/bhndb/Makefile +++ b/sys/modules/bhnd/bhndb/Makefile @@ -15,4 +15,6 @@ SRCS+= bhnd_bus_if.h \ SRCS+= device_if.h bus_if.h pci_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/bridgestp/Makefile b/sys/modules/bridgestp/Makefile index 0bfd0caa1880..47a28cb8e7cd 100644 --- a/sys/modules/bridgestp/Makefile +++ b/sys/modules/bridgestp/Makefile @@ -5,4 +5,6 @@ KMOD= bridgestp SRCS= bridgestp.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ctl/Makefile b/sys/modules/ctl/Makefile index 49ba041ce224..5ff72216b329 100644 --- a/sys/modules/ctl/Makefile +++ b/sys/modules/ctl/Makefile @@ -28,4 +28,6 @@ SRCS+= opt_cam.h MFILES= kern/bus_if.m kern/device_if.m +EXPORT_SYMS= YES + .include diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile index f64e53c91a7a..7210d4e8835e 100644 --- a/sys/modules/cxgbe/if_cxgbe/Makefile +++ b/sys/modules/cxgbe/if_cxgbe/Makefile @@ -44,4 +44,6 @@ SRCS+= fastlz.c CFLAGS+= -I${CXGBE} +EXPORT_SYMS= YES + .include diff --git a/sys/modules/dcons/Makefile b/sys/modules/dcons/Makefile index be27ee22dae0..bdc86609c16c 100644 --- a/sys/modules/dcons/Makefile +++ b/sys/modules/dcons/Makefile @@ -17,4 +17,6 @@ opt_ddb.h: CFLAGS+= -I${SRCTOP}/sys +EXPORT_SYMS= YES + .include diff --git a/sys/modules/efirt/Makefile b/sys/modules/efirt/Makefile index 58f4f9673c2e..4d6e89bc5d07 100644 --- a/sys/modules/efirt/Makefile +++ b/sys/modules/efirt/Makefile @@ -17,4 +17,6 @@ efirt_support.o: efirt_support.S assym.inc ${.IMPSRC} -o ${.TARGET} .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/evdev/Makefile b/sys/modules/evdev/Makefile index 7bea12e3277f..5888825f4773 100644 --- a/sys/modules/evdev/Makefile +++ b/sys/modules/evdev/Makefile @@ -6,4 +6,6 @@ KMOD= evdev SRCS= cdev.c evdev.c evdev_mt.c evdev_utils.c SRCS+= opt_evdev.h bus_if.h device_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/exca/Makefile b/sys/modules/exca/Makefile index 5135ff24adb3..3b51f87b2827 100644 --- a/sys/modules/exca/Makefile +++ b/sys/modules/exca/Makefile @@ -5,4 +5,6 @@ KMOD= exca SRCS= exca.c device_if.h bus_if.h power_if.h card_if.h pccarddevs.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/firewire/firewire/Makefile b/sys/modules/firewire/firewire/Makefile index 72fa049d4326..9ce806ae96d1 100644 --- a/sys/modules/firewire/firewire/Makefile +++ b/sys/modules/firewire/firewire/Makefile @@ -11,4 +11,6 @@ SRCS = bus_if.h device_if.h pci_if.h \ iec13213.h iec68113.h \ fwcrom.c fwdev.c fwmem.c fwmem.h fwdma.c fwdma.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/firmware/Makefile b/sys/modules/firmware/Makefile index 7a9eb4522970..5b74a9dce24c 100644 --- a/sys/modules/firmware/Makefile +++ b/sys/modules/firmware/Makefile @@ -5,4 +5,6 @@ KMOD= firmware SRCS= subr_firmware.c vnode_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/geom/geom_flashmap/Makefile b/sys/modules/geom/geom_flashmap/Makefile index 8b56c145ea51..47e3d6105371 100644 --- a/sys/modules/geom/geom_flashmap/Makefile +++ b/sys/modules/geom/geom_flashmap/Makefile @@ -5,4 +5,6 @@ KMOD= geom_flashmap SRCS= geom_flashmap.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/gpio/gpiobus/Makefile b/sys/modules/gpio/gpiobus/Makefile index 458d56d8b935..6dc40a2a9d65 100644 --- a/sys/modules/gpio/gpiobus/Makefile +++ b/sys/modules/gpio/gpiobus/Makefile @@ -42,4 +42,6 @@ SRCS+= ofw_gpiobus.c CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/ +EXPORT_SYMS= YES + .include diff --git a/sys/modules/hid/hconf/Makefile b/sys/modules/hid/hconf/Makefile index 0ac8d969cd71..182d1d9fdf63 100644 --- a/sys/modules/hid/hconf/Makefile +++ b/sys/modules/hid/hconf/Makefile @@ -7,4 +7,6 @@ SRCS= hconf.c SRCS+= opt_hid.h SRCS+= bus_if.h device_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/hid/hid/Makefile b/sys/modules/hid/hid/Makefile index 81fc6c671ed2..749df79beff2 100644 --- a/sys/modules/hid/hid/Makefile +++ b/sys/modules/hid/hid/Makefile @@ -7,4 +7,6 @@ SRCS= hid.c hid_if.c SRCS+= opt_hid.h SRCS+= bus_if.h device_if.h hid_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/hid/hidbus/Makefile b/sys/modules/hid/hidbus/Makefile index e233e3e06f07..c2a452e1e9f2 100644 --- a/sys/modules/hid/hidbus/Makefile +++ b/sys/modules/hid/hidbus/Makefile @@ -6,4 +6,6 @@ KMOD= hidbus SRCS= hidbus.c SRCS+= bus_if.h device_if.h hid_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/hid/hidmap/Makefile b/sys/modules/hid/hidmap/Makefile index 00e7099b287b..e0c1c086e098 100644 --- a/sys/modules/hid/hidmap/Makefile +++ b/sys/modules/hid/hidmap/Makefile @@ -7,4 +7,6 @@ SRCS= hidmap.c SRCS+= opt_hid.h SRCS+= bus_if.h device_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/hyperv/vmbus/Makefile b/sys/modules/hyperv/vmbus/Makefile index 47a83e76204a..0aa489d8fa26 100644 --- a/sys/modules/hyperv/vmbus/Makefile +++ b/sys/modules/hyperv/vmbus/Makefile @@ -35,4 +35,6 @@ vmbus_vector.o: CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/include \ -I${SRCTOP}/sys/dev/hyperv/vmbus +EXPORT_SYMS= YES + .include diff --git a/sys/modules/i2c/iicbb/Makefile b/sys/modules/i2c/iicbb/Makefile index c7737f09e8b9..9b74a5da39d6 100644 --- a/sys/modules/i2c/iicbb/Makefile +++ b/sys/modules/i2c/iicbb/Makefile @@ -10,4 +10,6 @@ KMOD = iicbb SRCS = device_if.h bus_if.h iicbus_if.h \ iicbb_if.h iicbb_if.c iicbb.c ${ofw_bus_if} opt_platform.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/i2c/iicbus/Makefile b/sys/modules/i2c/iicbus/Makefile index 8923615ecada..c6d2822bc20d 100644 --- a/sys/modules/i2c/iicbus/Makefile +++ b/sys/modules/i2c/iicbus/Makefile @@ -24,4 +24,6 @@ SRCS+= acpi_iicbus.c opt_acpi.h acpi_if.h SRCS+= ofw_iicbus.c ofw_bus_if.h .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/i2c/mux/iicmux/Makefile b/sys/modules/i2c/mux/iicmux/Makefile index 1d642bf3e5ae..b3f52c6c926e 100644 --- a/sys/modules/i2c/mux/iicmux/Makefile +++ b/sys/modules/i2c/mux/iicmux/Makefile @@ -16,4 +16,6 @@ SRCS+= \ SRCS+= ofw_bus_if.h .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/i2c/smbus/Makefile b/sys/modules/i2c/smbus/Makefile index b5e78f223b89..0e25b78c6e4f 100644 --- a/sys/modules/i2c/smbus/Makefile +++ b/sys/modules/i2c/smbus/Makefile @@ -5,4 +5,6 @@ KMOD = smbus SRCS = device_if.h bus_if.h smbus_if.h smbus_if.c \ smbconf.h smbconf.c smbus.h smbus.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ibcore/Makefile b/sys/modules/ibcore/Makefile index ba1f65748117..9d0717cf7df8 100644 --- a/sys/modules/ibcore/Makefile +++ b/sys/modules/ibcore/Makefile @@ -39,4 +39,6 @@ CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include CFLAGS+= -DINET6 -DINET -DCONFIG_INFINIBAND_USER_MEM +EXPORT_SYMS= YES + .include diff --git a/sys/modules/if_gif/Makefile b/sys/modules/if_gif/Makefile index 5799a350c8ae..639aed0d94a5 100644 --- a/sys/modules/if_gif/Makefile +++ b/sys/modules/if_gif/Makefile @@ -10,4 +10,6 @@ SRCS= if_gif.c opt_inet.h opt_inet6.h SRCS.INET=in_gif.c SRCS.INET6=in6_gif.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/if_infiniband/Makefile b/sys/modules/if_infiniband/Makefile index ca5e7e3f44db..6593cd7d0574 100644 --- a/sys/modules/if_infiniband/Makefile +++ b/sys/modules/if_infiniband/Makefile @@ -7,4 +7,6 @@ SRCS= if_infiniband.c \ opt_inet.h \ opt_inet6.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/iflib/Makefile b/sys/modules/iflib/Makefile index e86fd7e82dd6..f598db2743dd 100644 --- a/sys/modules/iflib/Makefile +++ b/sys/modules/iflib/Makefile @@ -11,4 +11,6 @@ SRCS+= ifdi_if.c SRCS+= device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h SRCS+= opt_acpi.h opt_inet.h opt_inet6.h opt_sched.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ipfw/Makefile b/sys/modules/ipfw/Makefile index ae1b597d08ce..df9f451d1d0a 100644 --- a/sys/modules/ipfw/Makefile +++ b/sys/modules/ipfw/Makefile @@ -19,4 +19,6 @@ CFLAGS+= -DIPFIREWALL -I${SRCTOP}/sys/contrib/ck/include #CFLAGS+= -DIPFIREWALL_DEFAULT_TO_ACCEPT # +EXPORT_SYMS= YES + .include diff --git a/sys/modules/iscsi/Makefile b/sys/modules/iscsi/Makefile index 9b150f5c2213..e74f8ff132e2 100644 --- a/sys/modules/iscsi/Makefile +++ b/sys/modules/iscsi/Makefile @@ -22,4 +22,6 @@ CFLAGS+=-DICL_KERNEL_PROXY MFILES= kern/bus_if.m kern/device_if.m dev/iscsi/icl_conn_if.m +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ixl/Makefile b/sys/modules/ixl/Makefile index 2b524e974404..fb2fcf6574ac 100644 --- a/sys/modules/ixl/Makefile +++ b/sys/modules/ixl/Makefile @@ -22,4 +22,6 @@ SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c i40e_lan_hmc.c i40e_hmc.c i40e # CFLAGS += -DIXL_IW # SRCS += ixl_iw.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/kgssapi/Makefile b/sys/modules/kgssapi/Makefile index a720cdd6a487..a21524cb419a 100644 --- a/sys/modules/kgssapi/Makefile +++ b/sys/modules/kgssapi/Makefile @@ -51,4 +51,6 @@ gssd_xdr.c: $S/kgssapi/gssd.x gssd_clnt.c: $S/kgssapi/gssd.x RPCGEN_CPP=${CPP:Q} rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/krpc/Makefile b/sys/modules/krpc/Makefile index 72adceac32ce..e8946f0ba4ef 100644 --- a/sys/modules/krpc/Makefile +++ b/sys/modules/krpc/Makefile @@ -55,4 +55,6 @@ rpctlssd_xdr.c: $S/rpc/rpcsec_tls/rpctlssd.x rpctlssd_clnt.c: $S/rpc/rpcsec_tls/rpctlssd.x RPCGEN_CPP=${CPP:Q} rpcgen -lM $S/rpc/rpcsec_tls/rpctlssd.x | grep -v string.h > rpctlssd_clnt.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/libalias/libalias/Makefile b/sys/modules/libalias/libalias/Makefile index 655e67bebb5e..4da69ea972b0 100644 --- a/sys/modules/libalias/libalias/Makefile +++ b/sys/modules/libalias/libalias/Makefile @@ -5,4 +5,6 @@ KMOD= libalias SRCS= alias.c alias_db.c alias_proxy.c alias_util.c alias_mod.c alias_sctp.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 49d787e2cb99..fd027e2118df 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -90,4 +90,6 @@ linux${SFX}_genassym.o: offset.inc .warning Building Linuxulator outside of a kernel does not make sense .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index c081151e3fc5..994f4aff1dac 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -62,4 +62,6 @@ linux_genassym.o: offset.inc .warning Building Linuxulator outside of a kernel does not make sense .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile index c7d139e2fb9a..9197ba9454bc 100644 --- a/sys/modules/linux_common/Makefile +++ b/sys/modules/linux_common/Makefile @@ -9,8 +9,6 @@ SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ EXPORT_SYMS= EXPORT_SYMS+= linux_emul_path -EXPORT_SYMS+= linux_ioctl_register_handler -EXPORT_SYMS+= linux_ioctl_unregister_handler EXPORT_SYMS+= linux_get_osname EXPORT_SYMS+= linux_get_osrelease @@ -18,4 +16,6 @@ EXPORT_SYMS+= linux_get_osrelease .warning Building Linuxulator outside of a kernel does not make sense .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile index 514428a82509..0d69445e576b 100644 --- a/sys/modules/linuxkpi/Makefile +++ b/sys/modules/linuxkpi/Makefile @@ -38,4 +38,6 @@ SRCS+= ${LINUXKPI_GENSRCS} CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include +EXPORT_SYMS= YES + .include diff --git a/sys/modules/mfi/Makefile b/sys/modules/mfi/Makefile index 53f4164add7b..7a17f9b0f4fa 100644 --- a/sys/modules/mfi/Makefile +++ b/sys/modules/mfi/Makefile @@ -15,4 +15,6 @@ SRCS+= device_if.h bus_if.h pci_if.h #CFLAGS += -DMFI_DEBUG +EXPORT_SYMS= YES + .include diff --git a/sys/modules/mii/Makefile b/sys/modules/mii/Makefile index 5709af97b720..348c9b7b2845 100644 --- a/sys/modules/mii/Makefile +++ b/sys/modules/mii/Makefile @@ -13,12 +13,6 @@ SRCS+= smscphy.c tdkphy.c truephy.c SRCS+= ukphy.c ukphy_subr.c SRCS+= xmphy.c -EXPORT_SYMS= mii_attach \ - mii_bitbang_readreg \ - mii_bitbang_sync \ - mii_bitbang_writereg \ - mii_mediachg \ - mii_pollstat \ - mii_tick +EXPORT_SYMS= YES .include diff --git a/sys/modules/mlx4/Makefile b/sys/modules/mlx4/Makefile index cb140a59854f..96818c2ef3d0 100644 --- a/sys/modules/mlx4/Makefile +++ b/sys/modules/mlx4/Makefile @@ -30,6 +30,8 @@ CFLAGS+= -I${SRCTOP}/sys/ofed/include CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include +EXPORT_SYMS= YES + .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith diff --git a/sys/modules/mlx5/Makefile b/sys/modules/mlx5/Makefile index 26b46f8efdbd..87203b635bf7 100644 --- a/sys/modules/mlx5/Makefile +++ b/sys/modules/mlx5/Makefile @@ -50,6 +50,8 @@ SRCS+= \ mlx5fpga_ipsec.c .endif +EXPORT_SYMS= YES + .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} diff --git a/sys/modules/mlxfw/Makefile b/sys/modules/mlxfw/Makefile index 98817b3954b9..3ab9b0f3950d 100644 --- a/sys/modules/mlxfw/Makefile +++ b/sys/modules/mlxfw/Makefile @@ -14,4 +14,6 @@ CFLAGS+= \ -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz +EXPORT_SYMS= YES + .include diff --git a/sys/modules/netgraph/atm/atmbase/Makefile b/sys/modules/netgraph/atm/atmbase/Makefile index f495cdbbda78..68959693811e 100644 --- a/sys/modules/netgraph/atm/atmbase/Makefile +++ b/sys/modules/netgraph/atm/atmbase/Makefile @@ -15,4 +15,6 @@ SRCS= ngatmbase.c unimsg_common.c straddr.c \ CFLAGS+= -I${LIBBASE} # -DNGATM_DEBUG +EXPORT_SYMS= YES + .include diff --git a/sys/modules/netgraph/bluetooth/bluetooth/Makefile b/sys/modules/netgraph/bluetooth/bluetooth/Makefile index 2e25d8e37cb5..eb6c64b7ae65 100644 --- a/sys/modules/netgraph/bluetooth/bluetooth/Makefile +++ b/sys/modules/netgraph/bluetooth/bluetooth/Makefile @@ -8,4 +8,6 @@ CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include KMOD= ng_bluetooth SRCS= ng_bluetooth.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/netgraph/bluetooth/socket/Makefile b/sys/modules/netgraph/bluetooth/socket/Makefile index 36bc4e9fbd0f..1b0e913b1cf8 100644 --- a/sys/modules/netgraph/bluetooth/socket/Makefile +++ b/sys/modules/netgraph/bluetooth/socket/Makefile @@ -13,4 +13,6 @@ SRCS= ng_btsocket.c \ ng_btsocket_rfcomm.c \ ng_btsocket_sco.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/netgraph/netgraph/Makefile b/sys/modules/netgraph/netgraph/Makefile index a34d6164c908..48adf319d718 100644 --- a/sys/modules/netgraph/netgraph/Makefile +++ b/sys/modules/netgraph/netgraph/Makefile @@ -4,4 +4,6 @@ KMOD= netgraph SRCS= ng_base.c ng_parse.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/nfscommon/Makefile b/sys/modules/nfscommon/Makefile index 28d658db75fa..4e96d902b1cb 100644 --- a/sys/modules/nfscommon/Makefile +++ b/sys/modules/nfscommon/Makefile @@ -13,4 +13,6 @@ SRCS= vnode_if.h \ opt_nfs.h \ opt_ufs.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/nfssvc/Makefile b/sys/modules/nfssvc/Makefile index ff9462c685f7..f59b63459fc2 100644 --- a/sys/modules/nfssvc/Makefile +++ b/sys/modules/nfssvc/Makefile @@ -5,4 +5,6 @@ KMOD= nfssvc SRCS= nfs_nfssvc.c \ opt_nfs.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ntb/ntb/Makefile b/sys/modules/ntb/ntb/Makefile index ec6421ac7b66..f318ff0f88b9 100644 --- a/sys/modules/ntb/ntb/Makefile +++ b/sys/modules/ntb/ntb/Makefile @@ -6,4 +6,6 @@ KMOD = ntb SRCS = ntb.c ntb_if.c SRCS += device_if.h bus_if.h ntb_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ntb/ntb_transport/Makefile b/sys/modules/ntb/ntb_transport/Makefile index df39148f64da..f7094a29d6b4 100644 --- a/sys/modules/ntb/ntb_transport/Makefile +++ b/sys/modules/ntb/ntb_transport/Makefile @@ -6,4 +6,6 @@ KMOD = ntb_transport SRCS = ntb_transport.c SRCS += device_if.h bus_if.h ntb_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/nvme/Makefile b/sys/modules/nvme/Makefile index 1fb4604fc33a..7aad95d55e60 100644 --- a/sys/modules/nvme/Makefile +++ b/sys/modules/nvme/Makefile @@ -23,4 +23,6 @@ SRCS = nvme.c \ opt_nvme.h \ pci_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ow/owc/Makefile b/sys/modules/ow/owc/Makefile index 909c2382ad7d..78da808c82bc 100644 --- a/sys/modules/ow/owc/Makefile +++ b/sys/modules/ow/owc/Makefile @@ -7,4 +7,6 @@ SRCS= owc_gpiobus.c SRCS+= gpio_if.h gpiobus_if.h owll_if.h ofw_bus_if.h bus_if.h device_if.h SRCS+= opt_platform.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/pf/Makefile b/sys/modules/pf/Makefile index d361ea0802fb..ed72d95af92f 100644 --- a/sys/modules/pf/Makefile +++ b/sys/modules/pf/Makefile @@ -22,4 +22,6 @@ opt_global.h: .endif .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/ppbus/Makefile b/sys/modules/ppbus/Makefile index 6b29f6985236..b2ebb2430936 100644 --- a/sys/modules/ppbus/Makefile +++ b/sys/modules/ppbus/Makefile @@ -7,7 +7,7 @@ SRCS= bus_if.h device_if.h ppbus_if.h ppbus_if.c \ opt_ppb_1284.h \ ppb_1284.c ppb_base.c ppb_msq.c ppbconf.c -EXPORT_SYMS= ppb_attach_device \ +EXPORT_SYMS= \ ppb_request_bus \ ppb_release_bus \ ppb_get_status \ @@ -17,6 +17,9 @@ EXPORT_SYMS= ppb_attach_device \ ppb_get_epp_protocol \ ppb_set_mode \ ppb_get_mode \ - ppb_write + ppb_write \ + ppb_lock + +EXPORT_SYMS= YES .include diff --git a/sys/modules/procfs/Makefile b/sys/modules/procfs/Makefile index 282b200e5a60..ee41bb8b116d 100644 --- a/sys/modules/procfs/Makefile +++ b/sys/modules/procfs/Makefile @@ -18,11 +18,11 @@ SRCS+= procfs_type.c SRCS+= procfs.c EXPORT_SYMS= -EXPORT_SYMS+= procfs_attr EXPORT_SYMS+= procfs_candebug EXPORT_SYMS+= procfs_docurproc EXPORT_SYMS+= procfs_doprocfile EXPORT_SYMS+= procfs_doprocmem EXPORT_SYMS+= procfs_notsystem +EXPORT_SYMS+= procfs_attr_rw .include diff --git a/sys/modules/pseudofs/Makefile b/sys/modules/pseudofs/Makefile index 45afba941428..eb083cd31d77 100644 --- a/sys/modules/pseudofs/Makefile +++ b/sys/modules/pseudofs/Makefile @@ -10,7 +10,8 @@ SRCS= opt_pseudofs.h \ pseudofs_vncache.c \ pseudofs_vnops.c -EXPORT_SYMS= pfs_mount \ +EXPORT_SYMS= pfs_cmount \ + pfs_mount \ pfs_unmount \ pfs_root \ pfs_statfs \ @@ -19,8 +20,6 @@ EXPORT_SYMS= pfs_mount \ pfs_create_dir \ pfs_create_file \ pfs_create_link \ - pfs_disable \ - pfs_enable \ pfs_destroy .if !defined(KERNBUILDDIR) diff --git a/sys/modules/pwm/pwmbus/Makefile b/sys/modules/pwm/pwmbus/Makefile index 3cf56697f200..1b3c9f3077c3 100644 --- a/sys/modules/pwm/pwmbus/Makefile +++ b/sys/modules/pwm/pwmbus/Makefile @@ -17,4 +17,6 @@ SRCS+= \ pwmbus_if.c \ pwmbus_if.h \ +EXPORT_SYMS= YES + .include diff --git a/sys/modules/rc4/Makefile b/sys/modules/rc4/Makefile index 21d2d85856a1..23cf6480d56b 100644 --- a/sys/modules/rc4/Makefile +++ b/sys/modules/rc4/Makefile @@ -5,4 +5,6 @@ KMOD= rc4 SRCS= rc4.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/rtwn/Makefile b/sys/modules/rtwn/Makefile index 465187e19f35..8f72a28a1e05 100644 --- a/sys/modules/rtwn/Makefile +++ b/sys/modules/rtwn/Makefile @@ -47,4 +47,6 @@ opt_rtwn.h: @echo "#define RTWN_WITHOUT_UCODE 1" >> ${.TARGET} .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/sdhci/Makefile b/sys/modules/sdhci/Makefile index 158ed4cd945a..9d8269d86109 100644 --- a/sys/modules/sdhci/Makefile +++ b/sys/modules/sdhci/Makefile @@ -5,4 +5,6 @@ KMOD= sdhci SRCS= sdhci.c sdhci.h sdhci_if.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h opt_mmccam.h opt_cam.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/sound/driver/sbc/Makefile b/sys/modules/sound/driver/sbc/Makefile index d7894d644e6a..bde54a077696 100644 --- a/sys/modules/sound/driver/sbc/Makefile +++ b/sys/modules/sound/driver/sbc/Makefile @@ -6,4 +6,6 @@ KMOD= snd_sbc SRCS= device_if.h bus_if.h isa_if.h pci_if.h SRCS+= sbc.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/sound/driver/spicds/Makefile b/sys/modules/sound/driver/spicds/Makefile index 87ab0bbf8b55..f271dae20b2e 100644 --- a/sys/modules/sound/driver/spicds/Makefile +++ b/sys/modules/sound/driver/spicds/Makefile @@ -6,4 +6,6 @@ KMOD= snd_spicds SRCS= device_if.h bus_if.h isa_if.h pci_if.h SRCS+= spicds.c +EXPORT_SYMS= YES + .include diff --git a/sys/modules/spi/spibus/Makefile b/sys/modules/spi/spibus/Makefile index 7832c870ca68..01386d39e118 100644 --- a/sys/modules/spi/spibus/Makefile +++ b/sys/modules/spi/spibus/Makefile @@ -17,4 +17,6 @@ SRCS+= \ spibus_if.c \ spibus_if.h \ +EXPORT_SYMS= YES + .include diff --git a/sys/modules/spigen/Makefile b/sys/modules/spigen/Makefile index 401b69a7ed98..5ff4805399b3 100644 --- a/sys/modules/spigen/Makefile +++ b/sys/modules/spigen/Makefile @@ -16,4 +16,6 @@ SRCS+= \ SRCS+= ofw_bus_if.h .endif +EXPORT_SYMS= YES + .include diff --git a/sys/modules/superio/Makefile b/sys/modules/superio/Makefile index 86585a45cc25..064c39863566 100644 --- a/sys/modules/superio/Makefile +++ b/sys/modules/superio/Makefile @@ -6,4 +6,6 @@ KMOD= superio SRCS= superio.c SRCS+= device_if.h bus_if.h isa_if.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/sysvipc/sysvmsg/Makefile b/sys/modules/sysvipc/sysvmsg/Makefile index 8cd9d2008b9a..84cbc70cde48 100644 --- a/sys/modules/sysvipc/sysvmsg/Makefile +++ b/sys/modules/sysvipc/sysvmsg/Makefile @@ -5,4 +5,6 @@ KMOD= sysvmsg SRCS= sysv_msg.c opt_sysvipc.h +EXPORT_SYMS= YES + .include diff --git a/sys/modules/sysvipc/sysvsem/Makefile b/sys/modules/sysvipc/sysvsem/Makefile index 186e7ed94f4b..89509341c2e5 100644 --- a/sys/modules/sysvipc/sysvsem/Makefile +++ b/sys/modules/sysvipc/sysvsem/Makefile @@ -5,4 +5,6 @@ KMOD= sysvsem SRCS= sysv_sem.c opt_sysvipc.h +EXPORT_SYMS= YES + *** 124 LINES SKIPPED *** From nobody Thu Nov 25 01:09:41 2021 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 1F24218B5B9C; Thu, 25 Nov 2021 01:09: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J00CT20N6z4wPv; Thu, 25 Nov 2021 01:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F31D141DB; Thu, 25 Nov 2021 01:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AP19fgp017103; Thu, 25 Nov 2021 01:09:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AP19f5W017102; Thu, 25 Nov 2021 01:09:41 GMT (envelope-from git) Date: Thu, 25 Nov 2021 01:09:41 GMT Message-Id: <202111250109.1AP19f5W017102@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: b0f2ca434842 - stable/13 - kmod_syms.awk: fix removal of the export list from the symbol table 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: b0f2ca434842cdb7cdd9c55e183dca8fd5a864c5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637802581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4uR2UPMsuYuskbJwNPpQ5FY00deyGx1y9+bw7Gjv5HI=; b=XPPzEXJdnyC/PVujHNz+z49MlSSPCj6avz6jYrrkf6VsEYBPVFpS9dbua6JeU8yz7Ukhdk Rf7sj7kTvHHdJRGjOylBfBlaw0ai/9rdGMsaJK89QKezd/tj9f4p2guwLY04U2n2h0oikj JEZ6rDUsm9aOOYyvbF6Ph4mnm7dRWh/JsbrhvSNq/42ZRTeITn/DkfII+elAl5SoUsjNZj uFEJ0+mLACE+FETjD8CaO2pIfioXcmzkL6yD/+0yCQFm71Vom+Oc/P/o83e4kapdQ+P9sy Er4OMUgFk7khpLFjE9Kbg8Ydv4dFMr8e/qALD1RpIp9l6EdCTKAAXGm1FGkFTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637802581; a=rsa-sha256; cv=none; b=pFEy9O7Sk0+O36Rsq3mduzXgk1b8xNbvGnkNseZvqZTAY4Lg2gwlvNu0NEVr9QSc4329UK 4YxRQlHn2V9vseLhTUWT85MTQ6AHxQgcetDFKrl+TE7f5gCvN2ahgwqM778t+4RQpT+4dk TUIi9qoAeFWpvYcXBzHPGlFbXUm/Qz4oxlMOFFx+mPC1WlDlEKDaLUt6PvKUmgBNEftcJe 1Ulv/a2ijwcThCAU9nMW/Qhua+At/mHJRwzpqvaQnWlQBKDE8Zbv/WOFB4iXRPKAJvRERd xEESCAYwtFerbL4yLoN39dkhPlpE7hT+e6LzVduprOS9tQen4jgwdb2Jjq32Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0f2ca434842cdb7cdd9c55e183dca8fd5a864c5 commit b0f2ca434842cdb7cdd9c55e183dca8fd5a864c5 Author: Konstantin Belousov AuthorDate: 2021-11-07 09:00:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-25 01:09:21 +0000 kmod_syms.awk: fix removal of the export list from the symbol table (cherry picked from commit 0d7a6199b61d55caf0a682ef072bdd107472ab49) --- sys/conf/kmod_syms.awk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/conf/kmod_syms.awk b/sys/conf/kmod_syms.awk index 677d813507ee..8691d2e0b989 100644 --- a/sys/conf/kmod_syms.awk +++ b/sys/conf/kmod_syms.awk @@ -2,6 +2,7 @@ # Read global symbols from object file. BEGIN { + modname = ARGV[1] while ("${NM:='nm'} -g " ARGV[1] | getline) { if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) { syms[$3] = $2 @@ -12,7 +13,12 @@ BEGIN { # De-list symbols from the export list. { - delete syms[$0] + smbl = $0 + if (!(smbl in syms)) { + printf "Symbol %s is not present in %s\n", \ + smbl, modname > "/dev/stderr" + } + delete syms[smbl] } # Strip commons, make everything else local. From nobody Thu Nov 25 05:01:41 2021 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 7420418962FF; Thu, 25 Nov 2021 05:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J05M96RZwz3DGR; Thu, 25 Nov 2021 05:01:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE27417928; Thu, 25 Nov 2021 05:01:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AP51f1J036850; Thu, 25 Nov 2021 05:01:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AP51fS4036849; Thu, 25 Nov 2021 05:01:41 GMT (envelope-from git) Date: Thu, 25 Nov 2021 05:01:41 GMT Message-Id: <202111250501.1AP51fS4036849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang Subject: git: 3218666bd082 - stable/13 - bridge(4): Use American spelling of "behavior" 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3218666bd082737e41d886dc3af8d172bbe111e6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637816501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYAL5g5CYkQXuiBhBdX5b45uzfkPvtRF7Qthpkhk+vg=; b=Mm7lwNVaqKZqhqmHJilOycqeG0jacOvyQnSW1/GrBtsrR4MuRTBdAJoqbPiColtB645sWt LBHRdI9KZJ9iXyBbycHPo8JPcCeABWZEl6m9bgthbjVBUvPdsbH8zNMSeZ+X0RuUn+Uxd/ ymvMJb7WZtWseTlwsQ9lToZGkhN5KdRv78deKPlpZvtgb4ekBDMzexaRhxNZjlO7Gy9ZlN UGOQo2HAVu7tgcMIBMLNb2MN64zg9Pi+5ZKNmSWVhgyQZu5nYR5YnF2KbDgmZCtqVEjIMQ SNWN/zirqpkDNQE3f5X4M45Pu4GhahgZxSEyNJTClCkE8FK4IOxnITiCeE2Y3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637816501; a=rsa-sha256; cv=none; b=ODJaSk3CbExaHN/bNabTAiNAbH5ujKWe2u8Oq0ko1Nbs3KfA38kDvx+zSeM5meGgYIvjDf oFmhS/YBwjnTSVkLuPtGOU8dyfqlOfR1u66bGvwvOiMxgRfIu0sQDFL9E0+WqD6Jrb+6VP mz2+h0JtzSuU7z8Cgh5BAe/qruQAghRRYtRFMSNqRz6XQdSDg2kyYFGiXboQ6qmTYEQxs4 93yHLBYCvCRD/5hlAZQkHdr91laH9yfq+ebvatcoClQ2CRPWA/1JtnxiUIecAQ1R30e4oi Y8nUas6wM6hW/eBZcQJFHY97s2erNFl9LXoCQcCPTdlwTwC/PprvA5kiZbIaLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3218666bd082737e41d886dc3af8d172bbe111e6 commit 3218666bd082737e41d886dc3af8d172bbe111e6 Author: Guangyuan Yang AuthorDate: 2021-11-22 02:41:49 +0000 Commit: Guangyuan Yang CommitDate: 2021-11-25 05:01:16 +0000 bridge(4): Use American spelling of "behavior" Fixes: 8406182dbeb972698775e2468902bc5f6e593d72 Reported by: Pau Amma (cherry picked from commit 28ba36c65db8b4d95abcd543b97f2ec5161cdae5) --- share/man/man4/bridge.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index c79e5da69837..e193724928ca 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -180,7 +180,7 @@ This situation is clearly against the description in Section 5, RFC 4007. Although it works in most cases, -it can cause some counterintuitive or undesirable behaviour in some +it can cause some counterintuitive or undesirable behavior in some edge cases when both, the .Nm interface and one of the member interfaces, have an IPv6 address @@ -198,7 +198,7 @@ interface has IPv6 addresses, IPv6 addresses on the member interface will be automatically removed before the interface is added. .Pp -This behaviour can be disabled by setting +This behavior can be disabled by setting .Xr sysctl 8 variable .Va net.link.bridge.allow_llz_overlap @@ -250,7 +250,7 @@ When filtering is enabled, bridged packets will pass through the filter inbound on the originating interface, on the bridge interface and outbound on the appropriate interfaces. Either stage can be disabled. -The filtering behaviour can be controlled using +The filtering behavior can be controlled using .Xr sysctl 8 : .Bl -tag -width ".Va net.link.bridge.pfil_onlyip" .It Va net.link.bridge.pfil_onlyip From nobody Thu Nov 25 07:38:56 2021 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 8C358189CDE8; Thu, 25 Nov 2021 07:39:09 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J08rr2F5Vz4q71; Thu, 25 Nov 2021 07:39:08 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.17.1/8.17.1/hmo17dec20) with ESMTPS id 1AP7cvt2042556 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 25 Nov 2021 08:38:57 +0100 (CET) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.1/8.17.1/Submit) id 1AP7cuCu042555; Thu, 25 Nov 2021 08:38:56 +0100 (CET) (envelope-from freebsd@oldach.net) Message-Id: <202111250738.1AP7cuCu042555@nuc.oldach.net> Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features In-Reply-To: <8664c9a1-f000-d07f-5f48-3b18d3e5f629@freebsd.org> from Allan Jude at "24 Nov 2021 13:02:47" To: allanjude@freebsd.org (Allan Jude) Date: Thu, 25 Nov 2021 08:38:56 +0100 (CET) Cc: manu@bidouilliste.com, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Thu, 25 Nov 2021 08:38:57 +0100 (CET) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Rspamd-Queue-Id: 4J08rr2F5Vz4q71 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net X-Spamd-Result: default: False [-3.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[oldach.net]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N Hi, Allan Jude wrote on Wed, 24 Nov 2021 19:02:47 +0100 (CET): > On 11/24/2021 3:30 AM, Emmanuel Vadot wrote: > > On Tue, 23 Nov 2021 20:36:40 +0100 (CET) > > freebsd@oldach.net (Helge Oldach) wrote: > > > >> Allan Jude wrote on Tue, 23 Nov 2021 20:14:53 +0100 (CET): > >>> On 11/23/2021 5:00 AM, Helge Oldach wrote: > >>>> Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET): > >>>> Hmmm. On a RPi4/8G: > >>>> > >>>> Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6): > >>>> | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > >>>> | aes-256-gcm 35791.98k 38533.57k 39986.77k 41397.59k 39840.43k 39638.36k > >>>> > >>>> After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621) > >>>> > >>>> | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > >>>> | aes-256-gcm 21277.62k 23226.64k 23613.90k 23687.51k 23892.93k 23947.95k > >>>> > >>>> It seems that AES throughput is actually cut by almost half? > >>> > >>> Do you know which of the CPU optimizations your RPi4 supports? > >> > >> Is this what you need? > >> > >> Instruction Set Attributes 0 = > > > > So there is no AES+PMULL instruction set on RPI4, I guess that openssl > > uses them for aes-gcm. > > > > I wonder what it uses before that make it have this boost. > > > > On my rockpro64 I do see the improvement btw : > > root@generic:~ # cpuset -l 4,5 openssl speed -evp aes-256-gcm > > ... > > aes-256-gcm 122861.59k 337938.39k 565408.44k 661223.09k 709175.19k 712327.25k > > root@generic:~ # cpuset -l 4,5 env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm > > ... > > aes-256-gcm 34068.11k 38068.62k 39435.24k 39818.75k 39905.34k 39922.35k > > > > Running on the big cores at max freq. > > > >> Instruction Set Attributes 1 = <> > >> Processor Features 0 = > >> Processor Features 1 = <> > >> Memory Model Features 0 = > >> Memory Model Features 1 = <8bit VMID> > >> Memory Model Features 2 = <32bit CCIDX,48bit VA> > >> Debug Features 0 = > >> Debug Features 1 = <> > >> Auxiliary Features 0 = <> > >> Auxiliary Features 1 = <> > >> AArch32 Instruction Set Attributes 5 = > >> AArch32 Media and VFP Features 0 = > >> AArch32 Media and VFP Features 1 = > >> > >>> You can set the environment variable OPENSSL_armcap to override > >>> OpenSSL's detection. > >>> > >>> Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm > >> > >> On FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621 again (i.e. after this commit): > >> > >> hmo@p48 ~ $ env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm > >> Doing aes-256-gcm for 3s on 16 size blocks: 6445704 aes-256-gcm's in 3.08s > >> Doing aes-256-gcm for 3s on 64 size blocks: 1861149 aes-256-gcm's in 3.00s > >> Doing aes-256-gcm for 3s on 256 size blocks: 479664 aes-256-gcm's in 3.01s > >> Doing aes-256-gcm for 3s on 1024 size blocks: 122853 aes-256-gcm's in 3.04s > >> Doing aes-256-gcm for 3s on 8192 size blocks: 15181 aes-256-gcm's in 3.00s > >> Doing aes-256-gcm for 3s on 16384 size blocks: 7796 aes-256-gcm's in 3.07s > >> OpenSSL 1.1.1l-freebsd 24 Aug 2021 > >> built on: reproducible build, date unspecified > >> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) > >> compiler: clang > >> The 'numbers' are in 1000s of bytes per second processed. > >> type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > >> aes-256-gcm 33504.57k 39704.51k 40825.01k 41394.83k 41454.25k 41601.52k > >> hmo@p48 ~ $ openssl speed -evp aes-256-gcm > >> Doing aes-256-gcm for 3s on 16 size blocks: 4066201 aes-256-gcm's in 3.00s > >> Doing aes-256-gcm for 3s on 64 size blocks: 1087387 aes-256-gcm's in 3.00s > >> Doing aes-256-gcm for 3s on 256 size blocks: 280110 aes-256-gcm's in 3.03s > >> Doing aes-256-gcm for 3s on 1024 size blocks: 70412 aes-256-gcm's in 3.04s > >> Doing aes-256-gcm for 3s on 8192 size blocks: 8762 aes-256-gcm's in 3.00s > >> Doing aes-256-gcm for 3s on 16384 size blocks: 4402 aes-256-gcm's in 3.02s > >> OpenSSL 1.1.1l-freebsd 24 Aug 2021 > >> built on: reproducible build, date unspecified > >> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) > >> compiler: clang > >> The 'numbers' are in 1000s of bytes per second processed. > >> type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes > >> aes-256-gcm 21686.41k 23197.59k 23656.30k 23725.04k 23926.10k 23916.23k > >> hmo@p48 ~ $ > >> > >> Kind regards, > >> Helge > > > > > > So based on results from Manu, and Mark Millard, it seems almost every > ARM platform is faster when it takes advantage of the CPU features, > except the RPi4(B). > > As Manu pointed out, it doesn't appear to have the AES+PMULL feature, > which means it must be something else that is slowing it down. > > What might help, is to try each feature in turn, and figure out which > one is causing slower results. > > #define HWCAP_FP 0x00000001 > #define HWCAP_ASIMD 0x00000002 > #define HWCAP_EVTSTRM 0x00000004 > #define HWCAP_AES 0x00000008 > #define HWCAP_PMULL 0x00000010 > #define HWCAP_SHA1 0x00000020 > #define HWCAP_SHA2 0x00000040 > #define HWCAP_CRC32 0x00000080 > > So try: > env OPENSSL_armcap=1 openssl speed -evp aes-256-gcm > as well as with armcap=2, 3 (both FP and ASIMD), 8 (just AES) etc. hmo@p48 ~ $ for f in 0 1 2 3 8 16 32 64 128 ; do echo -n $f:; env OPENSSL_armcap=$f openssl speed -evp aes-256-gcm 2>&1 | tail -1 | cut -wf7; done 0:42295.15k 1:23891.19k 2:42208.57k 3:23970.56k 8:42354.98k 16:42199.06k 32:size Illegal instruction (core dumped) 64:42322.42k 128:42275.00k hmo@p48 ~ $ So I guess HWCAP_FP is the culprit? Maybe related to hard/soft floating point math which indeed is kind of special on the Pi? > For ones where the CPU lacks the feature, it will crash with 'Illegal > instruction' > > Separately, it might also be interesting to see the results of `openssl > speed -evp sha256` before/after/with the different OPENSSL_armcap values Please let me know in case you still require this. Kind regards Helge From nobody Thu Nov 25 15:09:25 2021 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 97FF9189E7FD; Thu, 25 Nov 2021 15:09:28 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from tor1-11.mx.scaleengine.net (tor1-11.mx.scaleengine.net [209.51.186.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0LrS3rQMz3tMd; Thu, 25 Nov 2021 15:09:28 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.3] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by tor1-11.mx.scaleengine.net (Postfix) with ESMTPSA id AA2A03314F; Thu, 25 Nov 2021 15:09:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 tor1-11.mx.scaleengine.net AA2A03314F Message-ID: <1a76eb2e-b9f0-946e-c80b-e6bc9e258d59@freebsd.org> Date: Thu, 25 Nov 2021 10:09:25 -0500 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features Content-Language: en-US To: Helge Oldach Cc: manu@bidouilliste.com, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202111250738.1AP7cuCu042555@nuc.oldach.net> From: Allan Jude In-Reply-To: <202111250738.1AP7cuCu042555@nuc.oldach.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4J0LrS3rQMz3tMd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/25/2021 2:38 AM, Helge Oldach wrote: > Hi, > > Allan Jude wrote on Wed, 24 Nov 2021 19:02:47 +0100 (CET): >> On 11/24/2021 3:30 AM, Emmanuel Vadot wrote: >>> On Tue, 23 Nov 2021 20:36:40 +0100 (CET) >>> freebsd@oldach.net (Helge Oldach) wrote: >>> >>>> Allan Jude wrote on Tue, 23 Nov 2021 20:14:53 +0100 (CET): >>>>> On 11/23/2021 5:00 AM, Helge Oldach wrote: >>>>>> Allan Jude wrote on Mon, 22 Nov 2021 19:14:13 +0100 (CET): >>>>>> Hmmm. On a RPi4/8G: >>>>>> >>>>>> Before (FreeBSD 13.0-STABLE (GENERIC) #366 stable/13-n248173-d16fbc488e6): >>>>>> | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >>>>>> | aes-256-gcm 35791.98k 38533.57k 39986.77k 41397.59k 39840.43k 39638.36k >>>>>> >>>>>> After (FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621) >>>>>> >>>>>> | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >>>>>> | aes-256-gcm 21277.62k 23226.64k 23613.90k 23687.51k 23892.93k 23947.95k >>>>>> >>>>>> It seems that AES throughput is actually cut by almost half? >>>>> >>>>> Do you know which of the CPU optimizations your RPi4 supports? >>>> >>>> Is this what you need? >>>> >>>> Instruction Set Attributes 0 = >>> >>> So there is no AES+PMULL instruction set on RPI4, I guess that openssl >>> uses them for aes-gcm. >>> >>> I wonder what it uses before that make it have this boost. >>> >>> On my rockpro64 I do see the improvement btw : >>> root@generic:~ # cpuset -l 4,5 openssl speed -evp aes-256-gcm >>> ... >>> aes-256-gcm 122861.59k 337938.39k 565408.44k 661223.09k 709175.19k 712327.25k >>> root@generic:~ # cpuset -l 4,5 env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm >>> ... >>> aes-256-gcm 34068.11k 38068.62k 39435.24k 39818.75k 39905.34k 39922.35k >>> >>> Running on the big cores at max freq. >>> >>>> Instruction Set Attributes 1 = <> >>>> Processor Features 0 = >>>> Processor Features 1 = <> >>>> Memory Model Features 0 = >>>> Memory Model Features 1 = <8bit VMID> >>>> Memory Model Features 2 = <32bit CCIDX,48bit VA> >>>> Debug Features 0 = >>>> Debug Features 1 = <> >>>> Auxiliary Features 0 = <> >>>> Auxiliary Features 1 = <> >>>> AArch32 Instruction Set Attributes 5 = >>>> AArch32 Media and VFP Features 0 = >>>> AArch32 Media and VFP Features 1 = >>>> >>>>> You can set the environment variable OPENSSL_armcap to override >>>>> OpenSSL's detection. >>>>> >>>>> Try: env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm >>>> >>>> On FreeBSD 13.0-STABLE (GENERIC) #367 stable/13-n248176-f085bb0e621 again (i.e. after this commit): >>>> >>>> hmo@p48 ~ $ env OPENSSL_armcap=0 openssl speed -evp aes-256-gcm >>>> Doing aes-256-gcm for 3s on 16 size blocks: 6445704 aes-256-gcm's in 3.08s >>>> Doing aes-256-gcm for 3s on 64 size blocks: 1861149 aes-256-gcm's in 3.00s >>>> Doing aes-256-gcm for 3s on 256 size blocks: 479664 aes-256-gcm's in 3.01s >>>> Doing aes-256-gcm for 3s on 1024 size blocks: 122853 aes-256-gcm's in 3.04s >>>> Doing aes-256-gcm for 3s on 8192 size blocks: 15181 aes-256-gcm's in 3.00s >>>> Doing aes-256-gcm for 3s on 16384 size blocks: 7796 aes-256-gcm's in 3.07s >>>> OpenSSL 1.1.1l-freebsd 24 Aug 2021 >>>> built on: reproducible build, date unspecified >>>> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) >>>> compiler: clang >>>> The 'numbers' are in 1000s of bytes per second processed. >>>> type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >>>> aes-256-gcm 33504.57k 39704.51k 40825.01k 41394.83k 41454.25k 41601.52k >>>> hmo@p48 ~ $ openssl speed -evp aes-256-gcm >>>> Doing aes-256-gcm for 3s on 16 size blocks: 4066201 aes-256-gcm's in 3.00s >>>> Doing aes-256-gcm for 3s on 64 size blocks: 1087387 aes-256-gcm's in 3.00s >>>> Doing aes-256-gcm for 3s on 256 size blocks: 280110 aes-256-gcm's in 3.03s >>>> Doing aes-256-gcm for 3s on 1024 size blocks: 70412 aes-256-gcm's in 3.04s >>>> Doing aes-256-gcm for 3s on 8192 size blocks: 8762 aes-256-gcm's in 3.00s >>>> Doing aes-256-gcm for 3s on 16384 size blocks: 4402 aes-256-gcm's in 3.02s >>>> OpenSSL 1.1.1l-freebsd 24 Aug 2021 >>>> built on: reproducible build, date unspecified >>>> options:bn(64,64) rc4(int) des(int) aes(partial) idea(int) blowfish(ptr) >>>> compiler: clang >>>> The 'numbers' are in 1000s of bytes per second processed. >>>> type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes >>>> aes-256-gcm 21686.41k 23197.59k 23656.30k 23725.04k 23926.10k 23916.23k >>>> hmo@p48 ~ $ >>>> >>>> Kind regards, >>>> Helge >>> >>> >> >> So based on results from Manu, and Mark Millard, it seems almost every >> ARM platform is faster when it takes advantage of the CPU features, >> except the RPi4(B). >> >> As Manu pointed out, it doesn't appear to have the AES+PMULL feature, >> which means it must be something else that is slowing it down. >> >> What might help, is to try each feature in turn, and figure out which >> one is causing slower results. >> >> #define HWCAP_FP 0x00000001 >> #define HWCAP_ASIMD 0x00000002 >> #define HWCAP_EVTSTRM 0x00000004 >> #define HWCAP_AES 0x00000008 >> #define HWCAP_PMULL 0x00000010 >> #define HWCAP_SHA1 0x00000020 >> #define HWCAP_SHA2 0x00000040 >> #define HWCAP_CRC32 0x00000080 >> >> So try: >> env OPENSSL_armcap=1 openssl speed -evp aes-256-gcm >> as well as with armcap=2, 3 (both FP and ASIMD), 8 (just AES) etc. > > hmo@p48 ~ $ for f in 0 1 2 3 8 16 32 64 128 ; do echo -n $f:; env OPENSSL_armcap=$f openssl speed -evp aes-256-gcm 2>&1 | tail -1 | cut -wf7; done > 0:42295.15k > 1:23891.19k > 2:42208.57k > 3:23970.56k > 8:42354.98k > 16:42199.06k > 32:size > Illegal instruction (core dumped) > 64:42322.42k > 128:42275.00k > hmo@p48 ~ $ > > So I guess HWCAP_FP is the culprit? Maybe related to hard/soft floating > point math which indeed is kind of special on the Pi? > >> For ones where the CPU lacks the feature, it will crash with 'Illegal >> instruction' >> >> Separately, it might also be interesting to see the results of `openssl >> speed -evp sha256` before/after/with the different OPENSSL_armcap values > > Please let me know in case you still require this. > > Kind regards > Helge > So yeah, the issue seems to be that floating point on the RPi4 is slower than not, but now openssl (properly) detects that the CPU advertises support for it. As seen elsewhere in the thread, most other ARM platforms get a very significant speed boost. -- Allan Jude From nobody Thu Nov 25 15:31:10 2021 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 91D4918A9EF0; Thu, 25 Nov 2021 15:31:17 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0MKb5x5fz4VWL; Thu, 25 Nov 2021 15:31:15 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.17.1/8.17.1/hmo17dec20) with ESMTPS id 1APFVB3K039511 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 25 Nov 2021 16:31:11 +0100 (CET) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.1/8.17.1/Submit) id 1APFVBK9039510; Thu, 25 Nov 2021 16:31:11 +0100 (CET) (envelope-from freebsd@oldach.net) Message-Id: <202111251531.1APFVBK9039510@nuc.oldach.net> Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features In-Reply-To: <1a76eb2e-b9f0-946e-c80b-e6bc9e258d59@freebsd.org> from Allan Jude at "25 Nov 2021 10:09:25" To: allanjude@freebsd.org (Allan Jude) Date: Thu, 25 Nov 2021 16:31:10 +0100 (CET) Cc: manu@bidouilliste.com, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Thu, 25 Nov 2021 16:31:11 +0100 (CET) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Rspamd-Queue-Id: 4J0MKb5x5fz4VWL X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net X-Spamd-Result: default: False [-3.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[oldach.net]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.997]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N Allan Jude wrote on Thu, 25 Nov 2021 16:09:25 +0100 (CET): > On 11/25/2021 2:38 AM, Helge Oldach wrote: > > hmo@p48 ~ $ for f in 0 1 2 3 8 16 32 64 128 ; do echo -n $f:; env OPENSSL_armcap=$f openssl speed -evp aes-256-gcm 2>&1 | tail -1 | cut -wf7; done > > 0:42295.15k > > 1:23891.19k > > 2:42208.57k > > 3:23970.56k > > 8:42354.98k > > 16:42199.06k > > 32:size > > Illegal instruction (core dumped) > > 64:42322.42k > > 128:42275.00k > > hmo@p48 ~ $ > > > > So I guess HWCAP_FP is the culprit? Maybe related to hard/soft floating > > point math which indeed is kind of special on the Pi? > > So yeah, the issue seems to be that floating point on the RPi4 is slower > than not, but now openssl (properly) detects that the CPU advertises > support for it. > > As seen elsewhere in the thread, most other ARM platforms get a very > significant speed boost. So can we disable FP within OpenSSL for the RPi by default? This commit basically introduced a regression for this platform and I think that should be fixed. Or it the root cause a suboptimal FP implementation that is not adequate for the RPi? Kind regards Helge From nobody Thu Nov 25 16:54:06 2021 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 CECD918BAF60; Thu, 25 Nov 2021 16:54:14 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from tor1-11.mx.scaleengine.net (tor1-11.mx.scaleengine.net [IPv6:2001:470:1:474::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0P9L5MPyz3CBC; Thu, 25 Nov 2021 16:54:14 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.3] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by tor1-11.mx.scaleengine.net (Postfix) with ESMTPSA id 16B893366D; Thu, 25 Nov 2021 16:54:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 tor1-11.mx.scaleengine.net 16B893366D Message-ID: <9bf8a967-de50-9072-40cb-08d2798594dc@freebsd.org> Date: Thu, 25 Nov 2021 11:54:06 -0500 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features Content-Language: en-US To: Helge Oldach Cc: manu@bidouilliste.com, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202111251531.1APFVBK9039510@nuc.oldach.net> From: Allan Jude In-Reply-To: <202111251531.1APFVBK9039510@nuc.oldach.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4J0P9L5MPyz3CBC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/25/2021 10:31 AM, Helge Oldach wrote: > Allan Jude wrote on Thu, 25 Nov 2021 16:09:25 +0100 (CET): >> On 11/25/2021 2:38 AM, Helge Oldach wrote: >>> hmo@p48 ~ $ for f in 0 1 2 3 8 16 32 64 128 ; do echo -n $f:; env OPENSSL_armcap=$f openssl speed -evp aes-256-gcm 2>&1 | tail -1 | cut -wf7; done >>> 0:42295.15k >>> 1:23891.19k >>> 2:42208.57k >>> 3:23970.56k >>> 8:42354.98k >>> 16:42199.06k >>> 32:size >>> Illegal instruction (core dumped) >>> 64:42322.42k >>> 128:42275.00k >>> hmo@p48 ~ $ >>> >>> So I guess HWCAP_FP is the culprit? Maybe related to hard/soft floating >>> point math which indeed is kind of special on the Pi? >> >> So yeah, the issue seems to be that floating point on the RPi4 is slower >> than not, but now openssl (properly) detects that the CPU advertises >> support for it. >> >> As seen elsewhere in the thread, most other ARM platforms get a very >> significant speed boost. > > So can we disable FP within OpenSSL for the RPi by default? This commit > basically introduced a regression for this platform and I think that > should be fixed. > > Or it the root cause a suboptimal FP implementation that is not adequate > for the RPi? > > Kind regards > Helge > The root cause is that the RPi4 advertises support for FP, but its FP is slow. I don't know that there is an easy way to detect the RPi4 specifically. You might be able to just disable the FP bit by setting OPENSSL_armcap=~1 globally, or maybe via openssl.conf? -- Allan Jude From nobody Thu Nov 25 16:54:42 2021 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 4AFEA18BB544; Thu, 25 Nov 2021 16:54:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0P9v01d5z3CTJ; Thu, 25 Nov 2021 16:54:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5D7F211B5; Thu, 25 Nov 2021 16:54:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1APGsgQA080733; Thu, 25 Nov 2021 16:54:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1APGsgIe080732; Thu, 25 Nov 2021 16:54:42 GMT (envelope-from git) Date: Thu, 25 Nov 2021 16:54:42 GMT Message-Id: <202111251654.1APGsgIe080732@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: ab3f1b678dde - stable/13 - cloudabi: add deprecation notice in stable branches 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: ab3f1b678dde27cbdb0aec175e65401202db6dad Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637859283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HGB5mCRc7RDaNYJYZlO6jAzgrJQiEgP1ocBVnLsEEto=; b=yV27iS5+k/PsXBiZDQ2tjilYsJYrw6Fd/i3SAE6qBn40rgfIWoP+2kFMTA9BHiG3D9T/vz Cuuf/KMHMexHVd9yWy7ua6HmmlKoUBt56BwjxJI6eMCKHL8XC8DbK8NJWCrGwEG+CQdYRz uBRfKAk4ZI3NtVfJ/4g0QcqWBxnHeNU97VT+GsA0ySLKag9o44wIYmbD2nsJiBVv8qBx8h SRzy+a0Wjod0nKKF4Tl1PKFTDa6hLp321fcd1ScrEd+rpwO65n8nVg9Azbug8TpxaqP2Vi RFWWWWCW1IJB9aBFHc6rBY59wlX1bRok2zk6+VjsU/yCtawq8ERuNMCIa7G49Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637859283; a=rsa-sha256; cv=none; b=dsohRKHO9Gn51WH3KNBbSyzJIWz3v7XMTF+OvqqFX6cTwEjDmlX4N0z9K5KJwnhqgLjcUN D0Lc+ImvcxgnOMTr1rZjPxFaU5i+WJWKr38Ft7EjQyRyachNJvgThyS3W/v5BTepqp7aI3 QUqzxHq5ZwnVY0OhoCuqSYbWuVb9+Wvo4wkVjSkbT8uTNQ0r5voIkz4dSN3aBjSXqTNiMM RW4u66LJNpPliYABMrkOptW0Yb7aIjbBYfTeqEpEveY31EFTt2EexhROXp4MKufyOHfWQW zpgBgWwuo1q6Lxpa67BWDX/0MPXnTta6PjoMYVL7OErBguRfKUjQCw5Yu+/MLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ab3f1b678dde27cbdb0aec175e65401202db6dad commit ab3f1b678dde27cbdb0aec175e65401202db6dad Author: Ed Maste AuthorDate: 2021-11-25 16:45:59 +0000 Commit: Ed Maste CommitDate: 2021-11-25 16:54:11 +0000 cloudabi: add deprecation notice in stable branches It has been removed from main before 14.0. Sponsored by: The FreeBSD Foundation --- share/man/man4/cloudabi.4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man4/cloudabi.4 b/share/man/man4/cloudabi.4 index 3e3f988da4d0..0c87d933a6c5 100644 --- a/share/man/man4/cloudabi.4 +++ b/share/man/man4/cloudabi.4 @@ -51,6 +51,10 @@ cloudabi_load="YES" cloudabi32_load="YES" cloudabi64_load="YES" .Ed +.Sh DEPRECATION NOTICE +.Nm +support is not present in +.Fx 14.0 . .Sh DESCRIPTION CloudABI is a POSIX-like pure capability-based runtime environment, similar to From nobody Thu Nov 25 16:54:43 2021 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 BCCD218BB16E; Thu, 25 Nov 2021 16:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0P9w3KMZz3CTP; Thu, 25 Nov 2021 16:54:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 127F42109F; Thu, 25 Nov 2021 16:54:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1APGsh0X080760; Thu, 25 Nov 2021 16:54:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1APGshIj080759; Thu, 25 Nov 2021 16:54:43 GMT (envelope-from git) Date: Thu, 25 Nov 2021 16:54:43 GMT Message-Id: <202111251654.1APGshIj080759@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: c433c96d865e - stable/13 - Update deprecation version for drivers removed in main 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: c433c96d865e49db8bba63f27ee692ce0e752546 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637859284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wdLGzbADdS/tLNQ5DAOKPWmvUAZU0LLgj1oAwX2uQTg=; b=BnCHbmboT92Lx3qFS6wAIgDTu3iRUmXnG1yUgES8edgqYRVoGeDFAvnPo3NPiHGljyYgvt cA54fSOMvgVoL9ARWxJTH+Sriy3vagn80UxpT34PmRR2ja0Ecrs5wznYeR0WXbrsUTvijA V/7HHk5Bxe/CHqrr/1VcAwruXf0loNhui5awH6Y1LEgTQiGfM2w3Xr2BTw4ucndslq2Xxa 8IxIYelmliJoV2IyyP/hv96LinaOksnk/zpX6qW+iPep5a0dLlrg2UniDQ+1tFBOL2/CRo nu3vgNHXASjasDqUBzfv01/HUyyeV/+TEjVWHUGL8ynHVO/Ym6LGReL0Mq9K9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637859285; a=rsa-sha256; cv=none; b=fLd22SWcIZ4+2vvckWS03ZHBN0n9EtaJB/9U+ct3Epz1aZpzCRYoQ0PFs7ygJqjwL7ezKs 6r8baGxdGhxyRqJ1CQ0OorpM0T2XMYP0a1U25DhfOSWnHg1NKWNXzgOVwfQuUfl1/eNgl3 rncUfMtBOYECPQWtyyOxcTtu/OP8JH0KxHNujUEquGUYItJrKGnRe6YcFUTj5cCZ96dTLR Z2BeoILZAj1sms/5JV2GCNeCztRqxmT275/L0Q4b9B5NvXAxjy3KVw43yYZx4o54GmKLnc gkiN47aA/TuPne9MY/0RvdhOSjpvaCdZLFBlMOG+s6cVu59Nek114C8jqxlucw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c433c96d865e49db8bba63f27ee692ce0e752546 commit c433c96d865e49db8bba63f27ee692ce0e752546 Author: Ed Maste AuthorDate: 2021-11-25 16:47:03 +0000 Commit: Ed Maste CommitDate: 2021-11-25 16:54:12 +0000 Update deprecation version for drivers removed in main Removal of the amr, esp, iir, mly and twa drivers was planned before FreeBSD 13, but did not happen before the branch. Update the depreciation notices to indicate that they are gone in FreeBSD 14. Sponsored by: The FreeBSD Foundation --- share/man/man4/amr.4 | 2 +- share/man/man4/esp.4 | 2 +- share/man/man4/iir.4 | 2 +- share/man/man4/mly.4 | 2 +- share/man/man4/twa.4 | 2 +- sys/dev/amr/amr_pci.c | 2 +- sys/dev/esp/ncr53c9x.c | 2 +- sys/dev/iir/iir_pci.c | 2 +- sys/dev/mly/mly.c | 2 +- sys/dev/twa/tw_osl_freebsd.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/share/man/man4/amr.4 b/share/man/man4/amr.4 index 8ef14dfd1d9b..145ab0251e8a 100644 --- a/share/man/man4/amr.4 +++ b/share/man/man4/amr.4 @@ -49,7 +49,7 @@ amr_load="YES" The .Nm driver is not present in -.Fx 13.0 . +.Fx 14.0 . .Sh DESCRIPTION The .Nm diff --git a/share/man/man4/esp.4 b/share/man/man4/esp.4 index 7fb426a02573..9f9f59faa093 100644 --- a/share/man/man4/esp.4 +++ b/share/man/man4/esp.4 @@ -49,7 +49,7 @@ if_esp_load="YES" The .Nm driver is not present in -.Fx 13.0 . +.Fx 14.0 . .Sh DESCRIPTION The .Nm diff --git a/share/man/man4/iir.4 b/share/man/man4/iir.4 index fa742965eb90..eba9b88eb50c 100644 --- a/share/man/man4/iir.4 +++ b/share/man/man4/iir.4 @@ -12,7 +12,7 @@ The .Nm driver is not present in -.Fx 13.0 . +.Fx 14.0 . .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your diff --git a/share/man/man4/mly.4 b/share/man/man4/mly.4 index 1a59903dfb2c..f96844113542 100644 --- a/share/man/man4/mly.4 +++ b/share/man/man4/mly.4 @@ -51,7 +51,7 @@ mly_load="YES" The .Nm driver is not present in -.Fx 13.0 . +.Fx 14.0 . .Sh DESCRIPTION The .Nm diff --git a/share/man/man4/twa.4 b/share/man/man4/twa.4 index 64e3e37f7da0..bdc3935d8079 100644 --- a/share/man/man4/twa.4 +++ b/share/man/man4/twa.4 @@ -35,7 +35,7 @@ The .Nm driver is not present in -.Fx 13.0 . +.Fx 14.0 . .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c index dd7128e372ef..c57262a8ccc2 100644 --- a/sys/dev/amr/amr_pci.c +++ b/sys/dev/amr/amr_pci.c @@ -340,7 +340,7 @@ out: if (error) amr_pci_free(sc); else - gone_in_dev(dev, 13, "amr(4) driver"); + gone_in_dev(dev, 14, "amr(4) driver"); return(error); } diff --git a/sys/dev/esp/ncr53c9x.c b/sys/dev/esp/ncr53c9x.c index 35ce9a4dbf2c..6068497ce76b 100644 --- a/sys/dev/esp/ncr53c9x.c +++ b/sys/dev/esp/ncr53c9x.c @@ -402,7 +402,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *sc) NCR_UNLOCK(sc); - gone_in_dev(sc->sc_dev, 13, "esp(4) driver"); + gone_in_dev(sc->sc_dev, 14, "esp(4) driver"); return (0); fail_async: diff --git a/sys/dev/iir/iir_pci.c b/sys/dev/iir/iir_pci.c index 1dcdb7397e97..51ed27584a93 100644 --- a/sys/dev/iir/iir_pci.c +++ b/sys/dev/iir/iir_pci.c @@ -336,7 +336,7 @@ iir_pci_attach(device_t dev) } gdt_pci_enable_intr(gdt); - gone_in_dev(dev, 13, "iir(4) removed"); + gone_in_dev(dev, 14, "iir(4) removed"); return (0); err: diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index 1bdcdbb87443..194a14e257e4 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -336,7 +336,7 @@ mly_attach(device_t dev) if (error != 0) mly_free(sc); else - gone_in_dev(dev, 13, "mly(4) removed"); + gone_in_dev(dev, 14, "mly(4) removed"); return(error); } diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c index 6b76f424650a..ce79982bd95e 100644 --- a/sys/dev/twa/tw_osl_freebsd.c +++ b/sys/dev/twa/tw_osl_freebsd.c @@ -413,7 +413,7 @@ twa_attach(device_t dev) callout_init(&(sc->watchdog_callout[0]), 1); callout_init(&(sc->watchdog_callout[1]), 1); callout_reset(&(sc->watchdog_callout[0]), 5*hz, twa_watchdog, &sc->ctlr_handle); - gone_in_dev(dev, 13, "twa(4) removed"); + gone_in_dev(dev, 14, "twa(4) removed"); return(0); } From nobody Thu Nov 25 17:16:54 2021 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 9B82818A6B19; Thu, 25 Nov 2021 17:16:59 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0PgZ5hdSz3Lnr; Thu, 25 Nov 2021 17:16:58 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.17.1/8.17.1/hmo17dec20) with ESMTPS id 1APHGsmT018510 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 25 Nov 2021 18:16:54 +0100 (CET) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.1/8.17.1/Submit) id 1APHGsC7018508; Thu, 25 Nov 2021 18:16:54 +0100 (CET) (envelope-from freebsd@oldach.net) Message-Id: <202111251716.1APHGsC7018508@nuc.oldach.net> Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features In-Reply-To: <9bf8a967-de50-9072-40cb-08d2798594dc@freebsd.org> from Allan Jude at "25 Nov 2021 11:54:06" To: allanjude@freebsd.org (Allan Jude) Date: Thu, 25 Nov 2021 18:16:54 +0100 (CET) Cc: manu@bidouilliste.com, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Thu, 25 Nov 2021 18:16:54 +0100 (CET) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Rspamd-Queue-Id: 4J0PgZ5hdSz3Lnr X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net X-Spamd-Result: default: False [-3.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[oldach.net]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N Allan Jude wrote on Thu, 25 Nov 2021 17:54:06 +0100 (CET): > On 11/25/2021 10:31 AM, Helge Oldach wrote: > > Allan Jude wrote on Thu, 25 Nov 2021 16:09:25 +0100 (CET): > >> On 11/25/2021 2:38 AM, Helge Oldach wrote: > >>> hmo@p48 ~ $ for f in 0 1 2 3 8 16 32 64 128 ; do echo -n $f:; env OPENSSL_armcap=$f openssl speed -evp aes-256-gcm 2>&1 | tail -1 | cut -wf7; done > >>> 0:42295.15k > >>> 1:23891.19k > >>> 2:42208.57k > >>> 3:23970.56k > >>> 8:42354.98k > >>> 16:42199.06k > >>> 32:size > >>> Illegal instruction (core dumped) > >>> 64:42322.42k > >>> 128:42275.00k > >>> hmo@p48 ~ $ > >>> > >>> So I guess HWCAP_FP is the culprit? Maybe related to hard/soft floating > >>> point math which indeed is kind of special on the Pi? > >> > >> So yeah, the issue seems to be that floating point on the RPi4 is slower > >> than not, but now openssl (properly) detects that the CPU advertises > >> support for it. > >> > >> As seen elsewhere in the thread, most other ARM platforms get a very > >> significant speed boost. > > > > So can we disable FP within OpenSSL for the RPi by default? This commit > > basically introduced a regression for this platform and I think that > > should be fixed. > > > > Or it the root cause a suboptimal FP implementation that is not adequate > > for the RPi? > > > > Kind regards > > Helge > > > > The root cause is that the RPi4 advertises support for FP, but its FP is > slow. > > I don't know that there is an easy way to detect the RPi4 specifically. > You might be able to just disable the FP bit by setting > OPENSSL_armcap=~1 globally, or maybe via openssl.conf? Sure can do that locally - but again: This commit is basically a regression which IMHO should be fixed in a way not requiring users to tweak things? Kind regards Helge From nobody Thu Nov 25 17:41:09 2021 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 61A5C18B3ECB; Thu, 25 Nov 2021 17:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0QCV0kg2z3l5C; Thu, 25 Nov 2021 17:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED2D121928; Thu, 25 Nov 2021 17:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1APHf9Eo043743; Thu, 25 Nov 2021 17:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1APHf9Zs043742; Thu, 25 Nov 2021 17:41:09 GMT (envelope-from git) Date: Thu, 25 Nov 2021 17:41:09 GMT Message-Id: <202111251741.1APHf9Zs043742@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: fb91340341cd - stable/12 - cloudabi: add deprecation notice in stable branches 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: fb91340341cdb1679a74226d9f074fb8b7b0fe72 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637862070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fU3SCnQAhMyD668xAchW1KDzrc1ly4BR/hA5tRrctUo=; b=I1lHL9fBV3YDKBHrunFekS4HVXwzlUHe8Z7dZMF7fWQdCBaympVdHQEPMye1+Mqm+D9Ohp 42x31IFajnLr94wrBxc8KSl9XK7M7EaEpELnjxuHvH+usv2zLIMrRtKV3G17KENdahkIVP ZM/Y6LO935W9YkR4MRq7h4So9KlTBv3I01SrAzn1BmktPjUup3QHGdA9nSupj7HK7eETJf tjbSN4q3vHHfkV5A/DLBTl73fhMnC0fo86547eH+yhARLK6JW6vhM4VwYz3Wbv0iA1EeMD dUrUsi/QpqrPSyTt+F5B4Hz4OzKCmGmaRsK7j/nSqs0lNyt9e6TA/GtDAQaNvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637862070; a=rsa-sha256; cv=none; b=aKYVkjYJPyH+FWcIKw9k2u71KuO/YrmIs9ZqMGrnRRXgHRjg3cXoPqNToIOIBspwUzR4rO 8cJI+btzGpV5DJQ3jNZ2Zn06syjtAOHe/zXLE8JphI/DHXxRv9DgJJaaKzmNeniYixzCuj qxYXkv8rgOxpl4WA2y4wo46utM/myKtou+rA/Qt9H0b1Svul7FJ/T02tfH8D4b8L8nCjyK ZqZAmtAKm4WpLNGwNE6zoezAmKAMR1CsKkhBr1BfN5IYGcOPDvoVHVrRsp1e871+x+xgfR ioLhoPpLwmhy9Venkiw2lzpoCdhcWQ3dyfIyTnB7rkH+8K7YlHu7PCdQPw+B3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fb91340341cdb1679a74226d9f074fb8b7b0fe72 commit fb91340341cdb1679a74226d9f074fb8b7b0fe72 Author: Ed Maste AuthorDate: 2021-11-25 16:45:59 +0000 Commit: Ed Maste CommitDate: 2021-11-25 17:03:24 +0000 cloudabi: add deprecation notice in stable branches It has been removed from main before 14.0. Sponsored by: The FreeBSD Foundation (cherry picked from commit ab3f1b678dde27cbdb0aec175e65401202db6dad) --- share/man/man4/cloudabi.4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man4/cloudabi.4 b/share/man/man4/cloudabi.4 index 3e3f988da4d0..0c87d933a6c5 100644 --- a/share/man/man4/cloudabi.4 +++ b/share/man/man4/cloudabi.4 @@ -51,6 +51,10 @@ cloudabi_load="YES" cloudabi32_load="YES" cloudabi64_load="YES" .Ed +.Sh DEPRECATION NOTICE +.Nm +support is not present in +.Fx 14.0 . .Sh DESCRIPTION CloudABI is a POSIX-like pure capability-based runtime environment, similar to From nobody Thu Nov 25 17:41:11 2021 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 A45FB18B3ED1; Thu, 25 Nov 2021 17:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0QCW1vx2z3l0X; Thu, 25 Nov 2021 17:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 230DD21B10; Thu, 25 Nov 2021 17:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1APHfBao043773; Thu, 25 Nov 2021 17:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1APHfBw8043772; Thu, 25 Nov 2021 17:41:11 GMT (envelope-from git) Date: Thu, 25 Nov 2021 17:41:11 GMT Message-Id: <202111251741.1APHfBw8043772@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: dbdbbc6ec6b6 - stable/12 - Add/update deprecation version for drivers removed in main 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: dbdbbc6ec6b671c3e83e209cad14f4ec8c58f653 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637862071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VU7cfXp0TQnu0XZ7eRPE5zJGQDqsJsFuvSWsvGgoMkE=; b=CWgAwczPPZPv8qPfywWz2atRtbc0+f/7h6jSBwD+wDKmpQOJij3ol1sUa4VgrezDHpw9Xi 64j/HlzPHzrqkfv5EzqkSqknihWG388qFPFvWlT4XyXAN2V/uT46VSFLlb12CMDu2fIO+4 VdGr9PWzsidV0wkRft12iFcEW2C0Ubcfv0i4o3BeLJHWkzo4MiYfZc40qKtO8rlxMX9xkt aH33D6/6mvCDmBLI9p9UB2JiWXuzmZeqqKNIOI0kVGifbwEvGMIOzax7fdswMak9ll/wjQ X4Ld64WL2Mn5oMj4IojcSwqhSSCxHNSVQM84D/q2+JhHwX1G1otfc96kv0L6rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637862071; a=rsa-sha256; cv=none; b=EtcJkKHJBpFJuG5Q6vpP9yLmIwiKHQeXWvcSTSlnwZQegGrtyBLgLojtPHXs4bbl4CklVm 2Y9BFpnsZsjw23ncISGV7PQOgiAVdnbUA2T/dQ/qKeLa268aL+EJOi2I0QL6DWexcllvuD /Ume1i1YJHwCOS7tp9ZTMgdGiQa8VfFkiy/euJZcXAUqY0puASLdvIGZ51PtpB/8CNgXZg pXBHGTaWbLsF0EpEUgy+fPqJHiNLGb19X9lNMuj4bHCgo6ptunN0nPznmI85J8rQqT+rpQ 3qonzL8gPy9/fWVYJ7C0vfCeV+x4UOthuVqcHsC9R/pydkCD5ZBrVI8GZ4z4Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dbdbbc6ec6b671c3e83e209cad14f4ec8c58f653 commit dbdbbc6ec6b671c3e83e209cad14f4ec8c58f653 Author: Warner Losh AuthorDate: 2020-04-18 02:52:59 +0000 Commit: Ed Maste CommitDate: 2021-11-25 17:03:25 +0000 Add/update deprecation version for drivers removed in main Add deprecation notices indicating that the amr, esp, iir, mly and twa drivers happened before FreeBSD 14. Sponsored by: The FreeBSD Foundation (cherry picked from commit dd6382d1c454ab329405b64155dcdf334369a016) (cherry picked from commit 5b18755735f964e02e22e0a223dfe935f7e06f4b) (cherry picked from commit 6ccdbb521a65e2a0c82920eda9499ccf76896592) (cherry picked from commit a32311eccd93bcb0f6fb3f53a426e6918fec3c5b) (cherry picked from commit 5c68be59c8f5dbbddabc4c1144be8be6bfd30464) (cherry picked from commit c433c96d865e49db8bba63f27ee692ce0e752546) --- share/man/man4/amr.4 | 5 +++++ share/man/man4/esp.4 | 7 ++++++- share/man/man4/iir.4 | 5 +++++ share/man/man4/mly.4 | 5 +++++ share/man/man4/twa.4 | 5 +++++ sys/dev/amr/amr_pci.c | 2 ++ sys/dev/esp/ncr53c9x.c | 1 + sys/dev/iir/iir_pci.c | 1 + sys/dev/mly/mly.c | 2 ++ sys/dev/twa/tw_osl_freebsd.c | 1 + 10 files changed, 33 insertions(+), 1 deletion(-) diff --git a/share/man/man4/amr.4 b/share/man/man4/amr.4 index 1a38ee98cad8..145ab0251e8a 100644 --- a/share/man/man4/amr.4 +++ b/share/man/man4/amr.4 @@ -45,6 +45,11 @@ module at boot time, place the following line in .Bd -literal -offset indent amr_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 14.0 . .Sh DESCRIPTION The .Nm diff --git a/share/man/man4/esp.4 b/share/man/man4/esp.4 index 74676f8f03f9..2bbc12c31329 100644 --- a/share/man/man4/esp.4 +++ b/share/man/man4/esp.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2011 +.Dd March 10, 2020 .Dt ESP 4 .Os .Sh NAME @@ -45,6 +45,11 @@ following line in .Bd -literal -offset indent if_esp_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 14.0 . .Sh DESCRIPTION The .Nm diff --git a/share/man/man4/iir.4 b/share/man/man4/iir.4 index d9e4309771cd..eba9b88eb50c 100644 --- a/share/man/man4/iir.4 +++ b/share/man/man4/iir.4 @@ -8,6 +8,11 @@ .Sh NAME .Nm iir .Nd Intel Integrated RAID controller and ICP Vortex driver +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 14.0 . .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your diff --git a/share/man/man4/mly.4 b/share/man/man4/mly.4 index 0a701762d415..f96844113542 100644 --- a/share/man/man4/mly.4 +++ b/share/man/man4/mly.4 @@ -47,6 +47,11 @@ module at boot time, place the following line in .Bd -literal -offset indent mly_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 14.0 . .Sh DESCRIPTION The .Nm diff --git a/share/man/man4/twa.4 b/share/man/man4/twa.4 index dbafe91885cc..bdc3935d8079 100644 --- a/share/man/man4/twa.4 +++ b/share/man/man4/twa.4 @@ -31,6 +31,11 @@ .Sh NAME .Nm twa .Nd 3ware 9000/9500/9550/9650 series SATA RAID controllers driver +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 14.0 . .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c index 25b37eda3895..11941768d879 100644 --- a/sys/dev/amr/amr_pci.c +++ b/sys/dev/amr/amr_pci.c @@ -341,6 +341,8 @@ amr_pci_attach(device_t dev) out: if (error) amr_pci_free(sc); + else + gone_in_dev(dev, 14, "amr(4) driver"); return(error); } diff --git a/sys/dev/esp/ncr53c9x.c b/sys/dev/esp/ncr53c9x.c index 98d40ce70697..6068497ce76b 100644 --- a/sys/dev/esp/ncr53c9x.c +++ b/sys/dev/esp/ncr53c9x.c @@ -402,6 +402,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *sc) NCR_UNLOCK(sc); + gone_in_dev(sc->sc_dev, 14, "esp(4) driver"); return (0); fail_async: diff --git a/sys/dev/iir/iir_pci.c b/sys/dev/iir/iir_pci.c index bd7f15b57c4a..51ed27584a93 100644 --- a/sys/dev/iir/iir_pci.c +++ b/sys/dev/iir/iir_pci.c @@ -336,6 +336,7 @@ iir_pci_attach(device_t dev) } gdt_pci_enable_intr(gdt); + gone_in_dev(dev, 14, "iir(4) removed"); return (0); err: diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index 359692840f5f..7f2ef792006c 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -336,6 +336,8 @@ mly_attach(device_t dev) out: if (error != 0) mly_free(sc); + else + gone_in_dev(dev, 14, "mly(4) removed"); return(error); } diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c index 0b3e7933a90a..4f4fb7b06de4 100644 --- a/sys/dev/twa/tw_osl_freebsd.c +++ b/sys/dev/twa/tw_osl_freebsd.c @@ -428,6 +428,7 @@ twa_attach(device_t dev) callout_init(&(sc->watchdog_callout[0]), 1); callout_init(&(sc->watchdog_callout[1]), 1); callout_reset(&(sc->watchdog_callout[0]), 5*hz, twa_watchdog, &sc->ctlr_handle); + gone_in_dev(dev, 14, "twa(4) removed"); return(0); } From nobody Thu Nov 25 17:59:18 2021 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 2ADB218BD19C; Thu, 25 Nov 2021 17:59:21 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from tor1-11.mx.scaleengine.net (tor1-11.mx.scaleengine.net [209.51.186.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0QcT0V7tz3sVr; Thu, 25 Nov 2021 17:59:21 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.3] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by tor1-11.mx.scaleengine.net (Postfix) with ESMTPSA id 206BE33F43; Thu, 25 Nov 2021 17:59:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 tor1-11.mx.scaleengine.net 206BE33F43 Message-ID: <9284fa68-0ff1-ebae-3fdf-82049b1fee61@freebsd.org> Date: Thu, 25 Nov 2021 12:59:18 -0500 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features Content-Language: en-US To: Helge Oldach Cc: manu@bidouilliste.com, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202111251716.1APHGsC7018508@nuc.oldach.net> From: Allan Jude In-Reply-To: <202111251716.1APHGsC7018508@nuc.oldach.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4J0QcT0V7tz3sVr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/25/2021 12:16 PM, Helge Oldach wrote: > Allan Jude wrote on Thu, 25 Nov 2021 17:54:06 +0100 (CET): >> On 11/25/2021 10:31 AM, Helge Oldach wrote: >>> Allan Jude wrote on Thu, 25 Nov 2021 16:09:25 +0100 (CET): >>>> On 11/25/2021 2:38 AM, Helge Oldach wrote: >>>>> hmo@p48 ~ $ for f in 0 1 2 3 8 16 32 64 128 ; do echo -n $f:; env OPENSSL_armcap=$f openssl speed -evp aes-256-gcm 2>&1 | tail -1 | cut -wf7; done >>>>> 0:42295.15k >>>>> 1:23891.19k >>>>> 2:42208.57k >>>>> 3:23970.56k >>>>> 8:42354.98k >>>>> 16:42199.06k >>>>> 32:size >>>>> Illegal instruction (core dumped) >>>>> 64:42322.42k >>>>> 128:42275.00k >>>>> hmo@p48 ~ $ >>>>> >>>>> So I guess HWCAP_FP is the culprit? Maybe related to hard/soft floating >>>>> point math which indeed is kind of special on the Pi? >>>> >>>> So yeah, the issue seems to be that floating point on the RPi4 is slower >>>> than not, but now openssl (properly) detects that the CPU advertises >>>> support for it. >>>> >>>> As seen elsewhere in the thread, most other ARM platforms get a very >>>> significant speed boost. >>> >>> So can we disable FP within OpenSSL for the RPi by default? This commit >>> basically introduced a regression for this platform and I think that >>> should be fixed. >>> >>> Or it the root cause a suboptimal FP implementation that is not adequate >>> for the RPi? >>> >>> Kind regards >>> Helge >>> >> >> The root cause is that the RPi4 advertises support for FP, but its FP is >> slow. >> >> I don't know that there is an easy way to detect the RPi4 specifically. >> You might be able to just disable the FP bit by setting >> OPENSSL_armcap=~1 globally, or maybe via openssl.conf? > > Sure can do that locally - but again: This commit is basically a > regression which IMHO should be fixed in a way not requiring users to > tweak things? > > Kind regards > Helge > It is only a regression to RPi4's, but a massive improvement to every other bit of ARM hardware that has been tested. The error that made OpenSSL disable FP before, was an error (it was calling AT_CANARY instead of AT_HWCAP). So, your issue with openssl being slow on the RPi4 will need to be taken up with OpenSSL. -- Allan Jude From nobody Fri Nov 26 19:40:10 2021 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 9938218C6A93; Fri, 26 Nov 2021 19:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J14pL2LVGz4q6n; Fri, 26 Nov 2021 19:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C4A963BD; Fri, 26 Nov 2021 19:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQJeAba020032; Fri, 26 Nov 2021 19:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQJeAuY020027; Fri, 26 Nov 2021 19:40:10 GMT (envelope-from git) Date: Fri, 26 Nov 2021 19:40:10 GMT Message-Id: <202111261940.1AQJeAuY020027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: cfe9b890d574 - stable/13 - pf: Introduce ridentifier 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cfe9b890d574a92e8b04eb662e9ac2010d243193 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637955610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZid3wRohUGCtCXiIELU7gZHWp2CmfMZ73hTLvCac3M=; b=LfPdvUduOrw9t1o7cZAcxdpktdrEPyTrtwMhvvdZARIVaWir7W+DDa1OkIUjplImjKl0GM Tpo34769Kh8UCQA7Qu6/GwE7d/LZjzndOtBsV5iQBF81OkLLJ3aqn9rFy+zI+ddO8B6DU5 9Px+2bIFoaU998Hde+xj04fMTVp28yyiAwVc6z9QeEgn5bEjPzxwbw/XNrRQciOXroIdNW UH9G78TXDYq/9r+g0qBf4uSXZdozOq+y8+o/3bZFEj9SUjgrADGCEc8nzkq6T1Oh19OhW+ /UMwokRePE5Ku0mB8BhnkZn2Nib9Wlra3y0qhQakrlm79E3JNDIrTz2YWv2fQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637955610; a=rsa-sha256; cv=none; b=qOPXanpD1YlBLIBfRBuhUc5AUVUiiCs3ZoKUF6zd8vvPtvMrvDBN+MqL3UDq70qhQWsmKX Wwr5S6o+zVAlQZ8dPb8OQCxQ9GXn9hFLFdtijsqfDdcb3Ql84V4ZZSKzYLywitvFyXllXg ZS7xx+RCfJ3ajrK5FKN/JJJpMomBhTLt7R5CfJVp3RVHoVuPXlOcznkYMiRwMual0l632t FWYheIvYX8MWS9twanu67wH9t1pX63ui3lmqzHP0TbBCdc4wGS+QzOnNeQX0jkBLZaZR5M X3EjMzo4IvL4HNNk3ibdXEXhR/79R5LK+QwwlMc2CXT6AADWG6jAIP6TF93diw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cfe9b890d574a92e8b04eb662e9ac2010d243193 commit cfe9b890d574a92e8b04eb662e9ac2010d243193 Author: Kristof Provost AuthorDate: 2021-10-29 15:40:53 +0000 Commit: Kristof Provost CommitDate: 2021-11-26 03:39:05 +0000 pf: Introduce ridentifier Allow users to set a number on rules which will be exposed as part of the pflog header. The intent behind this is to allow users to correlate rules across updates (remember that pf rules continue to exist and match existing states, even if they're removed from the active ruleset) and pflog. Obtained from: pfSense MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32750 (cherry picked from commit 76c5eecc3490d89a9a3492ed2354802b69d69602) --- contrib/tcpdump/print-pflog.c | 7 ++++++- lib/libpfctl/libpfctl.c | 2 ++ lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/parse.y | 14 ++++++++++++++ sbin/pfctl/pfctl_parser.c | 2 ++ share/man/man4/pflog.4 | 3 ++- share/man/man5/pf.conf.5 | 7 ++++++- sys/net/if_pflog.h | 1 + sys/net/pfvar.h | 1 + sys/netpfil/ipfw/nat64/nat64clat.c | 2 +- sys/netpfil/ipfw/nat64/nat64lsn.c | 2 +- sys/netpfil/ipfw/nat64/nat64stl.c | 2 +- sys/netpfil/pf/if_pflog.c | 3 ++- sys/netpfil/pf/pf_nv.c | 2 ++ 14 files changed, 42 insertions(+), 7 deletions(-) diff --git a/contrib/tcpdump/print-pflog.c b/contrib/tcpdump/print-pflog.c index 38201c55ee3f..49994507e728 100644 --- a/contrib/tcpdump/print-pflog.c +++ b/contrib/tcpdump/print-pflog.c @@ -88,10 +88,12 @@ static const struct tok pf_directions[] = { static void pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) { - uint32_t rulenr, subrulenr; + uint32_t rulenr, subrulenr, ridentifier; rulenr = EXTRACT_32BITS(&hdr->rulenr); subrulenr = EXTRACT_32BITS(&hdr->subrulenr); + ridentifier = EXTRACT_32BITS(&hdr->ridentifier); + if (subrulenr == (uint32_t)-1) ND_PRINT((ndo, "rule %u/", rulenr)); else @@ -102,6 +104,9 @@ pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) if (hdr->uid != UID_MAX) ND_PRINT((ndo, " [uid %u]", (unsigned)hdr->uid)); + if (ridentifier != 0) + ND_PRINT((ndo, " [ridentifier %u]", ridentifier)); + ND_PRINT((ndo, ": %s %s on %s: ", tok2str(pf_actions, "unkn(%u)", hdr->action), tok2str(pf_directions, "unkn(%u)", hdr->dir), diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index c2d57d8136ca..e41f970e7696 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -455,6 +455,7 @@ pf_nvrule_to_rule(const nvlist_t *nvl, struct pfctl_rule *rule) assert(labelcount <= PF_RULE_MAX_LABEL_COUNT); for (size_t i = 0; i < labelcount; i++) strlcpy(rule->label[i], labels[i], PF_RULE_LABEL_SIZE); + rule->ridentifier = nvlist_get_number(nvl, "ridentifier"); strlcpy(rule->ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); strlcpy(rule->qname, nvlist_get_string(nvl, "qname"), PF_QNAME_SIZE); strlcpy(rule->pqname, nvlist_get_string(nvl, "pqname"), PF_QNAME_SIZE); @@ -566,6 +567,7 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, r->label[labelcount]); labelcount++; } + nvlist_add_number(nvlr, "ridentifier", r->ridentifier); nvlist_add_string(nvlr, "ifname", r->ifname); nvlist_add_string(nvlr, "qname", r->qname); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 70c144772c02..ac239d7cdcb1 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -81,6 +81,7 @@ struct pfctl_rule { struct pf_rule_addr dst; union pf_rule_ptr skip[PF_SKIP_COUNT]; char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; + u_int32_t ridentifier; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index c8a310688ca7..c075a0d4607c 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -236,6 +236,7 @@ static struct filter_opts { struct node_icmp *icmpspec; u_int32_t tos; u_int32_t prob; + u_int32_t ridentifier; struct { int action; struct node_state_opt *options; @@ -260,6 +261,7 @@ static struct filter_opts { static struct antispoof_opts { char *label[PF_RULE_MAX_LABEL_COUNT]; int labelcount; + u_int32_t ridentifier; u_int rtableid; } antispoof_opts; @@ -468,6 +470,7 @@ int parseport(char *, struct range *r, int); %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY MAPEPORTSET %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME %token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL +%token RIDENTIFIER %token LOAD RULESET_OPTIMIZATION PRIO %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY @@ -923,6 +926,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto r.af = $6; r.prob = $9.prob; r.rtableid = $9.rtableid; + r.ridentifier = $9.ridentifier; if ($9.tag) if (strlcpy(r.tagname, $9.tag, @@ -1322,6 +1326,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { r.logif = $2.logif; r.quick = $2.quick; r.af = $4; + r.ridentifier = $5.ridentifier; if (rule_label(&r, $5.label)) YYERROR; r.rtableid = $5.rtableid; @@ -1374,6 +1379,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { r.logif = $2.logif; r.quick = $2.quick; r.af = $4; + r.ridentifier = $5.ridentifier; if (rule_label(&r, $5.label)) YYERROR; r.rtableid = $5.rtableid; @@ -1436,6 +1442,9 @@ antispoof_opt : label { } antispoof_opts.label[antispoof_opts.labelcount++] = $1; } + | RIDENTIFIER number { + antispoof_opts.ridentifier = $2; + } | RTABLE NUMBER { if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); @@ -2151,6 +2160,7 @@ pfrule : action dir logquick interface route af proto fromto YYERROR; for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) free($9.label[i]); + r.ridentifier = $9.ridentifier; r.flags = $9.flags.b1; r.flagset = $9.flags.b2; if (($9.flags.b1 & $9.flags.b2) != $9.flags.b1) { @@ -2581,6 +2591,9 @@ filter_opt : USER uids { filter_opts.keep.action = $1.action; filter_opts.keep.options = $1.options; } + | RIDENTIFIER number { + filter_opts.ridentifier = $2; + } | FRAGMENT { filter_opts.fragment = 1; } @@ -5695,6 +5708,7 @@ lookup(char *s) { "return-icmp", RETURNICMP}, { "return-icmp6", RETURNICMP6}, { "return-rst", RETURNRST}, + { "ridentifier", RIDENTIFIER}, { "round-robin", ROUNDROBIN}, { "route", ROUTE}, { "route-to", ROUTETO}, diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 8d39b45eb9a5..8dde3c916009 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1019,6 +1019,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer i = 0; while (r->label[i][0]) printf(" label \"%s\"", r->label[i++]); + if (r->ridentifier) + printf(" ridentifier %u", r->ridentifier); if (r->qname[0] && r->pqname[0]) printf(" queue(%s, %s)", r->qname, r->pqname); else if (r->qname[0]) diff --git a/share/man/man4/pflog.4 b/share/man/man4/pflog.4 index 300092a9532b..19eb7012bca3 100644 --- a/share/man/man4/pflog.4 +++ b/share/man/man4/pflog.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2019 +.Dd October 29, 2021 .Dt PFLOG 4 .Os .Sh NAME @@ -84,6 +84,7 @@ struct pfloghdr { pid_t rule_pid; u_int8_t dir; u_int8_t pad[3]; + u_int32_t ridentifier; }; .Ed .Sh EXAMPLES diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 32f51bc00e47..cc1b902e0006 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -1867,6 +1867,9 @@ pass in inet proto tcp from any to 1.2.3.5 \e The macro expansion for the .Ar label directive occurs only at configuration file parse time, not during runtime. +.It Ar ridentifier Aq Ar number +Add an identifier (number) to the rule, which can be used to correlate the rule +to pflog entries, even after ruleset updates. .It Xo Ar queue Aq Ar queue .No \*(Ba ( Aq Ar queue , .Aq Ar queue ) @@ -2969,7 +2972,8 @@ filteropt = user | group | flags | icmp-type | icmp6-type | "tos" tos | "label" string | "tag" string | [ ! ] "tagged" string | "set prio" ( number | "(" number [ [ "," ] number ] ")" ) | "queue" ( string | "(" string [ [ "," ] string ] ")" ) | - "rtable" number | "probability" number"%" | "prio" number + "rtable" number | "probability" number"%" | "prio" number | + "ridentifier" number nat-rule = [ "no" ] "nat" [ "pass" [ "log" [ "(" logopts ")" ] ] ] [ "on" ifspec ] [ af ] @@ -2993,6 +2997,7 @@ rdr-rule = [ "no" ] "rdr" [ "pass" [ "log" [ "(" logopts ")" ] ] ] antispoof-rule = "antispoof" [ "log" ] [ "quick" ] "for" ifspec [ af ] [ "label" string ] + [ "ridentifier" number ] table-rule = "table" "\*(Lt" string "\*(Gt" [ tableopts-list ] tableopts-list = tableopts-list tableopts | tableopts diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h index 5ed341a85d86..c77d8da1440a 100644 --- a/sys/net/if_pflog.h +++ b/sys/net/if_pflog.h @@ -50,6 +50,7 @@ struct pfloghdr { pid_t rule_pid; u_int8_t dir; u_int8_t pad[3]; + u_int32_t ridentifier; }; #define PFLOG_HDRLEN sizeof(struct pfloghdr) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9fb231e95a2c..f9071546cbce 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -572,6 +572,7 @@ struct pf_krule { struct pf_rule_addr dst; union pf_krule_ptr skip[PF_SKIP_COUNT]; char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; + uint32_t ridentifier; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; diff --git a/sys/netpfil/ipfw/nat64/nat64clat.c b/sys/netpfil/ipfw/nat64/nat64clat.c index fcc922726d02..c48c68183e08 100644 --- a/sys/netpfil/ipfw/nat64/nat64clat.c +++ b/sys/netpfil/ipfw/nat64/nat64clat.c @@ -71,7 +71,7 @@ nat64clat_log(struct pfloghdr *plog, struct mbuf *m, sa_family_t family, static uint32_t pktid = 0; memset(plog, 0, sizeof(*plog)); - plog->length = PFLOG_REAL_HDRLEN; + plog->length = PFLOG_HDRLEN; plog->af = family; plog->action = PF_NAT; plog->dir = PF_IN; diff --git a/sys/netpfil/ipfw/nat64/nat64lsn.c b/sys/netpfil/ipfw/nat64/nat64lsn.c index bde42eeb18d6..90c27cabdf29 100644 --- a/sys/netpfil/ipfw/nat64/nat64lsn.c +++ b/sys/netpfil/ipfw/nat64/nat64lsn.c @@ -181,7 +181,7 @@ nat64lsn_log(struct pfloghdr *plog, struct mbuf *m, sa_family_t family, { memset(plog, 0, sizeof(*plog)); - plog->length = PFLOG_REAL_HDRLEN; + plog->length = PFLOG_HDRLEN; plog->af = family; plog->action = PF_NAT; plog->dir = PF_IN; diff --git a/sys/netpfil/ipfw/nat64/nat64stl.c b/sys/netpfil/ipfw/nat64/nat64stl.c index 286876e553e3..a3451a107579 100644 --- a/sys/netpfil/ipfw/nat64/nat64stl.c +++ b/sys/netpfil/ipfw/nat64/nat64stl.c @@ -70,7 +70,7 @@ nat64stl_log(struct pfloghdr *plog, struct mbuf *m, sa_family_t family, static uint32_t pktid = 0; memset(plog, 0, sizeof(*plog)); - plog->length = PFLOG_REAL_HDRLEN; + plog->length = PFLOG_HDRLEN; plog->af = family; plog->action = PF_NAT; plog->dir = PF_IN; diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 9eb168b9a74f..4853c1301d6f 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -215,7 +215,7 @@ pflog_packet(struct pfi_kkif *kif, struct mbuf *m, sa_family_t af, u_int8_t dir, return (0); bzero(&hdr, sizeof(hdr)); - hdr.length = PFLOG_REAL_HDRLEN; + hdr.length = PFLOG_HDRLEN; hdr.af = af; hdr.action = rm->action; hdr.reason = reason; @@ -231,6 +231,7 @@ pflog_packet(struct pfi_kkif *kif, struct mbuf *m, sa_family_t af, u_int8_t dir, strlcpy(hdr.ruleset, ruleset->anchor->name, sizeof(hdr.ruleset)); } + hdr.ridentifier = htonl(rm->ridentifier); /* * XXXGL: we avoid pf_socket_lookup() when we are holding * state lock, since this leads to unsafe LOR. diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index d53c6fe4b84e..b6676be645d7 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -531,6 +531,7 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule *rule) } } + PFNV_CHK(pf_nvuint32_opt(nvl, "ridentifier", &rule->ridentifier, 0)); PFNV_CHK(pf_nvstring(nvl, "ifname", rule->ifname, sizeof(rule->ifname))); PFNV_CHK(pf_nvstring(nvl, "qname", rule->qname, sizeof(rule->qname))); @@ -693,6 +694,7 @@ pf_krule_to_nvrule(struct pf_krule *rule) nvlist_append_string_array(nvl, "labels", rule->label[i]); } nvlist_add_string(nvl, "label", rule->label[0]); + nvlist_add_number(nvl, "ridentifier", rule->ridentifier); nvlist_add_string(nvl, "ifname", rule->ifname); nvlist_add_string(nvl, "qname", rule->qname); nvlist_add_string(nvl, "pqname", rule->pqname); From nobody Fri Nov 26 19:40:11 2021 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 D793818C684B; Fri, 26 Nov 2021 19:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J14pM2q5vz4qNl; Fri, 26 Nov 2021 19:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C87E63BE; Fri, 26 Nov 2021 19:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQJeBwd020247; Fri, 26 Nov 2021 19:40:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQJeBgB020246; Fri, 26 Nov 2021 19:40:11 GMT (envelope-from git) Date: Fri, 26 Nov 2021 19:40:11 GMT Message-Id: <202111261940.1AQJeBgB020246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 07b8f5dca17b - stable/13 - pf tests: basic test for ridentifier 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07b8f5dca17bb45257e6ded2de7cf831b0c27716 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637955611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7mncLERuDD4Kfn3x97Toc3IZ7KWy7bmRb6LQvdK8YUY=; b=eQHRzQP8AlpxbS/aXCTd98/Lb0uUy4Ynai1jGBPNLLdOurEyFG2u/5b4s87oJ/wtTppb8H 1nxwBat6ieR2gSBG+DuFnz3GGkg4b4hhkrREmp9m5euqHn8P+fTylBUzq2TtsEM1HERz0L /W9ybHn/SQtp5R3q3b0Wn7eJzcUNgFs1V0sca81TzsjDGtXe4gUmplX9aBK5ASOMULt9Oe 2K43M9634OAquX1livkmfExK4LvC1UumZyl5A3NIkq9ysiKjnrr9M2suQkM+SWScIUsLSF bPXMgADWljco08XC7GceSHH2r8IMHPfZpKSnEO2DWPx2mlH9cXjlVE7Wb8iuxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637955611; a=rsa-sha256; cv=none; b=NWfqOs4qjb8uk9/GVTJV5CmXI6gG/D+6QG94iSyrJ2MC5Fp6Qq46gTA1thw6F8e+BSlC5n WFvK4hnxAM9JL4yRqfG2WXbqYmYMH7NIqDY49+Fgj0vpjSLKCWy8H+mAUdJXlEyAjh1dnv Qc+owImPbAIv34yymPyokf2wo2Q+fCcbujiOBt3DYZ0bbdHCONqzUNW8PYAoRFY5ZHAL0M GFvzJLR0MvK+K79ls5Vl67TIHcsg16a9/PDyNo7GNNM8Fw08WkAfcxiCZRm3d2QVAcKLMG wGLwgGEtpgcIBJ98ZvgvBSfFzYgk1e0AZ+uzudzlynRu1mAEpbifJx9Lq2P3gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=07b8f5dca17bb45257e6ded2de7cf831b0c27716 commit 07b8f5dca17bb45257e6ded2de7cf831b0c27716 Author: Kristof Provost AuthorDate: 2021-10-29 15:52:59 +0000 Commit: Kristof Provost CommitDate: 2021-11-26 03:39:33 +0000 pf tests: basic test for ridentifier MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32751 (cherry picked from commit 508161111dc23cee0a41fa70de865743c694502f) --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/ridentifier.sh | 108 ++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/utils.subr | 7 +++ 3 files changed, 116 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 246c267e7d2b..e62f3485d26d 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -22,6 +22,7 @@ ATF_TESTS_SH+= altq \ pfsync \ proxy \ rdr \ + ridentifier \ route_to \ rules_counter \ set_skip \ diff --git a/tests/sys/netpfil/pf/ridentifier.sh b/tests/sys/netpfil/pf/ridentifier.sh new file mode 100644 index 000000000000..da2f40c7ae98 --- /dev/null +++ b/tests/sys/netpfil/pf/ridentifier.sh @@ -0,0 +1,108 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Test ridentifier keyword' + atf_set require.user root +} + +basic_body() +{ + pft_init + pflog_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig lo0 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid $(atf_get_srcdir)/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + jexec alcatraz pfctl -e + jexec alcatraz ifconfig pflog0 up + pft_set_rules alcatraz \ + "pass in log" \ + "pass in log proto tcp ridentifier 1234" + + jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > tcpdump.log & + sleep 1 + + echo "test" | nc -N 192.0.2.2 7 + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + sleep 1 + jexec alcatraz killall tcpdump + + # Make sure we spotted the ridentifier + atf_check -s exit:0 -o ignore \ + grep 'rule 1/0.*ridentifier 1234' tcpdump.log + # But not on the !TCP traffic + atf_check -s exit:1 -o ignore \ + grep 'rule 0/0.*ridentifier' tcpdump.log + + # Now try with antispoof rules + pft_set_rules alcatraz \ + "pass in log" \ + "antispoof log for ${epair}b ridentifier 4321" + + jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > tcpdump.log & + sleep 1 + + # Without explicit rules for lo0 we're going to drop packets to ourself + atf_check -s exit:2 -o ignore -e ignore \ + jexec alcatraz ping -c 1 -t 1 192.0.2.2 + + sleep 1 + jexec alcatraz killall tcpdump + + cat tcpdump.log + + # Make sure we spotted the ridentifier + atf_check -s exit:0 -o ignore \ + grep 'rule 2/0.*ridentifier 4321' tcpdump.log +} + +basic_cleanup() +{ + pft_cleanup + rm -f inetd-alcatraz.pid + rm -f tcpdump.log +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index d7df2a6747da..c9a404c8012e 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -46,6 +46,13 @@ pfsynct_init() fi } +pflog_init() +{ + if ! kldstat -q -m pflog; then + atf_skip "This test requires pflog" + fi +} + pft_set_rules() { jname=$1 From nobody Fri Nov 26 19:40:12 2021 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 5950818C6955; Fri, 26 Nov 2021 19:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J14pN49r8z4qWK; Fri, 26 Nov 2021 19:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52A3663BF; Fri, 26 Nov 2021 19:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQJeCL2020717; Fri, 26 Nov 2021 19:40:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQJeCFw020714; Fri, 26 Nov 2021 19:40:12 GMT (envelope-from git) Date: Fri, 26 Nov 2021 19:40:12 GMT Message-Id: <202111261940.1AQJeCFw020714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 029aed928131 - stable/13 - lagg: fix unused-but-set-variable 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 029aed928131427bab6274f2a1343d5aecd0ff31 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637955612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HAlQOMxreN5yaWRogAFB+VK5JEHghhsdUcXryjKai1M=; b=mYwzApOC1xvGhfSDv1QxlfIRv0atocuOPzyP8HIapxSc275S2qI6l1LC04vh/aQwvyLMtg W/A2UQPjQX2jNtpVCUPyhEAPFecnMelwn7qeghULb6rcyoIe/OEepJ8ajexs+8MFYPiJ2J uoXFuDHZTrxP8jQ0qCZQ2V/opvUoFcbo24yoswf5asA9BttXJhaWAXp10q0Zsn9fDisiAe 2HJbReCYgFNxhI8el8gjuVBdVmZba50vDlPTdy0q8H5wc6v0IM/OSjL5bz5KGmtNZ6MOPB ip/JNccsm781u89w6O/72JU8uJ1E/x6YbXMhbNwW5g6OfvZSpRTzGjS0e9B4OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637955612; a=rsa-sha256; cv=none; b=ltg27vWQ0j49+0XdqaU2mqe5CclMP7ksnvf5JO2AV+rVApRjp1SUGX8B65CwCM6BzSaxuj KxpPb2a+W5TvXUkf2GEQt091O6p2VFrsj1UH/SvZ66ONwsi8dbPDuSTcwalHFjVieCSIPN WILqAM3Kl/CpsYgG8lbxrTSXpn5oi2dSSg7vlFBNUD47/kVDsVNimdiIQ/1HThoX9oaZ3S YEVqNACKSSrwjsdtZTmokiCr7QqShf1LbAR5GHtnk3bDntUbfd2ZxiDGWQBHEh+EF7HPrj gLj8xcmKxMfcd0TjgMmINjzneCJ1DY+Ewtlj845gdUCORUetIhbYRuU7eIRMFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=029aed928131427bab6274f2a1343d5aecd0ff31 commit 029aed928131427bab6274f2a1343d5aecd0ff31 Author: Kristof Provost AuthorDate: 2021-11-19 16:22:48 +0000 Commit: Kristof Provost CommitDate: 2021-11-26 03:40:56 +0000 lagg: fix unused-but-set-variable MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3142d4f622d2f95da5c7c52f60ce840411a07b0a) --- sys/net/if_lagg.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index c53e5b283b76..55aae2795644 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -1797,13 +1797,10 @@ lagg_snd_tag_alloc(struct ifnet *ifp, { struct epoch_tracker et; struct lagg_snd_tag *lst; - struct lagg_softc *sc; struct lagg_port *lp; struct ifnet *lp_ifp; int error; - sc = ifp->if_softc; - NET_EPOCH_ENTER(et); lp = lookup_snd_tag_port(ifp, params->hdr.flowid, params->hdr.flowtype, params->hdr.numa_domain); From nobody Fri Nov 26 19:40:13 2021 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 66C5F18C6856; Fri, 26 Nov 2021 19:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J14pQ0pRrz4qGD; Fri, 26 Nov 2021 19:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61D1B655F; Fri, 26 Nov 2021 19:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQJeDeW021221; Fri, 26 Nov 2021 19:40:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQJeDDF021218; Fri, 26 Nov 2021 19:40:13 GMT (envelope-from git) Date: Fri, 26 Nov 2021 19:40:13 GMT Message-Id: <202111261940.1AQJeDDF021218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9aa63a8d13c6 - stable/13 - libpfct: be consistent with u_int vs. uint 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9aa63a8d13c6aa873cecca6858f52d1c381ecfd5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637955614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PyHcMMGiTqjXxS+K7eHmWEyiRbG+6e01x56IRded/Es=; b=YqCag2fdsnj7IbU9D6JXXE5fYHsUk5P0kvihKF4qywp1oLLhxJUdDxyEz3m5Um1Ncc+5Qx SjsnDfKhLOLChwwomU5aRbNlgen2/JeLcguIYmO7RNWavfVj3bFhPwwAREr9vldKZRZvNi kGR08+cnkHpQ2fPXlu561olkr2MEUQdmQh35HmGX1LmY3lGkkH2P/+g1nSxPa5T848fXGW GjnLJ/EmqmNFSNxaQObHgR9gBe1FvzLU7Ao1on8A9ZDiEImVXMUdRbbLsV3n7Ad4DMhrsb yqv9EfOMnS1wwYwx5Rv07Zjo/xgEmlkP4i8kXzikGmhUAso/K31cDzkeec5gdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637955614; a=rsa-sha256; cv=none; b=UvnExHh5qD5HltLjD9+xXiB+L9/QvgkvaI5ypJfIGIcLGom0LD+w/XdfYcIHSGwMzE83qt TK9KBbsoBremb3o9y4eFnJzeHkDgRY4m3Ap7SBw4Ihzv8N2Ik+qQKRuTcRrJXFu4twviEd w2fyWQ1/OHM1QwNuojRwxIP7Ff8By/oeLiz6qL0orlvhkYITCv2mirl8exI7luigClLCwX D/cbfMbXvOPi/EAxQgBIQLuVR6nJxjxCKgvNkcya6/D6Tuysv/N2FXqD+YzDh+k2t8okMC htalVTZTPmWXrR2os5rHlaHxgSlY6cquYI5gsLfaG8PznlTR4PdVW3IQEG/8Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9aa63a8d13c6aa873cecca6858f52d1c381ecfd5 commit 9aa63a8d13c6aa873cecca6858f52d1c381ecfd5 Author: Kristof Provost AuthorDate: 2021-11-05 08:37:56 +0000 Commit: Kristof Provost CommitDate: 2021-11-26 03:42:04 +0000 libpfct: be consistent with u_int vs. uint Always use uint64_t over u_int64_t, for the sake of consistency. No functional change. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 7bb3c927f7d9c48b356b4d20907b813f9b83273b) --- lib/libpfctl/libpfctl.c | 34 +++++++------- lib/libpfctl/libpfctl.h | 122 ++++++++++++++++++++++++------------------------ 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index e41f970e7696..96f5ea620f4d 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -61,7 +61,7 @@ static int _pfctl_clear_states(int , const struct pfctl_kill *, static void pf_nvuint_8_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int8_t *numbers, size_t *nelems) + uint8_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -78,7 +78,7 @@ pf_nvuint_8_array(const nvlist_t *nvl, const char *name, size_t maxelems, static void pf_nvuint_16_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int16_t *numbers, size_t *nelems) + uint16_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -95,7 +95,7 @@ pf_nvuint_16_array(const nvlist_t *nvl, const char *name, size_t maxelems, static void pf_nvuint_32_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int32_t *numbers, size_t *nelems) + uint32_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -112,7 +112,7 @@ pf_nvuint_32_array(const nvlist_t *nvl, const char *name, size_t maxelems, static void pf_nvuint_64_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int64_t *numbers, size_t *nelems) + uint64_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -304,7 +304,7 @@ static void pfctl_nv_add_rule_addr(nvlist_t *nvparent, const char *name, const struct pf_rule_addr *addr) { - u_int64_t ports[2]; + uint64_t ports[2]; nvlist_t *nvl = nvlist_create(0); pfctl_nv_add_addr_wrap(nvl, "addr", &addr->addr); @@ -345,7 +345,7 @@ static void pfctl_nv_add_pool(nvlist_t *nvparent, const char *name, const struct pfctl_pool *pool) { - u_int64_t ports[2]; + uint64_t ports[2]; nvlist_t *nvl = nvlist_create(0); nvlist_add_binary(nvl, "key", &pool->key, sizeof(pool->key)); @@ -394,7 +394,7 @@ static void pfctl_nv_add_uid(nvlist_t *nvparent, const char *name, const struct pf_rule_uid *uid) { - u_int64_t uids[2]; + uint64_t uids[2]; nvlist_t *nvl = nvlist_create(0); uids[0] = uid->uid[0]; @@ -539,11 +539,11 @@ pf_nvrule_to_rule(const nvlist_t *nvl, struct pfctl_rule *rule) int pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, - const char *anchor_call, u_int32_t ticket, u_int32_t pool_ticket) + const char *anchor_call, uint32_t ticket, uint32_t pool_ticket) { struct pfioc_nv nv; - u_int64_t timeouts[PFTM_MAX]; - u_int64_t set_prio[2]; + uint64_t timeouts[PFTM_MAX]; + uint64_t set_prio[2]; nvlist_t *nvl, *nvlr; size_t labelcount; int ret; @@ -656,15 +656,15 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, } int -pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket, const char *anchor, - u_int32_t ruleset, struct pfctl_rule *rule, char *anchor_call) +pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket, const char *anchor, + uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call) { return (pfctl_get_clear_rule(dev, nr, ticket, anchor, ruleset, rule, anchor_call, false)); } -int pfctl_get_clear_rule(int dev, u_int32_t nr, u_int32_t ticket, - const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule, +int pfctl_get_clear_rule(int dev, uint32_t nr, uint32_t ticket, + const char *anchor, uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call, bool clear) { struct pfioc_nv nv; @@ -941,7 +941,7 @@ pfctl_kill_states(int dev, const struct pfctl_kill *kill, unsigned int *killed) } static int -pfctl_get_limit(int dev, const int index, u_int *limit) +pfctl_get_limit(int dev, const int index, uint *limit) { struct pfioc_limit pl; @@ -962,7 +962,7 @@ pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s) struct pfioc_nv nv; nvlist_t *nvl; int ret; - u_int state_limit; + uint state_limit; ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit); if (ret != 0) @@ -992,7 +992,7 @@ pfctl_get_syncookies(int dev, struct pfctl_syncookies *s) struct pfioc_nv nv; nvlist_t *nvl; int ret; - u_int state_limit; + uint state_limit; bool enabled, adaptive; ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index ac239d7cdcb1..a9bd14527126 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -72,8 +72,8 @@ struct pfctl_pool { struct pf_addr counter; struct pf_mape_portset mape; int tblidx; - u_int16_t proxy_port[2]; - u_int8_t opts; + uint16_t proxy_port[2]; + uint8_t opts; }; struct pfctl_rule { @@ -81,7 +81,7 @@ struct pfctl_rule { struct pf_rule_addr dst; union pf_rule_ptr skip[PF_SKIP_COUNT]; char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; - u_int32_t ridentifier; + uint32_t ridentifier; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; @@ -93,9 +93,9 @@ struct pfctl_rule { TAILQ_ENTRY(pfctl_rule) entries; struct pfctl_pool rpool; - u_int64_t evaluations; - u_int64_t packets[2]; - u_int64_t bytes[2]; + uint64_t evaluations; + uint64_t packets[2]; + uint64_t bytes[2]; struct pfi_kif *kif; struct pfctl_anchor *anchor; @@ -104,19 +104,19 @@ struct pfctl_rule { pf_osfp_t os_fingerprint; int rtableid; - u_int32_t timeout[PFTM_MAX]; - u_int32_t max_states; - u_int32_t max_src_nodes; - u_int32_t max_src_states; - u_int32_t max_src_conn; + uint32_t timeout[PFTM_MAX]; + uint32_t max_states; + uint32_t max_src_nodes; + uint32_t max_src_states; + uint32_t max_src_conn; struct { - u_int32_t limit; - u_int32_t seconds; + uint32_t limit; + uint32_t seconds; } max_src_conn_rate; - u_int32_t qid; - u_int32_t pqid; - u_int32_t nr; - u_int32_t prob; + uint32_t qid; + uint32_t pqid; + uint32_t nr; + uint32_t prob; uid_t cuid; pid_t cpid; @@ -124,49 +124,49 @@ struct pfctl_rule { uint64_t states_tot; uint64_t src_nodes; - u_int16_t return_icmp; - u_int16_t return_icmp6; - u_int16_t max_mss; - u_int16_t tag; - u_int16_t match_tag; - u_int16_t scrub_flags; + uint16_t return_icmp; + uint16_t return_icmp6; + uint16_t max_mss; + uint16_t tag; + uint16_t match_tag; + uint16_t scrub_flags; struct pf_rule_uid uid; struct pf_rule_gid gid; - u_int32_t rule_flag; - u_int8_t action; - u_int8_t direction; - u_int8_t log; - u_int8_t logif; - u_int8_t quick; - u_int8_t ifnot; - u_int8_t match_tag_not; - u_int8_t natpass; - - u_int8_t keep_state; + uint32_t rule_flag; + uint8_t action; + uint8_t direction; + uint8_t log; + uint8_t logif; + uint8_t quick; + uint8_t ifnot; + uint8_t match_tag_not; + uint8_t natpass; + + uint8_t keep_state; sa_family_t af; - u_int8_t proto; - u_int8_t type; - u_int8_t code; - u_int8_t flags; - u_int8_t flagset; - u_int8_t min_ttl; - u_int8_t allow_opts; - u_int8_t rt; - u_int8_t return_ttl; - u_int8_t tos; - u_int8_t set_tos; - u_int8_t anchor_relative; - u_int8_t anchor_wildcard; - - u_int8_t flush; - u_int8_t prio; - u_int8_t set_prio[2]; + uint8_t proto; + uint8_t type; + uint8_t code; + uint8_t flags; + uint8_t flagset; + uint8_t min_ttl; + uint8_t allow_opts; + uint8_t rt; + uint8_t return_ttl; + uint8_t tos; + uint8_t set_tos; + uint8_t anchor_relative; + uint8_t anchor_wildcard; + + uint8_t flush; + uint8_t prio; + uint8_t set_prio[2]; struct { struct pf_addr addr; - u_int16_t port; + uint16_t port; } divert; }; @@ -178,13 +178,13 @@ struct pfctl_ruleset { struct { struct pfctl_rulequeue *ptr; struct pfctl_rule **ptr_array; - u_int32_t rcount; - u_int32_t ticket; + uint32_t rcount; + uint32_t ticket; int open; } active, inactive; } rules[PF_RULESET_MAX]; struct pfctl_anchor *anchor; - u_int32_t tticket; + uint32_t tticket; int tables; int topen; }; @@ -288,15 +288,15 @@ struct pfctl_syncookies { struct pfctl_status* pfctl_get_status(int dev); void pfctl_free_status(struct pfctl_status *status); -int pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket, - const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule, +int pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket, + const char *anchor, uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call); -int pfctl_get_clear_rule(int dev, u_int32_t nr, u_int32_t ticket, - const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule, +int pfctl_get_clear_rule(int dev, uint32_t nr, uint32_t ticket, + const char *anchor, uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call, bool clear); int pfctl_add_rule(int dev, const struct pfctl_rule *r, - const char *anchor, const char *anchor_call, u_int32_t ticket, - u_int32_t pool_ticket); + const char *anchor, const char *anchor_call, uint32_t ticket, + uint32_t pool_ticket); int pfctl_set_keepcounters(int dev, bool keep); int pfctl_get_states(int dev, struct pfctl_states *states); void pfctl_free_states(struct pfctl_states *states); From nobody Fri Nov 26 19:40:16 2021 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 955CE18C6C13; Fri, 26 Nov 2021 19:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J14pT1WyWz4qWd; Fri, 26 Nov 2021 19:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B825065CE; Fri, 26 Nov 2021 19:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQJeGKY022807; Fri, 26 Nov 2021 19:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQJeGLZ022802; Fri, 26 Nov 2021 19:40:16 GMT (envelope-from git) Date: Fri, 26 Nov 2021 19:40:16 GMT Message-Id: <202111261940.1AQJeGLZ022802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 7f944794868f - stable/12 - pf: Introduce ridentifier 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7f944794868f49c59449086a3755d72e7f747e41 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637955617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNJXHXPA3UHzC2Y1xQiCykI2/7eJ2V7E5EegjBuuBeo=; b=UOIkOh0rzaNvhSpuiAx+L7L6kkGEDixO3Eb2QPxMwgdTjTdnn6Pj/dHzs1lDXD53KNfsBz alixFgzdhk8tdlN6eqYne81hlWMvFjZRYFVbw5zNYOnIQ1DDO3QNP37lpWJCULP9HNYqWa 3olnJDAI+y1wKdizfwBMoNBQhAZpZdBLfKRR/2zaSoeNv+PglUz61YKJqNewfTC5WXp7Z4 e365Yj5PB3XyvN1cxh+auGjIa7MGw107DOOFdXJJka62+h1TBpaYyPnNM4ZxTooA1N849x AbZooZLqHjGNIwbNdz3xiVwU6c+/uevJhH/bGhBrT+ImzqBekc+HkGHcl4MF5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637955617; a=rsa-sha256; cv=none; b=q6xJ5HX6S7ksaTz4Od5rsU3Zxb2gRxn8SVK5MEm+/4lGzA35YiygFlFYlbWz8SlyAiGKJP CAcZhq1sRTA6BJ2/fei9pJRuAcQ4MqRbdKBFCIUaft/Z1fMajvFOtzlknxlWgIYsyQENe7 50DPU+iy6MxDXmZFpeuGxikoI5rgvqoq4jxVespmXDTDWoRlRR1Lqrf2cnVV8QMvoeY879 y6xTvxf+k11ynR7k4CVjLJlKfT/+zLZxwAZ0ejx7LlSoVzhUAr//CatY//EbbLKD9G4yKr 2bTio0sjQeUIraqiaQozS3EQmm36Vm7gKD1gNaROb3ZQiOARtS0W6VsigumIjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7f944794868f49c59449086a3755d72e7f747e41 commit 7f944794868f49c59449086a3755d72e7f747e41 Author: Kristof Provost AuthorDate: 2021-10-29 15:40:53 +0000 Commit: Kristof Provost CommitDate: 2021-11-26 03:49:02 +0000 pf: Introduce ridentifier Allow users to set a number on rules which will be exposed as part of the pflog header. The intent behind this is to allow users to correlate rules across updates (remember that pf rules continue to exist and match existing states, even if they're removed from the active ruleset) and pflog. Obtained from: pfSense MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32750 (cherry picked from commit 76c5eecc3490d89a9a3492ed2354802b69d69602) --- contrib/tcpdump/print-pflog.c | 7 ++++++- lib/libpfctl/libpfctl.c | 2 ++ lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/parse.y | 14 ++++++++++++++ sbin/pfctl/pfctl_parser.c | 2 ++ share/man/man4/pflog.4 | 3 ++- share/man/man5/pf.conf.5 | 7 ++++++- sys/net/if_pflog.h | 1 + sys/net/pfvar.h | 1 + sys/netpfil/ipfw/nat64/nat64clat.c | 2 +- sys/netpfil/ipfw/nat64/nat64lsn.c | 2 +- sys/netpfil/ipfw/nat64/nat64stl.c | 2 +- sys/netpfil/pf/if_pflog.c | 3 ++- sys/netpfil/pf/pf_nv.c | 2 ++ 14 files changed, 42 insertions(+), 7 deletions(-) diff --git a/contrib/tcpdump/print-pflog.c b/contrib/tcpdump/print-pflog.c index 38201c55ee3f..49994507e728 100644 --- a/contrib/tcpdump/print-pflog.c +++ b/contrib/tcpdump/print-pflog.c @@ -88,10 +88,12 @@ static const struct tok pf_directions[] = { static void pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) { - uint32_t rulenr, subrulenr; + uint32_t rulenr, subrulenr, ridentifier; rulenr = EXTRACT_32BITS(&hdr->rulenr); subrulenr = EXTRACT_32BITS(&hdr->subrulenr); + ridentifier = EXTRACT_32BITS(&hdr->ridentifier); + if (subrulenr == (uint32_t)-1) ND_PRINT((ndo, "rule %u/", rulenr)); else @@ -102,6 +104,9 @@ pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) if (hdr->uid != UID_MAX) ND_PRINT((ndo, " [uid %u]", (unsigned)hdr->uid)); + if (ridentifier != 0) + ND_PRINT((ndo, " [ridentifier %u]", ridentifier)); + ND_PRINT((ndo, ": %s %s on %s: ", tok2str(pf_actions, "unkn(%u)", hdr->action), tok2str(pf_directions, "unkn(%u)", hdr->dir), diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index c2d57d8136ca..e41f970e7696 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -455,6 +455,7 @@ pf_nvrule_to_rule(const nvlist_t *nvl, struct pfctl_rule *rule) assert(labelcount <= PF_RULE_MAX_LABEL_COUNT); for (size_t i = 0; i < labelcount; i++) strlcpy(rule->label[i], labels[i], PF_RULE_LABEL_SIZE); + rule->ridentifier = nvlist_get_number(nvl, "ridentifier"); strlcpy(rule->ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); strlcpy(rule->qname, nvlist_get_string(nvl, "qname"), PF_QNAME_SIZE); strlcpy(rule->pqname, nvlist_get_string(nvl, "pqname"), PF_QNAME_SIZE); @@ -566,6 +567,7 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, r->label[labelcount]); labelcount++; } + nvlist_add_number(nvlr, "ridentifier", r->ridentifier); nvlist_add_string(nvlr, "ifname", r->ifname); nvlist_add_string(nvlr, "qname", r->qname); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 70c144772c02..ac239d7cdcb1 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -81,6 +81,7 @@ struct pfctl_rule { struct pf_rule_addr dst; union pf_rule_ptr skip[PF_SKIP_COUNT]; char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; + u_int32_t ridentifier; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 2dd0e6b6ff43..f06462bda864 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -236,6 +236,7 @@ static struct filter_opts { struct node_icmp *icmpspec; u_int32_t tos; u_int32_t prob; + u_int32_t ridentifier; struct { int action; struct node_state_opt *options; @@ -260,6 +261,7 @@ static struct filter_opts { static struct antispoof_opts { char *label[PF_RULE_MAX_LABEL_COUNT]; int labelcount; + u_int32_t ridentifier; u_int rtableid; } antispoof_opts; @@ -468,6 +470,7 @@ int parseport(char *, struct range *r, int); %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY MAPEPORTSET %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME %token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL +%token RIDENTIFIER %token LOAD RULESET_OPTIMIZATION PRIO %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY @@ -915,6 +918,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto r.af = $6; r.prob = $9.prob; r.rtableid = $9.rtableid; + r.ridentifier = $9.ridentifier; if ($9.tag) if (strlcpy(r.tagname, $9.tag, @@ -1314,6 +1318,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { r.logif = $2.logif; r.quick = $2.quick; r.af = $4; + r.ridentifier = $5.ridentifier; if (rule_label(&r, $5.label)) YYERROR; r.rtableid = $5.rtableid; @@ -1366,6 +1371,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { r.logif = $2.logif; r.quick = $2.quick; r.af = $4; + r.ridentifier = $5.ridentifier; if (rule_label(&r, $5.label)) YYERROR; r.rtableid = $5.rtableid; @@ -1428,6 +1434,9 @@ antispoof_opt : label { } antispoof_opts.label[antispoof_opts.labelcount++] = $1; } + | RIDENTIFIER number { + antispoof_opts.ridentifier = $2; + } | RTABLE NUMBER { if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); @@ -2143,6 +2152,7 @@ pfrule : action dir logquick interface route af proto fromto YYERROR; for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) free($9.label[i]); + r.ridentifier = $9.ridentifier; r.flags = $9.flags.b1; r.flagset = $9.flags.b2; if (($9.flags.b1 & $9.flags.b2) != $9.flags.b1) { @@ -2573,6 +2583,9 @@ filter_opt : USER uids { filter_opts.keep.action = $1.action; filter_opts.keep.options = $1.options; } + | RIDENTIFIER number { + filter_opts.ridentifier = $2; + } | FRAGMENT { filter_opts.fragment = 1; } @@ -5687,6 +5700,7 @@ lookup(char *s) { "return-icmp", RETURNICMP}, { "return-icmp6", RETURNICMP6}, { "return-rst", RETURNRST}, + { "ridentifier", RIDENTIFIER}, { "round-robin", ROUNDROBIN}, { "route", ROUTE}, { "route-to", ROUTETO}, diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index dc4a2254d733..adf9255f0c84 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1019,6 +1019,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer i = 0; while (r->label[i][0]) printf(" label \"%s\"", r->label[i++]); + if (r->ridentifier) + printf(" ridentifier %u", r->ridentifier); if (r->qname[0] && r->pqname[0]) printf(" queue(%s, %s)", r->qname, r->pqname); else if (r->qname[0]) diff --git a/share/man/man4/pflog.4 b/share/man/man4/pflog.4 index 428bb5bd7f26..6269644bc312 100644 --- a/share/man/man4/pflog.4 +++ b/share/man/man4/pflog.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2007 +.Dd October 29, 2021 .Dt PFLOG 4 .Os .Sh NAME @@ -79,6 +79,7 @@ struct pfloghdr { pid_t rule_pid; u_int8_t dir; u_int8_t pad[3]; + u_int32_t ridentifier; }; .Ed .Sh EXAMPLES diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index f75edb6fcc17..e9ec3467da54 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -1868,6 +1868,9 @@ pass in inet proto tcp from any to 1.2.3.5 \e The macro expansion for the .Ar label directive occurs only at configuration file parse time, not during runtime. +.It Ar ridentifier Aq Ar number +Add an identifier (number) to the rule, which can be used to correlate the rule +to pflog entries, even after ruleset updates. .It Xo Ar queue Aq Ar queue .No \*(Ba ( Aq Ar queue , .Aq Ar queue ) @@ -2970,7 +2973,8 @@ filteropt = user | group | flags | icmp-type | icmp6-type | "tos" tos | "label" string | "tag" string | [ ! ] "tagged" string | "set prio" ( number | "(" number [ [ "," ] number ] ")" ) | "queue" ( string | "(" string [ [ "," ] string ] ")" ) | - "rtable" number | "probability" number"%" | "prio" number + "rtable" number | "probability" number"%" | "prio" number | + "ridentifier" number nat-rule = [ "no" ] "nat" [ "pass" [ "log" [ "(" logopts ")" ] ] ] [ "on" ifspec ] [ af ] @@ -2994,6 +2998,7 @@ rdr-rule = [ "no" ] "rdr" [ "pass" [ "log" [ "(" logopts ")" ] ] ] antispoof-rule = "antispoof" [ "log" ] [ "quick" ] "for" ifspec [ af ] [ "label" string ] + [ "ridentifier" number ] table-rule = "table" "\*(Lt" string "\*(Gt" [ tableopts-list ] tableopts-list = tableopts-list tableopts | tableopts diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h index 5ed341a85d86..c77d8da1440a 100644 --- a/sys/net/if_pflog.h +++ b/sys/net/if_pflog.h @@ -50,6 +50,7 @@ struct pfloghdr { pid_t rule_pid; u_int8_t dir; u_int8_t pad[3]; + u_int32_t ridentifier; }; #define PFLOG_HDRLEN sizeof(struct pfloghdr) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 6f8d79b27133..4c4fc7c65015 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -572,6 +572,7 @@ struct pf_krule { struct pf_rule_addr dst; union pf_krule_ptr skip[PF_SKIP_COUNT]; char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; + uint32_t ridentifier; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; diff --git a/sys/netpfil/ipfw/nat64/nat64clat.c b/sys/netpfil/ipfw/nat64/nat64clat.c index fcc922726d02..c48c68183e08 100644 --- a/sys/netpfil/ipfw/nat64/nat64clat.c +++ b/sys/netpfil/ipfw/nat64/nat64clat.c @@ -71,7 +71,7 @@ nat64clat_log(struct pfloghdr *plog, struct mbuf *m, sa_family_t family, static uint32_t pktid = 0; memset(plog, 0, sizeof(*plog)); - plog->length = PFLOG_REAL_HDRLEN; + plog->length = PFLOG_HDRLEN; plog->af = family; plog->action = PF_NAT; plog->dir = PF_IN; diff --git a/sys/netpfil/ipfw/nat64/nat64lsn.c b/sys/netpfil/ipfw/nat64/nat64lsn.c index ad1b62b07a92..ab77a071bcdb 100644 --- a/sys/netpfil/ipfw/nat64/nat64lsn.c +++ b/sys/netpfil/ipfw/nat64/nat64lsn.c @@ -181,7 +181,7 @@ nat64lsn_log(struct pfloghdr *plog, struct mbuf *m, sa_family_t family, { memset(plog, 0, sizeof(*plog)); - plog->length = PFLOG_REAL_HDRLEN; + plog->length = PFLOG_HDRLEN; plog->af = family; plog->action = PF_NAT; plog->dir = PF_IN; diff --git a/sys/netpfil/ipfw/nat64/nat64stl.c b/sys/netpfil/ipfw/nat64/nat64stl.c index a150322d1a44..fa7afee44be7 100644 --- a/sys/netpfil/ipfw/nat64/nat64stl.c +++ b/sys/netpfil/ipfw/nat64/nat64stl.c @@ -70,7 +70,7 @@ nat64stl_log(struct pfloghdr *plog, struct mbuf *m, sa_family_t family, static uint32_t pktid = 0; memset(plog, 0, sizeof(*plog)); - plog->length = PFLOG_REAL_HDRLEN; + plog->length = PFLOG_HDRLEN; plog->af = family; plog->action = PF_NAT; plog->dir = PF_IN; diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 9eb168b9a74f..4853c1301d6f 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -215,7 +215,7 @@ pflog_packet(struct pfi_kkif *kif, struct mbuf *m, sa_family_t af, u_int8_t dir, return (0); bzero(&hdr, sizeof(hdr)); - hdr.length = PFLOG_REAL_HDRLEN; + hdr.length = PFLOG_HDRLEN; hdr.af = af; hdr.action = rm->action; hdr.reason = reason; @@ -231,6 +231,7 @@ pflog_packet(struct pfi_kkif *kif, struct mbuf *m, sa_family_t af, u_int8_t dir, strlcpy(hdr.ruleset, ruleset->anchor->name, sizeof(hdr.ruleset)); } + hdr.ridentifier = htonl(rm->ridentifier); /* * XXXGL: we avoid pf_socket_lookup() when we are holding * state lock, since this leads to unsafe LOR. diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index d53c6fe4b84e..b6676be645d7 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -531,6 +531,7 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule *rule) } } + PFNV_CHK(pf_nvuint32_opt(nvl, "ridentifier", &rule->ridentifier, 0)); PFNV_CHK(pf_nvstring(nvl, "ifname", rule->ifname, sizeof(rule->ifname))); PFNV_CHK(pf_nvstring(nvl, "qname", rule->qname, sizeof(rule->qname))); @@ -693,6 +694,7 @@ pf_krule_to_nvrule(struct pf_krule *rule) nvlist_append_string_array(nvl, "labels", rule->label[i]); } nvlist_add_string(nvl, "label", rule->label[0]); + nvlist_add_number(nvl, "ridentifier", rule->ridentifier); nvlist_add_string(nvl, "ifname", rule->ifname); nvlist_add_string(nvl, "qname", rule->qname); nvlist_add_string(nvl, "pqname", rule->pqname); From nobody Fri Nov 26 19:40:17 2021 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 2A5FD18C6AC7; Fri, 26 Nov 2021 19:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J14pV2XQtz4qZ2; Fri, 26 Nov 2021 19:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0586278; Fri, 26 Nov 2021 19:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQJeHCG023324; Fri, 26 Nov 2021 19:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQJeHla023321; Fri, 26 Nov 2021 19:40:17 GMT (envelope-from git) Date: Fri, 26 Nov 2021 19:40:17 GMT Message-Id: <202111261940.1AQJeHla023321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 6aa808b2ada7 - stable/12 - pf tests: basic test for ridentifier 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6aa808b2ada75db1caa3ef52c463edb1717ccddb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637955619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nwpFZwUWgsU+zH5em8LGeogUjmzt40ILnTjY5/Ya7jY=; b=uajcQfSjHwJkAmyxcyBNMZYgBTAWvo8bCIoNlvbUoQbL9R+NsoJNTI1x34MO+wOtCAxB4j Mne/O8siV7ki2MU4z5/1gCCS86IRJvy2D2Vx3C4//JrP6WZzRYWVxxo+Qcs/ksH+nJWbLV iNk6uLsmdXbpou8uOfs+hQmic3iNqVoV3Un+xTAEVa9+mu8kYGHkcjiADq20OnaLH1FpAj cr/oTvxsnfm59uiHG7nsRl3AnZfLmscD7UKNePN/3E5D+3u0TOJ9XiAVNR2Oh4Rw7/p6bK j7d8c7momwejaMBinz38iW56wIOpIqFbgxxLDeIC2eG6K/EkwcIXOtYle2hKcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637955619; a=rsa-sha256; cv=none; b=kGfx49Yv31PIJObyzTpUlr34pnXx7EMGmNzVcbFD8v3JqyS0IG+sIPgkPbYbmaUiZIIDAj B1ksl4IbwZpGNnJ4geKVhcKkKu8mT0kH+Q0wxChXzj60ONEgy5uxPBGtXbXg8mUmAx0pdc NbmL3W+vAsSAE0nhdl50kOsoEfFcKMFpJMmo2PuoH37b73xOchy63+2wwEvluFpbR8lGRF kXR2/HXagH51JsX1X/woY9tDm65dwFiSDRO4Y3/3AKiWw2CISj937jC9P7pJdwW1txyjeF VJrUPt5PZ3mBkqBorCj20axzz5EBvsmi8cijFmOW+CTIELicz1JO9Si1A6ujzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6aa808b2ada75db1caa3ef52c463edb1717ccddb commit 6aa808b2ada75db1caa3ef52c463edb1717ccddb Author: Kristof Provost AuthorDate: 2021-10-29 15:52:59 +0000 Commit: Kristof Provost CommitDate: 2021-11-26 03:50:23 +0000 pf tests: basic test for ridentifier MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32751 (cherry picked from commit 508161111dc23cee0a41fa70de865743c694502f) --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/ridentifier.sh | 108 ++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/utils.subr | 7 +++ 3 files changed, 116 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 5a8b5fe8de70..ebeec7f85650 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -22,6 +22,7 @@ ATF_TESTS_SH+= altq \ set_tos \ src_track \ rdr \ + ridentifier \ route_to \ syncookie \ synproxy \ diff --git a/tests/sys/netpfil/pf/ridentifier.sh b/tests/sys/netpfil/pf/ridentifier.sh new file mode 100644 index 000000000000..da2f40c7ae98 --- /dev/null +++ b/tests/sys/netpfil/pf/ridentifier.sh @@ -0,0 +1,108 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Test ridentifier keyword' + atf_set require.user root +} + +basic_body() +{ + pft_init + pflog_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig lo0 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid $(atf_get_srcdir)/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + jexec alcatraz pfctl -e + jexec alcatraz ifconfig pflog0 up + pft_set_rules alcatraz \ + "pass in log" \ + "pass in log proto tcp ridentifier 1234" + + jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > tcpdump.log & + sleep 1 + + echo "test" | nc -N 192.0.2.2 7 + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + sleep 1 + jexec alcatraz killall tcpdump + + # Make sure we spotted the ridentifier + atf_check -s exit:0 -o ignore \ + grep 'rule 1/0.*ridentifier 1234' tcpdump.log + # But not on the !TCP traffic + atf_check -s exit:1 -o ignore \ + grep 'rule 0/0.*ridentifier' tcpdump.log + + # Now try with antispoof rules + pft_set_rules alcatraz \ + "pass in log" \ + "antispoof log for ${epair}b ridentifier 4321" + + jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > tcpdump.log & + sleep 1 + + # Without explicit rules for lo0 we're going to drop packets to ourself + atf_check -s exit:2 -o ignore -e ignore \ + jexec alcatraz ping -c 1 -t 1 192.0.2.2 + + sleep 1 + jexec alcatraz killall tcpdump + + cat tcpdump.log + + # Make sure we spotted the ridentifier + atf_check -s exit:0 -o ignore \ + grep 'rule 2/0.*ridentifier 4321' tcpdump.log +} + +basic_cleanup() +{ + pft_cleanup + rm -f inetd-alcatraz.pid + rm -f tcpdump.log +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index d7df2a6747da..c9a404c8012e 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -46,6 +46,13 @@ pfsynct_init() fi } +pflog_init() +{ + if ! kldstat -q -m pflog; then + atf_skip "This test requires pflog" + fi +} + pft_set_rules() { jname=$1 From nobody Fri Nov 26 19:40:18 2021 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 069E018C6A72; Fri, 26 Nov 2021 19:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J14pW52gSz4qD1; Fri, 26 Nov 2021 19:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3D9665CF; Fri, 26 Nov 2021 19:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQJeImv023858; Fri, 26 Nov 2021 19:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQJeIhH023855; Fri, 26 Nov 2021 19:40:18 GMT (envelope-from git) Date: Fri, 26 Nov 2021 19:40:18 GMT Message-Id: <202111261940.1AQJeIhH023855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9e2ae7bcd59c - stable/12 - libpfct: be consistent with u_int vs. uint 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9e2ae7bcd59ce9b95224a1221a9df6efbdb21a88 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637955619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kPG0e3bhTOr3PaETTsUl0GCX7Q57ffvzCJo04z3sXG8=; b=N4RTXW0MA8Bl06mV00JDl1vmc22M28gQ2ZPCX2pFMLqV7RDVV4k0MtNBi9oAoS9u0HT8rO i3YcJ5iHx4ygZo+i63sPZIeyP/ulz+U4vuh2RO10jG9jvLMqC9rRKzVstcACFYDs8XwpQ/ BY+ISchRzc6W1bZ1NcqZe2OzNQACCtAOgFqmb45WIHQyabSzCIHES/p58nVx/RGXtO0f/3 FpPq5XtSTWXc0/QBLbfiqZQLhbvv+BDedBAO6K2/nvsirGnPFi0EVjaa/aRu7vSDiryN/j P1D2Gf3TySeQRgfpfhtxl7/XpnMQCfRVZPfaqZp7xLV60iqzdKCx5Sfyi8j+TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637955619; a=rsa-sha256; cv=none; b=JHlPelV1vrFRE92zo0ZjglgxH49yrKScH1Jz/YtUFmHI4yQtNWEN3M1H5JkCvuDu22hoT4 A84w7bfr+zN1PYaNlyVomSZm1XnDnriWTCGXBSqpvoqsOMMgwnVAQm7VU3Dx2XOT+53MQB R+5oXzwn7SvQWzgEtHOGGtQGSSUTMM5O2y3juA4VZgldBLYUrR6CfiRh1MlTp6+VJAu8qC WcCPMHF+SwYkfSR/dacCa6uqMbgvQpDQPy1ipOSUt+iezAHeukXd/4nSFTjj1XLe3MNqZB hXG06Q+0LJigI+j8y7A7RF1JGNnE2OGEY5SbT8c9Kl5SEuMIROLBYClQHzaXhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9e2ae7bcd59ce9b95224a1221a9df6efbdb21a88 commit 9e2ae7bcd59ce9b95224a1221a9df6efbdb21a88 Author: Kristof Provost AuthorDate: 2021-11-05 08:37:56 +0000 Commit: Kristof Provost CommitDate: 2021-11-26 03:53:05 +0000 libpfct: be consistent with u_int vs. uint Always use uint64_t over u_int64_t, for the sake of consistency. No functional change. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 7bb3c927f7d9c48b356b4d20907b813f9b83273b) --- lib/libpfctl/libpfctl.c | 34 +++++++------- lib/libpfctl/libpfctl.h | 122 ++++++++++++++++++++++++------------------------ 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index e41f970e7696..96f5ea620f4d 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -61,7 +61,7 @@ static int _pfctl_clear_states(int , const struct pfctl_kill *, static void pf_nvuint_8_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int8_t *numbers, size_t *nelems) + uint8_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -78,7 +78,7 @@ pf_nvuint_8_array(const nvlist_t *nvl, const char *name, size_t maxelems, static void pf_nvuint_16_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int16_t *numbers, size_t *nelems) + uint16_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -95,7 +95,7 @@ pf_nvuint_16_array(const nvlist_t *nvl, const char *name, size_t maxelems, static void pf_nvuint_32_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int32_t *numbers, size_t *nelems) + uint32_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -112,7 +112,7 @@ pf_nvuint_32_array(const nvlist_t *nvl, const char *name, size_t maxelems, static void pf_nvuint_64_array(const nvlist_t *nvl, const char *name, size_t maxelems, - u_int64_t *numbers, size_t *nelems) + uint64_t *numbers, size_t *nelems) { const uint64_t *tmp; size_t elems; @@ -304,7 +304,7 @@ static void pfctl_nv_add_rule_addr(nvlist_t *nvparent, const char *name, const struct pf_rule_addr *addr) { - u_int64_t ports[2]; + uint64_t ports[2]; nvlist_t *nvl = nvlist_create(0); pfctl_nv_add_addr_wrap(nvl, "addr", &addr->addr); @@ -345,7 +345,7 @@ static void pfctl_nv_add_pool(nvlist_t *nvparent, const char *name, const struct pfctl_pool *pool) { - u_int64_t ports[2]; + uint64_t ports[2]; nvlist_t *nvl = nvlist_create(0); nvlist_add_binary(nvl, "key", &pool->key, sizeof(pool->key)); @@ -394,7 +394,7 @@ static void pfctl_nv_add_uid(nvlist_t *nvparent, const char *name, const struct pf_rule_uid *uid) { - u_int64_t uids[2]; + uint64_t uids[2]; nvlist_t *nvl = nvlist_create(0); uids[0] = uid->uid[0]; @@ -539,11 +539,11 @@ pf_nvrule_to_rule(const nvlist_t *nvl, struct pfctl_rule *rule) int pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, - const char *anchor_call, u_int32_t ticket, u_int32_t pool_ticket) + const char *anchor_call, uint32_t ticket, uint32_t pool_ticket) { struct pfioc_nv nv; - u_int64_t timeouts[PFTM_MAX]; - u_int64_t set_prio[2]; + uint64_t timeouts[PFTM_MAX]; + uint64_t set_prio[2]; nvlist_t *nvl, *nvlr; size_t labelcount; int ret; @@ -656,15 +656,15 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, } int -pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket, const char *anchor, - u_int32_t ruleset, struct pfctl_rule *rule, char *anchor_call) +pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket, const char *anchor, + uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call) { return (pfctl_get_clear_rule(dev, nr, ticket, anchor, ruleset, rule, anchor_call, false)); } -int pfctl_get_clear_rule(int dev, u_int32_t nr, u_int32_t ticket, - const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule, +int pfctl_get_clear_rule(int dev, uint32_t nr, uint32_t ticket, + const char *anchor, uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call, bool clear) { struct pfioc_nv nv; @@ -941,7 +941,7 @@ pfctl_kill_states(int dev, const struct pfctl_kill *kill, unsigned int *killed) } static int -pfctl_get_limit(int dev, const int index, u_int *limit) +pfctl_get_limit(int dev, const int index, uint *limit) { struct pfioc_limit pl; @@ -962,7 +962,7 @@ pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s) struct pfioc_nv nv; nvlist_t *nvl; int ret; - u_int state_limit; + uint state_limit; ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit); if (ret != 0) @@ -992,7 +992,7 @@ pfctl_get_syncookies(int dev, struct pfctl_syncookies *s) struct pfioc_nv nv; nvlist_t *nvl; int ret; - u_int state_limit; + uint state_limit; bool enabled, adaptive; ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index ac239d7cdcb1..a9bd14527126 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -72,8 +72,8 @@ struct pfctl_pool { struct pf_addr counter; struct pf_mape_portset mape; int tblidx; - u_int16_t proxy_port[2]; - u_int8_t opts; + uint16_t proxy_port[2]; + uint8_t opts; }; struct pfctl_rule { @@ -81,7 +81,7 @@ struct pfctl_rule { struct pf_rule_addr dst; union pf_rule_ptr skip[PF_SKIP_COUNT]; char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; - u_int32_t ridentifier; + uint32_t ridentifier; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; @@ -93,9 +93,9 @@ struct pfctl_rule { TAILQ_ENTRY(pfctl_rule) entries; struct pfctl_pool rpool; - u_int64_t evaluations; - u_int64_t packets[2]; - u_int64_t bytes[2]; + uint64_t evaluations; + uint64_t packets[2]; + uint64_t bytes[2]; struct pfi_kif *kif; struct pfctl_anchor *anchor; @@ -104,19 +104,19 @@ struct pfctl_rule { pf_osfp_t os_fingerprint; int rtableid; - u_int32_t timeout[PFTM_MAX]; - u_int32_t max_states; - u_int32_t max_src_nodes; - u_int32_t max_src_states; - u_int32_t max_src_conn; + uint32_t timeout[PFTM_MAX]; + uint32_t max_states; + uint32_t max_src_nodes; + uint32_t max_src_states; + uint32_t max_src_conn; struct { - u_int32_t limit; - u_int32_t seconds; + uint32_t limit; + uint32_t seconds; } max_src_conn_rate; - u_int32_t qid; - u_int32_t pqid; - u_int32_t nr; - u_int32_t prob; + uint32_t qid; + uint32_t pqid; + uint32_t nr; + uint32_t prob; uid_t cuid; pid_t cpid; @@ -124,49 +124,49 @@ struct pfctl_rule { uint64_t states_tot; uint64_t src_nodes; - u_int16_t return_icmp; - u_int16_t return_icmp6; - u_int16_t max_mss; - u_int16_t tag; - u_int16_t match_tag; - u_int16_t scrub_flags; + uint16_t return_icmp; + uint16_t return_icmp6; + uint16_t max_mss; + uint16_t tag; + uint16_t match_tag; + uint16_t scrub_flags; struct pf_rule_uid uid; struct pf_rule_gid gid; - u_int32_t rule_flag; - u_int8_t action; - u_int8_t direction; - u_int8_t log; - u_int8_t logif; - u_int8_t quick; - u_int8_t ifnot; - u_int8_t match_tag_not; - u_int8_t natpass; - - u_int8_t keep_state; + uint32_t rule_flag; + uint8_t action; + uint8_t direction; + uint8_t log; + uint8_t logif; + uint8_t quick; + uint8_t ifnot; + uint8_t match_tag_not; + uint8_t natpass; + + uint8_t keep_state; sa_family_t af; - u_int8_t proto; - u_int8_t type; - u_int8_t code; - u_int8_t flags; - u_int8_t flagset; - u_int8_t min_ttl; - u_int8_t allow_opts; - u_int8_t rt; - u_int8_t return_ttl; - u_int8_t tos; - u_int8_t set_tos; - u_int8_t anchor_relative; - u_int8_t anchor_wildcard; - - u_int8_t flush; - u_int8_t prio; - u_int8_t set_prio[2]; + uint8_t proto; + uint8_t type; + uint8_t code; + uint8_t flags; + uint8_t flagset; + uint8_t min_ttl; + uint8_t allow_opts; + uint8_t rt; + uint8_t return_ttl; + uint8_t tos; + uint8_t set_tos; + uint8_t anchor_relative; + uint8_t anchor_wildcard; + + uint8_t flush; + uint8_t prio; + uint8_t set_prio[2]; struct { struct pf_addr addr; - u_int16_t port; + uint16_t port; } divert; }; @@ -178,13 +178,13 @@ struct pfctl_ruleset { struct { struct pfctl_rulequeue *ptr; struct pfctl_rule **ptr_array; - u_int32_t rcount; - u_int32_t ticket; + uint32_t rcount; + uint32_t ticket; int open; } active, inactive; } rules[PF_RULESET_MAX]; struct pfctl_anchor *anchor; - u_int32_t tticket; + uint32_t tticket; int tables; int topen; }; @@ -288,15 +288,15 @@ struct pfctl_syncookies { struct pfctl_status* pfctl_get_status(int dev); void pfctl_free_status(struct pfctl_status *status); -int pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket, - const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule, +int pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket, + const char *anchor, uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call); -int pfctl_get_clear_rule(int dev, u_int32_t nr, u_int32_t ticket, - const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule, +int pfctl_get_clear_rule(int dev, uint32_t nr, uint32_t ticket, + const char *anchor, uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call, bool clear); int pfctl_add_rule(int dev, const struct pfctl_rule *r, - const char *anchor, const char *anchor_call, u_int32_t ticket, - u_int32_t pool_ticket); + const char *anchor, const char *anchor_call, uint32_t ticket, + uint32_t pool_ticket); int pfctl_set_keepcounters(int dev, bool keep); int pfctl_get_states(int dev, struct pfctl_states *states); void pfctl_free_states(struct pfctl_states *states); From nobody Fri Nov 26 20:50:40 2021 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 17B9C18A3F24; Fri, 26 Nov 2021 20:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J16Mh4kBPz3pN0; Fri, 26 Nov 2021 20:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A9F6FF6; Fri, 26 Nov 2021 20:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AQKoeK9018475; Fri, 26 Nov 2021 20:50:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AQKoePn018473; Fri, 26 Nov 2021 20:50:40 GMT (envelope-from git) Date: Fri, 26 Nov 2021 20:50:40 GMT Message-Id: <202111262050.1AQKoePn018473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: c41d129485e0 - stable/13 - ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le) 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c41d129485e0c2519397ff7e740e9401f948a74c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637959840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1YmG/cJ+wAlsHPaZwWr+YwtJ5itD7qsDL+syliECGEE=; b=CerdLU4iqep58tY7p12tCOWajS1JJ966fwTYpvas0/VXY5f9FrMhUy1AEYajioG0kWpL+M ZzAHnooUNsO+F9ohK5tIEjx8ltwcpjpwdwUkxGEz+XLIoPRLqk75FAI3RHbA/6UViRE7JE ugmbRDnDFOi6zN71NrsjySfs7AwdA4kCQ3LlfQLKQtY2A67MBgmZMt//6FA/PILZRsfhiM BTFrPH8TSLFnvUF8v+0FVuCKryurtaqJOY+Ed2koWfQFbJ8YjnnNFiN3HpcWA4fwpSmnzd Stj5m7zN83M1SXQFGPGr62vPVNeaXcn5Ge5u8sJpSCkQpayvBqZKJ4/lAtyR9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637959840; a=rsa-sha256; cv=none; b=PeQnF0iZVm7NXzxlNOjFp7FohFVQevyQBtXLcb17vQRdFHiVenEnx3fi0fYR66DpXw80+J YfbcH+mA6ucfe2Hc+xfgsdvw9RqO7WQs5yqlXu9E06HigmzJsc1QEI8W2oWGWItgT2IFRp Y6qNR+47izdQpru4NHh5/WoZLimh+BgYytPxRG8a0ukj7RirMdHxXtIj77/XeqP3dQ9NWk 1ftEt4SJcBzkUFUYiLKLdLS3+/7sF2zLjQF/GZbU9/UgoL0k/ggR+kNSgPG6Wk0BGqEu+X wvRppmGdyu/23lbIShppiEz0yZVLIcNIGzhwE2DchL0HXLOzHdpfMcSoZtdjcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=c41d129485e0c2519397ff7e740e9401f948a74c commit c41d129485e0c2519397ff7e740e9401f948a74c Author: Alfredo Dal'Ava Junior AuthorDate: 2021-11-03 16:42:28 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-11-26 23:50:55 +0000 ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le) On recent OpenBMC firmware, the onboard ASMEDIA video card framebuffer address was removed from device tree for security purposes (value is set to zero to avoid leaking the address). This patch works around the problem by taking framebuffer base address from the "ranges" property of a parent node. Reviewed by: luporl, jhibbits (on IRC) MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D30626 (cherry picked from commit b042d10cdc71ddd6ef3449261d712b05c648746e) --- sys/dev/vt/hw/ofwfb/ofwfb.c | 116 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 110 insertions(+), 6 deletions(-) diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c index 9dc674c0ebf9..e388356450d6 100644 --- a/sys/dev/vt/hw/ofwfb/ofwfb.c +++ b/sys/dev/vt/hw/ofwfb/ofwfb.c @@ -61,7 +61,8 @@ struct ofwfb_softc { uint32_t vendor_id; }; -#define PCI_VENDOR_ID_NVIDIA 0x10de +#define PCI_VID_NVIDIA 0x10de /* NVIDIA Corporation */ +#define PCI_VID_ASPEED 0x1a03 /* ASPEED Technology, Inc. */ static void ofwfb_initialize(struct vt_device *vd); static vd_probe_t ofwfb_probe; @@ -297,6 +298,104 @@ ofwfb_bitblt_text(struct vt_device *vd, const struct vt_window *vw, #endif } + +/* + * Decode OpenFirmware/IEEE 1275-1994 "ranges" property + * + * XXX: this is similar to ofw_pcib_fill_ranges but cannot use it here because + * it's not possible to allocate memory at the moment this is funcion is + * used. Since there are other similar functions dealing with "ranges" + * property, a proper refactoring is suggested. + */ +static uint64_t +decode_pci_ranges_host_addr(phandle_t pcinode) +{ + struct simplebus_range { + uint64_t bus; + uint64_t host; + uint64_t size; + }; + + struct simplebus_range ranges[4]; + int nranges, host_address_cells; + pcell_t acells, scells; + cell_t base_ranges[64]; + + ssize_t nbase_ranges; + int i, j, k; + + if (!OF_hasprop(pcinode, "ranges")) + return (0); + + if (OF_getencprop(pcinode, "#address-cells", &acells, sizeof(acells)) != + sizeof(acells)) + return (0); + + if (OF_getencprop(pcinode, "#size-cells", &scells, sizeof(scells)) != + sizeof(scells)) + return (0); + + if (OF_searchencprop(OF_parent(pcinode), "#address-cells", + &host_address_cells, sizeof(host_address_cells)) != + sizeof(host_address_cells)) + return (0); + + nbase_ranges = OF_getproplen(pcinode, "ranges"); + nranges = nbase_ranges / sizeof(cell_t) / (acells + host_address_cells + scells); + + /* prevent buffer overflow during iteration */ + if (nranges > sizeof(ranges) / sizeof(ranges[0])) + nranges = sizeof(ranges) / sizeof(ranges[0]); + + /* decode range value and return the first valid address */ + OF_getencprop(pcinode, "ranges", base_ranges, nbase_ranges); + for (i = 0, j = 0; i < nranges; i++) { + ranges[i].bus = 0; + for (k = 0; k < acells; k++) { + ranges[i].bus <<= 32; + ranges[i].bus |= base_ranges[j++]; + } + + ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + ranges[i].host <<= 32; + ranges[i].host |= base_ranges[j++]; + } + ranges[i].size = 0; + for (k = 0; k < scells; k++) { + ranges[i].size <<= 32; + ranges[i].size |= base_ranges[j++]; + } + + if (ranges[i].host != 0) + return (ranges[i].host); + } + + return (0); +} + +static bus_addr_t +find_pci_host_address(phandle_t node) +{ + uint64_t addr; + + /* + * According to IEEE STD 1275, if property "ranges" exists but has a + * zero-length property value, the child address space is identical + * to the parent address space. + */ + while (node) { + if (OF_hasprop(node, "ranges")) { + addr = decode_pci_ranges_host_addr(node); + if (addr != 0) + return ((bus_addr_t)addr); + } + node = OF_parent(node); + } + + return (0); +} + static void ofwfb_initialize(struct vt_device *vd) { @@ -350,7 +449,7 @@ ofwfb_initialize(struct vt_device *vd) * There is no good way to determine the correct option, as this * is independent of endian swapping. */ - if (sc->vendor_id == PCI_VENDOR_ID_NVIDIA) + if (sc->vendor_id == PCI_VID_NVIDIA) sc->argb = 0; else sc->argb = 1; @@ -430,7 +529,6 @@ ofwfb_init(struct vt_device *vd) sizeof(vendor_id)) == sizeof(vendor_id)) sc->vendor_id = vendor_id; - /* Keep track of the OF node */ sc->sc_node = node; @@ -497,12 +595,18 @@ ofwfb_init(struct vt_device *vd) * Grab the physical address of the framebuffer, and then map it * into our memory space. If the MMU is not yet up, it will be * remapped for us when relocation turns on. + * + * The ASPEED driver on recent petitboot versions doesn't expose the + * physical address of framebuffer anymore for security. So it should + * retrieve the address from PCI device properties. */ user_phys = 0; TUNABLE_UINT64_FETCH("hw.ofwfb.physaddr", &user_phys); - fb_phys = (bus_addr_t)user_phys; - if (fb_phys) - sc->fb.fb_pbase = (vm_paddr_t)fb_phys; + + if (user_phys) + sc->fb.fb_pbase = (vm_paddr_t)user_phys; + else if (sc->vendor_id == PCI_VID_ASPEED) + sc->fb.fb_pbase = find_pci_host_address(node); else if (OF_hasprop(node, "address")) { switch (OF_getproplen(node, "address")) { From nobody Sat Nov 27 02:23:30 2021 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 E741818B5780; Sat, 27 Nov 2021 02:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1Flk4DxKz3LCT; Sat, 27 Nov 2021 02:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7126413FA1; Sat, 27 Nov 2021 02:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AR2NUn2063490; Sat, 27 Nov 2021 02:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AR2NUtk063489; Sat, 27 Nov 2021 02:23:30 GMT (envelope-from git) Date: Sat, 27 Nov 2021 02:23:30 GMT Message-Id: <202111270223.1AR2NUtk063489@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: 0aa59ac82786 - stable/13 - pNFS: Add nfsstats counters for number of Layouts 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 0aa59ac827864628b545e5fb993cb67033df907e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637979810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X1rZJgJ+9kvD/EuRkpWr+Dt/3GDuXQ0rLMMMWYrLL8I=; b=qfiH5SH/ImGcAbztpdzvOhvBjkOopUu5oM1e3hxTcAG/pVWBdH304EAa7XVoNyhexY/OJm vPV6su/fX0ObWDrISbqby7RBa+fR2cjL4uGmCuGywvP+6pAt5b26qwotLE/XvQbtn1rUEL JmF4g8YVz/j80f+QfRgk2pB1Ex7IKdWKNzh/dz+csWHlQmyhhvbnh+7zOkdw3YbTN7oT3W Rap6N1R0QIP+Cl5qyunnabLqWsIYSKUGEnFCD+2gSE1Ol/KelrWpGNIdOB2jNvH8lVV3yB oqz5gVij0W4Fm+xTW9VBLLcGtMRArbQWRcLRGhRMU5+5wFnLEsRzwEPn1EXDhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637979810; a=rsa-sha256; cv=none; b=ny9cCdhvpb+3lA3uZjNLIUQnWYybdp8z7GRjPLkCuMYDzljQUuZJ6DTqFPmnHwvR2Fmq2A 8GxXWbr488IYF1k7EkOcLeghDHJkf0s4z3M83672ZjbItIAMwxSkbNO3Q9L//7FPfrnDMe T+95GxyiK1zDGfvSifapoUxuG7zMQT3qy/ZSTjvlgellUmLFJ6ksYTpvJ988/SLRo4cr0P ZeBPP6AjkWglRNqircss48+C4qZhzl4E/EMLgHwPO8wZn1Coa5mBSdkhTgo+z6gzb8jhQN SsMofLemW34ptxTYUlxuH87NJP9R2fPeTTpYBNGGwBUMALgFP9q3u5peHHr4Ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0aa59ac827864628b545e5fb993cb67033df907e commit 0aa59ac827864628b545e5fb993cb67033df907e Author: Rick Macklem AuthorDate: 2021-11-13 01:32:55 +0000 Commit: Rick Macklem CommitDate: 2021-11-27 02:20:16 +0000 pNFS: Add nfsstats counters for number of Layouts For pNFS, Layouts are issued by the server to indicate where a file's data resides on the DS(s). This patch adds counters for how many layouts are allocated to the nfsstatsv1 structure, using two reserved fields. (cherry picked from commit ce9676de86f267986f61979151101e3d8a6d61bc) --- sys/fs/nfs/nfsport.h | 4 ++-- sys/fs/nfsclient/nfs_clstate.c | 2 ++ sys/fs/nfsserver/nfs_nfsdstate.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 5dcce15f7f64..e099cf6e46f0 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -459,8 +459,8 @@ struct nfsstatsv1 { uint64_t rpccnt[NFSV42_NPROCS + 11]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; - uint64_t reserved_0; - uint64_t reserved_1; + uint64_t srvlayouts; + uint64_t cllayouts; uint64_t rpcrequests; uint64_t rpctimeouts; uint64_t rpcunexpected; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 1e2feef19d63..08eada1e1c3e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5214,6 +5214,7 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, nfsly_hash); lyp->nfsly_timestamp = NFSD_MONOSEC + 120; nfscl_layoutcnt++; + nfsstatsv1.cllayouts++; } else { if (retonclose != 0) lyp->nfsly_flags |= NFSLY_RETONCLOSE; @@ -5588,6 +5589,7 @@ nfscl_freelayout(struct nfscllayout *layp) free(rp, M_NFSLAYRECALL); } nfscl_layoutcnt--; + nfsstatsv1.cllayouts--; free(layp, M_NFSLAYOUT); } diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index e6a919093738..e9acacb27cbd 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -7400,6 +7400,7 @@ nfsrv_addlayout(struct nfsrv_descript *nd, struct nfslayout **lypp, /* Insert the new layout in the lists. */ *lypp = NULL; atomic_add_int(&nfsrv_layoutcnt, 1); + nfsstatsv1.srvlayouts++; NFSBCOPY(lyp->lay_xdr, layp, lyp->lay_layoutlen); *layoutlenp = lyp->lay_layoutlen; TAILQ_INSERT_HEAD(&lhyp->list, lyp, lay_list); @@ -7492,6 +7493,7 @@ nfsrv_freelayout(struct nfslayouthead *lhp, struct nfslayout *lyp) NFSD_DEBUG(4, "Freelayout=%p\n", lyp); atomic_add_int(&nfsrv_layoutcnt, -1); + nfsstatsv1.srvlayouts--; TAILQ_REMOVE(lhp, lyp, lay_list); free(lyp, M_NFSDSTATE); } From nobody Sat Nov 27 08:49:50 2021 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 46C9718BAA37; Sat, 27 Nov 2021 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1QKW01NLz4hGB; Sat, 27 Nov 2021 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0D58191CB; Sat, 27 Nov 2021 08:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AR8no9p070227; Sat, 27 Nov 2021 08:49:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AR8noZQ070226; Sat, 27 Nov 2021 08:49:50 GMT (envelope-from git) Date: Sat, 27 Nov 2021 08:49:50 GMT Message-Id: <202111270849.1AR8noZQ070226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: a9f6a79b2d6a - stable/13 - sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a9f6a79b2d6a8f0ec7e63d8f1ae9876842c8678a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638002991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i7AxbvFR12KBk4ArDTWdvW6q0DYicfwDZpuBx9fHxEc=; b=TCAijbea8ERhQtrQSVs131pGj6xIpSGmT9A1ShOvP3+1OSVUCDDTickfpS5P7Tzkc0EWfw eKbElK30yIh5hxa6LniPGiMWpnZQ51Qa4FojkIuvc3dseRYd6TmmUIXBghR3xM+nNat9ok m7s/wfx2p5dEmhrVHsFtxpcEopOC960ouK6IXweQTUsvOrGWSPJchMA1wvi2U0p/mJoxO3 vYgRmcWtcycUroud8gLlip/zuSTik0z417GcIsaDLeNwHHPtgJphUO4rZHbloFLdeVfuam qCMhhc/ul1MqUxM9rd3v6KNmoEGv1zCEKaSkdDcsl6dVWJrNAKQiqmBxUldrmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638002991; a=rsa-sha256; cv=none; b=YEllBPwfaFr5hjTsn0JBr6qdt00pvHrKPbswB9HWitueCQ0o0U4W0q8QMaWISqS1H1I8SC Ru51bQJ7D3+LvIxdkUil5TS4N7ZlGlK/UKmg6EePETY/mD5cF/LXoQLx0BokkyMxPzg8Sa xjYT7IWxAz9fmumWntfSUgm4o7v0qKe0hDqWsg2DkPszpqzuva35froB+UwvUuA9uAR61R srX6p6+3bwEFxe7xQTZOdVQu6Sfyws6z5W/VECngdKEt7ZCkwS3XK//deptg4NSfp7sYdT T7l1CSalp1ayzWqKD0wdmo/VFoa3471KFF1H+35lbwFK5jNmv/6HDOFHzHpwkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=a9f6a79b2d6a8f0ec7e63d8f1ae9876842c8678a commit a9f6a79b2d6a8f0ec7e63d8f1ae9876842c8678a Author: Andriy Gapon AuthorDate: 2021-07-09 14:28:40 +0000 Commit: Andriy Gapon CommitDate: 2021-11-27 08:32:36 +0000 sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes (cherry picked from commit e17b58ecbcb644f76cceda4ca7ff08f7677b5dfd) --- sys/cam/mmc/mmc_da.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 62066311aa93..22a467af2f5f 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1935,7 +1935,7 @@ sddadone(struct cam_periph *periph, union ccb *done_ccb) /*reduction*/0, /*timeout*/0, /*getcount_only*/0); - error = 5; /* EIO */ + error = EIO; } else { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); @@ -1956,7 +1956,7 @@ sddadone(struct cam_periph *periph, union ccb *done_ccb) softc->outstanding_cmds--; /* Complete partition switch */ softc->state = SDDA_STATE_NORMAL; - if (error != MMC_ERR_NONE) { + if (error != 0) { /* TODO: Unpause retune if accessing RPMB */ xpt_release_ccb(done_ccb); xpt_schedule(periph, CAM_PRIORITY_NORMAL); From nobody Sat Nov 27 08:49:51 2021 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 885DA18BAC8B; Sat, 27 Nov 2021 08:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1QKX129dz4h7G; Sat, 27 Nov 2021 08:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0DA319208; Sat, 27 Nov 2021 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AR8npZ5070251; Sat, 27 Nov 2021 08:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AR8npO4070250; Sat, 27 Nov 2021 08:49:51 GMT (envelope-from git) Date: Sat, 27 Nov 2021 08:49:51 GMT Message-Id: <202111270849.1AR8npO4070250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 83f68b84c234 - stable/13 - ds1307: allow configuration via hints on FDT-based systems 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 83f68b84c2347bbe11c5266e98bfd0a44334f004 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638002992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+XQt+YJgS4ePV3xWVSLut92oD+kvBuxfv1qXKIZ/QY=; b=rUFffuFKcRn9xdsbpTVGp2OOFT+iZGHS+FYyJRVqm20MW1RxbyFHpnOM1zrYi3jMMJGQVg aNQQvW++CHkTjE9FCA63JDd1DKIOwzSl7iV8M9dUjXmiOqtwZyeuAoyOb6tvh3H3/3+P4m Y6il4cZhgdMB2+unkl5bt3vuklKU/RWoqEwNZZO5EweTbPOGCgAq+Xkq81hcqS5+0g/Tn2 CKOn3R8gfkMh0hl93mGBEhtsGKQfRJGk/oa5LHEKGhXE5UmHN3VrrWlIbfTZFEuLspp+cn f4LvBKcb4oXQjqWeu9sCvN5D26mSROnlHfFEufZ1+HkFDbXw6SQZdvmp3ZgoAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638002992; a=rsa-sha256; cv=none; b=H9/70ZkupGriqUylaTOBYNPL+EgKMSufwQHfv4VkIw9KAY3Fh9jGjusXyF6Z6RVFZandXG eOq1ffjSfsueLeqpFdfX0/TM3UnzqSCCF+PuwKa9gTdXhW3XM0+8LKOT0iOAG/eejCLrtG xP1u4wKPNeL5AtXslDmt0smDqRBvS1PWEZemEfuP4HEM9nl9wiZhrVVh7CZO28epXNN+o4 wU65MVpIIWTQoY/ElysF1YeVFwPXB9ASx210A9ZhngnIIg+KGn0+DtTrPbvxGhPESyqChM DOyXC3WpOjTilbbUl0sEcynY1II1qJRXgQeS897kOcJHiHoFyE36tGIU9FhhsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=83f68b84c2347bbe11c5266e98bfd0a44334f004 commit 83f68b84c2347bbe11c5266e98bfd0a44334f004 Author: Andriy Gapon AuthorDate: 2021-11-04 11:55:35 +0000 Commit: Andriy Gapon CommitDate: 2021-11-27 08:44:16 +0000 ds1307: allow configuration via hints on FDT-based systems On-board devices should be configured via the FDT and overlays. Hints are primarily useful for external and temporarily attached devices. Adding hints is much easier and faster than writing and compiling an overlay. (cherry picked from commit 27645265c4e49ad7eaa25847a280307acb138da8) --- sys/dev/iicbus/ds1307.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/iicbus/ds1307.c b/sys/dev/iicbus/ds1307.c index 7bab7e78c0d8..47f47bb07f5e 100644 --- a/sys/dev/iicbus/ds1307.c +++ b/sys/dev/iicbus/ds1307.c @@ -216,18 +216,13 @@ ds1307_probe(device_t dev) return (ENXIO); compat = ofw_bus_search_compatible(dev, ds1307_compat_data); - - if (compat->ocd_str == NULL) - return (ENXIO); - - device_set_desc(dev, (const char *)compat->ocd_data); - - return (BUS_PROBE_DEFAULT); -#else + if (compat->ocd_str != NULL) { + device_set_desc(dev, (const char *)compat->ocd_data); + return (BUS_PROBE_DEFAULT); + } +#endif device_set_desc(dev, "Maxim DS1307 RTC"); - return (BUS_PROBE_NOWILDCARD); -#endif } static int From nobody Sat Nov 27 08:49:53 2021 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 D992918BAC8F; Sat, 27 Nov 2021 08:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1QKY2f6Bz4hRF; Sat, 27 Nov 2021 08:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20CF318FBE; Sat, 27 Nov 2021 08:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AR8nrQC070281; Sat, 27 Nov 2021 08:49:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AR8nrMW070279; Sat, 27 Nov 2021 08:49:53 GMT (envelope-from git) Date: Sat, 27 Nov 2021 08:49:53 GMT Message-Id: <202111270849.1AR8nrMW070279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: f537b3056421 - stable/13 - icee: allow configuration via hints on FDT-based systems 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f537b30564210708cea309de6e2ba54cf18e52b1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638002993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mZNH44f0XUujf0WpiZEdVAmTvWw9VsPXtGMKUVidLdU=; b=o9ydl/L9jMX4UTnkuU9nCl8D4PDNVH9Y/0jMxugF+Ug40IdgV/uk8V3+WWGas7r528wJAO IKswLO7mMBo0jIFnyLnprgf164dUiQqL513bku5uPI8Pb+xjUfbZ9AFyIwJufoVfY5aZj6 z6V0b6+m5v+EhHSCv375y+zbFIjUjh82+YypAdISFqk5wo62MRpJ0YxzHkWGpGYw4cgSIk PKXHlAoDmCSxwyiiMH32lvYO3lq04Tk/jUyW2nXbGecn0VeG2tWQE23KYDHuVRQ3grBhaD FOwITXN3yQzvF2/6c/muCdGC7HhbceQX2KjWotSeUa8Ns0s1Zzllylw6slp8mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638002993; a=rsa-sha256; cv=none; b=nd9ECiah28uQpWWj/RlvSOKThXUSCi+EsDytLQr/9a0gI9Sfv0goQKbYV2CZtGGMIs7sn/ EDcTdbgo+AsXWvt3biKdn6t33z0SvA/uLw9HoeAfSNB1yZW5de+n9eJRTPS+i5zMAQtDEO k2nih8S418Z2zciBxFW/7J4sVXNQvRWqArh8kFGpMx0ClC2/btdQw9T3HGEgZj7Dzr2QsX HPIMFrEuSH41mQC6YSA2ds+yPlswuVzxtlkoMxfTsibE+rVILRc7Xy4SK78UGPt5desaEh a5GBkv/Z8hIzaBO1l+DkrV1D5++LoVj+kgj+q3a5i0OvQjHu+cbfyyGj5t2hKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=f537b30564210708cea309de6e2ba54cf18e52b1 commit f537b30564210708cea309de6e2ba54cf18e52b1 Author: Andriy Gapon AuthorDate: 2021-11-04 11:56:22 +0000 Commit: Andriy Gapon CommitDate: 2021-11-27 08:47:25 +0000 icee: allow configuration via hints on FDT-based systems On-board devices should be configured via the FDT and overlays. Hints are primarily useful for external and temporarily attached devices. Adding hints is much easier and faster than writing and compiling an overlay. (cherry picked from commit 01e3492337cb48484e03be38340cc67ac5e30a5b) --- sys/dev/iicbus/icee.c | 64 +++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/sys/dev/iicbus/icee.c b/sys/dev/iicbus/icee.c index 19aff78bf45a..a658d73cb875 100644 --- a/sys/dev/iicbus/icee.c +++ b/sys/dev/iicbus/icee.c @@ -123,10 +123,10 @@ static struct cdevsw icee_cdevsw = .d_write = icee_write }; -#ifdef FDT static int icee_probe(device_t dev) { +#ifdef FDT struct eeprom_desc *d; if (!ofw_bus_status_okay(dev)) @@ -134,49 +134,42 @@ icee_probe(device_t dev) d = (struct eeprom_desc *) ofw_bus_search_compatible(dev, compat_data)->ocd_data; - if (d == NULL) - return (ENXIO); - - device_set_desc(dev, d->name); - return (BUS_PROBE_DEFAULT); -} - -static void -icee_init(struct icee_softc *sc) -{ - struct eeprom_desc *d; - - d = (struct eeprom_desc *) - ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; - if (d == NULL) - return; /* attach will see sc->size == 0 and return error */ - - sc->size = d->size; - sc->type = d->type; - sc->wr_sz = d->wr_sz; -} -#else /* !FDT */ -static int -icee_probe(device_t dev) -{ - + if (d != NULL) { + device_set_desc(dev, d->name); + return (BUS_PROBE_DEFAULT); + } +#endif device_set_desc(dev, "I2C EEPROM"); return (BUS_PROBE_NOWILDCARD); } -static void +static int icee_init(struct icee_softc *sc) { const char *dname; int dunit; +#ifdef FDT + struct eeprom_desc *d; + d = (struct eeprom_desc *) + ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; + if (d != NULL) { + sc->size = d->size; + sc->type = d->type; + sc->wr_sz = d->wr_sz; + return (0); + } +#endif dname = device_get_name(sc->dev); dunit = device_get_unit(sc->dev); - resource_int_value(dname, dunit, "size", &sc->size); - resource_int_value(dname, dunit, "type", &sc->type); - resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz); + if (resource_int_value(dname, dunit, "type", &sc->type) != 0) + return (ENOENT); + if (resource_int_value(dname, dunit, "size", &sc->size) != 0) + return (ENOENT); + if (resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz) != 0) + return (ENOENT); + return (0); } -#endif /* FDT */ static int icee_attach(device_t dev) @@ -187,13 +180,8 @@ icee_attach(device_t dev) sc->dev = dev; sc->addr = iicbus_get_addr(dev); - icee_init(sc); - if (sc->size == 0 || sc->type == 0 || sc->wr_sz == 0) { - device_printf(sc->dev, "Missing config data, " - "these cannot be zero: size %d type %d wr_sz %d\n", - sc->size, sc->type, sc->wr_sz); + if (icee_init(sc) != 0) return (EINVAL); - } if (bootverbose) device_printf(dev, "size: %d bytes, addressing: %d-bits\n", sc->size, sc->type); From nobody Sat Nov 27 08:52:11 2021 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 45E8018BDC2D; Sat, 27 Nov 2021 08:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1QNC75Mzz4kYQ; Sat, 27 Nov 2021 08:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D32BC1902D; Sat, 27 Nov 2021 08:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AR8qBFV082901; Sat, 27 Nov 2021 08:52:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AR8qBZ2082900; Sat, 27 Nov 2021 08:52:11 GMT (envelope-from git) Date: Sat, 27 Nov 2021 08:52:11 GMT Message-Id: <202111270852.1AR8qBZ2082900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 06f49eaf13bd - stable/12 - sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 06f49eaf13bdd9a0e5f4d8e260891dede592db12 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638003132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hzAZH5QDJnAdOAzDUhzL0ngUEImylnbJo4e4No+pktM=; b=aWB1+EN7tO2VckeDNFpZ9MuwiJ2DziqSNvQY7mAvtxbONSrraguidx2bBYawOaHqqGafoY W5ar2K27zE1gqyytv+Q4IMbaoF36xEq7RVdMd/BlVKNxCDdr9iDrO0LdcI6bedz92qHEfv 1jO0pmIn/TElW4PtcO0J5umWVvRuLrLi1BAAcGPnWPG+4VwaKoiOwORSDNs5IV+BR7WOY4 +ED6Z3EVpyJqMtIy8IMQ/uOw9UmdGAZ9CRsTPXtKE0ubDN6VQQ3jSprDcl9ZVIMq7OaPkf oOK8yk2YdMVSAcldnePnP/F8rrSfuJzHspERL/BjaFg+dB0R7ceWUaquiCVu5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638003132; a=rsa-sha256; cv=none; b=pDRxqbkMg4N7gzNajC2Ci1U4/5XOSOB6e2P2XVCpQ4spPyrgo86nOp5gW/ez1B0k6D9bzf RgDD4PP7FnX7MwkItWAvnjaiE3jgbLk57Xv45nA7gb7sjXP5ffD6Y0XHqPc8z8NiBJ6InM 10GQHpZSca/ajFFAyx2dv3om73Q+ObbI7AF54+/zbiyjpD+LWGMj4b6EI4MakKmN0FVWeb QljkdgPGulTIdAXCRArdcTbVHxaBoPgZ36zJvWQl/744vF42wL9NT4GUE8DZ2Ri/Snf7Ty a+yuO6pNtHrpwUlH3NTChhT3SjOcMPi3IGfHkukr8t++R0yU60tx2ytbYKmD+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=06f49eaf13bdd9a0e5f4d8e260891dede592db12 commit 06f49eaf13bdd9a0e5f4d8e260891dede592db12 Author: Andriy Gapon AuthorDate: 2021-07-09 14:28:40 +0000 Commit: Andriy Gapon CommitDate: 2021-11-27 08:39:19 +0000 sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes (cherry picked from commit e17b58ecbcb644f76cceda4ca7ff08f7677b5dfd) --- sys/cam/mmc/mmc_da.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 2587cda115cc..96898e92cb81 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1834,7 +1834,7 @@ sddadone(struct cam_periph *periph, union ccb *done_ccb) /*reduction*/0, /*timeout*/0, /*getcount_only*/0); - error = 5; /* EIO */ + error = EIO; } else { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); @@ -1855,7 +1855,7 @@ sddadone(struct cam_periph *periph, union ccb *done_ccb) softc->outstanding_cmds--; /* Complete partition switch */ softc->state = SDDA_STATE_NORMAL; - if (error != MMC_ERR_NONE) { + if (error != 0) { /* TODO: Unpause retune if accessing RPMB */ xpt_release_ccb(done_ccb); xpt_schedule(periph, CAM_PRIORITY_NORMAL); From nobody Sat Nov 27 08:52:12 2021 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 52BDD18BDA6D; Sat, 27 Nov 2021 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1QNF1wQ7z4kWY; Sat, 27 Nov 2021 08:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02950191DD; Sat, 27 Nov 2021 08:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AR8qCWT082927; Sat, 27 Nov 2021 08:52:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AR8qClJ082926; Sat, 27 Nov 2021 08:52:12 GMT (envelope-from git) Date: Sat, 27 Nov 2021 08:52:12 GMT Message-Id: <202111270852.1AR8qClJ082926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 45a19f61218b - stable/12 - ds1307: allow configuration via hints on FDT-based systems 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 45a19f61218b4072db9a327df5a7f176b6955163 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638003133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jk+XpJe4f4TizzdYgr7ReG4mhE5Zmpro5CmMDJFT5Rg=; b=PIiH9qlYSkeWPE2SLUUk9jF/G+5t0A8YBozRMnWsBU8+uyUKVGteptQU09IvPiMrRo5q0F BVszt4LSwNvAs17v1tdX59dKnJ9GQYr/skaD2p13AZJVxthHkU6TdEePDumI+GSHo/PFtR AU8Aq6VyCp9qE5k2d7f89X8MIAsxRxZm0ZgfQmGWoHSn8KIlFTeYq/pU8Ol9xeN5+dWVP3 X2aOvillBoR/Ma6RPSNMgtUMa+y9oXWFNvlPaBLtiRfMbNB2M8d05p1rIrb3xIumHvRYmC vTaUWX7TJzeG7cLh8VeyoS7Jo4vHHmSz7hl26JxQj1mlp/fR+hF1V84UkUFAaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638003133; a=rsa-sha256; cv=none; b=VsNtxUzIiDBGwGaEfObn2IjCOB1ZfaTQFw+zD9MVKW4HVsVF5R0yClDkgb4rKxjqHEKL5/ kI6itL9ec5/RniAPvnZxTZQtjJ2LPiArDgVEZ6qYISs1KUcORtAkGsZsgUE3w3pFEF/AIm Tm3bkPB5dqXvqwMQucgDnZesD6nCX8xTnHsXbbNHdULW3ICIm5GCAM9WO15EP2JiZVMEdB FsJ/cfXe2JT86sJ34PTEhoZm6iivGO8GxD6nXiwNlpQPXMBrM7QiU9lFrRVE1O25omJRbr FL9dMmJlEhzIeRh35q/LpQGnAwb6A5Es53uz1HuQVXYuWYleTbCu08RVZV1BpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=45a19f61218b4072db9a327df5a7f176b6955163 commit 45a19f61218b4072db9a327df5a7f176b6955163 Author: Andriy Gapon AuthorDate: 2021-11-04 11:55:35 +0000 Commit: Andriy Gapon CommitDate: 2021-11-27 08:46:31 +0000 ds1307: allow configuration via hints on FDT-based systems On-board devices should be configured via the FDT and overlays. Hints are primarily useful for external and temporarily attached devices. Adding hints is much easier and faster than writing and compiling an overlay. (cherry picked from commit 27645265c4e49ad7eaa25847a280307acb138da8) --- sys/dev/iicbus/ds1307.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/iicbus/ds1307.c b/sys/dev/iicbus/ds1307.c index 7bab7e78c0d8..47f47bb07f5e 100644 --- a/sys/dev/iicbus/ds1307.c +++ b/sys/dev/iicbus/ds1307.c @@ -216,18 +216,13 @@ ds1307_probe(device_t dev) return (ENXIO); compat = ofw_bus_search_compatible(dev, ds1307_compat_data); - - if (compat->ocd_str == NULL) - return (ENXIO); - - device_set_desc(dev, (const char *)compat->ocd_data); - - return (BUS_PROBE_DEFAULT); -#else + if (compat->ocd_str != NULL) { + device_set_desc(dev, (const char *)compat->ocd_data); + return (BUS_PROBE_DEFAULT); + } +#endif device_set_desc(dev, "Maxim DS1307 RTC"); - return (BUS_PROBE_NOWILDCARD); -#endif } static int From nobody Sat Nov 27 08:52:13 2021 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 B084918BDB6C; Sat, 27 Nov 2021 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1QNG3x4Lz4kdy; Sat, 27 Nov 2021 08:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 137711928D; Sat, 27 Nov 2021 08:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AR8qDfQ082956; Sat, 27 Nov 2021 08:52:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AR8qD9F082955; Sat, 27 Nov 2021 08:52:13 GMT (envelope-from git) Date: Sat, 27 Nov 2021 08:52:13 GMT Message-Id: <202111270852.1AR8qD9F082955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: ad5904ec5913 - stable/12 - icee: allow configuration via hints on FDT-based systems 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ad5904ec59133b0ab47383b0868eca33cf17b61b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638003134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PKKY8lCqUsrZ81+uzfAVXl9CWoCwYro4RXQ51iWJuzQ=; b=qmj1FkuZMFfXqg/RXH8QR9pshaQg2k+Htdx5WhB5WOYdRpW6EOxjsykktv2OKAnDGkKWht 5n/wJFDKBe2g6300PwJaHbk4rarqWAFr9LFcOjtvaDEA89806skUXQun6IPbRAfKRejiW4 dCcGQFxAiQu2f9Bi/l8wfzCINPa+3ib9DuzkFL9kWbLqtFFGYRO6CTUnv2WxpR9jj4fBiP QIGv9sS2TdbhvwSKmbQGuZys3eNbWtZF5699VVidvG+X3jF63KoFSf3PgItfZQGIFN/muh RUmK6fj8W3xbaaWADZyDy//AECS8EfcJqz/erCQViyD+n1PBEOxpOvAygYHIkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638003134; a=rsa-sha256; cv=none; b=gSiWoRRgJpcsQQjdBOgmXvNNsVk9awuayjKXlxHVZIbCZt/VFJMkRmE+agAPU9Nd8w8hwT /xQW4kF03dvR3DscSyUG6hs8Eph96L2OYk/b2JXP4pazxE5jAKkoXPBN92eCT8HV0zFiEC ymQqmjO3ug2/3R5EpGPuWbfeywy2Nk69424CVgfdgjRDy08BLIHg21mHpgKEm1eTg5HFd3 hdcQHV9hJ0fr8P6ys645KuD8IBMUzO92p7PbyyqQz1K5g4aCL1YsT2z7jVm64154pS/DWp rj32kIVrKnNSjRdJWGYV7A/Q7gLbBM3PLfGiXaxB44B7nGvOXS2jZdEBcDNm8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ad5904ec59133b0ab47383b0868eca33cf17b61b commit ad5904ec59133b0ab47383b0868eca33cf17b61b Author: Andriy Gapon AuthorDate: 2021-11-04 11:56:22 +0000 Commit: Andriy Gapon CommitDate: 2021-11-27 08:48:59 +0000 icee: allow configuration via hints on FDT-based systems On-board devices should be configured via the FDT and overlays. Hints are primarily useful for external and temporarily attached devices. Adding hints is much easier and faster than writing and compiling an overlay. (cherry picked from commit 01e3492337cb48484e03be38340cc67ac5e30a5b) --- sys/dev/iicbus/icee.c | 64 +++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/sys/dev/iicbus/icee.c b/sys/dev/iicbus/icee.c index 0f6ab4d0700a..bc2bd7338d1a 100644 --- a/sys/dev/iicbus/icee.c +++ b/sys/dev/iicbus/icee.c @@ -128,10 +128,10 @@ static struct cdevsw icee_cdevsw = .d_write = icee_write }; -#ifdef FDT static int icee_probe(device_t dev) { +#ifdef FDT struct eeprom_desc *d; if (!ofw_bus_status_okay(dev)) @@ -139,49 +139,42 @@ icee_probe(device_t dev) d = (struct eeprom_desc *) ofw_bus_search_compatible(dev, compat_data)->ocd_data; - if (d == NULL) - return (ENXIO); - - device_set_desc(dev, d->name); - return (BUS_PROBE_DEFAULT); -} - -static void -icee_init(struct icee_softc *sc) -{ - struct eeprom_desc *d; - - d = (struct eeprom_desc *) - ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; - if (d == NULL) - return; /* attach will see sc->size == 0 and return error */ - - sc->size = d->size; - sc->type = d->type; - sc->wr_sz = d->wr_sz; -} -#else /* !FDT */ -static int -icee_probe(device_t dev) -{ - + if (d != NULL) { + device_set_desc(dev, d->name); + return (BUS_PROBE_DEFAULT); + } +#endif device_set_desc(dev, "I2C EEPROM"); return (BUS_PROBE_NOWILDCARD); } -static void +static int icee_init(struct icee_softc *sc) { const char *dname; int dunit; +#ifdef FDT + struct eeprom_desc *d; + d = (struct eeprom_desc *) + ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; + if (d != NULL) { + sc->size = d->size; + sc->type = d->type; + sc->wr_sz = d->wr_sz; + return (0); + } +#endif dname = device_get_name(sc->dev); dunit = device_get_unit(sc->dev); - resource_int_value(dname, dunit, "size", &sc->size); - resource_int_value(dname, dunit, "type", &sc->type); - resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz); + if (resource_int_value(dname, dunit, "type", &sc->type) != 0) + return (ENOENT); + if (resource_int_value(dname, dunit, "size", &sc->size) != 0) + return (ENOENT); + if (resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz) != 0) + return (ENOENT); + return (0); } -#endif /* FDT */ static int icee_attach(device_t dev) @@ -192,13 +185,8 @@ icee_attach(device_t dev) sc->dev = dev; sc->addr = iicbus_get_addr(dev); - icee_init(sc); - if (sc->size == 0 || sc->type == 0 || sc->wr_sz == 0) { - device_printf(sc->dev, "Missing config data, " - "these cannot be zero: size %d type %d wr_sz %d\n", - sc->size, sc->type, sc->wr_sz); + if (icee_init(sc) != 0) return (EINVAL); - } if (bootverbose) device_printf(dev, "size: %d bytes, addressing: %d-bits\n", sc->size, sc->type); From nobody Sun Nov 28 02:05:53 2021 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 8DB8A18B2F68; Sun, 28 Nov 2021 02:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1sJx28qTz3GwT; Sun, 28 Nov 2021 02:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A4702683E; Sun, 28 Nov 2021 02:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AS25rSG054833; Sun, 28 Nov 2021 02:05:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AS25rNE054832; Sun, 28 Nov 2021 02:05:53 GMT (envelope-from git) Date: Sun, 28 Nov 2021 02:05:53 GMT Message-Id: <202111280205.1AS25rNE054832@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: 374f859ec08f - stable/13 - ng_h4: add deprecation notice 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 374f859ec08fc96a8cdd530eaeeba060c7b41912 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638065153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCxYUUeAWlUIgtcVDx4znO+Hgy3R4bWm38DK4ORKrkg=; b=LLTNq5d2cfs90Sio04lO7FGiyuxdngfEyM2F0cJc71MeGmRpv+XUL7FmXWMAZd6Kwod5Dv k6BNtb1x4sQKeGEgpZmSI0h7asCSrbRQSEuzUPI0LaqZokDfDMHfVelsmvU/7977vev51W Z64mYDdrvuepanGi5+xPv7gACLyAwUxDKNXowJvFuvCe+Ugyf/wZo6vj76dkY+NfbuP8pp kt3Mr+4abXEm6teiXI1E61x603O0/I6ZNNsxURh+NDfZnC53nqfZmVQphWFyfAfV5ID2eh OJf8Jmzv2B/intn9HjzV/sSigHJcZMJ4QXa2Hhq8V962ihrPpcq/1LLKGPa+ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638065153; a=rsa-sha256; cv=none; b=NNuiXCXlNbVDB4ff58QX8Eui9FvSUO5PyYbC6ZE1KuDiXoK2l1f92z89BxwVpU6glL1BU6 69d9i8QwVMSyYEsI1OkpZOM6v4zbaCvPXolxI6D2CqcPzWfx7S9YMqFfonvCQyKw6jD24E zYMMJKzk1G4c8zHMtUGTqIJIbigUZiE2ePk04kR2cMmWZHkdk6xdM+dhZGNNLweHlCckwc sDH21HvRAuieG9yNAULygovEi7+Qr5wRMzGeTL5SAUVcQRcIp86uUlH0WIQsQ8K8MHtctp OiwEzxHntm5vMtT0hoPEqzOWAPS0gP55elDD9ZFCO8zEzkIYn8qdSKxO/7qbKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=374f859ec08fc96a8cdd530eaeeba060c7b41912 commit 374f859ec08fc96a8cdd530eaeeba060c7b41912 Author: Ed Maste AuthorDate: 2021-11-25 16:55:34 +0000 Commit: Ed Maste CommitDate: 2021-11-28 00:26:38 +0000 ng_h4: add deprecation notice It is already gone in FreeBSD 14. Sponsored by: The FreeBSD Foundation --- share/man/man4/ng_h4.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_h4.4 b/share/man/man4/ng_h4.4 index bb539a230eba..52a9b8158746 100644 --- a/share/man/man4/ng_h4.4 +++ b/share/man/man4/ng_h4.4 @@ -25,7 +25,7 @@ .\" $Id: ng_h4.4,v 1.2 2003/05/21 19:37:35 max Exp $ .\" $FreeBSD$ .\" -.Dd June 14, 2002 +.Dd November 27, 2021 .Dt NG_H4 4 .Os .Sh NAME @@ -34,6 +34,11 @@ .Sh SYNOPSIS .In sys/types.h .In netgraph/bluetooth/include/ng_h4.h +.Sh DEPRECATION NOTICE +The +.Nm +Netgraph node is not present in +.Fx 14.0 . .Sh DESCRIPTION The .Nm h4 From nobody Sun Nov 28 02:05:54 2021 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 6E71418B3156; Sun, 28 Nov 2021 02:05:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1sJy430sz3H0M; Sun, 28 Nov 2021 02:05:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6004926A25; Sun, 28 Nov 2021 02:05:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AS25sgT054857; Sun, 28 Nov 2021 02:05:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AS25sV2054856; Sun, 28 Nov 2021 02:05:54 GMT (envelope-from git) Date: Sun, 28 Nov 2021 02:05:54 GMT Message-Id: <202111280205.1AS25sV2054856@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: ee2e925603e4 - stable/13 - Fix coredump_phnum test with ASLR enabled 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: ee2e925603e42897fbabe1b24208d27bdcaae786 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638065154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=txo+mUkl0RcF72IJ4+vjs/jg/c5Vz7A9TVDy7oZus3A=; b=J6jVNrkv5RiKHBG3syR5IAgpFMzV5Xb8NkGAg1p0TbdKwKL43Vxg9bnF2gKPJRT4jYwpDt y2aQUG18G+PfPZbagUbuft0l3szQVB/RKWUcVC7y3q0djC7opxAE03nOF696wAexS9oH91 zguKD+uhMGCq2WV/3VYGhpivXBS/nyEjWNZ8WBZvTww8Wjx/vmRMnR587Cy8ONnsu7E3qE GcLtMIkQLEaRm8jukXGwi85pPZYQDKyp7z3yOh7Bu76blu8petbGwHij4yZllR1LhzZiZD R3G3Csr/insMzYbkG8cOQpkKCo8GbOfH3ngdbp7BtbfQKipQDjMryJ4HYFAdnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638065154; a=rsa-sha256; cv=none; b=TGTcS73FSJ78qaCpBL/Vz3ErhfOGrns253KYuiSDXzvE8sw7Ak/Y7rgDiAXEDGDPJmTqzR lTo7KqH/TV1n7txxT8PpNVv93OUW6NkAbOSqwHQVJz//bJrp4VpxcYpwrvjQoNefv9svhx Uh6gU+jJjuVHFpCVu5umxs0GJpBwqiJ7kL08xEh8Nju6sU5ivcMiIAfaLZgYi2aT8hYTXF 0U+ixsSvU8v38QEmzzkyhsISwtU6j5dgOY6r83COuV1uXCDO8n37Bp0mBU1hPzW18nBGP8 QlSoTuzFQsGCZDJqq1fmvA7HtbReqBo/CdZV9dPvbm8LTa1gPnFLmxc4OmoRrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ee2e925603e42897fbabe1b24208d27bdcaae786 commit ee2e925603e42897fbabe1b24208d27bdcaae786 Author: Ed Maste AuthorDate: 2021-11-21 17:17:20 +0000 Commit: Ed Maste CommitDate: 2021-11-28 00:27:03 +0000 Fix coredump_phnum test with ASLR enabled coredump_phnum intends to generate a core file with many PT_LOAD segments. Previously it called mmap() in a loop with alternating protections, relying on each mapping following the previous, to produce a core file with many page-sized PT_LOAD segments. With ASLR on we no longer have this property of each mmap() following the previous. Instead, perform a single allocation, and then use mprotect() to set alternating pages to PROT_READ. PR: 259970 Reported by: lwhsu, mw Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33070 (cherry picked from commit 8ec4c5dae32765701ac70811455084efd1570c32) --- tests/sys/kern/coredump_phnum_helper.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/sys/kern/coredump_phnum_helper.c b/tests/sys/kern/coredump_phnum_helper.c index da023e691a24..0dff59b918d9 100644 --- a/tests/sys/kern/coredump_phnum_helper.c +++ b/tests/sys/kern/coredump_phnum_helper.c @@ -42,18 +42,21 @@ int main(int argc __unused, char **argv __unused) { void *v; - unsigned i; + size_t i, pages; - for (i = 0; i < UINT16_MAX + 1000; i++) { + pages = UINT16_MAX + 1000; + v = mmap(NULL, pages * PAGE_SIZE, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0); + if (v == NULL) + err(1, "mmap"); + for (i = 0; i < pages; i += 2) { /* - * Alternate protections; otherwise the kernel will just extend - * the adjacent same-protection previous mapping. + * Alternate protections to interleave RW and R PT_LOAD + * segments. */ - v = mmap(NULL, PAGE_SIZE, - (((i % 2) == 0) ? PROT_READ : 0) | PROT_WRITE, - MAP_ANON | MAP_PRIVATE, -1, 0); - if (v == MAP_FAILED) - err(1, "mmap"); + if (mprotect((char *)v + i * PAGE_SIZE, PAGE_SIZE, + PROT_READ) != 0) + err(1, "mprotect"); } /* Dump core. */ From nobody Sun Nov 28 02:05:55 2021 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 428C718B3063; Sun, 28 Nov 2021 02:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1sJz5KfKz3H2b; Sun, 28 Nov 2021 02:05:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8140B26916; Sun, 28 Nov 2021 02:05:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AS25tNw054881; Sun, 28 Nov 2021 02:05:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AS25t72054880; Sun, 28 Nov 2021 02:05:55 GMT (envelope-from git) Date: Sun, 28 Nov 2021 02:05:55 GMT Message-Id: <202111280205.1AS25t72054880@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: 2104a8064951 - stable/13 - mkimg: zero entry in vhdx_write_metadata 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 2104a806495173c399ca2709533ab0ab48b708b3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638065155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xQQisqtiNNSe4uf8We7Kdxt2jgcmhn8aPGz9vmv8iWc=; b=yAKHwI6mByLtmRtAn1kpfKolVvBXONq84nfMe7AxdeuwDtyF2VCELEq9l8lQtpY2Dy8l5G TthcuJvNQ5Sc9OHmnQPcHXRex/HU+RJopeAYjpJGJONH3BSUNAKz61peEqRUK5UZ7SMJOJ AQn3QCrNIwcN7uUnCVGxlz67ytJ0sl3S+HszDGIpIi+4hwxbBC3N/qov+LSRyzmNyryBQ0 YvU9meHW3lJM01RAxPB5Eq9NwsBmKS+WA+PFxwBvk2tCvShDEnX7cg1Ew5N/2AayuENxEM 4ovNsbzDc7wGKwmVGpu0gMODB2FDYThX6poXxzify1jvQBflLPbmiXmOaAPKpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638065155; a=rsa-sha256; cv=none; b=O5ZNfezUwUmN1ylE5HAKOHofLSxZcgsI1P3Z30P0DkiPP08VJ6lVxacQipVxiPY125NMfs o4srCSGSfdt80n8FSTEC3V6/yM26XiPpd0avWa4Tn/MdqlW45nvFo40p17xEJllss7Upzk ZRgswMG8v1VxHM9jUpvSy2bZjoVGXhkl4LxpJBjdQgicb4pT4lUfvcieItG15xaSuYCeaQ 70y0fUH5Q8gK9JJpI2LwsXhzaLiEScVvh9SG/q8yiV2SahhY+bHMwm9NRtSDlFaJKXCEcD 6FWQTFrJflx0BugK16NIGbiTN17XM88F3KgboEAazls++FHKI5IPX+uw6mvu/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2104a806495173c399ca2709533ab0ab48b708b3 commit 2104a806495173c399ca2709533ab0ab48b708b3 Author: Ed Maste AuthorDate: 2021-11-21 00:29:11 +0000 Commit: Ed Maste CommitDate: 2021-11-28 00:29:30 +0000 mkimg: zero entry in vhdx_write_metadata Otherwise _reserved might contain uninitialized data. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 036af1053acd6cae68c5fb6bed30508f2e40be13) --- usr.bin/mkimg/vhdx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/mkimg/vhdx.c b/usr.bin/mkimg/vhdx.c index 4c97b20f5996..744d6e810ca5 100644 --- a/usr.bin/mkimg/vhdx.c +++ b/usr.bin/mkimg/vhdx.c @@ -331,6 +331,7 @@ vhdx_write_metadata(int fd, uint64_t image_size) memset(metadata, 0, SIZE_1MB); memset(&header, 0, sizeof(header)); + memset(&entry, 0, sizeof(entry)); le64enc(&header.signature, VHDX_METADATA_TABLE_HEADER_SIGNATURE); le16enc(&header.entry_count, 5); From nobody Sun Nov 28 02:56:10 2021 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 B611218B1AB0; Sun, 28 Nov 2021 02:56:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1tQz0pcwz3mwB; Sun, 28 Nov 2021 02:56:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0C28271DF; Sun, 28 Nov 2021 02:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AS2uAis020319; Sun, 28 Nov 2021 02:56:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AS2uAwE020318; Sun, 28 Nov 2021 02:56:10 GMT (envelope-from git) Date: Sun, 28 Nov 2021 02:56:10 GMT Message-Id: <202111280256.1AS2uAwE020318@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: 2ff40d5e276f - stable/12 - ng_h4: add deprecation notice 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 2ff40d5e276f0f7b191a3e628897c5a3ca54a19c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638068171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sjz5QZTH+d2zIVLyNJN+YzI90Ua4sSfF/9cRlwYXTNQ=; b=FTUDzcDlrn+Hkl3QxlS1LMI51z3j+oWE8vBFxGxfrZEuAeuhvBi2xg62oJWaYgEm20HBn8 4INtoFPbkP3a/zq3Fty3nULWmNox6rrwc9UMI1OaDy5TSMtxe1votSB2GX7dIRr8qAPypd SM6bOMnQFgz8tANj60gIZuCh+tDoks91JEfpuO0OGyjgk9qfFaHLG48Y4lff4snONpSkIn eWp7xgmf6z157bWREIReK7lqhuAs9TlsRMieLCtZuzPlo4XZzJPKl/HIIuagLUUcHk2ky4 BZw189NwpwhNZAT99SK3+Z5LFtiRNgVkI8qa4HibI/gzkq9NjzgMkkX9NgZoxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638068171; a=rsa-sha256; cv=none; b=ETE46E6qxMqvkhknCpdwENwX05iQA9YfKgbTZ6byCJvman0vWnDmG8Ivu91AqsOQQa3xhS IuViZd4BfKAeVxE+ZzjTq/bdhzbZ+3YBIdMdK6WCvMQ4exCJ8rmFFPqgSCPUD7v7jDmFnj /wkye/sBoXPItGJn1gCvdVepVay1MP8MKkI10REpYaNDZbVfeB4+NLNoMy81+6NCJTr0n0 iFMvHxgkR3KJe+QWRKSPtHUjOgw/ezSM2Xig4wjxOGcAIEh1rvF+rKXAi1JwP+6wTW2SQb j0+CMu2SH0F8DUQGsTJ0MmpBQCVe/JadyS/dTMayqosioRiBBFmg/43vIsNgOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2ff40d5e276f0f7b191a3e628897c5a3ca54a19c commit 2ff40d5e276f0f7b191a3e628897c5a3ca54a19c Author: Ed Maste AuthorDate: 2021-11-25 16:55:34 +0000 Commit: Ed Maste CommitDate: 2021-11-28 02:55:46 +0000 ng_h4: add deprecation notice It is already gone in FreeBSD 14. Sponsored by: The FreeBSD Foundation (cherry picked from commit 374f859ec08fc96a8cdd530eaeeba060c7b41912) --- share/man/man4/ng_h4.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_h4.4 b/share/man/man4/ng_h4.4 index bb539a230eba..52a9b8158746 100644 --- a/share/man/man4/ng_h4.4 +++ b/share/man/man4/ng_h4.4 @@ -25,7 +25,7 @@ .\" $Id: ng_h4.4,v 1.2 2003/05/21 19:37:35 max Exp $ .\" $FreeBSD$ .\" -.Dd June 14, 2002 +.Dd November 27, 2021 .Dt NG_H4 4 .Os .Sh NAME @@ -34,6 +34,11 @@ .Sh SYNOPSIS .In sys/types.h .In netgraph/bluetooth/include/ng_h4.h +.Sh DEPRECATION NOTICE +The +.Nm +Netgraph node is not present in +.Fx 14.0 . .Sh DESCRIPTION The .Nm h4 From nobody Sun Nov 28 02:56:12 2021 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 00D1C18B1AB4; Sun, 28 Nov 2021 02:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1tR01t22z3mhF; Sun, 28 Nov 2021 02:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2165B26DDE; Sun, 28 Nov 2021 02:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AS2uCPh020343; Sun, 28 Nov 2021 02:56:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AS2uCNe020342; Sun, 28 Nov 2021 02:56:12 GMT (envelope-from git) Date: Sun, 28 Nov 2021 02:56:12 GMT Message-Id: <202111280256.1AS2uCNe020342@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: d3a7b75bbcb5 - stable/12 - Fix coredump_phnum test with ASLR enabled 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: d3a7b75bbcb5171d7eda9d712437efd46bb7605b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638068172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gF3OhGaXB9/ab3bVCnTM/PV96UaIFCr5b791Rr74ny0=; b=kzy+vOTyLwSelpxFJ5sX1Fw75UJYKxyApkjnXiMHljOVhSfFAxWoZIiS+XNtq/Nd1TnnyP oTqU/yMBY14ax1nMkXh8ISM8/Vg39L5OvD4FmWc/VayMOoFoah0T2iqebwzLvslZo2SFmL z/jjB/VCvV/k4mYzPX0Km/e+I/BCZ/z/8hrpyUWyGZcRxIuIDqKgBWDSf+SmoXWqMhKvx6 6wi7VvHdvCXcAOeKMWQ0c3ZSAFgI0awPw0q+hiP7QMxA4MrONTYb8BClYY4vxV93ihWg8/ hQSF5tIHt4j21EaxS0qzCbvsCqSHIgkuHqQHswZEfKkZeEu6E6YlL4xw+00Ztg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638068172; a=rsa-sha256; cv=none; b=rE7UdHFhflI7G2joLIx7tlVrjma2mvV3yYXJ0ArgsNAYAI+keDZ77N/wAAVyDnwMGSxh+j h042iRArcQ5qmiyXLMs/jMjVJG0IIupQTg2q1lKjsWXR5Cu8f4eazZ0XXKT/lgh7DyfKet m8Lsg9tPz14SuWvie4ZelyY9VdQPoLR2RxvBzxdZ4k82RLj+2moomGt9Z7F81WrgpiUDvh fnk1g3rqv3A7a+JWvOghcQY3/TCtZPmd3T+72kfF2/IWOr95ZRH37viweSKDDEmzLaQPg/ Z1ESJ6HnsOLspbufBOoCHrcFgDgmhDtYBxe4xX+DWHX1ofjbxa+ovYSJGmnmiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d3a7b75bbcb5171d7eda9d712437efd46bb7605b commit d3a7b75bbcb5171d7eda9d712437efd46bb7605b Author: Ed Maste AuthorDate: 2021-11-21 17:17:20 +0000 Commit: Ed Maste CommitDate: 2021-11-28 02:55:46 +0000 Fix coredump_phnum test with ASLR enabled coredump_phnum intends to generate a core file with many PT_LOAD segments. Previously it called mmap() in a loop with alternating protections, relying on each mapping following the previous, to produce a core file with many page-sized PT_LOAD segments. With ASLR on we no longer have this property of each mmap() following the previous. Instead, perform a single allocation, and then use mprotect() to set alternating pages to PROT_READ. PR: 259970 Reported by: lwhsu, mw Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33070 (cherry picked from commit 8ec4c5dae32765701ac70811455084efd1570c32) (cherry picked from commit ee2e925603e42897fbabe1b24208d27bdcaae786) --- tests/sys/kern/coredump_phnum_helper.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/sys/kern/coredump_phnum_helper.c b/tests/sys/kern/coredump_phnum_helper.c index da023e691a24..0dff59b918d9 100644 --- a/tests/sys/kern/coredump_phnum_helper.c +++ b/tests/sys/kern/coredump_phnum_helper.c @@ -42,18 +42,21 @@ int main(int argc __unused, char **argv __unused) { void *v; - unsigned i; + size_t i, pages; - for (i = 0; i < UINT16_MAX + 1000; i++) { + pages = UINT16_MAX + 1000; + v = mmap(NULL, pages * PAGE_SIZE, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0); + if (v == NULL) + err(1, "mmap"); + for (i = 0; i < pages; i += 2) { /* - * Alternate protections; otherwise the kernel will just extend - * the adjacent same-protection previous mapping. + * Alternate protections to interleave RW and R PT_LOAD + * segments. */ - v = mmap(NULL, PAGE_SIZE, - (((i % 2) == 0) ? PROT_READ : 0) | PROT_WRITE, - MAP_ANON | MAP_PRIVATE, -1, 0); - if (v == MAP_FAILED) - err(1, "mmap"); + if (mprotect((char *)v + i * PAGE_SIZE, PAGE_SIZE, + PROT_READ) != 0) + err(1, "mprotect"); } /* Dump core. */ From nobody Sun Nov 28 02:56:13 2021 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 7BDED18B1C15; Sun, 28 Nov 2021 02:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1tR15djNz3mfP; Sun, 28 Nov 2021 02:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E94A273A4; Sun, 28 Nov 2021 02:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AS2uDfi020367; Sun, 28 Nov 2021 02:56:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AS2uDro020366; Sun, 28 Nov 2021 02:56:13 GMT (envelope-from git) Date: Sun, 28 Nov 2021 02:56:13 GMT Message-Id: <202111280256.1AS2uDro020366@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: 38cb3cac475c - stable/12 - mkimg: zero entry in vhdx_write_metadata 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 38cb3cac475c70b7c9e71fb13d48fbdce40f52fd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638068173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xBUt3Q/BuNv1IzomILBDly0BVf87Y00tULq+nqh9bqA=; b=W8z3M7stWkEvUYKfcm5MLU/lB+Yg+dsVRaj9/zaw0qgytxtam4P1fDnxWyAMZEIoW5wX4M c+zRh9oqdr21sh+Ru49UgRZPMleqPiY3GuJydb+q6238bUaQbDcfWMGUnUZV7ZnaTqWqQ5 8YtCM0VIB4UZlJ6umZMdN/npcRQNuJScT4CsJVlLaBGND0BPeg9oyBKKjmBNQrm9HsrTb+ xSozyGRduZk9hZVmDHfI337f9eJ82JMUxkFEZaIDc8+EmXThvazAot+cxZBmxILZs9PC/M WbWeDfX72W3JDgEakoF0lwUGtko9LFSTwJyGfg32APf2jkKJo2xWAyfS1/z0Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638068173; a=rsa-sha256; cv=none; b=KMbh7G9K5P5Owgon9U1pxh5Z/dc24VAneTGGQQ7CzWo8dnGGWabbvc5x7N8R5nFZjLqL7u n4N/4r45rKsSxmHm/rxtECzxUT/ZBSg1TL9NOFM4MPp/IXW20HIteJxww/JAvTDFuAafPA w778T5iSJHPCr1BjSRs3XC6FZVse03JQkhFEuymSsZ0SYHpmDWsDD8p8XwWin6fdhVIiQB Ex5IcX3WT63chAA62sqcq0G2Ukb1AbhkoDKGTdmwWAIsrZz7OWxECi9dya7t2nrSyQMiiH zGgHQLGZC1JkbP0c7rxXvtq19lzTJ/8zIgNvsFxI2m+STnnWmHei+xfT4QwFDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=38cb3cac475c70b7c9e71fb13d48fbdce40f52fd commit 38cb3cac475c70b7c9e71fb13d48fbdce40f52fd Author: Ed Maste AuthorDate: 2021-11-21 00:29:11 +0000 Commit: Ed Maste CommitDate: 2021-11-28 02:55:46 +0000 mkimg: zero entry in vhdx_write_metadata Otherwise _reserved might contain uninitialized data. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 036af1053acd6cae68c5fb6bed30508f2e40be13) --- usr.bin/mkimg/vhdx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/mkimg/vhdx.c b/usr.bin/mkimg/vhdx.c index 4c97b20f5996..744d6e810ca5 100644 --- a/usr.bin/mkimg/vhdx.c +++ b/usr.bin/mkimg/vhdx.c @@ -331,6 +331,7 @@ vhdx_write_metadata(int fd, uint64_t image_size) memset(metadata, 0, SIZE_1MB); memset(&header, 0, sizeof(header)); + memset(&entry, 0, sizeof(entry)); le64enc(&header.signature, VHDX_METADATA_TABLE_HEADER_SIGNATURE); le16enc(&header.entry_count, 5); From nobody Sun Nov 28 11:43:45 2021 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 B0CBD18AEDE6; Sun, 28 Nov 2021 11:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267j2HFTz4gfh; Sun, 28 Nov 2021 11:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DF246478; Sun, 28 Nov 2021 11:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhjDj026191; Sun, 28 Nov 2021 11:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhj6C026190; Sun, 28 Nov 2021 11:43:45 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:45 GMT Message-Id: <202111281143.1ASBhj6C026190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 03490cedbc6c - stable/13 - TWL: Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03490cedbc6cf14316ac2522fddcdedbcf310297 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MKkyPvc2oJc+cl/w0dmluo9m8CAB4SMHT/yiu/KzulI=; b=fphNYy2QR5/AiiEFiahxGsYB8+PeVbhn1rdqf9G9KknGTg5MAqpEL8obTAhrXEJ63HxMr/ f6uIbOFWVckFsevYgeeHzzEkaS2OmIyA+zMMTFFcIwFP3M56g3MH0LMhwP7jd5hpmdzH7S 04La/djc0Zd6FsHDcdQkw4cTFTQA2XOCC9nXtfPxP81zvIDJE7aFehirE8Jnhq5MxFAqEZ 6BqSYGmxZ/4VWP3Lx/QXPRfiZHTVjZdHC0hsw4w1Qe8qIpmZrIUDJLuWL2E8HUI5dKuCKM iBeGbEfxu/3B03FFj9IxbciPq3bsNJc91PZJ2/+wTYpEMMcFxZuFrC1tgN9xsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099825; a=rsa-sha256; cv=none; b=WztMjWxNbrUKERGbGzkDBHGZJMCmOGJr1dmbeuIsOvROwMXNKNZqCZ6OLfUaqwnsYcRcdp dXtiG6gXSUXo1eUQgUiD+zumacYPiIJjubpoCUKORJI6Vasc2JhBX3CkGZkzA0AAZe+5AV RiTIXpoNR9xi+ArjZ5H1hHq44vU3Vdv8oy0n4e0+9gcM4LjovkPhxf59UD6dJKDjOZzkMC SXA/ECdwZbW5Ts6cPTETgjZAvB3lmsXnM6fLbt+naZ0wByW9vF9Bb5+BJlI7jRFhryrqR+ 9m3Ite3YSAowM/eOhT/LPoKNC8UGFHBbGUGfAD0mDo8EtxzKGl3QP5Y+Qx+lKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=03490cedbc6cf14316ac2522fddcdedbcf310297 commit 03490cedbc6cf14316ac2522fddcdedbcf310297 Author: Gordon Bergling AuthorDate: 2021-11-19 18:26:34 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:40:29 +0000 TWL: Fix a typo in a source code comment - s/maxium/maximum/ (cherry picked from commit 8b11850f9d04c096d8ed3647db512f8feceefaf4) --- sys/arm/ti/twl/twl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/ti/twl/twl.c b/sys/arm/ti/twl/twl.c index e1b20cbbaa5f..c7755b524f0a 100644 --- a/sys/arm/ti/twl/twl.c +++ b/sys/arm/ti/twl/twl.c @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); /* Each TWL device typically has more than one I2C address */ #define TWL_MAX_SUBADDRS 4 -/* The maxium number of bytes that can be written in one call */ +/* The maximum number of bytes that can be written in one call */ #define TWL_MAX_IIC_DATA_SIZE 63 /* The TWL devices typically use 4 I2C address for the different internal From nobody Sun Nov 28 11:43:46 2021 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 A077F18AF09A; Sun, 28 Nov 2021 11:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267k2gHkz4gfj; Sun, 28 Nov 2021 11:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CB256479; Sun, 28 Nov 2021 11:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhkdY026215; Sun, 28 Nov 2021 11:43:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhkKU026214; Sun, 28 Nov 2021 11:43:46 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:46 GMT Message-Id: <202111281143.1ASBhkKU026214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: c8f21cc79f00 - stable/13 - sched_ule(4): Fix two typo in source code comments 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8f21cc79f001b55469b4d6577a7cd0f927fafe9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tZYK7mBQoR8/vKspK2aisdazQNQ77w8uUlQl/wiPm4s=; b=c76dpgLUtZd9pJm97m7cVey+yG7U6eCpNZ4lGAk1dmQoxyPcJHsdwaxpz7PBFYBGh+vIW5 ciWwJikYXFRf+czZBX6RziNG4nZwGSal87VnnIJZn6bAtXW/B8jJBOgW/t6a7gxthbvD0p 0ZBkhIgwnwSDoH9AC9MOMOPi9KFiZEZnizJg+dEl+Uwn4+4hNZ49UMMVmFlsibDXM82Ma6 CMAnP/TYfgNR7vFkqgutollPcaBVffA82mAybdNpDSww97v3Y2shAFaL/d4+HQfb0BQVV3 8BOrE5pSZFOZtpgjWBenE44XDCXqIXQ9g7kMFfuVtqyKnXsnNqIhtUWjdKR6hA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099826; a=rsa-sha256; cv=none; b=Jk0wduWWvny507wC36YEqoRpYkPuJgKseobZrQIMySyCdLw9MzNoNScLrwFkV4Lc9d1gD4 u7PXWbLJJBh7uFpMJu8C1EMoi8prdQ4bNvYizZB/sCtFS1pWF5tmiOyIkqht5P6UjhPvoL EzZtwILNElr+DNailwlIwICkZLRTWJcSRaf90WxP8j0EU+b1Bydktev6n4wHvj7z4yCU4w t0eTuoCOQ2Z/De3XB+YG/j2W9f9+w/aJe4lyvFDNxiCXKMn7rIFZBzM0/lqargaGVa3fiP VrIEffnKSsUoSIsRKatcDYUFfJzJtNAee3abA0kEqqLGbpY/PYiRza2Iy/zdjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c8f21cc79f001b55469b4d6577a7cd0f927fafe9 commit c8f21cc79f001b55469b4d6577a7cd0f927fafe9 Author: Gordon Bergling AuthorDate: 2021-11-19 18:13:28 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:41:11 +0000 sched_ule(4): Fix two typo in source code comments - s/conditons/conditions/ - s/unconditonally/unconditionally/ (cherry picked from commit 15b5c347f1916d14e84765ae68921755ee930612) --- sys/kern/sched_ule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 708c19b27394..c9498cac7912 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -2020,7 +2020,7 @@ tdq_trysteal(struct tdq *tdq) /* * The data returned by sched_highest() is stale and * the chosen CPU no longer has an eligible thread. - * At this point unconditonally exit the loop to bound + * At this point unconditionally exit the loop to bound * the time spent in the critcal section. */ if (steal->tdq_load < steal_thresh || @@ -3033,7 +3033,7 @@ sched_fork_exit(struct thread *td) } /* - * Create on first use to catch odd startup conditons. + * Create on first use to catch odd startup conditions. */ char * sched_tdname(struct thread *td) From nobody Sun Nov 28 11:43:47 2021 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 2D40A18AEF60; Sun, 28 Nov 2021 11:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267l3vpNz4gcy; Sun, 28 Nov 2021 11:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6257D635D; Sun, 28 Nov 2021 11:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhlNq026239; Sun, 28 Nov 2021 11:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhlMl026238; Sun, 28 Nov 2021 11:43:47 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:47 GMT Message-Id: <202111281143.1ASBhlMl026238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 197f36e0005a - stable/13 - iscsi(4): Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 197f36e0005af6aa83c57e6f163d10ca949fb410 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NqbYIpGXVvkDTFLpDoWrGzWpTKNdv7CCDBnW8cWCe3A=; b=RITFHojHDywzY6w3SulFsl8QR8fOQjrVgh0odksYZTdVrn0O9ww98nThkAEzzENrqq3Es4 SCw4imwQc34Drs+9mUoikZV8NKDo18b/XOO/RKwDUlZPzGiN3wofT8fuUG+pOaeZJS22wr CtwGaloEvj6cSgBtDj5lODcqvbpHzo96yDpRj3hlt7mEoQoREFEMuMAGveyj06mwTzwZeq SFic5+P97jPMHfm5mtP0u3p6EPXarMP2+xe0oXElXq87/n/Ks6tRoPqHDT42aGNs9EMIrI vyCklSrI2uZwujuO7lcMmu4An8JOAsRVa1TWIEh3oPKb5GWWpWbkNxTrzldhTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099827; a=rsa-sha256; cv=none; b=I7P2FwGyZO7pwoxQayITjmWfPIXZkWPj1Nkbib8TfV2A9a065omKQ0cyAURblXZhUjh8y2 1OHBnqIlYcrw2PkE6YV+7nYhY1FwNfEANcXAxI7XNqQ7bT+xp9cKVsbzrSWEKSq8c8Vczg BW3J0gDymmzQVv3+jkJcstmt+qAcxTmXviFB2udojQxaXFM/ZzIhjXHwy+/aEjV8e/t193 eZe9UD40wBZtn3rxlMJOtNjod3Ua2vMiKr998vijwyLktFmZ0iNz0vZD6S9llK67l3ses6 7R5C7bcK702cgAeMERW59NAqV9GWCNDEGhgeQKucAQ7KV/OQGW303Z3NkJkAIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=197f36e0005af6aa83c57e6f163d10ca949fb410 commit 197f36e0005af6aa83c57e6f163d10ca949fb410 Author: Gordon Bergling AuthorDate: 2021-11-19 18:29:21 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:41:52 +0000 iscsi(4): Fix a typo in a source code comment - s/conditon/condition/ (cherry picked from commit 5e21882bb4e7d36ebcf0300234486a54ff4e7b13) --- sys/dev/isci/scil/scif_sas_design.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/isci/scil/scif_sas_design.h b/sys/dev/isci/scil/scif_sas_design.h index 1f2e8a851287..18c9e86e861d 100644 --- a/sys/dev/isci/scil/scif_sas_design.h +++ b/sys/dev/isci/scil/scif_sas_design.h @@ -334,7 +334,7 @@ Please refer to these files directly for further design information: The SCIF SAS SMP REMOTE DEVICE object represents the expander device and fulfills its SMP discover activities. The discover procedure includes a initial discover phase and a following SATA spinup_hold release phase, if there are expander attached -SATA device is discovered and in spinup_hold conditon. The SCIF SAS SMP REMOTE DEVICE +SATA device is discovered and in spinup_hold condition. The SCIF SAS SMP REMOTE DEVICE object also fulfills expander attached device Target Reset (Phy Control) activity. @image latex Discover Process.eps "SMP Discover Activity Diagram" width=10cm From nobody Sun Nov 28 11:43:48 2021 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 2799318AEF77; Sun, 28 Nov 2021 11:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267m5l9nz4gwr; Sun, 28 Nov 2021 11:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A27063EF; Sun, 28 Nov 2021 11:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhmqr026263; Sun, 28 Nov 2021 11:43:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhmOp026262; Sun, 28 Nov 2021 11:43:48 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:48 GMT Message-Id: <202111281143.1ASBhmOp026262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: f9236943e18a - stable/13 - ixl(4): Fix a typo in a sysctl description 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f9236943e18aba7226e0e6825575d452e5cd0245 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u4fu0WI5vRW6dZJmT86DUEZxzq41BGLL/JstpzsyCuk=; b=ZXrgoYrna/sy2pOtIZsxBZJxF4+tMdMGFOzB2Hsy/M/RJE7N0jAWI4UM3EWAO/iIJ6lBiK +IMEvA2UP2Jdr4r8L6brqZ5eSOCyVUa5KEw3svs32fsvsuXSNUJs7oZcy970iSnQPSkki4 WenYwY476XEZtZNa0DD9kLrz6O2NzAghRt9AtBsJVoETRD/maIP6u63eOxD/MHnYTzLPTQ sWdCFyh3vpTi4NKjTmuXMjQDmzQUwzsPIZ3+EwlTR8IkcJYbxolPxTfD3DeaipWwbojqbR CQ11RFfJ1hofdQVu5ELZo5NXRJhPgCo0kibH2eg/OyNPnJ4w62dAUraMyDK6xQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099829; a=rsa-sha256; cv=none; b=v2MQZvdZWY3iMEl5XC+qLjFY2ieXrYtFUcqeBE7PFozUZ1bAsIphHQMuI6j7jzYBgueWXZ cPmtL+g33hdeNS99Y+vRiGAqlaZQBCOs62cmLs6C8P/ZnxFzFIe2EnsN5ZM5Pvrpv+wSos BV27Wj3p5wS/EbOQTbN272tVDPfz1HW/40YXBtvyynT35s0W1VFoC2E+jtKzK2bhkzyAgG CdXgc6woYtLWAaIGmFXN+L4134hLw97lYIymIkKbiEaklH6TAAFLGWasC9SkUh4Iqm8qJY HCwAQ4n/ZE0z99oEdEkVR59hFnnQkXNKTVEOgIJt+KMs94cq/RPEUvbh7eL+7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f9236943e18aba7226e0e6825575d452e5cd0245 commit f9236943e18aba7226e0e6825575d452e5cd0245 Author: Gordon Bergling AuthorDate: 2021-11-19 18:59:28 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:42:14 +0000 ixl(4): Fix a typo in a sysctl description (cherry picked from commit d7125850f031f8e763ff35c70fda310a1419b876) --- sys/dev/ixl/if_ixl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index e7e6e31a7fca..7fa2318db300 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -235,7 +235,7 @@ TUNABLE_INT("hw.ixl.debug_recovery_mode", &ixl_debug_recovery_mode); SYSCTL_INT(_hw_ixl, OID_AUTO, debug_recovery_mode, CTLFLAG_RDTUN, &ixl_debug_recovery_mode, 0, - "Act like when FW entered recovery mode (for debuging)"); + "Act like when FW entered recovery mode (for debugging)"); #endif static int ixl_i2c_access_method = 0; From nobody Sun Nov 28 11:43:49 2021 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 A6D4018AF20A; Sun, 28 Nov 2021 11:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267p1CLXz4gfy; Sun, 28 Nov 2021 11:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C756647A; Sun, 28 Nov 2021 11:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhnlI026294; Sun, 28 Nov 2021 11:43:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhnqs026293; Sun, 28 Nov 2021 11:43:49 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:49 GMT Message-Id: <202111281143.1ASBhnqs026293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 7125ea0f154b - stable/13 - firewire(4): Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7125ea0f154bd5675c9b393a21d4a4c6fb4bf680 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmEtpmR7NhY3Drm5ROPvBbUNXmkCLFPTufaJYBsaS/w=; b=v9NMtl+UFGbVt7Oc1Rk4rSn4Wr5visAmEQ7Zzi0UEfeY81yaR6oaKVacxsEnnBROJuKHJ8 cjAo9S6KxaIF0Er6cIYEj7k9s22nVCJY1LoTTcNam8OVsYHwzzMtiysoHlHb5GyuJmkXNj pK5J3tZqEppXT0Lo166De/EVE3+/hHJ/6f6fjKvUP/uDlL91/TvTd4ToSeExztzktpNZKg r8ldbvFEBpN6kPoYHM9teyZSDsXdiCTzDTrVwPSFUUG+R7p5qD6oXIHXTyKt7a7jaWh6tJ yfPcUA5xSO7uCNR2n8d5UsT0VY0Yp2t2h8WD5Pa6/QQiz4DlJNQXfwdz/ds09w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099830; a=rsa-sha256; cv=none; b=RcLZY9ZIUO0Uyi4MFukR/gp1Em3GTJ3NPU9SWdzhuti7j7rWN8kN7++MdiRmplSOlF17+3 pnOLn2T92H2Si0NRbwTRf/YJ4LdLeUJSYBY+1w1djtniNxEL/Qo20AmrLrG1y/zxj75vMd civBwMjTSY5zBTRYX8V7v+O/LYKVDx1XXMv6iRs15M1IAgxeJ2LDhzpqbuQqMz6okuDFrv W0ym88tSBsdWtcGL3pm74C0ekX6Cm8TYFRiZf+thDQLz3RgGcsk/meudqwPsYlcm5exnc0 DNt+UMkVIvFEsBgihUgwv5mGRjIgKt0Qfcu15R6jmieJpRwJ2AFWBnfeidEtiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7125ea0f154bd5675c9b393a21d4a4c6fb4bf680 commit 7125ea0f154bd5675c9b393a21d4a4c6fb4bf680 Author: Gordon Bergling AuthorDate: 2021-11-19 18:50:56 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:42:33 +0000 firewire(4): Fix a typo in a source code comment - s/unavailabe/unavailable/ (cherry picked from commit 3e5ddef0fd391049f378456e10a0cea015652bc0) --- sys/dev/firewire/sbp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/firewire/sbp.h b/sys/dev/firewire/sbp.h index 93ad991e3a76..f50723556763 100644 --- a/sys/dev/firewire/sbp.h +++ b/sys/dev/firewire/sbp.h @@ -126,7 +126,7 @@ struct sbp_status { #define STATUS_LUR 5 /* 6: Maximum payload too small */ /* 7: Reserved for future standardization */ -/* 8: Resource unavailabe */ +/* 8: Resource unavailable */ #define STATUS_RES_UNAVAIL 8 /* 9: Function Rejected */ /* 10: Login ID not recognized */ From nobody Sun Nov 28 11:43:51 2021 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 986E118AF348; Sun, 28 Nov 2021 11:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267r1M0kz4gx7; Sun, 28 Nov 2021 11:43:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E07B763F2; Sun, 28 Nov 2021 11:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhpWC026342; Sun, 28 Nov 2021 11:43:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhpTM026341; Sun, 28 Nov 2021 11:43:51 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:51 GMT Message-Id: <202111281143.1ASBhpTM026341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 18e627e9c753 - stable/13 - ppbus(4): Fix a typo in source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 18e627e9c753684d6543f492c4d05caa282aaa56 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bo/hyK3q9EnketJk8KnlGVfO2VlKath8eY//GNX0BV4=; b=NqnXrQqG+ZxBbnBqeQdTDFKoCJzoMHAA/8CYOFd06lw1T0P4LCx0JANedfFd7+BmTldgtq Ef5eLk2+lDPh6CuSTrLV3AVQfSMz7tHNdmD/STd+9QWlxVzD63nAz12iDU32+JMFBPHM4S lFEYg8Dg+wM4t6syzVQYUP8oZdtsMX4L8uJYMhxpo+FJJ04cTYEzwz9qSM4gVwvk3tXXtW OPszjXo6Hi1fN6u5jUgDeW8aXYYjRIM1VKTCPB48NA/3tUgfvZQh1W9SPC/QyoSa+q7MlM V7rVRNTchX52Cr7FMh5bYE02IYfw1lNEbwIjs9EKy33JDNdk6+ZJFsXsfFv9HQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099832; a=rsa-sha256; cv=none; b=e66qXEpYC393aWtHJWXe/Q99htrTi+EQL4SXGge4fduWbNZfneaOmkjHDzVNueqfQtDagF Hm6fllH7Q65ZphbETU/3LIc0DvlikH/x+wZelw0hgJzHWqI6KTxMJidsMnQMOWSBbzM+Fq 6E3elXpOG/QA12emdrP8/A5Ut4U8+AASChYWP4mhcOUuwfelIX3WX8KoOxvhhIV7Qn8HBc twbnCtGB75k4T/++YJNiWW47UpjhkmXrZDmgtUYMlF3uMuGzzDrPyQg8aFz1zQrZ8av+Rz 2VKZ4wRbl0F/CRSZMvGMjH7IcpjaZbq3dVhtAPNt5J+ereOqHQarMFQjzeKRpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=18e627e9c753684d6543f492c4d05caa282aaa56 commit 18e627e9c753684d6543f492c4d05caa282aaa56 Author: Gordon Bergling AuthorDate: 2021-11-19 18:19:36 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:43:11 +0000 ppbus(4): Fix a typo in source code comment - s/quering/querying/ Obtained from: NetBSD (cherry picked from commit 975e2e3f84b0b7425185c9bb43722da779e8cd98) --- sys/dev/ppbus/ppb_1284.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ppbus/ppb_1284.c b/sys/dev/ppbus/ppb_1284.c index 5752e4599a8d..52dfb27931ed 100644 --- a/sys/dev/ppbus/ppb_1284.c +++ b/sys/dev/ppbus/ppb_1284.c @@ -737,7 +737,7 @@ ppb_1284_negociate(device_t bus, int mode, int options) goto error; } - /* Event 7 - quering result consider nACK not to misunderstand + /* Event 7 - querying result consider nACK not to misunderstand * a remote computer terminate sequence */ if (options & PPB_EXTENSIBILITY_LINK) { /* XXX not fully supported yet */ From nobody Sun Nov 28 11:43:50 2021 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 8EBAB18AF2B8; Sun, 28 Nov 2021 11:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267q0Nm2z4grb; Sun, 28 Nov 2021 11:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAB1363F0; Sun, 28 Nov 2021 11:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhoJE026318; Sun, 28 Nov 2021 11:43:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhonw026317; Sun, 28 Nov 2021 11:43:50 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:50 GMT Message-Id: <202111281143.1ASBhonw026317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 43c4228c970b - stable/13 - lpr(1): Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 43c4228c970b07ec1280a0e43783fb12e4296fa7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zxYjnnVNQrAskHohbkusEz84jFTwrje5me9xhlF5es0=; b=XrVHB9dwsEXtjJaCHL32jkUlWhQXy2Cfz4g75Tz1dIGdfEXOG6NWWud1Aqne32J4N+pBau CgB4PGMijx6EAgIXiLPc+1nHaPGmwgp1eEUFg5W5W6da5RN7mBfVqh192l5YBbit2n5VrR FMgFwLY8swUBw0SnpnECsOIl21H5oIX/GJ4ffzjIZANeakoTcFfEO/VudzXhS5ttrMTZ6b Ch4AglFty0G7C7Ocw21QoRz3r8PmjCFoWL0AM+JNlNU/Vxd9MUqAhc1lg15RVSOtQSorr3 ORJKDt3EH8BBdTxDhd+hO0psnGg2qoi+3AnkA+7LI+ZYfSfeDE83O+VU7skosA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099831; a=rsa-sha256; cv=none; b=VTQei3xj5bnWoV0A7ME4VxzJ275XlKjWoT3+dBaPV+BNX96pWMN7ZNMq7K92m5MbUR/RYR t4UQ/n0hUgmi7FXBgvUJnpga57V7Pm3P/n1ZHFX0W382zEHfKASR351bGXUqzr9ujZux8o lqABo4uhYlMR3kxgdUJMTVvl4i9LCMwC1+3TovRdiHCCpHkfaUXB/WoRfD1hFSJgLmokBl JC1Z6I51Z8JCiFKvoo1yKIqzX2jGQxKcUMSCOd+GP3dLldgmm9fShslLF9VqtpaUE3c2y8 xM7tasG53G8oGWKdt42hennLSfuV+E5eg0Wn7i1tRXkdi9YE/4gcWF+vroS3Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=43c4228c970b07ec1280a0e43783fb12e4296fa7 commit 43c4228c970b07ec1280a0e43783fb12e4296fa7 Author: Gordon Bergling AuthorDate: 2021-11-19 19:04:09 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:42:53 +0000 lpr(1): Fix a typo in a source code comment -s /debuging/debugging/ (cherry picked from commit 840d72371bdc48be58152c839160c492bef7f1b7) --- usr.sbin/lpr/common_source/ctlinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/common_source/ctlinfo.c b/usr.sbin/lpr/common_source/ctlinfo.c index d1f828e5ed99..15fed7bc32ef 100644 --- a/usr.sbin/lpr/common_source/ctlinfo.c +++ b/usr.sbin/lpr/common_source/ctlinfo.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); */ /* - * Some define's useful for debuging. + * Some define's useful for debugging. * TRIGGERTEST_FNAME and DEBUGREADCF_FNAME, allow us to do testing on * a per-spool-directory basis. */ From nobody Sun Nov 28 11:43:52 2021 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 0598718AF1CB; Sun, 28 Nov 2021 11:43:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J267s2w44z4h0R; Sun, 28 Nov 2021 11:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A41163F3; Sun, 28 Nov 2021 11:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBhris026366; Sun, 28 Nov 2021 11:43:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBhqlB026365; Sun, 28 Nov 2021 11:43:52 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:43:52 GMT Message-Id: <202111281143.1ASBhqlB026365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 654f47cfc0a6 - stable/13 - ffs_softdep: Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 654f47cfc0a64c86241a4d1f7a2a53a3829ecbfa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638099833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1ybxtQqE0iVmH6lwyAGSBMMlihVhaagt/Nz3SEnNXIE=; b=AeOKdrBBI9yC9m1U2F4RZr9LK3s/iiBOFWGXdKKtJoJ73BK/kPLpBNiml9goAZUcprDx5/ FyJdGYBSsYhyOa/th6du8aCznjVDSHf9jXufExYzj45MO2kJ6qGm4uluBDR0Kt53Dw+yGY 0P7xOW8pX/XRBOulbNI2ubrDB8p22neNmHa0SPVLGFKQH3HvoTB1dMkaNBIqNwY6mLd/bZ r5lqotafi7+rUKQnF9QYy6K5/uDmhvMYnKMMQ4p3uPJP+8a+be+OPji/qh0fLTt+QlMwFk xJxBQ2TU+HDHkmz/pA2aa6wnDa6iNrR3xrWSRrV5ty+RJXbyHSQ2RLzbzTZwRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638099833; a=rsa-sha256; cv=none; b=a8zYMpXq8zeCqcmGynGs/7CpCB544y1cVFwt2CtdB+vnRqPKa6XTjdqj6hmilarkRAY6im VDWi5pQlXYbY8l2tx5ISkLQwaQpjRRSwi6HzgQybp0w/PQfZ/61okQCwT0b04Nk+zYiYLn P7k59uVSoUa6YCwhuNVrLuk0+NLnnVWbmCEsdFVexTf4s6CAYI1++G5d+N2gydJtAVGd5b 6JaLGMAZD1TyS4wLZNm+JW7seeEYh91Lm6VQ40fIbMcwyinIIvaPgL9wcvPuzjUOvhz1sh Gjvon2GxjFMtNserOhxcbUVqapMN/tIemN9MF0wJ36yyoVrho7TTsvLQT4UWpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=654f47cfc0a64c86241a4d1f7a2a53a3829ecbfa commit 654f47cfc0a64c86241a4d1f7a2a53a3829ecbfa Author: Gordon Bergling AuthorDate: 2021-11-19 18:17:41 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:43:32 +0000 ffs_softdep: Fix a typo in a source code comment - s/conditonally/conditionally/ (cherry picked from commit bebff615877efdf549e5033b47ade4d8553f6a77) --- sys/ufs/ffs/ffs_softdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 0d2de850bd3e..8bc5e409cf04 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -9196,7 +9196,7 @@ complete_diradd(dap) /* * Cancel a diradd when a dirrem overlaps with it. We must cancel the journal - * add entries and conditonally journal the remove. + * add entries and conditionally journal the remove. */ static void cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref) From nobody Sun Nov 28 11:48:14 2021 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 A900718B37DA; Sun, 28 Nov 2021 11:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J26Dt2V70z4lDn; Sun, 28 Nov 2021 11:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 362A863F5; Sun, 28 Nov 2021 11:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBmEJh026910; Sun, 28 Nov 2021 11:48:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBmEPG026909; Sun, 28 Nov 2021 11:48:14 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:48:14 GMT Message-Id: <202111281148.1ASBmEPG026909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 27e280d90d22 - stable/12 - ffs_softdep: Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 27e280d90d227e6fbc78879f3128e417f8c3cf96 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638100094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kjgUIAKFNpHo4qX9Xb3TwpPFNX0uX2BWRXcjCSsyqI8=; b=RK8OAXKeWxymXBrVjmChGExKdF7/9VxU+wGe7kyH1j36/VabCN4RTf2SboTMx/17rbIYEU GaQE3ZdJv0azrBJHvFxgEiWwzIXzXVjRnWp8y4RrmCef8fJfNOrXSfah1TuQEQcnDT8sHz 5z/1fqAVjXEz8zSBewt5rYDTGTdBz3ZDLrgU44oQsEjH1Kq5HztA088p7jaRWg/kUedMQ4 hpa3OHA03ex3K3kHCrkmbGlfKAYdRrZfUolv+MLu4mior28f/CFOqlUIP/WOkkmk6XUmB1 foK8aPSOoJgsPy1rJeY2kKvIc40mUjNiZSN2mElV+GVrnGNymSa8WW6BDwI73w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638100094; a=rsa-sha256; cv=none; b=fr7r1eQf3adg+XGowvClxKsvDYAGhUI3vKLzizKSoNREIPAk53myy/ae9FfeUSjsaXnqJ+ O7th3tKXX5iO2KszMGm2dKc7oPQZCwYgVGcNN5EYTN48TtTK6nq4V8JvYezBKPxzslUqMF OICYmjGUsXEbtRCMvq5vfRBcg6NbiLSpVI5kCuumCgmbd92ntPFzSqfDQL4rx51gjOJjIp 2y2qA1wdJ7/SuHrfn2K+HytqI+x1Q6vQm6IBHvLsTLXSjXuixah1MumcDybxdZJTzNvpip tmWPvxJhlJEdVLHwD1yCiSnBg01RET7bEvXKoytKAXZQckzCn6TqTo7vooSLVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=27e280d90d227e6fbc78879f3128e417f8c3cf96 commit 27e280d90d227e6fbc78879f3128e417f8c3cf96 Author: Gordon Bergling AuthorDate: 2021-11-19 18:17:41 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:44:45 +0000 ffs_softdep: Fix a typo in a source code comment - s/conditonally/conditionally/ (cherry picked from commit bebff615877efdf549e5033b47ade4d8553f6a77) --- sys/ufs/ffs/ffs_softdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index bc83b92ee384..dc9c507ac11c 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -8804,7 +8804,7 @@ complete_diradd(dap) /* * Cancel a diradd when a dirrem overlaps with it. We must cancel the journal - * add entries and conditonally journal the remove. + * add entries and conditionally journal the remove. */ static void cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref) From nobody Sun Nov 28 11:48:15 2021 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 421AE18B3924; Sun, 28 Nov 2021 11:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J26Dv4NSHz4lV4; Sun, 28 Nov 2021 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60D5A647D; Sun, 28 Nov 2021 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBmFsD026936; Sun, 28 Nov 2021 11:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBmFZF026935; Sun, 28 Nov 2021 11:48:15 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:48:15 GMT Message-Id: <202111281148.1ASBmFZF026935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: fb93bffd8ab5 - stable/12 - ppbus(4): Fix a typo in source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fb93bffd8ab5db20049177665275ca6591a8869b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638100095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sEmypE1QCa+QhfX9f7uWlGOqWmQby+zGVmvRhMwNXyA=; b=d6IKPLnREEuQsPm2ueQH5JZk0DSnWPrvl1fWPqxaldsa+mnZD5Jp81/WBwdPQGwy5LFPyV ZP37nqVh+2l7BVPOeAarHBzGt5/QtobdrJjlXwShnIajBc7cgvegjNe9EC543doeX0Pfcy Osoq4Hy5jwb9xRTO+TQURfyK5lNlB8DmgTOXnBZSk7K24Z2ln2SDDcgHgp6D7Bym21a7nD gGnENfgd5scwk2DEbXEYzljpHfGHSWdGWSLpoc/gy/GpIgCuCrmgRcs1Kue44sjuU0wDh6 9CZGKAB+Xp5NIhnZsS4G48ZZfkJVq4HV+lBoMfXxVBuYkkUrBnhoS2b50hvfSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638100095; a=rsa-sha256; cv=none; b=ncQbfli5KRlvqEVQuE4zQCfljc1X25pkW2Qvu9SeMvd06Uh29x7wikN3rvpGd+A/sSl1Hj xEkCiKyg6FCAqMaJ8Eztw2Jecu+J33aTQweqaSK9AfBtBu5axJgfcDdLc0NQ4NeqcYnj7f yIaHwsmllXujgO/llkOAaDeerMtATuOv1pKJ/+lkKgaAPAvXtxruDG32uZ1g8nQjiEryrM ZVFDnPwS9OMrY1ksTq+FgnT0P4AJIWF4Bk7TMoTTTCGG+tSUNTZGuDx7aEuuKU4ygksFML XTur7zZ+iAgpdAxCp0q6e128Pf5q7EeAeh6jPUZez640JIeS4RHPtRtw71+q2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fb93bffd8ab5db20049177665275ca6591a8869b commit fb93bffd8ab5db20049177665275ca6591a8869b Author: Gordon Bergling AuthorDate: 2021-11-19 18:19:36 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:45:05 +0000 ppbus(4): Fix a typo in source code comment - s/quering/querying/ Obtained from: NetBSD (cherry picked from commit 975e2e3f84b0b7425185c9bb43722da779e8cd98) --- sys/dev/ppbus/ppb_1284.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ppbus/ppb_1284.c b/sys/dev/ppbus/ppb_1284.c index cd46b36c5473..c16b90e7289a 100644 --- a/sys/dev/ppbus/ppb_1284.c +++ b/sys/dev/ppbus/ppb_1284.c @@ -741,7 +741,7 @@ ppb_1284_negociate(device_t bus, int mode, int options) goto error; } - /* Event 7 - quering result consider nACK not to misunderstand + /* Event 7 - querying result consider nACK not to misunderstand * a remote computer terminate sequence */ if (options & PPB_EXTENSIBILITY_LINK) { From nobody Sun Nov 28 11:48:16 2021 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 74AFC18B3A9E; Sun, 28 Nov 2021 11:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J26Dx081Zz4lGx; Sun, 28 Nov 2021 11:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DBC26749; Sun, 28 Nov 2021 11:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBmGuK026971; Sun, 28 Nov 2021 11:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBmGrv026970; Sun, 28 Nov 2021 11:48:16 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:48:16 GMT Message-Id: <202111281148.1ASBmGrv026970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 09a5ae5dec01 - stable/12 - lpr(1): Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 09a5ae5dec010c13ba4cdf7bb9af96268d07de0c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638100097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Je/C1PDeAULqTRKoocaTt+3ewQ9+dCpaMF1JF25FKsc=; b=KL3yTD9pWI7TEqOirpf4yOIIYz0pse1kW+TodffAUwDtKBzKDK11gNDbBUcEoGpEy5g8sU Rt20P0pJHQzAazgCQlXJB2tgXMkmmcqbwm3/Ckj8M7Kjtn8bCsH0rAqN9yPOQwoHBsqAxq fYg3A81c7M3GT+MNgMfebLCwmWoDPOii3F8OPJk13e6n0XSYFClxHFYuozT6yGyI+glrIM o7mjQ/x9ZVRN1tNktdg4p/+Fv8BHI8UquESPlPwy2DjJPe1Lmpdzx+Mmd/cEWqLLUNI+RP 2ehpzdhom6hQb6JZ96RQPkqOCh0NbyrupzoSmfltx+1kHp6C0XwHNwsaY95XOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638100097; a=rsa-sha256; cv=none; b=DO6Gy9pUSPu3T0LFfuTLSrM3lxB0eHbS0jderGDFuBWcZOjyOUBUwR0aTKkCsMWGUm0ENh s6yR5d4YdbUbOr1b4VGiq/j/pGdfcy+3de+OoAyUPzxQGUnxtfUHjNjM7Al8GQPg7hvnxI HKoDOvG4fQV5U9o46EXxbDUJc1wKClsH5ciph/bIUoMdfwT9N+vQsWpK12VhrFMN8FoZoc o+GqjPoi7V/DXfmYWJv5toKdVUtMcGOrgIJ1TES1jHCQkM58GOCpwmd7UxI1+qtdOX4oIe VKpjuZFLuETrjUayv3ci2dbHdB4w5ULRi2/v1nRddNTQwSpdtq4B62b9StUF9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=09a5ae5dec010c13ba4cdf7bb9af96268d07de0c commit 09a5ae5dec010c13ba4cdf7bb9af96268d07de0c Author: Gordon Bergling AuthorDate: 2021-11-19 19:04:09 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:45:48 +0000 lpr(1): Fix a typo in a source code comment -s /debuging/debugging/ (cherry picked from commit 840d72371bdc48be58152c839160c492bef7f1b7) --- usr.sbin/lpr/common_source/ctlinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/common_source/ctlinfo.c b/usr.sbin/lpr/common_source/ctlinfo.c index d1f828e5ed99..15fed7bc32ef 100644 --- a/usr.sbin/lpr/common_source/ctlinfo.c +++ b/usr.sbin/lpr/common_source/ctlinfo.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); */ /* - * Some define's useful for debuging. + * Some define's useful for debugging. * TRIGGERTEST_FNAME and DEBUGREADCF_FNAME, allow us to do testing on * a per-spool-directory basis. */ From nobody Sun Nov 28 11:48:17 2021 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 7485118B39F2; Sun, 28 Nov 2021 11:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J26Dy1bRgz4lH0; Sun, 28 Nov 2021 11:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0AB76889; Sun, 28 Nov 2021 11:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBmH2Y027000; Sun, 28 Nov 2021 11:48:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBmHvp026999; Sun, 28 Nov 2021 11:48:17 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:48:17 GMT Message-Id: <202111281148.1ASBmHvp026999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: c7b5149d47ac - stable/12 - firewire(4): Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c7b5149d47ac81545c23aee8ec13db8b75bc0a2e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638100098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxzzw6q9/ZzN8og5NxlI5puU1GEqvAdMlVV66Nu9DMU=; b=Uws6+pvgp6rKR9k0BRUs+GysRhc917aX2DenvRvQpmT4wbFiJqdgbWaMij1PDJV/5OK9Jd EZuiQRLedeHJ/oHkGnumje48UrsMSU7D5ayLY14TtX9okOziIWdFI7yaGZHbL/X0bXuQhm besNjV7B9L5aLEyZsZ2fs+jIVOxtPuQ5hFcSMQ/R6WgF3IuwDg1AnD8K4BjCVfDZto4MGB GUCIm+/XNpkI4iMU+FIiK+ufx6Bs32Vm0gLKGWBQcAiMvcCAVOqzXzKk4P7zg4v7V/pjyL d8lTxZTh3swGmKnQ8rHj5Iu4PN588PyFj/u4i+AU5v+TnFhVkpk2/laFQZ3wdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638100098; a=rsa-sha256; cv=none; b=fMQHOlspBTSR2Edcdweu38uvNHC6OK/Ii4p+X+RcKNLi/ftItZYj8mMoE0DFQqFU55+OqM 172WfE3SZUYBN10cq8JzyDiODtLwdR6SLFN5uK7Pcqk6xX3rXKY9WkOvC3KTWZap1MycxZ yFhWRpA59zP+rmyoPbKQiJ89Bq34CrcetVvPbBFmC5JiauuxsPtBLW7WJw2LYoM6wg9NIQ rZxle+hbmP/ZVJI2KWMfY+p6S1ncQ03zlaSvk9ileZmQ0aa5V7c95Pq+vq+e/K4lKB1Co+ O3a+VQRjEwngZseXj0xQcIRP1OlMhWuddJLISAqfShItJoPQHuphOPTWZ6oX4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c7b5149d47ac81545c23aee8ec13db8b75bc0a2e commit c7b5149d47ac81545c23aee8ec13db8b75bc0a2e Author: Gordon Bergling AuthorDate: 2021-11-19 18:50:56 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:46:15 +0000 firewire(4): Fix a typo in a source code comment - s/unavailabe/unavailable/ (cherry picked from commit 3e5ddef0fd391049f378456e10a0cea015652bc0) --- sys/dev/firewire/sbp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/firewire/sbp.h b/sys/dev/firewire/sbp.h index 93ad991e3a76..f50723556763 100644 --- a/sys/dev/firewire/sbp.h +++ b/sys/dev/firewire/sbp.h @@ -126,7 +126,7 @@ struct sbp_status { #define STATUS_LUR 5 /* 6: Maximum payload too small */ /* 7: Reserved for future standardization */ -/* 8: Resource unavailabe */ +/* 8: Resource unavailable */ #define STATUS_RES_UNAVAIL 8 /* 9: Function Rejected */ /* 10: Login ID not recognized */ From nobody Sun Nov 28 11:48:18 2021 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 1B70E18B3956; Sun, 28 Nov 2021 11:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J26Dy6p0Xz4lBG; Sun, 28 Nov 2021 11:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3E84674A; Sun, 28 Nov 2021 11:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBmIP3027035; Sun, 28 Nov 2021 11:48:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBmIDQ027034; Sun, 28 Nov 2021 11:48:18 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:48:18 GMT Message-Id: <202111281148.1ASBmIDQ027034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 7ab9bcc23db0 - stable/12 - ixl(4): Fix a typo in a sysctl description 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7ab9bcc23db09aaa895b0e3fa65f134cf38d9504 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638100099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QHpUaRYTUkcbXwZvbJFlVpXAGtcwm0N4ifviK4KMDgA=; b=wLSORp/6YLaEFkVfBaKjjBJ9wdOR0WFnk1FRXajZNus2FhTqDgywv3lL7FJ6GcYhBdwroK UB329k2WySvh9bd0p/lfC7g5DZT/gKK8NQa5BOYcV5PHDEYRsfzRbpHErpq3UnQFbP1Woq II37THk5VNpdAResujRSt21WdLZFspKuJOf9kjrSJbG3zgR6lanZL/+0GmgcfI6WPyRtjm U+VwXvtuxd7iBNcaKn4t/aaoqmScxwzs1wKvctZBcSSP6qsp3nOQoqdaPx0ctC6qDBUjWl RovKERFpInL/Pd+gEoK6MPEME3yLfrvFHgr8xocCV0uwOgmZ5TwGuk2AbRZzCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638100099; a=rsa-sha256; cv=none; b=s7kQFvDSfRltBazzSXSkxDHNXxnDn3Pd7f7S3pEgCOKfpA6OIWKUgJ0xe//zeg8NnU2NwG 5JVGk3x4fj6dveUykgkVMcxFZd0ZUT5NWYlre+FuvOzjq8BrwT2BJYR6XXcqhVjK32bPsn ld6Ee4RnDPybydadFenGtRr31hN3UQsLSE6w/czsk5rCZxeHPBetBNuTGUOB9ylkiMgI8U dZUd3XSesaZuzE4flytMy7qmWVPKhZ8iMCrjtf4MI2ODDA31xVVz4Ia/9+FyC+R9pdua+U o1dcDIAIi+JcdsvG9Y9c7SauWMvJSNLW/0R0Cf9j1f8pWUVvDNQerN7xjdka0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7ab9bcc23db09aaa895b0e3fa65f134cf38d9504 commit 7ab9bcc23db09aaa895b0e3fa65f134cf38d9504 Author: Gordon Bergling AuthorDate: 2021-11-19 18:59:28 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:46:36 +0000 ixl(4): Fix a typo in a sysctl description (cherry picked from commit d7125850f031f8e763ff35c70fda310a1419b876) --- sys/dev/ixl/if_ixl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 52c9dd293e6b..dc0163a44dfb 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -236,7 +236,7 @@ TUNABLE_INT("hw.ixl.debug_recovery_mode", &ixl_debug_recovery_mode); SYSCTL_INT(_hw_ixl, OID_AUTO, debug_recovery_mode, CTLFLAG_RDTUN, &ixl_debug_recovery_mode, 0, - "Act like when FW entered recovery mode (for debuging)"); + "Act like when FW entered recovery mode (for debugging)"); #endif static int ixl_i2c_access_method = 0; From nobody Sun Nov 28 11:48:20 2021 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 E141618B3D16; Sun, 28 Nov 2021 11:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J26F25qjWz4lMR; Sun, 28 Nov 2021 11:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 079B463F7; Sun, 28 Nov 2021 11:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBmKwq027192; Sun, 28 Nov 2021 11:48:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBmKqL027191; Sun, 28 Nov 2021 11:48:20 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:48:20 GMT Message-Id: <202111281148.1ASBmKqL027191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: df533f4a54d4 - stable/12 - TWL: Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: df533f4a54d471bd26916728d5929a535c68ed46 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638100103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fm7EExttt3RE9F5q/hcY26e4g72qgtypzNiLVgihBhc=; b=O/8Mt6kfkfx88vfHbqbM7nHVXz7Eq+avuwipSDdxmGcG3ZzSwvhuXAzmPoOVlq+Ghf0Sme 7j0wO8Bt6uNqaS1UTS+xaNWp5MIJQQ/0WiuD/xr6v8PkIpBBARPSyZL/8UJguzZff5Reu/ PCO/nraVgXAXMOb9uh7e+jktqRTfr+x+sls0z+U/KXjqJIDhsOUrWIs+mKallYpArAQ+4k hQeFRLSV0vGwKyVyh/aG6cRvlfJ13FxRRCV02F9WpZkTQh8c4/QMcSHHB1vzajyh2p7iOX c+VZLS2dsuH08GSpYABpUOvjpUGkmTvdFdIaFtw5LbfVJR24KAS4FsPhNhTzUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638100103; a=rsa-sha256; cv=none; b=x0yZkRqWqBJ6AOw8OiWw5iYIQXrWthY2oyD4/YjQxQj0ibfxqOfqQcAGVUvBkLe3uk07QU GwEAxWgvzirAmYJy8C9z2B0/884zTe5Jh/55lBooVBY3pZr4iw8kEYiPF5xJ1JgRreN8aI 2y1bDk0CJsrQOzT+7HpytbjwLR5H7O2iD+OuWQGhmT2/gp6Dy8f4+ViRVooOGUogwjCY7i PuIUNizBD690OnEsa3Pq0YLynQT8L1OVi4S/rZ4WEz4dXAJ0QgIeXdSzix2YS0BRgDkf1h uKDhyG2gharJ5lTMvTKNg5N8bt1dvre+q0SEzWVJeHuoOIH4wxZYS+tT3bSfmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=df533f4a54d471bd26916728d5929a535c68ed46 commit df533f4a54d471bd26916728d5929a535c68ed46 Author: Gordon Bergling AuthorDate: 2021-11-19 18:26:34 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:47:36 +0000 TWL: Fix a typo in a source code comment - s/maxium/maximum/ (cherry picked from commit 8b11850f9d04c096d8ed3647db512f8feceefaf4) --- sys/arm/ti/twl/twl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/ti/twl/twl.c b/sys/arm/ti/twl/twl.c index 50f2bd9ea513..b1438bf82b2c 100644 --- a/sys/arm/ti/twl/twl.c +++ b/sys/arm/ti/twl/twl.c @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); /* Each TWL device typically has more than one I2C address */ #define TWL_MAX_SUBADDRS 4 -/* The maxium number of bytes that can be written in one call */ +/* The maximum number of bytes that can be written in one call */ #define TWL_MAX_IIC_DATA_SIZE 63 /* The TWL devices typically use 4 I2C address for the different internal From nobody Sun Nov 28 11:48:19 2021 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 5CA4118B3AF6; Sun, 28 Nov 2021 11:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J26F05vVlz4lXL; Sun, 28 Nov 2021 11:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDB4563F6; Sun, 28 Nov 2021 11:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASBmJBQ027145; Sun, 28 Nov 2021 11:48:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASBmJ7O027144; Sun, 28 Nov 2021 11:48:19 GMT (envelope-from git) Date: Sun, 28 Nov 2021 11:48:19 GMT Message-Id: <202111281148.1ASBmJ7O027144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 143b0e9b16c9 - stable/12 - iscsi(4): Fix a typo in a source code comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 143b0e9b16c999430ce5f3c156cc6ebfa9ccbc50 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638100101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=85wxUgK7Fp4zNyxl1DKmSlXU+LsfvLOWFHa6y0lBRig=; b=mW4q7ntDRYptAqhlPy0Vtq6a8lzCMHZWoCE2+PmrHASJdI9XM5ERTf4L4NlpnA0AaZrezj kk7CoD1O3jjMbCuYEHjwbbiyRI4lg0GnslizwkRp6HwEDrG8uGAOTUb5JJpQslYbTlwUhM PElqhQQLnpdphklmtssu8LaBbaAe2bItMYfi8hw4yWEuAIlq/Yv97EJO4rVpDr7GPjBjZw Tae5XnBIG+vcOL0p1HES2nR7aCl7xWs9+6EDxa0Up791ZBOCRLeWcHefXIqvskMgLNB2hZ HFSrluQ/AgKAZ4c9TBBJLalXKwJje448eHj090yvADMssf6+kPN8UuHFQ7qToQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638100101; a=rsa-sha256; cv=none; b=vHkQQI892q7YWJhakR1DHc8ds2vbEh4i6iEig3qOEIYLc4UT42HziV/brwxCyIwMFiv1Cw iDupNcdP7SbQeyFjMpKpm1YIPrVHOu+gy6BS8UdmBktcefJcXaW2A5+NHyLded0f/+YE2U Q1pXvdzrFsx4dr7rlEVPip5dIy+woNyMk2pD/4bHlO47KLVydIaLbRFD6V9SKoyKw1dcmw CSaEdPVSWwwIVK8VEKSY2VamQWSw1YilDDGail4E+INUPiT765ObE2eGHACKSwSf7u8Hpv dTRjOiX7YNS8X+mSRDJoY2J8C92SlzQOvuOlGpGjlK5eIAUwU0uQzVFCXLgqgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=143b0e9b16c999430ce5f3c156cc6ebfa9ccbc50 commit 143b0e9b16c999430ce5f3c156cc6ebfa9ccbc50 Author: Gordon Bergling AuthorDate: 2021-11-19 18:29:21 +0000 Commit: Gordon Bergling CommitDate: 2021-11-28 11:46:56 +0000 iscsi(4): Fix a typo in a source code comment - s/conditon/condition/ (cherry picked from commit 5e21882bb4e7d36ebcf0300234486a54ff4e7b13) --- sys/dev/isci/scil/scif_sas_design.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/isci/scil/scif_sas_design.h b/sys/dev/isci/scil/scif_sas_design.h index 1f2e8a851287..18c9e86e861d 100644 --- a/sys/dev/isci/scil/scif_sas_design.h +++ b/sys/dev/isci/scil/scif_sas_design.h @@ -334,7 +334,7 @@ Please refer to these files directly for further design information: The SCIF SAS SMP REMOTE DEVICE object represents the expander device and fulfills its SMP discover activities. The discover procedure includes a initial discover phase and a following SATA spinup_hold release phase, if there are expander attached -SATA device is discovered and in spinup_hold conditon. The SCIF SAS SMP REMOTE DEVICE +SATA device is discovered and in spinup_hold condition. The SCIF SAS SMP REMOTE DEVICE object also fulfills expander attached device Target Reset (Phy Control) activity. @image latex Discover Process.eps "SMP Discover Activity Diagram" width=10cm From nobody Sun Nov 28 16:42:10 2021 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 DB3DD18BA369; Sun, 28 Nov 2021 16:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2Dm24Dvlz3q0X; Sun, 28 Nov 2021 16:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72780127AE; Sun, 28 Nov 2021 16:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASGgAvM026197; Sun, 28 Nov 2021 16:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASGgAur026196; Sun, 28 Nov 2021 16:42:10 GMT (envelope-from git) Date: Sun, 28 Nov 2021 16:42:10 GMT Message-Id: <202111281642.1ASGgAur026196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 8fff4d48d881 - stable/12 - os-release.5: Fix quoting of dots 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8fff4d48d881cdba4e4be91e470a32be7f3861f7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638117730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yZQd9jg7kz31gtu6BkTfLFSTHcR5a4txsG8XcWtZ7q0=; b=O8zVCsHpK9OLMbq4RPZkVn/oaY1Ds8IjojDgzsBeuoh+LkUkYdx19RlDqwQDY9XxmGUxxB 6R6AMPIX6V2kyDO2Vot84skaTtuxLV7ilINTxO4otcSd79AZDH7nGmtlkj3W4J7zSVRrWr y2++MZsM3kGOIrq6s6H1wvv5EPFumukSZH/ylt5c+tS2eSg2aJrLHlVN7VzrZSILe4woLP 6eeEwtBihHIRNLyvExNY9mBbOj0oZvB2H19EWPlHsfHo69PRteas7ejhlG4zdPfatp6Zdv DaYpFcVtk/bXCqtPEL6vG8WcWW/heNRWcGPhHINEd5iuPGLpjjc+Ev/OZlGycw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638117730; a=rsa-sha256; cv=none; b=wRl0rhO4T+MkvBvVcdD0/y1Bsr7rw+uub7IxHAsCOh18u7kEswo/j/TL1PgM8kT0DyVJ2b A7d9inyAnLC4+n6SsvPAVXOVx1IeJYSrFPew99s/H7OngL9/YCYcMrWVcTd2t2nSVXopb1 iJwFEty/pBJO6hxZak26ceI/CK1FGGsdCkkhF4WDCFWd/RJsiFu0iOI0eT4v+Ktmo2rtzP nu07IG1FIYx89jbbk3P2isGHQDdpcIv8qIMfptPaJPbWO+9duHMbtZJG1eCI9T4r9onaP3 tzHwjUQ7/xW7zrHNZQtxFAbG+u8R9eS+EoU22jBIgNo6Yl6tnsVH87yMw7qIjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8fff4d48d881cdba4e4be91e470a32be7f3861f7 commit 8fff4d48d881cdba4e4be91e470a32be7f3861f7 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-23 10:34:44 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-28 16:42:01 +0000 os-release.5: Fix quoting of dots Dots needs to escaped with \& to be places inside Ql quotes. MFC after: 3 days (cherry picked from commit ee7485bef53df9108a20e497dac6341d030248ce) --- share/man/man5/os-release.5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man5/os-release.5 b/share/man/man5/os-release.5 index 0ad154859e3e..536e5079cd65 100644 --- a/share/man/man5/os-release.5 +++ b/share/man/man5/os-release.5 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2019 +.Dd November 23, 2021 .Dt OS-RELEASE 5 .Os .Sh NAME @@ -66,13 +66,13 @@ A string describing the preferred OS name. Version string for the OS, in its usual and customary format. .It Dv ID Lower case version of the name with only a-z, 0-9, -.Ql . , +.Ql \&. , .Ql - , and .Ql _ . .It Dv VERSION_ID Lower case version of the version with only a-z, 0-9, -.Ql . , +.Ql \&. , .Ql - , and .Ql _ . @@ -101,7 +101,7 @@ A string describing the variant of this operating system. This variable is optional. .It Dv VARIANT_ID Lower case version of the variant with only a-z, 0-9, -.Ql . , +.Ql \&. , .Ql - , and .Ql _ . From nobody Sun Nov 28 16:44:38 2021 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 0331E18BAEF8; Sun, 28 Nov 2021 16:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2Dpt52slz3qXK; Sun, 28 Nov 2021 16:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E80A1280F; Sun, 28 Nov 2021 16:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASGic6X026484; Sun, 28 Nov 2021 16:44:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASGicmj026483; Sun, 28 Nov 2021 16:44:38 GMT (envelope-from git) Date: Sun, 28 Nov 2021 16:44:38 GMT Message-Id: <202111281644.1ASGicmj026483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 98ddcae346db - stable/13 - os-release.5: Fix quoting of dots 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 98ddcae346db6c537b43fcec392a0eb84ee63f6f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638117878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1qdVHcRFOaQidHTGD4OCMW5kTM19Y1vhLCf9Or6nyk=; b=MGrs2lQzf4aYJqAxUiT4UrAVXavEfsR9abnxVMtx1CWJ+uGzkFf8h18p7UtGyAj41Nanmq J8xiKUQVWZHhhbCpLZU4cEkvU9PfJEjdv3JRcL67sqrsUKjinmAnUN5FCD0h3Yx3oXghEz goLqYcqTbjPyZiRNMbnlZ9aQv0QZN6X5d1yGn9fspdtK7avGVpimSmZi7p23fS9uKcZc4s VDxTOp30SIfc+xav4aHaiKm4sudUYrrCp+wezIo8bNL3bThY80grmq70Ua8CBcMJzsWAed 22sHFvYwMoKD3ZzFjHKOigC8YyyOirPLKM3Bz+R6/IbEFSQeiOg7U0+LsvoPWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638117878; a=rsa-sha256; cv=none; b=JXhgbAdivDdpVm1nFMBo8e5r7tltwA+Tiu5HTn9l3g5nm0hC/P/SZk64k1YipKKU2o2bNl EdDmeHW4hRajuad+VXSBwGcohbhskSM8hrG0PQsedZv4Z0GnyUseF1jRTnHdOoUv+lSu+K 45sbakAe2AFhlZB5+juRm7BXlhQK4mkQVVtK0mXdKiCVm3qZHFpDgXtKAXZqnKZEN9MZG+ EkMTOsSnu9Ov9R/p5UtXq2dgxg4daILjJIwbIAYInbV4Kj1ZcYAE7BvXRejbp/JXaNPmcu SxTQlgPRBXzmPfbR2m8xwyqf/vZ81jzeoZcpkzqKwIOhWjSYbtv0MdWM7uEhwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=98ddcae346db6c537b43fcec392a0eb84ee63f6f commit 98ddcae346db6c537b43fcec392a0eb84ee63f6f Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-23 10:34:44 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-28 16:42:37 +0000 os-release.5: Fix quoting of dots Dots needs to escaped with \& to be places inside Ql quotes. MFC after: 3 days (cherry picked from commit ee7485bef53df9108a20e497dac6341d030248ce) --- share/man/man5/os-release.5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man5/os-release.5 b/share/man/man5/os-release.5 index ab56e477cf3d..a16ca33112d0 100644 --- a/share/man/man5/os-release.5 +++ b/share/man/man5/os-release.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2019 +.Dd November 23, 2021 .Dt OS-RELEASE 5 .Os .Sh NAME @@ -67,13 +67,13 @@ A string describing the preferred OS name. Version string for the OS, in its usual and customary format. .It Dv ID Lower case version of the name with only a-z, 0-9, -.Ql . , +.Ql \&. , .Ql - , and .Ql _ . .It Dv VERSION_ID Lower case version of the version with only a-z, 0-9, -.Ql . , +.Ql \&. , .Ql - , and .Ql _ . @@ -102,7 +102,7 @@ A string describing the variant of this operating system. This variable is optional. .It Dv VARIANT_ID Lower case version of the variant with only a-z, 0-9, -.Ql . , +.Ql \&. , .Ql - , and .Ql _ . From nobody Sun Nov 28 16:46:22 2021 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 ACDC118BC746; Sun, 28 Nov 2021 16:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2Drt1lytz3rpx; Sun, 28 Nov 2021 16:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D8A1127C4; Sun, 28 Nov 2021 16:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASGkMYT026715; Sun, 28 Nov 2021 16:46:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASGkM45026714; Sun, 28 Nov 2021 16:46:22 GMT (envelope-from git) Date: Sun, 28 Nov 2021 16:46:22 GMT Message-Id: <202111281646.1ASGkM45026714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 900ca3c03a4e - stable/12 - style.Makefile.5: Do not require $FreeBSD$ SCM IDs 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 900ca3c03a4e06abc7bb645f594c5ff777fe0378 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638117982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FTnYjRm7mP23OfYEs/IMmJTH1ay7LLrwn4+WM/Sy0Zs=; b=vNp7f0zYs1X1EQo7gdC30MqKQKYAdLF+wtRJCVJ353QKqRXPi+RFjU4K79hpofIqcQYdUH Vl4iZWXmqslBTazjsRkmfE44DHNQPLXh30+ehbsnR6YMFU0BIXqGtLUImTwjk2jJscDgIl /UvugY+8W4S/a/RFSZHLRxPN+Vh8e1qC9kmYktWm5iLuOUpQCk5g7lzTyZVZl+v25ac7fM LRIhCsYxUQeFQ3tWYFqgcLlNs9X6m6lAv4FzRP6Tw/9I010x3rBC4FaONKdxfCqF0aA+2G S/7Eys4wbjZgVQKeFRHNQHZomzOEKskGbQDnTTvUIqgRuqf8GEF53TMBMZ2gbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638117982; a=rsa-sha256; cv=none; b=q5qKvtQqTTBif0Q6nXMtV4oY/tPu/2MealypO6mICKVegdrtO7boHAj7djfNNVP1741n5v /d24jqdiHIbebAwnyWpifQXBaLWN2pNwD6SLZRbjCL8ZbxfdCgyncsF1IbTSzJClhZbW4f rW4mqlhgm3INrI0XT2NOEOaXP5wDoXtCS+fZtRW8pOFUQJZRFOdfaC/kS9MVJar+npaO9G WILTV7PMlEcEtzVu0TDjAqOxreujZvDX6RDXrU9HWN9Hu6gYjcyGUQWsnlHPubpXpcArgs hkhiRq+z46m56g+RvQJcfHu+Xv/eL4L5MNzqLiSM9GN1nLDj2SN/yMkWQ3HZ1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=900ca3c03a4e06abc7bb645f594c5ff777fe0378 commit 900ca3c03a4e06abc7bb645f594c5ff777fe0378 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 21:00:30 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-28 16:45:54 +0000 style.Makefile.5: Do not require $FreeBSD$ SCM IDs It's no longer required to have those SCM IDs at the start of makefiles. MFC after: 3 days (cherry picked from commit 1ac5586c6d86134922e18871b270ca483c00bf8b) --- share/man/man5/style.Makefile.5 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index 5e34b968305b..e3f92242b640 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2015 +.Dd November 18, 2021 .Dt STYLE.MAKEFILE 5 .Os .Sh NAME @@ -42,13 +42,6 @@ This file specifies the preferred style for makefiles in the source tree. .Bl -bullet .It -All makefiles should have an SCM ID at the start of the file, -followed by a blank line. -.Bd -literal -# $FreeBSD\&$ - -.Ed -.It .Cm .PATH : comes next if needed, and is spelled .Dq Li ".PATH: " , From nobody Sun Nov 28 16:46:26 2021 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 A5E2D18BCA81; Sun, 28 Nov 2021 16:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2Dry5r6Sz3rYf; Sun, 28 Nov 2021 16:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C10412B04; Sun, 28 Nov 2021 16:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ASGkQJR026834; Sun, 28 Nov 2021 16:46:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ASGkQs9026833; Sun, 28 Nov 2021 16:46:26 GMT (envelope-from git) Date: Sun, 28 Nov 2021 16:46:26 GMT Message-Id: <202111281646.1ASGkQs9026833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2b890871f7d1 - stable/13 - style.Makefile.5: Do not require $FreeBSD$ SCM IDs 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b890871f7d196a16d7e4c4c4007095449948bcc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638117987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AUzNzbC3nBBulTPqOwIwKV55AGYoGYSVekar6x7DORI=; b=c6vM8AwU4LjD/kUIU6JSVUNqzlI65DDC5bQuH+d0M5166PfaBA5otef1iZ8oDVTju8aLJf vXD1OlN8adfC4PnxWKSxP4I9hI/BsavdW7uXmfP241/mhA08/dOsP29qQSJSUcv184XHX+ enZPkS0UFcmxifAxZETafT0gzJ8zbLE5aCOHSgO6cAc63xxSTi1YFfRKzP2eB4cC5I+ws2 p/ouD5wjd4r6sGzS8gOdeiGdI/3lqyn0W5+XOOMjfqHqE/o63u0PFabh9RzJQSx1JO1/Xo ta7yMwZlsv/kItI4KPioQQCM9L1WHYJHdI5yYjLZ/RTBUT8CgwzIrR+C3pJ7zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638117987; a=rsa-sha256; cv=none; b=OYX2izRsL2u/lTAHBXRPd9Gi5dPAWOE10+4bWDFiEHgHMamapX/AWOvc68NM6sy7FqYKiS XVZW6TjoAIXZUF/Gynd6E3Nke7SB5UzjadUNo8UHXFCtko7Q9+XR5JlMkqEZHqgazBl8ET ky+k4kTsslt4i2PABsX/rRe+NKiwcJ450KCuG59CuTgGB1A6FsHyBbZLLhjjbQqbHpdhnj keh+OuQbX5Ijn5NE575q22URTIMaX2TPuuUk9jJzXxi/4HHcHCylKcLEk/zCOfyVRcjJtn MQY0rzZI3q9k6MP1rSP7FWArdQqx8JbXhuaETAALLUxBSH9G0kutQtYLsCx+BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2b890871f7d196a16d7e4c4c4007095449948bcc commit 2b890871f7d196a16d7e4c4c4007095449948bcc Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-18 21:00:30 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-28 16:45:08 +0000 style.Makefile.5: Do not require $FreeBSD$ SCM IDs It's no longer required to have those SCM IDs at the start of makefiles. MFC after: 3 days (cherry picked from commit 1ac5586c6d86134922e18871b270ca483c00bf8b) --- share/man/man5/style.Makefile.5 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index 67991869ff57..4ced85704640 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2020 +.Dd November 18, 2021 .Dt STYLE.MAKEFILE 5 .Os .Sh NAME @@ -42,13 +42,6 @@ This file specifies the preferred style for makefiles in the source tree. .Bl -bullet .It -All makefiles should have an SCM ID at the start of the file, -followed by a blank line. -.Bd -literal -# $FreeBSD\&$ - -.Ed -.It .Cm .PATH : comes next if needed, and is spelled .Dq Li ".PATH: " , From nobody Mon Nov 29 00:08:29 2021 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 20A7B18C616A; Mon, 29 Nov 2021 00:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2Qg150Vcz3Bs5; Mon, 29 Nov 2021 00:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85E1A1886D; Mon, 29 Nov 2021 00:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AT08T7s015503; Mon, 29 Nov 2021 00:08:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AT08T2G015502; Mon, 29 Nov 2021 00:08:29 GMT (envelope-from git) Date: Mon, 29 Nov 2021 00:08:29 GMT Message-Id: <202111290008.1AT08T2G015502@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: b61ed468809f - stable/13 - nfsstat: Add output for counts of new RPCs to the "-E" option 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: b61ed468809f953adb2f885e1ec29f500c608087 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638144509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2QRZbc2ObT9Q4H5eZUrriuuppmzv+fr/Iv5y5BnGoLc=; b=j4Cycekl1HE67w1zT0qRW54w7Lk+R7OT2yvpZaGqs5U85IOeFjDGmUjU9FjeGUil5+Janw wmIbBJk8Mc/rh0Vm8hzB2kzPPIbaUBP3On5OXGxdddrP9li6FGLhoT+Z+h+ETq2k6PnpyB BjVXOcf63DYzsN3sqgLrzMkXfiAFrBXcryiqIj8jAb66rRmps02NdpI6q+kHxfFHixVuJx BPP2bF5dbvGrLcCwxTtNsu4GCMJXv0QJKnd/393Chas3AxsplXVSVcVqXK15glurY+Jmr5 VYamOpE4hheB1FeyD8jEQSTo3qmADXO2yeiFJ6bJ3L+C8gR3QKrJ0M1Lf2texw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638144509; a=rsa-sha256; cv=none; b=rqljJ1sqbl1kQp0vfAAaj3gjKV4PAdR4S6HnWYbTRLAbtgBVcS+9qUfBxHQZqAxR/x9WD6 3+NmuAoJb6Rb+48vRbR/aWE3Z+yldDtMmTwkNlVktSowT4BuCERJ1EkwErM0B+/+HhyxT0 3E0sm2o3NMkgHNXJrbfK8msRDQjiHSLaTmaOy0CzjeZghIab9E8vmrkp38c0z6RpUskn8a JWl/oQH0nDx+mdSjYcWrBOKzjkE21ajUogFivVBsAzE1LEc3HDJ6XrpJDrYLyTuw2iPW0w U0VOpTElPK8kLpV9ltoznWN83aG9Yr8zhANoTjZ7mtC0QiYGI5bW/4KBXqWIXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b61ed468809f953adb2f885e1ec29f500c608087 commit b61ed468809f953adb2f885e1ec29f500c608087 Author: Rick Macklem AuthorDate: 2021-11-14 21:36:14 +0000 Commit: Rick Macklem CommitDate: 2021-11-28 23:58:03 +0000 nfsstat: Add output for counts of new RPCs to the "-E" option Add output to the "-E" option for new RPCs related to NFSv4.1/4.2. Also, add output of the counts for allocated layouts and the title for the "Client" section (which was lost during a previous commit). (cherry picked from commit 75c666197cc7574f6f0d48344f8725f72072fc84) --- usr.bin/nfsstat/nfsstat.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index e2d747634bcc..da075d57c52e 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -749,10 +749,14 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_WRITEDS], (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_COMMITDS]); - xo_emit("{T:OpenLayout/%13.13s}{T:CreateLayout/%13.13s}\n"); - xo_emit("{:openlayout/%13ju}{:createlayout/%13ju}\n", + xo_emit("{T:OpenLayout/%13.13s}{T:CreateLayout/%13.13s}" + "{T:BindConnSess/%13.13s}{T:LookupOpen/%13.13s}\n"); + xo_emit("{:openlayout/%13ju}{:createlayout/%13ju}" + "{:bindconnsess/%13ju}{:lookupopen/%13ju}\n", (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_OPENLAYGET], - (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATELAYGET]); + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATELAYGET], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_BINDCONNTOSESS], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOOKUPOPEN]); xo_close_container("nfsv41"); @@ -772,17 +776,23 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_GETEXTATTR]); xo_emit("{T:SetExtattr/%13.13s}{T:RmExtattr/%13.13s}" - "{T:ListExtattr/%13.13s}\n"); + "{T:ListExtattr/%13.13s}{T:Deallocate/%13.13s}" + "{T:LayoutError/%13.13s}\n"); xo_emit("{:setextattr/%13ju}{:rmextattr/%13ju}" - "{:listextattr/%13ju}\n", + "{:listextattr/%13ju}{:deallocate/%13ju}" + "{:layouterror/%13ju}\n", (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETEXTATTR], (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RMEXTATTR], - (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LISTEXTATTR]); + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LISTEXTATTR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_DEALLOCATE], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LAYOUTERROR]); xo_close_container("nfsv42"); } xo_close_container("operations"); + if (printtitle) + xo_emit("{T:Client:}\n"); xo_open_container("client"); xo_emit("{T:OpenOwner/%13.13s}{T:Opens/%13.13s}" "{T:LockOwner/%13.13s}{T:Locks/%13.13s}" @@ -798,12 +808,13 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.cllocalopenowners); xo_emit("{T:LocalOpen/%13.13s}{T:LocalLown/%13.13s}" - "{T:LocalLock/%13.13s}\n"); + "{T:LocalLock/%13.13s}{T:Layouts/%13.13s}\n"); xo_emit("{:localopen/%13ju}{:locallown/%13ju}" - "{:locallock/%13ju}\n", + "{:locallock/%13ju}{:layouts/%13ju}\n", (uintmax_t)ext_nfsstats.cllocalopens, (uintmax_t)ext_nfsstats.cllocallockowners, - (uintmax_t)ext_nfsstats.cllocallocks); + (uintmax_t)ext_nfsstats.cllocallocks, + (uintmax_t)ext_nfsstats.cllayouts); xo_close_container("client"); xo_open_container("rpc"); @@ -1061,6 +1072,9 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.srvlockowners, (uintmax_t)ext_nfsstats.srvlocks, (uintmax_t)ext_nfsstats.srvdelegates); + xo_emit("{T:Layouts/%13.13s}\n"); + xo_emit("{:layouts/%13ju}\n", + (uintmax_t)ext_nfsstats.srvlayouts); xo_close_container("server"); if (printtitle) From nobody Mon Nov 29 14:20:59 2021 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 D5C0F18B004C; Mon, 29 Nov 2021 14:20:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nZg456qz3h26; Mon, 29 Nov 2021 14:20:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C94E23DDD; Mon, 29 Nov 2021 14:20:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEKxJf055900; Mon, 29 Nov 2021 14:20:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEKxqX055899; Mon, 29 Nov 2021 14:20:59 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:20:59 GMT Message-Id: <202111291420.1ATEKxqX055899@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: 141f0db23eff - stable/13 - pchtherm: Let the driver be compiled into the kernel 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 141f0db23eff6fe49aa4ee8cc9c84aabc3f3eaa6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638195659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EmNzp9s4YALQhjhNLH14W+kWUWjVuhDAKkPwMvZUf/c=; b=avXaAlPsUekbgH4jL6mlUcnUAr0hCJ20Bma/XiE7b/Eybf/7vazkZr/CqSB0Kxcbb6D7nH 90CpYJ3VYu+touRoFs1lOCnv9xIHF6h+TBylWKVfvH7YLmMIYEbAiOuj6DelRiQcnpoVRF YRcpKauWaZkbWLHiMbajmThlEEfkxU7BsjZp3CgwJKhvsJ+j5SRFh8wnilgQoKI+41o2vf PBlRNHrZmeL8nhQ7zqciB2qwBoAECekWBqTlBpHUg26ycQ+kb1X31khxfxsoFYbZiuy1vc 2mkFOzIb+6t8MeHO0kxkNscpUJgeeulIvr3jyEYKM4lcGcqyYLZJLyTx61bHDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638195659; a=rsa-sha256; cv=none; b=qb8XRUR3WZyyWhibrFi4qJRG+ry/gYD8+YOAWKXORPk38XfFWzi9u/NGTZrk12tIa8uFW6 Iy1ZrpOsEhJNl9hK48Je6RKrKKMs6YIwyjjEWUJGJ6+wrsYdwB7G4kvIm1u/VNu71u9uur BQs0WF+WIT1mAmauWFuA8MrLrAtXrkieTyfYhPwf6/KD/yECrJ0FRhrhRC5NRZswwnliWW UPH0GrXYPihhCr/8zElv+0QzpRc69ArNT+yqydDW0w/d9jCm7pGWHgrWasnmuT1Xi/cOG0 rU9316myIUw50gp2VuRrSarYeJxY5J5YBK6ZhNonj5ja5Hi5K+osiTf9y8frqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=141f0db23eff6fe49aa4ee8cc9c84aabc3f3eaa6 commit 141f0db23eff6fe49aa4ee8cc9c84aabc3f3eaa6 Author: N.J. Mann AuthorDate: 2021-11-22 17:04:05 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:04:16 +0000 pchtherm: Let the driver be compiled into the kernel PR: 259776 (cherry picked from commit a11983366ea72165809837a667d58e2ad440c496) --- sys/conf/files.x86 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index 4ff888e8910c..69e1f7fd6802 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -162,6 +162,7 @@ dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb dev/imcsmb/imcsmb.c optional imcsmb dev/imcsmb/imcsmb_pci.c optional imcsmb pci +dev/intel/pchtherm.c optional pchtherm dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/iommu/busdma_iommu.c optional acpi iommu pci From nobody Mon Nov 29 14:21:00 2021 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 9C85618B0123; Mon, 29 Nov 2021 14:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nZh62Lfz3RFP; Mon, 29 Nov 2021 14:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99FAD23F67; Mon, 29 Nov 2021 14:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEL09b055926; Mon, 29 Nov 2021 14:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEL02p055925; Mon, 29 Nov 2021 14:21:00 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:21:00 GMT Message-Id: <202111291421.1ATEL02p055925@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: 294965542720 - stable/13 - Fix segment size in compressing core dumps 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2949655427209b7d086eb35a92ea1e175d1b1a67 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638195661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PsjM/cOvIe+hBMc34XiOYwR+egrTNrk7zCZxtrH3SqA=; b=ZG6B8IczOu8QDqVU1yM+lty/0V0SXeDOwaVEkc0MnYqYUv4Hgz6KTHPlxK7SwkNI20B4cA 7MAGBbMuBk8y096DH96hTp52oaJSybce3bd1OnRAKLX9XdL+/htPI/lYEemVVuTR90htQr 4Oc8rQmtSycEcHSZBbZJKi5/XEHhWX5Mz2FBYUmvak+R1WaK0J7/tLh0Fdw9sK7w+Rv7U1 rz+/CFuusuPecdJhpOTvvBYQyBSXV8svceE/0+EdP2KAXWC961zIEQrNjRLOCOT/MA4AWL vdIj3QM0VHhHBcdXju7/HvZNt5qVgC94mhA135jdRpIazT+Fv3CBEYwgAIGQjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638195661; a=rsa-sha256; cv=none; b=KM+rCNFlIMrLuhRWus5gNAoq8m/RU7+VPDmKoRIabSZrgc8SqQftYg0etrLiPz6CTXhe5a ctSpd3+RV+kE2LLOA7zTQEujbXlBuxdidhsHLJf1DyzknLOWjtaOeRsyFf3tRLVJpna7bg LRfOqyr6+pRiMCWooNiYK9leNWqq/QaFdYskPO+CEeLNYZoMzpA3a6Z32aMj3qa26Kuv/T Knbl8TreiV7Hf0rO4TChoJRdmAqqEeecADqdwklavFEi1Vf4ZjHlnw23RU6x8CzTMvHs7V jaLNCltz9/le2oAr/31jESQDrNLdSsqcKlC95y4v3KV8MPcbJoQDnexF+6Cy6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2949655427209b7d086eb35a92ea1e175d1b1a67 commit 2949655427209b7d086eb35a92ea1e175d1b1a67 Author: Justin Hibbits AuthorDate: 2021-10-01 18:39:18 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:08:11 +0000 Fix segment size in compressing core dumps A core segment is bounded in size only by memory size. On 64-bit architectures this means a segment can be much larger than 4GB. However, compress_chunk() takes only a u_int, clamping segment size to 4GB-1, resulting in a truncated core. Everything else, including the compressor internally, uses size_t, so use size_t at the boundary here. This dates back to the original refactor back in 2015 (r279801 / aa14e9b7). PR: 260006 Sponsored by: Juniper Networks, Inc. (cherry picked from commit 63cb9308a75b99fe057409705bc1b2ac0293f578) --- sys/kern/imgact_elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index e1b6e3fc6ba7..18ddbae57d4a 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1505,9 +1505,9 @@ static void note_procstat_vmmap(void *, struct sbuf *, size_t *); * Write out a core segment to the compression stream. */ static int -compress_chunk(struct coredump_params *p, char *base, char *buf, u_int len) +compress_chunk(struct coredump_params *p, char *base, char *buf, size_t len) { - u_int chunk_len; + size_t chunk_len; int error; while (len > 0) { From nobody Mon Nov 29 14:21:01 2021 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 2972718B0381; Mon, 29 Nov 2021 14:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nZk3NpWz3h8j; Mon, 29 Nov 2021 14:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8E0C23CD1; Mon, 29 Nov 2021 14:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEL1M3055955; Mon, 29 Nov 2021 14:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEL16x055954; Mon, 29 Nov 2021 14:21:01 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:21:01 GMT Message-Id: <202111291421.1ATEL16x055954@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: fdd27db34802 - stable/13 - vm: Add a mode to vm_object_page_remove() which skips invalid pages 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: fdd27db34802decf062339411e5f84993e733be0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638195662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sMWaKpPXLXHjsNJcn3B9m/rwEgobkxN0E8OvtmWECiY=; b=fgikVjcCQQVMdrfinz5gzm2M5CqblXSOshqaXu6ojFvyWU1Ln3mc4Rj++bsA5Tz2Ykb84b wZSPrFiIGrMSt4PSq9zbjij2rzU7qOwvM2VayLf6p9jT2/ZhXRcIAv3AsduN2Q2tidSfB4 aHiLPL/ufoKkKYF/2GaXHsSB67jPP4hRfjYKiDEv8FY0DOguwceoxTkh/OBKYG6pbYB4S0 hQlUyxhH7PYFbB1odCe0ed8sSYbhDJldV3TnozHFXg7YXXP+4rUrA+ueHhySNqndDyHt0I ZuPkkh8vnnSzLrEiE/XBGgk8EJm8WGUwjxOD/ytbtzNl6/74hc8LiAGXBRrnYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638195662; a=rsa-sha256; cv=none; b=lxqU5YwJf63IsJhRyDvY1l/oZAwiIp4JMAE3M8zMwsf6i7xoCNvv1h1XqUC52Hup1bjCi1 KjjhyuN3JSXGBpMNiSzqbMYw/xOybc0B3LxkkwWGHyT4cN1cUh8kKh5lHWjIYzWuAqEg0T 9dzfdV04Uqk4Hek3K3B0AnJkankvYK1KkFdTr1ReRSZmherOGqT40ecpZWWpGKHnCiWBUA ib3R2rY8xO/7BiAtR7ugOVbDp6k01RCcw3rNEHKWc5oAJ4M6yM7SUwJrgEL7rC/1CKUEDL rF4TXG6KybUkdXdvvCquTEFrC9SWUq2Nu5gCPDVURYR8cTXvXi4gCumerKf3rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fdd27db34802decf062339411e5f84993e733be0 commit fdd27db34802decf062339411e5f84993e733be0 Author: Mark Johnston AuthorDate: 2021-11-15 16:44:04 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:09:28 +0000 vm: Add a mode to vm_object_page_remove() which skips invalid pages This will be used to break a deadlock in ZFS between the per-mountpoint teardown lock and page busy locks. In particular, when purging data from the page cache during dataset rollback, we want to avoid blocking on the busy state of invalid pages since the busying thread may be blocked on the teardown lock in zfs_getpages(). Add a helper, vn_pages_remove_valid(), for use by filesystems. Bump __FreeBSD_version so that the OpenZFS port can make use of the new helper. PR: 258208 Reviewed by: avg, kib, sef Tested by: pho (part of a larger patch) Sponsored by: The FreeBSD Foundation (cherry picked from commit d28af1abf031ee87a478b37180e3f0c518caedf6) --- sys/kern/vfs_vnops.c | 22 ++++++++++++++++++++++ sys/sys/vnode.h | 2 ++ sys/vm/vm_object.c | 19 +++++++++++++++++++ sys/vm/vm_object.h | 1 + 4 files changed, 44 insertions(+) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index b78c24e3e313..afb1c6799825 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2425,6 +2425,10 @@ vn_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, return (setfown(td, active_cred, vp, uid, gid)); } +/* + * Remove pages in the range ["start", "end") from the vnode's VM object. If + * "end" is 0, then the range extends to the end of the object. + */ void vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) { @@ -2437,6 +2441,24 @@ vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) VM_OBJECT_WUNLOCK(object); } +/* + * Like vn_pages_remove(), but skips invalid pages, which by definition are not + * mapped into any process' address space. Filesystems may use this in + * preference to vn_pages_remove() to avoid blocking on pages busied in + * preparation for a VOP_GETPAGES. + */ +void +vn_pages_remove_valid(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) +{ + vm_object_t object; + + if ((object = vp->v_object) == NULL) + return; + VM_OBJECT_WLOCK(object); + vm_object_page_remove(object, start, end, OBJPR_VALIDONLY); + VM_OBJECT_WUNLOCK(object); +} + int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) { diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index ba5eafc80d4b..66e8a7c0a87e 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -763,6 +763,8 @@ int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, int vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, struct thread *td, struct file *fp); void vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end); +void vn_pages_remove_valid(struct vnode *vp, vm_pindex_t start, + vm_pindex_t end); int vn_pollrecord(struct vnode *vp, struct thread *p, int events); int vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, enum uio_seg segflg, int ioflg, diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 5bbe7faed50b..47595d38137c 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2094,6 +2094,21 @@ again: for (; p != NULL && (p->pindex < end || end == 0); p = next) { next = TAILQ_NEXT(p, listq); + /* + * Skip invalid pages if asked to do so. Try to avoid acquiring + * the busy lock, as some consumers rely on this to avoid + * deadlocks. + * + * A thread may concurrently transition the page from invalid to + * valid using only the busy lock, so the result of this check + * is immediately stale. It is up to consumers to handle this, + * for instance by ensuring that all invalid->valid transitions + * happen with a mutex held, as may be possible for a + * filesystem. + */ + if ((options & OBJPR_VALIDONLY) != 0 && vm_page_none_valid(p)) + continue; + /* * If the page is wired for any reason besides the existence * of managed, wired mappings, then it cannot be freed. For @@ -2106,6 +2121,10 @@ again: vm_page_sleep_if_busy(p, "vmopar"); goto again; } + if ((options & OBJPR_VALIDONLY) != 0 && vm_page_none_valid(p)) { + vm_page_xunbusy(p); + continue; + } if (vm_page_wired(p)) { wired: if ((options & OBJPR_NOTMAPPED) == 0 && diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index adbe022417f4..2a16d8c6f096 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -232,6 +232,7 @@ struct vm_object { */ #define OBJPR_CLEANONLY 0x1 /* Don't remove dirty pages. */ #define OBJPR_NOTMAPPED 0x2 /* Don't unmap pages. */ +#define OBJPR_VALIDONLY 0x4 /* Ignore invalid pages. */ TAILQ_HEAD(object_q, vm_object); From nobody Mon Nov 29 14:21:03 2021 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 13F4F18B0405; Mon, 29 Nov 2021 14:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nZm4fYsz3h0Y; Mon, 29 Nov 2021 14:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 027DF23AF4; Mon, 29 Nov 2021 14:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEL3Nn056003; Mon, 29 Nov 2021 14:21:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEL3jh056002; Mon, 29 Nov 2021 14:21:03 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:21:03 GMT Message-Id: <202111291421.1ATEL3jh056002@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: 1556ae13560c - stable/13 - vm_page: Remove vm_page_sbusy() and vm_page_xbusy() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 1556ae13560c18f44b5daed19608c547e0bf6e8a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638195664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x2ew3SVGT7UXBL146X2WbS8mbC/orGkVDQcNdC+SUjg=; b=uB2WCETULUecgnUQ9uLyC3pZCLWuXOxPv8uoBLSjzP1ybnPTMlq3I5RAp0btX1cPjaMcPa /dZgoKBJRUDGTAq6GL/DNEopt5CCi0XwAEi+3pApakglPyw7uJes3cyLmUiWvcUKd5QEMv uXwafJqekQuUVswrKkUoswx17MZjiS2tPxxC47F96xEcGm6OoYchMiru5V5g4+btQuGSr+ 6oPNSNJVEymvq6TkUnWoGdfWZfp6ZrNfVyFIGJQvfl4gip9SbsYKPKKupUb6bl6KtNKucA 8BKbWLNkleQ8LM3ctZ9UXptihupVUVARoRT2iuPrCMzp5bSFArUuhkQ0R8Aq1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638195664; a=rsa-sha256; cv=none; b=sEt+aMMrYrSxHDDVURrD2wbpFDFvZY8yqLg84sXn6xYnvsl2zAOYOzAkxXvq69MlIoNzhp IFKEj14eWSto8q4XSdCWIx+bp84VkYAGTvBzYR8mCqDnR2eCqa085nHm1g34fFR2pN7orF 2u0th315sTzHPU6sjrfCsn+eagv1Z1F1M3xhiY9MtgEWwzJ6VrvCAgkDD90Rg44KtSKjea jtaZSgcQX/JbXcv22stC3hbx9vIdgIaWQ8rjsq56vIuBBGjbwKaGCa46gpgPLq5v1oWtFr VJSJVIw6A5YLls8QGl1w04je1xOmjR+RwpkTZbpXjq6Yq2mXBC7yBF8YAJiPVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1556ae13560c18f44b5daed19608c547e0bf6e8a commit 1556ae13560c18f44b5daed19608c547e0bf6e8a Author: Mark Johnston AuthorDate: 2021-11-15 16:35:52 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:11:37 +0000 vm_page: Remove vm_page_sbusy() and vm_page_xbusy() They are unused today and cannot be safely used in the face of unlocked lookup, in which pages may be busied without the object lock held. Obtained from: jeff (object_concurrency patches) Reviewed by: kib (cherry picked from commit a2665158d03e87dad410384e5c61c72e675f3edd) --- ObsoleteFiles.inc | 4 +++- share/man/man9/Makefile | 2 -- share/man/man9/vm_page_busy.9 | 16 ---------------- sys/vm/vm_page.h | 12 ------------ 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1448b9076c95..9e6b7b987d79 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,7 +36,9 @@ # xargs -n1 | sort | uniq -d; # done -# 20211115: vm_page_sleep_if_busy removed +# 20211115: vm_page busy functions removed +OLD_FILES+=share/man/man9/vm_page_sbusy.9.gz +OLD_FILES+=share/man/man9/vm_page_xbusy.9.gz OLD_FILES+=share/man/man9/vm_page_sleep_if_busy.9.gz # 20210923: rename boot(9) to kern_reboot(9) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 14cdf7470b41..f6eced940295 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2325,12 +2325,10 @@ MLINKS+=vm_page_busy.9 vm_page_busied.9 \ vm_page_busy.9 vm_page_busy_downgrade.9 \ vm_page_busy.9 vm_page_busy_sleep.9 \ vm_page_busy.9 vm_page_sbusied.9 \ - vm_page_busy.9 vm_page_sbusy.9 \ vm_page_busy.9 vm_page_sunbusy.9 \ vm_page_busy.9 vm_page_trysbusy.9 \ vm_page_busy.9 vm_page_tryxbusy.9 \ vm_page_busy.9 vm_page_xbusied.9 \ - vm_page_busy.9 vm_page_xbusy.9 \ vm_page_busy.9 vm_page_xunbusy.9 \ vm_page_busy.9 vm_page_assert_sbusied.9 \ vm_page_busy.9 vm_page_assert_unbusied.9 \ diff --git a/share/man/man9/vm_page_busy.9 b/share/man/man9/vm_page_busy.9 index 3f08a467bcb1..88511aafabca 100644 --- a/share/man/man9/vm_page_busy.9 +++ b/share/man/man9/vm_page_busy.9 @@ -32,12 +32,10 @@ .Nm vm_page_busy_downgrade , .Nm vm_page_busy_sleep , .Nm vm_page_sbusied , -.Nm vm_page_sbusy , .Nm vm_page_sunbusy , .Nm vm_page_trysbusy , .Nm vm_page_tryxbusy , .Nm vm_page_xbusied , -.Nm vm_page_xbusy , .Nm vm_page_xunbusy , .Nm vm_page_assert_sbusied , .Nm vm_page_assert_unbusied , @@ -56,8 +54,6 @@ .Ft int .Fn vm_page_sbusied "vm_page_t m" .Ft void -.Fn vm_page_sbusy "vm_page_t m" -.Ft void .Fn vm_page_sunbusy "vm_page_t m" .Ft int .Fn vm_page_trysbusy "vm_page_t m" @@ -66,8 +62,6 @@ .Ft int .Fn vm_page_xbusied "vm_page_t m" .Ft void -.Fn vm_page_xbusy "vm_page_t m" -.Ft void .Fn vm_page_xunbusy "vm_page_t m" .Pp .Cd "options INVARIANTS" @@ -140,11 +134,6 @@ in shared mode. Returns zero otherwise. .Pp The -.Fn vm_page_sbusy -function shared busies -.Fa m . -.Pp -The .Fn vm_page_sunbusy function shared unbusies .Fa m . @@ -173,11 +162,6 @@ in exclusive mode. Returns zero otherwise. .Pp The -.Fn vm_page_xbusy -function exclusive busies -.Fa m . -.Pp -The .Fn vm_page_xunbusy function exclusive unbusies .Fa m . diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 4b43b1d71f54..1785728b7a7e 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -748,24 +748,12 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line); #define vm_page_busied(m) \ (vm_page_busy_fetch(m) != VPB_UNBUSIED) -#define vm_page_sbusy(m) do { \ - if (!vm_page_trysbusy(m)) \ - panic("%s: page %p failed shared busying", __func__, \ - (m)); \ -} while (0) - #define vm_page_xbusied(m) \ ((vm_page_busy_fetch(m) & VPB_SINGLE_EXCLUSIVE) != 0) #define vm_page_busy_freed(m) \ (vm_page_busy_fetch(m) == VPB_FREED) -#define vm_page_xbusy(m) do { \ - if (!vm_page_tryxbusy(m)) \ - panic("%s: page %p failed exclusive busying", __func__, \ - (m)); \ -} while (0) - /* Note: page m's lock must not be owned by the caller. */ #define vm_page_xunbusy(m) do { \ if (!atomic_cmpset_rel_int(&(m)->busy_lock, \ From nobody Mon Nov 29 14:21:02 2021 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 12F1718B01C1; Mon, 29 Nov 2021 14:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nZl5FDZz3h6H; Mon, 29 Nov 2021 14:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9A6423CD2; Mon, 29 Nov 2021 14:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEL2pm055979; Mon, 29 Nov 2021 14:21:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEL2Fe055978; Mon, 29 Nov 2021 14:21:02 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:21:02 GMT Message-Id: <202111291421.1ATEL2Fe055978@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: cb081566cf86 - stable/13 - vm_page: Consolidate page busy sleep mechanisms 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: cb081566cf868dccce2f96bf5276b6dc561c842d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638195664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7kEuu6Df/fyYZ7axVcIfJ+9c1xjfAMnWAmts5rs7ozs=; b=LPxkO+XHtJZIezBNsXsBLr6gn/0cyM9LfC0NspDXDIWGmmEUxbol4ik8qOtkvtsv+ufkPn fdwoYibCHNBBaA3g87TCx3iRv25//LoQI7jvBx1UJRbgkRmN7cUHvKn5+cQzxIUNlvYZLu FrJbUYqGd/0dIWaJgbhuaDdQBEOudQ81KjEvRHYJMNuOrcTrBkHAApB1kuGDNCfHyk2o4a lGqkXu1crxX0c8r6Pu+hZ0+PNNnNFC008cxsODeCSPDrIAxTJ+1UFiaqW1mB0wpHYObwwB vfHZhc9HeD2n79CWEN5B+no7xRlM/q1R1P5M+AW/MHry6d1fSKMINW4IxQJ6Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638195664; a=rsa-sha256; cv=none; b=RhLyudshWtvWr7aBh6LO36+1diXgEU8j4VKQ9LItHvGuWIL2+/umewzef7YWv73N7QH2gQ hpI7Gp+16g8AeDjAhCZJCKNgSI+YkJ2rkci5jPQk+Yn515z93ndwQCBj0asrZZDhNbc6pg 9Kgp8aQUCN3tHcKUQN/tR4JENOHotTMJTC7qNBwPguN0ivya4/u3NExSoV/a4aglSA6yAA o6sM4KlX8S7+nkCjO7EPzFGouqV365Rp7A7vhiV3BspDAvV6BknUDmwlkqMKuPa6TMD3dV YYfmqIy02CFi4dzyyJmKeQ1mmY6y7XkkO7ms1SDIjeb5dzalK1t7sLJWjXUTkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cb081566cf868dccce2f96bf5276b6dc561c842d commit cb081566cf868dccce2f96bf5276b6dc561c842d Author: Mark Johnston AuthorDate: 2021-11-15 16:35:44 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:11:29 +0000 vm_page: Consolidate page busy sleep mechanisms - Modify vm_page_busy_sleep() and vm_page_busy_sleep_unlocked() to take a VM_ALLOC_* flag indicating whether to sleep on shared-busy, and fix up callers. - Modify vm_page_busy_sleep() to return a status indicating whether the object lock was dropped, and fix up callers. - Convert callers of vm_page_sleep_if_busy() to use vm_page_busy_sleep() instead. - Remove vm_page_sleep_if_(x)busy(). No functional change intended. Obtained from: jeff (object_concurrency patches) Reviewed by: kib (cherry picked from commit 87b646630c4892e21446cd096bea6bcaecea33ac) --- ObsoleteFiles.inc | 3 ++ share/man/man9/Makefile | 1 - share/man/man9/vm_page_busy.9 | 40 +++++++++--------- sys/vm/vm_fault.c | 5 +-- sys/vm/vm_object.c | 27 ++++++++---- sys/vm/vm_page.c | 97 ++++++++----------------------------------- sys/vm/vm_page.h | 6 +-- 7 files changed, 62 insertions(+), 117 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ac85e8b55e26..1448b9076c95 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20211115: vm_page_sleep_if_busy removed +OLD_FILES+=share/man/man9/vm_page_sleep_if_busy.9.gz + # 20210923: rename boot(9) to kern_reboot(9) OLD_FILES+=usr/share/man/man9/boot.9.gz diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 500cd252a3df..14cdf7470b41 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2326,7 +2326,6 @@ MLINKS+=vm_page_busy.9 vm_page_busied.9 \ vm_page_busy.9 vm_page_busy_sleep.9 \ vm_page_busy.9 vm_page_sbusied.9 \ vm_page_busy.9 vm_page_sbusy.9 \ - vm_page_busy.9 vm_page_sleep_if_busy.9 \ vm_page_busy.9 vm_page_sunbusy.9 \ vm_page_busy.9 vm_page_trysbusy.9 \ vm_page_busy.9 vm_page_tryxbusy.9 \ diff --git a/share/man/man9/vm_page_busy.9 b/share/man/man9/vm_page_busy.9 index f4e922a8319f..3f08a467bcb1 100644 --- a/share/man/man9/vm_page_busy.9 +++ b/share/man/man9/vm_page_busy.9 @@ -24,7 +24,7 @@ .\" DAMAGE. .\" .\" $FreeBSD$ -.Dd August 07, 2013 +.Dd November 11, 2021 .Dt VM_PAGE_BUSY 9 .Os .Sh NAME @@ -33,7 +33,6 @@ .Nm vm_page_busy_sleep , .Nm vm_page_sbusied , .Nm vm_page_sbusy , -.Nm vm_page_sleep_if_busy , .Nm vm_page_sunbusy , .Nm vm_page_trysbusy , .Nm vm_page_tryxbusy , @@ -52,14 +51,12 @@ .Fn vm_page_busied "vm_page_t m" .Ft void .Fn vm_page_busy_downgrade "vm_page_t m" -.Ft void -.Fn vm_page_busy_sleep "vm_page_t m" "const char *msg" +.Ft bool +.Fn vm_page_busy_sleep "vm_page_t m" "const char *msg" "int allocflags" .Ft int .Fn vm_page_sbusied "vm_page_t m" .Ft void .Fn vm_page_sbusy "vm_page_t m" -.Ft int -.Fn vm_page_sleep_if_busy "vm_page_t m" "const char *msg" .Ft void .Fn vm_page_sunbusy "vm_page_t m" .Ft int @@ -114,8 +111,23 @@ from an exclusive busy state to a shared busy state. .Pp The .Fn vm_page_busy_sleep -function puts the invoking thread to sleep using the appropriate -waitchannels for the busy mechanism. +checks the busy state of the page +.Fa m +and puts the invoking thread to sleep if the page is busy. +The VM object for the page must be locked. +The +.Fa allocflags +parameter must be either +.Dv 0 , +in which case the function will sleep if the page is busied, +or +.Dv VM_ALLOC_IGN_SBUSY , +in which case the function will sleep only if the page is exclusively +busied. +A return value of true indicates that the invoking thread was put to +sleep and that the object was unlocked. +A return value of false indicates that the invoking thread did not sleep +and the object remains locked. The parameter .Fa msg is a string describing the sleep condition for userland tools. @@ -133,18 +145,6 @@ function shared busies .Fa m . .Pp The -.Fn vm_page_sleep_if_busy -function puts the invoking thread to sleep, using the appropriate -waitchannels for the busy mechanism, if -.Fa m . -is busied in either exclusive or shared mode. -If the invoking thread slept a non-zero value is returned, otherwise -0 is returned. -The parameter -.Fa msg -is a string describing the sleep condition for userland tools. -.Pp -The .Fn vm_page_sunbusy function shared unbusies .Fa m . diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index c0ac89e4b70f..646f9ddb9017 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1290,9 +1290,8 @@ vm_fault_busy_sleep(struct faultstate *fs) } vm_object_pip_wakeup(fs->object); unlock_map(fs); - if (fs->m == vm_page_lookup(fs->object, fs->pindex)) - vm_page_busy_sleep(fs->m, "vmpfw", false); - else + if (fs->m != vm_page_lookup(fs->object, fs->pindex) || + !vm_page_busy_sleep(fs->m, "vmpfw", 0)) VM_OBJECT_WUNLOCK(fs->object); VM_CNT_INC(v_intrans); vm_object_deallocate(fs->first_object); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 47595d38137c..c465a2cf76dd 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1397,7 +1397,8 @@ next_page: */ vm_page_aflag_set(tm, PGA_REFERENCED); } - vm_page_busy_sleep(tm, "madvpo", false); + if (!vm_page_busy_sleep(tm, "madvpo", 0)) + VM_OBJECT_WUNLOCK(tobject); goto relookup; } vm_page_advise(tm, advice); @@ -1581,7 +1582,8 @@ retry: */ if (vm_page_tryxbusy(m) == 0) { VM_OBJECT_WUNLOCK(new_object); - vm_page_sleep_if_busy(m, "spltwt"); + if (vm_page_busy_sleep(m, "spltwt", 0)) + VM_OBJECT_WLOCK(orig_object); VM_OBJECT_WLOCK(new_object); goto retry; } @@ -1667,14 +1669,17 @@ vm_object_collapse_scan_wait(vm_object_t object, vm_page_t p) VM_OBJECT_WUNLOCK(object); VM_OBJECT_WUNLOCK(backing_object); vm_radix_wait(); + VM_OBJECT_WLOCK(object); + } else if (p->object == object) { + VM_OBJECT_WUNLOCK(backing_object); + if (vm_page_busy_sleep(p, "vmocol", 0)) + VM_OBJECT_WLOCK(object); } else { - if (p->object == object) + VM_OBJECT_WUNLOCK(object); + if (!vm_page_busy_sleep(p, "vmocol", 0)) VM_OBJECT_WUNLOCK(backing_object); - else - VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(p, "vmocol", false); + VM_OBJECT_WLOCK(object); } - VM_OBJECT_WLOCK(object); VM_OBJECT_WLOCK(backing_object); return (TAILQ_FIRST(&backing_object->memq)); } @@ -2118,7 +2123,8 @@ again: * not specified. */ if (vm_page_tryxbusy(p) == 0) { - vm_page_sleep_if_busy(p, "vmopar"); + if (vm_page_busy_sleep(p, "vmopar", 0)) + VM_OBJECT_WLOCK(object); goto again; } if ((options & OBJPR_VALIDONLY) != 0 && vm_page_none_valid(p)) { @@ -2426,7 +2432,10 @@ again: VM_OBJECT_RUNLOCK(tobject); tobject = t1object; } - vm_page_busy_sleep(tm, "unwbo", true); + tobject = tm->object; + if (!vm_page_busy_sleep(tm, "unwbo", + VM_ALLOC_IGN_SBUSY)) + VM_OBJECT_RUNLOCK(tobject); goto again; } vm_page_unwire(tm, queue); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 6be310531924..74c03ed3a21b 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1000,24 +1000,26 @@ vm_page_sunbusy(vm_page_t m) * vm_page_busy_sleep: * * Sleep if the page is busy, using the page pointer as wchan. - * This is used to implement the hard-path of busying mechanism. + * This is used to implement the hard-path of the busying mechanism. + * + * If VM_ALLOC_IGN_SBUSY is specified in allocflags, the function + * will not sleep if the page is shared-busy. * - * If nonshared is true, sleep only if the page is xbusy. + * The object lock must be held on entry. * - * The object lock must be held on entry and will be released on exit. + * Returns true if it slept and dropped the object lock, or false + * if there was no sleep and the lock is still held. */ -void -vm_page_busy_sleep(vm_page_t m, const char *wmesg, bool nonshared) +bool +vm_page_busy_sleep(vm_page_t m, const char *wmesg, int allocflags) { vm_object_t obj; obj = m->object; VM_OBJECT_ASSERT_LOCKED(obj); - vm_page_lock_assert(m, MA_NOTOWNED); - if (!_vm_page_busy_sleep(obj, m, m->pindex, wmesg, - nonshared ? VM_ALLOC_SBUSY : 0 , true)) - VM_OBJECT_DROP(obj); + return (_vm_page_busy_sleep(obj, m, m->pindex, wmesg, allocflags, + true)); } /* @@ -1026,21 +1028,19 @@ vm_page_busy_sleep(vm_page_t m, const char *wmesg, bool nonshared) * Sleep if the page is busy, using the page pointer as wchan. * This is used to implement the hard-path of busying mechanism. * - * If nonshared is true, sleep only if the page is xbusy. + * If VM_ALLOC_IGN_SBUSY is specified in allocflags, the function + * will not sleep if the page is shared-busy. * * The object lock must not be held on entry. The operation will * return if the page changes identity. */ void vm_page_busy_sleep_unlocked(vm_object_t obj, vm_page_t m, vm_pindex_t pindex, - const char *wmesg, bool nonshared) + const char *wmesg, int allocflags) { - VM_OBJECT_ASSERT_UNLOCKED(obj); - vm_page_lock_assert(m, MA_NOTOWNED); - _vm_page_busy_sleep(obj, m, pindex, wmesg, - nonshared ? VM_ALLOC_SBUSY : 0, false); + (void)_vm_page_busy_sleep(obj, m, pindex, wmesg, allocflags, false); } /* @@ -1050,6 +1050,8 @@ vm_page_busy_sleep_unlocked(vm_object_t obj, vm_page_t m, vm_pindex_t pindex, * lockstate against parameters. Returns true if it sleeps and * false otherwise. * + * allocflags uses VM_ALLOC_* flags to specify the lock required. + * * If locked is true the lock will be dropped for any true returns * and held for any false returns. */ @@ -1395,71 +1397,6 @@ vm_page_free_invalid(vm_page_t m) vm_page_free(m); } -/* - * vm_page_sleep_if_busy: - * - * Sleep and release the object lock if the page is busied. - * Returns TRUE if the thread slept. - * - * The given page must be unlocked and object containing it must - * be locked. - */ -int -vm_page_sleep_if_busy(vm_page_t m, const char *wmesg) -{ - vm_object_t obj; - - vm_page_lock_assert(m, MA_NOTOWNED); - VM_OBJECT_ASSERT_WLOCKED(m->object); - - /* - * The page-specific object must be cached because page - * identity can change during the sleep, causing the - * re-lock of a different object. - * It is assumed that a reference to the object is already - * held by the callers. - */ - obj = m->object; - if (_vm_page_busy_sleep(obj, m, m->pindex, wmesg, 0, true)) { - VM_OBJECT_WLOCK(obj); - return (TRUE); - } - return (FALSE); -} - -/* - * vm_page_sleep_if_xbusy: - * - * Sleep and release the object lock if the page is xbusied. - * Returns TRUE if the thread slept. - * - * The given page must be unlocked and object containing it must - * be locked. - */ -int -vm_page_sleep_if_xbusy(vm_page_t m, const char *wmesg) -{ - vm_object_t obj; - - vm_page_lock_assert(m, MA_NOTOWNED); - VM_OBJECT_ASSERT_WLOCKED(m->object); - - /* - * The page-specific object must be cached because page - * identity can change during the sleep, causing the - * re-lock of a different object. - * It is assumed that a reference to the object is already - * held by the callers. - */ - obj = m->object; - if (_vm_page_busy_sleep(obj, m, m->pindex, wmesg, VM_ALLOC_SBUSY, - true)) { - VM_OBJECT_WLOCK(obj); - return (TRUE); - } - return (FALSE); -} - /* * vm_page_dirty_KBI: [ internal use only ] * diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index b31ea0241cc7..4b43b1d71f54 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -592,9 +592,9 @@ malloc2vm_flags(int malloc_flags) bool vm_page_busy_acquire(vm_page_t m, int allocflags); void vm_page_busy_downgrade(vm_page_t m); int vm_page_busy_tryupgrade(vm_page_t m); -void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); +bool vm_page_busy_sleep(vm_page_t m, const char *msg, int allocflags); void vm_page_busy_sleep_unlocked(vm_object_t obj, vm_page_t m, - vm_pindex_t pindex, const char *wmesg, bool nonshared); + vm_pindex_t pindex, const char *wmesg, int allocflags); void vm_page_free(vm_page_t m); void vm_page_free_zero(vm_page_t m); @@ -678,8 +678,6 @@ vm_page_t vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options); vm_page_bits_t vm_page_set_dirty(vm_page_t m); void vm_page_set_valid_range(vm_page_t m, int base, int size); -int vm_page_sleep_if_busy(vm_page_t m, const char *msg); -int vm_page_sleep_if_xbusy(vm_page_t m, const char *msg); vm_offset_t vm_page_startup(vm_offset_t vaddr); void vm_page_sunbusy(vm_page_t m); bool vm_page_try_remove_all(vm_page_t m); From nobody Mon Nov 29 14:21:05 2021 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 8DE4818B035A; Mon, 29 Nov 2021 14:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nZp2stjz3h91; Mon, 29 Nov 2021 14:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AEB623B78; Mon, 29 Nov 2021 14:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEL5nd056027; Mon, 29 Nov 2021 14:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEL5V9056026; Mon, 29 Nov 2021 14:21:05 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:21:05 GMT Message-Id: <202111291421.1ATEL5V9056026@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: e0cee46f5800 - stable/13 - amd64: Initialize kernel_pmap's active CPU set to all_cpus 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e0cee46f5800071c105955c530ae91afa2cca002 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638195667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ou4ZDkEta9aSOWh8fLDmBMGlB3ahjI41MJBlitTXBgI=; b=vBKcAEMMHqNF0RvsWH79VYyCulBFf0aermX5LWpliR1dqF/ulyjyixMFQevi6XzOlh9avS HQHOugexCOQ5IEGGXaJEBJnIVK+8sEPTyOE3BnI7RyWDqEwvMRBtSWjgcgwASZmh3Dj6Co SFnWMfO756o2sJ/Q6EulcqUgsIDyqibjKS2467WLJOV9TY2OA7/f476TCQ/IAc9ef+US9W FFSqyS8O27+ZuP6T2P66JV236RiR4v9fQMXeHrlHmwgvbe0HiZnkuk2et5iCOzkvvhmSPD z/mAmsQQtmxY62M1v32r/wsxIDpGWi2UZSMrbejY0SWvskeRHuy4ND6JqEU7HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638195667; a=rsa-sha256; cv=none; b=INW0vSFosNzBfF4IzL7VJGR1vvWL7S1GOknzERiVz2/+N1xwXU61pij8s5Vdn9Yhke4i/s S4d15N8R6MOJ7JXQ/y5gKc15Gb8igY8LZaZZVIU5VFITuPFAuo8q902Oa6XKevULM78Zl8 VsApYstXQ2IpXbPV2kfvgZRIDkSvfloC/TuLR8AtrQXz0c+mE+nrcZP8UbJYbYbx4Dhk7U Nl476GMhQ9kozYYv1fiEgeNu3yc90xkR1jzoshkQByJQ0HrRYrB7bWd9a2kDDDfu4Z95Yz 9WUHLTT5z1bzaKn3TSt1IIS0a/76DP2U5Vz8jG34uEvdWPsBcMOBXnuxw1rwzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e0cee46f5800071c105955c530ae91afa2cca002 commit e0cee46f5800071c105955c530ae91afa2cca002 Author: Mark Johnston AuthorDate: 2021-11-15 17:41:24 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:17:08 +0000 amd64: Initialize kernel_pmap's active CPU set to all_cpus This is in preference to simply filling the cpuset, and allows the conditional in pmap_invalidate_cpu_mask() to be elided. Also export pmap_invalidate_cpu_mask() outside of pmap.c for use in a subsequent commit. Suggested by: kib Reviewed by: alc, kib Tested by: pho Sponsored by: The FreeBSD Foundation (cherry picked from commit 71e6e9da225aede95f6813a0fcf886538d0da9fe) --- sys/amd64/amd64/pmap.c | 22 ++++++++++++++-------- sys/amd64/include/pmap.h | 6 ++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 524b40ed2fee..986a1b670d60 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1924,11 +1924,16 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_pmltop = kernel_pml4; kernel_pmap->pm_cr3 = KPML4phys; kernel_pmap->pm_ucr3 = PMAP_NO_CR3; - CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); kernel_pmap->pm_stats.resident_count = res; kernel_pmap->pm_flags = pmap_flags; + /* + * The kernel pmap is always active on all CPUs. Once CPUs are + * enumerated, the mask will be set equal to all_cpus. + */ + CPU_FILL(&kernel_pmap->pm_active); + /* * Initialize the TLB invalidations generation number lock. */ @@ -2968,12 +2973,6 @@ pmap_invalidate_ept(pmap_t pmap) smr_wait(pmap->pm_eptsmr, goal); } -static cpuset_t -pmap_invalidate_cpu_mask(pmap_t pmap) -{ - return (pmap == kernel_pmap ? all_cpus : pmap->pm_active); -} - static inline void pmap_invalidate_preipi_pcid(pmap_t pmap) { @@ -10808,7 +10807,14 @@ pmap_pti_init(void) pti_finalized = true; VM_OBJECT_WUNLOCK(pti_obj); } -SYSINIT(pmap_pti, SI_SUB_CPU + 1, SI_ORDER_ANY, pmap_pti_init, NULL); + +static void +pmap_cpu_init(void *arg __unused) +{ + CPU_COPY(&all_cpus, &kernel_pmap->pm_active); + pmap_pti_init(); +} +SYSINIT(pmap_cpu, SI_SUB_CPU + 1, SI_ORDER_ANY, pmap_cpu_init, NULL); static pdp_entry_t * pmap_pti_pdpe(vm_offset_t va) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index bd6a8c006813..14ff4cf3cde9 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -535,6 +535,12 @@ void pmap_kasan_enter(vm_offset_t); void pmap_kmsan_enter(vm_offset_t); #endif +static __inline cpuset_t +pmap_invalidate_cpu_mask(pmap_t pmap) +{ + return (pmap->pm_active); +} + #endif /* _KERNEL */ /* Return various clipped indexes for a given VA */ From nobody Mon Nov 29 14:21:25 2021 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 CF46518B0C61; Mon, 29 Nov 2021 14:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nb96st0z3hPY; Mon, 29 Nov 2021 14:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9923923DE5; Mon, 29 Nov 2021 14:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATELPrX056221; Mon, 29 Nov 2021 14:21:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATELPfM056220; Mon, 29 Nov 2021 14:21:25 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:21:25 GMT Message-Id: <202111291421.1ATELPfM056220@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: f47775628333 - stable/12 - Fix segment size in compressing core dumps 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: f4777562833311b5b4c99e5dda8d50d91a514bf0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638195686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5eb4MFMjfQH6P187nu1KyzwAqn3Q6A+BvTGoqKvXQ0E=; b=Ad6zY3+KfFIAUXT7qw/nF2FExaglSjV5u9Ncn5R0q7txrVmwExxr6AAPRBlP4taFGPhsrF t7wgyswvSG/4qU+B/NTUpLepMMomEdeSg7+Uk10jmyIp9iHla/MI6JU4bBNkuTANE+QpH+ GtdmRxcVXKego82EQSw0HrqtFA6dxNBZbTQHDycbbA5CWZ2yugMwrFrnUCLi4GtoK1iQQM p/n8NAFU3MTXvyDbzC2CHXAX4L/531TfP76obTKTwHJ2ysIIlXIfBFGTl3Pstr5QNb4Hl9 GktChkZlCypzI+Hvpbja7IIE5AMJCLHfqbW8kN21tpBlTAZRQ+aG2otG04VZ4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638195686; a=rsa-sha256; cv=none; b=QBzlY7NDBjpeAEs0NP9p4UvqtVR1y1QGIPDLdmQs2qGjBAfBJN5+ugqdZvUxDHR5So0e+t txKM0KIl2YDqIgMyL/PsDJCNTdbbK3M76qza3zqzVG5DRBKTwjv7oiMJYJytPcSRsv61aw S4gSYKtO9roLzddYLLZGvA2/l8Z8uqKhn6BmZsW6moR6GEQbsfawsqAEWn+VO2uEeESfH5 B1AWdm6h0AeXHdVOtCeowAkAeScVpD54IxgPGt2PCSKtmQedIvLRC+AUqB+wxcCT/Flgoe ca6r+NtFk+LL0wxgO0R86cN9WjeLP+cV14sd61O3f3Y4xqN1MFvsb8cjfEd0ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f4777562833311b5b4c99e5dda8d50d91a514bf0 commit f4777562833311b5b4c99e5dda8d50d91a514bf0 Author: Justin Hibbits AuthorDate: 2021-10-01 18:39:18 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:21:19 +0000 Fix segment size in compressing core dumps A core segment is bounded in size only by memory size. On 64-bit architectures this means a segment can be much larger than 4GB. However, compress_chunk() takes only a u_int, clamping segment size to 4GB-1, resulting in a truncated core. Everything else, including the compressor internally, uses size_t, so use size_t at the boundary here. This dates back to the original refactor back in 2015 (r279801 / aa14e9b7). PR: 260006 Sponsored by: Juniper Networks, Inc. (cherry picked from commit 63cb9308a75b99fe057409705bc1b2ac0293f578) --- sys/kern/imgact_elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 416de09630ae..c056cfcec8e0 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1473,9 +1473,9 @@ static void note_procstat_vmmap(void *, struct sbuf *, size_t *); * Write out a core segment to the compression stream. */ static int -compress_chunk(struct coredump_params *p, char *base, char *buf, u_int len) +compress_chunk(struct coredump_params *p, char *base, char *buf, size_t len) { - u_int chunk_len; + size_t chunk_len; int error; while (len > 0) { From nobody Mon Nov 29 14:28:06 2021 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 1D5AC18B5E9D; Mon, 29 Nov 2021 14:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nkt5vykz3n8y; Mon, 29 Nov 2021 14:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC8692401A; Mon, 29 Nov 2021 14:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATES61M059280; Mon, 29 Nov 2021 14:28:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATES6AA059279; Mon, 29 Nov 2021 14:28:06 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:28:06 GMT Message-Id: <202111291428.1ATES6AA059279@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: 4022f3eec404 - stable/13 - cddl: fix missing ZFS library dependencies 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 4022f3eec40406dbd702d380ba27c875caf81e57 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638196086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jQhhBj7pVeHeeMiVUfUVCsKFt/o6IRbEAPgLNya9SFU=; b=Zs04u/Q75bRn51BWECEnj0aeQtXoAXiI0I49cs4xqmFQlqcxUW1f77RD2M1q+0cMzbUTXj 6JQak9zuHk32yfS+ien+2VeRQqTMDyE2ahppKjsCcKA3+pFBbNOHtNozt/OLewONkL3Xhn WE8bj1536CXObwhoLyjPgB0qIm22D4Pz+UDVykT67+GM4YPBuAOFNVZNUdUirGTKEcpp+q fay87hSdMC+ggvtklXKYRvAjHk4t1IGW8qsrXVQEMgBFqMtuc8du4b3um2k0Nmt19e/Ar7 Xu//0NYtb/VRylNezuXQ6wNd/PrfAS8ODMt0MAgvr7yxBCur/QyesUCzsBOvIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638196086; a=rsa-sha256; cv=none; b=Ni1/bJ4gL578eBg+3s2sDC90mPAx1CHzF+LZU5605ecsk5lOZYdBdi33FktYQbqYkhqAOu XnYaEcPiqsnorz0sA/DH3x4GCQntI4/9rUqi4/eSap27tNgIdOegSo4h5ygGnKp7Fhz5zS Q0hWO6EGsbfJxj7+Cv+PUn20R/MS79W6MMgN+Ad9qcZD3jR/Ic9Dhkkgwiqll1EC79+GYL Iw2BpGkqpalvRMCuOpedzY+lespfqZGoPK343Uv1tfOhrp7Fwc04tVBgDfBuW0qsgyxdez Yr6rBBJXTAMOKdynWR43jAG1CWlVTNuQ68oW6r39gXzBao4p/56BHr2X2dzOcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4022f3eec40406dbd702d380ba27c875caf81e57 commit 4022f3eec40406dbd702d380ba27c875caf81e57 Author: Greg V AuthorDate: 2021-10-16 16:29:28 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:26:35 +0000 cddl: fix missing ZFS library dependencies In 9fae47666 zfsd got a libspl dependency to avoid undefined references. However that workaround did not help external consumers of libzfs_core. Fix all missing dependencies lld 13 and the rtld complain about. Reviewed by: freqlabs, markj (cherry picked from commit 9e9c651caceb9ecd17131e8bb29791ba4cf1cec7) --- Makefile.inc1 | 8 ++++++-- cddl/lib/Makefile | 4 +++- cddl/lib/libavl/Makefile | 1 + cddl/lib/libnvpair/Makefile | 1 + cddl/lib/libzfs_core/Makefile | 2 +- cddl/lib/libzutil/Makefile | 2 +- cddl/usr.sbin/zfsd/Makefile.common | 2 +- share/mk/src.libnames.mk | 6 ++++-- 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 4439b9ef67d4..34bb10e6925f 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3006,11 +3006,15 @@ _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib_libzfs= cddl/lib/libzfs _cddl_lib_libzfsbootenv= cddl/lib/libzfsbootenv +cddl/lib/libavl__L: cddl/lib/libspl__L + +cddl/lib/libnvpair__L: cddl/lib/libspl__L + cddl/lib/libtpool__L: cddl/lib/libspl__L -cddl/lib/libzutil__L: cddl/lib/libavl__L cddl/lib/libtpool__L +cddl/lib/libzutil__L: cddl/lib/libavl__L lib/libgeom__L lib/msun__L cddl/lib/libtpool__L -cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L +cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L cddl/lib/libspl__L cddl/lib/libzutil__L cddl/lib/libzfs__L: cddl/lib/libzfs_core__L lib/msun__L lib/libutil__L cddl/lib/libzfs__L: lib/libthr__L lib/libmd__L lib/libz__L cddl/lib/libumem__L diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile index ae6862f70443..5ca0d56b291a 100644 --- a/cddl/lib/Makefile +++ b/cddl/lib/Makefile @@ -36,11 +36,13 @@ _pam_zfs_key= pam_zfs_key .endif .endif +SUBDIR_DEPEND_libavl= libspl SUBDIR_DEPEND_libctf= libspl SUBDIR_DEPEND_libdtrace= libctf +SUBDIR_DEPEND_libnvpair= libspl SUBDIR_DEPEND_libtpool= libspl SUBDIR_DEPEND_libuutil= libavl libspl -SUBDIR_DEPEND_libzfs_core= libnvpair +SUBDIR_DEPEND_libzfs_core= libnvpair libspl libzutil SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core libzutil SUBDIR_DEPEND_libzpool= libavl libnvpair libumem libicp SUBDIR_DEPEND_libzutil= libavl libtpool diff --git a/cddl/lib/libavl/Makefile b/cddl/lib/libavl/Makefile index 2f7b9ad30856..b5e3b458f982 100644 --- a/cddl/lib/libavl/Makefile +++ b/cddl/lib/libavl/Makefile @@ -4,6 +4,7 @@ PACKAGE= runtime LIB= avl +LIBADD= spl SRCS= avl.c WARNS?= 3 CFLAGS+= -DIN_BASE diff --git a/cddl/lib/libnvpair/Makefile b/cddl/lib/libnvpair/Makefile index 670253eff7c1..aaf76ed3fb28 100644 --- a/cddl/lib/libnvpair/Makefile +++ b/cddl/lib/libnvpair/Makefile @@ -4,6 +4,7 @@ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libnvpair LIB= nvpair +LIBADD= spl PACKAGE= runtime # user diff --git a/cddl/lib/libzfs_core/Makefile b/cddl/lib/libzfs_core/Makefile index 52747bfcc2d8..6350990064f7 100644 --- a/cddl/lib/libzfs_core/Makefile +++ b/cddl/lib/libzfs_core/Makefile @@ -5,7 +5,7 @@ LIB= zfs_core -LIBADD= nvpair +LIBADD= nvpair spl zutil PACKAGE= runtime INCS= libzfs_core.h diff --git a/cddl/lib/libzutil/Makefile b/cddl/lib/libzutil/Makefile index 7aea9da14e90..b2677eb3f8ae 100644 --- a/cddl/lib/libzutil/Makefile +++ b/cddl/lib/libzutil/Makefile @@ -5,7 +5,7 @@ .PATH: ${SRCTOP}/sys/contrib/openzfs/module/os/freebsd/zfs LIB= zutil -LIBADD= avl tpool +LIBADD= avl geom m tpool PACKAGE= runtime INCS = zutil_import.h diff --git a/cddl/usr.sbin/zfsd/Makefile.common b/cddl/usr.sbin/zfsd/Makefile.common index c18c796ce0ed..5e9257d7b37e 100644 --- a/cddl/usr.sbin/zfsd/Makefile.common +++ b/cddl/usr.sbin/zfsd/Makefile.common @@ -26,7 +26,7 @@ CFLAGS+= -I${SRCTOP}/cddl/usr.sbin # use issetugid(2) CFLAGS+= -D_MACHINE_FLOAT_H_ -DHAVE_ISSETUGID -LIBADD+= devdctl zfs zfs_core util geom bsdxml sbuf nvpair avl spl uutil zutil +LIBADD+= devdctl zfs util geom bsdxml sbuf nvpair avl uutil zutil cscope: find ${.CURDIR} -type f -a \( -name "*.[ch]" -o -name "*.cc" \) \ diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index c4d7ad8e2fcc..ae28000ca7f6 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -256,6 +256,7 @@ LIBVERIEXEC?= ${LIBVERIEXECDIR}/libveriexec.a _DP_80211= sbuf bsdxml _DP_9p= sbuf _DP_archive= z bz2 lzma bsdxml zstd +_DP_avl= spl _DP_zstd= pthread .if ${MK_BLACKLIST} != "no" _DP_blacklist+= pthread @@ -378,6 +379,7 @@ _DP_c+= ssp_nonshared _DP_stats= sbuf pthread _DP_stdthreads= pthread _DP_tacplus= md +_DP_nvpair= spl _DP_panelw= ncursesw _DP_rpcsec_gss= gssapi _DP_smb= kiconv @@ -389,9 +391,9 @@ _DP_uutil= avl spl _DP_zfs= md pthread umem util uutil m avl bsdxml crypto geom nvpair \ z zfs_core zutil _DP_zfsbootenv= zfs nvpair -_DP_zfs_core= nvpair +_DP_zfs_core= nvpair spl zutil _DP_zpool= md pthread z icp spl nvpair avl umem -_DP_zutil= avl tpool +_DP_zutil= avl geom m tpool _DP_be= zfs spl nvpair zfsbootenv _DP_netmap= _DP_ifconfig= m From nobody Mon Nov 29 14:28:07 2021 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 CD59A18B5CD2; Mon, 29 Nov 2021 14:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2nkw0rgxz3n1k; Mon, 29 Nov 2021 14:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE6F624104; Mon, 29 Nov 2021 14:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATES7VA059311; Mon, 29 Nov 2021 14:28:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATES7X4059310; Mon, 29 Nov 2021 14:28:07 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:28:07 GMT Message-Id: <202111291428.1ATES7X4059310@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: d364adc09c05 - stable/13 - Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: d364adc09c058ee838eef849072193b05d625f8b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638196088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TZBiAQFggHn1y6IktFMDQySeRpnCSCMkBVQhzoYntCA=; b=lYmTSusuzjHE0xhIMQLceHD0NC/5We6jCPktpnjkKjgCdN7ZAFRyOIm4jJQes2IAZJBXkd 3A9ChsGG3u/t091zuVR+RlqnwKEnqoZHd2FU2tQ4T7ULh6dOVwFlZ7aSvAFaYs7Z2FUb10 3i9pJG+t9SQncHci61mdzgwb1+C3EMPmjQ1gzDmtch7AzLA7dswlFqFGyL+uZP0HAO/5Xk hQ3uoxHNr/2frcIggNMXAVFaZ5pwxQXHPXOWGaSWD2EdIR7AEgsNFdQqwJ2CGxOfyIWCJh dvms4Fw+vtzTaKj2aYcrbd1n+fC4Che8c4JYCaZ1+REzeEGp2iYgmr8UpwrR0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638196088; a=rsa-sha256; cv=none; b=Rbznh+aokJoptXIDB7f9JraQeAP0HI6hTt2NVcp0/Q+s+az5alGOo4B9gv1dYkeaSBPiB1 89YjNfBQoepVY1nmMrQ9ZC5rEuYuPLhXNGewmYNGXqObfdVVjGbfrWg6G77LhOCerFTm/J HWBkzdFQwUBHShIvYmut02xnqtuuRivzKjF8IUBDGQOQHegCvnKBGelpoVl2EPmy65Cqpp R9zPm6Ho5H4/KAEzTOsSCVTm90/i9BiSHr+uOK4ZudDzQc/TwXcAkpBPWhwsQwEaKAAyAm ojCeJz9nMY9UTq/kuQ+JLSS83QHhJDHJ3R8xWCmf232r3O3YUNX05JdXr4Cfeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d364adc09c058ee838eef849072193b05d625f8b commit d364adc09c058ee838eef849072193b05d625f8b Author: Mark Johnston AuthorDate: 2021-11-26 14:27:19 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 14:27:49 +0000 Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block The compilation of several libraries under cddl/lib is not conditional on MK_ZFS = "yes", so their dependency on libspl is not conditional either. Unbreak buildworld when WITHOUT_ZFS is set. Reported by: bz Fixes: 9e9c651caceb ("cddl: fix missing ZFS library dependencies") (cherry picked from commit 7b3642da21cb4b1c301d8c6b6ce0847d19d8a473) --- Makefile.inc1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 34bb10e6925f..995ed7af3e4b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2995,6 +2995,8 @@ _cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libuutil= cddl/lib/libuutil _cddl_lib_libspl= cddl/lib/libspl +cddl/lib/libavl__L: cddl/lib/libspl__L +cddl/lib/libnvpair__L: cddl/lib/libspl__L cddl/lib/libuutil__L: cddl/lib/libavl__L cddl/lib/libspl__L .if ${MK_ZFS} != "no" @@ -3006,10 +3008,6 @@ _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib_libzfs= cddl/lib/libzfs _cddl_lib_libzfsbootenv= cddl/lib/libzfsbootenv -cddl/lib/libavl__L: cddl/lib/libspl__L - -cddl/lib/libnvpair__L: cddl/lib/libspl__L - cddl/lib/libtpool__L: cddl/lib/libspl__L cddl/lib/libzutil__L: cddl/lib/libavl__L lib/libgeom__L lib/msun__L cddl/lib/libtpool__L From nobody Mon Nov 29 14:58:56 2021 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 4DCD218C4980; Mon, 29 Nov 2021 14:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2pQT0HwZz4T8V; Mon, 29 Nov 2021 14:58:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF820244DC; Mon, 29 Nov 2021 14:58:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEwuiV099076; Mon, 29 Nov 2021 14:58:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEwuUZ099075; Mon, 29 Nov 2021 14:58:56 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:58:56 GMT Message-Id: <202111291458.1ATEwuUZ099075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 60c3b9a78ae9 - stable/13 - if_gif: fix vnet shutdown panic 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 60c3b9a78ae939bf705da2f22ae36a926f28ec8b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638197937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y6nvvBGo+gAm5glI+n/VouR1BObT+aTZZ84uz6JydzQ=; b=vJ6Pfa7P67J2KXIDBD5+3Cu4j+swZga2g7fQQEqoD3U2GUJzLJjT07JtmdgF/BkEHEYUwA 9UFaFL5wTKK+zExQWJ1UNSTtjwXqBX/zSdyYB1wcvH43UGP62BJPGF/zHSZNQtxI8CNlC/ ZVQU/BkBUTqN6cAX5eA+5GEeoF/emBfbJUisOb+DBnBCPvepPX/u2kRGdGmR+1l2q/s+v0 /gTh3ORRCDeIoDuHYvx4Vk7sGuS3a7YUfv5EDKlwYKP0cAjCjr6GMqXltO4WJfA1znFB5D t8nmKywD0nKm1YRNYdHvGQqfSB9KXaqHkgGjYb3QN8M/Jf7GL6zC48iv7vBoPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638197937; a=rsa-sha256; cv=none; b=LaAS54YlVbAgXbFVxXHfTUeGX6LTZGJo+y214f7j7oVFrsWG/mUoPX6gRDLeStzvFgTpM6 5F7sY2FsEWxNGP3u7HekDiXhTLCwf4Pxz46dmQEZIBlrog2AiB1z2q1SzysUDE1Jod/2gK 0wYkHf2Z0lO/Ssz/zgryWM8gK1cQ/XieO7oaDWhMswaIbEwoeVMYbxjsD+2wUbgCO9dL4f YIBcU+4aE3idDAMP5GWLrRV0NjQl6ZygPc5bqXxj7LK7SQBlHPG3qoWCrTVLkXCXVSL5Kg Mlfaz88Fn1pyNjsEjhml7pfLkuMXXXroSbzS6CpUKgqlHckvotnET7Nx1axNgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=60c3b9a78ae939bf705da2f22ae36a926f28ec8b commit 60c3b9a78ae939bf705da2f22ae36a926f28ec8b Author: Kristof Provost AuthorDate: 2021-11-04 17:05:58 +0000 Commit: Kristof Provost CommitDate: 2021-11-29 14:44:39 +0000 if_gif: fix vnet shutdown panic If an if_gif exists and has an address assigned inside a vnet when the vnet is shut down we failed to clean up the address, leading to a panic when we ip_destroy() and the V_in_ifaddrhashtbl is not empty. This happens because of the VNET_SYS(UN)INIT order, which means we destroy the if_gif interface before the addresses can be purged (and if_detach() does not remove addresses, it assumes this will be done by the stack teardown code). Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup operations happen in the correct order. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32835 (cherry picked from commit 8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d) --- sys/net/if_gif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 796f427e356b..ea4b80690e50 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -214,7 +214,7 @@ vnet_gif_init(const void *unused __unused) in6_gif_init(); #endif } -VNET_SYSINIT(vnet_gif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_init, NULL); static void @@ -229,7 +229,7 @@ vnet_gif_uninit(const void *unused __unused) in6_gif_uninit(); #endif } -VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_uninit, NULL); static int From nobody Mon Nov 29 14:58:57 2021 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 97D2C18C490D; Mon, 29 Nov 2021 14:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2pQV1QC9z4TMp; Mon, 29 Nov 2021 14:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06C30245E7; Mon, 29 Nov 2021 14:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEwvoI099132; Mon, 29 Nov 2021 14:58:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEwvp7099131; Mon, 29 Nov 2021 14:58:57 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:58:57 GMT Message-Id: <202111291458.1ATEwvp7099131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9bb3c824f523 - stable/13 - net tests: basic if_gif(4) test case 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9bb3c824f523fb9f1ea09fb88651a974a27cda31 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638197938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hVKmbevwEfsXe8xDH4Y05d4VFDkUIINjZYfnGXnJNk=; b=X0Z4xGOkIA9jjY52O2BszFKd/n7LM6IFuc7a2HQ2CvAuWgrFGSo278424OtSgyQxy+7vuM tr+pIjy0PRhWRld2SMH3Yjta0uYsdaJklFwybu7Q11UFX/ZYViMrH2AeVmR52DQHGLEfRo GUHZ/pmeryoxCKs85lWmMEWB8viMuyzSZyUu568na62d7Wf6dfIIgEUW1W8hTiGzAoGlZw s9gpPdKLt+Qwnx/CI8s2un35gPlPT7DPhxBuKUBcHm/B7y6nLi/9xMmk4dl/OzmLDg6GXx z5WPYtShbTPsZTRD94HS8MSWGKleO3XE8/wAcM6ddCbCBaOKUrb9UcXtotgoDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638197938; a=rsa-sha256; cv=none; b=f0LNrHBJq6tf13+/4x5tI0b1xYHa9BNMp0WDuu6QnGm7Dt1QbHvU9AbsyEpr7uFGmsM5U6 ssik0atKePL3b2xpJH4lU04cEW0h0rjqJhEkcP8VOmyt0o28x0bljf4wzOmC+N14owH9jZ ToaNSZXWerF3DBkexzFDlqDkLFqsCZ6kLm8Bp4yDLdKe4FTS6+2MtIjtuwe5XX9qugfH3T FbtWxG5y8QPp/EkKLJB4LWsS3kewydkUmwfHsfHohcM4J+qWhc8Y9x9GBhO+QVEYpmpvMV MIZi7rhOS2d6KglawadIFbNAfsgfkdUF9+4ro5yGY73tTlbdNBJ3V0p8aRXBNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9bb3c824f523fb9f1ea09fb88651a974a27cda31 commit 9bb3c824f523fb9f1ea09fb88651a974a27cda31 Author: Kristof Provost AuthorDate: 2021-11-04 16:15:19 +0000 Commit: Kristof Provost CommitDate: 2021-11-29 14:44:40 +0000 net tests: basic if_gif(4) test case MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32836 (cherry picked from commit 6e0755b37b20f776c7a9ac7a720db1af13966717) --- tests/sys/net/Makefile | 1 + tests/sys/net/if_gif.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 4771040816b7..9ff2b8c775b5 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -9,6 +9,7 @@ ATF_TESTS_C+= if_epair ATF_TESTS_SH+= if_bridge_test TEST_METADATA.if_bridge_test+= required_programs="python" ATF_TESTS_SH+= if_clone_test +ATF_TESTS_SH+= if_gif ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan diff --git a/tests/sys/net/if_gif.sh b/tests/sys/net/if_gif.sh new file mode 100644 index 000000000000..e4cf3722565a --- /dev/null +++ b/tests/sys/net/if_gif.sh @@ -0,0 +1,77 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic gif(4) test' + atf_set require.user root +} + +basic_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a 192.0.2.1/24 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone tunnel 192.0.2.1 192.0.2.2 + jexec one ifconfig $gone inet 198.51.100.1/24 198.51.100.2 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b 192.0.2.2/24 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo tunnel 192.0.2.2 192.0.2.1 + jexec two ifconfig $gtwo inet 198.51.100.2/24 198.51.100.1 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.0.2.2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec two ping -c 1 198.51.100.1 +} + +basic_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} From nobody Mon Nov 29 14:58:58 2021 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 876C118C4777; Mon, 29 Nov 2021 14:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2pQV45Z6z4T8b; Mon, 29 Nov 2021 14:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 278F62462C; Mon, 29 Nov 2021 14:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEww7w099183; Mon, 29 Nov 2021 14:58:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEwwve099182; Mon, 29 Nov 2021 14:58:58 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:58:58 GMT Message-Id: <202111291458.1ATEwwve099182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b4a51fd9c124 - stable/12 - if_gif: fix vnet shutdown panic 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b4a51fd9c12493e9e7ca6e2ac572ec41d99a941c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638197939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=odeC/Xq9WSmf+IC2AE1HmeRQK6akJCSCOGEespCNuDk=; b=sEQLP1Fu7G93ksmfvKk+n9nVQU9bgLvCg/dDRhLzp+gdlnTBGIlgtKmu4NpswO+npE20DD oqj/pN8LwotMWHbBztGHd961IdyKR1DaoCgexS6Cs3nY3zsapMPaYXarIZ0liVGJ5oHgxi McDPmo+Ni3H83cMMC4MixR3EUp4mR7lfTPAK4NK5XCrOzZFI1Mj2/nEp+F6rSRH9CGJupI AKG0c0ZcLbUe9cTjhlAiz1a1ThqJF3mtbYgnZUyHAy673iwZQjdxR/j0mHz0emhe4/AJrP xu0SckRBAz1/oYKnHw7p6S6OUHLJ8OHXxJIyxFXT2d1xInv4OZIQbPJCwKbBvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638197939; a=rsa-sha256; cv=none; b=MB+lpfvYcbZ28PPBMmkalnwWKZpC2Q4VS3eb4hwlNHUyvlwA/Hy+ZnnbOcuPS7nK0fgssJ Jr0RqXrVnFAKVHbzgcnh6p5P03WDz2Ygn/HjgJTnbyeUzaBopbthktLTpPMDUfU54clE7S AyEqGg5aOVIdvLZ5w3WxftcEtVgUwuZ6oRNiO/YO9Chs2IE1mQoNMJx6wiNCgmzA6mh6u6 mO9W5LdynbGutMkBqfO8DpkuzSStLjpFduOeNrt3+ey/IH1xVvmI7FRBP66tA7EDEt3Etv OXgEgUIZi1TsP8iGpC5MVmG8TGWuaZGkvyuPJ0qoSBO4OPH29G4jdaS5+uI9VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a51fd9c12493e9e7ca6e2ac572ec41d99a941c commit b4a51fd9c12493e9e7ca6e2ac572ec41d99a941c Author: Kristof Provost AuthorDate: 2021-11-04 17:05:58 +0000 Commit: Kristof Provost CommitDate: 2021-11-29 14:58:07 +0000 if_gif: fix vnet shutdown panic If an if_gif exists and has an address assigned inside a vnet when the vnet is shut down we failed to clean up the address, leading to a panic when we ip_destroy() and the V_in_ifaddrhashtbl is not empty. This happens because of the VNET_SYS(UN)INIT order, which means we destroy the if_gif interface before the addresses can be purged (and if_detach() does not remove addresses, it assumes this will be done by the stack teardown code). Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup operations happen in the correct order. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32835 (cherry picked from commit 8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d) --- sys/net/if_gif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index c9ccee4c98bd..ae70cb9e7715 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -214,7 +214,7 @@ vnet_gif_init(const void *unused __unused) in6_gif_init(); #endif } -VNET_SYSINIT(vnet_gif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_init, NULL); static void @@ -229,7 +229,7 @@ vnet_gif_uninit(const void *unused __unused) in6_gif_uninit(); #endif } -VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_uninit, NULL); static int From nobody Mon Nov 29 14:58:59 2021 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 244C318C4926; Mon, 29 Nov 2021 14:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2pQW3wY7z4TKb; Mon, 29 Nov 2021 14:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B38624069; Mon, 29 Nov 2021 14:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEwxep099237; Mon, 29 Nov 2021 14:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEwxRs099236; Mon, 29 Nov 2021 14:58:59 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:58:59 GMT Message-Id: <202111291458.1ATEwxRs099236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 09dfa60b58e8 - stable/12 - net tests: basic if_gif(4) test case 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 09dfa60b58e8a4dcbb82e2060a1f23cadb504474 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638197939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uLIJMbyILwPe+szH+WzeiQSNBuPpxadPMZoduuTKMaY=; b=eJSOCOMbE3wVH4QTl0YNb5OZ4LJQtpwyqBCyIDOcJ93OOlV5AbPP3hNKYgbEkiTlR5HXlA g+cCVrN7y/m7Zf5BAJf3jLjjsazzY11IVUVJjspc4WbpfkewjXRCWm2M+kdRRyt3RJ5pAw EeHI+SNguqfvBWe7EjUx5k1w2HyMk4yVGb8hsvnaZ0Ng5Ay48b+vDqa1j17/RUXYilu1mE kf0jucTuRTQ35XWVZADi4R1qrBD8BEUskPpnKSwv4KHHVQfqxOQXDilV1rMJMRMJbMAb4/ oLzQMZOTqC+7dI11lIrPrSKl741ehzDgiuyysuDABqEZEUqgr5/4FleEYfzMrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638197939; a=rsa-sha256; cv=none; b=uSwrrl4Kj0J0phOnHjuA8a5efYYHWgimpuBf9ko/MzIzoprRKN7aVonVqHSDf44GVDrgl3 N2JkRceFGulYSsf6U84yn8WPVoIu4xeLJXKlto7Wgae9G/Nq8dLTDifrOiZG5qq8Ci5fzY 9CWDDmyv1knoasyJxX24b9XWFcGSiBN4Vra/UywmTP6CrHwDwoSGCHF1vv/gBAFjA6lmu7 oA21vQlwESidG7mildwWNWVYCG9SD0SoQItyYC5D1H+aQ8KB1fIJPX9vlxB25UztmyMibA 03YfJEh26hfar/nZeGZITl54x4zQWc7aQAhwM2l82AbCm4R0LNffhdoehevdKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=09dfa60b58e8a4dcbb82e2060a1f23cadb504474 commit 09dfa60b58e8a4dcbb82e2060a1f23cadb504474 Author: Kristof Provost AuthorDate: 2021-11-04 16:15:19 +0000 Commit: Kristof Provost CommitDate: 2021-11-29 14:58:07 +0000 net tests: basic if_gif(4) test case MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32836 (cherry picked from commit 6e0755b37b20f776c7a9ac7a720db1af13966717) --- tests/sys/net/Makefile | 1 + tests/sys/net/if_gif.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index cccabd9fc775..7340688286cc 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -8,6 +8,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C+= if_epair ATF_TESTS_SH+= if_bridge_test ATF_TESTS_SH+= if_clone_test +ATF_TESTS_SH+= if_gif ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan diff --git a/tests/sys/net/if_gif.sh b/tests/sys/net/if_gif.sh new file mode 100644 index 000000000000..e4cf3722565a --- /dev/null +++ b/tests/sys/net/if_gif.sh @@ -0,0 +1,77 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic gif(4) test' + atf_set require.user root +} + +basic_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a 192.0.2.1/24 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone tunnel 192.0.2.1 192.0.2.2 + jexec one ifconfig $gone inet 198.51.100.1/24 198.51.100.2 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b 192.0.2.2/24 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo tunnel 192.0.2.2 192.0.2.1 + jexec two ifconfig $gtwo inet 198.51.100.2/24 198.51.100.1 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.0.2.2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec two ping -c 1 198.51.100.1 +} + +basic_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} From nobody Mon Nov 29 15:11:25 2021 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 2C16418AC8E5; Mon, 29 Nov 2021 15:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2phs6PLzz4bld; Mon, 29 Nov 2021 15:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD65524A1E; Mon, 29 Nov 2021 15:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATFBP8I022620; Mon, 29 Nov 2021 15:11:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATFBPJc022619; Mon, 29 Nov 2021 15:11:25 GMT (envelope-from git) Date: Mon, 29 Nov 2021 15:11:25 GMT Message-Id: <202111291511.1ATFBPJc022619@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: 8f02234dbd1d - stable/13 - Don't build sanitizer runtimes under WITHOUT_CXX 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 8f02234dbd1d578740b08afb4a0d6b877432adc9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638198685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SjQa7YA6ps2ufo1wWXU+FSO2oMNBftLvLKn9JmruUnQ=; b=oWXmJj8GCnvJuhF18Y+fvvlmUurBiN6mck5OMwOUGx2oOUzxgk8c6bXtPSEdLbYMU9Lnvs /IemXXMzHpIDrFBz/f3bw/4U0FOfRP35Ob8xC4QY9cps6ZM+Bb7xhIvOJ/kIYw00wlrFVK XjjpkWiI+0/A/LeWvChS+qvPWmwMsTBq8v6RcN2NWA5Oei7i7vfFmOAvXd8JwXBdM5vl/o /0jVPP3wt7ACsXgg3y3yhALUvQGS+zOLqTcATeSIP97j/bZ1kTb+ZMPjI81Ds+20a2fYBM DNF1ImgCkVP5gBOuYecc4rPnkCTSOlLO0j2a97LTqWb8QVsQLA6guLt3utlCNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638198685; a=rsa-sha256; cv=none; b=IGoSY2C9a3TOSy5O0xX2QuUjkuaoogYipJtG1gV1gIzfUJ2I2XteSzQKXd2sF/qxog6wGD PjOeO/qwGtfYsLecvMQ46NOPEKLiXHOys3JMoTfYQwvJvMHpewbcmAjJZdzpFGo+AedOwv KvaGx6ha/4nh2JV6VEabMfzuc4iZFuAWN3rdQdzYqyI1dw8Fk630ijhJKoEvDFTpPbLphe 3IwA68AwJGuTovs7Ueeq2+NWC2f42p1EQ1GC5pRpKwyjG2srRj4MrPACtMVYcBuYDSRClo Ag82qe/zfoX1j5d+vwlvxXDMJiEgprMEwUfb/ormXdbkZsJjiR5DsN7evJpBEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8f02234dbd1d578740b08afb4a0d6b877432adc9 commit 8f02234dbd1d578740b08afb4a0d6b877432adc9 Author: Ed Maste AuthorDate: 2021-10-29 00:49:12 +0000 Commit: Ed Maste CommitDate: 2021-11-29 15:10:53 +0000 Don't build sanitizer runtimes under WITHOUT_CXX In the past we built the sanitizer runtimes when building Clang (and using Clang as the compiler) but 7676b388adbc changed this to be conditional only on using Clang, to make the runtimes available for external Clang. They fail to build when WITHOUT_CXX is set though, so add MK_CXX as part of the condition. Reported by: Michael Dexter, Build Option Survey Reviewed by: imp, jrtc27 Fixes: 7676b388adbc ("Always build the sanitizer runtimes...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32731 (cherry picked from commit ad09e2c8cfbc2cf6f2b8826c121d6de8b3bfe96d) --- lib/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 3c218415d9ca..f42909ec0b09 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -172,10 +172,9 @@ SUBDIR.${MK_KERBEROS_SUPPORT}+= libcom_err SUBDIR.${MK_LDNS}+= libldns SUBDIR.${MK_STATS}+= libstats -# The libraries under libclang_rt can only be built by clang, and only make -# sense to build when clang is enabled at all. Furthermore, they can only be -# built for certain architectures. -.if ${COMPILER_TYPE} == "clang" && \ +# The libraries under libclang_rt can only be built by clang and when we enable +# C++ support. Furthermore, they can only be built for certain architectures. +.if ${COMPILER_TYPE} == "clang" && ${MK_CXX} != "no" && \ (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "powerpc") From nobody Mon Nov 29 15:11:26 2021 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 008FC18AC8EB; Mon, 29 Nov 2021 15:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2phv0vXzz4bjQ; Mon, 29 Nov 2021 15:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB6792437E; Mon, 29 Nov 2021 15:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATFBQ1n022646; Mon, 29 Nov 2021 15:11:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATFBQYl022645; Mon, 29 Nov 2021 15:11:26 GMT (envelope-from git) Date: Mon, 29 Nov 2021 15:11:26 GMT Message-Id: <202111291511.1ATFBQYl022645@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: 8bb7b159b5b8 - stable/13 - src.opts.mk: Add WITHOUT_CXX dependencies 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 8bb7b159b5b892ab8bf597203690434309691860 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638198687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YO7/VzWcA77lh9aUlpH/IFxfebQVn+D3b53aInrnio4=; b=Qv5N+dBhGkVhehoKha+WL9FWr/ODtrMHN1D5DLXtxH64jsTTj256uSMxGWyDhE/FEG1OvP c4r/9Raxh89WkytrPUADnZLQJaZsZuvQuMeDskhfh4oIkysEmQ5weWukyg2DgELmm2+DCi 1Np1rzMWG2ER6rIls4FbZPP7BpkcbPwo7X4xce38VSuAWB3Sg6KHUXJDE2IqsqtfQ9ze5k PWcTa1CG4dyx9kqhbroaW9VCghu+xM5fgdFibpNdz53Dl5KsRc3PaULcgjZGvqT0QQqwTb ykrWVa8LBAGQFKKxeOOYlrdqmIMov57P0IWBgGXd2HE3Mx0lOZEpKNWz3PkcdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638198687; a=rsa-sha256; cv=none; b=slm4ahZAOeq+xaECvKqoos8C/HT57d1db+n4Q8gzhbwD7ipTX51bjLaqas+UdHoeIr5HlI nWko3KFb15LNFeaUxvz1UwLULNBhiRVTWrojQc2gCrDJ/0OT/brwActIcs551nnWv8kjD9 VmFrdEnF9bin4+biNjwMxcrZ4LNLQZd5jK7vML0lp3dJkezp8IUdcBX/rxZdf/Kh1Hy+HL aE3uIkmYnzdELJ12q4tyz0mWV7zcZ66HMAvfgOgDuuOANMpxJuqcIU42mJmRNqCkPNbO/J Ykr4KBcs6wE3XlyztLdkfaohvzybh1vi7bVBy4Hgqmwb1zVGiQxa0KVKrKc22g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8bb7b159b5b892ab8bf597203690434309691860 commit 8bb7b159b5b892ab8bf597203690434309691860 Author: Ed Maste AuthorDate: 2021-10-29 01:43:33 +0000 Commit: Ed Maste CommitDate: 2021-11-29 15:10:53 +0000 src.opts.mk: Add WITHOUT_CXX dependencies OFED, OPENMP, and PMC depend on C++ support. Force them off when building WITHOUT_CXX. Reported by: Michael Dexter, Build Option Survey Reviewed by: imp, jrtc27 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32730 (cherry picked from commit 0e1c864898c1803835b1be0d59342ca761051db8) --- share/mk/src.opts.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 9c1138a446ca..d692b7efe58b 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -395,6 +395,9 @@ MK_KERBEROS_SUPPORT:= no .if ${MK_CXX} == "no" MK_CLANG:= no MK_GOOGLETEST:= no +MK_OFED:= no +MK_OPENMP:= no +MK_PMC:= no MK_TESTS:= no .endif From nobody Mon Nov 29 15:11:27 2021 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 87F0718AC9C3; Mon, 29 Nov 2021 15:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2phw37h0z4bRH; Mon, 29 Nov 2021 15:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1368024B89; Mon, 29 Nov 2021 15:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATFBSJ2022671; Mon, 29 Nov 2021 15:11:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATFBRAx022670; Mon, 29 Nov 2021 15:11:27 GMT (envelope-from git) Date: Mon, 29 Nov 2021 15:11:27 GMT Message-Id: <202111291511.1ATFBRAx022670@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: 7cc6e39cb6a9 - stable/13 - Do not build libatf-c++ when WITHOUT_CXX 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 7cc6e39cb6a934dea99a6aff336b353e938fbc58 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638198688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wMpyX1/2sb1JdDyTdHHZ3To5aDkwOrlUjK7lCnL1IeE=; b=qs/DfNMUR0jz4gGye92Z8WU4T72ouvSCQs24UGFNsPAxheHnjoTybry5GVEOr2ZacMa5RB o/09DeyMsNGPeb33cA4n98nlFi9W2MOzwzMVWoZr3sLdFJ8X1bUJwJwDaFlM7xn/zuzL9Y JCJ/Pt2Z8qLJxXxl4AnxZgaKbC6cOz+twed5S5Ad1LDcdvDczO85OiIhzRO2CfS4BUlCql ITRjeXtD9zbf0S5JZ4+caBa4WInw4exeSnGwbEhVmVUmyZ/MiyoQ5gn9iXBImlA/WqoKpz yJe/8tuEUyK6yOoKl7nkBy/RlUm6XH4kpITZH1WohgQ5EOx1VDDwWisZp2KjOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638198688; a=rsa-sha256; cv=none; b=hweyWkqFjAdDd5WhMyx6wYy1hh7cDGtREJ+gddZYv4ZdYsA367zWj1gpDk+Erv6Q640fOE 7YYgcvYc1eDxwMS7IeLXTTkjS74lbqCJmPHex9m/pseiFR0/2sbG049Xu+ayZPqOmjSfL8 k5yskKKWApamOktsngP61X2s/EpO0yQnFE2qdkpbrgcE/VdkH95QaWbbvkVtMFhl9hVaur MN1dNlWxf1IZrQ3Bw294uaaYEG+19W2h3TerpEeB+APM1ue1KGHQbewh0tmXhmzyQqDMVD pCQXYf4BVjIxD8aziOdy+ltBPduIs7Je498hcXKAjK+h7oEQy106GRI5sXfUSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7cc6e39cb6a934dea99a6aff336b353e938fbc58 commit 7cc6e39cb6a934dea99a6aff336b353e938fbc58 Author: Ed Maste AuthorDate: 2021-10-29 03:01:21 +0000 Commit: Ed Maste CommitDate: 2021-11-29 15:10:53 +0000 Do not build libatf-c++ when WITHOUT_CXX libatf-c++ requires C++ support. From jrtc27: bit slightly odd this isn't gated by MK_TESTS (which itself depends on MK_CXX), but this makes sense given the current behaviour. Reported by: Michael Dexter, Build Option Survey Reviewed by: imp, jrtc27 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32732 (cherry picked from commit 6ce99625ca7acecaa64723f0440007eb3f60f53d) --- lib/atf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/atf/Makefile b/lib/atf/Makefile index baadf535b424..05c7973fdc02 100644 --- a/lib/atf/Makefile +++ b/lib/atf/Makefile @@ -27,8 +27,8 @@ .include -SUBDIR= libatf-c \ - libatf-c++ \ +SUBDIR= libatf-c +SUBDIR.${MK_CXX}+= libatf-c++ SUBDIR.${MK_TESTS}+= tests From nobody Mon Nov 29 15:11:30 2021 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 A140818ACAC9; Mon, 29 Nov 2021 15:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2phy4jt3z4bRT; Mon, 29 Nov 2021 15:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56290246FD; Mon, 29 Nov 2021 15:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATFBUE9022734; Mon, 29 Nov 2021 15:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATFBUis022733; Mon, 29 Nov 2021 15:11:30 GMT (envelope-from git) Date: Mon, 29 Nov 2021 15:11:30 GMT Message-Id: <202111291511.1ATFBUis022733@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: 23566768d92a - stable/13 - syslogd: fix WITHOUT_INET builds 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 23566768d92aed2a59d3e5d9392824cbe83b867f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638198691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e2jv/N9o25exI8oKDqJWrlHtQuOmDUuIs61whiGKIJM=; b=mE/PN04+NE9lEUcrdyeJRTbMKB/wE0E12abyUTr0SAqmCO4841Vfk+ipBW/im1EXJlrngd hZbJXvrRHAjA73ConAbonUHiY/DXwXCxa+w0Yo4J4gBHghlifAvVW/SntEsBPubJ1IS8fA KCUBzR/mEtzqsBD6Pj1d5aDzGZ9UsNIrFZ1h62Ho8CgLXt5KGvNv0Kuf0IKe4GpmnENalb RmwmIeZaG99wOZPmAAE+cHVUjP7WcU0YA/M1xRPLM515fiOSAAnIsqX/pV4z5yFcctduSc bzie9PRjzkKNZnKLcylxJeD5Ky6Ny6RVjYWWGTHm8njmFIRf9uwcAEwmPa+ycg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638198691; a=rsa-sha256; cv=none; b=RAz+qbommyknVNR2uALivbLK+gQjJPhT26JmwW4vnG3v8LsWTK9KBSZ1cCwA7uGT89QOws XcgYK9FEjgjOjA2+5P9Aj6OOgltvmjQmEOw19+AhJMKZUZG4fh5InmksnTV7Ayjso5jCkm CKoQKRZzkZBSW6PU24/ARJEQxt2RHJxXpTtS0fYCVU9WOYi3rfy8pnlEbTqqjIRTPFAJ/d vjX8UPOFlepXc5sOY2RIBd7+NwqwzWqfNLK6zbTjeLLAvZ8udRYavG3Whh2ENZhTurOrI1 qK6O01AdrGOONmfes3PrfrF9fL5jp+E3csKgo9WZnNrzDOzCR6Px5YcqdRC0Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=23566768d92aed2a59d3e5d9392824cbe83b867f commit 23566768d92aed2a59d3e5d9392824cbe83b867f Author: Artem Khramov AuthorDate: 2021-06-12 17:21:13 +0000 Commit: Ed Maste CommitDate: 2021-11-29 15:10:53 +0000 syslogd: fix WITHOUT_INET builds Since 2d82b47 syslogd can't be built with `WITHOUT_INET` or `WITHOUT_INET6` build variables set, because `iovlist_truncate` is not defined but used. This change wraps the problematic `iovlist_truncate` call within ifdef directive. It's compiled out in this situation... Pull Request: https://github.com/freebsd/freebsd-src/pull/475 Reviewed by: imp@ (commit message slightly tweaked) (cherry picked from commit f06fa6f88733d709a5f9dd3a27b1a08571e49e6b) PR: 260098 --- usr.sbin/syslogd/syslogd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index c3b8af4fa8fa..5c2555480d3f 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1861,8 +1861,10 @@ fprintlog_write(struct filed *f, struct iovlist *il, int flags) dprintf("\n"); } +#if defined(INET) || defined(INET6) /* Truncate messages to maximum forward length. */ iovlist_truncate(il, MaxForwardLen); +#endif lsent = 0; for (r = f->fu_forw_addr; r; r = r->ai_next) { From nobody Mon Nov 29 15:11:29 2021 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 D524318AC96D; Mon, 29 Nov 2021 15:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2phy0F01z4bRN; Mon, 29 Nov 2021 15:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3485F24B8A; Mon, 29 Nov 2021 15:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATFBTSC022710; Mon, 29 Nov 2021 15:11:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATFBTkg022709; Mon, 29 Nov 2021 15:11:29 GMT (envelope-from git) Date: Mon, 29 Nov 2021 15:11:29 GMT Message-Id: <202111291511.1ATFBTkg022709@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: 3c1222232251 - stable/13 - src.conf.5: regen 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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: 3c1222232251e4e3b8bb69434fe7f9ca41444b1d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638198690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sfWZEy4Jf3rPID369x/R3DfOcj4UtL+jYcaJEbg8w/Y=; b=TRWkuBuxm7D9RlPVWGBbHLQFEPzp/AqKm+LwItOZs3P8cRxBX8wUnjNHZyXRuY/3vKq5dB 7y04OfgOAaQK2R85f2calbEW39ypYqfuQvxIn6FkOH42t+C5BtUY+Ya8KqjYwCtooUCJC+ 4/uTBpGTLVNje5nR9kBwkJ/qkYhBDBmqO6N20CMeIE9qZEzFKw7v/sZjLxz2z2SyKRytL0 ZdxqrzfPz0FcwkhVjRbveT/W/fNmy0kxDAuO2y0VlTkJuoZLkD91Aa8yt+HDAzVzGGvxGg ywwPIC1Xp7czW83ONQP/BU6xAH4pDi4OBI3MdYmkn01zMQJHWWACoPl+92pmLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638198690; a=rsa-sha256; cv=none; b=TaDEEd41vY4ePOQr5VZjJB2M5pVLNYOsKk99j/NlSlQwx1rC/qT7kc4VQNvZ916vHaHEmg 5YcaYz75VjecIjpli0GAI/pwQDc8U1YKi11eqYlE0sYCwRB0+d5VHpjkSXUFmOZMDk87TN wtX8Jb3nFr2qP/sZr7q8JQebhbSAwbNXSbp6jqHpNODZ2yUaRNnqhJNnLrEyWmogkL4Xyp 0zZxMjTyDvzFnH1IYo3lNLyFAr94hjeEXnI4dpiS3HQt+bsxLOOfplip/H0/noXeQOHfxi hD0QIU+fRKc9F6wZuLYogSi23imTEWGxSBZdw3Wtqjl9FUiK2KSsw9fRtzX1Lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3c1222232251e4e3b8bb69434fe7f9ca41444b1d commit 3c1222232251e4e3b8bb69434fe7f9ca41444b1d Author: Ed Maste AuthorDate: 2021-11-29 14:16:17 +0000 Commit: Ed Maste CommitDate: 2021-11-29 15:10:53 +0000 src.conf.5: regen --- share/man/man5/src.conf.5 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index eb15153b274e..2e8ec5764844 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 8, 2021 +.Dd November 29, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -393,6 +393,8 @@ When set, it enforces these options: .It .Va WITHOUT_OPENSSL .It +.Va WITHOUT_OPENSSL_KTLS +.It .Va WITHOUT_PKGBOOTSTRAP .It .Va WITHOUT_SVN @@ -456,6 +458,14 @@ When set, it enforces these options: .It .Va WITHOUT_LLVM_COV .It +.Va WITHOUT_OFED +.It +.Va WITHOUT_OFED_EXTRA +.It +.Va WITHOUT_OPENMP +.It +.Va WITHOUT_PMC +.It .Va WITHOUT_TESTS .El .It Va WITHOUT_DEBUG_FILES @@ -1296,6 +1306,8 @@ When set, it enforces these options: .It .Va WITHOUT_OPENSSH .It +.Va WITHOUT_OPENSSL_KTLS +.It .Va WITHOUT_PKGBOOTSTRAP .It .Va WITHOUT_SVN From nobody Mon Nov 29 17:56:51 2021 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 D7FFD18B987B; Mon, 29 Nov 2021 17:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2tMl46LZz4fLh; Mon, 29 Nov 2021 17:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E05426BE9; Mon, 29 Nov 2021 17:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATHupZj040841; Mon, 29 Nov 2021 17:56:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATHupaV040840; Mon, 29 Nov 2021 17:56:51 GMT (envelope-from git) Date: Mon, 29 Nov 2021 17:56:51 GMT Message-Id: <202111291756.1ATHupaV040840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 5c50e93e6ce4 - stable/13 - ext2fs: check for eh_depth in ext4_ext_check_header() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c50e93e6ce43e8558e043de0745bad889c3a77f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638208611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u+nuTnlVzRxKj368N1s+ThPT3VKouCtEmZyKhok4m64=; b=cL+7eUqsixTo9S0PaltAeS8YHjM3MM2KPejAXDLdNm7rmVEYfHmfhWjK4zjFLNk5XrEoYk Xfd2UwhCqAXv338IQVfaQpFtMx1IXeR2onBrvFe3bIErBy7gumeHoJ01Htd3+NIRn/b6lg J/IBCzJ+if4dbJ/O7vBT19k0Rkgye7B7Ot42yj5yBb/87yikIAEb/3jEMzRLdTwz94t9z0 Tbed3yIzNm1xeNR0Rp2e11ZWeprfIotFjoqA9L+GH3ht5nQRGSeaXk0Dnn+gB3C8DzqTkj W9UvGGfnwFDkQw5+im2zQ10gqYPw3Gptf77LHsCLpzhKg9htWZzqwf5mqoM39w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638208611; a=rsa-sha256; cv=none; b=diyDJ1AeBtwwa+Mb8NZzno67VD3Waesrhw4RD/ifiOP6Ni2PBj2i5T2WrChpnVK02Y3DCK 5d97sXNQ4nXgnDut0maRhuGOvf9jCOJWL8q2+matHXmvWgtBu1uAQbjVOqzO3gWruphceI gS7VHvZFYufhqr5EJW2s+l1VOf3j2OxexsyKm9ys1bzv8rAsu6yjplJpXNBXqGxOhOSwy9 NNE9YbGcw63zPceJUNKX9Ovqm3BQnGAW5aeNGvnxmAwsQ/V+itaSLHxmxP9+yfDTwTPBLW U0tkzYxIjSXCZKc2Vzm80LO2LuKDZa8BpedUOHxwPlYGC2CeFl5qUgcD4/RbNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5c50e93e6ce43e8558e043de0745bad889c3a77f commit 5c50e93e6ce43e8558e043de0745bad889c3a77f Author: Neel Chauhan AuthorDate: 2021-11-17 00:25:04 +0000 Commit: Neel Chauhan CommitDate: 2021-11-29 17:56:42 +0000 ext2fs: check for eh_depth in ext4_ext_check_header() PR: 259112 Reported by: Robert Morris Reviewed by: fsu (src) Differential Revision: https://reviews.freebsd.org/D33030 (cherry picked from commit be60d8f276fa20fc11ad814e54c9c2540f79c7da) --- sys/fs/ext2fs/ext2_extents.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/ext2fs/ext2_extents.c b/sys/fs/ext2fs/ext2_extents.c index 1a5dca66dd76..b33ff9fa8a1a 100644 --- a/sys/fs/ext2fs/ext2_extents.c +++ b/sys/fs/ext2fs/ext2_extents.c @@ -251,6 +251,10 @@ ext4_ext_check_header(struct inode *ip, struct ext4_extent_header *eh) error_msg = "header: invalid eh_entries"; goto corrupted; } + if (eh->eh_depth > 5) { + error_msg = "header: invalid eh_depth"; + goto corrupted; + } return (0); From nobody Mon Nov 29 17:57:19 2021 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 3864718B9AD5; Mon, 29 Nov 2021 17:57:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2tNH6Zxcz4fYR; Mon, 29 Nov 2021 17:57:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C158F26D41; Mon, 29 Nov 2021 17:57:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATHvJgX040993; Mon, 29 Nov 2021 17:57:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATHvJDk040992; Mon, 29 Nov 2021 17:57:19 GMT (envelope-from git) Date: Mon, 29 Nov 2021 17:57:19 GMT Message-Id: <202111291757.1ATHvJDk040992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 8facf7082d49 - stable/12 - ext2fs: check for eh_depth in ext4_ext_check_header() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8facf7082d4973aedc30cdd8e90fbd33beb17d7f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638208640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vvNofMRg5rp+EaDlaYbkRzu9W2Ikqsvut59+CWUXWe4=; b=sZtYdvYA7NcbsimtomtnqyYgbd7gxHqgKdyN8hk931PEuqmA7jjReAJUNEkU1fRU3BDyjv 6ul+8XhT6BcHjDncvqxUyHHTX9YpeVUjPbHxPl3BaiUvc/1hdhsvUDX8moggMkiZj4Q73x g+shrz6EAnQfDFMWK/6xpm5kvVPu9DXAWH7BZ+izzoPvHfGS2lOFOivQVMJWsJS43EmqGm 1OfZf99EqQTLf0XLp8xI6ARGD+bpb+3O45tPGS2CnP48gUJl6XzcmGqjVTHjiQtNCat3gM zQ1p5O5fsmA0MCmCvfkH7CUasA6VtFO2RMIniA0SrL4noo5kEdMvrHJc9mhIAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638208640; a=rsa-sha256; cv=none; b=Mf2upW302/JFzxMghyWaSID5TbkVrObIpj8By/GFu2foGM/shXXJLlt3G7rXsaPBJ/yP+E VXb0+HWwL1MFSe35P6Vnta6xT6z9KgzQsf7JtQLweFXUi+cEoxan0gg+VQ3tPeme4Ho3yf +DalZurCBlCno7hol/XfBuwPR5g5wJVb7SEWx0/d54JmG5gi4fGceDz3LUaZFjGOAyp8jV GPaQH8BKhQzV8HSCapQR9pqlh+5KELbBO0BE5p0AxvfST6RCKpsn0wYSfnEtr4o+bQd3u1 DIaWDUlsnU2sXpcd2vTXT+dyGlxEcCnAMk5u3ZLRYIFAOKPaRVBH1i7jLIArzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8facf7082d4973aedc30cdd8e90fbd33beb17d7f commit 8facf7082d4973aedc30cdd8e90fbd33beb17d7f Author: Neel Chauhan AuthorDate: 2021-11-17 00:25:04 +0000 Commit: Neel Chauhan CommitDate: 2021-11-29 17:57:12 +0000 ext2fs: check for eh_depth in ext4_ext_check_header() PR: 259112 Reported by: Robert Morris Reviewed by: fsu (src) Differential Revision: https://reviews.freebsd.org/D33030 (cherry picked from commit be60d8f276fa20fc11ad814e54c9c2540f79c7da) --- sys/fs/ext2fs/ext2_extents.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/ext2fs/ext2_extents.c b/sys/fs/ext2fs/ext2_extents.c index 61c751e9af5e..ba95b8a6f3ae 100644 --- a/sys/fs/ext2fs/ext2_extents.c +++ b/sys/fs/ext2fs/ext2_extents.c @@ -250,6 +250,10 @@ ext4_ext_check_header(struct inode *ip, struct ext4_extent_header *eh) error_msg = "header: invalid eh_entries"; goto corrupted; } + if (eh->eh_depth > 5) { + error_msg = "header: invalid eh_depth"; + goto corrupted; + } return (0); From nobody Tue Nov 30 01:35:37 2021 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 2AD9118BBC82; Tue, 30 Nov 2021 01: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J34Y55GZhz3nKf; Tue, 30 Nov 2021 01:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9617F53EA; Tue, 30 Nov 2021 01:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AU1Zb1C054605; Tue, 30 Nov 2021 01:35:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AU1ZbJc054604; Tue, 30 Nov 2021 01:35:37 GMT (envelope-from git) Date: Tue, 30 Nov 2021 01:35:37 GMT Message-Id: <202111300135.1AU1ZbJc054604@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: 02e3eb8d482d - stable/13 - mbuf: Only allow extpg mbufs if the system has a direct map 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 02e3eb8d482d513f1870b36c523a8f39a1c67b94 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638236137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2nh1SRx4AQlcnrAKNoCoxDgVNm8VnUVkB4f8tQTs+vI=; b=q5alA+imXfjJ+rbAl2jAbBuMZxBPnPm8WS5h2SWP40iupWtZEaeRuy0ZI4xiIK+jwSUZ4h vIe8odpme6513RreiCKr0oUZjyaA1myui/qWUrMCfdi/0G39elCdmFeA8x7qeHNtid2X1q 4CUoYNBdfg+EVip+iVE1w0Wo+vqQeKi0ymBY+4DXzB2GZIPnzvirrdgYY3bJxKdX7Z8UC0 EXSg5Gmb5mbn6snX3G2eN4Waf+XFuqZ2MMnDhxAVUU74JFxcJFNmEyNp7qxrYF8DUU8HCU hOXrVibksb88tO/HQYwX9K+YxAhwvSIHBeg3aZ/BXIyU9AhEKlQ+gTAaA0v6tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638236137; a=rsa-sha256; cv=none; b=wLm8WYtEA9eDUewLpQ8Hs2eYlPhVsMH8FECXhj2bCedOkGyLhz2MTKZYuqet4wCIeKCi58 8Y+cjSgTx7x0jTKqPsy5HVgDKe8/FVvITninoTRNhatBchiUKFdkXF+sTDm9i8FNgYUGsU Zi5prP0BABwkUGd30G7KMqnHP54z+uJ0i/ttLeVMQHz3rgawyBqUW9RhsC3Mh6Wf+gqg0b zVn05sfvryGdQWI/Y3+3fWaTa2H12U+q24sP/PhaHxij55+VeAsyLduAxVt+EjY7mVmoRK OJxT2gvaZHYSWzFh1WxPRP46/CGez0rSg1nR+RDpvvJn6o7TLLBIKpOqaecdCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=02e3eb8d482d513f1870b36c523a8f39a1c67b94 commit 02e3eb8d482d513f1870b36c523a8f39a1c67b94 Author: Mark Johnston AuthorDate: 2021-11-16 18:31:04 +0000 Commit: Mark Johnston CommitDate: 2021-11-30 01:34:54 +0000 mbuf: Only allow extpg mbufs if the system has a direct map Some upcoming changes will modify software checksum routines like in_cksum() to operate using m_apply(), which uses the direct map to access packet data for unmapped mbufs. This approach of course does not work on platforms without a direct map, so we have to disallow the use of unmapped mbufs on such platforms. I believe this is the right tradeoff: we only configure KTLS on amd64 and arm64 today (and one KTLS consumer, NFS TLS, requires a direct map already), and the use of unmapped mbufs with plain sendfile is a recent optimization. If need be, m_apply() could be modified to create CPU-private mappings of extpg mbuf pages as a fallback. So, change mb_use_ext_pgs to be hard-wired to zero on systems without a direct map. Note that PMAP_HAS_DMAP is not a compile-time constant on some systems, so the default value of mb_use_ext_pgs has to be determined during boot. Reviewed by: jhb Discussed with: gallatin Sponsored by: The FreeBSD Foundation (cherry picked from commit fcaa890c4469118255d463495b4044eef484fa3e) --- sys/kern/kern_mbuf.c | 32 ++++++++++++++++++++++++++++++-- sys/rpc/rpcsec_tls/rpctls_impl.c | 2 +- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 4e818d87a756..3a389e1f2fd3 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -116,9 +116,26 @@ int nmbjumbop; /* limits number of page size jumbo clusters */ int nmbjumbo9; /* limits number of 9k jumbo clusters */ int nmbjumbo16; /* limits number of 16k jumbo clusters */ -bool mb_use_ext_pgs = true; /* use M_EXTPG mbufs for sendfile & TLS */ -SYSCTL_BOOL(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLFLAG_RWTUN, +bool mb_use_ext_pgs = false; /* use M_EXTPG mbufs for sendfile & TLS */ + +static int +sysctl_mb_use_ext_pgs(SYSCTL_HANDLER_ARGS) +{ + int error, extpg; + + extpg = mb_use_ext_pgs; + error = sysctl_handle_int(oidp, &extpg, 0, req); + if (error == 0 && req->newptr != NULL) { + if (extpg != 0 && !PMAP_HAS_DMAP) + error = EOPNOTSUPP; + else + mb_use_ext_pgs = extpg != 0; + } + return (error); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLTYPE_INT | CTLFLAG_RW, &mb_use_ext_pgs, 0, + sysctl_mb_use_ext_pgs, "IU", "Use unmapped mbufs for sendfile(2) and TLS offload"); static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ @@ -137,6 +154,7 @@ static void tunable_mbinit(void *dummy) { quad_t realmem; + int extpg; /* * The default limit for all mbuf related memory is 1/2 of all @@ -173,6 +191,16 @@ tunable_mbinit(void *dummy) if (nmbufs < nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) nmbufs = lmax(maxmbufmem / MSIZE / 5, nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16); + + /* + * Unmapped mbufs can only safely be used on platforms with a direct + * map. + */ + if (PMAP_HAS_DMAP) { + extpg = mb_use_ext_pgs; + TUNABLE_INT_FETCH("kern.ipc.mb_use_ext_pgs", &extpg); + mb_use_ext_pgs = extpg != 0; + } } SYSINIT(tunable_mbinit, SI_SUB_KMEM, SI_ORDER_MIDDLE, tunable_mbinit, NULL); diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index 110ba107540a..c495213b08e2 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -711,7 +711,7 @@ rpctls_getinfo(u_int *maxlenp, bool rpctlscd_run, bool rpctlssd_run) int error; size_t siz; - if (PMAP_HAS_DMAP == 0 || !mb_use_ext_pgs) + if (!mb_use_ext_pgs) return (false); siz = sizeof(enable); error = kernel_sysctlbyname(curthread, "kern.ipc.tls.enable", From nobody Tue Nov 30 01:35:38 2021 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 D11E318BBB98; Tue, 30 Nov 2021 01:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J34Y70Z2pz3n5q; Tue, 30 Nov 2021 01:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4C0154D9; Tue, 30 Nov 2021 01:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AU1Zcj2054631; Tue, 30 Nov 2021 01:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AU1ZcCC054630; Tue, 30 Nov 2021 01:35:38 GMT (envelope-from git) Date: Tue, 30 Nov 2021 01:35:38 GMT Message-Id: <202111300135.1AU1ZcCC054630@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: 422456ae27f5 - stable/13 - sctp: Use m_apply() to calcuate a checksum for an mbuf chain 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 422456ae27f5f79dee3969de9190fbe9b9301c3c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638236139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ujecD9ihZvX7EQy6pZT8qEKudshjvSnhNEv9FEf027g=; b=ONqlZtZHVBxO1pOmiWFNDND2RJHYDUxlFJmCrV7mlnk0MJq+k5JA07kPyAANLJVEt/U7Ip TmU1xzk4ekA9qeWjGXTJWa/bQBHQkekOLiluIJqnoBcDFJcymi7+pVPGVliDkiWLha6zFL IoukliXYR29+eUu2D0kzDY2IuDJY8rXb2CjkefCzMm6EwYy7RMrUaS1/ASxzxkGmcCwbBy v8kIszGHCX7ZR32CKP3dzft51TMyOIi0+OXYI0PAd7jNs+ZOy3VHmXTBPy4Us8VQYYxgYv Q7lk8mhnO1puOsYZGYtMQF2Azl4afj+mGxjLfS4S7k23Dt7KpvKCQWPB1IZY3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638236139; a=rsa-sha256; cv=none; b=Jv8UufvmZuXuCYuWIqZ7IThho1mMvKxd45FV3VOw4c5Z/Yc88/dmhI7C7NKRbCvTRueNN+ 26ZXuUOszr1qXb64bbVeuYLXlBakGXAeTK+3ZmR5TrbhM6mBkGTMUP/1kteZoy6/OK26PU dYmSCPUpI1yoK1reUvPWS/ChIMSzmMbqiSgI0VmVyzBArpmiGO6R+8XNpdVFftYSyVVV5r MNBuemjN1faNrN/9lDtIooNtfOdE4/yY3gZN+bRGQtsc0zpoo4/jmrJunc3VZP27JqpDhT 81AFtURawof7lDZsEE2vl+YIs+19/wN0pP+vqna4+e1AWjEHNTrNEU1yrLagkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=422456ae27f5f79dee3969de9190fbe9b9301c3c commit 422456ae27f5f79dee3969de9190fbe9b9301c3c Author: Mark Johnston AuthorDate: 2021-11-16 18:36:30 +0000 Commit: Mark Johnston CommitDate: 2021-11-30 01:35:08 +0000 sctp: Use m_apply() to calcuate a checksum for an mbuf chain m_apply() works on unmapped mbufs, so this will let us elide mb_unmapped_to_ext() calls preceding sctp_calculate_cksum() calls in the network stack. Modify sctp_calculate_cksum() to assume it's passed an mbuf header. This assumption appears to be true in practice, and we need to know the full length of the chain. No functional change intended. Reviewed by: tuexen, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit b4d758a0cc54d991d2bdf7f697ec0b6b3fd6230d) --- sys/netinet/sctp_crc32.c | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/sys/netinet/sctp_crc32.c b/sys/netinet/sctp_crc32.c index a36d36dc4861..97b881bb5062 100644 --- a/sys/netinet/sctp_crc32.c +++ b/sys/netinet/sctp_crc32.c @@ -80,6 +80,16 @@ sctp_finalize_crc32c(uint32_t crc32c) return (crc32c); } +static int +sctp_calculate_cksum_cb(void *arg, void *data, u_int len) +{ + uint32_t *basep; + + basep = arg; + *basep = calculate_crc32c(*basep, data, len); + return (0); +} + /* * Compute the SCTP checksum in network byte order for a given mbuf chain m * which contains an SCTP packet starting at offset. @@ -89,30 +99,17 @@ sctp_finalize_crc32c(uint32_t crc32c) uint32_t sctp_calculate_cksum(struct mbuf *m, uint32_t offset) { - uint32_t base = 0xffffffff; - - while (offset > 0) { - KASSERT(m != NULL, ("sctp_calculate_cksum, offset > length of mbuf chain")); - if (offset < (uint32_t)m->m_len) { - break; - } - offset -= m->m_len; - m = m->m_next; - } - if (offset > 0) { - base = calculate_crc32c(base, - (unsigned char *)(m->m_data + offset), - (unsigned int)(m->m_len - offset)); - m = m->m_next; - } - while (m != NULL) { - base = calculate_crc32c(base, - (unsigned char *)m->m_data, - (unsigned int)m->m_len); - m = m->m_next; - } - base = sctp_finalize_crc32c(base); - return (base); + uint32_t base; + int len; + + M_ASSERTPKTHDR(m); + KASSERT(offset < m->m_pkthdr.len, + ("%s: invalid offset %u into mbuf %p", __func__, offset, m)); + + base = 0xffffffff; + len = m->m_pkthdr.len - offset; + (void)m_apply(m, offset, len, sctp_calculate_cksum_cb, &base); + return (sctp_finalize_crc32c(base)); } #if defined(SCTP) || defined(SCTP_SUPPORT) From nobody Tue Nov 30 01:35:39 2021 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 F121818BBAC1; Tue, 30 Nov 2021 01:35:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J34Y81StQz3nBG; Tue, 30 Nov 2021 01:35:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E751253EB; Tue, 30 Nov 2021 01:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AU1ZdZt054660; Tue, 30 Nov 2021 01:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AU1ZdNM054659; Tue, 30 Nov 2021 01:35:39 GMT (envelope-from git) Date: Tue, 30 Nov 2021 01:35:39 GMT Message-Id: <202111300135.1AU1ZdNM054659@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: 5b5bbf2e7c34 - stable/13 - sctp: Remove now-unneeded mb_unmapped_to_ext() calls 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 5b5bbf2e7c341ec6ba569536fb14acb990d53334 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638236140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HEKZZd4gMvSQH95ey7MkqhPm3lJELcGobHynSI2GYK0=; b=yViCLOBaOlFl7xWerTOxOhKrlPZ/G3sKAd+U4iGrKkcn2/X7Gdl1NwcIHXFqyL5y1vZj9G QLdadVwkP6Eap9PlM7xpKCMKe9EKEh5wNAfHhWE5W3QZgQItS+HogRBo+bgkt+3mjbMHZT Wn8xqa6LIg1mM9WojZCmOUeAvhc5dRxi8yqBrfriGUggOPAOIAV+wvmGrBQfxy+S4doHqF gSLT7JsMMRfbS1Dm0UDddhDhTN0SOqg2PtRcq2UqrecBURu0b13DGx1dknt6feL71qP+tf hD2pux65rT2uT+A/PSKLEEEMDsQ7AfwI3pca4gEkvmHMDDf8jsxazqVjNYdv2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638236140; a=rsa-sha256; cv=none; b=OgK3hHDKQpMoPVczkSryhITLl4YAmNNnnM8l3AmMYc1MRPmvSomzmNNNZG24P3WZyRDaza YS4CKGoSr4cbAnh3/SrYYZOPpS2HvOsFcTljwJfcLSiv44SoHTk5lYqBF3gOB+Yi6LuTLU ZMfJouwicCYrqdPdz9a5gZ87Mhp1nkORchvX9ivbyrg/H1qmB04Qg9roEj9nhQPOpwJX+x kV6B6sslwqOKkspJrKgDzMVrSN/x6i0OtuQOn1dV0S0YHyWcFDI8cYEetRcXLoElIGgXWS bl4XpiNCaXAtGeRu08a9jT2TgZSvj4DpI/t78laHUDI4qQOGqCnlqnblAp9o2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5b5bbf2e7c341ec6ba569536fb14acb990d53334 commit 5b5bbf2e7c341ec6ba569536fb14acb990d53334 Author: Mark Johnston AuthorDate: 2021-11-16 18:38:09 +0000 Commit: Mark Johnston CommitDate: 2021-11-30 01:35:20 +0000 sctp: Remove now-unneeded mb_unmapped_to_ext() calls sctp_delayed_checksum() now handles unmapped mbufs, thanks to m_apply(). No functional change intended. Reviewed by: tuexen Sponsored by: The FreeBSD Foundation (cherry picked from commit 756bb50b6a867f3309ce76d76f1842a667dd303a) --- sys/netinet/ip_divert.c | 6 ------ sys/netinet/ip_output.c | 12 ------------ sys/netipsec/ipsec_output.c | 12 ------------ sys/netpfil/pf/pf.c | 3 --- 4 files changed, 33 deletions(-) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 4919893d6a61..936e216e0926 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -220,9 +220,6 @@ divert_packet(struct mbuf *m, bool incoming) } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP) { - m = mb_unmapped_to_ext(m); - if (m == NULL) - return; sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; } @@ -238,9 +235,6 @@ divert_packet(struct mbuf *m, bool incoming) } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { - m = mb_unmapped_to_ext(m); - if (m == NULL) - return; sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; } diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index c269fca42015..4acec2bb877c 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -750,12 +750,6 @@ sendit: } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSTAT_INC(ips_odropped); - error = ENOBUFS; - goto bad; - } sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; } @@ -908,12 +902,6 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { - m0 = mb_unmapped_to_ext(m0); - if (m0 == NULL) { - error = ENOBUFS; - IPSTAT_INC(ips_odropped); - goto done; - } sctp_delayed_cksum(m0, hlen); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 86f06fd10947..a2deef95cdb5 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -336,12 +336,6 @@ ipsec4_common_output(struct mbuf *m, struct inpcb *inp, int forwarding) if (m->m_pkthdr.csum_flags & CSUM_SCTP) { struct ip *ip; - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSECSTAT_INC(ips_out_nomem); - key_freesp(&sp); - return (ENOBUFS); - } ip = mtod(m, struct ip *); sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; @@ -642,12 +636,6 @@ ipsec6_common_output(struct mbuf *m, struct inpcb *inp, int forwarding) } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSEC6STAT_INC(ips_out_nomem); - key_freesp(&sp); - return (ENOBUFS); - } sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; } diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 042658906bd2..84db11d2f0ef 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5976,9 +5976,6 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { - m0 = mb_unmapped_to_ext(m0); - if (m0 == NULL) - goto done; sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2)); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } From nobody Tue Nov 30 10:32:41 2021 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 1CFAA18B1B5D; Tue, 30 Nov 2021 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3JSn5QcYz3PKG; Tue, 30 Nov 2021 10:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9793514D96; Tue, 30 Nov 2021 10:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AUAWfqL073107; Tue, 30 Nov 2021 10:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AUAWfal073106; Tue, 30 Nov 2021 10:32:41 GMT (envelope-from git) Date: Tue, 30 Nov 2021 10:32:41 GMT Message-Id: <202111301032.1AUAWfal073106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wei Hu Subject: git: d11e9de955ea - stable/13 - Hyper-V: vPCI: Prepopulate device bars 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d11e9de955ea01fe01dce58c7eb090fe0352bced Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638268361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=juo8mqk6YsVgLmtI7I+t2FwamdscCRpki2Ol/WgzeG0=; b=kiAPWMCjSIzcs31yrz7VGXuaez/awppmVrBa2i5z1teMx3Qb4myDsI/XkzXQS5l1d70Z7B BZYWgjWIyBAvRhGdQJeVzEWXhU1+WK4BBKypu7F6yL9/XutLRPni0ENRzcOJDaL4PHuRFV ZuuVMmRUQoV4AjEFhREFAATc0xVBECguXceifwZQMw8FU3VWoxsx5Lbzky6835HsV+583v 3ton82s6M79Nv55mWCuE/1VpGq0FJ7n8IKsb5RDUlRVlfhhDOiipo/Y1XwzxgFmjeAcumV p4Fv6VT2S9eu8Heh8ETlZ82iSOpbobEENxrKcdmYTbnO7tplQE3EQaLtgxnGTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638268361; a=rsa-sha256; cv=none; b=WqyKTnvv+i5EIeYBRMYk/Son+8VXdxZ0brtK+8xg/Uz/DL5m/RPSMh+jfu83Y6UeJBZ8wH 60ZgR+BGqWOxGnMeqG/lf20ltheyMU+347DYX/o0tBmqCcl9vO/VapH7bCZK4BEOhYeCmZ 5m8k2Ab09TNIfh5AxJtVx5x7lUjZTv7OkoOWBlbTRBmz9rj4Lv1Vgx2H1orwxnqnKE/Zrv fRPi8ATWRmcy+A+qZzcma6tDF8gfy3cBq1nbOowfQTVU7gbxpsssHa3bV88i5aEAMtzawB L01CF1q3GBB1Jyy6UlpneOS7EQB57aTqfPsvNJWTFbz03EB+6NYhtbFulgu93w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=d11e9de955ea01fe01dce58c7eb090fe0352bced commit d11e9de955ea01fe01dce58c7eb090fe0352bced Author: Wei Hu AuthorDate: 2021-11-27 06:42:34 +0000 Commit: Wei Hu CommitDate: 2021-11-30 07:43:32 +0000 Hyper-V: vPCI: Prepopulate device bars In recent Hyper-V releases on Windows Server 2022, vPCI code does not initialize the last 4 bit of device bar registers. This behavior change could result weird problems cuasing PCI code failure when configuring bars. Just write all 1's to those bars whose probed values are not the same as current read ones. This seems to make Hyper-V vPCI and pci_write_bar() to cooperate correctly on these releases. Reported by: khng@freebsd.org Tested by: khng@freebsd.org MFC after: 2 weeks Sponsored by: Microsoft (cherry picked from commit 75412a521f60d4b0393c730ffb284e7c6ff9d2de) --- sys/dev/hyperv/pcib/vmbus_pcib.c | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c index 72e430c946db..c7df32044678 100644 --- a/sys/dev/hyperv/pcib/vmbus_pcib.c +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c @@ -1356,6 +1356,47 @@ _hv_pcifront_write_config(struct hv_pci_dev *hpdev, int where, int size, } } +/* + * The vPCI in some Hyper-V releases do not initialize the last 4 + * bit of BAR registers. This could result weird problems causing PCI + * code fail to configure BAR correctly. + * + * Just write all 1's to those BARs whose probed values are not zero. + * This seems to make the Hyper-V vPCI and pci_write_bar() to cooperate + * correctly. + */ + +static void +vmbus_pcib_prepopulate_bars(struct hv_pcibus *hbus) +{ + struct hv_pci_dev *hpdev; + int i; + + mtx_lock(&hbus->device_list_lock); + TAILQ_FOREACH(hpdev, &hbus->children, link) { + for (i = 0; i < 6; i++) { + /* Ignore empty bar */ + if (hpdev->probed_bar[i] == 0) + continue; + + uint32_t bar_val = 0; + + _hv_pcifront_read_config(hpdev, PCIR_BAR(i), + 4, &bar_val); + + if (hpdev->probed_bar[i] != bar_val) { + if (bootverbose) + printf("vmbus_pcib: initialize bar %d " + "by writing all 1s\n", i); + + _hv_pcifront_write_config(hpdev, PCIR_BAR(i), + 4, 0xffffffff); + } + } + } + mtx_unlock(&hbus->device_list_lock); +} + static void vmbus_pcib_set_detaching(void *arg, int pending __unused) { @@ -1479,6 +1520,8 @@ vmbus_pcib_attach(device_t dev) if (ret) goto vmbus_close; + vmbus_pcib_prepopulate_bars(hbus); + hbus->pci_bus = device_add_child(dev, "pci", -1); if (!hbus->pci_bus) { device_printf(dev, "failed to create pci bus\n"); From nobody Tue Nov 30 10:36:36 2021 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 3E15E18B468F; Tue, 30 Nov 2021 10:36:48 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3JYW4Dhkz3QnX; Tue, 30 Nov 2021 10:36:47 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1638268599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WnHzSwvS7vgNngK+j8T207hVByxcWKAsBOaYaEEVHno=; b=AlfAvfGeQUtGY8w3EPM9udLpXfNS0zNSJxiUYwwLbrpTBM/RUkPDxhUOMKrccDJ7qQtAcT ZHytAxXb7zLM6rSfoQDNgveEnUNbjT5P33UhMTF5lNE+3b2HFQWMI6DNYr0N4Yj3bIka82 SUC+SosqbutpeK5YzwW7efO8Ly8lSpU= Received: from skull.home.blih.net (lfbn-idf2-1-1163-183.w90-92.abo.wanadoo.fr [90.92.222.183]) by mx.blih.net (OpenSMTPD) with ESMTPSA id a6bcb01f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 30 Nov 2021 10:36:39 +0000 (UTC) Date: Tue, 30 Nov 2021 11:36:36 +0100 From: Emmanuel Vadot To: Wei Hu Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: d11e9de955ea - stable/13 - Hyper-V: vPCI: Prepopulate device bars Message-Id: <20211130113636.5b2d51dca869da19b32e47b7@bidouilliste.com> In-Reply-To: <202111301032.1AUAWfal073106@gitrepo.freebsd.org> References: <202111301032.1AUAWfal073106@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4J3JYW4Dhkz3QnX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, 30 Nov 2021 10:32:41 GMT Wei Hu wrote: > The branch stable/13 has been updated by whu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d11e9de955ea01fe01dce58c7eb090fe0352bced > > commit d11e9de955ea01fe01dce58c7eb090fe0352bced > Author: Wei Hu > AuthorDate: 2021-11-27 06:42:34 +0000 > Commit: Wei Hu > CommitDate: 2021-11-30 07:43:32 +0000 > > Hyper-V: vPCI: Prepopulate device bars > > In recent Hyper-V releases on Windows Server 2022, vPCI code does not > initialize the last 4 bit of device bar registers. This behavior change > could result weird problems cuasing PCI code failure when configuring > bars. > > Just write all 1's to those bars whose probed values are not the same > as current read ones. This seems to make Hyper-V vPCI and > pci_write_bar() to cooperate correctly on these releases. > > Reported by: khng@freebsd.org > Tested by: khng@freebsd.org > MFC after: 2 weeks Looks more 3 days to me. Also kib@ asked you a question for this commit, it would be more polite to answer him instead of mfc this 3 days after. Cheers, > Sponsored by: Microsoft > > (cherry picked from commit 75412a521f60d4b0393c730ffb284e7c6ff9d2de) > --- > sys/dev/hyperv/pcib/vmbus_pcib.c | 43 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > > diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c > index 72e430c946db..c7df32044678 100644 > --- a/sys/dev/hyperv/pcib/vmbus_pcib.c > +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c > @@ -1356,6 +1356,47 @@ _hv_pcifront_write_config(struct hv_pci_dev *hpdev, int where, int size, > } > } > > +/* > + * The vPCI in some Hyper-V releases do not initialize the last 4 > + * bit of BAR registers. This could result weird problems causing PCI > + * code fail to configure BAR correctly. > + * > + * Just write all 1's to those BARs whose probed values are not zero. > + * This seems to make the Hyper-V vPCI and pci_write_bar() to cooperate > + * correctly. > + */ > + > +static void > +vmbus_pcib_prepopulate_bars(struct hv_pcibus *hbus) > +{ > + struct hv_pci_dev *hpdev; > + int i; > + > + mtx_lock(&hbus->device_list_lock); > + TAILQ_FOREACH(hpdev, &hbus->children, link) { > + for (i = 0; i < 6; i++) { > + /* Ignore empty bar */ > + if (hpdev->probed_bar[i] == 0) > + continue; > + > + uint32_t bar_val = 0; > + > + _hv_pcifront_read_config(hpdev, PCIR_BAR(i), > + 4, &bar_val); > + > + if (hpdev->probed_bar[i] != bar_val) { > + if (bootverbose) > + printf("vmbus_pcib: initialize bar %d " > + "by writing all 1s\n", i); > + > + _hv_pcifront_write_config(hpdev, PCIR_BAR(i), > + 4, 0xffffffff); > + } > + } > + } > + mtx_unlock(&hbus->device_list_lock); > +} > + > static void > vmbus_pcib_set_detaching(void *arg, int pending __unused) > { > @@ -1479,6 +1520,8 @@ vmbus_pcib_attach(device_t dev) > if (ret) > goto vmbus_close; > > + vmbus_pcib_prepopulate_bars(hbus); > + > hbus->pci_bus = device_add_child(dev, "pci", -1); > if (!hbus->pci_bus) { > device_printf(dev, "failed to create pci bus\n"); -- Emmanuel Vadot From nobody Tue Nov 30 21:47:09 2021 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 7857118B905F; Tue, 30 Nov 2021 21:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3bR21YdXz3m9G; Tue, 30 Nov 2021 21:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11C8B1DD5B; Tue, 30 Nov 2021 21:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AULl9Qc068725; Tue, 30 Nov 2021 21:47:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AULl9V9068724; Tue, 30 Nov 2021 21:47:09 GMT (envelope-from git) Date: Tue, 30 Nov 2021 21:47:09 GMT Message-Id: <202111302147.1AULl9V9068724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 1097f2f40d08 - stable/13 - evdev: Add parentheses around '-' expression in operand of '&'. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1097f2f40d08f661cfbc84755570987f09feac71 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638308830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FONdN/JNMyQC1ZzapJf67rTozn8OgpMF5DPtONOHCkA=; b=t6eALI0v7hYqSYkR3ul0nAVFOM1XlF6X+BQVZnEOylbY71R8mwxf6chw1ln9FUdA3mx6uL dQYoAs5AfBeSRysrnvr2Vdokyyvj6VKGDHveWs0si+jXi1S9w1AMWTso9ZLY+TIeA1j1mO IqvCcbABKTjY6y0306s7Bf3wK6wLPezxiu3Plo/wJjkgOc2Br7GlqOMUQehWPmRzf7QRZi 6uefb90qcO3E5Bf+F660gdoseYKyqLWKMoVaotvo1lieljL3TdvGBeS5G45ztns94awBJQ NvSjP7guoqHLtIp9bLjG3gMyp716NPpLrDDa8t2h6OeKPrnWJpt458tu+6V4vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638308830; a=rsa-sha256; cv=none; b=KFY9acm8EOYp9c/mTqyk21rjyWOGYo7vp0C93cR+v00Sow5k3hLWKbBbBDz5XyTNBNBZm7 nJDkOaSyso1c/otEqQyJLTGNjXH1P0zyISbfmbwiHt/y/X+8G4bCwuNftoQ/LY4omcjivQ FR+JVoq2QI9JjJb9mFlyjoh6clYHy3Hf+YbKa/wFvYGn1snzsZHkw556H8EsjlYzzef42k GAYI16+mEJuQc+9R/mDWUcOJl7I1JecB8Rt/+RdpIqUKQ/IuNLH3olicj/1QYnL8R0ljnJ CDLiRJdUyJdVLO1UspeHvVIb9cq9djoQCAY+m1dnJ1EZKOOczXKWReoW1mme2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=1097f2f40d08f661cfbc84755570987f09feac71 commit 1097f2f40d08f661cfbc84755570987f09feac71 Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-11-30 21:45:30 +0000 evdev: Add parentheses around '-' expression in operand of '&'. This fixes a -Wparentheses error with GCC 9. Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D31947 (cherry picked from commit d99c87c8d54a02a229cbeaa19ec8784b1d5afbb9) --- sys/dev/evdev/evdev_mt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/evdev/evdev_mt.c b/sys/dev/evdev/evdev_mt.c index 3030a60e098a..6eb263838a61 100644 --- a/sys/dev/evdev/evdev_mt.c +++ b/sys/dev/evdev/evdev_mt.c @@ -100,7 +100,7 @@ static void evdev_mt_replay_events(struct evdev_dev *); static inline int ffc_slot(struct evdev_dev *evdev, slotset_t slots) { - return (ffs(~slots & (2U << MAXIMAL_MT_SLOT(evdev)) - 1) - 1); + return (ffs(~slots & ((2U << MAXIMAL_MT_SLOT(evdev)) - 1)) - 1); } void From nobody Tue Nov 30 22:46:17 2021 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 B631218B09D8; Tue, 30 Nov 2021 22:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3clG1XVQz4dCV; Tue, 30 Nov 2021 22:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 061DB1E547; Tue, 30 Nov 2021 22:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AUMkHBu049022; Tue, 30 Nov 2021 22:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AUMkHIw049021; Tue, 30 Nov 2021 22:46:17 GMT (envelope-from git) Date: Tue, 30 Nov 2021 22:46:17 GMT Message-Id: <202111302246.1AUMkHIw049021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 7af8903bf31f - stable/13 - ktls.4: fix openssl-devel port name 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7af8903bf31f7d58ec00399df2cbbb6ea4846123 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638312378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h09+SPA53t5+6ZkDD+qI1bY+8T6XL439FeafvsmL9+0=; b=kwmzSXey6TIJZ3lYQeeMSLPXTsCaiPqszQ+4CRT8L1JZ6r0hQsnw5/XyHvlyBWBtyOhiwC o7llxEPX7OLQYcFSyCTqu8YsA+IexdGqYzrWRecq6NDlM5ex7erBHPcsrT2BpX075519ha uU1WFZ9JrpCxgbMrqaVIeSR7YF0kYlj/ve8vpyGB0yijxS0keT+QulPNZFcSC8YCCa134i w830yfegAalmcD2vPLIHc1jb2lqYB/f69OHPrNzLRVU1IfDqRRPOho3OdfmpIXpLdbaG67 TvJjjlTF5mVN9g14d/7pAgo1laU1IVJs6KnXkqODjj8FZf7zDIStBfNAKXTOQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638312378; a=rsa-sha256; cv=none; b=YI8hqzQk8LzDWsPqa/5pCJt+ZVDWRZIk8ACN3nCiwPfrWUeRV6v5kiWtDFYzli30Hb+Zyz 2fUSsyBRTOlLGZDTIJbSFRyB97ZQ2HG4BU8xhYbMQa5HPWp+X7ZXlFzw/xNgNSwvmATRZf 2WGvyQterGjT8bOHNSvWa1rkObpKj6u0nyjYupm2e7ac9/UGR+teN/xY0nUBxauNbePM5v XGHV7HJgqwAVwk7qpfsQG5rqQcO/5PRubLHBhms07g7otngGDYJQxJ/uxfkt17nHuyy1Bx iNBkm3OCvBsByeLJn/Bdu9tjC2BArzEnG5EKV7+4B/0pGksq6ysAtF0frYQFHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by osa (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7af8903bf31f7d58ec00399df2cbbb6ea4846123 commit 7af8903bf31f7d58ec00399df2cbbb6ea4846123 Author: Sergey A. Osokin AuthorDate: 2021-11-12 14:31:48 +0000 Commit: Sergey A. Osokin CommitDate: 2021-11-30 22:45:44 +0000 ktls.4: fix openssl-devel port name PR: 259630 (cherry picked from commit b39a93b18ef17dcb1897186b1f01999337b9f8b9) --- share/man/man4/ktls.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 648eeaedfa6a..5e7ed1590aa9 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -232,7 +232,7 @@ mode. OpenSSL 3.0 and later include support for .Nm . The -.Fa devel/openssl +.Fa security/openssl-devel port may also be built with support for .Nm by enabling the From nobody Wed Dec 1 01:08:20 2021 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 EEDB318ADFF4; Wed, 1 Dec 2021 01:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3gv855y8z3sxQ; Wed, 1 Dec 2021 01:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F23120860; Wed, 1 Dec 2021 01:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B118KUm035645; Wed, 1 Dec 2021 01:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B118Kg1035644; Wed, 1 Dec 2021 01:08:20 GMT (envelope-from git) Date: Wed, 1 Dec 2021 01:08:20 GMT Message-Id: <202112010108.1B118Kg1035644@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: 998529e5941a - stable/13 - ldconfig: remove a comment which is another remnant of a.out support 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 998529e5941a20bcc300304e79afd10680cc0892 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638320900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MHQstwz5lZ3ST1ybvuStJpM0RE2MauW2j5IDeakKzkg=; b=ZA4Wlg1woFfdi/YAdgjeu58nHFeCMSUnZbfgQJ/izdC7HTc+lZHHBbn55KzJrx3SJQb1Ig D7M8eV2ylhHLl1LDLmcwgFnnmVW2gQhmvRYx7wEQOvOBN8bPrzAy+IFwncshiI1umtFPuE +rqslUrR7qc8N6g88zQ0KtgURAMKvCEFtEWU6s8UKSL8XGcyWg5MSjnLfz9WQ1oTV+PwUV I0RGNt0ybwXzY/IfMOmcTXf7jiPpaBt7ImjuOeLEPKEZcKGzeOGxQCiURH87jG8Gg0ohPP 1KoRMUCWI1karwG/Iqtzl6TFG6B2DNln3Kw7PyeODjVhB7V5rduaVPr7u98BwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638320900; a=rsa-sha256; cv=none; b=isc0VUBR6fFm/lzUCTYQm704WaTbk6Y16HtjaDpy1gksN8QaAcpIT/qa+mtAYatnBwKA5h Q+ntjj5FzSc6p9LI3hhznYTX7gXzdaUUldhgJcahHe7aWWJfeLZYYykA/hwbI+HeKVtdXQ aF38MK6BLnsMEVYQXXGzBM4/WvTkSp03cJjgzGIRBFhCCetCM59bKcOrQuKcKcJQhks6rq B5VqQasJ/3T5B+OKla+9q4hauD0D4sjtq6yiDzGCnrqvBisjmGWk15wVZvK+lJx+kkmpxD ZIR1t/ySXJDbyi/ZzVyK8Sd/509DvhW7X9MqbEURxh9E/birl1La/qK4O91QtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=998529e5941a20bcc300304e79afd10680cc0892 commit 998529e5941a20bcc300304e79afd10680cc0892 Author: Konstantin Belousov AuthorDate: 2021-11-24 20:44:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-01 01:07:18 +0000 ldconfig: remove a comment which is another remnant of a.out support (cherry picked from commit 83511ce5c473406e0661247e40971be28e218684) --- sbin/ldconfig/ldconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index d0c6c9802a52..389cbb6101b5 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -102,7 +102,7 @@ main(int argc, char **argv) } if (is_soft) - hints_file = _PATH_ELFSOFT_HINTS; /* Never will have a.out softfloat */ + hints_file = _PATH_ELFSOFT_HINTS; else if (is_32) hints_file = _PATH_ELF32_HINTS; else From nobody Wed Dec 1 01:08:21 2021 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 5DF3018AE121; Wed, 1 Dec 2021 01:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3gv96Dbrz3sxT; Wed, 1 Dec 2021 01:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1B022065C; Wed, 1 Dec 2021 01:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B118LoN035669; Wed, 1 Dec 2021 01:08:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B118LxO035668; Wed, 1 Dec 2021 01:08:21 GMT (envelope-from git) Date: Wed, 1 Dec 2021 01:08:21 GMT Message-Id: <202112010108.1B118LxO035668@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: 00558493b73c - stable/13 - ldconfig: start of cleanup 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 00558493b73c27d88556d8e41c0db5276e995b32 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638320901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/NZogFe4TO7DTlGR5YuuTRDzArHUyRASZY/7sgoqT3A=; b=O7Vcar7xO+E4s5FtSdmIfGJtqI13Qgte98BxzIWeWhu/+/1fcsxGg0iHILIfqXn31d+G1X mpTBlLUrwjW5m4L8VUG3iTy/qUUAtg332Yhj18gI9wmNe9fAU10AmIdK5OBv903jGHcFuF 2lP3IYWBpkqJHbfP1tdNIruNK3xVZhAgr/FXNEdYEC05fqacUl39l+ETEXpMpXZbX7VR0Y CT7J2C8IKmbPVocnuxNJEowSsRluTbspUpZV1Ao5ZQgqkfDXx0190SysZDunSOjyeQnABz IR4qQa2/VDW5BZLGqhbIU2KrZVKM2oD478CW1RXyrzMS7Hh54op7cIfhNMd5GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638320901; a=rsa-sha256; cv=none; b=stTjIGB5pB9r7WwfLplog/wcZrF0/R6ximIwZHGIiw+jZ8AAWiIK4pJmzNuhWweLM5d7ZT Rjn2+8rg6+i2sOJztX9HsCdpDApPxQ+Yhk0Rwcin5VdyK8etAzSPweAFgtI/k0/2vyUQgz VVqdSNw3SEalQE0DVtHXhGWAD4Rc0xcBiqiBZNSEsEdMzNZ89546Tjpt42rqGsUSN8RGvF DN+cfqOFlL/BlB090QnnoCtUlafLNcHCJT9WwmaQkI83HwwFRY3cs8BqKfyKDbcSc3H2jR 6W6Nbn3wzBKptxdgnPZeTNCeyWwyzUgBwwA1x7gfX6j0Ti3NqQJkU1FHh5z1oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=00558493b73c27d88556d8e41c0db5276e995b32 commit 00558493b73c27d88556d8e41c0db5276e995b32 Author: Konstantin Belousov AuthorDate: 2021-11-19 03:35:50 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-01 01:07:19 +0000 ldconfig: start of cleanup (cherry picked from commit 3f2c6f5598410b7233b0acd1c804a0473fa1e9fa) --- sbin/ldconfig/elfhints.c | 19 ++++++++--------- sbin/ldconfig/ldconfig.c | 55 +++++++++++++++++------------------------------- sbin/ldconfig/ldconfig.h | 5 +++-- 3 files changed, 31 insertions(+), 48 deletions(-) diff --git a/sbin/ldconfig/elfhints.c b/sbin/ldconfig/elfhints.c index bbedac64b3ff..81236feec5ca 100644 --- a/sbin/ldconfig/elfhints.c +++ b/sbin/ldconfig/elfhints.c @@ -48,17 +48,17 @@ #define MAXDIRS 1024 /* Maximum directories in path */ #define MAXFILESIZE (16*1024) /* Maximum hints file size */ -static void add_dir(const char *, const char *, int); +static void add_dir(const char *, const char *, bool); static void read_dirs_from_file(const char *, const char *); -static void read_elf_hints(const char *, int); +static void read_elf_hints(const char *, bool); static void write_elf_hints(const char *); static const char *dirs[MAXDIRS]; static int ndirs; -int insecure; +bool insecure; static void -add_dir(const char *hintsfile, const char *name, int trusted) +add_dir(const char *hintsfile, const char *name, bool trusted) { struct stat stbuf; int i; @@ -186,7 +186,7 @@ read_dirs_from_file(const char *hintsfile, const char *listfile) } static void -read_elf_hints(const char *hintsfile, int must_exist) +read_elf_hints(const char *hintsfile, bool must_exist) { int fd; struct stat s; @@ -231,15 +231,14 @@ read_elf_hints(const char *hintsfile, int must_exist) } void -update_elf_hints(const char *hintsfile, int argc, char **argv, int merge) +update_elf_hints(const char *hintsfile, int argc, char **argv, bool merge) { - int i; + struct stat s; + int i; if (merge) - read_elf_hints(hintsfile, 0); + read_elf_hints(hintsfile, false); for (i = 0; i < argc; i++) { - struct stat s; - if (stat(argv[i], &s) == -1) warn("warning: %s", argv[i]); else if (S_ISREG(s.st_mode)) diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 389cbb6101b5..3f623d6f38b1 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -30,11 +30,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - #include #include #include @@ -46,6 +41,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -53,34 +49,20 @@ static const char rcsid[] = #include "ldconfig.h" -#if DEBUG -/* test */ -#undef _PATH_ELF_HINTS -#define _PATH_ELF_HINTS "./ld-elf.so.hints" -#endif - #define _PATH_LD32_HINTS "/var/run/ld32.so.hints" #define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints" #define _PATH_ELFSOFT_HINTS "/var/run/ld-elf-soft.so.hints" -#undef major -#undef minor - -static int verbose; -static int nostd; -static int justread; -static int merge; -static int rescan; -static const char *hints_file; - -static void usage(void); +static void usage(void); int main(int argc, char **argv) { - int c; - int is_32 = 0; - int is_soft = 0; + const char *hints_file; + int c; + bool is_32, is_soft, justread, merge, nostd, rescan, verbose; + + is_32 = is_soft = justread = merge = nostd = rescan = verbose = false; while (argc > 1) { if (strcmp(argv[1], "-aout") == 0) { @@ -89,11 +71,11 @@ main(int argc, char **argv) argc--; argv++; } else if (strcmp(argv[1], "-32") == 0) { - is_32 = 1; + is_32 = true; argc--; argv++; } else if (strcmp(argv[1], "-soft") == 0) { - is_soft = 1; + is_soft = true; argc--; argv++; } else { @@ -108,29 +90,29 @@ main(int argc, char **argv) else hints_file = _PATH_ELF_HINTS; if (argc == 1) - rescan = 1; + rescan = true; else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { switch (c) { case 'R': - rescan = 1; + rescan = true; break; case 'f': hints_file = optarg; break; case 'i': - insecure = 1; + insecure = true; break; case 'm': - merge = 1; + merge = true; break; case 'r': - justread = 1; + justread = true; break; case 's': - nostd = 1; + nostd = true; break; case 'v': - verbose = 1; + verbose = true; break; default: usage(); @@ -143,13 +125,14 @@ main(int argc, char **argv) else update_elf_hints(hints_file, argc - optind, argv + optind, merge || rescan); - return 0; + exit(0); } static void usage(void) { fprintf(stderr, - "usage: ldconfig [-32] [-elf] [-Rimrsv] [-f hints_file] [directory | file ...]\n"); + "usage: ldconfig [-32] [-elf] [-Rimrsv] [-f hints_file] " + "[directory | file ...]\n"); exit(1); } diff --git a/sbin/ldconfig/ldconfig.h b/sbin/ldconfig/ldconfig.h index 9b278255ac07..8aff4e6a5ef2 100644 --- a/sbin/ldconfig/ldconfig.h +++ b/sbin/ldconfig/ldconfig.h @@ -32,12 +32,13 @@ #define LDCONFIG_H 1 #include +#include -extern int insecure; /* -i flag, needed here for elfhints.c */ +extern bool insecure; /* -i flag, needed here for elfhints.c */ __BEGIN_DECLS void list_elf_hints(const char *); -void update_elf_hints(const char *, int, char **, int); +void update_elf_hints(const char *, int, char **, bool); __END_DECLS #endif From nobody Wed Dec 1 01:08:22 2021 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 BDFCA18AE129; Wed, 1 Dec 2021 01:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3gvC0DYKz3sqS; Wed, 1 Dec 2021 01:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7CAD205D7; Wed, 1 Dec 2021 01:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B118MK3035697; Wed, 1 Dec 2021 01:08:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B118Mjs035696; Wed, 1 Dec 2021 01:08:22 GMT (envelope-from git) Date: Wed, 1 Dec 2021 01:08:22 GMT Message-Id: <202112010108.1B118Mjs035696@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: 46e032b0b123 - stable/13 - ldconfig(8): nostd/-s does nothing 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 46e032b0b123eee2c1ff896dfc474b7c9cf86ab7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638320903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bl1nnj/r3FLvXz5hwDfdwMhEB+79wMeSvsmIdNd41II=; b=PTM4caQ1rDbjLfKEoEj6hDxMi+xoGXoMRoq65kIZG/zvMc7ZjXkAesiYTzOwtc5LfEkN0P LaqtsMEomS+JFIku/Svvc3qUiECosN1kWyjSW0HVaowWUXLnUJx6H92GuwvEJheex86RKb YA0iwEt04ydNOYf/kJBIGawyNIff6K2M2KJQpbakyjZa2OV7a8XGB9aPTUYSs8fZ4RD1GW k/Re+bwSxj7pUUG5Q3xsTY2f5R2z48PJOZY5n8xFaEQK8cT1SIRMyFR/zSfnOm9xu64ecw hZ1rk9AAxkOZRhRlhJng4hwYljE23pViw+u5OSyBGAPBZ+ffEF3B8rGwy+rwVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638320903; a=rsa-sha256; cv=none; b=dMBoel2ZO4Jb/NRhmEN+8dyceH5GaZNSVrBA2wqhsp+uz63fHViSwYXmpI3BgKRbu+DnQY mctG7GDtuSwMKOxGBxX9i+XN6lmVPXN0zpEdvlp/1Lrn6pEbLMd9cg27n/tuC5I4sIZfET JSviiUP5RhjBeP+9gosHw7UlL7uECeIBKqKYT9i3Lx97uQ15sihYm3R9yub0wQHt3hDiTJ 0hFKgc6kBDnwRfQ+qvpeg+UP3GCU1agzWCtvSlJAZT3o51zEGTZkgBmSh++2RgoaN1Vibh xI9v1RQ6xUG+PsjHWI55apO1GjnlIpC7frob7PNWJmiFkd/vv5aq2c3cif270Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=46e032b0b123eee2c1ff896dfc474b7c9cf86ab7 commit 46e032b0b123eee2c1ff896dfc474b7c9cf86ab7 Author: Konstantin Belousov AuthorDate: 2021-11-19 05:21:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-01 01:07:19 +0000 ldconfig(8): nostd/-s does nothing (cherry picked from commit b828161d123bec894bc5a320ef26d6afc9b13ae8) --- sbin/ldconfig/ldconfig.8 | 6 +----- sbin/ldconfig/ldconfig.c | 8 ++++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/sbin/ldconfig/ldconfig.8 b/sbin/ldconfig/ldconfig.8 index 63e2271b7cd5..7718f018bc70 100644 --- a/sbin/ldconfig/ldconfig.8 +++ b/sbin/ldconfig/ldconfig.8 @@ -43,7 +43,7 @@ .Sh SYNOPSIS .Nm .Op Fl 32 -.Op Fl Rimrsv +.Op Fl Rimrv .Op Fl f Ar hints_file .Op Ar directory | Ar .Sh DESCRIPTION @@ -128,10 +128,6 @@ on the standard output. The hints file is not modified. .Pp Scan and print all libraries found on the directories list. -.It Fl s -Do not scan the built-in system directory -.Pq Dq /usr/lib -for shared libraries. .It Fl v Switch on verbose mode. .El diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 3f623d6f38b1..777895936834 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -60,9 +60,9 @@ main(int argc, char **argv) { const char *hints_file; int c; - bool is_32, is_soft, justread, merge, nostd, rescan, verbose; + bool is_32, is_soft, justread, merge, rescan, verbose; - is_32 = is_soft = justread = merge = nostd = rescan = verbose = false; + is_32 = is_soft = justread = merge = rescan = verbose = false; while (argc > 1) { if (strcmp(argv[1], "-aout") == 0) { @@ -109,7 +109,7 @@ main(int argc, char **argv) justread = true; break; case 's': - nostd = true; + /* was nostd */ break; case 'v': verbose = true; @@ -132,7 +132,7 @@ static void usage(void) { fprintf(stderr, - "usage: ldconfig [-32] [-elf] [-Rimrsv] [-f hints_file] " + "usage: ldconfig [-32] [-elf] [-Rimrv] [-f hints_file] " "[directory | file ...]\n"); exit(1); } From nobody Wed Dec 1 01:08:23 2021 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 4A82818AE37C; Wed, 1 Dec 2021 01:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3gvD22ydz3swr; Wed, 1 Dec 2021 01:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04D46208A6; Wed, 1 Dec 2021 01:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B118NZE035723; Wed, 1 Dec 2021 01:08:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B118Nve035722; Wed, 1 Dec 2021 01:08:23 GMT (envelope-from git) Date: Wed, 1 Dec 2021 01:08:23 GMT Message-Id: <202112010108.1B118Nve035722@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: a95dbfaa3d7c - stable/13 - rtld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: a95dbfaa3d7c4b4eed89026487c0ad7a2e4f68a3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638320904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=grnE+rXFvTlmULhOjiMNBf+KP1hF1ibZ/NHt0XOAQnQ=; b=TlFlsB/sVo/WJ7eODjddQO9TN+ZmkuPKSRbCK89wDfUCfC7wTeV6fZDuRlx6J3bK58iLc+ 0x+kGl2eoAql7TUSZSt8VySn28gbc5hP5ub+UnMzUSZgWMTYKLt94Lw40Ov0kfgZaDepAP dNql6xCP5RdY9l836Og4+TiMeS2PeZvc1JmR8WrR1SQd9KKKj+T8/a1sE1RUBKfAnuciGS FVXdFiFBUCXSWMSlXfoC1xvL1VZAGMY6bkNQIWUm642ZMpay6ZEf84trUCCCwAahzWWP6T 87nsPzieq0RjJd3cvnyGJdITIxR7vVrzvo9ZSgkzjGU6gFVvAkgyXpFru2LI0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638320904; a=rsa-sha256; cv=none; b=h+3g44xvM2319i6DqFnBMsF18WQcPV3867zQ5AcLUJU9NtKpPi/E5mea+njqplvtpimvhv mffWRy7UOoYIV54B9xFBHiv2mtwiOU85/OBWtmFUVuiqMDQSNVaXO6355IUVBKDt9gm0oe jKDdc0rGZV/iNBgno1ZWczebxJsnQHBS2+9wDp3fQmYmt9vY1dwxXyH9kyAxHX1SKm+C1a Wmd+5W3MYsNduQQ1V6rcDRKCuSuIzHjIa82q8QHuQBVFUl+Wa/UwBUPog2130p9jcrErxc Um48u7sWv0Z6PLulqnkHzEwZF+9WaaZ5E1BK/V/ffabYKlwSd/znLPZN/o6OFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a95dbfaa3d7c4b4eed89026487c0ad7a2e4f68a3 commit a95dbfaa3d7c4b4eed89026487c0ad7a2e4f68a3 Author: Konstantin Belousov AuthorDate: 2021-11-19 03:44:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-01 01:07:19 +0000 rtld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally (cherry picked from commit f340188625d4e0e4db850becb0a9b25448053e10) --- libexec/rtld-elf/rtld_paths.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld_paths.h b/libexec/rtld-elf/rtld_paths.h index 4ce423ce6dbb..6ead517e8feb 100644 --- a/libexec/rtld-elf/rtld_paths.h +++ b/libexec/rtld-elf/rtld_paths.h @@ -35,8 +35,12 @@ #define _COMPAT32_BASENAME_RTLD "ld-elf32.so.1" #endif +#ifndef _PATH_ELF32_HINTS +#define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints" +#endif + #ifdef COMPAT_32BIT -#define _PATH_ELF_HINTS "/var/run/ld-elf32.so.hints" +#define _PATH_ELF_HINTS _PATH_ELF32_HINTS #define _PATH_LIBMAP_CONF "/etc/libmap32.conf" #define _BASENAME_RTLD _COMPAT32_BASENAME_RTLD #define STANDARD_LIBRARY_PATH "/lib32:/usr/lib32" From nobody Wed Dec 1 01:08:24 2021 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 6670718AE588; Wed, 1 Dec 2021 01:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3gvF5VRcz3swx; Wed, 1 Dec 2021 01:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FC542073A; Wed, 1 Dec 2021 01:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B118OwU035747; Wed, 1 Dec 2021 01:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B118OI8035746; Wed, 1 Dec 2021 01:08:24 GMT (envelope-from git) Date: Wed, 1 Dec 2021 01:08:24 GMT Message-Id: <202112010108.1B118OI8035746@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: a2a905f4d02b - stable/13 - ldconfig: use libexec/rtld-elf/rtld_paths.h 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: a2a905f4d02b9592a8126c73f2eb4d3949265659 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638320906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QCq+d2tk+VGkpVndWiMpB9MU06eIRQI/Z0EPITdhjO8=; b=IOis8IdXSdZhYWy4UcEXMc4vkVMZaDvSJC01Zeb48yhV+s7DuQHYuRxn2HjFIVJ00HRu9d tPV1krfH1gXGhxo2AXk154TeTdbjuThMed8mWj0pKNWbEnHPQ7sAxSsTC6eCn51vEg+SxH 7KcEdSfvsnYr4rw3HDlMlH7LkKvTt7boqMt1en215PsExVK0e9kcTTkFsudr6DewNV6rYP EnEwHg2gZ1u6KfVyi8GvTTXxMTWt7UX/nEToWzhUUOYTvIe/Delcp/PtVvlW9tRpGqyofu RgOVwBx4tasAkC0VCIYlSsKkBnq/U9B4BD+h9RGHmypwX3NRnwiVUsKIhJ7qdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638320906; a=rsa-sha256; cv=none; b=Fxin9rwx5jRjox1OAOm0yvgEUM7KC9zGpZaEnMF8et3WijZxW0baC1WBj43sentEQ+bZGc RTI/JR1Etf6OJ8TF4wv/LJlG6j6hBnuKCDihV4LnIaQFtx9ZiQAcfb9/62keklscay5Cvn 4Gb/QMrqJq4Xf59Q3qFUIfAPy7PS/vWfyQHu5TCpzUT9GlJEJvnVJ+g88+xsrLfABxNdiD 2Lr3PUqWN3g6Gv6dsBRWFlHC7r8jECTgMNAd95H/FFR1p+kBksWnlIRCyUw68mlT0od7xt o30O5PmwtUZYvywHoCQj5e39ftZq1t1hXl+IaInXmNwKavkn7JPNzNfNN6uNbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a2a905f4d02b9592a8126c73f2eb4d3949265659 commit a2a905f4d02b9592a8126c73f2eb4d3949265659 Author: Konstantin Belousov AuthorDate: 2021-11-19 03:45:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-01 01:07:19 +0000 ldconfig: use libexec/rtld-elf/rtld_paths.h (cherry picked from commit af9115870670f508c11b3d173bcff5116d8ef320) --- sbin/ldconfig/Makefile | 1 + sbin/ldconfig/ldconfig.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/ldconfig/Makefile b/sbin/ldconfig/Makefile index 2ead668578f6..070c2c3d6901 100644 --- a/sbin/ldconfig/Makefile +++ b/sbin/ldconfig/Makefile @@ -3,6 +3,7 @@ PACKAGE=runtime PROG= ldconfig SRCS= elfhints.c ldconfig.c +CFLAGS+= -I${SRCTOP}/libexec/rtld-elf MAN= ldconfig.8 .include diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 777895936834..288c22813121 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -48,6 +48,7 @@ #include #include "ldconfig.h" +#include "rtld_paths.h" #define _PATH_LD32_HINTS "/var/run/ld32.so.hints" #define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints" @@ -84,7 +85,7 @@ main(int argc, char **argv) } if (is_soft) - hints_file = _PATH_ELFSOFT_HINTS; + hints_file = _PATH_SOFT_ELF_HINTS; else if (is_32) hints_file = _PATH_ELF32_HINTS; else From nobody Wed Dec 1 01:08:26 2021 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 2048F18AE16B; Wed, 1 Dec 2021 01:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3gvG3MLSz3sqg; Wed, 1 Dec 2021 01:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DD8A2065D; Wed, 1 Dec 2021 01:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B118QA0035771; Wed, 1 Dec 2021 01:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B118QBd035770; Wed, 1 Dec 2021 01:08:26 GMT (envelope-from git) Date: Wed, 1 Dec 2021 01:08:26 GMT Message-Id: <202112010108.1B118QBd035770@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: 0619dbdfde6d - stable/13 - ldconfig(8): check for no-args command line after options are parsed 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 0619dbdfde6d05ac99265ff0b0944468788678dd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638320906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/m1/jCpN7VvyYzi2EoKwytdWuWhm0WyRWQG7LiUYZ9E=; b=BN9u6+jAbTkMaKYaVM2WVwUHVT07ITG/5selX18AqvyVaIRb/i1CQJSXsfs0TuDoPwjZ5X biOM0Gc6yz0f93ooe/QKbevEBtR6dBOmzo9iEzpysDvGtqvpkH0SY8yQLGcmiN8vt9ghOJ pBVPNWMAL2KiD15CPMm2YNol6tKPYapUkLI5WvdFq4GBE7+6pUYwQoCx4WgxA5OqBmD/aH sKz/0uJxuI3L3Y5PJHZ/50h0AQPQrj10kcxhhz/FsU717Yc7vxCdi2txs7QwiV4J6z+oqt 2TSA5OQl4HA61gnLrqlTlYqLY5FDG72fv3xQgVbqP50d5QUc1dFjH0xnAfmilw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638320906; a=rsa-sha256; cv=none; b=NcnnpSf+5A56j+7QzljE1GDp417GeXksZftkvjG5J+kVY1GqnqOIGuJ3J/W7kKQ+z4gS5K yHM2+3NvqpvrKiqrC2EhbBnznoE7wfbOqItCjjbtUQ3Otr6/yBzepyl4HEit6LfuztA3+V swfCm+TD4EDpJXg04XDH5kgekBw4tsG0Ocea/JgGEPBem42fzDFGkcsBBOOAuw407pZYVL sMiAPBTw9qWk8aMPV1Nw3TG5wuboIayyZEnjGHR7mrtyiV5EO61d3Y4hpjtpvJeaNMxlt+ JAnSFRkG1OPNgR0TkrF2RPvhMInsNhnBeoK/ra7hSdUwTS/RxlxS5T1LvBM/tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0619dbdfde6d05ac99265ff0b0944468788678dd commit 0619dbdfde6d05ac99265ff0b0944468788678dd Author: Konstantin Belousov AuthorDate: 2021-11-19 04:07:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-01 01:07:19 +0000 ldconfig(8): check for no-args command line after options are parsed (cherry picked from commit 3ede04c78c7c726ed79a39d22c65a58d0ecc5d00) --- sbin/ldconfig/ldconfig.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 288c22813121..b039412a648b 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -90,9 +90,7 @@ main(int argc, char **argv) hints_file = _PATH_ELF32_HINTS; else hints_file = _PATH_ELF_HINTS; - if (argc == 1) - rescan = true; - else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { + while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { switch (c) { case 'R': rescan = true; @@ -121,11 +119,14 @@ main(int argc, char **argv) } } - if (justread) + if (justread) { list_elf_hints(hints_file); - else + } else { + if (argc == optind) + rescan = true; update_elf_hints(hints_file, argc - optind, argv + optind, merge || rescan); + } exit(0); } From nobody Wed Dec 1 12:48:31 2021 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 D4B3518BA2CB; Wed, 1 Dec 2021 12:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zR34GByz3jsY; Wed, 1 Dec 2021 12:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 720781CC9; Wed, 1 Dec 2021 12:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1CmVW7065809; Wed, 1 Dec 2021 12:48:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1CmVJU065808; Wed, 1 Dec 2021 12:48:31 GMT (envelope-from git) Date: Wed, 1 Dec 2021 12:48:31 GMT Message-Id: <202112011248.1B1CmVJU065808@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: aa5664c0f53b - stable/13 - safexcel: Fix -Wunused-but-set-variable warnings 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: aa5664c0f53b60915ad1400c4614af9b248223ab Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638362911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HuRLUjfs/iv4S2tIkYyYO/OVlnzih9Ki+UFmcAgZZMs=; b=M2OlnSwrA7+uLI0h+0Z+Nh6QMsiAfwYG76QcpIpCL4GKIqfRpyc6SnqDs2XIhlJSh4v8Tz WNmRg4Z5F6VgdDb/H31ZDrCTeN99wwO9Fo41e2xXh4qXVHo0WbKNQQZQ2gNjIMCs8+JnOx qTxjNluK0LykHOyjioW0yt0e91wNGYIO6ULoajsm/R/MNnMXcutNt5ZSkw8TBxPlola0Zb p1LQI5TuA7DqoOcYv2h8K37ls7wc7FScv3XdiFpc6Gl5AoLbGN2QFjZHpsGs7NW/XVVQ37 IgjudwLNFIkD2jkJAvdyj1P6bNIMVSTKv2csTvU8mG7PXJFxfEMscggpIqZBAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638362911; a=rsa-sha256; cv=none; b=h8m1ffavskJUNX2CIvTzHiJ4J5V3SZXjWMF2MbarkLTfjwKV4j+IW4zQGT30TEyRtLy8d4 8e1q+vmryf1NlLYrsEFzwsIjrLnVfuHESEfIQLhD4dgSwkN+5UzXaGepiWc+dSsipaGDlc UO5hDOsJamc7P5AYaUZlmPkuUQ9yklMMrwnAMVYNFYCADtqxEFVkqF5ieTUdGc5hRFVstV LJ6YhfCDZa5RtWge3xf6VXJEx0NZCzQvHrhfv5DxGIpmZlik433olRPR643UR/eBWsdQKY OAC8Ue8GaWCMOlnZhMRWG4JTQV/2Pm597s7WCnFA13EyDia1Q1xVqJSxGbLeRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aa5664c0f53b60915ad1400c4614af9b248223ab commit aa5664c0f53b60915ad1400c4614af9b248223ab Author: Mark Johnston AuthorDate: 2021-11-24 18:30:39 +0000 Commit: Mark Johnston CommitDate: 2021-12-01 12:40:49 +0000 safexcel: Fix -Wunused-but-set-variable warnings Sponsored by: The FreeBSD Foundation (cherry picked from commit 60c95f316374fdd383f70b50e98ad097460accf3) --- sys/dev/safexcel/safexcel.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 6095787330c1..242f1bcfb90a 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -168,7 +168,7 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) struct safexcel_res_descr *rdesc; struct safexcel_request *req; struct safexcel_ring *ring; - uint32_t blocked, error, i, ncdescs, nrdescs, nreqs; + uint32_t blocked, error, i, nrdescs, nreqs; blocked = 0; ring = &sc->sc_ring[ringidx]; @@ -194,7 +194,7 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) bus_dmamap_sync(ring->dma_atok.tag, ring->dma_atok.map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - ncdescs = nrdescs = 0; + nrdescs = 0; for (i = 0; i < nreqs; i++) { req = safexcel_next_request(ring); @@ -203,7 +203,6 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) bus_dmamap_sync(ring->data_dtag, req->dmap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - ncdescs += req->cdescs; while (req->cdescs-- > 0) { cdesc = safexcel_cmd_descr_next(&ring->cdr); KASSERT(cdesc != NULL, @@ -306,7 +305,6 @@ static int safexcel_configure(struct safexcel_softc *sc) { uint32_t i, mask, pemask, reg; - device_t dev; if (sc->sc_type == 197) { sc->sc_offsets = eip197_regs_offset; @@ -316,8 +314,6 @@ safexcel_configure(struct safexcel_softc *sc) pemask = EIP97_N_PES_MASK; } - dev = sc->sc_dev; - /* Scan for valid ring interrupt controllers. */ for (i = 0; i < SAFEXCEL_MAX_RING_AIC; i++) { reg = SAFEXCEL_READ(sc, SAFEXCEL_HIA_AIC_R(sc) + @@ -1625,12 +1621,10 @@ static void safexcel_instr_eta(struct safexcel_request *req, struct safexcel_instr *instr, struct safexcel_cmd_descr *cdesc) { - const struct crypto_session_params *csp; struct cryptop *crp; struct safexcel_instr *start; crp = req->crp; - csp = crypto_get_params(crp->crp_session); start = instr; /* Insert the AAD. */ @@ -2452,9 +2446,7 @@ safexcel_newsession(device_t dev, crypto_session_t cses, const struct crypto_session_params *csp) { struct safexcel_session *sess; - struct safexcel_softc *sc; - sc = device_get_softc(dev); sess = crypto_get_driver_session(cses); sess->cses = cses; @@ -2533,7 +2525,6 @@ safexcel_newsession(device_t dev, crypto_session_t cses, static int safexcel_process(device_t dev, struct cryptop *crp, int hint) { - const struct crypto_session_params *csp; struct safexcel_request *req; struct safexcel_ring *ring; struct safexcel_session *sess; @@ -2542,7 +2533,6 @@ safexcel_process(device_t dev, struct cryptop *crp, int hint) sc = device_get_softc(dev); sess = crypto_get_driver_session(crp->crp_session); - csp = crypto_get_params(crp->crp_session); if (__predict_false(crypto_buffer_len(&crp->crp_buf) > SAFEXCEL_MAX_REQUEST_SIZE)) { From nobody Wed Dec 1 12:48:32 2021 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 1F9B818BA405; Wed, 1 Dec 2021 12:48:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zR45Ttjz3jmg; Wed, 1 Dec 2021 12:48:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D9EC1E8E; Wed, 1 Dec 2021 12:48:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1CmWj8065839; Wed, 1 Dec 2021 12:48:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1CmWud065838; Wed, 1 Dec 2021 12:48:32 GMT (envelope-from git) Date: Wed, 1 Dec 2021 12:48:32 GMT Message-Id: <202112011248.1B1CmWud065838@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: bc7bc3bdf95f - stable/13 - netinet: Remove in_cksum_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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: bc7bc3bdf95f29d72479cf8c3c858d257f12e327 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638362912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oOQEh8gIxAkEDjPHUvYMWxdFRLr27Zr4eZX9QZiRIpk=; b=g2ZTS0/umRk38LM2Fm3CYKVSp9qiuKv+f5LIQ4E5G/OJepUIaC38S1A3MVIAVm+a5vPscG pNqsK7U1EZds07zCvy7FsklC+rDt3SlOssIe/sdDR73R645aTl2loM1FMBArxh2s/MsVGs QzzlpKb1xAIFw361qNdkiPqbrleW7Uk9xqi0stno0wVoIS0OCwJ0FvXYqtsm85kbjrDdNo tAv3GWZiGukOWqj0TMLsQACz25syKMsNI5lOMPCVSzgNcE067qDhcfEyJgVdqIUIPvRoyF aapoyc1r1oUIBdZcJ67vSM1YFAUtODRMTeeVBkvVrvvygdmWmnoqQqgi7zbDkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638362912; a=rsa-sha256; cv=none; b=pGUqXZfSVr0DVf44k0L6jX+cRXdG1Txcb0+iocF2C/OUkpkoaKoEl6I9y1mzRVfaM38rIz slfERkml1cYUlzeee3XIIkGIz2dduGm8CFT6r9wBoKlFJxXis5Gq37f5WPF3+kTIAXPSB4 M0V8bcwshAwsFWK1MHCVqO+W1v1DQq49Wvl+i3ZR4ifmr4MQcRTS3Kgoj8IWzXLXwKoUUD JhL3b1/tFK1gplmDkw0QUZJzyuwm8oI84xSHyMyRTgKqoFIbv7o3MBdN27iSj+XIgUo5I6 YwZLfR9y31zWjevfLalWRPmO6zM+CCud5H71uxf/06UiNJNOyn++FLGYliV2Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bc7bc3bdf95f29d72479cf8c3c858d257f12e327 commit bc7bc3bdf95f29d72479cf8c3c858d257f12e327 Author: Mark Johnston AuthorDate: 2021-11-24 18:15:40 +0000 Commit: Mark Johnston CommitDate: 2021-12-01 12:41:55 +0000 netinet: Remove in_cksum_update() It was never implemented on powerpc or riscv and appears to have been unused since it was added in 1998. No functional change intended. Reviewed by: kp, glebius, cy Sponsored by: The FreeBSD Foundation (cherry picked from commit 09100f936be0684aa8caef441b96345960fd9c72) --- sys/amd64/include/in_cksum.h | 29 ----------------------------- sys/i386/include/in_cksum.h | 19 ------------------- sys/mips/include/in_cksum.h | 29 ----------------------------- sys/powerpc/include/in_cksum.h | 29 ----------------------------- 4 files changed, 106 deletions(-) diff --git a/sys/amd64/include/in_cksum.h b/sys/amd64/include/in_cksum.h index 79d30cafbc90..89ff1097f369 100644 --- a/sys/amd64/include/in_cksum.h +++ b/sys/amd64/include/in_cksum.h @@ -45,35 +45,6 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) -#if defined(IPVERSION) && (IPVERSION == 4) -/* - * It it useful to have an Internet checksum routine which is inlineable - * and optimized specifically for the task of computing IP header checksums - * in the normal case (where there are no options and the header length is - * therefore always exactly five 32-bit words. - */ -#ifdef __CC_SUPPORTS___INLINE - -static __inline void -in_cksum_update(struct ip *ip) -{ - int __tmpsum; - __tmpsum = (int)ntohs(ip->ip_sum) + 256; - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); -} - -#else - -#define in_cksum_update(ip) \ - do { \ - int __tmpsum; \ - __tmpsum = (int)ntohs(ip->ip_sum) + 256; \ - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \ - } while(0) - -#endif -#endif - #ifdef _KERNEL #if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); diff --git a/sys/i386/include/in_cksum.h b/sys/i386/include/in_cksum.h index 87c18ec4066d..a8214e97cd9a 100644 --- a/sys/i386/include/in_cksum.h +++ b/sys/i386/include/in_cksum.h @@ -83,14 +83,6 @@ in_cksum_hdr(const struct ip *ip) return ~sum & 0xffff; } - -static __inline void -in_cksum_update(struct ip *ip) -{ - int __tmpsum; - __tmpsum = (int)ntohs(ip->ip_sum) + 256; - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); -} #endif static __inline u_short @@ -123,17 +115,6 @@ in_pseudo(u_int sum, u_int b, u_int c) sum -= 0xffff; return (sum); } - -#else -#if defined(IPVERSION) && (IPVERSION == 4) -#define in_cksum_update(ip) \ - do { \ - int __tmpsum; \ - __tmpsum = (int)ntohs(ip->ip_sum) + 256; \ - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \ - } while(0) - -#endif #endif #ifdef _KERNEL diff --git a/sys/mips/include/in_cksum.h b/sys/mips/include/in_cksum.h index d55b838b42ed..580fb9c024f8 100644 --- a/sys/mips/include/in_cksum.h +++ b/sys/mips/include/in_cksum.h @@ -42,35 +42,6 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) -#if defined(IPVERSION) && (IPVERSION == 4) -/* - * It it useful to have an Internet checksum routine which is inlineable - * and optimized specifically for the task of computing IP header checksums - * in the normal case (where there are no options and the header length is - * therefore always exactly five 32-bit words. - */ -#ifdef __CC_SUPPORTS___INLINE - -static __inline void -in_cksum_update(struct ip *ip) -{ - int __tmpsum; - __tmpsum = (int)ntohs(ip->ip_sum) + 256; - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); -} - -#else - -#define in_cksum_update(ip) \ - do { \ - int __tmpsum; \ - __tmpsum = (int)ntohs(ip->ip_sum) + 256; \ - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \ - } while(0) - -#endif -#endif - #ifdef _KERNEL #if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); diff --git a/sys/powerpc/include/in_cksum.h b/sys/powerpc/include/in_cksum.h index fd34e13d3822..7407b4ad7104 100644 --- a/sys/powerpc/include/in_cksum.h +++ b/sys/powerpc/include/in_cksum.h @@ -41,35 +41,6 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) -#if defined(IPVERSION) && (IPVERSION == 4) -/* - * It it useful to have an Internet checksum routine which is inlineable - * and optimized specifically for the task of computing IP header checksums - * in the normal case (where there are no options and the header length is - * therefore always exactly five 32-bit words. - */ -#ifdef __CC_SUPPORTS___INLINE - -static __inline void -in_cksum_update(struct ip *ip) -{ - int __tmpsum; - __tmpsum = (int)ntohs(ip->ip_sum) + 256; - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); -} - -#else - -#define in_cksum_update(ip) \ - do { \ - int __tmpsum; \ - __tmpsum = (int)ntohs(ip->ip_sum) + 256; \ - ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \ - } while(0) - -#endif -#endif - #ifdef _KERNEL #if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); From nobody Wed Dec 1 12:48:33 2021 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 4001218BA2DA; Wed, 1 Dec 2021 12:48:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zR61Blgz3jqF; Wed, 1 Dec 2021 12:48:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE3851C5D; Wed, 1 Dec 2021 12:48:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1CmXHT065866; Wed, 1 Dec 2021 12:48:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1CmX8D065865; Wed, 1 Dec 2021 12:48:33 GMT (envelope-from git) Date: Wed, 1 Dec 2021 12:48:33 GMT Message-Id: <202112011248.1B1CmX8D065865@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: 6c5409c5d6c7 - stable/13 - natd: Remove uneeded in_cksum.h includes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6c5409c5d6c7e018c5f16df47a700a557568dc5d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638362914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YFeXicHo9vwUr6TTz6rBwlxjDG63YMpASa9a+rc90dg=; b=YMf1bfw6DYRnlMRmS4EEEzj9fyqyeIOYJzKzkSnhSOuNHLLG6Z39qX013WxruolKnVa4YQ i+1nqsst5dHDqxSRnaQxmRiHbZ3nM/Br8d0rR0h2aVd5DenHRAAzOg1jhXK+gDhwQvRdsC vjSJwTok8IaOTaob88CsjlUxC55lFCDGtYPZTmepT/AJv2Nj4UYYYk9aZztuZHeqeggo9/ oM0DZuHd3z35ifjRyqnXuqiATKjdEB5RNAqTjZhvd+YT1dvd4wyGmToSFEJRdnvJHjzvGY aK8Vmn/wxHXTqa+f7Raowik5yA0Ehg2VhtLchBMZN5VA6k7g3xcd5ghJZuvurQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638362914; a=rsa-sha256; cv=none; b=HKhhGdBv6A8iyu9kywmIeoly+s/ozbugJQZaYqcO9fIBqG1S4+M3YpCa8xvZH/7MEm330C ZzG/1Rfd5Cm4KapomJ2HNXrlnMCZ4N9eU6rfcrCZS5EkOj5BmHdRPFqpqyQAtSQhxXPgAN zto5s9bHBSlLq/S8F9aHz/B07gXhU9EkZPel+PTG3Lj7utl3C9Vfc9XK/PpEoMn0DJmI6C mVfALxhJFrYacBmzVriQ8DFHqiEz3Cl0X0aqmojeo6lPqHzPp/5qO8s7kQp1UpErCcN/ak Z1PxeNOEziU+akylnWoDbVnPdirf7oIjTRrcvaTgto+oB4RU6ohi2wUlIr/phw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6c5409c5d6c7e018c5f16df47a700a557568dc5d commit 6c5409c5d6c7e018c5f16df47a700a557568dc5d Author: Mark Johnston AuthorDate: 2021-11-24 18:30:28 +0000 Commit: Mark Johnston CommitDate: 2021-12-01 12:42:13 +0000 natd: Remove uneeded in_cksum.h includes Sponsored by: The FreeBSD Foundation (cherry picked from commit 517373f7230207e60e4561bc44c8b3c44acea963) --- sbin/natd/icmp.c | 1 - sbin/natd/natd.c | 1 - 2 files changed, 2 deletions(-) diff --git a/sbin/natd/icmp.c b/sbin/natd/icmp.c index 1509b965f4b8..f85457ac4773 100644 --- a/sbin/natd/icmp.c +++ b/sbin/natd/icmp.c @@ -30,7 +30,6 @@ #include #include #include -#include #include diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index 268850c0a95a..402c430dfdfd 100644 --- a/sbin/natd/natd.c +++ b/sbin/natd/natd.c @@ -24,7 +24,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From nobody Wed Dec 1 12:48:34 2021 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 28F4818BA341; Wed, 1 Dec 2021 12:48:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zR70rZzz3jf2; Wed, 1 Dec 2021 12:48:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E02181CCA; Wed, 1 Dec 2021 12:48:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1CmYpK065899; Wed, 1 Dec 2021 12:48:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1CmYVa065898; Wed, 1 Dec 2021 12:48:34 GMT (envelope-from git) Date: Wed, 1 Dec 2021 12:48:34 GMT Message-Id: <202112011248.1B1CmYVa065898@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: 53e965ff94c3 - stable/13 - netinet: Remove in_cksum.c 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 53e965ff94c3a420e9b240920dc1eb742515b664 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638362915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GHYyWiNmcZdhpMkclM5kDecLlb40i8ZlMtBj/Y6lwHI=; b=x43tkq00RjcvDEHs1dK57aGBN+XDnkB82XV4m8qQtDQhy2AnEy5Y69CfxE5SW30WaksgRE nVsTbHjwNyM94DE3sU6IXIpeqbsPA0FzFqnh8gow/A4MyA9MQnXrdGuF0TlA/zL0n2DqYh HH7Zxo4qmlWqGsp+tKwJum2P2t10X2f6655GIx7+lSsLVsq5ZfhNsM8jWvj/yLKkoyhNeu T5ZK1J2awArGSim9x4jmEVZVG9r9XGTA8omuRRBSKLSMygProH/eFYcchn5FSFNyxy595P 36KYjbeECFpUEkqaeVqau9HgNQRrPARhxOi9AvMS80THJgQllixPe1eX7ieauQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638362915; a=rsa-sha256; cv=none; b=q2DJyJuvYZPZbf7bowxJgbc35HbAl8mQsTsbpoAslayakJXjNt+PvFwz2PNuAfYbHofaPa 4YZLwA4o/TYipsya1zbvDWSXFGrWO1DmPfSPq/3Xowa2zrmf/Wy2p42XTY41sJeUSc6QDg bUognRsGSQ0kotnWvUToJ7zQe/UcGoJRS1FN0AKTfXjDIngsCk0Qz7qBjorcIcLiOCPu7j oQ40SUF1sZSjyarjsdVwhLaJc7/92NSLojLaF3S+W5x2NMGjfLIYE2x/lw5wELbNt+lm22 Do1qZS4EdVabseh98XJQI3PCFbNFqt40wySZGpNCwjD7fFRbPElsyrNPtD3oww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=53e965ff94c3a420e9b240920dc1eb742515b664 commit 53e965ff94c3a420e9b240920dc1eb742515b664 Author: Mark Johnston AuthorDate: 2021-11-24 18:19:34 +0000 Commit: Mark Johnston CommitDate: 2021-12-01 12:42:26 +0000 netinet: Remove in_cksum.c It does not get compiled into the kernel. No functional change inteneded. Reviewed by: kp, glebius, cy Sponsored by: The FreeBSD Foundation (cherry picked from commit 5195bcc2126b302802643f5204d1030e5893fb62) --- sys/netinet/in_cksum.c | 148 ------------------------------------------------- 1 file changed, 148 deletions(-) diff --git a/sys/netinet/in_cksum.c b/sys/netinet/in_cksum.c deleted file mode 100644 index 64a69760dab7..000000000000 --- a/sys/netinet/in_cksum.c +++ /dev/null @@ -1,148 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1988, 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include - -/* - * Checksum routine for Internet Protocol family headers (Portable Version). - * - * This routine is very heavily used in the network - * code and should be modified for each CPU to be as fast as possible. - */ - -#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) -#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);} - -int -in_cksum(struct mbuf *m, int len) -{ - u_short *w; - int sum = 0; - int mlen = 0; - int byte_swapped = 0; - - union { - char c[2]; - u_short s; - } s_util; - union { - u_short s[2]; - long l; - } l_util; - - for (;m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - w = mtod(m, u_short *); - if (mlen == -1) { - /* - * The first byte of this mbuf is the continuation - * of a word spanning between this mbuf and the - * last mbuf. - * - * s_util.c[0] is already saved when scanning previous - * mbuf. - */ - s_util.c[1] = *(char *)w; - sum += s_util.s; - w = (u_short *)((char *)w + 1); - mlen = m->m_len - 1; - len--; - } else - mlen = m->m_len; - if (len < mlen) - mlen = len; - len -= mlen; - /* - * Force to even boundary. - */ - if ((1 & (uintptr_t) w) && (mlen > 0)) { - REDUCE; - sum <<= 8; - s_util.c[0] = *(u_char *)w; - w = (u_short *)((char *)w + 1); - mlen--; - byte_swapped = 1; - } - /* - * Unroll the loop to make overhead from - * branches &c small. - */ - while ((mlen -= 32) >= 0) { - sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; - sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; - sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11]; - sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15]; - w += 16; - } - mlen += 32; - while ((mlen -= 8) >= 0) { - sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; - w += 4; - } - mlen += 8; - if (mlen == 0 && byte_swapped == 0) - continue; - REDUCE; - while ((mlen -= 2) >= 0) { - sum += *w++; - } - if (byte_swapped) { - REDUCE; - sum <<= 8; - byte_swapped = 0; - if (mlen == -1) { - s_util.c[1] = *(char *)w; - sum += s_util.s; - mlen = 0; - } else - mlen = -1; - } else if (mlen == -1) - s_util.c[0] = *(char *)w; - } - if (len) - printf("cksum: out of data\n"); - if (mlen == -1) { - /* The last mbuf has odd # of bytes. Follow the - standard (the odd byte may be shifted left by 8 bits - or not as determined by endian-ness of the machine) */ - s_util.c[1] = 0; - sum += s_util.s; - } - REDUCE; - return (~sum & 0xffff); -} From nobody Wed Dec 1 12:48:35 2021 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 5155118BA3B5; Wed, 1 Dec 2021 12:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zR81j1dz3jcW; Wed, 1 Dec 2021 12:48:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B0AE1564; Wed, 1 Dec 2021 12:48:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1CmZfA065923; Wed, 1 Dec 2021 12:48:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1CmZQC065922; Wed, 1 Dec 2021 12:48:35 GMT (envelope-from git) Date: Wed, 1 Dec 2021 12:48:35 GMT Message-Id: <202112011248.1B1CmZQC065922@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: 1d250ec70748 - stable/13 - netinet: Deduplicate most in_cksum() implementations 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 1d250ec70748f9efb4d52d93bdd71eff6de057ee Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638362916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0kSulYIRyH6/Y8DFtNtvY//FLQzsp42HryGTHEp920c=; b=QXZxeR9qjHIKwr7ild17BBW5KVAcEaiYWYGzAL7uQz2huCwvswMpom3WwTPKmaicJHqOpV DZLqKUg51W9wMc1g4XW4nND4ZRR6RZoJ7Cy6CNyuv29n9J85t1k81yFzxVMfnI8I8ViJvR A7QvdcBJb7lw/ph1cIuTnFoZyuQyJKareLii7eCWeuDh19k58CtWt8yeI7UXp3j/Xji9/j QUZ8Thu5KHaVjj2O5Rf5xThOZ4VX55xX9ZBIDLJUwJ7BZUXspz7nkOF9mMSwMU+iClAFon RBferW1nCNdNjk/U+IbKveK6yn9B8rdkWv0BQQebD5CHwmw+brGEm6PYfZ1bAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638362916; a=rsa-sha256; cv=none; b=JjYFEG5q5EEzoo02G3KPI1paU7SOcpYYhR+B69zBTrAu4pp21fJ6Bz0If+qUU0OrOAnIOo Hro7ZuomA/CN6FDhFENCMfN6QuWYRLkK5d9xrJ4Oavue2gpklU3/qglpeKb1K7WpgDqqRF mtYoEZhe+HHtdiiMFdSlMJslOsBVqP6WPeqTQHsn9oXMlUa4hpWk9f7bTNPw6Pkm4m40g+ hvMHpYNZQhT4JdUscLXc3lXhDWlxS7ajQ5oI0po4M6FWuQMaKgEIxPKkVlpjDeiPHjbBxZ lSMZ26IKESTS0yrUedZD0Yb/1SBE9gswzHlLLyiI77IxPAOviBPiNl1qlVgTZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d250ec70748f9efb4d52d93bdd71eff6de057ee commit 1d250ec70748f9efb4d52d93bdd71eff6de057ee Author: Mark Johnston AuthorDate: 2021-11-24 18:19:44 +0000 Commit: Mark Johnston CommitDate: 2021-12-01 12:42:43 +0000 netinet: Deduplicate most in_cksum() implementations in_cksum() and related routines are implemented separately for each platform, but only i386 and arm have optimized versions. Other platforms' copies of in_cksum.c are identical except for style differences and support for big-endian CPUs. Deduplicate the implementations for the rest of the platforms. This will make it easier to implement in_cksum() for unmapped mbufs. On arm and i386, define HAVE_MD_IN_CKSUM to mean that the MI implementation is not to be compiled. No functional change intended. Reviewed by: kp, glebius Sponsored by: The FreeBSD Foundation (cherry picked from commit ecbbe831445a4b94279e5932828d60076e4ca444) --- sys/amd64/amd64/in_cksum.c | 243 ---------------------- sys/arm/arm/{in_cksum.c => in_cksum_machdep.c} | 0 sys/arm/include/in_cksum.h | 3 + sys/arm64/arm64/in_cksum.c | 241 --------------------- sys/conf/files | 1 + sys/conf/files.amd64 | 1 - sys/conf/files.arm | 2 +- sys/conf/files.arm64 | 1 - sys/conf/files.i386 | 2 +- sys/conf/files.mips | 1 - sys/conf/files.powerpc | 1 - sys/conf/files.riscv | 1 - sys/i386/i386/{in_cksum.c => in_cksum_machdep.c} | 0 sys/i386/include/in_cksum.h | 3 + sys/{mips/mips => netinet}/in_cksum.c | 7 + sys/powerpc/powerpc/in_cksum.c | 253 ----------------------- sys/riscv/riscv/in_cksum.c | 243 ---------------------- 17 files changed, 16 insertions(+), 987 deletions(-) diff --git a/sys/amd64/amd64/in_cksum.c b/sys/amd64/amd64/in_cksum.c deleted file mode 100644 index 30e90f043cc3..000000000000 --- a/sys/amd64/amd64/in_cksum.c +++ /dev/null @@ -1,243 +0,0 @@ -/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1988, 1992, 1993 - * The Regents of the University of California. All rights reserved. - * Copyright (c) 1996 - * Matt Thomas - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 - */ - -#include /* RCS ID & Copyright macro defns */ -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -/* - * Checksum routine for Internet Protocol family headers - * (Portable Alpha version). - * - * This routine is very heavily used in the network - * code and should be modified for each CPU to be as fast as possible. - */ - -#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) -#define REDUCE32 \ - { \ - q_util.q = sum; \ - sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ - } -#define REDUCE16 \ - { \ - q_util.q = sum; \ - l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ - sum = l_util.s[0] + l_util.s[1]; \ - ADDCARRY(sum); \ - } - -static const u_int32_t in_masks[] = { - /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ - 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ - 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */ - 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */ - 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */ -}; - -union l_util { - u_int16_t s[2]; - u_int32_t l; -}; -union q_util { - u_int16_t s[4]; - u_int32_t l[2]; - u_int64_t q; -}; - -static u_int64_t -in_cksumdata(const void *buf, int len) -{ - const u_int32_t *lw = (const u_int32_t *) buf; - u_int64_t sum = 0; - u_int64_t prefilled; - int offset; - union q_util q_util; - - if ((3 & (long) lw) == 0 && len == 20) { - sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4]; - REDUCE32; - return sum; - } - - if ((offset = 3 & (long) lw) != 0) { - const u_int32_t *masks = in_masks + (offset << 2); - lw = (u_int32_t *) (((long) lw) - offset); - sum = *lw++ & masks[len >= 3 ? 3 : len]; - len -= 4 - offset; - if (len <= 0) { - REDUCE32; - return sum; - } - } -#if 0 - /* - * Force to cache line boundary. - */ - offset = 32 - (0x1f & (long) lw); - if (offset < 32 && len > offset) { - len -= offset; - if (4 & offset) { - sum += (u_int64_t) lw[0]; - lw += 1; - } - if (8 & offset) { - sum += (u_int64_t) lw[0] + lw[1]; - lw += 2; - } - if (16 & offset) { - sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; - lw += 4; - } - } -#endif - /* - * access prefilling to start load of next cache line. - * then add current cache line - * save result of prefilling for loop iteration. - */ - prefilled = lw[0]; - while ((len -= 32) >= 4) { - u_int64_t prefilling = lw[8]; - sum += prefilled + lw[1] + lw[2] + lw[3] - + lw[4] + lw[5] + lw[6] + lw[7]; - lw += 8; - prefilled = prefilling; - } - if (len >= 0) { - sum += prefilled + lw[1] + lw[2] + lw[3] - + lw[4] + lw[5] + lw[6] + lw[7]; - lw += 8; - } else { - len += 32; - } - while ((len -= 16) >= 0) { - sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; - lw += 4; - } - len += 16; - while ((len -= 4) >= 0) { - sum += (u_int64_t) *lw++; - } - len += 4; - if (len > 0) - sum += (u_int64_t) (in_masks[len] & *lw); - REDUCE32; - return sum; -} - -u_short -in_addword(u_short a, u_short b) -{ - u_int64_t sum = a + b; - - ADDCARRY(sum); - return (sum); -} - -u_short -in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c) -{ - u_int64_t sum; - union q_util q_util; - union l_util l_util; - - sum = (u_int64_t) a + b + c; - REDUCE16; - return (sum); -} - -u_short -in_cksum_skip(struct mbuf *m, int len, int skip) -{ - u_int64_t sum = 0; - int mlen = 0; - int clen = 0; - caddr_t addr; - union q_util q_util; - union l_util l_util; - - len -= skip; - for (; skip && m; m = m->m_next) { - if (m->m_len > skip) { - mlen = m->m_len - skip; - addr = mtod(m, caddr_t) + skip; - goto skip_start; - } else { - skip -= m->m_len; - } - } - - for (; m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - mlen = m->m_len; - addr = mtod(m, caddr_t); -skip_start: - if (len < mlen) - mlen = len; - if ((clen ^ (long) addr) & 1) - sum += in_cksumdata(addr, mlen) << 8; - else - sum += in_cksumdata(addr, mlen); - - clen += mlen; - len -= mlen; - } - REDUCE16; - return (~sum & 0xffff); -} - -u_int in_cksum_hdr(const struct ip *ip) -{ - u_int64_t sum = in_cksumdata(ip, sizeof(struct ip)); - union q_util q_util; - union l_util l_util; - REDUCE16; - return (~sum & 0xffff); -} diff --git a/sys/arm/arm/in_cksum.c b/sys/arm/arm/in_cksum_machdep.c similarity index 100% rename from sys/arm/arm/in_cksum.c rename to sys/arm/arm/in_cksum_machdep.c diff --git a/sys/arm/include/in_cksum.h b/sys/arm/include/in_cksum.h index a75433830d73..352d46f07e7b 100644 --- a/sys/arm/include/in_cksum.h +++ b/sys/arm/include/in_cksum.h @@ -40,6 +40,9 @@ #include #ifdef _KERNEL + +#define HAVE_MD_IN_CKSUM + u_short in_cksum(struct mbuf *m, int len); u_short in_addword(u_short sum, u_short b); u_short in_cksum_skip(struct mbuf *m, int len, int skip); diff --git a/sys/arm64/arm64/in_cksum.c b/sys/arm64/arm64/in_cksum.c deleted file mode 100644 index ae02e91d9203..000000000000 --- a/sys/arm64/arm64/in_cksum.c +++ /dev/null @@ -1,241 +0,0 @@ -/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ - -/*- - * Copyright (c) 1988, 1992, 1993 - * The Regents of the University of California. All rights reserved. - * Copyright (c) 1996 - * Matt Thomas - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 - */ - -#include /* RCS ID & Copyright macro defns */ -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -/* - * Checksum routine for Internet Protocol family headers - * (Portable Alpha version). - * - * This routine is very heavily used in the network - * code and should be modified for each CPU to be as fast as possible. - */ - -#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) -#define REDUCE32 \ - { \ - q_util.q = sum; \ - sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ - } -#define REDUCE16 \ - { \ - q_util.q = sum; \ - l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ - sum = l_util.s[0] + l_util.s[1]; \ - ADDCARRY(sum); \ - } - -static const u_int32_t in_masks[] = { - /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ - 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ - 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */ - 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */ - 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */ -}; - -union l_util { - u_int16_t s[2]; - u_int32_t l; -}; -union q_util { - u_int16_t s[4]; - u_int32_t l[2]; - u_int64_t q; -}; - -static u_int64_t -in_cksumdata(const void *buf, int len) -{ - const u_int32_t *lw = (const u_int32_t *) buf; - u_int64_t sum = 0; - u_int64_t prefilled; - int offset; - union q_util q_util; - - if ((3 & (long) lw) == 0 && len == 20) { - sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4]; - REDUCE32; - return sum; - } - - if ((offset = 3 & (long) lw) != 0) { - const u_int32_t *masks = in_masks + (offset << 2); - lw = (u_int32_t *) (((long) lw) - offset); - sum = *lw++ & masks[len >= 3 ? 3 : len]; - len -= 4 - offset; - if (len <= 0) { - REDUCE32; - return sum; - } - } -#if 0 - /* - * Force to cache line boundary. - */ - offset = 32 - (0x1f & (long) lw); - if (offset < 32 && len > offset) { - len -= offset; - if (4 & offset) { - sum += (u_int64_t) lw[0]; - lw += 1; - } - if (8 & offset) { - sum += (u_int64_t) lw[0] + lw[1]; - lw += 2; - } - if (16 & offset) { - sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; - lw += 4; - } - } -#endif - /* - * access prefilling to start load of next cache line. - * then add current cache line - * save result of prefilling for loop iteration. - */ - prefilled = lw[0]; - while ((len -= 32) >= 4) { - u_int64_t prefilling = lw[8]; - sum += prefilled + lw[1] + lw[2] + lw[3] - + lw[4] + lw[5] + lw[6] + lw[7]; - lw += 8; - prefilled = prefilling; - } - if (len >= 0) { - sum += prefilled + lw[1] + lw[2] + lw[3] - + lw[4] + lw[5] + lw[6] + lw[7]; - lw += 8; - } else { - len += 32; - } - while ((len -= 16) >= 0) { - sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; - lw += 4; - } - len += 16; - while ((len -= 4) >= 0) { - sum += (u_int64_t) *lw++; - } - len += 4; - if (len > 0) - sum += (u_int64_t) (in_masks[len] & *lw); - REDUCE32; - return sum; -} - -u_short -in_addword(u_short a, u_short b) -{ - u_int64_t sum = a + b; - - ADDCARRY(sum); - return (sum); -} - -u_short -in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c) -{ - u_int64_t sum; - union q_util q_util; - union l_util l_util; - - sum = (u_int64_t) a + b + c; - REDUCE16; - return (sum); -} - -u_short -in_cksum_skip(struct mbuf *m, int len, int skip) -{ - u_int64_t sum = 0; - int mlen = 0; - int clen = 0; - caddr_t addr; - union q_util q_util; - union l_util l_util; - - len -= skip; - for (; skip && m; m = m->m_next) { - if (m->m_len > skip) { - mlen = m->m_len - skip; - addr = mtod(m, caddr_t) + skip; - goto skip_start; - } else { - skip -= m->m_len; - } - } - - for (; m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - mlen = m->m_len; - addr = mtod(m, caddr_t); -skip_start: - if (len < mlen) - mlen = len; - if ((clen ^ (long) addr) & 1) - sum += in_cksumdata(addr, mlen) << 8; - else - sum += in_cksumdata(addr, mlen); - - clen += mlen; - len -= mlen; - } - REDUCE16; - return (~sum & 0xffff); -} - -u_int in_cksum_hdr(const struct ip *ip) -{ - u_int64_t sum = in_cksumdata(ip, sizeof(struct ip)); - union q_util q_util; - union l_util l_util; - REDUCE16; - return (~sum & 0xffff); -} diff --git a/sys/conf/files b/sys/conf/files index 3dc1caf8b53a..abfc1f9101ae 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4363,6 +4363,7 @@ netinet/accf_http.c optional accept_filter_http inet netinet/if_ether.c optional inet ether netinet/igmp.c optional inet netinet/in.c optional inet +netinet/in_cksum.c optional inet | inet6 netinet/in_debug.c optional inet ddb netinet/in_kdtrace.c optional inet | inet6 netinet/ip_carp.c optional inet carp | inet6 carp diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index bf2213eec68c..633d9125398c 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -110,7 +110,6 @@ amd64/amd64/exception.S standard amd64/amd64/exec_machdep.c standard amd64/amd64/fpu.c standard amd64/amd64/gdb_machdep.c optional gdb -amd64/amd64/in_cksum.c optional inet | inet6 amd64/amd64/initcpu.c standard amd64/amd64/io.c optional io amd64/amd64/locore.S standard no-obj diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 69437d21e880..6f535f57b07e 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -34,8 +34,8 @@ arm/arm/generic_timer.c optional generic_timer arm/arm/gic.c optional gic arm/arm/gic_fdt.c optional gic fdt arm/arm/identcpu-v6.c standard -arm/arm/in_cksum.c optional inet | inet6 arm/arm/in_cksum_arm.S optional inet | inet6 +arm/arm/in_cksum_machdep.c optional inet | inet6 kern/subr_intr.c standard arm/arm/locore.S standard no-obj arm/arm/hypervisor-stub.S standard diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 84fd0c7858ff..c855d908bfc9 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -56,7 +56,6 @@ arm64/arm64/gic_v3.c standard arm64/arm64/gic_v3_acpi.c optional acpi arm64/arm64/gic_v3_fdt.c optional fdt arm64/arm64/identcpu.c standard -arm64/arm64/in_cksum.c optional inet | inet6 arm64/arm64/locore.S standard no-obj arm64/arm64/machdep.c standard arm64/arm64/machdep_boot.c standard diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 7beb3f21292c..8da7a15a5b63 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -173,7 +173,7 @@ i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode -i386/i386/in_cksum.c optional inet | inet6 +i386/i386/in_cksum_machdep.c optional inet | inet6 i386/i386/initcpu.c standard i386/i386/io.c optional io i386/i386/k6_mem.c optional mem diff --git a/sys/conf/files.mips b/sys/conf/files.mips index 7ee5b0019bd7..70eb44d0165d 100644 --- a/sys/conf/files.mips +++ b/sys/conf/files.mips @@ -20,7 +20,6 @@ mips/mips/exception.S standard mips/mips/fp.S standard mips/mips/freebsd32_machdep.c optional compat_freebsd32 mips/mips/gdb_machdep.c standard -mips/mips/in_cksum.c optional inet mips/mips/libkern_machdep.c standard mips/mips/locore.S standard no-obj mips/mips/machdep.c standard diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 347abee153d2..c8de9f5fa7a8 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -255,7 +255,6 @@ powerpc/powerpc/elf64_machdep.c optional powerpc64 | powerpc64le powerpc/powerpc/exec_machdep.c standard powerpc/powerpc/fpu.c standard powerpc/powerpc/gdb_machdep.c optional gdb -powerpc/powerpc/in_cksum.c optional inet | inet6 powerpc/powerpc/interrupt.c standard powerpc/powerpc/intr_machdep.c standard powerpc/powerpc/iommu_if.m standard diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 222a00956c17..1b03a8840109 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -48,7 +48,6 @@ riscv/riscv/elf_machdep.c standard riscv/riscv/exception.S standard riscv/riscv/exec_machdep.c standard riscv/riscv/intr_machdep.c standard -riscv/riscv/in_cksum.c optional inet | inet6 riscv/riscv/identcpu.c standard riscv/riscv/locore.S standard no-obj riscv/riscv/machdep.c standard diff --git a/sys/i386/i386/in_cksum.c b/sys/i386/i386/in_cksum_machdep.c similarity index 100% rename from sys/i386/i386/in_cksum.c rename to sys/i386/i386/in_cksum_machdep.c diff --git a/sys/i386/include/in_cksum.h b/sys/i386/include/in_cksum.h index a8214e97cd9a..6b9c62942561 100644 --- a/sys/i386/include/in_cksum.h +++ b/sys/i386/include/in_cksum.h @@ -118,6 +118,9 @@ in_pseudo(u_int sum, u_int b, u_int c) #endif #ifdef _KERNEL + +#define HAVE_MD_IN_CKSUM + #if !defined(__GNUCLIKE_ASM) #if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); diff --git a/sys/mips/mips/in_cksum.c b/sys/netinet/in_cksum.c similarity index 98% rename from sys/mips/mips/in_cksum.c rename to sys/netinet/in_cksum.c index 8f9a2d9de106..581950c8afa4 100644 --- a/sys/mips/mips/in_cksum.c +++ b/sys/netinet/in_cksum.c @@ -48,6 +48,11 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * These implementations may be overridden on a per-platform basis. + */ +#ifndef HAVE_MD_IN_CKSUM + /* * Checksum routine for Internet Protocol family headers * (Portable Alpha version). @@ -248,3 +253,5 @@ u_int in_cksum_hdr(const struct ip *ip) REDUCE16; return (~sum & 0xffff); } + +#endif /* !HAVE_MD_IN_CKSUM */ diff --git a/sys/powerpc/powerpc/in_cksum.c b/sys/powerpc/powerpc/in_cksum.c deleted file mode 100644 index 906dc7e8d9a3..000000000000 --- a/sys/powerpc/powerpc/in_cksum.c +++ /dev/null @@ -1,253 +0,0 @@ -/* $FreeBSD$ */ -/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1988, 1992, 1993 - * The Regents of the University of California. All rights reserved. - * Copyright (c) 1996 - * Matt Thomas - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 - */ - -#include /* RCS ID & Copyright macro defns */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Checksum routine for Internet Protocol family headers - * (Portable Alpha version). - * - * This routine is very heavily used in the network - * code and should be modified for each CPU to be as fast as possible. - */ - -#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) -#define REDUCE32 \ - { \ - q_util.q = sum; \ - sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ - } -#define REDUCE16 \ - { \ - q_util.q = sum; \ - l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ - sum = l_util.s[0] + l_util.s[1]; \ - ADDCARRY(sum); \ - } - -static const u_int32_t in_masks[] = { -#if _BYTE_ORDER == _LITTLE_ENDIAN - /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ - 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ - 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */ - 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */ - 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */ -#else - /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ - 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */ - 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */ - 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */ - 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */ -#endif -}; - -union l_util { - u_int16_t s[2]; - u_int32_t l; -}; -union q_util { - u_int16_t s[4]; - u_int32_t l[2]; - u_int64_t q; -}; - -static u_int64_t -in_cksumdata(const void *buf, int len) -{ - const u_int32_t *lw = (const u_int32_t *) buf; - u_int64_t sum = 0; - u_int64_t prefilled; - int offset; - union q_util q_util; - - if ((3 & (long) lw) == 0 && len == 20) { - sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4]; - REDUCE32; - return sum; - } - - if ((offset = 3 & (long) lw) != 0) { - const u_int32_t *masks = in_masks + (offset << 2); - lw = (u_int32_t *) (((long) lw) - offset); - sum = *lw++ & masks[len >= 3 ? 3 : len]; - len -= 4 - offset; - if (len <= 0) { - REDUCE32; - return sum; - } - } -#if 0 - /* - * Force to cache line boundary. - */ - offset = 32 - (0x1f & (long) lw); - if (offset < 32 && len > offset) { - len -= offset; - if (4 & offset) { - sum += (u_int64_t) lw[0]; - lw += 1; - } - if (8 & offset) { - sum += (u_int64_t) lw[0] + lw[1]; - lw += 2; - } - if (16 & offset) { - sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; - lw += 4; - } - } -#endif - /* - * access prefilling to start load of next cache line. - * then add current cache line - * save result of prefilling for loop iteration. - */ - prefilled = lw[0]; - while ((len -= 32) >= 4) { - u_int64_t prefilling = lw[8]; - sum += prefilled + lw[1] + lw[2] + lw[3] - + lw[4] + lw[5] + lw[6] + lw[7]; - lw += 8; - prefilled = prefilling; - } - if (len >= 0) { - sum += prefilled + lw[1] + lw[2] + lw[3] - + lw[4] + lw[5] + lw[6] + lw[7]; - lw += 8; - } else { - len += 32; - } - while ((len -= 16) >= 0) { - sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; - lw += 4; - } - len += 16; - while ((len -= 4) >= 0) { - sum += (u_int64_t) *lw++; - } - len += 4; - if (len > 0) - sum += (u_int64_t) (in_masks[len] & *lw); - REDUCE32; - return sum; -} - -u_short -in_addword(u_short a, u_short b) -{ - u_int64_t sum = a + b; - - ADDCARRY(sum); - return (sum); -} - -u_short -in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c) -{ - u_int64_t sum; - union q_util q_util; - union l_util l_util; - - sum = (u_int64_t) a + b + c; - REDUCE16; - return (sum); -} - -u_short -in_cksum_skip(struct mbuf *m, int len, int skip) -{ - u_int64_t sum = 0; - int mlen = 0; - int clen = 0; - caddr_t addr; - union q_util q_util; - union l_util l_util; - - len -= skip; - for (; skip && m; m = m->m_next) { - if (m->m_len > skip) { - mlen = m->m_len - skip; - addr = mtod(m, caddr_t) + skip; - goto skip_start; - } else { - skip -= m->m_len; - } - } - - for (; m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - mlen = m->m_len; - addr = mtod(m, caddr_t); -skip_start: - if (len < mlen) - mlen = len; - - if ((clen ^ (long) addr) & 1) - sum += in_cksumdata(addr, mlen) << 8; - else - sum += in_cksumdata(addr, mlen); - - clen += mlen; - len -= mlen; - } - REDUCE16; - return (~sum & 0xffff); -} - -u_int in_cksum_hdr(const struct ip *ip) -{ - u_int64_t sum = in_cksumdata(ip, sizeof(struct ip)); - union q_util q_util; - union l_util l_util; - REDUCE16; - return (~sum & 0xffff); -} diff --git a/sys/riscv/riscv/in_cksum.c b/sys/riscv/riscv/in_cksum.c deleted file mode 100644 index 30e90f043cc3..000000000000 --- a/sys/riscv/riscv/in_cksum.c +++ /dev/null @@ -1,243 +0,0 @@ -/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1988, 1992, 1993 - * The Regents of the University of California. All rights reserved. - * Copyright (c) 1996 - * Matt Thomas - * - * 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. *** 225 LINES SKIPPED *** From nobody Wed Dec 1 12:48:37 2021 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 E55EA18BA2F3; Wed, 1 Dec 2021 12:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zRB0wrvz3jsv; Wed, 1 Dec 2021 12:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 295011CCB; Wed, 1 Dec 2021 12:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1CmbIs065947; Wed, 1 Dec 2021 12:48:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1CmbWs065946; Wed, 1 Dec 2021 12:48:37 GMT (envelope-from git) Date: Wed, 1 Dec 2021 12:48:37 GMT Message-Id: <202112011248.1B1CmbWs065946@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: dfd5240189ca - stable/13 - netinet: Implement in_cksum_skip() using m_apply() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: dfd5240189ca024b268e53df2f0a3076df57b240 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638362919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mDJO7VAiijOT99SXK5CThttoeB0sjP2PM2WLwjAoZcs=; b=nE+XSH3YmEjiEetZhSD9rY2roTCqjXZctl0gFR+FI/dqP6DistYlFzPFnctkQLTS1bOQa8 cxhLL9wGYNKITStZwYp8d02yVE+D9buGPQN0l4AfTAYxLW9ZWSnVy0PAUWxK1QZTU0EGmx 2s9jw4//GOEXTwH8ubG68I35+3XPpBLNUf8s3IPf9RbOAluPJZCf8pnxTbROACvMxDeU5h 4917Z3nHRnXBk5isolOM53u0VQbTG/FVXrz4OH2iDiURM7AlRh2uoTXvrHAmQx5sA/l2xv kWIXGVtAU06PwfFmISKjVoye+1jqHIhYg2h4PDoz/U/MH7aYS7akyXQ5ieJOxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638362919; a=rsa-sha256; cv=none; b=sZhaTfC9QE+VH6CjaqWL/ObvTuOi+O4N/Yd/7B/+lnYH3jOTJCuwpKS+x4OcZRLk1BBqvo 7NpO17KDOkTWgILvkSl8R1+8j/4AIvldFS5UGwUY7FGhkkZKQpY8H+PNhFYLqzNJERPlgb 869MsKjEIWelk3kRg3tfBTwqQIYT6GsGMW3uIPUozVHDWBp+Z4JgXehijukxRD9CE4Dqb0 ZJV+b/ZIsguBeunfUOJZ6Blj6lU6cB0nVfSa0fl7/k94GG246wKTeFBgwZHQ502wjBP8sY q4XmTgWusn8JdlTIKm9d11N2IGT93UKSUuirCV6/xFA63zW9WYuUVMiQKHk5Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dfd5240189ca024b268e53df2f0a3076df57b240 commit dfd5240189ca024b268e53df2f0a3076df57b240 Author: Mark Johnston AuthorDate: 2021-11-24 18:19:54 +0000 Commit: Mark Johnston CommitDate: 2021-12-01 12:43:03 +0000 netinet: Implement in_cksum_skip() using m_apply() This allows it to work with unmapped mbufs. In particular, in_cksum_skip() calls no longer need to be preceded by calls to mb_unmapped_to_ext() to avoid a page fault. PR: 259645 Reviewed by: gallatin, glebius, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 0d9c3423f59bb305301f5a5bc7c8f5daf7b7aa52) --- sys/netinet/in_cksum.c | 63 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/sys/netinet/in_cksum.c b/sys/netinet/in_cksum.c index 581950c8afa4..98317d4dac4a 100644 --- a/sys/netinet/in_cksum.c +++ b/sys/netinet/in_cksum.c @@ -49,7 +49,9 @@ __FBSDID("$FreeBSD$"); #include /* - * These implementations may be overridden on a per-platform basis. + * These implementations may be overridden on a per-platform basis. On + * platforms with a direct map, the implementation of in_cksum() must handle + * unmapped mbufs. */ #ifndef HAVE_MD_IN_CKSUM @@ -203,44 +205,43 @@ in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c) return (sum); } +struct cksum_skip_partial_args { + uint64_t csum; + int clen; +}; + +static int +in_cksum_skip_partial(void *arg, void *data, u_int len) +{ + struct cksum_skip_partial_args *a; + + a = arg; + if (((uintptr_t)data ^ a->clen) & 1) + a->csum += in_cksumdata(data, len) << 8; + else + a->csum += in_cksumdata(data, len); + a->clen += len; + return (0); +} + u_short in_cksum_skip(struct mbuf *m, int len, int skip) { - u_int64_t sum = 0; - int mlen = 0; - int clen = 0; - caddr_t addr; + struct cksum_skip_partial_args a; union q_util q_util; union l_util l_util; + uint64_t sum; len -= skip; - for (; skip && m; m = m->m_next) { - if (m->m_len > skip) { - mlen = m->m_len - skip; - addr = mtod(m, caddr_t) + skip; - goto skip_start; - } else { - skip -= m->m_len; - } - } - - for (; m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - mlen = m->m_len; - addr = mtod(m, caddr_t); -skip_start: - if (len < mlen) - mlen = len; - - if ((clen ^ (uintptr_t) addr) & 1) - sum += in_cksumdata(addr, mlen) << 8; - else - sum += in_cksumdata(addr, mlen); - clen += mlen; - len -= mlen; - } + /* + * The use of m_apply() allows this routine to operate on unmapped + * mbufs. + */ + a.csum = 0; + a.clen = 0; + (void)m_apply(m, skip, len, in_cksum_skip_partial, &a); + sum = a.csum; REDUCE16; return (~sum & 0xffff); } From nobody Wed Dec 1 12:48:38 2021 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 DF4FE18BA2FE; Wed, 1 Dec 2021 12:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zRC2WyMz3jfK; Wed, 1 Dec 2021 12:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B82D18FF; Wed, 1 Dec 2021 12:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1Cmccg065974; Wed, 1 Dec 2021 12:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1Cmc7r065972; Wed, 1 Dec 2021 12:48:38 GMT (envelope-from git) Date: Wed, 1 Dec 2021 12:48:38 GMT Message-Id: <202112011248.1B1Cmc7r065972@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: f763c81c95bb - stable/13 - netinet: Remove unneeded mb_unmapped_to_ext() calls 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: f763c81c95bb5b68a11b12c9716ba2ee2b5d08fa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638362919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3rLaBg1XzmtYsHOLaTcr2FJN5Oz3/de/p8QRBh28RDA=; b=p3W2Y3L4Y1XnkqudljdpobgCKlajGgO1FhkINVlWkrvWSS6xALGOZAnFaUCOBDdcLFFV5/ HfPSkiTYBUf27wjyNyJ8N211QPQjpgRtEZvSWUI1gjc8HHRmMuOpAuhF6JxV9pzrcWwrZ7 i+lMx9oGNnny/rGGFO33aqxS388YLhJIua6ZG9kA9hz/jqNa1+rntt9gZAVONIK0CsU2Wu quWPlu7Rj6OT551iBzjlnZW0BHjOwuCoMH70nHI6y0Ch6c4Dv+jdIFWk8ByBL+gK8kfKy8 OoK1izWXP2WS2J15Df5nKn8XJ+wba6glh/dBI8RGBVPEaozWUwjCyxK3smM3uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638362919; a=rsa-sha256; cv=none; b=UeUordXsRXmQyZlpAaRFCcZvibWYVaIzzdG4qgfViHx8BbdU7xwyFNx7Hr/CkbRem8s+eZ x2MeS67chVRVYHzIz12+n74NF6pr8QVtbej8I8nN0aB+3fy/fFiWCMqpO5cH0GqMrlL0xy KaiJIfRkaTK285vWXD33oLhDGz2JyiGWm9E5Je5j1bxyYVktvScMRzxPyTIjoxBjyM10q7 Jo7lgd85DoNyA+/p1ybN2D6VFisDGSYHsbMQaJ5FDAi7/5qP6LF2odXbTa5pgSTMmi1mcV madIpnYlxpTgKxyyWggPo7Kqabj3vTF745gEDjYDfSLdtiMOymKj0i0f2IbDfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f763c81c95bb5b68a11b12c9716ba2ee2b5d08fa commit f763c81c95bb5b68a11b12c9716ba2ee2b5d08fa Author: Mark Johnston AuthorDate: 2021-11-24 18:20:09 +0000 Commit: Mark Johnston CommitDate: 2021-12-01 12:43:18 +0000 netinet: Remove unneeded mb_unmapped_to_ext() calls in_cksum_skip() now handles unmapped mbufs on platforms where they're permitted. Reviewed by: glebius, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 44775b163bfa902ea96658343e852062e2e67a8e) --- sys/netinet/ip_divert.c | 6 ---- sys/netinet/ip_output.c | 21 ++++------- sys/netinet6/ip6_output.c | 62 ++++++++++++++------------------ sys/netipsec/ipsec_output.c | 12 ------- sys/netpfil/ipfw/nat64/nat64_translate.c | 10 ------ sys/netpfil/pf/pf.c | 6 ---- 6 files changed, 32 insertions(+), 85 deletions(-) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 936e216e0926..ab9f0c4febc6 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -212,9 +212,6 @@ divert_packet(struct mbuf *m, bool incoming) /* Delayed checksums are currently not compatible with divert. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - m = mb_unmapped_to_ext(m); - if (m == NULL) - return; in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } @@ -226,9 +223,6 @@ divert_packet(struct mbuf *m, bool incoming) #endif #ifdef INET6 if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { - m = mb_unmapped_to_ext(m); - if (m == NULL) - return; in6_delayed_cksum(m, m->m_pkthdr.len - sizeof(struct ip6_hdr), sizeof(struct ip6_hdr)); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 4acec2bb877c..a011c28441bd 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -730,23 +730,20 @@ sendit: } } - m->m_pkthdr.csum_flags |= CSUM_IP; - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) { + /* Ensure the packet data is mapped if the interface requires it. */ + if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { m = mb_unmapped_to_ext(m); if (m == NULL) { IPSTAT_INC(ips_odropped); error = ENOBUFS; goto bad; } + } + + m->m_pkthdr.csum_flags |= CSUM_IP; + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) { in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; - } else if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSTAT_INC(ips_odropped); - error = ENOBUFS; - goto bad; - } } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { @@ -891,12 +888,6 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, * fragmented packets, then do it here. */ if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - m0 = mb_unmapped_to_ext(m0); - if (m0 == NULL) { - error = ENOBUFS; - IPSTAT_INC(ips_odropped); - goto done; - } in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 2b49a9f7c351..209169dbdabd 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -212,42 +212,26 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) *(u_short *)mtodo(m, offset) = csum; } -static int +static void ip6_output_delayed_csum(struct mbuf *m, struct ifnet *ifp, int csum_flags, - int plen, int optlen, bool frag) + int plen, int optlen) { KASSERT((plen >= optlen), ("%s:%d: plen %d < optlen %d, m %p, ifp %p " - "csum_flags %#x frag %d\n", - __func__, __LINE__, plen, optlen, m, ifp, csum_flags, frag)); + "csum_flags %#x", + __func__, __LINE__, plen, optlen, m, ifp, csum_flags)); - if ((csum_flags & CSUM_DELAY_DATA_IPV6) || -#if defined(SCTP) || defined(SCTP_SUPPORT) - (csum_flags & CSUM_SCTP_IPV6) || -#endif - (!frag && (ifp->if_capenable & IFCAP_MEXTPG) == 0)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - if (frag) - in6_ifstat_inc(ifp, ifs6_out_fragfail); - else - IP6STAT_INC(ip6s_odropped); - return (ENOBUFS); - } - if (csum_flags & CSUM_DELAY_DATA_IPV6) { - in6_delayed_cksum(m, plen - optlen, - sizeof(struct ip6_hdr) + optlen); - m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; - } + if (csum_flags & CSUM_DELAY_DATA_IPV6) { + in6_delayed_cksum(m, plen - optlen, + sizeof(struct ip6_hdr) + optlen); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } #if defined(SCTP) || defined(SCTP_SUPPORT) - if (csum_flags & CSUM_SCTP_IPV6) { - sctp_delayed_cksum(m, sizeof(struct ip6_hdr) + optlen); - m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; - } -#endif + if (csum_flags & CSUM_SCTP_IPV6) { + sctp_delayed_cksum(m, sizeof(struct ip6_hdr) + optlen); + m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; } - - return (0); +#endif } int @@ -1104,6 +1088,16 @@ nonh6lookup: passout: if (vlan_pcp > -1) EVL_APPLY_PRI(m, vlan_pcp); + + /* Ensure the packet data is mapped if the interface requires it. */ + if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + IP6STAT_INC(ip6s_odropped); + return (ENOBUFS); + } + } + /* * Send the packet to the outgoing interface. * If necessary, do IPv6 fragmentation before sending. @@ -1136,9 +1130,7 @@ passout: * XXX-BZ Need a framework to know when the NIC can handle it, even * with ext. hdrs. */ - error = ip6_output_delayed_csum(m, ifp, sw_csum, plen, optlen, false); - if (error != 0) - goto bad; + ip6_output_delayed_csum(m, ifp, sw_csum, plen, optlen); /* XXX-BZ m->m_pkthdr.csum_flags &= ~ifp->if_hwassist; */ tlen = m->m_pkthdr.len; @@ -1217,10 +1209,8 @@ passout: * fragmented packets, then do it here. * XXX-BZ handle the hw offloading case. Need flags. */ - error = ip6_output_delayed_csum(m, ifp, m->m_pkthdr.csum_flags, - plen, optlen, true); - if (error != 0) - goto bad; + ip6_output_delayed_csum(m, ifp, m->m_pkthdr.csum_flags, plen, + optlen); /* * Change the next header field of the last header in the diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index a2deef95cdb5..99855e7209de 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -323,12 +323,6 @@ ipsec4_common_output(struct mbuf *m, struct inpcb *inp, int forwarding) * this is done in the normal processing path. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSECSTAT_INC(ips_out_nomem); - key_freesp(&sp); - return (ENOBUFS); - } in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } @@ -624,12 +618,6 @@ ipsec6_common_output(struct mbuf *m, struct inpcb *inp, int forwarding) * this is done in the normal processing path. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSEC6STAT_INC(ips_out_nomem); - key_freesp(&sp); - return (ENOBUFS); - } in6_delayed_cksum(m, m->m_pkthdr.len - sizeof(struct ip6_hdr), sizeof(struct ip6_hdr)); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; diff --git a/sys/netpfil/ipfw/nat64/nat64_translate.c b/sys/netpfil/ipfw/nat64/nat64_translate.c index aa6f47656d9d..fecc8ff334d2 100644 --- a/sys/netpfil/ipfw/nat64/nat64_translate.c +++ b/sys/netpfil/ipfw/nat64/nat64_translate.c @@ -1292,11 +1292,6 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *saddr, /* Handle delayed checksums if needed. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - NAT64STAT_INC(&cfg->stats, nomem); - return (NAT64RETURN); - } in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } @@ -1674,11 +1669,6 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, uint16_t aport, /* Handle delayed checksums if needed. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - NAT64STAT_INC(&cfg->stats, nomem); - return (NAT64RETURN); - } in6_delayed_cksum(m, plen, hlen); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 84db11d2f0ef..1e6911c16f73 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5968,9 +5968,6 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, /* Copied from FreeBSD 10.0-CURRENT ip_output. */ m0->m_pkthdr.csum_flags |= CSUM_IP; if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) { - m0 = mb_unmapped_to_ext(m0); - if (m0 == NULL) - goto done; in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } @@ -6157,9 +6154,6 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & ~ifp->if_hwassist) { uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); - m0 = mb_unmapped_to_ext(m0); - if (m0 == NULL) - goto done; in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } From nobody Wed Dec 1 17:10:03 2021 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 3C5CD18CB32B; Wed, 1 Dec 2021 17:10:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dq6v4wz4dV6; Wed, 1 Dec 2021 17:10:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC66F5947; Wed, 1 Dec 2021 17:10:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA3MZ015779; Wed, 1 Dec 2021 17:10:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA3W0015776; Wed, 1 Dec 2021 17:10:03 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:03 GMT Message-Id: <202112011710.1B1HA3W0015776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 2b0a7984fec9 - stable/13 - if_stf: enable use in vnet jails 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b0a7984fec96d86b0467c0bd6b513451e59f7e3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ilnPUF81MvGsknoU9mHiG4O5khsapS2jJvWUrs/8nE=; b=Pra2oxE9kFn41TR/qE7URD8bXAw4W0lQsgk/Wz49LZpgMQyyluXlTVKO4LiZU8Fu1BJHOS Xe7dHHhBzLkmVwtSfy+5bZ4plQshZWZMFQfoizz7M/3RcZWYKfbAkb6dGNu9NAXkBurQOn jN2QRAXUzyVi/IZZrRUHdq+X/sgGRIjpvi6bxtEL+4jYdQXM6Y47k0acIXQoyrX52Wz2yh y3lzFvu7QkXGOXBeO49+Dk5Qke9STDtxA1wMO1qV6M8ZjArJFq+jyIr4jBQte/7qG2h1JI Z7vOANVa6PK8QGyByB62KdxMktILm1kSiua6QvH/S4mFqg8d+H31srytlqgcGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378604; a=rsa-sha256; cv=none; b=liZeCT4bMUDoDhdBtbeuXTKPGlVHwVxFyIxZehvDZtBQOFKKDCdiNjRsciuqxmuUZh4wFe un3hSPVSja+a1BuhCLXvV6oVCZidzTFtVpCn15cGqP2dPqm03YluxumXf/WI27SIFVBk1/ Fb6TX0PBtBXfoe1CiV+QAVfuJrnW4tghXWvNP9TWKPt58ipn5uWUDmVHN6P8O74zfyQjk1 ifE50xVqSMDbqFED4PCP3fOer0nUV87mXkDQgjaCRUy/hVmH9qI4aHOWXZi6QWoVyPcyLw hs51Ykg3iYkvt/37hzNzHb4eOYNk+BQHoa6oflNiYisyobF1Xu/bwRRlXqfjmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b0a7984fec96d86b0467c0bd6b513451e59f7e3 commit 2b0a7984fec96d86b0467c0bd6b513451e59f7e3 Author: Kristof Provost AuthorDate: 2021-11-05 11:01:37 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 15:53:19 +0000 if_stf: enable use in vnet jails The cloner must be per-vnet so that cloned interfaces get destroyed when the vnet goes away. Otherwise we fail assertions in vnet_if_uninit(): panic: vnet_if_uninit:475 tailq &V_ifnet=0xfffffe01665fe070 not empty cpuid = 19 time = 1636107064 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe015d0cac60 vpanic() at vpanic+0x187/frame 0xfffffe015d0cacc0 panic() at panic+0x43/frame 0xfffffe015d0cad20 vnet_if_uninit() at vnet_if_uninit+0x7b/frame 0xfffffe015d0cad30 vnet_destroy() at vnet_destroy+0x170/frame 0xfffffe015d0cad60 prison_deref() at prison_deref+0x9b0/frame 0xfffffe015d0cadd0 sys_jail_remove() at sys_jail_remove+0x119/frame 0xfffffe015d0cae00 amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe015d0caf30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe015d0caf30 --- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = 0x8011e920a, rsp = 0x7fffffffe788, rbp = 0x7fffffffe810 --- KDB: enter: panic MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32849 (cherry picked from commit 8e45fed3aefd00ff544efce8fedeba5e099d3d01) --- sys/net/if_stf.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 40f8a6f3a30a..a53e3ec01dc1 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -170,7 +170,8 @@ static int stf_ioctl(struct ifnet *, u_long, caddr_t); static int stf_clone_match(struct if_clone *, const char *); static int stf_clone_create(struct if_clone *, char *, size_t, caddr_t); static int stf_clone_destroy(struct if_clone *, struct ifnet *); -static struct if_clone *stf_cloner; +VNET_DEFINE_STATIC(struct if_clone *, stf_cloner); +#define V_stf_cloner VNET(stf_cloner) static const struct encap_config ipv4_encap_cfg = { .proto = IPPROTO_IPV6, @@ -282,17 +283,33 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) return (0); } +static void +vnet_stf_init(const void *unused __unused) +{ + V_stf_cloner = if_clone_advanced(stfname, 0, stf_clone_match, + stf_clone_create, stf_clone_destroy); +} +VNET_SYSINIT(vnet_stf_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_stf_init, NULL); + +static void +vnet_stf_uninit(const void *unused __unused) +{ + if_clone_detach(V_stf_cloner); + V_stf_cloner = NULL; +} +VNET_SYSUNINIT(vnet_stf_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_stf_uninit, + NULL); + static int stfmodevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - stf_cloner = if_clone_advanced(stfname, 0, stf_clone_match, - stf_clone_create, stf_clone_destroy); + /* Done in vnet_stf_init() */ break; case MOD_UNLOAD: - if_clone_detach(stf_cloner); + /* Done in vnet_stf_uninit() */ break; default: return (EOPNOTSUPP); From nobody Wed Dec 1 17:10:04 2021 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 7195418CB415; Wed, 1 Dec 2021 17:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Ds0QbRz4dKY; Wed, 1 Dec 2021 17:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0EDC584A; Wed, 1 Dec 2021 17:10:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA4Xf016010; Wed, 1 Dec 2021 17:10:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA4kT016006; Wed, 1 Dec 2021 17:10:04 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:04 GMT Message-Id: <202112011710.1B1HA4kT016006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 563b1596fca2 - stable/13 - if_stf: style(9) pass 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 563b1596fca2b3dc3787011dbc217079b14afb75 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CQZoc3xCXcpDZqf17ThGp9hX9nj3k2iD+F29Rd0Y0gk=; b=qyWOvJCim+rLPFjDVL6J0CHzK1Zy7aAuFND4gbP4N06M0iHvJ/SeiRrFt6tlufiN0wNt+7 Eopvg0e6ru86+BfzBljzcJOQxCVzLiDpzNAfOCzFByJANp+bEtXVpW+wwRJ2DFqvgep/u3 1V+uZfE2Jy0cpuQ/7J65lRIPkH5Lx2wk0HTBUkKv9IALg/80qetg3AULCh70v9Z/AuQ3mT OrXpQrOx+9TJ4TsyQjp3O1eQIuOhYRHf51Ub5+qxNtJzzZTLtcvbwF44O1w3ZHG074aOfK kvkMHkCDFlrBAGRwvE3uNA95lWbdXgIgAILNX9DT83yTUCrohQJaaWi3WnLIYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378605; a=rsa-sha256; cv=none; b=IhzpgqOyMfDTAbIkWpTUtoVRjVqO6uZFRiDQMY9x8mq39OlDPgd6Mwka7fdVvpl/Fhrikh k8RhpAhuM1B+PEX18pko+xszICsJzAxPquinzsqEegTKyy0bf3td9QvN/C9g58NF/caooQ /pi5tyY9ReXhoqSRQwxMur0QT9b9zuH5YV6cc2cJXyUBy6V8swW/JbG+GAGarNXGUjfMi2 vzPKWXntsv7qEjdgvCe1xrwyaIPJNZW9R69A64OdYIXnPuNRLAbgNCUzjrcmAExwsap3WI 1o8irLNkDvbdYBRMLPlPDNeNy6s08UIIWPAMFELpfsN1ToV44U2bz4ttbRiCmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=563b1596fca2b3dc3787011dbc217079b14afb75 commit 563b1596fca2b3dc3787011dbc217079b14afb75 Author: Kristof Provost AuthorDate: 2021-11-05 10:20:16 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 15:53:19 +0000 if_stf: style(9) pass As stated in style(9): "Values in return statements should be enclosed in parentheses." MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32848 (cherry picked from commit 3576121c8b1fcaa31b3a45ea52ff83f7c5855266) --- sys/net/if_stf.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index a53e3ec01dc1..d5ffdeabdf53 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -336,22 +336,22 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) sc = (struct stf_softc *)arg; if (sc == NULL) - return 0; + return (0); if ((STF2IFP(sc)->if_flags & IFF_UP) == 0) - return 0; + return (0); /* IFF_LINK0 means "no decapsulation" */ if ((STF2IFP(sc)->if_flags & IFF_LINK0) != 0) - return 0; + return (0); if (proto != IPPROTO_IPV6) - return 0; + return (0); m_copydata(m, 0, sizeof(ip), (caddr_t)&ip); if (ip.ip_v != 4) - return 0; + return (0); if (stf_getsrcifa6(STF2IFP(sc), &addr6, &mask6) != 0) return (0); @@ -362,7 +362,7 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) * success on: dst = 10.1.1.1, ia6->ia_addr = 2002:0a01:0101:... */ if (bcmp(GET_V4(&addr6), &ip.ip_dst, sizeof(ip.ip_dst)) != 0) - return 0; + return (0); /* * check if IPv4 src matches the IPv4 address derived from the @@ -377,10 +377,10 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) b = ip.ip_src; b.s_addr &= mask.s_addr; if (a.s_addr != b.s_addr) - return 0; + return (0); /* stf interface makes single side match only */ - return 32; + return (32); } static int @@ -450,7 +450,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } /* @@ -461,14 +461,14 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (stf_getsrcifa6(ifp, &addr6, &mask6) != 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } if (m->m_len < sizeof(*ip6)) { m = m_pullup(m, sizeof(*ip6)); if (!m) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } } ip6 = mtod(m, struct ip6_hdr *); @@ -486,7 +486,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, else { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETUNREACH; + return (ENETUNREACH); } bcopy(ptr, &in4, sizeof(in4)); @@ -505,7 +505,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } ip = mtod(m, struct ip *); @@ -525,7 +525,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); error = ip_output(m, NULL, NULL, 0, NULL, NULL); - return error; + return (error); } static int @@ -539,9 +539,9 @@ isrfc1918addr(struct in_addr *in) (ntohl(in->s_addr) & 0xff000000) >> 24 == 10 || (ntohl(in->s_addr) & 0xfff00000) >> 16 == 172 * 256 + 16 || (ntohl(in->s_addr) & 0xffff0000) >> 16 == 192 * 256 + 168)) - return 1; + return (1); - return 0; + return (0); } static int @@ -555,10 +555,10 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * 224.0.0.0/4 0.0.0.0/8 127.0.0.0/8 255.0.0.0/8 */ if (IN_MULTICAST(ntohl(in->s_addr))) - return -1; + return (-1); switch ((ntohl(in->s_addr) & 0xff000000) >> 24) { case 0: case 127: case 255: - return -1; + return (-1); } /* @@ -566,7 +566,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * (requirement from RFC3056 section 2 1st paragraph) */ if (isrfc1918addr(in)) - return -1; + return (-1); /* * reject packets with broadcast @@ -577,7 +577,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) continue; if (in->s_addr == ia4->ia_broadaddr.sin_addr.s_addr) { IN_IFADDR_RUNLOCK(&in_ifa_tracker); - return -1; + return (-1); } } IN_IFADDR_RUNLOCK(&in_ifa_tracker); @@ -597,7 +597,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) return (-1); } - return 0; + return (0); } static int @@ -609,7 +609,7 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) if (IN6_IS_ADDR_6TO4(in6)) { struct in_addr in4; bcopy(GET_V4(in6), &in4, sizeof(in4)); - return stf_checkaddr4(sc, &in4, inifp); + return (stf_checkaddr4(sc, &in4, inifp)); } /* @@ -619,9 +619,9 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) * (2) to be safe against future ip6_input change. */ if (IN6_IS_ADDR_V4COMPAT(in6) || IN6_IS_ADDR_V4MAPPED(in6)) - return -1; + return (-1); - return 0; + return (0); } static int @@ -775,5 +775,5 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - return error; + return (error); } From nobody Wed Dec 1 17:10:05 2021 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 0D1E318CB2ED; Wed, 1 Dec 2021 17:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Ds3v90z4d9k; Wed, 1 Dec 2021 17:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 403BA5B87; Wed, 1 Dec 2021 17:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA50X016138; Wed, 1 Dec 2021 17:10:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA5fb016135; Wed, 1 Dec 2021 17:10:05 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:05 GMT Message-Id: <202112011710.1B1HA5fb016135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e66cd95ea544 - stable/12 - if_stf: enable use in vnet jails 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e66cd95ea5442fa0c3373e654f4833cb1cc61caf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dNqpQLIiDZPg161wmch3zOQZUmm65cosmyi909pQ3sc=; b=AWZLyWSmDMbjaMlHM+atDTFNBRebLbr3bEGmsPXh5vtRHCAiUwmnOch36JLpm8YoQvKSij lNgIv0iPIdsiCz9g2zwKL2cyQJdtC63DVRvMa6FH9ZuRfDEKQIqcgDihUKEXNNJXF/7C+b OasLbJrewop9DISiSbYx5vAjumvcoz/ZiSes/Z5hGaObm+G/EB49spCWhuRCkiWp9T13Ch sNsv1UE4TgUhEKVudfNk+z+oIdDGOhbW8pUcrSNKOMTP+CE/O6zmri8nDlGgSkH81SBLtI i5AY3Ezo7FGqmPM884Bh4uywYlgnj1dwLM4Z7uZLRmXly3CEqFNQMoatcv5kkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378605; a=rsa-sha256; cv=none; b=s62pcWg0B91sgJ1DOTFhFE5nOhqIE19aXQIwMgehrPMoyB5Pv28sxHraGa7p48p+v/EBef twtXxfaVfWcQkwjFmaD3tTSwHGhiK3EJMqdDAUnO3wFKIIK4JPvAOPlOaHSofkmv8Qf/Z1 TejEwaK/7hrJsDBRdonNgtCq6udwW4xDQwpnj+JXO52cS2REGCYV45zLhDmgBxlXzOMxnq PbKfSDlwFVEsOhr7RbQNdgpIrgzrwKL4sFQaA7JrGJEu608ahuZ8BcvVk1jolqKMs/PSXs ACJF1nEtUV5ec6mjEazgKImuCyHOr1KRtI28EUdpjxtM7vPExUF1KxFgM+KGrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e66cd95ea5442fa0c3373e654f4833cb1cc61caf commit e66cd95ea5442fa0c3373e654f4833cb1cc61caf Author: Kristof Provost AuthorDate: 2021-11-05 11:01:37 +0000 Commit: Kristof Provost CommitDate: 2021-11-30 07:41:04 +0000 if_stf: enable use in vnet jails The cloner must be per-vnet so that cloned interfaces get destroyed when the vnet goes away. Otherwise we fail assertions in vnet_if_uninit(): panic: vnet_if_uninit:475 tailq &V_ifnet=0xfffffe01665fe070 not empty cpuid = 19 time = 1636107064 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe015d0cac60 vpanic() at vpanic+0x187/frame 0xfffffe015d0cacc0 panic() at panic+0x43/frame 0xfffffe015d0cad20 vnet_if_uninit() at vnet_if_uninit+0x7b/frame 0xfffffe015d0cad30 vnet_destroy() at vnet_destroy+0x170/frame 0xfffffe015d0cad60 prison_deref() at prison_deref+0x9b0/frame 0xfffffe015d0cadd0 sys_jail_remove() at sys_jail_remove+0x119/frame 0xfffffe015d0cae00 amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe015d0caf30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe015d0caf30 --- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = 0x8011e920a, rsp = 0x7fffffffe788, rbp = 0x7fffffffe810 --- KDB: enter: panic MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32849 (cherry picked from commit 8e45fed3aefd00ff544efce8fedeba5e099d3d01) --- sys/net/if_stf.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 225bd30b6bd3..f9abe4c6a630 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -168,7 +168,8 @@ static int stf_ioctl(struct ifnet *, u_long, caddr_t); static int stf_clone_match(struct if_clone *, const char *); static int stf_clone_create(struct if_clone *, char *, size_t, caddr_t); static int stf_clone_destroy(struct if_clone *, struct ifnet *); -static struct if_clone *stf_cloner; +VNET_DEFINE_STATIC(struct if_clone *, stf_cloner); +#define V_stf_cloner VNET(stf_cloner) static const struct encap_config ipv4_encap_cfg = { .proto = IPPROTO_IPV6, @@ -280,17 +281,33 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) return (0); } +static void +vnet_stf_init(const void *unused __unused) +{ + V_stf_cloner = if_clone_advanced(stfname, 0, stf_clone_match, + stf_clone_create, stf_clone_destroy); +} +VNET_SYSINIT(vnet_stf_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_stf_init, NULL); + +static void +vnet_stf_uninit(const void *unused __unused) +{ + if_clone_detach(V_stf_cloner); + V_stf_cloner = NULL; +} +VNET_SYSUNINIT(vnet_stf_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_stf_uninit, + NULL); + static int stfmodevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - stf_cloner = if_clone_advanced(stfname, 0, stf_clone_match, - stf_clone_create, stf_clone_destroy); + /* Done in vnet_stf_init() */ break; case MOD_UNLOAD: - if_clone_detach(stf_cloner); + /* Done in vnet_stf_uninit() */ break; default: return (EOPNOTSUPP); From nobody Wed Dec 1 17:10:05 2021 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 56E6918CB494; Wed, 1 Dec 2021 17:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dt2MKvz4dS6; Wed, 1 Dec 2021 17:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E80F5B0C; Wed, 1 Dec 2021 17:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA54Y016297; Wed, 1 Dec 2021 17:10:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA5a0016295; Wed, 1 Dec 2021 17:10:05 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:05 GMT Message-Id: <202112011710.1B1HA5a0016295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a40b76511844 - stable/13 - net tests: basic if_stf test 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a40b7651184478c18508cb676706465bacf1b773 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2jkJIR5h7HGnDL/O477NN/1TQmwK8k1eZOOozSsU4Ak=; b=TwrAgfMm4TDk6xQPlpSLh+u/HM+H2VDrtqCfp84u5h7DzTS1B07q2fijwe/czqSCNLY31j 1k2MvDpp7muDof6mi1LhhZfW2Q4Dw+oKP4686UmEbc61LHm6e+00AGHrbZmOcwMPebkemh YqZCWH8LbN609DzBVUFCtgFLmkWPqypmLNXPvM7ctlkZZNLQlcF3gfxmzCDsU9yHBVIs0O 5yKrrkpqajG9J6hmwFuOGuHzx88YPfqGgnCJpRf1acS4zb4KBDaKWlaKb7hRFKf2lv1Xzn bgczZkoFaLUtyfu0UKc8364iZmaJuuaflpTuTYCDlnJsFxuGVCm2LbbbnYeLag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378606; a=rsa-sha256; cv=none; b=ZpeaXGWWb3xebBI9QTLrYd+3XHP7RPLLZz1g0+7osrMvE7ofi9m/ykVB8YYqE9HS6wkSxc PHnNmRpvITPF7hhqZJTsbS6ssvGfLUXXuFLRJUR22hzGHNaDms0Rbt8vlx9ntfqkxU+kww R13v6SlBxj31pm6RIzUByy2GxF/rWlcj0vOnn9w/WoDySpRHYvjE4cMhYbPbAVHb2QHsm0 hlDiYIi8+W/iNf5tvFBjjaTZcTBsM6Pv3+pznHLGZRjuLOkCYcaDKp1y4gn+79IEvxm0vH lJC4l9pjhDF6KTBkqdXaSD46osGk8kHlLfCWBBYUlOjEOB2tXlmFkzk99oG3pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a40b7651184478c18508cb676706465bacf1b773 commit a40b7651184478c18508cb676706465bacf1b773 Author: Kristof Provost AuthorDate: 2021-11-05 14:20:19 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 15:53:19 +0000 net tests: basic if_stf test Test the 6to4 code. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32850 (cherry picked from commit eb5e0755f7496d1328d572b4d181c70b39152f08) --- tests/sys/net/Makefile | 1 + tests/sys/net/if_stf.sh | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 9ff2b8c775b5..0eed6cf734fa 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -11,6 +11,7 @@ TEST_METADATA.if_bridge_test+= required_programs="python" ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_gif ATF_TESTS_SH+= if_lagg_test +ATF_TESTS_SH+= if_stf ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan diff --git a/tests/sys/net/if_stf.sh b/tests/sys/net/if_stf.sh new file mode 100644 index 000000000000..f3ed2d744c7c --- /dev/null +++ b/tests/sys/net/if_stf.sh @@ -0,0 +1,84 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "6to4" "cleanup" +6to4_head() +{ + atf_set descr 'Test 6to4' + atf_set require.user root +} + +6to4_body() +{ + vnet_init + if ! kldstat -q -m if_stf; then + atf_skip "This test requires if_stf" + fi + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_stf" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail relay ${epair}a + jexec relay ifconfig lo0 inet6 2001:db8::1/64 up + jexec relay ifconfig ${epair}a 192.0.2.1/24 up + # Simple gif to terminate 6to4 + gif=$(jexec relay ifconfig gif create) + jexec relay ifconfig $gif inet6 2002:c000:0201::1/64 up + jexec relay ifconfig $gif tunnel 192.0.2.1 192.0.2.2 + jexec relay route -6 add default -interface $gif + + vnet_mkjail client ${epair}b + jexec client ifconfig ${epair}b 192.0.2.2/24 up + stf=$(jexec client ifconfig stf create) + jexec client ifconfig $stf inet6 2002:c000:0202::1/32 up + jexec client route -6 add default 2002:c000:0201::1 + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec client ping -c 1 192.0.2.1 + # 6to4 direct + atf_check -s exit:0 -o ignore \ + jexec client ping6 -c 1 2002:c000:0201::1 + + # "Wider internet" + atf_check -s exit:0 -o ignore \ + jexec client ping6 -c 1 2001:db8::1 +} + +6to4_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "6to4" +} From nobody Wed Dec 1 17:10:06 2021 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 BB48C18CB1E4; Wed, 1 Dec 2021 17:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dt5kQVz4dVJ; Wed, 1 Dec 2021 17:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53095584B; Wed, 1 Dec 2021 17:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA6cd016372; Wed, 1 Dec 2021 17:10:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA6No016369; Wed, 1 Dec 2021 17:10:06 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:06 GMT Message-Id: <202112011710.1B1HA6No016369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9684452504f9 - stable/12 - if_stf: style(9) pass 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9684452504f94d197eefcd1f2e24ac4d03922d4b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rGdcXA54NecUalGbpPK+Yu8L0T/WmiFu0QQhvIXlCnE=; b=Vs9YAIz5j9DJ5XnuLAFr4VlCm2Mo/QMrvi8XoZE4jVdJ7wKXorsNmkPIzUv8JK9ZRZQPlW V4TmCBlwmwCroFoujgEq7pur96KccGn3i1N6IROBWJhclGRuP9BlPqNT5H7CJcrMhvFYn/ z+T14DHuc3w0q+GPAm/albQGgtkKyQBDOnPl+khXGtn+0kzJ5b8a/9T62DPHzHECBJXDXo o7sby4OAqpDvz08JvQoJFgY7JssgKq09tFKo+ImcmVYki/G10SEeuQTurK3kNV4OUyvrSp pImBQdkoqg6mPPOItsb1GHBaB0vQZPmHgEENpaWTXCUDa9drDO8vcaXKQxN2Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378606; a=rsa-sha256; cv=none; b=TALlLhLOsBhMJndyAMVebGy1oHloP9frIYG74bv5qH7iY685eWuTHSksXmd0jYll+sTwrn 6ZPkMSP0OeqoT/rivVr6uZ9oT1dY1Y7Ncm3lxNnDa0OaWlp0DFLXmUtPzJ9DnmfYSmqVBW rCaPAD1vvTL0gxL0VSte0ikLIuCv1j3c7rTqBMjzUsfPeyYzUbCdeBuP3p5+kfegr46Cum BJ+vwNDXKYoErjx9GhP4RUQvLeqGBkHNTpZzg9eTO/NKYFg+xwPRvC7u0dUApozWEPZVJB UCmdzsq56rCPqllgSAVPW2kO/k5GzELn/Rg0q8qo5E+6dIQF2uXJnhFbHC5+8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9684452504f94d197eefcd1f2e24ac4d03922d4b commit 9684452504f94d197eefcd1f2e24ac4d03922d4b Author: Kristof Provost AuthorDate: 2021-11-05 10:20:16 +0000 Commit: Kristof Provost CommitDate: 2021-11-30 07:41:28 +0000 if_stf: style(9) pass As stated in style(9): "Values in return statements should be enclosed in parentheses." MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32848 (cherry picked from commit 3576121c8b1fcaa31b3a45ea52ff83f7c5855266) --- sys/net/if_stf.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index f9abe4c6a630..098099052264 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -334,22 +334,22 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) sc = (struct stf_softc *)arg; if (sc == NULL) - return 0; + return (0); if ((STF2IFP(sc)->if_flags & IFF_UP) == 0) - return 0; + return (0); /* IFF_LINK0 means "no decapsulation" */ if ((STF2IFP(sc)->if_flags & IFF_LINK0) != 0) - return 0; + return (0); if (proto != IPPROTO_IPV6) - return 0; + return (0); m_copydata(m, 0, sizeof(ip), (caddr_t)&ip); if (ip.ip_v != 4) - return 0; + return (0); if (stf_getsrcifa6(STF2IFP(sc), &addr6, &mask6) != 0) return (0); @@ -360,7 +360,7 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) * success on: dst = 10.1.1.1, ia6->ia_addr = 2002:0a01:0101:... */ if (bcmp(GET_V4(&addr6), &ip.ip_dst, sizeof(ip.ip_dst)) != 0) - return 0; + return (0); /* * check if IPv4 src matches the IPv4 address derived from the @@ -375,10 +375,10 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) b = ip.ip_src; b.s_addr &= mask.s_addr; if (a.s_addr != b.s_addr) - return 0; + return (0); /* stf interface makes single side match only */ - return 32; + return (32); } static int @@ -449,7 +449,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } /* @@ -460,14 +460,14 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (stf_getsrcifa6(ifp, &addr6, &mask6) != 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } if (m->m_len < sizeof(*ip6)) { m = m_pullup(m, sizeof(*ip6)); if (!m) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } } ip6 = mtod(m, struct ip6_hdr *); @@ -485,7 +485,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, else { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETUNREACH; + return (ENETUNREACH); } bcopy(ptr, &in4, sizeof(in4)); @@ -504,7 +504,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } ip = mtod(m, struct ip *); @@ -524,7 +524,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); error = ip_output(m, NULL, NULL, 0, NULL, NULL); - return error; + return (error); } static int @@ -538,9 +538,9 @@ isrfc1918addr(struct in_addr *in) (ntohl(in->s_addr) & 0xff000000) >> 24 == 10 || (ntohl(in->s_addr) & 0xfff00000) >> 16 == 172 * 256 + 16 || (ntohl(in->s_addr) & 0xffff0000) >> 16 == 192 * 256 + 168)) - return 1; + return (1); - return 0; + return (0); } static int @@ -554,10 +554,10 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * 224.0.0.0/4 0.0.0.0/8 127.0.0.0/8 255.0.0.0/8 */ if (IN_MULTICAST(ntohl(in->s_addr))) - return -1; + return (-1); switch ((ntohl(in->s_addr) & 0xff000000) >> 24) { case 0: case 127: case 255: - return -1; + return (-1); } /* @@ -565,7 +565,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * (requirement from RFC3056 section 2 1st paragraph) */ if (isrfc1918addr(in)) - return -1; + return (-1); /* * reject packets with broadcast @@ -576,7 +576,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) continue; if (in->s_addr == ia4->ia_broadaddr.sin_addr.s_addr) { IN_IFADDR_RUNLOCK(&in_ifa_tracker); - return -1; + return (-1); } } IN_IFADDR_RUNLOCK(&in_ifa_tracker); @@ -594,7 +594,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) return (-1); } - return 0; + return (0); } static int @@ -606,7 +606,7 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) if (IN6_IS_ADDR_6TO4(in6)) { struct in_addr in4; bcopy(GET_V4(in6), &in4, sizeof(in4)); - return stf_checkaddr4(sc, &in4, inifp); + return (stf_checkaddr4(sc, &in4, inifp)); } /* @@ -616,9 +616,9 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) * (2) to be safe against future ip6_input change. */ if (IN6_IS_ADDR_V4COMPAT(in6) || IN6_IS_ADDR_V4MAPPED(in6)) - return -1; + return (-1); - return 0; + return (0); } static int @@ -770,5 +770,5 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - return error; + return (error); } From nobody Wed Dec 1 17:10:07 2021 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 C802B18CB1F6; Wed, 1 Dec 2021 17:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dw1Hrzz4dN1; Wed, 1 Dec 2021 17:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 689805A20; Wed, 1 Dec 2021 17:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA73O016608; Wed, 1 Dec 2021 17:10:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA7vS016605; Wed, 1 Dec 2021 17:10:07 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:07 GMT Message-Id: <202112011710.1B1HA7vS016605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 118090989817 - stable/12 - net tests: basic if_stf test 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 118090989817bfe9e3c3c8d68d70484a4999ce6b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ea2q2+DPI5RjlU0rq6MDnUbW9crzI1gQ1anomsjt8jw=; b=pFTJYOBK5EJ2LGSLO8puC8kNb24vSblQLfnFFkGLi+XRFpUh6M2vsJSDod4+EJmeWNcn/S MDmCRFzP/ezuwgeAX1cArFjs8f8v4ywVQtvx0+sLUzmb0LgrCkWLF3uImcIZrlH/nb1AxD 5yJy/x69TdkyXdJwZ/MI/sZMuMl+p4jQfAoRm58YY8QZe+1ZoXG4U9C3/jlSYaecKf+wOT A5ooN1g2CafY3SsH1If7qE2HMOk3gt9OStePHNQixTQVszzyVF6O3JCibUjmlRHehgJCDE /P+DmDslQD9dpeYz9GmNOBYqekqV/3W3dVSt0Td5+99QTVmJP8K2+sJwmno40A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378608; a=rsa-sha256; cv=none; b=G1BtlV9jWpnnBPjcGpHScwSdQ9P3LBEYZfYuJLtKsdSOGetB+CpzU1D/XwUjL/3gAynqZD 6NmrosxzNmJP6F0fjxFA9eoIP0r8qg/Bfv6uxW4jmyL9umBh7Dwk9f8a7XqENuq4uZkAAj QaVPrNnEQknfBc7WgpHvVxCJld7UTnGOax+UCi9ybahzYtqvb6jHdK0VqBn+gsFB7rATV1 AQVmUvJVoGLBsWM/6td7Zr5gYQ3pJU0HpmcBDj+ueebYDxrCevQ8+PIFh6ZWGGM88423oJ kR0csnhcXky7ywq7RiOGUIzAKBsuBGcfyNtvWqJPB/ffMv8ZdL5s3e79G12OPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=118090989817bfe9e3c3c8d68d70484a4999ce6b commit 118090989817bfe9e3c3c8d68d70484a4999ce6b Author: Kristof Provost AuthorDate: 2021-11-05 14:20:19 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 12:43:25 +0000 net tests: basic if_stf test Test the 6to4 code. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32850 (cherry picked from commit eb5e0755f7496d1328d572b4d181c70b39152f08) --- tests/sys/net/Makefile | 1 + tests/sys/net/if_stf.sh | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 7340688286cc..ca50f6cbcd76 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -10,6 +10,7 @@ ATF_TESTS_SH+= if_bridge_test ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_gif ATF_TESTS_SH+= if_lagg_test +ATF_TESTS_SH+= if_stf ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan diff --git a/tests/sys/net/if_stf.sh b/tests/sys/net/if_stf.sh new file mode 100644 index 000000000000..af53f7bdb5dd --- /dev/null +++ b/tests/sys/net/if_stf.sh @@ -0,0 +1,84 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "6to4" "cleanup" +6to4_head() +{ + atf_set descr 'Test 6to4' + atf_set require.user root +} + +6to4_body() +{ + vnet_init + if ! kldstat -q -m if_stf; then + atf_skip "This test requires if_stf" + fi + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_stf" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail relay ${epair}a + jexec relay ifconfig lo0 inet6 2001:db8::1/64 up + jexec relay ifconfig ${epair}a 192.0.2.1/24 up + # Simple gif to terminate 6to4 + gif=$(jexec relay ifconfig gif create) + jexec relay ifconfig $gif inet6 2002:c000:0201::1/64 up no_dad + jexec relay ifconfig $gif tunnel 192.0.2.1 192.0.2.2 + jexec relay route -6 add default -interface $gif + + vnet_mkjail client ${epair}b + jexec client ifconfig ${epair}b 192.0.2.2/24 up + stf=$(jexec client ifconfig stf create) + jexec client ifconfig $stf inet6 2002:c000:0202::1/32 up no_dad + jexec client route -6 add default 2002:c000:0201::1 + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec client ping -c 1 192.0.2.1 + # 6to4 direct + atf_check -s exit:0 -o ignore \ + jexec client ping6 -c 1 2002:c000:0201::1 + + # "Wider internet" + atf_check -s exit:0 -o ignore \ + jexec client ping6 -c 1 2001:db8::1 +} + +6to4_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "6to4" +} From nobody Wed Dec 1 17:10:08 2021 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 EC5A118CB433; Wed, 1 Dec 2021 17:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dw4sLpz4dXL; Wed, 1 Dec 2021 17:10:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CC285A21; Wed, 1 Dec 2021 17:10:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA8To016770; Wed, 1 Dec 2021 17:10:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA8jA016768; Wed, 1 Dec 2021 17:10:08 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:08 GMT Message-Id: <202112011710.1B1HA8jA016768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 10199101997b - stable/13 - pf tests: Test PR259689 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 10199101997bdc352a74998dc7a39a24f5d722c4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MGSNCkyCQcl22yur1KA56Sj13Kq7aZUHLxPYLQBBrFQ=; b=jHYAuCSuAhcDQFyWmNLsxDNlPpnL8pRLHI7tFv7dU0a63ew7Y5A4r+TALU+LnJu98DONJF OfVvBr23Qc17sDpUH8OVm3Vy1UgjOweDfy3uUgYB5eqSBk2+e/T0y/u3abaGNZTnZ25Q2Q gJNRbstbzYN6ovZKWGkxq8BABH6G7IVKdTd5R3/PD4/TPM6MSwqg61iwMZ6W2hTkjVItiY Tr6hBpmTOHJ9ZJSAwqXBW+avAptVzkf56HV36WUT6LcH5p/Zd5wqrMhIHGQYjUZ9lEKZIZ LVeD/yXw8rVGplEes0SX8lrIEsig2wNXRBDikwHLuKFK1683cu9DN1nW59Mwtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378609; a=rsa-sha256; cv=none; b=maM3acKTfd3XFSTTRggW2hQPzZ1yFfRWXx212v12NozbD/0lJ99XjwAM4Xhq/P3u2cepFO LV5GwswjjQONFKKSWjYV4zIe8P6rmuCP4W3WSpaY9thQj9AaLWOAtXjaA82fs9Fm8ZScQm 3Oc/vBRroZoKYj6Uvm58niCjnj4vRgpF08znhJgnemCxyqLkNomqHgXO8o8T4A228BlpX9 2VGpVXtus8gbyLPmi5Nr3AQBu67t4uaZ2h6XLlc8/ey4iet2mSLoZPVtiaTyUHL2tjSyAz DKSvXnriA2Doa/RtjbRl36IHtodpXOnuuWcQs4F39ir8CViJRKiUYwX1T0kTow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=10199101997bdc352a74998dc7a39a24f5d722c4 commit 10199101997bdc352a74998dc7a39a24f5d722c4 Author: Kristof Provost AuthorDate: 2021-11-08 12:28:43 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 15:53:20 +0000 pf tests: Test PR259689 We didn't populate dyncnt/tblcnt, so `pfctl -sr -vv` might not have the table element count. PR: 259689 MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32893 (cherry picked from commit 2de49deeca0b1377664dee2cd0a43ee7cf6b4bc4) --- lib/libpfctl/libpfctl.c | 2 +- tests/sys/netpfil/pf/table.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 6613708b183c..9252f64969bb 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -294,7 +294,7 @@ pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) if (addr->type == PF_ADDR_DYNIFTL) { strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); - addr->p.dyncnt = nvlist_get_number(nvl, "dynctl"); + addr->p.dyncnt = nvlist_get_number(nvl, "dyncnt"); } if (addr->type == PF_ADDR_TABLE) { strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index 379b715e767a..692d622bd86a 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -214,6 +214,34 @@ automatic_cleanup() pft_cleanup } +atf_test_case "pr259689" "cleanup" +pr259689_head() +{ + atf_set descr 'Test PR 259689' + atf_set require.user root +} + +pr259689_body() +{ + pft_init + + vnet_mkjail alcatraz + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "pass in" \ + "block in inet from { 1.1.1.1, 1.1.1.2, 2.2.2.2, 2.2.2.3, 4.4.4.4, 4.4.4.5 }" + + atf_check -o match:'block drop in inet from <__automatic_.*:6> to any' \ + -e ignore \ + jexec alcatraz pfctl -sr -vv +} + +pr259689_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4_counters" @@ -221,4 +249,5 @@ atf_init_test_cases() atf_add_test_case "pr251414" atf_add_test_case "network" atf_add_test_case "automatic" + atf_add_test_case "pr259689" } From nobody Wed Dec 1 17:10:06 2021 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 EFFDD18CB434; Wed, 1 Dec 2021 17:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dv56hmz4dPv; Wed, 1 Dec 2021 17:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F4AF584C; Wed, 1 Dec 2021 17:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA6iY016533; Wed, 1 Dec 2021 17:10:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA6MQ016531; Wed, 1 Dec 2021 17:10:06 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:06 GMT Message-Id: <202112011710.1B1HA6MQ016531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 525205b5d2f1 - stable/13 - pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 525205b5d2f12b85c84cf060b5e42d5472e31501 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+Y1ojJ6uItlQoI2gpIN/shXU8OGuSWAR39tjROZZBE=; b=vg0P+6DMhEQS0dJxpF3eZbpvuBPF5dkfHIeFYVJafhY5YA34Wj72fCWcs6AmVFb7Za+dIP RvIX/K9NZ6xPEEewQK5mVyPD5kfMzURiiiS/T3QK+B9xwoG7Avda9ItHuv7aEy6GRRAwYl DzfQuDaUv947v5YaXe76mSU82z8q1ykHYjS6r3NpzC9oH7CcTN2ebMKI0XRHL3uhyjqBE1 zBH4fuRvAG2xzVHVeFB+wul5oZ2vUmHXwRj1NDMbN0nHXua9dJkROMOYnSZzDo5Zo3FIjz 1gShabyB3zZacMryHDsIKeBaUc4LwNiAcrtnOqqYBYAAJM6pfOLhZIObV+vcqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378608; a=rsa-sha256; cv=none; b=YZ6an2OKKla8Tk/rJvtFdmU6hXSRu2L4xE4ftcxUiD9jtQe+PCqXB/QgpJd9TH8GQLfagn cpRdXgWreVUCdagDNEESMy2TL6M7YDqpIWDDsIEngP/i61HgIYq+O8S/8umP5ywrrhNRQb 2OZEDIDWIxauzieKEA0difMTolEOC+5eBqa01MrdlL6jvKqYZpRtgEHAppvwZUb5S26FoA KnpNE6RdWuVLWG+RzZe2P3DSf72Pd0qZshGRfnWWs/Kd+OOT5xHjt06K/BA2os2DOtKd8u dJlDbbW3IhoCSKHZxyksMl5PKGNs8ANveiGc7r+Ese7uJpMpMV+rLsB5dEKdzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=525205b5d2f12b85c84cf060b5e42d5472e31501 commit 525205b5d2f12b85c84cf060b5e42d5472e31501 Author: Kristof Provost AuthorDate: 2021-11-08 12:25:20 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 15:53:19 +0000 pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap PR: 259689 MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32892 (cherry picked from commit 218a8a491c4980dcc941908f9505d37e7f052868) --- lib/libpfctl/libpfctl.c | 10 ++++++++-- sys/netpfil/pf/pf_nv.c | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 96f5ea620f4d..6613708b183c 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -287,14 +287,20 @@ pfctl_nv_add_addr_wrap(nvlist_t *nvparent, const char *name, static void pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) { + bzero(addr, sizeof(*addr)); + addr->type = nvlist_get_number(nvl, "type"); addr->iflags = nvlist_get_number(nvl, "iflags"); - if (addr->type == PF_ADDR_DYNIFTL) + if (addr->type == PF_ADDR_DYNIFTL) { strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); - if (addr->type == PF_ADDR_TABLE) + addr->p.dyncnt = nvlist_get_number(nvl, "dynctl"); + } + if (addr->type == PF_ADDR_TABLE) { strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), PF_TABLE_NAME_SIZE); + addr->p.tblcnt = nvlist_get_number(nvl, "tblcnt"); + } pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "addr"), &addr->v.a.addr); pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "mask"), &addr->v.a.mask); diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index b6676be645d7..573544972952 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -327,6 +327,8 @@ pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) { nvlist_t *nvl; nvlist_t *tmp; + uint64_t num; + struct pfr_ktable *kt; nvl = nvlist_create(0); if (nvl == NULL) @@ -334,10 +336,25 @@ pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) nvlist_add_number(nvl, "type", addr->type); nvlist_add_number(nvl, "iflags", addr->iflags); - if (addr->type == PF_ADDR_DYNIFTL) + if (addr->type == PF_ADDR_DYNIFTL) { nvlist_add_string(nvl, "ifname", addr->v.ifname); - if (addr->type == PF_ADDR_TABLE) + num = 0; + if (addr->p.dyn != NULL) + num = addr->p.dyn->pfid_acnt4 + + addr->p.dyn->pfid_acnt6; + nvlist_add_number(nvl, "dyncnt", num); + } + if (addr->type == PF_ADDR_TABLE) { nvlist_add_string(nvl, "tblname", addr->v.tblname); + num = -1; + kt = addr->p.tbl; + if ((kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && + kt->pfrkt_root != NULL) + kt = kt->pfrkt_root; + if (kt->pfrkt_flags & PFR_TFLAG_ACTIVE) + num = kt->pfrkt_cnt; + nvlist_add_number(nvl, "tblcnt", num); + } tmp = pf_addr_to_nvaddr(&addr->v.a.addr); if (tmp == NULL) From nobody Wed Dec 1 17:10:08 2021 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 6487818CB439; Wed, 1 Dec 2021 17:10:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dx2yvzz4dSL; Wed, 1 Dec 2021 17:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7266B5A22; Wed, 1 Dec 2021 17:10:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA8Ys016844; Wed, 1 Dec 2021 17:10:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA80i016841; Wed, 1 Dec 2021 17:10:08 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:08 GMT Message-Id: <202112011710.1B1HA80i016841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 73ef1f7462e9 - stable/12 - pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 73ef1f7462e95f12747a6ff33c0cbb2bc4f848b7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iHQo3swApf5+F/PVRkqGWirT+hqQE5ESd/gRHuZV/+4=; b=ShFAQLHvcT4I/okUjAYgBLdiK4tDV8WAg7hc/xDfiZX7wYB+8So9ckCs6hEVsAJyREhoWV FCcWodlW5ETp+GkOO6qDCiTlf8ziRZSiyVSpg6BYe3K/9o6ia74eLHsAz1wNys8gYtATP5 FQXeIAq4lwgJqk+OaJxdwGL3QUNtNSKZCXM/ERlNjCQwK2uhtMDP0OLLRjJZlGKuVj1hnL cht6RBFl+DXfeS/2gkLf8HlnPGpqJhn7ug81dI7tisdLBPbrQT/97Can3NmIRNlxmDvJFN M293Oragm40j5Z+kJIwciGGDa7zXb72SwR5k4HaypaA5v3sst3/KswdbN6TN+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378609; a=rsa-sha256; cv=none; b=t1xDq+LdvOfyC+ZSkJjZ5CnyMVFGJAwiyDRmhkl+0OGmt2/jwHXshbxFM4cMgAZjytc/xy 6eN2nXimRpJqlr0bCAJ4Umlg8SDyBIiy0x4Jn9bZzFhauHAqFU3nIUxiOu9TqEhtYYlkbn cMEFHG4jCXBr/1eqPOgPAdIGAoaxln3Vvtx7pOYgH84/IHSQL6IWIakc/fDsKZoGPWHBZj xB9DTXypP3Ja9dBiWz4+ywGnaO8+AGh3t+DQOkpt5s0EmWS2pdQrR67Jazn0EOW6gMA9UN YT3OG6yRNSVgUN/y2hJo8Iztz6I0GTJZl1IBX72L89TAfISWiWUOVF4oIKqRwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=73ef1f7462e95f12747a6ff33c0cbb2bc4f848b7 commit 73ef1f7462e95f12747a6ff33c0cbb2bc4f848b7 Author: Kristof Provost AuthorDate: 2021-11-08 12:25:20 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 12:43:25 +0000 pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap PR: 259689 MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32892 (cherry picked from commit 218a8a491c4980dcc941908f9505d37e7f052868) --- lib/libpfctl/libpfctl.c | 10 ++++++++-- sys/netpfil/pf/pf_nv.c | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 96f5ea620f4d..6613708b183c 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -287,14 +287,20 @@ pfctl_nv_add_addr_wrap(nvlist_t *nvparent, const char *name, static void pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) { + bzero(addr, sizeof(*addr)); + addr->type = nvlist_get_number(nvl, "type"); addr->iflags = nvlist_get_number(nvl, "iflags"); - if (addr->type == PF_ADDR_DYNIFTL) + if (addr->type == PF_ADDR_DYNIFTL) { strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); - if (addr->type == PF_ADDR_TABLE) + addr->p.dyncnt = nvlist_get_number(nvl, "dynctl"); + } + if (addr->type == PF_ADDR_TABLE) { strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), PF_TABLE_NAME_SIZE); + addr->p.tblcnt = nvlist_get_number(nvl, "tblcnt"); + } pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "addr"), &addr->v.a.addr); pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "mask"), &addr->v.a.mask); diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index b6676be645d7..573544972952 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -327,6 +327,8 @@ pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) { nvlist_t *nvl; nvlist_t *tmp; + uint64_t num; + struct pfr_ktable *kt; nvl = nvlist_create(0); if (nvl == NULL) @@ -334,10 +336,25 @@ pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) nvlist_add_number(nvl, "type", addr->type); nvlist_add_number(nvl, "iflags", addr->iflags); - if (addr->type == PF_ADDR_DYNIFTL) + if (addr->type == PF_ADDR_DYNIFTL) { nvlist_add_string(nvl, "ifname", addr->v.ifname); - if (addr->type == PF_ADDR_TABLE) + num = 0; + if (addr->p.dyn != NULL) + num = addr->p.dyn->pfid_acnt4 + + addr->p.dyn->pfid_acnt6; + nvlist_add_number(nvl, "dyncnt", num); + } + if (addr->type == PF_ADDR_TABLE) { nvlist_add_string(nvl, "tblname", addr->v.tblname); + num = -1; + kt = addr->p.tbl; + if ((kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && + kt->pfrkt_root != NULL) + kt = kt->pfrkt_root; + if (kt->pfrkt_flags & PFR_TFLAG_ACTIVE) + num = kt->pfrkt_cnt; + nvlist_add_number(nvl, "tblcnt", num); + } tmp = pf_addr_to_nvaddr(&addr->v.a.addr); if (tmp == NULL) From nobody Wed Dec 1 17:10:09 2021 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 402D518CB593; Wed, 1 Dec 2021 17:10:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J45Dy450Kz4dNB; Wed, 1 Dec 2021 17:10:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CE795B0F; Wed, 1 Dec 2021 17:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1HA92Z017108; Wed, 1 Dec 2021 17:10:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1HA9k7017105; Wed, 1 Dec 2021 17:10:09 GMT (envelope-from git) Date: Wed, 1 Dec 2021 17:10:09 GMT Message-Id: <202112011710.1B1HA9k7017105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 407930b9f9bb - stable/12 - pf tests: Test PR259689 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 407930b9f9bbfc10164677ed0732e867a871a513 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638378610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=amtP3prWdg2fdioZLTDQLgJ701LUHtEDpO1TZdYdOlw=; b=Y6+kS+2G5EIUK3gU4qWvW+u2UozfOWzisXo9wbOjxj2dQDsw/QxmpJW8NDGiRzG8khLP6V eCR9cFCh/HuH6OGUiX9aqpIZDpmQgIakT37/7EWn5cmk40bLfGKGUrZKVRsj3bAPzgVGRd xneen5ulz50xdSJfACV27Ib9FEmu/T1cb2Np8pvQE9a1FLfdBQXgn2e7f1+8R37RmiD5ey 46O76gVk5EDi2YOJTU3bdJVnqi5gMKISxHmgqNcYYElkyUNTRWWl+fst9S6irdeWUAHV4V kJxQ04uMPNsltJCt6ejLLXL7MTwrr9YDcLl36AuB76s7oRbXz2XrdPSnaQP0KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638378610; a=rsa-sha256; cv=none; b=petTMSinyuwSb5uYQSrLscfNrqldO8qs4SIXwrAANHTVpwxoDn8nWMiCJ2cbB0Iub0QMTK GgpLoo8WyZmpyB+/MYJ3aPHYw2sL79oglhjvHmS4gw89RCDgUHCQ+mW2Aoi/vaPsnyLVgJ XRRapVvKD9RXFegsFfpT03pAapnrC+oEH8mYCZkLzrYFH6/G3Tqnvd+BOAV9V5e41nMZ5+ ph6mfGU6ot2j5445TL6Y9Sx8kaAE9IqdzkOUCk3w1mxe/rfZYgsmxcRzgDbDaCfJelKfhF sSVys2nW6UMub8Ab+x3Dt8KX+4SZeO3cyzp/ywY/MdOsgBQKcfYo2A8HIEo9nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=407930b9f9bbfc10164677ed0732e867a871a513 commit 407930b9f9bbfc10164677ed0732e867a871a513 Author: Kristof Provost AuthorDate: 2021-11-08 12:28:43 +0000 Commit: Kristof Provost CommitDate: 2021-12-01 12:43:25 +0000 pf tests: Test PR259689 We didn't populate dyncnt/tblcnt, so `pfctl -sr -vv` might not have the table element count. PR: 259689 MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32893 (cherry picked from commit 2de49deeca0b1377664dee2cd0a43ee7cf6b4bc4) --- lib/libpfctl/libpfctl.c | 2 +- tests/sys/netpfil/pf/table.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 6613708b183c..9252f64969bb 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -294,7 +294,7 @@ pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) if (addr->type == PF_ADDR_DYNIFTL) { strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); - addr->p.dyncnt = nvlist_get_number(nvl, "dynctl"); + addr->p.dyncnt = nvlist_get_number(nvl, "dyncnt"); } if (addr->type == PF_ADDR_TABLE) { strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index ff2a68b81224..41ff4e3da84e 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -214,6 +214,34 @@ automatic_cleanup() pft_cleanup } +atf_test_case "pr259689" "cleanup" +pr259689_head() +{ + atf_set descr 'Test PR 259689' + atf_set require.user root +} + +pr259689_body() +{ + pft_init + + vnet_mkjail alcatraz + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "pass in" \ + "block in inet from { 1.1.1.1, 1.1.1.2, 2.2.2.2, 2.2.2.3, 4.4.4.4, 4.4.4.5 }" + + atf_check -o match:'block drop in inet from <__automatic_.*:6> to any' \ + -e ignore \ + jexec alcatraz pfctl -sr -vv +} + +pr259689_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4_counters" @@ -221,4 +249,5 @@ atf_init_test_cases() atf_add_test_case "pr251414" atf_add_test_case "network" atf_add_test_case "automatic" + atf_add_test_case "pr259689" } From nobody Wed Dec 1 18:59:04 2021 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 77D3018B6452; Wed, 1 Dec 2021 18:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J47fd0mS1z3kcL; Wed, 1 Dec 2021 18:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9E9F7243; Wed, 1 Dec 2021 18:59:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1Ix4qX060363; Wed, 1 Dec 2021 18:59:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1Ix4lQ060362; Wed, 1 Dec 2021 18:59:04 GMT (envelope-from git) Date: Wed, 1 Dec 2021 18:59:04 GMT Message-Id: <202112011859.1B1Ix4lQ060362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: a027f2ab422c - stable/12 - mprutil: add big endian support 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a027f2ab422c12f3f7bf9d1a519ada6b2b881e8a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638385145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ULjpM+ewMsqSM9ifvueYJ2FP8mDve+F26pROcbWtT0M=; b=WZdv8rpnPtX6BC6nNZlB1mAq+G1unquIIqXSGLfivXY1SkKtTSAgTc5bNAa+2Zn8ye2gBY Nj6eJ1chbYWjulzqFLU6XfsC4HoysBu4uqx32D+6NMqVa8E7VSijXK2Jqgo/PwADIYe9su gA/jQmG1sQDlVRJd4xPYX0qg3hDs/lwSMKPMBOmliGitHlrS++XsDLXnFvjHrapr0T2FOp bHtG0udxhQXwVwZF1QwAGnOohymGNiD/svwufmZVYicFG8BGfna7T2sp/U5K0wWFzu0ZHD gcdDN+cUSdIG/Re1ERn/Xb1MdVGv4qmGsWp2NQdZPYIjh17Jbsyy4cihD5zsrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638385145; a=rsa-sha256; cv=none; b=dVSWnaCLUfBqomj/oXeo3m2GfIJ4oahsgZu3F27YC5nu2P2K0MsB87rfFo9R+HxkkWnN/m 6zWiT++M+xTUItxdt4M5AV2Uss3grBmd7vJsVS17VRkrRAWrKMT+8vXKE/Ytllc93T1oZc QUvZdVikA+Li55U1oP0gUJzlTtR3Q6Y9gD/1l/FEsoek5htDfG39gG9yJk478yiJz2yzDF Th/mxxZx3EZKW2ag7yVOAhDC6oE96iYnoaZHCWkAgnsNzhvSxf2KhWL8WcSEnsvvAZUVzW Q2yH5qCVZy5QD5MPkGuBECRRheauwY2tUNw2O3IcOllbJgNd+krDj24bZEnKTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a027f2ab422c12f3f7bf9d1a519ada6b2b881e8a commit a027f2ab422c12f3f7bf9d1a519ada6b2b881e8a Author: Alfredo Dal'Ava Junior AuthorDate: 2021-04-17 01:01:38 +0000 Commit: Alexander Motin CommitDate: 2021-12-01 18:24:28 +0000 mprutil: add big endian support This fix mprutil on big endian platforms, as follow up of D25785. Flash operations are still not working, such as MPI2_FUNCTION_FW_UPLOAD failing due to timeout. Firmware version used during tests: 16.00.01.00 Submitted by: Andre Fernando da Silva Reviewed by: luporl, Sreekanth Reddy (by e-mail) Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26040 (cherry picked from commit fc9780fd41e7b29db04e9cb843cb5034b88ae662) --- usr.sbin/mpsutil/mps_cmd.c | 61 +++++++++++++++++++++++++++++++++++--------- usr.sbin/mpsutil/mps_flash.c | 9 ++++--- usr.sbin/mpsutil/mps_show.c | 59 +++++++++++++++++++++--------------------- usr.sbin/mpsutil/mps_slot.c | 4 ++- usr.sbin/mpsutil/mpsutil.8 | 3 +++ 5 files changed, 90 insertions(+), 46 deletions(-) diff --git a/usr.sbin/mpsutil/mps_cmd.c b/usr.sbin/mpsutil/mps_cmd.c index edde180bf99d..51a0e77822d9 100644 --- a/usr.sbin/mpsutil/mps_cmd.c +++ b/usr.sbin/mpsutil/mps_cmd.c @@ -47,6 +47,7 @@ __RCSID("$FreeBSD$"); #endif #include #include +#include #include #include @@ -245,6 +246,8 @@ struct mprs_btdh_mapping { uint16_t Reserved; }; +static void adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts); + const char * mps_ioc_status(U16 IOCStatus) { @@ -300,7 +303,7 @@ mps_set_slot_status(int fd, U16 handle, U16 slot, U32 status) NULL, 0, NULL, 0, 30) != 0) return (errno); - if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) + if (!IOC_STATUS_SUCCESS(le16toh(reply.IOCStatus))) return (EIO); return (0); } @@ -323,7 +326,7 @@ mps_read_config_page_header(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, NULL, 0, NULL, 0, 30)) return (errno); - if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { + if (!IOC_STATUS_SUCCESS(le16toh(reply.IOCStatus))) { if (IOCStatus != NULL) *IOCStatus = reply.IOCStatus; return (EIO); @@ -346,15 +349,15 @@ mps_read_ext_config_page_header(int fd, U8 ExtPageType, U8 PageNumber, U32 PageA req.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; req.ExtPageType = ExtPageType; req.Header.PageNumber = PageNumber; - req.PageAddress = PageAddress; + req.PageAddress = htole32(PageAddress); if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply), NULL, 0, NULL, 0, 30)) return (errno); - if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { + if (!IOC_STATUS_SUCCESS(le16toh(reply.IOCStatus))) { if (IOCStatus != NULL) - *IOCStatus = reply.IOCStatus; + *IOCStatus = le16toh(reply.IOCStatus); return (EIO); } if ((header == NULL) || (ExtPageLength == NULL)) @@ -385,7 +388,7 @@ mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, bzero(&req, sizeof(req)); req.Function = MPI2_FUNCTION_CONFIG; req.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; - req.PageAddress = PageAddress; + req.PageAddress = htole32(PageAddress); req.Header = header; if (req.Header.PageLength == 0) req.Header.PageLength = 4; @@ -399,6 +402,7 @@ mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, errno = error; return (NULL); } + reply.IOCStatus = le16toh(reply.IOCStatus); if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { if (IOCStatus != NULL) *IOCStatus = reply.IOCStatus; @@ -436,14 +440,14 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, bzero(&req, sizeof(req)); req.Function = MPI2_FUNCTION_CONFIG; req.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; - req.PageAddress = PageAddress; + req.PageAddress = htole32(PageAddress); req.Header = header; if (pagelen == 0) - pagelen = 4; + pagelen = htole16(4); req.ExtPageLength = pagelen; req.ExtPageType = ExtPageType; - len = pagelen * 4; + len = le16toh(pagelen) * 4; buf = malloc(len); if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply), buf, len, NULL, 0, 30)) { @@ -452,6 +456,7 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, errno = error; return (NULL); } + reply.IOCStatus = le16toh(reply.IOCStatus); if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { if (IOCStatus != NULL) *IOCStatus = reply.IOCStatus; @@ -475,7 +480,7 @@ mps_firmware_send(int fd, unsigned char *fw, uint32_t len, bool bios) bzero(&reply, sizeof(reply)); req.Function = MPI2_FUNCTION_FW_DOWNLOAD; req.ImageType = bios ? MPI2_FW_DOWNLOAD_ITYPE_BIOS : MPI2_FW_DOWNLOAD_ITYPE_FW; - req.TotalImageSize = len; + req.TotalImageSize = htole32(len); req.MsgFlags = MPI2_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT; if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply), @@ -506,7 +511,7 @@ mps_firmware_get(int fd, unsigned char **firmware, bool bios) return (-1); } - size = reply.ActualImageSize; + size = le32toh(reply.ActualImageSize); *firmware = calloc(size, sizeof(unsigned char)); if (*firmware == NULL) { warn("calloc"); @@ -575,6 +580,7 @@ mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, errno = error; return (NULL); } + req.ioc_status = le16toh(req.ioc_status); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; @@ -602,9 +608,10 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, req.header.PageVersion = PageVersion; req.header.PageNumber = PageNumber; req.header.ExtPageType = ExtPageType; - req.page_address = PageAddress; + req.page_address = htole32(PageAddress); if (ioctl(fd, MPSIO_READ_EXT_CFG_HEADER, &req) < 0) return (NULL); + req.ioc_status = le16toh(req.ioc_status); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; @@ -624,6 +631,7 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, errno = error; return (NULL); } + req.ioc_status = le16toh(req.ioc_status); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; @@ -752,6 +760,35 @@ mps_get_iocfacts(int fd) errno = EINVAL; return (NULL); } + adjust_iocfacts_endianness(facts); return (facts); } +static void +adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts) +{ + facts->MsgVersion = le16toh(facts->MsgVersion); + facts->HeaderVersion = le16toh(facts->HeaderVersion); + facts->Reserved1 = le16toh(facts->Reserved1); + facts->IOCExceptions = le16toh(facts->IOCExceptions); + facts->IOCStatus = le16toh(facts->IOCStatus); + facts->IOCLogInfo = le32toh(facts->IOCLogInfo); + facts->RequestCredit = le16toh(facts->RequestCredit); + facts->ProductID = le16toh(facts->ProductID); + facts->IOCCapabilities = le32toh(facts->IOCCapabilities); + facts->IOCRequestFrameSize = + le16toh(facts->IOCRequestFrameSize); + facts->FWVersion.Word = le32toh(facts->FWVersion.Word); + facts->MaxInitiators = le16toh(facts->MaxInitiators); + facts->MaxTargets = le16toh(facts->MaxTargets); + facts->MaxSasExpanders = le16toh(facts->MaxSasExpanders); + facts->MaxEnclosures = le16toh(facts->MaxEnclosures); + facts->ProtocolFlags = le16toh(facts->ProtocolFlags); + facts->HighPriorityCredit = le16toh(facts->HighPriorityCredit); + facts->MaxReplyDescriptorPostQueueDepth = + le16toh(facts->MaxReplyDescriptorPostQueueDepth); + facts->MaxDevHandle = le16toh(facts->MaxDevHandle); + facts->MaxPersistentEntries = + le16toh(facts->MaxPersistentEntries); + facts->MinDevHandle = le16toh(facts->MinDevHandle); +} diff --git a/usr.sbin/mpsutil/mps_flash.c b/usr.sbin/mpsutil/mps_flash.c index 22beaae79bb0..a0cc4a877b7d 100644 --- a/usr.sbin/mpsutil/mps_flash.c +++ b/usr.sbin/mpsutil/mps_flash.c @@ -29,6 +29,7 @@ __RCSID("$FreeBSD$"); #include #include #include +#include #include #include @@ -203,21 +204,21 @@ flash_update(int argc, char **argv) } } else { fwheader = (MPI2_FW_IMAGE_HEADER *)mem; - if (fwheader->VendorID != MPI2_MFGPAGE_VENDORID_LSI) { + if (le16toh(fwheader->VendorID) != MPI2_MFGPAGE_VENDORID_LSI) { warnx("Invalid firmware:"); warnx(" Expected Vendor ID: %04x", MPI2_MFGPAGE_VENDORID_LSI); - warnx(" Image Vendor ID: %04x", fwheader->VendorID); + warnx(" Image Vendor ID: %04x", le16toh(fwheader->VendorID)); munmap(mem, st.st_size); close(fd); free(facts); return (1); } - if (fwheader->ProductID != facts->ProductID) { + if (le16toh(fwheader->ProductID) != facts->ProductID) { warnx("Invalid image:"); warnx(" Expected Product ID: %04x", facts->ProductID); - warnx(" Image Product ID: %04x", fwheader->ProductID); + warnx(" Image Product ID: %04x", le16toh(fwheader->ProductID)); munmap(mem, st.st_size); close(fd); free(facts); diff --git a/usr.sbin/mpsutil/mps_show.c b/usr.sbin/mpsutil/mps_show.c index 814b22ab6f69..3985b3558a90 100644 --- a/usr.sbin/mpsutil/mps_show.c +++ b/usr.sbin/mpsutil/mps_show.c @@ -36,6 +36,7 @@ __RCSID("$FreeBSD$"); #include #include +#include #include #include #include @@ -111,7 +112,7 @@ show_adapter(int ac, char **av) warn("Failed to get BIOS page 3 info"); return (error); } - v = bios3->BiosVersion; + v = le32toh(bios3->BiosVersion); printf(" BIOS Revision: %d.%02d.%02d.%02d\n", ((v & 0xff000000) >> 24), ((v &0xff0000) >> 16), ((v & 0xff00) >> 8), (v & 0xff)); @@ -206,12 +207,12 @@ show_adapter(int ac, char **av) minspeed = get_device_speed(phy1->MaxMinLinkRate); maxspeed = get_device_speed(phy1->MaxMinLinkRate >> 4); - type = get_device_type(phy0->ControllerPhyDeviceInfo); + type = get_device_type(le32toh(phy0->ControllerPhyDeviceInfo)); - if (phy0->AttachedDevHandle != 0) { - snprintf(devhandle, 5, "%04x", phy0->AttachedDevHandle); + if (le16toh(phy0->AttachedDevHandle) != 0) { + snprintf(devhandle, 5, "%04x", le16toh(phy0->AttachedDevHandle)); snprintf(ctrlhandle, 5, "%04x", - phy0->ControllerDevHandle); + le16toh(phy0->ControllerDevHandle)); speed = get_device_speed(phy0->NegotiatedLinkRate); } else { snprintf(devhandle, 5, " "); @@ -545,7 +546,7 @@ show_devices(int ac, char **av) close(fd); return (error); } - handle = device->DevHandle; + handle = le16toh(device->DevHandle); if (device->ParentDevHandle == 0x0) { free(device); @@ -564,7 +565,7 @@ show_devices(int ac, char **av) else snprintf(bt, sizeof(bt), "%02d %02d", bus, target); - type = get_device_type(device->DeviceInfo); + type = get_device_type(le32toh(device->DeviceInfo)); if (device->PhyNum < nphys) { phydata = &sas0->PhyData[device->PhyNum]; @@ -576,7 +577,7 @@ show_devices(int ac, char **av) MPI2_SAS_EXPAND_PGAD_FORM_HNDL_PHY_NUM | (device->PhyNum << MPI2_SAS_EXPAND_PGAD_PHYNUM_SHIFT) | - device->ParentDevHandle, &IOCStatus); + le16toh(device->ParentDevHandle), &IOCStatus); if (exp1 == NULL) { if (IOCStatus != MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) { error = errno; @@ -595,19 +596,19 @@ show_devices(int ac, char **av) speed = " "; if (device->EnclosureHandle != 0) { - snprintf(enchandle, 5, "%04x", device->EnclosureHandle); - snprintf(slot, 3, "%02d", device->Slot); + snprintf(enchandle, 5, "%04x", le16toh(device->EnclosureHandle)); + snprintf(slot, 3, "%02d", le16toh(device->Slot)); } else { snprintf(enchandle, 5, " "); snprintf(slot, 3, " "); } printf("%-10s", bt); - snprintf(buf, sizeof(buf), "%08x%08x", device->SASAddress.High, - device->SASAddress.Low); + snprintf(buf, sizeof(buf), "%08x%08x", le32toh(device->SASAddress.High), + le32toh(device->SASAddress.Low)); printf("%-17s", buf); - snprintf(buf, sizeof(buf), "%04x", device->DevHandle); + snprintf(buf, sizeof(buf), "%04x", le16toh(device->DevHandle)); printf("%-8s", buf); - snprintf(buf, sizeof(buf), "%04x", device->ParentDevHandle); + snprintf(buf, sizeof(buf), "%04x", le16toh(device->ParentDevHandle)); printf("%-10s", buf); printf("%-14s%-6s%-5s%-6s%d\n", type, speed, enchandle, slot, device->MaxPortConnections); @@ -651,16 +652,16 @@ show_enclosures(int ac, char **av) close(fd); return (error); } - type = get_enc_type(enc->Flags, &issep); + type = get_enc_type(le16toh(enc->Flags), &issep); if (issep == 0) snprintf(sepstr, 5, " "); else - snprintf(sepstr, 5, "%04x", enc->SEPDevHandle); + snprintf(sepstr, 5, "%04x", le16toh(enc->SEPDevHandle)); printf(" %.2d %08x%08x %s %04x %s\n", - enc->NumSlots, enc->EnclosureLogicalID.High, - enc->EnclosureLogicalID.Low, sepstr, enc->EnclosureHandle, + le16toh(enc->NumSlots), le32toh(enc->EnclosureLogicalID.High), + le32toh(enc->EnclosureLogicalID.Low), sepstr, le16toh(enc->EnclosureHandle), type); - handle = enc->EnclosureHandle; + handle = le16toh(enc->EnclosureHandle); free(enc); } printf("\n"); @@ -704,19 +705,19 @@ show_expanders(int ac, char **av) } nphys = exp0->NumPhys; - handle = exp0->DevHandle; + handle = le16toh(exp0->DevHandle); if (exp0->EnclosureHandle == 0x00) snprintf(enchandle, 5, " "); else - snprintf(enchandle, 5, "%04d", exp0->EnclosureHandle); + snprintf(enchandle, 5, "%04d", le16toh(exp0->EnclosureHandle)); if (exp0->ParentDevHandle == 0x0) snprintf(parent, 5, " "); else - snprintf(parent, 5, "%04x", exp0->ParentDevHandle); + snprintf(parent, 5, "%04x", le16toh(exp0->ParentDevHandle)); printf(" %02d %08x%08x %04x %s %s %d\n", - exp0->NumPhys, exp0->SASAddress.High, exp0->SASAddress.Low, - exp0->DevHandle, parent, enchandle, exp0->SASLevel); + exp0->NumPhys, le32toh(exp0->SASAddress.High), le32toh(exp0->SASAddress.Low), + le16toh(exp0->DevHandle), parent, enchandle, exp0->SASLevel); printf("\n"); printf(" Phy RemotePhy DevHandle Speed Min Max Device\n"); @@ -733,8 +734,8 @@ show_expanders(int ac, char **av) warn("Error retrieving expander pg 1"); continue; } - type = get_device_type(exp1->AttachedDeviceInfo); - if ((exp1->AttachedDeviceInfo &0x7) == 0) { + type = get_device_type(le32toh(exp1->AttachedDeviceInfo)); + if ((le32toh(exp1->AttachedDeviceInfo) &0x7) == 0) { speed = " "; snprintf(rphy, 3, " "); snprintf(rhandle, 5, " "); @@ -744,7 +745,7 @@ show_expanders(int ac, char **av) snprintf(rphy, 3, "%02d", exp1->AttachedPhyIdentifier); snprintf(rhandle, 5, "%04x", - exp1->AttachedDevHandle); + le16toh(exp1->AttachedDevHandle)); } min = get_device_speed(exp1->HwLinkRate); max = get_device_speed(exp1->HwLinkRate >> 4); @@ -787,7 +788,7 @@ show_cfgpage(int ac, char **av) switch (ac) { case 4: - addr = (uint32_t)strtoul(av[3], NULL, 0); + addr = htole32((uint32_t)strtoul(av[3], NULL, 0)); case 3: num = (uint8_t)strtoul(av[2], NULL, 0); case 2: @@ -814,7 +815,7 @@ show_cfgpage(int ac, char **av) if (page >= 0x10) { ehdr = data; - len = ehdr->ExtPageLength * 4; + len = le16toh(ehdr->ExtPageLength) * 4; page = ehdr->ExtPageType; attrs = ehdr->PageType >> 4; } else { diff --git a/usr.sbin/mpsutil/mps_slot.c b/usr.sbin/mpsutil/mps_slot.c index 1879d699067a..bb4a7324c461 100644 --- a/usr.sbin/mpsutil/mps_slot.c +++ b/usr.sbin/mpsutil/mps_slot.c @@ -31,6 +31,7 @@ __RCSID("$FreeBSD$"); #include #include #include +#include #include #include @@ -99,7 +100,8 @@ slot_set(int argc, char **argv) return (error); } - if (mps_set_slot_status(fd, handle, slot, status) != 0) { + if (mps_set_slot_status(fd, htole16(handle), htole16(slot), + htole32(status)) != 0) { warnx("Failed to set status"); close(fd); return (1); diff --git a/usr.sbin/mpsutil/mpsutil.8 b/usr.sbin/mpsutil/mpsutil.8 index 7bd6728d49de..e7c2fda8f84e 100644 --- a/usr.sbin/mpsutil/mpsutil.8 +++ b/usr.sbin/mpsutil/mpsutil.8 @@ -169,3 +169,6 @@ The .Nm utility first appeared in .Fx 11.0 . +.Sh TODO +Flash operations (save/update) are not supported on big-endian architectures. +.Pp From nobody Wed Dec 1 18:59:05 2021 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 D6C1318B675C; Wed, 1 Dec 2021 18:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J47ff1HNTz3kT3; Wed, 1 Dec 2021 18:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 079DD71A3; Wed, 1 Dec 2021 18:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1Ix5Iv060390; Wed, 1 Dec 2021 18:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1Ix5J5060389; Wed, 1 Dec 2021 18:59:05 GMT (envelope-from git) Date: Wed, 1 Dec 2021 18:59:05 GMT Message-Id: <202112011859.1B1Ix5J5060389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 6cc44223cb67 - stable/12 - mpr: big-endian support 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6cc44223cb6717795afdac4348bbe7e2a968a07d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638385146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FGV85kDxAIFhW/TYsLYDmD+eRxpPmwDVnqvM4fAHDzk=; b=k4k2F0IsKJb8g0YKqLCL9YRUVOK1y66kll++AfEAq9wQQPzh2gZ9ZO6+TkuMHe50uWiD9n JK0at8IAY1i6GstLS/6oGaC3MxAw4FsI/i5K6fubhv2HHDQNHjeSfSzWHaMtIQqFEainYM +GpAaQcRcc5r2jF9XWOmLKrsfclHQ4cNZHS9rlTp1ZH8VAeGPlQ0NBb1KdYbw93RyahV12 377CMsuoP/dRyJ/VZNPjKmTeCtungvun8iyUAvjYV4BwYjU6jxHuRqZ+ytnTov/bSxIwuL bdqNJFT3+YwaDsEv8Uj2FOCk/UW1j/0AW02NinB/31dIvFdzJaFKwmG+1qZa1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638385146; a=rsa-sha256; cv=none; b=dKVLFgSUx2SXhNYorcu30ruH7C4nk2JOgxXKBVUhHbbiniIQlFz+0I0+qv+XIsNSV2gMcN dKROdhg0aoDUQlLMVP0yIPstK+VgEeXjZ21M1n3nmhxeyQ0O/7tz7CGhzXc6TGeI9JF4qe Nh3oSaec8gT5NweO1r5dauIW8OhS/5+SCp7gSSQCryReQ2GwznRlL/CvXuInZhEGSZpL5f zNvFEx7yAoH+0GMKk90G0Oo9MRD21hS9EVHW3yJrMKCNiK7ilI/sojM9p1qWpuWhey+ui3 hZEeuSPm24sg1JFHkD1olW2n4DAKv4RLUo8ST/etWtCZQT/o4T8DVH9Djl/m8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6cc44223cb6717795afdac4348bbe7e2a968a07d commit 6cc44223cb6717795afdac4348bbe7e2a968a07d Author: Alfredo Dal'Ava Junior AuthorDate: 2021-03-02 14:05:15 +0000 Commit: Alexander Motin CommitDate: 2021-12-01 18:42:58 +0000 mpr: big-endian support This fixes mpr driver on big-endian devices. Tested on powerpc64 and powerpc64le targets using a SAS9300-8i card (LSISAS3008 pci vendor=0x1000 device=0x0097) Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, Sreekanth Reddy (by email) Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25785 (cherry picked from commit 71900a794da046ad5322caae2774aed5b3d361b9) --- sys/dev/mpr/mpr.c | 75 ++++++++++++++++++++++++++++++++++------------- sys/dev/mpr/mpr_config.c | 16 +++++----- sys/dev/mpr/mpr_mapping.c | 4 +-- sys/dev/mpr/mpr_sas.c | 14 +++++---- sys/dev/mpr/mpr_sas_lsi.c | 21 +++++++------ sys/dev/mpr/mpr_table.c | 66 ++++++++++++++++++++--------------------- sys/dev/mpr/mprvar.h | 4 +++ 7 files changed, 119 insertions(+), 81 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 18300fedec6b..6e52efe0d8a4 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -111,6 +111,7 @@ static int mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag); static int mpr_debug_sysctl(SYSCTL_HANDLER_ARGS); static int mpr_dump_reqs(SYSCTL_HANDLER_ARGS); static void mpr_parse_debug(struct mpr_softc *sc, char *list); +static void adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts); SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD, 0, "MPR Driver Parameters"); @@ -416,7 +417,7 @@ mpr_resize_queues(struct mpr_softc *sc) * the size of an IEEE Simple SGE. */ if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { - chain_seg_size = htole16(sc->facts->IOCMaxChainSegmentSize); + chain_seg_size = sc->facts->IOCMaxChainSegmentSize; if (chain_seg_size == 0) chain_seg_size = MPR_DEFAULT_CHAIN_SEG_SIZE; sc->chain_frame_size = chain_seg_size * @@ -1055,15 +1056,21 @@ mpr_request_sync(struct mpr_softc *sc, void *req, MPI2_DEFAULT_REPLY *reply, mpr_dprint(sc, MPR_FAULT, "Timeout reading doorbell 0\n"); return (ENXIO); } + + /* + * If in a BE platform, swap bytes using le16toh to not + * disturb 8 bit field neighbors in destination structure + * pointed by data16. + */ data16[0] = - mpr_regread(sc, MPI2_DOORBELL_OFFSET) & MPI2_DOORBELL_DATA_MASK; + le16toh(mpr_regread(sc, MPI2_DOORBELL_OFFSET)) & MPI2_DOORBELL_DATA_MASK; mpr_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); if (mpr_wait_db_int(sc) != 0) { mpr_dprint(sc, MPR_FAULT, "Timeout reading doorbell 1\n"); return (ENXIO); } data16[1] = - mpr_regread(sc, MPI2_DOORBELL_OFFSET) & MPI2_DOORBELL_DATA_MASK; + le16toh(mpr_regread(sc, MPI2_DOORBELL_OFFSET)) & MPI2_DOORBELL_DATA_MASK; mpr_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); /* Number of 32bit words in the message */ @@ -1088,7 +1095,7 @@ mpr_request_sync(struct mpr_softc *sc, void *req, MPI2_DEFAULT_REPLY *reply, "Timeout reading doorbell %d\n", i); return (ENXIO); } - data16[i] = mpr_regread(sc, MPI2_DOORBELL_OFFSET) & + data16[i] = le16toh(mpr_regread(sc, MPI2_DOORBELL_OFFSET)) & MPI2_DOORBELL_DATA_MASK; mpr_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); } @@ -1143,9 +1150,8 @@ mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm) mpr_regwrite(sc, MPI26_ATOMIC_REQUEST_DESCRIPTOR_POST_OFFSET, rd.u.low); } else { - rd.u.low = cm->cm_desc.Words.Low; - rd.u.high = cm->cm_desc.Words.High; - rd.word = htole64(rd.word); + rd.u.low = htole32(cm->cm_desc.Words.Low); + rd.u.high = htole32(cm->cm_desc.Words.High); mpr_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET, rd.u.low); mpr_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET, @@ -1153,6 +1159,36 @@ mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm) } } +/* + * Ioc facts are read in 16 bit words and and stored with le16toh, + * this takes care of proper U8 fields endianness in + * MPI2_IOC_FACTS_REPLY, but we still need to swap back U16 fields. + */ +static void +adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts) +{ + facts->HeaderVersion = le16toh(facts->HeaderVersion); + facts->Reserved1 = le16toh(facts->Reserved1); + facts->IOCExceptions = le16toh(facts->IOCExceptions); + facts->IOCStatus = le16toh(facts->IOCStatus); + facts->IOCLogInfo = le32toh(facts->IOCLogInfo); + facts->RequestCredit = le16toh(facts->RequestCredit); + facts->ProductID = le16toh(facts->ProductID); + facts->IOCCapabilities = le32toh(facts->IOCCapabilities); + facts->IOCRequestFrameSize = le16toh(facts->IOCRequestFrameSize); + facts->IOCMaxChainSegmentSize = le16toh(facts->IOCMaxChainSegmentSize); + facts->MaxInitiators = le16toh(facts->MaxInitiators); + facts->MaxTargets = le16toh(facts->MaxTargets); + facts->MaxSasExpanders = le16toh(facts->MaxSasExpanders); + facts->MaxEnclosures = le16toh(facts->MaxEnclosures); + facts->ProtocolFlags = le16toh(facts->ProtocolFlags); + facts->HighPriorityCredit = le16toh(facts->HighPriorityCredit); + facts->MaxReplyDescriptorPostQueueDepth = le16toh(facts->MaxReplyDescriptorPostQueueDepth); + facts->MaxDevHandle = le16toh(facts->MaxDevHandle); + facts->MaxPersistentEntries = le16toh(facts->MaxPersistentEntries); + facts->MinDevHandle = le16toh(facts->MinDevHandle); +} + /* * Just the FACTS, ma'am. */ @@ -1174,6 +1210,9 @@ mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) request.Function = MPI2_FUNCTION_IOC_FACTS; error = mpr_request_sync(sc, &request, reply, req_sz, reply_sz, 5); + adjust_iocfacts_endianness(facts); + mpr_dprint(sc, MPR_TRACE, "facts->IOCCapabilities 0x%x\n", facts->IOCCapabilities); + mpr_dprint(sc, MPR_INIT, "%s exit, error= %d\n", __func__, error); return (error); } @@ -1232,10 +1271,10 @@ mpr_send_iocinit(struct mpr_softc *sc) init.HostPageSize = HOST_PAGE_SIZE_4K; error = mpr_request_sync(sc, &init, &reply, req_sz, reply_sz, 5); - if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) + if ((le16toh(reply.IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) error = ENXIO; - mpr_dprint(sc, MPR_INIT, "IOCInit status= 0x%x\n", reply.IOCStatus); + mpr_dprint(sc, MPR_INIT, "IOCInit status= 0x%x\n", le16toh(reply.IOCStatus)); mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); return (error); } @@ -1568,7 +1607,7 @@ mpr_alloc_requests(struct mpr_softc *sc) cm->cm_req_busaddr = sc->req_busaddr + i * sc->reqframesz; cm->cm_sense = &sc->sense_frames[i]; cm->cm_sense_busaddr = sc->sense_busaddr + i * MPR_SENSE_LEN; - cm->cm_desc.Default.SMID = i; + cm->cm_desc.Default.SMID = htole16(i); cm->cm_sc = sc; cm->cm_state = MPR_CM_STATE_BUSY; TAILQ_INIT(&cm->cm_chain_list); @@ -1691,7 +1730,7 @@ mpr_init_queues(struct mpr_softc *sc) * Initialize all of the free queue entries. */ for (i = 0; i < sc->fqdepth; i++) { - sc->free_queue[i] = sc->reply_busaddr + (i * sc->replyframesz); + sc->free_queue[i] = htole32(sc->reply_busaddr + (i * sc->replyframesz)); } sc->replyfreeindex = sc->num_replies; @@ -2756,7 +2795,8 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else - bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, 16); + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + evtreq->EventMasks[i] = htole32(sc->event_mask[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -2810,7 +2850,8 @@ mpr_reregister_events(struct mpr_softc *sc) bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else - bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, 16); + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + evtreq->EventMasks[i] = htole32(sc->event_mask[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -3483,8 +3524,6 @@ mpr_push_sge(struct mpr_command *cm, MPI2_SGE_SIMPLE64 *sge, size_t len, /* Endian Safe code */ sge_flags = sge->FlagsLength; sge->FlagsLength = htole32(sge_flags); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sge, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); } @@ -3511,8 +3550,6 @@ mpr_push_sge(struct mpr_command *cm, MPI2_SGE_SIMPLE64 *sge, size_t len, /* Endian Safe code */ sge_flags = sge->FlagsLength; sge->FlagsLength = htole32(sge_flags); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sge, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); return (0); @@ -3571,8 +3608,6 @@ mpr_push_ieee_sge(struct mpr_command *cm, void *sgep, int segsleft) /* Endian Safe code */ sge_length = sge->Length; sge->Length = htole32(sge_length); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sgep, cm->cm_sge, ieee_sge_size); cm->cm_sge = (MPI25_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + @@ -3590,8 +3625,6 @@ mpr_push_ieee_sge(struct mpr_command *cm, void *sgep, int segsleft) /* Endian Safe code */ sge_length = sge->Length; sge->Length = htole32(sge_length); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sgep, cm->cm_sge, ieee_sge_size); cm->cm_sge = (MPI25_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + ieee_sge_size); diff --git a/sys/dev/mpr/mpr_config.c b/sys/dev/mpr/mpr_config.c index 80c8a189b433..96b6031a534b 100644 --- a/sys/dev/mpr/mpr_config.c +++ b/sys/dev/mpr/mpr_config.c @@ -142,7 +142,7 @@ mpr_config_get_ioc_pg8(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 8; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -274,7 +274,7 @@ mpr_config_get_iounit_pg8(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 8; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -406,7 +406,7 @@ mpr_config_get_man_pg11(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 11; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -602,7 +602,7 @@ mpr_config_get_dpm_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->PageAddress = sc->max_dpm_entries << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; request->ExtPageLength = mpi_reply->ExtPageLength; - cm->cm_length = le16toh(request->ExtPageLength) * 4; + cm->cm_length = le16toh(request->ExtPageLength) * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1282,7 +1282,7 @@ mpr_config_get_bios_pg3(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 3; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1414,7 +1414,7 @@ mpr_config_get_raid_volume_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t request->Header.PageLength = mpi_reply->Header.PageLength; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->PageAddress = page_address; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1546,7 +1546,7 @@ mpr_config_get_raid_volume_pg1(struct mpr_softc *sc, Mpi2ConfigReply_t request->Header.PageLength = mpi_reply->Header.PageLength; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->PageAddress = htole32(form | handle); - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1704,7 +1704,7 @@ mpr_config_get_raid_pd_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageLength = mpi_reply->Header.PageLength; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->PageAddress = page_address; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; diff --git a/sys/dev/mpr/mpr_mapping.c b/sys/dev/mpr/mpr_mapping.c index 47d82063c128..9af67b6250f3 100644 --- a/sys/dev/mpr/mpr_mapping.c +++ b/sys/dev/mpr/mpr_mapping.c @@ -2572,7 +2572,7 @@ mpr_mapping_initialize(struct mpr_softc *sc) sc->pending_map_events = 0; sc->num_enc_table_entries = 0; sc->num_rsvd_entries = 0; - sc->max_dpm_entries = sc->ioc_pg8.MaxPersistentEntries; + sc->max_dpm_entries = le16toh(sc->ioc_pg8.MaxPersistentEntries); sc->is_dpm_enable = (sc->max_dpm_entries) ? 1 : 0; sc->track_mapping_events = 0; @@ -2586,7 +2586,7 @@ mpr_mapping_initialize(struct mpr_softc *sc) if (ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0) sc->num_rsvd_entries = 1; - volume_mapping_flags = sc->ioc_pg8.IRVolumeMappingFlags & + volume_mapping_flags = le16toh(sc->ioc_pg8.IRVolumeMappingFlags) & MPI2_IOCPAGE8_IRFLAGS_MASK_VOLUME_MAPPING_MODE; if (sc->ir_firmware && (volume_mapping_flags == MPI2_IOCPAGE8_IRFLAGS_LOW_VOLUME_MAPPING)) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index d3147a7e3f4d..2fb20ebcd9d7 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -2130,7 +2130,7 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb) } if ((lun != NULL) && (lun->eedp_formatted)) { - req->EEDPBlockSize = htole16(lun->eedp_block_size); + req->EEDPBlockSize = htole32(lun->eedp_block_size); eedp_flags |= (MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG | MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD); @@ -2501,10 +2501,6 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) target_id_t target_id; MPR_FUNCTRACE(sc); - mpr_dprint(sc, MPR_TRACE, - "cm %p SMID %u ccb %p reply %p outstanding %u\n", cm, - cm->cm_desc.Default.SMID, cm->cm_ccb, cm->cm_reply, - cm->cm_targ->outstanding); callout_stop(&cm->cm_callout); mtx_assert(&sc->mpr_mtx, MA_OWNED); @@ -2514,6 +2510,12 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) csio = &ccb->csio; target_id = csio->ccb_h.target_id; rep = (MPI2_SCSI_IO_REPLY *)cm->cm_reply; + mpr_dprint(sc, MPR_TRACE, + "cm %p SMID %u ccb %p reply %p outstanding %u csio->scsi_status 0x%x," + "csio->dxfer_len 0x%x, csio->msg_le 0x%xn\n", cm, + cm->cm_desc.Default.SMID, cm->cm_ccb, cm->cm_reply, + cm->cm_targ->outstanding, csio->scsi_status, + csio->dxfer_len, csio->msg_len); /* * XXX KDM if the chain allocation fails, does it matter if we do * the sync and unload here? It is simpler to do it in every case, @@ -3892,7 +3894,7 @@ mprsas_portenable_complete(struct mpr_softc *sc, struct mpr_command *cm) reply = (MPI2_PORT_ENABLE_REPLY *)cm->cm_reply; if (reply == NULL) mpr_dprint(sc, MPR_FAULT, "Portenable NULL reply\n"); - else if (le16toh(reply->IOCStatus & MPI2_IOCSTATUS_MASK) != + else if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) mpr_dprint(sc, MPR_FAULT, "Portenable failed\n"); diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c index 5e7da7d2e096..7bb72509e67e 100644 --- a/sys/dev/mpr/mpr_sas_lsi.c +++ b/sys/dev/mpr/mpr_sas_lsi.c @@ -160,11 +160,11 @@ mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, } bcopy(event->EventData, fw_event->event_data, sz); - fw_event->event = event->Event; - if ((event->Event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE || - event->Event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && + fw_event->event = le16toh(event->Event); + if ((fw_event->event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE || + fw_event->event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && sc->track_mapping_events) sc->pending_map_events++; @@ -173,9 +173,9 @@ mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, * are processed. Increment the startup_refcount and decrement it after * events are processed. */ - if ((event->Event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && + if ((fw_event->event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && sc->wait_for_port_enable) mprsas_startup_increment(sc->sassc); @@ -868,9 +868,8 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate) parent_devinfo = le32toh(parent_config_page.DeviceInfo); } } - /* TODO Check proper endianness */ - sas_address = config_page.SASAddress.High; - sas_address = (sas_address << 32) | config_page.SASAddress.Low; + sas_address = htole32(config_page.SASAddress.High); + sas_address = (sas_address << 32) | htole32(config_page.SASAddress.Low); mpr_dprint(sc, MPR_MAPPING, "Handle 0x%04x SAS Address from SAS device " "page0 = %jx\n", handle, sas_address); diff --git a/sys/dev/mpr/mpr_table.c b/sys/dev/mpr/mpr_table.c index a1bddf1a3065..79088fe8204e 100644 --- a/sys/dev/mpr/mpr_table.c +++ b/sys/dev/mpr/mpr_table.c @@ -316,7 +316,7 @@ mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) MPR_PRINTFIELD_START(sc, "PortFacts"); MPR_PRINTFIELD(sc, facts, PortNumber, %d); MPR_PRINTFIELD(sc, facts, PortType, 0x%x); - MPR_PRINTFIELD(sc, facts, MaxPostedCmdBuffers, %d); + MPR_PRINTFIELD_16(sc, facts, MaxPostedCmdBuffers, %d); } void @@ -324,33 +324,33 @@ mpr_print_evt_generic(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event { MPR_PRINTFIELD_START(sc, "EventReply"); - MPR_PRINTFIELD(sc, event, EventDataLength, %d); + MPR_PRINTFIELD_16(sc, event, EventDataLength, %d); MPR_PRINTFIELD(sc, event, AckRequired, %d); mpr_print_field(sc, "Event: %s (0x%x)\n", - mpr_describe_table(mpr_event_names, event->Event), event->Event); - MPR_PRINTFIELD(sc, event, EventContext, 0x%x); + mpr_describe_table(mpr_event_names, le16toh(event->Event)), le16toh(event->Event)); + MPR_PRINTFIELD_32(sc, event, EventContext, 0x%x); } void mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS Device Page 0"); - MPR_PRINTFIELD(sc, buf, Slot, %d); - MPR_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x); + MPR_PRINTFIELD_16(sc, buf, Slot, %d); + MPR_PRINTFIELD_16(sc, buf, EnclosureHandle, 0x%x); mpr_print_field(sc, "SASAddress: 0x%jx\n", mpr_to_u64(&buf->SASAddress)); - MPR_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, buf, ParentDevHandle, 0x%x); MPR_PRINTFIELD(sc, buf, PhyNum, %d); MPR_PRINTFIELD(sc, buf, AccessStatus, 0x%x); - MPR_PRINTFIELD(sc, buf, DevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, buf, DevHandle, 0x%x); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x); MPR_PRINTFIELD(sc, buf, ZoneGroup, %d); - mpr_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo, + mpr_print_field(sc, "DeviceInfo: %b,%s\n", le32toh(buf->DeviceInfo), "\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit" "\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct" "\15LsiDev" "\16AtapiDev" "\17SepDev", mpr_describe_table(mpr_sasdev0_devtype, buf->DeviceInfo & 0x03)); - MPR_PRINTFIELD(sc, buf, Flags, 0x%x); + MPR_PRINTFIELD_16(sc, buf, Flags, 0x%x); MPR_PRINTFIELD(sc, buf, PhysicalPort, %d); MPR_PRINTFIELD(sc, buf, MaxPortConnections, %d); mpr_print_field(sc, "DeviceName: 0x%jx\n", @@ -366,7 +366,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) mpr_print_evt_generic(sc, event); - switch(event->Event) { + switch(le16toh(event->Event)) { case MPI2_EVENT_SAS_DISCOVERY: { MPI2_EVENT_DATA_SAS_DISCOVERY *data; @@ -378,7 +378,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) mpr_describe_table(mpr_sasdisc_reason, data->ReasonCode)); MPR_PRINTFIELD(sc, data, PhysicalPort, %d); mpr_print_field(sc, "DiscoveryStatus: %b\n", - data->DiscoveryStatus, "\20" + le32toh(data->DiscoveryStatus), "\20" "\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout" "\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed" "\11SmpCrcError" "\12SubSubLink" "\13TableTableLink" @@ -397,8 +397,8 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *) &event->EventData; - MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); - MPR_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, EnclosureHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, ExpanderDevHandle, 0x%x); MPR_PRINTFIELD(sc, data, NumPhys, %d); MPR_PRINTFIELD(sc, data, NumEntries, %d); MPR_PRINTFIELD(sc, data, StartPhyNum, %d); @@ -411,7 +411,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) phynum = data->StartPhyNum + i; mpr_print_field(sc, "PHY[%d].AttachedDevHandle: 0x%04x\n", phynum, - phy->AttachedDevHandle); + le16toh(phy->AttachedDevHandle)); mpr_print_field(sc, "PHY[%d].LinkRate: %s (0x%x)\n", phynum, mpr_describe_table(mpr_linkrate_names, @@ -428,13 +428,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *) &event->EventData; - MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, EnclosureHandle, 0x%x); mpr_print_field(sc, "ReasonCode: %s\n", mpr_describe_table(mpr_sastopo_exp, data->ReasonCode)); MPR_PRINTFIELD(sc, data, PhysicalPort, %d); - MPR_PRINTFIELD(sc, data, NumSlots, %d); - MPR_PRINTFIELD(sc, data, StartSlot, %d); - MPR_PRINTFIELD(sc, data, PhyBits, 0x%x); + MPR_PRINTFIELD_16(sc, data, NumSlots, %d); + MPR_PRINTFIELD_16(sc, data, StartSlot, %d); + MPR_PRINTFIELD_32(sc, data, PhyBits, 0x%x); break; } case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: @@ -443,12 +443,12 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *) &event->EventData; - MPR_PRINTFIELD(sc, data, TaskTag, 0x%x); + MPR_PRINTFIELD_16(sc, data, TaskTag, 0x%x); mpr_print_field(sc, "ReasonCode: %s\n", mpr_describe_table(mpr_sasdev_reason, data->ReasonCode)); MPR_PRINTFIELD(sc, data, ASC, 0x%x); MPR_PRINTFIELD(sc, data, ASCQ, 0x%x); - MPR_PRINTFIELD(sc, data, DevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, DevHandle, 0x%x); mpr_print_field(sc, "SASAddress: 0x%jx\n", mpr_to_u64(&data->SASAddress)); break; @@ -476,24 +476,24 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) MPR_PRINTFIELD(sc, buf, PhysicalPort, %d); MPR_PRINTFIELD(sc, buf, NumPhys, %d); MPR_PRINTFIELD(sc, buf, Phy, %d); - MPR_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d); + MPR_PRINTFIELD_16(sc, buf, NumTableEntriesProgrammed, %d); mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate); - MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); + MPR_PRINTFIELD_16(sc, buf, AttachedDevHandle, 0x%04x); mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); + (le32toh(buf->PhyInfo) >> 16) & 0xf), le32toh(buf->PhyInfo)); mpr_print_field(sc, "AttachedDeviceInfo: %b,%s\n", - buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit" + le32toh(buf->AttachedDeviceInfo), "\20" "\4SATAhost" "\5SMPinit" "\6STPinit" "\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg" "\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev", mpr_describe_table(mpr_sasdev0_devtype, - buf->AttachedDeviceInfo & 0x03)); - MPR_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x); + le32toh(buf->AttachedDeviceInfo) & 0x03)); + MPR_PRINTFIELD_16(sc, buf, ExpanderDevHandle, 0x%04x); MPR_PRINTFIELD(sc, buf, ChangeCount, %d); mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, @@ -501,10 +501,10 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) MPR_PRINTFIELD(sc, buf, PhyIdentifier, %d); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); MPR_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x); - MPR_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x); + MPR_PRINTFIELD_32(sc, buf, AttachedPhyInfo, 0x%x); mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); + le32toh(buf->AttachedPhyInfo) & 0xf), le32toh(buf->AttachedPhyInfo)); MPR_PRINTFIELD(sc, buf, ZoneGroup, %d); MPR_PRINTFIELD(sc, buf, SelfConfigStatus, 0x%x); } @@ -513,12 +513,12 @@ void mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS PHY Page 0"); - MPR_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x); - MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); + MPR_PRINTFIELD_16(sc, buf, OwnerDevHandle, 0x%04x); + MPR_PRINTFIELD_16(sc, buf, AttachedDevHandle, 0x%04x); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); + le32toh(buf->AttachedPhyInfo) & 0xf), le32toh(buf->AttachedPhyInfo)); mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); @@ -529,7 +529,7 @@ mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) MPR_PRINTFIELD(sc, buf, Flags, 0x%x); mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); + (le32toh(buf->PhyInfo) >> 16) & 0xf), le32toh(buf->PhyInfo)); mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate); diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h index 08216ff54d1d..f8e479b2fbc8 100644 --- a/sys/dev/mpr/mprvar.h +++ b/sys/dev/mpr/mprvar.h @@ -760,6 +760,10 @@ do { \ mpr_printf((sc), tag "\n") #define MPR_PRINTFIELD(sc, facts, attr, fmt) \ mpr_print_field((sc), #attr ": " #fmt "\n", (facts)->attr) +#define MPR_PRINTFIELD_16(sc, facts, attr, fmt) \ + mpr_print_field((sc), #attr ": " #fmt "\n", le16toh((facts)->attr)) +#define MPR_PRINTFIELD_32(sc, facts, attr, fmt) \ + mpr_print_field((sc), #attr ": " #fmt "\n", le32toh((facts)->attr)) static __inline void mpr_from_u64(uint64_t data, U64 *mpr) From nobody Wed Dec 1 18:59:07 2021 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 CEB6118B647F; Wed, 1 Dec 2021 18:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J47fg3N20z3kfx; Wed, 1 Dec 2021 18:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 304ED71A4; Wed, 1 Dec 2021 18:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1Ix7w5060414; Wed, 1 Dec 2021 18:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1Ix7GY060413; Wed, 1 Dec 2021 18:59:07 GMT (envelope-from git) Date: Wed, 1 Dec 2021 18:59:07 GMT Message-Id: <202112011859.1B1Ix7GY060413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 9d98b001a8c5 - stable/12 - Remove unused wrappers around kproc_create() and kproc_exit(). 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9d98b001a8c5dad3735796e22ad0e4e776c91d4e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638385148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ShYpRfqh6PPWmqIim6YeQCDsy0DcvohPYfJpX/ONlsQ=; b=OBPxtWdn7U1m8sK7nEDNhGkXzVkdF6l2qNkeRPnLG6mp+tuBLpKirG/t6NqO4FSayy9TJr 4aC0lFU/0sHYke0gVs0tfeYBlWaa6uTWpP/M4qRCccsIFw0wDPRM55I8jQq7yY0K24ZJ0G BCmh7PaSFnQSRzRHAN/aTyGHU7ezRcu5UEclDKQJpSLFwW9ZzlTuTqzQLO9GEBgpetR/lI Nl3FtnES4xaZnGR/KKqxDijVfFmbJJU9/yAKJXHcxHkV5oCN9hfHB/6sedctfH61V2WaUa 51hnf5KWWMI7dBD77CI/tZF5cpiyw4lZxYwMDL+eQe1cQwrZpMFCORwV2mnJDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638385148; a=rsa-sha256; cv=none; b=MPp3QKx1vN4Gi2D2OKs3dy7CJ0C0UJZb7hZ0n7X2hJN0biGroHaIqLrwOazpbAqIFfeLWI uvOauQtu8KvCwfQSPJi11FW2wWoZSyoKDmXmSRheh4HsH3/P6SQ2gF4MhlvFkuEQs+p4aW eUvylBKnuZGqfzOv3DB30Rw6L168Lkj7bo1lHFulTLKTwLTYxhQbsnTqmj0JP8iTCF48tS GNUiNgrokQSPgIMXhNbdsIAlqaH/wHs71VbJQLXQD5qzJAkIIPlS+4pZKBO7oOuo4vIHXG u7z52ro2VedKXbG3ZQORVTKG0PqhD3VUJZC+L6+ae9+WDfmXK/0UyKfYxInlYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9d98b001a8c5dad3735796e22ad0e4e776c91d4e commit 9d98b001a8c5dad3735796e22ad0e4e776c91d4e Author: John Baldwin AuthorDate: 2021-03-12 17:47:58 +0000 Commit: Alexander Motin CommitDate: 2021-12-01 18:46:48 +0000 Remove unused wrappers around kproc_create() and kproc_exit(). Reviewed by: imp, kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29205 (cherry picked from commit 645b15e558dc102ff70a6332b1d0b0aa733fd2bb) --- sys/dev/mpr/mprvar.h | 10 ---------- sys/dev/mps/mpsvar.h | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h index f8e479b2fbc8..8eb9379d8cff 100644 --- a/sys/dev/mpr/mprvar.h +++ b/sys/dev/mpr/mprvar.h @@ -909,16 +909,6 @@ int mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, SYSCTL_DECL(_hw_mpr); /* Compatibility shims for different OS versions */ -#if __FreeBSD_version >= 800001 -#define mpr_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpr_kproc_exit(arg) kproc_exit(arg) -#else -#define mpr_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpr_kproc_exit(arg) kthread_exit(arg) -#endif - #if defined(CAM_PRIORITY_XPT) #define MPR_PRIORITY_XPT CAM_PRIORITY_XPT #else diff --git a/sys/dev/mps/mpsvar.h b/sys/dev/mps/mpsvar.h index 6800ef468757..bb0087bf0346 100644 --- a/sys/dev/mps/mpsvar.h +++ b/sys/dev/mps/mpsvar.h @@ -827,16 +827,6 @@ int mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, SYSCTL_DECL(_hw_mps); /* Compatibility shims for different OS versions */ -#if __FreeBSD_version >= 800001 -#define mps_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mps_kproc_exit(arg) kproc_exit(arg) -#else -#define mps_kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mps_kproc_exit(arg) kthread_exit(arg) -#endif - #if defined(CAM_PRIORITY_XPT) #define MPS_PRIORITY_XPT CAM_PRIORITY_XPT #else From nobody Wed Dec 1 18:59:08 2021 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 AAB0718B6921; Wed, 1 Dec 2021 18:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J47fj0DhBz3kjr; Wed, 1 Dec 2021 18:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E23172B2; Wed, 1 Dec 2021 18:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1Ix8t8060438; Wed, 1 Dec 2021 18:59:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1Ix8HM060437; Wed, 1 Dec 2021 18:59:08 GMT (envelope-from git) Date: Wed, 1 Dec 2021 18:59:08 GMT Message-Id: <202112011859.1B1Ix8HM060437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 9d842d84f49a - stable/12 - mpr/mps(4): Make device mapping some more robust. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9d842d84f49af6d4aacaea694dcaea4173522684 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638385149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g5S9RYPEiSLPOc4BDZjPI3ujsB9jy6SCruz2bDUCuUM=; b=OhPL7krut48zsPUaEAjpYcOso460SUczl5NY1ZCbXeB2PeDSqu8niTG1QIp9U0qu57j7vs UUfdkKY0aZW/ehWB0kt8Al8VgxIY8kVx+lG+0hyFauulTpqsZ6pJzWCW37//ZPYa6QKDw/ FZF8t+IUYgFK/ZW61AHOfLanXGHmEfCzAjEB9HlsKqB2cfLb8efUHYB4/HgylwKebPTzbS faecr4TFO3QyGYXyACS63+e9c+rPJmWYaALR/35cpueFW6ZSgI0jOj+8ngbLHeBF3HF1iP AF1zdxDn258GVPpfbmkbvN6JbyzP/UOOrwqmY4CrJehB6vomSt45RpOth1hnVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638385149; a=rsa-sha256; cv=none; b=oLmLKWVA8prdSVb53NvR+BaN340rinhvFkxS/CTQmm0ck9yJ60DCiBP9LUeXiMQmSw9wXn xj/nR8zqgIaRe8N0nztVfOl+geVzf83Z+wh9aS1DtA9bWMD9tf+ZeqDAYj74BUKvpzNamh XyGeWPk+bjTDjcmzFs0W3IxZdRNeAVBOmhx9htAzZ2FHmyz+uG8HYHyAg9RjuhJWpP3xto 6VV4Pa6mQeyb6IZpQf+f5FNMrkbx4+NBLzGD7DfmykKNBabBvuhlrEU5XkjBCEVlNYk6Kp TAsN4xA5AR266/YJJVhHvPPh6mbDq0E259+m139QBdnUfioN9gE7pvznK1cdAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9d842d84f49af6d4aacaea694dcaea4173522684 commit 9d842d84f49af6d4aacaea694dcaea4173522684 Author: Alexander Motin AuthorDate: 2021-04-24 03:18:01 +0000 Commit: Alexander Motin CommitDate: 2021-12-01 18:51:24 +0000 mpr/mps(4): Make device mapping some more robust. Allow new enclosure to replace previously existing one if there is no completely unused table entry, same as it is done for devices. If we can not process DPM due to corruption -- wipe it and restart from scratch. Otherwise I don't see a way to recover persistence if something go wrong and there is no BIOS to recover it for us. Together this solves a problem that appeared when 9300-8i firmware update to 16.00.10.00 somehow switched its mapping mode from Device Persistence to Enclosure/Slot without wiping the DPM table. It made HBA completely unusable, since overflowed and conflicting mapping table was unable to map any of enclosures and so devices. Also while there make some enclosure mapping errors more informative. MFC after: 1 month Sponsored by: iXsystems, Inc. (cherry picked from commit b99419aee49e2cc53747730be4d0ec4f9b330eb2) --- sys/dev/mpr/mpr_mapping.c | 71 ++++++++++++++++++++++++++++++----------------- sys/dev/mps/mps_mapping.c | 39 +++++++++++++++++--------- 2 files changed, 71 insertions(+), 39 deletions(-) diff --git a/sys/dev/mpr/mpr_mapping.c b/sys/dev/mpr/mpr_mapping.c index 9af67b6250f3..eed59ff38de1 100644 --- a/sys/dev/mpr/mpr_mapping.c +++ b/sys/dev/mpr/mpr_mapping.c @@ -1214,9 +1214,10 @@ _mapping_get_dev_info(struct mpr_softc *sc, phy_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } if (!((phy_change->device_info & @@ -1369,9 +1370,10 @@ _mapping_get_pcie_dev_info(struct mpr_softc *sc, port_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - port_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + port_change->dev_handle, + topo_change->enc_handle); continue; } if (!(port_change->device_info & @@ -1610,9 +1612,10 @@ _mapping_add_new_device(struct mpr_softc *sc, phy_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } @@ -1867,9 +1870,10 @@ _mapping_add_new_pcie_device(struct mpr_softc *sc, port_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - port_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + port_change->dev_handle, + topo_change->enc_handle); continue; } @@ -2208,7 +2212,7 @@ mpr_mapping_free_memory(struct mpr_softc *sc) free(sc->dpm_pg0, M_MPR); } -static bool +static void _mapping_process_dpm_pg0(struct mpr_softc *sc) { u8 missing_cnt, enc_idx; @@ -2335,8 +2339,8 @@ _mapping_process_dpm_pg0(struct mpr_softc *sc) MPR_DPM_BAD_IDX) { mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: Conflict in mapping table for " - " enclosure %d\n", __func__, - enc_idx); + "enclosure %d device %d\n", + __func__, enc_idx, map_idx); goto fail; } physical_id = @@ -2376,20 +2380,26 @@ _mapping_process_dpm_pg0(struct mpr_softc *sc) mt_entry->device_info = MPR_DEV_RESERVED; } } /*close the loop for DPM table */ - return (true); + return; fail: + mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " + "Wiping DPM to start from scratch\n", __func__); + dpm_entry = (Mpi2DriverMap0Entry_t *) ((uint8_t *) sc->dpm_pg0 + + sizeof(MPI2_CONFIG_EXTENDED_PAGE_HEADER)); + bzero(dpm_entry, sizeof(Mpi2DriverMap0Entry_t) * sc->max_dpm_entries); for (entry_num = 0; entry_num < sc->max_dpm_entries; entry_num++) { + sc->dpm_flush_entry[entry_num] = 1; sc->dpm_entry_used[entry_num] = 0; /* * for IR firmware, it may be necessary to wipe out * sc->mapping_table volumes tooi */ } + _mapping_flush_dpm_pages(sc); for (enc_idx = 0; enc_idx < sc->num_enc_table_entries; enc_idx++) _mapping_clear_enc_entry(sc->enclosure_table + enc_idx); sc->num_enc_table_entries = 0; - return (false); } /* @@ -2629,10 +2639,8 @@ retry_read_dpm: } } - if (sc->is_dpm_enable) { - if (!_mapping_process_dpm_pg0(sc)) - sc->is_dpm_enable = 0; - } + if (sc->is_dpm_enable) + _mapping_process_dpm_pg0(sc); if (! sc->is_dpm_enable) { mpr_dprint(sc, MPR_MAPPING, "%s: DPM processing is disabled. " "Device mappings will not persist across reboots or " @@ -2828,14 +2836,24 @@ mpr_mapping_enclosure_dev_status_change_event(struct mpr_softc *sc, * and the enclosure has enough space in the Mapping * Table to map its devices. */ - enc_idx = sc->num_enc_table_entries; - if (enc_idx >= sc->max_enclosures) { + if (sc->num_enc_table_entries < sc->max_enclosures) { + enc_idx = sc->num_enc_table_entries; + sc->num_enc_table_entries++; + } else { + enc_idx = _mapping_get_high_missing_et_idx(sc); + if (enc_idx != MPR_ENCTABLE_BAD_IDX) { + et_entry = &sc->enclosure_table[enc_idx]; + _mapping_add_to_removal_table(sc, + et_entry->dpm_entry_num); + _mapping_clear_enc_entry(et_entry); + } + } + if (enc_idx == MPR_ENCTABLE_BAD_IDX) { mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "Enclosure cannot be added to mapping " "table because it's full.\n", __func__); goto out; } - sc->num_enc_table_entries++; et_entry = &sc->enclosure_table[enc_idx]; et_entry->enc_handle = le16toh(event_data-> EnclosureHandle); @@ -2862,8 +2880,9 @@ mpr_mapping_enclosure_dev_status_change_event(struct mpr_softc *sc, le16toh(event_data->EnclosureHandle)); if (enc_idx == MPR_ENCTABLE_BAD_IDX) { mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: Cannot " - "unmap enclosure %d because it has already been " - "deleted.\n", __func__, enc_idx); + "unmap enclosure with handle 0x%04x because it " + "has already been deleted.\n", __func__, + le16toh(event_data->EnclosureHandle)); goto out; } et_entry = &sc->enclosure_table[enc_idx]; diff --git a/sys/dev/mps/mps_mapping.c b/sys/dev/mps/mps_mapping.c index 9330288acd06..d2f761568dac 100644 --- a/sys/dev/mps/mps_mapping.c +++ b/sys/dev/mps/mps_mapping.c @@ -1176,9 +1176,10 @@ _mapping_get_dev_info(struct mps_softc *sc, phy_change->is_processed = 1; mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } if (!((phy_change->device_info & @@ -1421,9 +1422,10 @@ _mapping_add_new_device(struct mps_softc *sc, phy_change->is_processed = 1; mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } @@ -1887,8 +1889,8 @@ _mapping_process_dpm_pg0(struct mps_softc *sc) MPS_DPM_BAD_IDX) { mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: Conflict in mapping table for " - " enclosure %d\n", __func__, - enc_idx); + "enclosure %d device %d\n", + __func__, enc_idx, map_idx); break; } physical_id = @@ -2364,14 +2366,24 @@ mps_mapping_enclosure_dev_status_change_event(struct mps_softc *sc, * and the enclosure has enough space in the Mapping * Table to map its devices. */ - enc_idx = sc->num_enc_table_entries; - if (enc_idx >= sc->max_enclosures) { + if (sc->num_enc_table_entries < sc->max_enclosures) { + enc_idx = sc->num_enc_table_entries; + sc->num_enc_table_entries++; + } else { + enc_idx = _mapping_get_high_missing_et_idx(sc); + if (enc_idx != MPS_ENCTABLE_BAD_IDX) { + et_entry = &sc->enclosure_table[enc_idx]; + _mapping_add_to_removal_table(sc, + et_entry->dpm_entry_num); + _mapping_clear_enc_entry(et_entry); + } + } + if (enc_idx == MPS_ENCTABLE_BAD_IDX) { mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: " "Enclosure cannot be added to mapping " "table because it's full.\n", __func__); goto out; } - sc->num_enc_table_entries++; et_entry = &sc->enclosure_table[enc_idx]; et_entry->enc_handle = le16toh(event_data-> EnclosureHandle); @@ -2398,8 +2410,9 @@ mps_mapping_enclosure_dev_status_change_event(struct mps_softc *sc, le16toh(event_data->EnclosureHandle)); if (enc_idx == MPS_ENCTABLE_BAD_IDX) { mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: Cannot " - "unmap enclosure %d because it has already been " - "deleted.\n", __func__, enc_idx); + "unmap enclosure with handle 0x%04x because it " + "has already been deleted.\n", __func__, + le16toh(event_data->EnclosureHandle)); goto out; } et_entry = &sc->enclosure_table[enc_idx]; From nobody Wed Dec 1 18:59:09 2021 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 7E56A18B67E5; Wed, 1 Dec 2021 18:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J47fj6HsKz3kTP; Wed, 1 Dec 2021 18:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 735077406; Wed, 1 Dec 2021 18:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1Ix9FY060462; Wed, 1 Dec 2021 18:59:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1Ix9s8060461; Wed, 1 Dec 2021 18:59:09 GMT (envelope-from git) Date: Wed, 1 Dec 2021 18:59:09 GMT Message-Id: <202112011859.1B1Ix9s8060461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: a1e06684e708 - stable/12 - mpr, mps: clear CCBs allocated on the stack 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a1e06684e708cca9eba2c3978c20a9552a55283f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638385152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2/HyNmFTVtG0XHYJKyDHGm78SHUzH72hfXSEZBP1RHM=; b=g/EUlwScrAp5zz9aBBPizNXuJA1lBq5fJFCYuYSb0FnReO6Kai2JP40podUxTWsbA6T9TU LwY5YQ5pFqpW3U8znOcfORoIj2JN+SeciXD1xKFSfq9027M6YW+LOIBrzIj1CWV0yDKpqH vRXBEH2doCZMWk5obBJtvesfBJ7qPbl+TGHWAQIZhCpLcR5no0iUObeJQdCPsqbNq7Ihof gH9fuPOJLEjmtgYqsSxJpzWIaoNRRFbtzrtwmDdcQCGB41tRDfJ2+S9HzzLJL+5Kgh7X47 JUpX0cPeUkEHU27ZQCILMKIBEICNoPWP1Dr8XOLC/pI45zAp3a3W0EVoywcWuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638385152; a=rsa-sha256; cv=none; b=KVym7IZJrNGw/EXem9q7SF8A7oBAqlREmqHKp6dZ0RgB0Ij6P+EdI/bQqTAN8qHVVpj3cO bvcDO2Gr8qmz/fC1c0DQk36Hddl5BLSZBUhPwTylkTYoGuZfHrr4Ub5DkNmX6VYX/ES311 saNSZXoe3pxAwe8orZEl1RKaKLc/Q/I0CQe1qtP7t/HIfuMT9d0r6KNHcSavtQ1ct9YmNy TvqRRhROAPsFHskYwDcKm/qcjKAm4TZiizFL7e7TNUNnxjjZ+q/05PTQFJvh5NhQTAVUI4 DSqn3w96bDN2T2NisvKGdT4nUbJd2YVodaoHnMg/Y+8yszoZyneHhArgkzhWew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a1e06684e708cca9eba2c3978c20a9552a55283f commit a1e06684e708cca9eba2c3978c20a9552a55283f Author: Edward Tomasz Napierala AuthorDate: 2021-05-21 06:42:08 +0000 Commit: Alexander Motin CommitDate: 2021-12-01 18:52:36 +0000 mpr, mps: clear CCBs allocated on the stack Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D30301 (cherry picked from commit 7608b98c4394590840a53d2b38b908582253de32) --- sys/dev/mpr/mpr_sas.c | 1 + sys/dev/mps/mps_sas.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index 2fb20ebcd9d7..4d8f4ebe1673 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -3545,6 +3545,7 @@ mprsas_async(void *callback_arg, uint32_t code, struct cam_path *path, } bzero(&rcap_buf, sizeof(rcap_buf)); + bzero(&cdai, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.ccb_h.flags = CAM_DIR_IN; diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c index 5ba5e87137e1..ad80b0471622 100644 --- a/sys/dev/mps/mps_sas.c +++ b/sys/dev/mps/mps_sas.c @@ -3244,6 +3244,7 @@ mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, } bzero(&rcap_buf, sizeof(rcap_buf)); + bzero(&cdai, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.ccb_h.flags = CAM_DIR_IN; From nobody Wed Dec 1 19:41:50 2021 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 ADEE918C99FD; Wed, 1 Dec 2021 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J48by2zY1z4SYH; Wed, 1 Dec 2021 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 463E87C95; Wed, 1 Dec 2021 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1Jfo0i024075; Wed, 1 Dec 2021 19:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1Jfo3I024074; Wed, 1 Dec 2021 19:41:50 GMT (envelope-from git) Date: Wed, 1 Dec 2021 19:41:50 GMT Message-Id: <202112011941.1B1Jfo3I024074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 060c97abb019 - stable/13 - powerpc64: make autoboot possible on powernv machines 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 060c97abb0192568ca6807d39ed822593c3f1459 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638387710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KEhzpZrF5PwE0/1CispvaYzV5zy/rLpsCEI49Y/RJtk=; b=DRDNlhLsUeitDy9B3IKOxIG1SECnrpKc7koaxjo/vomfTaZQetOma7f4gCRXPGMBmtDi/h bdrWEpgUp5qUvXj/N133sx2tnlXv/C5uFiTCYUOOZPMKyoKbPOcrHuHcwd96ERGtJ8buZ9 n5R6z0tBmMooriL1NNpCcHrxe9o/w1O4xQCCO9RKVHPjYGnXGrWtbaPalR/pwQIm2mriu/ p0txfJabpoyQ8uzMTFwVWXptJls2ybx88LnbeL1BWgPN31lgJl9yycwdMuUl7+x2kWgADc +VvM6/+OQoj8ZN9CrpM8LQOrFMf5cIW5bPxNiUGyBxuUE+7yA1n3NYGi0PYUeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638387710; a=rsa-sha256; cv=none; b=NWJRRh9qrw6l+JeYrbH2rzqTYyljBjddpysvUsaa/REr3DBLdTfE8CSh6VPqKFS2Rm4oT4 Dlg2sDafIV4VFVNvNRiKRRCFLGHgfb6B6zdyxaZxrG7iRxYBfJhBnVfFFBp2qJ1XS85c1q ylwRiZHR5qZtwG9zujDM8Q8EculuA1Pz1RLh3LbLbI7J3kJEy6yv/iKScAnPuG54pHvkVy 1AsxXxKiggTwC4WGT6D03d9KHY7J7R/tFrWy/x69zAqv9vIX1PtVWOS3YWOea96XHmOhce W8tbuNPT/jLQGSpKvqRC3PJvVblyIPFX1m9T+NiykDIm22NYWjcsC6rt88u6PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=060c97abb0192568ca6807d39ed822593c3f1459 commit 060c97abb0192568ca6807d39ed822593c3f1459 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-11-26 00:02:53 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-12-01 22:41:49 +0000 powerpc64: make autoboot possible on powernv machines It's required to specify a default boot option in order to make petitboot's autoboot feature work. Tested on Raptor Blackbird Reviewed by: imp, luporl MFC after: 2 days Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D32838 (cherry picked from commit b6644f529ca4c13975727c5625415fcc30c60af6) --- usr.sbin/bsdinstall/scripts/bootconfig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index c0a0ff4f77ee..c5218b10a271 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -27,6 +27,9 @@ # # $FreeBSD$ + +FREEBSD_BOOTLABEL="FreeBSD" + BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 @@ -41,8 +44,10 @@ if [ `uname -m` == powerpc ]; then platform=`sysctl -n hw.platform` if [ "$platform" == ps3 -o "$platform" == powernv ]; then rootpart=$(awk '{ if($2 == "/") printf("%s:%s\n", $3, $1); }' $PATH_FSTAB) + kboot_conf=$BSDINSTALL_CHROOT/boot/etc/kboot.conf mkdir -p $BSDINSTALL_CHROOT/boot/etc/ - echo FreeBSD=\'/kernel/kernel kernelname=/boot/kernel/kernel vfs.root.mountfrom=${rootpart}\' > $BSDINSTALL_CHROOT/boot/etc/kboot.conf + echo default=$FREEBSD_BOOTLABEL > $kboot_conf + echo $FREEBSD_BOOTLABEL=\'/kernel/kernel kernelname=/boot/kernel/kernel vfs.root.mountfrom=${rootpart}\' >> $kboot_conf fi fi @@ -81,11 +86,9 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${BOOTNAME}" fi - bootlabel="FreeBSD" - if [ "$BSDINSTALL_CONFIGCURRENT" ]; then f_dprintf "Creating UEFI boot entry" - efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null + efibootmgr --create --activate --label "$FREEBSD_BOOTLABEL" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null fi f_dprintf "Finished configuring ESP" From nobody Wed Dec 1 19:41:51 2021 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 2EA0918C9EBF; Wed, 1 Dec 2021 19:41:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J48bz4MZ8z4SYK; Wed, 1 Dec 2021 19:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72996797D; Wed, 1 Dec 2021 19:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1JfpmH024106; Wed, 1 Dec 2021 19:41:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1JfpCj024105; Wed, 1 Dec 2021 19:41:51 GMT (envelope-from git) Date: Wed, 1 Dec 2021 19:41:51 GMT Message-Id: <202112011941.1B1JfpCj024105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 5cee383b87f5 - stable/13 - powerpc64le: add LINT64LE kernel config 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5cee383b87f5aa86912e6cf3158d74af4bb912f1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638387711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56+OjafOpQUVHX1wjBL+xmCHwwQfmg1jgvJyCYXRJkQ=; b=gO9ywrfnOZqrzya2dr+TAWqZGF+ntcXA3xJQ5nRtqY78eKEjyCRY4fMOwikQTzEbPpVIja 8sulGO3H6gTlwVxISlRsmq5JE7AJJ+jPoCxS0NKoEdcT72Sr01PlMA3d2Ynt3F06G+38Qc ElIYVFE0acKhR8eYpN4WR7L83cEU3PWpXt2exIksXdziDWVAdhJqgHxtUiMUFWk/IXzkd8 W9pvud3gQgpyNhxXXc9QhR0Z4VkPVWZn722lbs4WIfLgy2xEbcIeo6eo/xby7RNEhgdh7V Xl3p/I3xdl7+3uaTO8edL9fyyiJpsWDG5eBhXMVm0PltBFAn9CRsGRJvXETnnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638387711; a=rsa-sha256; cv=none; b=eL40qkpcakN+9nCHXLiuXtI4NXXdh5NwDFSIXXfXZWnCO3dEubKtkTUqKaOdqlS5S3CaWg kvv5aai4t9os3q6LhqaZDOn/yKr1sj4UrOzUZKGo/RlKoUlxghZRUalWUleCRrljDQh3ii txdp4WGjpy6QeL6qAZGhHge+Kfpx2eTbB2sFuX0XCU93iOrJpYaxWcTLG+5oNeaHLgpMhB 7I0KQVFqghzjW0EgOU8k9ac+vIKqA30qUFrRulRW2SfLu4SRtIfsaVhxn1a6lvFinujpW4 fmUfN1wjHdonFrYCv2IwlCs3eoPKwWp+4JQf/MRDU3+qnjjZWN4ff9Cmj6Y6pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=5cee383b87f5aa86912e6cf3158d74af4bb912f1 commit 5cee383b87f5aa86912e6cf3158d74af4bb912f1 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-11-29 15:08:26 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-12-01 22:42:14 +0000 powerpc64le: add LINT64LE kernel config Add configuration file to be used by "FreeBSD--powerpc64le-LINT" CI/Jenkins job Reviewed by: lwhsu MFC after: 2 days Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D33136 (cherry picked from commit e671037b3c49734566e7e0af74ba1a64f45b77a2) --- sys/powerpc/conf/LINT64LE | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/powerpc/conf/LINT64LE b/sys/powerpc/conf/LINT64LE new file mode 100644 index 000000000000..9c9a417dd9d7 --- /dev/null +++ b/sys/powerpc/conf/LINT64LE @@ -0,0 +1,5 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include NOTES +machine powerpc powerpc64le From nobody Wed Dec 1 22:05:19 2021 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 D5B8918BC9F9; Wed, 1 Dec 2021 22:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4CnW3hzZz3mxy; Wed, 1 Dec 2021 22:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EECD11F4D; Wed, 1 Dec 2021 22:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1M5JFq014615; Wed, 1 Dec 2021 22:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1M5Jco014614; Wed, 1 Dec 2021 22:05:19 GMT (envelope-from git) Date: Wed, 1 Dec 2021 22:05:19 GMT Message-Id: <202112012205.1B1M5Jco014614@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: 2cd26a286a9e - stable/13 - nfsd: Add a new rc variable nfs_server_maxio 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2cd26a286a9e6339a3c6782a7101cbbd5d166666 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638396319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZ//AE9OVL58fBGZYSiy1LZE0AZo1nGjs2XpryZ16P4=; b=jdThU3gyDjWlrxPV/g37VP8HsAuJW4hsP+hnh7mnAwTjUwEu+tGPjE9UxfytDu10Bi39c+ 74Vb5ZGysqE7u+D9YpCb3vqN59A86irmBWORI7xlWJk0kWWkV1tVB/PCuCGNqy67dlW0U/ ssl0t63UjbxL3TzTBckjuYPeY/EVYg89fRHMZ0mJm1gCs8PbRGiyJ7WR0yz+O07UsUgQxO l8x9zM66a9lmNlDrQtD9P9WIofAVyHtnZs+RujhA4nvhRTWorUPtWqc66Mife6foHO9vJ3 N+rJqoVseiprpbW2Dyw//P+FuI7ojUEAX5R6ovtPC9AxixvKcyRSsocUsn0XZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638396319; a=rsa-sha256; cv=none; b=l/eO7VNTWh402haEzBCQ1UFyQVHyHUtAnkEz7GRiwgWBOlklt3o5lyCk94m5lBfRMecrpK eU3KtpoDn+pujxHz6Al6o8+UFoeDZ0dJzT9VliMn9Dq3dUxrUnPpaKnyJcKkOnSHA0Qb6p oxxcw9z3wyuapv8tC+qanXSP2/UA7BykiEIAxT3HVRSMKAtvYsR7foEeqf/JiKytSm9L6r fTAw+hqPFsFCPc4s/x8N0OdPsieHVGboh1CDxrWtnK4QoSolZPKrrB5hK8+oKDRFD3Uy9a QhURjKmCu7eU481EbZnJy2Z+DwsBVh0DGStKcf0oNHAnjvlSrXt0QrGdbdrVZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2cd26a286a9e6339a3c6782a7101cbbd5d166666 commit 2cd26a286a9e6339a3c6782a7101cbbd5d166666 Author: Rick Macklem AuthorDate: 2021-11-17 00:02:53 +0000 Commit: Rick Macklem CommitDate: 2021-12-01 22:01:57 +0000 nfsd: Add a new rc variable nfs_server_maxio Since vfs.nfsd.srvmaxio can only be set when nfsd.ko is loaded, but nfsd is not running, setting it in /etc/sysctl.conf is not feasible when "options NFSD" was not specified for the kernel. This patch adds a new rc variable nfs_server_maxio, which sets vfs.nfsd.srvmaxio at the correct time. rc.conf.5 will be patched separately. (cherry picked from commit 5509bad74e44eed3b9d54fbd74d3752b88428147) --- libexec/rc/rc.conf | 1 + libexec/rc/rc.d/nfsd | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index e4fc9a1d75fe..9336a9d91004 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -360,6 +360,7 @@ nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). nfs_server_flags="-u -t" # Flags to nfsd (if enabled). nfs_server_managegids="NO" # The NFS server maps gids for AUTH_SYS (or NO). +nfs_server_maxio="131072" # Maximum I/O size for the nfsd. mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r -S" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. diff --git a/libexec/rc/rc.d/nfsd b/libexec/rc/rc.d/nfsd index 1d0689b3beb7..b746cf7cea9d 100755 --- a/libexec/rc/rc.d/nfsd +++ b/libexec/rc/rc.d/nfsd @@ -28,6 +28,12 @@ nfsd_precmd() # oids are available. load_kld nfsd || return 1 + if [ -n "${nfs_server_maxio}" ]; then + if ! sysctl vfs.nfsd.srvmaxio=${nfs_server_maxio} >/dev/null; then + warn "Failed to set server max I/O" + fi + fi + if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsd.nfs_privport=1 > /dev/null From nobody Thu Dec 2 00:11:54 2021 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 69D5A18B2258; Thu, 2 Dec 2021 00:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4Gbb0B2Mz3HNC; Thu, 2 Dec 2021 00:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB0941356B; Thu, 2 Dec 2021 00:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B20BsDE087489; Thu, 2 Dec 2021 00:11:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B20BsCV087488; Thu, 2 Dec 2021 00:11:54 GMT (envelope-from git) Date: Thu, 2 Dec 2021 00:11:54 GMT Message-Id: <202112020011.1B20BsCV087488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 70cb68e7a00a - releng/12.3 - 12.3: update to -RELEASE 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 70cb68e7a00ac0310a2d0ca428c1d5018e6d39e1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638403915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xEzYLHoJ6dYIzJ5BUCgWNA33X78MA6Z4/zh4pt7Auqg=; b=pndwFcBoWctxrzadaoUANAselMQJc5H3R/RRWCvTynxWWbwWI1o+oIHVKD8kO4sviqL/6F duJm9nEkK/DreMpEWjaakkWc/ffOiUIB4+8xMXKxGaAxGoM9TzBHRURD87gwRJqZqVp46W VaGL2B41SKkeAs+WG8rVKbI67UYq5XY0DdQ8PX5mV8azRv1xNEzPjUIkUTv9+ejN/dMwk8 18DlfLGbcW7v2Vk+eziD+LYvBavphplsuLeVBrMm8HKUnTDoe5FSf9oGnYhx/OmI05KbXf +T6o6x0dugiW3R0xIpon+bUvNUqUhtmdwDEWurCYYw8ubkoNcO42FZ93m9Zx7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638403915; a=rsa-sha256; cv=none; b=eoVqj1em+85IyGbxFWsRRw13SXXOfzt8OGRfQN8FnMvJ86t+WQr4SS9imntz3xXN6ZuE8v g+Fhar11YFO3Q6lCdRnZcYz7OAto5ykGaKfvD32nC2tfS/KJkuIlnM9XSDgF4yuTiZlR/L mwnzotpIYB93P9SLyKFsAJmVQTFe1//xYclnJ+LDQNelqwHTZHHuTJkKqeGEeHQmYregaN kvztqZjpuc/99wWaV+AfLtHwkAtDTcHjI8n6GAQn3CY/e6dSH6O6k/Pevh7sYf5bcmNfQL ctomykSAYQDtImBLrrdvWSrCf9krLksAHI0yanoCI2fJtFB0m2NxYqsm5DairQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=70cb68e7a00ac0310a2d0ca428c1d5018e6d39e1 commit 70cb68e7a00ac0310a2d0ca428c1d5018e6d39e1 Author: Glen Barber AuthorDate: 2021-12-02 00:08:38 +0000 Commit: Glen Barber CommitDate: 2021-12-02 00:08:38 +0000 12.3: update to -RELEASE - Switch releng/12.3 from RC2 to RELEASE. - Add the anticipated 12.3-RELEASE date to UPDATING. - Set a static __FreeBSD_version. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate") --- UPDATING | 3 +++ lib/csu/common/crtbrand.c | 2 +- sys/conf/newvers.sh | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index 88a610e4705c..52e8aaecc102 100644 --- a/UPDATING +++ b/UPDATING @@ -17,6 +17,9 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20211206: + 12.3-RELEASE. + 20210730: Commit b69019c14cd8 removes pf's DIOCGETSTATESNV ioctl. As of be70c7a50d32 it is no longer used by userspace, but it does mean diff --git a/lib/csu/common/crtbrand.c b/lib/csu/common/crtbrand.c index f8fb0024db24..0dc3114b2fa7 100644 --- a/lib/csu/common/crtbrand.c +++ b/lib/csu/common/crtbrand.c @@ -65,7 +65,7 @@ static const struct { .descsz = sizeof(int32_t), .type = NT_FREEBSD_ABI_TAG, .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version + .desc = 1203000 }; static const struct { diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e6ab77045930..c927b4b07864 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.3" -BRANCH="RC2" +BRANCH="RELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Dec 2 01:08:32 2021 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 2D78518AC1BD; Thu, 2 Dec 2021 01:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4Hrw4hjWz3pbC; Thu, 2 Dec 2021 01:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82ABB14499; Thu, 2 Dec 2021 01:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B218WHT054853; Thu, 2 Dec 2021 01:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B218WaW054852; Thu, 2 Dec 2021 01:08:32 GMT (envelope-from git) Date: Thu, 2 Dec 2021 01:08:32 GMT Message-Id: <202112020108.1B218WaW054852@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: 23e8078bcc0f - stable/13 - rc.conf.5: Add entries for NFS 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 23e8078bcc0fe59b2cf0de537db4887c7018aa79 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638407312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wo2I6Y58jAFOM6MIU+pfM0Izcy7wroe2bEVfycDQVGk=; b=JNQDior3/TBnsd/NJZa1mDYAsJ0STJ7LKN7RjMNhq1uwcLpV74nS9CqsY2WhWWRWdlsIBA rDP3pnUf/vGe/Q4ESP8yNiIZAHPduifNZYoq/azxzU/EvpCqtIt/Nd07ErA0b/5bWHzO2a h6eq7X0lbzVDWjeb6wNNSySopeeiGHzFGkf1UKw9DoI54zn+yAkrYHOahOnROub5Z32koZ sh/3B+f/45y6zobOs00/mJ7Y9SyQdIe3VF+3559bbqIsOWZnBdoemWheRmOrvMxh0zqkBQ 6aQK0mM7jN9kpz1u+XPOPALUxmc+hBwNpX8TnWevnRut3qREVjxExcX7ZxxNaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638407312; a=rsa-sha256; cv=none; b=Z9CCt8MgWbJ9NGnXI9C/qCSmF+J+Au9+FqcZmW5R71sKGGifa/9Z1BgL/KoCtANVvSNNR3 cCSzeZy455s+CVjIDKQc1j/rCAqOLCBjgNDWKQZButMiZSJvD7lL9qTRfgFvVkOETmbPte O7iSVcn/qwbIa9lPMHj1AeU1cPdfvl89n5KXIXRRNzXHnB1lK836A3yfjs0HHwIvpko/EU HW8WdTwMr9dTFpC8wlyXa11jVhHRocHXUxpqYZDHMg8bm0ySXZD1yeDdDd8B01NRPIIMGY DqQKFok8/i7vyDSSZMmSAHtwSojYxQ1JBIVOOx74/SjK0rIRP9PausLimlmsjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=23e8078bcc0fe59b2cf0de537db4887c7018aa79 commit 23e8078bcc0fe59b2cf0de537db4887c7018aa79 Author: Rick Macklem AuthorDate: 2021-11-18 15:59:34 +0000 Commit: Rick Macklem CommitDate: 2021-12-02 01:05:12 +0000 rc.conf.5: Add entries for NFS Entries for a few recently defined rc variables were missing from rc.conf.5. This patch adds those. It was not obvious to me what the ordering is, so I added them to the area where other nfsd related variables are. I can easily move them. I also replaced "are" with "is", since it seems to read better. This is a content change. (cherry picked from commit 9dae2d03bc644be38196cf76c55039af1a7c1ba6) --- share/man/man5/rc.conf.5 | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 96db269407cd..883937a619ee 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2021 +.Dd November 18, 2021 .Dt RC.CONF 5 .Os .Sh NAME @@ -2371,9 +2371,40 @@ is set to .Dq Li YES and .Va nfsv4_server_enable -are set to +is set to .Dq Li YES , enable the server for NFSv4 as well as NFSv2 and NFSv3. +.It Va nfsv4_server_only +.Pq Vt bool +If +.Va nfs_server_enable +is set to +.Dq Li YES +and +.Va nfsv4_server_only +is set to +.Dq Li YES , +enable the NFS server for NFSv4 only. +.It Va nfs_server_maxio +.Pq Vt int +value to set vfs.nfsd.srvmaxio to, which is the +maximum I/O size for the NFS server. +.It Va tlsclntd_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr rpc.tlsclntd 8 +daemon, which is needed for NFS-over-TLS NFS mounts. +.It Va tlsservd_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr rpc.tlsservd 8 +daemon, which is needed for the +.Xr nfsd 8 +to support NFS-over-TLS NFS mounts. .It Va nfsuserd_enable .Pq Vt bool If @@ -4649,6 +4680,8 @@ it will be made permanently active. .Xr routed 8 , .Xr rpc.lockd 8 , .Xr rpc.statd 8 , +.Xr rpc.tlsclntd 8 , +.Xr rpc.tlsservd 8 , .Xr rpcbind 8 , .Xr rwhod 8 , .Xr savecore 8 , From nobody Thu Dec 2 01:12:58 2021 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 4442F18AE701; Thu, 2 Dec 2021 01:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4Hy26kHgz3rLP; Thu, 2 Dec 2021 01:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C733013EF9; Thu, 2 Dec 2021 01:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B21CwdE068140; Thu, 2 Dec 2021 01:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B21CwPb068139; Thu, 2 Dec 2021 01:12:58 GMT (envelope-from git) Date: Thu, 2 Dec 2021 01:12:58 GMT Message-Id: <202112020112.1B21CwPb068139@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: afb6f8307494 - stable/13 - mountd: Fix handling of usernames that start with a digit 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: afb6f83074944e3843bb171656af9f52ac9d4d98 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638407579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8g0hzJMII8yVc/LQU0LSgT2oBw2/0GxuAau+TmDe+as=; b=K6JYIqyJOCIEnnWufqNXTvBfzQaUzxttTqBC02MCvtycUUbMHnsdDULxU6LwlrUzo/6VRy YR4F4vlhrPLkt4WE+ufKNR6yp1UJbHStnYT+4zPPi2izX8jyk8YH0dwmrCJabusDiYnH52 kRcjcTOCPpe+61RXbFGp0FXhWCjomFJggaTN/pIYmbQUnhVk5f7XAH8PQGFaXJzqBUESD3 ss+S9wwGPxb/ATNLSD7FLk1ALjWBi2XXNz6LIj1pcMqqqI5QD86Yv25FOOVszpuEWIY9k+ Kx6aTorycLkKexwn18LCXFFXKWTjj8MumVEjCJkcpzvTPUW9AXUB8GUyRED7mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638407579; a=rsa-sha256; cv=none; b=yQX1z3mPYs85BSvkJLe/9PWxpjKp+kjyRI9DzW/65g+lSRWit2sqGiQKeJTGdFfU4iT/Bm /DfkWvQ4hVSG/8srVmDOMrRlDQiWud7xG9fMg2U0A6o9FH1zyUmKNt8IQUvh4L1TTitw/w 7QosF0+NhbLgLsZeefuOsjq1gbjB9p4mFNozIqho74HE7C4VgX/Ys8mwdLAd8IcsBJV0UB euydf34DX1mJUOjvoLevXTP1X8XmeifhrJCvOCvtKUspx3qrsPdQ1V2vT9XKY582eX/Xwj sPHBGbHJFY0T+tYTO0LEa/I8d1n8m2cF/aOr1oiJrXTirtQ8eCPoCTf6aOkKWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=afb6f83074944e3843bb171656af9f52ac9d4d98 commit afb6f83074944e3843bb171656af9f52ac9d4d98 Author: Rick Macklem AuthorDate: 2021-11-18 21:35:25 +0000 Commit: Rick Macklem CommitDate: 2021-12-02 01:08:35 +0000 mountd: Fix handling of usernames that start with a digit yocalebo_gmail.com submitted a patch for mountd.c that fixes the case where a username starts with a digit. Without this patch, the username that starts with a digit is misinterpreted as a numeric uid. With this patch, any string that does not entirely convert to a decimal number via strtoul() is considered a user/group name. (cherry picked from commit f4bf849bb894f4934b8df6c04a820dfa52e9576c) --- usr.sbin/mountd/mountd.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index c66ac13b3016..0c077b857d7e 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3534,6 +3534,8 @@ parsecred(char *namelist, struct expcred *cr) struct group *gr; gid_t groups[NGROUPS_MAX + 1]; int ngroups; + unsigned long name_ul; + char *end = NULL; /* * Set up the unprivileged user. @@ -3548,10 +3550,11 @@ parsecred(char *namelist, struct expcred *cr) names = namelist; name = strsep_quote(&names, ":"); /* Bug? name could be NULL here */ - if (isdigit(*name) || *name == '-') - pw = getpwuid(atoi(name)); - else + name_ul = strtoul(name, &end, 10); + if (*end != '\0' || end == name) pw = getpwnam(name); + else + pw = getpwuid((uid_t)name_ul); /* * Credentials specified as those of a user. */ @@ -3573,8 +3576,9 @@ parsecred(char *namelist, struct expcred *cr) if (ngroups > 1 && groups[0] == groups[1]) { ngroups--; inpos = 2; - } else + } else { inpos = 1; + } if (ngroups > NGROUPS_MAX) ngroups = NGROUPS_MAX; if (ngroups > SMALLNGROUPS) @@ -3589,25 +3593,26 @@ parsecred(char *namelist, struct expcred *cr) * Explicit credential specified as a colon separated list: * uid:gid:gid:... */ - if (pw != NULL) + if (pw != NULL) { cr->cr_uid = pw->pw_uid; - else if (isdigit(*name) || *name == '-') - cr->cr_uid = atoi(name); - else { + } else if (*end != '\0' || end == name) { syslog(LOG_ERR, "unknown user: %s", name); return; + } else { + cr->cr_uid = name_ul; } cr->cr_ngroups = 0; while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS_MAX) { name = strsep_quote(&names, ":"); - if (isdigit(*name) || *name == '-') { - groups[cr->cr_ngroups++] = atoi(name); - } else { + name_ul = strtoul(name, &end, 10); + if (*end != '\0' || end == name) { if ((gr = getgrnam(name)) == NULL) { syslog(LOG_ERR, "unknown group: %s", name); continue; } groups[cr->cr_ngroups++] = gr->gr_gid; + } else { + groups[cr->cr_ngroups++] = name_ul; } } if (names != NULL && *names != '\0' && cr->cr_ngroups == NGROUPS_MAX) From nobody Thu Dec 2 02:31:51 2021 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 98D1918ABEC0; Thu, 2 Dec 2021 02:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4Kj31tmLz4ng7; Thu, 2 Dec 2021 02:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22B7F15714; Thu, 2 Dec 2021 02:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B22Vp21073874; Thu, 2 Dec 2021 02:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B22VpQs073873; Thu, 2 Dec 2021 02:31:51 GMT (envelope-from git) Date: Thu, 2 Dec 2021 02:31:51 GMT Message-Id: <202112020231.1B22VpQs073873@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: 81c9a051ea35 - stable/13 - swap pager: lock vnode around VOP_CLOSE() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 81c9a051ea35ff784437ba780399447154d56cfa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638412311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ACpMikHLSDl9xwT2m6qpXC221NDeFuEM84M4GikUvqQ=; b=xb4/HMEBHBv5EW4u5hj9pY3W2JAeTzIVLh45E+vIWAZj5Wyr/QlWmjqWo23LDGl8lhsGpI TecIMFrnH44/lsu5Tve8Bs9Kec2jrQTUITLHtfZ6CB1KFufH25MfrOg41dXYWLagoTd1bW DUGUYPb6QzWq9OoZ2sO45FQ2sMPvmoq1re2g8r4X/99MMQMy2SXC6HmaU0bkCwQz/yXZIO cNYodUqRKfUAjrqSEqGHbyeopKweRyuizNFumxoptp4lb1nDDb26xoIpM9mESL1jl5K84H QY2+BAlnbeDLN3j9SJAfWSNtEZNdK1A63b9UZxhgxPCJZOeiPcN7cu6bUpfUCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638412311; a=rsa-sha256; cv=none; b=PQ5OdN19dbZXubj3xHvYLXkft92bY8Zprif57kGJ8eNdO2E6F1xziNy3N01molytDKf3ru 73gfXTjxarYHI4ihvIxxfBiN3Pj/eLjlGJixehO5E6XVR8CQ6Q0yLpJqh0mGw9Y1FlLEQ7 +/I7uh06Cmw3c1Z5rq198trJAJLavPZt2reAz8kqmvjHtA/3MxCV2nmSv0flfMOAdulUPE ve5qVKhgK9RbHtg9+/Er+06O0jwY+P63e2KVJXwGduAbrFWSrhhidb1P9xZ0pd+Hlb+2qv aBWIAlwW1aq3gp+jDZZ4JOM8YWrCoZ9CVN4OMoJJu0w29MmXDmQN6H+OIVE2vA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81c9a051ea35ff784437ba780399447154d56cfa commit 81c9a051ea35ff784437ba780399447154d56cfa Author: Konstantin Belousov AuthorDate: 2021-11-23 09:16:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-02 02:21:14 +0000 swap pager: lock vnode around VOP_CLOSE() (cherry picked from commit a6d04f34a4db6ff3fd5431ae10d4b877337fc138) --- sys/vm/swap_pager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 6d64ff883966..38c225db51ee 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3050,9 +3050,12 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp) static void swapdev_close(struct thread *td, struct swdevt *sp) { + struct vnode *vp; - VOP_CLOSE(sp->sw_vp, FREAD | FWRITE, td->td_ucred, td); - vrele(sp->sw_vp); + vp = sp->sw_vp; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); + vput(vp); } static int From nobody Thu Dec 2 02:31:52 2021 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 5A46418AC0A7; Thu, 2 Dec 2021 02:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4Kj43GBgz4nZq; Thu, 2 Dec 2021 02:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49F5D1588C; Thu, 2 Dec 2021 02:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B22VqE0073898; Thu, 2 Dec 2021 02:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B22VqY2073897; Thu, 2 Dec 2021 02:31:52 GMT (envelope-from git) Date: Thu, 2 Dec 2021 02:31:52 GMT Message-Id: <202112020231.1B22VqY2073897@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: 4b2caeec43ea - stable/13 - swapon: extend the region where the swap vnode is locked 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 4b2caeec43eabdb6331352ca9249abd5175f4838 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638412312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y95LN2XzDYYie4w2rFxa9B1Vmi6/8RylTAfTz3XpapU=; b=k3EIPlQ4wuitMvf+ZO7ez55JZ1aS3fjgElagw0fvWGwzV0Aemj13dTUTexxOToOxUwHIZa wz84iJEA8gGh2E+QIAH99KJgHz6AKexOkj6DUoFPvFlC6HYYWONQ7TWamOBbC04gwakbu2 SrCGNRgY0Dgq/V6w5WlqvDfzTR3NzQxTc/PakvR5eS6qBYro69Y34WQehkd914UB6j+ALS W+K6INPu1R7pDcn5b7ICLOqNz63kDGRXWgF/6SIweog/ncLCeT5ReKVuI7nwZvsy1VguzU eEUTWnHAFBvXJN0eq/o/kAIZP5cH3TUP6kL212h6c7VP6ZsVuReF9J08ItUM4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638412312; a=rsa-sha256; cv=none; b=VqrO3hQG1n/SFRAEY5kxNeh2zdTVHQaopKrFjfUDqd0gp+Xv45Iqvjgwb+rAe+A2YyTTWW YtwlRBnuyU1D8hCSREL0nApguiyzhZuDWSEy8E+VFiZewoT64mb5BoyLoS2JifQdxzfTGK oNhWqgA/fzo11jFtBuqYMwClEpntLkVi0N22DiHjym9rV/ufJxOlju6Qo8oSDGskvZipsJ WJ8TfeGk3CLF1tackkitEM9ak3YPm/pOQJjOJVJdIwAVDmyyeGb+Kg7/I5AgHzhk4LdKl9 FCzB/nDitzxalxWOOXFaqyBJcYleMJvACWeB2jo99dG78+NxRFi+8oZWwAYQvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4b2caeec43eabdb6331352ca9249abd5175f4838 commit 4b2caeec43eabdb6331352ca9249abd5175f4838 Author: Konstantin Belousov AuthorDate: 2021-11-24 03:06:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-02 02:21:14 +0000 swapon: extend the region where the swap vnode is locked (cherry picked from commit 6ddf41faa6f54738db9b3f313086974b6403d680) --- sys/vm/swap_pager.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 38c225db51ee..8363dce52683 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2360,8 +2360,8 @@ sys_swapon(struct thread *td, struct swapon_args *uap) goto done; } - NDINIT(&nd, LOOKUP, ISOPEN | FOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->name, td); + NDINIT(&nd, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, + UIO_USERSPACE, uap->name, td); error = namei(&nd); if (error) goto done; @@ -2381,8 +2381,10 @@ sys_swapon(struct thread *td, struct swapon_args *uap) error = swaponvp(td, vp, attr.va_size / DEV_BSIZE); } - if (error) - vrele(vp); + if (error != 0) + vput(vp); + else + VOP_UNLOCK(vp); done: sx_xunlock(&swdev_syscall_lock); return (error); @@ -3005,7 +3007,7 @@ swapongeom(struct vnode *vp) { int error; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + ASSERT_VOP_ELOCKED(vp, "swapongeom"); if (vp->v_type != VCHR || VN_IS_DOOMED(vp)) { error = ENOENT; } else { @@ -3013,7 +3015,6 @@ swapongeom(struct vnode *vp) error = swapongeom_locked(vp->v_rdev, vp); g_topology_unlock(); } - VOP_UNLOCK(vp); return (error); } @@ -3064,6 +3065,7 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) struct swdevt *sp; int error; + ASSERT_VOP_ELOCKED(vp, "swaponvp"); if (nblks == 0) return (ENXIO); mtx_lock(&sw_dev_mtx); @@ -3075,14 +3077,12 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) } mtx_unlock(&sw_dev_mtx); - (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_system_check_swapon(td->td_ucred, vp); if (error == 0) #endif error = VOP_OPEN(vp, FREAD | FWRITE, td->td_ucred, td, NULL); - (void) VOP_UNLOCK(vp); - if (error) + if (error != 0) return (error); swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close, From nobody Thu Dec 2 02:31:53 2021 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 A8CD318AC0AB; Thu, 2 Dec 2021 02:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4Kj573ygz4nmB; Thu, 2 Dec 2021 02:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF281583C; Thu, 2 Dec 2021 02:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B22VrRp073922; Thu, 2 Dec 2021 02:31:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B22Vrg6073921; Thu, 2 Dec 2021 02:31:53 GMT (envelope-from git) Date: Thu, 2 Dec 2021 02:31:53 GMT Message-Id: <202112020231.1B22Vrg6073921@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: 3a98b98be504 - stable/13 - swap_pager: lock vnode in swapdev_strategy() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 3a98b98be504e5ba3faf0fdf58271681d9eee5a1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638412314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oH1G2R06zyJBPN3Ed9WlOTgkOMdxUW/Y23zCgnF1lIQ=; b=pbCsn8MLo1BEpjbkW9/wRgEQaQN9Shkminldgz++ousm3k5LOuCAfh4esLfJj41o+Ay/XN 009OKiQj4I9K78PJi8rbc6Izr2Ul3+CwpGa5ELafPwoBX8QLBQsLv0Q675JYwYTYYsWWO3 0GoVHcvKNUjMMSbHKJiiZ0Ov+Rb4I6bjtFjpIpXiVgvngcgmhW9NeZ6x4rBcb3dV5ZbLbx 2UQusDDg6ooxZK3Jl9/VRqNtD7mNYWQnZ8j+F023UN9FXQjaLnjB4IAHNqf5W/RtZTq7wl qoAXBrdnMLnOFF6J/K4TARnrdI/IzIO8LQHe4hPCzL4cR+kpgbungOjcXxzeSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638412314; a=rsa-sha256; cv=none; b=dttZga4u2PcndL89yTnF+cpDCSxcsYgwDSU7ZbFnNOBjJSzmqRpivRS779OTmgDW3Qd3BS Ap4xGGwoGsrfjZpxG4LVvdCtUnjHdt4YS6HaB4DenfkzBGpEnT6Y7R7TnEuznnmaakLuBh VrvKLjeIg7FNY3PFxdRKItbJ2W1TnwsIgluRkO8pVFoF051jn5AXeS0CJjkdSmK7vpSzfM W7Cwh66mXBp9d//se1LEPmJ9J7fCSyOC3sLgHcpKwxwFzSrEvsmlL2tTMULvnznmcgdSCd lST7IqqqFShQXja+AhiwrmeYoPcZ4qQ86RpS6YBXxCRNTrz6+JxPC09Om7Z+rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3a98b98be504e5ba3faf0fdf58271681d9eee5a1 commit 3a98b98be504e5ba3faf0fdf58271681d9eee5a1 Author: Konstantin Belousov AuthorDate: 2021-11-24 11:26:46 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-02 02:21:15 +0000 swap_pager: lock vnode in swapdev_strategy() (cherry picked from commit b19740f4ce7a542783f87de2fee48476a7801d86) --- sys/vm/swap_pager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 8363dce52683..78533c9fb5e6 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3036,16 +3036,19 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp) vp2 = sp->sw_id; vhold(vp2); if (bp->b_iocmd == BIO_WRITE) { + vn_lock(vp2, LK_EXCLUSIVE | LK_RETRY); if (bp->b_bufobj) bufobj_wdrop(bp->b_bufobj); bufobj_wref(&vp2->v_bufobj); + } else { + vn_lock(vp2, LK_SHARED | LK_RETRY); } if (bp->b_bufobj != &vp2->v_bufobj) bp->b_bufobj = &vp2->v_bufobj; bp->b_vp = vp2; bp->b_iooffset = dbtob(bp->b_blkno); bstrategy(bp); - return; + VOP_UNLOCK(vp2); } static void From nobody Thu Dec 2 06:37:19 2021 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 E372A18AAC95; Thu, 2 Dec 2021 06:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4R8H3wltz3FF7; Thu, 2 Dec 2021 06:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6201F18B97; Thu, 2 Dec 2021 06:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B26bJoe096260; Thu, 2 Dec 2021 06:37:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B26bJ4T096259; Thu, 2 Dec 2021 06:37:19 GMT (envelope-from git) Date: Thu, 2 Dec 2021 06:37:19 GMT Message-Id: <202112020637.1B26bJ4T096259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 34aa8c27cd06 - stable/13 - rk_spi: declare support for rk3328 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 34aa8c27cd06276d57323f130ed24962841e6a79 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638427039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fyN3GW5VbdSnzXSzm9nanmcWnDPJ7PxOzRtKkRiJRzE=; b=xNYb8h1IQBXYdUDZqXwac4n6NBWkI3G+1H5c73iQKbzccoz3tJHMl22S/ibDVoGCgOc1rV 1h34EqwaRNbV3FNswWRuVm05TMVpLyqzdr+CB8LW7smzz0HNu5BbEmx10z7NVXH2rNwP6w dTKT6P1xlZKi6Fvzs7OxUBO7tMWMvykpoR5jfAOc1vhRfX6NLJYx+yURutvmWFTM2K37Bz GqFlAkq2oM3u7No0Vcq2xa2HcshGoIvoqHSLp2nsoPO5a+VJqraDhn2ZPwwLIycsN6Y+Lf 2ohAV+ACzyreGieZHY8xk+gqRx73c9knyTeGFwtX/Mnst1Zznl2PjqA8tiF2bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638427039; a=rsa-sha256; cv=none; b=Qph1U8f+eChQDfmntCWYdVA0Jiywx0a6AwiXbqfUa8lYyDNj7xn+xa2mVT26y5ESNpuAyf t0Wso9ZKM81uoAwngUVYj375H80jAZyjl5UvkR72JOPh5ZWl8hFqFPgaHGK/0mFwhiF3WR hqP/O/CJTo+Gf7pORTwDnrTZOJ2jtyQlul2CSWi8VHpBG5QD9SyXg7LKjdP0jxeUJdTHQc vVzH7FzFDbaN7os5KBlI6t5nJPaINpJyEQpHVI4WW4cw80EMV9s0/s12/7y50OEHOr7qx9 WWdJUAJPG5hokeeV4J1YOnL4n7/5EDfKjbubKjRZtymO0r65vFGH9NsiIuArDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=34aa8c27cd06276d57323f130ed24962841e6a79 commit 34aa8c27cd06276d57323f130ed24962841e6a79 Author: Andriy Gapon AuthorDate: 2021-11-25 21:12:11 +0000 Commit: Andriy Gapon CommitDate: 2021-12-02 06:36:46 +0000 rk_spi: declare support for rk3328 Tested on Rock64 using the onboard SPI flash. (cherry picked from commit 8c12ee5021e293c992a7b54215fda1edfbebaa25) --- sys/arm64/rockchip/rk_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm64/rockchip/rk_spi.c b/sys/arm64/rockchip/rk_spi.c index 13e3abb80085..4df1208f40aa 100644 --- a/sys/arm64/rockchip/rk_spi.c +++ b/sys/arm64/rockchip/rk_spi.c @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #define CS_MAX 1 static struct ofw_compat_data compat_data[] = { + { "rockchip,rk3328-spi", 1 }, { "rockchip,rk3399-spi", 1 }, { NULL, 0 } }; From nobody Thu Dec 2 14:15:26 2021 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 90AA518C1335; Thu, 2 Dec 2021 14:15:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4dJt2F6Gz4skW; Thu, 2 Dec 2021 14:15:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0801EE47; Thu, 2 Dec 2021 14:15:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B2EFQlp008840; Thu, 2 Dec 2021 14:15:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B2EFQVp008839; Thu, 2 Dec 2021 14:15:26 GMT (envelope-from git) Date: Thu, 2 Dec 2021 14:15:26 GMT Message-Id: <202112021415.1B2EFQVp008839@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: 344c1bc6e643 - stable/13 - make_dev.9: Fix 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 344c1bc6e643cf2b470c2ff8770057462f44c100 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638454526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7uDpqqeS7aimvq0qZgrgpqg1u3/f8s+xSmCUe+iFCY=; b=YsET9zypRfjwa0mFp9s2wCLHa+y8sk01cEvqWpGJS3mQ7qx2DDfNye7Y0cYErQ0AwDhSSY PaTDtB8UCbEVtW52e03cY+HZdMveuI+omKND9zTg71H6+8phlhImi/E+GNWqV5Kx1CHnuo m9lQrTfzSAIUh5SqgcOVOaXOYg4S0YQ3WzzU6txfE5dbSsM9Ak5Xz9glRAQItsOUCeeXBs 25pc7szQPkRKyxLRzKLsj+WVjnow69Tp+/WrgOsjNaUZY+obStZwWczyYuMTggAfxsSsoW iuD+rkcBmdwlot8AfyREmm7n7cDdUqYdMWU5pw126vqy6ssreK0b1ibSpZUAXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638454526; a=rsa-sha256; cv=none; b=myblxEwhR/YiK+BbBRo6rh1CPafRzPwvLhS0bpcbZUWOiATf0wzysIyHNm8wug5PEmq2aU 3xcgxilWQfkYNeM4Ie8BzDViEyw8xZ9ueNxu2y0Cs/QKaNbztqhAc/3ShBjnYw+6LyTXe1 ZD1LKNjX6lZeNt2YXhFzX9Fk3VaPZVMlBlAhxOBVDc2yjX5pm/1SEf0/IUrsDDS1xGgF1j 8iddx4FF/lyi1rK3hh9DHVP4UGVOBiOe7x2bgXhjfZo1A9q7lHY97GQaC1Wg8jVuW8JAZe XZL1k/L+G/dW03n2DB20+MFkmKTBKKAGmZTpodxU/yyouKbllxIhrvFy7OYsrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=344c1bc6e643cf2b470c2ff8770057462f44c100 commit 344c1bc6e643cf2b470c2ff8770057462f44c100 Author: Mark Johnston AuthorDate: 2021-11-25 16:32:30 +0000 Commit: Mark Johnston CommitDate: 2021-12-02 14:15:01 +0000 make_dev.9: Fix a typo (cherry picked from commit cc7decfcf93be2a9e78923cc9782fd913f70b78e) --- share/man/man9/make_dev.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/make_dev.9 b/share/man/man9/make_dev.9 index fa186e649bd3..cd038a703616 100644 --- a/share/man/man9/make_dev.9 +++ b/share/man/man9/make_dev.9 @@ -292,7 +292,7 @@ prior to calling The .Fn make_dev_alias function is similar to -.Fn make_dev_alias +.Fn make_dev_alias_p but it returns the resulting aliasing .Ft *cdev and may not return an error. From nobody Thu Dec 2 14:15:27 2021 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 B9EE418C148D; Thu, 2 Dec 2021 14:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4dJv2d3lz4sqX; Thu, 2 Dec 2021 14:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39E481ECA8; Thu, 2 Dec 2021 14:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B2EFRKF008865; Thu, 2 Dec 2021 14:15:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B2EFRn7008864; Thu, 2 Dec 2021 14:15:27 GMT (envelope-from git) Date: Thu, 2 Dec 2021 14:15:27 GMT Message-Id: <202112021415.1B2EFRn7008864@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: 2e837779a7ef - stable/13 - link_elf_obj: Process global ifunc relocs after other global relocs 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2e837779a7efe3cd315988de931257d980cc789c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638454527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rpECGlxPM0KimYPu5cJSYP+30tJabtIt1y1Et5EOtWI=; b=cuWBXroBLYbIw8UHxfLWaKZaqV75v1xDjLTlnosYX44xGFg1SlzqGx5GIU5XSab73kLDYM ATBl2U06L67zOoswN3dG/269u214hROPjyClK8kCN5NIvcFa43tuw+twavkVgJ56YNFesI 3ecysFTxvYIE5kRHWegxl1om6M8d6n8fB0g4FjjfK6bZGVBfLJI9yWnAd/K2VQlSxTJzNX nmDkDXgCFJiBr661RloeT4+xjnbhTaDA4cL4J5su3eKQPkvoDZ4WvdX1wlHTxLGhoIWr0h NDJpH1X5j1I4omDKp75QoPgBDVeh9PWDuRMuF5/lA1/AcAJi0PJAnU7TMqkIPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638454527; a=rsa-sha256; cv=none; b=TNt7k+TfnqkPWVb7gwPTFxz/5Qcah6iPWXSMuGaFAQWZLeb4kCgCoOoxU5UaUIFMOSx6GI Vsed2PfWZe2jwYziv6e8GJZReSB+tWZ/b+/yyQDEdJ3N81NM3ZRr8RzODH0g/FmuZpZP4E fj+vhXGiTMZT3Fe2Z7MXrzG31X6/EEPBi+Fqs/RZqwP4s10KnFNfjtr6m16nxqeVSYMAR7 oLCZZPHegAz+dn1hBlSxzZMIQ7Qpt4YP9Cic/XNTKZS2uN/AE+B86iYlbngfHUavxdmiOO uAH5FWJ35YKQogf4HTdTiEijCnsMkaWmm0uLjqzgEnt6DzX8dITu6yqHOOiDJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2e837779a7efe3cd315988de931257d980cc789c commit 2e837779a7efe3cd315988de931257d980cc789c Author: Mark Johnston AuthorDate: 2021-11-25 21:52:17 +0000 Commit: Mark Johnston CommitDate: 2021-12-02 14:15:15 +0000 link_elf_obj: Process global ifunc relocs after other global relocs This is needed to ensure that resolvers that reference global symbols return correct results. Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit b11e6fd75b1bb9d337b0edab14d160ff65b11aae) --- sys/kern/link_elf_obj.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 5c6db11e1937..bafbd9f4c616 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -1321,7 +1321,7 @@ findbase(elf_file_t ef, int sec) } static int -relocate_file(elf_file_t ef) +relocate_file1(elf_file_t ef, bool ifuncs) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -1354,6 +1354,9 @@ relocate_file(elf_file_t ef) /* Local relocs are already done */ if (ELF_ST_BIND(sym->st_info) == STB_LOCAL) continue; + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || + elf_is_ifunc_reloc(rel->r_info)) != ifuncs) + continue; if (elf_reloc(&ef->lf, base, rel, ELF_RELOC_REL, elf_obj_lookup)) { symname = symbol_name(ef, rel->r_info); @@ -1386,6 +1389,9 @@ relocate_file(elf_file_t ef) /* Local relocs are already done */ if (ELF_ST_BIND(sym->st_info) == STB_LOCAL) continue; + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || + elf_is_ifunc_reloc(rela->r_info)) != ifuncs) + continue; if (elf_reloc(&ef->lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup)) { symname = symbol_name(ef, rela->r_info); @@ -1406,6 +1412,17 @@ relocate_file(elf_file_t ef) return (0); } +static int +relocate_file(elf_file_t ef) +{ + int error; + + error = relocate_file1(ef, false); + if (error == 0) + error = relocate_file1(ef, true); + return (error); +} + static int link_elf_lookup_symbol(linker_file_t lf, const char *name, c_linker_sym_t *sym) { From nobody Thu Dec 2 14:15:52 2021 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 C2B9C18C1824; Thu, 2 Dec 2021 14:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4dKP2dXHz4t7Z; Thu, 2 Dec 2021 14:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 184281EE85; Thu, 2 Dec 2021 14:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B2EFqcs009009; Thu, 2 Dec 2021 14:15:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B2EFqOu009008; Thu, 2 Dec 2021 14:15:52 GMT (envelope-from git) Date: Thu, 2 Dec 2021 14:15:52 GMT Message-Id: <202112021415.1B2EFqOu009008@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: e0d7fe1a03d1 - stable/12 - link_elf_obj: Process global ifunc relocs after other global relocs 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: e0d7fe1a03d17b3f6dc03e1079d103ce5a366feb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638454553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t95MnmWI2K8NaQzs1qwQsU8AA15aolDeoUyfLHHcdOE=; b=PEKmMjIlSFg6SklvgoHgNL7/h4j7sf89KF8Y5c+pPN4qxZQEUGOJXktUUFPOJ6goTO7+A5 OestcxQJSZncF+8rOCh2q2UPwCDjUgxkfbd+5/hvvxf/d3IUvopEFG2h0p7CQpADQDRjQA K72NxQQHF+JDmNYSGzFe5AH3D1oOUYvvZL6NMrOVVQOQj+0LCR6KeFvtaniUzOncIOjXSh tmc/FAnc4YotXkT202uqxMYGxKWfzro7bVg1Ubs9BH1MczrnrmX2ylsq/e+c/u15sqTHXF 1C9Ubz68W5LQ2L0/JGQNOH3zn3V32jsL27VE06piYYzHrsauqQLxkyHQJeuMMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638454553; a=rsa-sha256; cv=none; b=Ujqle8wIjmDdRV/z9W79cx131KohCxHERQpotwdE3Ai16slFC5rZ1nYMTmtoMGGCp1fYuY m4pR8APpA1g+/ZqBGrXgvpMwYg5QDKwJwgr19AGHrH3ppa9DmB85NiQUxfG4FUDGkSYqxl 87Xa0eH7qyKjCTME7dBqgHxm5eaL/p845MsXQbsQj6dX4m74874lwkSghL+Jel6hGw5xXM 2NLxGx1RE3524M/a9hR1Gx4mOWXgyQOyAmvqSk/hNc35vlun7X+zD3dHt0Fvx704v+T857 73CA06f78ASiY68R1/1eHFyvYchthmugKPXYYpHPFTvghXKV3oAZp9ockJEkzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e0d7fe1a03d17b3f6dc03e1079d103ce5a366feb commit e0d7fe1a03d17b3f6dc03e1079d103ce5a366feb Author: Mark Johnston AuthorDate: 2021-11-25 21:52:17 +0000 Commit: Mark Johnston CommitDate: 2021-12-02 14:15:42 +0000 link_elf_obj: Process global ifunc relocs after other global relocs This is needed to ensure that resolvers that reference global symbols return correct results. Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit b11e6fd75b1bb9d337b0edab14d160ff65b11aae) --- sys/kern/link_elf_obj.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index c892c14833d6..5b79b0b4c17c 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -1244,7 +1244,7 @@ findbase(elf_file_t ef, int sec) } static int -relocate_file(elf_file_t ef) +relocate_file1(elf_file_t ef, bool ifuncs) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -1278,6 +1278,9 @@ relocate_file(elf_file_t ef) /* Local relocs are already done */ if (ELF_ST_BIND(sym->st_info) == STB_LOCAL) continue; + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || + elf_is_ifunc_reloc(rel->r_info)) != ifuncs) + continue; if (elf_reloc(&ef->lf, base, rel, ELF_RELOC_REL, elf_obj_lookup)) { symname = symbol_name(ef, rel->r_info); @@ -1310,6 +1313,9 @@ relocate_file(elf_file_t ef) /* Local relocs are already done */ if (ELF_ST_BIND(sym->st_info) == STB_LOCAL) continue; + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || + elf_is_ifunc_reloc(rela->r_info)) != ifuncs) + continue; if (elf_reloc(&ef->lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup)) { symname = symbol_name(ef, rela->r_info); @@ -1330,6 +1336,17 @@ relocate_file(elf_file_t ef) return (0); } +static int +relocate_file(elf_file_t ef) +{ + int error; + + error = relocate_file1(ef, false); + if (error == 0) + error = relocate_file1(ef, true); + return (error); +} + static int link_elf_lookup_symbol(linker_file_t lf, const char *name, c_linker_sym_t *sym) { From nobody Thu Dec 2 14:52:20 2021 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 4051018AA731; Thu, 2 Dec 2021 14: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4f7S73hcz3LZ7; Thu, 2 Dec 2021 14:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2EF71F375; Thu, 2 Dec 2021 14:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B2EqKf2061612; Thu, 2 Dec 2021 14:52:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B2EqKP8061611; Thu, 2 Dec 2021 14:52:20 GMT (envelope-from git) Date: Thu, 2 Dec 2021 14:52:20 GMT Message-Id: <202112021452.1B2EqKP8061611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 9e89269ee7e5 - stable/13 - usb/u3g: Add support for Quectel EM05. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9e89269ee7e5f31aa60ae8c645821d4ca08f5ae6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638456741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qHL1ON262trFhqQKYizGsLymeKk1oi77LOrpxXheMo=; b=MTN8Q0l9KGeG8B62PIgngF8HSjmSb+Gq3XhhTHVKW55+NnMO+nrtvTLpbzp4VwKW9WmLIY d79LPY3zjUsGpzudW9brog8KKtWwQkOrRIV+pVHO00uK4psNelmcKJibAtDCiVPbWxGBv9 kNHCCtKYnC883kODWUEBOXl5TsiwfaL9SDR9sYJ1PrQrrF/V+KDBxGiQJZt6HpTlhgAHGL saY3TSlAJU6HSGHOegHe2BvncKOJTzfusiPnrEGbzqLfUUPx9ujL/gUEhH7Me5l5wpuNar dZv6wEvPSZhHWAnI7gRu65Zjyo/1FeC/zHVSjQMFnWbRmJi7esFBorKpfkFLag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638456741; a=rsa-sha256; cv=none; b=NyRZ/qMLjvdTyVrRSAXMeQ12mwvhn5i6McfhAz3TvpFbmuCvacreMK3hWhFWvcPEceu8uf ATtzZMfcoDjirAbZItgJSMdpynnaeifIXSQPC+Oov9Ggw/1qqkoNfb6nEGlVmGlqKFZAxF kOyZMFfRLwJ9JxYObQB/R3AQkc21yCH3TiLugAb7RRe9/ok4miHNsrjZGg3+/eyFTaaKoC QvxVXY5GMg/qTalfgXUXVzcknLVt088DN45Uw238kZCZT1fIFII0ebO2lxsbfNUg01XAqD T7Y2+q7jzUB/7GMsXAJKo2E0rwLazTbSdBrtAl4yi4Y9rasjIKVgxNfs328Z0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9e89269ee7e5f31aa60ae8c645821d4ca08f5ae6 commit 9e89269ee7e5f31aa60ae8c645821d4ca08f5ae6 Author: Hans Petter Selasky AuthorDate: 2021-11-25 14:27:50 +0000 Commit: Hans Petter Selasky CommitDate: 2021-12-02 14:51:46 +0000 usb/u3g: Add support for Quectel EM05. Pull Request: https://github.com/freebsd/freebsd-src/pull/565 Sponsored by: NVIDIA Networking (cherry picked from commit 0229172a65765392f566ae1cdc730615ab504e15) --- sys/dev/usb/serial/u3g.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index fcff316d8d3a..33e6339be85d 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -496,6 +496,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(QUANTA, Q101, 0), U3G_DEV(QUANTA, Q111, 0), U3G_DEV(QUECTEL, EC25, 0), + U3G_DEV(QUECTEL, EM05, 0), U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC313U, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index b3cf80be01a4..383849f5a01d 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -3944,6 +3944,7 @@ product QUANTA RW6815R 0xf003 HP iPAQ rw6815 RNDIS /* Quectel products */ product QUECTEL EC25 0x0125 LTE modem +product QUECTEL EM05 0x0127 LTE modem /* Quickshot products */ product QUICKSHOT STRIKEPAD 0x6238 USB StrikePad From nobody Fri Dec 3 07:26:27 2021 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 71FCA18AD6F2; Fri, 3 Dec 2021 07:26:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J54BX1Qt5z4r91; Fri, 3 Dec 2021 07:26:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111864C10; Fri, 3 Dec 2021 07:26:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B37QRQA082399; Fri, 3 Dec 2021 07:26:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B37QRJZ082398; Fri, 3 Dec 2021 07:26:27 GMT (envelope-from git) Date: Fri, 3 Dec 2021 07:26:27 GMT Message-Id: <202112030726.1B37QRJZ082398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: bab53d35329c - stable/13 - twsi: sort headers, remove unneeded 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bab53d35329c587c953600de6d1dd03d24bdcea7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638516388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pr3RlACRmytVDiRBh/xIB68aRaicxhe2sZs8T5tgVmU=; b=mIMjWV5MbfYczQn3SE+6EwH64UVWiYmrjkEI2qyUDmlbvLU5P7ojFMgs9uEGyBZod+ur5M bL7RhdVeIgHYUIJpuvKLRYlmVLLI1OGSAeK9lbWaahMFjcQz7otFbzwsfhLnzfpuvvn2w4 b7qwHuPgC9LCM/zPcLIZQbWqdymHfHmOSw8zCr8ENYQ0ZSD/vt4T7Z8If40hJDLwe4kvzX OUnujr3wJqrSriwab1RB8aWPI3E12tqKW/YD802nKfuVVMO8qVARS6yALPudjAH3PWqtK5 s4x2dFBg9DpUlAltl/dGJZcNyHoV1QU8StsKskHVZRw3NIqhSC2jghvrydbORQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638516388; a=rsa-sha256; cv=none; b=kU5jStlnrkQ5EeuGbhUOvf4JOUu89/DTPs16NNb6KljL/Vif7xxOCaSbSwngKo2PVDc9UJ ObdnZxjxU6wH7w0lGo/QfESpvJbF44KOU8W94aSocIqkwkpq397CuHmQts653PZlKkubAv COZ+AXTKIUR0vdgfA6day9IVYaGzkQDNEUHlUfgWxKsnQoDpWWCSgNoMXyTVxW/kiN0wK+ F/uwt+E876kTNI9pHIkF8SCGt0pUD/EBFYWvMzv514Lg32EF8Xsht6ivnNNhUkz0EtGeah WJwpP9++QwFEwvefEp5mkwqIgMkZ2nJl76EMFrTdwBJ/4plbzpj8G8V+WAe33Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=bab53d35329c587c953600de6d1dd03d24bdcea7 commit bab53d35329c587c953600de6d1dd03d24bdcea7 Author: Andriy Gapon AuthorDate: 2021-11-26 06:28:41 +0000 Commit: Andriy Gapon CommitDate: 2021-12-03 07:21:36 +0000 twsi: sort headers, remove unneeded (cherry picked from commit 26559dd1770bb49c68f58a5fbcea3b4c96534c94) --- sys/dev/iicbus/twsi/twsi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/dev/iicbus/twsi/twsi.c b/sys/dev/iicbus/twsi/twsi.c index a606c2aefd36..aa5de857c1d9 100644 --- a/sys/dev/iicbus/twsi/twsi.c +++ b/sys/dev/iicbus/twsi/twsi.c @@ -44,22 +44,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include +#include #include #include #include -#include - -#include -#include - #include #include -#include -#include #include From nobody Fri Dec 3 07:26:29 2021 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 AC7DA18AD6F5; Fri, 3 Dec 2021 07:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J54BY27Rkz4qlY; Fri, 3 Dec 2021 07:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A3CB4B35; Fri, 3 Dec 2021 07:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B37QTSo082423; Fri, 3 Dec 2021 07:26:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B37QT7E082422; Fri, 3 Dec 2021 07:26:29 GMT (envelope-from git) Date: Fri, 3 Dec 2021 07:26:29 GMT Message-Id: <202112030726.1B37QT7E082422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 3b7478a7c4df - stable/13 - twsi: add more of status definitions 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b7478a7c4df6111c921a8e88e89a3dc9dae18f9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638516389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnY3OwPI7GKXPxpX/cxS4DJHEJDQ3A3Dg8wJdF3PVbo=; b=fPQHSqO6nTY2j3C/8wz3y2vggE29V6avoRZBEL89PRwBSN8cjekOxIqivKFyqAjyhjIR9B GDfpDADbocxzNC4CYdzyRB6XtGeFrl0iAED4UsRxJBV2/H4aJTU8XwsZpJ2nuq7gWCoIlO YNMJExSywRLv/RoqUxNWRkBfL3uClr/l5OYUvbu+mlxsU/oxf3gl3a9lZmehyhhFzHFsTz sOtW48ezgrgZq+CGfLIQNlDSvi1wL9nWi76TX+F/PJFX8VGrKCQdQlS8KwuP8JXHo74e5B nq1vFV4W/V1TD56CGoks1UZIRbvOc4PbZppqlt+RAk1fPXPw7jIBM3XlWFmf+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638516389; a=rsa-sha256; cv=none; b=DTN75Ta11B5DQmkhMBYl+o06bHAJnalxfupWeZVBGTWCM0zK+lP75XHs9D4wF9KyDKMeAB wceV36T+F1MByzef3uqR5LAfHpY8Cdnw4nuF4h4+i0b5z8Mc+UuOHF8/3/bnEVzlUSGUHd f5HW6kwS33zh5VX8EQKTQT5bb/ormPoNDyvHRNp8JMsF60QU+BuTtpE0tROzh85P3bC7aJ x1UbSRkzYGtwLZgnT9rk67WwRTLFr2uudhsgYaMi7wKC1FFeKZzy0VIlHWTFo6f1LCdF3F BhR4T+6ZHHcj1MTcXv98G6YqqCtnUwJhaprztWmMTZFiy48jUBberOZK7keR6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=3b7478a7c4df6111c921a8e88e89a3dc9dae18f9 commit 3b7478a7c4df6111c921a8e88e89a3dc9dae18f9 Author: Andriy Gapon AuthorDate: 2021-11-26 06:30:22 +0000 Commit: Andriy Gapon CommitDate: 2021-12-03 07:23:58 +0000 twsi: add more of status definitions For completeness and for future use. (cherry picked from commit de86f339cdda0a10130033ff1771fb13cfacd9d0) --- sys/dev/iicbus/twsi/twsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/iicbus/twsi/twsi.c b/sys/dev/iicbus/twsi/twsi.c index aa5de857c1d9..84bf0223fba7 100644 --- a/sys/dev/iicbus/twsi/twsi.c +++ b/sys/dev/iicbus/twsi/twsi.c @@ -68,16 +68,19 @@ __FBSDID("$FreeBSD$"); #define TWSI_CONTROL_TWSIEN (1 << 6) #define TWSI_CONTROL_INTEN (1 << 7) +#define TWSI_STATUS_BUS_ERROR 0x00 #define TWSI_STATUS_START 0x08 #define TWSI_STATUS_RPTD_START 0x10 #define TWSI_STATUS_ADDR_W_ACK 0x18 #define TWSI_STATUS_ADDR_W_NACK 0x20 #define TWSI_STATUS_DATA_WR_ACK 0x28 #define TWSI_STATUS_DATA_WR_NACK 0x30 +#define TWSI_STATUS_ARBITRATION_LOST 0x38 #define TWSI_STATUS_ADDR_R_ACK 0x40 #define TWSI_STATUS_ADDR_R_NACK 0x48 #define TWSI_STATUS_DATA_RD_ACK 0x50 #define TWSI_STATUS_DATA_RD_NOACK 0x58 +#define TWSI_STATUS_IDLE 0xf8 #define TWSI_DEBUG #undef TWSI_DEBUG From nobody Fri Dec 3 07:26:30 2021 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 2604818AD8BA; Fri, 3 Dec 2021 07:26:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J54BZ4dQXz4r57; Fri, 3 Dec 2021 07:26:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CB1E4BF3; Fri, 3 Dec 2021 07:26:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B37QU2o082447; Fri, 3 Dec 2021 07:26:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B37QU45082446; Fri, 3 Dec 2021 07:26:30 GMT (envelope-from git) Date: Fri, 3 Dec 2021 07:26:30 GMT Message-Id: <202112030726.1B37QU45082446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: c141cad41d94 - stable/13 - twsi: remove write-only softc field 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c141cad41d949b344c177fc838f0828442b61a14 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638516390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FPwzOtgZQmRWrujL5VxHmu21VPXu+kRLEX7E7tZ46h8=; b=yDVDEaeZj3bDSC8tTnuAwDBmBx5E/rAQNnO1abZlwb92EtAYPZ6U7Y/iJLJCZtkAJZGi6v iVRU68CFf2bTpLYvsHGF6GR9u7PGX/97LYi24284jxutONMgzAra9AG1SVeqbfOh4Nhxif 01DafyxkiYyZdMyip/+BJsHal/oFuNIICSL/CmQGn8hNQ7MZ0j7ooJsQ43yt84UmAla0tC lE3PVdvx+t36eC5chGmzhnbNt1kkytTAqFiEwjaR9SMkKWYSrdhaJUoiksrfyC+4FSrfpX rcpIio01QvASV+c7QOFyRNTI250shCDRqh0GCtPugtJBWSel1RP5LAHbdHaNkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638516390; a=rsa-sha256; cv=none; b=yAX32cIm2u5be7HzITMzFk0hnlCsjW4YErZfPoXY4eFV12BZCG2Owg3EvjrKaB64XLlyff fJEXsi9X4zHo5Kgpo//ZRE6Jna5cxymOLGlGg1P03+5W/BLgo58bdHf673KoMD7nn9YLnI zwsH3VigPSfZTFIzJRnYbMG8Q1ptesDHLiUlMMfxJavu7vjWAorGampdnUa+lSCce7MGX+ bRov4f+H8aMCsCSmQYkHmbmcESEKSoup4g31VC6r6g2Cc34Vg6hjb0/1C/pUniwc9Emdno bBkpENiI/sGcQJ4f7GAtfZzUHXHN7RwCBAoMopUgGfDXdNntPCzYRIrBkMnhtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=c141cad41d949b344c177fc838f0828442b61a14 commit c141cad41d949b344c177fc838f0828442b61a14 Author: Andriy Gapon AuthorDate: 2021-11-26 06:45:12 +0000 Commit: Andriy Gapon CommitDate: 2021-12-03 07:24:11 +0000 twsi: remove write-only softc field (cherry picked from commit f00bc54f62c455c7ed44afee736c3c64873a305a) --- sys/dev/iicbus/twsi/a10_twsi.c | 2 -- sys/dev/iicbus/twsi/twsi.h | 1 - 2 files changed, 3 deletions(-) diff --git a/sys/dev/iicbus/twsi/a10_twsi.c b/sys/dev/iicbus/twsi/a10_twsi.c index 17f551f27234..7554db0fbc94 100644 --- a/sys/dev/iicbus/twsi/a10_twsi.c +++ b/sys/dev/iicbus/twsi/a10_twsi.c @@ -121,8 +121,6 @@ a10_twsi_attach(device_t dev) sc->reg_baud_rate = TWI_CCR; sc->reg_soft_reset = TWI_SRST; - sc->need_ack = true; - if (ofw_bus_is_compatible(dev, "allwinner,sun6i-a31-i2c") || ofw_bus_is_compatible(dev, "allwinner,sun6i-a83t-i2c")) sc->iflag_w1c = true; diff --git a/sys/dev/iicbus/twsi/twsi.h b/sys/dev/iicbus/twsi/twsi.h index 631486fb3f0c..b10ce45be6f4 100644 --- a/sys/dev/iicbus/twsi/twsi.h +++ b/sys/dev/iicbus/twsi/twsi.h @@ -65,7 +65,6 @@ struct twsi_softc { int transfer; int error; uint32_t control_val; - bool need_ack; bool iflag_w1c; bus_size_t reg_data; From nobody Fri Dec 3 07:26:31 2021 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 BD02D18AD8C8; Fri, 3 Dec 2021 07:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J54Bb6HpPz4r3n; Fri, 3 Dec 2021 07:26:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71D9E4C11; Fri, 3 Dec 2021 07:26:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B37QVJ0082471; Fri, 3 Dec 2021 07:26:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B37QVDZ082470; Fri, 3 Dec 2021 07:26:31 GMT (envelope-from git) Date: Fri, 3 Dec 2021 07:26:31 GMT Message-Id: <202112030726.1B37QVDZ082470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: a138038f6934 - stable/13 - twsi: compile in support for debug messages, disabled by default 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a138038f69342b30d45d9da056438e7e4e3a1d56 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638516392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oJv8r6xN38Tsl6R0NQ+beX2YNjdBsiA9mbkYVLgbEMo=; b=YGB4+GpUnbnNZZVWWiP5Nm6DNtAsI4esk+sXGtSdM2ckpEck3m9BGhKBigQyoPYDrJ7jSi NM+vf58cIdBey1HV10Eq1/2YlAfwl7Z2NCiJRMoOA6Q/vBebQpiJD1rYRaF7gmjd9CPVR1 jG284LvP5pryUkDf0yFil5uj1fod0hGC4KFhHt8SVHVwNbfjNsHgfqkhcSxDOihRacpy6R BIU+zJVGyug2g4nt9ngh1kcXAHBLyF2O+anshvOv1RODuoZEkot8BNkNpxEA9sTl6zwB+6 GuSzgmTkTHI6AAp5HHZ8ORtrYDXjDGeFUSxspsdV6hNH5ljVJ43KYwoze+kcew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638516392; a=rsa-sha256; cv=none; b=Gv46RurFMq6bUn21a9D4kxd2z4iAOlLlnOIty3Z2XREAvt7Rfqow0wYU5fJOJn4XwJyMV4 8iuahvmnxy6CmUuRpiHZqXxqxHa/sxGzn2ZJa1OMaEa9K0ZsSnuktZ4O9dyn5ZZgDNYZgL Rk92yEaGY4m59tvNIxhfVicNLV4BCoHgAfZuWJudqZbpIPvM9kH1anfwCUOOVjoLfXwf7k K874Fhywury24gtzRsfFJ1MADl5u+mmUekr2AZ+YJUS+4dVro2w4dURL+Y9ebSM+wNOrIA 59Y2n8LfUjKDpymkJLzdFnqZCNJ50X7VLEAvi3AxYlPvhRGe9wCwHeHsOhPxFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=a138038f69342b30d45d9da056438e7e4e3a1d56 commit a138038f69342b30d45d9da056438e7e4e3a1d56 Author: Andriy Gapon AuthorDate: 2021-11-26 06:52:56 +0000 Commit: Andriy Gapon CommitDate: 2021-12-03 07:24:22 +0000 twsi: compile in support for debug messages, disabled by default Debug messages can now be enabled per driver instance via a new sysctl. Also, debug messages in TWSI_READ and TWSI_WRITE require debug level greater than 1 as they are mostly redundant because callers of those functions already log most interesting results. NB: the twsi drivers call their device iichb, so the new sysctl will appear under dev.iichb.N. (cherry picked from commit a2793d6182256b8edf647c11c642ad3c7c83809e) --- sys/dev/iicbus/twsi/twsi.c | 136 ++++++++++++++++++++++++--------------------- sys/dev/iicbus/twsi/twsi.h | 1 + 2 files changed, 75 insertions(+), 62 deletions(-) diff --git a/sys/dev/iicbus/twsi/twsi.c b/sys/dev/iicbus/twsi/twsi.c index 84bf0223fba7..49fe608473b2 100644 --- a/sys/dev/iicbus/twsi/twsi.c +++ b/sys/dev/iicbus/twsi/twsi.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -85,11 +86,8 @@ __FBSDID("$FreeBSD$"); #define TWSI_DEBUG #undef TWSI_DEBUG -#ifdef TWSI_DEBUG -#define debugf(dev, fmt, args...) device_printf(dev, "%s: " fmt, __func__, ##args) -#else -#define debugf(dev, fmt, args...) -#endif +#define debugf(sc, fmt, args...) if ((sc)->debug) \ + device_printf((sc)->dev, "%s: " fmt, __func__, ##args) static struct resource_spec res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -103,7 +101,8 @@ TWSI_READ(struct twsi_softc *sc, bus_size_t off) uint32_t val; val = bus_read_4(sc->res[0], off); - debugf(sc->dev, "read %x from %lx\n", val, off); + if (sc->debug > 1) + debugf(sc, "read %x from %lx\n", val, off); return (val); } @@ -111,7 +110,8 @@ static __inline void TWSI_WRITE(struct twsi_softc *sc, bus_size_t off, uint32_t val) { - debugf(sc->dev, "Writing %x to %lx\n", val, off); + if (sc->debug > 1) + debugf(sc, "Writing %x to %lx\n", val, off); bus_write_4(sc->res[0], off, val); } @@ -121,10 +121,10 @@ twsi_control_clear(struct twsi_softc *sc, uint32_t mask) uint32_t val; val = TWSI_READ(sc, sc->reg_control); - debugf(sc->dev, "read val=%x\n", val); + debugf(sc, "read val=%x\n", val); val &= ~(TWSI_CONTROL_STOP | TWSI_CONTROL_START); val &= ~mask; - debugf(sc->dev, "write val=%x\n", val); + debugf(sc, "write val=%x\n", val); TWSI_WRITE(sc, sc->reg_control, val); } @@ -134,10 +134,10 @@ twsi_control_set(struct twsi_softc *sc, uint32_t mask) uint32_t val; val = TWSI_READ(sc, sc->reg_control); - debugf(sc->dev, "read val=%x\n", val); + debugf(sc, "read val=%x\n", val); val &= ~(TWSI_CONTROL_STOP | TWSI_CONTROL_START); val |= mask; - debugf(sc->dev, "write val=%x\n", val); + debugf(sc, "write val=%x\n", val); TWSI_WRITE(sc, sc->reg_control, val); } @@ -166,13 +166,13 @@ twsi_poll_ctrl(struct twsi_softc *sc, int timeout, uint32_t mask) { timeout /= 10; - debugf(sc->dev, "Waiting for ctrl reg to match mask %x\n", mask); + debugf(sc, "Waiting for ctrl reg to match mask %x\n", mask); while (!(TWSI_READ(sc, sc->reg_control) & mask)) { DELAY(10); if (--timeout < 0) return (timeout); } - debugf(sc->dev, "done\n"); + debugf(sc, "done\n"); return (0); } @@ -196,11 +196,11 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, int32_t mask, /* read IFLG to know if it should be cleared later; from NBSD */ iflg_set = TWSI_READ(sc, sc->reg_control) & TWSI_CONTROL_IFLG; - debugf(dev, "send start\n"); + debugf(sc, "send start\n"); twsi_control_set(sc, TWSI_CONTROL_START); if (mask == TWSI_STATUS_RPTD_START && iflg_set) { - debugf(dev, "IFLG set, clearing (mask=%x)\n", mask); + debugf(sc, "IFLG set, clearing (mask=%x)\n", mask); twsi_clear_iflg(sc); } @@ -211,16 +211,16 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, int32_t mask, DELAY(1000); if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf(dev, "timeout sending %sSTART condition\n", + debugf(sc, "timeout sending %sSTART condition\n", mask == TWSI_STATUS_START ? "" : "repeated "); return (IIC_ETIMEOUT); } status = TWSI_READ(sc, sc->reg_status); - debugf(dev, "status=%x\n", status); + debugf(sc, "status=%x\n", status); if (status != mask) { - debugf(dev, "wrong status (%02x) after sending %sSTART condition\n", + debugf(sc, "wrong status (%02x) after sending %sSTART condition\n", status, mask == TWSI_STATUS_START ? "" : "repeated "); return (IIC_ESTATUS); } @@ -230,7 +230,7 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, int32_t mask, DELAY(1000); if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf(dev, "timeout sending slave address (timeout=%d)\n", timeout); + debugf(sc, "timeout sending slave address (timeout=%d)\n", timeout); return (IIC_ETIMEOUT); } @@ -238,7 +238,7 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, int32_t mask, status = TWSI_READ(sc, sc->reg_status); if (status != (read_access ? TWSI_STATUS_ADDR_R_ACK : TWSI_STATUS_ADDR_W_ACK)) { - debugf(dev, "no ACK (status: %02x) after sending slave address\n", + debugf(sc, "no ACK (status: %02x) after sending slave address\n", status); return (IIC_ENOACK); } @@ -264,7 +264,7 @@ twsi_calc_baud_rate(struct twsi_softc *sc, const u_int target, if (clk_get_freq(sc->clk_core, &clk) < 0) return (-1); - debugf(sc->dev, "Bus clock is at %ju\n", clk); + debugf(sc, "Bus clock is at %ju\n", clk); for (n = 0; n < 8; n++) { for (m = 0; m < 16; m++) { @@ -306,23 +306,23 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) case IIC_SLOW: case IIC_FAST: param = sc->baud_rate[speed].param; - debugf(dev, "Using IIC_FAST mode with speed param=%x\n", param); + debugf(sc, "Using IIC_FAST mode with speed param=%x\n", param); break; case IIC_FASTEST: case IIC_UNKNOWN: default: param = sc->baud_rate[IIC_FAST].param; - debugf(dev, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param); + debugf(sc, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param); break; } #ifdef EXT_RESOURCES } #endif - debugf(dev, "Using clock param=%x\n", param); + debugf(sc, "Using clock param=%x\n", param); mtx_lock(&sc->mutex); - TWSI_WRITE(sc, sc->reg_soft_reset, 0x0); + TWSI_WRITE(sc, sc->reg_soft_reset, 0x1); TWSI_WRITE(sc, sc->reg_baud_rate, param); TWSI_WRITE(sc, sc->reg_control, TWSI_CONTROL_TWSIEN); DELAY(1000); @@ -338,7 +338,7 @@ twsi_stop(device_t dev) sc = device_get_softc(dev); - debugf(dev, "%s\n", __func__); + debugf(sc, "%s\n", __func__); mtx_lock(&sc->mutex); twsi_control_clear(sc, TWSI_CONTROL_ACK); twsi_control_set(sc, TWSI_CONTROL_STOP); @@ -360,7 +360,7 @@ twsi_repeated_start(device_t dev, u_char slave, int timeout) sc = device_get_softc(dev); - debugf(dev, "%s: slave=%x\n", __func__, slave); + debugf(sc, "%s: slave=%x\n", __func__, slave); mtx_lock(&sc->mutex); rv = twsi_locked_start(dev, sc, TWSI_STATUS_RPTD_START, slave, timeout); @@ -384,7 +384,7 @@ twsi_start(device_t dev, u_char slave, int timeout) sc = device_get_softc(dev); - debugf(dev, "%s: slave=%x\n", __func__, slave); + debugf(sc, "%s: slave=%x\n", __func__, slave); mtx_lock(&sc->mutex); rv = twsi_locked_start(dev, sc, TWSI_STATUS_START, slave, timeout); mtx_unlock(&sc->mutex); @@ -422,7 +422,7 @@ twsi_read(device_t dev, char *buf, int len, int *read, int last, int delay) DELAY(1000); if (twsi_poll_ctrl(sc, delay, TWSI_CONTROL_IFLG)) { - debugf(dev, "timeout reading data (delay=%d)\n", delay); + debugf(sc, "timeout reading data (delay=%d)\n", delay); rv = IIC_ETIMEOUT; goto out; } @@ -430,7 +430,7 @@ twsi_read(device_t dev, char *buf, int len, int *read, int last, int delay) status = TWSI_READ(sc, sc->reg_status); if (status != (last_byte ? TWSI_STATUS_DATA_RD_NOACK : TWSI_STATUS_DATA_RD_ACK)) { - debugf(dev, "wrong status (%02x) while reading\n", status); + debugf(sc, "wrong status (%02x) while reading\n", status); rv = IIC_ESTATUS; goto out; } @@ -461,14 +461,14 @@ twsi_write(device_t dev, const char *buf, int len, int *sent, int timeout) twsi_clear_iflg(sc); DELAY(1000); if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf(dev, "timeout writing data (timeout=%d)\n", timeout); + debugf(sc, "timeout writing data (timeout=%d)\n", timeout); rv = IIC_ETIMEOUT; goto out; } status = TWSI_READ(sc, sc->reg_status); if (status != TWSI_STATUS_DATA_WR_ACK) { - debugf(dev, "wrong status (%02x) while writing\n", status); + debugf(sc, "wrong status (%02x) while writing\n", status); rv = IIC_ESTATUS; goto out; } @@ -495,8 +495,8 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) sc->control_val = TWSI_CONTROL_TWSIEN | TWSI_CONTROL_INTEN | TWSI_CONTROL_ACK; TWSI_WRITE(sc, sc->reg_control, sc->control_val); - debugf(dev, "transmitting %d messages\n", nmsgs); - debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); + debugf(sc, "transmitting %d messages\n", nmsgs); + debugf(sc, "status=%x\n", TWSI_READ(sc, sc->reg_status)); sc->nmsgs = nmsgs; sc->msgs = msgs; sc->msg_idx = 0; @@ -504,7 +504,7 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) #ifdef TWSI_DEBUG for (int i = 0; i < nmsgs; i++) - debugf(sc->dev, "msg %d is %d bytes long\n", i, msgs[i].len); + debugf(sc, "msg %d is %d bytes long\n", i, msgs[i].len); #endif /* Send start and re-enable interrupts */ sc->control_val = TWSI_CONTROL_TWSIEN | @@ -515,17 +515,17 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) while (sc->error == 0 && sc->transfer != 0) { tsleep_sbt(sc, 0, "twsi", SBT_1MS * 30, SBT_1MS, 0); } - debugf(sc->dev, "pause finish\n"); + debugf(sc, "pause finish\n"); if (sc->error) { - debugf(sc->dev, "Error, aborting (%d)\n", sc->error); + debugf(sc, "Error, aborting (%d)\n", sc->error); TWSI_WRITE(sc, sc->reg_control, 0); } /* Disable module and interrupts */ - debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); + debugf(sc, "status=%x\n", TWSI_READ(sc, sc->reg_status)); TWSI_WRITE(sc, sc->reg_control, 0); - debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); + debugf(sc, "status=%x\n", TWSI_READ(sc, sc->reg_status)); return (sc->error); } @@ -539,16 +539,16 @@ twsi_intr(void *arg) sc = arg; - debugf(sc->dev, "Got interrupt Current msg=%x\n", sc->msg_idx); + debugf(sc, "Got interrupt Current msg=%x\n", sc->msg_idx); status = TWSI_READ(sc, sc->reg_status); - debugf(sc->dev, "reg control=%x\n", TWSI_READ(sc, sc->reg_control)); + debugf(sc, "reg control=%x\n", TWSI_READ(sc, sc->reg_control)); switch (status) { case TWSI_STATUS_START: case TWSI_STATUS_RPTD_START: /* Transmit the address */ - debugf(sc->dev, "Send the address (%x)", sc->msgs[sc->msg_idx].slave); + debugf(sc, "Send the address (%x)", sc->msgs[sc->msg_idx].slave); if (sc->msgs[sc->msg_idx].flags & IIC_M_RD) TWSI_WRITE(sc, sc->reg_data, @@ -560,10 +560,10 @@ twsi_intr(void *arg) break; case TWSI_STATUS_ADDR_W_ACK: - debugf(sc->dev, "Ack received after transmitting the address (write)\n"); + debugf(sc, "Ack received after transmitting the address (write)\n"); /* Directly send the first byte */ sc->sent_bytes = 1; - debugf(sc->dev, "Sending byte 0 (of %d) = %x\n", + debugf(sc, "Sending byte 0 (of %d) = %x\n", sc->msgs[sc->msg_idx].len, sc->msgs[sc->msg_idx].buf[0]); TWSI_WRITE(sc, sc->reg_data, sc->msgs[sc->msg_idx].buf[0]); @@ -572,7 +572,7 @@ twsi_intr(void *arg) break; case TWSI_STATUS_ADDR_R_ACK: - debugf(sc->dev, "Ack received after transmitting the address (read)\n"); + debugf(sc, "Ack received after transmitting the address (read)\n"); sc->recv_bytes = 0; TWSI_WRITE(sc, sc->reg_control, sc->control_val); @@ -580,7 +580,7 @@ twsi_intr(void *arg) case TWSI_STATUS_ADDR_W_NACK: case TWSI_STATUS_ADDR_R_NACK: - debugf(sc->dev, "No ack received after transmitting the address\n"); + debugf(sc, "No ack received after transmitting the address\n"); sc->transfer = 0; sc->error = IIC_ENOACK; sc->control_val = 0; @@ -588,29 +588,29 @@ twsi_intr(void *arg) break; case TWSI_STATUS_DATA_WR_ACK: - debugf(sc->dev, "Ack received after transmitting data\n"); + debugf(sc, "Ack received after transmitting data\n"); if (sc->sent_bytes == sc->msgs[sc->msg_idx].len) { - debugf(sc->dev, "Done sending all the bytes for msg %d\n", sc->msg_idx); + debugf(sc, "Done sending all the bytes for msg %d\n", sc->msg_idx); /* Send stop, no interrupts on stop */ if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP)) { - debugf(sc->dev, "Done TX data, send stop\n"); + debugf(sc, "Done TX data, send stop\n"); TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_STOP); } else { - debugf(sc->dev, "Done TX data with NO_STOP\n"); + debugf(sc, "Done TX data with NO_STOP\n"); TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); } sc->msg_idx++; if (sc->msg_idx == sc->nmsgs) { - debugf(sc->dev, "transfer_done=1\n"); + debugf(sc, "transfer_done=1\n"); transfer_done = 1; sc->error = 0; } else { - debugf(sc->dev, "Send repeated start\n"); + debugf(sc, "Send repeated start\n"); TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); } } else { - debugf(sc->dev, "Sending byte %d (of %d) = %x\n", + debugf(sc, "Sending byte %d (of %d) = %x\n", sc->sent_bytes, sc->msgs[sc->msg_idx].len, sc->msgs[sc->msg_idx].buf[sc->sent_bytes]); @@ -623,18 +623,18 @@ twsi_intr(void *arg) break; case TWSI_STATUS_DATA_RD_ACK: - debugf(sc->dev, "Ack received after receiving data\n"); + debugf(sc, "Ack received after receiving data\n"); sc->msgs[sc->msg_idx].buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); - debugf(sc->dev, "msg_len=%d recv_bytes=%d\n", sc->msgs[sc->msg_idx].len, sc->recv_bytes); + debugf(sc, "msg_len=%d recv_bytes=%d\n", sc->msgs[sc->msg_idx].len, sc->recv_bytes); /* If we only have one byte left, disable ACK */ if (sc->msgs[sc->msg_idx].len - sc->recv_bytes == 1) sc->control_val &= ~TWSI_CONTROL_ACK; if (sc->msgs[sc->msg_idx].len == sc->recv_bytes) { - debugf(sc->dev, "Done with msg %d\n", sc->msg_idx); + debugf(sc, "Done with msg %d\n", sc->msg_idx); sc->msg_idx++; if (sc->msg_idx == sc->nmsgs - 1) { - debugf(sc->dev, "No more msgs\n"); + debugf(sc, "No more msgs\n"); transfer_done = 1; sc->error = 0; } @@ -645,12 +645,12 @@ twsi_intr(void *arg) case TWSI_STATUS_DATA_RD_NOACK: if (sc->msgs[sc->msg_idx].len - sc->recv_bytes == 1) { sc->msgs[sc->msg_idx].buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); - debugf(sc->dev, "Done RX data, send stop (2)\n"); + debugf(sc, "Done RX data, send stop (2)\n"); if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP)) TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_STOP); } else { - debugf(sc->dev, "No ack when receiving data, sending stop anyway\n"); + debugf(sc, "No ack when receiving data, sending stop anyway\n"); if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP)) TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_STOP); @@ -661,14 +661,14 @@ twsi_intr(void *arg) break; default: - debugf(sc->dev, "status=%x hot handled\n", status); + debugf(sc, "status=%x hot handled\n", status); sc->transfer = 0; sc->error = IIC_EBUSERR; sc->control_val = 0; wakeup(sc); break; } - debugf(sc->dev, "Refresh reg_control\n"); + debugf(sc, "Refresh reg_control\n"); /* * Newer Allwinner chips clear IFLG after writing 1 to it. @@ -676,7 +676,7 @@ twsi_intr(void *arg) TWSI_WRITE(sc, sc->reg_control, sc->control_val | (sc->iflag_w1c ? TWSI_CONTROL_IFLG : 0)); - debugf(sc->dev, "Done with interrupts\n\n"); + debugf(sc, "Done with interrupts\n\n"); if (transfer_done == 1) { sc->transfer = 0; wakeup(sc); @@ -701,6 +701,9 @@ int twsi_attach(device_t dev) { struct twsi_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; sc = device_get_softc(dev); sc->dev = dev; @@ -713,6 +716,15 @@ twsi_attach(device_t dev) return (ENXIO); } +#ifdef TWSI_DEBUG + sc->debug = 1; +#endif + ctx = device_get_sysctl_ctx(dev); + tree_node = device_get_sysctl_tree(dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "debug", CTLFLAG_RWTUN, + &sc->debug, 0, "Set debug level (zero to disable)"); + /* Attach the iicbus. */ if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) { device_printf(dev, "could not allocate iicbus instance\n"); diff --git a/sys/dev/iicbus/twsi/twsi.h b/sys/dev/iicbus/twsi/twsi.h index b10ce45be6f4..ed0ea72ab819 100644 --- a/sys/dev/iicbus/twsi/twsi.h +++ b/sys/dev/iicbus/twsi/twsi.h @@ -64,6 +64,7 @@ struct twsi_softc { uint16_t recv_bytes; int transfer; int error; + int debug; uint32_t control_val; bool iflag_w1c;