From nobody Mon Jul 14 00:29:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgNVC6rfFz61hXK; Mon, 14 Jul 2025 00:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgNVC3NPpz3s0l; Mon, 14 Jul 2025 00:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752452947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7fUnhZAWzjaA4FdGkzeZFiZ6k/yKje6BvXedS0OTQKY=; b=pbh3r3SdgFJ+a6qPAZ+V1fCq3YYzex0rruyPJoAsdZQrZTBWRpDHe4x9kETpRBVxuoAAPL myFLzdxcrJsfW2X7zwzPW6UzpCoAz3p7x5n/0JXn43+jB5/6ydCDhJZYINOF89S/Vwcoji PzfGlFSbkpm0WBj/B+iUS/cCxoe7hPXKHRrdkThOkMS69KpeFDarP6z0vIOEUiI1TpYcUC 56rB8eTRve2Azk8sIIKMdem+Wa45q+10FNLVyW/30UK34rYKWUBqMi5907a4vluUzi5F7z eFyVg+yqI7r1JvxvSs5I8xZPQfvaoCPDWOcSLZkPETnDDRuh0U0rs6Zhab3TGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752452947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7fUnhZAWzjaA4FdGkzeZFiZ6k/yKje6BvXedS0OTQKY=; b=eVWG5GfeKl2MMJu9FA5zOvpONyHhe1ngQXJzvOXSOo1BllkbP/yjK/L1opmwV7K9tBZq46 2P4fGwgFq9zjiBYMydCS+uMAuZWtwohO5b++FqkeIZBuujWpRQXciSVbljhZPcwXOS2Bez spINOObYkSAJM2zE3vOys4bsyGomYcbZ1ENrc5OaBXMHaImuyS7H8M9KorlpIrLat07HXt Anf4jUEpsOvhJ/xJpLBMWVhk10z6F1p37ggz0XouEV7q3QLcl67n6kLM36CBK2Nn5O8BYk kKz/iw1z9X1fWjBzJ8pyokpA5+BN6ELt+EoZosysH0wJU1U7ldcRoud81OnZcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752452947; a=rsa-sha256; cv=none; b=MvqXsvqqvlV5KQ1SA2w8220zu3ZMM5tqNG0Iq5uiKSUkeQcyg8Lo4gq49kBhhcADzrqZAp BEqd5nQovcHeBVrypgvJFgsObtKn2KzFyL7yp7ukkf8I8hL+C8c4qA0UpvCdSqWE5Y2UCc InwPkDZn44pGrxl1GHWQMI2QJMVk/VDGD41sYELDANqXLztrCYNU5MLiSVSHePKWbZwd+U DB67gwBi5ynRd6qi1oLRy5IyFe5X8VYNAfo+kYcXAyaddxdNwQ2+I7i2cRd4m3csEv+Pm7 V/fPNYVA1hCL4uFzmRv5InLSPOKJ1in54HdnBqyw9Z1bbOb4m3qh8y5DC9jOsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgNVC2r4ZzXKQ; Mon, 14 Jul 2025 00:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56E0T7Us022904; Mon, 14 Jul 2025 00:29:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56E0T7GY022901; Mon, 14 Jul 2025 00:29:07 GMT (envelope-from git) Date: Mon, 14 Jul 2025 00:29:07 GMT Message-Id: <202507140029.56E0T7GY022901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: b87aa791533f - main - amd64 pmap: simplify recent changes to pmap_enter_pde() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b87aa791533fd3fc8096faa837264761ed7f4a8c Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=b87aa791533fd3fc8096faa837264761ed7f4a8c commit b87aa791533fd3fc8096faa837264761ed7f4a8c Author: Alan Cox AuthorDate: 2025-07-07 20:29:40 +0000 Commit: Alan Cox CommitDate: 2025-07-14 00:23:49 +0000 amd64 pmap: simplify recent changes to pmap_enter_pde() When pmap_enter_pde() removes an existing 2MB page mapping within the kernel address space, do not remap the kernel page table page since it will shortly be unmapped. Simply zero it. Eliminate an unnecessary conditional refcount decrement on what must be a kernel page table page. (We only utilize this refcount on user-space page table pages.) Convert an assertion from a panic to a KASSERT. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51235 --- sys/amd64/amd64/pmap.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index fd02d1ad6690..c3e3a91b20ec 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1336,7 +1336,7 @@ static pdp_entry_t *pmap_pti_pdpe(vm_offset_t va); static pd_entry_t *pmap_pti_pde(vm_offset_t va); static void pmap_pti_wire_pte(void *pte); static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - bool remove_pt, struct spglist *free, struct rwlock **lockp); + bool demote_kpde, struct spglist *free, struct rwlock **lockp); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, pd_entry_t ptepde, struct spglist *free, struct rwlock **lockp); static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); @@ -6165,8 +6165,7 @@ pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * pmap_remove_kernel_pde: Remove a kernel superpage mapping. */ static void -pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, - bool remove_pt) +pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) { pd_entry_t newpde; vm_paddr_t mptepa; @@ -6174,12 +6173,8 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if (remove_pt) - mpte = pmap_remove_pt_page(pmap, va); - else - mpte = vm_radix_lookup(&pmap->pm_root, pmap_pde_pindex(va)); - if (mpte == NULL) - panic("pmap_remove_kernel_pde: Missing pt page."); + mpte = pmap_remove_pt_page(pmap, va); + KASSERT(mpte != NULL, ("pmap_remove_kernel_pde: missing pt page")); mptepa = VM_PAGE_TO_PHYS(mpte); newpde = mptepa | X86_PG_M | X86_PG_A | X86_PG_RW | X86_PG_V; @@ -6209,7 +6204,7 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * pmap_remove_pde: do the things to unmap a superpage in a process */ static int -pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool remove_pt, +pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool demote_kpde, struct spglist *free, struct rwlock **lockp) { struct md_page *pvh; @@ -6249,9 +6244,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool remove_pt, pmap_delayed_invl_page(m); } } - if (pmap == kernel_pmap) { - pmap_remove_kernel_pde(pmap, pdq, sva, remove_pt); - } else { + if (pmap != kernel_pmap) { mpte = pmap_remove_pt_page(pmap, sva); if (mpte != NULL) { KASSERT(vm_page_any_valid(mpte), @@ -6262,6 +6255,14 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool remove_pt, mpte->ref_count = 0; pmap_add_delayed_free_list(mpte, free, false); } + } else if (demote_kpde) { + pmap_remove_kernel_pde(pmap, pdq, sva); + } else { + mpte = vm_radix_lookup(&pmap->pm_root, pmap_pde_pindex(sva)); + if (vm_page_any_valid(mpte)) { + mpte->valid = 0; + pmap_zero_page(mpte); + } } return (pmap_unuse_pt(pmap, sva, *pmap_pdpe(pmap, sva), free)); } @@ -7573,8 +7574,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, * the mapping is not from kernel_pmap, then * a reserved PT page could be freed. */ - (void)pmap_remove_pde(pmap, pde, va, - pmap != kernel_pmap, &free, lockp); + (void)pmap_remove_pde(pmap, pde, va, false, &free, + lockp); if ((oldpde & PG_G) == 0) pmap_invalidate_pde_page(pmap, va, oldpde); } else { @@ -7584,10 +7585,9 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, * before any changes to mappings are * made. Abort on failure. */ - mt = PHYS_TO_VM_PAGE(*pde & PG_FRAME); - if (pmap_insert_pt_page(pmap, mt, false, false)) { - if (pdpg != NULL) - pdpg->ref_count--; + mt = PHYS_TO_VM_PAGE(oldpde & PG_FRAME); + if (pmap_insert_pt_page(pmap, mt, false, + false)) { CTR1(KTR_PMAP, "pmap_enter_pde: cannot ins kern ptp va %#lx", va); From nobody Mon Jul 14 08:04:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgZbl4RVZz60gLK; Mon, 14 Jul 2025 08:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgZbl3lKbz3Tcm; Mon, 14 Jul 2025 08:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752480275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzR5Prde2Jsd8rvqcR10qi5UAONWYXn6VbT2/6I4Gbw=; b=PaJav/d90ACUhmv8GCgqz3JyydrSz/jyt9hRaW4CQJrAabkQg3ugXuBDxDpz0sxGDJhYZL FpR0rbO7ipedhsMhQBcNwSZxvEiSHTS5nSOeCXiHcEH0ID8fClByn53pOcRaCFYfXaIocr HNjFa1VDog30PMKiWV0pJ9Atfh+tvKyT2sy/NaBjyFMEBmU41Q136yK9Q8igfN5427g01f AELqtfXquh3WsuRe8RzpCvn23it9S6m6PkwFYoCrPjyGC6heL7FXVqru1s2odhyA5r5WkS fxImnTmpbX7ajHgYWlY0ftwqFEvLW13X0l7GbJq4lDpT191hZGkyDiw/Pmoayw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752480275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzR5Prde2Jsd8rvqcR10qi5UAONWYXn6VbT2/6I4Gbw=; b=THS2sEI3KjJ0uxaTfju3di49yamwqqfDy/OuKBAxW1NDXoBewkF9n9/TEoXTJ2x2Zd/o/D vL/UAawkDFPGYYdAY/Y/sAx+y4WlCR6l6sh5wbUc6kCMihTSCC6Oj2ZZ/Axi89HoVigfDS /hja+xXh6tlVjmHGwMnrXqB9EacU4HFuB3We9xRJ3HG8LujgYLGK8TFRk1y25poym7Hbq5 k0eOoi0T5Lq3o+yQxDOg1v9uPUxNA2njTafGGtwEU48JaKqk/CyyJD7Q/PN+vweEPaFDcC Dnci20vgfaIv5Jhn+NFNMKvMo/4BTnJyr0S5LvpP2+F+JsxzlV1WLQO9d/4f1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752480275; a=rsa-sha256; cv=none; b=Lqm1D7DSt0RJmwkGJtdOR1Sy/Bg3G4YrFfFQKawaWebIUTkPYXQzyCZ/KiTUk9Hbp0fZOj ZTso7fPC/GJ9VX3vTkxfyfIM+/Yjj+L+vA0fqZyAlT1qDwj/4htK7LbZRbovXk4cNn/oD+ TZPL8rPtMsFaAoVaisbb79+wrEvdbgC0cDZ9TmiB08dLcs8yGYM3+4IO3XU6Pvvz4hFP0e 6vjlbK6/na52BPcyPxqBO7ZZW/W38yiLEk5xMoXIUvOuYWx0FdwoDvMvvVbWA08TWF2iy+ /ZLH8LBdHk5KhAQA4SXSZ0oACTfxXZtwjsC7IhGpX0nJRbbqFiFjHmV9v1w1Tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgZbl3HGbzlHl; Mon, 14 Jul 2025 08:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56E84Zxs086030; Mon, 14 Jul 2025 08:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56E84ZCr086027; Mon, 14 Jul 2025 08:04:35 GMT (envelope-from git) Date: Mon, 14 Jul 2025 08:04:35 GMT Message-Id: <202507140804.56E84ZCr086027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 4d718f57c58e - main - xhci pci: Add some amd xhci controller device ids List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d718f57c58e4f3431b8dee4eda77eb7c54cd1d2 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=4d718f57c58e4f3431b8dee4eda77eb7c54cd1d2 commit 4d718f57c58e4f3431b8dee4eda77eb7c54cd1d2 Author: Tom Jones AuthorDate: 2025-07-14 07:59:32 +0000 Commit: Tom Jones CommitDate: 2025-07-14 08:03:45 +0000 xhci pci: Add some amd xhci controller device ids Reviewed by: aokblast Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51259 --- sys/dev/usb/controller/xhci_pci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index b50e33ea36ce..d5cfd228a429 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -99,6 +99,11 @@ xhci_pci_match(device_t self) return ("AMD Starship USB 3.0 controller"); case 0x149c1022: return ("AMD Matisse USB 3.0 controller"); + case 0x15b61022: + case 0x15b71022: + return ("AMD Raphael/Granite Ridge USB 3.1 controller"); + case 0x15b81022: + return ("AMD Raphael/Granite Ridge USB 2.0 controller"); case 0x15e01022: case 0x15e11022: return ("AMD Raven USB 3.1 controller"); @@ -109,6 +114,8 @@ xhci_pci_match(device_t self) return ("AMD 300 Series USB 3.1 controller"); case 0x43d51022: return ("AMD 400 Series USB 3.1 controller"); + case 0x43f71022: + return ("AMD 600 Series USB 3.2 controller"); case 0x78121022: case 0x78141022: case 0x79141022: From nobody Mon Jul 14 12:18:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bghF25Jhqz61gbg; Mon, 14 Jul 2025 12:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bghF246Ysz3nGr; Mon, 14 Jul 2025 12:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752495526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6VXKXHEN0hff3RvS5ysH43QjNwQFYL38tyKzrYW9fzE=; b=S21HkECvj9xgLPkGv86waaReAo3XB/NxvXUFdX7BK6NB0mxP1uN0vNtaCaS18BMmCBXRUb NtNmA4VCunf05oM68yYUajfwC43LRCp3pbmpyewNRvUqrRrkSaQ4R+COgD+rfV3q1XM5sa nGMGWsKqQ9FreW7jS59B/BZpW0TlrUAUAKywlRhpyo2vjxdmDLIK4t7AV3focxQUup4Ecl hsefxi4EFGZHHtwKGrf0AL9+qGKy/OFoHwvRqvjirZ3kyuAWrI+en0/4S4/gJq1SlZ+R21 7k2aSZ6R5zG094CKKwszqATcv2pgy2mjUHatElzugnTpwRIcelML5BbkhQqMAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752495526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6VXKXHEN0hff3RvS5ysH43QjNwQFYL38tyKzrYW9fzE=; b=thDdSy2PBpmQTA30gpcgtUcwyRaxwRr/AyiDt7A/SI8Z2qJgIFHe+Z0SZiQFlsjsnQiVFy Bw8QE0hB2aF6e2ko8t10ZjQZghpYE+lDzk3NVnUe9YZcgxIgwiysDBaGcLc6u+LU6d7+Rh sCtaCm/efqF6uGSrjS7yyGM/LkunxWQBdpk5owQP6YszJfxFjHB/27oRAUxdfiunHfRUdt URzI9CmNMg9edHGHYU4MkJYuzBbgiU6M3oOvcN60B/3IKxAqjcYBjze/S4I6dqOvw9sK2A 8qo3JUHGamMMQXs9cyjqZGz0660zz7p0JjjAJSUjAv5Bd9Kdf0nVya8TwabqhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752495526; a=rsa-sha256; cv=none; b=IoqhtWw5cSqLximQZfOG4UZQyD5BajostRGaOaLDFLRW7TyA7q5XltWhlqU8GaNGX6GrgS 3KHKnnzA06TeOEplG8y9aueUnHmeh6o43awqVy/F7LEyQAhshK8zjzEx/vNv0npWlNKvwm egGCDgbn3i2v3sA0xVNARVHlT6HwrD2K+qK8XdD2YWAdw4cXZta29KiCb4pCoq8blTG2Jy eQF/f8E5yho4zvLU0xbCndPhWIZA0rrDPJxKbA2tL3DJGeFB4XhCIK2qbr1rgbHZcHF8MX LsP8xx1dkneaO1r9zdEf9jfuPX/MNjDQEOmfeSKKJOWt2xbvudW0/Y8y6OYzDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bghF23c4fztSM; Mon, 14 Jul 2025 12:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ECIk6q057041; Mon, 14 Jul 2025 12:18:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ECIkiV057038; Mon, 14 Jul 2025 12:18:46 GMT (envelope-from git) Date: Mon, 14 Jul 2025 12:18:46 GMT Message-Id: <202507141218.56ECIkiV057038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a487606afd9b - main - dtrace_dtrace.4: Document the DTrace dtrace provider List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a487606afd9b7c21d76fce29c43b53c7c7a3a8eb Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=a487606afd9b7c21d76fce29c43b53c7c7a3a8eb commit a487606afd9b7c21d76fce29c43b53c7c7a3a8eb Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-11 20:28:26 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-14 12:17:04 +0000 dtrace_dtrace.4: Document the DTrace dtrace provider Reviewed by: bcr, christos Event: Berlin Hackathon 202507 Relnotes: yes Differential Revision: https://reviews.freebsd.org/D51267 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 1 + share/man/man4/Makefile | 1 + share/man/man4/dtrace_dtrace.4 | 191 +++++++++++++++++++++++++++ 3 files changed, 193 insertions(+) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 7a98baf39776..10a6922d79db 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -1223,6 +1223,7 @@ Invalid command line options or arguments were specified. .Xr cpp 1 , .Xr dwatch 1 , .Xr dtrace_audit 4 , +.Xr dtrace_dtrace 4 , .Xr dtrace_io 4 , .Xr dtrace_ip 4 , .Xr dtrace_kinst 4 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 7c8a8f3afc45..5648fd2c1a84 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -980,6 +980,7 @@ _ccd.4= ccd.4 .if ${MK_CDDL} != "no" _dtrace_provs= dtrace_audit.4 \ + dtrace_dtrace.4 \ dtrace_io.4 \ dtrace_ip.4 \ dtrace_kinst.4 \ diff --git a/share/man/man4/dtrace_dtrace.4 b/share/man/man4/dtrace_dtrace.4 new file mode 100644 index 000000000000..b8c31005b47e --- /dev/null +++ b/share/man/man4/dtrace_dtrace.4 @@ -0,0 +1,191 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 14, 2025 +.Dt DTRACE_DTRACE 4 +.Os +.Sh NAME +.Nm dtrace_dtrace +.Nd a DTrace provider for BEGIN, END, and ERROR probes +.Sh SYNOPSIS +.Nm dtrace Ns Cm :::BEGIN +.Nm dtrace Ns Cm :::END +.Nm dtrace Ns Cm :::ERROR +.Sh DESCRIPTION +The +.Nm dtrace +provider implements three special probes related to the life cycle of the +DTrace program itself. +.Ss dtrace:::BEGIN +The +.Nm dtrace Ns Cm :::BEGIN +probe fires at the beginning of a +.Xr dtrace 1 , +program before tracing has begun. +It provides a convenient place for initializing variables +and printing column headers. +.Pp +Variables such as +.Va stack +or +.Va execname +cannot be relied upon in the execution context of the +.Nm dtrace Ns Cm :::BEGIN +probe. +.Ss dtrace:::END +The +.Nm dtrace Ns Cm :::END +probe fires at the end of a +.Xr dtrace 1 +program, when all tracing has stopped. +.Ss dtrace:::ERROR +The +.Nm dtrace Ns Cm :::ERROR +probe fires when an unexpected runtime error occurs in another probe. +.Pp +The following table describes the arguments to +.Nm dtrace Ns Cm :::ERROR . +.Bl -column -offset indent "Argument" "Definition" +.It Sy Argument Ta Sy Definition +.It Fa arg1 Ta Enabled probe identifier (EPID) +of the probe where the runtime error occurred +.It Fa arg2 Ta Index of the action statement that caused the error +.It Fa arg3 Ta DIF offset into the action if available (otherwise -1) +.It Fa arg4 Ta Fault type +.It Fa arg5 Ta Accessed address (or 0 if not applicable) when +.Va arg4 +is of fault type +.Dv DTRACEFLT_BADADDR , DTRACEFLT_BADALIGN , DTRACEFLT_KPRIV , +or +.Dv DTRACEFLT_UPRIV +.El +.Pp +The fault types are: +.Bl -tag -offset indent -width "DTRACEFLT_NOSCRATCH" -compact +.It Dv DTRACEFLT_UNKNOWN +Unknown fault +.It Dv DTRACEFLT_BADADDR +Bad address +.It Dv DTRACEFLT_BADALIGN +Bad alignment +.It Dv DTRACEFLT_ILLOP +Illegal operation +.It Dv DTRACEFLT_DIVZERO +Divide-by-zero +.It Dv DTRACEFLT_NOSCRATCH +Out of scratch space +.It Dv DTRACEFLT_KPRIV +Illegal kernel access +.It Dv DTRACEFLT_UPRIV +Illegal user access +.It Dv DTRACEFLT_TUPOFLOW +Tuple stack overflow +.It Dv DTRACEFLT_BADSTACK +Bad stack +.El +.Sh FILES +.Bl -tag -width '' +.It In sys/dtrace.h +The header file containing the definitions of DTrace fault types. +.El +.Sh EXAMPLES +.Ss Example 1 : Custom Column Headers +The following script uses the +.Nm dtrace Ns Cm :::BEGIN +probe to print column headers. +Note the pragma line setting the +.Ql quiet +option to disable the default column headers. +.Bd -literal -offset 2n +#pragma D option quiet + +dtrace:::BEGIN +{ + printf(" %12s %-20s %-20s %s\en", + "DELTA(us)", "OLD", "NEW", "TIMESTAMP"); +} +.Ed +.Ss Example 2 : Handling Runtime Errors with dtrace:::ERROR +The following script causes a runtime error by dereferencing a pointer +on address +.Ad 19930908 +in the +.Cm BEGIN +probe. +As a result, the +.Cm ERROR +probe fires and prints out +.Dq Oops +along with the probe arguments. +At that point, the program ends and fires the +.Cm END +probe. +.\" It might look weird to define ERROR first, but that is on purpose. +.\" This way the probe IDs and EPIDs are a bit more mixed up +.\" and are easier to understand. +.Bd -literal -offset 2n +ERROR +{ + printf("Oops\en"); + printf("EPID (arg1): %d\en", arg1); + printf("Action index (arg2): %d\en", arg2); + printf("DIF offset (arg3): %d\en", arg3); + printf("Fault type (arg4): %d\en", arg4); + printf("Accessed address (arg5): %X\en", arg5); + exit(1); +} +BEGIN +{ + *(int *)0x19931101; +} +END { + printf("Bye"); +} +.Ed +.Pp +This script will result in the following output: +.Bd -literal -offset 2n +CPU ID FUNCTION:NAME + 2 3 :ERROR Oops +EPID (arg1): 2 +Action index (arg2): 1 +DIF offset (arg3): 16 +Fault type: 1 +arg5: 19931101 + +dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): invalid address (0x19931101) in action #1 at DIF offset 16 + 2 2 :END Bye +.Ed +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr tracing 7 +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter dtrace Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-dtrace.html +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh CAVEATS +The +.Nm dtrace Ns Cm :::ERROR +probe arguments cannot be accessed through the typed +.Va args[] +array. +.Pp +.Xr dtrace 1 +will not fire the +.Nm dtrace Ns Cm :::ERROR +probe recursively. +If an error occurs in one of the action statements of the +.Nm dtrace Ns Cm :::ERROR , +then +.Xr dtrace 1 +will abort further processing of +the +.Nm dtrace Ns Cm :::ERROR +probe's actions. From nobody Mon Jul 14 13:02:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgjCJ0SXMz61k1d; Mon, 14 Jul 2025 13:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgjCH4TfBz3G7X; Mon, 14 Jul 2025 13:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752498139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9XLN5FLrhGWfEUlkhsP0Bpf07JPEOPn/ffGS1K51kE=; b=W4RNNGW+50zcLSy2tWLqv7v/F05m80mpTauWy0rx6ViMDpzprtZDeu11sPy16tCpGn4VPW cw99NMrbysKmk2kx7VAFg8kknQounqMgkT2HgqNBFJPZjNbIyALssvJ6XlzzXBQxCwBhlK uK2gu/Xrs3RKtfoKxQTp5fW/4s45gFiKPZADBdYRlj57l0MCo3xTpq2ZYCrA7bcnV1pQIz qn9HUwr/a6NXJLZIEoTGd6yv30MOm3u7vKEKC6mDsM91GEcWEfPL297PUfu0DXJ8qPAiMt G6VF++bDnZdD1Rlx0SX175kmQ9eOPsx1znCDXzq97QfT1JJOksZTJMHHVrPgSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752498139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9XLN5FLrhGWfEUlkhsP0Bpf07JPEOPn/ffGS1K51kE=; b=F9SI3fTtKqSAbwnRjMwjkhGBpNDKP9ISdXGdI/GyWTEBfkgMJQ5lkEQI2yoofiJd11sXss zcYtYYTITnYF81+hBzfDL+TLdW6FTTpHr5/mweos3UUGPhQEWCVkcji8oaw2Z7WizE9kNF 1Syk1J48la34RcZdfP9I3WHyTj+U0BKjyx7JDFtEYfi9hkdlVg4vUgeKe2dixIcSyq/3pD aqwbDBsYGOyHq04gXjiZikpB+jpiP+07+LEflA5SZCOvnZiHGuTblIs2ynvZK6iAA7TRXV dwXp4lDE3CgSrmjkP+GL1xjQNCdfK96Ug+LeSw6q/abSy/KLkq1ZQR2rJwCT+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752498139; a=rsa-sha256; cv=none; b=M3+f1X8Jb/5WQAKbPYFc1cD037dQ/fKqqzx4Hvq/K/JNU1KFGZS0UPdKVBUXDbqxT1Ghvy onG0yMPxenI2E72ZpHb9inoXqHNPo1vaLuWooDwzfQz3XmEosLaN4VNm1RaBg1GlIk9X8I a3ZH6YUgpQ8nk55fOwjPMGWzvyvKSPyAwmB3lSzmt08Fg646BiXlmhFcFajlbiO/9aIfpC VgyE3B6i4G8Dfqe3E+BpLhilauYN3BprUk1HAo6ECMpCWdmmkfEFRd/qg9fYBjdajZM7L1 7FFKMC2idVvaZJeb/wkb5Nksyx8FLjp66xWwVIaQYbh88ePRSssyIrNrAZyWVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgjCH44gwzw4D; Mon, 14 Jul 2025 13:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ED2JW4049364; Mon, 14 Jul 2025 13:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ED2JbT049361; Mon, 14 Jul 2025 13:02:19 GMT (envelope-from git) Date: Mon, 14 Jul 2025 13:02:19 GMT Message-Id: <202507141302.56ED2JbT049361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 193f2289fc9a - main - d.7: Document the DTrace scripting language List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 193f2289fc9a5c7464b460e1e61c2c0ac8c9f57d Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=193f2289fc9a5c7464b460e1e61c2c0ac8c9f57d commit 193f2289fc9a5c7464b460e1e61c2c0ac8c9f57d Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-11 18:10:58 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-14 13:01:51 +0000 d.7: Document the DTrace scripting language Reviewed by: bcr, christos, ziaee Event: Berlin Hackathon 202507 Relnotes: yes Differential Revision: https://reviews.freebsd.org/D51268 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 3 +- share/man/man7/Makefile | 1 + share/man/man7/d.7 | 287 +++++++++++++++++++++++++++ share/man/man7/intro.7 | 5 +- 4 files changed, 294 insertions(+), 2 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 10a6922d79db..f3d7a49e0e78 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 12, 2025 +.Dd June 14, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -1235,6 +1235,7 @@ Invalid command line options or arguments were specified. .Xr dtrace_udp 4 , .Xr dtrace_udplite 4 , .Xr elf 5 , +.Xr d 7 , .Xr tracing 7 , .Xr SDT 9 .Rs diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 7daa0ffed8ea..1e50242a1754 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -6,6 +6,7 @@ MAN= arch.7 \ bsd.snmpmod.mk.7 \ build.7 \ c.7 \ + d.7 \ clocks.7 \ crypto.7 \ development.7 \ diff --git a/share/man/man7/d.7 b/share/man/man7/d.7 new file mode 100644 index 000000000000..30efb0249a77 --- /dev/null +++ b/share/man/man7/d.7 @@ -0,0 +1,287 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 14, 2025 +.Dt D 7 +.Os +.Sh NAME +.Nm D +.Nd DTrace scripting language overview +.Sh SYNOPSIS +.Sm off +.Ar provider Cm \&: +.Ar module Cm \&: +.Ar function Cm \&: +.Ar name +.Sm on +.Sm off +.Oo +.Cm / +.Ar predicate +.Cm / +.Sm on +.Oc +.Op Cm \&{ Ns Ar action Ns Cm \&} +.Sh DESCRIPTION +.Nm D +is the +.Xr dtrace 1 +scripting language. +This manual provides a brief reference of the +.Nm +language and scripting. +.Pp +This manual page serves as a short reference of the language. +Refer to books listed in +.Sx SEE ALSO +for a complete reference. +.Sh PROBE'S DESCRIPTION +A probe's description consists of four elements: +.Sm off +.D1 Ar provider Ns Cm \&: Ns Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on +.Pp +The exact meaning of +.Ar module , +.Ar function , +and +.Ar name +depends on +.Ar provider . +.Sh USER-DEFINED VARIABLE TYPES +.Bl -column "thread-local" "Syntax" +.It Sy Type Ta Sy Syntax +.It global Ta Va variable_name +.It thread-local Ta Sy self-> Ns Va variable_name +.It clause-local Ta Sy this-> Ns Va variable_name +.It aggregate Ta Sy @ Ns Va variable_name +.El +.Pp +.Em Tips : +.Bl -dash -compact +.It +Always use the variable type with the smallest scope +to minimize processing overhead. +.It +Use aggregate variables instead of global variables when possible. +Aggregate variables are multi-CPU safe in contrast to global variables. +.El +.Sh BUILT-IN VARIABLES +.Ss Probe Arguments +.Bl -tag -width "arg0, ..., arg9" +.It Va args[] +The array of typed probe arguments. +.It Va arg0 , ... , arg9 +The untyped probe arguments represented as 64-bit unsigned integers. +Only the first ten arguments are available this way. +.El +.Ss Probe Information +.Bl -tag -width probeprov +.It Va epid +The enabled probe ID which uniquely identifies an enabled probe. +An enabled probe is defined by its probe ID, its predicates, and its actions. +.It Va id +The probe ID which uniquely identifies a probe available to DTrace. +.It Va probeprov +The +.Ar provider +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.It Va probemod +The +.Ar module +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.It Va probefunc +The +.Ar function +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.It Va probename +The +.Ar name +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.El +.Ss Process Information +.Bl -tag -width execname +.It Va execargs +The process arguments. +Effectively, +.Ql curthread->td_proc->p_args . +.It Va execname +The name of the current process. +Effectively, +.Ql curthread->td_proc->p_comm . +.It Va gid +The group ID of the current process. +.It Va pid +The process ID of the current process. +.It Va ppid +The parent process ID of the current process. +.It Va uid +The user ID of the current process. +.El +.Ss Thread Information +.Bl -tag -width curlwpsinfo +.It Va uregs[] +The saved user-mode register values. +.It Va cpu +The ID of the current CPU. +.It Va stackdepth +The kernel stack frame depth. +.It Va ustackdepth +The userspace counterpart of +.Va stackdepth . +.It Va tid +The thread ID. +Depending on the context, +this can be either the ID of a kernel thread or a thread in a user process. +.It Va errno +The +.Xr errno 2 +value of the last system call performed by the current thread. +.It Va curlwpsinfo +A pointer to the +.Vt lwpsinfo_t +representation of the current thread. +Refer to +.Xr dtrace_proc 4 +for more details. +.It Va curpsinfo +A pointer to the +.Vt psinfo_t +representation of the current process. +Refer to +.Xr dtrace_proc 4 +for more details. +.It Va curthread +A pointer to the thread struct that is currently on-CPU. +E.g., +.Ql curthread->td_name +returns the thread name. +The +.In sys/proc.h +header documents all members of +.Vt struct thread . +.It Va caller +The address of the kernel thread instruction at the time of execution +of the current probe. +.It Va ucaller +The userspace counterpart of +.Va caller . +.El +.Ss Timestamps +.Bl -tag -width walltimestamp +.It Va timestamp +The number of nanoseconds since boot. +Suitable for calculating relative time differences of elapsed time and latency. +.It Va vtimestamp +The number of nanoseconds that the current thread spent on CPU. +The counter is not increased during handling of a fired DTrace probe. +Suitable for calculating relative time differences of on-CPU time. +.It Va walltimestamp +The number of nanoseconds since the Epoch +.Pq 1970-01-01T00+00:00 . +Suitable for timestamping logs. +.El +.Sh BUILT-IN FUNCTIONS +.Ss Aggregation Functions +.Bl -tag -compact -width "llquantize(value, factor, low, high, nsteps)" +.It Fn avg value +Average +.It Fn count +Count +.It Fn llquantize value factor low high nsteps +Log-linear quantization +.It Fn lquantize value low high nsteps +Linear quantization +.It Fn max value +Maximum +.It Fn min value +Minimum +.It Fn quantize value +Power-of-two frequency distribution +.It Fn stddev value +Standard deviation +.It Fn sum value +Sum +.El +.Ss Kernel Destructive Functions +By default, +.Xr dtrace 1 +does not permit the use of destructive actions. +.Bl -tag -width "chill(nanoseconds)" +.It Fn breakpoint +Set a kernel breakpoint and transfer control to +the +.Xr ddb 4 +kernel debugger. +.It Fn chill nanoseconds +Spin on the CPU for the specified number of +.Fa nanoseconds . +.It Fn panic +Panic the kernel. +.El +.Sh FILES +.Bl -tag -width /usr/share/dtrace +.It Pa /usr/share/dtrace +DTrace scripts shipped with +.Fx +base. +.El +.Sh SEE ALSO +.Xr awk 1 , +.Xr dtrace 1 , +.Xr tracing 7 +.Rs +.%B The illumos Dynamic Tracing Guide +.%D 2008 +.%U https://illumos.org/books/dtrace/ +.Re +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%A George Neville-Neil +.%A Jonathan Anderson +.%A Graeme Jenkinson +.%A Brian Kidney +.%A Domagoj Stolfa +.%A Arun Thomas +.%A Robert N. M. Watson +.%C Cambridge, United Kingdom +.%D August 2018 +.%T Univeristy of Cambridge Computer Laboratory +.%R OpenDTrace Specification version 1.0 +.%U https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-924.pdf +.Re +.Sh HISTORY +This manual page first appeared in +.Fx 15.0 . +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh BUGS +The +.Va cwd +variable which typically provides the current working directory is +not supported on +.Fx +at the moment. diff --git a/share/man/man7/intro.7 b/share/man/man7/intro.7 index d889c2dd299f..43e48de87bc5 100644 --- a/share/man/man7/intro.7 +++ b/share/man/man7/intro.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 23, 2025 +.Dd July 14, 2025 .Dt INTRO 7 .Os .Sh NAME @@ -49,6 +49,9 @@ system timekeeping clocks available in .It Xr crypto 7 cryptographic algorithms provided by OpenCrypto in .Fx +.It Xr d 7 +.Xr dtrace 1 +scripting language overview .It Xr development 7 development introduction to .Fx From nobody Mon Jul 14 14:46:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bglWS1Gdmz61qZY; Mon, 14 Jul 2025 14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bglWS0bKhz48vg; Mon, 14 Jul 2025 14:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752504388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bGJY+4TrVgkk1fzJ6d3CrEMl8ZXylgHvPtlu2/Ut7pU=; b=f2d5xK1ZWa2K4ARo85KjJchNNJa12axOZDxAia/DUzRFDmCxDUJ/Jl7Jcot1MGWrOstLPC 1x7vpS4+t3QtDRbI9pQcKFwkk0wWqw+k2M1Y3ZaFEyh2uSNYYpG9MlbcNb3r61nDbasWN5 7lUUoyn3MBiN3JQGbAQUMh5rZ3KEiLRu2wsb4xvYiyTRFl7fGxxJg8PAO8fAi3obVqZWbj OkfEMl+M39wLIb3LzV5a1iSAdHggb0UWhrW18/Kc8OaZPMsVxidQzY1QoJihV28umLLLU6 4b1LIKP0JKq87JFt/A3YSEtR0hlX79P0uL3z7Io+TSCVBQrtj14elMcG8lvHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752504388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bGJY+4TrVgkk1fzJ6d3CrEMl8ZXylgHvPtlu2/Ut7pU=; b=AA6mwEj7GhT/P7psF6hhYuFd8fp8rcralsRvKJfH8bk6nY6CGJuJ8ghUE8+al0X9yVAq4r qs2PGgcVvPY8gMa5pkx6oa7kfXm+Hx4qNRuAH6BEO8Jf95kYSEFI8CdNgC6CSwHkW40uWo xsHI1d1yHlnj8YwsxwlGDopO8h29YIWmhYg6ZQ78ADvDnCyNwhhXbxI7hJ5ZGT0VlcCukc 80gJIdyEbrOR/zPvyP9NEGN2mzF2LG8fqrE+OvNmYLKlXvGBwNnENjzMSjqy7C1c1kwOzA f16ueh0da6z7leFD/Mm/hNl2wuyCrASKEBsgFidL3TeS8zDOnOsfmwBHW3k4sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752504388; a=rsa-sha256; cv=none; b=M5XvSDJuudQV2QpdtUz3s645smYOde6KhL6f8axCGN7Oo49Ow4WYQhoDx0nE6VK4Mqv45o trmFfgKNHYwfIkcgFgH8wDsepKYJP1lOAgmqeqRvl21vmPTIfYd4Gq3rs/Pf19IB44zEgn zNdQfaRyWGPqPaLRhHVgVfOyVb9o6zaZhm0lqNtUXZPa8jYvsmgdGfaGxTOM0p+Mfnj1YB j8uRp7fdsKOgzdkMu2V754KS1TWdZYWl+l8DPJxRP8aLg3Scl7NTn7dLjkYwkrUsoEWZ7h F2JB6zkWBy74o0tJ6tkV1kaCUXxsPxb75zg79gjWrVnDMRbucAPJPyzWHbPgRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bglWR6nZfzyPC; Mon, 14 Jul 2025 14:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EEkRUO038094; Mon, 14 Jul 2025 14:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EEkRhm038091; Mon, 14 Jul 2025 14:46:27 GMT (envelope-from git) Date: Mon, 14 Jul 2025 14:46:27 GMT Message-Id: <202507141446.56EEkRhm038091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1cc020eba69e - main - ncurses: Provide reproducible paths List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cc020eba69e8c3216683b41487600c6c958cbb0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1cc020eba69e8c3216683b41487600c6c958cbb0 commit 1cc020eba69e8c3216683b41487600c6c958cbb0 Author: Mark Johnston AuthorDate: 2025-07-14 14:45:57 +0000 Commit: Mark Johnston CommitDate: 2025-07-14 14:45:57 +0000 ncurses: Provide reproducible paths Avoid hard-coding the value of SRCTOP in generated files. Use /usr/src as the canonical srcdir. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50955 --- lib/ncurses/tinfo/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ncurses/tinfo/Makefile b/lib/ncurses/tinfo/Makefile index 920bd6e5559c..476df54bb72a 100644 --- a/lib/ncurses/tinfo/Makefile +++ b/lib/ncurses/tinfo/Makefile @@ -259,10 +259,18 @@ term.h: MKterm.h.awk edit_cfg.sh Caps Caps-ncurses sh ${NCURSES_DIR}/include/edit_cfg.sh ${NCURSES_CFG_H} $@.new mv -f $@.new $@ +# Avoid hard-coding absolute source paths if requested. +.if ${MK_REPRODUCIBLE_BUILD} != "no" +NCURSES_SRCTOP=/usr/src +.else +NCURSES_SRCTOP=${SRCTOP} +.endif + curses.h: curses.head MKkey_defs.sh Caps Caps-ncurses cat curses.head > $@.new AWK=${AWK} _POSIX2_VERSION=199209 sh ${NCURSES_DIR}/include/MKkey_defs.sh \ ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses >> $@.new + sed -i '' 's|${SRCTOP}|${NCURSES_SRCTOP}|g' $@.new cat ${NCURSES_DIR}/include/curses.wide >> $@.new cat ${NCURSES_DIR}/include/curses.tail >> $@.new mv -f $@.new $@ @@ -387,6 +395,7 @@ unctrl.h: unctrl.h.in terminfo.5: MKterminfo.sh terminfo.head Caps sh ${NCURSES_DIR}/man/MKterminfo.sh ${NCURSES_DIR}/man/terminfo.head \ ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/man/terminfo.tail >$@ + sed -i '' 's|${SRCTOP}|${NCURSES_SRCTOP}|g' $@ CLEANFILES+= terminfo.5 From nobody Mon Jul 14 15:02:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgltP6C7bz61r8s; Mon, 14 Jul 2025 15:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgltP1gbgz4Kdw; Mon, 14 Jul 2025 15:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwT1htvBbRb05wiLhPiihGEeuPmp9InXAqzv5M0WYmc=; b=CMQ1t65Wff1wsxHSy6cOYApYTcQrw4318ZQSO8XFEUNe/+fKp2JDkDtdVu9Jczw4hAkC8U 3puvklC/98avY96ZUeGvAXGFwwcwwCqWRLUDyfDXS/co5i/Zx0Gopfv1KwMvS/js8Ix6nu QJXjWtJiGO+sV/QXuGMDfeESmwN0IkJc3kiA0Dj5M0mDPcOPcvhAwsFZBzP9FNGtpylnhX ETY4AteHSPEE4ELwObjRVgMNlckWjQggA0sN1XdMIgB2IRGInzEvX/oWhCEMHJcbsSoDSI aSFEYcsG7b9VZHi4Rrrs15HX9doP7gxrXfcAL2589mJonWmDoymJi93UvdgvhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwT1htvBbRb05wiLhPiihGEeuPmp9InXAqzv5M0WYmc=; b=mSadjz+gbYJMGxRj2DVXWHJSvSec0bfm38pIJNN5rveWnBZ8fKK6RoZTtKeqA7dRlNWLgn p/cGDy9AxT3g36VZvknOD5k+DJbjLWBxkkh3ikIUb3rBnBkVsp6Lhucagq9/ZDyDdDfJhH H2LXKGnzlLDR2UhM/pM7qnKVnQ54DWMHD9OJa0qXFxd+RtVzBzTb+ONxKy2sSWhMTP5ONS wIydobGyfp9f0t1eGyJk6bVO5QMUK2EUrSlbrrz7uWDZ6dFgpsd9DgPoK4dGXlpcBjS0Y3 9agxq/6k8iRQ9ToYIewE1SbX6T7CW/AWqh+AHq1q8fVpoyWt/Jq0OnJMhVvBrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752505373; a=rsa-sha256; cv=none; b=GSfyhPC6+3p59IQT1KzMqVJm0Lco40ll5V/leBbSvc9EZtBCtM3SOI3x2DYCjhbkAXuqH5 ROWvsO6TAPFLmpqqpGpF6RMpIicRYyREGdAyzBK4hNykd77V1FL47PIlSKr04+NdP4S0t0 uPKcGbsH9BkyPhxNTQ+cXp3XWULNdLD9+Mqln3HZ1Sjy29qTf/karoFbz+7qmz0qTtGAiD rm5OvPxWOah+vIKzQ+rptjTfPnFIaHzU8QMV3fPCTNxrQ/TnUhxo/7iS82lUvFfvqb8Fet G9YjSpap9feSkzbTXn0y/y2VqQ8lgaXtnfKvr+FRutO0Xbjhwt3aPKF8SGGWsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgltP15PKz101n; Mon, 14 Jul 2025 15:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EF2r0s075523; Mon, 14 Jul 2025 15:02:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EF2rSK075520; Mon, 14 Jul 2025 15:02:53 GMT (envelope-from git) Date: Mon, 14 Jul 2025 15:02:53 GMT Message-Id: <202507141502.56EF2rSK075520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7442cdca51fa - main - i386: Unhook all kernel configs from make universe List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7442cdca51fac3416cd6e2d1944158add17e65de Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7442cdca51fac3416cd6e2d1944158add17e65de commit 7442cdca51fac3416cd6e2d1944158add17e65de Author: John Baldwin AuthorDate: 2025-07-14 15:00:10 +0000 Commit: John Baldwin CommitDate: 2025-07-14 15:00:10 +0000 i386: Unhook all kernel configs from make universe This effectively makes i386 a world-only target in make universe. Reviewed by: bz, imp Differential Revision: https://reviews.freebsd.org/D51193 --- sys/i386/conf/GENERIC | 2 ++ sys/i386/conf/GENERIC-NODEBUG | 2 ++ sys/i386/conf/LINT | 1 + sys/i386/conf/MINIMAL | 2 ++ sys/i386/conf/PAE | 2 ++ 5 files changed, 9 insertions(+) diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index e7d460af21d4..f577cd07ac7c 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -17,6 +17,8 @@ # in NOTES. # +#NO_UNIVERSE + cpu I486_CPU cpu I586_CPU cpu I686_CPU diff --git a/sys/i386/conf/GENERIC-NODEBUG b/sys/i386/conf/GENERIC-NODEBUG index ea07613a796f..a93304481b5f 100644 --- a/sys/i386/conf/GENERIC-NODEBUG +++ b/sys/i386/conf/GENERIC-NODEBUG @@ -25,6 +25,8 @@ # in NOTES. # +#NO_UNIVERSE + include GENERIC include "std.nodebug" diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 41207eb63cb9..2e947202f723 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -1,3 +1,4 @@ +#NO_UNIVERSE include "../../conf/NOTES" include "../../x86/conf/NOTES" diff --git a/sys/i386/conf/MINIMAL b/sys/i386/conf/MINIMAL index 2a06eb84bff8..8019617ca4d4 100644 --- a/sys/i386/conf/MINIMAL +++ b/sys/i386/conf/MINIMAL @@ -31,6 +31,8 @@ # in NOTES. # +#NO_UNIVERSE + cpu I486_CPU cpu I586_CPU cpu I686_CPU diff --git a/sys/i386/conf/PAE b/sys/i386/conf/PAE index a39d32d77106..72af9e9a9eec 100644 --- a/sys/i386/conf/PAE +++ b/sys/i386/conf/PAE @@ -2,6 +2,8 @@ # PAE -- Generic kernel configuration file for FreeBSD/i386 PAE # +#NO_UNIVERSE + include GENERIC ident PAE-GENERIC From nobody Mon Jul 14 15:02:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgltQ5NGvz61rJq; Mon, 14 Jul 2025 15:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgltQ2W2hz4Kf0; Mon, 14 Jul 2025 15:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uLzGyPQ2JJrGiV0ur6LIKxAotQA5kE1AaRdCBjrJAg=; b=mcEyrOb3FGniMRlpjfA8CvEK9OWabBLQDI4ID6kVt1xSr2s2kALnsGtPLyuIl7/kDLEfGa EKkJdOyBQB6O9pC7l3+yZo3Y0WqYM1g/5A8cHhD1S0JQ+Y50BaXyXtcZRi0SqHExdyPH7C KoKpi2xlSmtsLrzqGpnCY4WsYydV0mosq5U+AObXiqEm68O6BuEvgjpV8amyWRgYNfF+mB 69Hoo5LG71F5B1UBW+nTOdi7bmlbFaGNCeDk9XXpEU8oei5vOeqvniM/65zULdmoK+pumT MKju2CChdIVogkjDeXOVEc3aCmfiN5OX8nnUwjyVWcItorKao+2bO2J+r5b0qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uLzGyPQ2JJrGiV0ur6LIKxAotQA5kE1AaRdCBjrJAg=; b=El7XLv9C6fsOOaIjM5VdORrZPA96gzVP6Y+BZEoMIzQaBbcYzOXWk7HW+7/g0dZPhycT// z1chW7dk4rmKo+dOaWXG8SCm61SLCRg0nsvqnbnmrKI/uhg1JtXzD2jx1H+ILGCdTQTANd Y+vZId119tF+dHIc3ZplS5uiKIJW/MsNGYtsxRkHdV6yVHP+9T0jD2a03vc3sFb2pwhuZk zkjRvT5Qn+vZ3v8DA00AkDXFUhHc7faFPnOZYny075kqo4zUTfe0hXd+bDWNI/gGj+fo9q cibWqv6ocAtTGkCE7ncq3GJESqkYhcraOyve6XYcbQBcWrQfmJ0jU/xU9t2Uow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752505374; a=rsa-sha256; cv=none; b=bK2Jo4uqJaNjl9ovF0fpIYLKLLutvhUeBzSlOkhqPobgbNVyC7Ie47NS4vkWwd0w3IPrwK UHNhIXdnRrgZaqlyNuPhcNl+iNAcGMHhOyp9b8PUMph+VgdWoW1nbGXPcG8Oa7WeyTjSu7 oxynFIfnin+h7MbMCXsZD+5mHN3lvIo2bDg5sIflu/PMPzU93EBQzYalHzFDuL/oyEO710 dnB+tmqJD6ONlP+L7bKDxEQQCxQLA+xFnAqp+DLLrcmfpCK2fbTyqlOf2oxJfBxiDtLdvX 8NfqzPRYCv+q58dZW2A3Mt0+54Mtitfu/3qZBU2nNGDeRCqDNqiFUIHQXvRjow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgltQ20K1z101p; Mon, 14 Jul 2025 15:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EF2s5N075565; Mon, 14 Jul 2025 15:02:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EF2s0p075563; Mon, 14 Jul 2025 15:02:54 GMT (envelope-from git) Date: Mon, 14 Jul 2025 15:02:54 GMT Message-Id: <202507141502.56EF2s0p075563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4a3fb7547e6b - main - powerpc: Disconnect 32-bit powerpc from make universe List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a3fb7547e6bbae48e6535f22752486769df7272 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4a3fb7547e6bbae48e6535f22752486769df7272 commit 4a3fb7547e6bbae48e6535f22752486769df7272 Author: John Baldwin AuthorDate: 2025-07-14 15:01:09 +0000 Commit: John Baldwin CommitDate: 2025-07-14 15:01:09 +0000 powerpc: Disconnect 32-bit powerpc from make universe World and kernels for 32-bit powerpc can still be built using the buildworld and buildkernel targets. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51194 --- Makefile | 8 +++----- share/mk/local.sys.machine.mk | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4afec2a80c60..383430307495 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ # # See src/UPDATING `COMMON ITEMS' for more complete information. # -# If TARGET=machine (e.g. powerpc, arm64, ...) is specified you can +# If TARGET=machine (e.g. powerpc64, arm64, ...) is specified you can # cross build world for other machine types using the buildworld target, # and once the world is built you can cross build a kernel using the # buildkernel target. @@ -530,8 +530,7 @@ worlds: .PHONY # Don't build rarely used, semi-supported architectures unless requested. # .if defined(EXTRA_TARGETS) -# powerpcspe excluded from main list until clang fixed -EXTRA_ARCHES_powerpc= powerpcspe +EXTRA_ARCHES_powerpc= powerpc powerpcspe .endif TARGETS?= ${TARGET_MACHINE_LIST} _UNIVERSE_TARGETS= ${TARGETS} @@ -546,8 +545,7 @@ TOOLCHAINS_amd64= amd64-${_GCC_VERSION} TOOLCHAINS_arm= armv7-${_GCC_VERSION} TOOLCHAINS_arm64= aarch64-${_GCC_VERSION} TOOLCHAINS_i386= i386-${_GCC_VERSION} -TOOLCHAINS_powerpc= powerpc-${_GCC_VERSION} powerpc64-${_GCC_VERSION} -TOOLCHAIN_powerpc64= powerpc64-${_GCC_VERSION} +TOOLCHAINS_powerpc= powerpc64-${_GCC_VERSION} TOOLCHAINS_riscv= riscv64-${_GCC_VERSION} .endif diff --git a/share/mk/local.sys.machine.mk b/share/mk/local.sys.machine.mk index 5e40dfe805f9..e1a197e516e5 100644 --- a/share/mk/local.sys.machine.mk +++ b/share/mk/local.sys.machine.mk @@ -9,7 +9,7 @@ MACHINE_ARCH_host32?= ${_HOST_ARCH32} MACHINE_ARCH_LIST_arm?= armv7 ${EXTRA_ARCHES_arm} MACHINE_ARCH_LIST_arm64?= aarch64 -MACHINE_ARCH_LIST_powerpc?= powerpc powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc} +MACHINE_ARCH_LIST_powerpc?= powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc} MACHINE_ARCH_LIST_riscv?= riscv64 .for m in ${TARGET_MACHINE_LIST} From nobody Mon Jul 14 15:02:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgltS1GJtz61rjH; Mon, 14 Jul 2025 15:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgltR3Wzmz4Kkd; Mon, 14 Jul 2025 15:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aLoLRQR+tkzq4KC/WC7iCNxeLLzIiN3RkncXES8zEH0=; b=OnkoWQS1mhXp+C5lCbfqjYQBNiAqBXpXIJrIU0uvRbQf1Bu6ue61Jzc1iq5/AjLNDAC2KY 8EVyIOs8ZAbSAbBV+l6+EIdYlC9sk/l3WN6AkuOMvPUCqaYYsww6WS2CsOtGqgw71LRvh1 m88dVeMJCLzd3v81yRNUTXCEHDtNiCFI8zeu9GtKaq/g2FaYm6sY3qcZO2HBg5NAU7JJVi cHhdM+tmsZXdyUdo3ll8Sq457xBYUP+YxJWsM1BJ/QMFaLJ9A/M5iUNaIJPExcnqOmggxg 6FYGZCjKfm6oOKHTqMfjRSkaFNiEumY/56EVzg7lNUYkhBG0efB3lbes50YVCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aLoLRQR+tkzq4KC/WC7iCNxeLLzIiN3RkncXES8zEH0=; b=UGqZXizst9I7WmxMlYF/kDBmC6DEl8yILMgECtZMYSeXUFLaxmrf4rp3iSAqoi0kMN5S34 Y9CNV0jBfspzkiBHQqEzB4CB9SK08G844nqSzLyCd4OsADxmh2KzoJ1OGSct38vs78G2Xx a4GqduD/CMLLchdtcywJc6wZeYbOQ1jizQgubJrZu3aUiI4aGbmLsXj3fN8hJJMAYttmXV Z2R5vBKx9zXmqDVMMmepr9tGycUknuH3GFoR/uCKK9e4NbLtEmQecxh7eHvYfyhaoEg4m6 1Syj1XwLh7zxjOGlC36shbi4FMN7smBrWWkLRFnilmfHXq4W/BOmhH+M8Z5wyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752505375; a=rsa-sha256; cv=none; b=VeYWpDXnFrr5mMD3ywpVht1bpw/QZZGORSf9e7eSbE8hdtZO1MFMjpC2fc0Ti53weh0ygy uwaoJNALVSpT89Y2Xwbx7FbI45gyFC0kJL4SuKM+Ylkb791y+2zgTK7YctZXY42z0G2eWA +NtTEgq5YfZ76jcpkr+bVSjqm5SiQmfAb7QeT2HoYLwpZ3uCXgmauR7B5a+AsAX7iD8lQg uZzBqFeTxB+fsXtK8PdgmicoxMeXC+/5LBDtmihCeDJ1djJIPC4+jeDO6nn7x8ASVAt/la c2nLdEQ0vJXWcQHD9B5UXV3qifAdeAOyyJMymhb5zFzL5q7KbQDssksO7fCfLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgltR30bRzync; Mon, 14 Jul 2025 15:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EF2tYA075599; Mon, 14 Jul 2025 15:02:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EF2t88075596; Mon, 14 Jul 2025 15:02:55 GMT (envelope-from git) Date: Mon, 14 Jul 2025 15:02:55 GMT Message-Id: <202507141502.56EF2t88075596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 072f54bf9ff3 - main - arch.7: Move i386, powerpc, and powerpcspe to the discontinued arch list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 072f54bf9ff3fb544ae65649e723d5f846b53897 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=072f54bf9ff3fb544ae65649e723d5f846b53897 commit 072f54bf9ff3fb544ae65649e723d5f846b53897 Author: John Baldwin AuthorDate: 2025-07-14 15:01:30 +0000 Commit: John Baldwin CommitDate: 2025-07-14 15:01:30 +0000 arch.7: Move i386, powerpc, and powerpcspe to the discontinued arch list Other tables retain entries about these architectures since those details are still relevant for lib32 environments. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D51195 --- share/man/man7/arch.7 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 91f6953370d9..918f9058c7aa 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -67,8 +67,7 @@ and should be avoided. .Pp On some architectures, e.g., -.Dv powerpc -and AIM variants of +AIM variants of .Dv powerpc64 , the kernel uses a separate address space. On other architectures, kernel and a user mode process share a @@ -88,9 +87,6 @@ release to support each architecture. .It aarch64 Ta 11.0 .It amd64 Ta 5.1 .It armv7 Ta 12.0 -.It i386 Ta 1.0 -.It powerpc Ta 6.0 -.It powerpcspe Ta 12.0 .It powerpc64 Ta 9.0 .It powerpc64le Ta 13.0 .It riscv64 Ta 12.0 @@ -104,6 +100,7 @@ Discontinued architectures are shown in the following table. .It armeb Ta 8.0 Ta 11.4 .It armv6 Ta 10.0 Ta 14.x .It ia64 Ta 5.0 Ta 10.4 +.It i386 Ta 1.0 Ta 14.x .It mips Ta 8.0 Ta 13.5 .It mipsel Ta 9.0 Ta 13.5 .It mipselhf Ta 12.0 Ta 13.5 @@ -114,6 +111,8 @@ Discontinued architectures are shown in the following table. .It mips64elhf Ta 12.0 Ta 13.5 .It mips64hf Ta 12.0 Ta 13.5 .It pc98 Ta 2.2 Ta 11.4 +.It powerpc Ta 6.0 Ta 14.x +.It powerpcspe Ta 12.0 Ta 14.x .It riscv64sf Ta 12.0 Ta 13.5 .It sparc64 Ta 5.0 Ta 12.4 .El From nobody Mon Jul 14 15:02:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgltT19k3z61rcs; Mon, 14 Jul 2025 15:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgltS4C73z4Kf2; Mon, 14 Jul 2025 15:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6SW4knS54rkxRrXRIxgY6+Qhu7wdWNVpusRdhr/Wk0=; b=VYGEFrdkqqsLVUMYDIz+CD41B/UGWQVmLPFxfee1O/nWd91AUz+WlZvy+gkElU3Bl9S1qL BVmVzDLIvD85tCI/AZG2EU4iko233seod0c2rbnKzBv/y6HiGQ+jJebgSpqXCD8ewD9ldT FjLYQJI+oIxk1btOZjiKRRzpzJTznGDQKQPm+1BWKWcbTVm7ml3qmrjnP5/TnTiqq/PnMn lgzg34JPePE9inUsbqoxVLGcM7gBoM+3deryZzJkg21YyEw+2eXOzN8j66wSt9WBy1PTkK gftKXxd2ndglmgYZkfnXsTnzK+8LglaTLm2Efa73HfNRGcvVKJhg/CrjNRR/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752505376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6SW4knS54rkxRrXRIxgY6+Qhu7wdWNVpusRdhr/Wk0=; b=ievLglxBYMUf5H83wByWkaVmy9En2mWWIUSaylAO+R2xkPPg4Ayhfv4vERXvcRFjIICz4X nYhUnmKSd0CO2XAQbownAtM10kLvLjm1XNVa5y0Z7Y92pntk+jZibMzwX6hYH2LHeIh+fF mmBTZtU54eUdwXgFlgHYrrsF1SPg/qhdDql7yauyducHjlAfXPbo9CBA0s7vSkN8qRARPh 1+mvGATR5ZSiLMhPAGQiWOgde8hVSSuxIHlwep7PZ2Ga2kcUQwlxVvdBBfBIacb28kmTvp l90hzXYacRT9dqyGnIgbHF48EJBvTE3jaQJgQ1Hbpu08A9DG9iF9wDzUgQMBxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752505376; a=rsa-sha256; cv=none; b=kJzY4Yv1gIq+9sQztXp0VdPcWEF6EO/gfipmzIc8VfuMw+rsOWwbovhEjZeJs4pwzqKV/T 73ygef0H5O80xZhrZJuJeIqU8SyM7Q/7ZhRVNGTa79qUQ7XzIifs/ENq1zbr15tTM1ukgx QPVIVRWOblkZeymLeqDYrR1uSVyobS9AyHBILnpY1Jsrzf9ir6Dq53JOMf3XpSdbfPVraS voIMTEBF7SUi+6wOFghQTpEcoAbjz2Xyc4jaNiH2s7XKb76hnODoTKDp/zYbvEt/dmPzGj 1FwYTqeIqZhji/r85XXaLsAqZ0HafnsXnnE3uRuRwEGfKpbmChrmbcyAz8s3Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgltS3gM5zywQ; Mon, 14 Jul 2025 15:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EF2urm075634; Mon, 14 Jul 2025 15:02:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EF2uXj075631; Mon, 14 Jul 2025 15:02:56 GMT (envelope-from git) Date: Mon, 14 Jul 2025 15:02:56 GMT Message-Id: <202507141502.56EF2uXj075631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0d0d6378add2 - main - Remove stale reference to EXTRA_ARCHES_arm List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d0d6378add20d859a92a1eb3fa8b15f47806efe Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0d0d6378add20d859a92a1eb3fa8b15f47806efe commit 0d0d6378add20d859a92a1eb3fa8b15f47806efe Author: John Baldwin AuthorDate: 2025-07-14 15:02:15 +0000 Commit: John Baldwin CommitDate: 2025-07-14 15:02:15 +0000 Remove stale reference to EXTRA_ARCHES_arm Fixes: 7818c2d37c2c ("armv6: Remove support for building armv6") --- share/mk/local.sys.machine.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/local.sys.machine.mk b/share/mk/local.sys.machine.mk index e1a197e516e5..961362cb048a 100644 --- a/share/mk/local.sys.machine.mk +++ b/share/mk/local.sys.machine.mk @@ -7,7 +7,7 @@ TARGET_MACHINE_LIST?= amd64 arm arm64 i386 powerpc riscv MACHINE_ARCH_host?= ${_HOST_ARCH} MACHINE_ARCH_host32?= ${_HOST_ARCH32} -MACHINE_ARCH_LIST_arm?= armv7 ${EXTRA_ARCHES_arm} +MACHINE_ARCH_LIST_arm?= armv7 MACHINE_ARCH_LIST_arm64?= aarch64 MACHINE_ARCH_LIST_powerpc?= powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc} MACHINE_ARCH_LIST_riscv?= riscv64 From nobody Mon Jul 14 16:36:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgnyT2jkzz61xFh; Mon, 14 Jul 2025 16:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgnyT1SSfz41Gh; Mon, 14 Jul 2025 16:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752510993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k5TUfC3QeN1W5Ka974YaeeoPkh/x4dO0tZs0y2eEOpU=; b=mGPv0Bgip9+sBIYEA8tKCCoruz+UxHJ5jrFNdzulLINUTXo7ZyDIJS99ccOgL0dNjtXzDz TorP8/y7KFGmF3eIUSwYYR2fX9NogNkJdy9fgdZgzqnpqqAQt34sn8gG4f+GD/nZ5hcwYV pQERjbTp5+LeD7n31K/uO+u82ixrpcyPK6bjQv9kL5HDH+ucdzr1z/H/IiYdEiLIAadxCa iz2Bewj2KFNPOYXjILp4EOK5dSf9CQBJb92DoaVUxnCqP0bLpvdRcJO93bvDR/SYiCV9zY g//v0eTTWUw0U3jNrjLF+AwmKdP41XRN0q3f2uX3p76mNpruO6dErm3s9Z+Y7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752510993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k5TUfC3QeN1W5Ka974YaeeoPkh/x4dO0tZs0y2eEOpU=; b=Kj8v1vEMWNNEnxI3ZYMel2qzpyDXc/Mgyd0O30PV2SUURCqhmvY3ton/btUYP6sqsF9ikF lc3L2s3QWSeOsCNv0FtN73/Rd8vnX5dbDPZLCQ8LEKNJcSy3onZRXRRlXtQkViR49gaZp7 GkNwaZrn3+AlkqRKnd66Wsf0vSJqYb6k8l8PtSxoZAWihl2nCNHSdXPyQX3cl4OWEljKpn hdxI9qqYji39npgkqy9UlUY2ctn94YT8GkdCZYhWOk+lJOb5AzCPNbqUHm/3bIhu+gLPTu 1r1s+0aWpQcGFF6GImP1lFQqj+ya5/UjfWXmlmbAVI0ppujrUHCI3LLSpjwoyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752510993; a=rsa-sha256; cv=none; b=cXtuvujbCEZZzHsaIOVKBIT1WC4L+7IXlW/tn10bALRCLwRuVxxYqgu3E0J0ZUAS2mfhW+ ZF6oaWhYniOEd7zcrFj5W7GBkbsIGwol4GM5uiHOTNITkxbAnJEr00mVaKJbvZKfOzsbqU WdR2cR4inFAdHlqfL5CNhOZ6nJfStICgGpTzOTyrFF6NR+cYRPXJ0exkaE9AgvtOPEEujL uAZghwh0Efn61/o2ATI2Ko5KKZKYDAPnBgQDDxIRaLXC2HHUmp2RhWyLgLOemVsBetGAqX a2/NerdSYxCCswW5/478Jp1U3MpVQ5fj3HuNxxKTsHAnW3UlctMmV9DZjL/ruw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgnyT0dMdz12Nt; Mon, 14 Jul 2025 16:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EGaXpG045528; Mon, 14 Jul 2025 16:36:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EGaX8G045525; Mon, 14 Jul 2025 16:36:33 GMT (envelope-from git) Date: Mon, 14 Jul 2025 16:36:33 GMT Message-Id: <202507141636.56EGaX8G045525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 46efd2ceca73 - main - dtrace_profile.4: Document the DTrace profile provider List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46efd2ceca736a20f06a730921574065047c01fe Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=46efd2ceca736a20f06a730921574065047c01fe commit 46efd2ceca736a20f06a730921574065047c01fe Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 13:49:11 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-14 16:35:01 +0000 dtrace_profile.4: Document the DTrace profile provider Event: Berlin Hackathon 202507 Reviewed by: bcr, christos Relnotes: yes Differential Revision: https://reviews.freebsd.org/D51278 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 1 + share/man/man4/Makefile | 1 + share/man/man4/dtrace_profile.4 | 129 +++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index f3d7a49e0e78..bcd23c1789be 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -1229,6 +1229,7 @@ Invalid command line options or arguments were specified. .Xr dtrace_kinst 4 , .Xr dtrace_lockstat 4 , .Xr dtrace_proc 4 , +.Xr dtrace_profile 4 , .Xr dtrace_sched 4 , .Xr dtrace_sctp 4 , .Xr dtrace_tcp 4 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5648fd2c1a84..5e60f00bc09f 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -986,6 +986,7 @@ _dtrace_provs= dtrace_audit.4 \ dtrace_kinst.4 \ dtrace_lockstat.4 \ dtrace_proc.4 \ + dtrace_profile.4 \ dtrace_sched.4 \ dtrace_sctp.4 \ dtrace_tcp.4 \ diff --git a/share/man/man4/dtrace_profile.4 b/share/man/man4/dtrace_profile.4 new file mode 100644 index 000000000000..07f86663d60a --- /dev/null +++ b/share/man/man4/dtrace_profile.4 @@ -0,0 +1,129 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 14, 2025 +.Dt DTRACE_PROFILE 4 +.Os +.Sh NAME +.Nm dtrace_profile +.Nd a DTrace provider for firing probes at a given time interval +.Sh SYNOPSIS +.Nm profile Ns Cm :::profile- Ns Ar rate Ns Op Ar unit +.Nm profile Ns Cm :::tick- Ns Ar rate Ns Op Ar unit +.Sh DESCRIPTION +The +.Nm profile +provider implements three special probes related to the life cycle of the +DTrace program itself. +.Ss Probes +The +.Nm profile Ns Cm :::profile +probes fire on all CPUs and are suitable for measuring the whole system +periodically. +.Pp +The +.Nm profile Ns Cm :::tick +probes fire on a single CPU, potentially a different one every time. +They are useful, e.g., for printing partial results periodically. +.Ss Rate and Time Units +The +.Nm profile +provider probes will fire at the specified +.Ar rate . +.Pp +The default unit is +.Cm hz . +The +.Nm profile +provider supports the following time units: +.Bl -column -offset indent "ns, nsec" "Definition" +.It Sy Time Unit Ta Sy Definition +.It Cm ns , nsec Ta nanoseconds +.It Cm us , usec Ta microseconds +.It Cm ms , msec Ta milliseconds +.It Cm s , sec Ta seconds +.It Cm m , min Ta minutes +.It Cm h , hour Ta hours +.It Cm d , day Ta days +.It Cm hz Ta Hertz (frequency per second) +.El +.Ss Probe Arguments +The arguments of the +.Nm profile +provider probes +are: +.Bl -tag -width arg0 +.It Va arg0 +The PC (program counter) in the kernel when the probe triggered, +or 0 if the process was not in the kernel at that time. +.It Va arg1 +The PC in the user process when the probe triggered, +or 0 if the process was in the kernel when the probe triggered. +.El +.Pp +Use arguments +.Va arg0 +and +.Va arg1 +to tell if the +.Nm profile +provider probe fired in the kernel or in the userspace context. +.Sh IMPLEMENTATION NOTES +The +.Xr sysctl 8 +variable +.Va kern.dtrace.profile.aframes +controls the number of skipped artificial frames for +the +.Nm profile +provider. +.Sh EXAMPLES +.Ss Example 1 : Profiling On-CPU Kernel Stack Traces +The following DTrace one-liner uses the +.Nm profile +provider to collect stack traces over 60 seconds. +.\" XXX: Keep on one line for easier copy-pasting. +.Bd -literal -offset indent +dtrace -x stackframes=100 -n 'profile-197 /arg0/ {@[stack()] = count();} tick-60s {exit(0);} +.Ed +.Pp +The system is profiled at the 197 Hz to avoid sampling in lockstep +with other periodic activities. +This unnatural frequency minimizes the chance of overlapping with other events. +.Pp +Option +.Fl x Cm stackframes=100 +increases the maximum number of kernel stack frames to unwind during +.Fn stack . +.Pp +Checking if +.Ar arg0 +is not zero makes sure that profiling happens +when the program is in the kernel context. +.Pp +Refer to +.Lk https://www.brendangregg.com/flamegraphs.html +to learn about generating flame graphs from the obtained stack traces. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr tracing 7 +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter profile Provider +.%D 2008 +.%U https://www.illumos.org/books/dtrace/chp-profile.html +.Re +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%P pp. 24\(en25 +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . From nobody Mon Jul 14 16:40:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgp2c4w5Zz61xNf; Mon, 14 Jul 2025 16:40:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgp2c44rgz43gh; Mon, 14 Jul 2025 16:40:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752511208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JXk8meGUWqUxW8hKawe1Kc/i3b7g5N9234CbHUBgPMk=; b=oJQHXuSPviVMEiXwBVWPC5zB/kic5aM09HgPVAIbM/LXfZKq3ZEgyFA1MzTd2sok2CndNe fGv/EnESa0QWj2kwMkl5IwwtxN4LfPohaKtanUxJdyockUl8TpH305g7ryBQ6t2Ysda0lO rjljh9sZYcf+bfSUu+gG1unnk3+rrI2O5PHuzWWBSPerxY2VajvalnJVpZtL0IcFJs/ael S/omlY0NeWn3oKK8yZJ1LfgBW1UJXJ9qOVRmuXrOleCleuaty6po1/8Nbtt3PCALzkctMq roqKf7xmQTnQGO89n0WGtN9m/bfX34bkR+ppl3xuVty8kyL8HaxC4q2OIa/9QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752511208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JXk8meGUWqUxW8hKawe1Kc/i3b7g5N9234CbHUBgPMk=; b=jOD1GtvBxwANOpjCD7HPvEAcRNh1xZE1fIF/+xwjhHA0X75GUOckec0n6ZX1MWkhk8vsRr HQWwOn7TQPgTQ3l8LNd5Z9zxHtM8fA4kitchb5jkqpF0yMqKUm4n9/6GEneuXh0DsubISJ ZrA3t9iMd6kJF4NWqUPVAfEzP6cW+hjHOrCRH/mKV8AMMLb8Ux9g7U0mHOV37SGuHPIDKl ONR72pRJO5BGkRHe+5eid7u+7NCL13jFes9s86pf6YSs+8S10crFYjsCkmFfFLBQZSC26m 9tEBQS+Z81Xnld7AOQdcpZJiPEp2GdiKPrfxZyru+r8YJ4d6Gj83VY6/I014+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752511208; a=rsa-sha256; cv=none; b=snS3TOrkvJp+ssODC1J22T3R4OB8FF/zne6VVGGBaKLP6DAYKkb1JJNuak369jx5XWGP2A XCMtWz8VodmvkGsmN8cx4rqhu7O8QQNLYPXjzHC0vSvtBPHzQK1rffuHolFs2pBfrgc8c6 XklqLOvOR8/Sn9/ZcjRMjSj7CUjXSo5jweJKXk/GRxm5Yxsio8l5K4DPqcPPMMnI1frtPP ipdfbAKyMRqpqsgwek0viUt8tj0TDLhpUUu5KckiAl1DyXywxgX29snxIyarY9mgr7RdKH x/imJAh2GDzc5kUH9tatU1QP9fGVqjfxDWYMDyeZo9my6BHQ0xrAZRkd1+bsVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgp2c3H8cz11xy; Mon, 14 Jul 2025 16:40:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EGe8rq050097; Mon, 14 Jul 2025 16:40:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EGe8pM050093; Mon, 14 Jul 2025 16:40:08 GMT (envelope-from git) Date: Mon, 14 Jul 2025 16:40:08 GMT Message-Id: <202507141640.56EGe8pM050093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1fe7af063581 - main - dtrace.1: Document evaltime List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fe7af0635810a96a292638d11d25ddbe95bd581 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=1fe7af0635810a96a292638d11d25ddbe95bd581 commit 1fe7af0635810a96a292638d11d25ddbe95bd581 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-14 14:51:37 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-14 16:38:19 +0000 dtrace.1: Document evaltime Reviewed by: christos, ziaee MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51301 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 48 +++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index bcd23c1789be..d44ee5023e78 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2025 +.Dd July 14, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -617,6 +617,52 @@ Same as the flag. .It Sy dynvarsize Ns = Ns Ar size Size of the dynamic variable space. +.Sm off +.It Sy evaltime = Cm exec | preinit | postinit | main +.Sm on +Process create mode. +When using +.Fl c Ar cmd +to start a command, +.Nm +will first stop the newly started +.Ar cmd , +evaluate the +.Xr d 7 +program, +and then resume the +.Ar cmd . +The +.Cm evaltime +option controls the exact moment when this happens. +.Pp +The following table describes supported modes. +.Bl -column -offset indent "postinit" "D Program Evaluation Time" +.It Sy Mode Ta Sy D Program Evaluation Time +.It Cm exec Ta +Right at the first instruction of the command +.Ar cmd +execution. +.It Cm preinit Ta +Before +.Xr elf 5 Ap s +.Dq .init +sections. +.It Cm postinit Ta +After +.Xr elf 5 Ap s +.Dq .init +sections. +Default on +.Fx . +.It Cm main Ta +Before the first instruction of the +.Fn main +function. +.El +.Pp +Usually, there is no reason to change the default mode, +but it might be handy in situations such as shared library tracing. .It Sy flowindent Turn on flow indentation. Same as the From nobody Mon Jul 14 16:42:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgp5K0lqlz61xRP; Mon, 14 Jul 2025 16:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgp5J6gN6z45dV; Mon, 14 Jul 2025 16:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752511348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b7CpEeKp53vK3wzIgg6Rdw2CGYxxB7wbsd9fdeSvzZs=; b=pRSpIQQLa/fJvIiVhvbFcStK96z85jKoUGStubRRqk2BJfZdCg3JuWXm5zV410t5sB4k4E 1JwH0Rx2ENTGeY62ZE3Tz/akRhtE6gyo9uAdCFfqvXd2tnSuz1d108EjefObKbsBjiDd4Z wylgvkOiIO/S+FONP1oi+fwRmyIJtZHLYyvpQyKYwRg5NTZ3pxUC6EMsn3szerGtrw3Fda w/tRyGVQWHGljLfXp36gyFlHoaLh3QLF5ulPBPExe3sJeX8WwyrYTRJU0tlKbIDHH53Evg DcOTG6ouX4D/Z7yi3sORSTBM4C9vGX8PRFVGYiVAGvVrRD8yoqs1jtSYjIlPIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752511348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b7CpEeKp53vK3wzIgg6Rdw2CGYxxB7wbsd9fdeSvzZs=; b=YRYm1kAXlQSQn3nqVPVCHD7p3t15gI3FfOWC9SP+YkTy21u7OzTqLWoufu4t8VA9irciNA EUKLiT6wxptH8hBwojE3ZtPu8BoG2iPdFvk3aHU2XjwWnGmeNe/JBFnq5NVvliS+wW5pul Rr5GfpNp0LBSqPwff8olAwgGycj3HcpV+vIi19LFp7TAZ1VkSMgbZjuXMuz7FWdH1NT2tk DF/Goc1H0eb1fgiDEx3sdU5r0BqvWqGcJmQZQlPYaLhg3rUNIRYjPkP5s0j7DZx5Rorc5d Vd0cw+i83FxbljFzp/Bbio6gScx7WEh/spZTAjQo7qoUcJGIu62R1FwZosHSIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752511348; a=rsa-sha256; cv=none; b=xQSmYASNJA+Wry4ZXij9nVLuEUvn8Yp9FZpQPiQi306z0uQNXvQbFf5gn3TFl9vYTWWZGH dr4T363Ucla/J/OBZFeuznpv7Q0mjcqyfwpaNKquC+m6We7emaFTbkGOMkEjeEVlgnV/dP 70YW4agBsmsky9JGD3mrFL+DdjLXUkd3+iBZ/INBTQ+3GyIxw7z4ama2ZVwNg/V+xJJbg7 gZey/AVdDvHgiB2Oamg4GxUZKYQqH0z8EOIAjP/06bhNj6q3rf/NuHU+xc93eW197/HZBC y9/Wz/utYhzoex8c7nD9HzJbprBjwiCCQ2KS8EkiyxKj9vjjw/oh2VlTvxrTKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgp5J6H3Vz1228; Mon, 14 Jul 2025 16:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EGgSMQ063563; Mon, 14 Jul 2025 16:42:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EGgS2T063560; Mon, 14 Jul 2025 16:42:28 GMT (envelope-from git) Date: Mon, 14 Jul 2025 16:42:28 GMT Message-Id: <202507141642.56EGgS2T063560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: ab9ee52e849c - main - tracing.7: Shorten doc description for apropos List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab9ee52e849c02cf905830d43f2153cdd9ca32bc Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=ab9ee52e849c02cf905830d43f2153cdd9ca32bc commit ab9ee52e849c02cf905830d43f2153cdd9ca32bc Author: Alexander Ziaee AuthorDate: 2025-07-14 16:40:34 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-14 16:42:21 +0000 tracing.7: Shorten doc description for apropos Shorten document description to fit on one line for the beautification of apropos results, removing only the search keyword "facilities", which I think is unlikely to cause discoverability regression. MFC after: No (please mfc if mfc'ing tracing.7) Reviewed by: 0mp, bcr Differential Revision: https://reviews.freebsd.org/D51284 --- share/man/man7/tracing.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 index f3e3a5bf98c4..7085bac78385 100644 --- a/share/man/man7/tracing.7 +++ b/share/man/man7/tracing.7 @@ -8,7 +8,7 @@ .Os .Sh NAME .Nm tracing -.Nd introduction to tracing and performance monitoring facilities on FreeBSD +.Nd introduction to FreeBSD tracing and performance monitoring .Sh DESCRIPTION .Fx features a large variety of tracing and performance monitoring facilities. From nobody Mon Jul 14 17:52:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgqf35Vyrz621mK; Mon, 14 Jul 2025 17:52:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgqf32MlBz3qbw; Mon, 14 Jul 2025 17:52:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752515547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GChz5a+7iFk8IUdOYPUh5rpteuCe6Qfb0h5n9U12O1w=; b=e2qpB/zFP/rUZ+KeLOiMAFJGcsjDdl+nwkS4uU5rxvil0h6/QegM5RANHwXHde/+n4VdfL Q7kSDBj6NFtxy0LqeZhBbDl3RIXy8yJRmOs8aYAC0AxG/ADK6KfQCuZA5s6RJ0s/AhaKg5 JkQ+noEVXWZQTa5gmpVIZ8rQR3RtxWwTfhpk92vPsphqKfSQhKqkW/723U33/4li0gLeBu cOm7rXeUr7Haw44pJw8GCnhOnPL2MIllabX5qDSwwscvSwTLKXDe+7wDAAQcAeQKEwdPBJ xaSs+A4436y3oD38Qay16moHr6vpCzBfVIBgcuwy5/96Iv7ojXtyUjcZUanptg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752515547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GChz5a+7iFk8IUdOYPUh5rpteuCe6Qfb0h5n9U12O1w=; b=iGuLWdauNJ6iaIQ0rs/T6F1a2Ho7k+EVESugBrekBTh1zN8ZC8K02lD/QxhxgSWDDMpDNi 2RNKHEze1+KmJg8YlozBofp+Xb9IfzgkpOcKMea3N4+IQG+T2ylJkTPCBNyswt1R6EAgfc E081W9Y9dHbgAyTq7fPBD83spX4uOe+PHw+cVzh3Db7/WaDNqk2lBmy7nGvcCVnYzYTUD/ n5SIOnBHaY54fhJvv/ekAGuLOqrQo1pJPxTQKfYsuh+jRWLPlWH+K7jy73c45FxmkyipCs ImsiCIuxeIcFK5K/RjmYnnDcb++xtfsitscLvC2cXvmTHhX2HB79USmpjSx7HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752515547; a=rsa-sha256; cv=none; b=ZYjPSdcu3k+a4OhTf7bOTddJvN3oAcG9pmS1MZG6+BCUa2sPY94dnGGbR6tpk/ilGxDgva +Rw1RmNfO9BaOemQmmCybA6flkW+sLUpRVRzQSbuuofxc/SFGouQ8iOBKLxBPqYBXcUaMj hd1ytEBqIbn1Q6kTEz1t1+4xFS1eY2NSxRxij4XB4KAvKxnXVPLkrCXGHK5qYM2weI2nqT qghcEQi5XRnOHUOhOE1g6LOQkzkv+buz6eDEXUKk+Ifo4xoC0uKuyUG7X0EcvDU6RrhLRg ohBroRcK+mokQApzRHyNQDTmunndkQxFQn/oW0wE+X1jjsk4DH2v/AwGsUGtrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgqf31zM1z13dt; Mon, 14 Jul 2025 17:52:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EHqRfr095914; Mon, 14 Jul 2025 17:52:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EHqRvs095911; Mon, 14 Jul 2025 17:52:27 GMT (envelope-from git) Date: Mon, 14 Jul 2025 17:52:27 GMT Message-Id: <202507141752.56EHqRvs095911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: b87dcd700499 - main - find.1: Correct HISTORY grammar typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b87dcd7004993417cf711f20a0924e3a768ae116 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b87dcd7004993417cf711f20a0924e3a768ae116 commit b87dcd7004993417cf711f20a0924e3a768ae116 Author: Jeffrey R. Day AuthorDate: 2025-07-14 17:50:51 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-14 17:50:51 +0000 find.1: Correct HISTORY grammar typo PR: 286292 MFC after: 3 days Reviewed by: ziaee --- usr.bin/find/find.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index eb3fd4d0dbde..8c2d8624a82a 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -1156,7 +1156,7 @@ and was removed in .At v3 . It was rewritten for .At v5 -and later be enhanced for the Programmer's Workbench (PWB). +and was later enhanced for the Programmer's Workbench (PWB). These changes were later incorporated in .At v7 . .Sh BUGS From nobody Mon Jul 14 18:01:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgqrx2R21z6224T; Mon, 14 Jul 2025 18:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgqrx1g57z3wYx; Mon, 14 Jul 2025 18:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752516113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dloCoyNxqiwWgtgm7rvsdaJLzRMqobslWlySED8DHLs=; b=mX/FZlj9hg6Lc6F9rjBptEmpG+3FTFdrDvX5stx52QUXnT0+C8MewBR8rxJHHdmGAvQyY+ /n7Bzm38WnCUab5q6Z2zVTa5GKkXvuIM8SNZtiG03TpnYzB8pynBiv2i+Xj7KcMJVX9bT0 qSSkkfN4JIpVt9G8X8kCh7N118aQIVxIHlThKTj/Cha+E+lsHEUrkZenWTzLGbzCshLh6Q 3fJxwK9uB4ANB9GVAzKorTqrzGfxz/guJCEr7fMJ6QP35Oiqi5YHR5XUDeoRWAgJOAOS5r gAWC2HjFS9Joo4fjvA6y/tbtOacn35lBnyIvI0vJX/VBiOkgHNDqZy6TcKNfHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752516113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dloCoyNxqiwWgtgm7rvsdaJLzRMqobslWlySED8DHLs=; b=fM8TNrTj2uh5qO4oFxg2VvMl1sUV5LG3qsiZcqjOlK56WmD8pkaWdLTmss8/FBolIAbmcr D1u51bV1lR8zugVC7SB/s02xdryUdtqj6JmXEwowP5bU/SrEd/YzDFPePbBluL++7rURJh BEbuoTOpcWmGOpAgcLohnjBl+rLcCDMY0Mawd0qHkLk1TZn9WziuZatFTR3OEIggZED4Ny RgcwBZHUAO2VErVVvc03EoGOGfHieqjKGfuWd+/QuhdJOZDw32ZjVSsndnbCWnepAO9IEZ Pu7idEjnsWuhb54BK25dbf4LI3yVZ7xdL9szc2si1ZTmbo+2rRk9boqxGioyvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752516113; a=rsa-sha256; cv=none; b=tv19845ccgrNilyyCLb8MY3e/qZshudu+tUnvPBQH49i+oYWZPNyyVlwzDSLw2vHjeT1wq WxsdmkaH8yx10/Ruaz4iCpx3EJDswfOTtjQOAhKHwZ+z4KWOxRIsYYNpncusVUwlkdyIa7 QcRbfHVzDt6GzjXgvQcHTMwxTZ8lCkMADSrrIbX0AJWFcYyJk295lS2XyKmr9kzqyGthuE W81O6zaIdxSgWH+U5UICZMGgBZoHguWpleljXmiYpakPSoRdZxEh7hUZd+thX+u159ECh1 E7xySsaJcgiuJLiCZ+qZxJvzEBgk3OaZusmp7ODFZ3gtGB6t7IUgSpE9hZjUYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgqrx0rMVz14M3; Mon, 14 Jul 2025 18:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EI1rbN011554; Mon, 14 Jul 2025 18:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EI1rDt011551; Mon, 14 Jul 2025 18:01:53 GMT (envelope-from git) Date: Mon, 14 Jul 2025 18:01:53 GMT Message-Id: <202507141801.56EI1rDt011551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a3207059d5e5 - main - src.conf.5: Regen after retiring some 32-bit architectures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3207059d5e59747a1d85baffa795d1035a94e39 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a3207059d5e59747a1d85baffa795d1035a94e39 commit a3207059d5e59747a1d85baffa795d1035a94e39 Author: Ed Maste AuthorDate: 2025-07-14 17:56:27 +0000 Commit: Ed Maste CommitDate: 2025-07-14 18:00:21 +0000 src.conf.5: Regen after retiring some 32-bit architectures Commit 4a3fb7547e6b ("powerpc: Disconnect 32-bit powerpc from make universe") changed the default architecture lists. i386 hasn't chanaged as only the kernels are disabled; i386 is still included in TARGET_MACHINE_LIST. Sponsored by: The FreeBSD Foundation --- share/man/man5/src.conf.5 | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 63e9f471f1f1..a3db00aed42f 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd July 5, 2025 +.Dd July 14, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -493,7 +493,7 @@ Do not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/armv7, powerpc/powerpc and riscv/riscv64. +arm/armv7 and riscv/riscv64. .It Va WITH_CXGBETOOL Build .Xr cxgbetool 8 @@ -655,7 +655,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_EFI Build .Xr efivar 3 @@ -687,7 +687,7 @@ Build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp This is a default setting on -arm/armv7, arm64/aarch64, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, arm64/aarch64, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITHOUT_FILE Do not build .Xr file 1 @@ -750,7 +750,7 @@ Do not build HTML docs. Do not build or install HyperV utilities. .Pp This is a default setting on -arm/armv7, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_HYPERV Build or install HyperV utilities. .Pp @@ -916,7 +916,7 @@ On 64-bit platforms, do not build 32-bit library set and a runtime linker. .Pp This is a default setting on -arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, i386/i386, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LIB32 On 64-bit platforms, build the 32-bit library set and a .Nm ld-elf32.so.1 @@ -935,7 +935,7 @@ arm/armv7 and riscv/riscv64. Build the LLDB debugger. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LLD_BOOTSTRAP Do not build the LLD linker during the bootstrap phase of the build. @@ -1038,7 +1038,7 @@ with support for verification based on certificates obtained from UEFI. Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_GELI Build GELI bootloader support. .Pp @@ -1048,7 +1048,7 @@ amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. Do not build the 32-bit UEFI loader. .Pp This is a default setting on -arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LOADER_IA32 Build the 32-bit UEFI loader. .Pp @@ -1058,7 +1058,7 @@ amd64/amd64. Do not build kboot, a linuxboot environment loader .Pp This is a default setting on -arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, i386/i386, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LOADER_KBOOT Build kboot, a linuxboot environment loader .Pp @@ -1068,7 +1068,7 @@ amd64/amd64, arm64/aarch64 and powerpc/powerpc64. Do not build LUA bindings for the boot loader. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_LUA Build LUA bindings for the boot loader. .Pp @@ -1083,7 +1083,7 @@ amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. Build openfirmware bootloader components. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LOADER_PXEBOOT Do not build pxeboot on i386/amd64. When the pxeboot is too large, or unneeded, it may be disabled with this option. @@ -1104,7 +1104,7 @@ amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64le and riscv/riscv64. Build ubldr. .Pp This is a default setting on -arm/armv7, powerpc/powerpc and powerpc/powerpc64. +arm/armv7 and powerpc/powerpc64. .It Va WITH_LOADER_VERBOSE Build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. @@ -1309,7 +1309,7 @@ Do not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/armv7, powerpc/powerpc and riscv/riscv64. +arm/armv7 and riscv/riscv64. .It Va WITH_MLX5TOOL Build .Xr mlx5tool 8 @@ -1401,7 +1401,7 @@ Build the InfiniBand software stack, including kernel modules and userspace libraries. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_OFED_EXTRA Build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" @@ -1412,7 +1412,7 @@ Enable building LDAP support for kerberos using an openldap client from ports. Do not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/armv7 and powerpc/powerpc. +arm/armv7. .It Va WITH_OPENMP Build LLVM's OpenMP runtime. .Pp @@ -1465,7 +1465,7 @@ is set explicitly) Do not include kernel TLS support in OpenSSL. .Pp This is a default setting on -arm/armv7, i386/i386, powerpc/powerpc and riscv/riscv64. +arm/armv7, i386/i386 and riscv/riscv64. .It Va WITH_OPENSSL_KTLS Include kernel TLS support in OpenSSL. .Pp @@ -1502,7 +1502,7 @@ Do not build dynamically linked binaries as Position-Independent Executable (PIE). .Pp This is a default setting on -arm/armv7, i386/i386 and powerpc/powerpc. +arm/armv7 and i386/i386. .It Va WITH_PIE Build dynamically linked binaries as Position-Independent Executable (PIE). From nobody Mon Jul 14 18:33:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgrYX4cTjz623nP; Mon, 14 Jul 2025 18:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgrYX440Mz47NJ; Mon, 14 Jul 2025 18:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752518016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ASKk3PueNoV68RlH4McYUvOvWLtsYbIU1ptGq+9YkFU=; b=Qqv8+TdoMYAbKLLlFzrj5YFnW3Wa/wH9RYC4knvh5FdgrUtXKlaYyJvV8lUVjtbw+cB1wn 2tcvEodZ1VdX8z0WxEOj7SNugArt/tQpV38QFqIPuDHr4l0MIpHSHHvS/sMrHjtmtNQTJr pzj1qIWpHyH95ktzwYd3oir/XrfVTh3DI0OlYTYfv2aHxOE15zUHgUbbA6E85DsFoOZ44N ujGgOfRmGsq8u5ri4Vmz7nrvyfFpHwpVaRSGAf6jQI+UKHLvOhPNwQEvEUXtsloC/eFRIZ nu2LsDjSNfDMre9/a3CBGTsF83qNcdVT8vsfeyVg5sZtbkcYnCrAI17L4sX2yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752518016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ASKk3PueNoV68RlH4McYUvOvWLtsYbIU1ptGq+9YkFU=; b=KFhUAOO+/CsRucfTsApV2v9GmADB/nUMtr65ig1oAD1tfqEnhBWu2hkjiqp7L8Ea7AQbrS QQ40+HSLyzLHd9OSd0/Fx/hacMKqBvAB4gh9GPHqxlUAF+AZRiLZxH3q663Zj//ssfawBn HSQR8+xzjy+fa/VniRv6fI+sxyT1O+e10DdSrLO8jMfewL3y5AcdiR4bMqeCbEdmvolCq2 7NVwqf2dWtOQ1x66PcakK7RFx35UmP96Vl5gPnYZ2SH33ut5Bir88VG/G67MTPalhds/R+ AbLKk+7TaAXSFpBnKCH8yultFxXWJ9UlsyeicFXpzhD360VhYzSlVjxeZtF4Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752518016; a=rsa-sha256; cv=none; b=y1Ii6NlRp2mDoZaum5XfgtwkQJQiDdv5mgjUD+NaUMDo9e4p0AVwY+vq0TBoelml+qhX+W VZBbLd2XtgtgYFPki5JcbpKDa43xdUP7bulamcEjZrF2gr/wq/ZhV4AfuzJE8wjTdYJMoZ k4SLNYD+5HBcjpAX5Z52/Mmmyg6bcvIK7t2sm4p3pGDt9FpgMfFxN/7gWqEcGmpUNL1d5l xS4OOtXGiDMwnSvTobiWe4jRYFVrOEMRqpCHQjPzmHcTtSluX4h18YBFTtt3NwOfUnHYAy hXmhYIXPgznaUfkD4aI+aHd15f3fVBNWu4ySbVaZdb9Swa5ddtf51wo6j9LEsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgrYX3MWfz15KZ; Mon, 14 Jul 2025 18:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EIXaHb072179; Mon, 14 Jul 2025 18:33:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EIXaXH072176; Mon, 14 Jul 2025 18:33:36 GMT (envelope-from git) Date: Mon, 14 Jul 2025 18:33:36 GMT Message-Id: <202507141833.56EIXaXH072176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: bdb44a47b71e - main - d.7: Refrain from unnecessary time travel List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bdb44a47b71ed706ed63b9e3afda7a4479f4eaa5 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=bdb44a47b71ed706ed63b9e3afda7a4479f4eaa5 commit bdb44a47b71ed706ed63b9e3afda7a4479f4eaa5 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-14 18:28:40 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-14 18:33:06 +0000 d.7: Refrain from unnecessary time travel Fix a typo in the manual's date. Reported by: Gary Jennejohn Fixes: 193f2289fc9a d.7: Document the DTrace scripting language --- share/man/man7/d.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/d.7 b/share/man/man7/d.7 index 30efb0249a77..f4686d98b1d1 100644 --- a/share/man/man7/d.7 +++ b/share/man/man7/d.7 @@ -3,7 +3,7 @@ .\" .\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> .\" -.Dd July 14, 2025 +.Dd June 14, 2025 .Dt D 7 .Os .Sh NAME From nobody Mon Jul 14 21:18:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgwDD2Mh6z62Cr6; Mon, 14 Jul 2025 21:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgwDD1qSVz3JPL; Mon, 14 Jul 2025 21:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752527932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UyYstU6eQKAg1IBZrIN1nfFVTWx5+J4VA20JMKVPQU=; b=vNycy8u+iU3lSdMPOCvxgVLJsnJ6YNmT+hpWZUFOrxA1ACJtutWGji9lXkwC9AqgJCggkV OMNLdm7PHRZTW5c4Hp9rg35/ppiOsm8Gg3AcpJOsXtctsXCaoq7Xxy2q6ViL7iF9ku3+xQ T+WXmlhIJZwvMVpsxiVZlmjAQZHRhkFeVqz4vo/zVf7GCbT1+VoQGgpFzsQCgqbbVYq3Js VqrqDbdMtatrNddOY/WIkahwBTAq1fy51Wwn9OLh+htiJ4fLSQWbyOxnOnN075NVhkXkcD Qpdpw882V0g9B2ehHxV6qgLUZ/x82fv8hPKyXqtgftqgax+epmoNf3F+jk9Ung== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752527932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UyYstU6eQKAg1IBZrIN1nfFVTWx5+J4VA20JMKVPQU=; b=KiAMnM9BIPCvePdpIWgOgmD+AKCsKwRZ6SW9RBbmc9rENcnQu1ub4ceA9kPOXDkiP1obMY lDUt0fAcNgoggpYXUrhsP0v+/XVK0ZlYRH+ooAV+5mooWrxip5Xmi5BZVwALLYQ60oNMfn F6NvE6nqpZgBrIt/l6rfDSe1wxqSaJ4CyzWP4lhsq96njUhoxassdRX77FFNbGXQG2APbP I925h9q1i3reD/4hBYpx9EsENm9Qz+i5dpULoiG4arziEjRL00BFGCegQPJgmOb+OF1yDl wEEbT1Rt47Fj8COS3po1oSlH62rzgOQ1ytJQRmr0i/DECTeMZhLPHLAAJcHwmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752527932; a=rsa-sha256; cv=none; b=HZS0uwu0Y/Vlc5rU52+04a1Ck63N7lD+8TZxbZMKEWqilIgRrPpVXxeBv67/MyWgGuezIW J8wjQN20+Amqcz5/lD3rqWRAOWNGBU09+Tnm52GOjZBF1qHjB8YV9hgrUr13ZbVJY7IZzS QHc7a3cJZfVWytnlpOMLaG0xWgYoENaBMNhrYR/z+hHzW4mUsY0VqR8IShpy6/70MWfKi/ iQdQz3rzAYZ/2jTeo4CWdVxcJBmc+uKx/q+1+em8hyjRO1aHBuKqigPlkKzN5b+6c8qeCL FAZI3uftaFFr/0MNRt9gV3GeXMPDL0f82V4Oo2DIB6+VloYM9ueXIN60mmOAqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgwDD1Lxvz19BX; Mon, 14 Jul 2025 21:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ELIqvb075831; Mon, 14 Jul 2025 21:18:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ELIqXD075828; Mon, 14 Jul 2025 21:18:52 GMT (envelope-from git) Date: Mon, 14 Jul 2025 21:18:52 GMT Message-Id: <202507142118.56ELIqXD075828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: fbc4e90c5ca6 - main - nanobsd.8: Shorten title for apropos, tag SPDX List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbc4e90c5ca6186ade53d29bf3e69aab6ad1cbc3 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=fbc4e90c5ca6186ade53d29bf3e69aab6ad1cbc3 commit fbc4e90c5ca6186ade53d29bf3e69aab6ad1cbc3 Author: Alexander Ziaee AuthorDate: 2025-07-14 21:14:40 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-14 21:18:32 +0000 nanobsd.8: Shorten title for apropos, tag SPDX MFC after: 3 days --- share/man/man8/nanobsd.8 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man8/nanobsd.8 b/share/man/man8/nanobsd.8 index 2ba072541ada..838f9ddc9afa 100644 --- a/share/man/man8/nanobsd.8 +++ b/share/man/man8/nanobsd.8 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2006 Daniel Gerzo .\" All rights reserved. .\" @@ -22,13 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 10, 2024 +.Dd July 14, 2025 .Dt NANOBSD 8 .Os .Sh NAME .Nm nanobsd.sh -.Nd utility used to create a FreeBSD system image suitable for embedded -applications +.Nd create an embedded FreeBSD system image .Sh SYNOPSIS .Nm .Op Fl BbfhIiKknqvWwX From nobody Mon Jul 14 21:23:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgwKV51bkz62D9h; Mon, 14 Jul 2025 21:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgwKV3DNdz3MJD; Mon, 14 Jul 2025 21:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752528206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bmsOogoUr3+kgqxsRhnDmeKK3ysR34Q42VTO48eGaN4=; b=qPE67Muwlynyojx8ps/ieNKIcYIwRi2qtPIRFf/8Iz8PBS/uUKLg1clFRMJJI80aO3gezo D1SBQbANuIsMeS14vyl59kBQoADf4ebbKoczIarEPw0J6gXtzj1cSWBEEAlITHwI9Lyvxw KfByOOh2Xioj5g2tn22HoBrzC1V5WiCo6SYShsdZb9rkc6UtrjoGMXNmv0f0bz/MjgWZYa zofjXlAv428Q+cftYVTslg8+fnuXQwfhaApP3g/JS6xt7QA25Q6lgJL9AZqr50Pob+9ATA xKybg5VGwA8XBWdMc5d33WiDFy75usSEhcKtQQX2qOusKQRR6fJ1LDFeEmBFPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752528206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bmsOogoUr3+kgqxsRhnDmeKK3ysR34Q42VTO48eGaN4=; b=RRBELPNfEPOLoC8YY2t5Mr2hT/bzkdE/MZuXu7S7ivV5gNZZoN8bk2DYWPcVsT6l/pSdi0 5otlrDBX2IBTsFt64tGHArBh1/zfTMyV/v6fn81nFT3LDT/U3OZxpc9hs1Bfj6TZs56A0R brUFBM+F5NRQIaDewuACaZ3CfbVba+es5HrHWOmRuD4UPwzri9i5KmHTsCL14IUnkfoznP X4lCmuAhBEg6nrlYQaP6XcUADvqYP64/cCXsSrtLyBkMCHrwZfvRbrHSQJPjUziVJy3UMk Wzo/fpK7K1E0Vl01o3OKe/kjAL3Bm1AR9P4E3oF53KxAuMvOal+r8qJAk6Nf7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752528206; a=rsa-sha256; cv=none; b=uXEIh41adQpcG6dMY/B9Tb4vaEBl9yusbeztxW/gG4pr3w5x/HxvJp2aXzrimBP5bogr+f T6BJCeeFZcNbc/6SDVr9/QkhqN0f39u5ZCWudAUYdu+RftpqQCzAVecUtRkvd5Ur2Y/6Fv bB8WS7ehhXDxYdlhTjvgArnxk5Tu4GMUKJqS5v76zOZJ+JrqFt+AAFUoqnwQPBnC7qRDsK qiwLA+3MC3r6cMbWnG5w3scYgm92z+7IFZMoamo5Qk9cbv7IZiLxoCAodr5MfkLAC4Hv50 1Cr/BboqY/Q+fPTy0k0FO8gWpICWTMspooOmwDnlww8ftGEhQo3F/UtqWqP76Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgwKV2pBYz19Pd; Mon, 14 Jul 2025 21:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ELNQEd092734; Mon, 14 Jul 2025 21:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ELNQxK092731; Mon, 14 Jul 2025 21:23:26 GMT (envelope-from git) Date: Mon, 14 Jul 2025 21:23:26 GMT Message-Id: <202507142123.56ELNQxK092731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 8f480d007526 - main - style.Makefile.5: Remove title macros, tag SPDX List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f480d0075263ff354212ce0558ee811ce62ff09 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=8f480d0075263ff354212ce0558ee811ce62ff09 commit 8f480d0075263ff354212ce0558ee811ce62ff09 Author: Alexander Ziaee AuthorDate: 2025-07-14 21:21:12 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-14 21:22:14 +0000 style.Makefile.5: Remove title macros, tag SPDX Title macros are discouraged in mdoc(7) because they are not portable. While here, remove a redundant "file". File is still in the title twice. MFC after: 3 days --- share/man/man5/style.Makefile.5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index cc5d2f6bb28a..fe8754924575 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 2002-2003, 2023 David O'Brien .\" All rights reserved. .\" @@ -30,10 +33,7 @@ .Os .Sh NAME .Nm style.Makefile -.Nd -.Fx -.Pa Makefile -file style guide +.Nd FreeBSD Makefile style guide .Sh DESCRIPTION This file specifies the preferred style for makefiles in the .Fx From nobody Mon Jul 14 22:03:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgxD46PBzz62G3X; Mon, 14 Jul 2025 22:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgxD34q31z3m5J; Mon, 14 Jul 2025 22:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LBiH2aiPsDkalLjmeX8FqTUKXxxcAWQMYzl+ffmTEf0=; b=aX4iJQ53AewyXrH0JSCRrzHU7TtBylvGd0Vy0b1TCxO84lAnPKCe4u9PIN/+VhV0jVzKVH ntKeF3BGsfh1dumOsYGCru+YdsU81qCBNIhgfsgWxssblVD2uISQTnShjcq/A+VFhsg4bh REKFxnLYb8zP4lSM4vNGI3chHOnhnC2rJbtY+3VuVeeXKc8j2Tn3/+ZhNQ3X76zWVTghz+ MuiIvkfug4g2oSjKryq91SsOzYPn4nwCN2iRIT2GgGz4kuy6uINQx3DPQE350VESxSeJxd 1LnQsjYf4LJdX3kS96Q8h4H/P0HCeNRRKHDh5RMNfAle8B8mCYizAWoB8nPb9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LBiH2aiPsDkalLjmeX8FqTUKXxxcAWQMYzl+ffmTEf0=; b=CJCUMR4xmVERMwl7qP0e5VCj8mCaHq+zKsgSRm7dT6zCqu6PZTPWLX5Jdajh5IHv+602Wt qpYtcvGlFXJXgGO/oXayx9zaXCEERofeGDGhcRKnseRlevxmgd90ik9ZSsCH1aq8eQY03Z 2ny2o8ARl4GpBpQlaVJximK4Hf4IgtqI8CyQEYFm3cynNnCSbHO6NGO00rsIumV44ayQYO pybqUDNICFUU1zgbqYLMzZ7HFioKrXC1/7Fkt5SwwkSU/z/DofneuSwDSjxj4D7Fs0mjHJ romiTUMvMT8h4y1LDXGODEW18WvPnO1GQIZW/QWLH+QO+jmkHmVjyGIEKHdUQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752530627; a=rsa-sha256; cv=none; b=mdrpO43lHPnWYhhPYvYMDkHDZ9ClwdvtdQS0pc8CT3YXTiErgz8+NR19ItKokpElAXLNY0 N7XtX/T+6vPECuH3+weo1HV3X7a9TiP72dQpDBvolLi5m7DQkN0SFIBtcvyqTZhQrHUW1Z jWo/b394kLli+DR+6zhsY0OItlZWVSWEgWiNdOb89RDKuhsxJZe+6i9O+YcOxlXVVvN3WG 8F5QBHh3mquxYzX+4IU0l1fRjj0YwWGzIOQJBIXF9zUG2fNoscOr7EnFzuiQJ+L2DQScQc 2imAFkej9a45WaB0NikhwijQ5vc44VTjlsIUfikFH6PaHLAXQAnXGWKAHP/7Sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgxD3483tz1BQQ; Mon, 14 Jul 2025 22:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EM3lIM070598; Mon, 14 Jul 2025 22:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EM3lOw070595; Mon, 14 Jul 2025 22:03:47 GMT (envelope-from git) Date: Mon, 14 Jul 2025 22:03:47 GMT Message-Id: <202507142203.56EM3lOw070595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4dd828c80828 - main - amd64: add kva_layout List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4dd828c80828637452a8a4e07a64e294c82e5d8b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4dd828c80828637452a8a4e07a64e294c82e5d8b commit 4dd828c80828637452a8a4e07a64e294c82e5d8b Author: Konstantin Belousov AuthorDate: 2025-06-15 21:39:10 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-14 22:03:28 +0000 amd64: add kva_layout Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51085 --- sys/amd64/amd64/mem.c | 4 +- sys/amd64/amd64/minidump_machdep.c | 10 ++--- sys/amd64/amd64/pmap.c | 77 ++++++++++++++++++++++---------------- sys/amd64/amd64/trap.c | 2 +- sys/amd64/include/param.h | 5 ++- sys/amd64/include/pmap.h | 12 ++++++ sys/amd64/include/vmparam.h | 26 +++++-------- sys/vm/vm_kern.c | 9 ++++- 8 files changed, 86 insertions(+), 59 deletions(-) diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index 413b7c74890e..851f2df0e6e1 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/mem.c @@ -105,8 +105,8 @@ memrw(struct cdev *dev, struct uio *uio, int flags) * PAGE_SIZE, the uiomove() call does not * access past the end of the direct map. */ - if (v >= DMAP_MIN_ADDRESS && - v < DMAP_MIN_ADDRESS + dmaplimit) { + if (v >= kva_layout.dmap_low && + v < kva_layout.dmap_high) { error = uiomove((void *)v, c, uio); break; } diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c index 6d0917e16099..43bf81a991bf 100644 --- a/sys/amd64/amd64/minidump_machdep.c +++ b/sys/amd64/amd64/minidump_machdep.c @@ -186,7 +186,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) * tables, so care must be taken to read each entry only once. */ pmapsize = 0; - for (va = VM_MIN_KERNEL_ADDRESS; va < kva_end; ) { + for (va = kva_layout.km_low; va < kva_end; ) { /* * We always write a page, even if it is zero. Each * page written corresponds to 1GB of space @@ -279,9 +279,9 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) mdhdr.msgbufsize = mbp->msg_size; mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages)); mdhdr.pmapsize = pmapsize; - mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS; - mdhdr.dmapbase = DMAP_MIN_ADDRESS; - mdhdr.dmapend = DMAP_MAX_ADDRESS; + mdhdr.kernbase = kva_layout.km_low; + mdhdr.dmapbase = kva_layout.dmap_low; + mdhdr.dmapend = kva_layout.dmap_high; mdhdr.dumpavailsize = round_page(sizeof(dump_avail)); dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, @@ -323,7 +323,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) /* Dump kernel page directory pages */ bzero(fakepd, sizeof(fakepd)); - for (va = VM_MIN_KERNEL_ADDRESS; va < kva_end; va += NBPDP) { + for (va = kva_layout.km_low; va < kva_end; va += NBPDP) { ii = pmap_pml4e_index(va); pml4 = (uint64_t *)PHYS_TO_DMAP(KPML4phys) + ii; pdp = (uint64_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 15a812fefbaa..c5f3176f8c37 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -415,7 +415,7 @@ SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, static int ndmpdp; vm_paddr_t dmaplimit; -vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; +vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS_LA48; pt_entry_t pg_nx; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, @@ -480,6 +480,18 @@ static int ndmpdpphys; /* number of DMPDPphys pages */ vm_paddr_t kernphys; /* phys addr of start of bootstrap data */ vm_paddr_t KERNend; /* and the end */ +struct kva_layout_s kva_layout = { + .kva_min = KV4ADDR(PML4PML4I, 0, 0, 0), + .dmap_low = KV4ADDR(DMPML4I, 0, 0, 0), + .dmap_high = KV4ADDR(DMPML4I + NDMPML4E, 0, 0, 0), + .lm_low = KV4ADDR(LMSPML4I, 0, 0, 0), + .lm_high = KV4ADDR(LMEPML4I + 1, 0, 0, 0), + .km_low = KV4ADDR(KPML4BASE, 0, 0, 0), + .km_high = KV4ADDR(KPML4BASE + NKPML4E - 1, NPDPEPG - 1, + NPDEPG - 1, NPTEPG - 1), + .rec_pt = KV4ADDR(PML4PML4I, 0, 0, 0), +}; + /* * pmap_mapdev support pre initialization (i.e. console) */ @@ -549,8 +561,8 @@ static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ static vmem_t *large_vmem; static u_int lm_ents; -#define PMAP_ADDRESS_IN_LARGEMAP(va) ((va) >= LARGEMAP_MIN_ADDRESS && \ - (va) < LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents) +#define PMAP_ADDRESS_IN_LARGEMAP(va) ((va) >= kva_layout.lm_low && \ + (va) < kva_layout.lm_high) int pmap_pcid_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, @@ -2025,7 +2037,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ virtual_avail = (vm_offset_t)KERNSTART + round_2mpage(KERNend - (vm_paddr_t)kernphys); - virtual_end = VM_MAX_KERNEL_ADDRESS; + virtual_end = kva_layout.km_high; /* * Enable PG_G global pages, then switch to the kernel page @@ -2421,6 +2433,7 @@ pmap_init(void) { struct pmap_preinit_mapping *ppim; vm_page_t m, mpte; + pml4_entry_t *pml4e; int error, i, ret, skz63; /* L1TF, reserve page @0 unconditionally */ @@ -2560,18 +2573,19 @@ pmap_init(void) printf("pmap: large map %u PML4 slots (%lu GB)\n", lm_ents, (u_long)lm_ents * (NBPML4 / 1024 / 1024 / 1024)); if (lm_ents != 0) { - large_vmem = vmem_create("large", LARGEMAP_MIN_ADDRESS, - (vmem_size_t)lm_ents * NBPML4, PAGE_SIZE, 0, M_WAITOK); + large_vmem = vmem_create("large", kva_layout.lm_low, + (vmem_size_t)kva_layout.lm_high - kva_layout.lm_low, + PAGE_SIZE, 0, M_WAITOK); if (large_vmem == NULL) { printf("pmap: cannot create large map\n"); lm_ents = 0; } for (i = 0; i < lm_ents; i++) { m = pmap_large_map_getptp_unlocked(); - /* XXXKIB la57 */ - kernel_pml4[LMSPML4I + i] = X86_PG_V | - X86_PG_RW | X86_PG_A | X86_PG_M | pg_nx | - VM_PAGE_TO_PHYS(m); + pml4e = pmap_pml4e(kernel_pmap, kva_layout.lm_low + + (u_long)i * NBPML4); + *pml4e = X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M | + pg_nx | VM_PAGE_TO_PHYS(m); } } } @@ -3900,7 +3914,7 @@ pmap_kextract(vm_offset_t va) pd_entry_t pde; vm_paddr_t pa; - if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) { + if (va >= kva_layout.dmap_low && va < kva_layout.dmap_high) { pa = DMAP_TO_PHYS(va); } else if (PMAP_ADDRESS_IN_LARGEMAP(va)) { pa = pmap_large_map_kextract(va); @@ -4041,7 +4055,7 @@ pmap_qremove(vm_offset_t sva, int count) * enough to one of those pmap_enter() calls for it to * be caught up in a promotion. */ - KASSERT(va >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", va)); + KASSERT(va >= kva_layout.km_low, ("usermode va %lx", va)); KASSERT((*vtopde(va) & X86_PG_PS) == 0, ("pmap_qremove on promoted va %#lx", va)); @@ -4943,7 +4957,7 @@ pmap_release(pmap_t pmap) static int kvm_size(SYSCTL_HANDLER_ARGS) { - unsigned long ksize = VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS; + unsigned long ksize = kva_layout.km_high - kva_layout.km_low; return sysctl_handle_long(oidp, &ksize, 0, req); } @@ -4954,7 +4968,7 @@ SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_MPSAFE, static int kvm_free(SYSCTL_HANDLER_ARGS) { - unsigned long kfree = VM_MAX_KERNEL_ADDRESS - kernel_vm_end; + unsigned long kfree = kva_layout.km_high - kernel_vm_end; return sysctl_handle_long(oidp, &kfree, 0, req); } @@ -5032,7 +5046,7 @@ pmap_page_array_startup(long pages) vm_page_array_size = pages; - start = VM_MIN_KERNEL_ADDRESS; + start = kva_layout.km_low; end = start + pages * sizeof(struct vm_page); for (va = start; va < end; va += NBPDR) { pfn = first_page + (va - start) / sizeof(struct vm_page); @@ -6068,8 +6082,8 @@ pmap_demote_pde_mpte(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * so the direct map region is the only part of the * kernel address space that must be handled here. */ - KASSERT(!in_kernel || (va >= DMAP_MIN_ADDRESS && - va < DMAP_MAX_ADDRESS), + KASSERT(!in_kernel || (va >= kva_layout.dmap_low && + va < kva_layout.dmap_high), ("pmap_demote_pde: No saved mpte for va %#lx", va)); /* @@ -7185,7 +7199,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, PG_RW = pmap_rw_bit(pmap); va = trunc_page(va); - KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); + KASSERT(va <= kva_layout.km_high, ("pmap_enter: toobig")); KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%lx)", va)); @@ -9551,7 +9565,7 @@ pmap_unmapdev(void *p, vm_size_t size) va = (vm_offset_t)p; /* If we gave a direct map region in pmap_mapdev, do nothing */ - if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) + if (va >= kva_layout.dmap_low && va < kva_layout.dmap_high) return; offset = va & PAGE_MASK; size = round_page(offset + size); @@ -9730,7 +9744,7 @@ pmap_change_prot(vm_offset_t va, vm_size_t size, vm_prot_t prot) int error; /* Only supported within the kernel map. */ - if (va < VM_MIN_KERNEL_ADDRESS) + if (va < kva_layout.km_low) return (EINVAL); PMAP_LOCK(kernel_pmap); @@ -9761,7 +9775,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, * Only supported on kernel virtual addresses, including the direct * map but excluding the recursive map. */ - if (base < DMAP_MIN_ADDRESS) + if (base < kva_layout.dmap_low) return (EINVAL); /* @@ -9784,7 +9798,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, pte_bits |= X86_PG_RW; } if ((prot & VM_PROT_EXECUTE) == 0 || - va < VM_MIN_KERNEL_ADDRESS) { + va < kva_layout.km_low) { pde_bits |= pg_nx; pte_bits |= pg_nx; } @@ -9880,7 +9894,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, pmap_pte_props(pdpe, pde_bits, pde_mask); changed = true; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS && + if (tmpva >= kva_layout.km_low && (*pdpe & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ @@ -9910,7 +9924,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, pmap_pte_props(pde, pde_bits, pde_mask); changed = true; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS && + if (tmpva >= kva_layout.km_low && (*pde & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ @@ -9938,7 +9952,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, pmap_pte_props(pte, pte_bits, pte_mask); changed = true; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS && + if (tmpva >= kva_layout.km_low && (*pte & PG_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ @@ -10910,8 +10924,8 @@ pmap_large_unmap(void *svaa, vm_size_t len) struct spglist spgf; sva = (vm_offset_t)svaa; - if (len == 0 || sva + len < sva || (sva >= DMAP_MIN_ADDRESS && - sva + len <= DMAP_MIN_ADDRESS + dmaplimit)) + if (len == 0 || sva + len < sva || (sva >= kva_layout.dmap_low && + sva + len < kva_layout.dmap_high)) return; SLIST_INIT(&spgf); @@ -11157,11 +11171,10 @@ pmap_large_map_wb(void *svap, vm_size_t len) sva = (vm_offset_t)svap; eva = sva + len; pmap_large_map_wb_fence(); - if (sva >= DMAP_MIN_ADDRESS && eva <= DMAP_MIN_ADDRESS + dmaplimit) { + if (sva >= kva_layout.dmap_low && eva < kva_layout.dmap_high) { pmap_large_map_flush_range(sva, len); } else { - KASSERT(sva >= LARGEMAP_MIN_ADDRESS && - eva <= LARGEMAP_MIN_ADDRESS + lm_ents * NBPML4, + KASSERT(sva >= kva_layout.lm_low && eva < kva_layout.lm_high, ("pmap_large_map_wb: not largemap %#lx %#lx", sva, len)); pmap_large_map_wb_large(sva, eva); } @@ -11202,8 +11215,8 @@ pmap_pti_init(void) VM_OBJECT_WLOCK(pti_obj); pml4_pg = pmap_pti_alloc_page(); pti_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml4_pg)); - for (va = VM_MIN_KERNEL_ADDRESS; va <= VM_MAX_KERNEL_ADDRESS && - va >= VM_MIN_KERNEL_ADDRESS && va > NBPML4; va += NBPML4) { + for (va = kva_layout.km_low; va <= kva_layout.km_high && + va >= kva_layout.km_low && va > NBPML4; va += NBPML4) { pdpe = pmap_pti_pdpe(va); pmap_pti_wire_pte(pdpe); } diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 09ac0a67dbef..eefddad2f142 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -769,7 +769,7 @@ trap_pfault(struct trapframe *frame, bool usermode, int *signo, int *ucode) return (-1); } } - if (eva >= VM_MIN_KERNEL_ADDRESS) { + if (eva >= kva_layout.km_low) { /* * Don't allow user-mode faults in kernel address space. */ diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 8db314fa034d..1bbb302259d6 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -146,8 +146,9 @@ #define amd64_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define amd64_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) -#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ - || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) +#define INKERNEL(va) \ + (((va) >= kva_layout.dmap_low && (va) < kva_layout.dmap_high) || \ + ((va) >= kva_layout.km_low && (va) < kva_layout.km_high)) #ifdef SMP #define SC_TABLESIZE 1024 /* Must be power of 2. */ diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 7d3e91bcd9b9..5790b0ad156b 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -548,6 +548,18 @@ pmap_pml5e_index(vm_offset_t va) return ((va >> PML5SHIFT) & ((1ul << NPML5EPGSHIFT) - 1)); } +struct kva_layout_s { + vm_offset_t kva_min; + vm_offset_t dmap_low; /* DMAP_MIN_ADDRESS */ + vm_offset_t dmap_high; /* DMAP_MAX_ADDRESS */ + vm_offset_t lm_low; /* LARGEMAP_MIN_ADDRESS */ + vm_offset_t lm_high; /* LARGEMAP_MAX_ADDRESS */ + vm_offset_t km_low; /* VM_MIN_KERNEL_ADDRESS */ + vm_offset_t km_high; /* VM_MAX_KERNEL_ADDRESS */ + vm_offset_t rec_pt; +}; +extern struct kva_layout_s kva_layout; + #endif /* !LOCORE */ #endif /* !_MACHINE_PMAP_H_ */ diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 0cd9bb4fa7a4..f12e5217a44b 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -181,12 +181,9 @@ * 0xffffffff80000000 KERNBASE */ -#define VM_MIN_KERNEL_ADDRESS KV4ADDR(KPML4BASE, 0, 0, 0) -#define VM_MAX_KERNEL_ADDRESS KV4ADDR(KPML4BASE + NKPML4E - 1, \ - NPDPEPG-1, NPDEPG-1, NPTEPG-1) - -#define DMAP_MIN_ADDRESS KV4ADDR(DMPML4I, 0, 0, 0) -#define DMAP_MAX_ADDRESS KV4ADDR(DMPML4I + NDMPML4E, 0, 0, 0) +#define VM_MIN_KERNEL_ADDRESS_LA48 KV4ADDR(KPML4BASE, 0, 0, 0) +#define VM_MIN_KERNEL_ADDRESS kva_layout.km_low +#define VM_MAX_KERNEL_ADDRESS kva_layout.km_high #define KASAN_MIN_ADDRESS KV4ADDR(KASANPML4I, 0, 0, 0) #define KASAN_MAX_ADDRESS KV4ADDR(KASANPML4I + NKASANPML4E, 0, 0, 0) @@ -199,9 +196,6 @@ #define KMSAN_ORIG_MAX_ADDRESS KV4ADDR(KMSANORIGPML4I + NKMSANORIGPML4E, \ 0, 0, 0) -#define LARGEMAP_MIN_ADDRESS KV4ADDR(LMSPML4I, 0, 0, 0) -#define LARGEMAP_MAX_ADDRESS KV4ADDR(LMEPML4I + 1, 0, 0, 0) - /* * Formally kernel mapping starts at KERNBASE, but kernel linker * script leaves first PDE reserved. For legacy BIOS boot, kernel is @@ -239,21 +233,21 @@ * vt fb startup needs to be reworked. */ #define PHYS_IN_DMAP(pa) (dmaplimit == 0 || (pa) < dmaplimit) -#define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ - (va) < (DMAP_MIN_ADDRESS + dmaplimit)) +#define VIRT_IN_DMAP(va) \ + ((va) >= kva_layout.dmap_low && (va) < kva_layout.dmap_high) #define PMAP_HAS_DMAP 1 -#define PHYS_TO_DMAP(x) ({ \ +#define PHYS_TO_DMAP(x) __extension__ ({ \ KASSERT(PHYS_IN_DMAP(x), \ ("physical address %#jx not covered by the DMAP", \ (uintmax_t)x)); \ - (x) | DMAP_MIN_ADDRESS; }) + (x) + kva_layout.dmap_low; }) -#define DMAP_TO_PHYS(x) ({ \ +#define DMAP_TO_PHYS(x) __extension__ ({ \ KASSERT(VIRT_IN_DMAP(x), \ ("virtual address %#jx not covered by the DMAP", \ (uintmax_t)x)); \ - (x) & ~DMAP_MIN_ADDRESS; }) + (x) - kva_layout.dmap_low; }) /* * amd64 maps the page array into KVA so that it can be more easily @@ -274,7 +268,7 @@ */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ - VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) + kva_layout.km_low + 1) * 3 / 5) #endif /* initial pagein size of beginning of executable file */ diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 875c22d27628..e7d7b6726d2c 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -110,11 +110,18 @@ u_int exec_map_entry_size; u_int exec_map_entries; SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, - SYSCTL_NULL_ULONG_PTR, VM_MIN_KERNEL_ADDRESS, "Min kernel address"); +#if defined(__amd64__) + &kva_layout.km_low, 0, +#else + SYSCTL_NULL_ULONG_PTR, VM_MIN_KERNEL_ADDRESS, +#endif + "Min kernel address"); SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, #if defined(__arm__) &vm_max_kernel_address, 0, +#elif defined(__amd64__) + &kva_layout.km_high, 0, #else SYSCTL_NULL_ULONG_PTR, VM_MAX_KERNEL_ADDRESS, #endif From nobody Mon Jul 14 22:03:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgxD35XvGz62G5N; Mon, 14 Jul 2025 22:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgxD242Y1z3m9v; Mon, 14 Jul 2025 22:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBel8r6dJ2IuYii8Qijrr9ejz8m/303/dgSe+60LDZI=; b=os9QOBv3y3ZKFblIK8/jSoEvfyHlFkY0+T+O1lF76h8WzxAaK5QCA3zG+/dq2xxqa2m8xr jm4kqHmueH1DtHof0R5ZtX2ZyNK1109KahTtPytIORPMjK9UpXdjYmE1Ub1U2FrVhQoFh+ /rIBEWaOnwtTvTWpvuEtpoPdr1VEvX05kZ14j/n8o/GMojPGtqn9yuy5yvjXnuDz9gIxJz kIvDSEalA9ADamAcEwDrZNywOi9X8BAtQDn9enoV2VUFVsnHwm/ykCzmz1nYlcXcLZkTKh EmxY+RVRjrQAIgTGnNgtrSINb5rbJzxVRm52LUgn++BNh8z1p5DfNbUNVF9rxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBel8r6dJ2IuYii8Qijrr9ejz8m/303/dgSe+60LDZI=; b=jQtoAjOly2ham5Y1VXNeQ5VbIx4DkFU7uScXP4FWmRtMxI+1BcBKNUOr5vW6nACnMrOykI BahfVRZP9FNyDjx2qO3KcKxVgmiP2i5gAWD13Mz6z9HB0l71B2mBFxQAJNZwjeIvELelSO ff0mVOZZ4HMWIYKit7W2t3Er+x2VsVJH65STaVmrJzeolxcv3VqPzbU/Cqs/EAVUET0Kxn xvsc9uzzGI2mjTw+hSFKysQ8DmJbYYwLBVjQbosMJQNfCuUzwEtigwQke38NKO2db+ICtS ofKqXhxZBuu2ogP9zxhfvO/KENHOpYqJ7eSdZYPYeb8JuoDb2Ell/Z9hfJfG0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752530626; a=rsa-sha256; cv=none; b=tYUeAlVPDEWEObU0Er0UqaB09z3LbCB2o4wUnBcyWaIDnx7/LLcASiMTZoJggu45MXd40g e6OkJDzPuIbxpzZWl0id4IHEes0dArwMHP/wblk//vmM6G7wGpEgavxB4Cw+h3kdYvjj6t 1imGBYj4Kb9J9Ny+ajhHXlxmqUh5Mc1tTA42jHGf7Q+T0Ka0s14nzOWnYWyvHAEr6UyGLx v1ffKOF26NoSmhMm1zxMjsrhfbin5O37wIG5B/tCrKZ3dkaJ51CXGWFZz4ux5kXnVaEuUU +em8A41uNF/R32TB6QhoO1D+rky4JNNaOkl0aVO5dJkqF8TmpRArnwkxgqRItA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgxD23NvHz1BQP; Mon, 14 Jul 2025 22:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EM3k1n070564; Mon, 14 Jul 2025 22:03:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EM3k73070561; Mon, 14 Jul 2025 22:03:46 GMT (envelope-from git) Date: Mon, 14 Jul 2025 22:03:46 GMT Message-Id: <202507142203.56EM3k73070561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f05d399a3761 - main - amd64 pmap: do not hardcode 512GB List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f05d399a376127685df6681ca53688fdfb119a3d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f05d399a376127685df6681ca53688fdfb119a3d commit f05d399a376127685df6681ca53688fdfb119a3d Author: Konstantin Belousov AuthorDate: 2025-06-28 11:59:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-14 22:03:28 +0000 amd64 pmap: do not hardcode 512GB Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51085 --- sys/amd64/amd64/pmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index c3e3a91b20ec..15a812fefbaa 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1745,7 +1745,8 @@ create_pagetables(vm_paddr_t *firstaddr) * Each NDMPML4E allows 512 GB, so limit to that, * and then readjust ndmpdp and ndmpdpphys. */ - printf("NDMPML4E limits system to %d GB\n", NDMPML4E * 512); + printf("NDMPML4E limits system to %lu GB\n", + (u_long)NDMPML4E * NBPML4 / 1024 / 1024 / 1024); Maxmem = atop(NDMPML4E * NBPML4); ndmpdpphys = NDMPML4E; ndmpdp = NDMPML4E * NPDEPG; From nobody Mon Jul 14 22:03:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgxD72JY3z62Fsf; Mon, 14 Jul 2025 22:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgxD66L3Zz3mGL; Mon, 14 Jul 2025 22:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vkrnZgQqnPsxL7FEpstZDqVN7JFCxFf7m4hkAVKLyF0=; b=kL9rOVPMZhbHQBA481CJpo6Cu2Hx/X6wJRmQ28atDe9OnYNggTXIqDyk4fcTUaMuZqh2be IFDorgWmY+FdhUu0NwF932f+vhc/6fKyya8bF834+Xgxbn9/30yh8uVJ768YkFycZIeA37 6Qhfb/0wC8JXrHugJ1ubFPyWmZ9KspBJFXVF6Ng2HSJefMyzeX9ajDe7OhuP8s56z9eNaY nhyxL3SqfiNJhf3y24cFU7YTRxPDtf3Mk7rrGdJOOuv7sl/v3lnayuuBlr9nTxHdGNOToA D44s8J/eOcXDkM9SXtqkxQeQBl/uF70W/DqHCYPrx54uaHuspfE9da6tFrSdBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vkrnZgQqnPsxL7FEpstZDqVN7JFCxFf7m4hkAVKLyF0=; b=jwGZNkGOgmcjRmt7iEuDEFdIlKHVrYsPa7qoI/HTijWsMBksooNVQisQWg8q8lPeg9fJKD ST0bxrC/O/faByToSUF516ry7fYUi7riC9tTNronQkMBzBV6CQt+QhOd7I4Cwgrn1uqV41 kl/8WTKoC8KEszMsubooEYdRADZyXkp8FI2K6xg49HPqmjRQI8g64QFhrRe8vLkPp2MEZ3 nAQJushaxXUPZh3YFMLU1pytbGXPTSjme9h1an8IhZ/a8kLFg0yiFPO8o7WE0H23tCruGA CxYfPkcTTMUscygxasK1zdKHIsqG5ik63ahSGnB/AvSmYXfnLmlwl7FqBochug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752530630; a=rsa-sha256; cv=none; b=RUZNkun8GTewDUBH0r2mrvA6S3dLIxxHqAWbs//BrJFSpqlUWI8qcyzsWr/h7/STfw5wOv cNtUFVox6J2ujKJIuMMMJ1fjPZFDzHngk3Pxq7opQJIeCL3F0O+69VcHEV3ydZSdRH7ktF 34OQG3gEAXVq5ej1f+/h68chPErIkF4aStN9WbmQaldp3+EP/XlMcLxGEedu5maPjtO77o SoYkXL9T1SN62+TCrvKNwNbtqsIY4VfRzbl4AwmygR/mnBYAG8kKue2yRZndyKs5Knxekf kSqVr+B5Fif68qySV7nzhDeF5Q+3D8B1beh0BGVKsX6UmL8M38sVRPIjqJb6LA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgxD65wLFz1BQR; Mon, 14 Jul 2025 22:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EM3oOX070711; Mon, 14 Jul 2025 22:03:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EM3oNe070708; Mon, 14 Jul 2025 22:03:50 GMT (envelope-from git) Date: Mon, 14 Jul 2025 22:03:50 GMT Message-Id: <202507142203.56EM3oNe070708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 25c6d4710f1c - main - amd64 pmap: add KVA map for LA57 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25c6d4710f1cb15ae35c4650f1aaabf3abed1595 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=25c6d4710f1cb15ae35c4650f1aaabf3abed1595 commit 25c6d4710f1cb15ae35c4650f1aaabf3abed1595 Author: Konstantin Belousov AuthorDate: 2025-07-03 14:04:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-14 22:03:28 +0000 amd64 pmap: add KVA map for LA57 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51085 --- sys/amd64/include/vmparam.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index f12e5217a44b..59053665dc40 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -163,6 +163,7 @@ * Virtual addresses of things. Derived from the page directory and * page table indexes from pmap.h for precision. * + * LA48: * 0x0000000000000000 - 0x00007fffffffffff user map * 0x0000800000000000 - 0xffff7fffffffffff does not exist (hole) * 0xffff800000000000 - 0xffff804020100fff recursive page table (512GB slot) @@ -175,6 +176,20 @@ * 0xfffffc0000000000 - 0xfffffdffffffffff 2TB KMSAN shadow map, optional * 0xfffffe0000000000 - 0xffffffffffffffff 2TB kernel map * + * LA57: + * 0x0000000000000000 - 0x00ffffffffffffff user map + * 0x0100000000000000 - 0xf0ffffffffffffff does not exist (hole) + * 0xff00000000000000 - 0xff00ffffffffffff recursive page table (2048TB slot) + * 0xff01000000000000 - 0xff20ffffffffffff direct map (32 x 2048TB slots) + * 0xff21000000000000 - 0xffff807fffffffff unused + * 0xffff808000000000 - 0xffff847fffffffff large map (can be tuned up) + * 0xffff848000000000 - 0xfffff77fffffffff unused (large map extends there) + * 0xfffff60000000000 - 0xfffff7ffffffffff 2TB KMSAN origin map, optional + * 0xfffff78000000000 - 0xfffff7bfffffffff 512GB KASAN shadow map, optional + * 0xfffff80000000000 - 0xfffffbffffffffff 4TB unused + * 0xfffffc0000000000 - 0xfffffdffffffffff 2TB KMSAN shadow map, optional + * 0xfffffe0000000000 - 0xffffffffffffffff 2TB kernel map + * * Within the kernel map: * * 0xfffffe0000000000 vm_page_array From nobody Mon Jul 14 22:03:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgxD86dyhz62G3Y; Mon, 14 Jul 2025 22:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgxD80SZsz3mTg; Mon, 14 Jul 2025 22:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B71cfIvsCM+IX1rcoF12Jd49HnZz8gnBdJjrETR49I8=; b=uHc7ozQOWQiYfVR/Z8bZQq5Ddu5xJY2GHUSPIkR/jsSdpJmL9DWRkHImOSk3FhcpyK3Ygm OPi++nK4pFW9/Ymh48l3eXWdow9AJqHszkgxTue4BbA08P+kWcXSgVcsijXFPwxLmQplPx 3F9feLI1NtBTCCH7lHeTu/LppWsK1Y599uTHU5R79c5iO1DrPO8HtRfU0Eeer5uzfiL7T1 uHa7Hz1CMU2SWWoyrzOfLVRaLR3tfANxkRxkHy4rpiP3pKjD3M+2P1DboHg2q7q+wteaNP HFPXLS+Oej6pxFxuTHlgwUTT6bj6Bdw4VcTKDIOWehvMPhSahBZypZP/wTOHVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752530632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B71cfIvsCM+IX1rcoF12Jd49HnZz8gnBdJjrETR49I8=; b=J4slRwAMfHiYYdLNVGWbO8YwjE1yEaJEe7bJwusElfehs/TpwsiRauojW4VMzzddKyOHiF uNC1EY5aIlKa7WE0Mz8Bp7y0XP3kn0gX22dNBKjdlEKQZUz/nO6IP2A6eUsYbDQMVIrGYr n3cznbwQm+gBk33lym7wFuy2d5Ykfn5OhvKwgbSSCEbGh9ZCC/mc80wi3wUymMcGCLdrFK TVDvS6GG9sU1Ymn7MybSMd73VrcYB8/2GV87+M8ugliYCTlSF41LNLD7EcicbAfyz723RT Kthkk1EeO1NB8O+dxKCf8kdTUov9iP/7WtzSbXI1IcK9UCqGl4Ja1Q39yRVTKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752530632; a=rsa-sha256; cv=none; b=WzADkqulWYJvcD2mUOFeAMD77QZ3YG061UgoeWs/mhcd6Aj1yDW1DgV40EmIIIrEgyU9YA vqRYwiIiqbcfnbzt/od127xCsfVTMz8+19CjMwM3KTrzUglQgj0wRADUluI/1xszTjH/20 3+5I8mw13K7eJME+fDUhzC47emg2H/x5O3JML4Sn9MS5QjEyXnvao9clOvtQXqHlWds8UM VxbCzXSXzUgSWkwNksyobOFdyWBBxkorR258BjSSWbQuB3dr3o5DOqfJcn3LywdF6ti7NH rJsHjrhoGhMUq4Xl2Cwl5trdSiwvZ1Dksz5QTvS/1kMndYU6/r4kYWHI8OKyBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgxD76mLPz1Bfv; Mon, 14 Jul 2025 22:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56EM3ptx070747; Mon, 14 Jul 2025 22:03:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EM3p3H070744; Mon, 14 Jul 2025 22:03:51 GMT (envelope-from git) Date: Mon, 14 Jul 2025 22:03:51 GMT Message-Id: <202507142203.56EM3p3H070744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 42f1054ef12d - main - ast: do not dereference NULL td_proc in CTR statement List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42f1054ef12d10f3ba46770b985a320b0ceb9f2f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=42f1054ef12d10f3ba46770b985a320b0ceb9f2f commit 42f1054ef12d10f3ba46770b985a320b0ceb9f2f Author: Konstantin Belousov AuthorDate: 2025-07-14 21:54:34 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-14 22:03:28 +0000 ast: do not dereference NULL td_proc in CTR statement If ast is called to clean up thread, as in ast_kclear(), td_proc is NULL. Guard against derefencing it in the trace. Reported by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/subr_trap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 18388ae5f232..bac7d0080c71 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -338,8 +338,9 @@ ast_handler(struct thread *td, struct trapframe *framep, bool dtor) td->td_ast = 0; } - CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, td->td_proc->p_pid, - td->td_proc->p_comm); + CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, + td->td_proc == NULL ? -1 : td->td_proc->p_pid, + td->td_proc == NULL ? "" : td->td_proc->p_comm); KASSERT(framep == NULL || TRAPF_USERMODE(framep), ("ast in kernel mode")); From nobody Mon Jul 14 23:46:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgzVK62Ptz61bwq; Mon, 14 Jul 2025 23:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgzVK5CjCz3nJB; Mon, 14 Jul 2025 23:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752536777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HCnVqN8yREH7XdSbL1GdS+8pDiZdxAyxtJOM5baW108=; b=eD2Kv7q1o9CrduIHgQDlIk4bUVaITX5ONmDvA+1XC/6mXfVcaPvhKxB6qX58rC0jnVstsH i9KWh373AcVLTyaeF2LSoCdXe8m4gl46/6hDoj2RuPCtaFjisVg/FTEnnK4jHWwV/ITGI2 Obe+GKbRuVtyb6FucSLOK96D/AXx12MVy6O1HBNqHZriZnaW10h6xAHKVquWjK4SBc3HnT 5hZ6QQYHZQEtIbJpHbPw1qxLd5Jt+yP/t7fEB6753tppvsoO7JyUpCkizSy/w6ajifikH5 V7AF4h8QyuQOBOcnNq+nQxpsorhfB5M/84WteXK4z7Q1ItZ8ZPrOjx16VEJ0eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752536777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HCnVqN8yREH7XdSbL1GdS+8pDiZdxAyxtJOM5baW108=; b=xIYRSfAQZ0FDRxEasGWrm/o7sqQlKsdFIwNs8GGaWLXlernn4zQZ3Jb+pGfAf0HmbxqCKd 8HmvdAUSsP97pFiLMl8iApDtSadHq/yyqEwEeW/GJpMtvmLDmqXdbfMBbyKRnngIZAT05q BNfXVZ4THGEmWqJNZ433w7LZ+oN+J0dwaaylDntzI3wph+/KdBC2+ez/6atoEmaQAdIcad nVbZp6R3kG1+HQVV3V4n6CHXwelQIpiLGcQkZyOMet772iwvUubFXKAsrVYVL965a2c9tr eCiv+P2Zdq759wGgWVrBn6dZOfacGwOYvVnqM9yRzMzrMKT4QFSdT4vBHxhnUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752536777; a=rsa-sha256; cv=none; b=ko9JW2v+tnmQlsh0OuMg2nL0JYGRQV1ZjUKFJFyJOUbCh2dohDYT4U3nUGd9S8iGdpbbwU DnYvU8jEzBQ1zOGB3qLaoHMfbe7M8mqQQsJupY6NDvvHCfaqGokYCVi96PjWhSuELrb/7i Gct3kpA455vnyIkfIgROA0ZolbQXKpBQu0fWWKNT31D/mLO6GXrwdm8GQ34caM0U/j/usP uATQDkWRL3z3J1p4OyvimMsb812uqzqhuvc1VIlAT1WdS+28Lj8AvfwTZfVOBZGU8yfkg9 +nyXTWbz4/5TFxCWaGVEWhPF4n8kvi2KDG1FzZYxK4QvD0umbCT+04z86+Zt+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgzVK4nkbz1GM; Mon, 14 Jul 2025 23:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ENkH0W059205; Mon, 14 Jul 2025 23:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ENkHba059202; Mon, 14 Jul 2025 23:46:17 GMT (envelope-from git) Date: Mon, 14 Jul 2025 23:46:17 GMT Message-Id: <202507142346.56ENkHba059202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 0abee387e1df - main - vnode.9: Fix a typo in sys/tools/vnode_if.awk path name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0abee387e1dfd0bf09becadb39b9bc9fef240d95 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=0abee387e1dfd0bf09becadb39b9bc9fef240d95 commit 0abee387e1dfd0bf09becadb39b9bc9fef240d95 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-14 23:40:50 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-14 23:44:50 +0000 vnode.9: Fix a typo in sys/tools/vnode_if.awk path name Fixes: e01826567938 vnode.9: Document vnode_if.awk and vnode_if.src MFC after: 1 week --- share/man/man9/vnode.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 5dd087725e92..d17492668298 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 9, 2024 +.Dd July 15, 2025 .Dt VNODE 9 .Os .Sh NAME @@ -113,7 +113,7 @@ The function declarations and definitions are generated from .Pa sys/kern/vnode_if.src by the -.Pa sys/tools/vndoe_if.awk +.Pa sys/tools/vnode_if.awk script. The interfaces are documented in their respective manual pages like .Xr VOP_READ 9 From nobody Tue Jul 15 05:12:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bh6l82B8Tz61whC; Tue, 15 Jul 2025 05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bh6l80z3bz3mF0; Tue, 15 Jul 2025 05:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i9QVfql9nE8wlBGH12mSlEejIJfyi73YAhqOCPzBMvA=; b=mh2vClp1LyBdrfkkCGSSzlstkxQNrLse/CFDcrXT2FZBQT2mq74/4RtXU2iXGGETatZWfg wtE51ppywRBR4oPRhFopaS19KoHaBV3YjzlZZxSsJVwhW0kuVPc0+AVYOClzk0pOb63A/R 7z1clebqKjvaVWoPjCKUHN3DJqiKRcTdDHwoTtlv5NJgLNYWS3MpXigwIhUk55b4gnt4Qf VveTByiboVmab4vLsuhFZfnvqIWozUF+QNhlzPDQqjW4j6khPIwDbRRL10TKtjRS674n3l bz6huNZ+ZG/UQbvYYzC+dzDwe/aCDGbbJqaOT5P1s5BK5YuyR2DWjmKO9lx14g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i9QVfql9nE8wlBGH12mSlEejIJfyi73YAhqOCPzBMvA=; b=oayXoA+bbyIt+PQi3OY3jqEeHXDBSYGJPOkeTbHqeSf/gt34KG+jQg45Q/rKSnkzlOiqnY l+s/DQ37tZuEIMQGcF/cVXlD4rXob5VwtTaNshHyk3tkw7REc6vB7FygRrV3a9jsclh1j0 LowxtmbRIpG6FmEEbx4G0XjJmgslRnHzQ/wZZGg+xSeeOVNRBkCMj4+O/1SEAmiyPYZwaU jV9XwJfEkMJZog8stNUb/4uqhN6RfpkvAWi9QtWhAL7VNO2ueyzUTyxUUQHpFtg9F5ouzb CVguAVtpS8xNuhmy2As0TCkTLvEQyZPqTGQvSCjqWEmp/3ku3Cfb/oPAh/hcQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752556372; a=rsa-sha256; cv=none; b=qlFoC+0qGdEQR1k5U+GKp7JSuD0+UP3yz9trFXcyJzAA6lVI8Fj5kclehvEoSp9ZLjdWEe fFejJkETQ43LbC6czbIiu6wEIkJkAuZICrbIQPtgUaDlYqMs1x6Q76QklZbsDwdxZwBNYb +tGAevF2jzJT7ivJdOlkGiIXesPi2Uob3jVWD1fPVjjAUiTo7A3+Ezp2qm017nWsrZKPBe irjTPCa0+ldhb5I8A6Tb3fX+u78iD9W+rl0zC29Ji9uxkgxO2mayN/lNflgsidfuToTSQ8 eU09TR+aMEE5kLPwHZr+BDIh9UBq+IFtIDwEs/qQJER2AElBPEsUAwI0RVlEuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bh6l80ZF6z9dg; Tue, 15 Jul 2025 05:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56F5CpR5079657; Tue, 15 Jul 2025 05:12:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56F5CpOD079654; Tue, 15 Jul 2025 05:12:51 GMT (envelope-from git) Date: Tue, 15 Jul 2025 05:12:51 GMT Message-Id: <202507150512.56F5CpOD079654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: e64ad2324153 - main - packages: move ucl files to a subdirectory List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e64ad2324153dcd77aba0cd42bb8f194b62bb955 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=e64ad2324153dcd77aba0cd42bb8f194b62bb955 commit e64ad2324153dcd77aba0cd42bb8f194b62bb955 Author: Lexi Winter AuthorDate: 2025-07-07 13:30:13 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:44 +0000 packages: move ucl files to a subdirectory We want to have a UCL file for every package, to set fields like comment, desc, license, etc.; to avoid cluttering release/packages with ~200 new files, move these to the ucl/ directory. Add a better description for the yp package to demonstrate how this will work in practice. Clean up the handling of the package comment suffix for generated packages (dev, lib32, etc.) and do the UCL modifications in generate-ucl.lua, so we don't overwrite the ucl's comment. Add a long-form suffix to the description for generated packages to explain what they do. Eventually, we should require the ucl file exists (try=false) to prevent people accidentally creating new packages with a typo, but for now, keep the ucl optional. Reviewed by: kevans, des, bapt, emaste Approved by: kevans (mentor), des (mentor) Differential Revision: https://reviews.freebsd.org/D50160 --- release/packages/Makefile.package | 2 - release/packages/generate-ucl.lua | 45 +++++++++++++-- release/packages/generate-ucl.sh | 92 ++++++++++++++++++++---------- release/packages/{ => ucl}/certctl.ucl | 0 release/packages/{ => ucl}/clang-all.ucl | 0 release/packages/{ => ucl}/clibs.ucl | 0 release/packages/{ => ucl}/lld-all.ucl | 0 release/packages/{ => ucl}/lldb-all.ucl | 0 release/packages/{ => ucl}/runtime.ucl | 0 release/packages/{ => ucl}/ssh-all.ucl | 0 release/packages/{ => ucl}/unbound-all.ucl | 0 release/packages/{ => ucl}/utilities.ucl | 0 release/packages/ucl/yp-all.ucl | 7 +++ 13 files changed, 107 insertions(+), 39 deletions(-) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index c2427aa16945..e00efed2af1b 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -187,7 +187,5 @@ vt_COMMENT= VT fonts and keyboard files vt_DESC= VT fonts and keyboard files wpa_COMMENT= 802.11 Supplicant wpa_DESC= 802.11 Supplicant -yp_COMMENT= Yellow Pages programs -yp_DESC= Yellow Pages programs zfs_COMMENT= ZFS Libraries and Utilities zfs_DESC= ZFS Libraries and Utilities diff --git a/release/packages/generate-ucl.lua b/release/packages/generate-ucl.lua index ae6ee58dd84a..0d18e1dc0120 100755 --- a/release/packages/generate-ucl.lua +++ b/release/packages/generate-ucl.lua @@ -3,33 +3,66 @@ --[[ usage: generare-ucl.lua [ ]... -In the files the variable (in the form ${variablename} -in the ) will be expanded to . +Build a package's UCL configuration by loading the template UCL file +, replacing any $VARIABLES in the UCL based on the provided +variables, then writing the result to . -The undefined variables will reamin unmofifier "${variablename}" +If COMMENT_SUFFIX or DESC_SUFFIX are set, append these to the generated comment +and desc fields. We do this here because there's no way to do it in +template.ucl. ]]-- local ucl = require("ucl") +local comment_suffix = nil +local desc_suffix = nil + +-- This parser is the output UCL we want to build. +local parser = ucl.parser() + +-- Set any $VARIABLES from the command line in the parser. This causes ucl to +-- automatically replace them when we load the source ucl. if #arg < 2 or #arg % 2 ~= 0 then io.stderr:write(arg[0] .. ": expected an even number of arguments, got " .. #arg) os.exit(1) end -local parser = ucl.parser() for i = 2, #arg - 2, 2 do - parser:register_variable(arg[i - 1], arg[i]) + local varname = arg[i - 1] + local varvalue = arg[i] + + if varname == "COMMENT_SUFFIX" and #varvalue > 0 then + comment_suffix = varvalue + elseif varname == "DESC_SUFFIX" and #varvalue > 0 then + desc_suffix = varvalue + end + + parser:register_variable(varname, varvalue) end + +-- Load the source ucl file. local res,err = parser:parse_file(arg[#arg - 1]) if not res then io.stderr:write(arg[0] .. ": fail to parse("..arg[#arg - 1].."): "..err) os.exit(1) end + +local obj = parser:get_object() + +-- Add comment and desc suffix. +if comment_suffix ~= nil then + obj["comment"] = obj["comment"] .. comment_suffix +end +if desc_suffix ~= nil then + obj["desc"] = obj["desc"] .. "\n\n" .. desc_suffix +end + +-- Write the output file. local f,err = io.open(arg[#arg], "w") if not f then io.stderr:write(arg[0] .. ": fail to open("..arg[#arg].."): ".. err) os.exit(1) end -local obj = parser:get_object() + f:write(ucl.to_format(obj, 'ucl', true)) f:close() diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index b7d7bad35023..4dac34cd4753 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -2,9 +2,35 @@ # # +mancx=" (manual pages)" +mandx="This package contains the online manual pages." + +lib32cx=" (32-bit libraries)" +lib32dx="This package contains 32-bit libraries for running 32-bit applications on +a 64-bit host." + +devcx=" (development files)" +devdx="This package contains development files for compiling applications." + +dev32cx=" (32-bit development files)" +dev32dx="This package contains development files for compiling 32-bit applications +on a 64-bit host." + +dbgcx=" (debugging symbols)" +dbgdx="This package contains external debugging symbols for use with a source-level +debugger." + +dbg32cx=" (32-bit debugging symbols)" +dbg32dx="This package contains 32-bit external debugging symbols for use with a +source-level debugger." + main() { + outname="" + origname="" desc= + desc_suffix="" comment= + comment_suffix="" debug= uclsource= while getopts "do:s:u:" arg; do @@ -52,51 +78,53 @@ main() { # as a dependency. libcompat-dev|libcompiler_rt-dev|liby-dev) outname=${outname%%-dev} - _descr="Development Files" + comment_suffix="$devcx" + desc_suffix="$devdx" ;; - libcompat-lib32_dev|libcompiler_rt-lib32_dev|liby-lib32_dev) - outname=${outname%%-lib32_dev} - _descr="32-bit Libraries, Development Files" + libcompat-dev-lib32|libcompiler_rt-dev-lib32|liby-dev-lib32) + outname=${outname%%-dev-lib32} + comment_suffix="$dev32cx" + desc_suffix="$dev32dx" ;; libcompat-man|libelftc-man) outname=${outname%%-man} - _descr="Manual Pages" - ;; - utilities) - uclfile="${uclfile}" - ;; - runtime) - outname="runtime" - _descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)" + comment_suffix="$mancx" + desc_suffix="$mandx" ;; - *-lib32_dev) - outname="${outname%%-lib32_dev}" - _descr="32-bit Libraries, Development Files" + *-dev) + outname="${outname%%-dev}" + comment_suffix="$devcx" + desc_suffix="$devdx" pkgdeps="${outname}" ;; - *-lib32_dbg) - outname="${outname%%-lib32_dbg}" - _descr="32-bit Libraries, Debugging Symbols" + *-dbg) + outname="${outname%%-dbg}" + comment_suffix="$dbgcx" + desc_suffix="$dbgdx" pkgdeps="${outname}" ;; - *-lib32) - outname="${outname%%-lib32}" - _descr="32-bit Libraries" + *-dev-lib32) + outname="${outname%%-dev-lib32}" + comment_suffix="$dev32cx" + desc_suffix="$dev32dx" pkgdeps="${outname}" ;; - *-dev) - outname="${outname%%-dev}" - _descr="Development Files" + *-dbg-lib32) + outname="${outname%%-dbg-lib32}" + comment_suffix="$dbg32cx" + desc_suffix="$dbg32dx" pkgdeps="${outname}" ;; - *-dbg) - outname="${outname%%-dbg}" - _descr="Debugging Symbols" + *-lib32) + outname="${outname%%-lib32}" + comment_suffix="$lib32cx" + desc_suffix="$lib32dx" pkgdeps="${outname}" ;; *-man) outname="${outname%%-man}" - _descr="Manual Pages" + comment_suffix="$mancx" + desc_suffix="$mandx" pkgdeps="${outname}" ;; ${origname}) @@ -116,13 +144,14 @@ main() { echo "" echo "===============================================================" echo "DEBUG:" - echo "_descr=${_descr}" echo "outname=${outname}" echo "origname=${origname}" echo "srctree=${srctree}" echo "uclfile=${uclfile}" echo "desc=${desc}" + echo "desc_suffix=${desc_suffix}" echo "comment=${comment}" + echo "comment_suffix=${comment_suffix}" echo "vital=${vital}" echo "cp ${uclsource} -> ${uclfile}" echo "===============================================================" @@ -132,7 +161,6 @@ main() { fi [ -z "${comment}" ] && comment="${outname} package" - [ -n "${_descr}" ] && comment="${comment} (${_descr})" [ -z "${desc}" ] && desc="${outname} package" cp "${uclsource}" "${uclfile}" @@ -155,11 +183,13 @@ EOF PKGGENNAME "${outname}" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ COMMENT "${comment}" \ + COMMENT_SUFFIX "${comment_suffix}" \ DESC "${desc}" \ + DESC_SUFFIX "$desc_suffix" \ CAP_MKDB_ENDIAN "${cap_arg}" \ PKG_WWW "${PKG_WWW}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ - UCLFILES "${srctree}/release/packages/" \ + UCLFILES "${srctree}/release/packages/ucl" \ ${uclfile} ${uclfile} return 0 diff --git a/release/packages/certctl.ucl b/release/packages/ucl/certctl.ucl similarity index 100% rename from release/packages/certctl.ucl rename to release/packages/ucl/certctl.ucl diff --git a/release/packages/clang-all.ucl b/release/packages/ucl/clang-all.ucl similarity index 100% rename from release/packages/clang-all.ucl rename to release/packages/ucl/clang-all.ucl diff --git a/release/packages/clibs.ucl b/release/packages/ucl/clibs.ucl similarity index 100% rename from release/packages/clibs.ucl rename to release/packages/ucl/clibs.ucl diff --git a/release/packages/lld-all.ucl b/release/packages/ucl/lld-all.ucl similarity index 100% rename from release/packages/lld-all.ucl rename to release/packages/ucl/lld-all.ucl diff --git a/release/packages/lldb-all.ucl b/release/packages/ucl/lldb-all.ucl similarity index 100% rename from release/packages/lldb-all.ucl rename to release/packages/ucl/lldb-all.ucl diff --git a/release/packages/runtime.ucl b/release/packages/ucl/runtime.ucl similarity index 100% rename from release/packages/runtime.ucl rename to release/packages/ucl/runtime.ucl diff --git a/release/packages/ssh-all.ucl b/release/packages/ucl/ssh-all.ucl similarity index 100% rename from release/packages/ssh-all.ucl rename to release/packages/ucl/ssh-all.ucl diff --git a/release/packages/unbound-all.ucl b/release/packages/ucl/unbound-all.ucl similarity index 100% rename from release/packages/unbound-all.ucl rename to release/packages/ucl/unbound-all.ucl diff --git a/release/packages/utilities.ucl b/release/packages/ucl/utilities.ucl similarity index 100% rename from release/packages/utilities.ucl rename to release/packages/ucl/utilities.ucl diff --git a/release/packages/ucl/yp-all.ucl b/release/packages/ucl/yp-all.ucl new file mode 100644 index 000000000000..9e17cd108d84 --- /dev/null +++ b/release/packages/ucl/yp-all.ucl @@ -0,0 +1,7 @@ +comment = "Yellow Pages (YP) / Network Information Service (NIS)" +desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 29121751723a - main - packages: create UCL files for package descriptions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29121751723a0ea1a357d32148165c416b0824ec Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=29121751723a0ea1a357d32148165c416b0824ec commit 29121751723a0ea1a357d32148165c416b0824ec Author: Lexi Winter AuthorDate: 2025-07-07 13:34:58 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:44 +0000 packages: create UCL files for package descriptions Mechanically convert Makefile.package into individual UCL files for each package and delete it. Move handling of the 'comment' and 'desc' fields from generate-ucl.sh to template.ucl; this provides the default values for some packages which don't have a UCL file yet. Reviewed by: des, bapt, emaste Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50280 --- release/packages/Makefile.package | 191 ----------------------------- release/packages/generate-ucl.sh | 12 -- release/packages/template.ucl | 4 +- release/packages/ucl/acct-all.ucl | 4 + release/packages/ucl/acpi-all.ucl | 4 + release/packages/ucl/amd-all.ucl | 4 + release/packages/ucl/apm-all.ucl | 4 + release/packages/ucl/at-all.ucl | 4 + release/packages/ucl/audit-all.ucl | 4 + release/packages/ucl/autofs-all.ucl | 4 + release/packages/ucl/bhyve-all.ucl | 4 + release/packages/ucl/blocklist-all.ucl | 4 + release/packages/ucl/bluetooth-all.ucl | 4 + release/packages/ucl/bootloader-all.ucl | 4 + release/packages/ucl/bsdinstall-all.ucl | 4 + release/packages/ucl/bsnmp-all.ucl | 4 + release/packages/ucl/caroot-all.ucl | 4 + release/packages/ucl/certctl-all.ucl | 4 + release/packages/ucl/clang-all.ucl | 4 + release/packages/ucl/clibs-all.ucl | 4 + release/packages/ucl/console-tools-all.ucl | 4 + release/packages/ucl/cron-all.ucl | 4 + release/packages/ucl/csh-all.ucl | 4 + release/packages/ucl/ctf-tools-all.ucl | 4 + release/packages/ucl/cxgbe-tools-all.ucl | 4 + release/packages/ucl/devd-all.ucl | 4 + release/packages/ucl/devmatch-all.ucl | 4 + release/packages/ucl/dhclient-all.ucl | 4 + release/packages/ucl/dma-all.ucl | 4 + release/packages/ucl/docs-all.ucl | 4 + release/packages/ucl/dtrace-all.ucl | 4 + release/packages/ucl/dwatch-all.ucl | 4 + release/packages/ucl/ee-all.ucl | 4 + release/packages/ucl/efi-tools-all.ucl | 4 + release/packages/ucl/elftoolchain-all.ucl | 4 + release/packages/ucl/examples-all.ucl | 4 + release/packages/ucl/fetch-all.ucl | 4 + release/packages/ucl/firmware-iwm-all.ucl | 4 + release/packages/ucl/ftp-all.ucl | 4 + release/packages/ucl/ftpd-all.ucl | 4 + release/packages/ucl/fwget-all.ucl | 4 + release/packages/ucl/games-all.ucl | 4 + release/packages/ucl/geom-all.ucl | 4 + release/packages/ucl/ggate-all.ucl | 4 + release/packages/ucl/hast-all.ucl | 4 + release/packages/ucl/hostapd-all.ucl | 4 + release/packages/ucl/hyperv-tools-all.ucl | 4 + release/packages/ucl/inetd-all.ucl | 4 + release/packages/ucl/jail-all.ucl | 4 + release/packages/ucl/kerberos-all.ucl | 4 + release/packages/ucl/kerberos-lib-all.ucl | 4 + release/packages/ucl/kernel-all.ucl | 4 + release/packages/ucl/lp-all.ucl | 4 + release/packages/ucl/manuals-all.ucl | 4 + release/packages/ucl/mlx-tools-all.ucl | 4 + release/packages/ucl/mtree-all.ucl | 4 + release/packages/ucl/netmap-all.ucl | 4 + release/packages/ucl/newsyslog-all.ucl | 4 + release/packages/ucl/nfs-all.ucl | 4 + release/packages/ucl/ntp-all.ucl | 4 + release/packages/ucl/nuageinit-all.ucl | 4 + release/packages/ucl/nvme-tools-all.ucl | 4 + release/packages/ucl/openssl-all.ucl | 4 + release/packages/ucl/openssl-lib-all.ucl | 4 + release/packages/ucl/periodic-all.ucl | 4 + release/packages/ucl/pkg-bootstrap-all.ucl | 4 + release/packages/ucl/rc-all.ucl | 4 + release/packages/ucl/rcmds-all.ucl | 7 ++ release/packages/ucl/rdma-all.ucl | 1 + release/packages/ucl/rescue-all.ucl | 4 + release/packages/ucl/resolvconf-all.ucl | 4 + release/packages/ucl/runtime-all.ucl | 4 + release/packages/ucl/sendmail-all.ucl | 4 + release/packages/ucl/smbutils-all.ucl | 4 + release/packages/ucl/ssh-all.ucl | 4 + release/packages/ucl/syscons-all.ucl | 4 + release/packages/ucl/syslogd-all.ucl | 4 + release/packages/ucl/tcpd-all.ucl | 4 + release/packages/ucl/telnet-all.ucl | 4 + release/packages/ucl/tests-all.ucl | 4 + release/packages/ucl/ufs-all.ucl | 4 + release/packages/ucl/unbound-all.ucl | 4 + release/packages/ucl/utilities-all.ucl | 4 + release/packages/ucl/vi-all.ucl | 4 + release/packages/ucl/vt-all.ucl | 4 + release/packages/ucl/wpa-all.ucl | 4 + release/packages/ucl/zfs-all.ucl | 4 + 87 files changed, 338 insertions(+), 205 deletions(-) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package deleted file mode 100644 index e00efed2af1b..000000000000 --- a/release/packages/Makefile.package +++ /dev/null @@ -1,191 +0,0 @@ -# -# - -acct_COMMENT= System Accounting Utilities -acct_DESC= System Accounting Utilities -acpi_COMMENT= ACPI Utilities -acpi_DESC= ACPI Utilities -amd_COMMENT= AMD Utilities -amd_DESC= AMD Utilities -apm_COMMENT= APM Utilities -apm_DESC= APM Utilities -at_COMMENT= AT Utilities -at_DESC= AT Utilities -audit_COMMENT= OpenBSM auditing utilities -audit_DESC= OpenBSM auditing utilities -autofs_COMMENT= Autofs Utilities -autofs_DESC= Autofs Utilities -bhyve_COMMENT= Bhyve Utilities -bhyve_DESC= Bhyve Utilities -blocklist_COMMENT= Blocklist Utilities -blocklist_DESC= Blocklist Utilities -bluetooth_COMMENT= Bluetooth Utilities -bluetooth_DESC= Bluetooth Utilities -bootloader_COMMENT= Bootloader -bootloader_DESC= Bootloader and configuration files -bsdinstall_COMMENT= BSDInstall Utilities -bsdinstall_DESC= BSDInstall Utilities -bsnmp_COMMENT= BSNMP Utilities -bsnmp_DESC= BSNMP Utilities -caroot_COMMENT= SSL Certificates -caroot_DESC= SSL Certificates -clang_COMMENT= Clang Utilities -clang_DESC= Clang Utilities -clibs_COMMENT= Core C Libraries -clibs_DESC= Core C Libraries -certctl_COMMENT= SSL Certificate Utility -certctl_DESC= SSL Certificate Utility -console-tools_COMMENT= Console Utilities -console-tools_DESC= Console Utilities -cron_COMMENT= cron(8) and crontab(1) -cron_DESC= cron(8) and crontab(1) -csh_COMMENT= C Shell -csh_DESC= C Shell -ctf-tools_COMMENT= CTF Utilities -ctf-tools_DESC= CTF Utilities -cxgbe-tools_COMMENT= Chelsio cxbge Utilities -cxgbe-tools_DESC= Chelsio cxbge Utilities -devd_COMMENT= Devd Utility and scripts -devd_DESC= Devd Utility and scripts -devmatch_COMMENT= Devmatch Utility -devmatch_DESC= Devmatch Utility -dhclient_COMMENT= DHCP Client -dhclient_DESC= DHCP Client -dma_COMMENT= DMA Mail Agent Utilities -dma_DESC= DMA Mail Agent Utilities -docs_COMMENT= Documentation -docs_DESC= Documentation -dtrace_COMMENT= Dtrace Utilities -dtrace_DESC= Dtrace Utilities -dwatch_COMMENT= Dwatch Utilities -dwatch_DESC= Dwatch Utilities -ee_COMMENT= Easy Editor Utilities -ee_DESC= Easy Editor Utilities -efi-tools_COMMENT= UEFI Utilities -efi-tools_DESC= UEFI Utilities -examples_COMMENT= Examples in /usr/share/examples -examples_DESC= Examples in /usr/share/examples -fd_COMMENT= Floppy disk support -fd_DESC= Floppy disk support -fetch_COMMENT= Fetch Utility -fetch_DESC= Fetch Utility -firmware-iwm_DESC= iwm(4) firmwares -firmware-iwm_COMMENT= iwm(4) firmwares -ftp_COMMENT= FTP Utilities -ftp_DESC= FTP Utilities -ftpd_COMMENT= FTP Daemon -ftpd_DESC= FTP Daemon -fwget_COMMENT= FWGET Utility -fwget_DESC= FWGET Utility -games_COMMENT= Games -games_DESC= Games -geom_COMMENT= GEOM Utilitites -geom_DESC= GEOM Utilitites -ggate_COMMENT= GEOM Gate Utilities -ggate_DESC= GEOM Gate Utilities -hast_COMMENT= Highly Available Storage daemon -hast_DESC= Highly Available Storage daemon -hostapd_COMMENT= 802.11 Access Point Daemon an Utilities -hostapd_DESC= 802.11 Access Point Daemon an Utilities -hyperv-tools_COMMENT= Microsoft HyperV Utilities -hyperv-tools_DESC= Microsoft HyperV Utilities -inetd_COMMENT= Internet super-server -inetd_DESC= Internet super-server -jail_COMMENT= Jail Utilities -jail_DESC= Jail Utilities -jail-debug_DESCR= Debugging Symbols -jail-development_DESCR=Development Files -jail-profile_DESCR= Profiling Libraries -jail-lib32_DESCR= 32-bit Libraries -jail-lib32-debug_DESCR=32-bit Debugging Symbols -jail-lib32-development_DESCR=32-bit Development Files -jail-lib32-profile_DESCR=32-bit Profiling Libraries -kerberos_COMMENT= Kerberos Utilities -kerberos_DESC= Kerberos Utilities -kerberos-lib_COMMENT= Kerberos Libraries -kerberos-lib_DESC= Kerberos Libraries -kernel_COMMENT= FreeBSD Kernel -kernel_DESC= FreeBSD Kernel -lp_COMMENT= Printer subsystem -lp_DESC= Printer subsystem -manuals_COMMENT= Manual Pages -manuals_DESC= Manual Pages -mlx-tools_COMMENT= Mellanox Utilities -mlx-tools_DESC= Mellanox Utilities -mtree_COMMENT= MTREE Files -mtree_DESC= MTREE Files -netmap_COMMENT= Netmap Library and Utilities -netmap_DESC= Netmap Library and Utilities -newsyslog_COMMENT= Newsyslog Utility -newsyslog_DESC= Newsyslog Utility -nfs_COMMENT= NFS Utilities -nfs_DESC= NFS Utilities -ntp_COMMENT= Network Time Protocol server and client -ntp_DESC= Network Time Protocol server and client -nuageinit_COMMENT= CloudInit support scripts -nuageinit_DESC= CloudInit support scripts -nvme-tools_COMMENT= NVME Utilities -nvme-tools_DESC= NVME Utilities -openssl_COMMENT= OpenSSL Utility -openssl_DESC= OpenSSL Utility -openssl-lib_COMMENT= OpenSSL Libraries -openssl-lib_DESC= OpenSSL Libraries -pkg-bootstrap_COMMENT= pkg bootstrap Utility -pkg-bootstrap_DESC= pkg bootstrap Utility -periodic_COMMENT= Periodic Utility -periodic_DESC= Periodic Utility -rc_COMMENT= RC Scripts -rc_DESC= RC Scripts -rcmds_COMMENT= BSD/SunOS remote status commands -rcmds_DESC=\ -The BSD/SunOS remote status commands, which can be used to query or interact\ -with remote hosts over the network. This includes the command-line utilities\ -rwho, ruptime, rup, rusers and rwall and the daemons rwhod, rpc.rstatd,\ -rpc.rusersd, and rpc.rwalld. -rdma_COMMENT= RDMA Utilities -rdma_DESC= RDMA Utilities -rescue_COMMENT= Rescue Utilities -rescue_DESC= Rescue Utilities -resolvconf_COMMENT= Resolvconf Utility and scripts -resolvconf_DESC= Resolvconf Utility and scripts -runtime_COMMENT= FreeBSD Base System -runtime_DESC= FreeBSD Base System -runtime-debug_DESCR= Debugging Symbols -runtime-development_DESCR=Development Files -runtime-profile_DESCR= Profiling Libraries -runtime-lib32_DESCR= 32-bit Libraries -runtime-lib32-debug_DESCR=32-bit Debugging Symbols -runtime-lib32-development_DESCR=32-bit Development Files -runtime-lib32-profile_DESCR=32-bit Profiling Libraries -sendmail_COMMENT= Sendmail Utilities -sendmail_DESC= Sendmail Utilities -smbutils_COMMENT= SMB Utilities -smbutils_DESC= SMB Utilities -ssh_COMMENT= Secure Shell Utilities -ssh_DESC= Secure Shell Utilities -syscons_COMMENT= Syscons Console -syscons_DESC= Syscons Console -syslogd_COMMENT= Syslog Daemon -syslogd_DESC= Syslog Daemon -tcpd_COMMENT= TCP Wrapper utilities -tcpd_DESC= TCP Wrapper utilities -telnet_COMMENT= Telnet client -telnet_DESC= Telnet client -tests_COMMENT= Test Suite -tests_DESC= Test Suite -toolchain_COMMENT= Utilities for program development -toolchain_DESC= Utilities for program development -ufs_COMMENT= UFS Libraries and Utilities -ufs_DESC= UFS Libraries and Utilities -unbound_COMMENT= Unbound DNS Resolver -unbound_DESC= Unbound DNS Resolver -utilities_COMMENT= Non-vital programs and libraries -utilities_DESC= Non-vital programs and libraries -vi_COMMENT= Vi Editor -vi_DESC= Vi Editor -vt_COMMENT= VT fonts and keyboard files -vt_DESC= VT fonts and keyboard files -wpa_COMMENT= 802.11 Supplicant -wpa_DESC= 802.11 Supplicant -zfs_COMMENT= ZFS Libraries and Utilities -zfs_DESC= ZFS Libraries and Utilities diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 4dac34cd4753..6a64fc78a3b1 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -27,9 +27,7 @@ source-level debugger." main() { outname="" origname="" - desc= desc_suffix="" - comment= comment_suffix="" debug= uclsource= @@ -135,9 +133,6 @@ main() { ;; esac - desc="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESC)" - comment="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_COMMENT)" - uclsource="${srctree}/release/packages/template.ucl" if [ -n "${debug}" ]; then @@ -148,9 +143,7 @@ main() { echo "origname=${origname}" echo "srctree=${srctree}" echo "uclfile=${uclfile}" - echo "desc=${desc}" echo "desc_suffix=${desc_suffix}" - echo "comment=${comment}" echo "comment_suffix=${comment_suffix}" echo "vital=${vital}" echo "cp ${uclsource} -> ${uclfile}" @@ -160,9 +153,6 @@ main() { echo "" fi - [ -z "${comment}" ] && comment="${outname} package" - [ -z "${desc}" ] && desc="${outname} package" - cp "${uclsource}" "${uclfile}" if [ -n "${pkgdeps}" ]; then echo 'deps: {' >> ${uclfile} @@ -182,9 +172,7 @@ EOF PKGNAME "${origname}" \ PKGGENNAME "${outname}" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ - COMMENT "${comment}" \ COMMENT_SUFFIX "${comment_suffix}" \ - DESC "${desc}" \ DESC_SUFFIX "$desc_suffix" \ CAP_MKDB_ENDIAN "${cap_arg}" \ PKG_WWW "${PKG_WWW}" \ diff --git a/release/packages/template.ucl b/release/packages/template.ucl index a65f58868118..982641305ad6 100644 --- a/release/packages/template.ucl +++ b/release/packages/template.ucl @@ -4,7 +4,7 @@ name = "${PKG_NAME_PREFIX}-${PKGNAME}" origin = "base" version = "${VERSION}" -comment = "${COMMENT}" +comment = "${PKGNAME} package" categories = [ base ] maintainer = "${PKG_MAINTAINER}" www = "${PKG_WWW}" @@ -12,7 +12,7 @@ prefix = "/" licenselogic = "single" licenses = [ BSD2CLAUSE ] desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: f75b20e7ddb8 - main - packages: make UCL files required List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f75b20e7ddb86a68e0c7bd1d96de523f27fc4182 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=f75b20e7ddb86a68e0c7bd1d96de523f27fc4182 commit f75b20e7ddb86a68e0c7bd1d96de523f27fc4182 Author: Lexi Winter AuthorDate: 2025-07-07 13:37:19 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:44 +0000 packages: make UCL files required Modify template.ucl to require that the "all" UCL file exists for every package. This prevents packages being added accidentally, and ensures each package has as least a perfunctory comment and description. Add missing UCL files for all existing packages. Modify special packages created by Makefile.inc1 to pass the appropriate parameters to generate-ucl to find their UCL files. Reviewed by: des, bapt Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50281 --- Makefile.inc1 | 24 ++++++++++++------------ release/packages/generate-ucl.sh | 10 ++++++++++ release/packages/template.ucl | 2 +- release/packages/ucl/ccdconfig-all.ucl | 5 +++++ release/packages/ucl/ctl-all.ucl | 4 ++++ release/packages/ucl/dtb-all.ucl | 4 ++++ release/packages/ucl/elftoolchain-all.ucl | 4 ---- release/packages/ucl/fd-all.ucl | 4 ++++ release/packages/ucl/ipf-all.ucl | 4 ++++ release/packages/ucl/ipfw-all.ucl | 4 ++++ release/packages/ucl/iscsi-all.ucl | 6 ++++++ release/packages/ucl/kernel-all.ucl | 4 ++-- release/packages/ucl/lib9p-all.ucl | 5 +++++ release/packages/ucl/libarchive-all.ucl | 4 ++++ release/packages/ucl/libbegemot-all.ucl | 5 +++++ release/packages/ucl/libblocksruntime-all.ucl | 4 ++++ release/packages/ucl/libbsdstat-all.ucl | 5 +++++ release/packages/ucl/libbsm-all.ucl | 6 ++++++ release/packages/ucl/libbz2-all.ucl | 5 +++++ release/packages/ucl/libcasper-all.ucl | 5 +++++ release/packages/ucl/libcompat-all.ucl | 4 ++++ release/packages/ucl/libcompiler_rt-all.ucl | 4 ++++ release/packages/ucl/libcuse-all.ucl | 5 +++++ release/packages/ucl/libdwarf-all.ucl | 6 ++++++ release/packages/ucl/libevent1-all.ucl | 4 ++++ release/packages/ucl/libexecinfo-all.ucl | 5 +++++ release/packages/ucl/libipt-all.ucl | 6 ++++++ release/packages/ucl/libldns-all.ucl | 6 ++++++ release/packages/ucl/liblzma-all.ucl | 5 +++++ release/packages/ucl/libmagic-all.ucl | 5 +++++ release/packages/ucl/libpathconv-all.ucl | 5 +++++ release/packages/ucl/librpcsec_gss-all.ucl | 5 +++++ release/packages/ucl/librss-all.ucl | 5 +++++ release/packages/ucl/libsdp-all.ucl | 5 +++++ release/packages/ucl/libsqlite3-all.ucl | 4 ++++ release/packages/ucl/libstdbuf-all.ucl | 6 ++++++ release/packages/ucl/libstdthreads-all.ucl | 4 ++++ release/packages/ucl/libthread_db-all.ucl | 5 +++++ release/packages/ucl/libucl-all.ucl | 5 +++++ release/packages/ucl/libufs-all.ucl | 8 ++++++++ release/packages/ucl/libvgl-all.ucl | 13 +++++++++++++ release/packages/ucl/libvmmapi-all.ucl | 4 ++++ release/packages/ucl/liby-all.ucl | 5 +++++ release/packages/ucl/libyaml-all.ucl | 5 +++++ release/packages/ucl/libzfs-all.ucl | 5 +++++ release/packages/ucl/lld-all.ucl | 5 +++++ release/packages/ucl/lldb-all.ucl | 5 +++++ release/packages/ucl/locales-all.ucl | 4 ++++ release/packages/ucl/natd-all.ucl | 4 ++++ release/packages/ucl/pf-all.ucl | 4 ++++ release/packages/ucl/ppp-all.ucl | 5 +++++ release/packages/ucl/quotacheck-all.ucl | 8 ++++++++ release/packages/ucl/src-all.ucl | 5 +++++ release/packages/ucl/src-sys-all.ucl | 5 +++++ release/packages/ucl/syscons-all.ucl | 4 ---- release/packages/ucl/syscons-data-all.ucl | 4 ++++ release/packages/ucl/toolchain-all.ucl | 4 ++++ release/packages/ucl/vt-all.ucl | 4 ---- release/packages/ucl/vt-data-all.ucl | 4 ++++ release/packages/ucl/zoneinfo-all.ucl | 5 +++++ 60 files changed, 291 insertions(+), 27 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index d366be09f497..010f5ac2bb55 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2130,11 +2130,10 @@ create-source-src-package: _pkgbootstrap .PHONY PKGNAME "src" \ PKGGENNAME "src" \ VERSION "${PKG_VERSION}" \ - DESC "FreeBSD Kernel Sources" \ - COMMENT "FreeBSD Userland Sources" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ PKG_WWW "${PKG_WWW}" \ + UCLFILES "${SRCDIR}/release/packages/ucl" \ ${SRCDIR}/release/packages/template.ucl \ ${SSTAGEDIR}/src.ucl ${PKG_CMD} -o ABI=${PKG_ABI} \ @@ -2155,13 +2154,12 @@ create-source-src-sys-package: _pkgbootstrap .PHONY > ${SSTAGEDIR}/src-sys.plist ${SRCDIR}/release/packages/generate-ucl.lua \ PKGNAME "src-sys" \ - PKGGENNAME "src" \ + PKGGENNAME "src-sys" \ VERSION "${PKG_VERSION}" \ - DESC "FreeBSD Kernel Sources" \ - COMMENT "FreeBSD Kernel Sources" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ PKG_WWW "${PKG_WWW}" \ + UCLFILES "${SRCDIR}/release/packages/ucl" \ ${SRCDIR}/release/packages/template.ucl \ ${SSTAGEDIR}/src-sys.ucl ${PKG_CMD} -o ABI=${PKG_ABI} \ @@ -2226,12 +2224,12 @@ create-dtb-package: @if [ -f ${KSTAGEDIR}/${DISTDIR}/dtb.plist ]; then \ ${SRCDIR}/release/packages/generate-ucl.lua \ PKGNAME "dtb" \ + PKGGENNAME "dtb" \ VERSION "${PKG_VERSION}" \ - COMMENT "FreeBSD Devicetree Blobs" \ - DESC "FreeBSD Devicetree Blobs" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ PKG_WWW "${PKG_WWW}" \ + UCLFILES "${SRCDIR}/release/packages/ucl" \ ${SRCDIR}/release/packages/template.ucl \ ${KSTAGEDIR}/${DISTDIR}/dtb.ucl ; \ awk -F\" ' \ @@ -2257,13 +2255,15 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap -v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \ ${SRCDIR}/release/packages/generate-ucl.lua \ PKGNAME "kernel-${INSTALLKERNEL:tl}${flavor}" \ + PKGGENNAME "kernel" \ VERSION "${PKG_VERSION}" \ KERNELDIR "kernel" \ - COMMENT "FreeBSD ${INSTALLKERNEL} kernel ${flavor}" \ - DESC "FreeBSD ${INSTALLKERNEL} kernel ${flavor}" \ + KERNEL_NAME "${INSTALLKERNEL}" \ + KERNEL_FLAVOR "${flavor}" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ PKG_WWW "${PKG_WWW}" \ + UCLFILES "${SRCDIR}/release/packages/ucl" \ ${SRCDIR}/release/packages/template.ucl \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ awk -F\" ' \ @@ -2296,14 +2296,14 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne PKGNAME "kernel-${_kernel:tl}${flavor}" \ PKGGENNAME "kernel" \ FORCEINCLUDE "kernel${flavor}" \ - UCLFILES "${SRCDIR}/release/packages/" \ VERSION "${PKG_VERSION}" \ + KERNEL_NAME "${_kernel:tl}" \ + KERNEL_FLAVOR "${flavor}" \ KERNELDIR "kernel.${_kernel}" \ - DESC "FreeBSD ${_kernel} kernel ${flavor}" \ - COMMENT "FreeBSD ${_kernel} kernel ${flavor}" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ PKG_WWW "${PKG_WWW}" \ + UCLFILES "${SRCDIR}/release/packages/ucl" \ ${SRCDIR}/release/packages/template.ucl \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ awk -F\" ' \ diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 6a64fc78a3b1..3d3f67ed365c 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -5,6 +5,10 @@ mancx=" (manual pages)" mandx="This package contains the online manual pages." +lib32mancx=" (32-bit manual pages)" +lib32mandx="This package contains the online manual pages for 32-bit components +on a 64-bit host." + lib32cx=" (32-bit libraries)" lib32dx="This package contains 32-bit libraries for running 32-bit applications on a 64-bit host." @@ -113,6 +117,12 @@ main() { desc_suffix="$dbg32dx" pkgdeps="${outname}" ;; + *-man-lib32) + outname="${outname%%-man-lib32}" + comment_suffix="$lib32mancx" + desc_suffix="$lib32mandx" + pkgdeps="${outname}" + ;; *-lib32) outname="${outname%%-lib32}" comment_suffix="$lib32cx" diff --git a/release/packages/template.ucl b/release/packages/template.ucl index 982641305ad6..faa48effe1ad 100644 --- a/release/packages/template.ucl +++ b/release/packages/template.ucl @@ -14,6 +14,6 @@ licenses = [ BSD2CLAUSE ] desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: d9c11f0799b5 - main - packages: handle dependencies in ucl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9c11f0799b546e8a244af2125ded27aa1ce05b8 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=d9c11f0799b546e8a244af2125ded27aa1ce05b8 commit d9c11f0799b546e8a244af2125ded27aa1ce05b8 Author: Lexi Winter AuthorDate: 2025-07-07 13:38:23 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:44 +0000 packages: handle dependencies in ucl For packages with specific dependencies, add the dependencies in their UCL files instead of listing them in generate-ucl.sh. generate-ucl.sh has logic to add automatic subpackage dependencies, so e.g. "FreeBSD-foo-dev" depends on "FreeBSD-foo". Move this into generate-ucl.lua instead. This means we no longer need to pre-process the UCL in generate-ucl.sh, and we can undo the hack where it calls generate-ucl.lua with the same filename as both input and output file. Reviewed by: des, bapt Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50283 --- release/packages/generate-ucl.lua | 70 ++++++++++++++++++++++++++++++++++++++- release/packages/generate-ucl.sh | 56 +------------------------------ release/packages/ucl/certctl.ucl | 12 +++++++ release/packages/ucl/clang.ucl | 11 ++++++ release/packages/ucl/periodic.ucl | 6 ++++ release/packages/ucl/rcmds.ucl | 8 +++++ 6 files changed, 107 insertions(+), 56 deletions(-) diff --git a/release/packages/generate-ucl.lua b/release/packages/generate-ucl.lua index 0d18e1dc0120..0557e8e8cc23 100755 --- a/release/packages/generate-ucl.lua +++ b/release/packages/generate-ucl.lua @@ -14,6 +14,42 @@ template.ucl. local ucl = require("ucl") +-- Hardcode a list of packages which don't get the automatic pkggenname +-- dependency because the base package doesn't exist. We should have a better +-- way to handle this. +local no_gen_deps = { + ["libcompat-dev"] = true, + ["libcompat-dev-lib32"] = true, + ["libcompat-man"] = true, + ["libcompiler_rt-dev"] = true, + ["libcompiler_rt-dev-lib32"] = true, + ["liby-dev"] = true, + ["liby-dev-lib32"] = true, +} + +-- Return true if the package 'pkgname' should have a dependency on the package +-- pkggenname. +function add_gen_dep(pkgname, pkggenname) + if pkgname == pkggenname then + return false + end + if pkgname == nil or pkggenname == nil then + return false + end + if no_gen_deps[pkgname] ~= nil then + return false + end + if pkggenname == "kernel" then + return false + end + + return true +end + +local pkgname = nil +local pkggenname = nil +local pkgprefix = nil +local pkgversion = nil local comment_suffix = nil local desc_suffix = nil @@ -31,10 +67,18 @@ for i = 2, #arg - 2, 2 do local varname = arg[i - 1] local varvalue = arg[i] - if varname == "COMMENT_SUFFIX" and #varvalue > 0 then + if varname == "PKGNAME" and #varvalue > 0 then + pkgname = varvalue + elseif varname == "PKGGENNAME" and #varvalue > 0 then + pkggenname = varvalue + elseif varname == "VERSION" and #varvalue > 0 then + pkgversion = varvalue + elseif varname == "COMMENT_SUFFIX" and #varvalue > 0 then comment_suffix = varvalue elseif varname == "DESC_SUFFIX" and #varvalue > 0 then desc_suffix = varvalue + elseif varname == "PKG_NAME_PREFIX" and #varvalue > 0 then + pkgprefix = varvalue end parser:register_variable(varname, varvalue) @@ -49,6 +93,30 @@ end local obj = parser:get_object() +-- If pkgname is different from pkggenname, add a dependency on pkggenname. +-- This means that e.g. -dev packages depend on their respective base package. +if add_gen_dep(pkgname, pkggenname) then + if obj["deps"] == nil then + obj["deps"] = {} + end + obj["deps"][pkggenname] = { + ["version"] = pkgversion, + ["origin"] = "base" + } +end + +-- If PKG_NAME_PREFIX is provided, rewrite the names of dependency packages. +-- We can't do this in UCL since variable substitution doesn't work in array +-- keys. +if pkgprefix ~= nil and obj["deps"] ~= nil then + newdeps = {} + for dep, opts in pairs(obj["deps"]) do + local newdep = pkgprefix .. "-" .. dep + newdeps[newdep] = opts + end + obj["deps"] = newdeps +end + -- Add comment and desc suffix. if comment_suffix ~= nil then obj["comment"] = obj["comment"] .. comment_suffix diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 3d3f67ed365c..57fe181ec5bb 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -59,81 +59,40 @@ main() { shift $(( ${OPTIND} - 1 )) case "${outname}" in - bootloader) - pkgdeps="" - ;; - certctl) - pkgdeps="caroot openssl" - ;; - clang) - pkgdeps="lld libcompiler_rt-dev" - ;; - periodic) - pkgdeps="cron" - ;; - rcmds) - # the RPC daemons require rpcbind - pkgdeps="utilities" - ;; - - # -dev packages that have no corresponding non-dev package - # as a dependency. - libcompat-dev|libcompiler_rt-dev|liby-dev) - outname=${outname%%-dev} - comment_suffix="$devcx" - desc_suffix="$devdx" - ;; - libcompat-dev-lib32|libcompiler_rt-dev-lib32|liby-dev-lib32) - outname=${outname%%-dev-lib32} - comment_suffix="$dev32cx" - desc_suffix="$dev32dx" - ;; - libcompat-man|libelftc-man) - outname=${outname%%-man} - comment_suffix="$mancx" - desc_suffix="$mandx" - ;; *-dev) outname="${outname%%-dev}" comment_suffix="$devcx" desc_suffix="$devdx" - pkgdeps="${outname}" ;; *-dbg) outname="${outname%%-dbg}" comment_suffix="$dbgcx" desc_suffix="$dbgdx" - pkgdeps="${outname}" ;; *-dev-lib32) outname="${outname%%-dev-lib32}" comment_suffix="$dev32cx" desc_suffix="$dev32dx" - pkgdeps="${outname}" ;; *-dbg-lib32) outname="${outname%%-dbg-lib32}" comment_suffix="$dbg32cx" desc_suffix="$dbg32dx" - pkgdeps="${outname}" ;; *-man-lib32) outname="${outname%%-man-lib32}" comment_suffix="$lib32mancx" desc_suffix="$lib32mandx" - pkgdeps="${outname}" ;; *-lib32) outname="${outname%%-lib32}" comment_suffix="$lib32cx" desc_suffix="$lib32dx" - pkgdeps="${outname}" ;; *-man) outname="${outname%%-man}" comment_suffix="$mancx" desc_suffix="$mandx" - pkgdeps="${outname}" ;; ${origname}) ;; @@ -163,19 +122,6 @@ main() { echo "" fi - cp "${uclsource}" "${uclfile}" - if [ -n "${pkgdeps}" ]; then - echo 'deps: {' >> ${uclfile} - for dep in ${pkgdeps}; do - cat <> ${uclfile} - ${PKG_NAME_PREFIX}-${dep}: { - origin: "base", - version: "${PKG_VERSION}" - } -EOF - done - echo '}' >> ${uclfile} - fi cap_arg="$( make -f ${srctree}/share/mk/bsd.endian.mk -VCAP_MKDB_ENDIAN )" ${srctree}/release/packages/generate-ucl.lua \ VERSION "${PKG_VERSION}" \ @@ -188,7 +134,7 @@ EOF PKG_WWW "${PKG_WWW}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ UCLFILES "${srctree}/release/packages/ucl" \ - ${uclfile} ${uclfile} + ${uclsource} ${uclfile} return 0 } diff --git a/release/packages/ucl/certctl.ucl b/release/packages/ucl/certctl.ucl index 664a6d139585..300aa55fabda 100644 --- a/release/packages/ucl/certctl.ucl +++ b/release/packages/ucl/certctl.ucl @@ -1,3 +1,15 @@ +deps { + "caroot": { + version = "${VERSION}" + origin = "base" + } + + "openssl": { + version = "${VERSION}" + origin = "base" + } +} + scripts: { # XXX If pkg picks up a mechanism to detect in the post-install script # files being added or removed, we should use it instead to gate the diff --git a/release/packages/ucl/clang.ucl b/release/packages/ucl/clang.ucl new file mode 100644 index 000000000000..956b769a1ee7 --- /dev/null +++ b/release/packages/ucl/clang.ucl @@ -0,0 +1,11 @@ +deps { + "lld" { + version = "${VERSION}" + origin = "base" + } + + "libcompiler_rt-dev" { + version = "${VERSION}" + origin = "base" + } +} diff --git a/release/packages/ucl/periodic.ucl b/release/packages/ucl/periodic.ucl new file mode 100644 index 000000000000..6f85d2ab744b --- /dev/null +++ b/release/packages/ucl/periodic.ucl @@ -0,0 +1,6 @@ +deps { + "cron" { + version = "${VERSION}" + origin = "base" + } +} diff --git a/release/packages/ucl/rcmds.ucl b/release/packages/ucl/rcmds.ucl new file mode 100644 index 000000000000..88a4916675dc --- /dev/null +++ b/release/packages/ucl/rcmds.ucl @@ -0,0 +1,8 @@ +deps { + # The RPC daemons require rpcbind. + "utilities" { + version = "${VERSION}" + origin = "base" + } +} + From nobody Tue Jul 15 05:12:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bh6lF0PGMz61wv2; Tue, 15 Jul 2025 05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bh6lD3MqDz3ly5; Tue, 15 Jul 2025 05:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K8IeVCeU2hlMMIFjutdw8K6dfvTPAhwsCo4d7ZV2Pek=; b=pVCdCM/AnOu4uSvNYSujfColGtLoMt7HgpO/mzMwP7pkNfAtJSLFqY3lG87pBvBwf61kro FWh/ViLL6zeD+qmqoRVMBNVfQ2pDqz41sZb5F88pIZ8efAkEmqBWWXtIdXpjFTAFX+kmM8 OecD/+S/Awcuqo8clMPsRJbGssfGQoXO/+nbxKExRlpGnjYzp+rRf5VBVcKC7/XGvOljw6 nknK9CJQEJaa4XSRr/Kppemdjvr95sOshku/thEnZJQD/inpk7QWGfnB4PNUDPd11+iFSs rBIxVwwCinaS6sQ1TsFxIRjfCHXvSQt3hjqqyedJxWo8GZpnTzweJXh3hsjEIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K8IeVCeU2hlMMIFjutdw8K6dfvTPAhwsCo4d7ZV2Pek=; b=tgDWat/cnzPyeAquZd0jVRs0pBmK50NU2kR5i57oZdbFJi7tnr2ge4hG8lUFEkr8nhN+ii GufKb6CGkYA1Knd6fF4Vjyhn4wmMwtEa7ZUWDE/dUepSct09BxeKde1ySBBBYd9yGjSnzo LEBvZoGdWpjmudy34LTBTFm2W17VR8zp/x+qp8wYpH6Sg5Qi5pOh7wflmRS7fVSNi32e5x fMWlR/1T9KiGiNsO6zB9/ipRiROAFtF+5VZeY6ZzX8jlTmPPSqoZJ/eCMNdxDdKxHKVqqJ dqECniCu6TbQU11AqkK+OobFff9x6SqG1d1EA/K0GT73jbjyh9ogCKIqzVrcvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752556376; a=rsa-sha256; cv=none; b=DtnXfRXQ33udUHUHAJIko6t0XNRdJI9vprGV6W7W6UtMKatFoLSoK50I+7P46Hi1M8DNBe 0pjZ+ouyXSPvIG6knZFmqGsg5PNlN8ea+AzXYvuw+Z+wQa8RV2lkxHe4LYgLiG7XwS1eoN IK6KPELqM6+1O7XWuTT7Vb5T0FP65wwaX9xqSSK00kf/sNVZn/MQw07FwgcdjQxycbWzbv 6TV3k/2eBQKaG3FR90WU+h5FT3unnjZFkUsT/xEmKVK8XibvWDWE3b6R26qzVz5YwA+MgP 1SQun46xoKypdDIfAUo4wvEJcyIWG7HtzU4SsDEwG9MmZJN+1ootMKG9AeahmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bh6lD2zPfz9c3; Tue, 15 Jul 2025 05:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56F5CulO079810; Tue, 15 Jul 2025 05:12:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56F5CusJ079807; Tue, 15 Jul 2025 05:12:56 GMT (envelope-from git) Date: Tue, 15 Jul 2025 05:12:56 GMT Message-Id: <202507150512.56F5CusJ079807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 237db83d02c8 - main - packages: handle suffixes in generate-ucl.lua List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 237db83d02c8fb3a6292427990a92ca280f73177 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=237db83d02c8fb3a6292427990a92ca280f73177 commit 237db83d02c8fb3a6292427990a92ca280f73177 Author: Lexi Winter AuthorDate: 2025-07-07 13:39:39 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:44 +0000 packages: handle suffixes in generate-ucl.lua Move handling of comment/desc suffixes from generate-ucl.sh to generate-ucl.lua. Reviewed by: des, bapt Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50284 --- release/packages/generate-ucl.lua | 72 ++++++++++++++++++++++++++++++--------- release/packages/generate-ucl.sh | 46 ------------------------- 2 files changed, 56 insertions(+), 62 deletions(-) diff --git a/release/packages/generate-ucl.lua b/release/packages/generate-ucl.lua index 0557e8e8cc23..3d91d11bc42f 100755 --- a/release/packages/generate-ucl.lua +++ b/release/packages/generate-ucl.lua @@ -6,14 +6,65 @@ generare-ucl.lua [ ]... Build a package's UCL configuration by loading the template UCL file , replacing any $VARIABLES in the UCL based on the provided variables, then writing the result to . - -If COMMENT_SUFFIX or DESC_SUFFIX are set, append these to the generated comment -and desc fields. We do this here because there's no way to do it in -template.ucl. ]]-- local ucl = require("ucl") +-- Give subpackages a special comment and description suffix to indicate what +-- they contain, so e.g. "foo-man" has " (manual pages)" appended to its +-- comment. This avoids having to create a separate ucl files for every +-- subpackage just to set this. +-- +-- Note that this is not a key table because the order of the pattern matches +-- is important. +pkg_suffixes = { + { + "%-dev%-lib32$", "(32-bit development files)", + "This package contains development files for compiling ".. + "32-bit applications on a 64-bit host." + }, + { + "%-dbg%-lib32$", "(32-bit debugging symbols)", + "This package contains 32-bit external debugging symbols ".. + "for use with a source-level debugger.", + }, + { + "%-man%-lib32$", "(32-bit manual pages)", + "This package contains the online manual pages for 32-bit ".. + "components on a 64-bit host.", + }, + { + "%-lib32$", "(32-bit libraries)", + "This package contains 32-bit libraries for running 32-bit ".. + "applications on a 64-bit host.", + }, + { + "%-dev$", "(development files)", + "This package contains development files for ".. + "compiling applications." + }, + { + "%-man$", "(manual pages)", + "This package contains the online manual pages." + }, + { + "%-dbg$", "(debugging symbols)", + "This package contains external debugging symbols for use ".. + "with a source-level debugger.", + }, +} + +function add_suffixes(obj) + local pkgname = obj["name"] + for _,pattern in pairs(pkg_suffixes) do + if pkgname:match(pattern[1]) ~= nil then + obj["comment"] = obj["comment"] .. " " .. pattern[2] + obj["desc"] = obj["desc"] .. "\n\n" .. pattern[3] + return + end + end +end + -- Hardcode a list of packages which don't get the automatic pkggenname -- dependency because the base package doesn't exist. We should have a better -- way to handle this. @@ -50,8 +101,6 @@ local pkgname = nil local pkggenname = nil local pkgprefix = nil local pkgversion = nil -local comment_suffix = nil -local desc_suffix = nil -- This parser is the output UCL we want to build. local parser = ucl.parser() @@ -73,10 +122,6 @@ for i = 2, #arg - 2, 2 do pkggenname = varvalue elseif varname == "VERSION" and #varvalue > 0 then pkgversion = varvalue - elseif varname == "COMMENT_SUFFIX" and #varvalue > 0 then - comment_suffix = varvalue - elseif varname == "DESC_SUFFIX" and #varvalue > 0 then - desc_suffix = varvalue elseif varname == "PKG_NAME_PREFIX" and #varvalue > 0 then pkgprefix = varvalue end @@ -118,12 +163,7 @@ if pkgprefix ~= nil and obj["deps"] ~= nil then end -- Add comment and desc suffix. -if comment_suffix ~= nil then - obj["comment"] = obj["comment"] .. comment_suffix -end -if desc_suffix ~= nil then - obj["desc"] = obj["desc"] .. "\n\n" .. desc_suffix -end +add_suffixes(obj) -- Write the output file. local f,err = io.open(arg[#arg], "w") diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 57fe181ec5bb..7b08c3a8c59d 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -2,37 +2,9 @@ # # -mancx=" (manual pages)" -mandx="This package contains the online manual pages." - -lib32mancx=" (32-bit manual pages)" -lib32mandx="This package contains the online manual pages for 32-bit components -on a 64-bit host." - -lib32cx=" (32-bit libraries)" -lib32dx="This package contains 32-bit libraries for running 32-bit applications on -a 64-bit host." - -devcx=" (development files)" -devdx="This package contains development files for compiling applications." - -dev32cx=" (32-bit development files)" -dev32dx="This package contains development files for compiling 32-bit applications -on a 64-bit host." - -dbgcx=" (debugging symbols)" -dbgdx="This package contains external debugging symbols for use with a source-level -debugger." - -dbg32cx=" (32-bit debugging symbols)" -dbg32dx="This package contains 32-bit external debugging symbols for use with a -source-level debugger." - main() { outname="" origname="" - desc_suffix="" - comment_suffix="" debug= uclsource= while getopts "do:s:u:" arg; do @@ -61,38 +33,24 @@ main() { case "${outname}" in *-dev) outname="${outname%%-dev}" - comment_suffix="$devcx" - desc_suffix="$devdx" ;; *-dbg) outname="${outname%%-dbg}" - comment_suffix="$dbgcx" - desc_suffix="$dbgdx" ;; *-dev-lib32) outname="${outname%%-dev-lib32}" - comment_suffix="$dev32cx" - desc_suffix="$dev32dx" ;; *-dbg-lib32) outname="${outname%%-dbg-lib32}" - comment_suffix="$dbg32cx" - desc_suffix="$dbg32dx" ;; *-man-lib32) outname="${outname%%-man-lib32}" - comment_suffix="$lib32mancx" - desc_suffix="$lib32mandx" ;; *-lib32) outname="${outname%%-lib32}" - comment_suffix="$lib32cx" - desc_suffix="$lib32dx" ;; *-man) outname="${outname%%-man}" - comment_suffix="$mancx" - desc_suffix="$mandx" ;; ${origname}) ;; @@ -112,8 +70,6 @@ main() { echo "origname=${origname}" echo "srctree=${srctree}" echo "uclfile=${uclfile}" - echo "desc_suffix=${desc_suffix}" - echo "comment_suffix=${comment_suffix}" echo "vital=${vital}" echo "cp ${uclsource} -> ${uclfile}" echo "===============================================================" @@ -128,8 +84,6 @@ main() { PKGNAME "${origname}" \ PKGGENNAME "${outname}" \ PKG_NAME_PREFIX "${PKG_NAME_PREFIX}" \ - COMMENT_SUFFIX "${comment_suffix}" \ - DESC_SUFFIX "$desc_suffix" \ CAP_MKDB_ENDIAN "${cap_arg}" \ PKG_WWW "${PKG_WWW}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ From nobody Tue Jul 15 05:12:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bh6lG1D8Yz61wv6; Tue, 15 Jul 2025 05:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bh6lF5JD3z3m3d; Tue, 15 Jul 2025 05:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oJiuTnkfFWuAeHsIpjvJQBTnt8lQRXIH5S/IRNxcwQ=; b=x3vPex4EdN4K7IxupUmhTWiX8EBX8hOVZeygjclxseEEV6KxZXfto4fNaAjgXzXkiweC0O qsYSgHZz++wk7HCs8mf1GNKq2fTvAVzaBMk+KPqGNn9NC2OQ9sPvkWGdqgIj/6Uy478NqQ jFk4/TL/Koixu+jHeb1CaVFYDRCD3iJr1lV+gt18oSCNOGGcf61ulLI+9WxCoY99wgXQdD 6yzfYd73YcE1z6AI9dSAkK3z3P6SAaLYdY2TMBtnUEUBsuT6l4IuNV4PKmJL7+Jkcuy5kJ gaIeJpai+jDBj/IPQn04PMMwh4GTCDCH5bEJG3hBWqYjsF5V62+VVjzyO/gijQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oJiuTnkfFWuAeHsIpjvJQBTnt8lQRXIH5S/IRNxcwQ=; b=xqjjvu6vaNvbVuv5gwxU9tdR9mRDR7N7jwHf3oQBBhYRBPA+9CdE6JKJJ+liEARCQR0PKV 8W9qqCDWY3WmElKz49KoFyUynWNYZs1Uggnn/2SGm+aaUeHMH+6lqPN9rp1eKvBHFp5FTB xUYWZZ2nPmD5tkaua9jZjxQ7oVak0vvAU/aIQtMPAtpHQbjbv7A6BJ2I4qP70KSOQUEUS+ SDFT0cT1GQ913c5K9vI1FpIYzCl+gKmOjesfj7lDXwEh1+UmUl5yts7uF9vGvf6pSNQBxY +uGRUczDFWZVepsQTuYQ1mw53m/JCfWDynYIWtd/PiBWYE7wjCLrUNoevFPBlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752556377; a=rsa-sha256; cv=none; b=QoMw7jgshLU+FYbYeEy9ewqXysTe1ClWR67DqLc6/oC/c8YxxR2kp/xHlC5WhCDU3n8//x G0hUF9ZBwxCksDNXfUhFRt2Z8Ygm4jRx5jI+ZKhO1Tyo6Bjur4PtW3QnRkQjTdxcDvK7X7 UtdiXFn9ebEaIvzGCTbtbw8BWbpp819PnL++lL7zJLgXyNlpp5+5IA1NiA/FrCXYV9CUPK GEmXYZhgSKd8vPISox56lgrNTHu7EbC3/ttL/ywy3bdrOyhouuAaKv3ngeXPU+Q/v6W3VB 1cHWw9NaYD5+BmF4+KhyzHFE/PN0+OmzyBRsR5Me2iSKZfcwRNNEPT1Cn/dfJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bh6lF4Ct1z9GS; Tue, 15 Jul 2025 05:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56F5Cv4n079847; Tue, 15 Jul 2025 05:12:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56F5CvqJ079844; Tue, 15 Jul 2025 05:12:57 GMT (envelope-from git) Date: Tue, 15 Jul 2025 05:12:57 GMT Message-Id: <202507150512.56F5CvqJ079844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 953b3a061438 - main - release/packages/generate-ucl.sh: use correct exit status List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 953b3a061438ab977c60c79ac3efd38018a4fa0b Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=953b3a061438ab977c60c79ac3efd38018a4fa0b commit 953b3a061438ab977c60c79ac3efd38018a4fa0b Author: Lexi Winter AuthorDate: 2025-07-07 14:13:18 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:45 +0000 release/packages/generate-ucl.sh: use correct exit status Propagate the exit status from generate-ucl.lua, so that if parsing the UCL fails, the package generation step also fails. Approved by: kevans (mentor) Review by: kevans Differential Revision: https://reviews.freebsd.org/D51190 --- release/packages/generate-ucl.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 7b08c3a8c59d..3078185a3c4e 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -89,8 +89,6 @@ main() { PKG_MAINTAINER "${PKG_MAINTAINER}" \ UCLFILES "${srctree}/release/packages/ucl" \ ${uclsource} ${uclfile} - - return 0 } main "${@}" From nobody Tue Jul 15 05:12:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bh6lJ2hm4z61x8h; Tue, 15 Jul 2025 05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bh6lH6WyDz3mHl; Tue, 15 Jul 2025 05:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hhUD6rZ7yw1YbkolCG36vY+TsX87iaAaMfRayAPUSa4=; b=KOPEnXPl1Lzkej4ziedUp9VVj2KTS2B1tjSXG7lN2mAxf/7crCMtu19/lztxCF7nWbOau9 Opd237nYhhKAuqOZ+B5EQS2FYjobqCRS0Ahi2RR0UPiGMb5H+5G/BQROYmOnjoYNpLYG2O e1QSeC9XTxIE7Q5AUfMkzuN6XVa9y1q02Cdqe78IMxDHBwSadpbtx7kuI2khatFR4go3Pk aNREcEbJW7XUmH1MTCMlvtl5VWovNZfoTvaIQBET+3CrrZwZtrWSazbBPJIC4362fGHRr5 QI1jjxZdHxt0JD+3sElKv01JiBjW8f9yJjm8wjP/d7E4MncpT0JnEb+h74+5Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hhUD6rZ7yw1YbkolCG36vY+TsX87iaAaMfRayAPUSa4=; b=RrYH3Qd0uNB9CZ4lZOvLKzUhFrh2YQvZsYhF57+v994V3zGcM9/KUN4styMDiAZ0nLV8SL 1dnrGopqIHBUj1dHlJvWRO2+4j1Xba2YN3wkjS4qXew3ELu4te2kPa+Re/e+OhviVqBZoB Rk5FXjzUXiJ7q0+PAAxA6vw3tcXiKwN1tamtnkMS/FgDhHdKMrvp+d9VcBA94MD7HRgSMm mo6r33KSZ0jzNjp4izKknN0O1A6o0VURpK/7ZhVcWJOd34XYXc4HLWeLwKtg5JDJi0JMz2 PiLhmXDkbNzPoKo5xO7lU1WYL/GawX/qRWDCSL55z+5/k1q2S7hBO7D/DW67DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752556379; a=rsa-sha256; cv=none; b=veUPQ4IxdvAsspbDKtNHM/xjlkAlB0claIR1F0xDnZXJdhgxeQ59VPcQo5oXfNbUCvOjpW FhQ7ozVQU/ParU4d8omQVZQXYHkPmvqLPMeKozW9qTq0Dbx0/wsC+rhVQgq3V3NInmkfor U9ugOt88uaxQir4Qb5ylhgjZML/qu5icLgrR25t0qLAg0koTvkscCgwh3YbpxS89da8KEb QexfVu5Nyy3H8+yKtcwFesOKM6A2oQ+lYowl0IXg8mZkfvcBpxcYeNCb8fvtE3J6Zu/UrX d5v6Jc7gvF1nm88Hdr7+HCDiCxXih097lqMKWRQYPAri3mB+GS5fxSmLzVdusA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bh6lH67g8z9sY; Tue, 15 Jul 2025 05:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56F5CxMp079916; Tue, 15 Jul 2025 05:12:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56F5CxRI079913; Tue, 15 Jul 2025 05:12:59 GMT (envelope-from git) Date: Tue, 15 Jul 2025 05:12:59 GMT Message-Id: <202507150512.56F5CxRI079913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 6738882248a7 - main - inetd.conf: remove -[46] from the ssh entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6738882248a755aad859784150969085e006cf89 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=6738882248a755aad859784150969085e006cf89 commit 6738882248a755aad859784150969085e006cf89 Author: Lexi Winter AuthorDate: 2025-07-15 04:44:38 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:45 +0000 inetd.conf: remove -[46] from the ssh entry sshd doesn't require these flags, and including them makes outgoing connections (e.g., port forwarding) restricted to the family of the inbound connection, which is not usually desirable and also not how standalone sshd works. MFC after: 3 days Reviewed by: kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D51296 --- usr.sbin/inetd/inetd.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/inetd/inetd.conf b/usr.sbin/inetd/inetd.conf index 40f1e1285af6..a8359ea793f5 100644 --- a/usr.sbin/inetd/inetd.conf +++ b/usr.sbin/inetd/inetd.conf @@ -7,8 +7,8 @@ # #ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l #ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -l -#ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4 -#ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i -6 +#ssh stream tcp nowait root /usr/sbin/sshd sshd -i +#ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i #telnet stream tcp nowait root /usr/local/libexec/telnetd telnetd #telnet stream tcp6 nowait root /usr/local/libexec/telnetd telnetd #shell stream tcp nowait root /usr/local/sbin/rshd rshd From nobody Tue Jul 15 05:12:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bh6lH2Mj9z61xBf; Tue, 15 Jul 2025 05:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bh6lG5YVTz3ltK; Tue, 15 Jul 2025 05:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=13Pl+I+07RU1lfwm+Y7eurpCBRnVDb0jwvnqK4aCIIU=; b=Pgc021+c6ZWIhfOt1RNe1spqNfRSH5hF4X8mwMb1qDsIuOHv/7gViZh/pbdIcbkTrze24I 0nk9sUVs1vnu25TCnnX4gLbUluKdp0xLZVkX+tQiKGM5ScRKN1FbweLB4BDTS4LBU9HtV4 cMwt2FgxeBOGPsTJnbsnTEef8H1J/98TK/HBK75pOTVq1hzpMm5pAXQrumJ/PA2ADKTzcq hIGNO31yNrQrOunkk9LMD15if/QrBBlAeYVRJNCah79a8Bg0aXh4fh88PKAVvstdEMpXSa lXFKVuaY1PSIMXCvKrrETrpidVkapmpTTQH0jFJ6rkSf3gJhm/FUmItKo0URLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=13Pl+I+07RU1lfwm+Y7eurpCBRnVDb0jwvnqK4aCIIU=; b=fYDRI3ylUzFfAnYZE+V6UAeluXOgn3v71ycyOQDtl0jmrUc+qevL63YfJ2F8x85Vt9iv80 ExymcoF5xWVIbflg2VJ7PEOMbkLGBL371vEVSVunLFTVL1qD5wewhfJpDMOQi4q9ICULWw HQuOTZlzzcqQbufFA/ttwopfhPZ+xnft+rid+XN05cjbBCHAyaGGHH+uh5CsBEas3rJS+y T/yIJCw4UsgRUT1fIGVfRz/1ZCFz0n/Nh4owk9Iih2CLXPjym6nCFtovPDrVEX0O9lJ1bJ 18InIJVgnVPSd/wq6MlP8I3OtajeJlUL3cAJZMgSiY7QvQvvTnyBOIb5AZ/fDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752556378; a=rsa-sha256; cv=none; b=k7BvDPTjaA5basoYi77pp+zKYHwW1y3IaiOIv/uPbYQTag59DD8xMJuNh7gkWSyhYN0UUM 2vGvOK9NYfls+lNrmyjkWxULDD2VsMqV8NEW34INwKucBwMbDEdS/bbozdvuXgKDhMLjM2 6ViAtBn2WW7x+nwHKD3S3LjTjs3tzjTx64aovWnO8HtCxaYy26fEpVZVdboCEqLCz4wieY +Ll3/gpwXpv+KGp3sIAOr1PqSbVhGJpkuWVvzrXRz+/JkB0kmDVinJTxvsQYBJLeoyICW7 e9eN71IB2I+QiqjyXOreWfLIv17RRzFGXO4N1bW8YTjLNly6yH87OQU9n9KVxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bh6lG58Jbz9qn; Tue, 15 Jul 2025 05:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56F5CwnF079881; Tue, 15 Jul 2025 05:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56F5CwBh079878; Tue, 15 Jul 2025 05:12:58 GMT (envelope-from git) Date: Tue, 15 Jul 2025 05:12:58 GMT Message-Id: <202507150512.56F5CwBh079878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: db55cc8110ce - main - nlmsg_report_err_msg: add __printflike annotation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db55cc8110ceea084c6f52a1ecfd6ab87e0aac2b Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=db55cc8110ceea084c6f52a1ecfd6ab87e0aac2b commit db55cc8110ceea084c6f52a1ecfd6ab87e0aac2b Author: Lexi Winter AuthorDate: 2025-07-10 21:02:21 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:45 +0000 nlmsg_report_err_msg: add __printflike annotation Reviewed by: kevans, kp Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D51234 --- sys/netlink/netlink_message_parser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/netlink_message_parser.h b/sys/netlink/netlink_message_parser.h index 8492ecb3021b..720317ed74f3 100644 --- a/sys/netlink/netlink_message_parser.h +++ b/sys/netlink/netlink_message_parser.h @@ -209,7 +209,8 @@ int nlattr_get_nested(struct nlattr *nla, struct nl_pstate *npt, int nlattr_get_nested_ptr(struct nlattr *nla, struct nl_pstate *npt, const void *arg, void *target); -bool nlmsg_report_err_msg(struct nl_pstate *npt, const char *fmt, ...); +bool nlmsg_report_err_msg(struct nl_pstate *npt, const char *fmt, ...) + __printflike(2, 3); #define NLMSG_REPORT_ERR_MSG(_npt, _fmt, ...) { \ nlmsg_report_err_msg(_npt, _fmt, ## __VA_ARGS__); \ From nobody Tue Jul 15 05:13:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bh6lK2p9cz61xBj; Tue, 15 Jul 2025 05:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bh6lK0l5Nz3mLN; Tue, 15 Jul 2025 05:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhANFNSOKN0aC7J0yoGvAYmjqE2GkL8PspMCuoF3qBU=; b=v1qCzBn8RGIDlxf+ytIMI5O8CB/eGxw8Xqm59NE8ppcz5Xz6PasL00pFRttF97ZBdpPlOF KRCeQ71595usSo8uxYp4ph741Wp9w9g2LBT8TMvuL/Rac6ES2O2H68FF7mbkiA6nq7UMlu IP5Co22waODu9//PjeZKND8RPjzl2tEuPnzSlXFJf7fy91SP/kscQO1xoLmm0PHgj1o71/ rJj8t3odDxciTvE0Xr6E5gOWcjIePMS6fGuwGf5nJSGiRRdB66RMMU7ODzWK889Ns4yZBu NgVkD/8aHn+DEAfL11gekPuWhgShi73B2PuvdYsn5xALIknjCEEnufKcSYnIzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752556381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhANFNSOKN0aC7J0yoGvAYmjqE2GkL8PspMCuoF3qBU=; b=oFjwoQThCX86K2q3cMytTay2qFDZ3r1KNd0ZOHcfaf1qiwV2WdotCFOC1nJK7URXSLOzix 11ULPHnEfGjfnn3HFW99tOJvYqbrHgjGxcTWVTxk3P5A/M6S4t80Wv0PhAp2W5ehq2nZPs j7Awu5D6avEiUzlXFn314My6gLg2Es27huUni2G8wP/IaCfH/hUU2JW+jv6m1Yq+8iJsJC OPCqsa/rNNYtNuJY9/nB6HQ4kPfhjO0W7IcuDD1gcuEx/r4nKWafB2lY31Qeu+oAAOsusA +vErEncuSNNpj7KkKdPUgrPsp0jWx07EqzUHbccQh9BV3AQ98FbomqGBf9Slwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752556381; a=rsa-sha256; cv=none; b=F6bEQELQWf8g2kkKO4yZyO5MYC++2euQ02Xx/cBNrKRwdD/AflEMjndBYpc9tDMWty32iA h7fq0z8AUOTSybONuNFSSFXi8w4jdt0mx8ehjrdKvmwz9tstU0Vcwg/iC75QSYBTCmNLLW wGNrqEuh7zNfU2wZZhnTSKlOlst2iF3pyiiyi+ho0riygUbJ4JVzxzyr4eSWmRpPI9uQ8q wA6FFr1LNFQ0qNx2foXOlolWKhbtG2gJfymbgGEcTb4u3vf+QOWHzfJytn/IYHSSnrJSt0 G5dYjYORYZOqrRNFaLFlcWb5YfuOYckIff/mmxsT+O24lK6qZYiM2puopVVRXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bh6lJ6tt0z9B5; Tue, 15 Jul 2025 05:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56F5D0D9079956; Tue, 15 Jul 2025 05:13:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56F5D058079953; Tue, 15 Jul 2025 05:13:00 GMT (envelope-from git) Date: Tue, 15 Jul 2025 05:13:00 GMT Message-Id: <202507150513.56F5D058079953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 7d4673d3a439 - main - netinet6: allow binding a raw socket to an anycast address List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d4673d3a439d1394df6bed0f9a50235eab5630f Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=7d4673d3a439d1394df6bed0f9a50235eab5630f commit 7d4673d3a439d1394df6bed0f9a50235eab5630f Author: Lexi Winter AuthorDate: 2025-07-15 05:11:40 +0000 Commit: Lexi Winter CommitDate: 2025-07-15 05:12:45 +0000 netinet6: allow binding a raw socket to an anycast address Raw sockets have a separate check for this in rip6_bind() that was missed in the previous change. This fixes e.g. 'ping -S' using an anycast address. Fixes: ca4b046105f6 ("netinet6: allow binding to anycast addresses") Reviewed by: tuexen, kevans, des (previous version) Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50438 --- sys/netinet6/raw_ip6.c | 3 +-- tests/sys/netinet6/addr6.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 0379ef7c789a..c90a1213bd66 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -765,8 +765,7 @@ rip6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) } if (ifa != NULL && ((struct in6_ifaddr *)ifa)->ia6_flags & - (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY| - IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) { + (IN6_IFF_NOTREADY|IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) { NET_EPOCH_EXIT(et); return (EADDRNOTAVAIL); } diff --git a/tests/sys/netinet6/addr6.sh b/tests/sys/netinet6/addr6.sh index 38e4bb152240..6fd66d5aa0c7 100755 --- a/tests/sys/netinet6/addr6.sh +++ b/tests/sys/netinet6/addr6.sh @@ -39,7 +39,32 @@ addr6_invalid_addr_cleanup() vnet_cleanup } +atf_test_case "anycast_raw_addr" "cleanup" +anycast_raw_addr_head() +{ + atf_set descr "a raw socket can bind to an anycast address" + atf_set require.user root +} + +anycast_raw_addr_body() +{ + # lo0 needs to be up in the test jail for this test to work + ifconfig lo0 up + + netif=$(ifconfig lo create) + echo $netif >netif + atf_check -s exit:0 ifconfig $netif inet6 2001:db8::1/128 up + atf_check -s exit:0 ifconfig $netif inet6 2001:db8::2/128 anycast + atf_check -s exit:0 -o ignore ping -c1 -S 2001:db8::2 2001:db8::1 +} + +anycast_raw_addr_cleanup() +{ + ifconfig $(cat netif) destroy +} + atf_init_test_cases() { atf_add_test_case "addr6_invalid_addr" + atf_add_test_case "anycast_raw_addr" } From nobody Tue Jul 15 08:52:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhCck5hHKz629Cm; Tue, 15 Jul 2025 08:52:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhCck3977z3HHv; Tue, 15 Jul 2025 08:52:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752569558; 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=HqT+IeRAEOPhtcBtPykd9wijyQimv+BAPNp2/MIswWY=; b=llNDIkSpY5z77gkAlHNuxyVYpIhjw979t0h2ogwVBX6mLH0vXm4uCFUUXYOndV/Vq0raej /2luQKs51KxVQiBFeDpTtSt9UnXDZQVyz6/bab0WE3IE9BIRHZ0n4y9Q6drzrlaD1Tagqw W3o+Dsgjbm+cMTDSD1gYDt9nqRRBcQ9XWCOHRyXlUuFebzUsG443a/BftNu6KQXAPyajq+ 53Uz2KR9XequQHY7znrYS+NuOlGKq6pEJdR1bOjz4RePQQ/6Txfj7pGzFrY/DqO3GSONkI bDCYhsWmVOL/CSl1uFRGuU74qqCL7Dd1Nn7Z4q9yrymqqYfD396y2j+guufBLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752569558; 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=HqT+IeRAEOPhtcBtPykd9wijyQimv+BAPNp2/MIswWY=; b=nx1XLyGbDW31Kib7kCWF8Or5uCLvp5yGusMjOCDBMCL2uqmvqvXthjxKYhxosys2cU8JOZ T+6+B6aDtwAD8Nek05D4B5Qb5EO+FhZjrrVabv7kucApMXEnvGp+l5K33PkDMxMXjMHlCu A9pPpgxRNGo7nZlvY5sem3DJSeGcH0Yh+rd5KwbLNAv6YwLMhrxYufW1PtmLZgjxTAJbv1 /Aj3CMR8wYE8QlUTMJ95YItXXeRMzb2pi90QOMiMiaoSLL52YmMSeUISmqzBRp5af88EG+ HByjoa9YT/kp/q6yHJxR8iEp1AnAeFKroUS3hj8bEh+V/C/fbIW1IEdQFYm61A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752569558; a=rsa-sha256; cv=none; b=gDoGZpjmA3B782GuZwX8N4JHnnjxpELCJpmIgkWOZlEJkDs9S4dqqpuo7c6EUMLpE58VKG FW3D8vmgAgJGkg/TtFMFtg4/Wnh+rvtPL8SK2i7Md/0VirQHktFF4qba1qzZazJLE83u/G y7xtf6HGV++5tLsP7Hi333vfz6up1CizS9Xq0fOyHJOrjLc/YAYsSr0+kg3iVRWZtm8sZ5 VZKE0s9X9Y479v//y++vhzk6N3zga7fV9wDRwS34LsWQCqemCtzIukMdfW0MHvkNUp/OjA ZRvpmf8FBTOGXCXkjKdgB5I5dUyhkMwI4XC4CHmuvF25LLlL5PrqSHxONnKCSg== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher 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 "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bhCck28cWz6rc; Tue, 15 Jul 2025 08:52:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 0C9F351FAC; Tue, 15 Jul 2025 10:52:35 +0200 (CEST) From: Kristof Provost To: Konstantin Belousov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 4dd828c80828 - main - amd64: add kva_layout Date: Tue, 15 Jul 2025 10:52:35 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: <202507142203.56EM3lOw070595@gitrepo.freebsd.org> References: <202507142203.56EM3lOw070595@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 15 Jul 2025, at 0:03, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D4dd828c80828637452a8a4e0= 7a64e294c82e5d8b > > commit 4dd828c80828637452a8a4e07a64e294c82e5d8b > Author: Konstantin Belousov > AuthorDate: 2025-06-15 21:39:10 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-14 22:03:28 +0000 > > amd64: add kva_layout > > Reviewed by: markj > Tested by: pho > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D51085 > --- =2E. > diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h > index 0cd9bb4fa7a4..f12e5217a44b 100644 > --- a/sys/amd64/include/vmparam.h > +++ b/sys/amd64/include/vmparam.h > @@ -181,12 +181,9 @@ > * 0xffffffff80000000 KERNBASE > */ > > -#define VM_MIN_KERNEL_ADDRESS KV4ADDR(KPML4BASE, 0, 0, 0) > -#define VM_MAX_KERNEL_ADDRESS KV4ADDR(KPML4BASE + NKPML4E - 1, \ > - NPDPEPG-1, NPDEPG-1, NPTEPG-1) > - > -#define DMAP_MIN_ADDRESS KV4ADDR(DMPML4I, 0, 0, 0) > -#define DMAP_MAX_ADDRESS KV4ADDR(DMPML4I + NDMPML4E, 0, 0, 0) > +#define VM_MIN_KERNEL_ADDRESS_LA48 KV4ADDR(KPML4BASE, 0, 0, 0) > +#define VM_MIN_KERNEL_ADDRESS kva_layout.km_low > +#define VM_MAX_KERNEL_ADDRESS kva_layout.km_high The removal of DMAP_MIN_ADDRESS breaks the KASAN build. This seems to fix it for me, but I=E2=80=99m not familiar enough with thi= s code to be confident to commit it: diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 0edb631d1475..31204bad8c30 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -263,8 +263,8 @@ kasan_mark(const void *addr, size_t size, size_t red= zsize, uint8_t code) if (__predict_false(!kasan_enabled)) return; - if ((vm_offset_t)addr >=3D DMAP_MIN_ADDRESS && - (vm_offset_t)addr < DMAP_MAX_ADDRESS) + if ((vm_offset_t)addr >=3D kva_layout.dmap_low && + (vm_offset_t)addr < kva_layout.dmap_high) return; KASSERT((vm_offset_t)addr >=3D VM_MIN_KERNEL_ADDRESS && =E2=80=94 Kristof From nobody Tue Jul 15 09:01:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhCqm3htNz629Wg for ; Tue, 15 Jul 2025 09:02:12 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhCqm0943z3LBq for ; Tue, 15 Jul 2025 09:02:07 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-7e2e3108841so229492885a.3 for ; Tue, 15 Jul 2025 02:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; t=1752570125; x=1753174925; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zvvSMc/3nnkdjMNk1GwkQRZy9S810jExSGmH9wEqSqw=; b=ggQzzSfzCOiZZ+cGyl747SDgUI3sgFwWGfFdwh3QgumuOSPyU8Z3O1qndUtkEI5B5Y 0R5SnemZLhVXIKbDYnPu3EPZmoNB3XU8fk9ITLrSVr8qk/Lu5A0cpey46tkfZ4xOGjwD 3Pq5NnO2FshScm7uuN6CSyDB5SSXeiimejiC8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752570125; x=1753174925; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zvvSMc/3nnkdjMNk1GwkQRZy9S810jExSGmH9wEqSqw=; b=PjEztkyB9yfXpFmIOagdH0HZE2S5XTYwfAHLcXTwoD1b4AJXUx66athPWjlExggH8q 6stuQYu0WvKm4/UpWiwlCK+wLhsyLTk+NAE0vt8P5kgk1r8JjsePunBjOGHhF1gNFR7e VoNCu+2sh7EYDaEOji7zzBlenAjouaE4pdKG4DfmUzUkTQZ1rUpHKPQJL12jwW8oKYZI 0Pw6BHzR4Y49I4fPap3BuUgpptxr5qe9GmwcfX8wTZMvtHN/UbhE8FLfxqWDBZ7FKznA cBBoWe+5pX2VfKgf6AB84O7JH6AcqRmN17MfJY90uu7k7zFk3sAeP7bblQnrGfXY2gRU U9iQ== X-Forwarded-Encrypted: i=1; AJvYcCWZpthN9oKSjfWvLNjwFOHjm77H1ysgVCV1ShtiluLLWfr7hSvzditRIUFxE/vihX3Mg8+/Nw072W+RgD05AwsxiQvHCQ==@freebsd.org X-Gm-Message-State: AOJu0Yzrce3WpDJM/ojJ14bntiBIakGvLlkH9KIH54zBmUVGSflMPJaR /3RvhLLtAIrpbMpt8TcyRJbm/uOjZhnTETZsbJLBAKLkj4r998HTuBTAGmX+UPeCNNHLlqYZAel HJo/63l9mgh8aAQC9qxIGCLwv/v8/hmnu2rvRAEtX X-Gm-Gg: ASbGncsRKsT5E7+kHDwVhWmfrVeLJNqA7HdGl3MJlPJtWC4DjxJ5pPmsxmd7hWEPDFH YIgw7s5xzSwS3b/JRRoK/NlrzJcNSZpqIJ0VOdbF/Wp6aDBn1j1wNuLCmX1E4YYm+zhGlJW44b+ HqUEEkwRUvDTzqxxPp1Hcjjg4AOdcC6kpJAqaLqComel9VEfbviuZl0FAoBgIcu6ZMSa2Xsw+0C 06WUharUAHf8uRDsH8= X-Google-Smtp-Source: AGHT+IH2fLh2ZhExoBE6ko6/f5uoMZ8vAR86dAD5YpFi0V+lCREIEPXgmzuHws/Eh5Ay1hoygNimro6oVz83S6LhBgk= X-Received: by 2002:a05:622a:198f:b0:4ab:8862:7fe6 with SMTP id d75a77b69052e-4ab8862865cmr8141721cf.26.1752570125153; Tue, 15 Jul 2025 02:02:05 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507142203.56EM3lOw070595@gitrepo.freebsd.org> In-Reply-To: From: Kevin Bowling Date: Tue, 15 Jul 2025 02:01:53 -0700 X-Gm-Features: Ac12FXyll3Whg1MjM3zHEjT2S1Aqw-7BjeXY_9wmdKDX_6-tzns55Fr5JDv9IWg Message-ID: Subject: Re: git: 4dd828c80828 - main - amd64: add kva_layout To: Kristof Provost Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bhCqm0943z3LBq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 15, 2025 at 1:52=E2=80=AFAM Kristof Provost wr= ote: > > On 15 Jul 2025, at 0:03, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D4dd828c80828637452a8a4e0= 7a64e294c82e5d8b > > > > commit 4dd828c80828637452a8a4e07a64e294c82e5d8b > > Author: Konstantin Belousov > > AuthorDate: 2025-06-15 21:39:10 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-14 22:03:28 +0000 > > > > amd64: add kva_layout > > > > Reviewed by: markj > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D51085 > > --- > .. > > diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h > > index 0cd9bb4fa7a4..f12e5217a44b 100644 > > --- a/sys/amd64/include/vmparam.h > > +++ b/sys/amd64/include/vmparam.h > > @@ -181,12 +181,9 @@ > > * 0xffffffff80000000 KERNBASE > > */ > > > > -#define VM_MIN_KERNEL_ADDRESS KV4ADDR(KPML4BASE, 0, 0, 0) > > -#define VM_MAX_KERNEL_ADDRESS KV4ADDR(KPML4BASE + NKPML4E - 1, = \ > > - NPDPEPG-1, NPDEPG-1, NPTEPG-1) > > - > > -#define DMAP_MIN_ADDRESS KV4ADDR(DMPML4I, 0, 0, 0) > > -#define DMAP_MAX_ADDRESS KV4ADDR(DMPML4I + NDMPML4E, 0, 0,= 0) > > +#define VM_MIN_KERNEL_ADDRESS_LA48 KV4ADDR(KPML4BASE, 0, 0, = 0) > > +#define VM_MIN_KERNEL_ADDRESS kva_layout.km_low > > +#define VM_MAX_KERNEL_ADDRESS kva_layout.km_high > > The removal of DMAP_MIN_ADDRESS breaks the KASAN build. > > This seems to fix it for me, but I=E2=80=99m not familiar enough with thi= s code to be confident to commit it: Looks correct per Kib's comment on a similar issue here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D288236 > > diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c > index 0edb631d1475..31204bad8c30 100644 > --- a/sys/kern/subr_asan.c > +++ b/sys/kern/subr_asan.c > @@ -263,8 +263,8 @@ kasan_mark(const void *addr, size_t size, siz= e_t redzsize, uint8_t code) > if (__predict_false(!kasan_enabled)) > return; > > - if ((vm_offset_t)addr >=3D DMAP_MIN_ADDRESS && > - (vm_offset_t)addr < DMAP_MAX_ADDRESS) > + if ((vm_offset_t)addr >=3D kva_layout.dmap_low && > + (vm_offset_t)addr < kva_layout.dmap_high) > return; > > KASSERT((vm_offset_t)addr >=3D VM_MIN_KERNEL_ADDRESS && > > =E2=80=94 > Kristof From nobody Tue Jul 15 10:07:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHT0154z62DbB; Tue, 15 Jul 2025 10:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHS5frxz3fFF; Tue, 15 Jul 2025 10:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJBOnqCt4VFtIS4B43d1EcasT3nrLSlf9zumnRjBHjw=; b=yxOOxQuaLaTnWxgoyXDO0wnlbbMAfh37+5vXtVOvmr/iXmEWP6bloMahUGXn0dHmsRdoTM m5Tsgv7VcpXsfKt9q2Z6FRkF6asuyxaysuM8Hx+rR3kr0Nl3wsVB/GTNcf7nx5n4fjzdf6 XFsOhW9iAfCIrJYyxRDOv4SADLFJT/rtoY8KFIu+Dl2kDSOHlxKgeL7et5DXLVZWIQiDor ikf7Z+uxnRqgfPjuVztmWKM6dm0ok4IGGpiT8GvSMkRIdeAJv8Tu7xo61yqx7D4ICNEQwm +ZSwRML6Iq669tBinr9jtjEwiCDoeVhqKS6SQt0E9c6J8KoXrs8ZN/Vjza2HXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJBOnqCt4VFtIS4B43d1EcasT3nrLSlf9zumnRjBHjw=; b=vjl7mKKgTfFWZUpDDD7BB2jwg5ui2fTnh5qQdIxQP4Ouv4J8n1nNdyFF8AtarTTZvW8cID ygcCG18HMxyG6xF7T6l+FKTMbMKpL1TLNTZEVP7I78aAZl0N7PvJIRWGzllRu+tXKTnag6 UoJgKfdoe0BVcq0jLAxMK08X5MyH/+l9aHMObtXU3JXV/uaNn1RNnVVnt0/LCr3Rl0IIad 0zID1VG41XUZuXW4zlkOoyegV4HWPhpCYb5gyX7G1QILL8J4+wr4Z9l+Izojmjt/gGLdRE lx19IvnCU+aDhWvbXIYtffG03r1YEqdzu5h3DRaO3JZQAS8M67LxBupCssRMWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574068; a=rsa-sha256; cv=none; b=Hnx5FwdzKjtof/9zECXtU1njIT4VnWVw27eInmqkO7kUnFcpth5BQM4wNWTxkuPMSCycs6 I6+5P9nQZABbh4Rtd1K++rREPPa7NBpXX431fJSk5ERf+J17/gSkjdqswqODSdARWckmNv AMdfh3Uj911yR/fvcPBNgYAUtutSQX9Epc0guGvVVABsJut3Wxf3JIdUPvc8fhua7XK+4f IXvjVaORMFpunGdsKMtYdnUZlU5zG+kDfiZSVrIV8auXiEtIdYyZulciFen/LXFLRoZPpR 478Fej2shLub46vkTUSqrLNHpe5YLctJEf6JyR6hRRKfu+cHyqQWi+D8RqUyJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHS4Q1szbx0; Tue, 15 Jul 2025 10:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7m5s027735; Tue, 15 Jul 2025 10:07:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7mDc027732; Tue, 15 Jul 2025 10:07:48 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:48 GMT Message-Id: <202507151007.56FA7mDc027732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: fbb290df0836 - main - pf: Remove ptr_array from struct pf_kruleset List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbb290df083678ceefec4da6133e55dbf99f9794 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fbb290df083678ceefec4da6133e55dbf99f9794 commit fbb290df083678ceefec4da6133e55dbf99f9794 Author: Kristof Provost AuthorDate: 2025-07-07 12:53:49 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:28 +0000 pf: Remove ptr_array from struct pf_kruleset Each ruleset's rules are stored in a TAILQ called "ptr" with "rcount" representing the number of rules in the ruleset; "ptr_array" points to an array of the same length. "ptr" is backed by pool_get(9) and may change in size as "expired" rules get removed from the ruleset - see "once" in pf.conf(5). "ptr_array" is allocated momentarily through mallocarray(9) and gets filled with the TAILQ entries, so that the sole user pfsync(4) can access the list of rules by index to pick the n-th rule during state insertion. Remove "ptr_array" and make pfsync iterate over the TAILQ instead to get the matching rule's index. This simplifies both code and data structures and avoids duplicate memory management. OK sashan Obtained from: OpenBSD, kn , d13e571b26 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 - sys/netpfil/pf/if_pfsync.c | 11 +++++++---- sys/netpfil/pf/pf_ioctl.c | 30 +++++------------------------- 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 1f2011634695..452a8eb4024b 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1370,7 +1370,6 @@ struct pf_kruleset { struct pf_krulequeue queues[2]; struct { struct pf_krulequeue *ptr; - struct pf_krule **ptr_array; u_int32_t rcount; u_int32_t ticket; int open; diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 2391edaf1a5a..4e03584b8f85 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -532,6 +532,7 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) struct pf_kpooladdr *rpool_first; int error; uint8_t rt = 0; + int n = 0; PF_RULES_RASSERT(); @@ -557,10 +558,12 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) */ if (sp->pfs_1301.rule != htonl(-1) && sp->pfs_1301.anchor == htonl(-1) && (flags & (PFSYNC_SI_IOCTL | PFSYNC_SI_CKSUM)) && ntohl(sp->pfs_1301.rule) < - pf_main_ruleset.rules[PF_RULESET_FILTER].active.rcount) - r = pf_main_ruleset.rules[ - PF_RULESET_FILTER].active.ptr_array[ntohl(sp->pfs_1301.rule)]; - else + pf_main_ruleset.rules[PF_RULESET_FILTER].active.rcount) { + TAILQ_FOREACH(r, pf_main_ruleset.rules[ + PF_RULESET_FILTER].active.ptr, entries) + if (ntohl(sp->pfs_1301.rule) == n++) + break; + } else r = &V_pf_default_rule; /* diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index c14211edf10f..016bb1fedef0 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1359,7 +1359,7 @@ static int pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) { struct pf_kruleset *rs; - struct pf_krule *rule, **old_array, *old_rule; + struct pf_krule *rule, *old_rule; struct pf_krulequeue *old_rules; struct pf_krule_global *old_tree; int error; @@ -1384,13 +1384,10 @@ pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) /* Swap rules, keep the old. */ old_rules = rs->rules[rs_num].active.ptr; old_rcount = rs->rules[rs_num].active.rcount; - old_array = rs->rules[rs_num].active.ptr_array; old_tree = rs->rules[rs_num].active.tree; rs->rules[rs_num].active.ptr = rs->rules[rs_num].inactive.ptr; - rs->rules[rs_num].active.ptr_array = - rs->rules[rs_num].inactive.ptr_array; rs->rules[rs_num].active.tree = rs->rules[rs_num].inactive.tree; rs->rules[rs_num].active.rcount = @@ -1420,7 +1417,6 @@ pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) } rs->rules[rs_num].inactive.ptr = old_rules; - rs->rules[rs_num].inactive.ptr_array = old_array; rs->rules[rs_num].inactive.tree = NULL; /* important for pf_ioctl_addrule */ rs->rules[rs_num].inactive.rcount = old_rcount; @@ -1433,9 +1429,6 @@ pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) while ((rule = TAILQ_FIRST(old_rules)) != NULL) pf_unlink_rule_locked(old_rules, rule); PF_UNLNKDRULES_UNLOCK(); - if (rs->rules[rs_num].inactive.ptr_array) - free(rs->rules[rs_num].inactive.ptr_array, M_TEMP); - rs->rules[rs_num].inactive.ptr_array = NULL; rs->rules[rs_num].inactive.rcount = 0; rs->rules[rs_num].inactive.open = 0; pf_remove_if_empty_kruleset(rs); @@ -1458,24 +1451,11 @@ pf_setup_pfsync_matching(struct pf_kruleset *rs) if (rs_cnt == PF_RULESET_SCRUB) continue; - if (rs->rules[rs_cnt].inactive.ptr_array) - free(rs->rules[rs_cnt].inactive.ptr_array, M_TEMP); - rs->rules[rs_cnt].inactive.ptr_array = NULL; - if (rs->rules[rs_cnt].inactive.rcount) { - rs->rules[rs_cnt].inactive.ptr_array = - mallocarray(rs->rules[rs_cnt].inactive.rcount, - sizeof(struct pf_rule **), - M_TEMP, M_NOWAIT); - - if (!rs->rules[rs_cnt].inactive.ptr_array) - return (ENOMEM); - } - - TAILQ_FOREACH(rule, rs->rules[rs_cnt].inactive.ptr, - entries) { - pf_hash_rule_rolling(&ctx, rule); - (rs->rules[rs_cnt].inactive.ptr_array)[rule->nr] = rule; + TAILQ_FOREACH(rule, rs->rules[rs_cnt].inactive.ptr, + entries) { + pf_hash_rule_rolling(&ctx, rule); + } } } From nobody Tue Jul 15 10:07:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHV1lRQz62DbC; Tue, 15 Jul 2025 10:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHT5gh3z3f2d; Tue, 15 Jul 2025 10:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=25qTEr8sxkUN6LJQ13C6x0zwK2y9XGZSTvueZJr+SwU=; b=A9cEHsqc2DzN1SrznPQQnfhCLUjSMaTyj5FXHcrWxW3fqwLdBpZ6yldklc6PRyT/TDzJIw wliJxLYms11Vo7hquMJ1XeZVFPiAJRWRSEhifSCGsX7148fIQh8/6/Sj56n0Ad4jsj5oPq MyUgWcpd0lRq+o9i8kNY6p5IshC1H8yq93yMksm/sZdLZdpSdBx0CRwtzMMZABQkPlZH/H ANCwMV6NJdMKmqdAQc6FD4Jh4vlIZWi5iZ5GvyDjbrnWwxq200rABZsrdeaSDmRXaMUQMZ 32s7kqAA+H9Ii1itz2Hg4OzILWgKmwcjccGZAJ839NBeDWll+oHRWqPmqyQN0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=25qTEr8sxkUN6LJQ13C6x0zwK2y9XGZSTvueZJr+SwU=; b=M4e283Gp7jJ126UnK5eNDDazmUj8X2gNSlKzYsB6T9rpBu2DSYQj5xA+zAoxhDE/ZTmMir U/A2+0GK9sVWUgGWYtF9908q+ypQoNYk4ifxRuZj/olwEtlYGnGCkvCi6zkrgp4dpYToeM EMog6rv2vHmTwVND7UFdvzXle67zEywEUTL6RXLHRVRRiEp5wf/gDIS52PPGe6Un+AnJ7D oAR9v8hGZRJ+l/cXRi1qzYdKIlfsTaBqarZ4s+gDvnat/VaR1RUOQIuQXrA30oQ635MarN uDyoAtOeosFfIC93dz0sRcy37NyTgXpOEAv8ZB9nWNtQ8cdwCsWo3ly5N3/COw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574069; a=rsa-sha256; cv=none; b=NPf1QxbYXfFxozgnzoS/WHsjzv6eZAc6ZJXJ0ClcYiU2qRXuYCLz5VKq3gTzvFdJGTDdA2 a/j3oAxFNjhtHN5nRblDvMa4jx9V4GsPC5rP9I4olNeTdGTIwWVtnenOBnnX/XCKQneYyx j8jSt2nzttHKWlfxtsJB5M0TtF6c29pFBBKmCyE0ZSKCq65fDQq/3ndqjye7GT90EOXshr b9oL39SDOQN3qyGiMhN7VeAAt6BIfsflTuwpRY3C2Agwm0IHoDCSJjjbPuIn0HmO58pGmp tayUQQyClR8sbHx5IwDi9yr9LAn5XHdVDXfOxu0WZ6YQuNz7VD0tjFj1ncBxrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHT5GMvzbbm; Tue, 15 Jul 2025 10:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7n6h027769; Tue, 15 Jul 2025 10:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7nDK027766; Tue, 15 Jul 2025 10:07:49 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:49 GMT Message-Id: <202507151007.56FA7nDK027766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d217ed397922 - main - pfctl: Accommodate a basename(3) that takes a non-const parameter List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d217ed397922fb369fa22023d844aa9cda127b0a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d217ed397922fb369fa22023d844aa9cda127b0a commit d217ed397922fb369fa22023d844aa9cda127b0a Author: Kristof Provost AuthorDate: 2025-07-07 14:39:08 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:28 +0000 pfctl: Accommodate a basename(3) that takes a non-const parameter It may in fact modify the string buffer. ok kn@ sashan@ Obtained from: OpenBSD, naddy , 697265c5fb Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 271286deeda7..2015e0a09549 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -131,8 +131,8 @@ int pfctl_walk_get(int, struct pfioc_ruleset *, void *); int pfctl_walk_anchors(int, int, const char *, int(*)(int, struct pfioc_ruleset *, void *), void *); struct pfr_anchors * - pfctl_get_anchors(int, char *, int); -int pfctl_recurse(int, int, char *, + pfctl_get_anchors(int, const char *, int); +int pfctl_recurse(int, int, const char *, int(*)(int, int, struct pfr_anchoritem *)); int pfctl_call_clearrules(int, int, struct pfr_anchoritem *); int pfctl_call_cleartables(int, int, struct pfr_anchoritem *); @@ -2988,20 +2988,23 @@ pfctl_show_anchors(int dev, int opts, char *anchor) } struct pfr_anchors * -pfctl_get_anchors(int dev, char *anchor, int opts) +pfctl_get_anchors(int dev, const char *anchor, int opts) { struct pfioc_ruleset pr; static struct pfr_anchors anchors; + char anchorbuf[PATH_MAX]; char *n; SLIST_INIT(&anchors); memset(&pr, 0, sizeof(pr)); if (*anchor != '\0') { - n = dirname(anchor); + strlcpy(anchorbuf, anchor, sizeof(anchorbuf)); + n = dirname(anchorbuf); if (n[0] != '.' && n[1] != '\0') strlcpy(pr.path, n, sizeof(pr.path)); - n = basename(anchor); + strlcpy(anchorbuf, anchor, sizeof(anchorbuf)); + n = basename(anchorbuf); if (n != NULL) strlcpy(pr.name, n, sizeof(pr.name)); } @@ -3051,7 +3054,7 @@ pfctl_call_clearanchors(int dev, int opts, struct pfr_anchoritem *pfra) } int -pfctl_recurse(int dev, int opts, char *anchorname, +pfctl_recurse(int dev, int opts, const char *anchorname, int(*walkf)(int, int, struct pfr_anchoritem *)) { int rv = 0; From nobody Tue Jul 15 10:07:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHW2tvGz62Dd0; Tue, 15 Jul 2025 10:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHV6mKNz3fKp; Tue, 15 Jul 2025 10:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7gfKSaU49/C230ZxUZ2JT97APQduSy7R2nLazM9Vf3Q=; b=B0HKEs5PTWU8V9AuBi9j+vrvsl4LoOtxfA3t43W/sTppF6gAr1JBO9xlFbnvn96MJdsuFd Zn0tODdvHldwp6onYfG8U3UXMqTFWvtzsiFki5jb8qR0AdM3eJl5ldEVg5Gw11c68lBMaa QuNt+4X0F99itmaoHQ3IlvyuXYwQ7im/4L1x9nFdXAbWKKXgevfeMH5ZXJ6g1kGEZPg0wY +dRqZA7C1afkv4BNgHsaCm7Ebhj/Fwk3XUFnrspOpNB6qavAsglpNfDFbdb+49MOeamKDv WkLywFNh+PEv2rNUW7jLQHTTSSjYoDpzIgfZFlBUx7tOplugv/KURZ23DQBwuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7gfKSaU49/C230ZxUZ2JT97APQduSy7R2nLazM9Vf3Q=; b=ig+DV3J01dPMqr/qLj+8OVLb88fGA79LohLpiwSmbHYkBRXdJikhLjJ+ZJ3qYeVKtPXjK+ wclTTUp2gGtwYG4D0kEMAmNrxfyjnuYlSwF1/tK6x0DfvN8ASL+6Jae0iG6Ab+dT8hyp+Y ND5RjH7YAIS7lmsK5DntO6au/r0iIK8Lx23NepveFYp6MILbQgoyqcaxqqbT8wLWTVQh27 i90M1wENZcjoEiF+mYE9Rr0+GiceNVOJ3Wdy0P7LNK/OvvqffF0otq7nw206/j7XqN7AOW R0Sg+C+x9uRk3E+GT4IYIC4VHT5clwEN3Dt+91x5Bfxv4rdDEHt1cTzuiYMQFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574071; a=rsa-sha256; cv=none; b=AiCaJXDXIDlCi3cpnSVEAYpp9EgwIwPx80Avz+TWnAZHRJGtKtjEJplAIuaY76TiklCrUb Rlx0czdiC7OH5G1z2c527kp+qonmL1Osy1bj1wv+lRm+XmG+zD6tnQ3W8uo1KktfpGFejp 8YeH5qdpVH/rE1r7rUSSLkFejUtLtggcExYDsauOOHq9uBVGSzMIqzVM2RwQxxs7LrGGXg sCGYsbg85aWXurCFuOkffQMxtRD2h9jll+dF/p6OWDjMmQn9GlmowNtuQFCniYsyHLYvBF uC8O5YRKiLQXvMIU+8CLhsdeiytqlCWRaj4Qnis8ElUENlf1BC6st7O/Yow87w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHV6KVbzbbn; Tue, 15 Jul 2025 10:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7oON027803; Tue, 15 Jul 2025 10:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7obL027800; Tue, 15 Jul 2025 10:07:50 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:50 GMT Message-Id: <202507151007.56FA7obL027800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b09707abf932 - main - pf: synproxy should be processing incoming SYN packets only. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b09707abf932d3fea37aa7ef8bab0e9631fb7529 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b09707abf932d3fea37aa7ef8bab0e9631fb7529 commit b09707abf932d3fea37aa7ef8bab0e9631fb7529 Author: Kristof Provost AuthorDate: 2025-07-07 14:47:42 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:28 +0000 pf: synproxy should be processing incoming SYN packets only. issue noticed by sthen@. fix discussed with bluhm@ and procter@ OK bluhm@, kn@, procter@ Obtained from: OpenBSD, sashan , 4e62cf09d9 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 4 ++++ share/man/man5/pf.conf.5 | 1 + sys/netpfil/pf/pf.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 9a917d1d8464..4286b6149ac6 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5324,6 +5324,10 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) "synproxy state or modulate state"); problems++; } + if ((r->keep_state == PF_STATE_SYNPROXY) && (r->direction != PF_IN)) + fprintf(stderr, "%s:%d: warning: " + "synproxy used for inbound rules only, " + "ignored for outbound\n", file->name, yylval.lineno); if (r->rule_flag & PFRULE_AFTO && r->rt) { if (r->rt != PF_ROUTETO && r->rt != PF_REPLYTO) { yyerror("dup-to " diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index b5843d67e106..a51fde500367 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -2574,6 +2574,7 @@ will not work if .Xr pf 4 operates on a .Xr bridge 4 . +Also they act on incoming SYN packets only. .Pp Example: .Bd -literal -offset indent diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a410fe570c39..ac05cad7d4c8 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6219,7 +6219,7 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, if (ctx->tag > 0) s->tag = ctx->tag; if (pd->proto == IPPROTO_TCP && (tcp_get_flags(th) & (TH_SYN|TH_ACK)) == - TH_SYN && r->keep_state == PF_STATE_SYNPROXY) { + TH_SYN && r->keep_state == PF_STATE_SYNPROXY && pd->dir == PF_IN) { pf_set_protostate(s, PF_PEER_SRC, PF_TCPS_PROXY_SRC); pf_undo_nat(ctx->nr, pd, bip_sum); s->src.seqhi = arc4random(); From nobody Tue Jul 15 10:07:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHY0t5Bz62DRM; Tue, 15 Jul 2025 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHX1DpDz3fR0; Tue, 15 Jul 2025 10:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/XzKBXtLo8m/riwIC180TAIz9oPJJmVd1ARypPGfisQ=; b=nMCf8SrhFso7dP/xJI1wNmoCqN9rP9+g4R22yj12sDgNxbJ3Q7Fq/9oQaWSsTMKdcGBBTF z4o40M7Gba8i50j5ZOtp7IeHsY4I9igwrSpzacQMqbooYrpJFSkpSFc+/8EbgqD2Q6yzzC R04sY0nf8HNBRfCSMghcwc7M2F6T9fg0lxrQZt18FfYQfXjSaaGPs3otNKccDLARnIbSGT aRboIaZHFC90jFcMY1C/blEGiKTd9pjmE4e7qwrw/9KB5SfZA1ZC1mKDyQ33ysRq6Enwwz XuIpeyIE4rfJ04A+XvW8R0NBxFMuJTJ9i1N0u0XU7sQp/qUFa26nbSynEMswog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/XzKBXtLo8m/riwIC180TAIz9oPJJmVd1ARypPGfisQ=; b=Ni+SFCQH36XUyCtU7lr5M87jdkVfp1j/aqcaFqfA42ot097Ip1piRJFUthYBfwk1iBUAE7 uUBXjXYrAZ7kj2uanUxoKTIgaGLA+G3ILcLrDNEfZT5ZSawgXgiS1aI9snPAUi159L8bZA QigNIkD141pZkgzssGDfglKn0IsmHU741QSt3Vwq/CutcPIRu+xStSqurbDnb43ulMmiHF o8srcZQMfrPf3q3pSBhXaPaJRo0/H69vHS4Wb+HMnIBZcMd5Jb1cKOI4JDuegGESLERX8N siSTNqB0HwqgBjVj9oHGEFjUoygugS3BNP+EmIaC1ez/DyZD6lPaqqCltMh6UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574072; a=rsa-sha256; cv=none; b=azQ1C4n8qv4l3VorNx+qm3aw2v6CDr5UnGqBqxgrXujeEJZkRwSb94+S6OZDbgEXamxGyu ENiDexGUrmipQ3WL/VuVRrFTPYculgfLHhLxNYKjsMWeNE287sSIAZZgkUr3BJNo2QzhdW 8dz2ddFyI8azqDfJIG9JRauYeWYC/xpiq9vljKGAqRrIYa4+5g4eZ1mavHvW18F0ARJhk4 7U5f+JvBXYU7f+s4GBJL43H/DF7pssqUGFJG5OWwjy5UnB6eQ/29AKUhRDghfx2zXyimpK qdkzPBo+hKYJzfUTcZ9sf/j5lAjAoF3bEDp0xfmuMCLU/FnWGa6Kh7ir3qIPzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHW705JzbYq; Tue, 15 Jul 2025 10:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7pSA027846; Tue, 15 Jul 2025 10:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7p93027843; Tue, 15 Jul 2025 10:07:51 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:51 GMT Message-Id: <202507151007.56FA7p93027843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: bd6786eada91 - main - pfctl tests: avoid the synproxy warning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd6786eada918d0625e8cc84b69996d4f9547d3b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=bd6786eada918d0625e8cc84b69996d4f9547d3b commit bd6786eada918d0625e8cc84b69996d4f9547d3b Author: Kristof Provost AuthorDate: 2025-07-07 16:13:19 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:29 +0000 pfctl tests: avoid the synproxy warning If we try to set a synproxy rule without restricting it to only the 'in' direction pfctl warns that the synproxy option will only apply to the inbound direction. Avoid this warning by explicitly limiting it to 'in'. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/tests/files/pf0088.in | 2 +- sbin/pfctl/tests/files/pf0088.ok | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/tests/files/pf0088.in b/sbin/pfctl/tests/files/pf0088.in index 4700b6916b7e..a85aa84a30bb 100644 --- a/sbin/pfctl/tests/files/pf0088.in +++ b/sbin/pfctl/tests/files/pf0088.in @@ -16,7 +16,7 @@ pass to 10.0.0.2 keep state block from 10.0.0.3 to 10.0.0.2 pass to 10.0.0.2 modulate state block from 10.0.0.3 to 10.0.0.2 -pass to 10.0.0.2 synproxy state +pass in to 10.0.0.2 synproxy state pass out proto tcp from 10.0.0.4 to 10.0.0.5 keep state diff --git a/sbin/pfctl/tests/files/pf0088.ok b/sbin/pfctl/tests/files/pf0088.ok index 47251a4503dd..801056a4ab46 100644 --- a/sbin/pfctl/tests/files/pf0088.ok +++ b/sbin/pfctl/tests/files/pf0088.ok @@ -11,7 +11,7 @@ pass inet from any to 10.0.0.2 flags S/SA keep state block drop inet from 10.0.0.3 to 10.0.0.2 pass inet from any to 10.0.0.2 flags S/SA modulate state block drop inet from 10.0.0.3 to 10.0.0.2 -pass inet from any to 10.0.0.2 flags S/SA synproxy state +pass in inet from any to 10.0.0.2 flags S/SA synproxy state pass out inet proto tcp from 10.0.0.4 to 10.0.0.5 flags S/SA keep state pass out inet proto tcp from 10.0.0.4 to 10.0.0.5 port = http flags S/SA keep state pass out all flags S/SA keep state From nobody Tue Jul 15 10:07:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHZ2DmKz62DbL; Tue, 15 Jul 2025 10:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHY1rCxz3fRB; Tue, 15 Jul 2025 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Mp56smJcdurjzxXrqL7rAkpIe46g4HfV9g2MAZruHA=; b=gzHFnQpODqOlmdYJoOqmwQWH4FVCYeXAsXkcBd5O2Xv8HDWofbNqqJEInwlrYltkPOSPIO hORDKkbCYFLyigA04gOhMfNu+WYB6bI3P6juG9ok1hbAWo7zmCrNgIaDqAHpQbqU2HcI2h PtJe/XCNd+zoWl/WdT2Ho/ncMpCZBGwg1E32Vx76+Pf2HzGDYdcCYHu0WiV6tGPsT/EPuX 1n8TPd8M7DEwodHO3G7itdVylAC1jJxyuNOKsps+8mds7efZgPhUAhuHsEfh083Hd+3NZr FxRA0KaSsSN34IYt3h/UqD6cpemTtIy9+SvzrdVx7I09O7FjwfnsOhf3eaeePQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Mp56smJcdurjzxXrqL7rAkpIe46g4HfV9g2MAZruHA=; b=BuS6B4jJ3D8ocHaIOdgTMOXv3pNHs7IoLMCh0FcfLiBVfvY7eiXFNnYF0WC0KGvTlpPpAT bLQjG5VSlZCBDkxS5pmPRB6hRzhz07ySmgzfeI9/83ed6T35qTWb+hlq45Wg3Up6jJqIfS m0AVcvq9zvrIT6vWKsUzmr3pA+LJp97I4fSeuB/ssEotaT0goddzf+Q0Y0ZNKsfIAJfhv7 nRmyHysnlVieDzkHggJ0QVZXK8yC4oRc8bu8rsO85knihnNnOHzMGMuCAWZPPyYs1tzude +pvpODJ7lRHtPVQ4yQ8pqoHvexIKC9iIw6ezVHo5Me4cTQhxU2oK67qKlfq5xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574073; a=rsa-sha256; cv=none; b=sdHfApc6xrfoCCv8Jpn8qAy0t9xGJeyOvg0NJeIRQf0q6tXGZymla/ZdKxCtSDfCGldwD1 4Iifzte8BB4I+NdOTmaPYcvgetP25VW+egjKtnKa58aOyJYD4LdwmXD8s+CON2oodTtt3m BaoLZ19GIEuPhbphevVVo5oQCDtWvzue51sPxh8/qQi6R4xEMhqjLNSxyEUA4YistfOu+j tQL1PMgJWaR4YRSw4h8MaANHfDghtRrhutiMvuBpOx4S41X4sOhXt3WzX5idvfLloE6wPr h9D2lkkUEM1VnR3uoK4kgjWnnXrYlOXDU6/dNu2I80nilExyL5uh41YQCV7TPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHY0pr8zbbp; Tue, 15 Jul 2025 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7rGZ027882; Tue, 15 Jul 2025 10:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7r3W027879; Tue, 15 Jul 2025 10:07:53 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:53 GMT Message-Id: <202507151007.56FA7r3W027879@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: cc68decda316 - main - pf: Reject rules with invalid port ranges List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc68decda316558cc53fadfbb39ac51847f363dd Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cc68decda316558cc53fadfbb39ac51847f363dd commit cc68decda316558cc53fadfbb39ac51847f363dd Author: Kristof Provost AuthorDate: 2025-07-07 15:09:58 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:29 +0000 pf: Reject rules with invalid port ranges Ranges where the left boundary is bigger than the right one are always bogus as they work like `port any' (`port 34<>12' means "all ports") or in way that inverts the rule's action (`pass ... port 34:12' means "pass no port at all"). Add checks for all ranges and invalidate those that yield no or all ports. For this to work on redirections, make pfctl(8) pass the range's type, otherwise boundary including ranges are not detected as such; that is to say, `struct pf_pool's `port_op' member was unused in the kernel so far. `rdr-to' rules with invalid ranges could panic the kernel when hit. Reported-by: syzbot+9c309db201f06e39a8ba@syzkaller.appspotmail.com OK sashan Obtained from: OpenBSD, kn , 39c2a1337a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 016bb1fedef0..3caa0d2e3b11 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2041,6 +2041,19 @@ pf_ioctl_getrules(struct pfioc_rule *pr) return (0); } +static int +pf_validate_range(uint8_t op, uint16_t port[2]) +{ + uint16_t a = ntohs(port[0]); + uint16_t b = ntohs(port[1]); + + if ((op == PF_OP_RRG && a > b) || /* 34:12, i.e. none */ + (op == PF_OP_IRG && a >= b) || /* 34><12, i.e. none */ + (op == PF_OP_XRG && a > b)) /* 34<>22, i.e. all */ + return 1; + return 0; +} + int pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, uint32_t pool_ticket, const char *anchor, const char *anchor_call, @@ -2060,6 +2073,11 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, #define ERROUT(x) ERROUT_FUNCTION(errout, x) + if (pf_validate_range(rule->src.port_op, rule->src.port)) + ERROUT(EINVAL); + if (pf_validate_range(rule->dst.port_op, rule->dst.port)) + ERROUT(EINVAL); + if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); if (rule->rcv_ifname[0]) From nobody Tue Jul 15 10:07:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHb0MxTz62DbN; Tue, 15 Jul 2025 10:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHZ2djLz3fCh; Tue, 15 Jul 2025 10:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cebF6vyi7SL/WB3wegS8WrnGfm/ikyt8g32z+cljvMY=; b=geMqy2B3GAwlkDKzfUjjDzDwFshT1BfMFQV6T8KXGEMwffsEbos/ZXzGdP8uoPIIQEnakV zYBK9ibNAsSLGUiAd395ofUXpMiAEE4qoE3LniuV+YVKLI1COMEG4EgPSiMLo2P25RMiCH +unhd1UJkPUAPV3dC7xXG/vF3+J0OrQF9Bc4voR3IwK/Z6xNCUwGfLy0+M8PDj5AkGkgZg vSg3owkCRs7u96L+u4/eQ/DLwFCWEJI+xWv+GZ3+eq0/T7iLTGxrj2ZZQSRqQE9oevtzia 8yOug9enVznpKeupm95TC5pz9I6653FHsqyl1HjjxxNKDFHRDCT+0QYULwETEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cebF6vyi7SL/WB3wegS8WrnGfm/ikyt8g32z+cljvMY=; b=KNhCz/Lz9e1WZJcvPzdpwLz51gO+OkDrtkfbacsxNAs516qgRLsXC9TWSpo+umzz8H5NAy Oz2Upv8LoJ+j4QjfZbvdbUUEVKmIyX6cLiPIHjCSfafXpreOo8Pu3I06Rq9ddrflA6CZ1n b06I1cPi+UipRiESuu7L7hM4R2ZURink+cZyUQ8k25rQYiB15Jvj7k7RanV7wLq0Lvxkiq jKaIVS/6HGNs5MVUPxCbBudvDR8qNizwhQWykijTNnrnsF3vSj/8wp4Zq+n1hh5XpJKoe3 leAQyumZOLgz+RyXmDWZtDfVkNPD9rwYJrRqKwXPeoBAO4vwtFPmyj/tYfqxhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574074; a=rsa-sha256; cv=none; b=kk2QeTr1EM+Xtf5hdx+2Y2fL2366mi0hQNrYGTvrxz+Qn+qlaaDSjf0AZHhStvpNR2LF+M jGc4liR/wGhn76XHPt8LD9XpKNgqKoUltq6/6WxqArl0dk1FxBM8B9ecBCDstu+Z+9OYkU Ukmq94eAm9iqNXI3JLi7vXQV3cuEX0BI1WIgOwoA6mS+yq6AzMKKSyX9GoLSYkZae09rKY atAXVRKzcr7d0b16UyJk/0KwLDtgWK2nZVsURP2+ml0Mebr+MrdJjqxJygQM9xA5I+8lbL g5AfffMv7HxwhT3MvIB7cpeQXilMrrdSE5qlfdNIBeF0ZSqhmXCSwyBMpBZaNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHZ22t2zbbq; Tue, 15 Jul 2025 10:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7sPS027917; Tue, 15 Jul 2025 10:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7swW027914; Tue, 15 Jul 2025 10:07:54 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:54 GMT Message-Id: <202507151007.56FA7swW027914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3524dfd74144 - main - pfctl: Fail to parse rules with invalid ranges List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3524dfd74144b7e9ad43f4317d494bf41645bb45 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3524dfd74144b7e9ad43f4317d494bf41645bb45 commit 3524dfd74144b7e9ad43f4317d494bf41645bb45 Author: Kristof Provost AuthorDate: 2025-07-08 09:39:25 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:29 +0000 pfctl: Fail to parse rules with invalid ranges This makes pfctl(8) detect bogus ranges (with and without `-n') before loading the ruleset and completes the previous commit. OK sashan sthen Obtained from: OpenBSD, kn , 123a1e155c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 4286b6149ac6..a8a165d336fa 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -367,6 +367,7 @@ static struct node_fairq_opts fairq_opts; static struct node_state_opt *keep_state_defaults = NULL; static struct pfctl_watermarks syncookie_opts; +int validate_range(uint8_t, uint16_t, uint16_t); int disallow_table(struct node_host *, const char *); int disallow_urpf_failed(struct node_host *, const char *); int disallow_alias(struct node_host *, const char *); @@ -3825,9 +3826,14 @@ port_item : portrange { err(1, "port_item: calloc"); $$->port[0] = $1.a; $$->port[1] = $1.b; - if ($1.t) + if ($1.t) { $$->op = PF_OP_RRG; - else + if (validate_range($$->op, $$->port[0], + $$->port[1])) { + yyerror("invalid port range"); + YYERROR; + } + } else $$->op = PF_OP_EQ; $$->next = NULL; $$->tail = $$; @@ -3844,6 +3850,10 @@ port_item : portrange { $$->port[0] = $2.a; $$->port[1] = $2.b; $$->op = $1; + if (validate_range($$->op, $$->port[0], $$->port[1])) { + yyerror("invalid port range"); + YYERROR; + } $$->next = NULL; $$->tail = $$; } @@ -3859,6 +3869,10 @@ port_item : portrange { $$->port[0] = $1.a; $$->port[1] = $3.a; $$->op = $2; + if (validate_range($$->op, $$->port[0], $$->port[1])) { + yyerror("invalid port range"); + YYERROR; + } $$->next = NULL; $$->tail = $$; } @@ -5196,6 +5210,19 @@ yyerror(const char *fmt, ...) return (0); } +int +validate_range(uint8_t op, uint16_t p1, uint16_t p2) +{ + uint16_t a = ntohs(p1); + uint16_t b = ntohs(p2); + + if ((op == PF_OP_RRG && a > b) || /* 34:12, i.e. none */ + (op == PF_OP_IRG && a >= b) || /* 34><12, i.e. none */ + (op == PF_OP_XRG && a > b)) /* 34<>22, i.e. all */ + return 1; + return 0; +} + int disallow_table(struct node_host *h, const char *fmt) { @@ -6018,8 +6045,14 @@ apply_rdr_ports(struct pfctl_rule *r, struct pfctl_pool *rpool, struct redirspec if (!rs->rport.b && rs->rport.t) { rpool->proxy_port[1] = ntohs(rs->rport.a) + (ntohs(r->dst.port[1]) - ntohs(r->dst.port[0])); - } else + } else { + if (validate_range(rs->rport.t, rs->rport.a, + rs->rport.b)) { + yyerror("invalid rdr-to port range"); + return (1); + } r->rdr.proxy_port[1] = ntohs(rs->rport.b); + } if (rs->pool_opts.staticport) { yyerror("the 'static-port' option is only valid with nat rules"); From nobody Tue Jul 15 10:07:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHd0Wnsz62DgT; Tue, 15 Jul 2025 10:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHc3QqBz3f7b; Tue, 15 Jul 2025 10:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ANn5Ox+AOVTH0NIxyHPRTXkNKT36/VWGDqcdueFdmQc=; b=J2wqNaKrLd4AkLs7CCz3ki8xY9NTaHBfBSK0hVQUg1dUBb4BsMrurL1arw/3J6CKxnMTZF ISLjnbWdKz4p9itpqyKxgsGWGOlrdpfSvrR32O/7g+5qQ0wQW2LA/kre+Z1p8DpML8DylZ vIuNn2daaPoJibt0xW72NJKrPXF061vnt7T6BdUZlEoJhyg7Nqsu3FbZq67vZNEIqOaR7w MDlZtLIgXqKNxsyQUOe0muGlZ2bHFG/n89aWW/CNGqa81TlSuwE+EGiokjd37dzNcsTqEv XuOSFMTffxXhU7IzKuPcrxDTFiKpbaUZ+yFuCROkDPYoiZVZdVxXmJN4Hj0f/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ANn5Ox+AOVTH0NIxyHPRTXkNKT36/VWGDqcdueFdmQc=; b=cdbOmoD1Br+z+udPcXJd4dD3gGy+RVok9kGIB29nIEN8lIxpO8swdkPZVsj4t+CVX2NtIj jp1tV/Ih/YQIBqAqw2+dm6CyW6VWiPu5ewEJ8IqS0oX7ncIG76YqwTZIXY0NLPQPBiR4KY 7mS0JaTsmib9JwDvPM9tZR2MoTQdOJwM8X6vhynknP2pbx4E/WBwadpv6YCw7MrAgDxBdX 29ydJVPzWnyYyelU1WW05m2EoMAR7iL/0RmYP2nV9N5MYs9aPkg1m+72TjYG041nirj10L 23v9SPuUpm+Uf9jRTHYMlCTiZ/M0vpNS4BcHDzl6xZHbg4DwAKBCybKgtNicEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574076; a=rsa-sha256; cv=none; b=ublJ0DipoVTvaSsGPbeHg7XvyVoTpNhzDhxA1+BdCQfU6ajWGuAxlUl4SVNDpsATtV7p/7 n0g6V+WR4MFt65sLcwLsEsnNYpG7WHXje+LC7XBynkCzi5baFCbR0m5+ogT4oc2IdDBiyf qJ/XoY8btcH4tRLOnxdsZ355xIeVXpF8lNOwKkKHAg4Eve4VSN0ZIwCW6CmKaspiTA3sDQ YjGKGB6MzedQk2zT7mBBWDiN4kAl6to1FsKYKIf82b6gwUfs+DUVlPUQrRw2S+kxaCYkh5 dye0I5G7spgyZC3HW1JRV1EA0QSKssJZNlfUli+pyov8CdWjCtad6REMwDu4vQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHc2pH5zbbr; Tue, 15 Jul 2025 10:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7u6x027988; Tue, 15 Jul 2025 10:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7ug5027985; Tue, 15 Jul 2025 10:07:56 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:56 GMT Message-Id: <202507151007.56FA7ug5027985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7b0b4fca080e - main - pfctl: getifaddrs() can return entries where ifa_addr is NULL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b0b4fca080e818e5cf2559453345b6057d33064 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7b0b4fca080e818e5cf2559453345b6057d33064 commit 7b0b4fca080e818e5cf2559453345b6057d33064 Author: Kristof Provost AuthorDate: 2025-07-08 09:48:52 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:30 +0000 pfctl: getifaddrs() can return entries where ifa_addr is NULL Check for this before accessing anything in ifa_addr. ok claudio@ Obtained from: OpenBSD, benno , ff7f497850 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index bd2c10c8080f..cc2b03ec211f 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1483,7 +1483,8 @@ ifa_load(void) err(1, "getifaddrs"); for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - if (!(ifa->ifa_addr->sa_family == AF_INET || + if (ifa->ifa_addr == NULL || + !(ifa->ifa_addr->sa_family == AF_INET || ifa->ifa_addr->sa_family == AF_INET6 || ifa->ifa_addr->sa_family == AF_LINK)) continue; From nobody Tue Jul 15 10:07:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHc6dm0z62DbQ; Tue, 15 Jul 2025 10:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHb43C9z3fLm; Tue, 15 Jul 2025 10:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CO8gRIY0WvL1hqY+CNxXx05vfXOIiqea8WEkTlK3k4=; b=UKyYLt1/RpNI+09Sd/B8gL9XMoCgIG6iNLNxt/665gbURwLK38TcYDznS3yZPDJ4dZC+oK Kp7QXu7XKPLX/1TA8hz1Zg1UtN9U6ixqzC5PL19YGtGKGE08flaeel+WXs9h6uAfsjsiJN HX1LoPduJxev1tdPpLwMU1qWmMdo5ajKCz3gLDc3WOlhud+1iQI5pAIALbaOoQ0/kqocne qYVhb+bUt6xchuIOD63OGwPCP4dTvYSeCgyAGKrMVsfflFxwAO4SFKbdRbAxulGKWvPlIy GCnyzkw4AMPJavJjMNJ4WN8rN+XjxrqQg33K/SjZy6u0CWaleiCBFOiFfRwrcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CO8gRIY0WvL1hqY+CNxXx05vfXOIiqea8WEkTlK3k4=; b=WASsgvx9TSPdol/aaI66ed0Qf3ZgJrohWugciV5eHNa8vBxiWLOa1Gvv/HXYTd6Up3KlBG MgUBCVsaz5eACawZzUr//T1lEkmAF5oT/z7g8OxsRRJZUMl51RV1M0laVDiz+fyZI0B8Cq sDgb21oSW+N8+5PTRr//3He9ad/453u9Uf6Zbpe5M7hm7xbMl+4fRd3R7K/e2Eqaww8I4o xscHvy4cEXre9uyCjlL/1UAC2WZYbDD0x08XYQWThk5ADxaZRFq0M9/0rtJuvpup0gf69Z Fa6L7a3/CkBSFje2E0qu4occCVW+2kVsLD1fvs/qNjRhtqRo/dpMyDgWxxwPbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574075; a=rsa-sha256; cv=none; b=fyKF7cWDLkaUcEupJ0Yb8AjUbO6xeO9RFJ1G8wlQwCj7ZAMQcoRmgjwKnmH+nvjldYBFwO +1zJSVkrJZ1fhq4Mka/R/+sFCBy3ISzyOfPMJK6Wsjf/C6/xbIenJMQv4IzrS9TXfqv05f 9KS87cMvhsusp24BZYy+3ppVPJ2ewAUEWuWaAJdv+Qh9ULUYZkbfLUyesSM0KC7mBV13TR XqdCu5ThU4OvZmfQ8kdjmEiQ63rNFwFBf/SSicYPt3INTGN4M3KeUuJ1lmjvgUHsTmt6GK pjEynuk/3YMCnkCLKV7r9/lsDmVsRlNvQCWvy/5/ST13ny6xX/OkK2HWGoBNUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHb2g1Tzc1J; Tue, 15 Jul 2025 10:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7tCM027951; Tue, 15 Jul 2025 10:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7tfS027948; Tue, 15 Jul 2025 10:07:55 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:55 GMT Message-Id: <202507151007.56FA7tfS027948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: dbfdda7b4398 - main - pfctl tests: verify port range validation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbfdda7b4398117f617f5fdf0957f916361682c8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dbfdda7b4398117f617f5fdf0957f916361682c8 commit dbfdda7b4398117f617f5fdf0957f916361682c8 Author: Kristof Provost AuthorDate: 2025-07-08 09:47:52 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:29 +0000 pfctl tests: verify port range validation Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/tests/files/pf1072.fail | 1 + sbin/pfctl/tests/files/pf1072.in | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + 3 files changed, 3 insertions(+) diff --git a/sbin/pfctl/tests/files/pf1072.fail b/sbin/pfctl/tests/files/pf1072.fail new file mode 100644 index 000000000000..06ef5ae457e5 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1072.fail @@ -0,0 +1 @@ +invalid port range diff --git a/sbin/pfctl/tests/files/pf1072.in b/sbin/pfctl/tests/files/pf1072.in new file mode 100644 index 000000000000..e09e92388ce1 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1072.in @@ -0,0 +1 @@ +pass in proto tcp from any port 500:100 to any diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 51729bc9adad..3a68cc06ec74 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -180,3 +180,4 @@ PFCTL_TEST(1068, "max-pkt-rate") PFCTL_TEST(1069, "max-pkt-size") PFCTL_TEST_FAIL(1070, "include line number") PFCTL_TEST(1071, "mask length on (lo0)") +PFCTL_TEST_FAIL(1072, "Invalid port range") From nobody Tue Jul 15 10:07:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHf0sztz62DRX; Tue, 15 Jul 2025 10:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHd4QpMz3fTN; Tue, 15 Jul 2025 10:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vNWgkLkQ61RcQEZihkXXK7vsfc6eCkx+0phaIlCnOcs=; b=iSOF6Vi7k+iAso/nY2b6Pn5G/fAtmu1/jaBX3l38M4NmBDkrwPBdJcgwUAoZcCVl4G7Xaw IWj9huryr4RRqZR7B6TgB+SgcZ5nS+mL9TnaJ3H+f8X++aH//Jl7PHiFJF8PNyJXqkq3mw lLjIhCBq8vuoWrhM11+SEBAOQ2Zz39aJiGHAotJxtFIWeQXexcx0HqnGsSXGZMFLH5o4iA NxfyrvTqXPu3KjrClqhCCTZlVj/Tjz5fA2Cl5wyH/ghBMjK09FsN0ZxzUa3J1exly96qIP e8koUhH7NTRvT+rI2EYw8lx/eCZ6k8yB6B4YLPFR64ly1vB0mZOj5DVtvn2whg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vNWgkLkQ61RcQEZihkXXK7vsfc6eCkx+0phaIlCnOcs=; b=myCZ71cFvyFZ2/wTcE3Tlg5S5kXnAOQdl3ea/xkfVUx+DN6qv4+2Lw2DkQhajjVMD7U3QQ LvDCbyIq/t0mr/6jvaq2WjetOhoKg3v3qba3oTRvjuQBstY1gXwpaWN87zLdcW+stOz7QK mE6Vb4rFlodWI+aDODLWTJDh9ZZs9a33AO7IS2+IjPX4OMhlvO3zVAynpsfCbemJGeszaw OKUMpeqCf5TKRUi/jn9KALsLueeqynwwrBEP82JFKa6IQHmnlOZ7v2HOSZmY2PCIcnpdUA zHLUFLiaNjCrpex+7oewFkyaHXXvUJC5WgCs7Hjkn0VAs7NdedZlgnCY70Zkkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574077; a=rsa-sha256; cv=none; b=Oec27zPeXtNg8OI4HFkr/Ut96G5nG/k6kmOiSsdi60e4RwzfJXRMyKevVHnR/n0aA9faCI YHt73b2FQA26icP3L/Hd7/5jouMHxbWQghneXX6zt/Ls7G0RtTfDjUWpwJ6YVTt24u4n5E YnCjlC1n69AeJfEJQUhfSd5jIhXSx13pMY6dr7lFr0f9ASJROlyDTFsub6rRfaNJjfFFf7 2ioYqQhtFJp00W561aGuJaDar9j4jAxx2S4Dz47F90AwCeZBzJdY73kfQnodWrflIej8AI sjUy6W1x9xEm+WSdZhmAomdNm4jyxLRqfFh2doZtHA4SjyPezhAL04SBFglAqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHd3npkzbT8; Tue, 15 Jul 2025 10:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7vGn028027; Tue, 15 Jul 2025 10:07:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7vT8028024; Tue, 15 Jul 2025 10:07:57 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:57 GMT Message-Id: <202507151007.56FA7vT8028024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7250fc4eb5d0 - main - pflog: improve uid logging List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7250fc4eb5d0effdc285a2e7bc5c6b17d2fb1b9f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7250fc4eb5d0effdc285a2e7bc5c6b17d2fb1b9f commit 7250fc4eb5d0effdc285a2e7bc5c6b17d2fb1b9f Author: Kristof Provost AuthorDate: 2025-07-08 15:04:12 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:30 +0000 pflog: improve uid logging Sometimes a user ID was logged in pflog(4) although the logopt of the rule did not specify it. Check the option again for the log rule in case another rule has triggered a socket lookup. Remove logopt group, it is not documented and cannot work as struct pfloghdr does not contain a gid. Rename PF_LOG_SOCKET_LOOKUP to PF_LOG_USER to express what it does. The lookup involved is only an implemntation detail. OK kn@ sashan@ mvs@ Obtained from: OpenBSD, bluhm , f6d3bf21b2 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 3 +-- sbin/pfctl/pfctl_parser.c | 2 +- sys/netpfil/pf/if_pflog.c | 4 ++-- sys/netpfil/pf/pf.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index a8a165d336fa..358fa909fc50 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -3232,8 +3232,7 @@ logopts : logopt { $$ = $1; } logopt : ALL { $$.log = PF_LOG_ALL; $$.logif = 0; } | MATCHES { $$.log = PF_LOG_MATCHES; $$.logif = 0; } - | USER { $$.log = PF_LOG_SOCKET_LOOKUP; $$.logif = 0; } - | GROUP { $$.log = PF_LOG_SOCKET_LOOKUP; $$.logif = 0; } + | USER { $$.log = PF_LOG_USER; $$.logif = 0; } | TO string { const char *errstr; u_int i; diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index cc2b03ec211f..f2eb75135609 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -928,7 +928,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf("%sall", count++ ? ", " : ""); if (r->log & PF_LOG_MATCHES) printf("%smatches", count++ ? ", " : ""); - if (r->log & PF_LOG_SOCKET_LOOKUP) + if (r->log & PF_LOG_USER) printf("%suser", count++ ? ", " : ""); if (r->logif) printf("%sto pflog%u", count++ ? ", " : "", diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 0a84f9d680ac..cb96d2fcc44c 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -284,9 +284,9 @@ pflog_packet(uint8_t action, u_int8_t reason, * state lock, since this leads to unsafe LOR. * These conditions are very very rare, however. */ - if (trigger->log & PF_LOG_SOCKET_LOOKUP && !pd->lookup.done && lookupsafe) + if (trigger->log & PF_LOG_USER && !pd->lookup.done && lookupsafe) pd->lookup.done = pf_socket_lookup(pd); - if (pd->lookup.done > 0) + if (trigger->log & PF_LOG_USER && pd->lookup.done > 0) hdr.uid = pd->lookup.uid; else hdr.uid = -1; diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index db353d185368..cfff58064922 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -140,7 +140,7 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL, #define PF_LOG 0x01 #define PF_LOG_ALL 0x02 -#define PF_LOG_SOCKET_LOOKUP 0x04 +#define PF_LOG_USER 0x04 #define PF_LOG_FORCE 0x08 #define PF_LOG_MATCHES 0x10 From nobody Tue Jul 15 10:07:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHh4Nmgz62DgY; Tue, 15 Jul 2025 10:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHg6Zkkz3fMf; Tue, 15 Jul 2025 10:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b09yeto8/9jkCM3vx3FnB32uxLPFA3uya4f4GXukVIU=; b=Nk6upo/bXtKgSiHoZBorbI9yqfONzVdoB8NqOH0O+itxylWBmrnMSTczgaWq+pvli3srar d8z/8SYr7/+eQqfxm//JdrHAHru/HUxAcujyF7atLRL3VyfgTJwb/qAfXxfE2I3eb9SRBg 43F6ItUY233DT37cBu6Nh/kESiQV2Qk7ALZtOJnsGsmp3UtoS8Yzdwb9cCmmDs5UmIHfhP rU++w1nQ3xHJuyHHP28osQm3+kDA3b3a2qNnEv10/v8/xPhuquQr6qzkdhf6Q8KB4Pg32G mBgi2M0uWtIVQDzoGiVTyaUTtxBEz+1HlnhkWOiNQB37OOeHxqt6uFpK2tjxlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b09yeto8/9jkCM3vx3FnB32uxLPFA3uya4f4GXukVIU=; b=SoGiGsjJ0uvR5HWsCzhx8uACH7vN8R5Z36bddV+Sk60w/D/jExLitGg9EArPqv2rmbJJBm 85d2Zg9VEOy0av8PVPijGWRxy/bfLSfieFQrjjoMq5/nLCN9nCIPMDoA9rNa7NxU2Now1n jpo7QpxqHEzxnLD8DBNjk8qHsmkqQJA0iK+6sNfdQNiVOFxQZFpwidPZKjsfjrCzz9BV1V 11lOOBrg7Px2usUWdCRVuv4qL14d1TLG8rX4MeM0bHGVcxhkvBebGvYJmgQsEwEwEQiW8a dKVxpZsh3KAjsN5KvCtpSXn7Riv4oNXoINv3UOYCvGO3E7pN+VaFnZyD5V1zzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574080; a=rsa-sha256; cv=none; b=d5pwr0v3Rj8jwRuRl5Ywk3h4zljzPcqVOYt/3jPazNlEejp5PRq8VrXYVHCtVaCN37i+K+ 7KZf2wwodDnhJ+7igRWCRI+M/XdUDqMO38pgr5fz6eA/QmmZ8U14PPBVutYlt8ZCKPnDtX w4/fk5g06GyeTYrdQKbTm48M/8Lm5eYiTBgN0Co/NCWKtClgKUCBR5w0ctQfjg5qRk6I1q TZIRNzDbACJ8QtiphfvkkKAxUXd8xi4Qp/Sxjy7MBZiraePkz/yVtvX+Bbfktg0JauG96d /8Uv4JMEyn5GAOHvVT7N2N+8U2m2ml/WqU5KipZcdb60zicAcbv3b1pxiPIIhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHg65NGzc1K; Tue, 15 Jul 2025 10:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7xAQ028100; Tue, 15 Jul 2025 10:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7xpp028097; Tue, 15 Jul 2025 10:07:59 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:59 GMT Message-Id: <202507151007.56FA7xpp028097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2805280f7f57 - main - pf.conf.5: Markup optional ICMP/ICMP6 codes as such List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2805280f7f575b33c3cc2584371b37abf8d5dda1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2805280f7f575b33c3cc2584371b37abf8d5dda1 commit 2805280f7f575b33c3cc2584371b37abf8d5dda1 Author: Kristof Provost AuthorDate: 2025-07-09 12:06:16 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:30 +0000 pf.conf.5: Markup optional ICMP/ICMP6 codes as such Only icmp(4)/icmp6(4) types are required for `icmp-type'/`icmp6-type' rules while codes are optional. From Martin Vahlensieck < openbsd at academicsolutions dot ch >, thanks! Obtained from: OpenBSD, kn , 5171218709 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index a51fde500367..11e22ebc78bf 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 7, 2025 +.Dd July 9, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -2122,10 +2122,10 @@ options, or scrubbed with will also not be recoverable from intermediate packets. Such connections will stall and time out. .It Xo Ar icmp-type Aq Ar type -.Ar code Aq Ar code +.Ar Op code Aq Ar code .Xc .It Xo Ar icmp6-type Aq Ar type -.Ar code Aq Ar code +.Ar Op code Aq Ar code .Xc This rule only applies to ICMP or ICMPv6 packets with the specified type and code. From nobody Tue Jul 15 10:07:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHg2dv9z62DCV; Tue, 15 Jul 2025 10:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHf5smWz3fGv; Tue, 15 Jul 2025 10:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9I5vaj1g4oNeg0lpwZKxoWfizfl8oAr0eqBN+Ks5lfo=; b=qBXFyL9aNvlb3L6ijGUHk5nKKwP8QNu1NIIX1B36Vw5qCLNmYQdluA3+8DQTEK+bChtpPC Iq/6mCPh+HNt66YTVbM9ODVygeH7hOH2ZG7/wYz2ao4XBjOBQdKajPP1tccuXPf9np9Q3K wCxs9QnbsOkxJz44gdb3efGBBiNRVXx3kZcqQRGrF27uJacQZ8D5epRibNOqXTgYoksmI/ jOTKINnIpjIdSRdABMx4cj0PHd2gV3RQbsJQ+8X0mAKbeQ4AwvDsgjYANYnWnGCprR3R/0 YOyxNXdB53ACbfBV7CAr9XgXibE4cr5z8aaOwjeEHNHMAx92QMNbVcNFkydMSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9I5vaj1g4oNeg0lpwZKxoWfizfl8oAr0eqBN+Ks5lfo=; b=jXsn+4xGmiA4QyJjDWPD8FZVs9Fi0cwhNsspQ6EUCzyJOFSsbnbFGWOCXZTk1vIJD4lhfn sClOtoTIKdxDKt3evo2E3WNQSOdEibWtcioa8ZtEbIgp1HJOAZRqK6/6g1d9Xi7kBHZ2uv IfXsffEfR1NpD0UQjdq6XfN4h1o9P10vpD1NFh+0F3mrIzzG4P7j6ae+ovgkvtobDAA+jI XfWLT1jHCiB9/S0kjA+vPdTl3RxvuwnkXhsCY3QvS9JtC2A34Cn/wKxRWSfPGy7xB6Qwqv Q9vAwb+EQPMuRmwOM3foHGWDCJf69zsie8S7GqQEkHF9oeKwoEeh4r3Pe8ZPUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574078; a=rsa-sha256; cv=none; b=kRYdIQVUgE9P7ryD3mylA1yD5TcC1vgAnyUMY4SDPkZNDp4G5Efciv9r7H9+CI3q2Ouz6w P47qOLV5Y+fZQWT2KMIwnUZ7A5C1U3/10zc36pZtCZ9EHEfluDNwXlWoMAZaejSifXjQ7H Z3nezV1j2faRct32HL/RMVcIBOzI8MiISPnkMVMJNqE5t2hNkCTHaSab/ELmvf6CGs+GOo WcruBkTIn6QiyN8gz0AHZzolqi2c7JKW+0dZCVJD04CIYREZN+lZFdAQjx6omUS8VwDeAP tAdRrh5dko1vwev74A4Ie5pY57y3VNY5hfqfY5SDjXtx41bw1gzKeVetGs5+Vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHf54vhzbYr; Tue, 15 Jul 2025 10:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7wVT028063; Tue, 15 Jul 2025 10:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7wNE028060; Tue, 15 Jul 2025 10:07:58 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:58 GMT Message-Id: <202507151007.56FA7wNE028060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2212dbd78884 - main - pf: Don't run copies of packets made by dup-to through pf_test. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2212dbd78884e36f4d9f15e0e6b65fdd09d37679 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2212dbd78884e36f4d9f15e0e6b65fdd09d37679 commit 2212dbd78884e36f4d9f15e0e6b65fdd09d37679 Author: Kristof Provost AuthorDate: 2025-07-08 15:09:30 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:30 +0000 pf: Don't run copies of packets made by dup-to through pf_test. dup-to is kind of like what you do with a span port, but is a bit more fine grained. it copies packets in a connection out an interface so that connection can be monitored. it doesnt make sense for pf to see the copied packets and try to match or create new states for them either. at best it needs config to stop pf seeing the copies (eg, set skip on $dup_to_tgt_if). at worst it breaks the connections you're monitoring because the states in pf get confused. found while discussing larger route-to changes on tech@. ok bluhm@ sashan@ Obtained from: OpenBSD, dlg , 670ae1ca2f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ac05cad7d4c8..63d513fb1956 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9068,6 +9068,9 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, goto bad; } + if (r->rt == PF_DUPTO) + skip_test = true; + if (pd->dir == PF_IN && !skip_test) { if (pf_test(AF_INET, PF_OUT, PFIL_FWD, ifp, &m0, inp, &pd->act) != PF_PASS) { @@ -9370,6 +9373,9 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, goto bad; } + if (r->rt == PF_DUPTO) + skip_test = true; + if (pd->dir == PF_IN && !skip_test) { if (pf_test(AF_INET6, PF_OUT, PFIL_FWD | PF_PFIL_NOREFRAGMENT, ifp, &m0, inp, &pd->act) != PF_PASS) { From nobody Tue Jul 15 10:08:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhFHj4WtFz62DRf; Tue, 15 Jul 2025 10:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHj0v4Xz3fH7; Tue, 15 Jul 2025 10:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1L5nJa6NY6GUjkAwziYnO237d1Le3259SiB8gc4oAZY=; b=Dlgsw3E74031HLTkSCAaeeDveArxAXROqwfDyUgniMHoASvWQquSsqb5q/fg3/inKFWFmH eZnfgFuPC/spdBpZMYr0jV8PpKhI6Ks8+IwpErlk9aqBFtM9GNG3I/fR6FARXEfzxLk2Gh 7dfdYHlxiumz+n8vRNhLgR6RtsyzIPpfs268mb/3r8au8NjWytq23nx5KI6ZoQtVHVhWxp SSb4PxeOXBF8sbk/F9KPrho2vmEBOgpvq2n8whE9oNMHkUZwlJ0hNk1x6fcp4ijlTKxBoy vpDHdixA5tXkrRLXGf/uJ/Ka1WYhNI7ReuIgnWDrRsHagqeN6rXU2PCQUrYN0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1L5nJa6NY6GUjkAwziYnO237d1Le3259SiB8gc4oAZY=; b=rL9BmPgukGcuwuKsgtZ4KjJpZXjC9xsxUfTglhKfYhO2x32MvcviraC4emY1emEHkWaCC1 rl4eYtmXzrXn+KfB+ivu/wWtnYypDiSTAUrEo9SHBiT9qxgIbrppw4kLYen3GzWoVxSlkf ihhEw719aYIzM++8/m0ollnRNhsVEQ/7InzczDY9t8ncFOKZXs7XYTb2/zvhkEty1AIdFY 8H8JrSMRLKQ0hPwkGRa82sYRvluzmdbOe+AEgJFrUlVjSdXBSGsjQZPGP4fbVOACZluqk8 N6JVTiq5L18IrhBoq2YDzlvS0yOQWrTApyVqpPMMzkuFhe8+yi6MAL2jYO+kNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574081; a=rsa-sha256; cv=none; b=gSmBiFvzZOBLGsqmPwrb1xsgucxFyNbpjaF+qg8eBZRBekPwLUIoUjddODuaKzedKDVCqq +7f09+8HYV6oDQCpHoAqDQ9fcOxhZ1q7SpuH2T5fn1dLKUUyGD+Ba9Yv9k840pDlQPi0y4 8GGqubV9Ywf7zaeTWvf5taqpgotjhGF0gqRkrouNsAd30epJfLKawNuGqcexx8ZlqKpYax wxB7FGaxBVYIhzoPgCI70aIVINTnkWm95k1mYarDJq6/gN6rjNK4nI3gDc9n560xvA2uvi du2wZZDf8SL5PQ0mWrH4BpPb7umes0ITuLh69nKluJ2CGBVcYrNekVqXlNartQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhFHj02KMzc2J; Tue, 15 Jul 2025 10:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA80rw028145; Tue, 15 Jul 2025 10:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA80jk028141; Tue, 15 Jul 2025 10:08:00 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:08:00 GMT Message-Id: <202507151008.56FA80jk028141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 29e8f3e29203 - main - pf: let pf_table.c to use standard way to work with lists List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29e8f3e2920334577fda8c5808c6313b844280af Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=29e8f3e2920334577fda8c5808c6313b844280af commit 29e8f3e2920334577fda8c5808c6313b844280af Author: Kristof Provost AuthorDate: 2025-07-09 12:21:15 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:31 +0000 pf: let pf_table.c to use standard way to work with lists OK todd@, mvs@, kn@ Obtained from: OpenBSD, sashan , 7f9adf34a4 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_table.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index e3f3ab9025f7..9c0151b7da2b 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -819,10 +819,10 @@ pfr_create_kentry(struct pfr_addr *ad, bool counters) static void pfr_destroy_kentries(struct pfr_kentryworkq *workq) { - struct pfr_kentry *p, *q; + struct pfr_kentry *p; - for (p = SLIST_FIRST(workq); p != NULL; p = q) { - q = SLIST_NEXT(p, pfrke_workq); + while ((p = SLIST_FIRST(workq)) != NULL) { + SLIST_REMOVE_HEAD(workq, pfrke_workq); pfr_destroy_kentry(p); } } @@ -1680,8 +1680,7 @@ pfr_ina_commit(struct pfr_table *trs, u_int32_t ticket, int *nadd, } if (!(flags & PFR_FLAG_DUMMY)) { - for (p = SLIST_FIRST(&workq); p != NULL; p = q) { - q = SLIST_NEXT(p, pfrkt_workq); + SLIST_FOREACH_SAFE(p, &workq, pfrkt_workq, q) { pfr_commit_ktable(p, tzero); } rs->topen = 0; @@ -1710,7 +1709,7 @@ pfr_commit_ktable(struct pfr_ktable *kt, time_t tzero) } else if (kt->pfrkt_flags & PFR_TFLAG_ACTIVE) { /* kt might contain addresses */ struct pfr_kentryworkq addrq, addq, changeq, delq, garbageq; - struct pfr_kentry *p, *q, *next; + struct pfr_kentry *p, *q; struct pfr_addr ad; pfr_enqueue_addrs(shadow, &addrq, NULL, 0); @@ -1720,7 +1719,8 @@ pfr_commit_ktable(struct pfr_ktable *kt, time_t tzero) SLIST_INIT(&delq); SLIST_INIT(&garbageq); pfr_clean_node_mask(shadow, &addrq); - SLIST_FOREACH_SAFE(p, &addrq, pfrke_workq, next) { + while ((p = SLIST_FIRST(&addrq)) != NULL) { + SLIST_REMOVE_HEAD(&addrq, pfrke_workq); pfr_copyout_addr(&ad, p); q = pfr_lookup_addr(kt, &ad, 1); if (q != NULL) { @@ -1864,8 +1864,7 @@ pfr_setflags_ktables(struct pfr_ktableworkq *workq) { struct pfr_ktable *p, *q; - for (p = SLIST_FIRST(workq); p; p = q) { - q = SLIST_NEXT(p, pfrkt_workq); + SLIST_FOREACH_SAFE(p, workq, pfrkt_workq, q) { pfr_setflags_ktable(p, p->pfrkt_nflags); } } @@ -2015,10 +2014,10 @@ pfr_create_ktable(struct pfr_table *tbl, time_t tzero, int attachruleset) static void pfr_destroy_ktables(struct pfr_ktableworkq *workq, int flushaddr) { - struct pfr_ktable *p, *q; + struct pfr_ktable *p; - for (p = SLIST_FIRST(workq); p; p = q) { - q = SLIST_NEXT(p, pfrkt_workq); + while ((p = SLIST_FIRST(workq)) != NULL) { + SLIST_REMOVE_HEAD(workq, pfrkt_workq); pfr_destroy_ktable(p, flushaddr); } } From nobody Tue Jul 15 12:53:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhJyC2ZJPz62Mlm; Tue, 15 Jul 2025 12:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhJyB5lFtz3V1V; Tue, 15 Jul 2025 12:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9nyLULf0LJElOSjDTUy2Yktt0gL3I1eL+MoKZLBxSZg=; b=LGgOnKSzZ0WIeNxZdW3qG3LjawX/LrQBmGjsi+bSRlhy6zlK9vsLUTx0oDLSxDdsJwzPGP 7zQ7c4fQ1+CP4EZUn1+OPvzpzMENPgOgrJoXa39F7app0n6zZ/5ttHtgD2h5uoweArOHiT ymmQ91UBNLJ10Gv4+jgYpJYSnJu6mJPYVW7Z3Z3CIho7ah6HMqAc4nX3uBuohariFjbPHf vG4LyEVKKc8QQlIjUFI3S2Obu+o/J+IEIaIVs4oIUYGlqNqq6wPVMKolWOnOov+xHg1OGT OdJiYspWTGf9GaLCDZvdYFKd1pJt/UbJLHh3lnAgortzJgYh7w1EpszgRD/WGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9nyLULf0LJElOSjDTUy2Yktt0gL3I1eL+MoKZLBxSZg=; b=md5vI8lSmlhTgEI1ZqFyEBbV6URwLeILcMQUyP3hEcz2vj97mNtj9n/e9pLRN6pQyzG/vu uQemqDa7EtOmW7Izs4kbn4v0Ijwv3MYfCwgeysRIw6Cps3CyxPrIHIb7S3hPC/ir89xDpM IEYrsjlH6gIehDhLxmFNLtYSCqTsHkcMyH4NkMAzAW8KNx2GgujlfEQIygC9aB8uCIIRY2 4DZpjt6agVid5tkVMZGZcyc9vFMgBBwNTNX9/1hR0va6JB0OguZcg9dY0/qEvWLDvXpxP5 Z3+p9QQLRK+krL5n3y4O1JDTk1sRD+qGnKxH0n9G9m2wJN3vy75+jkpAZy/HeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752583986; a=rsa-sha256; cv=none; b=iCZRMe2Nhb9jkD7+GpsAusz5zj+Owc1grmzCKLMWXhFe8j/PiqgKTrhDN8TJukRn+rAaSq Hckxbzs2Qq4ANYsN+P+f57jH+rZ63WTNknoIvtUvIyFm9L7fTNHBs0t3ih3rm3E0JGrlJ0 l3VAzlXDz3vlIhWQoe5X+Oz5TOcT/a0eQrUwzE+tj+qj9IWJ2GnigrY9GDUIvv9PVt2CDb YgajZv2QwsY0QcZbJxnMAZ9GrhACYur5WkTsOoe2uxrbcVQjmgPFqBVCE2SSZyqh9TL29B KQyGNpfDzVjWf6RQ9rXdf7jxh2U8IprFkqa0TBqQkhrCdDG+0kX+zXkVkAt3fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhJyB5LW5zhDZ; Tue, 15 Jul 2025 12:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FCr6P0045443; Tue, 15 Jul 2025 12:53:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FCr6wO045440; Tue, 15 Jul 2025 12:53:06 GMT (envelope-from git) Date: Tue, 15 Jul 2025 12:53:06 GMT Message-Id: <202507151253.56FCr6wO045440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c8a523690b1a - main - i386: Avoid calling kmem_alloc_contig(M_NEVERFREED) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8a523690b1a904344662c5834b713e5fc9e9aad Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c8a523690b1a904344662c5834b713e5fc9e9aad commit c8a523690b1a904344662c5834b713e5fc9e9aad Author: Mark Johnston AuthorDate: 2025-07-15 00:19:51 +0000 Commit: Mark Johnston CommitDate: 2025-07-15 12:52:14 +0000 i386: Avoid calling kmem_alloc_contig(M_NEVERFREED) vm_page_alloc_contig* don't handle VM_ALLOC_NOFREE. After commit 07297aee35f2 ("vm_page: update comments and KASSERT()s concerning page allocation"), pmap_pdpt_allocf() triggers one of the added assertions, since pdptzone is a NOFREE zone. Simply clear the flag when allocating a slab. It is not worth trying to implement support for the NOFREE allocator here. Reported by: Jenkins Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D51311 --- sys/i386/i386/pmap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 5065b7e61ee8..b44f5e08bbcf 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -876,14 +876,16 @@ __CONCAT(PMTYPE, init_pat)(void) #ifdef PMAP_PAE_COMP static void * -pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *flags, - int wait) +pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *sflagsp, + int flags) { /* Inform UMA that this allocator uses kernel_map/object. */ - *flags = UMA_SLAB_KERNEL; + *sflagsp = UMA_SLAB_KERNEL; + /* contig allocations cannot be NEVERFREED */ + flags &= ~M_NEVERFREED; return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), - bytes, wait, 0x0ULL, 0xffffffffULL, 1, 0, VM_MEMATTR_DEFAULT)); + bytes, flags, 0x0ULL, 0xffffffffULL, 1, 0, VM_MEMATTR_DEFAULT)); } #endif From nobody Tue Jul 15 12:53:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhJyD48bRz62MRK; Tue, 15 Jul 2025 12:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhJyC6gRkz3V5W; Tue, 15 Jul 2025 12:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IoZQPSNcdY2geCP9CH0csEirkTXBujM1x4gc327Ag/A=; b=O0w9Apq84vblYFu+FZ2NJUhGo399aUZcWUgqcx1pDKoi5jU+GVHrjuz/U67f6RMaFwxkRb vZRJnwAx4qxbQqRYNbzDHCjHnizGvSvUgaF4iF0sy2JtFhbDbKfitooPwD74qqss9+fk5/ jBrK/Pyc8UVudqV0IELLuhBYplIygY4LyVN7tK7dNf8biM4f96506lFlKT+NzWEZSjb03j smdZW6b3+Eh5YDdY/9VWh4ZEu8jDkK1p4qSUBXvhVAtCJtKUBQBzpAwfl37Xnt+eRr7czP gNuphXX56T+qZugBG/94w4/jdrvg4c9QD1Hb7H8rzR0pmHvtqLHm5DBFyikf8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IoZQPSNcdY2geCP9CH0csEirkTXBujM1x4gc327Ag/A=; b=JOEYcctkaY/moQuOuIwDrwooOOXOJe0S1ZJAsqVcFwrRLOflukLKvRxuj+GEaR55SZKLtL 4mf5j4ly01Yq17A9sYr1OBgOhUaZff3RYHH1ofjcqSLivzZMJSfzkuLrtntWO10eyj9AFs Ah7eK+kHUdMvsBDmRUXwRCxadGECqpOsm2bghChKw5sAweU0XfV1nIRU4rili+zmGOt1hM /s2E2HnJaM8K/UUHOgDAhwnqTY7dn5e9+Vq07Xj0P5WEsXYKIuKbqNsH9ZaCAHA2ikpWXE +zIbtd7qohSyimHrxWM0JXH8wKiwTRj6zv1WbO65CdQl6iw/0oXeuOodEbJwmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752583987; a=rsa-sha256; cv=none; b=dUWt0H0u+TGGkuDnP1PqHYW75/xzfSp4h7v2EY36PKpsZsM6onz3ZufT+NxQQnFCMfli6Q /JGF+iRUA3z0tQcfAHc8awvVlyOcohncVw8uof9IUS/jFjDgRaUdB2RVhrLVovCiirt0nL TwRLb1ptXtlQqQp/+r6FRKxBT2N824UHQAzdHPSoAoByTO3Zq9PMvyn98g+skvypqRoV+/ 5QDvJ/me8tuusheGZHV0r6H/PDDRllkzDEVp7fYwdqCqqlduKwEMJz79ziJAdgDWGR3Pg2 6TRFd9tJ47x2XXYoUa4Ji3HNlezCpFUJZj8cXett76T7m3w8vaQYCISP7FjHWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhJyC60Q6zgsq; Tue, 15 Jul 2025 12:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FCr7p1045476; Tue, 15 Jul 2025 12:53:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FCr7Ld045473; Tue, 15 Jul 2025 12:53:07 GMT (envelope-from git) Date: Tue, 15 Jul 2025 12:53:07 GMT Message-Id: <202507151253.56FCr7Ld045473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d4cdba5b2f55 - main - p9fs: Set *eofflag in p9fs_readdir() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4cdba5b2f55b62ba1558995226dd9d93fe00af8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d4cdba5b2f55b62ba1558995226dd9d93fe00af8 commit d4cdba5b2f55b62ba1558995226dd9d93fe00af8 Author: Mark Johnston AuthorDate: 2025-07-15 00:20:06 +0000 Commit: Mark Johnston CommitDate: 2025-07-15 12:52:56 +0000 p9fs: Set *eofflag in p9fs_readdir() Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50760 --- sys/fs/p9fs/p9fs_vnops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 56bf766ef801..227e2b93883e 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -1784,6 +1784,9 @@ p9fs_readdir(struct vop_readdir_args *ap) return (EBADF); } + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; + io_buffer = uma_zalloc(p9fs_io_buffer_zone, M_WAITOK); /* We haven't reached the end yet. read more. */ @@ -1801,8 +1804,11 @@ p9fs_readdir(struct vop_readdir_args *ap) count = p9_client_readdir(vofid, (char *)io_buffer, diroffset, count); - if (count == 0) + if (count == 0) { + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; break; + } if (count < 0) { error = EIO; From nobody Tue Jul 15 12:53:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhJyF39g0z62N3W; Tue, 15 Jul 2025 12:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhJyF0jF3z3V1b; Tue, 15 Jul 2025 12:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYeY9CaBJP9cOSf0I04/5IVnOxHbAuJ8v6Fcs4bNr+w=; b=vRjxE82OZthp4zQ2R0x/xuzQIjn/ESqGytJClgVe3oYUzRWlyfczRJHdLu4pfO3rUYLosg d3sP+qIoy0SNixt9kiEAeCaGfX3dz2hVopUh0OxsbDyETY9e5p93OvyWj2GrDSf/Zk+7fY Cvu0Np7OjHqGHZJij1SpbnFOQEByhB/xkDhRss6tc4fJY+t9r3MvXOTDnGUfeuyJdcm2Xy FuKJi6kNEsmHm3SGmTIBWC+53xE1CuZFnT8YiwlaSk9nO4GbeQGzWeadFNUxkihz8aQR1f MQWDXi9sUb5qPG9RV6HqbR7tjw+Rn0MuVk2iRqoIhmEPu5DQqsVmZADaUuL2Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYeY9CaBJP9cOSf0I04/5IVnOxHbAuJ8v6Fcs4bNr+w=; b=IHTQ4DGwsRy1OuDbaOQWtpLul0Oc14g5cYNXgzK9KNYf0sxtTtFUezYwjF/dhIBW+nx2RH hMoc6Et3crTd+zMeis5UawbFaMDWGCfkOTYRqHxviMh9T2gB4PdAsROY4xNAU9uJsr6DrA vIj81EqWGJvuX6xjhlCVq4CWqWWp6c51JaXEya5vp0y9nDIFP/79hxKSndAVqwiv4ziN0T e8ZIa2v7YcsR/PyrS1k41vdg7bIlaVZdyrbu7ulGVx0/WQMNDwd7GhYGLcL4mWMU8w6/VW krg4Oaa5+Fislh2901Q9rvgqwTkAythPVaDQISaQnhExo1ATbTt1YJHJIXFqsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752583989; a=rsa-sha256; cv=none; b=Dzt3q4StLAvFf6ytWR1WDEdCXnfluOxUi21cNiPep2HVjghJgOA3W+x0NF7J8iySUXkE6w akmYCiJZ4ihCqZ9n1f54s4hY7H5f0PP6MLDSnG4Hxhusy+WBk/oAQmnJvv/2K0v2KmBnNR OOv2wlaKRzooV6VWvvduq2dF1C8amxKlxREvAOs9VyiTUQDgNf7Rf0HOEK3aQU4It58JoD WpqzZGRgoqvN3cfy5B4RKY+ODnYRbBzq2FbwU8JNM/JKYKk2spF2SZeAiQFdX7jC/41c/O lBAlJjw6ASu/5LHbBHtPHdAlb40K5S+80B/h/xc85bRcV2i+Ee7HursgDXSevQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhJyF02DyzgqR; Tue, 15 Jul 2025 12:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FCr8PK045509; Tue, 15 Jul 2025 12:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FCr8Pg045506; Tue, 15 Jul 2025 12:53:08 GMT (envelope-from git) Date: Tue, 15 Jul 2025 12:53:08 GMT Message-Id: <202507151253.56FCr8Pg045506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1f683624df87 - main - kasan: Use kasan_md_unsupported() to check for invalid addresses List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f683624df878b2e4c0187137640bf2e6662c36f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1f683624df878b2e4c0187137640bf2e6662c36f commit 1f683624df878b2e4c0187137640bf2e6662c36f Author: Mark Johnston AuthorDate: 2025-07-15 00:31:10 +0000 Commit: Mark Johnston CommitDate: 2025-07-15 12:52:58 +0000 kasan: Use kasan_md_unsupported() to check for invalid addresses The subsequent assert verifies that the address is in the kernel map anyway, and this removes uses of the MD DMAP_*_ADDRESS constants from MI code. This fixes the amd64 KASAN build after commit 4dd828c80828 ("amd64: add kva_layout"). MFC after: 2 weeks --- sys/kern/subr_asan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 0edb631d1475..464efda1e91a 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -263,8 +263,7 @@ kasan_mark(const void *addr, size_t size, size_t redzsize, uint8_t code) if (__predict_false(!kasan_enabled)) return; - if ((vm_offset_t)addr >= DMAP_MIN_ADDRESS && - (vm_offset_t)addr < DMAP_MAX_ADDRESS) + if (kasan_md_unsupported((vm_offset_t)addr)) return; KASSERT((vm_offset_t)addr >= VM_MIN_KERNEL_ADDRESS && From nobody Tue Jul 15 12:53:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhJyG5bNgz62Mpg; Tue, 15 Jul 2025 12:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhJyG1F34z3V1c; Tue, 15 Jul 2025 12:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eTVqgSg0X0pBtb9AcqXHIVpFNlCd+qZyeJxBzxu3Xp4=; b=q22HrxmosxtqwGxzJkXQ89IuwGDCJQ6GBaltNPrCUz0/m/k3L9UCcBWTUUAig9dmVuthYm 0cG+iHC2TfaiEhG7iMJcJZDkh3mBSKIJZ1ijRtsG69FpddrHajnNB3ThJJm4xu2cfS3AyN UMJ+/9dpKe4sgYu+r4wfQBgBQhu+GUdxQOwCUPPrJbWYdFDl7LWPnAZfQKUUWv223CiKeP CH2tPhC2rUcUT5gI8phvwlN/BWe2u2d3UQChH7JpvtG4+Q4DNXfxSeqe7RkAMR2pAvStqI vCEd16HWll4EabhEvz8Yu/lQp6GP2zULjIGRRXADY/oUEW0BqPrYJPG3x7jxBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752583990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eTVqgSg0X0pBtb9AcqXHIVpFNlCd+qZyeJxBzxu3Xp4=; b=waCc9g90nHpylEBSjbiTBWvMXKw+DkmCuzIy8zC0rQLusUvzNzl0KTsGKnj6d/vt3n1Zd8 FBjwDGcl9in0eo9R3M2WTG3gd5Rqvr5/ZdTkn5H7Ia9NOcFf0p9G0GTDsqGeVn1Ws9SPZP Xz3py3t+ioD9Podd83pEt33H9KNH6hsJHGxGb8nwwzuSE5VAX/58PlMfumooD93q4jB1LO t2Sk4tfdApV1vzjOvhiE58DlKaYAU2l0GElZ0WS6cSDTiSb5o0mN7U3ToehhaJ5zm5N2Qr obTZgM5+ppRBfaVGbXtP47IPqMB4SJmRC8+BwdFLBjbNXiq3BvgINNQIxAmr+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752583990; a=rsa-sha256; cv=none; b=N9DELBq3QPQxy08vhvI66MJov+Pw2Lmh8sT9ePr9jcucMjFmT8PXeanV0qIfBE1dGCa22F RYW8sk1xPgzmBzlSJrkM28o2Gu2Gpv2gTQns2l09Vy/9w8K2Y2HyjMmFFSVBbpqIhPUA/x O/lbUuBhxXdCsqFN3fGLa0R0iFMenfud8K1sDqSP2h7PNM4gPe89kionGnsQpe0LGaUGsk ghSbR3i7cLtkmKnFL6wnFBNpP1XvAX5FmABnIQu2/PZTuvSJqRb/hNKIi4MdOXa0Nit0fC wxH4NFow38PquhNSoZafR4TXmbhzDnY/JrrkKJPVomNJoHtySvz1jh2/LN0IbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhJyG0k9MzhDb; Tue, 15 Jul 2025 12:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FCrAfn045550; Tue, 15 Jul 2025 12:53:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FCr91L045547; Tue, 15 Jul 2025 12:53:09 GMT (envelope-from git) Date: Tue, 15 Jul 2025 12:53:09 GMT Message-Id: <202507151253.56FCr91L045547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: da84054f3a50 - main - fdescfs: Set *eofflag in fdesc_readdir() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da84054f3a508ceab4474e4a002c87813963cc84 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=da84054f3a508ceab4474e4a002c87813963cc84 commit da84054f3a508ceab4474e4a002c87813963cc84 Author: Mark Johnston AuthorDate: 2025-07-15 00:38:21 +0000 Commit: Mark Johnston CommitDate: 2025-07-15 12:52:58 +0000 fdescfs: Set *eofflag in fdesc_readdir() Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51319 --- sys/fs/fdescfs/fdesc_vnops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 676ea5de12b8..58a22b8bdc50 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -547,6 +547,8 @@ fdesc_readdir(struct vop_readdir_args *ap) fmp = VFSTOFDESC(ap->a_vp->v_mount); if (ap->a_ncookies != NULL) *ap->a_ncookies = 0; + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; off = (int)uio->uio_offset; if (off != uio->uio_offset || off < 0 || (u_int)off % UIO_MX != 0 || @@ -559,7 +561,12 @@ fdesc_readdir(struct vop_readdir_args *ap) fcnt = i - 2; /* The first two nodes are `.' and `..' */ FILEDESC_SLOCK(fdp); - while (i < fdp->fd_nfiles + 2 && uio->uio_resid >= UIO_MX) { + while (uio->uio_resid >= UIO_MX) { + if (i >= fdp->fd_nfiles + 2) { + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; + break; + } bzero((caddr_t)dp, UIO_MX); switch (i) { case 0: /* `.' */ From nobody Tue Jul 15 12:56:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhK270YZQz62Mqf; Tue, 15 Jul 2025 12:56:31 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhK265Vlyz3XDZ; Tue, 15 Jul 2025 12:56:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-6fb0eb0f0fbso59222706d6.1; Tue, 15 Jul 2025 05:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752584188; x=1753188988; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=bsY6hrwyKygh67sTIGh+/H9Y6t+oHXmQEafQOgk6aco=; b=mnesZfEFCFIBXrKPsPfcrecWr550D1M7wZCLALLnYWJ/CcoruETvlVW9U9q0ZavpA6 omRBs4tpHM5jY4OmZ4bO/bKPCGv2PnecD9kY7t49NxKC37jG4ElL6/OvoxY6Efqy81D3 HNya/t+FRgSuUVE8mT+VH/6LtX/d80L2W62cdpWCLkYapbTnIQaQNSxlbuhqAkFChPxj Cbdyvc23SkHvCZpfCrnZsfekqqvpKbCw2keQLQfgcnwCjeFG/nrMoxImc8OiahiZPllk jo6ILzUdQf/4FF1hD94B9TsqVfwQNrOCZAPpnWZspiejtgAXT6roJ4oN8XtyLNXRthFt Bfhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752584188; x=1753188988; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bsY6hrwyKygh67sTIGh+/H9Y6t+oHXmQEafQOgk6aco=; b=RKqIKaf3uY2yDURejMhG2ww1PUKAOeUISb5FYalLX1BMwPaeCTtWHlPyMgztUaJpEL bS9MDP/xU7fCsawh49V0dcPuz7uVAk/wO97//lDIMzZxNMueXphMrH6VK+Cnyx5rawhK 33/C1QM/xIcVoA9sROaq3nRSzs0DcLiGLYGp2O/cd7DW7DnHEIKsvLx6QTCSivwuQDXX qG1w33qJthW5fWw2BACx1Gdxrp4ePW+FbAsH3YS8GkP1LBVCuTPMQqV3sAJX0yzJ6pZj o3NR7RpPFkg/vYaKVYJ/wNzNIG2uu28spNkkGeaSgV4QeWHBT/hom7UhOdC4O5dofTiE A4Fw== X-Forwarded-Encrypted: i=1; AJvYcCVLA7Trhiv8IGbxe57HE5bVo+GW+k2tJG8OuIQtkKV5WQK4dDUf+jHp9M/pvrLOALv/Zic8JjP0ovvrfHNyCdQbD/eRzP4=@freebsd.org, AJvYcCX3eOMB3++92roFUgE1kPyZLaCCX+5Iww7ITuD+p1Jdg6g5VNrRlTgESrbutbXQCjtUG84zkTzSXlbi5wFmeMs=@freebsd.org, AJvYcCXNN69aREzbwDVx6K6ON4uAhQy74lfwQG718o7mqzIQPvU9wK1nYWF10usTW1CuXtV0sYKPEoVJP0FBCnPNF0DIqvxa@freebsd.org X-Gm-Message-State: AOJu0Yx61z16W9XPOORgQmxv5EP7Eg+Tn4DPzw7k7xVtfJOXhEriUs7W Ixe9W2+LVnZk6cdX3VHk2NrcXInTaX94h5bag6r9tnbhbIS+5Ob7rbtBA8tbmlfGXRw= X-Gm-Gg: ASbGncsjtv0twudq8lfHa6zMQeCBR2FcxxfP2YJ8FXpIxwPtTgDefwWhuNh1QYxjveP ULP47wbS6r+MO1Wg5Nd0jDWdS6k9CjRd8BcHwalz08BBX4FjfYjha5RgQ0qLgdTCRBzU94bJsk5 WKJA2c8KVP/1ThFcD6CcOdXymKOJxTqCI7NRpZNTzy17QjbmKDDfzvt+45XxwaKMdGS/mvwMT1Z oCecNm90Yb0lkhdnftj+4F/o3EjjBcuqY4mzHW4PxdENDEstbik4sEvD/HoxMhnhXAmFhVZivYq cRsQ1clz6QAeJZO8NvCfAhR8Qn8ebDA+5RvEbBw5RTK7sHVC+yhVC+tIVg7VQg9KJ/Vz4dtxpuO lLYEkWIsrSJkuK+JCamB+RNsCbklEeST99HqREwznThH7OkQ= X-Google-Smtp-Source: AGHT+IGVuULCtVl6ldcfnMutTUWuJ/4b1z/HjwgUzSsz8dtXopmknmW8Hqt54MBiDNb1Wl3u29BkyA== X-Received: by 2002:a05:6214:5f83:b0:704:a957:8656 with SMTP id 6a1803df08f44-704e1dd6601mr39212236d6.11.1752584188053; Tue, 15 Jul 2025 05:56:28 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-704979e3146sm57322446d6.41.2025.07.15.05.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jul 2025 05:56:27 -0700 (PDT) Date: Tue, 15 Jul 2025 08:56:25 -0400 From: Mark Johnston To: Kristof Provost Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4dd828c80828 - main - amd64: add kva_layout Message-ID: References: <202507142203.56EM3lOw070595@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4bhK265Vlyz3XDZ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 15, 2025 at 10:52:35AM +0200, Kristof Provost wrote: > On 15 Jul 2025, at 0:03, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=4dd828c80828637452a8a4e07a64e294c82e5d8b > > > > commit 4dd828c80828637452a8a4e07a64e294c82e5d8b > > Author: Konstantin Belousov > > AuthorDate: 2025-06-15 21:39:10 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-14 22:03:28 +0000 > > > > amd64: add kva_layout > > > > Reviewed by: markj > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D51085 > > --- > .. > > diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h > > index 0cd9bb4fa7a4..f12e5217a44b 100644 > > --- a/sys/amd64/include/vmparam.h > > +++ b/sys/amd64/include/vmparam.h > > @@ -181,12 +181,9 @@ > > * 0xffffffff80000000 KERNBASE > > */ > > > > -#define VM_MIN_KERNEL_ADDRESS KV4ADDR(KPML4BASE, 0, 0, 0) > > -#define VM_MAX_KERNEL_ADDRESS KV4ADDR(KPML4BASE + NKPML4E - 1, \ > > - NPDPEPG-1, NPDEPG-1, NPTEPG-1) > > - > > -#define DMAP_MIN_ADDRESS KV4ADDR(DMPML4I, 0, 0, 0) > > -#define DMAP_MAX_ADDRESS KV4ADDR(DMPML4I + NDMPML4E, 0, 0, 0) > > +#define VM_MIN_KERNEL_ADDRESS_LA48 KV4ADDR(KPML4BASE, 0, 0, 0) > > +#define VM_MIN_KERNEL_ADDRESS kva_layout.km_low > > +#define VM_MAX_KERNEL_ADDRESS kva_layout.km_high > > The removal of DMAP_MIN_ADDRESS breaks the KASAN build. > > This seems to fix it for me, but I’m not familiar enough with this code to be confident to commit it: > > diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c > index 0edb631d1475..31204bad8c30 100644 > --- a/sys/kern/subr_asan.c > +++ b/sys/kern/subr_asan.c > @@ -263,8 +263,8 @@ kasan_mark(const void *addr, size_t size, size_t redzsize, uint8_t code) > if (__predict_false(!kasan_enabled)) > return; > > - if ((vm_offset_t)addr >= DMAP_MIN_ADDRESS && > - (vm_offset_t)addr < DMAP_MAX_ADDRESS) > + if ((vm_offset_t)addr >= kva_layout.dmap_low && > + (vm_offset_t)addr < kva_layout.dmap_high) > return; That restores the old behaviour, but it would break on arm64, which doesn't have a kva_layout. I pushed a different patch as commit 1f683624df878b2e4c0187137640bf2e6662c36f. That way is also consistent with how unhandled addresses are handled in KMSAN. From nobody Tue Jul 15 13:06:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhKGC3B8Tz62NbJ; Tue, 15 Jul 2025 13:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhKGC2fwYz3cxY; Tue, 15 Jul 2025 13:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752584819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VqB88GdUaRY+4LFlt6Hd+trnV+Ed/yOkFvcLAMct3p4=; b=RGa4/zCv+8Ls+XypJPag0vaQ9aK6twvtrO6SpE6NuYaZSQ9+blZkaX1vU4W4cCRW4A6QnN ess4KspVEozf5STu1pz2rnloMSqqQX+u5SkA5dKsZwc3KYMrVvvA62ldYxEtQyTmJPR1lh tg2n8VMf5nEl896wkZnyLc5HfNkpjZUfvpZ/dEsLhtNwNSvrNlyPEpO93Sn8m/UyWCcQX0 UBA+8ohSZAY04FmL9jvAB9OzH/0x4YwOjepAuoyUi4r/KdYSOCAbJkbzKOYqkdI6RdtCet Mv0H8eAS6svKh5+GNErktJ7WyoJMDeTYbSbi+Hyk2HbZVIJspe/8HFcWwwDVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752584819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VqB88GdUaRY+4LFlt6Hd+trnV+Ed/yOkFvcLAMct3p4=; b=Aqb6yYwhx7ruWB1cOaS1vLH9353K5QSm/6F4t2MrQ5D+DF2+a08RUvwmhla/f7Q2qM1n41 3XXYeGF1iwhQnETo99oTnKdOuEqeNWwC3OpjZgNZ75iXqepwYHyThZbnnIkENtJlaVX9PA nqRPVaYViEyDr//cFGr7cmQUgh3NuM3u2mtnVJXcvTOZ/nO2jfjrcwm5YHL/IadJ8TOj7/ 5akx7GPGA0dJUjDloLGH6JvP+C7a56/yzeBisuy64mwBtvNZ2vmLcxCjTdQz9H4JDZf0LL hWtXpvNF5HKWNVszvBOh8i002kFmA8zC4EbbAYhigDPjNWDh2Yi87lEYdyT+Rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752584819; a=rsa-sha256; cv=none; b=EAVt59Ctz4d9AI2tiZ9hu37CExHQWul8ghUbPfLQ5dbFrvFEGYS4QUDQ9hC8MmuEPvyS6+ uKAaROXZDBF3TjECELwns4hg28ubiVEiE0eAtSgyMvZxiPg5dTF/ru/B7plTGoHAo3hFCE /0GPBEVadQ2/be+fe8A2IExw+cjY6WxDi4ttLZeFaaWxkusKv6G3jtt8h45T1TvOu8nU2S onxYIX1dftax7wm4Hfo6bX1FK7L+uLYaLzy3NT96+mYCoHOxfJfn0kc/a9r1i/TgsmetXF Vd3PhEHRXVdabUDpm6hlHMgkLdjr/nToqSDr2m5s8ddFxipRFwNHLPp7qyzUtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhKGC2GFHzhNG; Tue, 15 Jul 2025 13:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FD6xbH066825; Tue, 15 Jul 2025 13:06:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FD6xKB066822; Tue, 15 Jul 2025 13:06:59 GMT (envelope-from git) Date: Tue, 15 Jul 2025 13:06:59 GMT Message-Id: <202507151306.56FD6xKB066822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9e8c1f9576e7 - main - /etc/rc.d/pf: Fix for multi-line pf_fallback_rules List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e8c1f9576e75fcd34007c6e8a4a6da0b1b2f1e2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9e8c1f9576e75fcd34007c6e8a4a6da0b1b2f1e2 commit 9e8c1f9576e75fcd34007c6e8a4a6da0b1b2f1e2 Author: Michael Proto AuthorDate: 2025-07-13 21:30:28 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 13:06:27 +0000 /etc/rc.d/pf: Fix for multi-line pf_fallback_rules Setting multiple pf_fallback_rules in /etc/rc.conf as per the documentation produces invalid pf syntax due to the lack of echo quoting $pf_fallback_rules in /etc/rc.d/pf. Adding quotes around the $pf_fallback_rules echo maintains newlines needed for valid pfctl syntax. Provided patch resolves the issue Also updating rc.conf(5) to reflect that multi-line pf_fallback_rules should not include a trailing backslash (\) as line breaks are needed when passing rules to pfctl via stdin. PR: 288197 Reviewed by: kp MFC after: 2 weeks --- libexec/rc/rc.d/pf | 2 +- share/man/man5/rc.conf.5 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc.d/pf b/libexec/rc/rc.d/pf index 0b4c086db22b..46fb085e5175 100755 --- a/libexec/rc/rc.d/pf +++ b/libexec/rc/rc.d/pf @@ -38,7 +38,7 @@ pf_fallback() $pf_program -f "$pf_fallback_rules_file" $pf_flags else warn "Loading fallback rules: $pf_fallback_rules" - echo $pf_fallback_rules | $pf_program -f - $pf_flags + echo "$pf_fallback_rules" | $pf_program -f - $pf_flags fi } diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 2fd63e4f743d..de2181d638d1 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 21, 2025 +.Dd July 15, 2025 .Dt RC.CONF 5 .Os .Sh NAME @@ -1164,8 +1164,8 @@ and is not found. Multiple rules can be set as follows: .Bd -literal -pf_fallback_rules="\\ - block drop log all\\ +pf_fallback_rules=" + block drop log all pass in quick on em0" .Pp .Ed From nobody Tue Jul 15 13:11:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhKN414xkz62Ncq; Tue, 15 Jul 2025 13:12:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhKN36jBzz3fYc; Tue, 15 Jul 2025 13:12:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752585123; 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=V9b2xGbWzHqHXINpk5iOa/LYdqqFz6HacnOTyZatqgc=; b=kz7l5YhCbuFzKZlnx79keJBH79/u8pgrjdu3ZnYRS+syyMAp2a8gRbdrC1vY/0LOXs1AJR W3o2iYm4yQClxewgE0W+5se5KJXztSGxMJ6/p9SaOzxzBJznpBGfZo61zraWVz224YSduF TiAxzDWYuvxQKDo65wZeMHkE4aSy80+6B1AqzkzjP7sGFKVEiqZemq7Fg8Neh6LYjzL8Jo pQ8aq1aNjHFxEAkcxL/px43xS1oVY2hmy9514e+AHic9rL93PqzIrrt8VvPUtirmlHpyaL RnR9L8QbP1+bIYmTnnaVk6uui11Ymr293mnksBNcYlWFx6behxLvgxLQ4En03g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752585123; 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=V9b2xGbWzHqHXINpk5iOa/LYdqqFz6HacnOTyZatqgc=; b=DfDVUneRERu4DXWxfbNxULZ89aRBtD9PkcTfLM0N8Oar8g9ANxsY1nrARR/Joqn1t6O0IE KBLFC7Gy+4OW6eQevM51b1xP++V3jcNIsvJJIbPfXN3rQH9xHLjIVAzKn3kAtYxLXtspks /Aaad7KiuGZOLchIdxAD9AyfGysUbw8UdW4Kzgm5i3eqbFWuSWMtmJMBOzkXrPL8v4G1/H IgBEk5gM8wP/U4UwJUzwPCwYqKh06tGuTQAgsEQVtgS/WsqDOw7n3UjN5IOoVk2qWOfuLy fpqlBffTmQYQ/9rkw6ofYsLT1VM8gdRIykFKCch7sQpSbFn5QQyASY/gZKCHFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752585123; a=rsa-sha256; cv=none; b=DyNsyGuHwMMfvky4IcuI3kMJAwlmuQjn9w9QMMH+5uFHyhS/scS0eYuCbjuaHQCSgy5IBK RfS9SPmZ8oCL7uyE33PlZX6BWNQCAYUpQZnNDXIABq6NoQsCVKEwd0DBiAnLe5yQPDezK3 QWXXy/q232UGySYUy9SZcFoGbHeAknY3c7Q7nOSQc5izZM4X2GfsoMI3wPTR+kXLIg7HIN ybovr0T4yWVVRUD22fMsPT+QxKxR2FSG9vGjCmED2PgRTo4ZYCa+oSA2dajh8GiD42rrBS 3ns2NfDy+mHmnEDw5AJzaGS8TnQZ6unzOgQzBPWDX7+xStCDUoautVlqe4bNNg== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher 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 "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bhKN35Z0BzByw; Tue, 15 Jul 2025 13:12:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id BB1AD52545; Tue, 15 Jul 2025 15:12:01 +0200 (CEST) From: Kristof Provost To: Mark Johnston Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4dd828c80828 - main - amd64: add kva_layout Date: Tue, 15 Jul 2025 15:11:59 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: References: <202507142203.56EM3lOw070595@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 15 Jul 2025, at 14:56, Mark Johnston wrote: > On Tue, Jul 15, 2025 at 10:52:35AM +0200, Kristof Provost wrote: >> On 15 Jul 2025, at 0:03, Konstantin Belousov wrote: >>> The branch main has been updated by kib: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D4dd828c80828637452a8a4= e07a64e294c82e5d8b >>> >>> commit 4dd828c80828637452a8a4e07a64e294c82e5d8b >>> Author: Konstantin Belousov >>> AuthorDate: 2025-06-15 21:39:10 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2025-07-14 22:03:28 +0000 >>> >>> amd64: add kva_layout >>> >>> Reviewed by: markj >>> Tested by: pho >>> Sponsored by: The FreeBSD Foundation >>> Differential revision: https://reviews.freebsd.org/D51085 >>> --- >> .. >>> diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.= h >>> index 0cd9bb4fa7a4..f12e5217a44b 100644 >>> --- a/sys/amd64/include/vmparam.h >>> +++ b/sys/amd64/include/vmparam.h >>> @@ -181,12 +181,9 @@ >>> * 0xffffffff80000000 KERNBASE >>> */ >>> >>> -#define VM_MIN_KERNEL_ADDRESS KV4ADDR(KPML4BASE, 0, 0, 0) >>> -#define VM_MAX_KERNEL_ADDRESS KV4ADDR(KPML4BASE + NKPML4E - 1, \ >>> - NPDPEPG-1, NPDEPG-1, NPTEPG-1) >>> - >>> -#define DMAP_MIN_ADDRESS KV4ADDR(DMPML4I, 0, 0, 0) >>> -#define DMAP_MAX_ADDRESS KV4ADDR(DMPML4I + NDMPML4E, 0, 0, 0) >>> +#define VM_MIN_KERNEL_ADDRESS_LA48 KV4ADDR(KPML4BASE, 0, 0, 0) >>> +#define VM_MIN_KERNEL_ADDRESS kva_layout.km_low >>> +#define VM_MAX_KERNEL_ADDRESS kva_layout.km_high >> >> The removal of DMAP_MIN_ADDRESS breaks the KASAN build. >> >> This seems to fix it for me, but I=E2=80=99m not familiar enough with = this code to be confident to commit it: >> >> diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c >> index 0edb631d1475..31204bad8c30 100644 >> --- a/sys/kern/subr_asan.c >> +++ b/sys/kern/subr_asan.c >> @@ -263,8 +263,8 @@ kasan_mark(const void *addr, size_t size, size_t = redzsize, uint8_t code) >> if (__predict_false(!kasan_enabled)) >> return; >> >> - if ((vm_offset_t)addr >=3D DMAP_MIN_ADDRESS && >> - (vm_offset_t)addr < DMAP_MAX_ADDRESS) >> + if ((vm_offset_t)addr >=3D kva_layout.dmap_low && >> + (vm_offset_t)addr < kva_layout.dmap_high) >> return; > > That restores the old behaviour, but it would break on arm64, which > doesn't have a kva_layout. > > I pushed a different patch as commit 1f683624df878b2e4c0187137640bf2e66= 62c36f. > That way is also consistent with how unhandled addresses are handled in= > KMSAN. That seems to work too, thanks! =E2=80=94 Kristof From nobody Tue Jul 15 15:19:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhNBc6Y1Pz62VTP; Tue, 15 Jul 2025 15:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhNBc5yb2z3VPZ; Tue, 15 Jul 2025 15:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752592744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fCUkeXLwKe/IYpbxGlvbem09HMPJ9uI1pS1geA8hQ7I=; b=j8cG8vylqYAUtm0WCi2Pmp5l8HUkNoue5R7Cke7VVhgzynTH05b5PmkFrYT8OUAm6uIvCi kcRvjOa3q/MyyoHsTG+OjkO6gtdaiVtFFxo4tgEGvAB9MQOcw+pDMSRm78itxwRDVSo+j4 uW81eYSnfNQfkzMMRtvS8xPSDj8paDgaaaKSCITHHmEc7jKoikyLi0ESf8mhxFHv61cuHO vs8A33C2ddtjHeFNtfAT2jlnIpc7uL5XSrabPO18qCfOHmuFfUzXYCtfbtUzlSanqkrNzP 9xkLAfHj7+sS0WAd4rSv/u+Q1aybyHYiR7pG9QX3YYSCvgGJjwfZ+ZBkUf1Yrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752592744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fCUkeXLwKe/IYpbxGlvbem09HMPJ9uI1pS1geA8hQ7I=; b=JWQny6r0cNPMiVdHWxFBDcGWGmOmJb56qlifpi0VAgjFcFeJ2wL18atEqAM5h1K83SWl5A qRsnhAjG786fDMB5P99lQE4YLQ+3sRFR0tr0a+rXX5rjKFOLSxwaGg5M8uqJuVGnj35RUT fHTtjXb4oVNd08x6A6lTQCmUhuBwgKOsJeMZpJd4QaYl8O5uotzraNMsfo/Az39+BwjNHy K7jDk6y95P6letdC5E68A5YF61CVzSDYZWbX0TvtXuwHo1WJ8eae7brYQjFJpj7iuYHjWi rjiE3iJT5BuA8czT7SpGwOaAlddbj9CX2uMFsvWkGa6zu2iJ2eCsCezP7NL7bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752592744; a=rsa-sha256; cv=none; b=KR+QNbEUt2odlbh//VDMotdNOy7fAwLzc5SAZGgtR/Vo7XmEpwyYyCJdamsSE4L4AOzjKL yp+kbc9Glxsz6Qjxdjomh1L4fA/2QwgVQOThzWFdxhAM1q0cBf/mEVISuIm3GzBFO0PYBI 4j1DGZx3Un6Ymawo80WoY45F/DUvEX40KvzBysqFlf548b74wNMkkU4TEd+O2O2RjYPBWB CZFtqdEmjsR0GCjmj8eCohlFXF6MyHKIGRGMDchukDhXSR23/iFDfz2PuHNXCGlPFdR1Ff EZKwWoQOvC7zy82VLxigVGrGuKx9G117u37/fc1N2G3urwA9Ni5yQ5+1SDQoUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhNBc5Px7zlBt; Tue, 15 Jul 2025 15:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FFJ4hn013947; Tue, 15 Jul 2025 15:19:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FFJ4FS013944; Tue, 15 Jul 2025 15:19:04 GMT (envelope-from git) Date: Tue, 15 Jul 2025 15:19:04 GMT Message-Id: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fad79db40505 - main - vm_pageout: Remove a volatile qualifier from some vm_domain members List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fad79db405052f3faad7184ea2c8bfe9f92a700d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fad79db405052f3faad7184ea2c8bfe9f92a700d commit fad79db405052f3faad7184ea2c8bfe9f92a700d Author: Mark Johnston AuthorDate: 2025-07-15 15:16:40 +0000 Commit: Mark Johnston CommitDate: 2025-07-15 15:16:40 +0000 vm_pageout: Remove a volatile qualifier from some vm_domain members These are always accessed using atomic(9) intrinsics, so do not need the qualifier. No functional change intended. Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51322 --- sys/vm/vm_pagequeue.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index cbbd27389662..9bd3b389fb60 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -260,9 +260,9 @@ struct vm_domain { u_int vmd_inactive_shortage; /* Per-thread shortage. */ blockcount_t vmd_inactive_running; /* Number of inactive threads. */ blockcount_t vmd_inactive_starting; /* Number of threads started. */ - volatile u_int vmd_addl_shortage; /* Shortage accumulator. */ - volatile u_int vmd_inactive_freed; /* Successful inactive frees. */ - volatile u_int vmd_inactive_us; /* Microseconds for above. */ + u_int vmd_addl_shortage; /* (a) Shortage accumulator. */ + u_int vmd_inactive_freed; /* (a) Successful inactive frees. */ + u_int vmd_inactive_us; /* (a) Microseconds for above. */ u_int vmd_inactive_pps; /* Exponential decay frees/second. */ int vmd_oom_seq; int vmd_last_active_scan; From nobody Tue Jul 15 15:19:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhNBf1cMgz62Vnr; Tue, 15 Jul 2025 15:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhNBd6mbxz3VVH; Tue, 15 Jul 2025 15:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752592746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HDHiBHQY4F5zlW/KcqOnu43sml3+xQPTyVPOOFeiCD8=; b=OZIyYEm8lBFCqQwemm/o6+oSTeuGFzRrdUUZWT85dsn/x3NECrqC4p2ky6Upuwd2J60ivt 80wXjouuCdGpHmZO99Xve0k2qvzeYVr5kjuBUtdzGqWZCoqobNjA0q65xSI1fIssymgkxl Dox+YcKM9QbwJqTuWhP3aMxFKd4s9y9xH0qXCxvluOE0Ebt1PDyy5NU9TLJrEV6zM9sjl2 KTyXnCNiVqahPuNyiN62fZUXe9LHyIQOkLbNdgHV+WQkr5UeMV7rqUktxVrTaFKK2hhHRt HIjw6QBCJclUy1+Hnk79e0i8Wa0F4zKr92h1YskRnrdfO0u5WoeaoZtZiwFmFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752592746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HDHiBHQY4F5zlW/KcqOnu43sml3+xQPTyVPOOFeiCD8=; b=YvtMocJbjHXbah5zCSwZXjIcWfT2mifZkxywYYGaBbfehvGUR9sV39rq6XkNsTmm4bDFJe K9K2G3WEEP0sWdI/NOB6KTC5agq4U0DR1xdCWT5sZ1tCRr0Rihi2savEVhUjkzUI1YEC4S ULWaMw/dhVJgG887i80stvQH+bxgLTnFM8gU/Y+KPfoxDieY+/fj7CRXGcWZ9bNBYcsyBj IgyIX8V1m3kI9tPvqxV7u2PhWcmRhLlI9fDAEj9RuZW6mOTHrJWybAWVNBUj9vJgLTVF+O xD43MT2tbs0xSYdIBmK1vbNKroliZHzGRJ7hINiJNnlRDAdpzzj2+inFztjYDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752592746; a=rsa-sha256; cv=none; b=L8HXFcBFej1MpXShTo/0SHUheT4udUsqXaS5yJqf3LsffuSh2LZn5rR65RFFdSkKinaNH4 yuwy0FOk4gHkSUq1lcK3vuckb6kElTcxHhtw8oaCfJpuRZ8nJWEz09StqsqCUXfFZnJb0D apkLELueOq5KP1fQCtEKsmZtJWskttLH6I5eboHGTZ3z9COaC+QTrglz/MZepw6NV1Hnl1 y0d12gutRjN7PyL15+A4gf/AuOjp3MOrRRBgMlgZDKLN28A0l7/P6X1xGrPqB40dGzh133 hpXOgnrntmWGzhL1vgAxsM/VthhKd++O1qOgXpKBNI7NZlvxB0JFLcsAZkPK4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhNBd6DYJzlWy; Tue, 15 Jul 2025 15:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FFJ50o013982; Tue, 15 Jul 2025 15:19:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FFJ5pN013979; Tue, 15 Jul 2025 15:19:05 GMT (envelope-from git) Date: Tue, 15 Jul 2025 15:19:05 GMT Message-Id: <202507151519.56FFJ5pN013979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5c76e9f45796 - main - swap_pager: Convert swap-space-full flags to bools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c76e9f4579677482b0f96d4b3581f5e1ea2e072 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5c76e9f4579677482b0f96d4b3581f5e1ea2e072 commit 5c76e9f4579677482b0f96d4b3581f5e1ea2e072 Author: Mark Johnston AuthorDate: 2025-07-15 15:16:57 +0000 Commit: Mark Johnston CommitDate: 2025-07-15 15:16:57 +0000 swap_pager: Convert swap-space-full flags to bools No functional change intended. Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51321 --- sys/vm/swap_pager.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 86b75a2d7989..d6bd06226d04 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -384,8 +384,8 @@ swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) #endif } -static int swap_pager_full = 2; /* swap space exhaustion (task killing) */ -static int swap_pager_almost_full = 1; /* swap space exhaustion (w/hysteresis)*/ +static bool swap_pager_full = true; /* swap space exhaustion (task killing) */ +static bool swap_pager_almost_full = true; /* swap space exhaustion (w/hysteresis) */ static struct mtx swbuf_mtx; /* to sync nsw_wcount_async */ static int nsw_wcount_async; /* limit async write buffers */ static int nsw_wcount_async_max;/* assigned maximum */ @@ -642,14 +642,14 @@ swp_sizecheck(void) { if (swap_pager_avail < nswap_lowat) { - if (swap_pager_almost_full == 0) { + if (!swap_pager_almost_full) { printf("swap_pager: out of swap space\n"); - swap_pager_almost_full = 1; + swap_pager_almost_full = true; } } else { - swap_pager_full = 0; + swap_pager_full = false; if (swap_pager_avail > nswap_hiwat) - swap_pager_almost_full = 0; + swap_pager_almost_full = false; } } @@ -958,11 +958,10 @@ swp_pager_getswapspace(int *io_npages) swp_sizecheck(); swdevhd = TAILQ_NEXT(sp, sw_list); } else { - if (swap_pager_full != 2) { + if (!swap_pager_full) { printf("swp_pager_getswapspace(%d): failed\n", *io_npages); - swap_pager_full = 2; - swap_pager_almost_full = 1; + swap_pager_full = swap_pager_almost_full = true; } swdevhd = NULL; } @@ -2863,10 +2862,8 @@ swapoff_one(struct swdevt *sp, struct ucred *cred, u_int flags) sp->sw_id = NULL; TAILQ_REMOVE(&swtailq, sp, sw_list); nswapdev--; - if (nswapdev == 0) { - swap_pager_full = 2; - swap_pager_almost_full = 1; - } + if (nswapdev == 0) + swap_pager_full = swap_pager_almost_full = true; if (swdevhd == sp) swdevhd = NULL; mtx_unlock(&sw_dev_mtx); From nobody Tue Jul 15 15:32:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhNVC75pKz62Wkj; Tue, 15 Jul 2025 15:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhNVC56bvz3b7V; Tue, 15 Jul 2025 15:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752593555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tcV8Pry+wl3xuurlxHV5TApkqjC2gEsUkqMm1eivxwM=; b=hRxqRYi9MxxgI0bW1nXyi1NbS1KxcVvXl5/nlttwKei2zn3pb+dqYdOfy4p1EEyi17gtlv HIA6CCqPe6NAF8EsuFoWZAeql1eD18YKPAW/3m6WP0plI7+xbHfa/uypGE7j95OXM0bRfO KNDy1LWM7KKqultnA0MGhxWQrW4bz5R4MvU0e8Pk9BCr20OIprhDfiJ6dMzVqAA54hF14X Gxm7hE1pnIOiCNAbvpz8mgCOw+wkSjgHGbwr/v9yKAO/m/01TSMKeGw3YFoar7/vXlOka8 KPh8ZtcswOiJ/2z7Eq9tG/kcmveXgO6JJBJCk+jR3lBLHUL4mONlMmhGMZmf/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752593555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tcV8Pry+wl3xuurlxHV5TApkqjC2gEsUkqMm1eivxwM=; b=IWdk7Bz/q90I3Ubmz6xa2vsNFL+s0PKdS8LYOdumhGf8/43c5NQJDj+FfdVMEpL3sODuln Oj3FFfcX/fuFSnSJSAr+7PCfQPONa67CTEN0nrjXGeGswR9egQLTVsrm3bqQd9noQlH7Zm dToy3arlAlIYBRJNVVWXPvmcnjLCBkfZ268IAg2rT2MtWIYcdjQvicMgFaWjugM7S5BqGh GS+1yLFjX0T1nhY88X/uXwFMWTotp2NPruEFwh6uVd6KLC5oZ5DOPcQEphBWHr5BPMtZxw p2yfkd1GiL1dEXCk9J9ndl2IIhPC4QdMiE9bYPj4+1n78kQklOKHc6qakBVQ9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752593555; a=rsa-sha256; cv=none; b=VoeIyyv3/+9/6HSKkgrqebixAJ8USOxfwpfEiLRsDxY0GGgXKK5/uEfYDiyat92PgtY+mh 94uJjpS+Q1b8FOeblGbX7AfQfglQ6m+OL1cd4AP8FOaeWZ1+qHIjGhKzwevFYhXkP3SZTp JtZ87+BnIOfwT7B+UFsguqGtHWirb8e8YOX0QXQvE1bv/MIcfC8hHu8Q8uPdtPTFITEla1 vyYfpwkb92NLSHs8k2eESB6nAUwhHABMvEiJVM+ZYKXsOJ3I0XQmPpRrQz+wM//V4oTilx ATB9/5M5K2XAE4pxl4csojmEDRkMgyh+mp2/idOTMTR35HwNPOVpUk1wKf5rRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhNVC4dQpzmKD; Tue, 15 Jul 2025 15:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FFWZKZ049070; Tue, 15 Jul 2025 15:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FFWZ4g049067; Tue, 15 Jul 2025 15:32:35 GMT (envelope-from git) Date: Tue, 15 Jul 2025 15:32:35 GMT Message-Id: <202507151532.56FFWZ4g049067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: db8296ff38cd - main - ethernet: Move the assertion of ether header sizes back into ethernet.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db8296ff38cd149a21ce363341d401afebd75a0f Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=db8296ff38cd149a21ce363341d401afebd75a0f commit db8296ff38cd149a21ce363341d401afebd75a0f Author: Zhenlei Huang AuthorDate: 2025-07-15 15:31:19 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-15 15:31:19 +0000 ethernet: Move the assertion of ether header sizes back into ethernet.h There're lots of consumers, Ethernet drivers, libraries and applications. It is more promising to assert the sizes in every compilation units rather than in if_ethersubr.c only. Those assertions were in the header file but were moved to if_ethersubr.c due to possible conflict of the implementation of CTASSERT [1]. Now that the default C standard is now gnu17 [2] [3] which supports _Static_assert natively, use _Static_assert instead of CTASSERT to avoid possible conflicts. While here, add an extra assertion for the size of struct ether_vlan_header. [1] d54d93ac7f0f Move CTASSERT of ether header sizes out of the header file and into ... [2] ca4eddea97c5 src: Use gnu17 as the default C standard for userland instead of gnu99 [3] 3a98d5701c7f sys: Use gnu17 as the default C standard for the kernel PR: 287761 (exp-run) Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D50947 --- sys/net/ethernet.h | 6 ++++++ sys/net/if_ethersubr.c | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index cf4f75bd0b6c..01485cf26e06 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -62,6 +62,8 @@ struct ether_header { u_char ether_shost[ETHER_ADDR_LEN]; u_short ether_type; } __packed; +_Static_assert(sizeof(struct ether_header) == ETHER_HDR_LEN, + "size of struct ether_header is wrong"); /* * Structure of a 48-bit Ethernet address. @@ -69,6 +71,8 @@ struct ether_header { struct ether_addr { u_char octet[ETHER_ADDR_LEN]; } __packed; +_Static_assert(sizeof(struct ether_addr) == ETHER_ADDR_LEN, + "size of struct ether_addr is wrong"); #define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ #define ETHER_IS_IPV6_MULTICAST(addr) \ @@ -112,6 +116,8 @@ struct ether_vlan_header { uint16_t evl_tag; uint16_t evl_proto; } __packed; +_Static_assert(sizeof(struct ether_vlan_header) == ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN, + "size of struct ether_vlan_header is wrong"); #define EVL_VLID_MASK 0x0FFF #define EVL_PRI_MASK 0xE000 diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 7be4dfac23e7..3ae0c01c0efc 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -92,11 +92,6 @@ #include -#ifdef CTASSERT -CTASSERT(sizeof (struct ether_header) == ETHER_ADDR_LEN * 2 + 2); -CTASSERT(sizeof (struct ether_addr) == ETHER_ADDR_LEN); -#endif - VNET_DEFINE(pfil_head_t, link_pfil_head); /* Packet filter hooks */ /* netgraph node hooks for ng_ether(4) */ From nobody Tue Jul 15 16:35:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhPtK2Pn8z62ZSX; Tue, 15 Jul 2025 16:35:05 +0000 (UTC) (envelope-from glebius@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhPtK1qg8z41Ll; Tue, 15 Jul 2025 16:35:05 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752597305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TGsrqO7vMGJQjpyf38kAzTyNoIzOlcI5XUqP5LoAdI4=; b=RIYreSP8hZ53+vLHCG15rvZYXk1qLOvrp7TcaXO7x2ahWLv0XTNvBncnLhyTa48WzQBQkB JyIzQIYFMO8pjdqIQ8+nNmd3JpCa6Pkiu3IgkY0t1gEN30143RavRPxUga1dKUPCeJltmC /oTAceUVvw3HlAxaKCbGmWgZ4jiQ2K10qWHeMc2nMQlKygM70Yhq9YSsrq2qt2G/zAlYFL QraQ6ESNz/4DAWGnUFnDt0gOCRciGlCbNren1bMqACsaQGHzNG/Sh6r6rGtlADaI04m5BI FWlMHiYmW4x5nrGs21VLRYx29Y+6pA4na9hoW3pR3qkfynsS6cgn9NZbADyqBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752597305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TGsrqO7vMGJQjpyf38kAzTyNoIzOlcI5XUqP5LoAdI4=; b=sk2GEVBR6m0wY/AVcP8CYcNxf2FN3A89JAgEtJPBvN+SaL11fy9Xn/EgbtF1/5kbHpdyh+ otYb0AjtHgaAZerPyB55vn986pL3Tq9dN1sY3U5oNMzYroqcTEZexkqeYe+Z9u0r/cj2Fv 99z6adLpurmsv8JrGzNxQfOCZtllwRcdRcNAuHdtGN37/V5Q79IC0fIyz6dhpWODV+CMYQ UkWiqjhr4hM9I1TW98EKATXQkW/7My+5ACwzX8ryvGNQWJSsAL0hTj8jHRrObPEtIzWywG hAOrpjKsuLffMjjkdzTNdcjXaQgoiGgqxDD9egzIc+YNoDVRMQvyGoqcuzablw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752597305; a=rsa-sha256; cv=none; b=Ls23BDkwOFgYZ7+uOPiHomvtWX+faKYXBxITk4BR+RXCeVEkJFrlKxZ1+/qH9uWa/WeRFo HnRLIuGdJtaSl4PAVz7/iVDObXv8jex7qbMogz6N17Oti1J2dNOOtyPDCeLucaQB5xg8hR RNf/Dc644HjVJcbIiLtW9xRyQbff84TS6xoSeeaJPgu2NYgb3k0FoIW1nCp3qaVMIquoY4 rRr14p43ILUyMBjr/EuQjv4k8iqZrKTSt6bHCPGY1E0Wqv/Q/FuhrWbqu3DlXgyW4ThoBH qjdB94UDjZVSOtkugtexad8Vbp5sS8uTzc9n6fB/1V5zBFLllyU+3hE5G2+tCg== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bhPtJ473YzHlB; Tue, 15 Jul 2025 16:35:04 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 15 Jul 2025 09:35:02 -0700 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7b0b4fca080e - main - pfctl: getifaddrs() can return entries where ifa_addr is NULL Message-ID: References: <202507151007.56FA7ug5027985@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507151007.56FA7ug5027985@gitrepo.freebsd.org> On Tue, Jul 15, 2025 at 10:07:56AM +0000, Kristof Provost wrote: K> commit 7b0b4fca080e818e5cf2559453345b6057d33064 K> Author: Kristof Provost K> AuthorDate: 2025-07-08 09:48:52 +0000 K> Commit: Kristof Provost K> CommitDate: 2025-07-15 07:55:30 +0000 K> K> pfctl: getifaddrs() can return entries where ifa_addr is NULL Is this true on FreeBSD? The libc code sets what the route socket returns and the latter always copies out kernel's ifa->ifa_addr into info.rti_info[RTAX_IFA]. Can we have a in kernel a struct ifaddr with NULL ifa_addr? -- Gleb Smirnoff From nobody Tue Jul 15 16:40:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhQ0P34Qjz62ZMS; Tue, 15 Jul 2025 16:40:21 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhQ0P1Q31z44V8; Tue, 15 Jul 2025 16:40:21 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752597621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9b909/FG0c/6//YI34T8ZqupsD6hqr5bH2wxiChU5hc=; b=Ai14vX2yOE5hGf1XY2KGOWAOlUrCmUL7InATcDoXqr61NWvIdnGt5aSFlIiLCj/PpX4Dix VSK9F+8KIiX6FfWebxdWbvUyF3X/xa23PfP32AO3xriY0jB4DTCpCvXa0qBFJa6Q1hHro0 Jsgs388Vws3xXn7Z0/9gz36sCv3zDRWiKQrxZaxpHp8UKNpRnHEfykFFEj76S/7KSNcscJ YslwzdCWS9Mi0N6pSk4h1j+X8eiz9aRQmzjQgAkiel4w9z6BXRCme9IXURIUb8/yp6BQrL ujhLiW+7LzexqeLeWmVgU4fjm3GIfQcOv+CqBVG8zcA6sf/g06oNNWxFB7vQrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752597621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9b909/FG0c/6//YI34T8ZqupsD6hqr5bH2wxiChU5hc=; b=tX44q75muODsNYMWgXrEVUvToqSsGl6xSt/u4BW8DWzL1bUbi3cDTshKOYkRkWa26Ey2JK p6pa58dGD+uzHlesmL6QPVQPPxEI06IGgKyl87gs91qAoJToVQzm+5BTRm8Em3Cm0co+wQ 9ZClcwTQlzCeOW3xnH8HOeDRwEQ5ctvUHcP97zDkmWYLlLdyN3Wshj3vKwt08nCoyxBssL Am/awuuDSXth49T5mxhTS4nbyutcXIDIatcrR7TWphD69X9jo+F9DmvJEF6jiA2X9nr6ud khsJ0H/Iu0tl4HkYuIP99KdWmt5ew8xFLDhmMRKSkPf5YasUjxGv/NpIzCwtoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752597621; a=rsa-sha256; cv=none; b=GvNRvsNh5HYZIy+DZWVdzDcSrheHXcnDNAOigKKq4vOs5RSOjkvmQDgkbzzSJEwFTNg7Dm H4bDSKlE+WvArfxS3xpH6Eo+TrXNlXsPPoUbPWyVW+P/gMkGDsCseS5NamyoIpOV+/AADy RDPRkrfN72FI8MhPuYuTUuGewbUTUGi46LXczoJ52r6v+dOZlwHqSBUXtqLbyo8cMuI6JR Cd06YFt61QZrK1gHVjSO3UNzEn91qwEZ+d1KuxmJZy87UUUOiXuzoofRbU+xWDIUolObrO xLQoOmhxdPTTPAiQ2tmgGSmnFTmYd7U6fr7KO7ib7LRnvGuEHYlzZRSOvLaqGg== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bhQ0N27P4zHC7; Tue, 15 Jul 2025 16:40:20 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 15 Jul 2025 09:40:18 -0700 From: Gleb Smirnoff To: Mark Johnston , alc@freebsd.org, kib@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fad79db40505 - main - vm_pageout: Remove a volatile qualifier from some vm_domain members Message-ID: References: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> On Tue, Jul 15, 2025 at 03:19:04PM +0000, Mark Johnston wrote: M> The branch main has been updated by markj: M> M> URL: https://cgit.FreeBSD.org/src/commit/?id=fad79db405052f3faad7184ea2c8bfe9f92a700d M> M> commit fad79db405052f3faad7184ea2c8bfe9f92a700d M> Author: Mark Johnston M> AuthorDate: 2025-07-15 15:16:40 +0000 M> Commit: Mark Johnston M> CommitDate: 2025-07-15 15:16:40 +0000 M> M> vm_pageout: Remove a volatile qualifier from some vm_domain members M> M> These are always accessed using atomic(9) intrinsics, so do not need the M> qualifier. No functional change intended. M> M> Reviewed by: alc, kib M> MFC after: 2 weeks M> Sponsored by: Modirum MDPay M> Sponsored by: Klara, Inc. M> Differential Revision: https://reviews.freebsd.org/D51322 What's the benefit of removing the qualifiers? They act as documentation and they match atomic(9) prototypes. To me this looks like removing a const qualifier with a reasoning that we use the variable only as an argument to functions that have const qualifier. -- Gleb Smirnoff From nobody Tue Jul 15 16:59:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhQQB3xmWz62bvY; Tue, 15 Jul 2025 16:59:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhQQ95SKTz3Dwj; Tue, 15 Jul 2025 16:59:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752598753; 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=H+6N+D+mnalBcUzl/IeULSsMV1GGSgpU9sFx75KOH6Q=; b=Xraijw/RiRaNuTc0WthjYtIYouqBFPVgFHcwQKvEwvCnhsW2XY8XLMdzOby7uiDnKtH1PG AWRlBlKtvuXwfdfe24bh5tB2ehLfl1ZDMAaZQs/jWikbgDMaFS3eghzyk6u751KxMNkBvB 279Ye6ZQugQdL5ZP/4elsSyjsMVmHtcROqhMZtWOcMuT7Qg6UwD/hJw8rGuU6lohXMosY9 alZnYAUTtkhULwlGbujpqNyEc75U4StEze+O0O1PDz5koR4GNlqNXUoID6olFk7kmQSe4s 5WhFVPUbMNYK76rSSyrchUcLbnr5s90+B+sW10uVn8AAIgJU3RN1vnvI62Dkfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752598753; 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=H+6N+D+mnalBcUzl/IeULSsMV1GGSgpU9sFx75KOH6Q=; b=ooSjUpLueBA0RZuV8GgvSHrByqjjMazk7orZBg+W834oREHtOvSA1wTXsbmC/WFKQixSgt ZAddvkOTMX5/oQLRXM9/tSiRcwRbpNICGdUH7z54oEr+6r91HwkXcZHHCzxJeeuh6bVy3H iUAyWh8c6gmlhx8wtsXBc23yVU55f6kqxslz4B+ZDUPaU9JQeJ5OIx2zNjxnfgmELcd3Yy J4TL3pHi52fzkrl3ih4cKNxryy8F08BZslgSL9K2wxTQ9mHGKsZa6kaa/E82seadlXzJuI v9RUE3to3YGai3NHzwsewMsf2+uO8TdxL4Snxhv4FrZRdk6361dxuYlakCR4pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752598753; a=rsa-sha256; cv=none; b=h91Wg0ySASdT+dfUPg00GXOpTj5uRzYhga9mO2XV5X7ty427UiE1haJvXZ87QAYnLHsYIR nG76AUCDVrQF+Z7mkyEpfy9rTfazwoAo5ScZ4Yw03sWIAc1lclku9rqZs6j5m6AkYZWYoQ jgn6a2LxDCA+efY59yPzYELGOszQDgQO85rCNFxK3UmmgajqOqGcXRnfc8P/O3xeV+GSxu /KwfEdI2GC+kTJheno0Yej+L8knQJ2CHlskFDc4Otg8cHndv8pCTq3Kxnu5RqBHvyDzAo/ X+gZaMmLhcd6wnfxtsgwhhqxztkfqsrpu87PjKjEV6NHLIjZiL1E6YNT4cnBJw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher 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 "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bhQQ946sbzHDh; Tue, 15 Jul 2025 16:59:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 4BCB952B49; Tue, 15 Jul 2025 18:59:11 +0200 (CEST) From: Kristof Provost To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7b0b4fca080e - main - pfctl: getifaddrs() can return entries where ifa_addr is NULL Date: Tue, 15 Jul 2025 18:59:10 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: References: <202507151007.56FA7ug5027985@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; markup=markdown Content-Transfer-Encoding: 8bit On 15 Jul 2025, at 18:35, Gleb Smirnoff wrote: > On Tue, Jul 15, 2025 at 10:07:56AM +0000, Kristof Provost wrote: > K> commit 7b0b4fca080e818e5cf2559453345b6057d33064 > K> Author: Kristof Provost > K> AuthorDate: 2025-07-08 09:48:52 +0000 > K> Commit: Kristof Provost > K> CommitDate: 2025-07-15 07:55:30 +0000 > K> > K> pfctl: getifaddrs() can return entries where ifa_addr is NULL > > Is this true on FreeBSD? The libc code sets what the route socket > returns and the latter always copies out kernel's ifa->ifa_addr > into info.rti_info[RTAX_IFA]. Can we have a in kernel a > struct ifaddr with NULL ifa_addr? > Probably not, but I wanted this for diff reduction anyway. — Kristof From nobody Tue Jul 15 17:24:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhQzb1VXSz62ctr; Tue, 15 Jul 2025 17:24:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhQzZ4dgpz3RFF; Tue, 15 Jul 2025 17:24:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4ab71ac933eso17340461cf.2; Tue, 15 Jul 2025 10:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752600280; x=1753205080; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=o9bZGFJAVY/et5DW9cS/t5hz9Nl+J5OzyJ1AbpaVmGE=; b=Fbdv/5nWrPJvZirXxncRoYEmv2GghkfNuewp4M38q37BG9BOvuK8Np2WdptVLU/nUk DfvUMCOtMgFWAlT4WFKrOZOHRk05xb1e0nzCqV79eLh/NuL4p44mCFCmh2fMESP4KF2P o1HzJDIGi3KIx3KxLpax/KKFyug7StP0itCH8/s+f0/DxHWiYt8wzZgvKisGUbYkyrSV n4HTfcksc19n6p6bll47loNxJguFZRkeA1TuEzasMxm49wcZiX9yiY08QdIPlqn/ycWq Nl/NHqZLPwb2QIAeZ/2knBYCBgisnJtR6XXErB3Dn6h2rjnyEZJAZkYWjgDnZCzxxzoA 86bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752600280; x=1753205080; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o9bZGFJAVY/et5DW9cS/t5hz9Nl+J5OzyJ1AbpaVmGE=; b=M+jDXkBT8iYA6c9bl/4ZNE7myHfj5g060ZIozoEaJWQeqkdorZbIbHQob37Nh+upRI eBUXpNFqGwBMvmXtZrKX6jXJRhHgrd3h6SacSFo2LzmCMWBy3ckDUdT9xcEO+nHcj8j6 QcKNQjG/G6LUIuIPJdsH5V4BboMLa465kkW73xysEkeSIDpo/Kc9ax9VAjVQEobsD09M c4hr3k7wGtY/mGH48pBrJGNEXBJDBQ44A/e6DyJLFnMcbn0OSR+B8TtScsAo1apZBhLg cehVgrZKRJj8fAY082/LmYED/7U1MLasH+xMWzVZSgEwvkKKeAb2eI9XBo5In2AtwNzo aHgQ== X-Forwarded-Encrypted: i=1; AJvYcCUyMYxJQLGaGI5L6G0RvyvHp5DRdh6r6buHNYVZc7Fn17+gJAQ06fi9RI4h9NGeBk7GFMiZ7FaT+Pa1RQ6Dsn8=@freebsd.org, AJvYcCV7aFeRFFK2EBLK5vwuITZJTxlgBcEcj5V6aOiRxjrYwxfAexNeT3QLnrBk+tv6VzyiprN+Xo1oMFSFv4Wa4BZCiNNv@freebsd.org, AJvYcCVcLpWTdJu83nOzV9OugpHEwQfrW6jUBYZvGS/keoZTObVgAQYnDlqRuwUEPiAO0sfvUYJE@freebsd.org, AJvYcCXf6uNyYmDndlObR8ik8M1/HWmmyPPulf4fxv0FPcOhyCpBDKzJMzXo6y2Cw0q6OCpMAfvCwMhXq3pew1EPpOoLP+xkaRE=@freebsd.org X-Gm-Message-State: AOJu0YyMRtxfc1WiaTFBO8hnNDC2D3fmZEhy2QWpyurrFP2TL2fSf93N NjJEgDaccuwuW5Pbdrxbupvd0pyZsreJbwikq542TIyS8AB+e1dBMsNz90xllEIA8Tc= X-Gm-Gg: ASbGncuLymdvkEHJt4Ex9d7SgM9hx9mW8JnpXWW5mtmnNCEID+zMTRCgg4BpQjQSW5L j4nvptZLkj4jgc8x7eYugZDn99186CCztSuq5cP8rrS+TkDHjSaxlNxGt79ztMiGE9jVbr5gFG2 Bkc32/aFbeC+r4CYvpq4YtGpkFoZ53wQN8+BOUPAmHEgsskCq7Eqz2xA5FIVKDZv2K3T37+fN2/ WXkpARhTU/phGJWYiePkufY4d59d1oyNN+4rGt107WcY5EQqnIeVtirhzJ0RJt2eWxtWHubfbWB NIsjtPsj8aYe33elAkRJ/ampW+6abhTkCWaLzHVJ+rH9jlWj2rdc53RAW9Xy2l3ZW1+g0Sg7fNk kNk4KpnE5lpnUFoIWORiiktHDCJCo+yGtnzMLppsZ5Ql9wOY= X-Google-Smtp-Source: AGHT+IEuqWQnvJOKNvZ/kYU6KwFB3FJL57qlwZcXb246TC4EKyqp62H3OgD0UCiQ9Ri9RvspwdFriA== X-Received: by 2002:ac8:7e82:0:b0:4a9:a3ff:2830 with SMTP id d75a77b69052e-4ab90ccabb8mr4212001cf.42.1752600280294; Tue, 15 Jul 2025 10:24:40 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ab6de94c3esm22041021cf.36.2025.07.15.10.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jul 2025 10:24:39 -0700 (PDT) Date: Tue, 15 Jul 2025 13:24:36 -0400 From: Mark Johnston To: Gleb Smirnoff Cc: alc@freebsd.org, kib@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fad79db40505 - main - vm_pageout: Remove a volatile qualifier from some vm_domain members Message-ID: References: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bhQzZ4dgpz3RFF X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 15, 2025 at 09:40:18AM -0700, Gleb Smirnoff wrote: > On Tue, Jul 15, 2025 at 03:19:04PM +0000, Mark Johnston wrote: > M> The branch main has been updated by markj: > M> > M> URL: https://cgit.FreeBSD.org/src/commit/?id=fad79db405052f3faad7184ea2c8bfe9f92a700d > M> > M> commit fad79db405052f3faad7184ea2c8bfe9f92a700d > M> Author: Mark Johnston > M> AuthorDate: 2025-07-15 15:16:40 +0000 > M> Commit: Mark Johnston > M> CommitDate: 2025-07-15 15:16:40 +0000 > M> > M> vm_pageout: Remove a volatile qualifier from some vm_domain members > M> > M> These are always accessed using atomic(9) intrinsics, so do not need the > M> qualifier. No functional change intended. > M> > M> Reviewed by: alc, kib > M> MFC after: 2 weeks > M> Sponsored by: Modirum MDPay > M> Sponsored by: Klara, Inc. > M> Differential Revision: https://reviews.freebsd.org/D51322 > > What's the benefit of removing the qualifiers? They act as documentation > and they match atomic(9) prototypes. To me this looks like removing a > const qualifier with a reasoning that we use the variable only as an > argument to functions that have const qualifier. Note that I updated the comments as well to indicate that accesses to the fields should be done through atomic(9), so the documentation is preserved. The reason atomic(9) prototypes include the volatile qualifier is to permit their use with volatile-qualified variables without a cast, not because the interface expects only volatile-qualified parameters. More generally, I believe that new code should always avoid using volatile to provide any kind of synchronization, ignoring the case of accesses to memory mapped with non-default attributes. atomic(9) intrinsics should be used where they are needed, and some comments should explain the synchronization protocol if it's not obvious. From nobody Tue Jul 15 18:05:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhRtb2y1lz62fwt; Tue, 15 Jul 2025 18:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhRtb2NLtz3p9L; Tue, 15 Jul 2025 18:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752602727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ZOl6cLFNd/1QdYu+uvoLZx0dCFoubk0cCMObU34JGc=; b=daET6qHuvfIWzgET5tuKFNIwKgCRQZPgbhnO8SZcdTHe7ZhVQyTyjQEqWuEOFh38/lbhIQ /zSreEwOI2yKd4L6G4AxMdSVMTAAuOk4nEK+34xo/0UGLJpjS6gdGI87pQjSUqes4E69z2 CNaMQIR51YbsdtXajQuNcueqsRyxYj9CeyCjsfDKB17EuItd6VnVKEg8J+LoaWcx+BQZrS 6LSyZxPlVs+CwUoRq+t6rqqzeBTQRqfZEa6LJ8gA5yBAbPTMBZ6Ne0vjyf/eY27g+KpSI4 XT7qtq8CqMihElhjKg/oVeeyEnp2i8lzbrWsshjeFUgnz2BuDJdAIsAoGhpfeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752602727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ZOl6cLFNd/1QdYu+uvoLZx0dCFoubk0cCMObU34JGc=; b=u4ZhkjZxxivi/xw6I/KYYW27mwBkwUlq8adWH9UjsWU0S5tNrgvln+BTUnnSbNo86mdAaS 7pQcvLnZrqIQV56rsNVN1dZErRBxycSwcN8VhS4FghjtFCQOw0vorA67NrvJfNjBjmhhO5 PTx+lXwPGThQXS8RxfxJxEfb/mawSpQB34Xx5lWZ6mPTVsX3Y4kfsVE/P9euWNGG8YDXW0 eLxjTzuRM6u/i7NjJPK5MuUi/c80KEVcfCRhBHZHMVXoKF3FP8g8P3klYA5BDT+Mbg4Xya zqvgaYnZdmzfjIPM6hljGITOeGbb4oa0ARaJk3G/ts4pDLAxXaookhXt9g5wNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752602727; a=rsa-sha256; cv=none; b=En0MV43l2N97D8SbCdCAtLvr34LcQofhJelzbTndAeGAUwgg1IZCDEqt91nGcYhArnW4x4 rC3m43LJL09mLO3iUh9D3+OCW9wiTBsilWcbIqqqceDOcn0m1ulWp6GtH4DlPnrFvViU4y EeofCbK2j4SQccJVFSzX7bNgy+3npR4VIykyb7Vnx86JnJCqlQFRXe8MgVF5260oZ4qPw+ gvnBNLeKF1kxMX5LRlUzRfSe2EHelp+vNmVALGRdcI0rFvET+cfE2SSC7/Hnjy66wnwkNI xzEAlV3tG0T5q4o65zQwGQAV1BvrzQjXcYMYrXSoyIk5TosWOMCwAUqX73XpEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhRtb1VG3zrFV; Tue, 15 Jul 2025 18:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FI5RSk032138; Tue, 15 Jul 2025 18:05:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FI5RbN032135; Tue, 15 Jul 2025 18:05:27 GMT (envelope-from git) Date: Tue, 15 Jul 2025 18:05:27 GMT Message-Id: <202507151805.56FI5RbN032135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5a1e2927d63e - main - bsdinstall: wlanconfig: properly format regdomain dialog input List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a1e2927d63ed6394b767088eb2d66676f275467 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5a1e2927d63ed6394b767088eb2d66676f275467 commit 5a1e2927d63ed6394b767088eb2d66676f275467 Author: Bjoern A. Zeeb AuthorDate: 2025-07-14 18:32:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-15 17:53:21 +0000 bsdinstall: wlanconfig: properly format regdomain dialog input Without the extra '\n' the dual-column ('REGD' '') are not properly separated for dialog which leads to an [misleading] error hidden on the command line: Error: --menu bad arguments items number. [Writing this I wonder why the dual-column input is needed]. It is still unclear as to where the error message quoted in PR287538 suddenly came from for 14.3-RELEASE given the code was broken since 2016 (or noone ever noticed or reported). Looking at manual ifconfig output: ifconfig wlan0 country GB regdomain Expected -> ifconfig: unknown regdomain Expected and "ifconfig: " gets stripped by the script, which means the regdomain variable would have to be set to "Expected" or more likely to "Expected eval: Use: not found" which looks like a concatination of errors. Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: 95ee591e83a91 PR: 287538 Reviewed by: emaste, thj Differential Revision: https://reviews.freebsd.org/D51313 --- usr.sbin/bsdinstall/scripts/wlanconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig index 8ac64858eaba..99550ce3938d 100755 --- a/usr.sbin/bsdinstall/scripts/wlanconfig +++ b/usr.sbin/bsdinstall/scripts/wlanconfig @@ -92,7 +92,7 @@ dialog_country_select() sub(/.*domains:/, ""), /[^[:alnum:][[:space:]]/ { n = split($0, domains) for (i = 1; i <= n; i++) - printf "'\''%s'\'' '\'\''", domains[i] + printf "'\''%s'\'' '\'\''\n", domains[i] } ' | sort ) countries=$( echo "$input" | awk ' From nobody Tue Jul 15 18:42:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhSjH3Q6bz62hfM; Tue, 15 Jul 2025 18:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhSjF4Wrkz3FqR; Tue, 15 Jul 2025 18:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752604945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R0B+lgs0jc6E+5zKBPoobmHWKVll5EIiqTNjgWjFBe8=; b=p04b7DP7PNnQgs7bb3uZdaKd1dVlONK+QXm8NxL18ZBkw8WRKMTQQtQktI6hRW9HtDQIUD 6tifGV7azzVjOuVb+aJl/MFp4MgB1mZasVYvxOnV/1yNUT2szyNFe6aqmtmb5n88zn1J3G n4w6wTNty8bK6+K9Mj8fcz0ex65rbmaTgXoAcyQe1mo/upm1uP5VdovjugHb/X7CsCu6H5 TdiIakCIKAaI4CVjFu3oSC7oNrYgEq+fKFr57wMzvZYMlBYbVJVC3SrPy16JOrCFr8cil6 8dyBhvLqJGa+DXnfxcp2CUr4wztFqIm26St835CpKI/AmZvGV3Z4gz+3BmWIug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752604945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R0B+lgs0jc6E+5zKBPoobmHWKVll5EIiqTNjgWjFBe8=; b=mkEP9rln8Kd/np8dRNIIwuk4yHykDTnRDeOD0RDp9VrPOzBDqoeVHDpvJylf7hxtYgsYxO /1azyMmDaIxRz3fMd/DBx3Kwo8h9q9aXAP73oFsv1EoieXSAUOaZhoB3yzEatV4kbnndDy MWc9abfcHWN8Wya3sekhllPfUH0CVpQwnfb61Y9dIZJFrSKH/fkDNGr9dOxnsgMxcGjjCU smG5OpuPRlSooUjpGQlMxTSQ1lQyE26g+xIt3yRyppOUn5Cn5uvIukY7mLeQ45E5QQALBr 4sqOR0dAlRzZujNj3WPz8/zrcCSfylAm/hgXZP9sp35K79TPc0y7euT/bKWSZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752604945; a=rsa-sha256; cv=none; b=TCpmJLlpkipLVjbfPbh67VBZul6aJ2RbTrNWJDpN+NarG/5VNbGTulz3xmpsOJF4dqImDh M0HBYRPg77F7Wyd9MZarhN9zdYN3Qqy/ohcy7nZ1pc8LR2XptSAuhOwyv6yB2r1nbXiD2M uDD0eg67VafWLonluX92Xz32bNnkwQ9ATDSVWnH8OItdorM6f9v2jnuIiKmaASLID48srF kICjl6b2FoXrA/L+a2IjffXGMf/JVztDVJIPX7M/9elou7h11pxGYrwMGMBw0xFbdDmSfr jRlgFcIge+MfV1dkmSdfLW9KI6Wzsg1DPziTaNLMyoi4wqhYMdikm1WJVnuoDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhSjF476pzrqT; Tue, 15 Jul 2025 18:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FIgP17006863; Tue, 15 Jul 2025 18:42:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FIgPHm006860; Tue, 15 Jul 2025 18:42:25 GMT (envelope-from git) Date: Tue, 15 Jul 2025 18:42:25 GMT Message-Id: <202507151842.56FIgPHm006860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 153e73d782f3 - main - bsdinstall: wlanconfig: ensure the interface is always up for scanning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 153e73d782f3f1b06c502a708a3b30236ab332bd Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=153e73d782f3f1b06c502a708a3b30236ab332bd commit 153e73d782f3f1b06c502a708a3b30236ab332bd Author: Bjoern A. Zeeb AuthorDate: 2025-07-14 18:32:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-15 18:41:05 +0000 bsdinstall: wlanconfig: ensure the interface is always up for scanning Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: thj (earlier), emaste Differential Revision: https://reviews.freebsd.org/D51312 --- usr.sbin/bsdinstall/scripts/wlanconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig index 99550ce3938d..33d94a933f45 100755 --- a/usr.sbin/bsdinstall/scripts/wlanconfig +++ b/usr.sbin/bsdinstall/scripts/wlanconfig @@ -200,6 +200,12 @@ fi while :; do SCANSSID=0 + # While wpa_supplicant may IFF_UP the interface, we do not want to rely + # in this. In case the script is run manually (outside the installer, + # e.g., for testing) wpa_supplicant may be running and the wlanN + # interface may be down (especially if dialog_country_select is not + # run successfully either) and scanning will not work. + f_eval_catch -d wlanconfig ifconfig "ifconfig $WLAN_IFACE up" f_eval_catch -d wlanconfig wpa_cli "wpa_cli scan" f_dialog_title "Scanning" f_dialog_pause "Waiting 5 seconds to scan for wireless networks..." 5 || From nobody Tue Jul 15 19:19:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhTXX4P8Vz62kqZ; Tue, 15 Jul 2025 19:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhTXX2qTwz3cHr; Tue, 15 Jul 2025 19:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752607196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/wEFkER8KhKa9xwXUNSjXAHpcgdH3pT/89ob1niMWk=; b=PTv/4lT1kN/prqXrcluHy5QfDXs1n6/RUuxotXbCmnoYsqqwKqrK1E0QOIsi960coXovDW 2CkKe/rICHbLElP2ClcJlHxle2zlpDuE9bO+dgTzmQyOAs4Uze67dg9ljYZYgS2XIGBQQc fjSi/VeVMd1CZQjfsuaKHLrM7UbqBSO8vR3BjeaV0jxjs5sTHFlrsY9u7LKTSUTbzm9hfO bM7rkqvMEM3zDbwBe6zKP+nHWYuEjsvR5U9x8RiJDwzPHY8BAp2+K+j4QgAfIumcmbcOXA +lZfZNA69pPb3UxEbhPDKEFROjwpw3YqwUJkcRqX4u+nrN1gI5sxze54bvGrvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752607196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/wEFkER8KhKa9xwXUNSjXAHpcgdH3pT/89ob1niMWk=; b=MlJa1vG3PKCO3Xgc/taJ/FmCYgI/BneW8eIQ+1i3MgbZmKyeqMwOgEjWBGWB23Wj8StPwk +/5rwGidRWpQURYbF41v8UVD6eUSiB9H6xQA5B3TazDqtM/gmPnNhWZAb1h1Mdw73VQ00c 9Fz3uJOwEjSoFjCsJCsbMcbzJg4h7ysvoH0wbip+O+G8W+gICzx4nZSUjdDpI9K42vJ7vy ixZ80frND+xnEPQRpEpyGpZwS7wutPT5lWmcrpcQJ/TLP2wZdD26B8ruIbXkclOMv6SZWd rP3EcwYVSpB6+C044F+ZFgkJpdESe5T0TD5cOn0v9i4lRmaLxw8DbbdRC/6WQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752607196; a=rsa-sha256; cv=none; b=e3d1VEns/hN8BpggYjFjnyaVsctMzthwNccC/3QGR05ezU2+y1STlFuf/VagyG9aO/evZ9 71umYoPUi/UGajGw0nwD2SRHCrn3MC+o+C97D1kYEG671dB2UDosa89S65FnOI62wajxqU u/5VB3BPGblwNOlvRQswiyqmH20zh1Q/xarj6uOimdVYrWR6oCDZBHSGE1tL0AmK+FPDuk 8IqlEWqhcPNPTATqzNgAr4oC2nMLXyRfTCyXz2wS9j+Ikjs5QcAEsANrFosgnKiLQFF1D9 ajEvmB2DKDjA5rpbrqP1qMrHT2/jKGDfkwWYA2qH2ZfmfTk0TcMRN5RrhtiE9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhTXX2LMBzs3g; Tue, 15 Jul 2025 19:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FJJuOw065633; Tue, 15 Jul 2025 19:19:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FJJuOv065630; Tue, 15 Jul 2025 19:19:56 GMT (envelope-from git) Date: Tue, 15 Jul 2025 19:19:56 GMT Message-Id: <202507151919.56FJJuOv065630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 221453e31c80 - main - arch.7: Bump Dd List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 221453e31c801e0635d09205b218ccf4053232fd Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=221453e31c801e0635d09205b218ccf4053232fd commit 221453e31c801e0635d09205b218ccf4053232fd Author: John Baldwin AuthorDate: 2025-07-15 19:19:25 +0000 Commit: John Baldwin CommitDate: 2025-07-15 19:19:25 +0000 arch.7: Bump Dd Fixes: 072f54bf9ff3 ("arch.7: Move i386, powerpc, and powerpcspe to the discontinued arch list") --- share/man/man7/arch.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 918f9058c7aa..fe4e8055a8b1 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 12, 2025 +.Dd July 14, 2025 .Dt ARCH 7 .Os .Sh NAME From nobody Tue Jul 15 19:20:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhTXv304Yz62kHk; Tue, 15 Jul 2025 19:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhTXt6bPkz3ck0; Tue, 15 Jul 2025 19:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752607214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rfWDfqqwvejeHwPoUgINEG8/LGrKvDv4Lu/brSU1W+s=; b=xm9tN8lMWjpWu8vdE+IyRjBYQ269ZXDoe6fT4pceCoGlHdlfzHFIrp/D1PJTOhbCqsXfUs Bd07zY3qNlXZuvTew7Z/xpVT0WCszTqyK+bPCDMMp/19808+ZlN6C5qla1fLxp3XD3ewpB pNY8En2GMnVuBXs1pdqaTgaptXvsPFT1w/eqsYP5Yq6ZqvjEY03kNDfOTaPEeUUkN+cUU4 S4GXY1v9aFcDLAmkNUah06Y8R2m2vitf/ab2t2rmh5jR7V3YtZaZLW5/3GZayWcV5qRWxi yTSLWuQAOoxCMLUI1lxTXUWoVt287FFrsnktN9D6DGb5LRFjrHkpQqrWE/Ww0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752607214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rfWDfqqwvejeHwPoUgINEG8/LGrKvDv4Lu/brSU1W+s=; b=Jcweh9bq0omyXtXByfaHuamRm2hzHCo304DfUrSUWN+w+Ki2eA1alcxh4uHUQbLnhf9xqP BZI/bpAX6wwAKWXPRPQe9yk+hh5GZzWPx56+OU1Mi2PH9OQzwVBUIIvIKMlvaBlNfON7Ci t1OaxvQYxZcD1yWidmeYCBujkoP8IN1FG6FKa0XbYPkIhHt0nCfdjfj3gXSNJKWsz3cOj6 eiqVAasvhZMFnRYzeTANvE0ElCAo6ub2azwiE7yjb8SXXAKQ+AC4yb3hrZoc9+ffomlP63 mNVOTLzqwCk+fK/RwFXSeX8Fh2IYcNL2BFIeXbJefZiQZWdK0WFlpS5PGpN5kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752607214; a=rsa-sha256; cv=none; b=fAGQUgNb5cekYgLxeEHzOkNnJaU9S4H3UlOtEhz/H673tEGgd7qbBXyd/a3JjumGxo7Jvt OJBNah8CTShgjUBAY+T6lCj/Q02HQscZSsX6PtvHOOz0ipgv/Z50u85hpIozz3RDC49dbW AVu71i0xVtAVqT3prM4Q0L34hgjawUq+uVfMAYyAP/Fx7rA3BMC9zOLFzM/SgON/SHU2ZH 9LLXFT3KtThN3g4DkLEkNfDcJG1Bw9ImpNlgzwW93lwjnVaxHL1VadAAIlKJ5uMbi6inuO wL7yPbbENJ7+Ecdv1bBtBoaiue1Wi8cfOOlaNeuou/2sQ93kYfiC5eF38h0k8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhTXt5fzNzspv; Tue, 15 Jul 2025 19:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FJKEFp072686; Tue, 15 Jul 2025 19:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FJKEPS072682; Tue, 15 Jul 2025 19:20:14 GMT (envelope-from git) Date: Tue, 15 Jul 2025 19:20:14 GMT Message-Id: <202507151920.56FJKEPS072682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 3cb2a7e01e13 - main - sed.1: Adjust examples to fit in one line + SPDX List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cb2a7e01e13c866d7c4bb55da8f229233c0cd7c Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3cb2a7e01e13c866d7c4bb55da8f229233c0cd7c commit 3cb2a7e01e13c866d7c4bb55da8f229233c0cd7c Author: Alexander Ziaee AuthorDate: 2025-06-15 02:51:05 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-15 19:20:11 +0000 sed.1: Adjust examples to fit in one line + SPDX Examples were previously overflowing at MANWIDTH 80. Keep the same complexity but use shorter phrases to make them easier to read. Tag SPDX while here. MFC after: 3 days Reviewed by: bcr Discussed with: emaste Differential Revision: https://reviews.freebsd.org/D50867 --- usr.bin/sed/sed.1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1 index 345f673310d8..5fd894eaf78b 100644 --- a/usr.bin/sed/sed.1 +++ b/usr.bin/sed/sed.1 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -28,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 17, 2024 +.Dd June 14, 2025 .Dt SED 1 .Os .Sh NAME @@ -597,17 +600,17 @@ with .Ql baz when piped from another command: .Bd -literal -offset indent -echo "An alternate word, like bar, is sometimes used in examples." | sed 's/bar/baz/' +echo "use bar in examples" | sed 's/bar/baz/' .Ed .Pp Using backlashes can sometimes be hard to read and follow: .Bd -literal -offset indent -echo "/home/example" | sed 's/\\/home\\/example/\\/usr\\/local\\/example/' +echo "/bin/bash" | sed 's/\\/bin\\/bash/\\/bin\\/sh/' .Ed .Pp Using a different separator can be handy when working with paths: .Bd -literal -offset indent -echo "/home/example" | sed 's#/home/example#/usr/local/example#' +echo "/bin/bash" | sed 's#/bin/bash#/bin/sh#' .Ed .Pp Replace all occurrences of From nobody Tue Jul 15 19:25:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhTgT19y7z62kln; Tue, 15 Jul 2025 19:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhTgT0W3Sz3h7N; Tue, 15 Jul 2025 19:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752607557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hQY1nK0JYaSP/P/bY66qBnorsGYCm7ESnCpq01UcMUY=; b=RdpCGdS+Kr2tJEBLuePaXjKbAi0Zs9zqK9h/cQenlToQUFqSOKzu4MUEI0JFKxri5uhaQj uvpU2RidlaPCAwFVHEznJ5hQcRVrZAT4zqAoipor6Y5wcF+R9iuHU7nUob58I/uyApju/6 2WScUSj6zf493tumZy41JEnclHDmxky57t1ONDRXodQ3F7Qlvd5Ae5/nQe2Qom+ieN8ivh f81B9Draa3uopXsbJzM3AZfcdhnTenS1i52H9LH5ufP9JLmFg+fhg0vO12erxP1xBu1sXa XOdc7aQZWZh5cGelZ/F4FMzgl2GmVQfw6PasYkHzL/uwlWRy/noC+L1wLIhXig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752607557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hQY1nK0JYaSP/P/bY66qBnorsGYCm7ESnCpq01UcMUY=; b=pEOXlMRloI1rmJl2Ov1e24w8f9KN8iO7Oqzwc6MycY7/klTFKS3as1aGYDT3DRVB/pDTs8 iOF4Ew99o9PKlhwdGJpytMfHwwDZ1lD7r2TPlD+Ou1RxLTZtQC2rzTegkJC++B8ylqmvl0 kmhpPqOAXZm+gvRCxNAa/sV74AVD8/pLqlVNfKvtBeJkqenLjinAiJSGTtUb6D+zf69ROY 4UngjbUFxJVhHe4bZyc28ZoXcpELbWLCwslyMzNRRxyBQ8W4pAOZcOoWXHYBL0PLLnAV94 hDjtH1xQMSgdMC+keS6DRMDdZGYVg/DzmlXiotyPLX+LzYwLVWUlyD/nt8wxAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752607557; a=rsa-sha256; cv=none; b=Sr+azhL3HJJzCKFY5cjZ9+5aaXFnjewbe7jMS81QjK4GBLg6p79eFAwe6aVH4ceOSCX08E oymGzpP5q6/wza+Q8OFjSpyhShQuMPLQWu/DXbjQPuak/dZMyogF6aKe8KyU5b+5gI8CnK r3nDseLy+J3WhaNPqZTztxy46O5dZ/jHbKnvDg2KEzXRFvoR2jFnHSreolQZbMrQ7jfyUj JDw+cKZ9yZi6Cn9WCPEK1RHnNJOtNIGL8yY8w6tyQ/t8MoLfx75/kLKPUo3IA70YWeYiD3 3v4w0av20HBy4ochRxIHD2QhN05th9rj6oflxQTnMnKUiZ7LrgGTXI7qQ3Av4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhTgS6yn0ztHC; Tue, 15 Jul 2025 19:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FJPup0084169; Tue, 15 Jul 2025 19:25:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FJPuGO084166; Tue, 15 Jul 2025 19:25:56 GMT (envelope-from git) Date: Tue, 15 Jul 2025 19:25:56 GMT Message-Id: <202507151925.56FJPuGO084166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 602e423db166 - main - top.1: Document the THR column List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 602e423db1661a316c2e97d229e14cb20c57f835 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=602e423db1661a316c2e97d229e14cb20c57f835 commit 602e423db1661a316c2e97d229e14cb20c57f835 Author: Alexander Ziaee AuthorDate: 2025-07-15 19:24:13 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-15 19:25:31 +0000 top.1: Document the THR column MFC after: 3 days Fixes: 32efd26355e2 (Add a THR column) Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D50754 --- usr.bin/top/top.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index d8ef763e7a34..53b078839526 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -1,4 +1,4 @@ -.Dd April 1, 2025 +.Dd June 9, 2025 .Dt TOP 1 .Os .Sh NAME @@ -398,6 +398,7 @@ ID corresponding to the process, USERNAME is the name of the process's owner (if .Fl u is specified, a UID column will be substituted for USERNAME), +THR is the thread count, showing the number of threads a process has, PRI is the current priority of the process, NICE is the .Xr nice 1 From nobody Tue Jul 15 20:04:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhVXn1Wb6z61Y0D; Tue, 15 Jul 2025 20:05:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhVXm2rwwz49gH; Tue, 15 Jul 2025 20:05:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56FK4wxJ060743; Tue, 15 Jul 2025 23:05:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56FK4wxJ060743 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56FK4vBE060742; Tue, 15 Jul 2025 23:04:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 15 Jul 2025 23:04:57 +0300 From: Konstantin Belousov To: Mark Johnston Cc: Gleb Smirnoff , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fad79db40505 - main - vm_pageout: Remove a volatile qualifier from some vm_domain members Message-ID: References: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bhVXm2rwwz49gH X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 15, 2025 at 01:24:36PM -0400, Mark Johnston wrote: > On Tue, Jul 15, 2025 at 09:40:18AM -0700, Gleb Smirnoff wrote: > > On Tue, Jul 15, 2025 at 03:19:04PM +0000, Mark Johnston wrote: > > M> The branch main has been updated by markj: > > M> > > M> URL: https://cgit.FreeBSD.org/src/commit/?id=fad79db405052f3faad7184ea2c8bfe9f92a700d > > M> > > M> commit fad79db405052f3faad7184ea2c8bfe9f92a700d > > M> Author: Mark Johnston > > M> AuthorDate: 2025-07-15 15:16:40 +0000 > > M> Commit: Mark Johnston > > M> CommitDate: 2025-07-15 15:16:40 +0000 > > M> > > M> vm_pageout: Remove a volatile qualifier from some vm_domain members > > M> > > M> These are always accessed using atomic(9) intrinsics, so do not need the > > M> qualifier. No functional change intended. > > M> > > M> Reviewed by: alc, kib > > M> MFC after: 2 weeks > > M> Sponsored by: Modirum MDPay > > M> Sponsored by: Klara, Inc. > > M> Differential Revision: https://reviews.freebsd.org/D51322 > > > > What's the benefit of removing the qualifiers? They act as documentation > > and they match atomic(9) prototypes. To me this looks like removing a > > const qualifier with a reasoning that we use the variable only as an > > argument to functions that have const qualifier. > > Note that I updated the comments as well to indicate that accesses to > the fields should be done through atomic(9), so the documentation is > preserved. > > The reason atomic(9) prototypes include the volatile qualifier is to > permit their use with volatile-qualified variables without a cast, not > because the interface expects only volatile-qualified parameters. > > More generally, I believe that new code should always avoid using > volatile to provide any kind of synchronization, ignoring the case of > accesses to memory mapped with non-default attributes. atomic(9) > intrinsics should be used where they are needed, and some comments > should explain the synchronization protocol if it's not obvious. Hmm, when I wrote atomic_load/store(), volatile casts were used to utilize compiler-specific semantic of volatile accesses, that happens to match what loads and stores should do (access that place now). I.e. it is not for the allowance to use volatile-qualified locations, but to provide the C11-compatible semantic. After stating that, it is clear why qualifying the vars with volatile is not what we want: the semantic of volatile is compiler-dependent, and it only happens to match what is really used for code. Atomics loads and stores do provide the primitive ops we need, and hide the compiler-specific implementation under. I.e., volatile should *not* be used. From nobody Tue Jul 15 20:44:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhWQf4pc4z61bCw; Tue, 15 Jul 2025 20:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhWQf37RNz3Khm; Tue, 15 Jul 2025 20:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752612298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=feX+30Qz3NOPZ5Luwj7nMrGkd0WuOdcu5Umya2bsiZ4=; b=cAGAgKpimj0z8emMDNLFVQ70S0WCVYG2M1YGOvbJY0pBa8ZiPph1miGLC4ZiqhnfNmSdZ7 WpfoTff3XlQT4h8bpldQQVw3fd1NbOk4BXEvtQdJ/LAp31FvIvsKExKKNb6O/NUlKY/6L5 YXd/Q6XmtRsSWp73rjfhQWSQNmwEnDi47Pr6/lLKIV2vgrE5s5LC+DxCC+YrbKyCsT3nxP msFJYuH8MW7zHORpCe8jTaCOBQ4YiUl7RBZ1Mf2oYHHulGBO02ZbHgveW+2xBODi8GiDjT mpYEHekUM0+vwL0V2U/SKuIyiW+MM0kbY/eB2HtFnyfMdoCNI6oinq0Ln1rCKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752612298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=feX+30Qz3NOPZ5Luwj7nMrGkd0WuOdcu5Umya2bsiZ4=; b=CMgdF+zV1dV6Dk+mSPLLjSIaE1PHHLkYFbDSsLviTcdDbBPxE0SO5AA/sHMt2EDNnvvK6j p32g+t91eu/X/kzH1uqVfKZytYeWdj22Qt3iibgspt3BoyOk7CYDASLKUKjARkLY0aJE8z VAw8Ew5ZJ0EU8aC9mDx6s+nyAUpm9+etnYlq/4nUZTxBLvUa/SV3Htk12ZYH2A9JQVsOLq W2I3jIutcZ8/Aq3sPwyBGusAN2rr2c/vML2kYjHPmLhEH020lzOZCUESTtTYM10rTTIgOw Y2RTYeIKQ+RqWUMSvi23etnPAPEoE16KQjwRoFiZKBMUwR+Qvz+qCpUPbVHlUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752612298; a=rsa-sha256; cv=none; b=Jsun/IROwRQ5K0OSyK31evg/zZpQ+ebmDT5WlrFaF1WObZf9Z0QurpeIeix0YM0wDIMlHx ORBse9Ntlv9I+Ks/dOX3H8INV33VOpbqR+uFEZGomF4KDGMg+CbqlavQaauvhQvD/HaQ9M //ak9Bg/GmYL2S/9i4ehGqxnYm9Oyl6CTpJqTooC4bhvx+qacIjum2tENrW2g7JLVCbw4c kmpyRkR2YLBcZRHNo1FbULjWV0alrInS3Vi+nbbg7HZ1ivBDezgr9nRFab/yqG1O3YjeaC EB8LhGUMKquDFF/GHLCNwP/6R7ALGVxO4soBNsjFu8/wh7v0HHZ+JP6dDkXutg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhWQf2krszvtc; Tue, 15 Jul 2025 20:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FKiwWh033722; Tue, 15 Jul 2025 20:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FKiwwi033719; Tue, 15 Jul 2025 20:44:58 GMT (envelope-from git) Date: Tue, 15 Jul 2025 20:44:58 GMT Message-Id: <202507152044.56FKiwwi033719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 874385b03f8d - main - uexterr_gettext: add tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 874385b03f8d75111b98a6d6c0fbfb5ac5b29ace Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=874385b03f8d75111b98a6d6c0fbfb5ac5b29ace commit 874385b03f8d75111b98a6d6c0fbfb5ac5b29ace Author: Alan Somers AuthorDate: 2025-07-03 19:38:07 +0000 Commit: Alan Somers CommitDate: 2025-07-15 20:43:52 +0000 uexterr_gettext: add tests Add tests for the new extended errno feature. Sponsored by: ConnectWise MFC after: 2 weeks Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51184 --- sys/kern/sys_generic.c | 6 +++ sys/sys/exterrvar.h | 1 + tests/sys/kern/Makefile | 1 + tests/sys/kern/exterr_test.c | 108 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 94e44d888181..b472aaea89e6 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2309,6 +2309,12 @@ sys_exterrctl(struct thread *td, struct exterrctl_args *uap) return (EINVAL); td->td_pflags2 &= ~TDP2_UEXTERR; return (0); + case EXTERRCTL_UD: + /* + * Important: this code must always return EINVAL and never any + * extended error, for testing purposes. + */ + /* FALLTHROUGH */ default: return (EINVAL); } diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 15557c614f88..7bf1d264ff5e 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -21,6 +21,7 @@ #define EXTERRCTL_ENABLE 1 #define EXTERRCTL_DISABLE 2 +#define EXTERRCTL_UD 3 #define EXTERRCTLF_FORCE 0x00000001 diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index f2c24ad9dec9..336e73f29835 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -17,6 +17,7 @@ ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test # One test modifies the maxfiles limit, which can cause spurious test failures. TEST_METADATA.kern_descrip_test+= is_exclusive="true" +ATF_TESTS_C+= exterr_test ATF_TESTS_C+= fdgrowtable_test ATF_TESTS_C+= getdirentries_test ATF_TESTS_C+= jail_lookup_root diff --git a/tests/sys/kern/exterr_test.c b/tests/sys/kern/exterr_test.c new file mode 100644 index 000000000000..17c84c1f8ed4 --- /dev/null +++ b/tests/sys/kern/exterr_test.c @@ -0,0 +1,108 @@ +/*- + * Copyright (C) 2025 ConnectWise, LLC. 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. + */ + +#include +#include + +#include +#include +#include +#include + +ATF_TC(gettext_extended); +ATF_TC_HEAD(gettext_extended, tc) +{ + atf_tc_set_md_var(tc, "descr", "Retrieve an extended error message"); +} +ATF_TC_BODY(gettext_extended, tc) +{ + char exterr[UEXTERROR_MAXLEN]; + int r; + + /* + * Use an invalid call to mmap() because it supports extended error + * messages, requires no special resources, and does not need root. + */ + ATF_CHECK_ERRNO(ENOTSUP, + mmap(NULL, 0, PROT_MAX(PROT_READ) | PROT_WRITE, 0, -1, 0)); + r = uexterr_gettext(exterr, sizeof(exterr)); + ATF_CHECK_EQ(0, r); + printf("Extended error: %s\n", exterr); + /* Note: error string may need to be updated due to kernel changes */ + ATF_CHECK(strstr(exterr, "prot is not subset of max_prot") != 0); +} + +ATF_TC(gettext_noextended); +ATF_TC_HEAD(gettext_noextended, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Fail to retrieve an extended error message because none exists"); +} +ATF_TC_BODY(gettext_noextended, tc) +{ + char exterr[UEXTERROR_MAXLEN]; + int r; + + ATF_CHECK_ERRNO(EINVAL, exterrctl(EXTERRCTL_UD, 0, NULL)); + r = uexterr_gettext(exterr, sizeof(exterr)); + ATF_CHECK_EQ(0, r); + ATF_CHECK_STREQ(exterr, ""); +} + +ATF_TC(gettext_noextended_after_extended); +ATF_TC_HEAD(gettext_noextended_after_extended, tc) +{ + atf_tc_set_md_var(tc, "descr", + "uexterr_gettext should not return a stale extended error message"); +} +ATF_TC_BODY(gettext_noextended_after_extended, tc) +{ + char exterr[UEXTERROR_MAXLEN]; + int r; + + /* + * First do something that will create an extended error message, but + * ignore it. + */ + ATF_CHECK_ERRNO(ENOTSUP, + mmap(NULL, 0, PROT_MAX(PROT_READ) | PROT_WRITE, 0, -1, 0)); + + /* Then do something that won't create an extended error message */ + ATF_CHECK_ERRNO(EINVAL, exterrctl(EXTERRCTL_UD, 0, NULL)); + + /* Hopefully we won't see the stale extended error message */ + r = uexterr_gettext(exterr, sizeof(exterr)); + ATF_CHECK_EQ(0, r); + ATF_CHECK_STREQ(exterr, ""); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, gettext_extended); + ATF_TP_ADD_TC(tp, gettext_noextended); + ATF_TP_ADD_TC(tp, gettext_noextended_after_extended); + + return (atf_no_error()); +} From nobody Tue Jul 15 20:51:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhWYv5zZ1z61bMS; Tue, 15 Jul 2025 20:51:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhWYv5PJnz3MSN; Tue, 15 Jul 2025 20:51:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752612675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=On4sbwwg9nAwf844nAC+8tHdL14pk8HeQmDM8INYBro=; b=kCWcKAh5iDgpcZTfHIGYRC7iPeNpxXHg0v7VUoQxwFPrztVVe1tE/vCZJ+IkqLIqPSdgop 4M5hMjvQpO6lLcJ3RO0q8NkJDtsZ8zRyYgQGzSWJcC1cmpjbCzRHzBWdIMPrPxDzYQTQfb 7BNjHxP8fDfhCSXVMjAS+EL0+DD6fJJFjBT76oYWQFZABrC4stejNoyDzeM/xqdiJLdD1z 7hpkhNHVGgSgn2oR3e+UMZ4tRXUDGF+5FXsSEjc5Po4gAn0L8BUWxkI61tq4uoTiRgGG5Y XkDfio98Zgb4Y32xb/x8OSKAioxehW+kVATes1Iq6c1eYnw83JJ6IjWXmjKnfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752612675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=On4sbwwg9nAwf844nAC+8tHdL14pk8HeQmDM8INYBro=; b=UFs4hSAk2mM3a3en7kJCEgagj41AnAs17j+G6r3G7X4XMV5CwsViFdNaJ2W5F3GUqwZ2X+ 4pfVDdSH7wm5jEhNfqQNzdFmqMkanikKus8zqCYcfu0xNWgPDpHdaR1rDSz03m5a7qlxLP BSNWq3LsfwzT3R0KtHOpg0eB7TBK/vq70UQl8yirz02nOG15dPMG74ztqVrjuti6Fv+ney 8zcfeA/1joS6i9KQd+f0VA18wbgDPfRT0KXNvBONcCpg/3oqaRT/iuNprIcz+LcsviGjsu ogGHOiSKtU0BqhSBW+ZcqDNnLFS0mIQ2UeclqJ8W3XC9lfIZF6LhuAoea1DDdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752612675; a=rsa-sha256; cv=none; b=cFT4i+LKoI0tvldOo+O8KJckSUlm5H4uvKuZzdAAqvkt4aGLuo/bsP8IJa+SXPv/Rlkpi/ o1KrMDZ3a9ghln5wN68LG3qfs0ekv3W8Y7iAkj2aP84t/IkuOSGS2I94bhbYO0H3jQY5WG ZkpfCVxefb7s3lkxgzS3fxySB6dINdtkAocZf5590l11hCTbSMlSbPqmAUeSL1EpZ8pgin PGSseB8DQ86hlhMXymJFsyZHPgV4c/Q3Tv5iF90wmCWjsMph/a/lyY+3FvKSyJf24/qOfB QdpDt6uh6+FbckFFkfNgYBRuFTr3NDoRhmu03dUA3K1uV+F9cY1yaj63WJGlbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhWYv50VgzwKs; Tue, 15 Jul 2025 20:51:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FKpFQX046392; Tue, 15 Jul 2025 20:51:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FKpFE4046389; Tue, 15 Jul 2025 20:51:15 GMT (envelope-from git) Date: Tue, 15 Jul 2025 20:51:15 GMT Message-Id: <202507152051.56FKpFE4046389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ea97c397d75c - main - pf: remove unused argument from pf_send_icmp() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea97c397d75c3fd108b1bc033f39d3e6d41c7dfe Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ea97c397d75c3fd108b1bc033f39d3e6d41c7dfe commit ea97c397d75c3fd108b1bc033f39d3e6d41c7dfe Author: Kristof Provost AuthorDate: 2025-07-15 06:32:49 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 18:49:13 +0000 pf: remove unused argument from pf_send_icmp() We never use the struct pf_krule, so remove that argument. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 63d513fb1956..264830fcf534 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -327,7 +327,7 @@ int pf_change_icmp_af(struct mbuf *, int, sa_family_t); int pf_translate_icmp_af(int, void *); static void pf_send_icmp(struct mbuf *, u_int8_t, u_int8_t, - int, sa_family_t, struct pf_krule *, int); + int, sa_family_t, int); static void pf_detach_state(struct pf_kstate *); static int pf_state_key_attach(struct pf_state_key *, struct pf_state_key *, struct pf_kstate *); @@ -4349,11 +4349,11 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, } else if (pd->proto != IPPROTO_ICMP && pd->af == AF_INET && r->return_icmp) pf_send_icmp(pd->m, r->return_icmp >> 8, - r->return_icmp & 255, 0, pd->af, r, rtableid); + r->return_icmp & 255, 0, pd->af, rtableid); else if (pd->proto != IPPROTO_ICMPV6 && pd->af == AF_INET6 && r->return_icmp6) pf_send_icmp(pd->m, r->return_icmp6 >> 8, - r->return_icmp6 & 255, 0, pd->af, r, rtableid); + r->return_icmp6 & 255, 0, pd->af, rtableid); } static int @@ -4411,7 +4411,7 @@ pf_send_challenge_ack(struct pf_pdesc *pd, struct pf_kstate *s, static void pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, int mtu, - sa_family_t af, struct pf_krule *r, int rtableid) + sa_family_t af, int rtableid) { struct pf_send_entry *pfse; struct mbuf *m0; @@ -9016,7 +9016,7 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, if (ip->ip_ttl <= IPTTLDEC) { if (r->rt != PF_DUPTO) pf_send_icmp(m0, ICMP_TIMXCEED, - ICMP_TIMXCEED_INTRANS, 0, pd->af, r, + ICMP_TIMXCEED_INTRANS, 0, pd->af, pd->act.rtableid); goto bad_locked; } @@ -9162,7 +9162,7 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, } pf_send_icmp(m0, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - ifp->if_mtu, pd->af, r, pd->act.rtableid); + ifp->if_mtu, pd->af, pd->act.rtableid); } SDT_PROBE1(pf, ip, route_to, drop, __LINE__); goto bad; @@ -9313,7 +9313,7 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, if (ip6->ip6_hlim <= IPV6_HLIMDEC) { if (r->rt != PF_DUPTO) pf_send_icmp(m0, ICMP6_TIME_EXCEEDED, - ICMP6_TIME_EXCEED_TRANSIT, 0, pd->af, r, + ICMP6_TIME_EXCEED_TRANSIT, 0, pd->af, pd->act.rtableid); goto bad_locked; } @@ -9462,7 +9462,7 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, if (r->rt != PF_DUPTO) pf_send_icmp(m0, ICMP6_PACKET_TOO_BIG, 0, - ifp->if_mtu, pd->af, r, pd->act.rtableid); + ifp->if_mtu, pd->af, pd->act.rtableid); } SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); goto bad; From nobody Tue Jul 15 21:07:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhWwr4qYBz61ccj; Tue, 15 Jul 2025 21:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhWwr11Nrz3ZLs; Tue, 15 Jul 2025 21:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752613660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GCaNPSXkolBeTPDBkQwdOPWtjr3pNgS3MbVQaSwCFAY=; b=lH7rOCKs99d+hExAgdGnjtGiu4ldYiWthsVFAqYzbzUgeNbeYag52dws6XhmoY5vL6VqTS fn8u7qmqtzHwPk+bnvmsorhZaz3biW/mLVJT5+dRLwWajqWyoK4zP0nLhdFfj2ubRoYu/b JYcUXR3CoIhow4y//++aYEjxGyt5Hq5zNWhQSs060HzO1gQipQudMHoQAbFp/8hPKYX2Wd OUkTV9lmbe4JYfaNqTZLz9XTedgH9G6l1CGwE3kKi2TW5pyHygOKDoIdSBJ+KTk1Ap/IFj pScU9k90Vz0jdbiqsk5wbPBDHhHfZiwW25H6kHdtts7Zw+AteSMAQGfVV0DCjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752613660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GCaNPSXkolBeTPDBkQwdOPWtjr3pNgS3MbVQaSwCFAY=; b=ZqmOBAWTRFyLILKGCVoGah5SK8i/Mo7A4TK4OOakVnrCHBJRTFcqoKHtYrGTR6w0FcHl9+ IH2X+1o4Bxdaa9Tkrv0TDgM/g3ig2zNakYLVwImDtGy2dyGY/VAmWvdcf5a5XQ1ex5FRRO ze1nAGo8XXC1Kv0IEWYNgzcq8XPzKIPpQ9W7Bm5MUKDFLNPLNVUZilo+W8YE7AyCLCTiAH BMMGIIMoAMVJuAvz5OSl18OgilDm4RMQ6bydqI2N5wzOe5ThuH8LzNMHzEceyZFMDew3gF Qfim6CsVHDE0HzapznVBRiLrEtX1D8B90P/mmz7k4ZMp7Zpa6UNTV5ufWNcssg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752613660; a=rsa-sha256; cv=none; b=VrXNv273hvG/Q4ci05nfq88/BfFdKi4JIH9U1BBtZYWpT4d9pkfx7VQPDJFwRxoqFjeAWa feG5X9+/Nfq57RVLCSJ0Ahhe4zliOiBCN5ffLLDD7YlKdyNVtFrmOhVLincWL0VeXqkMpi ivYGOZjchWgMrQzoDPXvk2MfVeaduQsnrpWTcY/m66wUzUl8Dj0N6FiHZ6cNweYyp/79Zm NIhKZwagQWElKbii2DP+ewsEZ1Sd4JJ2irn1H+sqUr0Rr+nKy5LasDsu+KCyAivNEZF99k vyDGswthkUntaasPIrU/aRQsg/mLhfjqPi+jhTnY4xJJdSPDw5TLWVSzzyQcrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhWwr09zJzwcv; Tue, 15 Jul 2025 21:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FL7d6R073436; Tue, 15 Jul 2025 21:07:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FL7d5u073433; Tue, 15 Jul 2025 21:07:39 GMT (envelope-from git) Date: Tue, 15 Jul 2025 21:07:39 GMT Message-Id: <202507152107.56FL7d5u073433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6567623f831d - main - vfs_cache: Fix the SDT definition of vfs:fplookup:lookup:done List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6567623f831daaffa67777d17780e8f424c1bb01 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=6567623f831daaffa67777d17780e8f424c1bb01 commit 6567623f831daaffa67777d17780e8f424c1bb01 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-14 23:09:24 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-15 21:07:13 +0000 vfs_cache: Fix the SDT definition of vfs:fplookup:lookup:done 1. The definition lists struct nameidata as the type of the first argument. However, the actual probes always pass a variable of type struct nameidata* to SDT_PROBE3. 2. The third argument (args[2]) is actually enum cache_fpl_status. Reviewed by: markj Approved by: markj (mentor) Fixes: 07d2145a1717 vfs: add the infrastructure for lockless lookup MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51315 --- sys/kern/vfs_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 3d455b3874cc..ec3f947ffa55 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -332,7 +332,8 @@ SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *", "char *"); SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t"); -SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata", "int", "bool"); +SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata *", "int", + "enum cache_fpl_status"); SDT_PROBE_DECLARE(vfs, namei, lookup, entry); SDT_PROBE_DECLARE(vfs, namei, lookup, return); From nobody Tue Jul 15 21:09:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhWzK1gFpz61cVV; Tue, 15 Jul 2025 21:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhWzJ5JY9z3bhq; Tue, 15 Jul 2025 21:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752613788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ciNOdNLm4H+9sAjkTY/4PRyXaOpFYaTeafHYPD5viJs=; b=XiltigfEBczQBRSR83VoBnRTZbJR2J3n8t1rTDMwGKTSG4rGEJfGX1DlQnooKOO/Wvwgez VQ9LfLMOMwKEdTe+xjtzs3hxQpiPaMCA7DcwIOvpuceAC7xRaTO3788LsU2hwgnXYDl9Pd BYujHfRVSUu41EUXfAte/Drw+0OcAj8GzDH8kPx2y1LeXV63l6hq9W4oB5izz0mQo8JElu oCt0HQbYP4z2Nfhx0z2Jf0+XEJax8xSrzgWonl/4rGSYaqAkxwQ6chaeb5jtsDL28szheJ 3uB+zIEFna5ugGga4/P9agKQiVtoS4m42igCQEw5KWAMkN/FTVAUsh5mgJbMWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752613788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ciNOdNLm4H+9sAjkTY/4PRyXaOpFYaTeafHYPD5viJs=; b=OeBIy8w7WPiV+nh64n9VaKPEKxGXtWMV4k1LMVn7K93cYPcrHKrNEzIXOD08BtiARtWUNU WCHP+q6jM3dpLiZqdeIPHrUZFM2G4ytHtadWM3HtM25f9NMg+c/kLCJjk+RPq9b/IADIGs uyfc/HcnPc2WM4p9iiMELvfo0xIZ89x+FnP7TYfEuXfHkkqIOQlJEYs0+eHzZfvBF4D1Ep fy9pUwc0m8OkIq0tMwmRGCrFRFxwxeruE3tWW12w6fdmVXeRNt8JzQxQ3agGcgcAJdM0Zo eBj97ZotrYg4vsxbTzM1DwyGBRHzLR66oojHNkxkOGvQ/MhQyiilfLG6kwcHKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752613788; a=rsa-sha256; cv=none; b=b8qhlGoS/ew2ClwMu2Iyi+l052CE/f9Ji/dO/imnY0obmB520Gop8R1Xk7Mz6Vdx0Rvife me/kwBzDI7uA/i4qPbmmzPUx2VvC0n2UrHdylFsEDRB3s1yFv0yueHtFvf6RMxmwT4sonU QecMaotGaDmA3fkIlYsP51kB26RcWjCHUrNGcOwoipoVvk0WXVajJLz+N0j83Zg1Go2typ bTzOTwGAgyOGzqATsuwVxTEJonPyhgRkODpCW9chxjbe9KiD+Kiq9Iu0eAA7hk212FIQ7k nVblrUk97c9paoWbKOPkTjYhRVCrYUw2CqvJ5/jhyvpH2dn64e653qsZwjoVVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhWzJ4tlFzwhy; Tue, 15 Jul 2025 21:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FL9mY8074181; Tue, 15 Jul 2025 21:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FL9mqO074178; Tue, 15 Jul 2025 21:09:48 GMT (envelope-from git) Date: Tue, 15 Jul 2025 21:09:48 GMT Message-Id: <202507152109.56FL9mqO074178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: b2bf651a797b - main - sockstat: Reintroduce -w flag with altered behavior List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2bf651a797b7bf177146d497e59ab86e4898f6d Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b2bf651a797b7bf177146d497e59ab86e4898f6d commit b2bf651a797b7bf177146d497e59ab86e4898f6d Author: Damin Rido AuthorDate: 2025-06-30 13:46:28 +0000 Commit: Alan Somers CommitDate: 2025-07-15 21:09:02 +0000 sockstat: Reintroduce -w flag with altered behavior The -w flag was previously removed when automatic column sizing was introduced. Originally, -w enabled wider output, but used hardcoded column widths that did not guarantee alignment with actual content. This commit reintroduces the -w flag with a new purpose: to dynamically size columns based on the longest entry in the current output. Unlike the original behavior, this version ensures fully aligned and consistently formatted rows. By default, sockstat now uses fixed-width columns for more compact output, especially in 80-column terminals. Users who prefer a full-width view can now use -w to enable automatic column sizing. Sponsored by: Google, LLC (GSoC 2025) MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1746 Reviewed by: asomers, glebius --- usr.bin/sockstat/sockstat.1 | 6 ++-- usr.bin/sockstat/sockstat.c | 74 +++++++++++++++++++++++---------------------- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index da658e33e542..4832a09764fd 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 27, 2025 +.Dd June 30, 2025 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46ACcfIiLlnqSsUuv +.Op Fl 46ACcfIiLlnqSsUuvw .Op Fl j Ar jail .Op Fl p Ar ports .Op Fl P Ar protocols @@ -119,6 +119,8 @@ Show sockets. .It Fl v Verbose mode. +.It Fl w +Automatically size the columns. .El .Pp If neither diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index 1a24ff67c321..d0540c54a1aa 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -97,6 +97,7 @@ static bool opt_s; /* Show protocol state if applicable */ static bool opt_U; /* Show remote UDP encapsulation port number */ static bool opt_u; /* Show Unix domain sockets */ static u_int opt_v; /* Verbose mode */ +static bool opt_w; /* Automatically size the columns */ /* * Default protocols to use if no -P was defined. @@ -1101,7 +1102,7 @@ format_unix_faddr(struct addr *faddr, char *buf, size_t bufsize) { /* Remote peer we connect(2) to, if any. */ if (faddr->conn != 0) { struct sock *p; - pos += strlcpy(buf, "-> ", bufsize); + pos += strlcpy(SAFEBUF, "-> ", SAFESIZE); p = RB_FIND(pcbs_t, &pcbs, &(struct sock){ .pcb = faddr->conn }); if (__predict_false(p == NULL)) { @@ -1132,8 +1133,7 @@ format_unix_faddr(struct addr *faddr, char *buf, size_t bufsize) { while ((p = RB_FIND(pcbs_t, &pcbs, &(struct sock){ .pcb = ref })) != 0) { f = RB_FIND(files_t, &ftree, - &(struct file){ .xf_data = - p->socket }); + &(struct file){ .xf_data = p->socket }); if (f != NULL) { pos += snprintf(SAFEBUF, SAFESIZE, "%s[%lu %d]", fref ? "" : ",", @@ -1178,13 +1178,10 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) len = strlen(s->protoname); if (s->vflag & (INP_IPV4 | INP_IPV6)) len += 1; - if (laddr != NULL && faddr != NULL && s->family == AF_UNIX && - laddr->address.ss_len == 0 && faddr->conn == 0) - len += strlen(" (not connected)"); cw->proto = MAX(cw->proto, len); while (laddr != NULL || faddr != NULL) { - if (s->family == AF_UNIX) { + if (opt_w && s->family == AF_UNIX) { if ((laddr == NULL) || (faddr == NULL)) errx(1, "laddr = %p or faddr = %p is NULL", (void *)laddr, (void *)faddr); @@ -1193,7 +1190,7 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) cw->local_addr = MAX(cw->local_addr, len); len = format_unix_faddr(faddr, NULL, 0); cw->foreign_addr = MAX(cw->foreign_addr, len); - } else { + } else if (opt_w) { if (laddr != NULL) { len = formataddr(&laddr->address, NULL, 0); cw->local_addr = MAX(cw->local_addr, len); @@ -1296,23 +1293,6 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) static void calculate_column_widths(struct col_widths *cw) { - cw->user = 4; - cw->command = 10; - cw->pid = 3; - cw->fd = 2; - cw->proto = 5; - cw->local_addr = 13; - cw->foreign_addr = 15; - cw->pcb_kva = 18; - cw->fib = 3; - cw->splice_address = 14; - cw->inp_gencnt = 2; - cw->encaps = 6; - cw->path_state = 10; - cw->conn_state = 10; - cw->stack = 5; - cw->cc = 2; - int n, len; struct file *xf; struct sock *s; @@ -1366,13 +1346,10 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) faddr = s->faddr; first = true; - snprintf(buf, bufsize, "%s%s%s%s", + snprintf(buf, bufsize, "%s%s%s", s->protoname, s->vflag & INP_IPV4 ? "4" : "", - s->vflag & INP_IPV6 ? "6" : "", - (laddr != NULL && faddr != NULL && - s->family == AF_UNIX && laddr->address.ss_len == 0 && - faddr->conn == 0) ? " (not connected)" : ""); + s->vflag & INP_IPV6 ? "6" : ""); printf(" %-*s", cw->proto, buf); while (laddr != NULL || faddr != NULL) { if (s->family == AF_UNIX) { @@ -1381,23 +1358,27 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) (void *)laddr, (void *)faddr); if (laddr->address.ss_len > 0) formataddr(&laddr->address, buf, bufsize); + else if (laddr->address.ss_len == 0 && faddr->conn == 0) + strlcpy(buf, "(not connected)", bufsize); else strlcpy(buf, "??", bufsize); - printf(" %-*s", cw->local_addr, buf); + printf(" %-*.*s", cw->local_addr, cw->local_addr, buf); if (format_unix_faddr(faddr, buf, bufsize) == 0) strlcpy(buf, "??", bufsize); - printf(" %-*s", cw->foreign_addr, buf); + printf(" %-*.*s", cw->foreign_addr, + cw->foreign_addr, buf); } else { if (laddr != NULL) formataddr(&laddr->address, buf, bufsize); else strlcpy(buf, "??", bufsize); - printf(" %-*s", cw->local_addr, buf); + printf(" %-*.*s", cw->local_addr, cw->local_addr, buf); if (faddr != NULL) formataddr(&faddr->address, buf, bufsize); else strlcpy(buf, "??", bufsize); - printf(" %-*s", cw->foreign_addr, buf); + printf(" %-*.*s", cw->foreign_addr, + cw->foreign_addr, buf); } if (opt_A) printf(" %#*" PRIx64, cw->pcb_kva, s->pcb); @@ -1411,6 +1392,8 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) if (sp != NULL) formataddr(&sp->laddr->address, buf, bufsize); + else + strlcpy(buf, "??", bufsize); } else strlcpy(buf, "??", bufsize); printf(" %-*s", cw->splice_address, buf); @@ -1510,6 +1493,25 @@ display(void) err(1, "malloc()"); return; } + + cw = (struct col_widths) { + .user = strlen("USER"), + .command = 10, + .pid = strlen("PID"), + .fd = strlen("FD"), + .proto = strlen("PROTO"), + .local_addr = opt_w ? strlen("LOCAL ADDRESS") : 21, + .foreign_addr = opt_w ? strlen("FOREIGN ADDRESS") : 21, + .pcb_kva = 18, + .fib = strlen("FIB"), + .splice_address = strlen("SPLICE ADDRESS"), + .inp_gencnt = strlen("ID"), + .encaps = strlen("ENCAPS"), + .path_state = strlen("PATH STATE"), + .conn_state = strlen("CONN STATE"), + .stack = strlen("STACK"), + .cc = strlen("CC"), + }; calculate_column_widths(&cw); if (!opt_q) { @@ -1642,7 +1644,7 @@ static void usage(void) { errx(1, - "usage: sockstat [-46ACcfIiLlnqSsUuv] [-j jid] [-p ports] [-P protocols]"); + "usage: sockstat [-46ACcfIiLlnqSsUuvw] [-j jid] [-p ports] [-P protocols]"); } int @@ -1721,7 +1723,7 @@ main(int argc, char *argv[]) ++opt_v; break; case 'w': - /* left for backward compatibility. */ + opt_w = true; break; default: usage(); From nobody Tue Jul 15 21:44:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhXlC3T1Xz61fgy; Tue, 15 Jul 2025 21:44:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhXlC15ncz3xPj; Tue, 15 Jul 2025 21:44:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-4ab5953f5dcso32525891cf.0; Tue, 15 Jul 2025 14:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752615857; x=1753220657; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=UudRag4V6mrWb1EFmHqpnecVHehGsXOcxxDXUg3QU5E=; b=cBmhkrRuTnysOwtKnMx368SV/RUaCix0/tA7yGpkJ+yVAQbhdUzW//XxAJi501eYc2 JyCTd1TOt7Jxf/eVQVZqVID7o4n/heDo4h4tqbWcHHDC2ltEje2CZha/xDR/IGgzdn5A H9CisA/nBBpqnYzwq8kPzZLzahKunwUyqEtQ0M9at15ZWLCew2137LVdNiQ8y/HUTPAY 8fsSquafMs6IwXtz5uhXv2XQ3WHXP24oEgb1x09bw5bUadWHWa53h78qAScKXTcHb/OH knHXHUWNSPx1yOxOG3jnECvclubRCBt0aE5e3M8UUZDUmdHIiMYRicBXwbEw9RBnNlDO +qaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752615857; x=1753220657; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UudRag4V6mrWb1EFmHqpnecVHehGsXOcxxDXUg3QU5E=; b=pJ7hBkzRom0gl8HKWxXIZFrDUhy3riKwIAXSeKgY64kfulESAZO52AOhwq+PnykjbN mjWIvhgIqnZExuTVhvD2asTnHs0guYEB4WGh49ZpSLRKUlLqSnbIh3bsXY0uBs+PEV3B KJK4m238ugDXXBuYadio5Qc/DfHCBs3oiWSHjLUQ8W6za/P7IalcB9mK1PsJONeEZicI QcSPV9euGbpnd3w/WVkU/Bp080slb+uYKtI5f4kUaaa/+sT8j54v4Ps2+Ka/oZibfSxo jXGeGYFRg50h5k44vBE8zjf1OgPZQAtjaBeLenlpaUFdyXQKYuuArGsbZ7PyF+387r1/ PrdA== X-Forwarded-Encrypted: i=1; AJvYcCUV2j2i4Gggm7yD//Ae9vbQ0sINgT82VsCjjNNFmGKIf7IySxrEVhtJ6srbs83LVRq4qz6sX/KbOUMeE92HtTYiaMKRlw==@freebsd.org, AJvYcCUZFlZP4lLpdbqlwWns2l1T1CkQ3Je0nwbgS7Tukee0kNXdd0bzPxM1oqMB3Fx3zRBrgxn69XBWTi+H3d1ifpY=@freebsd.org, AJvYcCXgMWlIYvgUGF/gkFlEdt2dAMyluQVr6l1eTuQLqAutVhRPpUym8R9UQ5jxH1vFfeqD4QAFJDm6vJqtwCaSDeOAlJqE5f4=@freebsd.org, AJvYcCXvkpO3DW8jKAMZiOksBw2Vhjqlg6aCqyJHHa0Zm6jYtEjPEzyDRmVLBh0007X/n5VxFgI=@freebsd.org X-Gm-Message-State: AOJu0Yx/VWVuxyWwUJxRObDyI1ueAU9YV329kzFYFiCzKXrOkUnk4fym Vw1wjNGFUacIVLzKHpkPmLnWC0DOlDOMzZrWReb6ej4IO6SvOMvadpd444m6D46Y0aU= X-Gm-Gg: ASbGncuFKjjMo7MgvP8DfY1khdc5gnOiTbcBX7dXB6YyektqcSXiFgbgNFswqwT4NSP GoIklkSnD3qSRwZhteUQSe/G44makBEFaY4dcaPfoixQbfuzn1aHERgwJ5FBX0aq71o97jU0m0X GI5/tzTlAaPlhg3aK+o5xAqW5CERyTXHgUyc8AMP4py0/gyiX6zXtNnMhlfbPtrHIyl13pVRmgx VHXOUj+m3O6YnmUh3YlPRuC8cBJm+nh7iqsJRzQNjgVVCuQWozg1X/V3TcYTRfjwwxJTbKD/yLn i3S9ZXRTLQeVHzfAqgJxomDLbyeb6I1SS/Qp6ntCSRi6icW+IlIoGteAqwH1ubFtsCvx+MxJbN6 c6P6XSY2LjpnjfHkT45RgkL5OO/q6+I6LEuC65zHHi4e09Ow= X-Google-Smtp-Source: AGHT+IFYGpWOY+Rsb/FT6c+SaXHXyGD5lfgod4Syv6Q3Lo0sVtVPWymBw7bKPVlZz1S93IG6l2kXDA== X-Received: by 2002:ac8:5948:0:b0:4ab:4102:50de with SMTP id d75a77b69052e-4ab93d48758mr6769031cf.28.1752615856615; Tue, 15 Jul 2025 14:44:16 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ab3d44b3d6sm45089821cf.56.2025.07.15.14.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jul 2025 14:44:16 -0700 (PDT) Date: Tue, 15 Jul 2025 17:44:13 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Gleb Smirnoff , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fad79db40505 - main - vm_pageout: Remove a volatile qualifier from some vm_domain members Message-ID: References: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4bhXlC15ncz3xPj X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 15, 2025 at 11:04:57PM +0300, Konstantin Belousov wrote: > On Tue, Jul 15, 2025 at 01:24:36PM -0400, Mark Johnston wrote: > > On Tue, Jul 15, 2025 at 09:40:18AM -0700, Gleb Smirnoff wrote: > > > On Tue, Jul 15, 2025 at 03:19:04PM +0000, Mark Johnston wrote: > > > M> The branch main has been updated by markj: > > > M> > > > M> URL: https://cgit.FreeBSD.org/src/commit/?id=fad79db405052f3faad7184ea2c8bfe9f92a700d > > > M> > > > M> commit fad79db405052f3faad7184ea2c8bfe9f92a700d > > > M> Author: Mark Johnston > > > M> AuthorDate: 2025-07-15 15:16:40 +0000 > > > M> Commit: Mark Johnston > > > M> CommitDate: 2025-07-15 15:16:40 +0000 > > > M> > > > M> vm_pageout: Remove a volatile qualifier from some vm_domain members > > > M> > > > M> These are always accessed using atomic(9) intrinsics, so do not need the > > > M> qualifier. No functional change intended. > > > M> > > > M> Reviewed by: alc, kib > > > M> MFC after: 2 weeks > > > M> Sponsored by: Modirum MDPay > > > M> Sponsored by: Klara, Inc. > > > M> Differential Revision: https://reviews.freebsd.org/D51322 > > > > > > What's the benefit of removing the qualifiers? They act as documentation > > > and they match atomic(9) prototypes. To me this looks like removing a > > > const qualifier with a reasoning that we use the variable only as an > > > argument to functions that have const qualifier. > > > > Note that I updated the comments as well to indicate that accesses to > > the fields should be done through atomic(9), so the documentation is > > preserved. > > > > The reason atomic(9) prototypes include the volatile qualifier is to > > permit their use with volatile-qualified variables without a cast, not > > because the interface expects only volatile-qualified parameters. > > > > More generally, I believe that new code should always avoid using > > volatile to provide any kind of synchronization, ignoring the case of > > accesses to memory mapped with non-default attributes. atomic(9) > > intrinsics should be used where they are needed, and some comments > > should explain the synchronization protocol if it's not obvious. > > Hmm, when I wrote atomic_load/store(), volatile casts were used to utilize > compiler-specific semantic of volatile accesses, that happens to match > what loads and stores should do (access that place now). I.e. it is not > for the allowance to use volatile-qualified locations, but to provide > the C11-compatible semantic. My understanding is that C11 atomic ops take volatile-qualified parameters for the reason I gave above. There is a note in the standard which suggests this: NOTE Many operations are volatile-qualifed. The ‘‘volatile as device register’’ semantics have not changed in the standard. This qualifcation means that volatility is preserved when applying these operations to volatile objects. I see similar hints here, but I don't know what source this is based on: https://en.cppreference.com/w/c/atomic/atomic_load.html > After stating that, it is clear why qualifying the vars with volatile > is not what we want: the semantic of volatile is compiler-dependent, > and it only happens to match what is really used for code. Atomics > loads and stores do provide the primitive ops we need, and hide the > compiler-specific implementation under. > > I.e., volatile should *not* be used. From nobody Tue Jul 15 22:00:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhY5Y09YYz61gN8; Tue, 15 Jul 2025 22:00:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhY5X2Rf2z3C6K; Tue, 15 Jul 2025 22:00:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56FM038g064494; Wed, 16 Jul 2025 01:00:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56FM038g064494 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56FM03OV064493; Wed, 16 Jul 2025 01:00:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 16 Jul 2025 01:00:03 +0300 From: Konstantin Belousov To: Mark Johnston Cc: Gleb Smirnoff , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fad79db40505 - main - vm_pageout: Remove a volatile qualifier from some vm_domain members Message-ID: References: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bhY5X2Rf2z3C6K X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 15, 2025 at 05:44:13PM -0400, Mark Johnston wrote: > On Tue, Jul 15, 2025 at 11:04:57PM +0300, Konstantin Belousov wrote: > > On Tue, Jul 15, 2025 at 01:24:36PM -0400, Mark Johnston wrote: > > > On Tue, Jul 15, 2025 at 09:40:18AM -0700, Gleb Smirnoff wrote: > > > > On Tue, Jul 15, 2025 at 03:19:04PM +0000, Mark Johnston wrote: > > > > M> The branch main has been updated by markj: > > > > M> > > > > M> URL: https://cgit.FreeBSD.org/src/commit/?id=fad79db405052f3faad7184ea2c8bfe9f92a700d > > > > M> > > > > M> commit fad79db405052f3faad7184ea2c8bfe9f92a700d > > > > M> Author: Mark Johnston > > > > M> AuthorDate: 2025-07-15 15:16:40 +0000 > > > > M> Commit: Mark Johnston > > > > M> CommitDate: 2025-07-15 15:16:40 +0000 > > > > M> > > > > M> vm_pageout: Remove a volatile qualifier from some vm_domain members > > > > M> > > > > M> These are always accessed using atomic(9) intrinsics, so do not need the > > > > M> qualifier. No functional change intended. > > > > M> > > > > M> Reviewed by: alc, kib > > > > M> MFC after: 2 weeks > > > > M> Sponsored by: Modirum MDPay > > > > M> Sponsored by: Klara, Inc. > > > > M> Differential Revision: https://reviews.freebsd.org/D51322 > > > > > > > > What's the benefit of removing the qualifiers? They act as documentation > > > > and they match atomic(9) prototypes. To me this looks like removing a > > > > const qualifier with a reasoning that we use the variable only as an > > > > argument to functions that have const qualifier. > > > > > > Note that I updated the comments as well to indicate that accesses to > > > the fields should be done through atomic(9), so the documentation is > > > preserved. > > > > > > The reason atomic(9) prototypes include the volatile qualifier is to > > > permit their use with volatile-qualified variables without a cast, not > > > because the interface expects only volatile-qualified parameters. > > > > > > More generally, I believe that new code should always avoid using > > > volatile to provide any kind of synchronization, ignoring the case of > > > accesses to memory mapped with non-default attributes. atomic(9) > > > intrinsics should be used where they are needed, and some comments > > > should explain the synchronization protocol if it's not obvious. > > > > Hmm, when I wrote atomic_load/store(), volatile casts were used to utilize > > compiler-specific semantic of volatile accesses, that happens to match > > what loads and stores should do (access that place now). I.e. it is not > > for the allowance to use volatile-qualified locations, but to provide > > the C11-compatible semantic. > > My understanding is that C11 atomic ops take volatile-qualified > parameters for the reason I gave above. There is a note in the standard > which suggests this: > > NOTE Many operations are volatile-qualifed. The ‘‘volatile as device > register’’ semantics have not changed in the standard. This qualifcation > means that volatility is preserved when applying these operations to > volatile objects. > > I see similar hints here, but I don't know what source this is based on: > https://en.cppreference.com/w/c/atomic/atomic_load.html I answered more to the Gleb' question, about making atomically accessed locations volatile. Yes, volatile (and const for load since some time) are used to allow also accessing volatile-qualified atomics. But it is not to provide atomicity properties through volatile properties. > > > After stating that, it is clear why qualifying the vars with volatile > > is not what we want: the semantic of volatile is compiler-dependent, > > and it only happens to match what is really used for code. Atomics > > loads and stores do provide the primitive ops we need, and hide the > > compiler-specific implementation under. > > > > I.e., volatile should *not* be used. From nobody Wed Jul 16 03:49:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhhr76ZKCz621lL; Wed, 16 Jul 2025 03:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhhr75PDmz43Y8; Wed, 16 Jul 2025 03:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752637751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+RF5nJQOf+u2EldD1EHE7sIInhG9i2dDnIwCP4A0AU=; b=qb7uDrkZ28+zWYBz6JgEZ9bbZouU5AeSq7RMxZHSmA5jPHGjq5zSZ2RCF1bEkzHorqusJk vFghWy1ep68IAxq164a0QFBD3gcMX1atbnXnsX1R8x6WZkpr8Rm47qJyQKqKUflGPthTM9 sDRUVhFmKW0aZaJ1zpx4EoMLGVavXSgyuQtQ9RSi4B1zMPyUre4f+P5n/vNjy/NDpp3cBu +1WE9s2Z+yvedHz0HJWebXyhI/4bxvXSR+GwfuunF9MRV68gmoGnuBpQRHgfnIQhy4lwV0 /oYUIgaYEcraRgHxz29uQzSH0U105lF8cIoSMmpQkTOOrmyBQaH5mVkSjE7+aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752637751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+RF5nJQOf+u2EldD1EHE7sIInhG9i2dDnIwCP4A0AU=; b=hvgrspicUH7u3os+bjvifCeq50rTuyPgaz1Boj8PvA5ct2VW35ZcyL3ceNShjl4PncFzfn bRHJch7Oh5EfdvxblWh6rarbSd4Pz05WJ4l/y3Mxipxdu/1GZs4zE6zZYxuYY4u42uN6CG 0h7t4c50hwgBgiQRfxSA6m67HEsqo2pl+/9lO7biwwzxtd+4Yh6lBP1MVbkhMv78tVXIMa gNww+vped87bfq7C1iGhA9LNAhzRz3dMYCXrDHJxcL4k0ZEnObeihn/fcF4Bdd0U96Y//2 7jJfy7r8/eNNELTgzzt++b4Nq+4xxweQrSRSeg15r2sY023rsFVsbvNc4ORi8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752637751; a=rsa-sha256; cv=none; b=A7chKH9R0WoFP6Bmk2YUlQeoA1L72dCkbnQhFHvLxqlSIG7B9gedJ11DB0dIEuSs9SE9jx OzmiY/0vrANTyTOWpzns25KVCZZmAO1KYZM9uzPH1iY6Wn4dbH+9/TtnYv3rmwFIEQxhT8 JNxZhPRjHDYVdW3NyxDL2ABoDWVNMQZ/V8xO4Arhu0Wj4x+cM4ITYUBi135bAMr8wjV9lc TR/9dSPA3lAebm+zCuBT+wQc1i5nJ5YLmO2Bx074v/j09jUif8hqRkPW1FwMv3vor3uy+d wTFqlg2oAzUxh9gQOTXX8aj9hihh2MqxT0BD97qw7OCCSe5MkWsRqBWS0/N6jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhhr7511zz17d3; Wed, 16 Jul 2025 03:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56G3nBaG025273; Wed, 16 Jul 2025 03:49:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56G3nBk2025270; Wed, 16 Jul 2025 03:49:11 GMT (envelope-from git) Date: Wed, 16 Jul 2025 03:49:11 GMT Message-Id: <202507160349.56G3nBk2025270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cb193bdf8aa6 - main - amd64: restore semantic for VIRT_IN_DMAP() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb193bdf8aa685f0f161ee8c57c6d05d1ee6ef67 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cb193bdf8aa685f0f161ee8c57c6d05d1ee6ef67 commit cb193bdf8aa685f0f161ee8c57c6d05d1ee6ef67 Author: Konstantin Belousov AuthorDate: 2025-07-15 23:42:56 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-16 03:48:45 +0000 amd64: restore semantic for VIRT_IN_DMAP() The macro should check if the virtual address falls into working direct map, not that it falls into KVA potentially belonging to DMAP. This was its previous meaning, as can be seen in the only use by DMAP_TO_PHYS(). Fixes: 4dd828c80828637452a8a4e07a64e294c82e5d8b Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51334 --- sys/amd64/include/vmparam.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 59053665dc40..e4cc05cbb889 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -249,7 +249,7 @@ */ #define PHYS_IN_DMAP(pa) (dmaplimit == 0 || (pa) < dmaplimit) #define VIRT_IN_DMAP(va) \ - ((va) >= kva_layout.dmap_low && (va) < kva_layout.dmap_high) + ((va) >= kva_layout.dmap_low && (va) < kva_layout.dmap_low + dmaplimit) #define PMAP_HAS_DMAP 1 #define PHYS_TO_DMAP(x) __extension__ ({ \ From nobody Wed Jul 16 08:51:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhqYV3xtwz62HCF; Wed, 16 Jul 2025 08:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhqYV2nJpz3Gfj; Wed, 16 Jul 2025 08:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752655918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAq2QP+FK6nT/x6P3CqCC+qvfK6xM9Y09ciNjhOdUyM=; b=CnRlfU+GPcI9+IBrTnjpFQUH9JH8lU9+0eQdgSGWgKEc6C+Kib+FHLySXpgJFDMNaZTblF zeSUL/HAe8rEnA/sA938ms6+lur9YmMGrEw5iLNjF8B72YZR+5ofoWUj5Yzjjv2ibCJR+n y0AhhdxscCPZ/Y9iqm0nksgu1SlPab40Q3GSF61znA6dTkZ00djWYEGkm8g/rw+1iQ7H1b zbG1xJDsZznikPPejyLPs0dL7u0D8ZJMjWtOcewovXnpMUlAXpJA6hUJApIXb6TmNIkXpM D5BZ94TgBXP35qsxVXRPptEoeOvNsckJ5L1836NHULMipsBTRfN0rS3XM6FgZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752655918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAq2QP+FK6nT/x6P3CqCC+qvfK6xM9Y09ciNjhOdUyM=; b=bape32rdEXVRJLboAsiIw3NDf6/YHE5qBrWDusRZDPb33K/9Cw0z8Dr2WCrbQGMdzwiVNv FelToaOjsentMrmobMwqhMRxb6VB/6ZGOUZC9qqUcSWIdzj81qVWEadS1E95ZztRTX9kFE t/V3Zf3b9X7ZbmpjcEfL11bHksmQsTD7Gfnz6Qxw4ofE86+uyhPzRd9W9/U/oY3uIA1+iP pmZlNckylovA8GKJhywUPCJ/Lu1CXWWJRK4Ao5z6u2MP0/eMK6+mv32B62FzgSprohXQkx SQmC3eniMmKQQOcjzZlPs38OubjuaYF4TXdjzh/FeO/5I5p2RKbdwsjBn+G0Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752655918; a=rsa-sha256; cv=none; b=LErmKsRoKF0L2fr4oFIR0oNr63hAyHBOUei6Z+crZ5QhH2f7unae/GsT358UQVTO/WNU7o LMV9tk5iDrfrnnAc0bIkHfNI4VzJ5cZrvJ2fK4MDYvSKVRJO7uHrpdsVSxDYu5zQKxAuO2 lMPDwrjYj3EgF2IpjEjUUtBEMeWJ9sRW/2J2sJ4Ti6/ngmslnKZFQVXIeZ6GbqEiJba3AV bU+kuVCQWdpP2L1RtJa7XCb57vYRgbFIVTeujHrcdMigdK1E3EI2WAH9P2N5OuJAab+PgD Obc3hM8GVP5Ib1qr8qPjcKuUWHUy+3Vs3AuW4vmUMqjCF5tS1YErvkgsNPVwGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhqYV2JC9z1HHv; Wed, 16 Jul 2025 08:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56G8pwoX003063; Wed, 16 Jul 2025 08:51:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56G8pwkl003060; Wed, 16 Jul 2025 08:51:58 GMT (envelope-from git) Date: Wed, 16 Jul 2025 08:51:58 GMT Message-Id: <202507160851.56G8pwkl003060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 31d1c080ab7b - main - vfs cache: drop SDT_PROBES_ENABLED usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31d1c080ab7b6d713f7b5fd8ff78e07d63645bc6 Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=31d1c080ab7b6d713f7b5fd8ff78e07d63645bc6 commit 31d1c080ab7b6d713f7b5fd8ff78e07d63645bc6 Author: Mateusz Guzik AuthorDate: 2025-07-16 08:38:22 +0000 Commit: Mateusz Guzik CommitDate: 2025-07-16 08:50:35 +0000 vfs cache: drop SDT_PROBES_ENABLED usage since sdt probes started being hot patched This eliminates a now spurious branch on fpl.status --- sys/kern/vfs_cache.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ec3f947ffa55..89c1d779f04c 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -6421,15 +6421,11 @@ out: cache_fpl_smr_assert_not_entered(&fpl); cache_fpl_assert_status(&fpl); *status = fpl.status; - if (SDT_PROBES_ENABLED()) { - SDT_PROBE3(vfs, fplookup, lookup, done, ndp, fpl.line, fpl.status); - if (fpl.status == CACHE_FPL_STATUS_HANDLED) - SDT_PROBE4(vfs, namei, lookup, return, error, ndp->ni_vp, true, - ndp); - } - + SDT_PROBE3(vfs, fplookup, lookup, done, ndp, fpl.line, fpl.status); if (__predict_true(fpl.status == CACHE_FPL_STATUS_HANDLED)) { MPASS(error != CACHE_FPL_FAILED); + SDT_PROBE4(vfs, namei, lookup, return, error, ndp->ni_vp, true, + ndp); if (error != 0) { cache_fpl_cleanup_cnp(fpl.cnp); MPASS(fpl.dvp == NULL); From nobody Wed Jul 16 10:29:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhskC29FBz62Mbf; Wed, 16 Jul 2025 10:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhskC0LrVz42DR; Wed, 16 Jul 2025 10:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752661779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DkzLYAqzkcR60xVohkWb7ttYKWAjfayY6fsL8jkPv00=; b=TkVDHV7jH4dYnvWnLuXLDJkepcnnPh/Y2nyhrvTg9Lezr0P3F2YNBNrvfXa6jDlv44D1zD 9otWMFST9ueN7oezgMG31RGfT3+V0JHFAei9HuWn9FhoxJ34XO7keVA722YVY9v60aozEl 6J7lZS6X/hmIR57nCc6TSnZCqrwjR1o3J4UZIZI5jaQrxoD+tPm0jpgzqjr5F/AzRIaRz+ UkTsGYS3rsgwSAZVeZDNOCuYurzJr+XyqdSW3DZaH74jXYPYAWNtsUd7UJAuryBp9nb3hl e2KwwHxlpo3GoszKn6yCHpZkCj6AJWhozk7kRmm2hvhHmf329KmfdhJckfeD1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752661779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DkzLYAqzkcR60xVohkWb7ttYKWAjfayY6fsL8jkPv00=; b=j4E+F+PYxauMOI4GOWWRYxUgClvbggjMfzbUnMkzGImmK5JONLBmk/C2wJIcEvvu2TnYKw i0wL/9vgNrHrufwRRtO4SMFfShvbpehk8pOdYSG3a1/ZAYkQH7X2F+b+uj0gxyg9m6tli7 MsgflQ4RmYK7K2g92IPZKxQWkmRDq5KjbBC72Lh/YUL6t8qxzOHnZY7z6EdgNewr0Feqv4 jnTm/d4XNFqSlb/pB/ogVcsLMM2x8ytMk7TiKz1vMJlRrJ8SfFpnpkSgx+n+bYgNhcNL2u bxI8aWLB9/hHBkBSZZ1yyIbMGacavUwYpfd9NRL+lZT6vkcdFJYYG5FkmMf4Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752661779; a=rsa-sha256; cv=none; b=tFmytP561RURNIvXG4LVccoLgZa1M2IGjDBgmGgknwfzW8Rm7qjwOv05N5bRWzFgooog0z GmeUfMnxtK3i/c2LKDIFQAuqIRvBDAoOlh/ltBl1p1BgXG7/NVRI/9sHO3Rl3sWFehg8qw bKO7c6NAAocKkLzjyYELeF6fBp87H6/axxOVyHw2RM7Kheql/ebCjDKDP1fPwU7q8Hij74 mbi2emFdB04TRPJ79fUdIWcCz2SJy1djrxXIbfZFLQrKHgBdbNiJJqBJ+tGw4DYS/Festd b7e9rY+6dWWIMWQvhB20pXob+9aaDe4rDw+O9jw4/K0/x8skvM1E5KnjDleFEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhskB6myPz1KNH; Wed, 16 Jul 2025 10:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GATcvu078932; Wed, 16 Jul 2025 10:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GATcS3078929; Wed, 16 Jul 2025 10:29:38 GMT (envelope-from git) Date: Wed, 16 Jul 2025 10:29:38 GMT Message-Id: <202507161029.56GATcS3078929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 9388c2887817 - main - dtrace_fbt.4: Document the DTrace fbt provider List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9388c2887817d7162ebb356b39aa9b4ab67a8c00 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=9388c2887817d7162ebb356b39aa9b4ab67a8c00 commit 9388c2887817d7162ebb356b39aa9b4ab67a8c00 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-06-14 19:26:48 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-16 10:27:52 +0000 dtrace_fbt.4: Document the DTrace fbt provider Reported by: markj Reviewed by: christos, markj (earlier version), ziaee Obtained from: Mark Johnston, DTrace, FreeBSD Journal, May 2014 Obtained from: https://wiki.freebsd.org/DTrace/One-Liners MFC after: 2 weeks Relnotes: yes --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 3 +- share/man/man4/Makefile | 1 + share/man/man4/dtrace_fbt.4 | 332 +++++++++++++++++++++++++++ share/man/man4/dtrace_kinst.4 | 12 +- 4 files changed, 343 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index d44ee5023e78..da8cbd9ffe50 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2025 +.Dd July 16, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -1270,6 +1270,7 @@ Invalid command line options or arguments were specified. .Xr dwatch 1 , .Xr dtrace_audit 4 , .Xr dtrace_dtrace 4 , +.Xr dtrace_fbt 4 , .Xr dtrace_io 4 , .Xr dtrace_ip 4 , .Xr dtrace_kinst 4 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5e60f00bc09f..fcdbf81dc0fd 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -981,6 +981,7 @@ _ccd.4= ccd.4 .if ${MK_CDDL} != "no" _dtrace_provs= dtrace_audit.4 \ dtrace_dtrace.4 \ + dtrace_fbt.4 \ dtrace_io.4 \ dtrace_ip.4 \ dtrace_kinst.4 \ diff --git a/share/man/man4/dtrace_fbt.4 b/share/man/man4/dtrace_fbt.4 new file mode 100644 index 000000000000..3e35bb8c5bbc --- /dev/null +++ b/share/man/man4/dtrace_fbt.4 @@ -0,0 +1,332 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 16, 2025 +.Dt DTRACE_FBT 4 +.Os +.Sh NAME +.Nm dtrace_fbt +.Nd a DTrace provider for dynamic kernel tracing based on function boundaries +.Sh SYNOPSIS +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +.Sh DESCRIPTION +The Function Boundary Tracing +.Pq Nm fbt +provider instruments the entry and return of almost every kernel function +corresponding to an +.Xr elf 5 +symbol in the kernel and loaded kernel modules. +.Pp +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +fires whenever the +.Ar function +is called. +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +fires when the +.Ar function +returns. +.Pp +The +.Ar module +in the probe description is either the name of the loaded kernel module +or +.Ql kernel +for functions compiled into the kernel. +.Ss Function Boundary Instrumentation +The +.Nm fbt +will always instrument a function's entry, but +its return will be intsrumented so long as it can find a +.Ql ret +instruction. +.Pp +In some cases, +.Nm fbt +cannot instrument a function's entry and/or return. +Refer to subsection +.Sx Frame Pointer +for more details. +.Ss Probe Arguments +The arguments of the entry probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +are the arguments of the traced function call. +.Bl -column -offset indent "Entry Probe Argument" "Definition" +.It Sy Entry Probe Argument Ta Sy Definition +.It Fa args[0] Ta Function's first argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft size_t Fa size +.It Fa args[1] Ta Function's second argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft struct malloc_type Fa *type +.It Fa args[2] Ta Function's third argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft int Fa flags +.It Fa ... Ta ... +.El +.Pp +The arguments of the return probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +are +.Fa args[0] +.Po +the offset of the firing return instruction within the function; +useful to tell apart two different return statements in a single function +.Pc +and +.Fa args[1] +.Pq the return value, if any . +.Bl -column -offset indent "Return Probe Argument" "Definition" +.It Sy Return Probe Argument Ta Sy Definition +.It Fa args[0] Ta Offset of the traced return instruction +.It Fa args[1] Ta Function's return value +.Po e.g., a kernel virtual address if returning from a successful +.Xr malloc 9 +.Pc +.El +.Pp +Subsection +.Sx Example 2 : Getting Details About Probe's Arguments +shows how to get probe's argument count and types directly with +.Xr dtrace 1 +without having to resort to the reading function's source code +or documentation. +.Sh EXAMPLES +.Ss Example 1 : Listing Available FBT Probes +The following example shows how to list all the available +.Nm fbt +probes. +.Bd -literal -offset 2n +# dtrace -l -P fbt + ID PROVIDER MODULE FUNCTION NAME +[...] +31868 fbt kernel hammer_time entry +31869 fbt kernel hammer_time return +[...] +.Ed +.Pp +Since +.Fn hammer_time +is a part of the kernel and not a separate loaded module, the +.Ar module +column displays +.Ql kernel . +.Ss Example 2 : Getting Details About Probe's Arguments +The following example shows how to generate a program stability report of +.Xr malloc 9 Ap s +entry and return probes. +Those reports are useful to view +the probe's number of arguments and their types. +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:entry +[...] + Argument Types + args[0]: size_t + args[1]: struct malloc_type * + args[2]: int +.Ed +.Pp +The count and types of +.Nm fbt Ns Cm \&::malloc:entry +arguments +match the function signature of +.Xr malloc 9 : +.Va args[0] +is +.Ft size_t , +.Va args[1] +is +.Ft "struct malloc_type *" , +and +.Va "args[2]" +is +.Ft int . +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:return +[...] + Argument Types + args[0]: int + args[1]: void * +.Ed +.Pp +The +.Cm return +probe reports two arguments and their types: +the return instruction offset +.Pq the usual Ft int +and the function's return value, which in this case is +.Ft void * , +as +.Xr malloc 9 +returns a kernel virtual address. +.Ss Example 3 : Counting Kernel Slab Memory Allocation by Function +.Bd -literal -offset 2n +# dtrace -n 'fbt::kmem*:entry { @[probefunc] = count(); }' +dtrace: description 'fbt::kmem*:entry ' matched 47 probes +^C + kmem_alloc_contig 1 + kmem_alloc_contig_domainset 1 + kmem_cache_reap_active 1 + kmem_alloc_contig_pages 2 + kmem_free 2 + kmem_std_destructor 19 + kmem_std_constructor 26 + kmem_cache_free 151 + kmem_cache_alloc 181 +.Ed +.Ss Example 4 : Counting Kernel Slab Memory Allocation by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::kmem*:entry { @[caller] = count(); } END { printa("%40a %@16d\en", @); }' +^C + kernel`contigmalloc+0x33 1 + kernel`free+0xd3 1 + kernel`kmem_alloc_contig+0x29 1 +kernel`kmem_alloc_contig_domainset+0x19a 1 + zfs.ko`arc_reap_cb_check+0x16 1 +.Ed +.Ss Example 5 : Counting Kernel malloc()'s by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[caller] = count(); } END { printa("%45a %@16d\en", @); }' +^C + kernel`devclass_get_devices+0xa8 1 + kernel`sys_ioctl+0xb7 1 + dtrace.ko`dtrace_ioctl+0x15c1 1 + dtrace.ko`dtrace_ioctl+0x972 2 + dtrace.ko`dtrace_dof_create+0x35 2 + kernel`kern_poll_kfds+0x2f0 4 + kernel`kern_poll_kfds+0x28a 19 +.Ed +.Ss Example 6 : Counting Kernel malloc()'s by Kernel Stack Trace +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[stack()] = count(); }' +^C + dtrace.ko`dtrace_dof_create+0x35 + dtrace.ko`dtrace_ioctl+0x827 + kernel`devfs_ioctl+0xd1 + kernel`VOP_IOCTL_APV+0x2a + kernel`vn_ioctl+0xb6 + kernel`devfs_ioctl_f+0x1e + kernel`kern_ioctl+0x286 + kernel`sys_ioctl+0x12f + kernel`amd64_syscall+0x169 + kernel`0xffffffff81092b0b + 2 +.Ed +.Ss Example 7 : Summarizing vmem_alloc()'s by Arena Name and Size Distribution +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::vmem_alloc:entry { @[args[0]->vm_name] = quantize(arg1); }' +^C + + kernel arena dom + value ------------- Distribution ------------- count + 2048 | 0 + 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4 + 8192 |@@@@@@@@@@@@@ 2 + 16384 | 0 +.Ed +.Ss Example 8 : Measuring Total Time Spent Executing a Function +This DTrace script measures the total time spent in +.Fn vm_page* +kernel functions. +The +.Fn quantize +aggregation organizes the measurements into power-of-two buckets, +providing a time distribution in nanoseconds for each function. +.Bd -literal -offset 2n +fbt::vm_page*:entry { + self->start = timestamp; +} + +fbt::vm_page*:return /self->start/ { + @[probefunc] = quantize(timestamp - self->start); + self->start = 0; +} +.Ed +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr dtrace_kinst 4 , +.Xr tracing 7 +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%P pp. 898\(en903 +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter fbt Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-fbt.html#chp-fbt +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh CAVEATS +.Ss Stability and Portability +.Nm fbt +probes are by definition tightly coupled to kernel code; if the code underlying +a script changes, the script may fail to run or may produce incorrect results. +Scripts written for one version of +.Fx +might not work on others, +and almost certainly will not work on other operating systems. +.Pp +Individual +.Nm fbt +probes often do not correspond nicely to logical system events. +For example, consider a DTrace script which prints the destination +address of every IP packet as the kernel hands them over +to the network card driver (NIC). +An +.Nm fbt Ns -based +implementation of such a script is a discouragingly difficult task: +it involves instrumenting at least four different functions in different parts +of the IPv4 and IPv6 code. +At the same time, with the +.Xr dtrace_ip 4 +provider the script is a simple one-liner: +.Dl dtrace -n 'ip:::send {printf("%s", args[2]->ip_daddr);}' +.Pp +Make sure to review available +.Xr dtrace 1 +providers first +before implementing a custom script with the +.Nm fbt +provider. +If none of the DTrace providers offer the desired probes, +consider adding new statically-defined tracing probes +.Pq Xr SDT 9 . +.Ss Frame Pointer +Inline functions are not instrumentable by +.Nm fbt +as they lack a frame pointer. +A developer might explicitly disable inlining by adding the +.Ql __noinline +attribute to a function definition, +but of course this requires a recompilation of the kernel. +Building the kernel with +.Fl fno-omit-frame-pointer +is another way of preserving frame pointers. +Note, that sometimes compilers will omit the frame pointer in leaf functions, +even when configured with +.Fl fno-omit-frame-pointer . +.Pp +Function returns via a tail call are also not instrumentable by +.Nm fbt . +As a result, +a function might have an entry probe +and a mix of instrumented and uninstrumentable returns. +.Pp +Use +.Xr dtrace_kinst 4 +to trace arbitrary instructions inside kernel functions +and work around some of the +limitations +of +.Nm fbt . +.Ss Tracing DTrace +The +.Nm fbt +provider cannot attach to functions inside DTrace provider kernel modules. diff --git a/share/man/man4/dtrace_kinst.4 b/share/man/man4/dtrace_kinst.4 index 9debbc1bd106..c2187689749b 100644 --- a/share/man/man4/dtrace_kinst.4 +++ b/share/man/man4/dtrace_kinst.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 27, 2023 +.Dd July 16, 2025 .Dt DTRACE_KINST 4 .Os .Sh NAME @@ -43,10 +43,13 @@ creates probes on-demand, meaning it searches for and parses the function's instructions each time .Xr dtrace 1 is run, and not at module load time. -This is in contrast to FBT's load-time parsing, since +This is in contrast to +.Xr dtrace_fbt 4 Ap s +load-time parsing, since .Nm kinst can potentially create thousands of probes for just a single function, instead -of up to two (entry and return) in the case of FBT. +of up to two (entry and return) in the case of +.Xr dtrace_fbt 4 . A result of this is that .Cm dtrace -l -P kinst will not match any probes. @@ -79,7 +82,8 @@ Trace all instructions in # dtrace -n 'kinst::amd64_syscall:' .Ed .Sh SEE ALSO -.Xr dtrace 1 +.Xr dtrace 1 , +.Xr dtrace_fbt 4 .Sh HISTORY The .Nm kinst From nobody Wed Jul 16 10:31:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhsmt2m1kz62MR6; Wed, 16 Jul 2025 10:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhsmt1CzSz43LG; Wed, 16 Jul 2025 10:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752661918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IZ+LVVTcGqF+tDOyOAmQOHd7wXAcjNplFmeZShdxI/c=; b=BD4oesRFFdwts7CFfpDmWwAA35U1lasiL1IWMxxCmnFu5n2Yfk0d60JKGvWsSz0GqYmj0A fzAVY1OqZB7XZCCHez8zqVRLO8DIW8iL0J8InRB3RXdiNMUc6tZQOhUg4byxxG9aaFS1DP X6lMhS8zHMOwgzKcpD2p95O3UG8ESK2gtvglau0WCnsl8/rodehDrAa/FMLYOvVp9YOs3Y CfnqeB7bGEQB294XsxRzWkkfU+PlSdbqYr1Td0Y5VgcRLxuHueS0mFzILbvUHSdyFNTJLC jEhuTw34Q8JN93J07A8RrnF62aKtK8DgrWw/qp1rhFQiAm8rAgtw8vM3YdeKHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752661918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IZ+LVVTcGqF+tDOyOAmQOHd7wXAcjNplFmeZShdxI/c=; b=pdm5bs+MBYgKJuAoSX7hEZS4/PAxOkOP4rs/L1ztbTv+kGhNjCucVZnFB6nEbdUNF+kdNY 1LFaBVIj5vPNAIMk3eyPPqnlpHkyJ9ZYVFQULJvz91xQdecbRFsen9/qdTXYVtqQyQhHBr Bqnu6NXPII2efatfbKa7o3uFZcJPg+aOaaXubbEZJPfjb849iSf0CcBhlfXdczl5sE2071 7QU/dtp/NpgSQcLWtGm6aVsiK5PigcZoPFzRV7gMHD4CWb5sWtjhe0BSlPtu+AbfravfaD NNKFCifZpEm4T+lyYyowtg6o5fpmI6No0v/fuHeTgkVwC9fxEppWcSJovluoOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752661918; a=rsa-sha256; cv=none; b=ZdHyxItO5zE5CwddImWWOCXT5CNjv9kVI5PZcZP5gdkhZJaoh7delI1J0B8AxCl8GolaLC hZUfg1HnzzohCRbZXnYvv5RUIYb0aOBmuDtzPn3zUGAbAb/WsCoUDEzcRU/4Mi3fB33l+Q Uac+IkakgqhyLLsRv6q/HJXcS4VuQN4vDjhmQm/n+2n6TBxmhSgn/1YHyq4jIHHLCb/QIg MY6pVpkm+o7cb1Kbwrgssd6Z6F8jzT3RugNDy/UE5DPDIc+KtW8DDkWg5dC0O5078kGkC6 pGVMjhfDzDvqOm1CkdLenyMYE/ZvQem675Zaw8PKjwxE5jgizQK4R3l+O9Gs1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhsmt0jhpz1KmQ; Wed, 16 Jul 2025 10:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GAVver094237; Wed, 16 Jul 2025 10:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GAVvV6094234; Wed, 16 Jul 2025 10:31:57 GMT (envelope-from git) Date: Wed, 16 Jul 2025 10:31:57 GMT Message-Id: <202507161031.56GAVvV6094234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: d6ee73e5ad27 - main - stress2: Added syzkaller reproducers. Update the exclude list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6ee73e5ad271638d54932479b7f2a31e74e78ad Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=d6ee73e5ad271638d54932479b7f2a31e74e78ad commit d6ee73e5ad271638d54932479b7f2a31e74e78ad Author: Peter Holm AuthorDate: 2025-07-16 10:29:07 +0000 Commit: Peter Holm CommitDate: 2025-07-16 10:31:04 +0000 stress2: Added syzkaller reproducers. Update the exclude list --- tools/test/stress2/misc/all.exclude | 8 +- tools/test/stress2/misc/syzkaller80.sh | 320 +++++++++++++++++++++++++++++++++ tools/test/stress2/misc/syzkaller81.sh | 72 ++++++++ 3 files changed, 398 insertions(+), 2 deletions(-) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index f8a5ea4a91f1..54524c92eac0 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -16,8 +16,6 @@ fsck12.sh Waiting for fix 20230319 fsync.sh panic: Journal overflow 20190208 fuse.sh https://people.freebsd.org/~pho/stress/log/log0546.txt 20240828 fuse2.sh https://people.freebsd.org/~pho/stress/log/log0547.txt 20240828 -getrandom.sh Known DoS issue 20201107 -getrandom2.sh Known DoS issue 20200302 gjournal.sh panic: Journal overflow 20190626 gjournal2.sh panic: Journal overflow 20180125 gjournal3.sh panic: Bio not on queue 20171225 @@ -34,6 +32,7 @@ maxvnodes2.sh https://people.freebsd.org/~pho/stress/log/log0083.txt 20210329 memguard.sh https://people.freebsd.org/~pho/stress/log/log0088.txt 20210402 memguard2.sh Waiting for fix commit memguard3.sh Waiting for fix commit +mount7.sh https://people.freebsd.org/~pho/stress/log/log0549.txt 20240912 mlockall2.sh Unrecoverable OOM killing seen 20190203 mlockall6.sh https://people.freebsd.org/~pho/stress/log/log0430.txt 20230403 mlockall7.sh Needs further investigation 20210123 @@ -46,6 +45,7 @@ nfs16.sh panic: Failed to register NFS lock locally - error=11 20160608 nullfs28.sh Hang in "mount drain" seen 20220111 oom2.sh Hang in pfault 20180324 overcommit2.sh CAM stuck in vmwait seen 20200112 +pmc4.sh https://people.freebsd.org/~pho/stress/log/log0548.txt 20240904 pmc8.sh panic: [pmc,2749] (ri21, rc1) waiting too long for pmc to ... 20210621 rename14.sh https://people.freebsd.org/~pho/stress/log/log0433.txt 20230409 sctp2.sh panic: Queues are not empty when handling SHUTDOWN-COMPLETE 20210211 @@ -71,8 +71,12 @@ syzkaller59.sh Page fault 20220625 syzkaller65.sh panic: in_pcblookup_hash_locked: invalid local address 20230318 syzkaller66.sh panic: in_pcbconnect: inp is already connected 20230621 syzkaller67.sh panic: ASan: Invalid access, 8-byte read at ... 20230621 +syzkaller80.sh panic 20250711 +syzkaller81.sh panic 20250711 quota6.sh https://people.freebsd.org/~pho/stress/log/log0456.txt 20240707 truss3.sh WiP 20200915 +zfs18.sh https://people.freebsd.org/~pho/stress/log/log0560.txt 20241118 +zfs9.sh panic: sacked_bytes < 0 20250711 # Test not to run for other reasons: diff --git a/tools/test/stress2/misc/syzkaller80.sh b/tools/test/stress2/misc/syzkaller80.sh new file mode 100755 index 000000000000..31eae210d5b3 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller80.sh @@ -0,0 +1,320 @@ +#!/bin/sh + +# panic: ../../../kern/uipc_usrreq.c:1256: uipc_sosend_stream_or_seqpacket: Empty stailq 0xfffffe00ffe5fc88->stqh_last is 0xfffffe00ffe5fcd0, not head's first field address +# cpuid = 5 +# time = 1749593630 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00ffe5fab0 +# vpanic() at vpanic+0x136/frame 0xfffffe00ffe5fbe0 +# panic() at panic+0x43/frame 0xfffffe00ffe5fc40 +# uipc_sosend_stream_or_seqpacket() at uipc_sosend_stream_or_seqpacket+0xa39/frame 0xfffffe00ffe5fd10 +# sousrsend() at sousrsend+0x79/frame 0xfffffe00ffe5fd70 +# dofilewrite() at dofilewrite+0x81/frame 0xfffffe00ffe5fdc0 +# sys_writev() at sys_writev+0x69/frame 0xfffffe00ffe5fe00 +# amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe00ffe5ff30 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe00ffe5ff30 +# --- syscall (0, FreeBSD ELF64, syscall), rip = 0x82330181a, rsp = 0x8238dbf68, rbp = 0x8238dbf90 --- +# KDB: enter: panic +# [ thread pid 4484 tid 101524 ] +# Stopped at kdb_enter+0x33: movq $0,0x122ebc2(%rip) +# db> x/s version +# version: FreeBSD 15.0-CURRENT #0 main-n277833-948078b65c27-dirty: Tue Jun 10 06:01:36 CEST 2025 +# pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO +# db> + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +set -u +prog=$(basename "$0" .sh) +cat > /tmp/$prog.c < + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static unsigned long long procid; + +static void kill_and_wait(int pid, int* status) +{ + kill(pid, SIGKILL); + while (waitpid(-1, status, 0) != pid) { + } +} + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void execute_one(void) +{ + if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { + } + int i, call, thread; + for (call = 0; call < 5; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + if (call == 2) + break; + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); +} + +static void execute_one(void); + +#define WAIT_FLAGS 0 + +static void loop(void) +{ + int iter = 0; + for (;; iter++) { + int pid = fork(); + if (pid < 0) + exit(1); + if (pid == 0) { + execute_one(); + exit(0); + } + int status = 0; + uint64_t start = current_time_ms(); + for (;;) { + sleep_ms(10); + if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) + break; + if (current_time_ms() - start < 5000) + continue; + kill_and_wait(pid, &status); + break; + } + } +} + +uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; + +void execute_call(int call) +{ + intptr_t res = 0; + switch (call) { + case 0: + res = syscall(SYS_socketpair, /*domain=*/1ul, /*type=SOCK_STREAM*/ 1ul, + /*proto=*/0, /*fds=*/0x200000000040ul); + if (res != -1) { + r[0] = *(uint32_t*)0x200000000040; + r[1] = *(uint32_t*)0x200000000044; + } + break; + case 1: + memcpy((void*)0x200000000100, "\x09\x00\x10\x00", 4); + syscall(SYS_setsockopt, /*fd=*/r[1], /*level=*/0, /*optname=*/3, + /*optval=*/0x200000000100ul, /*optlen=*/4ul); + break; + case 2: + *(uint64_t*)0x2000000018c0 = 0; + *(uint32_t*)0x2000000018c8 = 0; + *(uint64_t*)0x2000000018d0 = 0; + *(uint64_t*)0x2000000018d8 = 0; + *(uint64_t*)0x2000000018e0 = 0x200000001880; + memcpy((void*)0x200000001880, "\x10\x00\x00\x00\xff\xff\x00\x00\x06", 9); + *(uint64_t*)0x2000000018e8 = 0x10; + *(uint32_t*)0x2000000018f0 = 0; + syscall(SYS_sendmsg, /*fd=*/r[0], /*msg=*/0x2000000018c0ul, /*f=*/0ul); + for (int i = 0; i < 64; i++) { + syscall(SYS_sendmsg, /*fd=*/r[0], /*msg=*/0x2000000018c0ul, /*f=*/0ul); + } + break; + case 3: + syscall(SYS_writev, /*fd=*/r[0], /*vec=*/0ul, /*vlen=*/0ul); + for (int i = 0; i < 64; i++) { + syscall(SYS_writev, /*fd=*/r[0], /*vec=*/0ul, /*vlen=*/0ul); + } + break; + case 4: + syscall(SYS_setsockopt, /*fd=*/(intptr_t)-1, /*level=*/0, /*optname=*/0xa, + /*optval=*/0ul, /*optlen=*/0ul); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, + /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, + /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x1012ul, + /*fd=*/(intptr_t)-1, /*offset=*/0ul); + const char* reason; + (void)reason; + for (procid = 0; procid < 4; procid++) { + if (fork() == 0) { + loop(); + } + } + sleep(1000000); + return 0; +} +EOF +mycc -o /tmp/$prog -Wall -Wextra -O0 /tmp/$prog.c -lpthread || exit 1 + +work=/tmp/$prog.dir +rm -rf $work +mkdir $work +cd /tmp/$prog.dir +timeout 3m /tmp/$prog > /dev/null 2>&1 + +rm -rf /tmp/$prog /tmp/$prog.c /tmp/$prog.core /tmp/$prog.?????? $work +exit 0 diff --git a/tools/test/stress2/misc/syzkaller81.sh b/tools/test/stress2/misc/syzkaller81.sh new file mode 100755 index 000000000000..e3e4ec50aeea --- /dev/null +++ b/tools/test/stress2/misc/syzkaller81.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +# panic: kern_clock_gettime: 22 +# cpuid = 1 +# time = 1750181240 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01a6084ba0 +# vpanic() at vpanic+0x136/frame 0xfffffe01a6084cd0 +# panic() at panic+0x43/frame 0xfffffe01a6084d30 +# kern_clock_nanosleep() at kern_clock_nanosleep+0x38f/frame 0xfffffe01a6084db0 +# sys_clock_nanosleep() at sys_clock_nanosleep+0x49/frame 0xfffffe01a6084e00 +# amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe01a6084f30 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01a6084f30 +# --- syscall (0, FreeBSD ELF64, syscall), rip = 0x8233d281a, rsp = 0x820bfb2b8, rbp = 0x820bfb2e0 --- +# KDB: enter: panic +# [ thread pid 26119 tid 104417 ] +# Stopped at kdb_enter+0x33: movq $0,0x122a7b2(%rip) +# db> x/s version +# version: FreeBSD 15.0-CURRENT #1 ufs-n278031-3296ff02387b: Tue Jun 17 16:40:44 CEST 2025 +# pho@mercat1.netperf.freebsd.org:/var/tmp/deviant3/sys/amd64/compile/PHO +# db> + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +set -u +prog=$(basename "$0" .sh) +cat > /tmp/$prog.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + syscall(SYS_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, + /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, + /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x1012ul, + /*fd=*/(intptr_t)-1, /*offset=*/0ul); + const char* reason; + (void)reason; + if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { + } + *(uint64_t*)0x200000000040 = 0x10000000000; + *(uint64_t*)0x200000000048 = 0x4000000; + syscall(SYS_clock_nanosleep, /*id=*/0x10ul, /*flags=TIMER_ABSTIME*/ 1ul, + /*rqtp=*/0x200000000040ul, /*rmtp=*/0ul); + return 0; +} +EOF +mycc -o /tmp/$prog -Wall -Wextra -O0 /tmp/$prog.c || exit 1 + +work=/tmp/$prog.dir +rm -rf $work +mkdir $work +cd /tmp/$prog.dir +timeout 3m /tmp/$prog > /dev/null 2>&1 + +rm -rf /tmp/$prog /tmp/$prog.c /tmp/$prog.core /tmp/$prog.?????? $work +exit 0 From nobody Wed Jul 16 10:40:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhsyg5gxrz62MvG; Wed, 16 Jul 2025 10: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhsyg4rp2z45yQ; Wed, 16 Jul 2025 10:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752662427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wSc8qjVpu9WO/fXnUNplNoq5jhXyO51sd/jrdAhCFmw=; b=x8WBGkpWyOWSLaCV1iOYoPYn+DbxH+k9kNOWMBMD5Ugsf0qiButIQEChxLZU1M9AP77i8Y 8bjR+9JyjqeJmerncW0vpoaSUSuPrBj4RsD0PRSjOnXpOWAdph/QRbi0IOc8p/vk7Helo2 pas22lVg6Mgwu9q0ZpT6HtYGDjVeXmJIZEFoifQZB/CcPBZYVMPKTMynfRH9tBza0pTkyN fLSgZ8dvc/R7gMG3LyTGmQcsIiQJRE5/IveiF3WFAGL8MlSa2W2slLIqktzIVlzcbKQdvZ DWgA8KoMFoLPQbnadpbzQnIBTYcj1J1YEtWa+0Xna9OEtnhwTWLdyg3Z9OObbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752662427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wSc8qjVpu9WO/fXnUNplNoq5jhXyO51sd/jrdAhCFmw=; b=FB+HfZdwK69d8z4WvLaZuFwlJnYAcQ0bJ1zWbdiHzKuATwRb3TsxIZCA4O48GlhG+NKMWq Ol4Jt/G7D5pIWbkkCokJsvJHkfo+Iw7MBn8XhRQOAMB7HI8ZM6aOJPFf22FeK/3xdxGyKd hc0nNcpif/YIkUgjPGOzXnGVsPxt7bZXGs+extzhEs18l0a0oG9LeP8+G/o28uRST4Fus9 cuYnjGrUI2d1ty2RY9bpiCAx957vGPxH2q5vzDaiW6DVMifJ97hKTuFhDeuVizO9t6XD6w dhTqge/eQyq3HAOjWmuON5btwR+BBDor8QHCNunGgB8WivbNiAjyNojJo0YTUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752662427; a=rsa-sha256; cv=none; b=JgRuwW3A2N5Qt+hATIuS0JZZshMkAZeayUuOJ/lw0SPR/vT+2H1KzC2qgMOo0RAfl2xnma HXUwUxPINE+OycdRkXoPv7CkUEIKutgY3nFnjOfHtvIQYPmTrHO/to2qC4lHYC734H6e8n K87BT7ED1V22/IATod9grY/V8M5u7c6J5261LUMOnVVNxihIHdRPRqeCViUpXQJZOhs81B vtxyjVP6yWkZoZJam1QIbn9dpz/pDRboHJNa1EMy2DM3GxXHdqucSWgybyww/XffDvMoJb F/+0/kIRIfRPg3uDof3axETz6X5fULnqjIFv2oAHhy8+yXsQED8R7o6joBE0Qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhsyg4RDxz1LLc; Wed, 16 Jul 2025 10:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GAeRNj006693; Wed, 16 Jul 2025 10:40:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GAeRQV006690; Wed, 16 Jul 2025 10:40:27 GMT (envelope-from git) Date: Wed, 16 Jul 2025 10:40:27 GMT Message-Id: <202507161040.56GAeRQV006690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 113f2f0c76a7 - main - stress2: Updated dtrace comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 113f2f0c76a7ddc09cbadaa199e47cecec0f2814 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=113f2f0c76a7ddc09cbadaa199e47cecec0f2814 commit 113f2f0c76a7ddc09cbadaa199e47cecec0f2814 Author: Peter Holm AuthorDate: 2025-07-16 10:38:25 +0000 Commit: Peter Holm CommitDate: 2025-07-16 10:38:25 +0000 stress2: Updated dtrace comment --- tools/test/stress2/misc/fullpath2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/stress2/misc/fullpath2.sh b/tools/test/stress2/misc/fullpath2.sh index e4024c32f317..f0037851482d 100755 --- a/tools/test/stress2/misc/fullpath2.sh +++ b/tools/test/stress2/misc/fullpath2.sh @@ -123,7 +123,7 @@ static volatile u_int *share; #define NB 1024 #define RUNTIME 300 -/* dtrace -w -n 'fbt::*vn_fullpath1:entry {@rw[execname,probefunc] = count(); }' */ +/* dtrace -w -n 'fbt::*vn_fullpath:entry {@rw[execname,probefunc] = count(); }' */ static void getfiles(pid_t pid) From nobody Wed Jul 16 11:57:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhvgk3BD0z62R2q; Wed, 16 Jul 2025 11:57:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhvgk2Ptfz3qsm; Wed, 16 Jul 2025 11:57:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752667058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jxOrwnv8comwdU7kijiyhYImu2FlsDax1rqdHAvPoXY=; b=JkCRy09EzuPOEeF+VYFA2+Wtxi8bwAnaIG41OqeQo4mS4Uzes8SHLDUZUmI7UBPZXpx+VG WAWhUCQjN4qNsiOOoOGP5NqmPzpCU+k75Dx0ZgA4GsGAjKTIvvy52Olt3u2/vYSCudCR98 0+H5tdkH+t4YfWaKlHFbQmy4QTq6spVxWmp3c9lQ0txgvrYHSFwKWUijLPv3fhvdOBmoLP zk/xHS63+wwBFH89BkFd4JBwmBfEp+KKLCK06dVCvloPqAfNpHqr1CFYxRoWcxd2JDT+ev jDfJImBRy00xO3o7LIr8FgpU/SsZcTi72yuleps4IOFtZwHvCNDXbm5vh3/iIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752667058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jxOrwnv8comwdU7kijiyhYImu2FlsDax1rqdHAvPoXY=; b=WHlGBrFM4SH9XQm1OPbaVGr0Bfh5JNo0ChOaiUNg18SvlBW9Kp9oDAGR29SEYnfQDYdis2 Jv8w6uioqWug0+KlddeVkvksHlEhRH/88/GbsIWRXmZAIsO9yz+9bWDdpcPOk5bmp3Zc1W 9fw3zYRKt/AI4lJ/Csbkt755LhZOLY+fzA1ne/ahA4qj/2dwtZviOfFw4IlaSw7z9xHjgs 1GkAhpGYx9Zv9cqSjbpDpVMxbifkjpZ1PsVD6Hn/hs5cFY+mvTPfFLZm+GSrG9oYuS3qN1 i5VimGReVTfcExeT+iKs0aSY3i1babhT+TJLYkKv1B5EophVECLRXgxtqw1qiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752667058; a=rsa-sha256; cv=none; b=T3LZ0tvijy/CrcOuiWdIv3z4x630WO7muYXmGdMjKFIj6kLGH9d8VoW+wrybiv3TmIno07 VLmPxgyDT7cIMSepGZWezKE2K172hc2eyO/+7+S358BWniE44v9JZ70h2hYYcBHySLX9tp mryNFl7YRv2f0fkzVAl8v7bfqdXgj7b8HWVyBZikp2eWmWwkaSPTMaT1MPVEn0laqBVMPL C5OUxB+typAX9MOz7KU5zoiuJuCeNG/DjkaspLS7qtLyvrNLDWuRx/0Rn+ui+QP4MICXZC QtLmdbdCzy4snN/BYm061u/gbYFGKF0Lm7HHyxBFpqZ0OX8uUTrMR7pWvmns9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhvgk1vH7z1NCL; Wed, 16 Jul 2025 11:57:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GBvcLu047482; Wed, 16 Jul 2025 11:57:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GBvc6S047479; Wed, 16 Jul 2025 11:57:38 GMT (envelope-from git) Date: Wed, 16 Jul 2025 11:57:38 GMT Message-Id: <202507161157.56GBvc6S047479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d00f66feaa17 - main - pf: delay taking the rules lock in pf_test() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d00f66feaa174de17f7df3647028d80c018a2fcc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d00f66feaa174de17f7df3647028d80c018a2fcc commit d00f66feaa174de17f7df3647028d80c018a2fcc Author: Kristof Provost AuthorDate: 2025-07-13 14:04:19 +0000 Commit: Kristof Provost CommitDate: 2025-07-16 11:33:51 +0000 pf: delay taking the rules lock in pf_test() We don't need the rules lock to protect the mbuf, or even the kif. If an interface is removed (which is the only way for a kif to go away) we're not going to receive traffic on it. We can't delay taking the lock more, because pf_setup_pdesc() calls the normalisation code, which iterates the scrub rules. If we ever get rid of those (as OpenBSD has) it should be possible to delay taking the rules lock until we actually need to iterate of the rules. That is, we might be able to avoid taking it at all if we match an existing state. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D51329 --- sys/netpfil/pf/pf.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 264830fcf534..ad42f1cccd33 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -10064,6 +10064,8 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->didx = (dir == PF_IN) ? 1 : 0; pd->af = pd->naf = af; + PF_RULES_ASSERT(); + TAILQ_INIT(&pd->sctp_multihome_jobs); if (default_actions != NULL) memcpy(&pd->act, default_actions, sizeof(pd->act)); @@ -10477,35 +10479,30 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 PF_RULES_RLOCK_TRACKER; KASSERT(dir == PF_IN || dir == PF_OUT, ("%s: bad direction %d\n", __func__, dir)); M_ASSERTPKTHDR(*m0); + NET_EPOCH_ASSERT(); if (!V_pf_status.running) return (PF_PASS); - PF_RULES_RLOCK(); - kif = (struct pfi_kkif *)ifp->if_pf_kif; if (__predict_false(kif == NULL)) { DPFPRINTF(PF_DEBUG_URGENT, ("%s: kif == NULL, if_xname %s\n", __func__, ifp->if_xname)); - PF_RULES_RUNLOCK(); return (PF_DROP); } if (kif->pfik_flags & PFI_IFLAG_SKIP) { - PF_RULES_RUNLOCK(); return (PF_PASS); } if ((*m0)->m_flags & M_SKIP_FIREWALL) { - PF_RULES_RUNLOCK(); return (PF_PASS); } if (__predict_false(! M_WRITABLE(*m0))) { *m0 = m_unshare(*m0, M_NOWAIT); if (*m0 == NULL) { - PF_RULES_RUNLOCK(); return (PF_DROP); } } @@ -10518,12 +10515,10 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 ifp = ifnet_byindexgen(pd.pf_mtag->if_index, pd.pf_mtag->if_idxgen); if (ifp == NULL || ifp->if_flags & IFF_DYING) { - PF_RULES_RUNLOCK(); m_freem(*m0); *m0 = NULL; return (PF_PASS); } - PF_RULES_RUNLOCK(); (ifp->if_output)(ifp, *m0, sintosa(&pd.pf_mtag->dst), NULL); *m0 = NULL; return (PF_PASS); @@ -10538,11 +10533,12 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 /* But only once. We may see the packet multiple times (e.g. * PFIL_IN/PFIL_OUT). */ pf_dummynet_flag_remove(pd.m, pd.pf_mtag); - PF_RULES_RUNLOCK(); return (PF_PASS); } + PF_RULES_RLOCK(); + if (pf_setup_pdesc(af, dir, &pd, m0, &action, &reason, kif, default_actions) == -1) { if (action != PF_PASS) From nobody Wed Jul 16 11:57:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhvgl6dFPz62R7H; Wed, 16 Jul 2025 11:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhvgl3mPtz3qgc; Wed, 16 Jul 2025 11:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752667059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x2yqz6vUtC0+oTS9D7qouM6hnajUAvB6xvUaMp74dro=; b=cXQidJ89bsdxZX/AbSK9NMqpEaI44ZTRm7DcSpkOlc5DcA0hcwlvhjFXzKurhVCWGZmlgd ZAHtOR7cPDohIw71z3hfTfqeh5ZSMvmipTDKLC/YHEK3dnH2xkPuyjKHHcB9PXWP44raXr 1mlnDVPefUhNMdExp7sgbJeD6D0TlxhSMKIegDQob1TOubNM/uUMKYbPszjVK1HyDXt9WD GsfoLTh0eWWmtzE6qs38DriMoNSa0I5flWPTgOtxnNlKMWM+F1KtYbcZBte+m/e83jXcfb rslSTOAcEldj78sUzKB5dZyEA1zM54OVG1ZApndFHOBXjDyQvMD2tYqRVZ5F3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752667059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x2yqz6vUtC0+oTS9D7qouM6hnajUAvB6xvUaMp74dro=; b=g4c3T1SvDDtpG6XwRXibTcQul2VNWkMHEktu7ZywfZb5RtyURAvrKOoKqZpzLGIGrjRdQL z9vdaqJokf8aG4IYLA4rP/azGX2vqbHqKmd/RJ/fyGxqco6F8UtoQg1WPeD4OhJ/aQYxJB 9yX1tnNkUsYA4iv46drtMAlmHgqmp4tg1IATAbt0OTD9ESLph/A8yi+86n6OOUmCV9Vo9n xAhF4cwHNden/Nnq2sm2V4PlIZXlByKeWFSs8+KQb4Ih+Qv6Ff7sdT8l56DkaYlHb1E8Nq Jw+uKzSG/a36hu4NU4mFFpRZAQMztN7jPcFfco5pasdTydCoU6bzhTUfwtI92Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752667059; a=rsa-sha256; cv=none; b=Ta4MqhA43e4RRiiESRmJPsBVeiC8fEhu0NEwgrWiaWGodM9AYQ656IjtFWt/bwIq/aRYsr 4ymb2KVbAOZBdlS2di92bZHvLvx+wGmy1rBzb3wxmpJgYTIu0WOdXi954qrW+vX5ZcnNs9 UmuBaFzHVtrkeW8Lts+5HiHnQy191YDNpMFYhaggcNoxOteNhacSlb2rToS4D75kRJ5SxC Mm+0XFMI+eb4lYO6DUEsfbBnwa/snFz40/loaDlDhPxhIbymosbhlMlgdm4GPEICBuoEVC DD+h7mOXXiHppoqXWhV9GeHKSubAzobL7Q2oHojAvJrSVRRXKUT6M44Z4N9b+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhvgl3M9Rz1NCM; Wed, 16 Jul 2025 11:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GBvd5x047516; Wed, 16 Jul 2025 11:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GBvdpc047513; Wed, 16 Jul 2025 11:57:39 GMT (envelope-from git) Date: Wed, 16 Jul 2025 11:57:39 GMT Message-Id: <202507161157.56GBvdpc047513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: cb43e97aea11 - main - pf: add missing IPv6 length check List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb43e97aea11a788972f977ea68c518bfb7fc0c1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cb43e97aea11a788972f977ea68c518bfb7fc0c1 commit cb43e97aea11a788972f977ea68c518bfb7fc0c1 Author: Kristof Provost AuthorDate: 2025-07-15 08:40:25 +0000 Commit: Kristof Provost CommitDate: 2025-07-16 11:33:51 +0000 pf: add missing IPv6 length check We failed to verify that the packet was long enough for the provided IPv6 packet length. This could result in us walking off the end of the mbuf and panicing. PR: 288224 Reported by: Robert Morris Tested by: Robert Morris Reviewed by: emaste Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D51324 --- sys/netpfil/pf/pf.c | 6 ++++++ tests/sys/netpfil/pf/nat64.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ad42f1cccd33..9acfb19645b7 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -10141,6 +10141,12 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, } h = mtod(pd->m, struct ip6_hdr *); + if (pd->m->m_pkthdr.len < + sizeof(struct ip6_hdr) + ntohs(h->ip6_plen)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } if (pf_walk_header6(pd, h, reason) != PF_PASS) { *action = PF_DROP; diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py index adae2489ce5e..5cc4713a16cc 100644 --- a/tests/sys/netpfil/pf/nat64.py +++ b/tests/sys/netpfil/pf/nat64.py @@ -272,3 +272,18 @@ class TestNAT64(VnetTestTemplate): reply = self.common_test_source_addr(packet) icmp = reply.getlayer(sp.ICMPv6EchoRequest) assert icmp + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_bad_len(self): + """ + PR 288224: we can panic if the IPv6 plen is longer than the packet length. + """ + ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") + import scapy.all as sp + + packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=2, plen=512) \ + / sp.ICMPv6EchoRequest() / sp.Raw("foo") + reply = sp.sr1(packet, timeout=3) + # We don't expect a reply to a corrupted packet + assert not reply From nobody Wed Jul 16 11:57:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhvgn1h9kz62RRF; Wed, 16 Jul 2025 11:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhvgm5Nhfz3qZZ; Wed, 16 Jul 2025 11:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752667060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PZU40OTlAceH0LVwSN3RZ9qILWZVjnpowea2dwoiU58=; b=nfMINRm4b8b2I9XZWN20dWL1KoV31OjTBvr26OzPqHMtw5QjdKUKm6rYOnUayCRmUPFfBR f0gjWboj7TswX1vnEt0U3wTNQ1btCCvwZXWSa331pep1PceTnXhHDWR7Ex1doKNuwEiH17 vlk87kejvHT+2f9RJMu3aTJRitpSk7wDJKtp7fYC6efWbT6ITbL+bXakke0I/4Mbpz9ffm jzTR4AgN4HjtwD/lngruM0VxvuDTiJ0I6J19PNElICohyo1IV4fYXNvzxG/B9Ktm7e0TXV ahRLNRD3EalfjLnRVfyAf4B/Gmiyd5t5lxEScABYe7XpOF0v+GDT89GpsbZs9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752667060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PZU40OTlAceH0LVwSN3RZ9qILWZVjnpowea2dwoiU58=; b=CDhQu0rDgowtWcDU3GAvwK74HYpbZY022Odd/4bhe2BDc5Hd7EDU0jMECNYLki/hujx1tF G1VSy9VkZF7TB8ybYpajv08J9/SdIvJyk/H+o4UWXoi9KlihfxfR/6qllAoM1Ej4kDP4p0 K4ZRRqM2q9bFx7wLHbMCfWMOEpynIq41p25Y5OLXRq0Q6Xk59XiiCGDWaxPywyQlxbDOsJ /JISZhpGB87TruMjkjGPcHQoDesJ8UFshHUzQ3nFcEAY/0U1Le51R2hxmgaXxOOfOIGclv 3VjxcChXwXnTzrUGTDVfch+uH9fX6ckYIa2Kg1uWBw/ZkkxYZ1VBrQIl58Ok9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752667060; a=rsa-sha256; cv=none; b=UIQJGGGbrDcyKIP/aQv0RdWlWpeJUS29/6BVQCSzerW6007czQ4kQoq0MD3KL8LbURe/l1 3XCuNJkidOvOXWgdUIlqhlJYi/HiwyJ83BkN2Itpv10EEkCymRApWKeLUxi61KEaAE0/2m JBZggODMUklL2+z0w4b/ON7E1Iklrc7ly/Ci8oqJhs2q/IZ6bF8AmTsXeuz6fGOm8d39Ry tlWkEIQpXZlix6lZI1jrnOMWkQRTGf04Civ8JNXWh/FAgiP3ZEIuf11RWkZj1yKxwfNiNZ UAFtNlS8z8ipBSESUKhS8Z5omoiMV+LEkA2xwkhe3GsB0Bkcd+Rm1RDKMK+fPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhvgm3vltz1Mxq; Wed, 16 Jul 2025 11:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GBve1X047550; Wed, 16 Jul 2025 11:57:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GBveEQ047547; Wed, 16 Jul 2025 11:57:40 GMT (envelope-from git) Date: Wed, 16 Jul 2025 11:57:40 GMT Message-Id: <202507161157.56GBveEQ047547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 451179a352a2 - main - Revert "pf: remove unused argument from pf_send_icmp()" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 451179a352a20fd08494774eaf26949981c4c9a1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=451179a352a20fd08494774eaf26949981c4c9a1 commit 451179a352a20fd08494774eaf26949981c4c9a1 Author: Kristof Provost AuthorDate: 2025-07-16 08:44:13 +0000 Commit: Kristof Provost CommitDate: 2025-07-16 11:33:51 +0000 Revert "pf: remove unused argument from pf_send_icmp()" This reverts commit ea97c397d75c3fd108b1bc033f39d3e6d41c7dfe. The rule is used in the ALTQ case, which I missed. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9acfb19645b7..009f7e4d78b1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -327,7 +327,7 @@ int pf_change_icmp_af(struct mbuf *, int, sa_family_t); int pf_translate_icmp_af(int, void *); static void pf_send_icmp(struct mbuf *, u_int8_t, u_int8_t, - int, sa_family_t, int); + int, sa_family_t, struct pf_krule *, int); static void pf_detach_state(struct pf_kstate *); static int pf_state_key_attach(struct pf_state_key *, struct pf_state_key *, struct pf_kstate *); @@ -4349,11 +4349,11 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, } else if (pd->proto != IPPROTO_ICMP && pd->af == AF_INET && r->return_icmp) pf_send_icmp(pd->m, r->return_icmp >> 8, - r->return_icmp & 255, 0, pd->af, rtableid); + r->return_icmp & 255, 0, pd->af, r, rtableid); else if (pd->proto != IPPROTO_ICMPV6 && pd->af == AF_INET6 && r->return_icmp6) pf_send_icmp(pd->m, r->return_icmp6 >> 8, - r->return_icmp6 & 255, 0, pd->af, rtableid); + r->return_icmp6 & 255, 0, pd->af, r, rtableid); } static int @@ -4411,7 +4411,7 @@ pf_send_challenge_ack(struct pf_pdesc *pd, struct pf_kstate *s, static void pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, int mtu, - sa_family_t af, int rtableid) + sa_family_t af, struct pf_krule *r, int rtableid) { struct pf_send_entry *pfse; struct mbuf *m0; @@ -9016,7 +9016,7 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, if (ip->ip_ttl <= IPTTLDEC) { if (r->rt != PF_DUPTO) pf_send_icmp(m0, ICMP_TIMXCEED, - ICMP_TIMXCEED_INTRANS, 0, pd->af, + ICMP_TIMXCEED_INTRANS, 0, pd->af, r, pd->act.rtableid); goto bad_locked; } @@ -9162,7 +9162,7 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, } pf_send_icmp(m0, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - ifp->if_mtu, pd->af, pd->act.rtableid); + ifp->if_mtu, pd->af, r, pd->act.rtableid); } SDT_PROBE1(pf, ip, route_to, drop, __LINE__); goto bad; @@ -9313,7 +9313,7 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, if (ip6->ip6_hlim <= IPV6_HLIMDEC) { if (r->rt != PF_DUPTO) pf_send_icmp(m0, ICMP6_TIME_EXCEEDED, - ICMP6_TIME_EXCEED_TRANSIT, 0, pd->af, + ICMP6_TIME_EXCEED_TRANSIT, 0, pd->af, r, pd->act.rtableid); goto bad_locked; } @@ -9462,7 +9462,7 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, if (r->rt != PF_DUPTO) pf_send_icmp(m0, ICMP6_PACKET_TOO_BIG, 0, - ifp->if_mtu, pd->af, pd->act.rtableid); + ifp->if_mtu, pd->af, r, pd->act.rtableid); } SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); goto bad; From nobody Wed Jul 16 13:36:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhxsl22Cpz61XDH; Wed, 16 Jul 2025 13:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhxsk5rdlz3Y4W; Wed, 16 Jul 2025 13:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752672986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xh1nj0YkM5g1swaMlKQftk25QZm2XM4yFJE7EoX00s=; b=QmRMTs/yZ0y3ZBsehpOd6iiwY8Amlg4xz4STjFm6aYrRVfq8ZjGYHK/gH2a+Irqm+0iC46 hQkJDmsQwtQJa6+sNOoqr8Fm6NOGrLXC6z2uE9oDBgZu2Cpaf1F2//13Qa5pGVGpa1rtqR rvwrNzEsqGaGBoIHBW9L9XUEU1mqxlxzVD7BLot3jW8h8X2B+SQqNOk5CZhBVpgz0ZvtDI Hsq4TtAofKPFKDRq1b6U5KEGoT+CN3aPpBe1GJqzBT6D+0h21+6P7zSL2J1WTLnArZBeOj sH3Ql518f4av9P2b4aZQ4M+SAxPRwbffGIHufc7FGJT1Bt0cyf3NMHGxa7Slqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752672986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xh1nj0YkM5g1swaMlKQftk25QZm2XM4yFJE7EoX00s=; b=aGjMV0XQczkltKn4K5Hq2eqdF0HsS+yjonZMWyDWP9PFyLyzROb4By/tpJA5J9FniLWqnl rmYFBwSPJEsTcABVpzNRFd9b6SOpha8/Nj+hX2VMp7rD/aJ6N8+zhZ1ZC/u8voMPmLeNGD VrBO9swgNk4pTcbtVZU3oKG6TIacImwrKEmzila4szEvWmSxfPD/OvfwsFL23YwEt+HaST Il7fg+hJ88QUzFuDFTLAKm1g0PfUIlGJP3rRQ2B6t2xcpdCDQ1jtZRAiPQgURo779vdGJz 4GGrnQrtwfhTMlUo1i0pY+v0zZeHfe18hVqBUjnbdvrnvvH5/3b3ZvDMxKgJdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752672986; a=rsa-sha256; cv=none; b=ex1WZWoVm1aTh7B28vZj2sXkHObgBq63EsMIOfQo79RT77EOir/uVSdyMJw4FqWdF3QP5H 80tso3EjMx4Fh+ZmnANs7ro/wPVUciMdJUf07dGrnli7Jy52dsu/N0nvsdceXvmY7M7KSq Y4aT7LLEyzngy+58oEGYeV4JUVow9m9Im6Q1608MZSDON6ypyCNpxfW0RxyNVlm+Vj+JOH Q7uDB28LCuq7fnIVtNVLMs3761PcXbTAb/xf8SN97UFSAQ+DnaYOZV3Vg75wJ531xw+D/O 3xQjBCdD89QHH+ADf5okBgMLMsJ+j47FhRqBolUM/bzCd2Y+uEON2ADY1gxoDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhxsk5Ndzz1Qj0; Wed, 16 Jul 2025 13:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GDaQ6g036546; Wed, 16 Jul 2025 13:36:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GDaQXP036543; Wed, 16 Jul 2025 13:36:26 GMT (envelope-from git) Date: Wed, 16 Jul 2025 13:36:26 GMT Message-Id: <202507161336.56GDaQXP036543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e48d5d23bbef - main - release: Sort loader.conf lines consistently List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e48d5d23bbef61829aafd594759a2f880a3422f1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e48d5d23bbef61829aafd594759a2f880a3422f1 commit e48d5d23bbef61829aafd594759a2f880a3422f1 Author: Ed Maste AuthorDate: 2025-07-16 13:09:46 +0000 Commit: Ed Maste CommitDate: 2025-07-16 13:36:16 +0000 release: Sort loader.conf lines consistently loader_brand was in a different spot in the dvd image compared to the others. Reviewed by: jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51342 --- release/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index 84f29983b6c7..7cafd7ddb787 100644 --- a/release/Makefile +++ b/release/Makefile @@ -340,8 +340,8 @@ dvd: ${PKGBASE_REPO} echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf - echo loader_brand=\"install\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf + echo loader_brand=\"install\" >> ${.TARGET}/boot/loader.conf echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG From nobody Wed Jul 16 14:24:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhyx66vzyz61ZN0; Wed, 16 Jul 2025 14:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhyx649XRz3vKg; Wed, 16 Jul 2025 14:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752675866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94SptSrcBoFXd2nqaj/2YP4ADKz6V2bGZDkkyFiSp28=; b=EJySABiAKboV706bhj4+YT9UL6UN/94mfztTLyEEZKELzaDjHhIHy9qqP4MCRiV2rVRlMD xJ/EXKPJkbl49xCzLEkfaTb937SwiunaQuyEDE519yYueJQEYNu0UmTeHnkzVEBV3PfzuU RNvwdGk8Wu/899ghA8v45idkYPkIuhW7006rlBs/TKJZUe5NBwjxxyyBo9i8Zps7gWrNsO 6M0wVKEp974/6DRVt/jyNSoFKX7SwwRzBQfO5Upcj7LqrTbygTmP0SAobEU7HtGDA7RD0D vsnvv5CgwJfQbE1Usi4KZZ7VkG9YfMlsgChKnQl19TUQadlLZQ/wmBT1zZeGQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752675866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94SptSrcBoFXd2nqaj/2YP4ADKz6V2bGZDkkyFiSp28=; b=fYCMQORmC9pNiGODNYrv/Xn5/AosSX7pk1zfZxdTD8ON0F2FQQkvMnRmPue52ksRGr8QxN QgKo7Qcae+a/FK+yrN+BThAQqAHcsGZqYhjIRoC+4ryJqAgeR+yimF4Oi3GZ7FGviHtt9h +WfbZZOQzy0uzmZw84fPW/6U1kMnLU6dWyb5aTBv+jwZ7srdvoIRyGDjHjOHVZUP9Im1Vw SVcvTmd64Nxh+26LnFSyLbgJZQzSJpPReYtxhSGhxcfMZJ7JF6paswBbnT9ERUwQS+KLGP 4qTmypF1t4Ryja6ORuPLb7sAjeHITWtnDhcoBR4DpPq/6YK5D/E0JzGqor6zPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752675866; a=rsa-sha256; cv=none; b=HRpc0ft7kw/M2OlHbkOKJdeSKuPK6kDO9y/hk9zmSa8FK86LgGneao6dxXNYdpI/T1XyBE g8BitI5NJ8OYCKk3TXe5J3JUP3BbVaVKCdWh4NAVFW/bQK/NDWNxV1tGWXRF97yo7pbRQv uUVBROxA2T9Opbrq7BvUUPhS3uO0LCIl/OpLWo9snOisAbUvu9iFvf+1jZ2fvD/tyRY287 WRjdYOwYXbB63f4YLZ08V0kpU3oYuZ60j4mCPdyIg1EyZl6mXgzlZw2XPMcTFyqnUQqxOq jpT6qzlpBlQnlKL3rLPks1kTh0gv9Cp8uIcNna/aKo1jwFgGATeTl2GjxEOvng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhyx6382xz1RjH; Wed, 16 Jul 2025 14:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GEOQBb030670; Wed, 16 Jul 2025 14:24:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GEOQ63030667; Wed, 16 Jul 2025 14:24:26 GMT (envelope-from git) Date: Wed, 16 Jul 2025 14:24:26 GMT Message-Id: <202507161424.56GEOQ63030667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 56eb7566c419 - main - md(4): Stop symlinking vn.4 to md.4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 56eb7566c41902a14d4392f8a01c045dbde6de7e Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=56eb7566c41902a14d4392f8a01c045dbde6de7e commit 56eb7566c41902a14d4392f8a01c045dbde6de7e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-16 11:44:01 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-16 14:23:41 +0000 md(4): Stop symlinking vn.4 to md.4 We've done the same in the past to the vnconfig.8->mdconfig.8 link in: eb5f4569819 Remove ancient vnconfig symlink Reviewed by: bcr, markj, ziaee Approved by: markj (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27122 --- ObsoleteFiles.inc | 3 +++ share/man/man4/Makefile | 1 - share/man/man4/md.4 | 4 ++-- sys/dev/md/md.c | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index a5e41d9ac6d6..e5a3da94e127 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250716: Remove an old manual page, vn(4) was removed in FreeBSD 5.0 +OLD_FILES+=usr/share/man/man4/vn.4.gz + # 20250710: share: Delete bitrotted make_*_driver.sh scripts OLD_FILES+=usr/share/examples/drivers/README OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index fcdbf81dc0fd..fca94c9b6881 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -746,7 +746,6 @@ MLINKS+=lge.4 if_lge.4 MLINKS+=lo.4 loop.4 MLINKS+=lp.4 plip.4 MLINKS+=malo.4 if_malo.4 -MLINKS+=md.4 vn.4 MLINKS+=mem.4 kmem.4 MLINKS+=mfi.4 mfi_linux.4 \ mfi.4 mfip.4 diff --git a/share/man/man4/md.4 b/share/man/man4/md.4 index 0c99d61f8392..1da26ddda037 100644 --- a/share/man/man4/md.4 +++ b/share/man/man4/md.4 @@ -5,7 +5,7 @@ .\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp .\" ---------------------------------------------------------------------------- .\" -.Dd January 8, 2020 +.Dd July 16, 2025 .Dt MD 4 .Os .Sh NAME @@ -158,7 +158,7 @@ installation process. The .Nm driver did a hostile takeover of the -.Xr vn 4 +.Sy vn driver in .Fx 5.0 . .Sh AUTHORS diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 741a7c013f7d..29dc0c880e3a 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -11,9 +11,9 @@ */ /*- - * The following functions are based on the vn(4) driver: mdstart_swap(), - * mdstart_vnode(), mdcreate_swap(), mdcreate_vnode() and mddestroy(), - * and as such under the following copyright: + * The following functions are based on the historical vn(4) driver: + * mdstart_swap(), mdstart_vnode(), mdcreate_swap(), mdcreate_vnode() + * and mddestroy(), and as such under the following copyright: * * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 From nobody Wed Jul 16 14:49:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhzVN0Kz6z61bSR; Wed, 16 Jul 2025 14:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhzVM6Bfkz4651; Wed, 16 Jul 2025 14:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752677387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AxUL4lIy7SIkOuxhJgyn3PWPPVq/HbDuf109CpyopZU=; b=sQmYMZzWxNHzuq+6LLXWhQtt7wO91gH+yigYz+d0gI2X/ZIy0sil9Jd4xq/tEI9oCp7ij8 JWj9ODMKCBMbek0jIiJm+DWHxOXhsENxOSxihDgZBMoTGyd1umZaoeC9yPi881dxRUGe2a Zx9friWIIynLojKuRR8KxrayfLXWg7fh62a3aYo64lZ3yNCt1Q4/tX2lM2wOW+8CarXQmC bZjNhYshXbzfywVljWmsR0cVEd7W5mNYyxu7CkfDzO1BnT91GeH20k4zPhOShfYZHpAs9v gyDE9r7tOfbCEyuG7ns25Z0yHdajbpHkfM+yGkhi9PIn1vKOEx4fVrb/ZYGpuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752677387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AxUL4lIy7SIkOuxhJgyn3PWPPVq/HbDuf109CpyopZU=; b=jxJtmZ7T4xunEInIWVoh3DHYVecUG2guc5mZbBPP3iorAP4ICXE2K4Ryh41/q00LeYAWrz iEfglE3FjnIobXE63Qdr+dJLyglRq+jvkP9NiGXD4+T+TrywBW6WBIh/YVgwEPkUmeAEEr /c56WgqoGumI7bE2NUPaaYnGNo2vvHWPvyxUib5b7ciAfwPV42k5i3C+xaVdobBQyoe1t2 QCrgpffE2EeZUsvUX4harsTH68tIaKwL7cq6scMVSKDo92YzmTAb2l84AXTgwtWNZcL0lI 9WKSv06FE1MuAVWcIOfUevx89DVdc2v6VzAqK8Pv/us8U8cmKdnvmPkspsY/1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752677387; a=rsa-sha256; cv=none; b=MPRyI7dDGFIhq2TQH2h2cdv47IiFs3c9YOZKsdRQsG4CQykbN97y+5MG8UCO8sAQJsLA++ kxNUQ6CLKWVwQxTg4eIrTowV7A2HdYRZdrdB3/pvN1Sb5uWCB5ZMtNfsOT9A+2Tm38Jn6T 5OPJCyFB0ghf4eFGEkqPETjmM5rrsGqTneHiALZMBJ2Ah5Wv4W/oCNBRw0pnqt0MB4ahmR 5Wsa8vztqC9VEB4oXlUf4JWKMZ1gzQ/X654rst4iC5eLGGnrDpILn+TDxdgn1HryIelQFI SWfD8FMAmUNJy6YR0moRS/nXz6WUIXLhShND8OsiSF39IHE0ar8HSZGUgrXLUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhzVM5SZ5z1SNT; Wed, 16 Jul 2025 14:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GEnlMt069118; Wed, 16 Jul 2025 14:49:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GEnlun069115; Wed, 16 Jul 2025 14:49:47 GMT (envelope-from git) Date: Wed, 16 Jul 2025 14:49:47 GMT Message-Id: <202507161449.56GEnlun069115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f38ac6f27ace - main - GitHub: Provide more context in pull request issue comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f38ac6f27ace386d7e1d18cda6ffb8af5b20b598 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f38ac6f27ace386d7e1d18cda6ffb8af5b20b598 commit f38ac6f27ace386d7e1d18cda6ffb8af5b20b598 Author: Ed Maste AuthorDate: 2025-07-15 18:12:50 +0000 Commit: Ed Maste CommitDate: 2025-07-16 14:34:20 +0000 GitHub: Provide more context in pull request issue comment Be explicit that the user should update their branch and re-push to update the pull request. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51332 --- .github/workflows/checklist.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checklist.yml b/.github/workflows/checklist.yml index f5c3ea599abf..7f7b0d51f46e 100644 --- a/.github/workflows/checklist.yml +++ b/.github/workflows/checklist.yml @@ -89,6 +89,7 @@ jobs: /* Loop for each key in "checklist". */ for (const c in checklist) msg += "- " + c + "" + checklist[c].join(", ") + "\n"; + msg += "\nPlease review CONTRIBUTING.md, then update and push your branch again.\n" comment_func({ owner: context.repo.owner, From nobody Wed Jul 16 15:08:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhzw51QmYz61cV0; Wed, 16 Jul 2025 15:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhzw5034gz4G6m; Wed, 16 Jul 2025 15:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8WSet1Ipy0FMvWR/DGTHGGtamAT6GJ1K/7Y+uITXEsw=; b=J7676lbKrqqEL21PsD2NIaR65DYkteZnyIMt8V5onZa/KWV6r5KouXCvujiJ/wihXXsVfY 67Ggc7bCCp4MUN6hw2o4H5yWB4huPNK3VflxjSpNNk+I3I3svWtK3xeIpXrVcvrjfSyFHv JcrJOPrMbA7XwXGhowstV15DCxggMHO7y7H2nmywT5sSaDVxpmr0JQLG9VYjxWzTmZINwv eCZJqsbOjt76TFkJc8IQE/URfzJjvIO9gnihQfbgGUEyFC3mf/ATAS8zgWN1UrBEx3tswv 98cz37iTv/KS8ikB3OboljX0dUtYeB3xkvAnw2TRk/lqrocHtEzsI2fYV24xnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8WSet1Ipy0FMvWR/DGTHGGtamAT6GJ1K/7Y+uITXEsw=; b=Q1UszyOtKMajdqOqDs3XozHzR6A4xjTLLOSMRBvFbVV/1+Bq1T9TloMFNjvhG4a5uq/Gr1 L97Ti+/L4pt/qvaY3TnJcgffmQxqFviM5AnCqbRqfVc5HONS9IvS27FpCV+kzUrK5r/Yb1 z1zHHCJrEEPLimZkJ1e/I3ZN1Oj2fXnKtf+J5Tj29uo+4qJzfhn2Qd5N0AIVsHqH3bSNaw Ef/mktQ1is70r5jp3PZCYVT35CvmCXMhLyrOvLIF3OpgeOMAm5IwBZ+/uSnGudeuYWaRYr QX3QHUFiKMmXGfWFs9Vg6FwmCQ9jvBdQwH78nHStBT9qnLEOAt570XwEk1ARjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752678517; a=rsa-sha256; cv=none; b=tGukytWHeEl2yPKwBlueVSwra25H3ThFQW9+vQiOKxmNsIlOaRXRHTPYBXQlh123OBFC8c 8XhJunv1lhoUkiKmqnP+OwbA0II1E/qV3M5XX1fZG/5OdmJJw/QrpGXfUD0lJpjDqIOWIF 0/jzcgYRXusGK/uBY346oS68Z+VrMyra7f906c8Me5eDTwateDzMt2uZUR1gqgGES/JtYX 2/ZYSjjIpXeU/Qqce2ku8zQuYN6VeHeV6D+13yL3f7IEe1SC1arh3uCd3XiuxJiX+HIiZb gL2VobKUbOV3kin1VEBPFr+DvQLbR6/MTGeJmV7Sz67W28pqJLuH56kU5PuKhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhzw46lPcz6T; Wed, 16 Jul 2025 15:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GF8aDq008013; Wed, 16 Jul 2025 15:08:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GF8aZK008010; Wed, 16 Jul 2025 15:08:36 GMT (envelope-from git) Date: Wed, 16 Jul 2025 15:08:36 GMT Message-Id: <202507161508.56GF8aZK008010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: ceab09e3dbc2 - main - release: Add a helper script for common tools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ceab09e3dbc25240c7e4d0839672cc3008830150 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=ceab09e3dbc25240c7e4d0839672cc3008830150 commit ceab09e3dbc25240c7e4d0839672cc3008830150 Author: Bojan Novković AuthorDate: 2025-06-24 15:03:37 +0000 Commit: Bojan Novković CommitDate: 2025-07-16 15:03:49 +0000 release: Add a helper script for common tools Add a helper script that populates variables used to invoke several tools. This is also the first step towards cleaning up several inconsistencies related to tool invocation in various release scripts (e.g. ${MAKEFS} vs makefs). Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51038 Reviewed by: emaste, des --- release/scripts/tools.subr | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/release/scripts/tools.subr b/release/scripts/tools.subr new file mode 100644 index 000000000000..e818f0a55410 --- /dev/null +++ b/release/scripts/tools.subr @@ -0,0 +1,13 @@ +#!/bin/sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2025 The FreeBSD Foundation +# +# This software was developed by Klara, Inc. +# under sponsorship from the FreeBSD Foundation. +# + +: ${ETDUMP:=etdump} +: ${MAKEFS:=makefs} +: ${MKIMG:=mkimg} From nobody Wed Jul 16 15:08:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhzw63V3jz61cxQ; Wed, 16 Jul 2025 15:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhzw610WDz4G28; Wed, 16 Jul 2025 15:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=met5mIFU/eI9LPPrIapTl24IpPh/CkULhcgxmBemKeg=; b=KJYPdD3U/ZAfA14bi6kqVEeue36qilHI5r3r1c11G9J1lcy7cfWX9RuNXw4W90oQhB73rN a3PQrW+ERKzT0pdqSoRlADikaKzqvCBMUPJLGjFWvbJ1FWsVExITtE56UBF3+mpC5LjJn8 eTyIMinK6nXsdPfQQndcO450DZoDVoEiFRgkC2XZ5WqA+oudTx7POUqjRYfsPNOiJ1AEZ0 uzrzPT3vMb+Ra0ppM1/P05Xcd/QtbCZQm2lcFSQCmnPZWA6MSSfAxa0pHj/0o4KZWt/p+7 G6zmJ6hHWnVhrWGEo4Ega9R3jcK4rK08MY241+KMZVkVUd66kSjHMRGmpV80FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=met5mIFU/eI9LPPrIapTl24IpPh/CkULhcgxmBemKeg=; b=C7c04Yruu4khCiCiXQbZd97iehWAZfIPZEReOTrWrqfYVX7HtvI6qBzShYnmXsTsFkDmJ2 yr+KVCW73/nY1pRjwrY9DMj3gsX/KI3QgEEtv5MZzBQld5qnCeO6rFZ1eJHsXgMckDLHRV 8l0he6n8CVFF13pIlnp1j0EYTexF4fiRFPW5KA6X4r976Ib3rehUi895g8H/feVWMQdRzV mXbjtvPrZZ3PksgBobGTh+V5wyCx0U9j+FtH4HW7kRbSJYyMgz0CyNvoemswgWiBqDVLJ1 Q21z/CKIlEMe9X2ULuA3csPnnyzGDloiK58qB7PbVNWrxuzghIGbF650wy3PRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752678518; a=rsa-sha256; cv=none; b=jquaHnP51jYQ2Fa77hdn+tYQGGNHm8Le2a0A8WlkA+4DFJnzgT6aZ8CPlYdHEIPKWtTfwf rmFGHehvBo3EEQuvnCYD5W1X/+IVmlKekTehW9I2m8WoSzBYvr3/0ElsK45ywSw7N1dc1F z+xzW3IIAnmeH/RzxvoAbIylndtSeYaioUQ9yYZPaPW4cxtTjgdrr9h5tnfQsDB6LyA90r chWDZNeymLLfgexCqTDAlGWK4RRyzILmnlxwaHFqbB2sr1DHNbhRdmaWgf4DcO2VcARZOH bHxUxh0E8P+wT1gCmxqBWuhnuz3kdgA86F/UiaxX+T9tFVMoW/WGqOUTtLvnCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhzw60c4rz8y; Wed, 16 Jul 2025 15:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GF8bR9008057; Wed, 16 Jul 2025 15:08:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GF8bjL008054; Wed, 16 Jul 2025 15:08:37 GMT (envelope-from git) Date: Wed, 16 Jul 2025 15:08:37 GMT Message-Id: <202507161508.56GF8bjL008054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 483ef23ebb72 - main - release: Consistently use variables for invoking certain tools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 483ef23ebb7235059c30db86588e178cdeb80097 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=483ef23ebb7235059c30db86588e178cdeb80097 commit 483ef23ebb7235059c30db86588e178cdeb80097 Author: Bojan Novković AuthorDate: 2025-06-24 15:17:36 +0000 Commit: Bojan Novković CommitDate: 2025-07-16 15:04:03 +0000 release: Consistently use variables for invoking certain tools This change cleans up the inconsistent ways of invoking makefs and mkimg by making sure that these tools are invoked through their corresponding variables. This was previously only used in a few amd64 and arm64 release scripts. Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51039 Reviewed by: emaste, markj --- release/amd64/make-memstick.sh | 7 ++++--- release/amd64/mkisoimages.sh | 13 +------------ release/arm64/make-memstick.sh | 5 +++-- release/arm64/mkisoimages.sh | 13 +------------ release/i386/make-memstick.sh | 9 ++++++--- release/i386/mkisoimages.sh | 5 ++++- release/powerpc/mkisoimages.sh | 5 ++++- release/riscv/make-memstick.sh | 5 +++-- release/riscv/mkisoimages.sh | 13 +------------ release/tools/vmimage.subr | 7 ++++--- 10 files changed, 31 insertions(+), 51 deletions(-) diff --git a/release/amd64/make-memstick.sh b/release/amd64/make-memstick.sh index cbb80e971343..cec4b27b5b96 100755 --- a/release/amd64/make-memstick.sh +++ b/release/amd64/make-memstick.sh @@ -12,6 +12,7 @@ set -e scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr . ${scriptdir}/../../tools/boot/install-boot.sh if [ "$(uname -s)" = "FreeBSD" ]; then @@ -51,7 +52,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +${MAKEFS} -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then @@ -67,10 +68,10 @@ else make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi fi -mkimg -s mbr \ +${MKIMG} -s mbr \ -b ${BASEBITSDIR}/boot/mbr \ -p efi:=${espfilename} \ - -p freebsd:-"mkimg -s bsd -b ${BASEBITSDIR}/boot/boot -p freebsd-ufs:=${2}.part" \ + -p freebsd:-"${MKIMG} -s bsd -b ${BASEBITSDIR}/boot/boot -p freebsd-ufs:=${2}.part" \ -a 2 \ -o ${2} rm ${espfilename} diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh index 245beb660c3f..8f7163e05261 100644 --- a/release/amd64/mkisoimages.sh +++ b/release/amd64/mkisoimages.sh @@ -25,20 +25,9 @@ set -e scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr . ${scriptdir}/../../tools/boot/install-boot.sh -if [ -z $ETDUMP ]; then - ETDUMP=etdump -fi - -if [ -z $MAKEFS ]; then - MAKEFS=makefs -fi - -if [ -z $MKIMG ]; then - MKIMG=mkimg -fi - if [ "$1" = "-b" ]; then MAKEFSARG="$4" else diff --git a/release/arm64/make-memstick.sh b/release/arm64/make-memstick.sh index 90ff98b394c7..0da59c29635b 100755 --- a/release/arm64/make-memstick.sh +++ b/release/arm64/make-memstick.sh @@ -17,6 +17,7 @@ if [ "$(uname -s)" = "FreeBSD" ]; then fi scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr . ${scriptdir}/../../tools/boot/install-boot.sh if [ $# -ne 2 ]; then @@ -51,7 +52,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +${MAKEFS} -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then @@ -62,7 +63,7 @@ fi espfilename=$(mktemp /tmp/efiboot.XXXXXX) make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi -mkimg -s gpt \ +${MKIMG} -s gpt \ -p efi:=${espfilename} \ -p freebsd-ufs:=${2}.part \ -o ${2} diff --git a/release/arm64/mkisoimages.sh b/release/arm64/mkisoimages.sh index cb58178ed4b9..46b16f0ce08d 100644 --- a/release/arm64/mkisoimages.sh +++ b/release/arm64/mkisoimages.sh @@ -21,20 +21,9 @@ set -e scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr . ${scriptdir}/../../tools/boot/install-boot.sh -if [ -z $ETDUMP ]; then - ETDUMP=etdump -fi - -if [ -z $MAKEFS ]; then - MAKEFS=makefs -fi - -if [ -z $MKIMG ]; then - MKIMG=mkimg -fi - if [ "$1" = "-b" ]; then MAKEFSARG="$4" else diff --git a/release/i386/make-memstick.sh b/release/i386/make-memstick.sh index 7a20be20c026..ad2126b0a8f8 100755 --- a/release/i386/make-memstick.sh +++ b/release/i386/make-memstick.sh @@ -11,6 +11,9 @@ set -e +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr + if [ "$(uname -s)" = "FreeBSD" ]; then PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH @@ -48,16 +51,16 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +${MAKEFS} -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then rm ${metalogfilename} fi -mkimg -s mbr \ +${MKIMG} -s mbr \ -b ${BASEBITSDIR}/boot/mbr \ - -p freebsd:-"mkimg -s bsd -b ${BASEBITSDIR}/boot/boot -p freebsd-ufs:=${2}.part" \ + -p freebsd:-"${MKIMG} -s bsd -b ${BASEBITSDIR}/boot/boot -p freebsd-ufs:=${2}.part" \ -o ${2} rm ${2}.part diff --git a/release/i386/mkisoimages.sh b/release/i386/mkisoimages.sh index 8f000aae3b17..1918b36eeb44 100644 --- a/release/i386/mkisoimages.sh +++ b/release/i386/mkisoimages.sh @@ -24,6 +24,9 @@ set -e +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr + if [ "$1" = "-b" ]; then MAKEFSARG="$4" else @@ -67,7 +70,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" +${MAKEFS} -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" rm -f "$BASEBITSDIR/etc/fstab" if [ -n "${METALOG}" ]; then rm ${metalogfilename} diff --git a/release/powerpc/mkisoimages.sh b/release/powerpc/mkisoimages.sh index ba7c32f87bee..9d83390f1a4e 100644 --- a/release/powerpc/mkisoimages.sh +++ b/release/powerpc/mkisoimages.sh @@ -24,6 +24,9 @@ set -e +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr + if [ "$1" = "-b" ]; then MAKEFSARG="$4" else @@ -107,7 +110,7 @@ echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab" if [ -n "${METALOG}" ]; then echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} fi -makefs -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" +${MAKEFS} -D -N ${BASEBITSDIR}/etc -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$MAKEFSARG" "$@" rm -f "$BASEBITSDIR/etc/fstab" if [ n "$bootable" ]; then rm $BOOTBLOCK diff --git a/release/riscv/make-memstick.sh b/release/riscv/make-memstick.sh index 90ff98b394c7..0da59c29635b 100755 --- a/release/riscv/make-memstick.sh +++ b/release/riscv/make-memstick.sh @@ -17,6 +17,7 @@ if [ "$(uname -s)" = "FreeBSD" ]; then fi scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr . ${scriptdir}/../../tools/boot/install-boot.sh if [ $# -ne 2 ]; then @@ -51,7 +52,7 @@ if [ -n "${METALOG}" ]; then echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} MAKEFSARG=${metalogfilename} fi -makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} +${MAKEFS} -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} rm ${BASEBITSDIR}/etc/fstab rm ${BASEBITSDIR}/etc/rc.conf.local if [ -n "${METALOG}" ]; then @@ -62,7 +63,7 @@ fi espfilename=$(mktemp /tmp/efiboot.XXXXXX) make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi -mkimg -s gpt \ +${MKIMG} -s gpt \ -p efi:=${espfilename} \ -p freebsd-ufs:=${2}.part \ -o ${2} diff --git a/release/riscv/mkisoimages.sh b/release/riscv/mkisoimages.sh index cb58178ed4b9..46b16f0ce08d 100644 --- a/release/riscv/mkisoimages.sh +++ b/release/riscv/mkisoimages.sh @@ -21,20 +21,9 @@ set -e scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr . ${scriptdir}/../../tools/boot/install-boot.sh -if [ -z $ETDUMP ]; then - ETDUMP=etdump -fi - -if [ -z $MAKEFS ]; then - MAKEFS=makefs -fi - -if [ -z $MKIMG ]; then - MKIMG=mkimg -fi - if [ "$1" = "-b" ]; then MAKEFSARG="$4" else diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index ce0ea03c096c..eb816018e9d3 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -6,6 +6,7 @@ # scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../scripts/tools.subr . ${scriptdir}/../../tools/boot/install-boot.sh export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" @@ -209,11 +210,11 @@ buildfs() { case "${VMFS}" in ufs) - cd ${DESTDIR} && makefs ${MAKEFSARGS} -o label=rootfs -o version=2 -o softupdates=1 \ + cd ${DESTDIR} && ${MAKEFS} ${MAKEFSARGS} -o label=rootfs -o version=2 -o softupdates=1 \ ${VMBASE} .${NO_ROOT:+/METALOG} ;; zfs) - cd ${DESTDIR} && makefs -t zfs ${MAKEFSARGS} \ + cd ${DESTDIR} && ${MAKEFS} -t zfs ${MAKEFSARGS} \ -o poolname=zroot -o bootfs=zroot/ROOT/default -o rootpath=/ \ -o fs=zroot\;mountpoint=none \ -o fs=zroot/ROOT\;mountpoint=none \ @@ -342,7 +343,7 @@ vm_create_disk() { buildfs echo "Building final disk image... Please wait." - mkimg -s ${PARTSCHEME} -f ${VMFORMAT} \ + ${MKIMG} -s ${PARTSCHEME} -f ${VMFORMAT} \ ${BOOTPARTS} \ ${SWAPOPT} \ ${CONFIG_DRIVE} \ From nobody Wed Jul 16 15:08:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhzw81564z61cXN; Wed, 16 Jul 2025 15:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhzw725Lbz4G57; Wed, 16 Jul 2025 15:08:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JeP3gvkvleI6jj2VgVzl0kGTrLMbECFzE7u06pGtvps=; b=o8hEdlvblMISHhYScYSpK1YfcEyyqOF38bZ7c1E+lgbgU2hgMfWu+ka8aSWjvQ8NtFcBbD VSl+rJVwVGoowfiY9Wo0OK863v9NwI9EHLjyc5g8BYoAF7kluWJl67TO5YSs8RUccKHg+M qRLumDwTE7GI2JjLPwLzsAGPsIdlZJcgMX4w58t/BOzGL7ryImBeNakrmPLzkqJFKY7UbH n3cx036XLNOeTkMnUDoO2wEYi0p5fpQykNZ4PVam4HHxilQivB8GO0scj07xSZV9pSRRnt jR/xkymwsRtqnXMcjXTOfn0ml1kZBH60HEKm6oFbLjaMNU0nE+pWqAcnZTBlTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JeP3gvkvleI6jj2VgVzl0kGTrLMbECFzE7u06pGtvps=; b=pNHi1L94Vg4wC/RNnS8z50Cvv+xL5Hvk7iS1pidMkshx5QCf+pI5+RYizayOLqoV0nDZmz 5dtPE2rrUjb2zGNm8PycpqZLi9OOU8vQ7FFvVhcUQxaulz0oCLDqF/4STWYz1WzpHd3JeP 3ikRMGCk6EE39ccPp+5EYMBZKJ8sA2RvbsG2W1VsWyiMUfprPZt3yT9baid6t6qOUJbIay krHNcgodUHvgPECjBnh9voTcfPqDwzEv0ug0yDtQafSacpf9oZVMCfZeao8sSbTAxoMOz0 C8gERIwG885bGhqBaAhmwP3Q2Uqs39griB740eTfSj1RGs3CWJie0bDfsEl/uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752678519; a=rsa-sha256; cv=none; b=xMA0LB2RiLYyNXtU7kPTOQnSJsQArDe+75kQeO8mmbHj7Pjp/bBOXaRMFJXIfHutm0wEy/ P6vN0Pa570pCFIhKKV0zuaKPgHSNdLGOVtEkCeKC91sMoArrOOcghr5UI+9RdssJzSXEI/ TGSBvLP7fkBIcQkB1gKaEt3SpvvDoj5rcISf1BuHDCk0DUbAlOUyUu86WPxj+u7/AaPkey W4+XvjxIIXCMDzhn/5EB8tsehfLU/qpY7ZNIOO6xbRSqoAsxfN5zUMkMweZCqIyg/Hq4dY qi+sZP1u8vjPhfJtBzqrpUq2+3QYi43VjNn+Y/W3IoPfDCSHdc88uGlHL85RSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhzw71FZFz90; Wed, 16 Jul 2025 15:08:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GF8dHu008094; Wed, 16 Jul 2025 15:08:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GF8d6Z008091; Wed, 16 Jul 2025 15:08:39 GMT (envelope-from git) Date: Wed, 16 Jul 2025 15:08:39 GMT Message-Id: <202507161508.56GF8d6Z008091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 06077dc327ea - main - makefs: Fix undefined behaviour in ffs.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06077dc327eae05026dde958c7a275b8b5bae3b9 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=06077dc327eae05026dde958c7a275b8b5bae3b9 commit 06077dc327eae05026dde958c7a275b8b5bae3b9 Author: Bojan Novković AuthorDate: 2025-06-25 09:45:06 +0000 Commit: Bojan Novković CommitDate: 2025-07-16 15:06:11 +0000 makefs: Fix undefined behaviour in ffs.c Fix a UBSAN-reported error in `ffs_make_dirbuf` where a zero offset gets applied to a NULL pointer. Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51037 Reviewed by: emaste, mckusick --- usr.sbin/makefs/ffs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index 4efcd20ad91a..c0fcadf11fba 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -1056,7 +1056,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const char *name, fsnode *node, int needswap) reclen = DIRSIZ_SWAP(0, &de, needswap); de.d_reclen = ufs_rw16(reclen, needswap); - dp = (struct direct *)(dbuf->buf + dbuf->cur); + dp = dbuf->buf == NULL ? NULL : (struct direct *)(dbuf->buf + dbuf->cur); llen = 0; if (dp != NULL) llen = DIRSIZ_SWAP(0, dp, needswap); From nobody Wed Jul 16 15:08:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhzw93p7rz61cXP; Wed, 16 Jul 2025 15:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhzw84ZyKz4GFD; Wed, 16 Jul 2025 15:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xcFySuH7P8lwL4X8M/EKKQjxnUZTV81A2ILyY00/z0=; b=bDMwEWUGtJdMPmHSnDipsHe/z/ZaaweEPJNQEHKlrDY2YhTm2/cIvdi8YHulMQRNjJBbJA Wie+8qfgMXFwBNmLlPHlpUKNt25c2NB2+u0Y7uYIiKF7//Fk2StKvW6vtqurFlpKFOMIE1 XreiB2Dq2VcMIfFOG+M+b93nhnt9Zp2gW6JjiKNJqPkxvSRySNXjr2rPD0jhdchNFTQ7F2 o606r/q77oL7hk58YDSXrmv8CyJkyKub78DoRTXWnkHTbY4RQNj/P8nDhgnECytpSgopnF +MkyCIDWyaV1Df8TtMXokfAadE3nVH2pka8GUCIuliIR4xfIO0nAbAZlcfBbgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752678520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xcFySuH7P8lwL4X8M/EKKQjxnUZTV81A2ILyY00/z0=; b=XKN6xXzIB+W7K3bwQWyrDNl4l1SZRmd/Y8qy+PRk46XdOVgM+rqDI6DTfemyziYekHwP13 EC+sM2Q9bj/vPQGYw+PdPSY1YIsAyvqDbuqsNbBH7SK4GpruazoR9cj12RCC/GdMsmig/t qpWkY7nrB1yoYrhGMvK6F9KJOUGSyBfOQdfXsLyixLi+QA72nne0PpD5eGJRX5v70uORnv 51om1fD4pG8WnDDur40/z3C7LBax0Ubj8g+tIDWs/WRUYVibN7srqtRjschtLQMwlux0Be evQe1bgxbWI3KefA6/xgRW4V+F0SSVjpFjYR0EIBjkiPb8/Ub+XEjZSrWugz3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752678520; a=rsa-sha256; cv=none; b=l1Qjk0UnplRdOsLnJM/bvE33uUnV0q7jhEaIzaAKzSfJLyY/ivjFuEnvsoVdUv9WlALrKd FeWo3DymJDoT89Kg8h6d13Y+62c3/kJ+Y5t2wsvJf5lc0wRUj/+MZf/FbAQXwf+NAAk9uS Rb014b/4wnwxmXY96Inw6qZU43GbTGPfvP6Rn14FfaV34q+8vh/9c3YJg0FyHdz2/BsGEI sidBz/BuKTAxrlXzse1+K2ZWoX+LmGNk26YRRJDnUNh4qtv+wX8dzu33yb1BGlfq6BTpFG Zhv9SfX1BSQLp/rL9aVOsdtmh6AMNeV8klVT0fWyfF5YLbJYtCFWPeuzsEkpQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bhzw82DMLz6V; Wed, 16 Jul 2025 15:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GF8e8V008131; Wed, 16 Jul 2025 15:08:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GF8eMJ008128; Wed, 16 Jul 2025 15:08:40 GMT (envelope-from git) Date: Wed, 16 Jul 2025 15:08:40 GMT Message-Id: <202507161508.56GF8eMJ008128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 636823cfd260 - main - makefs: Correct license text in 'makefs_msdos_tests.sh' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 636823cfd2606f95f707b945227d0d868b7c8ed6 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=636823cfd2606f95f707b945227d0d868b7c8ed6 commit 636823cfd2606f95f707b945227d0d868b7c8ed6 Author: Bojan Novković AuthorDate: 2025-07-16 15:07:15 +0000 Commit: Bojan Novković CommitDate: 2025-07-16 15:07:15 +0000 makefs: Correct license text in 'makefs_msdos_tests.sh' Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation --- usr.sbin/makefs/tests/makefs_msdos_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/makefs/tests/makefs_msdos_tests.sh b/usr.sbin/makefs/tests/makefs_msdos_tests.sh index b36b43b3abf6..fb94429b477b 100644 --- a/usr.sbin/makefs/tests/makefs_msdos_tests.sh +++ b/usr.sbin/makefs/tests/makefs_msdos_tests.sh @@ -4,7 +4,7 @@ # Copyright (c) 2025 The FreeBSD Foundation # # This software was developed by Klara, Inc. -# under sponsorship from the FreeBSD Foundation and the Sovereign Tech Agency. +# 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 From nobody Wed Jul 16 15:21:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj0CM2rYjz61dMv; Wed, 16 Jul 2025 15:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj0CL6gjHz4MGM; Wed, 16 Jul 2025 15:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752679310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZhoT58UlqKhU1slfCaWbpIQTlDTlfkyCY6pIy2CXWw=; b=NgQn1Hue8JvsSJcImEyn8ZZ3q1jvhp6xn6/uPwoWTde4jOdTj5lnSasQI0aG6jau2H8FdF hu1wDOW+/LqxkQpuhty1KLBMJLJLedj1Cm4xY5d4gXP132gicuehK6i6xAAZYuANMaS1J5 3K4nG5Ah3qTgYPgosVXkYws5qnD6T/eCH1Ghak1Q/cvmtnkehZcEsSzpAbciYK3knX91Zo 4vaVvZa9CRdKOZ65pCA5xn6lVHCdTTOLZ4TK44pQ1RWlaANjWWpa/pRobqdRKTTGsp5Um1 c6xD2k/9tn42mXD17aAd12P/BFoDcgCw5U3jhQccrElFHwLlxenRz+7AWRFOlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752679310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZhoT58UlqKhU1slfCaWbpIQTlDTlfkyCY6pIy2CXWw=; b=d4MIWRsQ/POHCeoNBV3RndEHU3lmQSXiHsYBQc+veq7kJjnYiUd2a175rzfKljrntCYS4n Oy0YmrkqNE7C/V/E/xv6O4jjZUzrc8w2bt/MOcxlTkkYoFMT0T3QjJpnmrIr+iaS/ZY7N3 Te3CI+UKvzHD3MI/ilxVm1XYsLusqrvRvhQirbYJKqsEC9DJ6p+42b9/7sghCuGOZyyuWZ Z2LSnd7dpvEAgCqUjJdVZlCr+53ad34ryaUX73mzKRoqM898vl8UyU73Xb1wYenDaugtDP 8yiS6Qqg1c82O7iw1dpgzQPuS6Ki8yMtF/7uIswDPebduqKK8FrP47IpLMN3mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752679310; a=rsa-sha256; cv=none; b=OOIoYlbXl5KkWkS41n7Am7kIxWiy9G0ZKrKLN1P3UJhs+ocp66wpa1AIMvYFqEVgD3aqA6 bI3Hq81bw4Yx1DJbOMf82smBHflkhzm0wE3J1FXF280YWk4GiN7kyjJhV+by00rZn1XbKr yhc34+Qz/J7dWwhTDZlBbiUI2XMLDjk1KHMcqAPKSXIBuOYNDZsYhbJsWk5bWVVLAAIph0 /j0OazHNoCElQaguEt8e600facn6RH5aukkgMC89YXyTzrmHmxKdr1wlUY5BzCH0NP+4Jy YRuqB4UN7+mWIGFSEMMMQiQ6NmQMSbTNZ3dHJrQVXJKfBpapA6NfKZjvwYiIuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj0CL6DdczSX; Wed, 16 Jul 2025 15:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GFLoV5041698; Wed, 16 Jul 2025 15:21:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GFLo0h041695; Wed, 16 Jul 2025 15:21:50 GMT (envelope-from git) Date: Wed, 16 Jul 2025 15:21:50 GMT Message-Id: <202507161521.56GFLo0h041695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 4e78b9b5afe9 - main - net80211: fix VHT node setup in hostap mode List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e78b9b5afe9c1ebe93ccd8a0767fda39b26da4a Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=4e78b9b5afe9c1ebe93ccd8a0767fda39b26da4a commit 4e78b9b5afe9c1ebe93ccd8a0767fda39b26da4a Author: Adrian Chadd AuthorDate: 2025-06-11 04:59:30 +0000 Commit: Adrian Chadd CommitDate: 2025-07-16 15:12:03 +0000 net80211: fix VHT node setup in hostap mode Way back in 2017 I wrote the initial VHT hostap support, and then added a NULL check here to stop it from panicing. However, there is no VHTINFO IE in an ASSOC_REQ management frame. Thus, the node would never have VHT state initialised. This mirrors what HT node setup does (which again doesn't have HTINFO IE's in an ASSOC_REQ frame), the upgrade will happen once the exchange completes. Fixes: 2023566223a4020d832bd4e25dc7dadfd660b836 Differential Revision: https://reviews.freebsd.org/D50787 --- sys/net80211/ieee80211_hostap.c | 7 ++----- sys/net80211/ieee80211_vht.c | 4 +--- sys/net80211/ieee80211_vht.h | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index c5a478533313..9074878e17e4 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -2214,12 +2214,9 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, /* VHT */ if (IEEE80211_IS_CHAN_VHT(ni->ni_chan) && - vhtcap != NULL && - vhtinfo != NULL) { - /* XXX TODO; see below */ - net80211_vap_printf(vap, "%s: VHT TODO!\n", __func__); + vhtcap != NULL) { ieee80211_vht_node_init(ni); - ieee80211_vht_update_cap(ni, vhtcap, vhtinfo); + ieee80211_vht_update_cap(ni, vhtcap); } else if (ni->ni_flags & IEEE80211_NODE_VHT) ieee80211_vht_node_cleanup(ni); diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index e91977f1ef98..de0b691d4d2a 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -838,12 +838,10 @@ ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *ni) } void -ieee80211_vht_update_cap(struct ieee80211_node *ni, const uint8_t *vhtcap_ie, - const uint8_t *vhtop_ie) +ieee80211_vht_update_cap(struct ieee80211_node *ni, const uint8_t *vhtcap_ie) { ieee80211_parse_vhtcap(ni, vhtcap_ie); - ieee80211_parse_vhtopmode(ni, vhtop_ie); } static struct ieee80211_channel * diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h index 2964de63c343..a1529df4a85b 100644 --- a/sys/net80211/ieee80211_vht.h +++ b/sys/net80211/ieee80211_vht.h @@ -52,8 +52,7 @@ uint8_t * ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *); uint8_t *ieee80211_add_vhtcap_ch(uint8_t *, struct ieee80211vap *, struct ieee80211_channel *); -void ieee80211_vht_update_cap(struct ieee80211_node *, - const uint8_t *, const uint8_t *); +void ieee80211_vht_update_cap(struct ieee80211_node *, const uint8_t *); struct ieee80211_channel * ieee80211_vht_adjust_channel(struct ieee80211com *, From nobody Wed Jul 16 15:21:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj0CN5C2sz61dDT; Wed, 16 Jul 2025 15:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj0CN0ZnLz4LtQ; Wed, 16 Jul 2025 15:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752679312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rwwN3lP0DQmTCC4xq+n+n3z+LaBbsRLZ11U55YMBuz8=; b=M20oPaqxi5YH1+iXncQxjmx97tv2Cmny+CxQll9yy+CwYWmp+fXkmBuVOg4xuzD+UtKtnq ylOHbWE6F/xzQj37w2IwLE1u+PIn07ouWvpAHaHb35C0rE3o6QKiQugeKZwZTKqZWd0JHd eRXRVKRhGJjLWzkjWUrnn8VF6pwuDKuiANODPq6P5+wHrUxCoDEOrCIK8r/R6ZjXkloNOc 9JkT4uT6hZ3dO/lgecUk70AouXs0uFgKAqM7OU4SYW4/z5biv68h0G5pH7ONWFjJQs/1RQ FJrHZAiWfd9poCAmjwebhgRL7J8237Cg8hoSfPjKEIypBIHvzIH4UKWttfHCJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752679312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rwwN3lP0DQmTCC4xq+n+n3z+LaBbsRLZ11U55YMBuz8=; b=u8CVrELyhwycf158uXpyvlZQVl7TI7wQUkh9Y6TcnaB5q643G0LTgPzMC3lOSYQrgGcOXi +4sUZFkTOb0nw9lrmZYDntzSZzLC4k8U+WAHqB7mT826LcijTLuPmDAglsAUYm76ew77/W gUEq7FR+LqGTrHcZ8NtZUXjlKSbGezlVsP1Oxn68mroy+sKSgWa1FwcLOBnqrPK49gqPBB 7tSW8SJ6UMt7htl93OyW5e1Dwg62p9Z6hpay1nQwax6EhcJWe8LZcJBiDEmtEzGPkgSJA/ BoGrXaLshDY+QI171MUbNRxx4BqbWRgtlL+iuj1Qv3QUlqnH3BZytaqq3ZE4og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752679312; a=rsa-sha256; cv=none; b=au6VA/zoCx5jBy8TO5Mpo61ofvAnJ84jbseQ5a31rS1I9OfjyVFuq8mUNWb5MBqYsrYYWY HuVikCXVZCmwX9qG3reJB2XI3/2Pe8EHd1aQUdRuC5+JpCtio8XyMDFJqNxzDvsSvxWRxC 7Nj1yylIOIIX8qLtkm3YfwIWPfnS19/be7+0yHLhtlCYAn8irepYic/olwlHevXD5UAyPE rDVvAtdPEfrIPR6ulTTcK1aDB+aBiVQDXgKdAcf1+Ss9iuwuOkyMpc8dGHMTZvHOHVOj98 7hsF6748SmdhrpOGY9ypnlb8HClks46/ca95XJynK8L387mcVYeZbQYwDqvNXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj0CM6vlmzsS; Wed, 16 Jul 2025 15:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GFLpxQ041733; Wed, 16 Jul 2025 15:21:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GFLpbI041730; Wed, 16 Jul 2025 15:21:51 GMT (envelope-from git) Date: Wed, 16 Jul 2025 15:21:51 GMT Message-Id: <202507161521.56GFLpbI041730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 33e8fc370c18 - main - net80211: don't dereference a NULL HTINFO IE if it's presented List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33e8fc370c186c693c32f909305520de7c75853a Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=33e8fc370c186c693c32f909305520de7c75853a commit 33e8fc370c186c693c32f909305520de7c75853a Author: Adrian Chadd AuthorDate: 2025-06-11 18:10:03 +0000 Commit: Adrian Chadd CommitDate: 2025-07-16 15:12:11 +0000 net80211: don't dereference a NULL HTINFO IE if it's presented ieee80211_vht_get_vhtflags() is checking the htinfo IE for the 20/40MHz flag as part of deciding valid channel widths. However, in the hostapd path, the ASSOC_REQ/REASSOC_REQ path will parse the IEs, do some HT/VHT setup, then call ieee80211_ht_updatehtcap_final(). In a HT ASSOC/REASSOC request there won't be a HTINFO IE, however ieee80211_vht_get_vhtflags() still checks for it, leading to a panic. Instead, treat it as if we don't yet know if it's HT40 or not. I'm not sure if we should do that or have it just do _RETURN_CHAN_BITS(0). Differential Revision: https://reviews.freebsd.org/D50794 --- sys/net80211/ieee80211_ht.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 5ec80e3646b8..c28f124648a1 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -1951,6 +1951,11 @@ do { \ (vap->iv_vht_flags & IEEE80211_FVHT_VHT) == 0) _RETURN_CHAN_BITS(0); + /* + * TODO: should we bail out if there's no htinfo? + * Or just treat it as if we can't do the HT20/HT40 check? + */ + /* * The original code was based on * 802.11ac-2013, Table 8-183x-VHT Operation Information subfields. @@ -1962,8 +1967,12 @@ do { \ */ htinfo = (const struct ieee80211_ie_htinfo *)ni->ni_ies.htinfo_ie; - ht40 = ((htinfo->hi_byte1 & IEEE80211_HTINFO_TXWIDTH) == - IEEE80211_HTINFO_TXWIDTH_2040); + if (htinfo != NULL) + ht40 = ((htinfo->hi_byte1 & IEEE80211_HTINFO_TXWIDTH) == + IEEE80211_HTINFO_TXWIDTH_2040); + else + ht40 = false; + can_vht160 = can_vht80p80 = can_vht80 = false; /* 20 Mhz */ From nobody Wed Jul 16 16:41:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj1zK3xbdz61kBh; Wed, 16 Jul 2025 16:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj1zJ6Qp4z3n16; Wed, 16 Jul 2025 16:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752684092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7F/ITvYq6wtOT2V4ld8KwCgIselpoPUpQvEpH1HKx14=; b=G1pPXZ4rPsjZkXQFFvJKhKDhyl4vZez/VkgBh7Dh87LtLyZNXvUOfpV6cNIClQNc1vS12B 7I40rw6UXpBtgKRRdln7wpi8SNFSZseNKbkQDJrTxH0lmp+XiK9EckAB6uoRuYULy6ZjF4 N0OYVbvkeRF76wVk1rT+P8whm4NkArw8XUKaj+AUvWKkyHvsdomdlKyrJ08Xit89vXsXQf P3ndr3EaUBjnJ/IxZXNAk/zZ2Ucx3OTWEVF3GCf1lt/jEo+98CyhQSrIau2e2lkqNz62i8 /gepMIYJWw1KfZaW+jrM73XW9+cTMTMqKYnkeuKYCg6BwG4+tEV5aw3EDtJ0XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752684092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7F/ITvYq6wtOT2V4ld8KwCgIselpoPUpQvEpH1HKx14=; b=hIi+bqDn31Hpfb7v61HRdN1Fx8zakgLdjLBzobD+Xb69Iyetgi/28N9C1tLX4dyXch959B jhThvUb/64K6dRSqoXBxxy2EUO3GCeF42/fD6XAONZ0PcVxENklZEobABjz5B9qYvI/8ex 7hNLHm9kW7xhcllThzO2tWukJJuXD5XTSvlm0rkT9xEyU5h+azaD/5aR7snFq/WsFQBLbZ 4rdwskgFlOvRINjmCP1o7D/0Li/bk24HCahSgSQfbANO4pE1nVeyoAujxZVlcSg0aeImgQ 0FnEtUVzf/zihaRnTwkPi3mjaSu7GXxCcnjx+0bxqiKuIVpxsN/mLd/8lQD6ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752684092; a=rsa-sha256; cv=none; b=cf9yHg+aIS0nEe6iB/wZ9BWn8NaJBX2A2fv3M7GKES+85w5WHFKjI40q1jrXD5UNxKphuF YMISVCeaHLwtt3mjK8EpxoaGAEwMyJmZ0hKPqn1H4G5Vq3NiNEQdJE9zjlEsPijofBAjre RRRJ6n2vcB6Dcg9mwIpPKwpm/2QjiF6P+yHyM4s2vELGTVsZZCVB/JXJphJPL7WEusrj7y Yzpyp8rR4mHuaGudp054VIV2s6tK7sy33+p5BCnoeQiHdvs6T/dBCS8katUgm9beGGnAld o9HrgwjJK6eN7Qo0Ji+TdGUBQyTNWn8iaKX6xHcbga+PXg57SsUFU3Rq1YR1EQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj1zJ5zpBz2Tm; Wed, 16 Jul 2025 16:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GGfW7a091793; Wed, 16 Jul 2025 16:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GGfWwV091790; Wed, 16 Jul 2025 16:41:32 GMT (envelope-from git) Date: Wed, 16 Jul 2025 16:41:32 GMT Message-Id: <202507161641.56GGfWwV091790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 310162ea218a - main - hwt(4): Add Intel Processor Trace backend List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 310162ea218a6e6b9d5b2cc6c39f8634f58dc555 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=310162ea218a6e6b9d5b2cc6c39f8634f58dc555 commit 310162ea218a6e6b9d5b2cc6c39f8634f58dc555 Author: Bojan Novković AuthorDate: 2025-07-16 15:32:18 +0000 Commit: Bojan Novković CommitDate: 2025-07-16 16:40:37 +0000 hwt(4): Add Intel Processor Trace backend Differential Revision: https://reviews.freebsd.org/D46397 Reviewed by: kib, markj, br --- sys/amd64/pt/pt.c | 977 ++++++++++++++++++++++++++++++++++++++++++++++++ sys/amd64/pt/pt.h | 49 +++ sys/modules/Makefile | 2 + sys/modules/pt/Makefile | 8 + 4 files changed, 1036 insertions(+) diff --git a/sys/amd64/pt/pt.c b/sys/amd64/pt/pt.c new file mode 100644 index 000000000000..d96da1c1ac17 --- /dev/null +++ b/sys/amd64/pt/pt.c @@ -0,0 +1,977 @@ +/* + * Copyright (c) 2025 Bojan Novković + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* + * hwt(4) Intel Processor Trace (PT) backend + * + * Driver Design Overview + * + * - Since PT is configured on a per-core basis, the driver uses + * 'smp_rendezvous' to start and disable tracing on each target core. + * - PT-specific resources are stored in a 'struct pt_ctx' context structure for + * each traced CPU core or thread. Upon initialization, a ToPA configuration + * is generated for each 'pt_ctx' structure using the HWT tracing buffers. + * The HWT tracing buffer is split into 4K ToPA entries. Currently, each + * 4K ToPA entry is configured to trigger an interrupt after it is filled. + * - The PT driver uses the XSAVE/XRSTOR PT extensions to load and save all + * relevant PT registers. Every time a traced thread is switched + * out or in, its state will be saved to or loaded from its corresponding + * 'pt_ctx' context. + * - When tracing starts, the PT hardware will start writing data into the + * tracing buffer. When a TOPA_INT entry is filled, it will trigger an + * interrupt before continuing. The interrupt handler will then fetch the + * last valid tracing buffer offset and enqueue a HWT_RECORD_BUFFER record. + * The driver is currently configured to use the NMI interrupt line. + * - The userspace PT backend waits for incoming HWT_RECORD_BUFFER records + * and uses the offsets to decode data from the tracing buffer. + * + * Future improvements and limitations + * + * - We currently configure the PT hardware to trigger an interrupt whenever + * a 4K ToPA entry is filled. While this is fine when tracing smaller + * functions or infrequent code paths, this will generate too much interrupt + * traffic when tracing hotter functions. A proper solution for this issue + * should estimate the amount of data generated by the current configuration + * and use it to determine interrupt frequency. + * + * - Support for more tracing options and PT features. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef PT_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif +#define PT_SUPPORTED_FLAGS \ + (RTIT_CTL_MTCEN | RTIT_CTL_CR3FILTER | RTIT_CTL_DIS_TNT | \ + RTIT_CTL_USER | RTIT_CTL_OS | RTIT_CTL_BRANCHEN) +#define PT_XSAVE_MASK (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE) +#define PT_XSTATE_BV (PT_XSAVE_MASK | XFEATURE_ENABLED_PT) +#define PT_MAX_IP_RANGES 2 + +#define PT_TOPA_MASK_PTRS 0x7f +#define PT_TOPA_PAGE_MASK 0xffffff80 +#define PT_TOPA_PAGE_SHIFT 7 + +#define CPUID_PT_LEAF 0x14 + +MALLOC_DEFINE(M_PT, "pt", "Intel Processor Trace"); + +SDT_PROVIDER_DEFINE(pt); +SDT_PROBE_DEFINE(pt, , , topa__intr); + +TASKQUEUE_FAST_DEFINE_THREAD(pt); + +static void pt_send_buffer_record(void *arg, int pending __unused); +static int pt_topa_intr(struct trapframe *tf); + +/* + * Intel Processor Trace XSAVE-managed state. + */ +struct pt_ext_area { + uint64_t rtit_ctl; + uint64_t rtit_output_base; + uint64_t rtit_output_mask_ptrs; + uint64_t rtit_status; + uint64_t rtit_cr3_match; + uint64_t rtit_addr0_a; + uint64_t rtit_addr0_b; + uint64_t rtit_addr1_a; + uint64_t rtit_addr1_b; +}; + +struct pt_buffer { + uint64_t *topa_hw; /* ToPA table entries. */ + size_t size; + struct mtx lock; /* Lock for fields below. */ + vm_offset_t offset; + uint64_t wrap_count; + int curpage; +}; + +struct pt_ctx { + int id; + struct pt_buffer buf; /* ToPA buffer metadata */ + struct task task; /* ToPA buffer notification task */ + struct hwt_context *hwt_ctx; + uint8_t *save_area; /* PT XSAVE area */ +}; +/* PT tracing contexts used for CPU mode. */ +static struct pt_ctx *pt_pcpu_ctx; + +enum pt_cpu_state { + PT_DISABLED = 0, + PT_STOPPED, + PT_ACTIVE +}; + +static struct pt_cpu { + struct pt_ctx *ctx; /* active PT tracing context */ + enum pt_cpu_state state; /* used as part of trace stop protocol */ +} *pt_pcpu; + +/* + * PT-related CPUID bits. + */ +static struct pt_cpu_info { + uint32_t l0_eax; + uint32_t l0_ebx; + uint32_t l0_ecx; + uint32_t l1_eax; + uint32_t l1_ebx; + size_t xsave_area_size; + size_t xstate_hdr_offset; + size_t pt_xsave_offset; +} pt_info __read_mostly; + +static bool initialized = false; +static int cpu_mode_ctr = 0; + +static __inline enum pt_cpu_state +pt_cpu_get_state(int cpu_id) +{ + return (atomic_load_int(&pt_pcpu[cpu_id].state)); +} + +static __inline void +pt_cpu_set_state(int cpu_id, enum pt_cpu_state state) +{ + atomic_store_int(&pt_pcpu[cpu_id].state, state); +} + +static __inline struct xstate_hdr * +pt_ctx_get_xstate_hdr(struct pt_ctx *ctx) +{ + return ((struct xstate_hdr *)(ctx->save_area + + pt_info.xstate_hdr_offset)); +} + + +static __inline struct pt_ext_area * +pt_ctx_get_ext_area(struct pt_ctx *ctx) +{ + return ((struct pt_ext_area *)(ctx->save_area + + pt_info.pt_xsave_offset)); +} + +/* + * Updates current trace buffer offset from the + * ToPA MSRs. Records if the trace buffer wrapped. + */ +static __inline void +pt_update_buffer(struct pt_buffer *buf) +{ + uint64_t reg; + int curpage; + + /* Update buffer offset. */ + reg = rdmsr(MSR_IA32_RTIT_OUTPUT_MASK_PTRS); + curpage = (reg & PT_TOPA_PAGE_MASK) >> PT_TOPA_PAGE_SHIFT; + mtx_lock_spin(&buf->lock); + /* Check if the output wrapped. */ + if (buf->curpage > curpage) + buf->wrap_count++; + buf->curpage = curpage; + buf->offset = reg >> 32; + mtx_unlock_spin(&buf->lock); + + dprintf("%s: wrap_cnt: %lu, curpage: %d, offset: %zu\n", __func__, + buf->wrap_count, buf->curpage, buf->offset); +} + +static __inline void +pt_fill_buffer_record(int id, struct pt_buffer *buf, + struct hwt_record_entry *rec) +{ + rec->record_type = HWT_RECORD_BUFFER; + rec->buf_id = id; + rec->curpage = buf->curpage; + rec->offset = buf->offset + (buf->wrap_count * buf->size); +} + +/* + * Enables or disables tracing on curcpu + * using the XSAVE/XRSTOR PT extensions. + */ +static void +pt_cpu_toggle_local(uint8_t *save_area, bool enable) +{ + u_long xcr0, cr0; + u_long xss; + + cr0 = rcr0(); + if (cr0 & CR0_TS) + clts(); + xcr0 = rxcr(XCR0); + if ((xcr0 & PT_XSAVE_MASK) != PT_XSAVE_MASK) + load_xcr(XCR0, xcr0 | PT_XSAVE_MASK); + xss = rdmsr(MSR_IA32_XSS); + wrmsr(MSR_IA32_XSS, xss | XFEATURE_ENABLED_PT); + + if (!enable) { + KASSERT((rdmsr(MSR_IA32_RTIT_CTL) & RTIT_CTL_TRACEEN) != 0, + ("%s: PT is disabled", __func__)); + xsaves(save_area, XFEATURE_ENABLED_PT); + } else { + KASSERT((rdmsr(MSR_IA32_RTIT_CTL) & RTIT_CTL_TRACEEN) == 0, + ("%s: PT is enabled", __func__)); + xrstors(save_area, XFEATURE_ENABLED_PT); + } + wrmsr(MSR_IA32_XSS, xss); + if ((xcr0 & PT_XSAVE_MASK) != PT_XSAVE_MASK) + load_xcr(XCR0, xcr0); + if (cr0 & CR0_TS) + load_cr0(cr0); +} + +/* + * Starts PT tracing on 'curcpu'. + */ +static void +pt_cpu_start(void *dummy) +{ + struct pt_cpu *cpu; + + cpu = &pt_pcpu[curcpu]; + MPASS(cpu->ctx != NULL); + + dprintf("%s: curcpu %d\n", __func__, curcpu); + load_cr4(rcr4() | CR4_XSAVE); + wrmsr(MSR_IA32_RTIT_STATUS, 0); + pt_cpu_set_state(curcpu, PT_ACTIVE); + pt_cpu_toggle_local(cpu->ctx->save_area, true); +} + +/* + * Stops PT tracing on 'curcpu'. + * Updates trace buffer offset to ensure + * any data generated between the last interrupt + * and the trace stop gets picked up by userspace. + */ +static void +pt_cpu_stop(void *dummy) +{ + struct pt_cpu *cpu; + struct pt_ctx *ctx; + + /* Shutdown may occur before PT gets properly configured. */ + if (pt_cpu_get_state(curcpu) == PT_DISABLED) + return; + + cpu = &pt_pcpu[curcpu]; + ctx = cpu->ctx; + MPASS(ctx != NULL); + dprintf("%s: curcpu %d\n", __func__, curcpu); + + pt_cpu_set_state(curcpu, PT_STOPPED); + pt_cpu_toggle_local(cpu->ctx->save_area, false); + pt_update_buffer(&ctx->buf); +} + +/* + * Prepares the Table of Physical Addresses (ToPA) metadata for 'pt_ctx'. + * The HWT trace buffer is split into 4K ToPA table entries and used + * as a circular buffer, meaning that the last ToPA entry points to + * the first ToPA entry. Each entry is configured to raise an + * interrupt after being filled. + */ +static int +pt_topa_prepare(struct pt_ctx *ctx, struct hwt_vm *vm) +{ + struct pt_buffer *buf; + size_t topa_size; + int i; + + topa_size = TOPA_SIZE_4K; + buf = &ctx->buf; + + KASSERT(buf->topa_hw == NULL, + ("%s: ToPA info already exists", __func__)); + buf->topa_hw = mallocarray(vm->npages + 1, sizeof(uint64_t), M_PT, + M_ZERO | M_WAITOK); + dprintf("%s: ToPA virt addr %p\n", __func__, buf->topa_hw); + buf->size = vm->npages * PAGE_SIZE; + for (i = 0; i < vm->npages; i++) { + buf->topa_hw[i] = VM_PAGE_TO_PHYS(vm->pages[i]) | topa_size; + /* + * XXX: TOPA_INT should ideally be set according to + * expected amount of incoming trace data. Too few TOPA_INT + * entries will not trigger interrupts often enough when tracing + * smaller functions. + */ + buf->topa_hw[i] |= TOPA_INT; + } + buf->topa_hw[vm->npages] = (uint64_t)vtophys(buf->topa_hw) | TOPA_END; + + return (0); +} + +/* + * Configures IP filtering for trace generation. + * A maximum of 2 ranges can be specified due to + * limitations imposed by the XSAVE/XRSTOR PT extensions. + */ +static int +pt_configure_ranges(struct pt_ctx *ctx, struct pt_cpu_config *cfg) +{ + struct pt_ext_area *pt_ext; + int nranges_supp, n, error = 0; + + pt_ext = pt_ctx_get_ext_area(ctx); + if (pt_info.l0_ebx & CPUPT_IPF) { + nranges_supp = (pt_info.l1_eax & CPUPT_NADDR_M) >> + CPUPT_NADDR_S; + + if (nranges_supp > PT_IP_FILTER_MAX_RANGES) + nranges_supp = PT_IP_FILTER_MAX_RANGES; + n = cfg->nranges; + if (n > nranges_supp) { + printf("%s: %d IP filtering ranges requested, CPU " + "supports %d, truncating\n", + __func__, n, nranges_supp); + n = nranges_supp; + } + + switch (n) { + case 2: + pt_ext->rtit_ctl |= (1UL << RTIT_CTL_ADDR_CFG_S(1)); + pt_ext->rtit_addr1_a = cfg->ip_ranges[1].start; + pt_ext->rtit_addr1_b = cfg->ip_ranges[1].end; + case 1: + pt_ext->rtit_ctl |= (1UL << RTIT_CTL_ADDR_CFG_S(0)); + pt_ext->rtit_addr0_a = cfg->ip_ranges[0].start; + pt_ext->rtit_addr0_b = cfg->ip_ranges[0].end; + break; + default: + error = (EINVAL); + break; + }; + } else + error = (ENXIO); + + return (error); +} + +static int +pt_init_ctx(struct pt_ctx *pt_ctx, struct hwt_vm *vm, int ctx_id) +{ + + dprintf("%s: ctx id %d\n", __func__, ctx_id); + + KASSERT(pt_ctx->buf.topa_hw == NULL, + ("%s: active ToPA buffer in context %p\n", __func__, pt_ctx)); + + memset(pt_ctx, 0, sizeof(struct pt_ctx)); + mtx_init(&pt_ctx->buf.lock, "pttopa", NULL, MTX_SPIN); + pt_ctx->save_area = malloc_aligned(pt_info.xsave_area_size, 64, + M_PT, M_NOWAIT | M_ZERO); + if (pt_ctx->save_area == NULL) + return (ENOMEM); + dprintf("%s: preparing ToPA buffer\n", __func__); + if (pt_topa_prepare(pt_ctx, vm) != 0) { + dprintf("%s: failed to prepare ToPA buffer\n", __func__); + free(pt_ctx->save_area, M_PT); + return (ENOMEM); + } + + pt_ctx->id = ctx_id; + TASK_INIT(&pt_ctx->task, 0, pt_send_buffer_record, pt_ctx); + + return (0); +} + +static void +pt_deinit_ctx(struct pt_ctx *pt_ctx) +{ + + if (pt_ctx->buf.topa_hw != NULL) + free(pt_ctx->buf.topa_hw, M_PT); + if (pt_ctx->save_area != NULL) + free(pt_ctx->save_area, M_PT); + memset(pt_ctx, 0, sizeof(*pt_ctx)); + pt_ctx->buf.topa_hw = NULL; +} + +/* + * HWT backend configuration method. + * + * Checks and translates the user-defined configuration to a + * set of PT tracing features. Uses the feature set to initialize + * the tracing context for the target CPU or thread. + */ +static int +pt_backend_configure(struct hwt_context *ctx, int cpu_id, int thread_id) +{ + struct hwt_cpu *hwt_cpu; + struct hwt_thread *thr; + struct pt_ctx *pt_ctx; + struct pt_cpu_config *cfg; + struct pt_ext_area *pt_ext; + struct xstate_hdr *hdr; + int error; + + dprintf("%s\n", __func__); + + cfg = (struct pt_cpu_config *)ctx->config; + pt_ctx = NULL; + + /* Clear any flags we don't support yet. */ + cfg->rtit_ctl &= PT_SUPPORTED_FLAGS; + if (cfg->rtit_ctl & RTIT_CTL_MTCEN) { + if ((pt_info.l0_ebx & CPUPT_MTC) == 0) { + printf("%s: CPU does not support generating MTC " + "packets\n", __func__); + return (ENXIO); + } + } + + if (cfg->rtit_ctl & RTIT_CTL_CR3FILTER) { + if ((pt_info.l0_ebx & CPUPT_CR3) == 0) { + printf("%s: CPU does not support CR3 filtering\n", + __func__); + return (ENXIO); + } + } + + if (cfg->rtit_ctl & RTIT_CTL_DIS_TNT) { + if ((pt_info.l0_ebx & CPUPT_DIS_TNT) == 0) { + printf("%s: CPU does not support TNT\n", __func__); + return (ENXIO); + } + } + /* TODO: support for more config bits. */ + + if (ctx->mode == HWT_MODE_CPU) { + TAILQ_FOREACH(hwt_cpu, &ctx->cpus, next) { + if (hwt_cpu->cpu_id != cpu_id) + continue; + pt_ctx = &pt_pcpu_ctx[cpu_id]; + break; + } + } else { + TAILQ_FOREACH(thr, &ctx->threads, next) { + if (thr->thread_id != thread_id) + continue; + KASSERT(thr->private != NULL, + ("%s: hwt thread private" + " not set, thr %p", + __func__, thr)); + pt_ctx = (struct pt_ctx *)thr->private; + break; + } + } + if (pt_ctx == NULL) + return (ENOENT); + + dprintf("%s: preparing MSRs\n", __func__); + pt_ext = pt_ctx_get_ext_area(pt_ctx); + hdr = pt_ctx_get_xstate_hdr(pt_ctx); + + pt_ext->rtit_ctl |= cfg->rtit_ctl; + if (cfg->nranges != 0) { + dprintf("%s: preparing IPF ranges\n", __func__); + if ((error = pt_configure_ranges(pt_ctx, cfg)) != 0) + return (error); + } + pt_ctx->hwt_ctx = ctx; + pt_ext->rtit_ctl |= RTIT_CTL_TOPA; + pt_ext->rtit_output_base = (uint64_t)vtophys(pt_ctx->buf.topa_hw); + pt_ext->rtit_output_mask_ptrs = PT_TOPA_MASK_PTRS; + hdr->xstate_bv = XFEATURE_ENABLED_PT; + hdr->xstate_xcomp_bv = XFEATURE_ENABLED_PT | + XSTATE_XCOMP_BV_COMPACT; + pt_ext->rtit_ctl |= RTIT_CTL_TRACEEN; + pt_pcpu[cpu_id].ctx = pt_ctx; + pt_cpu_set_state(cpu_id, PT_STOPPED); + + return (0); +} + +/* + * hwt backend trace start operation. CPU affine. + */ +static void +pt_backend_enable(struct hwt_context *ctx, int cpu_id) +{ + if (ctx->mode == HWT_MODE_CPU) + return; + + KASSERT(curcpu == cpu_id, + ("%s: attempting to start PT on another cpu", __func__)); + pt_cpu_start(NULL); + CPU_SET(cpu_id, &ctx->cpu_map); +} + +/* + * hwt backend trace stop operation. CPU affine. + */ +static void +pt_backend_disable(struct hwt_context *ctx, int cpu_id) +{ + struct pt_cpu *cpu; + + if (ctx->mode == HWT_MODE_CPU) + return; + + KASSERT(curcpu == cpu_id, + ("%s: attempting to disable PT on another cpu", __func__)); + pt_cpu_stop(NULL); + CPU_CLR(cpu_id, &ctx->cpu_map); + cpu = &pt_pcpu[cpu_id]; + cpu->ctx = NULL; +} + +/* + * hwt backend trace start operation for remote CPUs. + */ +static int +pt_backend_enable_smp(struct hwt_context *ctx) +{ + + dprintf("%s\n", __func__); + if (ctx->mode == HWT_MODE_CPU && + atomic_swap_32(&cpu_mode_ctr, 1) != 0) + return (-1); + + KASSERT(ctx->mode == HWT_MODE_CPU, + ("%s: should only be used for CPU mode", __func__)); + smp_rendezvous_cpus(ctx->cpu_map, NULL, pt_cpu_start, NULL, NULL); + + return (0); +} + +/* + * hwt backend trace stop operation for remote CPUs. + */ +static int +pt_backend_disable_smp(struct hwt_context *ctx) +{ + + dprintf("%s\n", __func__); + if (ctx->mode == HWT_MODE_CPU && + atomic_swap_32(&cpu_mode_ctr, 0) == 0) + return (-1); + + if (CPU_EMPTY(&ctx->cpu_map)) { + dprintf("%s: empty cpu map\n", __func__); + return (-1); + } + smp_rendezvous_cpus(ctx->cpu_map, NULL, pt_cpu_stop, NULL, NULL); + + return (0); +} + +/* + * HWT backend initialization method. + * + * Installs the ToPA interrupt handler and initializes + * the tracing contexts used for HWT_MODE_CPU. + */ +static int +pt_backend_init(struct hwt_context *ctx) +{ + struct hwt_cpu *hwt_cpu; + int error; + + dprintf("%s\n", __func__); + if (ctx->mode == HWT_MODE_CPU) { + TAILQ_FOREACH(hwt_cpu, &ctx->cpus, next) { + error = pt_init_ctx(&pt_pcpu_ctx[hwt_cpu->cpu_id], + hwt_cpu->vm, hwt_cpu->cpu_id); + if (error) + return (error); + } + } + + return (0); +} + +/* + * HWT backend teardown method. + * + * Removes the ToPA interrupt handler, stops tracing on all active CPUs, + * and releases all previously allocated ToPA metadata. + */ +static int +pt_backend_deinit(struct hwt_context *ctx) +{ + struct pt_ctx *pt_ctx; + struct hwt_thread *thr; + int cpu_id; + + dprintf("%s\n", __func__); + + pt_backend_disable_smp(ctx); + if (ctx->mode == HWT_MODE_THREAD) { + TAILQ_FOREACH(thr, &ctx->threads, next) { + KASSERT(thr->private != NULL, + ("%s: thr->private not set", __func__)); + pt_ctx = (struct pt_ctx *)thr->private; + pt_deinit_ctx(pt_ctx); + } + } else { + CPU_FOREACH(cpu_id) { + if (!CPU_ISSET(cpu_id, &ctx->cpu_map)) + continue; + if (pt_pcpu[cpu_id].ctx != NULL) { + KASSERT(pt_pcpu[cpu_id].ctx == + &pt_pcpu_ctx[cpu_id], + ("%s: CPU mode tracing with non-cpu mode PT" + "context active", + __func__)); + pt_pcpu[cpu_id].ctx = NULL; + } + pt_ctx = &pt_pcpu_ctx[cpu_id]; + pt_deinit_ctx(pt_ctx); + memset(&pt_pcpu[cpu_id], 0, sizeof(struct pt_cpu)); + } + } + + return (0); +} + +/* + * Fetches current offset into the tracing buffer. + */ +static int +pt_backend_read(struct hwt_vm *vm, int *curpage, vm_offset_t *curpage_offset, + uint64_t *data) +{ + struct pt_buffer *buf; + + if (vm->ctx->mode == HWT_MODE_THREAD) + buf = &((struct pt_ctx *)vm->thr->private)->buf; + else + buf = &pt_pcpu[vm->cpu->cpu_id].ctx->buf; + mtx_lock_spin(&buf->lock); + *curpage = buf->curpage; + *curpage_offset = buf->offset + (buf->wrap_count * vm->ctx->bufsize); + mtx_unlock_spin(&buf->lock); + + return (0); +} + +/* + * HWT thread creation hook. + * Allocates and associates a 'struct pt_ctx' for a given hwt thread. + */ +static int +pt_backend_alloc_thread(struct hwt_thread *thr) +{ + struct pt_ctx *pt_ctx; + int error; + + /* Omit M_WAITOK since this might get invoked a non-sleepable context */ + pt_ctx = malloc(sizeof(*pt_ctx), M_PT, M_NOWAIT | M_ZERO); + if (pt_ctx == NULL) + return (ENOMEM); + + error = pt_init_ctx(pt_ctx, thr->vm, thr->thread_id); + if (error) + return (error); + + thr->private = pt_ctx; + return (0); +} +/* + * HWT thread teardown hook. + */ +static void +pt_backend_free_thread(struct hwt_thread *thr) +{ + struct pt_ctx *ctx; + + ctx = (struct pt_ctx *)thr->private; + + pt_deinit_ctx(ctx); + free(ctx, M_PT); +} + +static void +pt_backend_dump(int cpu_id) +{ +} + +static struct hwt_backend_ops pt_ops = { + .hwt_backend_init = pt_backend_init, + .hwt_backend_deinit = pt_backend_deinit, + + .hwt_backend_configure = pt_backend_configure, + + .hwt_backend_enable = pt_backend_enable, + .hwt_backend_disable = pt_backend_disable, + +#ifdef SMP + .hwt_backend_enable_smp = pt_backend_enable_smp, + .hwt_backend_disable_smp = pt_backend_disable_smp, +#endif + + .hwt_backend_read = pt_backend_read, + .hwt_backend_dump = pt_backend_dump, + + .hwt_backend_thread_alloc = pt_backend_alloc_thread, + .hwt_backend_thread_free = pt_backend_free_thread, +}; + +static struct hwt_backend backend = { + .ops = &pt_ops, + .name = "pt", + .kva_req = 1, +}; + +/* + * Reads the latest valid trace buffer offset and enqueues + * a HWT_RECORD_BUFFER record. + * Used as a taskqueue routine from the ToPA interrupt handler. + */ +static void +pt_send_buffer_record(void *arg, int pending __unused) +{ + struct hwt_record_entry record; + struct pt_ctx *ctx = (struct pt_ctx *)arg; + + /* Prepare buffer record. */ + mtx_lock_spin(&ctx->buf.lock); + pt_fill_buffer_record(ctx->id, &ctx->buf, &record); + mtx_unlock_spin(&ctx->buf.lock); + hwt_record_ctx(ctx->hwt_ctx, &record, M_ZERO | M_NOWAIT); +} +static void +pt_topa_status_clear(void) +{ + uint64_t reg; + + reg = rdmsr(MSR_IA_GLOBAL_STATUS_RESET); + reg &= ~GLOBAL_STATUS_FLAG_TRACETOPAPMI; + reg |= GLOBAL_STATUS_FLAG_TRACETOPAPMI; + wrmsr(MSR_IA_GLOBAL_STATUS_RESET, reg); +} + +/* + * ToPA PMI handler. + * + * Invoked every time a ToPA entry marked with TOPA_INT is filled. + * Uses taskqueue to enqueue a buffer record for userspace. + * Re-enables the PC interrupt line as long as tracing is active. + */ +static int +pt_topa_intr(struct trapframe *tf) +{ + struct pt_buffer *buf; + struct pt_ctx *ctx; + uint64_t reg; + + SDT_PROBE0(pt, , , topa__intr); + + if (pt_cpu_get_state(curcpu) != PT_ACTIVE) { + return (0); + } + reg = rdmsr(MSR_IA_GLOBAL_STATUS); + if ((reg & GLOBAL_STATUS_FLAG_TRACETOPAPMI) == 0) { + /* ACK spurious or leftover interrupt. */ + pt_topa_status_clear(); + return (1); + } + + ctx = pt_pcpu[curcpu].ctx; + buf = &ctx->buf; + KASSERT(buf->topa_hw != NULL, + ("%s: ToPA PMI interrupt with invalid buffer", __func__)); + + pt_cpu_toggle_local(ctx->save_area, false); + pt_update_buffer(buf); + pt_topa_status_clear(); + taskqueue_enqueue_flags(taskqueue_pt, &ctx->task, + TASKQUEUE_FAIL_IF_PENDING); + + if (pt_cpu_get_state(curcpu) == PT_ACTIVE) { + pt_cpu_toggle_local(ctx->save_area, true); + lapic_reenable_pcint(); + } + return (1); +} + +/* + * Module initialization. + * + * Saves all PT-related cpuid info, registers itself as a HWT backend, + * and allocates metadata required to keep track of tracing operations + * on each CPU. + */ +static int +pt_init(void) +{ + u_int cp[4]; + int error; + + dprintf("pt: Enumerating part 1\n"); + cpuid_count(CPUID_PT_LEAF, 0, cp); + dprintf("pt: Maximum valid sub-leaf Index: %x\n", cp[0]); + dprintf("pt: ebx %x\n", cp[1]); + dprintf("pt: ecx %x\n", cp[2]); + + pt_info.l0_eax = cp[0]; + pt_info.l0_ebx = cp[1]; + pt_info.l0_ecx = cp[2]; + + dprintf("pt: Enumerating part 2\n"); + cpuid_count(CPUID_PT_LEAF, 1, cp); + dprintf("pt: eax %x\n", cp[0]); + dprintf("pt: ebx %x\n", cp[1]); + + pt_info.l1_eax = cp[0]; + pt_info.l1_ebx = cp[1]; + + error = hwt_backend_register(&backend); + if (error != 0) { + printf("pt: unable to register hwt backend, error %d\n", error); + return (error); + } + pt_pcpu = mallocarray(mp_ncpus, sizeof(struct pt_cpu), M_PT, + M_ZERO | M_WAITOK); + pt_pcpu_ctx = mallocarray(mp_ncpus, sizeof(struct pt_ctx), M_PT, + M_ZERO | M_WAITOK); + + nmi_register_handler(pt_topa_intr); + if (!lapic_enable_pcint()) { + nmi_remove_handler(pt_topa_intr); + hwt_backend_unregister(&backend); + free(pt_pcpu, M_PT); + free(pt_pcpu_ctx, M_PT); + pt_pcpu = NULL; + pt_pcpu_ctx = NULL; + printf("pt: failed to setup interrupt line\n"); + return (error); + } + initialized = true; + + return (0); +} + +/* + * Checks whether the CPU support Intel PT and + * initializes XSAVE area info. + * + * The driver relies on XSAVE/XRSTOR PT extensions, + * Table of Physical Addresses (ToPA) support, and + * support for multiple ToPA entries. + */ +static bool +pt_supported(void) +{ + u_int cp[4]; + + if ((cpu_stdext_feature & CPUID_STDEXT_PROCTRACE) == 0) { + printf("pt: CPU does not support Intel Processor Trace\n"); + return (false); + } + if ((cpu_feature2 & CPUID2_XSAVE) == 0) { + printf("pt: XSAVE is not supported\n"); + return (false); + } + if (!xsave_extfeature_supported(XFEATURE_ENABLED_PT, true)) { + printf("pt: CPU does not support managing PT state using XSAVE\n"); + return (false); + } + if (!xsave_extension_supported(CPUID_EXTSTATE_XSAVEC)) { + printf("pt: XSAVE compaction is not supported\n"); + return (false); + } + if (!xsave_extension_supported(CPUID_EXTSTATE_XSAVES)) { + printf("pt: CPU does not support XSAVES/XRSTORS\n"); + return (false); + } + + /* Require ToPA support. */ + cpuid_count(CPUID_PT_LEAF, 0, cp); + if ((cp[2] & CPUPT_TOPA) == 0) { + printf("pt: ToPA is not supported\n"); + return (false); + } + if ((cp[2] & CPUPT_TOPA_MULTI) == 0) { + printf("pt: multiple ToPA outputs are not supported\n"); + return (false); + } + + pt_info.xstate_hdr_offset = xsave_area_hdr_offset(); + pt_info.xsave_area_size = xsave_area_size(PT_XSTATE_BV, true, true); + pt_info.pt_xsave_offset = xsave_area_offset(PT_XSTATE_BV, + XFEATURE_ENABLED_PT, true, true); + + return (true); +} + +static void +pt_deinit(void) +{ + if (!initialized) + return; + nmi_remove_handler(pt_topa_intr); + lapic_disable_pcint(); + hwt_backend_unregister(&backend); + free(pt_pcpu, M_PT); + free(pt_pcpu_ctx, M_PT); + pt_pcpu = NULL; + initialized = false; +} + +static int +pt_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + if (!pt_supported() || pt_init() != 0) { *** 107 LINES SKIPPED *** From nobody Wed Jul 16 17:16:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj2lz49Ldz61m31; Wed, 16 Jul 2025 17:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj2lz24kwz47VG; Wed, 16 Jul 2025 17:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752686207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ICO/2sUSM0ByiH3FD9dVwNVusWkKpJn/efNoBiKQDLs=; b=Vk4NaEwvEYAcwYPGUbYUGOYl9IxGVJu1Ph+Z3qNsgi2AydCj6HSN/mq/vXXFzp9c7RPOhT zBr6JZQ5o6TYT9XjSyal5swxuiQTlhzONAeyA7xV5lvePDaQAaxuE39LhM0bIMLv0qithx abGWLSfns32J573bwS5IXiwiFG27iEoc8DtjDi+VZ3S2R8mh5vM7vfWWdXndfSW3FA2Vk/ 5lQxh4E6XK5Ltccplek4R5vDFxmy7c8sLA6huPnmyBLJOtomaJFl66nQbZ6HSCrwGC32W9 yTarJGw/k65aU+LqoXSD7f+in4WG38J1b3fszZqi7At97+YEFhszP48og0dIOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752686207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ICO/2sUSM0ByiH3FD9dVwNVusWkKpJn/efNoBiKQDLs=; b=UTrMZthu6WlK/wdMe6PFcCQMNwh/Efn1ov8SHO7mAusTvEos2aI/UVDLrllma5a4v5Z5g0 PVX4Vs7KmdqouEtHm9gd4DEn+OfMzryRLTFEr4iu9k08gjsr/9mRYdSstbh3vwd1CIuROq 3Mp/c4I+QX0VHJonIwfu4dIokxbdYs/I7yKU6cAX6UGcb1x/H/uWY8yjA+J+/XbQYKNpPq QiGVsBXVG1jPR/5CfZZFWhfCJCVjfXcYPkZlAe92xXMBUSiNanY21Z0RKX8XFUuS4Eem2r gQsB4ckrllQat8cXQ+1jBFx8yelRxTKJmGRWjqschwk0zFalHXATjNl/mh3SvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752686207; a=rsa-sha256; cv=none; b=OSABedn4ZFCxoVGkitW3mlwgZUrsgkumOcrMfOX3Kb1YnevYG+n6wCf5Ur2rYDNohpRRbF pZ7cK9bkHidEW0dt3DDfyF1vR0VXd4BLJUA4Yoao0SBcJFxhvKUSnXKRwDUjdLpvvZmSgJ cX2v52dYiTjk8mepbbnZAdqzsa+2wk5RgcndPT2lA2Z1kHixKkjSaSmLRI2g0Xeej/NZZU X1pEsuBlHi10weqQ8LHkQAq6ePnlkYYRfOS1xsvncd0tKOnctkPmWitu+99hPKhwLmTQfv zWQoCyKzS+Emum4ge8eAfHocDwLRAUFQ6uybJx68mm9+2GpjglmgmYRkiH6S0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj2lz1C4lz3dk; Wed, 16 Jul 2025 17:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GHGkRj052904; Wed, 16 Jul 2025 17:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GHGk68052901; Wed, 16 Jul 2025 17:16:46 GMT (envelope-from git) Date: Wed, 16 Jul 2025 17:16:46 GMT Message-Id: <202507161716.56GHGk68052901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 42d59ad1d63e - main - pt: Include missing sys/lock.h header List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42d59ad1d63e811998af3efbab1268e6787b750f Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=42d59ad1d63e811998af3efbab1268e6787b750f commit 42d59ad1d63e811998af3efbab1268e6787b750f Author: Bojan Novković AuthorDate: 2025-07-16 17:14:17 +0000 Commit: Bojan Novković CommitDate: 2025-07-16 17:14:17 +0000 pt: Include missing sys/lock.h header Fixes: 310162ea218a --- sys/amd64/pt/pt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/pt/pt.c b/sys/amd64/pt/pt.c index d96da1c1ac17..c7b75767680a 100644 --- a/sys/amd64/pt/pt.c +++ b/sys/amd64/pt/pt.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include From nobody Wed Jul 16 17:50:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj3VX1xV3z61nGB; Wed, 16 Jul 2025 17:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj3VX16Lvz3TNh; Wed, 16 Jul 2025 17:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752688212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ey8EQrSugjdQTh56/jVmaj+5JR3W23IWvE5TAnA3ESU=; b=LvT61LbVCOsfFRDkBHWGy3QSgZjI3xY0r1OxeLOe2cYHS8LCSj5KMzj2wwneHkiJYLcyio MDRFMwfGAwCeTLI4BoLF6Vbuq/H2CMK0jjiW7yIADm15pj7Z6txR/Rpj7VNjvwscYIXG5W Q2BkMSEMW3Hsb7NZNmSa1gT+c9GVQd9qPcBHcX2CezbA3H8MxYRiwy1MqolVijZ4lns3Q4 01skwh/djRG95olniY36pl4EXMa5hCRkmwXwz4PHZsaXvPc7lam1RC7oaSEDs3tPJJQkKK az/bpnN60cKyRR6L2fpnz4aGONEMqUXfdcRlZmXPSw4S7a5K3hnOHnisqOtD+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752688212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ey8EQrSugjdQTh56/jVmaj+5JR3W23IWvE5TAnA3ESU=; b=Z+Gz0cLfNZI5oZjHwlWmzAIHRKMv6Gk3sgaMot/psMsQkRWXGWeG1yLju0ObCkgvYRpVQc SITYB38B6vaq+0tSbjs4mDALoQWG/Jjr04Ch43GJDvFCIWBVuW6RZyw/AOXbiv2ac6al94 SyOASXDaXpWsuzDeFhobyH1aC3fud9gPy+UoIn0WmPUWYdqKpWDSD1MZeQBesTW7hcFfuq TGFzoJ3CIQ9DDddVsiza4CajByo4kfAZ3C8LBoWq+AKkd+vFoFlRXnzC/TynAZVR2Tar95 pHB6qANRDIQNURPGSTkcSV0AC4OhTcT9Go53Rz0P4NEUrTjXTYat3Qr/aoEeMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752688212; a=rsa-sha256; cv=none; b=OOi7qPZRWwtuGMbqbOtJFU+kYAM4p4z5hPrnBHdZDoYgjWRSMC5WLV1Dfjr42Io1BgUUYJ sLM6XFHJpMa0Zv/xaw3D93fzS5rEvlaSrrNc5T4/KPEiAa/yKWaAhYVxib8msSGoOF95+P r6mrge9Fl7P58JM/4+AET4AmPFZbwdBlRBPofpWKWxGZwnWVAvrYYGn2IwOgZ4jX96lFJQ Q+8DeuieMwfnXjpU/HCnc1b7cAB70T4nqmuOqa9wKOd2RjggVLlFk/qalObqCYqoU8HEVG +dIPoEQT4x2CIAb1VHI3Q/iMQRxWYJ1XIY2V7MX/JUjT8zXO3RUA4e/0ElD+kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj3VX0jHYz4d8; Wed, 16 Jul 2025 17:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GHoCpf015737; Wed, 16 Jul 2025 17:50:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GHoBkH015724; Wed, 16 Jul 2025 17:50:11 GMT (envelope-from git) Date: Wed, 16 Jul 2025 17:50:11 GMT Message-Id: <202507161750.56GHoBkH015724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jesper Schmitz Mouridsen Subject: git: fc618b5f7e58 - main - preliminary usb support for fwget List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jsm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc618b5f7e5844b859030d8337b2b272dc20169e Auto-Submitted: auto-generated The branch main has been updated by jsm: URL: https://cgit.FreeBSD.org/src/commit/?id=fc618b5f7e5844b859030d8337b2b272dc20169e commit fc618b5f7e5844b859030d8337b2b272dc20169e Author: Jesper Schmitz Mouridsen AuthorDate: 2025-07-16 17:26:23 +0000 Commit: Jesper Schmitz Mouridsen CommitDate: 2025-07-16 17:49:14 +0000 preliminary usb support for fwget Mostly a copy of pci subsystem support, by replacing pciconf with usbconfig and excluding hardware classes. Approved by: wireless (bz) manpages (ziaee) USB (bz) Differential Revision: https://reviews.freebsd.org/D48678 --- usr.sbin/fwget/Makefile | 2 +- usr.sbin/fwget/fwget.8 | 14 +++++++++++--- usr.sbin/fwget/fwget.sh | 6 +++--- usr.sbin/fwget/usb/Makefile | 10 ++++++++++ usr.sbin/fwget/usb/usb | 43 +++++++++++++++++++++++++++++++++++++++++++ usr.sbin/fwget/usb/usb_ralink | 12 ++++++++++++ 6 files changed, 80 insertions(+), 7 deletions(-) diff --git a/usr.sbin/fwget/Makefile b/usr.sbin/fwget/Makefile index 1cdf0f18230d..4c934aee3413 100644 --- a/usr.sbin/fwget/Makefile +++ b/usr.sbin/fwget/Makefile @@ -2,6 +2,6 @@ PACKAGE= fwget SCRIPTS= fwget MAN= fwget.8 -SUBDIR= pci +SUBDIR= pci usb .include diff --git a/usr.sbin/fwget/fwget.8 b/usr.sbin/fwget/fwget.8 index 7b8b606cc591..86e304775e2d 100644 --- a/usr.sbin/fwget/fwget.8 +++ b/usr.sbin/fwget/fwget.8 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 27, 2024 +.Dd July 7, 2025 .Dt FWGET 8 .Os .Sh NAME @@ -47,7 +47,11 @@ Dry run, only show needed packages .It Fl v Be more verbose .It Ar subsystem -Hardware subsystem, default pci +Hardware subsystem(s), default is all supported subsystems. +Space separated hardware subsystems, accepts +.Cm pci +and +.Cm usb .El .Sh SEE ALSO .Xr firmware 9 @@ -64,4 +68,8 @@ utility and this manual page were written by .An Emmanuel Vadot Aq Mt manu@FreeBSD.org for Beckhoff Automation GmbH & Co\. KG. .Sh CAVEATS -This utility currently only supports the pci subsystem. +This utility currently only supports the +.Xr pci 4 +and +.Xr usb 4 +subsystems. diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index 138a2a26bfb1..de1e6fa51f0f 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -35,7 +35,7 @@ usage() Usage: $(basename "$0") [options] [subsystem] Supported subsystems - pci + pci, usb Options: -n -- Do not install packages, only print the results @@ -100,9 +100,9 @@ done shift $(($OPTIND - 1)) subsystems="$@" -# Default searching PCI subsystem +# Default searching PCI and USB subsystem if [ -z "${subsystems}" ]; then - subsystems="pci" + subsystems="pci usb" fi # Fail early on unsupported subsystem diff --git a/usr.sbin/fwget/usb/Makefile b/usr.sbin/fwget/usb/Makefile new file mode 100644 index 000000000000..315e9c743cc8 --- /dev/null +++ b/usr.sbin/fwget/usb/Makefile @@ -0,0 +1,10 @@ +PACKAGE= fwget + +SCRIPTS=usb \ + usb_ralink + +BINDIR= ${LIBEXECDIR}/fwget + +MAN= + +.include diff --git a/usr.sbin/fwget/usb/usb b/usr.sbin/fwget/usb/usb new file mode 100755 index 000000000000..fef6bc76ba89 --- /dev/null +++ b/usr.sbin/fwget/usb/usb @@ -0,0 +1,43 @@ +# +# Copyright 2023 Beckhoff Automation GmbH & Co. KG +# Copyright 2023 Bjoern A. Zeeb +# Copyright 2025 Jesper Schmitz Mouridsen + +# SPDX-License-Identifier: BSD-2-Clause + + +usb_get_vendor() +{ + local hexvendor=$(echo $1 | sed 's/.*idVendor=\(0x[0-9a-z]*\).*/\1/') + case "${hexvendor}" in + 0x148f) echo "ralink" ;; + esac +} + +usb_get_device() +{ + local hexdevice=$(echo $1 | sed 's/.*idProduct=\(0x[0-9a-z]*\).*/\1/') + echo "${hexdevice}" + +} + +usb_search_packages() +{ + local IFS + + oldifs=$IFS + IFS=$'\n' + for fulldevice in $(usbconfig -l dump_device_desc); do + vendor=$(usb_get_vendor "${fulldevice}") + if [ -z "${vendor}" ]; then + continue + fi + device=$(usb_get_device "${fulldevice}") + log_verbose "Trying to match device ${device} and vendor ${vendor} with usb_${vendor}" + if [ -f ${LIBEXEC_PATH}/usb_${vendor} ]; then + . ${LIBEXEC_PATH}/usb_${vendor} + usb_${vendor} ${device} + fi + done + IFS=${oldifs} +} diff --git a/usr.sbin/fwget/usb/usb_ralink b/usr.sbin/fwget/usb/usb_ralink new file mode 100755 index 000000000000..8d3135063011 --- /dev/null +++ b/usr.sbin/fwget/usb/usb_ralink @@ -0,0 +1,12 @@ +# +# Copyright (c) 2025 Jesper Schmitz Mouridsen +# +# SPDX-License-Identifier: BSD-2-Clause + +usb_ralink() +{ + + case "$1" in + 0x7601) addpkg "wifi-firmware-mt7601u-kmod"; return 1 ;; + esac +} From nobody Wed Jul 16 18:02:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj3n85jmWz61p7d; Wed, 16 Jul 2025 18:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj3n84rwkz3cfT; Wed, 16 Jul 2025 18:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752688972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=123kNPjoV9yWDuunOTAjzbh3hl2nqbXDyJjf7my4580=; b=Ki7kjAVBQ/5oR6jx5aeyaWwLyDtWpLP6SarSPx08fVrGpqU6W0MUifDepsTbTHQRFDxLUN LSDSUsH/q2/vL8zIFqV7z6BZdshHO/uED6x1wjlJK8jaPDRs/6a+lO4vAJH6Us1vLEWsPV 7LqE9V+FScgWCbT2n9hoadMoGdgUEf6V5pVKpM8WTCPjz9iK6jneBirX220QauRwV5uAT0 IcUEKqhuPST7eutckXgFglyUPxWHZDhs6vHCfFPHFCkPb7gXYgF3RA+7qTd5F+Ww5ZaCsu 4hVhIMEWxXNWCdSinyDMXI8UbPwVGzoiHhm7nrJ3U0sqIIuLWPmIs1kM4/OzzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752688972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=123kNPjoV9yWDuunOTAjzbh3hl2nqbXDyJjf7my4580=; b=feR/DeR4hzL8eLbMuzR6fibvfYgMrevMgsNbGlO0rPbFQ0kJdl1tmSOcs/Jbij+O4mWfUP 9WOP+ODqSo0GSsR2zfujr966/l7Iui1QMyMfvf9D/s0ErDv9+Ffu7nnYgIBc17cah8VXHz HQQYZvEAKtz+q3lWBVXTfRiWA7/X8hIceCWOhFaTVJ71i4OtEnoizIu7+WxwVm2mdpTgQK R9ji3E2dFXA+XsbkwDDAbLZSORT+paN2MBQD/dnYe7pbqpEgMDCn5ZVg/G2JntRWyKqhuJ s8l5LQCwRkLu8s+LGppca33XIiIK7h1kC7yibdlvjbu36wkVfVVddgSN6hA3Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752688972; a=rsa-sha256; cv=none; b=CGiGlyAIIgoesbND1zd7A5KhZNk0AzwZIPx9i9fg5rFNg3j5dKHAGexOmyxPAc8Dj8UEPM +u0MLrqvGhGjFrIgbM8Kqq5nIK18z5+tkxssksqCnJyeRpjZdCMYizx9aLTwJD3/WitXGJ IHaeg8P4GzYbVWxzFX+dBD2p8f08iw/yzgqt4NuNKRAGinzlydi68XS3ST8up2ClriG0W6 4iIvFIoyUMaY/yR6695ZiCplJ/jea6Ry6+u0z20Xz+GWH3ADCubuJDCCh6OWZyeE+Rw3W5 P2sEPz19zu56rp+2pC2/PtfGebr47VMet2Jxywuh9UO0MVbCIgVdV09j251HfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj3n84Kl0z592; Wed, 16 Jul 2025 18:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GI2qiB046994; Wed, 16 Jul 2025 18:02:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GI2qZ0046991; Wed, 16 Jul 2025 18:02:52 GMT (envelope-from git) Date: Wed, 16 Jul 2025 18:02:52 GMT Message-Id: <202507161802.56GI2qZ0046991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: cc61a0793a0e - main - manpages: prefer linking to xo_options.7 over xo_parse_args.3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc61a0793a0e7db8601e5eba1242befb810a5844 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=cc61a0793a0e7db8601e5eba1242befb810a5844 commit cc61a0793a0e7db8601e5eba1242befb810a5844 Author: Alan Somers AuthorDate: 2025-07-16 17:41:31 +0000 Commit: Alan Somers CommitDate: 2025-07-16 18:02:24 +0000 manpages: prefer linking to xo_options.7 over xo_parse_args.3 Most libxo-enabled utilities link to xo_parse_args.3. But that man page doesn't actually describe how to format command-line arguments. Rather, xo_options.7 does. I suspect that these utilities link to the former because the latter man page did not exist until libxo-0.7.2 (8a6eceff3ce). And newer utilities have probably been copy/pasting the same text from older ones. But the superior man page does exist now, so we should link to it instead. MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51354 --- bin/df/df.1 | 6 +++--- bin/ps/ps.1 | 6 +++--- sbin/mount/mount.8 | 6 +++--- sbin/savecore/savecore.8 | 6 +++--- usr.bin/du/du.1 | 6 +++--- usr.bin/iscsictl/iscsictl.8 | 6 +++--- usr.bin/last/last.1 | 6 +++--- usr.bin/netstat/netstat.1 | 6 +++--- usr.bin/nfsstat/nfsstat.1 | 4 ++-- usr.bin/procstat/procstat.1 | 6 +++--- usr.bin/vmstat/vmstat.8 | 6 +++--- usr.bin/w/w.1 | 6 +++--- usr.bin/wc/wc.1 | 6 +++--- usr.sbin/arp/arp.8 | 6 +++--- usr.sbin/efitable/efitable.8 | 4 ++-- usr.sbin/lastlogin/lastlogin.8 | 4 ++-- usr.sbin/sesutil/sesutil.8 | 6 +++--- 17 files changed, 48 insertions(+), 48 deletions(-) diff --git a/bin/df/df.1 b/bin/df/df.1 index ceb1bb45babf..2de72e4e3bb2 100644 --- a/bin/df/df.1 +++ b/bin/df/df.1 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 29, 2023 +.Dd July 16, 2025 .Dt DF 1 .Os .Sh NAME @@ -65,7 +65,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl a Show all mount points, including those that were mounted with the @@ -264,7 +264,7 @@ each file or directory name or disk label .Xr getmntinfo 3 , .Xr libxo 3 , .Xr localeconv 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr fstab 5 , .Xr mount 8 , .Xr pstat 8 , diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 1c964157f53f..542004453658 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 06, 2025 +.Dd July 16, 2025 .Dt PS 1 .Os .Sh NAME @@ -194,7 +194,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. The default is the traditional text style output. .It Fl A @@ -925,7 +925,7 @@ Display information on all system processes: .Xr kvm 3 , .Xr libxo 3 , .Xr strftime 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr mac 4 , .Xr procfs 4 , .Xr pstat 8 , diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8 index b584d71ea567..7bfc21ea41d5 100644 --- a/sbin/mount/mount.8 +++ b/sbin/mount/mount.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 30, 2025 +.Dd July 16, 2025 .Dt MOUNT 8 .Os .Sh NAME @@ -80,7 +80,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl a All the file systems described in @@ -573,7 +573,7 @@ support for a particular file system might be provided either on a static .Xr acl 3 , .Xr getmntinfo 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr cd9660 4 , .Xr devfs 4 , .Xr ext2fs 4 , diff --git a/sbin/savecore/savecore.8 b/sbin/savecore/savecore.8 index 53d2360719dd..1fb79c51f98d 100644 --- a/sbin/savecore/savecore.8 +++ b/sbin/savecore/savecore.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 4, 2022 +.Dd July 16, 2025 .Dt SAVECORE 8 .Os .Sh NAME @@ -69,7 +69,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl C Check to see if a dump exists, @@ -193,7 +193,7 @@ is meant to be called near the end of the initialization file .Xr zstd 1 , .Xr getbootfile 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr mem 4 , .Xr textdump 4 , .Xr tar 5 , diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1 index 37f7d7837b11..1b6d800b0285 100644 --- a/usr.bin/du/du.1 +++ b/usr.bin/du/du.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 29, 2024 +.Dd July 16, 2025 .Dt DU 1 .Os .Sh NAME @@ -58,7 +58,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl A Display the apparent size instead of the disk usage. @@ -225,7 +225,7 @@ Also display a grand total at the end: .Xr chflags 2 , .Xr fts 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr symlink 7 , .Xr quot 8 .Sh STANDARDS diff --git a/usr.bin/iscsictl/iscsictl.8 b/usr.bin/iscsictl/iscsictl.8 index 74394063a007..88c79c297848 100644 --- a/usr.bin/iscsictl/iscsictl.8 +++ b/usr.bin/iscsictl/iscsictl.8 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 27, 2018 +.Dd July 16, 2025 .Dt ISCSICTL 8 .Os .Sh NAME @@ -88,7 +88,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl A Add session. @@ -190,7 +190,7 @@ Disconnect all iSCSI sessions: .Dl Nm Fl Ra .Sh SEE ALSO .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr iscsi 4 , .Xr iscsi.conf 5 , .Xr iscsid 8 diff --git a/usr.bin/last/last.1 b/usr.bin/last/last.1 index f3ccc6e772af..b026ed6a7921 100644 --- a/usr.bin/last/last.1 +++ b/usr.bin/last/last.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 9, 2021 +.Dd July 16, 2025 .Dt LAST 1 .Os .Sh NAME @@ -75,7 +75,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl d Ar date Specify the snapshot date and time. @@ -223,7 +223,7 @@ alice ttyv0 Mon Dec 7 19:18 - 22:27 (03:09) .Xr lastcomm 1 , .Xr getutxent 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr ac 8 , .Xr lastlogin 8 .Sh HISTORY diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index cf6a907c6aa4..1931c38a1fad 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 30, 2025 +.Dd July 16, 2025 .Dt NETSTAT 1 .Os .Sh NAME @@ -166,7 +166,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl 4 Show IPv4 only. @@ -954,7 +954,7 @@ Show IPv4 listening sockets: .Xr ps 1 , .Xr sockstat 1 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr bpf 4 , .Xr inet 4 , .Xr route 4 , diff --git a/usr.bin/nfsstat/nfsstat.1 b/usr.bin/nfsstat/nfsstat.1 index 7d641b50f1ac..a4a00586f21b 100644 --- a/usr.bin/nfsstat/nfsstat.1 +++ b/usr.bin/nfsstat/nfsstat.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 28, 2023 +.Dd July 16, 2025 .Dt NFSSTAT 1 .Os .Sh NAME @@ -123,7 +123,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .El .Sh SEE ALSO diff --git a/usr.bin/procstat/procstat.1 b/usr.bin/procstat/procstat.1 index 1e05e235e619..b810abf66da7 100644 --- a/usr.bin/procstat/procstat.1 +++ b/usr.bin/procstat/procstat.1 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 7, 2022 +.Dd July 16, 2025 .Dt PROCSTAT 1 .Os .Sh NAME @@ -136,7 +136,7 @@ flag is specified the output is generated via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .Pp The following commands are available for @@ -870,7 +870,7 @@ procstat: procstat_getprocs() .Xr libprocstat 3 , .Xr libxo 3 , .Xr signal 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr ddb 4 , .Xr divert 4 , .Xr icmp 4 , diff --git a/usr.bin/vmstat/vmstat.8 b/usr.bin/vmstat/vmstat.8 index de4176c9361c..80facb05cc35 100644 --- a/usr.bin/vmstat/vmstat.8 +++ b/usr.bin/vmstat/vmstat.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 21, 2021 +.Dd July 16, 2025 .Dt VMSTAT 8 .Os .Sh NAME @@ -71,7 +71,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl a When used with @@ -371,7 +371,7 @@ statistics every second. .Xr systat 1 , .Xr libmemstat 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr gstat 8 , .Xr iostat 8 , .Xr pstat 8 , diff --git a/usr.bin/w/w.1 b/usr.bin/w/w.1 index a92edc6f0059..159eb3370c8c 100644 --- a/usr.bin/w/w.1 +++ b/usr.bin/w/w.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 24, 2020 +.Dd July 16, 2025 .Dt W 1 .Os .Sh NAME @@ -61,7 +61,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl d dumps out the entire process list on a per controlling @@ -145,7 +145,7 @@ flags are no longer supported. .Xr uptime 1 , .Xr who 1 , .Xr libxo 3 , -.Xr xo_parse_args 3 +.Xr xo_options 7 .Sh HISTORY The .Nm diff --git a/usr.bin/wc/wc.1 b/usr.bin/wc/wc.1 index 482145c8f01f..656408794950 100644 --- a/usr.bin/wc/wc.1 +++ b/usr.bin/wc/wc.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 11, 2020 +.Dd July 16, 2025 .Dt WC 1 .Os .Sh NAME @@ -70,7 +70,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl L Write the length of the line containing the most bytes (default) or characters @@ -196,7 +196,7 @@ utility. .Sh SEE ALSO .Xr iswspace 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 +.Xr xo_options 7 .Sh STANDARDS The .Nm diff --git a/usr.sbin/arp/arp.8 b/usr.sbin/arp/arp.8 index d31b2b482ba3..0a171c9e36be 100644 --- a/usr.sbin/arp/arp.8 +++ b/usr.sbin/arp/arp.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 13, 2020 +.Dd July 16, 2025 .Dt ARP 8 .Os .Sh NAME @@ -80,7 +80,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl a The program displays or, if it is used with the @@ -183,7 +183,7 @@ character will mark the rest of the line as a comment. .Sh SEE ALSO .Xr inet 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr arp 4 , .Xr ifconfig 8 , .Xr ndp 8 diff --git a/usr.sbin/efitable/efitable.8 b/usr.sbin/efitable/efitable.8 index d1f4cedcdea8..bb8a9cc3d0e1 100644 --- a/usr.sbin/efitable/efitable.8 +++ b/usr.sbin/efitable/efitable.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 10, 2021 +.Dd July 16, 2025 .Dt EFITABLE 8 .Os .Sh NAME @@ -45,7 +45,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl t Ar name Fl -table Ar name Specify the name of the table to print. diff --git a/usr.sbin/lastlogin/lastlogin.8 b/usr.sbin/lastlogin/lastlogin.8 index 3b2d47fdaf76..9fd5c88d02cd 100644 --- a/usr.sbin/lastlogin/lastlogin.8 +++ b/usr.sbin/lastlogin/lastlogin.8 @@ -73,7 +73,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl f Ar file Open last login database @@ -93,7 +93,7 @@ last login database .Xr last 1 , .Xr getutxent 3 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr ac 8 .Sh AUTHORS .An -nosplit diff --git a/usr.sbin/sesutil/sesutil.8 b/usr.sbin/sesutil/sesutil.8 index 664dcab593e9..d4960b3ec6bf 100644 --- a/usr.sbin/sesutil/sesutil.8 +++ b/usr.sbin/sesutil/sesutil.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 5, 2022 +.Dd July 16, 2025 .Dt SESUTIL 8 .Os .Sh NAME @@ -129,7 +129,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 .El .Sh EXAMPLES Turn off all locate LEDs: @@ -146,7 +146,7 @@ Turn on the fault LED for a drive bay not associated with a device: .Dl Nm Cm fault -u /dev/ses2 7 on .Sh SEE ALSO .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr ses 4 .Sh HISTORY The From nobody Wed Jul 16 18:16:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj45772Q8z61q0M; Wed, 16 Jul 2025 18:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj4573p6Tz3p0g; Wed, 16 Jul 2025 18:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752689803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X+Vj+qRHyoInOixxrqVVY650kppJY+7ws8A85FtrCpU=; b=NCVkwLFS3C1iasDkPTiyW/W/Sma6v5EJljV5zuy2dxno7KigtzL+QdT1twdKjr5fLZmTlH g8ZZ5V9MItGxel6Zwptp5YayQTOLoFWRPPeREjqLQjaexeam12d0SsdDMFhzMpooBEQuB/ jmNHrKfAvQwTQDqYi1toILzf8Ge2UJVStfCXg5U/9xm8WW85XeHfcy+cd1FrJV10ba567R mRORhMtaKNnYJRuIv2qAT8AJKjVkh9+O2NLCPaGYJIiOG5GeJ0c1wb5FW9OOmv5npZemVT FyXKrLld1OHu8fX6jpgFEkbEOPIZ930O7fO62/khgdEVSvZxuxxC+Ra7gVpVXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752689803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X+Vj+qRHyoInOixxrqVVY650kppJY+7ws8A85FtrCpU=; b=lspW2SBPDhkx27GzndR3uoUOnMIVqzV0Xotl1MiCqgTxkqpOYKOy1iJJPRqGvYYpe0iAwq niu8bCyZnmiuwoZUxqUHUHdDD5XL0YX/kdLmiB4d5SDGzSe/POd7QHibH57DOwIVKWdksZ 3wR5KPgRVF/CbYTqLIfJp126dKksGI96MCXX1bYIXuY1d37z9CIj1PaHMhdfD2Dt8i4TSh MGxu1yQ7ovrJtmJthvWLs6060oi1rYjN31PSY17o2oUdYmxRFVO8X6q1ozXe1acABGNE5g 9u9ZtZHgaXMFNMy92a8DHRI6NKBQIk8NijiapmstPNIG7zGYdHxrphnPwNzWoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752689803; a=rsa-sha256; cv=none; b=FIghVJvbdKVqwL6JxF71WNMeZOjcBDizz01TZzpUDWWqzPjmeUGu9L6br1G6G0xfCUTv+Y 8mrHijDWYFdYwuNQHQnIE9+ScTfbPoh6QMuzQimD4TJ8EG/imVmFAqK8c4ITAsWscoBKYv RvIjKxmHABX7a3GG2j4y/0TCPhLtjHzMHkS/cRBNeIrulUNTjJQOutjkQUOfY5MPfh15vP 1F/f9kxmywYyhs1Y/tvd9zFLBi47bs6fJiJQztCN90ZDw02udf08sjzSGceiiX5ThGhzy7 1n37PnG5FuYfNCwN8v3QVVd9FxEE+qmUGn066B81f7Nx0Y43K53RxVoJtxgSBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj4573PN5z59X; Wed, 16 Jul 2025 18:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GIGhqq066793; Wed, 16 Jul 2025 18:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GIGhFN066790; Wed, 16 Jul 2025 18:16:43 GMT (envelope-from git) Date: Wed, 16 Jul 2025 18:16:43 GMT Message-Id: <202507161816.56GIGhFN066790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 6dd0803ffd31 - main - libsa/zfs: prefer a vdev with newer txg to a stale one List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6dd0803ffd31c60a84488d06928813353c6303d3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6dd0803ffd31c60a84488d06928813353c6303d3 commit 6dd0803ffd31c60a84488d06928813353c6303d3 Author: Gleb Smirnoff AuthorDate: 2025-07-16 18:15:12 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-16 18:15:54 +0000 libsa/zfs: prefer a vdev with newer txg to a stale one Before this change, the first probed member of a pool would initialize vdev tree for the pool. Now, imagine a situation when a machine has a disk that has been removed from the pool, but the ZFS label was not erased. That's a typical scenario - disk goes offline, it is replaced with a spare, no data changes written to the gone disk. Then, disk appears back at boot time and it is the first one to be probed by the loader. It has the same pool GUID as all other members and naive loader would not see a conflict. Then the disk will be used as source of truth to read the bootenv. To fix that, provide vdev_free() that allows to rollback the already prebuilt vdev tree, so that a new one can be built from scratch. Upon encountering a newer configuration for already known top level part of a pool, call vdev_free() and let vdev_probe() to build a new one. The change has been tested with loader_lua and userboot.so, but it should have same effect on the legacy boot1 loader. Reviewed by: tsoome, mav, imp Differential Revision: https://reviews.freebsd.org/D51219 --- stand/libsa/zfs/zfsimpl.c | 52 +++++++++++++++++++++++++++++++++++++-------- sys/cddl/boot/zfs/zfsimpl.h | 2 +- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index c7dc72561eff..971d71d098d3 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -1106,7 +1106,8 @@ vdev_insert(vdev_t *top_vdev, vdev_t *vdev) } static int -vdev_from_nvlist(spa_t *spa, uint64_t top_guid, const nvlist_t *nvlist) +vdev_from_nvlist(spa_t *spa, uint64_t top_guid, uint64_t txg, + const nvlist_t *nvlist) { vdev_t *top_vdev, *vdev; nvlist_t **kids = NULL; @@ -1120,6 +1121,7 @@ vdev_from_nvlist(spa_t *spa, uint64_t top_guid, const nvlist_t *nvlist) return (rc); top_vdev->v_spa = spa; top_vdev->v_top = top_vdev; + top_vdev->v_txg = txg; vdev_insert(spa->spa_root_vdev, top_vdev); } @@ -1163,7 +1165,7 @@ done: static int vdev_init_from_label(spa_t *spa, const nvlist_t *nvlist) { - uint64_t pool_guid, top_guid; + uint64_t pool_guid, top_guid, txg; nvlist_t *vdevs; int rc; @@ -1171,13 +1173,15 @@ vdev_init_from_label(spa_t *spa, const nvlist_t *nvlist) NULL, &pool_guid, NULL) || nvlist_find(nvlist, ZPOOL_CONFIG_TOP_GUID, DATA_TYPE_UINT64, NULL, &top_guid, NULL) || + nvlist_find(nvlist, ZPOOL_CONFIG_POOL_TXG, DATA_TYPE_UINT64, + NULL, &txg, NULL) != 0 || nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, NULL, &vdevs, NULL)) { printf("ZFS: can't find vdev details\n"); return (ENOENT); } - rc = vdev_from_nvlist(spa, top_guid, vdevs); + rc = vdev_from_nvlist(spa, top_guid, txg, vdevs); nvlist_destroy(vdevs); return (rc); } @@ -1267,6 +1271,21 @@ vdev_update_from_nvlist(uint64_t top_guid, const nvlist_t *nvlist) return (rc); } +/* + * Shall not be called on root vdev, that is not linked into zfs_vdevs. + * See comment in vdev_create(). + */ +static void +vdev_free(struct vdev *vdev) +{ + struct vdev *kid, *safe; + + STAILQ_FOREACH_SAFE(kid, &vdev->v_children, v_childlink, safe) + vdev_free(kid); + STAILQ_REMOVE(&zfs_vdevs, vdev, vdev, v_alllink); + free(vdev); +} + static int vdev_init_from_nvlist(spa_t *spa, const nvlist_t *nvlist) { @@ -1313,9 +1332,10 @@ vdev_init_from_nvlist(spa_t *spa, const nvlist_t *nvlist) vdev = vdev_find(guid); /* * Top level vdev is missing, create it. + * XXXGL: how can this happen? */ if (vdev == NULL) - rc = vdev_from_nvlist(spa, guid, kids[i]); + rc = vdev_from_nvlist(spa, guid, 0, kids[i]); else rc = vdev_update_from_nvlist(guid, kids[i]); if (rc != 0) @@ -2006,8 +2026,7 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, vdev_t *vdev; nvlist_t *nvl; uint64_t val; - uint64_t guid; - uint64_t pool_txg, pool_guid; + uint64_t guid, pool_guid, top_guid, txg; const char *pool_name; int rc, namelen; @@ -2063,7 +2082,9 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, } if (nvlist_find(nvl, ZPOOL_CONFIG_POOL_TXG, DATA_TYPE_UINT64, - NULL, &pool_txg, NULL) != 0 || + NULL, &txg, NULL) != 0 || + nvlist_find(nvl, ZPOOL_CONFIG_TOP_GUID, DATA_TYPE_UINT64, + NULL, &top_guid, NULL) != 0 || nvlist_find(nvl, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, NULL, &pool_guid, NULL) != 0 || nvlist_find(nvl, ZPOOL_CONFIG_POOL_NAME, DATA_TYPE_STRING, @@ -2098,9 +2119,22 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, nvlist_destroy(nvl); return (ENOMEM); } + } else { + struct vdev *kid; + + STAILQ_FOREACH(kid, &spa->spa_root_vdev->v_children, + v_childlink) + if (kid->v_guid == top_guid && kid->v_txg < txg) { + printf("ZFS: pool %s vdev %s ignoring stale " + "label from txg 0x%jx, using 0x%jx@0x%jx\n", + spa->spa_name, kid->v_name, + kid->v_txg, guid, txg); + STAILQ_REMOVE(&spa->spa_root_vdev->v_children, + kid, vdev, v_childlink); + vdev_free(kid); + break; + } } - if (pool_txg > spa->spa_txg) - spa->spa_txg = pool_txg; /* * Get the vdev tree and create our in-core copy of it. diff --git a/sys/cddl/boot/zfs/zfsimpl.h b/sys/cddl/boot/zfs/zfsimpl.h index 0ce38384abbf..83d964360343 100644 --- a/sys/cddl/boot/zfs/zfsimpl.h +++ b/sys/cddl/boot/zfs/zfsimpl.h @@ -2019,6 +2019,7 @@ typedef struct vdev { vdev_list_t v_children; /* children of this vdev */ const char *v_name; /* vdev name */ uint64_t v_guid; /* vdev guid */ + uint64_t v_txg; /* most recent transaction */ uint64_t v_id; /* index in parent */ uint64_t v_psize; /* physical device capacity */ int v_ashift; /* offset to block shift */ @@ -2048,7 +2049,6 @@ typedef struct spa { STAILQ_ENTRY(spa) spa_link; /* link in global pool list */ char *spa_name; /* pool name */ uint64_t spa_guid; /* pool guid */ - uint64_t spa_txg; /* most recent transaction */ struct uberblock *spa_uberblock; /* best uberblock so far */ vdev_t *spa_root_vdev; /* toplevel vdev container */ objset_phys_t *spa_mos; /* MOS for this pool */ From nobody Wed Jul 16 18:36:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj4Wv6Gmjz61qnT; Wed, 16 Jul 2025 18:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj4Wv5F7Nz40Zq; Wed, 16 Jul 2025 18:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752690987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vhEMBe3w+yT8/tcpOAbuXf5CHLueU9ea9+ka4Xy6UKs=; b=Yqp8OMqk0Bv9Lf71lg9kaKGj7e5/4pWeFi7L4/5aGr5DuW2gCQJZifjm6lRXbcxowwPmce lDVaixwWPhb15NrZbRxPR4KwfkcFzqPcKajcCCN3OEQ6QKZpqOdhx2qnMPTPelFzmxt+5V ByGMNYyOJunrgs7nnB35miPf6EbkINNmMraLfI8al7wRQqygMvT+Mju1lIpby7ZGbsxAOZ OZ3agYnBhWVFmZRVOdjZK4n1UgaGkiYzxD5Sg2QuVKSwN4u1LcdHH6fmvij/y0V2sTSAYo dY86FhJz3BHVOZDHGvUAfIlBQERI1P42wSqz/YRX4qxFeGusYKwpXvLy/Oikeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752690987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vhEMBe3w+yT8/tcpOAbuXf5CHLueU9ea9+ka4Xy6UKs=; b=qEWXminw7BBzXPv+0IFmn8zg61BLX+WUzXO1ewHNujlCfior++AAr4qJuFBGyzFjlEzjRG dWnk3a3zhz02+57z6tj0gwcxHqK3Bi+I5Q9S0NB4k0PsG4oKwEAoTlJWGJWGqfDMXkSt3L UdhWCCV9hdLZwiDgH758v66MJBFFk8JwTpLOAbRlQdUyT8tLje4BKLqtUMbbTypRtcVmA0 7QjZT+9w1SAV7/dt6do1SccIDPyqKkscQpyF+Vq9i3YERi6qL8eqxIM3Po4Ea3AIf8WgRj RTuFnf5AM75Epsrxey19DssWqsdoUOLmfLC4+aTBqiMWHAmsDPlLcqXQw+qcnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752690987; a=rsa-sha256; cv=none; b=KrcHcw5vGFsvxr6euJQIg8N84QjLLGTqDsPJThohca14rz7zo3h65eylpzVvKmMl2JXwuc kMZhyggUaE3nch0LC0wqFWfK3573L/ZmQrD1GiHDL7a3NrAFjDynosfJG4CCcmzxN6Hn+y ngJ2vngi4R0FKz81yGIwXU4RAoimddAP8yat67UTGOPRA0pBatcXUbZmoAxXF/M50SiN2H QwjG+3dN3ELwegj2ytJKk5Xv5fEXIFxIyuaQ3nvHCA2Oxy/UMNWDrmcKduV34v1IZ0RX/D MagmnzVpIkI58CTr7VvpiX8sg4UrjAK24xCqJCsKV69wq3F3XQ/iXkjHF9eBMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj4Wv4Z4pz5vK; Wed, 16 Jul 2025 18:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GIaRu0005011; Wed, 16 Jul 2025 18:36:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GIaR8i005008; Wed, 16 Jul 2025 18:36:27 GMT (envelope-from git) Date: Wed, 16 Jul 2025 18:36:27 GMT Message-Id: <202507161836.56GIaR8i005008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Koshy Subject: git: 5d418202f888 - main - libelf: Fix the NAME sections of two manual pages. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkoshy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d418202f888e5d5062f1e4d26457ea67fc81739 Auto-Submitted: auto-generated The branch main has been updated by jkoshy: URL: https://cgit.FreeBSD.org/src/commit/?id=5d418202f888e5d5062f1e4d26457ea67fc81739 commit 5d418202f888e5d5062f1e4d26457ea67fc81739 Author: Joseph Koshy AuthorDate: 2025-07-16 18:34:26 +0000 Commit: Joseph Koshy CommitDate: 2025-07-16 18:34:26 +0000 libelf: Fix the NAME sections of two manual pages. This change allows mandoc(1) to find these manual pages for all the relevant function names. Submitted by: Ingo Schwarze Obtained from: elftoolchain/r4192 --- contrib/elftoolchain/libelf/elf_open.3 | 5 +++-- contrib/elftoolchain/libelf/gelf_xlatetof.3 | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/contrib/elftoolchain/libelf/elf_open.3 b/contrib/elftoolchain/libelf/elf_open.3 index 054036a24935..896bf8455ae5 100644 --- a/contrib/elftoolchain/libelf/elf_open.3 +++ b/contrib/elftoolchain/libelf/elf_open.3 @@ -23,11 +23,12 @@ .\" .\" $Id: elf_open.3 3743 2019-06-12 19:36:30Z jkoshy $ .\" -.Dd June 12, 2019 +.Dd July 15, 2025 .Dt ELF_OPEN 3 .Os .Sh NAME -.Nm elf_open +.Nm elf_open , +.Nm elf_openmemory .Nd open ELF objects and ar(1) archives .Sh LIBRARY .Lb libelf diff --git a/contrib/elftoolchain/libelf/gelf_xlatetof.3 b/contrib/elftoolchain/libelf/gelf_xlatetof.3 index 2e5ee0fe15e0..4a7b25c99b5a 100644 --- a/contrib/elftoolchain/libelf/gelf_xlatetof.3 +++ b/contrib/elftoolchain/libelf/gelf_xlatetof.3 @@ -23,13 +23,16 @@ .\" .\" $Id: gelf_xlatetof.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" -.Dd October 11, 2018 +.Dd July 15, 2025 .Dt GELF_XLATETOF 3 .Os .Sh NAME -.Nm elf32_xlate , -.Nm elf64_xlate , -.Nm gelf_xlate +.Nm elf32_xlatetof , +.Nm elf32_xlatetom , +.Nm elf64_xlatetof , +.Nm elf64_xlatetom , +.Nm gelf_xlatetof , +.Nm gelf_xlatetom .Nd translate data between files and memory .Sh LIBRARY .Lb libelf From nobody Wed Jul 16 19:33:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj5p44BDxz61tN8; Wed, 16 Jul 2025 19:33:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj5p42nY1z3cH7; Wed, 16 Jul 2025 19:33:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752694428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ORDB9rjhKEl6ZMRhKPeTwdjhndGcdJwmYEOZj3pud5U=; b=R+yJiEHBdzMPsiBuhYJsqKCZVxK9AoFkBWAjkiSuZPVXDitf6wUnLJN4JuEGWvK6SDGpq2 0DETT7HjGK7c7qLbRU2gaMow3dZzj5YOB8MpqPT0lJH1JBG2FLpWLRH/67pgmFgsLRgdCd pTtsZf/aWsSLwPuhZGxke2AopSmtmqPF+16ix8HEN8w9+U9DVMDr8xi6hFNigxUNjALn7+ k6LFGxDzk4ZBBiWvyZltcg1g4hADp2xWQQG8Jom3KURN4R6N0/pE0xc6+0KMOxW5oEfXFR 8rnjohhXkZJ39iWYsV8GlOaSZR/dazkDX5K8TYW4FgYKtgIb8SZEicw3LzA8iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752694428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ORDB9rjhKEl6ZMRhKPeTwdjhndGcdJwmYEOZj3pud5U=; b=R6Iuc1Imx3EaaZhRtSAGCXpvWPY5bYuuS/zZWrYU4IY6jCPQK18zD7R28m8UUp1cs8PI58 1reydl6U4z+2nPQYyEPbWJ1UGwf8o31NTAV85z9QdhvqlgWddlXdXKUh2Clu4SJ90jY8dr L+e9ek58vn/482j9igtTupwd3kCNInZcJjNnya3VAvu84/7EqJCviCAivf8nGzEd21rbp4 PJFEymbXCE3jb7a2zBKapkHWGW42UAOo1o9KzhYTmvWHnf4DVKf6urgzWLgzrlEmbdLJ+R qyKiw4SQqab8Qg5X1wqGXnD1eIsOEkTosJ7LaJbX67WcH3kT/0YaEpJ7a5ncqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752694428; a=rsa-sha256; cv=none; b=wnS6+4Qd1G7QU3VgBU0WlTpUVY46ifiQugkI2N19idsCmjll44nmk4gTs/sgpscJKKcNHr SlmGoTyomJhLfD6MIcWKkh/HBiXl44aABEW4YPlxaMZfR1ZrVmSgKsSUEivMqvsMMGhQE6 5Qnbpvf4/Pz9ZCzcOTD63dpIEgv9RYmid4Q95UZcLE7DKvTJo5Q9lATNzckLOXNJjo+BuL PNy8ux214AYDElFPNu74W1f9vu+gSdGe/wd9HPnwNH39adcji6TRYlgMNDACwFOrkZ78RX 96f7CG6XO7F8Lb6iOcsKJfGfMUKNjiyGaeq46dSGYVxR0WBdNXxKGdXA/Mib8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj5p41ysNz7Wj; Wed, 16 Jul 2025 19:33:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GJXmgH016365; Wed, 16 Jul 2025 19:33:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GJXmuH016362; Wed, 16 Jul 2025 19:33:48 GMT (envelope-from git) Date: Wed, 16 Jul 2025 19:33:48 GMT Message-Id: <202507161933.56GJXmuH016362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 55f80afa17e8 - main - udf: Improve input validation. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55f80afa17e8926f69660f19631194bcf7fa66f4 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=55f80afa17e8926f69660f19631194bcf7fa66f4 commit 55f80afa17e8926f69660f19631194bcf7fa66f4 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-16 19:33:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-16 19:33:41 +0000 udf: Improve input validation. The existing code frequently assigns unsigned 64-bit values to variables that are signed and / or shorter without checking for overflow. Try to deal with these cases. While here, fix two structs that used single-element arrays in place of flexible array members. PR: 287896 MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51339 --- sys/fs/udf/ecma167-udf.h | 4 ++-- sys/fs/udf/udf_vfsops.c | 7 ++++++- sys/fs/udf/udf_vnops.c | 48 ++++++++++++++++++++++++++++++++++++------------ 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/sys/fs/udf/ecma167-udf.h b/sys/fs/udf/ecma167-udf.h index 839bbec08254..19e114763cac 100644 --- a/sys/fs/udf/ecma167-udf.h +++ b/sys/fs/udf/ecma167-udf.h @@ -243,7 +243,7 @@ struct part_map_spare { uint8_t n_st; /* Number of Sparing Tables */ uint8_t reserved1; uint32_t st_size; - uint32_t st_loc[1]; + uint32_t st_loc[]; } __packed; union udf_pmap { @@ -266,7 +266,7 @@ struct udf_sparing_table { uint16_t rt_l; /* Relocation Table len */ uint8_t reserved[2]; uint32_t seq_num; - struct spare_map_entry entries[1]; + struct spare_map_entry entries[]; } __packed; /* Partition Descriptor [3/10.5] */ diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index c7438147c0a0..c5ef1f686093 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -81,6 +81,7 @@ #include #include #include +#include #include #include #include @@ -729,7 +730,7 @@ udf_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp) struct ifid *ifhp; struct vnode *nvp; struct udf_node *np; - off_t fsize; + uint64_t fsize; int error; ifhp = (struct ifid *)fhp; @@ -741,6 +742,10 @@ udf_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp) np = VTON(nvp); fsize = le64toh(np->fentry->inf_len); + if (fsize > OFF_MAX) { + *vpp = NULLVP; + return (EIO); + } *vpp = nvp; vnode_create_vobject(*vpp, fsize, curthread); diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 88bf4917a851..37889241e8c3 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -182,11 +183,14 @@ udf_access(struct vop_access_args *a) } static int -udf_open(struct vop_open_args *ap) { +udf_open(struct vop_open_args *ap) +{ struct udf_node *np = VTON(ap->a_vp); - off_t fsize; + uint64_t fsize; fsize = le64toh(np->fentry->inf_len); + if (fsize > OFF_MAX) + return (EIO); vnode_create_vobject(ap->a_vp, fsize, ap->a_td); return 0; } @@ -314,12 +318,13 @@ udf_getattr(struct vop_getattr_args *a) * that directories consume at least one logical block, * make it appear so. */ - if (fentry->logblks_rec != 0) { - vap->va_size = - le64toh(fentry->logblks_rec) * node->udfmp->bsize; - } else { + vap->va_size = le64toh(fentry->logblks_rec); + if (vap->va_size == 0) vap->va_size = node->udfmp->bsize; - } + else if (vap->va_size > UINT64_MAX / node->udfmp->bsize) + vap->va_size = UINT64_MAX; + else + vap->va_size *= node->udfmp->bsize; } else { vap->va_size = le64toh(fentry->inf_len); } @@ -446,6 +451,7 @@ udf_read(struct vop_read_args *ap) struct buf *bp; uint8_t *data; daddr_t lbn, rablock; + uint64_t len; off_t diff, fsize; ssize_t n; int error = 0; @@ -471,7 +477,12 @@ udf_read(struct vop_read_args *ap) return (error); } - fsize = le64toh(node->fentry->inf_len); + len = le64toh(node->fentry->inf_len); + if (len > OFF_MAX) { + /* too big, just cap to the requested length */ + len = uio->uio_resid; + } + fsize = len; udfmp = node->udfmp; do { lbn = lblkno(udfmp, uio->uio_offset); @@ -783,6 +794,7 @@ udf_readdir(struct vop_readdir_args *a) struct udf_uiodir uiodir; struct udf_dirstream *ds; uint64_t *cookies = NULL; + uint64_t len; int ncookies; int error = 0; @@ -811,8 +823,12 @@ udf_readdir(struct vop_readdir_args *a) * Iterate through the file id descriptors. Give the parent dir * entry special attention. */ - ds = udf_opendir(node, uio->uio_offset, le64toh(node->fentry->inf_len), - node->udfmp); + len = le64toh(node->fentry->inf_len); + if (len > INT_MAX) { + /* too big, just cap to INT_MAX */ + len = INT_MAX; + } + ds = udf_opendir(node, uio->uio_offset, len, node->udfmp); while ((fid = udf_getfid(ds)) != NULL) { /* XXX Should we return an error on a bad fid? */ @@ -904,7 +920,8 @@ udf_readlink(struct vop_readlink_args *ap) struct udf_node *node; void *buf; char *cp; - int error, len, root; + uint64_t len; + int error, root; /* * A symbolic link in UDF is a list of variable-length path @@ -914,6 +931,8 @@ udf_readlink(struct vop_readlink_args *ap) vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + if (len > MAXPATHLEN) + return (EIO); buf = malloc(len, M_DEVBUF, M_WAITOK); iov[0].iov_len = len; iov[0].iov_base = buf; @@ -1116,13 +1135,14 @@ udf_lookup(struct vop_cachedlookup_args *a) struct udf_mnt *udfmp; struct fileid_desc *fid = NULL; struct udf_dirstream *ds; + uint64_t fsize; u_long nameiop; u_long flags; char *nameptr; long namelen; ino_t id = 0; int offset, error = 0; - int fsize, lkflags, ltype, numdirpasses; + int lkflags, ltype, numdirpasses; dvp = a->a_dvp; node = VTON(dvp); @@ -1133,6 +1153,10 @@ udf_lookup(struct vop_cachedlookup_args *a) nameptr = a->a_cnp->cn_nameptr; namelen = a->a_cnp->cn_namelen; fsize = le64toh(node->fentry->inf_len); + if (fsize > INT_MAX) { + /* too big, just cap to INT_MAX */ + fsize = INT_MAX; + } /* * If this is a LOOKUP and we've already partially searched through From nobody Wed Jul 16 20:17:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj6mP0Swmz61xHY; Wed, 16 Jul 2025 20:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj6mN6m13z3Cs7; Wed, 16 Jul 2025 20:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752697044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JUaN0GEfvbPJoYSvmTxi6IWkQBbjEq57xmSB0YMaQLE=; b=AAN7AY/Y5BhOamzv31LcdbNszFL3sde0ISdtjItBLLk4stDitoxMcJwwAtFEjO48mg/+JF 0+Hi9Poi5wbOiRNfqRvfldcmJCqwcmXzAJ6x+4V/mVp+0duqxr8oPLDvcDR2EW930Q6jKs Td8zll+qQNzgW8bvOrDwZvUcbotkW9nNlr5naNTNNIh1Z+QSqkqqjp3BdmY1PyE0U0oEc9 eBKOrrU4IBLIxXv0dsFYur+Q2zEe+TLM5Sx7iibmz/9O4dwicWIoZLTVeiLoFuNsfr/KqH 82iz/10JYK6RjHAHsiQMUQfuJHZJ4yC5PWFwbnLAZdBXpPy6SMSrRFHYcBDlPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752697044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JUaN0GEfvbPJoYSvmTxi6IWkQBbjEq57xmSB0YMaQLE=; b=ke0fNfBuoeOlCdUVu3I/KWxcFn3KVQvLakVRtWdMLK1+LwAz0H3A4pyq17zJ+blIt0kboH rJ/jFZFg5ry0Ebyfi3RYOZcd4lhx22moCeBVG3EbppSg6B5Oi4JPErWqx/f2ynGfVexN1s 1e+En1qDUGE0siPhvTwTlrFqYZVRH2hTCNqSms6opMb703rMuo6QKilqiRZlFl8vFDIGs6 /+fUct8sQBG8luzqZz9sHdc/77HjYUUcaj92eaQy0V+ILLTwpMwjsGhZRDskGPbQHsRm79 qCElKR61hb138UJRpwSDU5t7NsMD+NSE2iPugCVYVI+ZSJfZ6/TS+VKERLlaLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752697044; a=rsa-sha256; cv=none; b=aGQwDCzHiHQACieEWw2PzKwnV+KS76J3OYEuzRoa7RjlzXqZv7ATUTZqb1tx6NbrYNwod4 jpcILdYS9sCtgVnp5XUXjiZWBcgE7xmQVpVSH/E2Q2ThOvow0bhoTPsfrQPy1cdsFcXpeR cxaF70+PxWgtOkaPGKkhlWtUHhsydonomH4D3PiXkgNlPsQ0AbHXSaZqLuD1Cq9T+H0u/Z rfFBEkwZf26NXTGkznF01k1AxnIBGcBGRlKDJaG8Putw4fd9nDoPOAIUTWT645TwpSUMLa P+DOc9qZ+4Qwpe2HEscQ0drXWKO0qdWDJMvcM2VUID6PrLkicWkaLs1CeVfrKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj6mN6BsLz8kj; Wed, 16 Jul 2025 20:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GKHOVw094267; Wed, 16 Jul 2025 20:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GKHO6T094263; Wed, 16 Jul 2025 20:17:24 GMT (envelope-from git) Date: Wed, 16 Jul 2025 20:17:24 GMT Message-Id: <202507162017.56GKHO6T094263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 57f725a6a6c1 - main - tests/ci: fix missing /usr/local/{sbin,bin} in freebsdci rc PATH List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57f725a6a6c19b12015854589764babe58252155 Auto-Submitted: auto-generated The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/src/commit/?id=57f725a6a6c19b12015854589764babe58252155 commit 57f725a6a6c19b12015854589764babe58252155 Author: Siva Mahadevan AuthorDate: 2025-07-16 20:15:33 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2025-07-16 20:17:09 +0000 tests/ci: fix missing /usr/local/{sbin,bin} in freebsdci rc PATH Currently, a lot of tests report 'skipped' due to missing binaries in the PATH. The real issue is that /etc/rc forcibly restricts the PATH to the base system only. This patch re-enables a large chunk of skipped tests by adding the missing LOCALBASE directories to the PATH so that Kyua can discover third-party packages. It also fixes some minor rc scripting style as per the official freebsd scripting guide[0]. [0] https://docs.freebsd.org/en/articles/rc-scripting Signed-off-by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Approved by: lwhsu Differential Revision: https://reviews.freebsd.org/D51303 --- tests/ci/tools/freebsdci | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/ci/tools/freebsdci b/tests/ci/tools/freebsdci index 7b4ce9669ab2..51bd19e2967d 100755 --- a/tests/ci/tools/freebsdci +++ b/tests/ci/tools/freebsdci @@ -25,9 +25,6 @@ . /etc/rc.subr -: ${freebsdci_enable:="NO"} -: ${freebsdci_type:="full"} - name="freebsdci" desc="Run FreeBSD CI" rcvar=freebsdci_enable @@ -39,6 +36,11 @@ tardev=/dev/vtbd1 metadir=/meta istar=$(file -s ${tardev} | grep "POSIX tar archive" | wc -l) +load_rc_config $name +: ${freebsdci_enable:="NO"} +: ${freebsdci_type:="full"} +PATH="${PATH}:/usr/local/sbin:/usr/local/bin" + auto_shutdown() { # NOTE: Currently RISC-V kernels lack the ability to @@ -105,5 +107,4 @@ firstboot_ci_run() auto_shutdown } -load_rc_config $name run_rc_command "$1" From nobody Wed Jul 16 21:30:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bj8Ns35L7z6222Z; Wed, 16 Jul 2025 21:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bj8Nr6RKHz4F0w; Wed, 16 Jul 2025 21:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752701436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6GRwFqRyseiy0BoZaMJ6enfHGZfELnANteDFf+QU6A4=; b=xbGUioVRypSAuMUqCoFwuqkhUYoL/gbcgRfYq7w4PiEm6UR9ruQOBpizORKDkfugUIhYnt OalxE4G09q71/kvObCKu3ZZZgF3SA2kcrBCWV5denFzRYwYWqzIx0nKw7aWnRSTTY8y9OE ZOU+BWl+NZY/oHHcYkVqmo/8jCRf8minOhmf/0uhUoZSlpP1nX5rzfb6zqu02pi15AfADq Mw0SKv6JsUz0WwU99yYFehbz49ormPCRCAFzK8CjLcuQxl8Rs68eLdSR1L9Bz2hbQIfvqJ IFXipL8yR27wsO/ixLxA8cx8aBREgSd4rObyCt2oaouJuZeYvd7ydwZaRafjug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752701436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6GRwFqRyseiy0BoZaMJ6enfHGZfELnANteDFf+QU6A4=; b=E1HCbNWIg79++7ISFepbeuS953sTB0qmsiwfL6DXNCZmvsDMl/mJQ2XCQSySTGLksXPu66 r5eKlmqA71ZYkxrFGW4/5smCFO4jG2z7zyRnVsNq+SnOH7xhgIA99FsPxnLvwAFudBxYs7 DXRbfr+2vdO+GsaharCfGuwAWPQBVaO9O6OIf6qfv1ksteGYpF4HIcwtOSwFYO9zIWMBJO 6vKogDTd3EGApKOAYaHLKy5RjsTvDAySE59hlqLaYdTReKr2qk0SaCkyh/051sxAIdtbGT fTgbj2j0a5bBSi7DAjQ384hE8aqhZWnXF4rxqASnXiStoTDSxTXCQZuzdDiBzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752701436; a=rsa-sha256; cv=none; b=DqPmwE+skFXLD0oNdlekzV+fnq9oz1Fv51nDngDkBaMs4CB5uVBS5Ywh0VQVjpgsxvkwlz OunlnEE4RU39tvRS5khmWVfOxAd2RQhRoaZR+Pxrm8dUoA6luwB2FGMWzyC7Bo0xPT9PMl eUXOcPV99M/XOOF9RLYpiIopy+kFam2qSHbTEWrhD7T+BUBOvT4DHCkJaZ3/5I7wKLxS66 aH2jdqdN++RuN0fBUep9dx58AIx/moGRNkkJ9NlpzVY40vUMqDp/Agq9K4ZyeyOhOisVKY 4b+jtrTY3LtCWNEzDeWHQd8vjJmVsGJQkOLVa0I5uhkcmzNnJsjELEAbQsU52w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bj8Nr610fzBV7; Wed, 16 Jul 2025 21:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GLUaJ5034733; Wed, 16 Jul 2025 21:30:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GLUaI5034730; Wed, 16 Jul 2025 21:30:36 GMT (envelope-from git) Date: Wed, 16 Jul 2025 21:30:36 GMT Message-Id: <202507162130.56GLUaI5034730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 5f9a73c22fea - main - mgb: Fix mac tx disable bug in teardown List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f9a73c22fea8973e047477853529feaedea6fe6 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5f9a73c22fea8973e047477853529feaedea6fe6 commit 5f9a73c22fea8973e047477853529feaedea6fe6 Author: jefby AuthorDate: 2025-07-05 02:52:08 +0000 Commit: Ed Maste CommitDate: 2025-07-16 21:30:06 +0000 mgb: Fix mac tx disable bug in teardown Signed-off-by: jefby Reviewed-by: emaste Pull-request: https://github.com/freebsd/freebsd-src/pull/1755 --- sys/dev/mgb/if_mgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index 1240d0f84415..409f34167df0 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -1435,7 +1435,7 @@ mgb_hw_teardown(struct mgb_softc *sc) /* Stop MAC */ CSR_CLEAR_REG(sc, MGB_MAC_RX, MGB_MAC_ENBL); - CSR_WRITE_REG(sc, MGB_MAC_TX, MGB_MAC_ENBL); + CSR_CLEAR_REG(sc, MGB_MAC_TX, MGB_MAC_ENBL); if ((err = mgb_wait_for_bits(sc, MGB_MAC_RX, MGB_MAC_DSBL, 0))) return (err); if ((err = mgb_wait_for_bits(sc, MGB_MAC_TX, MGB_MAC_DSBL, 0))) From nobody Wed Jul 16 23:21:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjBrr6Kb2z627Pp; Wed, 16 Jul 2025 23:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjBrr381yz3Sc2; Wed, 16 Jul 2025 23:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752708092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4khCaLkEh41G5IXhdXWzo7Mkjsg7uuvhPCSSrh7l2yk=; b=Y1sGSkHHICzcKKfGNFISC/61ddPKVwDTeZC819xomMFvY0M7YDDJ2E2vzEPhpxPHva5oAZ QRSM9AXuGEU2+KWSMx7sRz9O7tP+ap8kX5mUShwY1e9pVuofd4Bqmc/ESb2dJ1PTanfSOk Cp2qn06etSDxVbGLKujXIdrzt3+5il2NXdmoKQ2apDZs/yYV9cQbpj3J5l6/3IlZtrD4+T JYU1uu9G8jm5sWHjo/QZuEjqJlmYxDaTblmY5Ht7mFJV0MQFmdeIJIbEFGwDKX8U2qUiho 0tgfz+cYYw2ZHVQerbE3XnX9+P81knqAongsqvOn5i7gWpG3o3AwTvabc1wa/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752708092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4khCaLkEh41G5IXhdXWzo7Mkjsg7uuvhPCSSrh7l2yk=; b=Pua7qOZdXRGVFrWl1i65LOojVtXnLKWzF3Cf+Fpq1G7BprfS+ex6knPhTfrLwWZHoQBibi xr+Uq1FmfSOuQ+yUxvZvia84E+nlh1asR52Qd5rHr8M9r5XEt3pA7jfXKZrnc//vQaqoNv SEoriLTDZ3Vihpyw0VJmeGSrIiN2SSSY9yi+9CX6wdn7tjENDACpQFMRy0E+n9eQzr4Wga nzXwbz/0OunH/H0yc2vwUcvw0ZHWyMKWbPzTOn/S1O+YBjdgddDj1eHrIfDfPZlJQPgpVe 7U2PoBRfw8/yRpwWRH/VVRAHOeShBaM28MH7q7G56CYTIFaTnn00V887jQG0+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752708092; a=rsa-sha256; cv=none; b=sWEoRh9SO85Bhabznpom3h6I8HD7kWkyRSFYQh+AR/M2DwfEeNdzox7kPes1eujWYDUlUu 73r9UEerE8uXFiBJqQkwZ3ZQnSz9DXLcH7G8jxxi/s8WU4BJPYMqg/fAcQuqLMJhIKmEg0 DGmzQsh+VSB02jLhUw6M7iAaGo5WKQK7cEd2Ia9GV4YAyEsJtcJXP7LYu67iRh1FV4KIIn Yx3KBzoCsTpmwuLowxQS+ZbhoA2AdNk3IX1GuIC3cqiIgKHW8uwH5WOFFBUhNysgqd1Fza Rgvrmlyy/iX2YBjkwVMhPdxL6MmPj5HNYRnimKg7sJLoB5R6DH9fFxs87dKs0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjBrr2TJBzV1Z; Wed, 16 Jul 2025 23:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GNLWjr044147; Wed, 16 Jul 2025 23:21:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GNLWGc044144; Wed, 16 Jul 2025 23:21:32 GMT (envelope-from git) Date: Wed, 16 Jul 2025 23:21:32 GMT Message-Id: <202507162321.56GNLWGc044144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0d5fdcb63c9d - main - ufshci: enable the ufshci module to load at boot time List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d5fdcb63c9df9a28dda04861c30c84d495257b4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0d5fdcb63c9df9a28dda04861c30c84d495257b4 commit 0d5fdcb63c9df9a28dda04861c30c84d495257b4 Author: Jaeyoon Choi AuthorDate: 2025-07-16 23:14:28 +0000 Commit: Warner Losh CommitDate: 2025-07-16 23:20:59 +0000 ufshci: enable the ufshci module to load at boot time The ufshci driver tried to allocate a single 256KB segment for the UTP command descriptor during boot, but failed due to memory fragmentation. I fixed it to allocate the buffer in 8KB segments instead. Sponsored by: Samsung Electronics Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50933 --- sys/conf/files | 13 ++++++++++++ sys/dev/ufshci/ufshci_private.h | 4 ++-- sys/dev/ufshci/ufshci_req_sdb.c | 45 ++++++++++++++++++++++++++++++++--------- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 74d251c2b608..dd0d390962f2 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3227,6 +3227,19 @@ dev/uart/uart_if.m optional uart dev/uart/uart_subr.c optional uart dev/uart/uart_tty.c optional uart # +# Universal Flash Storage Host Controller Interface drivers +# +dev/ufshci/ufshci.c optional ufshci +dev/ufshci/ufshci_ctrlr.c optional ufshci +dev/ufshci/ufshci_ctrlr_cmd.c optional ufshci +dev/ufshci/ufshci_dev.c optional ufshci +dev/ufshci/ufshci_pci.c optional ufshci +dev/ufshci/ufshci_req_queue.c optional ufshci +dev/ufshci/ufshci_req_sdb.c optional ufshci +dev/ufshci/ufshci_sim.c optional ufshci +dev/ufshci/ufshci_sysctl.c optional ufshci +dev/ufshci/ufshci_uic_cmd.c optional ufshci +# # USB controller drivers # dev/usb/controller/musb_otg.c optional musb diff --git a/sys/dev/ufshci/ufshci_private.h b/sys/dev/ufshci/ufshci_private.h index cac743884ee6..ac58d44102a0 100644 --- a/sys/dev/ufshci/ufshci_private.h +++ b/sys/dev/ufshci/ufshci_private.h @@ -149,6 +149,8 @@ struct ufshci_hw_queue { bus_dmamap_t queuemem_map; bus_addr_t req_queue_addr; + bus_addr_t *ucd_bus_addr; + uint32_t num_entries; uint32_t num_trackers; @@ -198,8 +200,6 @@ struct ufshci_req_queue { bus_dma_tag_t dma_tag_payload; bus_dmamap_t ucdmem_map; - - bus_addr_t ucd_addr; }; struct ufshci_device { diff --git a/sys/dev/ufshci/ufshci_req_sdb.c b/sys/dev/ufshci/ufshci_req_sdb.c index 4670281d367a..b1f303afaef5 100644 --- a/sys/dev/ufshci/ufshci_req_sdb.c +++ b/sys/dev/ufshci/ufshci_req_sdb.c @@ -48,6 +48,29 @@ ufshci_req_sdb_cmd_desc_destroy(struct ufshci_req_queue *req_queue) } } +static void +ufshci_ucd_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + struct ufshci_hw_queue *hwq = arg; + int i; + + if (error != 0) { + printf("ufshci: Failed to map UCD, error = %d\n", error); + return; + } + + if (hwq->num_trackers != nseg) { + printf( + "ufshci: Failed to map UCD, num_trackers = %d, nseg = %d\n", + hwq->num_trackers, nseg); + return; + } + + for (i = 0; i < nseg; i++) { + hwq->ucd_bus_addr[i] = seg[i].ds_addr; + } +} + static int ufshci_req_sdb_cmd_desc_construct(struct ufshci_req_queue *req_queue, uint32_t num_entries, struct ufshci_controller *ctrlr) @@ -55,7 +78,6 @@ ufshci_req_sdb_cmd_desc_construct(struct ufshci_req_queue *req_queue, struct ufshci_hw_queue *hwq = &req_queue->hwq[UFSHCI_SDB_Q]; struct ufshci_tracker *tr; size_t ucd_allocsz, payload_allocsz; - uint64_t ucdmem_phys; uint8_t *ucdmem; int i, error; @@ -71,10 +93,11 @@ ufshci_req_sdb_cmd_desc_construct(struct ufshci_req_queue *req_queue, * Allocate physical memory for UTP Command Descriptor (UCD) * Note: UFSHCI UCD format is restricted to 128-byte alignment. */ - error = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), 128, - ctrlr->page_size, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - ucd_allocsz, howmany(ucd_allocsz, ctrlr->page_size), - ctrlr->page_size, 0, NULL, NULL, &req_queue->dma_tag_ucd); + error = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), 128, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, ucd_allocsz, + howmany(ucd_allocsz, sizeof(struct ufshci_utp_cmd_desc)), + sizeof(struct ufshci_utp_cmd_desc), 0, NULL, NULL, + &req_queue->dma_tag_ucd); if (error != 0) { ufshci_printf(ctrlr, "request cmd desc tag create failed %d\n", error); @@ -88,7 +111,7 @@ ufshci_req_sdb_cmd_desc_construct(struct ufshci_req_queue *req_queue, } if (bus_dmamap_load(req_queue->dma_tag_ucd, req_queue->ucdmem_map, - ucdmem, ucd_allocsz, ufshci_single_map, &ucdmem_phys, 0) != 0) { + ucdmem, ucd_allocsz, ufshci_ucd_map, hwq, 0) != 0) { ufshci_printf(ctrlr, "failed to load cmd desc memory\n"); bus_dmamem_free(req_queue->dma_tag_ucd, req_queue->ucd, req_queue->ucdmem_map); @@ -96,7 +119,6 @@ ufshci_req_sdb_cmd_desc_construct(struct ufshci_req_queue *req_queue, } req_queue->ucd = (struct ufshci_utp_cmd_desc *)ucdmem; - req_queue->ucd_addr = ucdmem_phys; /* * Allocate physical memory for PRDT @@ -128,10 +150,9 @@ ufshci_req_sdb_cmd_desc_construct(struct ufshci_req_queue *req_queue, tr->slot_state = UFSHCI_SLOT_STATE_FREE; tr->ucd = (struct ufshci_utp_cmd_desc *)ucdmem; - tr->ucd_bus_addr = ucdmem_phys; + tr->ucd_bus_addr = hwq->ucd_bus_addr[i]; ucdmem += sizeof(struct ufshci_utp_cmd_desc); - ucdmem_phys += sizeof(struct ufshci_utp_cmd_desc); hwq->act_tr[i] = tr; } @@ -175,6 +196,11 @@ ufshci_req_sdb_construct(struct ufshci_controller *ctrlr, req_queue->hwq = malloc(sizeof(struct ufshci_hw_queue), M_UFSHCI, M_ZERO | M_NOWAIT); hwq = &req_queue->hwq[UFSHCI_SDB_Q]; + hwq->num_entries = req_queue->num_entries; + hwq->num_trackers = req_queue->num_trackers; + req_queue->hwq->ucd_bus_addr = malloc(sizeof(bus_addr_t) * + req_queue->num_trackers, + M_UFSHCI, M_ZERO | M_NOWAIT); mtx_init(&hwq->qlock, "ufshci req_queue lock", NULL, MTX_DEF); @@ -277,6 +303,7 @@ ufshci_req_sdb_destroy(struct ufshci_controller *ctrlr, if (mtx_initialized(&hwq->qlock)) mtx_destroy(&hwq->qlock); + free(req_queue->hwq->ucd_bus_addr, M_UFSHCI); free(req_queue->hwq, M_UFSHCI); } From nobody Wed Jul 16 23:32:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjC5l0pv7z62845; Wed, 16 Jul 2025 23:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjC5k6bbGz3d1k; Wed, 16 Jul 2025 23:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752708763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OcnY44gNpdR6Ywn+6NaAdjjm0Z2SgPAmXgprZRCXl5c=; b=tzZMKcdwzFcL3kKzoeHvx2778uyIAhbyV12Jxf5WjSHc2fwsp0YXl6E2YUwNooIwMlwm6R +v+E0OiRGVBL92GQj0UBcfxa+Q5vWpJNvNhf3vG5WH5bHRrhsQiD+nHWq4slZRFRHUWtg4 EtcauJmlzXLfaxwYgGXKAL5WEoUAPQZLtElsVbbABoqWVOSbsjXVMLobFjdl47buJD8eaA DC8Yuf8qDjwCuZd5ExpyyFt6s8q3jFQtt3/tLLMDIEYuTHw0CWBNEAitYTOB/XAHFJYE+V n1qaExYN7ZeBtbbg/0wNXn9kAVBFqWbXrUXkUPoDdTP+PwODOnznipBVdO93mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752708762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OcnY44gNpdR6Ywn+6NaAdjjm0Z2SgPAmXgprZRCXl5c=; b=TiXx3CPtYVhlYzzbNAIBuYEd/9YkRw9RC43Izs5lubY1Oj27pz7K39m9p6aEvg66qkvLyh 39X1WCFKFc0HDYJDOJPoGnDEAMpkDAqaqI1z6W7JbBCGdyC92SRzUSxzIVO/8096N6SA6f zae8L7YvrvyPPN5jsNHjDA49w/0d8l/UhlNSDeoHJG752zxm/SAG+AaRUvpi4SOF1UpEX1 Wau2uRXMlD19Rrpq+P8MCCwN9AFO3ky+k/uRoEPzYs5y61Ogs28qoTymz36DB3Fbhxm+lE eo9Sa+E4527Py0YIQVW75xb4LzC8cj8ARAICBr6mrDGP1jSXZ2aUdJy8TqNk0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752708762; a=rsa-sha256; cv=none; b=cloEa7SDfsQd7Dc/PgPy8GoATBvsNIRM8NuhFB/3eXTEO+nK4Ga/lx5bSDUNuqLfJ3dTuK STJ0HpkmKNeNcR/zwmGQzBbBperPOFR8EPJ/zIUvxKJRNPl+6BG9EtFE8iSulmniEtK1uj k/h1MjZc4tDRWq0nBN/AGMp4mHjH4zU6Hg0IQt655DyLYF31jQ4K30gUyqkEMzu0sz+YaK F24c1wvPem7PPIOk3CNl0mRLxFEqfKjoWGKdH+XdRaZhMK03ohps6TbznjgFwUggg/fA8u 1hvJ7oK6kxYe2v1/mdnOml8pfuFxHtzsnyISxSYt8H00XsdUXDtHgmV3kazIHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjC5k5z2KzWYR; Wed, 16 Jul 2025 23:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GNWgOS068375; Wed, 16 Jul 2025 23:32:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GNWgvd068371; Wed, 16 Jul 2025 23:32:42 GMT (envelope-from git) Date: Wed, 16 Jul 2025 23:32:42 GMT Message-Id: <202507162332.56GNWgvd068371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d6d66936c45e - main - mlx5en: fix TLS Rx hardware offload initialization List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6d66936c45e99ec284554292181d26b6a5558d3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d6d66936c45e99ec284554292181d26b6a5558d3 commit d6d66936c45e99ec284554292181d26b6a5558d3 Author: Ariel Ehrenberg AuthorDate: 2025-07-03 08:57:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-16 23:32:27 +0000 mlx5en: fix TLS Rx hardware offload initialization The TLS RX context had the tcp sequence number of next TLS record set in resync_tcp_sn parameter instead of in next_record_tcp_sn parameter during hardware initialization. This prevent the hardware from synchronizing with the TLS stream, and caused TLS offload to remain inactive. Set next_record_tcp_sn to the next TCP sequence number and resync_tcp_sn to zero to enable proper TLS record boundary detection and activate hardware offload. Reviewed by: kib, slavash Sponsored by: NVidia networking MFC after: 1 week --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c index 4de451f1b039..89d2010656c5 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c @@ -659,7 +659,8 @@ mlx5e_tls_rx_set_params(void *ctx, struct inpcb *inp, const struct tls_session_p return (EINVAL); MLX5_SET64(sw_tls_rx_cntx, ctx, param.initial_record_number, tls_sn_he); - MLX5_SET(sw_tls_rx_cntx, ctx, param.resync_tcp_sn, tcp_sn_he); + MLX5_SET(sw_tls_rx_cntx, ctx, param.resync_tcp_sn, 0); + MLX5_SET(sw_tls_rx_cntx, ctx, progress.next_record_tcp_sn, tcp_sn_he); return (0); } From nobody Wed Jul 16 23:58:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjCgx3Jx3z628xy; Wed, 16 Jul 2025 23:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjCgx1rJbz40lQ; Wed, 16 Jul 2025 23:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752710333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRD24aABjWkp/5a49h91VaSYx7oZXng3NP49BQGUHuI=; b=vrj3GILRaOrW6bhXLDtVzt7mo59uX/bZHw3VeMSbt5GsF1Vs/+DgqUC/eqc+BXe36JcdXa AOB3xSOFcomZbw7Tu1QY9ZBTOCNUAiyyo833plAeMvRTtoEcF+FVlpsaoKNU53lSmBEsQw nxHgrBGQ0JF8v7LsIWG8myo9d19Vw4ytWT9bj+2wQOeDInT+udcy9NV3t2l+tA9xFLZEyq v6iCF9C93QBWOvBtfydAfjPPQzusidb1IQ64kPlPcbCEUCZ4Q54ruGsb5rXveswgh4pHa1 K+IeI/CWcQr8zzn2zQQXIXZqkVRgY5NMsX41B7Bclx5cbhgXq2f7YCxkjdokUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752710333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRD24aABjWkp/5a49h91VaSYx7oZXng3NP49BQGUHuI=; b=RRvE5mWfj4KcS/07iTKJIGDuhoUfFt/hZxqMNanEXdQJL8GFSWBiKTMbqt+qZSjCk/mlL9 c3mGG2f21RooWgh26uxlwoNe+xtDah+L6HhyvYGRS9yQdb9Okl/VeuF+LAnHwFzfTLywns UtMKwQlmcEc8aF8YB0Fm4QsJm0XMXL/B/j0PME+ylICFaczo54yjU+1CqXZrDHpHXDBpul y1rSnn6AjIAwoxh75OSXwVl3CfTMPHASDhdJzIfDjEBWAP6THl95hNFoH8GWI7zmBn7JFO ciiS1vCuJXYJlDPb9zfPjXha4a7JjV7tPyGjKK43hTPtKxfMruQLrH+pKex9/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752710333; a=rsa-sha256; cv=none; b=CsjA1h80/R0Yz71CSSdJ745VFr0N4crLI3o2zio/o41LCC1m3HDnyk8OoYP1EcAlCvNZPT SoQ0azCtD5JBWYyF0VUroPzy5EQ1E7kHLRy0YbrDhyayBkPwJvqxg9VhC3mDcrWo7CgEtW kR0ZyFpwSBOl97r/LVW5liTE0aJwynokuq+AlNivAKGJceWsuiXSvd+C2YQnYtlQ401TLl wSMY+F9As2PSleaZalKJDRKsHn05Cbwywm3rMo46V+Nfvrqyqs3JeTYB8Fs3Vv54FW7sLR kcvxNvD8/w8QnZJPhO4kGXXyA6X0XoQsmlaeiNxfL2Y4L5DikQvRVC17Yq4Dvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjCgx13ZNzXM7; Wed, 16 Jul 2025 23:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56GNwqBQ008336; Wed, 16 Jul 2025 23:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GNwqDC008333; Wed, 16 Jul 2025 23:58:52 GMT (envelope-from git) Date: Wed, 16 Jul 2025 23:58:52 GMT Message-Id: <202507162358.56GNwqDC008333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ff2dc0bca372 - main - sys: Bump __FreeBSD_version for removal of DMAP_MIN/MAX_ADDRESS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff2dc0bca3728448284d757ca983d023da7279b5 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ff2dc0bca3728448284d757ca983d023da7279b5 commit ff2dc0bca3728448284d757ca983d023da7279b5 Author: Ed Maste AuthorDate: 2025-07-16 15:17:14 +0000 Commit: Ed Maste CommitDate: 2025-07-16 23:58:21 +0000 sys: Bump __FreeBSD_version for removal of DMAP_MIN/MAX_ADDRESS PR: 288236 Reviewed by: kib Sponsored by: The FreeBSD Foundation --- 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 af116d6e3f7a..a8e9635242dd 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -74,7 +74,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500051 +#define __FreeBSD_version 1500052 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Jul 17 00:47:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjDmS4pxrz62CbS; Thu, 17 Jul 2025 00:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjDmS3tBWz3b3S; Thu, 17 Jul 2025 00:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752713272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oWgmnflWAu+Sb3A70TPNUUBP4hbvhu4rySBpwqGS2Y8=; b=sbyoMnF2+EzOo71t0BqDi/VKEsvrObWCPvnq+iShQy7vsHwcrg4+1gU46J9tzT22UCjKTh gUCHQfqbXjED6hwOSVje0A6QYxJ1vwhrTo54aG5RBsMw6jqWYMdmeM5IMDSmPmKcmg3RCU +fOhT0LG6/yKTDlKTPwSfI5KoKQ2aCgFG+I9uz7xRYgSX3rxJh21XptraBI3xsJ+KDm6zL odK1Ewvktqx19mfgRn5tehHVq493kArJgdU2LRtIQyt8DLmhWIZFBnoNktjmB1wq1swmUM HIlM/pZy03UNi1bPwpGOdAna9fdRn3uHmjOl1M4rYyi5rWd/a3NMkK/1ED935w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752713272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oWgmnflWAu+Sb3A70TPNUUBP4hbvhu4rySBpwqGS2Y8=; b=JcasmVS9M7gzewJzEXUWcyqEBWII2H5ndJST2ABx1751pU4mWEea7PP1KJ9XCGcE+CfY0s 41KlWN4j2sXJhoU+hHRSuUUeB1bRkDfb/M8ODqFrLnfEJnYXxrDZtdZmW/JuKhBlR31ZKJ cXhBuL51577kZbd6IAXdVgMf+4xiKA/urkTnECNYuXBRV/6P3yBQrW8w2sF3rQ2hZe+Ma0 ype+M9o5tkkef4Tkjoq1ZkFYJfpqzOoxoBLu/NFvSuerAVAYHRX8t20tHtT0/+xmr1w84l ygPXjgE15kO1vutZB8eH9tkz3R7tv5+rfTurdFvfNwzpDRUz8GKsFjHjvG1c1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752713272; a=rsa-sha256; cv=none; b=vPxG1wPSWD+ofU7obs/yICWTadmuPdCpCqRG0IzaxZ8WvUMTulZrqtd+3oguAkiVYHudB3 tLpylRpCGJHr6H48oGXCr0eb5dDRYHGEIleZ9wZ9kPJ1HJyHiZDIezQB9lqwN4iCQ/JUcV iGv0C5a1BOEpLJo5VkcT3CUYjJMCwHbRBqmrNohctyIpphH4yqIyqakHuyZCwRr8bJv/Xk IqLd4GGXvx3tvF44qSf1T+c1/oQBeyAgivUe1MfJQxvQXDwYZ+XyRMdrE1GvA85Bij15mQ eEMOIxPwes73IQqxGws3toOqHKnolldY3tS+Wy2noFwj1isbFEbktqwhU0Puhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjDmS3PjQzYtq; Thu, 17 Jul 2025 00:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56H0lq4Z002061; Thu, 17 Jul 2025 00:47:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56H0lqp6002058; Thu, 17 Jul 2025 00:47:52 GMT (envelope-from git) Date: Thu, 17 Jul 2025 00:47:52 GMT Message-Id: <202507170047.56H0lqp6002058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: cc86794b0319 - main - gpiobus: plug IRQ leaks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc86794b0319bad273a84e8bc36651a141b2ddc7 Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=cc86794b0319bad273a84e8bc36651a141b2ddc7 commit cc86794b0319bad273a84e8bc36651a141b2ddc7 Author: Ahmad Khalifa AuthorDate: 2025-07-14 17:47:06 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-17 00:33:52 +0000 gpiobus: plug IRQ leaks Unmap the IRQ instead of just freeing the map data in the case of an error. Also don't overwrite the resource's virtual address since the copy of the map data made by intr_activate_irq is stored there. Implement gpiobus_release_resource so it can unmap IRQs mapped by gpio_alloc_intr_resource. Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D51325 --- sys/dev/gpio/gpiobus.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index ab7f13177969..764bcb7e6ee8 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -110,10 +110,9 @@ gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, res = bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, irq, irq, 1, alloc_flags); if (res == NULL) { - intr_free_intr_map_data((struct intr_map_data *)gpio_data); + intr_unmap_irq(irq); return (NULL); } - rman_set_virtual(res, gpio_data); return (res); } #else @@ -866,6 +865,25 @@ gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, end, count, flags)); } +static int +gpiobus_release_resource(device_t dev, device_t child, struct resource *r) +{ + int err; +#ifdef INTRNG + u_int irq; + + irq = rman_get_start(r); + MPASS(irq == rman_get_end(r)); +#endif + err = bus_generic_rman_release_resource(dev, child, r); + if (err != 0) + return (err); +#ifdef INTRNG + intr_unmap_irq(irq); +#endif + return (0); +} + static struct resource_list * gpiobus_get_resource_list(device_t bus __unused, device_t child) { @@ -1060,7 +1078,7 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_alloc_resource, gpiobus_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), + DEVMETHOD(bus_release_resource, gpiobus_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), From nobody Thu Jul 17 04:02:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjK4X32pVz62PYb; Thu, 17 Jul 2025 04:02:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjK4X0jmNz420f; Thu, 17 Jul 2025 04:02:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752724924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F+uR+jwkoOe0NblgsGwnoBD6BC2orxjT1bxqy9KuRBI=; b=tAH2K8OuBBmWQ7E3Twu7jRCRA8z4pzlYW54TEn1diiSbvIuY1iGFBHWb469SP3kG+kZ1ZT 8TsYrXzTL5McLr+QnrV+n5TTRbXM90D1IzEoAj68JNkUWoMDhVrgQzHUlB0Fd29007Tmex 6qyhj8aCMbuPZN6ePwi9Y967hk3CSfByG0s1yo1s3ue7Mw+bbMoFoDUMlsmSjRnslpOOxS jsZThYU/gm0qgc5BjhDMjF2XarNmanxsHzvKnCb4zksK24J9Z/Q/3xswPKdalrvrkDcxbb OruxehwE3+Y15DDsyJcd1ndGFPYNl+Wqj+D1B7oRJCfnCnrQy+MAOXU87jEZeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752724924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F+uR+jwkoOe0NblgsGwnoBD6BC2orxjT1bxqy9KuRBI=; b=I8baVzTpTF+lKU8CihK8vMAWY90b0BNYarXute1F31dzlgKG8cOQrSEggmBlG3d8qp47SF 4eV9DJgRtcwbiYPCprjD2J0CaMHQ4Qphs34fO+Zi4GmE19RbxfMOEJkfT8N3iGEvNSuMjn cOuvc85fgM41EqYHLHPHv187w5W4rX4I6RNNehl2S0QLNRNZnv0srLvaTC8ItSOc/adtCz JqxB4jcgGjl6NvrO0nmTyINad1lPPU/sKMMWK5nVnCiqk+DHJoJqX4wqNPgUsb8K754nm4 9Mp/LHtfQyBYwwDvDLzYKEk5Hidyp56VMHYV1KjASQShMZDQl4K7t3cUYNBsQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752724924; a=rsa-sha256; cv=none; b=I+5/Lp+vHBAqp7CLBF24dbYu/v3dwUwi6/s6j6n9Cs/d+SMTP/YOkDzCTcb6hJKHZN4w+c co+4KUAY0dpVP6Kfu6515vAw3rfVSfvXUJXULxsqHPKox9XJpZrXUJir/DHENbg+H9u2H+ 8njJgIEcfxw7cb2leIf9FGSndodsGGKY5Ob4b2X4tui8Vl5+rN9gGRo5H8eiSZ3CcgMQN/ /KfBM7Xn1JTAz5v0VkYTa/p7e3FmCo6s8IAJxqlHMkLoyT1FLVvSzmHsNC+Ia8XX+oADST LkkICj9XWa/CkPBrGZOsIfBNiCj4FHANhsT0dUFHi1j0JDb12Te2P2WBwebWIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjK4X0B5KzfKl; Thu, 17 Jul 2025 04:02:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56H4239f080246; Thu, 17 Jul 2025 04:02:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56H423mH080243; Thu, 17 Jul 2025 04:02:03 GMT (envelope-from git) Date: Thu, 17 Jul 2025 04:02:03 GMT Message-Id: <202507170402.56H423mH080243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 10d9ec31bf28 - main - qlnxe: Fix build with INET List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10d9ec31bf28949221280c9ddc0816464407a43f Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=10d9ec31bf28949221280c9ddc0816464407a43f commit 10d9ec31bf28949221280c9ddc0816464407a43f Author: Zhenlei Huang AuthorDate: 2025-07-17 04:01:16 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-17 04:01:16 +0000 qlnxe: Fix build with INET opt_inet.h is missing from 5684c8783b64, thus actually `#ifdef INET` does not work. PR: 287445 See also: https://redmine.pfsense.org/issues/16248 Reviewed by: kbowling Tested by: leper Fixes: 5684c8783b64 qlnxe: Add missing #ifdef INET to fix amd64 LINT-NOINET/NOIP builds MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51295 --- sys/dev/qlnx/qlnxe/qlnx_os.c | 2 ++ sys/modules/qlnx/qlnxe/Makefile | 1 + 2 files changed, 3 insertions(+) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 05ec69a70dfe..160534476688 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -30,6 +30,8 @@ * Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131. */ +#include "opt_inet.h" + #include #include "qlnx_os.h" #include "bcm_osal.h" diff --git a/sys/modules/qlnx/qlnxe/Makefile b/sys/modules/qlnx/qlnxe/Makefile index 3d8415cf0e57..2a44ae6ddde5 100644 --- a/sys/modules/qlnx/qlnxe/Makefile +++ b/sys/modules/qlnx/qlnxe/Makefile @@ -58,6 +58,7 @@ SRCS+=qlnx_rdma.c SRCS+=qlnx_ioctl.c SRCS+=qlnx_os.c +SRCS+=opt_inet.h SRCS+= ${LINUXKPI_GENSRCS} From nobody Thu Jul 17 04:02:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjK4Y5lV7z62Pnw; Thu, 17 Jul 2025 04:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjK4Y21t9z41xZ; Thu, 17 Jul 2025 04:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752724925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3Sfh3L0GBXBPLo4o+t0F/6gT7ouH4t7lubGk3OTQok=; b=AbsT9XcdeEJvGH04onCZq1T1NKH0eEKdQ2xWZfJMrFSMYMT1NRiSJw0zg7iz/FVAoVsSAQ Q935cZFJhdmPfIeWdf89fcfEsLFY/j1VDpFMaSCNDywworhsLt4gISeTPrm9Cg6WrQVmsK ZOMJVl81+8eZZEFMpnmwJcodHCb9QXnL0/mdIdwUD+E4btN5Md0UpF0+KWfK25AA90y1i/ 6yTuhrxcYYcWaJcpyQ+H9/1m9iSImDuENa1YeHDDuEeEnkIZKjB+6MQSQZYnS9Ix/QQ9co TmOOtNOWZ2ayfJkkWxtE8RoPQ3/osFT7HDFkXV2bKvB2/rT5Yfwa4PU43USL2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752724925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3Sfh3L0GBXBPLo4o+t0F/6gT7ouH4t7lubGk3OTQok=; b=IZGBCdO6J6f6zAt6vnDcuiOhbo3wswrAiylrlc4YUXHy5XiUNULmWL+7i2iKiSpknFMDKx kCBMB4ys9GYdZUuAynl58rXtmHmRp/eHEMTSGfhI0hUab3VK8i1PTpPiB5wFmqEFViEqX5 r+AhSGvAWmKZZsiXhdEQYQVdx9mfHa0YtMJAGSWGEesTeSZbB+V8CbYJmC4/ZK3aJGQIVq t35AnAXmti2rQNC6+Yg4FlhfP5uW+00SnOuHEYowoiYJrxEfKpjNU/m0cwyNoA3G8ln7Iq 0GCivnoAeLoWY809JqdY0HXIk8UNQR0/mtzzRERUNNiYu/7V5OwpjqEvBZYEYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752724925; a=rsa-sha256; cv=none; b=WnLirg13n3yV+oGMNoimTnrLGa5hVoHzgUytLJLMmXwfsDjl1szYiEOETuUS3oxD92Ac3j ZfHQjTfvmM+I6yQeWAgYLEWqKSQCPgrcZSBhk4NUN2G6WZOW/6ZBULFn6OoRyUaL/wSeuo kJEQJ8Zb2Hh4dybqZHd6lNVVYY+kybf9VzMF9Uuw7BCv49YRIEsCo8YQkEMq3bttzLZejI GF6PBE9cG0hFY44jk0kxWqvcsG+j83ARpvtXKIeLUamnNOdNr49YZyVPNGptZaSN0QqiTR OWZ+dhRLYIgC7Kdk0z+Yg2g9y6jTmsi5CMIoTrQ8GDqxY2w/8HwA1WtdGCRdZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjK4Y17hQzgHC; Thu, 17 Jul 2025 04:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56H425lh080281; Thu, 17 Jul 2025 04:02:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56H425Jr080278; Thu, 17 Jul 2025 04:02:05 GMT (envelope-from git) Date: Thu, 17 Jul 2025 04:02:05 GMT Message-Id: <202507170402.56H425Jr080278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 12fea464070a - main - qlnxe: Fix error handling of SIOCGI2C ioctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12fea464070a9061fda874038614ed55011ad59d Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=12fea464070a9061fda874038614ed55011ad59d commit 12fea464070a9061fda874038614ed55011ad59d Author: Zhenlei Huang AuthorDate: 2025-07-17 04:01:16 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-17 04:01:16 +0000 qlnxe: Fix error handling of SIOCGI2C ioctl The error -1 is actually ERESTART in the context of syscall. It is for kernel mode only and will not be passed to user mode. When the kernel sees this error it will restart the syscall. When the the SFP module data is not available, e.g. the SFP module is not present, the ioctl handler returns ERESTART and kernel will retry infinitely, hence the userland `ifconfig -v ql0` will hang forever until get interrupted. That is apparently wrong. Fix that by returning error ENODEV to indicate the SFP module data is not available. As for the case that ecore_ptt_acquire() fails, it appears to be quite safe to restart, so keep returning ERESTART. Reported by: Steve Wheeler See also: https://redmine.pfsense.org/issues/16248 Reviewed by: kbowling MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51351 --- sys/dev/qlnx/qlnxe/qlnx_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 160534476688..9d23d5df1d2b 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2780,7 +2780,7 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) if (!p_ptt) { QL_DPRINT1(ha, "ecore_ptt_acquire failed\n"); - ret = -1; + ret = ERESTART; break; } @@ -2791,7 +2791,7 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) ecore_ptt_release(p_hwfn, p_ptt); if (ret) { - ret = -1; + ret = ENODEV; break; } From nobody Thu Jul 17 09:36:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjSVm6jkPz62kBC; Thu, 17 Jul 2025 09:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjSVm5VZcz49T3; Thu, 17 Jul 2025 09:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dcwvIxrfrtx1V8Q0F00NONeUH/hhkr29NaibWESq5vM=; b=VZo2tnQ5tBpjkXUyLSU46J7NkxmSvXm+VERG8S0bPWs6P7c8SKAo9XLs8SaWndZROyOqde lqNA0mzJV0r+wqVCjwIRniHc07L+ANLqIDLMzvkma9NejfpqcNNHhT5SoyZo81jPkIJdL4 AM0Xlff44b/tKXQnat+FZmHK6k/vXfjrbN/0KKSpaD1S7xGAUOXgJ3McNB9lW9pZNNlGdK PHk4AvZvOr6y2lC4Ir9R5sfjnj4nEYVni+0GU9GsLg6/v9+iW+H6AHq6Y2Y5u3jKulVwke /28tefcMrYQTmlpNzgBjfKp2nxe23YfKwZXjkV4JFLiAoE4Zv3CTx79YAtHfnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dcwvIxrfrtx1V8Q0F00NONeUH/hhkr29NaibWESq5vM=; b=eTPIgQqQZihGZGYUVRakcp7DbXLHC0q0EtO5ekbCpVkQ9V/3h0FhfF+70ExZkzRavp/8vJ I8JDjqz6DjGa1HbGDBAIHc7MOP3yMU10tyuHgHS7lysTtBw+LS/XcwTu4DAnA5nI9l08l+ 3355xTNCy+hGKyv/++17PuSRAPBd7kW/+oQil6vsbuQFUWwrEP6Z1saXp86EgLFnDg+2EW 0fM5xofESCfjKdE1XBn2R/H4hfKKsridxZOHtm47C9OHsZKMmcH4u3SnSeau52v46DBDoe Bj10l1WeywrpASjHTrB+/ALEpdIZwuOoCr/G+hW83wVzZaSBNYMsBLjtuK/lTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752745008; a=rsa-sha256; cv=none; b=F8kKw9nUngGhYrYgHSoXdnIVNDceN+NzyTy3D75OvYEqql9nuSsV4PhLRbWKo9dF6UII+0 vepNflAA3srxG/Gh5/ncT2UhivNFtiBCBELjQjRMxG8FyFhFyCEaUkzlpjau9Y/35+xN20 nqSECyR/guk7EvSg1JYXb7OsbtyZvP4ZSFrOP56LdG4CfHULYiH7erG4eueC5vLT5wne4a wq8f6PoRvrfeq2xt8Ad26jNFk1wlqNygBPz9gE0fOGy29jgOZNgJ91H/+mvdw1ZLi9s6PF U71SitJfP03eJA4txJ70yfh7MAVwgt4RbJgsP6l1H2mSvB3DHTYbVNkljlTQYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjSVm55jyzqY6; Thu, 17 Jul 2025 09:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56H9amX2003421; Thu, 17 Jul 2025 09:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56H9am4R003418; Thu, 17 Jul 2025 09:36:48 GMT (envelope-from git) Date: Thu, 17 Jul 2025 09:36:48 GMT Message-Id: <202507170936.56H9am4R003418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: fb65357d8707 - main - ipsec_offload: pre-calculate xform_history for recorded accelerated SA List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb65357d8707219c98db2216622057133f42fa3d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fb65357d8707219c98db2216622057133f42fa3d commit fb65357d8707219c98db2216622057133f42fa3d Author: Konstantin Belousov AuthorDate: 2025-07-06 16:54:42 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-17 09:36:18 +0000 ipsec_offload: pre-calculate xform_history for recorded accelerated SA Also provide the helper to fill the xform_history into mtag, provided by a driver. Reviewed by: Ariel Ehrenberg , slavash Sponsored by: Nvidia networking --- sys/netipsec/ipsec_offload.c | 21 +++++++++++++++++++++ sys/netipsec/ipsec_offload.h | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index 467d5ded1d7a..a2092c91c1aa 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -94,6 +94,7 @@ struct ifp_handle_sav { size_t hdr_ext_size; uint64_t cnt_octets; uint64_t cnt_allocs; + struct xform_history xfh; }; #define IFP_HS_HANDLED 0x00000001 @@ -412,6 +413,10 @@ ipsec_accel_handle_sav(struct secasvar *sav, struct ifnet *ifp, ihs->ifdata = priv; ihs->flags = flags; ihs->hdr_ext_size = esp_hdrsiz(sav); + memcpy(&ihs->xfh.dst, &sav->sah->saidx.dst, sizeof(ihs->xfh.dst)); + ihs->xfh.spi = sav->spi; + ihs->xfh.proto = sav->sah->saidx.proto; + ihs->xfh.mode = sav->sah->saidx.mode; mtx_lock(&ipsec_accel_sav_tmp); CK_LIST_FOREACH(i, &sav->accel_ifps, sav_link) { if (i->ifp == ifp) { @@ -1162,4 +1167,20 @@ ipsec_accel_key_setaccelif_impl(struct secasvar *sav) return (m); } +bool +ipsec_accel_fill_xh(if_t ifp, uint32_t drv_spi, struct xform_history *xh) +{ + struct ifp_handle_sav *i; + + if (drv_spi < IPSEC_ACCEL_DRV_SPI_MIN || + drv_spi > IPSEC_ACCEL_DRV_SPI_MAX) + return (false); + + i = DRVSPI_SA_PCTRIE_LOOKUP(&drv_spi_pctrie, drv_spi); + if (i == NULL) + return (false); + memcpy(xh, &i->xfh, sizeof(*xh)); + return (true); +} + #endif /* IPSEC_OFFLOAD */ diff --git a/sys/netipsec/ipsec_offload.h b/sys/netipsec/ipsec_offload.h index 904fe6252396..6e374d721a4f 100644 --- a/sys/netipsec/ipsec_offload.h +++ b/sys/netipsec/ipsec_offload.h @@ -180,6 +180,9 @@ bool ipsec_accel_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, struct secpolicy *sp, struct secasvar *sav, int af, int mtu, int *hwassist); void ipsec_accel_forget_sav(struct secasvar *sav); +struct xform_history; +bool ipsec_accel_fill_xh(if_t ifp, uint32_t drv_spi, + struct xform_history *xh); #else #define ipsec_accel_input(a, b, c) (ENXIO) #define ipsec_accel_output(a, b, c, d, e, f, g, h) ({ \ @@ -187,6 +190,7 @@ void ipsec_accel_forget_sav(struct secasvar *sav); false; \ }) #define ipsec_accel_forget_sav(a) +#define ipsec_accel_fill_xh(a, b, c) (false) #endif struct ipsec_accel_in_tag *ipsec_accel_input_tag_lookup(const struct mbuf *); From nobody Thu Jul 17 09:36:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjSVp3ZdTz62kLS; Thu, 17 Jul 2025 09:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjSVn6bWTz49LR; Thu, 17 Jul 2025 09:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xVYM72T71Er/K0eFvFUs6XfYKvhrw1ZzdR4Ybi5CBOA=; b=ipDWmJxO+ANYlb/IgSSOEjSCvEamja84Du5OiufR0DiBaMFzS76lQt8AT+NPvj0JLYktGn KsyeTWJzLQl95MauSg5zhUofsNs2fGKh5maWRnnGUFKkv3pQofb1NSp4FrPKxCzk2JEHQy AHPYZP0ZKIth6GJeM3gH3tltUX/a34FlTykfE9Yex2QQyP29V4AGuSc4poY0m1nH7SYwBa a6DoFs0UR+dpM+zn2TAU+UHk3DhQs3z8HuXO2pkhAdgDcrIJZPRNKTRCFUL6ciPqKdogxY PwPX5xyVsBsz6JJaC4EGE3y+UVxH4F3NuGcblKLMJL8IHbsgiEMeo6FDFYG2Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xVYM72T71Er/K0eFvFUs6XfYKvhrw1ZzdR4Ybi5CBOA=; b=OaNvSCU6G6S529CtKmT99GdeZUvSba9eNjPVLl7r+TdDkS/QlBr6hFiSwaUbQrtUCdRQt5 EmkvwpBYpeaomALL17V5GHgvcW2GLJa+ipZEPfWGJ7rdOyHf2NRH2+SJkYLpQGnhmrQ0Th kkQZ+hGs2Zx6aNPQvgE5JkodhK57zgwQucjdrmTVa8t0QPrO8q9aKP8Ejy1ELAXgjsAI30 Rqgxe5tOQCoui18kkzTBKYsE75N3xv63nw5TtIYnMMET0ZgNRQ6LPV2tdMjXZikiLP3Fvx aYrXzpXUSOl47l4RmioiY2q5DHC10eAVIEKRw/cwocCu0oa+PUZuj8U38O9umA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752745009; a=rsa-sha256; cv=none; b=dE35Q/jv3QrnXu43iI6EVRVbEgOCTVOMNWHPhmBrUFsANpg4HcK07ouf1hCg3qdEiewryX SheqEXYLyB/qGv2VBEtSH2fzPKrn6Oilv+37iojh7/liJ3Nq0zqElEsmCIng4Cgc95z3dp X9Yn1KJCrwbyM9xhF+JktJm2tsowXc/14DnvOhgbR8BjbcIYjqwjLy5HTjTInL6YoM0kk+ zpS/3+alm/+77xc1xQYjMDGyAsxhWeztZBhSf7QTYcKnJG5xFODS/NvsDV97RdICiMXamM JuOPgZOp3slYBR5W911PALMkaGIt7wFFTh/AwheZfzcE8VBB0kHCFd9NrGdFPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjSVn60YDzqY7; Thu, 17 Jul 2025 09:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56H9anqK003454; Thu, 17 Jul 2025 09:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56H9anal003451; Thu, 17 Jul 2025 09:36:49 GMT (envelope-from git) Date: Thu, 17 Jul 2025 09:36:49 GMT Message-Id: <202507170936.56H9anal003451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b494e256a492 - main - ipsec offload: add xform_history to the ipsec_accel_in_tag List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b494e256a492c3d26eadfec9cd45956fb2d9c72e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b494e256a492c3d26eadfec9cd45956fb2d9c72e commit b494e256a492c3d26eadfec9cd45956fb2d9c72e Author: Konstantin Belousov AuthorDate: 2025-07-07 22:30:42 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-17 09:36:22 +0000 ipsec offload: add xform_history to the ipsec_accel_in_tag The layout makes ipsec_accel_in_tag compatible with PACKET_TAG_IPSEC_IN_DONE. Reviewed by: Ariel Ehrenberg , slavash Sponsored by: Nvidia networking --- sys/netipsec/ipsec_offload.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netipsec/ipsec_offload.h b/sys/netipsec/ipsec_offload.h index 6e374d721a4f..fb8cd7438598 100644 --- a/sys/netipsec/ipsec_offload.h +++ b/sys/netipsec/ipsec_offload.h @@ -30,6 +30,7 @@ #include #include #include +#include struct secpolicy; struct secasvar; @@ -42,6 +43,7 @@ struct ipsec_accel_out_tag { struct ipsec_accel_in_tag { struct m_tag tag; + struct xform_history xh; /* Must be first to mimic IPSEC_IN_DONE */ uint16_t drv_spi; }; From nobody Thu Jul 17 09:36:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjSVq3lxtz62kJj; Thu, 17 Jul 2025 09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjSVq0Vqrz49Ld; Thu, 17 Jul 2025 09:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mXJNDc/tPBoiAayzcP/Qx2dYx85RVr7Rf2a2KLCDaXE=; b=NO/WVM4EibBnUYnK0DoJShMsYPPLQjU1FdwLZNBoy/5/KO8h4uJjCPXtMaHG1sWFnqadvQ ycLVlVZZAqOQrWvrfHsmXh7x/R7XzsKalSkGuD4UcFxe1xwtwk09WNIY5gY7evrYBascP6 itd9pBXqfvrJT8TqFo+5WeyZP3EXxX06+7cP0+PcNTu1bQvGECD2M392d7chTRgrCFiRuZ cYLm9rA5jkPdb5DNmqjuObqfKO8C0TK04dha2X8Sh4WmK+HmEoQTY0S37UEFJgR86ANWim KjGDe6NlkDBEGFw9RJdJqU3hGWsgl+/FDl1K1qV/OhgWv/cXgVSyH3znkbkoEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mXJNDc/tPBoiAayzcP/Qx2dYx85RVr7Rf2a2KLCDaXE=; b=uGBdqWfmJJB+yEnGC7A2LB0lh9ak0Ye5UNC+KP/ctlMsmIxXileK/2HTqLVyvnvTbAckiC xyb4XlQ4fbUxNexwTnu+av/3yCem3Iy6n87zhp67gqc9O/Zpq68GwfDrnSioE8VB9GB1aK 3uGNZ48S5wKYztG+3BtiubJbNhLS8IAqL7RvNnK7vw1fO4plSO2Ozsn1+0EXRGpKzgr4iy MklPlgYso2h46k86R8pGaLy4KKM882Ke0FNq5X5Jsn7xTshBeR646pPy9NoJhYLmU9FraW iop2Nt2ILbO2+rAVW9ns7GrfuwXxl82rxQGSp62oPjdZZPfuCLd9Qm57PkRjHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752745011; a=rsa-sha256; cv=none; b=N8PVTyV+hRUIgM2OavQeh94WeOB39PGEXuYxLJqeL5oXBI/ogS/CmDWIEI7US4VhAEar51 VF2MWprDNPEXtUDJwdwflfLFtPq0PsOGwiI5rGj9J3+UVWHc2M2sgBwzByCDsJMbjalFH+ HK/JsVEuAQRoqcubqSU9ECA4Iwuu1A5TRt0Xdqd1T0aWecaFiRzkQP2WNtyZJahQFVFOuE t1XeKJrQAZUUUkSVL+43MXuDci3WiTBFKiNOyyn73JDZV0D5iLOZE03qYk+vG3Ya1uTNWp qmCwMsneZplQT8l+TTuXXCsMaLgp9VGGvwen542B6sN9wbRKPqdBx8XwORC5Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjSVp6xNXzqSB; Thu, 17 Jul 2025 09:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56H9aobo003488; Thu, 17 Jul 2025 09:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56H9aoEM003485; Thu, 17 Jul 2025 09:36:50 GMT (envelope-from git) Date: Thu, 17 Jul 2025 09:36:50 GMT Message-Id: <202507170936.56H9aoEM003485@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 72c9ad9331a9 - main - mlx5en ipsec offload: copy xform_history to the ipsec_accel_in_tag List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72c9ad9331a9d0b80bdfe8c6d76c61aa336bb1e5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72c9ad9331a9d0b80bdfe8c6d76c61aa336bb1e5 commit 72c9ad9331a9d0b80bdfe8c6d76c61aa336bb1e5 Author: Konstantin Belousov AuthorDate: 2025-07-06 16:58:25 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-17 09:36:26 +0000 mlx5en ipsec offload: copy xform_history to the ipsec_accel_in_tag Reviewed by: Ariel Ehrenberg , slavash Sponsored by: Nvidia networking --- sys/dev/mlx5/mlx5_accel/ipsec.h | 8 ++++---- sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c | 16 +++++++++++----- sys/dev/mlx5/mlx5_en/mlx5_en_rx.c | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/dev/mlx5/mlx5_accel/ipsec.h b/sys/dev/mlx5/mlx5_accel/ipsec.h index 361b9f72d873..c3f3a2372482 100644 --- a/sys/dev/mlx5/mlx5_accel/ipsec.h +++ b/sys/dev/mlx5/mlx5_accel/ipsec.h @@ -260,8 +260,8 @@ int mlx5e_accel_ipsec_fs_rx_tables_create(struct mlx5e_priv *priv); void mlx5e_accel_ipsec_fs_rx_catchall_rules_destroy(struct mlx5e_priv *priv); int mlx5e_accel_ipsec_fs_rx_catchall_rules(struct mlx5e_priv *priv); int mlx5_accel_ipsec_rx_tag_add(if_t ifp, struct mlx5e_rq_mbuf *mr); -void mlx5e_accel_ipsec_handle_rx_cqe(struct mbuf *mb, struct mlx5_cqe64 *cqe, - struct mlx5e_rq_mbuf *mr); +void mlx5e_accel_ipsec_handle_rx_cqe(if_t ifp, struct mbuf *mb, + struct mlx5_cqe64 *cqe, struct mlx5e_rq_mbuf *mr); static inline int mlx5e_accel_ipsec_flow(struct mlx5_cqe64 *cqe) { @@ -269,12 +269,12 @@ static inline int mlx5e_accel_ipsec_flow(struct mlx5_cqe64 *cqe) } static inline void -mlx5e_accel_ipsec_handle_rx(struct mbuf *mb, struct mlx5_cqe64 *cqe, +mlx5e_accel_ipsec_handle_rx(if_t ifp, struct mbuf *mb, struct mlx5_cqe64 *cqe, struct mlx5e_rq_mbuf *mr) { u32 ipsec_meta_data = be32_to_cpu(cqe->ft_metadata); if (MLX5_IPSEC_METADATA_MARKER(ipsec_meta_data)) - mlx5e_accel_ipsec_handle_rx_cqe(mb, cqe, mr); + mlx5e_accel_ipsec_handle_rx_cqe(ifp, mb, cqe, mr); } #endif /* __MLX5_ACCEL_IPSEC_H__ */ diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c index 0883cfb2d510..5dccb8bc2b87 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c @@ -24,11 +24,14 @@ * */ +#include "opt_ipsec.h" + #include #include #include #include #include +#include #include #include #include @@ -48,7 +51,8 @@ mlx5_accel_ipsec_rx_tag_add(if_t ifp, struct mlx5e_rq_mbuf *mr) return (0); mtag = (struct ipsec_accel_in_tag *)m_tag_get( - PACKET_TAG_IPSEC_ACCEL_IN, sizeof(*mtag), M_NOWAIT); + PACKET_TAG_IPSEC_ACCEL_IN, sizeof(struct ipsec_accel_in_tag) - + __offsetof(struct ipsec_accel_in_tag, xh), M_NOWAIT); if (mtag == NULL) return (-ENOMEM); mr->ipsec_mtag = mtag; @@ -56,8 +60,8 @@ mlx5_accel_ipsec_rx_tag_add(if_t ifp, struct mlx5e_rq_mbuf *mr) } void -mlx5e_accel_ipsec_handle_rx_cqe(struct mbuf *mb, struct mlx5_cqe64 *cqe, - struct mlx5e_rq_mbuf *mr) +mlx5e_accel_ipsec_handle_rx_cqe(if_t ifp, struct mbuf *mb, + struct mlx5_cqe64 *cqe, struct mlx5e_rq_mbuf *mr) { struct ipsec_accel_in_tag *mtag; u32 drv_spi; @@ -65,10 +69,12 @@ mlx5e_accel_ipsec_handle_rx_cqe(struct mbuf *mb, struct mlx5_cqe64 *cqe, drv_spi = MLX5_IPSEC_METADATA_HANDLE(be32_to_cpu(cqe->ft_metadata)); mtag = mr->ipsec_mtag; WARN_ON(mtag == NULL); - mr->ipsec_mtag = NULL; if (mtag != NULL) { mtag->drv_spi = drv_spi; - m_tag_prepend(mb, &mtag->tag); + if (ipsec_accel_fill_xh(ifp, drv_spi, &mtag->xh)) { + m_tag_prepend(mb, &mtag->tag); + mr->ipsec_mtag = NULL; + } } } diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c index 6b53db6fea23..eb569488631a 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c @@ -467,7 +467,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, struct mlx5e_rq *rq, break; } - mlx5e_accel_ipsec_handle_rx(mb, cqe, mr); + mlx5e_accel_ipsec_handle_rx(ifp, mb, cqe, mr); } static inline void From nobody Thu Jul 17 09:36:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjSVt0BBYz62kGq; Thu, 17 Jul 2025 09:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjSVr4QM9z49R1; Thu, 17 Jul 2025 09:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oYDHAL5IoOFEmGMLas+/HueD9sV3gD6d9Gl3qnu25Vg=; b=h1qIGjwoz92hxOCJqeZwev/Ktw+LsnBtOh4CrtlLG08uQLBOfgaL1J5LfbCeGtUldKOGsj U25gCWdUo9ACbDDr+zuPle+6PUdtra4GobZXXhCkdDgVZ2MLaT22jDpcsdfWVAIsOfZTt0 MlKPFOuhC+tNuCy/MyPm1oV5KcNcKWYSZUUXixJz1JLK4O6MxCBuPIOFc5NNVBmDlDo9MJ cFK7o4XiSTzESX0Il4jRoaqdA4lyI1j+WgnZbR5peEEACqVsjb/BdugfBdk6nD7vOFFa9d 8SFSubcWnx3omCLlIvlYc6v+RW8KoK+tHgAHUUWRMyK/j8Zdo0fEz2qvWkYQMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752745012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oYDHAL5IoOFEmGMLas+/HueD9sV3gD6d9Gl3qnu25Vg=; b=bxJqRDeKbqoOgOkPFz0Y0Agxdnhc7pPSabJqrT/KFbWCjV+kX6hFZDUePQLHptA1n7HDSN QSe3oT1rBiXd5jFjRSIQEZldkGA4R90fF3SP3pAO4kvHdQEOURPoXbh/5MgqSOqqzRcmZO tUPwi/F30eYH4ej7RCCR8aN29Lc3IKIpwZqjdMgimN0gYDzpdodF8iA7ZON8NKmDHR9j/e mIXQAEGllevemi16AXGNoZrUn46yKzKZHIFkQsf05BiyfxraNknwysvQ1OAxeRUWL3j5CN 5C/9zy+LidxWx7QeFazPtGsOUJNPfeBXzQI0rQQizYkQDFKGgSifCMrjQYwULw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752745012; a=rsa-sha256; cv=none; b=ooXXaJqCM1uI5ZiLVgNLksMA6yBRGHHsRKifGtM+LBdkW5UKZ2NJi76tXceIunDKr0q35Z c30AxHfwUU5OUyr87pP6uhSJ8WRR2Ml9AQ/p67U3Yf3m6rRerFpZW3SOk2mHJ+Yi/TvsHN 3r4/ro4R0DxxK4VYW+l/6Q+azUq0clrjRcVq7T2uRBfxyAnK7pwFkY/ygqJG9oTDw52KDv kGv44g2kxSgxKqXXGgDcKFg+1v1nfQ4N2h1NTf4hEx3CQzYxdPOzUh97bsD5XhSUCHB2bg taSW+HuXyrdYaQ/USXoc72/Id8LHOsq29krJ6WDnwUoo2j715qLnGvqVMgjs3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjSVr0VdJzqY8; Thu, 17 Jul 2025 09:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56H9apUW003527; Thu, 17 Jul 2025 09:36:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56H9apYt003522; Thu, 17 Jul 2025 09:36:51 GMT (envelope-from git) Date: Thu, 17 Jul 2025 09:36:51 GMT Message-Id: <202507170936.56H9apYt003522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5be5a0bde5f9 - main - ipsec offload: make hw-decrypted plain text packet like sw decrypted. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5be5a0bde5f990dbc680272eee74132bcde815f2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5be5a0bde5f990dbc680272eee74132bcde815f2 commit 5be5a0bde5f990dbc680272eee74132bcde815f2 Author: Konstantin Belousov AuthorDate: 2025-07-07 18:01:34 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-17 09:36:30 +0000 ipsec offload: make hw-decrypted plain text packet like sw decrypted. Mark hw-decrypted mbufs with M_DECRYPTED in the CHECK_POLICY() hook, when the flag is owned by IPSEC. Convert PACKET_TAG_IPSEC_ACCEL_IN to PACKET_TAG_IPSEC_IN_DONE to provide the xform history for ipsec transform history check. The hw-decrypted packets are then subject to exactly the same checks at CHECK_POLICY() hooks as the sw-decrypted packet. This includes the policy checking, and updating the corresponding policy' lastused field, needed for IKE daemons to track association lifetime. Reviewed by: Ariel Ehrenberg , slavash Sponsored by: Nvidia networking --- sys/netipsec/ipsec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c index 6bacc68b7441..92d0201b398a 100644 --- a/sys/netipsec/ipsec.c +++ b/sys/netipsec/ipsec.c @@ -636,8 +636,10 @@ ipsec4_in_reject1(const struct mbuf *m, struct ip *ip1, struct inpcb *inp) #ifdef IPSEC_OFFLOAD tag = ipsec_accel_input_tag_lookup(m); - if (tag != NULL) - return (0); + if (tag != NULL) { + tag->tag.m_tag_id = PACKET_TAG_IPSEC_IN_DONE; + __DECONST(struct mbuf *, m)->m_flags |= M_DECRYPTED; + } #endif if (ip1 == NULL) { From nobody Thu Jul 17 11:01:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjVNG0fjRz61Zkx; Thu, 17 Jul 2025 11:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjVNF6Bnvz3vSL; Thu, 17 Jul 2025 11:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752750077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9mky5we0fgRdzpuqUyZ3/cbUOU/7mO6l9M+AVxXaVTc=; b=kqo2G6SPKK60t0x5jqhzLN2sScN7FcVfn9rzdO1xoeAO6EL2ZC878tMPssakZ/O7waCSST 3DagEZ0vb0QISoNu/X5/wsYAYYrNz+Rdq3BWLmib9+esfQ10pEsL0Of3tJ/DhSlmySM9tX Xb4SWt6tWkwG/nkc9gj40iLo1CGxSIULqqBm3yVzRUYRrTt8xpSW+lRiWn4HwyeSdTry8i hseiW/Og+osJrVtROqQMrlnX3AxFmpeiF9ZLVlUCn0W1wku1Pch+XOpQ6iFKzBiD5urQZH euplXHBetCeZ6CeLGtEZYJqEcqPrLsZ5ntEUY8Hsm+3M7LZWpi1M6QUKQsx7Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752750077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9mky5we0fgRdzpuqUyZ3/cbUOU/7mO6l9M+AVxXaVTc=; b=OhYNksY41HFkDoBNIM4bTACP+W4tX0aPNclZTdOUOsLdJMlKN7SvHILfcPgq19tN+YIoPm f9+gNFvvcwhQI7HvESJddZiPPBmG7Nf/qEEsHaGMwOqOf/Yem60PfzR7MzIkvjUeEXFlBj Upl41St0nzsS/sbz5ca/T9Dezmrws5X05kYMdLEZ3NJ/kbtwjbvgCjVtAjDIV1qeOu1ya1 s9+cQ7sWTuMnuSKoEeiyWVQJ/hGM5KEeB5oCrhyhbBNw2K7Vz/2ZPH53QPKNsPRuc2EzSy Mv/GKnQSjgFM0OUtf3PRFzpCOYlf19GHihysk0WuCa3rP/UW5mlHFj6trUmBlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752750077; a=rsa-sha256; cv=none; b=srb8DbpX7g15wMrp0k9FI6zTArxb6SHPwr+Aszg7PQIrHiCHd82oYdcNH79dQZwYv7i26i X6oZ2NTBUCNusjDnQNB1NiwAZRjMMqixL2SMnLZBwEVq2ZLT76+Xc13gGXEJLyN9PBDSr5 8Ga8iy1+WQ+jMCqZ8MXHY0Kb32hgfXmNxRa1ncj5jfdfB9oT4oYIOs9RHgLsPlASPzv68N vKRA23UppdstcGLu8dABEau2Gwp21gKRMmS8jMYevwxOWAmQw0MZJQWZM6sbYhfEfntLn6 6N5uDVPvzY7UaTt6wr5/Lrl3Qi3cHCB0oMYKi8uiQ4W+76gBQr/yykKLOYaLig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjVNF5pTWzsgG; Thu, 17 Jul 2025 11:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HB1HFs065920; Thu, 17 Jul 2025 11:01:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HB1HB0065917; Thu, 17 Jul 2025 11:01:17 GMT (envelope-from git) Date: Thu, 17 Jul 2025 11:01:17 GMT Message-Id: <202507171101.56HB1HB0065917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 39598c2a9f5d - main - ipsec offload: ipsec_accel_fill_xh() should indirect through fn pointer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39598c2a9f5d074b1365e5ba97441fb5b4f8476b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=39598c2a9f5d074b1365e5ba97441fb5b4f8476b commit 39598c2a9f5d074b1365e5ba97441fb5b4f8476b Author: Konstantin Belousov AuthorDate: 2025-07-17 10:57:35 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-17 10:57:35 +0000 ipsec offload: ipsec_accel_fill_xh() should indirect through fn pointer The config with IPSEC_SUPPORT + IPSEC_OFFLOAD is the valid one. Fixes: 5be5a0bde5f990dbc680272eee74132bcde815f2 Sponsored by: Nvidia networking --- sys/netipsec/ipsec_offload.c | 8 ++++++-- sys/netipsec/ipsec_offload.h | 16 +++++++++++++--- sys/netipsec/key.c | 2 ++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index a2092c91c1aa..8a09d5f37b4a 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -160,6 +160,8 @@ static void ipsec_accel_drv_sa_lifetime_update_impl(struct secasvar *sav, static int ipsec_accel_drv_sa_lifetime_fetch_impl(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs); static void ipsec_accel_ifdetach_event(void *arg, struct ifnet *ifp); +static bool ipsec_accel_fill_xh_impl(if_t ifp, uint32_t drv_spi, + struct xform_history *xh); static void ipsec_accel_init(void *arg) @@ -186,6 +188,7 @@ ipsec_accel_init(void *arg) ipsec_accel_drv_sa_lifetime_update_impl; ipsec_accel_drv_sa_lifetime_fetch_p = ipsec_accel_drv_sa_lifetime_fetch_impl; + ipsec_accel_fill_xh_p = ipsec_accel_fill_xh_impl; pctrie_init(&drv_spi_pctrie); ipsec_accel_ifdetach_event_tag = EVENTHANDLER_REGISTER( ifnet_departure_event, ipsec_accel_ifdetach_event, NULL, @@ -210,6 +213,7 @@ ipsec_accel_fini(void *arg) ipsec_accel_on_ifdown_p = NULL; ipsec_accel_drv_sa_lifetime_update_p = NULL; ipsec_accel_drv_sa_lifetime_fetch_p = NULL; + ipsec_accel_fill_xh_p = NULL; ipsec_accel_sync_imp(); clean_unrhdr(drv_spi_unr); /* avoid panic, should go later */ clear_unrhdr(drv_spi_unr); @@ -1167,8 +1171,8 @@ ipsec_accel_key_setaccelif_impl(struct secasvar *sav) return (m); } -bool -ipsec_accel_fill_xh(if_t ifp, uint32_t drv_spi, struct xform_history *xh) +static bool +ipsec_accel_fill_xh_impl(if_t ifp, uint32_t drv_spi, struct xform_history *xh) { struct ifp_handle_sav *i; diff --git a/sys/netipsec/ipsec_offload.h b/sys/netipsec/ipsec_offload.h index fb8cd7438598..ae60eaa8ae78 100644 --- a/sys/netipsec/ipsec_offload.h +++ b/sys/netipsec/ipsec_offload.h @@ -68,6 +68,8 @@ extern void (*ipsec_accel_drv_sa_lifetime_update_p)(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t octets, uint64_t allocs); extern int (*ipsec_accel_drv_sa_lifetime_fetch_p)(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs); +extern bool (*ipsec_accel_fill_xh_p)(if_t ifp, uint32_t drv_spi, + struct xform_history *xh); #ifdef IPSEC_OFFLOAD /* @@ -160,6 +162,16 @@ ipsec_accel_key_setaccelif(struct secasvar *sav) return (NULL); } +static inline bool +ipsec_accel_fill_xh(if_t ifp, uint32_t drv_spi, struct xform_history *xh) +{ + bool (*p)(if_t ifp, uint32_t drv_spi, struct xform_history *xh); + + p = atomic_load_ptr(&ipsec_accel_fill_xh_p); + if (p != NULL) + return (p(ifp, drv_spi, xh)); + return (false); +} #else #define ipsec_accel_sa_newkey(a) @@ -170,6 +182,7 @@ ipsec_accel_key_setaccelif(struct secasvar *sav) #define ipsec_accel_sync() #define ipsec_accel_is_accel_sav(a) #define ipsec_accel_key_setaccelif(a) +#define ipsec_accel_fill_xh(a, b, c) (false) #endif void ipsec_accel_forget_sav_impl(struct secasvar *sav); @@ -183,8 +196,6 @@ bool ipsec_accel_output(struct ifnet *ifp, struct mbuf *m, int mtu, int *hwassist); void ipsec_accel_forget_sav(struct secasvar *sav); struct xform_history; -bool ipsec_accel_fill_xh(if_t ifp, uint32_t drv_spi, - struct xform_history *xh); #else #define ipsec_accel_input(a, b, c) (ENXIO) #define ipsec_accel_output(a, b, c, d, e, f, g, h) ({ \ @@ -192,7 +203,6 @@ bool ipsec_accel_fill_xh(if_t ifp, uint32_t drv_spi, false; \ }) #define ipsec_accel_forget_sav(a) -#define ipsec_accel_fill_xh(a, b, c) (false) #endif struct ipsec_accel_in_tag *ipsec_accel_input_tag_lookup(const struct mbuf *); diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index ae67d83c6d13..4ba1b49c24f0 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -114,6 +114,8 @@ void (*ipsec_accel_drv_sa_lifetime_update_p)(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t octets, uint64_t allocs); int (*ipsec_accel_drv_sa_lifetime_fetch_p)(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs); +bool (*ipsec_accel_fill_xh_p)(if_t ifp, uint32_t drv_spi, + struct xform_history *xh); #endif #define FULLMASK 0xff From nobody Thu Jul 17 13:19:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjYS84mMSz61lRj; Thu, 17 Jul 2025 13:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjYS80L8hz4KKR; Thu, 17 Jul 2025 13:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752758392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gb6AZMLOdoPpOLpdumt0ggvRHvUdVIcNSKoPK1AigAo=; b=WbKFd+tEebOOc+Fc36rH90yaG3yg6Zs+q0VrcIZxcEafJnYy8lGOt/691ozE/IeQ2AXXUR JeKdAyWw2Ihy0+AhFTAeH93Acre1ZIITexUWCm0lWCU297QCzsgyVgr86vJSjaXdnZaTJO Rb8eLSnLvKhhEtmb4RvQ2yP/KsIf/4WuTDDW/jbm6Ir6Wg8DVCoM7qaIfwZIX1ASoLg0Bs gycRLQZCZ28zOI3wykBYaHV2qY5bVFX+kACJAgfJog0J3fslLZMojHJcl6HuiO/0+NLaTr 0FKagiQgILjABPEf2QDPH8vk/xymoEww148xIweMrxjZWc8mdSdG3q63JDZcjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752758392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gb6AZMLOdoPpOLpdumt0ggvRHvUdVIcNSKoPK1AigAo=; b=sa9mtLTOXjagbrueYTwiMznDpIUJC2MxIvdNJDVUM+Q1J+zFFzbzFlyU18ZeniNGRKyL+7 mb4buzSx7KVCGz1s6QztAYX7qo9o13hZNRX6d0A3/nRqkXk3iYXYfj4X0c2uQ/O1D/48gh AuCgXEvd2XABYOkFFdxPpr0XBBf3V1hn4RSuLeGVg4z6Yk6zzo/1PMb0YVi5bUl67a1M5R pw8RR/xvNHm8p9z8JMzmJbfxYOM3VmsQ59nRgUzOKIZKLAgZR1F2nAx/poZwZN5JPvltDH G4L32pj/R2w8UlLHcrnhse5r730EuptJTQeEJFUE2/Yv1i6A4+hIyw73snPXSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752758392; a=rsa-sha256; cv=none; b=FtRqsaXu7oU+rZ62IFZPlUYIxPXtUR16Mwk/z8gqHp4JMtpfVSZ+LrcKaJ+51EZqA3goaQ Pgk+3NAprnQxkOqhAT/Arlu1kPdcF1zL4JguhzX4MhZmXO7qN0FUohBRheBQBlxUxZbwvS i9dFk6H5owcbJJMEYlv2ecbAirvCo7IXmGFJycoLH44NpIlRCTFl3t5AUhYaodeePfGzeQ FGu1L1omiO18Y2lt122N+qxu1LE7sg/L/cWuJK4bOuvhCV5dwbveqLJbm8gYX/Uk1LK/qb 4/fbExFEOwEY7Y3kaRNsh4w9KDjLXgrgFnk9LyEGYz8BpHqqi7XUml9xLIkpVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjYS75yfWzwqp; Thu, 17 Jul 2025 13:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HDJprE018758; Thu, 17 Jul 2025 13:19:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HDJp6d018755; Thu, 17 Jul 2025 13:19:51 GMT (envelope-from git) Date: Thu, 17 Jul 2025 13:19:51 GMT Message-Id: <202507171319.56HDJp6d018755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 131c91bd4567 - main - amd64: Remove some unused SMP-only defines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 131c91bd456708d5cb9e574ba8b4f01871df8672 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=131c91bd456708d5cb9e574ba8b4f01871df8672 commit 131c91bd456708d5cb9e574ba8b4f01871df8672 Author: Mark Johnston AuthorDate: 2025-07-17 13:19:28 +0000 Commit: Mark Johnston CommitDate: 2025-07-17 13:19:28 +0000 amd64: Remove some unused SMP-only defines No functional change intended. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51350 --- sys/amd64/amd64/apic_vector.S | 6 ------ sys/amd64/vmm/intel/vmx_support.S | 6 ------ 2 files changed, 12 deletions(-) diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S index 6e51ebff298a..5bb877a174f7 100644 --- a/sys/amd64/amd64/apic_vector.S +++ b/sys/amd64/amd64/apic_vector.S @@ -49,12 +49,6 @@ #include #include -#ifdef SMP -#define LK lock ; -#else -#define LK -#endif - .text SUPERALIGN_TEXT /* End Of Interrupt to APIC */ diff --git a/sys/amd64/vmm/intel/vmx_support.S b/sys/amd64/vmm/intel/vmx_support.S index f393f160b101..130130b64541 100644 --- a/sys/amd64/vmm/intel/vmx_support.S +++ b/sys/amd64/vmm/intel/vmx_support.S @@ -32,12 +32,6 @@ #include "vmx_assym.h" -#ifdef SMP -#define LK lock ; -#else -#define LK -#endif - /* Be friendly to DTrace FBT's prologue/epilogue pattern matching */ #define VENTER push %rbp ; mov %rsp,%rbp #define VLEAVE pop %rbp From nobody Thu Jul 17 15:59:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjczv6YLcz61wSW; Thu, 17 Jul 2025 15:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjczv5pSbz3bgj; Thu, 17 Jul 2025 15:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752767947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iwvTClAg4DoxaC3IrXjtjN7k9pLdAcW2gfOHaKn9v48=; b=HKnQSDijXBMWyRVDuX/Nw4qfybxuUFIuHKhAS8ckM0F+eKyVF42rYLogR4IgRFHmfaSmO3 ykdiBIehh5ylGSZLLNQ55rOYG7tkn4hMh75aygkaAZV+0b7miE3QScNqDm+dONvvdg1g1Q fSiqmBBfVolH2YCeDXmGDyRB+GXEpP4N9WTFuRqY//6dTHCFHrdxXPorkvNrloQMYC2W1S hfOWL0CVc6iWed11XH3/OzsQ/Ag11AeF24qvlsgXiVbosITD2evg4sKsZGSxlZn3IpcqIY RV1RTUJ28aww2esU7ADZgAdPShB8nwsYG6Rp0u5CXzUnmiWqxOG9BBLQwInVMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752767947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iwvTClAg4DoxaC3IrXjtjN7k9pLdAcW2gfOHaKn9v48=; b=w3BcLu0bWgGg2NMnurWt4s4o5uPhlK4deklP2eItBiJ7HNnwKNoCgdNRTJ+gLJmrD3Kn2X JyVNYj0id2MhHVgOkQLrDVokm6zL+PkOd4o0+46FzlEPLUaQOxncgKKa5GtbSykBvZOex0 lOJnXePDKUyHE9LTJ7UFTIoYyMd3OBprHk36ilTa+66QMC92jcLgRh/LJ3Ikpic6W+henZ o+mmpF1bI1tU5W4St03cwaOfUseePXOVBmZ9iLUNShOlO+bmY8th5ENlf37052wiTQMbzC fY9AskbwAzOU69qYY1Mol01PsKe3spo/VUNEonYuYwZHlMBUkxYoT4/X01SiBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752767947; a=rsa-sha256; cv=none; b=xNbltsnUR34bHayCVTA7BnT7mT8rorEdwpv6taQqJ4Nj9oRhBhTpKbA5vGKERu3HIBxNze 7XH/iy5r6Gt937p9FLEK/KPNHTkK+7imBzJ0wP2kx82aMtDCAtTxmlit7LZMgtTjOW5oz5 MBTEcVKFrxYHEd6bPVrRur3bZgzrOEY/49zT4wd8ZYZ2C0ayLdWSDeC3izlSoVLxVSLry5 8DSIrcwjHtt61k2hEiercqH1vvPExqtBUBcW1LEpV4sjJEconfwichlI3iJIYqBLOgHRni hf+qwIJTgMXq2yWofgqgsJ4Yhfw/51vg1AOoZ57xvtNqn9GA9zrhYU6ujG/yyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjczv5BmQz12FX; Thu, 17 Jul 2025 15:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HFx70X018584; Thu, 17 Jul 2025 15:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HFx79S018581; Thu, 17 Jul 2025 15:59:07 GMT (envelope-from git) Date: Thu, 17 Jul 2025 15:59:07 GMT Message-Id: <202507171559.56HFx79S018581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d4f042f094ec - main - libbsnmp: fix local client socket creation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4f042f094ec31447f127d6c4e15a8366dd32725 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d4f042f094ec31447f127d6c4e15a8366dd32725 commit d4f042f094ec31447f127d6c4e15a8366dd32725 Author: Gleb Smirnoff AuthorDate: 2025-07-17 15:57:56 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-17 15:57:56 +0000 libbsnmp: fix local client socket creation Revert "bsnmp: Use mkstemp when creating clients local socket" The use of mktemp() was intentional here. We don't want a regular file to be created. If created, it guarantees that following bind(2) would always fail with EADDRINUSE and thus open_client_local() always fails. This reverts commit 81e0e7b9e36d6a25b3af6482811318e085537d2f. Reviewed by: rew, harti Differential Revision: https://reviews.freebsd.org/D51031 --- contrib/bsnmp/lib/snmpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index b312a37ed3ed..a7556527ad51 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -1012,7 +1012,7 @@ open_client_local(const char *path) snprintf(snmp_client.local_path, sizeof(snmp_client.local_path), "%s", SNMP_LOCAL_PATH); - if (mkstemp(snmp_client.local_path) == -1) { + if (mktemp(snmp_client.local_path) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); (void)close(snmp_client.fd); snmp_client.fd = -1; From nobody Thu Jul 17 16:01:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjd2z6nBTz61x0h; Thu, 17 Jul 2025 16:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjd2z0LSkz3dCL; Thu, 17 Jul 2025 16:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CiNdDBpUIt8WsgdLRgmvhcEFljtFNvjQgWcrY6iiA4o=; b=W9FLR7uuQT/LutaTIFsh7MIV8G+29kwbPbrMZ7Qjhgu14CLY7MgulhZ+E3l3UXd7OYtH6k Aan4EpHmg61tnWSFaE5mbOdRtvydrOqrrhnOyRplQndcLFR6p2bEmL/amPRhun9xYmx1W7 m6hQAhKxnM2WFsY3/Jwt+Ai2pfWPfnTVmiIB8KsjgKAP6+RP0NvLTTjbaz+/6KUoSJa3OO OemNdi+RkpNstYDKmUlg8LSJ0IDnaJ7Bkx47/LHdYqSF1iuUFWx8LqBiVuDIzqA6FA8t7O SDcJ5s/dkqiGtsOfcI/GnXZHbfTRGw4rocAf2nT/QPmlppwGfkdo74SY21a6QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CiNdDBpUIt8WsgdLRgmvhcEFljtFNvjQgWcrY6iiA4o=; b=VV95JNmJ+uC833ID6TSaARd0GeIUK0gFc40XII09ZladBloKcReif3TccDuSX+FPGFE1Qj NZEU6h1WyGx/LKy+qGMVnu05AaevT21AyxZPMfNRuwlzzcwcdZUpVxgA83Hpya6EJIa6Us S/50QW7z7PSu/ehBitHCsBOxM2TesPLpUmlme34it5NoX9o4G1W2AQO/rSdm+nj19t0P3F /OEe0RmjZWv6PTswHmLHKFAXlKIE9HUZzSUe4mNCCAhvmSBZn5ZKxCy7rBHcL522xDcf5L OEDaeNizTKu2TRst6yc0M0o3/l1suloY9TFNbZGxa0zlryw+YCBoIHdSncN41g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752768107; a=rsa-sha256; cv=none; b=UQD+Xhhtb+WzOUZCp97bc0ec302AkJU0xoJp/EdtVb5IsVwDAe/e775eLVtjE6bgLpKaPo QEzNsOJk8AS1xwI+BlfiawfWwqO277CQ+2uBlad7SlGzU5zDGypRIzDIoOIDc4cyR9R5bK Ul5SUAXilvE1sZw6yki9SJ4T58ROSPyMwV28cNxiTr3P94zVU8H6YZxD0IPDXnXaQY9nX1 oB4/7K2BpfJ0gfV4GdlpJcs9MU4YuhzF2s9M/9unw/cHtHQ0Wgtu/At0V6UhXcCQ7leIX6 AxSmOdx3XyQW3vB2FH246bsFNAHowYsWPwmTRFTPzp2sMfkMZqoQnRA6km16VA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjd2y6b8kz12Fs; Thu, 17 Jul 2025 16:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HG1kNl032775; Thu, 17 Jul 2025 16:01:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HG1kAj032772; Thu, 17 Jul 2025 16:01:46 GMT (envelope-from git) Date: Thu, 17 Jul 2025 16:01:46 GMT Message-Id: <202507171601.56HG1kAj032772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 665877ced9ea - main - libbsnmp: define SNMP_DEFAULT_LOCAL that matches default server config List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 665877ced9ea53f838f80176739a8621a61d40c6 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=665877ced9ea53f838f80176739a8621a61d40c6 commit 665877ced9ea53f838f80176739a8621a61d40c6 Author: Gleb Smirnoff AuthorDate: 2025-07-17 15:59:44 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-17 15:59:44 +0000 libbsnmp: define SNMP_DEFAULT_LOCAL that matches default server config The default /etc/snmpd.config we install for decades has: begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1 begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4 However, libbsnmp internally used DEFAULT_LOCAL set to "/var/run/snmp.sock" (note missing "d") to fill server pathname in case if API user didn't provide one. This results with default server config never working with an application that uses default initializer. The libbsnmptools has a workaround for that, it defines internally SNMP_DEFAULT_LOCAL that matches /etc/snmpd.config. Bring this all to an order: - Make a public define SNMP_DEFAULT_LOCAL in libbsnmp. - Point it to what /etc/snmpd.config has in. - Remove workaround from libbsnmptools. Reviewed by: harti Differential Revision: https://reviews.freebsd.org/D51071 --- contrib/bsnmp/lib/snmpclient.c | 10 ++-------- contrib/bsnmp/lib/snmpclient.h | 1 + contrib/bsnmp/lib/snmppriv.h | 1 - usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 9 --------- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h | 1 - 5 files changed, 3 insertions(+), 19 deletions(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index a7556527ad51..d5d4af998a0c 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -981,14 +981,8 @@ open_client_local(const char *path) char *ptr; int stype; - if (snmp_client.chost == NULL) { - if ((snmp_client.chost = malloc(1 + sizeof(DEFAULT_LOCAL))) - == NULL) { - seterr(&snmp_client, "%s", strerror(errno)); - return (-1); - } - strcpy(snmp_client.chost, DEFAULT_LOCAL); - } + if (snmp_client.chost == NULL && path == NULL) + path = SNMP_DEFAULT_LOCAL; if (path != NULL) { if ((ptr = malloc(1 + strlen(path))) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); diff --git a/contrib/bsnmp/lib/snmpclient.h b/contrib/bsnmp/lib/snmpclient.h index a19bdb2ea653..662dc7c4a204 100644 --- a/contrib/bsnmp/lib/snmpclient.h +++ b/contrib/bsnmp/lib/snmpclient.h @@ -40,6 +40,7 @@ #define SNMP_STRERROR_LEN 200 +#define SNMP_DEFAULT_LOCAL "/var/run/snmpd.sock" #define SNMP_LOCAL_PATH "/tmp/snmpXXXXXXXXXXXXXX" diff --git a/contrib/bsnmp/lib/snmppriv.h b/contrib/bsnmp/lib/snmppriv.h index 5b66992ca985..6ed51cf39369 100644 --- a/contrib/bsnmp/lib/snmppriv.h +++ b/contrib/bsnmp/lib/snmppriv.h @@ -44,4 +44,3 @@ enum snmp_code snmp_pdu_decrypt(const struct snmp_pdu *); #define DEFAULT_HOST "localhost" #define DEFAULT_PORT "snmp" -#define DEFAULT_LOCAL "/var/run/snmp.sock" diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index fb09e1ac785e..b4613763fff5 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -790,15 +790,6 @@ parse_server(char *opt_arg) if (snmp_parse_server(&snmp_client, opt_arg) < 0) return (-1); - if (snmp_client.trans > SNMP_TRANS_UDP && snmp_client.chost == NULL) { - if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL) + 1)) - == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); - return (-1); - } - strcpy(snmp_client.chost, SNMP_DEFAULT_LOCAL); - } - return (2); } diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h index 2874f311fbd0..54a087491a4f 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h @@ -43,7 +43,6 @@ #define MAX_BUFF_SIZE (ASN_MAXOCTETSTRING + 50) #define SNMP_DEFS_DIR "/usr/share/snmp/defs/" -#define SNMP_DEFAULT_LOCAL "/var/run/snmpd.sock" #define SNMP_MAX_REPETITIONS 10 From nobody Thu Jul 17 16:01:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjd302x2bz61wd4; Thu, 17 Jul 2025 16:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjd3015Smz3d46; Thu, 17 Jul 2025 16:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvV+9lUei/mNOIDdL3PdlLqM/fewpy48YTx1bUPamBE=; b=vzHWqDzcXW5BfgaXZG9x+gGJ16fbtojIZvL0ovWPV8JUPXvJbbTiHkLahzHxXhEDn2ExLH 1tOopyeOicsEKYw8S/KuwnDpbzjTgKGlpLnIQcvb9ACazexPbdy8BofnPgeNWzAg8WK8kJ AKRbjBPIg25cL0pr3EIxeosVt4ksB4uxSLaMlZajNCVxpsYFjh3a0gckH1tSFdw3DH1+sB Atmsj7gRBZKLWtNmT80IhC+LMaMl9Q35oV/RpO848XT7sh0lDmGPsSDYWb8wfoaLaXbzkf K44hdnAHpAqCu8XCbcfgQ56zgu66hhsDZAGxkdqpVFl+6HOY8NeVq4tQX6ZgLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvV+9lUei/mNOIDdL3PdlLqM/fewpy48YTx1bUPamBE=; b=Ll+IWw8sjkPp2z4sGO5/1V/QNT+Ee8U/ugxvl/1IROZc+9Vf/PhgPtGTmlslalj7JxQZaz GCMJeNMDOf1xsktcrTMUHOFuehz1VYph6B5BPXkmMcvMBzZnvhA2+LNoAlpoNogHKlj26S /GCqaaQujQSvIBdmE867cWqFFnwKoWcYVwoQ6CfI1FtEU8QEtsjXgs/jcS10SnGv92LR2T YL+R6jAS7XR3TiPow/OYCMqkEZHlb9D/c+Q00+vIADONNWzXp2AHP8d2Xgu0P3X8GqZ8F+ pa130lPD/UzK49wrG/eKZMlI9I/RvDdCIvAEXYuXSoCcDmc5s0jqClyji6Px3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752768108; a=rsa-sha256; cv=none; b=Yo8VTyOCzYNnAVcAnxuwHVd0osV3Trn4OC5gd1ChE3UW5bbG03cs+5ZvJS1zsb16176QDB YNuE6c2DJ3saJU7+5uk17s3ISYUC7T2kSJmGURlj1lsX3mvjdyCn/cArKe2GGXa1PT2w85 7+40NIregWMF7eqXLmpq3BsbMAMlZ+Y/EBDJPDV8FppnQWm2m6qgGx4p/Smxe9WHRzQKTZ nSapNtgZCXubfaeHoxuKiGg/Yeuy8txImeBB28s42MX1rDyoVjjVQ1mfOnYfse2qKQbfFF 5qb/oKsb6yTf4X5Qc997IADT7ukn0mO+C/YwYJEnBSRZOt78ayqoAWTveENjOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjd300RPlz12Wr; Thu, 17 Jul 2025 16:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HG1lrm032808; Thu, 17 Jul 2025 16:01:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HG1lko032805; Thu, 17 Jul 2025 16:01:47 GMT (envelope-from git) Date: Thu, 17 Jul 2025 16:01:47 GMT Message-Id: <202507171601.56HG1lko032805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 44836e3277af - main - bsnmpget: print SNMP library reported error on failures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44836e3277af1f272a409b8d5806c67a9dbb9cb0 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=44836e3277af1f272a409b8d5806c67a9dbb9cb0 commit 44836e3277af1f272a409b8d5806c67a9dbb9cb0 Author: Gleb Smirnoff AuthorDate: 2025-07-17 16:00:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-17 16:00:15 +0000 bsnmpget: print SNMP library reported error on failures Reviewed by: syrinx, harti Differential Revision: https://reviews.freebsd.org/D51073 --- usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c index 9d5a693c7c68..9252e63749bb 100644 --- a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c +++ b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c @@ -1179,8 +1179,10 @@ main(int argc, char ** argv) /* On -h (help) exit without error. */ if (opt_num == -2) exit(0); - else + else { + fprintf(stderr, "Error: %s\n", snmp_client.error); exit(1); + } } oid_cnt = argc - opt_num - 1; @@ -1239,7 +1241,7 @@ main(int argc, char ** argv) } if (snmp_open(NULL, NULL, NULL, NULL)) { - warn("Failed to open snmp session"); + fprintf(stderr, "snmp_open(3): %s\n", snmp_client.error); snmp_tool_freeall(&snmptoolctx); exit(1); } From nobody Thu Jul 17 16:01:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjd3208y4z61x0l; Thu, 17 Jul 2025 16:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjd313dQSz3dJ8; Thu, 17 Jul 2025 16:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qaSICQ2ZyFDzuKKuSFWrOu2/s9+5mmbY6qbYH5Eqh2A=; b=UCl7PI7GwnNr2P/Fv4aEflBt0BFTkryHb9lXfltwo2eYQAe9aPIQ+2pKaJbKA+iGq7v5V1 /z+K5qamovRu331+jfullTJH+Z7Er5m9g3QV5EwEgl9KTL/lF+QQS104TF1RPbuRM87Dmd 5nGpHulV39hMSCTuzfFmdAil6TeS4JEqPrnG9tBXxg38Fv9uoQdnANCDhiBBoMHZXh8cGC BViA5Mpc6m9dE6Zi0ufzHQwtpNuTJM19lGeYB80tbUQF7PGNpm+XIkJ6yIwj8n8BduQoWO u5wc4/dl4lI88mpqdGYsINb6eXDG35oizMtdUOLf+rBDF49x6VussSrsMe3hRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qaSICQ2ZyFDzuKKuSFWrOu2/s9+5mmbY6qbYH5Eqh2A=; b=YJyP8KVLoVQh4pVQ8wr23yMyp9XuTIGT6mQnWkLVi6mYKRv3YbtjwCya3grt3rdbdfZsty G99jWjI4awuU46IuXFgGq8H66590cdj5bc31UIupxwObEeAFMu9Lm5Q2JHZK0PzpK1LgTj QaNTa7FmraPCekkRDWlgeyjY8pelz/OUIhWEwhz5HUuYMMELwZ2IG1no8rp5ArVrypuG7k DcVNxFkYcFXn+8aJ9q5RaVsrkc17J9wFh3XyhcZJU66vgaMytQjN52At8bQIYdZIpw9gmq Nx4ph9d+qfPiX51UWUa64X4JAI3VZx9F1IXQdIUH7ynOff+RSZyB+7QHiSAnIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752768109; a=rsa-sha256; cv=none; b=IS5q9qVVH9wEXEuYvnMUx9q6kpm0VtYMX9qrTKPm6XJRRqlwuk7Qg9P6pfqs8yYD/KFpgm /irFq0a7vYOzlGYzWb901cmxxR12vBoj622GA92fXrl0PdyZGn1Q3JRM4Cg46IX550wITy UI9EYmIozwBQxzu+6uwz9FV6y2coEbhYZ1/GN49/5Cte/TNTzGCOzdmm/CSCd1atgR3bkF i70083a/rqyNQXCczMZ7TV60cqB9AP4WDf4hhmVe+BJNSfo0Zfr0gmyl/kR2UXeFtaEajb uJDdEHdL650JlLmJfAVOI/DqFqcDbGwStdOG+h8Jh8KHhZOjhHM2RxXpk4p5wQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjd311TVRz12Lq; Thu, 17 Jul 2025 16:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HG1nXk032842; Thu, 17 Jul 2025 16:01:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HG1n2M032839; Thu, 17 Jul 2025 16:01:49 GMT (envelope-from git) Date: Thu, 17 Jul 2025 16:01:49 GMT Message-Id: <202507171601.56HG1n2M032839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9b588ef15f47 - main - bsnmpd: use MSG_NOSIGNAL when doing send(2) on a local socket List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b588ef15f47900ff77419eaf2817ce62fb58a14 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9b588ef15f47900ff77419eaf2817ce62fb58a14 commit 9b588ef15f47900ff77419eaf2817ce62fb58a14 Author: Gleb Smirnoff AuthorDate: 2025-07-17 16:00:26 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-17 16:00:26 +0000 bsnmpd: use MSG_NOSIGNAL when doing send(2) on a local socket Otherwise in unix/stream mode a disconnected client will crash the server. Reviewed by: harti Differential Revision: https://reviews.freebsd.org/D51355 --- contrib/bsnmp/snmpd/trans_lsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/snmpd/trans_lsock.c b/contrib/bsnmp/snmpd/trans_lsock.c index fa3bd34d14f0..ca2311be7cc3 100644 --- a/contrib/bsnmp/snmpd/trans_lsock.c +++ b/contrib/bsnmp/snmpd/trans_lsock.c @@ -417,7 +417,7 @@ lsock_send(struct tport *tp, const u_char *buf, size_t len, } } - return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); + return (sendto(peer->input.fd, buf, len, MSG_NOSIGNAL, addr, addrlen)); } static void From nobody Thu Jul 17 16:01:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjd326ryHz61wfq; Thu, 17 Jul 2025 16:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjd322s6kz3d4Q; Thu, 17 Jul 2025 16:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lyfDX6abtDoBqEI98UbcmwjovUMa/NKWiokjt4nvhsU=; b=eAEm/rubXoawgwDG7zBLwoOSq2sJlSNd0K8GIMuDbZkGC344uUc9Cq70ruScblVuCnSz80 pWMqbE6ChDhuWWRJ/PpUQhLkZf+h2/SGqOKMZYyzVpAmCaaOYP8BHt2Q9DpJ0kZWuK7pgv d5TRTjPtxWUVlR1UByockj1TFu3n7tfWGEORx9qJ7E8cBTt8V2nBMSe2munLExqKl5jKxQ RODFnce/IQM3vPPQONY6gs9Z5UAQPjjTmx3ahhYm8RrdHxA4xL+yBljvYB3nG4o3GQHYyn wqdGU+CfugfoiNyndbpvdqjIHFpS7Z2dCHxEMaR1qKj1vsZScPukZYowl3lV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lyfDX6abtDoBqEI98UbcmwjovUMa/NKWiokjt4nvhsU=; b=PAu7c1MKRQZlzM1nCnvd+SoqME5f4WNruL7N0eVDik8kVb4c9Hc5+Zd/57hdqQNpiC3I83 0CNSVo8qNffa5gqgUdNtNXv9ROrb2/UwOV+RhUMcZAjtgJGinchkkJjFc1sXR4MlvuYwc9 XE2IbaQSLEgWSF/vxStTxz8TqGKzDSQp9+T/Kx1rTBgra//Sv0s7z8Vs0GREkMutamoOS1 4498sSjaMMe7C1UlOkPfwyLNlKvfgvcECcYbUKVAkdndquIhC8UeTmJld/UzUTTgzk+yFL JxDfwO1iwsmHcaiEjO60flN2P1a3ivd8ozqScu/g0ia55Kp2R87lyBWOlTxpEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752768110; a=rsa-sha256; cv=none; b=NAQT/rxMnEGDDo+7ucJDGrSq24FTrtMoKAow0Ku6LJOWyqaiAPO1Sy3UHSJyBE9FcPiEE+ AgqH1u6VMzVfgbT9kbOZYUodqFAv1giXpk26XkLSNbSwuSV1UQdtMk80Ct3/nlnFx8h2fI yWyBmsPiSYJ35iziwEw9WZxLjlEDMAIaf6QWXaHbSIsDQmohbg9pXcKwbl7hmT+OTiCuXV Y60y+0LjrxaX4rmOQYSrGnab/Q889UfS5HdvHM/LH+8ETrU81mMFowtzlIgMKQVq2ly65x ZeJ6QUHE/Q9TUAeGcj++hgKMUKiu2WyTx/86JleWAvgu6VVNqDEVYVTEXvLaFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjd322KrBz129N; Thu, 17 Jul 2025 16:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HG1o6t032876; Thu, 17 Jul 2025 16:01:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HG1o1d032873; Thu, 17 Jul 2025 16:01:50 GMT (envelope-from git) Date: Thu, 17 Jul 2025 16:01:50 GMT Message-Id: <202507171601.56HG1o1d032873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3c29b47bbc0a - main - bsnmpd: in debugging mode (-d) use default library print/error functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c29b47bbc0a107c2bda0c103fc8c6de2cbddee8 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3c29b47bbc0a107c2bda0c103fc8c6de2cbddee8 commit 3c29b47bbc0a107c2bda0c103fc8c6de2cbddee8 Author: Gleb Smirnoff AuthorDate: 2025-07-17 16:00:44 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-17 16:00:44 +0000 bsnmpd: in debugging mode (-d) use default library print/error functions We want to see debugging on stderr in non-daemon mode, otherwise this mode has little value. Reviewed by: harti Differential Revision: https://reviews.freebsd.org/D51356 --- contrib/bsnmp/snmpd/main.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c index 928b84121f82..c77572934d24 100644 --- a/contrib/bsnmp/snmpd/main.c +++ b/contrib/bsnmp/snmpd/main.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -1509,7 +1510,7 @@ main(int argc, char *argv[]) { int opt; FILE *fp; - int background = 1; + bool background = true; struct tport *p; const char *prefix = "snmpd"; struct lmodule *m; @@ -1526,11 +1527,6 @@ main(int argc, char *argv[]) NULL }; - snmp_printf = snmp_printf_func; - snmp_error = snmp_error_func; - snmp_debug = snmp_debug_func; - asn_error = asn_error_func; - while ((opt = getopt(argc, argv, "c:dD:e:hI:l:m:p:")) != EOF) switch (opt) { @@ -1539,7 +1535,7 @@ main(int argc, char *argv[]) break; case 'd': - background = 0; + background = false; break; case 'D': @@ -1601,6 +1597,13 @@ main(int argc, char *argv[]) break; } + if (background) { + snmp_printf = snmp_printf_func; + snmp_error = snmp_error_func; + snmp_debug = snmp_debug_func; + asn_error = asn_error_func; + } + openlog(prefix, LOG_PID | (background ? 0 : LOG_PERROR), LOG_USER); setlogmask(LOG_UPTO(debug.logpri - 1)); From nobody Thu Jul 17 16:01:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjd34083Zz61wfr; Thu, 17 Jul 2025 16:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjd333SlCz3d78; Thu, 17 Jul 2025 16:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6RcydlyMVCfjIzLU0Vyi91fXKRBg3xYeeBH/6NQzysQ=; b=tAG6rjT1/PzuXqD124WcCGILOJsepVZEDjsCbrVURPdyoNHYnn/7JTCYjX5ZrpASjXZ0X5 sGBWgAJPtjBLPq5xCXOe9eHQo+kyLaAzZE9Niw9l1rHCVlyIE3JC1TBkhnVgInaQJkmwlu QZZt2OysylxATNvkKyP/NvUktLNyA9nNSfHJ7jt0pAqvCoKvSc/EpoXzSS1e7Tv62mDSKS 77Xm7IxI0vLCVgBdC15xrr/xEhXiloH+ownMHf/Jb/QASTZa2kYPvc3v31uwJ2TpilbX2P B9XhQ7aKy2z0oj7Mq8uNSrk3wJq4oaXMAdzWUd/M4FHJkHnnG75eodYPRUFt7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752768111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6RcydlyMVCfjIzLU0Vyi91fXKRBg3xYeeBH/6NQzysQ=; b=Dl6ouJ3Rmn/hHSvao0cTb4bbkwUkKfFtjXdQSPB9fovOg1fw2dbq3ULSnaoCIuA9UAVaXr QWwfnWUPg+3p4hc0+mUn9Vp0IWLBxGs7crx/pLTGqyPzO78eukI36M6X4qpGhIIJQjm+sN DE9LjZiBmB0xfOSvdeM/ObxNrAS1kWyBnrhfWXOejlecCOKb/jeHrurm22sa5uUN3P0CQD OvEta0GpgL8abmaUFACdZMu0J+Xs39BENZJh2mC08Wzd7p/zTI9Vw8UFa6Cw5wMfgAs6tO wpaZBf2Q9o7/hBHp94nnsC0n3mkd8VS9CDrUVwFkAmoQNCiZLqVIY56lufwO3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752768111; a=rsa-sha256; cv=none; b=omX3iL4FeEKdHkaTfkqld930BkfjWb97TX0uzWc9toqEbaqz4gt7Xr2fy1lsWAb0O4/p26 uqTHl2ylIUviFg3AccKche0doqr6Rry6/XwJZqw1V2nIKDfmCf7ZTzKR4BSCxXAKYbV/DD nf3HM3uZbUv7KsxBOUndWtvP2BRW47DCtKea0LT3v1kkZ/bT79lx6GHRy6qkzo7ACD1zej 4DkMvWRveVrLP4BW45QFnFrJn318sYX52/DywVawT33mbpcg8K43zJyv36VIkA27rFyoWz pMPu2HTuEz1+5Kg616b8ddzWzXUwpzd/UK+YqAEsX1ph9PLGhsQ/WQDyW8p1Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjd332jrHz12C0; Thu, 17 Jul 2025 16:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HG1p2u032916; Thu, 17 Jul 2025 16:01:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HG1pXt032913; Thu, 17 Jul 2025 16:01:51 GMT (envelope-from git) Date: Thu, 17 Jul 2025 16:01:51 GMT Message-Id: <202507171601.56HG1pXt032913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2181568715e8 - main - libbegemot: improve tracing prints List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2181568715e87f2ee434ba9c484dac43f19667ba Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2181568715e87f2ee434ba9c484dac43f19667ba commit 2181568715e87f2ee434ba9c484dac43f19667ba Author: Gleb Smirnoff AuthorDate: 2025-07-17 16:01:09 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-17 16:01:30 +0000 libbegemot: improve tracing prints Add newlines. Use __func__ instead of hardcoded name (fixes one case). While here, wrap lines according to style(9). Differential Revision: https://reviews.freebsd.org/D51357 --- contrib/libbegemot/rpoll.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/contrib/libbegemot/rpoll.c b/contrib/libbegemot/rpoll.c index c61b84057eba..f5ce43140205 100644 --- a/contrib/libbegemot/rpoll.c +++ b/contrib/libbegemot/rpoll.c @@ -285,8 +285,8 @@ poll_register(int fd, poll_f func, void *arg, int mask) poll_unblocksig(); if(rpoll_trace) - fprintf(stderr, "poll_register(%d, %p, %p, %#x)->%tu", - fd, (void *)func, (void *)arg, mask, p - regs); + fprintf(stderr, "%s(%d, %p, %p, %#x)->%tu\n", __func__, fd, + (void *)func, (void *)arg, mask, p - regs); return p - regs; } @@ -297,7 +297,7 @@ void poll_unregister(int handle) { if(rpoll_trace) - fprintf(stderr, "poll_unregister(%d)", handle); + fprintf(stderr, "%s(%d)\n", __func__, handle); poll_blocksig(); @@ -399,8 +399,8 @@ poll_start_utimer(unsigned long long usecs, int repeat, timer_f func, void *arg) resort = 1; if(rpoll_trace) - fprintf(stderr, "poll_start_utimer(%llu, %d, %p, %p)->%tu", - usecs, repeat, (void *)func, (void *)arg, p - tims); + fprintf(stderr, "%s(%llu, %d, %p, %p)->%tu\n", __func__, usecs, + repeat, (void *)func, (void *)arg, p - tims); return p - tims; } @@ -418,7 +418,7 @@ poll_stop_timer(int handle) u_int i; if(rpoll_trace) - fprintf(stderr, "poll_stop_timer(%d)", handle); + fprintf(stderr, "%s(%d)\n", __func__, handle); tims[handle].func = NULL; tims_used--; @@ -597,9 +597,10 @@ poll_dispatch(int wait) if(mask) { if(rpoll_trace) - fprintf(stderr, "poll_dispatch() -- " - "file %d/%d %x", - regs[idx].fd, idx, mask); + fprintf(stderr, + "%s() -- file %d/%d %x\n", + __func__, regs[idx].fd, + idx, mask); (*regs[idx].func)(regs[idx].fd, mask, regs[idx].arg); } } @@ -617,7 +618,8 @@ poll_dispatch(int wait) if(tims[tfd[i]].when > now) break; if(rpoll_trace) - fprintf(stderr, "rpoll_dispatch() -- timeout %d",tfd[i]); + fprintf(stderr, "%s() -- timeout %d\n", + __func__, tfd[i]); (*tims[tfd[i]].func)(tfd[i], tims[tfd[i]].arg); if(tfd[i] < 0) continue; From nobody Thu Jul 17 17:02:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjfP64Y3wz621Wc; Thu, 17 Jul 2025 17:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjfP63xb1z3F3d; Thu, 17 Jul 2025 17:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752771754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F/uBGa9XSnd5qbIzf8Y43RVQDSiydxw/LwiuOrHV0JY=; b=KyNj6rDKu9u/9gLJ0i+BAOi7zEpvdOVEHeKmsk0VzcvMXdYhO7mCYPQcfNSj/kg/Cs1ow5 AIqTvistIBwKKZyJaphygQiVzRBCh95Nrk0a9dAY6hvdMpCYDslbYea9spzLrD3jsutLKB Y3jgMiM5Cu9yF0TX3ii7ACfSpHTFGjc8TiiOiSlGX0SyNYUf+awOYEJ2ZmkkHk/umdreoS slH6jMsqNgstOHG/bsYRfRFwgnPuDyB2szULxN/Stu16SGiXIF5Gz/ppkjVoCCJXgXvcEr LosKEWVLVtunrJl1+P3QYQtfNANlaVHm6jR7x2sS/smfpvjL4+Y9DVi4TRtAsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752771754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F/uBGa9XSnd5qbIzf8Y43RVQDSiydxw/LwiuOrHV0JY=; b=btB55y+s1Sf8Yj/6W/zC1sGZWvi0pQAyZiGRvCivxHJs5SdyiEZi0X5Jbh2N+81oJ3WSnv 0NNZksAm4n/4oKPwkuZRQOQd8o9XrZrQQ5eHDXUZ+mlt5rAPDOu1wlbgNoUoP8Imy1OMyJ yglIFtfCPcrcCE1ceVfsx9ghpZe2E3BRAea3y1F/saGeJ1dqMEdcs1wV+Ufq7uS7z+In9n mkJAON0u0b5nu57fPgA7W1E6IfyvAM0XRyPp4zAF9f6q1QCi+ggVC/4cBE3NzspDymDQNC OMxu3EmNBv0XhNMcfosPe9+dGSy30Ucgrigdx2RNvWjNF53TR59+dgQY4mARXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752771754; a=rsa-sha256; cv=none; b=HBkpcbDSTxWh1InKdJ15S9RRuGW69nfQ7y5IXM/10OztMW2yRfE87pPI0kq7xZPiJz/r0N 64Ay1y979Zd1ZtDrNEhGRvreQbyb9b/TBq2Z9W/pSFpkKvN9oritzAsa1oTvhOGE4hl3IB LLLGO3FaHn2OJMqiEXxfckOTY7zdHfnbN0bghCJPOoNuamTtY49afcIuYrHbwSKnr1of4F DWChrXc1Yfk0kKGsZYNZFCW+Xy5iv1Ae/cR24ekboJUcF0Xbay2UvyRGXVntPfABPTG51i mZ4hypY1EbpGWnafhbGKCkb5n74I7fDD0O0qgVTp9kowl9fv9VRhsFapDyHbAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjfP634JCz13dw; Thu, 17 Jul 2025 17:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HH2YrA049527; Thu, 17 Jul 2025 17:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HH2YTp049523; Thu, 17 Jul 2025 17:02:34 GMT (envelope-from git) Date: Thu, 17 Jul 2025 17:02:34 GMT Message-Id: <202507171702.56HH2YTp049523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8768b60de16a - main - lib: Fix calls that naively set F_SETFD. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8768b60de16a3d72a8783ec1241a711a782a36a9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8768b60de16a3d72a8783ec1241a711a782a36a9 commit 8768b60de16a3d72a8783ec1241a711a782a36a9 Author: Ricardo Branco AuthorDate: 2025-07-14 20:10:38 +0000 Commit: Mark Johnston CommitDate: 2025-07-17 17:00:32 +0000 lib: Fix calls that naively set F_SETFD. With the recent inclusion of the FD_CLOFORK and FD_RESOLVE_BENEATH flags, we must avoid clearing them when setting only FD_CLOEXEC. Signed-off-by: Ricardo Branco Reviewed by: kib, markj MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/1766 --- lib/libc/gen/fdopendir.c | 10 +++++++++- lib/libc/stdio/fdopen.c | 18 ++++++++++++++---- lib/libc/stdio/freopen.c | 10 +++++++--- lib/libfetch/common.c | 7 +++++-- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/lib/libc/gen/fdopendir.c b/lib/libc/gen/fdopendir.c index df6709fbcb85..9393cbe28f85 100644 --- a/lib/libc/gen/fdopendir.c +++ b/lib/libc/gen/fdopendir.c @@ -48,8 +48,16 @@ DIR * fdopendir(int fd) { + int flags, rc; - if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) + flags = _fcntl(fd, F_GETFD, 0); + if (flags == -1) return (NULL); + + if ((flags & FD_CLOEXEC) == 0) { + rc = _fcntl(fd, F_SETFD, flags | FD_CLOEXEC); + if (rc == -1) + return (NULL); + } return (__opendir_common(fd, DTF_HIDEW | DTF_NODUP, true)); } diff --git a/lib/libc/stdio/fdopen.c b/lib/libc/stdio/fdopen.c index a0d7b71df782..49ec97eda39d 100644 --- a/lib/libc/stdio/fdopen.c +++ b/lib/libc/stdio/fdopen.c @@ -46,7 +46,7 @@ FILE * fdopen(int fd, const char *mode) { FILE *fp; - int flags, oflags, fdflags, tmp; + int flags, oflags, fdflags, rc, tmp; /* * File descriptors are a full int, but _file is only a short. @@ -76,9 +76,19 @@ fdopen(int fd, const char *mode) if ((fp = __sfp()) == NULL) return (NULL); - if ((oflags & O_CLOEXEC) && _fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { - fp->_flags = 0; - return (NULL); + if ((oflags & O_CLOEXEC) != 0) { + tmp = _fcntl(fd, F_GETFD, 0); + if (tmp == -1) { + fp->_flags = 0; + return (NULL); + } + if ((tmp & FD_CLOEXEC) == 0) { + rc = _fcntl(fd, F_SETFD, tmp | FD_CLOEXEC); + if (rc == -1) { + fp->_flags = 0; + return (NULL); + } + } } fp->_flags = flags; diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index f0732b6d6741..048fd30b3193 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -55,7 +55,7 @@ freopen(const char * __restrict file, const char * __restrict mode, FILE * __restrict fp) { int f; - int dflags, flags, isopen, oflags, sverrno, wantfd; + int dflags, fdflags, flags, isopen, oflags, sverrno, wantfd; if ((flags = __sflags(mode, &oflags)) == 0) { sverrno = errno; @@ -113,8 +113,12 @@ freopen(const char * __restrict file, const char * __restrict mode, (void) ftruncate(fp->_file, (off_t)0); if (!(oflags & O_APPEND)) (void) _sseek(fp, (fpos_t)0, SEEK_SET); - if (oflags & O_CLOEXEC) - (void) _fcntl(fp->_file, F_SETFD, FD_CLOEXEC); + if ((oflags & O_CLOEXEC) != 0) { + fdflags = _fcntl(fp->_file, F_GETFD, 0); + if (fdflags != -1 && (fdflags & FD_CLOEXEC) == 0) + (void) _fcntl(fp->_file, F_SETFD, + fdflags | FD_CLOEXEC); + } f = fp->_file; isopen = 0; wantfd = -1; diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 0d85ed468284..786d5647d993 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -277,13 +277,16 @@ conn_t * fetch_reopen(int sd) { conn_t *conn; + int flags; int opt = 1; /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); - fcntl(sd, F_SETFD, FD_CLOEXEC); - setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof opt); + flags = fcntl(sd, F_GETFD); + if (flags != -1 && (flags & FD_CLOEXEC) == 0) + (void)fcntl(sd, F_SETFD, flags | FD_CLOEXEC); + (void)setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt)); conn->sd = sd; ++conn->ref; return (conn); From nobody Thu Jul 17 17:17:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjfk34lpvz621vf; Thu, 17 Jul 2025 17:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjfk334jmz3Qgw; Thu, 17 Jul 2025 17:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752772635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1nsBLvJUXFiZATulOIiXK/3zwNUwOQ/GS9wQBFewRBk=; b=Ldgig+AD35h27MD+3+DJeVHMwwyOtWs5SnU3TP2p3C5RQVoZuENeFseSAQ5BbvVAwu/kv2 HXqAaXsiD7ayaKN1N5aI9jyeUd/cx+pnKPc4uUAmstg26azc8LpL2ZxdzSuWP0KAoi67ka 9Ng5avm541rPTAZ4nX1qoJSXz3zceqI/OYoGG6Tzc3YXOmr8pUgtzCYWwArd+eqnNM3Loh UOzi64K+5Z6s5UA5Ge7az9dR/Ah9quE9OaEC3F1M2LUjx06GY75xn5IaEtzZprr1Djzfro 4UkBYi7bKfkH6eEd0KoE75j4E5QOiguboYgZg+i97JJPc+X7x8nZ+J2tKUWigQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752772635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1nsBLvJUXFiZATulOIiXK/3zwNUwOQ/GS9wQBFewRBk=; b=j7XVkHSqW160dQusDKs0luEaKEyvgH+b6fYnuqGMo6NxKQgUCO0zNByYyjYW1IkSqj9vhF 7rDLXF0XJoSxabkycsXU/H5m3IRh7pefk/HeogTiJzylB6sVhdhNYLNrcLXF6gVcpHHZAM V/bCRDiRz9+zM1eBBjZ9zq7qGwJNMoH8DXakYF7CeoTIAaZ8ARDb9Io1943sIbdqqUuHDw vBBm1N0D/Sw4LTqn1mUrjvmHSbmc8Mo67/TCvkGGC+ilvwKmat4WUv+TGVRdXvLbWzBkKx NHsZi83lyAjLLQiH4qTGPsFtUiaCH3PgMq8I4j+trtwMefSsDhJS46UCaFotoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752772635; a=rsa-sha256; cv=none; b=Eod3kxzA4JvPE1Jk0N8vASJGxnJQkZ6/wVSls1h+xBg2r4knmjWzKzdhInmEv26vxpZPBo nZwxH0w7fUhctI/lleGQjnwHSIUQ7lIi53PrhswPIcq4ULBgHJPqwkE6urG/fSYkJKaY6x 6CRv2xdeOiI/uUvqd98gUE7px1+nUve7lEyWJ64FtBVE544aFSajMRDPXKKYLYw++ehqCm cHnBwYdNABQgdPswcbalchPd71aV5hO5atLrbhKmCiVdlODBRA7VcjJ/kIKE/HadRjEYzx 6WlLVC8ksLasstd7x3T/pAnfLjk//H8qN1CWfHPkENOQ0siak1UAjDajIOOvfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjfk32N6pz142w; Thu, 17 Jul 2025 17:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HHHFtU069336; Thu, 17 Jul 2025 17:17:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HHHFrJ069333; Thu, 17 Jul 2025 17:17:15 GMT (envelope-from git) Date: Thu, 17 Jul 2025 17:17:15 GMT Message-Id: <202507171717.56HHHFrJ069333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 97b61b22edba - main - route: fix `route -n monitor` when its output is redirected List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97b61b22edba74c62adba1d022fb73541aa5ff93 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=97b61b22edba74c62adba1d022fb73541aa5ff93 commit 97b61b22edba74c62adba1d022fb73541aa5ff93 Author: Oleg Streejak AuthorDate: 2025-07-17 17:06:50 +0000 Commit: Kyle Evans CommitDate: 2025-07-17 17:17:01 +0000 route: fix `route -n monitor` when its output is redirected This is a small oversight in the transition to netlink; the non-netlink implementation would explicitly flush its stdout as necessary to avoid apparent long stalls in output when we end up fully-buffered. Adjust the netlink implementation to do the same. This was noticed while trying to triage failures in the wg-quick script. Commit message by kevans, patch by author. PR: 278265 Fixes: 091fec1188929 ("route: switch transport protocol [...]") MFC after: 3 days --- sbin/route/route_netlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c index 631c2860b547..ba22a2ec1e22 100644 --- a/sbin/route/route_netlink.c +++ b/sbin/route/route_netlink.c @@ -738,6 +738,7 @@ print_nlmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct snl_msg_info *cinf print_nlmsg_generic(h, hdr, cinfo); } + fflush(stdout); snl_clear_lb(&h->ss_cmd); } From nobody Thu Jul 17 17:50:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjgSQ0Y5Cz623S0; Thu, 17 Jul 2025 17:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjgSP639Hz3mQS; Thu, 17 Jul 2025 17:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752774629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVz4REpfyiOYFypLLdurNjfC0HV7V0ri9/K8bdMuH30=; b=LI+kj8zxpyk9cI6htBhfmDs7zR+T6Pmrju14Mh/gLX3M1I9XA3+9yhHvrX0/GWtY6EgexM i8iyfJBpKDE0sYdF2PLm6isd45z7J7WkIFY6msyYoZp1T4Fref1fdri4PCwwcNrIa5cKvl C0tb98qwH4/xsZR9PGkk7YblujkO/uViZK5BZEP01jwbLMKR4tCt3J/lNNihZxWfC8AL+d 2w9eqDkrk2/gQiGQJEhDS8jfRy06A5xX3gU5j7q75dVWfLe+yoyQnBd+5E8BNeHkt7magH R71UpG3ASgCYQqo/kKi9g+1ZIFVxjeJVgbzJUunphGGp2Obybsi3nYyjq42i0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752774629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVz4REpfyiOYFypLLdurNjfC0HV7V0ri9/K8bdMuH30=; b=AI5gxbfzYrIYNg6J8L8xAzubp3Zgu3Js4xDtMAJfOPdXj9GN7rKno/QmZk6QAa+C3gvKO9 bF68JAB7ziSg8JK7gp8XQkJqdJ+C9NyujS2HaMeVzL1O9q61Vp7Hl1u7laupZveAwAE81O C57vcKhWuNFLD58FMMN7me0T+8Xi9OfmwHQD87wTsBdSZcsiHCrk9kp4BF8yPhC4dDDVrV Li9agb+ZO1Qolozwva9KhABTvPvDDGkezPwoDQp6x/uqzd1HP+VQNZvlux9qvb2NpGOl8f Q62lQoIE4vnMjbvoFAmfwHgNdpTIbZlhObCLF6xlGC5HWzDY7QHjzHFu/OfkiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752774629; a=rsa-sha256; cv=none; b=Dbyi6oedGz3MpZXjpkq2NMVaQXP+PYfS+ITUU5GpU8xx4P9dQniXXewF/XuWte+345r4qD HU2TSBwuPceV52E/ET8TbbJzvjaRLlpVhHZijEdXV+k/CosuEXMx/aw51NEak1SS/rOeUE sYUxDerrk+WVbCDgjV/nLK25F4cu4n4iNKQw7/MiCmxigBnr31FSV1I8vlv8MyTprcPKqR qdBXe4Guu33BQfyEBppCYlwxAPIaXcYdKYdjlSw/A1h3wFOWF+MVFaH0swv1UECe1cOxxA M6rL5eg3IN5MNSdVhHW6Az292dptVPDeazJHo4snxtz9HsKeTMSPQGAHLfQZgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjgSP5YfQz14lf; Thu, 17 Jul 2025 17:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HHoTFe035313; Thu, 17 Jul 2025 17:50:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HHoTEr035310; Thu, 17 Jul 2025 17:50:29 GMT (envelope-from git) Date: Thu, 17 Jul 2025 17:50:29 GMT Message-Id: <202507171750.56HHoTEr035310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: b2e9c8e69bcf - main - packages: add package ucl for libopencsd-all List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2e9c8e69bcf4c757ac4dbcd836618d65cfe2c0e Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=b2e9c8e69bcf4c757ac4dbcd836618d65cfe2c0e commit b2e9c8e69bcf4c757ac4dbcd836618d65cfe2c0e Author: Lexi Winter AuthorDate: 2025-07-17 17:49:04 +0000 Commit: Lexi Winter CommitDate: 2025-07-17 17:49:44 +0000 packages: add package ucl for libopencsd-all This package is installed on arm64 (only) and was missing an entry in Makefile.package so it was missed in the mechanical conversion run. This fixes the arm64 package build. Fixes: f75b20e7ddb8 ("packages: make UCL files required") Reported by: dch, cperciva Reviewed by: kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D51374 --- release/packages/ucl/libopencsd-all.ucl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release/packages/ucl/libopencsd-all.ucl b/release/packages/ucl/libopencsd-all.ucl new file mode 100644 index 000000000000..af46292dceed --- /dev/null +++ b/release/packages/ucl/libopencsd-all.ucl @@ -0,0 +1,5 @@ +comment = "ARM CoreSight Trace Decode Library" +desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 92b9f43c788d - main - certctl: Add an option to copy files. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92b9f43c788da24d2d8376a50953ef67c2303ba7 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=92b9f43c788da24d2d8376a50953ef67c2303ba7 commit 92b9f43c788da24d2d8376a50953ef67c2303ba7 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-17 18:10:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-17 18:13:56 +0000 certctl: Add an option to copy files. This is slower than linking but is the only method that works for all cases, including running certctl from outside a jail that does not contain the raw certificate data. While here, fix a bug that occurs in unprivileged mode if DESTDIR is unset or the root directory. MFC after: 1 week Reviewed by: dfr Differential Revision: https://reviews.freebsd.org/D51373 --- usr.sbin/certctl/certctl.8 | 10 ++++++---- usr.sbin/certctl/certctl.sh | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/usr.sbin/certctl/certctl.8 b/usr.sbin/certctl/certctl.8 index 286072c1b4d6..7e49bb89e2ac 100644 --- a/usr.sbin/certctl/certctl.8 +++ b/usr.sbin/certctl/certctl.8 @@ -24,7 +24,7 @@ .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 10, 2023 +.Dd July 17, 2025 .Dt CERTCTL 8 .Os .Sh NAME @@ -38,15 +38,15 @@ .Op Fl v .Ic untrusted .Nm -.Op Fl nUv +.Op Fl cnUv .Op Fl D Ar destdir .Op Fl M Ar metalog .Ic rehash .Nm -.Op Fl nv +.Op Fl cnv .Ic untrust Ar file .Nm -.Op Fl nv +.Op Fl cnv .Ic trust Ar file .Sh DESCRIPTION The @@ -56,6 +56,8 @@ applications that use OpenSSL. .Pp Flags: .Bl -tag -width 4n +.It Fl c +Copy certificates instead of linking to them. .It Fl D Ar destdir Specify the DESTDIR (overriding values from the environment). .It Fl d Ar distbase diff --git a/usr.sbin/certctl/certctl.sh b/usr.sbin/certctl/certctl.sh index 458f5c53682f..2bde651de126 100755 --- a/usr.sbin/certctl/certctl.sh +++ b/usr.sbin/certctl/certctl.sh @@ -36,6 +36,7 @@ set -u ############################################################ GLOBALS SCRIPTNAME="${0##*/}" +LINK=-lrs ERRORS=0 NOOP=false UNPRIV=false @@ -110,7 +111,6 @@ create_trusted() { local hash certhash otherfile otherhash local suffix - local link=${2:+-lrs} hash=$(do_hash "$1") || return certhash=$(openssl x509 -sha1 -in "$1" -noout -fingerprint) @@ -130,7 +130,7 @@ create_trusted() done suffix=$(get_decimal "$CERTDESTDIR" "$hash") verbose "Adding $hash.$suffix to trust store" - perform install ${INSTALLFLAGS} -m 0444 ${link} \ + perform install ${INSTALLFLAGS} -m 0444 ${LINK} \ "$(realpath "$1")" "$CERTDESTDIR/$hash.$suffix" } @@ -159,7 +159,6 @@ resolve_certname() create_untrusted() { local srcfile filename - local link=${2:+-lrs} set -- $(resolve_certname "$1") srcfile=$1 @@ -170,7 +169,7 @@ create_untrusted() fi verbose "Adding $filename to untrusted list" - perform install ${INSTALLFLAGS} -m 0444 ${link} \ + perform install ${INSTALLFLAGS} -m 0444 ${LINK} \ "$srcfile" "$UNTRUSTDESTDIR/$filename" } @@ -190,7 +189,7 @@ do_scan() 0) ;; 1) - "$CFUNC" "$CFILE" link + "$CFUNC" "$CFILE" ;; *) verbose "Multiple certificates found, splitting..." @@ -303,19 +302,20 @@ usage() echo " List trusted certificates" echo " $SCRIPTNAME [-v] untrusted" echo " List untrusted certificates" - echo " $SCRIPTNAME [-nUv] [-D ] [-d ] [-M ] rehash" - echo " Generate hash links for all certificates" - echo " $SCRIPTNAME [-nv] untrust " + echo " $SCRIPTNAME [-cnUv] [-D ] [-d ] [-M ] rehash" + echo " Rehash all trusted and untrusted certificates" + echo " $SCRIPTNAME [-cnv] untrust " echo " Add to the list of untrusted certificates" - echo " $SCRIPTNAME [-nv] trust " + echo " $SCRIPTNAME [-cnv] trust " echo " Remove from the list of untrusted certificates" exit 64 } ############################################################ MAIN -while getopts D:d:M:nUv flag; do +while getopts cD:d:M:nUv flag; do case "$flag" in + c) LINK=-c ;; D) DESTDIR=${OPTARG} ;; d) DISTBASE=${OPTARG} ;; M) METALOG=${OPTARG} ;; @@ -334,7 +334,7 @@ fi : ${METALOG:=${DESTDIR}/METALOG} INSTALLFLAGS= if "$UNPRIV" ; then - INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR} -o root -g wheel" + INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR:-/} -o root -g wheel" fi : ${LOCALBASE:=$(sysctl -n user.localbase)} : ${TRUSTPATH:=${DESTDIR}${DISTBASE}/usr/share/certs/trusted:${DESTDIR}${LOCALBASE}/share/certs:${DESTDIR}${LOCALBASE}/etc/ssl/certs} From nobody Thu Jul 17 18:15:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjh0l1hYfz625BF; Thu, 17 Jul 2025 18:15:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjh0k3XL3z41Q1; Thu, 17 Jul 2025 18:15:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752776102; h=from:from:reply-to:subject:subject: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++nilIj0EI5vngY3IfM1JrKTZptwd//gmrTbLCYVVE=; b=QSP0lYGoLhj+tUEn8i+1T7u5rynqh60RAcPonIwXP5BT2vI0InzlMeC65s+FeNtj3ZYAB0 wJqh3HJ+l+5ufwZwNdW09YpO2cLrVPxd1PauMR/hpusOQU4wQxOOid1r2midyTZaqWcDnj 8r4+QmkLGqXAkxMRkzxTqZywYuCwMWuCpzpf+Ts8Y/f716iAmzEW3LhM8xCpBjtAqEp6Rc uxVUXiYytVtz55t88SLnqw9/2fDcFQnHj2KY3bXY9REY+ZZs8YisvrTkpFNLK9FQxItdAd E0Nz4NqmuAtPX/l6ciwWFjnH0nbCPkqwwKlFKHIQbqR5CGmZAzRNaG5pZecY4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752776102; h=from:from:reply-to:subject:subject: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++nilIj0EI5vngY3IfM1JrKTZptwd//gmrTbLCYVVE=; b=qwImXyxKFODtaq6xZheoHpgFer7wL+lQPIk8P6z1OpwmCKyfse0JKOeajpAgXKOv2pdOhD nARH3RbpumQc92F08iwfXjMRDtkAJxQa2yedK84mu5Xv1un3hgCco4Q0514psgVrQ5DBB/ Moe6XlNWTrLq52LZxGUYOiXp2gP9YaLv2+JSVsWTZ9Xd3Mj8JwhsaHRq8b4dgfmUVRDLHH DsdtcRmWNAwIhN2P/sIrqTs3AYSuVTZ6zfzxyj3VDFa+7l7A29TTQn6VcT5ma1TpWykZtt B5Hk1VDN5MAWmRyuI1D+m2STCvaS8TbSownp7BQZ50ktRTmvkS1w29V6/srRCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752776102; a=rsa-sha256; cv=none; b=d2FLQXRzGmi4Eq1Zc2ny95oZyS+eUbSBeUdVF6SGng3oE7sj4P3/MI6WcjWePHHOvOeUSI U7D9/MEs9nqGIGa5nybVjSzHR/8g/+KbheGbF8v88UrDotvfCaOjDsWfytpy4f8ccnJu0+ bYLTELsIsFr5+JMKEFMXyMx9riEqI7m+IlF3/bYuZt5zdrUggqVO6rh0k+j+qruKY6LWwG Y8Ft1gsGHagtzZtHAOB9SGygQ051a1X0pOTTXgYEcJLFUtxTe+9CAivIYxLg6FFzFFIjHc 0j7FXfg+tgmULSPWfXLoSjHimBG6YhPt+YCIVC8OHhsl3LmTCgJ4Y9BjIIIcdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjh0k2ZJwz161s; Thu, 17 Jul 2025 18:15:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HIF2dY082159; Thu, 17 Jul 2025 18:15:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HIF289082155; Thu, 17 Jul 2025 18:15:02 GMT (envelope-from git) Date: Thu, 17 Jul 2025 18:15:02 GMT Message-Id: <202507171815.56HIF289082155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c19877b03f8c - main - release: Let caroot depend on certctl, not vice versa. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c19877b03f8cd210674f0aaca5ec14c5eb00574f Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c19877b03f8cd210674f0aaca5ec14c5eb00574f commit c19877b03f8cd210674f0aaca5ec14c5eb00574f Author: Dag-Erling Smørgrav AuthorDate: 2025-07-17 18:13:38 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-17 18:13:56 +0000 release: Let caroot depend on certctl, not vice versa. This makes it possible to remove the caroot package and still have the tool needed to install its replacement (e.g. security/ca_root_nss). Reviewed by: ivy Differential Revision: https://reviews.freebsd.org/D42095 --- release/packages/ucl/caroot.ucl | 10 ++++++++++ release/packages/ucl/certctl.ucl | 15 --------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/release/packages/ucl/caroot.ucl b/release/packages/ucl/caroot.ucl new file mode 100644 index 000000000000..4d2b52d300fc --- /dev/null +++ b/release/packages/ucl/caroot.ucl @@ -0,0 +1,10 @@ +deps { + "certctl": { + version = "${VERSION}" + origin = "base" + } +} +scripts: { + post-install = "/usr/sbin/certctl -D${PKG_ROOTDIR}/ rehash" + post-uninstall = "/usr/sbin/certctl -D${PKG_ROOTDIR}/ rehash" +} diff --git a/release/packages/ucl/certctl.ucl b/release/packages/ucl/certctl.ucl index 300aa55fabda..7f7adec83159 100644 --- a/release/packages/ucl/certctl.ucl +++ b/release/packages/ucl/certctl.ucl @@ -1,21 +1,6 @@ deps { - "caroot": { - version = "${VERSION}" - origin = "base" - } - "openssl": { version = "${VERSION}" origin = "base" } } - -scripts: { - # XXX If pkg picks up a mechanism to detect in the post-install script - # files being added or removed, we should use it instead to gate the - # rehash. - post-install = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 701072154af0 - main - snd_uaudio.4: Rework SYNOPSIS, add HARDWARE, SPDX List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 701072154af0881ef395736a06d09ffa47cfc096 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=701072154af0881ef395736a06d09ffa47cfc096 commit 701072154af0881ef395736a06d09ffa47cfc096 Author: Alexander Ziaee AuthorDate: 2025-07-17 15:56:16 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-17 19:56:09 +0000 snd_uaudio.4: Rework SYNOPSIS, add HARDWARE, SPDX + Rework synopsis for consistency, adding sysctls + Add a HARDWARE section for HW relnotes + tag SPDX MFC after: 3 days Reviewed by: christos, pauamma Differential Revision: https://reviews.freebsd.org/D51240 --- share/man/man4/snd_uaudio.4 | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/share/man/man4/snd_uaudio.4 b/share/man/man4/snd_uaudio.4 index 00329a6d8e40..7193c85fa4f0 100644 --- a/share/man/man4/snd_uaudio.4 +++ b/share/man/man4/snd_uaudio.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" $NetBSD: uaudio.4,v 1.15 2002/02/12 19:53:57 jdolecek Exp $ .\" .\" Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -27,32 +30,30 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 15, 2025 +.Dd July 17, 2025 .Dt SND_UAUDIO 4 .Os .Sh NAME .Nm snd_uaudio .Nd USB audio and MIDI device driver .Sh SYNOPSIS -To compile this driver into the kernel, place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device sound" .Cd "device usb" .Cd "device snd_uaudio" -.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 -snd_uaudio_load="YES" -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for USB audio class devices and USB MIDI class devices. +In +.Xr rc.conf 5 : +.Cd kld_list="snd_uaudio" .Pp +In +.Xr sysctl.conf 5 : +.Cd hw.usb.uaudio.buffer_ms +.Cd hw.usb.uaudio.default_bits +.Cd hw.usb.uaudio.default_channels +.Cd hw.usb.uaudio.default_rate +.Cd hw.usb.uaudio.handle_hid +.Cd hw.usb.uaudio.debug +.Sh DESCRIPTION A USB audio device consists of a number of components: input terminals (e.g.\& USB digital input), output terminals (e.g.\& speakers), and a number of units in between (e.g.\& volume control). @@ -68,6 +69,11 @@ sample rate and sample size. Refer to the .Ql USB Audio Class Specification for more information. +.Sh HARDWARE +The +.Nm +driver provides support for USB audio class devices and +USB MIDI class devices. .Sh SYSCTL VARIABLES The following settings can be entered at the .Xr loader 8 From nobody Thu Jul 17 20:04:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjkRN3pS8z62Blr; Thu, 17 Jul 2025 20:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjkRN2slNz3rjG; Thu, 17 Jul 2025 20:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752782688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LeFQT3ygP1t2vw2NsxJvH02WIK27Yo9oXQzDQNNBnEQ=; b=vBn/iXoavYUMdhFT3D1zrDOqBkginqCejBabwQQMOgC+bEh5WWIzWXUGc0qwemCXSZ8+Ts +E4bRFMZkwOn6OEt4oeOWgH0d62KXpQPdjTxvMzjL+GG778AdBkCP/xXlnE2QrRNMPuqwg m5ZPT72tsnfNQ8uYN32pzAGc/VcfulhvkFuMDOhQTMIBvaWh2tQuIXLycWXP6SwEMneskk xVowf/Z3e3IzMt4GCrE0EBFzbOa0ZWmJIZdmfLxxHCw92nvo1MmSih7lwV4xF09m/wfe4t NqGelWIAaTRSjydcVWxkM5MPuMioKGS51Y/3WJpaD3Xh9c9qJ42xWvMqfkDrHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752782688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LeFQT3ygP1t2vw2NsxJvH02WIK27Yo9oXQzDQNNBnEQ=; b=hNAllmwzJAMJD2pgxFN2Q756WHeVNIhDWM6e8I57QOV/xfISE8mBQEWkso7o3VGf5MMO0f 6hTpG9T8SRhlzICXA+AymSC5qL9UZ9GRjRGeYUu0SrxUFBx5B/mwP9pqJojRYa9IY65gcE 2ixb+rmkRm9V75tMIG+v6sj8QGfgm300qODPXlYuDbteHLbjS7rXc8UIGECidk6psy/jzp FgalMeus1oWD0WpNDEcb2F0AwLd0pHk5/kaTSl7JrACzovr1KDDfp6P9B2vyJjy9NLWDdl 4szhtVEnjGTeKFdbMbadKdfzd7FCBVzGzMFAYkAKtcmKzjqjcyGKGn1CgTprhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752782688; a=rsa-sha256; cv=none; b=GsqxJ4H8KLEpbr9O4gYRygGSO/c4PyK4AB0TOUQ9O7+wO761m1Sw6XQNCEkgPbLzb2txr8 UvgC3nVT4gB4YTAdm3wQ8VEq9s9d1XrGNA+aPSy2bb3IkIk3UV60aCuKvt/H2sxNN95Ehb gKkOGgjjUBL8K/LpRB1Fj0XvVumS4yTJsRix0ZnKlB5Z4fyE9lKJr4+b4myucPQfYVxSNZ 1/8eXiiBqVQ7Js2hoghmITKCWPLGP3i7vM3u0x2LWn+gkUAghq0jyLXhugzygR8EpgHHp/ cGyjnOMLj4WXPtrTXowreC1QAjNfh2BOTP6CXigha7VP28siXMr5k+A4oHaaHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjkRN2Byfz18Lk; Thu, 17 Jul 2025 20:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HK4mvo089847; Thu, 17 Jul 2025 20:04:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HK4mpc089844; Thu, 17 Jul 2025 20:04:48 GMT (envelope-from git) Date: Thu, 17 Jul 2025 20:04:48 GMT Message-Id: <202507172004.56HK4mpc089844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 7757c5489508 - main - mtw.4: Make style consistent with other manuals List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7757c54895081dd9cbce398bf08f236fa83a175e Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7757c54895081dd9cbce398bf08f236fa83a175e commit 7757c54895081dd9cbce398bf08f236fa83a175e Author: Alexander Ziaee AuthorDate: 2025-04-15 23:25:34 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-17 20:02:56 +0000 mtw.4: Make style consistent with other manuals Fixes: c14b016242613 (importing if_mtw from OpenBSD) Reviewed by: adrian, carlavilla (mentor), jsm, mhorne(mentor) Differential Revision: https://reviews.freebsd.org/D48905 --- share/man/man4/mtw.4 | 78 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 17 deletions(-) diff --git a/share/man/man4/mtw.4 b/share/man/man4/mtw.4 index 17722be73203..6aa59d848d36 100644 --- a/share/man/man4/mtw.4 +++ b/share/man/man4/mtw.4 @@ -24,23 +24,41 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Feb 03, 2025 +.Dd May 3, 2025 .Dt MTW 4 .Os .Sh NAME -.Nm if_mtw -.Nd "Mediatek MT7601U" -.Ed +.Nm mtw +.Nd MediaTek MT7601U USB IEEE 802.11n wireless network driver +.Sh SYNOPSIS +.Cd device usb +.Cd device mtw +.Cd device wlan +.Pp +In +.Xr rc.conf 5 : +.Cd kld_list="if_mtw" .Sh DESCRIPTION -This module provides support for Mediatek MT7601U with the firmware from net/wifi-firmware-mtw-kmod - +This module provides support for +MediaTek MT7601U USB wireless network adapters. +If the appropriate hardware is detected, +the driver will be automatically loaded with +.Xr devmatch 8 . +If driver autoloading is explicitly disabled, enable the module in +.Xr rc.conf 5 . +The +.Nm +driver can be configured at runtime with +.Xr ifconfig 8 +or at boot with +.Xr rc.conf 5 . .Sh HARDWARE The .Nm -driver supports Mediatek MT7601U -based USB wireless network adapters including (but not all of them tested): +driver supports MediaTek MT7601U based USB wireless network adapters +including (but not all of them tested): .Pp -.Bl -column -compact +.Bl -bullet -compact .It ASUS USB-N10 v2 .It @@ -58,17 +76,43 @@ TP-LINK TL-WN727N v4 (tested working) .It Yealink WF40 .El +.Sh FILES +The +.Nm +driver requires firmware from +.Pa ports/net/wifi-firmware-mt7601u-kmod . +This firmware package will be installed automatically with +.Xr fwget 8 +if the appropriate hardware is detected at installation or runtime. .Sh SEE ALSO -.Xr usb 4 -.Sh BUGS +.Xr usb 4 , +.Xr wlan 4 , +.Xr networking 7 , +.Xr fwget 8 , +.Xr wpa_supplicant 8 +.Sh HISTORY The .Nm -only works in station mode and monitor mode. The firmware does not always reinitialize when reloading the module, or when rebooting, without first unplugging the device. -.Sh History -The mtw driver first appeared in OpenBSD 7.1. The mtw driver was ported to FreeBSD in FreeBSD 15.0. +driver first appeared in +.Ox 7.1 +and +.Fx 15.0 . .Sh AUTHORS .An -nosplit -The mtw driver was written by +The +.Nm +driver was written by .An James Hastings Aq Mt hastings@openbsd.org -ported to FreeBSD by -.An Jesper Schmitz Mouridsen Aq Mt jsm@FreeBSD.org +and ported to +.Fx +by +.An Jesper Schmitz Mouridsen Aq Mt jsm@FreeBSD.org . +.Sh BUGS +.Nm +only works in +.Cm station +mode and +.Cm monitor +mode. +The firmware does not always reinitialize when reloading the module, +or when rebooting, without first unplugging the device. From nobody Thu Jul 17 20:08:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjkXC05Ckz62C43; Thu, 17 Jul 2025 20:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjkXB5xdSz3vG3; Thu, 17 Jul 2025 20:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752782938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dvn8GBj+Ywubhr25iVj8UohutSpRjkwCeze2LUrXtc8=; b=uNz9nkGgiQI3FOZ0tOmmb5Vaj/l7ZfD03FoO4PMfr9oy3raKufPBfzKgGE669cRa6lGh9/ 0zgv/I50UJHcaffEnjapugF/GovSHSKIuPtlGHDu0u2hg6c95RQNij2EIoVfqJQ4EfIGgn 4OmXb5KGMQOrwX/ssmnqMAhRoTcs7u9RVbwDPogbwT0mqInkJm4v5w9JeVhQD7BpWt17h7 7yIMELaDKJoIfdkiERF1SMbA/bQBWeixAM1PI5GjXxRFWXcHOeI5XeGnO+PHY1ccKLLhfj TCzjTDGNf9UJV7cq/Ii5k06ZQvVDe6gCVSJUoVTDi5p4MHwTwBow5XZQXbSJxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752782938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dvn8GBj+Ywubhr25iVj8UohutSpRjkwCeze2LUrXtc8=; b=vJSwFs86M3v2D3hdoQIW1/ROL9JlbElc6ez1/4b0lYZ3lMzqb4bj84Q8YX9Y7D1rRrzGE3 fA9xFnQN465hau/BMmVVq9NMKBx4tMhejcqtY8PIkNU95dEChu0dfytcC2zwJ41bTl9SSt m8r17VMe85+Zn/jMpt9niT3mBHgwOHswAMVE6gHnaA96L9nPm+0ijz4VpTBz+g6cUpQ8rW VYyO9D1QI9WtgDBWqrP+2p2eZJAHh+LLzL22CE2xYD1bnG5zWNTrgy8w/7ZE2FLMfRSczj eapeKa1Ux1/P+OepRkgGTjqiajjRBv+u/XobHFbS1130iTMvz+OPy2fAvJaQPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752782938; a=rsa-sha256; cv=none; b=o2pyhOvQYVEwr1cVgx9Pw8YZSO8LLNIcfvyMg5wLxO4VADQ/bdgsVQMjviCQaxjerR8i23 QhlF6hdbzEwX+LCEJc+BtMmYixB2rhLxgwYJMd5rl1X3XhGM6pHzz4srCgJ74mEaaOl+rD 1wjnayDhf9qRIHIlYdhQxUXcBEWqkEQT18bV3IJQJZggWzuWrTVewNqD+3VUyf+xvZtFwe 6/pVUAsJKEFe0bg0V3uJMhUiCb29F6WeLlYQCM+ycE94lRoPjQJh12sXIpFw1h+2LkK81U 7CaCQ0x3WAK19K8pT24PPYk8f8WiX4+xYwkYQJDPxscLEsV75XgN8atsjAfYkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjkXB5Nn1z18kD; Thu, 17 Jul 2025 20:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HK8wP3091315; Thu, 17 Jul 2025 20:08:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HK8wu2091312; Thu, 17 Jul 2025 20:08:58 GMT (envelope-from git) Date: Thu, 17 Jul 2025 20:08:58 GMT Message-Id: <202507172008.56HK8wu2091312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: c4fe5431bddc - main - ufshci.4: Move hardware to HARDWARE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4fe5431bddc88d7add89195144a75cbc02fa57e Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=c4fe5431bddc88d7add89195144a75cbc02fa57e commit c4fe5431bddc88d7add89195144a75cbc02fa57e Author: Alexander Ziaee AuthorDate: 2025-07-17 20:06:04 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-17 20:08:38 +0000 ufshci.4: Move hardware to HARDWARE This lets us pull them automatically into the hardware release notes. Note the beautiful introductory sentence here, this pattern can maybe improve the relationship between DESCRIPTION introductory sentence and HARDWARE. MFC: never (ufshci does not mfc) Reviewed by: 0mp, christos, imp Differential Revision: https://reviews.freebsd.org/D51379 --- share/man/man4/ufshci.4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/share/man/man4/ufshci.4 b/share/man/man4/ufshci.4 index d008afbf8ace..d722c9902b98 100644 --- a/share/man/man4/ufshci.4 +++ b/share/man/man4/ufshci.4 @@ -7,7 +7,7 @@ .\" .\" Author: Jaeyoon Choi .\" -.Dd June 24, 2025 +.Dd July 17, 2025 .Dt UFSHCI 4 .Os .Sh NAME @@ -28,11 +28,6 @@ ufshci_load="YES" .Sh DESCRIPTION Universal Flash Storage (UFS) is a low-power, high-performance storage standard composed of a host controller and a single target device. -The -.Nm -initializes both the host controller and the target device, and handles I/O. -It currently supports the UFS/UFSHCI 4.1 specification and all earlier -revisions. .Pp The driver currently provides: .Bl -bullet @@ -58,6 +53,11 @@ subsystem and its logical unit appears as the device node The driver is under active development; upcoming work includes full UFS 4.1 feature coverage, additional power-management modes, and ACPI/FDT-based attach support. +.Sh HARDWARE +The +.Nm +driver supports both host controllers and devices implementing the +Universal Flash Storage Host Controller Interface 4.1 and earlier. .Sh CONFIGURATION The .Nm From nobody Thu Jul 17 21:54:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjmsh6szSz62JbF; Thu, 17 Jul 2025 21:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjmsh2KZ6z3Kkg; Thu, 17 Jul 2025 21:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752789256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sMKfsbYVc50XpZEiapm8gVE7YWxOdTrxmiI5mnp6f2c=; b=YUeb+rrW+6LLd+JctW/P+uU+zT9EUfEYH31tePuz83T+paCm74YFxeFewJ95IfPVq7Gxhm SyqKx/f8JvsxBXFU9BlM3yAYBuVA5QJeMQF+j+rBx4zwmhxqaY/beGAXgHy4XlbV28Y+cO FGCFHVwbbDj+hIrXoBOsyji8Rc1wsfv6uTaPTgzONXMSwfxqjG/6rm6oaIY8ZFQP7fdYyp Zx7rnA8WXJxufnWwSqj57DeJRr5snB0vc+Ww4XPvlVLdHHOWPeYIv4viyOBCJWqE+9jhRI +wCwUTU44fMvniUvQyAuQvGT/b5nEHKmeXQi7+kwqsN2cTVhn0dSeqqen1zo3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752789256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sMKfsbYVc50XpZEiapm8gVE7YWxOdTrxmiI5mnp6f2c=; b=eY8FCzfsAFOO0l+jYGugg4imi1PSzuAJlu5n0e8+7vClVLYHN0ntYHaRfrme87sS9cwMN5 W3xpCWp7eOwhMwspioW62R0pdUU4fcm0y50itxyKRbAQUr9s5Tj60DKOAQHQRFKD/00lrY +wBQk6p5nsyjoOPIXijBlwhrDpLxwGOnpjD5Pl9hJ5nzHPmV11DzTB1W4ftr5n+mA4Cps1 EhGz9fRAUREFR3dtgoK6fBFe+TIALlpHW4/EDTDnenERa+OnCMZ5vcSXBRT5f4TWln+fna gzKiLNYALEfJF17LwM0MdYFkc1Q6v0wVxPiG4Xd/njOmNjLti7tcBeqKmG1doA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752789256; a=rsa-sha256; cv=none; b=ReO83lY+Nk14OzhTtlaRw485BtJynZamDISJO/qeUNlMEjhkX6EH701YVXkeWD0OQoCkmG aaQjrs/04x9+YOr6xQNRGVqZZky41iez4L65wuIhjoBVTBE/Nxa/Hsh0ljeu9vSrB7vGX9 7eDH9rgUs09caVr6K+1LJqv22EL1405PlFauTlnBXm+oidmyQHdN8wCL+jYDZPVcSsoEa6 0lk4Tm4j2MVncUw6/KWJi88aE88jHoDs/iIJ18sP3zlLWqCnCMgorRCo5MsfENIagApWdP YRsbyLXKjCdvMdcEM9Q+wXMNhivrR3H3fv61J7Hj9wFrRyt7FbsYJ3BmqkPgaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjmsh1wTnz1CKv; Thu, 17 Jul 2025 21:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HLsGnA095200; Thu, 17 Jul 2025 21:54:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HLsGLL095197; Thu, 17 Jul 2025 21:54:16 GMT (envelope-from git) Date: Thu, 17 Jul 2025 21:54:16 GMT Message-Id: <202507172154.56HLsGLL095197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 29af6d2e2ec9 - main - msdosfs: replace '/' in direntries with '?' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18 commit 29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18 Author: Konstantin Belousov AuthorDate: 2025-07-17 01:12:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-17 21:53:54 +0000 msdosfs: replace '/' in direntries with '?' PR: 288266 Reported by: Robert Morris Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51365 --- sys/fs/msdosfs/msdosfs_conv.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c index da4848169173..208b64930e61 100644 --- a/sys/fs/msdosfs/msdosfs_conv.c +++ b/sys/fs/msdosfs/msdosfs_conv.c @@ -797,19 +797,24 @@ mbsadjpos(const char **instr, size_t inlen, size_t outlen, int weight, int flag, static u_char * dos2unixchr(u_char *outbuf, const u_char **instr, size_t *ilen, int lower, struct msdosfsmount *pmp) { - u_char c, *outp; - size_t len, olen; + u_char c, *outp, *outp1; + size_t i, len, olen; outp = outbuf; if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { olen = len = 4; + outp1 = outp; if (lower & (LCASE_BASE | LCASE_EXT)) msdosfs_iconv->convchr_case(pmp->pm_d2u, (const char **)instr, ilen, (char **)&outp, &olen, KICONV_LOWER); else msdosfs_iconv->convchr(pmp->pm_d2u, (const char **)instr, ilen, (char **)&outp, &olen); + for (i = 0; i < outp - outp1; i++) { + if (outp1[i] == '/') + outp1[i] = '?'; + } len -= olen; /* @@ -826,6 +831,8 @@ dos2unixchr(u_char *outbuf, const u_char **instr, size_t *ilen, int lower, struc c = dos2unix[c]; if (lower & (LCASE_BASE | LCASE_EXT)) c = u2l[c]; + if (c == '/') + c = '?'; *outp++ = c; outbuf[1] = '\0'; } From nobody Thu Jul 17 23:34:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjq4q2zbmz62PHD; Thu, 17 Jul 2025 23:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjq4q0VC1z3hc1; Thu, 17 Jul 2025 23:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752795243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqpkw14iUoSXKZFHvpNSRG7WAePAT1kTrPVBTiaAgR0=; b=bGlaYilPjkJ9O4q8WvvaBLjzcbE3qIPp5WIouO1kigVz+fP9s8SU4vEqJ6UE1Wmj4fADQT 0SDIURSo0InKQqtMtQG6PEeGFmSfCgBwmc6+0eIEXHN2gnFQTWa9PsRA1JsmQCvag4yHqI TnhLYuVKzGshKIuuUP0Je+7ksCLmQOtajucRahBy7JZADWhHiwdeb/IvQulRn3yfK5UNZc VfnwpbeuFAubaNiSWy0L96YkedA5D1NPImgynrcwxZL332mGv33Y6Qu9LprFE2oEy26J1u S1lfNFnYWsLU/Bwkogt1rqyLgbuMJ23WS1KW/TFIiv+qqRbv118MfimGFHzs8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752795243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqpkw14iUoSXKZFHvpNSRG7WAePAT1kTrPVBTiaAgR0=; b=Ra99JRuEs6cUm2pv0myPacEZy3feIryNn+F08wMX3hzFdj2t1A/XXdDrYoBHgs+2igjvqM sNmewL7iMd30pCQKnkWu5ALE2MyQoJgO6cri3s0dD3+i2DykJdqiRsKrgMIILCYMOptlbj igigqs5I74m1XcBLicCLiyhX44AHilyPI+uRqLSVtE5CKMUiSgLwZrH0NPcKkQOMU223SQ So58W0sm1j9Y3dNrL4HJG3v7TXkGvtc1pe6P3uY7woSadhztHBkO/e4XsZY8adeswuFoUZ 6pc4zp4UrbyFzlSF3ntejNNSWzQTjpylQFqYjlzO9leDXVjXQBBLydmkhQOCtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752795243; a=rsa-sha256; cv=none; b=Hq5rWHOrCbJrb1YZAHjKWco8YP8MXOprCdRy4ZAn7ZvHimCtOTi08Sas3LN+DnsYJxt02m MYrnJfgIejD8NjIAwBWErlkoMHToDU8AmU+aSQXWtQyGczybl/ixAt5pyAfu6H+kiurZtI /67gl5ACSFPhg6/Trrf/tGGODJgu9A+oVDtZkbfk0oFBu7r2Y1ajUI9d/cR+2DrlYllpx4 VjzbfOwiW/d1BdWQpsVX8+7lKpfhhW+Dkj2Pp/N5SPdwib9GYPMGLnXaa8W+OKu7WRhPE+ lJugZlVbfNji3pPiwp0PyuPoDLQGViHInV/sKKphMljQRyBo3aCjJFkFsb18fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjq4p72Zdz1gZ; Thu, 17 Jul 2025 23:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HNY2hB082870; Thu, 17 Jul 2025 23:34:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HNY2qW082867; Thu, 17 Jul 2025 23:34:02 GMT (envelope-from git) Date: Thu, 17 Jul 2025 23:34:02 GMT Message-Id: <202507172334.56HNY2qW082867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 5a846c48f209 - main - pmap_enter_{l2,pde}: correct the handling of an error case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a846c48f209d04dad36aa35a9968f557c4516f7 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=5a846c48f209d04dad36aa35a9968f557c4516f7 commit 5a846c48f209d04dad36aa35a9968f557c4516f7 Author: Alan Cox AuthorDate: 2025-07-16 08:08:49 +0000 Commit: Alan Cox CommitDate: 2025-07-17 22:10:29 +0000 pmap_enter_{l2,pde}: correct the handling of an error case When pmap_enter_object()'s call to pmap_enter_{l2,pde}() fails to create a managed mapping within the kernel address space due to the inability to allocate a PV entry, it needs to remove the kernel page table page from the pmap's trie of idle page table pages. Previously, it did not. Reviewed by: andrew, kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51353 --- sys/amd64/amd64/pmap.c | 11 +++++++++++ sys/arm64/arm64/pmap.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 2c7777e608b9..14f57ca94ba7 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -7561,6 +7561,9 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, PG_RW = pmap_rw_bit(pmap); KASSERT((newpde & (pmap_modified_bit(pmap) | PG_RW)) != PG_RW, ("pmap_enter_pde: newpde is missing PG_M")); + KASSERT((flags & (PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM)) != + PMAP_ENTER_NORECLAIM, + ("pmap_enter_pde: flags is missing PMAP_ENTER_NOREPLACE")); PG_V = pmap_valid_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -7689,6 +7692,14 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, if (!pmap_pv_insert_pde(pmap, va, newpde, flags, lockp)) { if (pdpg != NULL) pmap_abort_ptp(pmap, va, pdpg); + else { + KASSERT(va >= VM_MAXUSER_ADDRESS && + (*pde & (PG_PS | PG_V)) == PG_V, + ("pmap_enter_pde: invalid kernel PDE")); + mt = pmap_remove_pt_page(pmap, va); + KASSERT(mt != NULL, + ("pmap_enter_pde: missing kernel PTP")); + } if (uwptpg != NULL) { mt = pmap_remove_pt_page(pmap, va); KASSERT(mt == uwptpg, diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a09da794e77d..459cc8ebe505 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -5709,6 +5709,9 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(ADDR_IS_CANONICAL(va), ("%s: Address not in canonical form: %lx", __func__, va)); + KASSERT((flags & (PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM)) != + PMAP_ENTER_NORECLAIM, + ("pmap_enter_l2: flags is missing PMAP_ENTER_NOREPLACE")); if ((l2 = pmap_alloc_l2(pmap, va, &l2pg, (flags & PMAP_ENTER_NOSLEEP) != 0 ? NULL : lockp)) == NULL) { @@ -5828,6 +5831,15 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, if (!pmap_pv_insert_l2(pmap, va, new_l2, flags, lockp)) { if (l2pg != NULL) pmap_abort_ptp(pmap, va, l2pg); + else { + KASSERT(ADDR_IS_KERNEL(va) && + (pmap_load(l2) & ATTR_DESCR_MASK) == + L2_TABLE, + ("pmap_enter_l2: invalid kernel L2E")); + mt = pmap_remove_pt_page(pmap, va); + KASSERT(mt != NULL, + ("pmap_enter_l2: missing kernel PTP")); + } if (uwptpg != NULL) { mt = pmap_remove_pt_page(pmap, va); KASSERT(mt == uwptpg, From nobody Thu Jul 17 23:37:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bjq8l15cbz62PKq; Thu, 17 Jul 2025 23:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bjq8l01Txz3l6S; Thu, 17 Jul 2025 23:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752795447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+1Hgz4YCd9iSBTxZFWjxWj8X6lHNGC6z76rtXmpRVgQ=; b=BCMozpMktZ5F8olyVdBhn1Qh/S7cyyY9y/8Ipou+wCR841q6U44EsxqMZm1f/Ymtumnx6v QdVJCy6Nrvfujq7ESdelcsTFr6p8A1MfV5a47aLC6X23QcSP9Q31D7o1jd6ujFbC7GQsL1 mIZITiNgWNk6wMw0jNZUAEdAMc9XeTM/f5Qd1o7Ng1U5zp0QyEWnVdL7a7PGy3mECFE43d BHG4bKyfPqAVyNTamIZIOtr5FPoCHP3Ji9NztHAIxmdn3kJ3P+/h1aWzN6/sJ2iMSdl6py pNtWABkvAMKiBH2uJhW9QEwehGO91Ku+2CU7xNVfzMWiy7zethGKWDBcOjQmRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752795447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+1Hgz4YCd9iSBTxZFWjxWj8X6lHNGC6z76rtXmpRVgQ=; b=hUiXOjejdUX+YpIQ/HfNSxbpfF50rqH0GYzvvSm6WrXpw6b9GI+I5iaFIaeBA6uPkXP1gG Pvj8j/pcCRQJofGXva4vL1TLVNbKKebIw+AR5F4FPUAUCy/yjABm6k0h5et3YdxdgI/V5c 7ry/0kEE8bozcjc64iFDzo2/yfQ1BJJT76rC1iRmVuj24Hcfs8zMG5cXiLn1ICooarMfKK PYk65dlKXp4XvBH3EbXCoG8tZ+d2fWiRzPHn9h2DSbiVze1j9zMpbb4AHshp/FZq1zjwpf fE5ixepdsP4ZkOezi5u4rttoebv7YZEQUBrJjoY8HDmyw9u0+JAH2CkQF3pM1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752795447; a=rsa-sha256; cv=none; b=Yzj8IvdJ8AKr8TJrBBp7GKR11/HviF9w5Do3quEzu92MViy2NJseL322VEaWyaUWOxGP8V sxiPFy8zoLmsBgokhrHypGtwJRcYqJ1YL/KUPRVT1BR0yXMpDOj40cQQjOEfI86r3TU2xJ taAb7fdgRakwp9Hb/M+dxEBFJ3OgOrDpmGPAakDQ7CI5aA4LzXuxSG6x4tx+AIRHJJfsj5 1Z3pe+AkGUUb8bBSoLczVw4ouwFOIEvWO9rCovnDZPI7ei0I5vWHoM/C3Zssw5mPIpjQ1a hGU8r44EwPc1MptrZPNw56h4mWwrR64FwHrN8DB5JZiMMoBib4Ti3karNyWFbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bjq8k62cLz19C; Thu, 17 Jul 2025 23:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56HNbQlX083965; Thu, 17 Jul 2025 23:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56HNbQvv083962; Thu, 17 Jul 2025 23:37:26 GMT (envelope-from git) Date: Thu, 17 Jul 2025 23:37:26 GMT Message-Id: <202507172337.56HNbQvv083962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: e67aef419093 - main - Add DEBUG_PRINTF to stand.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e67aef419093b08984b8a2de535bc3e4ce13e087 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e67aef419093b08984b8a2de535bc3e4ce13e087 commit e67aef419093b08984b8a2de535bc3e4ce13e087 Author: Simon J. Gerraty AuthorDate: 2025-07-17 23:36:17 +0000 Commit: Simon J. Gerraty CommitDate: 2025-07-17 23:36:17 +0000 Add DEBUG_PRINTF to stand.h stand/ is mostly debugged with printfs, in an ad hoc and sometimes fragile manner. For example BOOTP_DEBUG in bootp.c cannot be defined unless NETIF_DEBUG is defined in dev_net.c or build fails for lack of the symbol debug. The DEBUG_PRINTF implementation in stand.h addresses that and allows for more control over debug output. It is compatible with the usage in libsecureboot. Simply define _DEBUG_LEVEL to the desired level of debug or in the case of libsecureboot _DEBUG_LEVEL_VAR to the variable that will hold that value - default is _debug which is static so each translation unit can be controlled independently. The 1st arg to DEBUG_PRINTF is a level which must be greater than or equal to _DEBUG_LEVEL_VAR if the printf is to be called. See libsecureboot for more examples. Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D51269 --- lib/libsecureboot/h/libsecureboot.h | 1 + stand/common/dev_net.c | 57 ++++++++------------------- stand/libsa/bootp.c | 78 +++++++++---------------------------- stand/libsa/pkgfs.c | 33 +++++++++------- stand/libsa/stand.h | 13 +++++++ 5 files changed, 68 insertions(+), 114 deletions(-) diff --git a/lib/libsecureboot/h/libsecureboot.h b/lib/libsecureboot/h/libsecureboot.h index 017558536825..d32df9594332 100644 --- a/lib/libsecureboot/h/libsecureboot.h +++ b/lib/libsecureboot/h/libsecureboot.h @@ -29,6 +29,7 @@ #include #ifdef _STANDALONE +#define _DEBUG_LEVEL_VAR DebugVe #include #else #include diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c index fc6b43ec7a40..964fa514cac5 100644 --- a/stand/common/dev_net.c +++ b/stand/common/dev_net.c @@ -66,10 +66,6 @@ #include "dev_net.h" #include "bootstrap.h" -#ifdef NETIF_DEBUG -int debug = 0; -#endif - static char *netdev_name; static int netdev_sock = -1; static int netdev_opens; @@ -143,11 +139,8 @@ net_open(struct open_file *f, ...) return (ENXIO); } netdev_name = strdup(devname); -#ifdef NETIF_DEBUG - if (debug) - printf("%s: netif_open() succeeded\n", - __func__); -#endif + DEBUG_PRINTF(1,("%s: netif_open() succeeded %#x\n", + __func__, rootip.s_addr)); } /* * If network params were not set by netif_open(), try to get @@ -200,10 +193,7 @@ net_close(struct open_file *f) { struct devdesc *dev; -#ifdef NETIF_DEBUG - if (debug) - printf("%s: opens=%d\n", __func__, netdev_opens); -#endif + DEBUG_PRINTF(1,("%s: opens=%d\n", __func__, netdev_opens)); dev = f->f_devdata; dev->d_opendata = NULL; @@ -216,10 +206,7 @@ net_cleanup(void) { if (netdev_sock >= 0) { -#ifdef NETIF_DEBUG - if (debug) - printf("%s: calling netif_close()\n", __func__); -#endif + DEBUG_PRINTF(1,("%s: calling netif_close()\n", __func__)); rootip.s_addr = 0; free(netdev_name); netif_close(netdev_sock); @@ -271,10 +258,7 @@ net_getparams(int sock) bootp(sock); if (myip.s_addr != 0) goto exit; -#ifdef NETIF_DEBUG - if (debug) - printf("%s: BOOTP failed, trying RARP/RPC...\n", __func__); -#endif + DEBUG_PRINTF(1,("%s: BOOTP failed, trying RARP/RPC...\n", __func__)); #endif /* @@ -292,10 +276,7 @@ net_getparams(int sock) printf("%s: bootparam/whoami RPC failed\n", __func__); return (EIO); } -#ifdef NETIF_DEBUG - if (debug) - printf("%s: client name: %s\n", __func__, hostname); -#endif + DEBUG_PRINTF(1,("%s: client name: %s\n", __func__, hostname)); /* * Ignore the gateway from whoami (unreliable). @@ -309,16 +290,12 @@ net_getparams(int sock) } if (smask) { netmask = smask; -#ifdef NETIF_DEBUG - if (debug) - printf("%s: subnet mask: %s\n", __func__, - intoa(netmask)); -#endif + DEBUG_PRINTF(1,("%s: subnet mask: %s\n", __func__, + intoa(netmask))); } -#ifdef NETIF_DEBUG - if (gateip.s_addr && debug) - printf("%s: net gateway: %s\n", __func__, inet_ntoa(gateip)); -#endif + if (gateip.s_addr) + DEBUG_PRINTF(1,("%s: net gateway: %s\n", __func__, + inet_ntoa(gateip))); /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { @@ -329,12 +306,10 @@ exit: if ((rootaddr = net_parse_rootpath()) != INADDR_NONE) rootip.s_addr = rootaddr; -#ifdef NETIF_DEBUG - if (debug) { - printf("%s: server addr: %s\n", __func__, inet_ntoa(rootip)); - printf("%s: server path: %s\n", __func__, rootpath); - } -#endif + DEBUG_PRINTF(1,("%s: proto: %d\n", __func__, netproto)); + DEBUG_PRINTF(1,("%s: server addr: %s\n", __func__, inet_ntoa(rootip))); + DEBUG_PRINTF(1,("%s: server port: %d\n", __func__, rootport)); + DEBUG_PRINTF(1,("%s: server path: %s\n", __func__, rootpath)); return (0); } @@ -410,6 +385,8 @@ net_parse_rootpath(void) (void)strsep(&ptr, ":"); if (ptr != NULL) { addr = inet_addr(rootpath); + DEBUG_PRINTF(1,("rootpath=%s addr=%#x\n", + rootpath, addr)); bcopy(ptr, rootpath, strlen(ptr) + 1); } } else { diff --git a/stand/libsa/bootp.c b/stand/libsa/bootp.c index d919bb59e843..ac37553c6d34 100644 --- a/stand/libsa/bootp.c +++ b/stand/libsa/bootp.c @@ -42,7 +42,6 @@ #include -#define BOOTP_DEBUGxx #define SUPPORT_DHCP #define DHCP_ENV_NOVENDOR 1 /* do not parse vendor options */ @@ -130,10 +129,7 @@ bootp(int sock) } wbuf; struct bootp *rbootp; -#ifdef BOOTP_DEBUG - if (debug) - printf("bootp: socket=%d\n", sock); -#endif + DEBUG_PRINTF(1, ("bootp: socket=%d\n", sock)); if (!bot) bot = getsecs(); @@ -141,10 +137,7 @@ bootp(int sock) printf("bootp: bad socket. %d\n", sock); return; } -#ifdef BOOTP_DEBUG - if (debug) - printf("bootp: d=%lx\n", (long)d); -#endif + DEBUG_PRINTF(1, ("bootp: socktodesc=%lx\n", (long)d)); bp = &wbuf.wbootp; bzero(bp, sizeof(*bp)); @@ -225,31 +218,20 @@ bootp(int sock) netmask = htonl(IN_CLASSB_NET); else netmask = htonl(IN_CLASSC_NET); -#ifdef BOOTP_DEBUG - if (debug) - printf("'native netmask' is %s\n", intoa(netmask)); -#endif + DEBUG_PRINTF(1, ("'native netmask' is %s\n", intoa(netmask))); } -#ifdef BOOTP_DEBUG - if (debug) - printf("mask: %s\n", intoa(netmask)); -#endif + DEBUG_PRINTF(1,("rootip: %s\n", inet_ntoa(rootip))); + DEBUG_PRINTF(1,("mask: %s\n", intoa(netmask))); /* We need a gateway if root is on a different net */ if (!SAMENET(myip, rootip, netmask)) { -#ifdef BOOTP_DEBUG - if (debug) - printf("need gateway for root ip\n"); -#endif + DEBUG_PRINTF(1,("need gateway for root ip\n")); } /* Toss gateway if on a different net */ if (!SAMENET(myip, gateip, netmask)) { -#ifdef BOOTP_DEBUG - if (debug) - printf("gateway ip (%s) bad\n", inet_ntoa(gateip)); -#endif + DEBUG_PRINTF(1,("gateway ip (%s) bad\n", inet_ntoa(gateip))); gateip.s_addr = 0; } @@ -264,18 +246,11 @@ bootpsend(struct iodesc *d, void *pkt, size_t len) { struct bootp *bp; -#ifdef BOOTP_DEBUG - if (debug) - printf("bootpsend: d=%lx called.\n", (long)d); -#endif - + DEBUG_PRINTF(1,("bootpsend: d=%lx called.\n", (long)d)); bp = pkt; bp->bp_secs = htons((u_short)(getsecs() - bot)); -#ifdef BOOTP_DEBUG - if (debug) - printf("bootpsend: calling sendudp\n"); -#endif + DEBUG_PRINTF(1,("bootpsend: calling sendudp\n")); return (sendudp(d, pkt, len)); } @@ -288,34 +263,22 @@ bootprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft, struct bootp *bp; void *ptr; -#ifdef BOOTP_DEBUG - if (debug) - printf("bootp_recvoffer: called\n"); -#endif + DEBUG_PRINTF(1,("bootp_recvoffer: called\n")); ptr = NULL; n = readudp(d, &ptr, (void **)&bp, tleft); if (n == -1 || n < sizeof(struct bootp) - BOOTP_VENDSIZE) goto bad; -#ifdef BOOTP_DEBUG - if (debug) - printf("bootprecv: checked. bp = %p, n = %zd\n", bp, n); -#endif + DEBUG_PRINTF(1,("bootprecv: checked. bp = %p, n = %zd\n", bp, n)); + if (bp->bp_xid != htonl(d->xid)) { -#ifdef BOOTP_DEBUG - if (debug) { - printf("bootprecv: expected xid 0x%lx, got 0x%x\n", - d->xid, ntohl(bp->bp_xid)); - } -#endif + DEBUG_PRINTF(1,("bootprecv: expected xid 0x%lx, got 0x%x\n", + d->xid, ntohl(bp->bp_xid))); goto bad; } -#ifdef BOOTP_DEBUG - if (debug) - printf("bootprecv: got one!\n"); -#endif + DEBUG_PRINTF(1,("bootprecv: got one!\n")); /* Suck out vendor info */ if (bcmp(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)) == 0) { @@ -359,10 +322,7 @@ vend_rfc1048(u_char *cp, u_int len) u_char tag; const char *val; -#ifdef BOOTP_DEBUG - if (debug) - printf("vend_rfc1048 bootp info. len=%d\n", len); -#endif + DEBUG_PRINTF(1,("vend_rfc1048 bootp info. len=%d\n", len)); ep = cp + len; /* Step over magic cookie */ @@ -443,10 +403,8 @@ vend_cmu(u_char *cp) { struct cmu_vend *vp; -#ifdef BOOTP_DEBUG - if (debug) - printf("vend_cmu bootp info.\n"); -#endif + DEBUG_PRINTF(1,("vend_cmu bootp info.\n")); + vp = (struct cmu_vend *)cp; if (vp->v_smask.s_addr != 0) { diff --git a/stand/libsa/pkgfs.c b/stand/libsa/pkgfs.c index 64ebdf033f14..32d488de5cfb 100644 --- a/stand/libsa/pkgfs.c +++ b/stand/libsa/pkgfs.c @@ -31,12 +31,6 @@ #include #include -#ifdef PKGFS_DEBUG -#define DBG(x) printf x -#else -#define DBG(x) -#endif - static int pkg_open(const char *, struct open_file *); static int pkg_close(struct open_file *); static int pkg_read(struct open_file *, void *, size_t, size_t *); @@ -172,6 +166,9 @@ pkgfs_init(const char *pkgname, struct fs_ops *proto) exclusive_file_system = NULL; + DEBUG_PRINTF(0, ("%s(%s: '%s') -> %d (error=%d)\n", __func__, + proto->fs_name, pkgname, fd, errno)); + if (fd == -1) return (errno); @@ -239,7 +236,7 @@ pkg_open_follow(const char *fn, struct open_file *f, int lnks) if (strcmp(fn, tf->tf_hdr.ut_name) == 0) { f->f_fsdata = tf; tf->tf_fp = 0; /* Reset the file pointer. */ - DBG(("%s: found %s type %c\n", __func__, + DEBUG_PRINTF(1, ("%s: found %s type %c\n", __func__, fn, tf->tf_hdr.ut_typeflag[0])); if (tf->tf_hdr.ut_typeflag[0] == '2') { /* we have a symlink @@ -275,6 +272,7 @@ pkg_close(struct open_file *f) /* * Free up the cache if we read all of the file. */ + DEBUG_PRINTF(1, ("%s(%s)\n", __func__, tf->tf_hdr.ut_name)); if (tf->tf_fp == tf->tf_size && tf->tf_cachesz > 0) { free(tf->tf_cache); tf->tf_cachesz = 0; @@ -297,6 +295,8 @@ pkg_read(struct open_file *f, void *buf, size_t size, size_t *res) return (EBADF); } + DEBUG_PRINTF(4, ("%s(%s,%zd)\n", __func__, tf->tf_hdr.ut_name, size)); + if (tf->tf_cachesz == 0) cache_data(tf, 1); @@ -334,6 +334,8 @@ pkg_read(struct open_file *f, void *buf, size_t size, size_t *res) tf->tf_fp = fp; if (res != NULL) *res = size; + DEBUG_PRINTF(4, ("%s(%s) res=%zd\n", __func__, tf->tf_hdr.ut_name, + (ssize_t)(tf->tf_size - tf->tf_fp))); return ((sz == -1) ? errno : 0); } @@ -377,7 +379,7 @@ pkg_seek(struct open_file *f, off_t ofs, int whence) return (tf->tf_fp); } } - DBG(("%s: negative file seek (%jd)\n", __func__, + DEBUG_PRINTF(3, ("%s: negative file seek (%jd)\n", __func__, (intmax_t)delta)); errno = ESPIPE; return (-1); @@ -511,26 +513,28 @@ cache_data(struct tarfile *tf, int force) size_t sz; if (tf == NULL) { - DBG(("%s: no file to cache data for?\n", __func__)); + DEBUG_PRINTF(5, ("%s: no file to cache data for?\n", + __func__)); errno = EINVAL; return (-1); } pkg = tf->tf_pkg; if (pkg == NULL) { - DBG(("%s: no package associated with file?\n", __func__)); + DEBUG_PRINTF(5, ("%s: no package associated with file?\n", + __func__)); errno = EINVAL; return (-1); } if (tf->tf_cachesz > 0) { - DBG(("%s: data already cached\n", __func__)); + DEBUG_PRINTF(5, ("%s: data already cached\n", __func__)); errno = EINVAL; return (-1); } if (tf->tf_ofs != pkg->pkg_ofs) { - DBG(("%s: caching after force read of file %s?\n", + DEBUG_PRINTF(5, ("%s: caching after force read of file %s?\n", __func__, tf->tf_hdr.ut_name)); errno = EINVAL; return (-1); @@ -548,7 +552,8 @@ cache_data(struct tarfile *tf, int force) tf->tf_cache = malloc(sz); if (tf->tf_cache == NULL) { - DBG(("%s: could not allocate %d bytes\n", __func__, (int)sz)); + DEBUG_PRINTF(5, ("%s: could not allocate %d bytes\n", + __func__, (int)sz)); errno = ENOMEM; return (-1); } @@ -732,7 +737,7 @@ new_package(int fd, struct package **pp) } /* - * Done parsing the ZIP header. Spkgt the inflation engine. + * Done parsing the ZIP header. Start the inflation engine. */ error = inflateInit2(&pkg->pkg_zs, -15); if (error != Z_OK) diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h index e1188fb73a26..8b7d93074ef2 100644 --- a/stand/libsa/stand.h +++ b/stand/libsa/stand.h @@ -558,4 +558,17 @@ void tslog_getbuf(void ** buf, size_t * len); __END_DECLS +/* define _DEBUG_LEVEL n or _DEBUG_LEVEL_VAR before include */ +#ifndef DEBUG_PRINTF +# if defined(_DEBUG_LEVEL) || defined(_DEBUG_LEVEL_VAR) +# ifndef _DEBUG_LEVEL_VAR +# define _DEBUG_LEVEL_VAR _debug +static int _debug = _DEBUG_LEVEL; +# endif +# define DEBUG_PRINTF(n, args) if (_DEBUG_LEVEL_VAR >= n) printf args +# else +# define DEBUG_PRINTF(n, args) +# endif +#endif + #endif /* STAND_H */ From nobody Fri Jul 18 09:53:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bk4q41vLnz6259Q; Fri, 18 Jul 2025 09:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bk4q40wLYz46Sf; Fri, 18 Jul 2025 09:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T+5H/lCmEEr8jQ5fbKMPMmUYHAnTJNs369oG5RbbyVc=; b=KKGl2CvHAOLyRXVSDY2jnbGETc052CAXPwwQTgMbrrVJAu+uLlgSefxToVD4EGktGMqV+1 bp6C9ncrSZQk6VclX1oeb86QQ8A8/EqmZJsXaDhXJLBtrZP4uTNNuRilM9ewLJKzmuypas 4Le/25czkMAtH/Re9QfgnhI6F/orfTpzp1pJywqn1X4GbG0WLqDgiYcrZ/twOK2+fFDcHz 9kksnif28/f9qZEXGBJEF5KtHWN3mJ4IjqcDp6NupvYelN9EYfvzWJT3bIQNEW/00p6Ye9 bIZCXJUYDRObNdcb1dIefhMwJxdmiiesE0PQ9UHp2lmMkw4Fl64Z/tUbFo+nhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T+5H/lCmEEr8jQ5fbKMPMmUYHAnTJNs369oG5RbbyVc=; b=j2gK54FFnexpuLEB5Pa8P2jDcqbzRoAEEPY0G0jnk5Qc4zdmm6ZolxxiO24y5QE+7I1Epg LFXI4n+l3stGzhTLVlUYpeEFI2eWNJ+h7Gu6oUA+ZcTC0rjJUOnVdbBJTP1Kk/RmDLeqcK 1ORMaR8B3BRkcDWAdxH6DajirgccGocXcIX8z6MMSYRHKo077AJO8XuOM4fsLHW2edNKJJ Bx4BBePsyP9liav2MbfD71gKq07NMdu4JVAuIv8mBxpLrmro/KbAXe+SK6bMBOa0x2nB2S k7BWOhOrJSiwF0ZXNEY4SzuO47ohN02BHFBR7dpJShaVuplaq4fqfBbjnk/nvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752832384; a=rsa-sha256; cv=none; b=Vs0t1GjjElifO8MkRkc3bIRq8botAGo23GQQSWWo042EGG6su9YYtbjk4uPmv1MQZcwr4L TO/U5XhPsjtP3+std8WPOWlIzElqNheHywLMlecmI9kN4r4G21OZkG6YRfihfTEaN6c9+3 Eu4rb0+IoWN4vt4E2ZD8yvXIf1Ec45wB+YYD6bLGbUaj050kcAibMow2iopfI137fFb0Zn Re0QhpvHY2RyHEWtz3V0DOkxALJLMtTVxKoUPF/EMgoXSYBHqb0uFvS2lyu/DGk5qV3QGT cooEc88rppB1TFQ49lxCaHMgBpA5ihQ66n1rxxIqolP6xRiwhL9bVizZPretYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bk4q40WsQzbjP; Fri, 18 Jul 2025 09:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56I9r331046818; Fri, 18 Jul 2025 09:53:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56I9r37Z046815; Fri, 18 Jul 2025 09:53:03 GMT (envelope-from git) Date: Fri, 18 Jul 2025 09:53:03 GMT Message-Id: <202507180953.56I9r37Z046815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ec281d797c4f - main - pf: fix zero division found by syzkaller List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec281d797c4f0b4848c519fae97b5c2c6f368ec5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ec281d797c4f0b4848c519fae97b5c2c6f368ec5 commit ec281d797c4f0b4848c519fae97b5c2c6f368ec5 Author: Kristof Provost AuthorDate: 2025-07-09 13:14:50 +0000 Commit: Kristof Provost CommitDate: 2025-07-18 07:33:29 +0000 pf: fix zero division found by syzkaller The sanity checks in pf(4) ioctls are not powerful enough to detect invalid port ranges (or even invalid rules). syzkaller does not use pfctl(8), it uses ioctl(2) to pass some random chunk of memory as a rule to pf(4). Fix adds explicit check for 0 divider to pf_get_transaddr(). It should make syzkaller happy without disturbing anyone else. OK gnezdo@ Reported-by: syzbot+d1f00da48fa717e171f3@syzkaller.appspotmail.com Obtained from: OpenBSD, sashan , 38bfd041cb Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_lb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 26f7ab41eef4..9c7863bb301e 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -1012,10 +1012,13 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, if (rpool->proxy_port[1]) { uint32_t tmp_nport; + uint16_t div; - tmp_nport = ((ntohs(pd->ndport) - ntohs(r->dst.port[0])) % - (rpool->proxy_port[1] - rpool->proxy_port[0] + - 1)) + rpool->proxy_port[0]; + div = r->rdr.proxy_port[1] - r->rdr.proxy_port[0] + 1; + div = (div == 0) ? 1 : div; + + tmp_nport = ((ntohs(pd->ndport) - ntohs(r->dst.port[0])) % div) + + rpool->proxy_port[0]; /* Wrap around if necessary. */ if (tmp_nport > 65535) From nobody Fri Jul 18 09:53:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bk4q53SH2z625dp; Fri, 18 Jul 2025 09:53:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bk4q51cCgz46Bp; Fri, 18 Jul 2025 09:53:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ijEXlgv7KJLUBa4HLRd9A5XfhYmujoHFjSsWavfGuoQ=; b=qXEJ5tv4b9w8DEhOPXJTBmf/4Lz4ZE901oL8gK2w1aAuAeZuigQ/F7E0nNndGyCtG7BtFN lTyQJqWNKa6mPhVdo2BguH+kGSs21vsTAKNK5WFscTsHQIVIZtg2v8G8O/LpN1qpnUby71 bae3YOHXA/buKu3O1CILO6qvk9j+T1rijxxA9Wd0SSgSjIY7fUdPoxw0VyWzctBDrBLr4K EnCp3R6vYQ+mRhYJCWKadwVgI1QLXkZ1NrfHPI2BMBdpfyu6FtM0LFmnGFIEq9hqoyiSnC agYSwe03Nkc4RzUGSPMLXK1yoPfXaMB5XS7EnBYzVhgy0dj/LHz2KgFI6IbCUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ijEXlgv7KJLUBa4HLRd9A5XfhYmujoHFjSsWavfGuoQ=; b=B4ucx1Holt5gQvfed6KnEEozVJqdlYFael5w01aFHT0icaeupCvL/slSYKgwlbQ70PG53X EVAOnthI//CCupP0CyxXmR3kqCoPvwBOGIzQKSeVBgQvVnoG8jItfcATRjt6NAouPj73dq HXbOHcEGJzJ4zpv6jLO14VrC4RHLXiIuxsYq1HukhuUq7HeG4Qc4QY5LwjFVteBAxDso/j 5fDeRQ2BzrJ1jjBFehFbPTExGaIFTnQFwrZiWFT+IPgzQsiuw7HjC50Ww3Is+0xbi2NCC7 eNow6H8gcQc3LUo+zATiEIQUvnoH6QWuk0RPGvm/Juf2pNyvMMpp7yL7dx7Cww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752832385; a=rsa-sha256; cv=none; b=knwYtuBpwi08qGL5dwr9fXKeQaVHA/1IlB5/hywZTrBQXQUqKcxsby41Wd4pJu3nuFnTIJ Ej6yVYxI7oiBrOvpAg1C3pn5ExLh15/EB1tuGmcKE47tOlefBFmtv6dkF/T890elD005S6 34dZFMvnLzF7lszUSPKFtRFa8Z8dRl/wz43FTnIv0VhjHfzY3abg+XHEvJmzoPSXbhSiBG rb2p74oew+HddeBOg2bNKS0WC6hNOGFODg5DDesxIKi/qbxCAVt3i2Z8Mv5PyjHUCW030h MEEHCA7wd2lcP0pYNFz2J6Tn+SKVi7nvc+fovH9u7/Aza1keQ9wjyNKsoCgVPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bk4q515SvzbjQ; Fri, 18 Jul 2025 09:53:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56I9r5Gc046851; Fri, 18 Jul 2025 09:53:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56I9r5Od046848; Fri, 18 Jul 2025 09:53:05 GMT (envelope-from git) Date: Fri, 18 Jul 2025 09:53:05 GMT Message-Id: <202507180953.56I9r5Od046848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: da319c4d8c20 - main - pf.conf.5: update syncookie example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da319c4d8c20e9a99d36865e1529e84b47b53289 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=da319c4d8c20e9a99d36865e1529e84b47b53289 commit da319c4d8c20e9a99d36865e1529e84b47b53289 Author: Kristof Provost AuthorDate: 2025-07-09 13:16:42 +0000 Commit: Kristof Provost CommitDate: 2025-07-18 07:33:29 +0000 pf.conf.5: update syncookie example Multiply the number of states in the example adaptive timeout calculation by 10 so it works with the numbers in the config, which were previously multiplied. ok dlg@ Obtained from: OpenBSD, jmatthew , 5642facce3 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 11e22ebc78bf..ea3735482e42 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -365,7 +365,7 @@ set timeout { adaptive.start 60000, adaptive.end 120000 } set limit states 100000 .Ed .Pp -With 9000 state table entries, the timeout values are scaled to 50% +With 90000 state table entries, the timeout values are scaled to 50% (tcp.first 60, tcp.established 43200). .It Ar set loginterface Enable collection of packet and byte count statistics for the given From nobody Fri Jul 18 09:53:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bk4q70Gywz625gr; Fri, 18 Jul 2025 09:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bk4q62z94z46F7; Fri, 18 Jul 2025 09:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v+u/592UpXRIeubSbp4PM1KdS4hU+NbpWQ21tNe6ah0=; b=bbBtvimfJVwLypFmP0vkQVtmcTKtIYdhfqHn/taNn/xGK1GIMRacTJy8hMzSQ5qa5+i/sH vQR+35bqdWN2/AnNYQlTW2bhkg9l8O3dQ2swFYQbw6CzSkyqAH2CkeC/p41F4TaPJlzPDy Gsi7x8YBBMFgXXBJ2yK+gp3x/TWVnWjSPW2j2UmvOhgsz2Wlno3Pjezi/6VCqCmm1zT317 LjTxohXHWotDm38253bJE/Z5kxItaYh/rv8u/0HJMxE/PoTiIgwYmHBRskc7GwfsJFURU5 VOQ9PsQywPSwiXtUXyAxWS048JNWmh/96enFElymVr40pE7sKLtsJD/QVWRueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v+u/592UpXRIeubSbp4PM1KdS4hU+NbpWQ21tNe6ah0=; b=l59+7hXinHtmT6sWA8nuMahvCEb13/g1RFOwEDs89dlI0aiUMT6TO2S9ZaO142Aa3FOsO7 DXil97C7xQzxNEaku8N2Zgwj0PIICe49YB2MnIgh18ZZph6cDNGdeBdMG+y3W+vLkbnqTB 47cVCD5aVJ4h7ZSKfU5bUbCUGfO1lmASVZ40TtDvl8yW61fYBKyDAZJQIkQWdga9sExaKU RghKhCSEhrmdtGVckXhqheOv8NIFab9XDz+og7mmXxEV9SkK+1gl0b5+15gYUMWm5UgbL5 ZoQKY/7462hQBcQaoilWCBAEsXMFw+aKJYc9Vl3oIZhfwimg6cr4BEr/V9F9Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752832386; a=rsa-sha256; cv=none; b=PPKZGsIKUU6g6cWSPFiQskTr1oewcfnpqMzdfRpDEoDO+IBCdYqNJXn/BfvrW+Sl/nqklU O7RGlZWIhiBkiudK0tWnHx6d73BxdtCW2+oP5pwom6yk4dtfxc6jU1qclRIBu8YGrswluF IluqJrTYi0YJrzH56qk+F4f8y+GxtTYthkfoiuEyhJJIN6JTX0P5IEtkXW0GGiGVeXpc2A pRsdH9BEJLhOUYUETrUJsdPMt/0cyUw81sKzUDTps9pBhXNHNTbdtIzXTTsm55zpknWeVZ Tfjb62OE1X/yjy7teuv6tPlhxagxKuDlKyKSQnS+K5DfNiUwUqZtowIHJDtIUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bk4q62M8hzc8b; Fri, 18 Jul 2025 09:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56I9r6Kx046884; Fri, 18 Jul 2025 09:53:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56I9r6ck046881; Fri, 18 Jul 2025 09:53:06 GMT (envelope-from git) Date: Fri, 18 Jul 2025 09:53:06 GMT Message-Id: <202507180953.56I9r6ck046881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c3cc26afc922 - main - pf: stricter af checks for af-to rules List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3cc26afc9226d808389bca8e939f408415b72ad Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3cc26afc9226d808389bca8e939f408415b72ad commit c3cc26afc9226d808389bca8e939f408415b72ad Author: Kristof Provost AuthorDate: 2025-07-09 14:48:06 +0000 Commit: Kristof Provost CommitDate: 2025-07-18 07:33:29 +0000 pf: stricter af checks for af-to rules An af-to pf rule must have an address family naf to use after translation. Make stricter sanity checks in pf ioctl to avoid later crashes during packet processing. Reported-by: syzbot+0ef9190e7d0195496d0d@syzkaller.appspotmail.com OK sashan@ Obtained from: OpenBSD, bluhm , 035d4f5430 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 3caa0d2e3b11..937619977fd9 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2041,6 +2041,34 @@ pf_ioctl_getrules(struct pfioc_rule *pr) return (0); } +static int +pf_rule_checkaf(struct pf_krule *r) +{ + switch (r->af) { + case 0: + if (r->rule_flag & PFRULE_AFTO) + return (EPFNOSUPPORT); + break; + case AF_INET: + if ((r->rule_flag & PFRULE_AFTO) && r->naf != AF_INET6) + return (EPFNOSUPPORT); + break; +#ifdef INET6 + case AF_INET6: + if ((r->rule_flag & PFRULE_AFTO) && r->naf != AF_INET) + return (EPFNOSUPPORT); + break; +#endif /* INET6 */ + default: + return (EPFNOSUPPORT); + } + + if ((r->rule_flag & PFRULE_AFTO) == 0 && r->naf != 0) + return (EPFNOSUPPORT); + + return (0); +} + static int pf_validate_range(uint8_t op, uint16_t port[2]) { @@ -2073,6 +2101,8 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, #define ERROUT(x) ERROUT_FUNCTION(errout, x) + if ((error = pf_rule_checkaf(rule))) + ERROUT(error); if (pf_validate_range(rule->src.port_op, rule->src.port)) ERROUT(EINVAL); if (pf_validate_range(rule->dst.port_op, rule->dst.port)) @@ -3741,6 +3771,10 @@ DIOCGETRULENV_error: break; } + if ((error = pf_rule_checkaf(newrule))) { + pf_krule_free(newrule); + break; + } if (newrule->ifname[0]) kif = pf_kkif_create(M_WAITOK); pf_counter_u64_init(&newrule->evaluations, M_WAITOK); From nobody Fri Jul 18 09:53:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bk4q75LcSz625bW; Fri, 18 Jul 2025 09:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bk4q73Pdhz46HX; Fri, 18 Jul 2025 09:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RhdNmgByyfW1Cj9gelmlTPcjY1hv7aLS5IiDkPeaL2U=; b=CYxAK43sLiXn/HSCuL1xmMuyayu7JELH0ZW/e0BSw5q2OEWFntlarR8BEk0LltS3qURZPt 18fe4sYAkfKYTpIcxNG76N6CZJKGblNVJ1+5zE+RtGturObLwpMDtShffipT/kqQdchq0b NagJ7LkulYSnLCu8gwXsLcmS38axNXcMR3ViM3cTK3rKDxNtW2gcv7T9FTcpQZyfA3UmPz sixxhPjN46CQiXKzbkpbroAQQAFSfVE9DGOMTR6v22jnsYdzbL/nf8mGPGk0oQKZshz633 kT1f34ZwC08IB9JKp+r4zg6FHnz4JmoyWd3kRk+SuZrsAqRjW6eGPNotr25N3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RhdNmgByyfW1Cj9gelmlTPcjY1hv7aLS5IiDkPeaL2U=; b=ERRKT0njChMfqF+LdinMu0W06AiCAoD1MIlp6YL9cIfQcge6+/lxFXxPM8IgITFdtSGN5a r9VCjgvvJM2oCku7en5Mh4CmEKr9EMTTvaURltsA/yykTNYfbabPWKbjpVX4Cs2spMSxcz xFf0opyInJfslgx9y765Zy5znETaL7FWiwDDPSJLZEc8rYn4jbrbuH7gFxjNioswsR3N5A OTq1TRz0QfjS68UQml1xv1Nd4oxQqvv5OQRfeOYEXxbxxE5ELk64/AimP6MTzTgezwueTy cnFbod//6/xbx0d1bA25mogkBkJb3HB49B3PZBefnA4lX/wN3lTXCxe1XFilGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752832387; a=rsa-sha256; cv=none; b=Ew/SUcDULMPnA1gUSfLTvFcfJC0elAW4VgPg7/Bk6s3ecknRlqsRNzF/0K3gYkwaXqi+3T DwrtAXHY/+cON0h9IWG/H4lMe7x/u2oYI3rDrAaElODX4aHOaQhib2I+hWi9/PEo9CT7Il 4xc90/CY56vlMKpGVOb2uMbMJGQtVYe8uFmq7V0r2a0KkvTFsWR3zKTkYBb3fIqtGhriqt 2QKfgXZq/xSrgbQSYWDH4Ryaz2aVnS81cf+l51wmQVW6ess52L5VXXxPRZZuCzX+emuV8R cZbMfNbOhXfHJB1BXZFxemsbFW2E0KJvH9Oja08xjgdC1DnX0WDRWUX+D+t65Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bk4q73066zc8c; Fri, 18 Jul 2025 09:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56I9r7eU046920; Fri, 18 Jul 2025 09:53:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56I9r7EM046916; Fri, 18 Jul 2025 09:53:07 GMT (envelope-from git) Date: Fri, 18 Jul 2025 09:53:07 GMT Message-Id: <202507180953.56I9r7EM046916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 912333007432 - main - pf.conf.5: Avoid gendered language in man pages when not referring to a specific person. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9123330074321d4a8687ff9feee30098efe4e693 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9123330074321d4a8687ff9feee30098efe4e693 commit 9123330074321d4a8687ff9feee30098efe4e693 Author: Kristof Provost AuthorDate: 2025-07-09 15:09:18 +0000 Commit: Kristof Provost CommitDate: 2025-07-18 07:33:29 +0000 pf.conf.5: Avoid gendered language in man pages when not referring to a specific person. Rewrite or use singular they. ok thfr@ sthen@ daniel@ ian@ job@ kmos@ jcs@ ratchov@ phessler@ and others I'm likely missing on an earlier version. feedback tj@, feedback and ok jmc@ Obtained from: OpenBSD, jsg , 25a24f0b58 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index ea3735482e42..5a9d8f350739 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -2784,8 +2784,8 @@ This means that it will not work on other protocols and will not match a currently established connection. .Pp Caveat: operating system fingerprints are occasionally wrong. -There are three problems: an attacker can trivially craft his packets to -appear as any operating system he chooses; +There are three problems: an attacker can trivially craft packets to +appear as any operating system; an operating system patch could change the stack behavior and no fingerprints will match it until the database is updated; and multiple operating systems may have the same fingerprint. From nobody Fri Jul 18 09:53:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bk4qB0jlSz625gt; Fri, 18 Jul 2025 09:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bk4q957RDz46Fk; Fri, 18 Jul 2025 09:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bvh2y3HZ8zgJF45oFbDMLc3MXKmFB0CG97PT00Cthn8=; b=wXJ8vo2EUPr2VH74N08OIZVnCKpYEUcVWmhMyG2ej7CvpTpAiC+CsQPu4DeX3gc+M/DYmK dgmbSI1HcFZmLL6g5mjKGJaBeZjHB+EtVhpRG5C2QEsreFkfTL0nlNEkS3p6bA6ahzIbK9 2yi4CzSBFDVhIvKuej35IovOLZRSTyMwJHai55mIoh6RRMeSh0ePL01P0SlSwAHk5GADHJ 21X3Z4pv/iesgpxh7fX19Bg/eHYlgQNky3RuI2ufP+D1BWRNG3eQ0YbIR1T1WSgcOhbaAi HFcWIsfe5r6JWnZu5X1SwkB/d4DZNoI9ZsWbzd6s2rFD5vXyG5OQvOm10VbbFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bvh2y3HZ8zgJF45oFbDMLc3MXKmFB0CG97PT00Cthn8=; b=riTK7t/PPEf01cx+ZFXrzn4tJ11BHx7RyEWuKU1XNumpPB4+iw78CCQjxRxyxFnVXBaglN pYHcR44sViSjUQpRffkI8f499lxB5I7UtG/3aekEkm1pvNeNpu/MbwizEqkZbivWoDEHeM wMUdXleiYgLTTrN0JAUjUyRaooOGvDdWPa3hfCexa/FBi6bZGTjUd441zqkpB5M0HDtqD3 rAS7uToAFgiBGXzIkzPJps4ns1OPTzs63hG7/TEzYvmoMoVqg80j2cr1FOUnBdGI13GQcf F6pfCikC9uGdgcfAF51xx+LwCZvjPiP2LjnFk9vrOxoW5Zw3wdUUVK0Rs1vUpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752832389; a=rsa-sha256; cv=none; b=a5eOehMGWfq38eLu1gYVu78/tA9i0AZDZFGjS1Sd1te61nbnWgyXDJgNBFziCMjz1/40f2 7eYb84k1VsvCLOoh/i4yDLGASBCqPGwZgrbC3LDq0PSrpYPJzC4ByyB5Z1oitLZj0yCFSk lMRqOOkfJaQz/zBvP10W/Hkd/YMElprAjoUyKTkIR/rwJMWd5kT+alQs4eTtLmMvtcGWLR ZSjpXwm49U25viBhAOuHtkGrbpMd8UIh3or4WlyYovCyG9/cSJxRfbtKP0eagQeZ1xSP7q GeHQ+x1MKSbofQ1MxOyRiIqFAqbGNcNoOpu48BJA02ZBflT5nBgbBY98Kp50nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bk4q94RJ1zc8d; Fri, 18 Jul 2025 09:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56I9r9he046984; Fri, 18 Jul 2025 09:53:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56I9r9lI046981; Fri, 18 Jul 2025 09:53:09 GMT (envelope-from git) Date: Fri, 18 Jul 2025 09:53:09 GMT Message-Id: <202507180953.56I9r9lI046981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a86b5a2cba3c - main - pf.conf.5: add missing commas between subordinate and main clauses List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a86b5a2cba3c205e1d96a9dff0c150e1815306f3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a86b5a2cba3c205e1d96a9dff0c150e1815306f3 commit a86b5a2cba3c205e1d96a9dff0c150e1815306f3 Author: Kristof Provost AuthorDate: 2025-07-09 15:31:03 +0000 Commit: Kristof Provost CommitDate: 2025-07-18 07:33:30 +0000 pf.conf.5: add missing commas between subordinate and main clauses jmc@ dislikes a comma before "then" in a conditional, so leave those untouched. ok jmc@ Obtained from: OpenBSD, naddy , 41ce3b17e7 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 5a9d8f350739..8954e872c231 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -1387,7 +1387,7 @@ part of the new destination address according to the specified subnet. It is possible to embed a complete IPv4 address into an IPv6 address using a network prefix of /96 or smaller. .Pp -When a destination address is not specified it is assumed that the host +When a destination address is not specified, it is assumed that the host part is 32-bit long. For IPv6 to IPv4 translation this would mean using only the lower 32 bits of the original IPv6 destination address. @@ -3112,7 +3112,7 @@ rule can also contain a filter ruleset in a brace-delimited block. In that case, no separate loading of rules into the anchor is required. Brace delimited blocks may contain rules or other brace-delimited blocks. -When an anchor is populated this way the anchor name becomes optional. +When an anchor is populated this way, the anchor name becomes optional. .Bd -literal -offset indent anchor "external" on $ext_if { block From nobody Fri Jul 18 09:53:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bk4q90tn1z625W1; Fri, 18 Jul 2025 09:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bk4q83zdCz46Nb; Fri, 18 Jul 2025 09:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pkb3vd/Q9KpfxkkqYHCh+mtjpBvAx9PU/1a6cC1UDj8=; b=HIJee6R4RkQLyG8EAN6f397g5f3aDZUg5RdQGQ9udZdGC/9BkbWpEfYJtvQf3SL84lajMZ jBwzFdDjo/WbfsaBLlAURFnrfX2f5s7e18aThK9gp0/U+zPy6+KjeTE6xiHLtbDc6lrLE1 VXP6KFP14wgcPi+/ROM6cC14y8sSEhmJ0y5OdECEkboeE+jNpjvATBsPLjuq8glJwjvkv7 KBbaMoAQq01KHZmxSgZowlf6Trygl+GAc6x/Jz0P5T29oKbKqIiWZrxBO+eam4YJUbKvZL YX1ANgtUywxSlyzS68nh6mOPSYaz9pLgE0V2zZLRpMV7NtFrateaM2AmcCxHFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752832388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pkb3vd/Q9KpfxkkqYHCh+mtjpBvAx9PU/1a6cC1UDj8=; b=WyV442aXakvWPgRDjFReeH9ehCS0DrfVUCRni9GEIYd0Ss5njg1kUg+9eK+Aepmks8TJm8 d1U1AjLwnV1QvvoREVJ2ZQje7I2nxpuvi2E4sNqfxcomNzx4Q3YWwLCr3rMl6u1/30V6fo Z9mvvLMd9qzGOzFlZE1Zj7axBeyq3aVLgbUM6AgQhVvioRXTu0LT1cFZ5jIivdfM2LYtF4 hA8+P+/y6fZaf/HyMRwOyCb+U/3GMmp/Ziln0FrnoH3tRGRiY1nko2ZNNKtSHg3fwu/K/u lD30S9Kp2e48xg12BwFl2X9v92J1Ps3OaPoCjRkuiA6VH7/aqj25P0y3ckwuTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752832388; a=rsa-sha256; cv=none; b=GdeNqYG5k/CKea9Ez/F3G1pf6R7TdJC6ImED4cNCYgNvIMKgibfGEvYhqQa12Urnf02Lhz U2E5s12CTotLxmfw7DL/QE/2W1HmkFVrk5+wo8pOWm+09odZm87h9W5FvtWdJxNDxjidaP /0H5CddL/rVhZ0urlPQbxRCuFypM2s3FULnhLWojUPaqLlnhNqt0i6DA2u9uzxmndewApS GE+h7FPLX+K6LHHTk3Sp+NFsz2hV5HKgNJv4+7f+76UD/0cbqtb4kdDV61VlHlGd683wbu XzrRPsO8TkEWM3qGwdPaoSkmL0yJK4dsc6/6+8hswT2cpiAZaDmLLz9pEtgOsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bk4q83PKdzbjR; Fri, 18 Jul 2025 09:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56I9r8cd046952; Fri, 18 Jul 2025 09:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56I9r8XZ046949; Fri, 18 Jul 2025 09:53:08 GMT (envelope-from git) Date: Fri, 18 Jul 2025 09:53:08 GMT Message-Id: <202507180953.56I9r8XZ046949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 879f6c26b405 - main - pf: Use goto fail consistently to leave the giant switch in pfioctl(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 879f6c26b40554d1e398a7452e0866fba8706138 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=879f6c26b40554d1e398a7452e0866fba8706138 commit 879f6c26b40554d1e398a7452e0866fba8706138 Author: Kristof Provost AuthorDate: 2025-07-09 15:21:33 +0000 Commit: Kristof Provost CommitDate: 2025-07-18 07:33:30 +0000 pf: Use goto fail consistently to leave the giant switch in pfioctl(). To terminate inner switches and loops, break is used. This makes it easier to reason whereto the code jumps. no binary change; OK millert@ sashan@ Obtained from: OpenBSD, bluhm , 462999584c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 170 +++++++++++++++++++++++----------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 937619977fd9..5c69c395c5fc 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -3597,7 +3597,7 @@ DIOCADDRULENV_error: error = pf_rule_to_krule(&pr->rule, rule); if (error != 0) { pf_krule_free(rule); - break; + goto fail; } pr->anchor[sizeof(pr->anchor) - 1] = '\0'; @@ -3756,11 +3756,11 @@ DIOCGETRULENV_error: if (pcr->action < PF_CHANGE_ADD_HEAD || pcr->action > PF_CHANGE_GET_TICKET) { error = EINVAL; - break; + goto fail; } if (pcr->rule.return_icmp >> 8 > ICMP_MAXTYPE) { error = EINVAL; - break; + goto fail; } if (pcr->action != PF_CHANGE_REMOVE) { @@ -3768,12 +3768,12 @@ DIOCGETRULENV_error: error = pf_rule_to_krule(&pcr->rule, newrule); if (error != 0) { pf_krule_free(newrule); - break; + goto fail; } if ((error = pf_rule_checkaf(newrule))) { pf_krule_free(newrule); - break; + goto fail; } if (newrule->ifname[0]) kif = pf_kkif_create(M_WAITOK); @@ -3922,7 +3922,7 @@ DIOCGETRULENV_error: pf_free_rule(newrule); PF_RULES_WUNLOCK(); PF_CONFIG_UNLOCK(); - break; + goto fail; } newrule->nat.cur = TAILQ_FIRST(&newrule->nat.list); @@ -3949,7 +3949,7 @@ DIOCGETRULENV_error: PF_RULES_WUNLOCK(); PF_CONFIG_UNLOCK(); error = EINVAL; - break; + goto fail; } } @@ -3967,7 +3967,7 @@ DIOCGETRULENV_error: PF_RULES_WUNLOCK(); PF_CONFIG_UNLOCK(); error = EEXIST; - break; + goto fail; } if (oldrule == NULL) @@ -4023,7 +4023,7 @@ DIOCCHANGERULE_error: if (sp->timeout >= PFTM_MAX) { error = EINVAL; - break; + goto fail; } if (V_pfsync_state_import_ptr != NULL) { PF_RULES_RLOCK(); @@ -4043,7 +4043,7 @@ DIOCCHANGERULE_error: s = pf_find_state_byid(ps->state.id, ps->state.creatorid); if (s == NULL) { error = ENOENT; - break; + goto fail; } pfsync_state_export((union pfsync_state_union*)&ps->state, @@ -4122,7 +4122,7 @@ DIOCGETSTATES_retry: error = copyout(pstore, out, sizeof(struct pfsync_state_1301) * count); if (error) - break; + goto fail; out = ps->ps_states + nr; } DIOCGETSTATES_full: @@ -4142,7 +4142,7 @@ DIOCGETSTATES_full: if (ps->ps_req_version > PF_STATE_VERSION) { error = ENOTSUP; - break; + goto fail; } if (ps->ps_len <= 0) { @@ -4200,7 +4200,7 @@ DIOCGETSTATESV2_retry: error = copyout(pstore, out, sizeof(struct pf_state_export) * count); if (error) - break; + goto fail; out = ps->ps_states + nr; } DIOCGETSTATESV2_full: @@ -4306,12 +4306,12 @@ DIOCGETSTATESV2_full: if (psp->ifname[0] == '\0') { error = EINVAL; - break; + goto fail; } error = pf_user_strcpy(ps.ifname, psp->ifname, IFNAMSIZ); if (error != 0) - break; + goto fail; ifp = ifunit(ps.ifname); if (ifp != NULL) { psp->baudrate32 = @@ -4372,7 +4372,7 @@ DIOCGETSTATESV2_full: altq = malloc(sizeof(*altq), M_PFALTQ, M_WAITOK | M_ZERO); error = pf_import_kaltq(pa, altq, IOCPARM_LEN(cmd)); if (error) - break; + goto fail; altq->local_flags = 0; PF_RULES_WLOCK(); @@ -4380,7 +4380,7 @@ DIOCGETSTATESV2_full: PF_RULES_WUNLOCK(); free(altq, M_PFALTQ); error = EBUSY; - break; + goto fail; } /* @@ -4392,7 +4392,7 @@ DIOCGETSTATESV2_full: PF_RULES_WUNLOCK(); error = EBUSY; free(altq, M_PFALTQ); - break; + goto fail; } altq->altq_disc = NULL; TAILQ_FOREACH(a, V_pf_altq_ifs_inactive, entries) { @@ -4412,7 +4412,7 @@ DIOCGETSTATESV2_full: if (error) { PF_RULES_WUNLOCK(); free(altq, M_PFALTQ); - break; + goto fail; } if (altq->qname[0] != 0) @@ -4450,13 +4450,13 @@ DIOCGETSTATESV2_full: if (pa->ticket != V_ticket_altqs_active) { PF_RULES_RUNLOCK(); error = EBUSY; - break; + goto fail; } altq = pf_altq_get_nth_active(pa->nr); if (altq == NULL) { PF_RULES_RUNLOCK(); error = EBUSY; - break; + goto fail; } pf_export_kaltq(altq, pa, IOCPARM_LEN(cmd)); PF_RULES_RUNLOCK(); @@ -4480,20 +4480,20 @@ DIOCGETSTATESV2_full: if (pq->ticket != V_ticket_altqs_active) { PF_RULES_RUNLOCK(); error = EBUSY; - break; + goto fail; } nbytes = pq->nbytes; altq = pf_altq_get_nth_active(pq->nr); if (altq == NULL) { PF_RULES_RUNLOCK(); error = EBUSY; - break; + goto fail; } if ((altq->local_flags & PFALTQ_FLAG_IF_REMOVED) != 0) { PF_RULES_RUNLOCK(); error = ENXIO; - break; + goto fail; } PF_RULES_RUNLOCK(); if (cmd == DIOCGETQSTATSV0) @@ -4562,30 +4562,30 @@ DIOCGETSTATESV2_full: if (pca->action < PF_CHANGE_ADD_HEAD || pca->action > PF_CHANGE_REMOVE) { error = EINVAL; - break; + goto fail; } if (pca->addr.addr.type != PF_ADDR_ADDRMASK && pca->addr.addr.type != PF_ADDR_DYNIFTL && pca->addr.addr.type != PF_ADDR_TABLE) { error = EINVAL; - break; + goto fail; } if (pca->addr.addr.p.dyn != NULL) { error = EINVAL; - break; + goto fail; } if (pca->action != PF_CHANGE_REMOVE) { #ifndef INET if (pca->af == AF_INET) { error = EAFNOSUPPORT; - break; + goto fail; } #endif /* INET */ #ifndef INET6 if (pca->af == AF_INET6) { error = EAFNOSUPPORT; - break; + goto fail; } #endif /* INET6 */ newpa = malloc(sizeof(*newpa), M_PFRULE, M_WAITOK); @@ -4708,7 +4708,7 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != 0) { error = ENODEV; - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_clr_tables(&io->pfrio_table, &io->pfrio_ndel, @@ -4724,13 +4724,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_table))) { error = ENOMEM; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_table); @@ -4739,7 +4739,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_add_tables(pfrts, io->pfrio_size, @@ -4756,13 +4756,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_table))) { error = ENOMEM; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_table); @@ -4771,7 +4771,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_del_tables(pfrts, io->pfrio_size, @@ -4789,14 +4789,14 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; - break; + goto fail; } PF_RULES_RLOCK(); n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); if (n < 0) { PF_RULES_RUNLOCK(); error = EINVAL; - break; + goto fail; } io->pfrio_size = min(io->pfrio_size, n); @@ -4807,7 +4807,7 @@ DIOCCHANGEADDR_error: if (pfrts == NULL) { error = ENOMEM; PF_RULES_RUNLOCK(); - break; + goto fail; } error = pfr_get_tables(&io->pfrio_table, pfrts, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -4826,7 +4826,7 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_tstats)) { error = ENODEV; - break; + goto fail; } PF_TABLE_STATS_LOCK(); PF_RULES_RLOCK(); @@ -4835,7 +4835,7 @@ DIOCCHANGEADDR_error: PF_RULES_RUNLOCK(); PF_TABLE_STATS_UNLOCK(); error = EINVAL; - break; + goto fail; } io->pfrio_size = min(io->pfrio_size, n); @@ -4846,7 +4846,7 @@ DIOCCHANGEADDR_error: error = ENOMEM; PF_RULES_RUNLOCK(); PF_TABLE_STATS_UNLOCK(); - break; + goto fail; } error = pfr_get_tstats(&io->pfrio_table, pfrtstats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -4865,7 +4865,7 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || @@ -4874,7 +4874,7 @@ DIOCCHANGEADDR_error: * size, so we didn't fail on overly large requests. * Keep doing so. */ io->pfrio_size = pf_ioctl_maxcount; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_table); @@ -4883,7 +4883,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); - break; + goto fail; } PF_TABLE_STATS_LOCK(); @@ -4904,7 +4904,7 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; - break; + goto fail; } PF_RULES_RLOCK(); @@ -4912,7 +4912,7 @@ DIOCCHANGEADDR_error: if (n < 0) { PF_RULES_RUNLOCK(); error = EINVAL; - break; + goto fail; } io->pfrio_size = min(io->pfrio_size, n); @@ -4924,7 +4924,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_set_tflags(pfrts, io->pfrio_size, @@ -4940,7 +4940,7 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != 0) { error = ENODEV; - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_clr_addrs(&io->pfrio_table, &io->pfrio_ndel, @@ -4956,13 +4956,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), @@ -4970,7 +4970,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_add_addrs(&io->pfrio_table, pfras, @@ -4990,13 +4990,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), @@ -5004,7 +5004,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_del_addrs(&io->pfrio_table, pfras, @@ -5024,17 +5024,17 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size2 < 0) { error = EINVAL; - break; + goto fail; } count = max(io->pfrio_size, io->pfrio_size2); if (count > pf_ioctl_maxcount || WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { error = EINVAL; - break; + goto fail; } totlen = count * sizeof(struct pfr_addr); pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, @@ -5042,7 +5042,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_set_addrs(&io->pfrio_table, pfras, @@ -5063,13 +5063,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), @@ -5091,13 +5091,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_astats)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_astats))) { error = EINVAL; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_astats); pfrastats = mallocarray(io->pfrio_size, @@ -5119,13 +5119,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), @@ -5133,7 +5133,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_clr_astats(&io->pfrio_table, pfras, @@ -5153,13 +5153,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), @@ -5167,7 +5167,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); - break; + goto fail; } PF_RULES_RLOCK(); error = pfr_tst_addrs(&io->pfrio_table, pfras, @@ -5187,13 +5187,13 @@ DIOCCHANGEADDR_error: if (io->pfrio_esize != sizeof(struct pfr_addr)) { error = ENODEV; - break; + goto fail; } if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; - break; + goto fail; } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), @@ -5201,7 +5201,7 @@ DIOCCHANGEADDR_error: error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); error = pfr_ina_define(&io->pfrio_table, pfras, @@ -5236,13 +5236,13 @@ DIOCCHANGEADDR_error: if (io->esize != sizeof(*ioe)) { error = ENODEV; - break; + goto fail; } if (io->size < 0 || io->size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { error = EINVAL; - break; + goto fail; } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), @@ -5250,7 +5250,7 @@ DIOCCHANGEADDR_error: error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); for (i = 0, ioe = ioes; i < io->size; i++, ioe++) { @@ -5317,13 +5317,13 @@ DIOCCHANGEADDR_error: if (io->esize != sizeof(*ioe)) { error = ENODEV; - break; + goto fail; } if (io->size < 0 || io->size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { error = EINVAL; - break; + goto fail; } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), @@ -5331,7 +5331,7 @@ DIOCCHANGEADDR_error: error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); for (i = 0, ioe = ioes; i < io->size; i++, ioe++) { @@ -5400,14 +5400,14 @@ DIOCCHANGEADDR_error: if (io->esize != sizeof(*ioe)) { error = ENODEV; - break; + goto fail; } if (io->size < 0 || io->size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { error = EINVAL; - break; + goto fail; } totlen = sizeof(struct pfioc_trans_e) * io->size; @@ -5416,7 +5416,7 @@ DIOCCHANGEADDR_error: error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); - break; + goto fail; } PF_RULES_WLOCK(); /* First makes sure everything will succeed. */ @@ -5557,7 +5557,7 @@ DIOCCHANGEADDR_error: if (psn->psn_len == 0) { psn->psn_len = sizeof(struct pf_src_node) * nr; - break; + goto fail; } nr = 0; @@ -5582,7 +5582,7 @@ DIOCCHANGEADDR_error: sizeof(struct pf_src_node) * nr); if (error) { free(pstore, M_TEMP); - break; + goto fail; } psn->psn_len = sizeof(struct pf_src_node) * nr; free(pstore, M_TEMP); @@ -5638,14 +5638,14 @@ DIOCCHANGEADDR_error: if (io->pfiio_esize != sizeof(struct pfi_kif)) { error = ENODEV; - break; + goto fail; } if (io->pfiio_size < 0 || io->pfiio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfiio_size, sizeof(struct pfi_kif))) { error = EINVAL; - break; + goto fail; } io->pfiio_name[sizeof(io->pfiio_name) - 1] = '\0'; From nobody Fri Jul 18 14:30:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkBzS5TwDz62P3m; Fri, 18 Jul 2025 14:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkBzS4F5Nz3rnq; Fri, 18 Jul 2025 14:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752849044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z75daaBpL/CE3T41H+Y/H++Mol3VU/XB6UqK6qySg9g=; b=R/Am3RF1bV2cwCUM2EJKtxcJgDWE1hkwmSKR8lGlY8HFl2Rm8biqREwnAPsboA7PwRm1xE gPExR/SeYDI62j7N5+xJU4MwEyuh7kgla1/rXS1jpagIeBZihHGq9l/uxqxj2h20jmHxyJ GU40GwUPFPVaGX4pcQpKh2o2AXxfx8useUNDqs4bUDSO6Cj9sdOxpvVOWLM72zbYkwwFae D6eTmwHaVqSSqd4NTAPkC/HUbOz+3Om67zs+2bsTuGQkVjYzDFXjF/93TQx0FOO9ME/cBT SLOluSD0R9OhcSnpj7MatwwEDlOq6+iLT8QTbqAz6CRgWQV/xWXjjIwU45QJbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752849044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z75daaBpL/CE3T41H+Y/H++Mol3VU/XB6UqK6qySg9g=; b=nlsyZGskKEzBL56YUl0DZd6cQcKOsCeZQoPncEejSlVlTG7Tl5LyZyaNj2XsqoRBmm6COZ JTJzPTUuN0I8CGx+MSbGQ5inbOJQInqLeYXLoYQpGhdRNaIJoA2M6E7BmUdvg12YIaXLJb 9jTH3GrsdYrOCB/qVWWT5aTcwXjZwKD3wtj1XY5afFZpRjq7iu7eAAkkWihY5JE2nAQgh7 rIQ8gvRD6kEzAdPjV4yRtL9NAwXMY4y06IbLx9ztGlw3gqMWEU9qxm2IyHx0NgX6ISlVrJ nxl+U3ORFs31Ttv7blysRm6QPg4Jw5xMeQAk/RCTBMp8q8MfIX31ji4ZawhA9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752849044; a=rsa-sha256; cv=none; b=UyBIQQlUHuBcB9NijX874HH6HzETMkhl4iFZXydyh0kgdb9OPeXyWDXdxaBoNpQJSD01q/ AE2A4dAtTyZW7yC8h3jtQKK5mqLSVoGKDmaUufNP2yqx1qyy3XFcuN0cP/JGJPc3Ny5OvE y1HdZfShzb6jIp49JHC4yxDizMkOATcz96lFvixj+GRSWoakjfjx0UKIyNpIdtnQnmPW1Q s/ODeSaHp3rRNhDRVuWxJMao/uQRNKIoQBezj2bAtB8WONRZM27RzEGyDiaGlFA6OCv7Bw lzORKOQ2KvWdLRNq1OBolexNUz+qxumTItO8ayWyU7PSaAmdK2JgJ+Jwf1VbWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkBzS2cQ0zkbn; Fri, 18 Jul 2025 14:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IEUi5q064485; Fri, 18 Jul 2025 14:30:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IEUiRc064482; Fri, 18 Jul 2025 14:30:44 GMT (envelope-from git) Date: Fri, 18 Jul 2025 14:30:44 GMT Message-Id: <202507181430.56IEUiRc064482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: af0ec3fa29ca - main - inotify: Fix a couple of locking bugs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af0ec3fa29cad823d0196538381f1e832f5974a7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=af0ec3fa29cad823d0196538381f1e832f5974a7 commit af0ec3fa29cad823d0196538381f1e832f5974a7 Author: Mark Johnston AuthorDate: 2025-07-18 14:25:28 +0000 Commit: Mark Johnston CommitDate: 2025-07-18 14:25:28 +0000 inotify: Fix a couple of locking bugs When hooking vop_rename_post(), the preexisting dst vnode will be unlocked. But, we need to invoke VOP_GETATTR on it in vn_inotify() to check its link count. In inotify_unlink_watch_locked(), the vnode interlock is not held, so don't use vn_irflag_unset_locked(). Reviewed by: kib Fixes: f1f230439fa4 ("vfs: Initial revision of inotify") Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51401 --- sys/kern/vfs_inotify.c | 5 +++-- sys/sys/inotify.h | 14 +++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index 2b42228465a4..d3cd0d1f9832 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -371,7 +371,7 @@ inotify_unlink_watch_locked(struct inotify_softc *sc, struct inotify_watch *watc TAILQ_REMOVE(&vp->v_pollinfo->vpi_inotify, watch, vlink); if (TAILQ_EMPTY(&vp->v_pollinfo->vpi_inotify)) - vn_irflag_unset_locked(vp, VIRF_INOTIFY); + vn_irflag_unset(vp, VIRF_INOTIFY); } /* @@ -675,7 +675,8 @@ vn_inotify(struct vnode *vp, struct vnode *dvp, struct componentname *cnp, struct vattr va; int error; - error = VOP_GETATTR(vp, &va, cnp->cn_cred); + error = VOP_GETATTR(vp, &va, + cnp->cn_cred); if (error == 0 && va.va_nlink != 0) selfevent = 0; } diff --git a/sys/sys/inotify.h b/sys/sys/inotify.h index 65dc5dba43f3..d1f23d5898bb 100644 --- a/sys/sys/inotify.h +++ b/sys/sys/inotify.h @@ -107,11 +107,18 @@ void vn_inotify_revoke(struct vnode *); } while (0) /* Log an inotify event using a specific name for the vnode. */ -#define INOTIFY_NAME(vp, dvp, cnp, ev) do { \ +#define INOTIFY_NAME_LOCK(vp, dvp, cnp, ev, lock) do { \ if (__predict_false((vn_irflag_read(vp) & VIRF_INOTIFY) != 0 || \ - (vn_irflag_read(dvp) & VIRF_INOTIFY) != 0)) \ + (vn_irflag_read(dvp) & VIRF_INOTIFY) != 0)) { \ + if (lock) \ + vn_lock((vp), LK_SHARED | LK_RETRY); \ VOP_INOTIFY((vp), (dvp), (cnp), (ev), 0); \ + if (lock) \ + VOP_UNLOCK(vp); \ + } \ } while (0) +#define INOTIFY_NAME(vp, dvp, cnp, ev) \ + INOTIFY_NAME_LOCK((vp), (dvp), (cnp), (ev), false) extern __uint32_t inotify_rename_cookie; @@ -126,7 +133,8 @@ extern __uint32_t inotify_rename_cookie; VOP_INOTIFY((vp), (tdvp), (tcnp), IN_MOVED_TO, cookie); \ } \ if ((tvp) != NULL) \ - INOTIFY_NAME((tvp), (tdvp), (tcnp), _IN_MOVE_DELETE); \ + INOTIFY_NAME_LOCK((tvp), (tdvp), (tcnp), \ + _IN_MOVE_DELETE, true); \ } while (0) #define INOTIFY_REVOKE(vp) do { \ From nobody Fri Jul 18 15:32:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkDLh17LCz62S6r; Fri, 18 Jul 2025 15:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkDLg6kplz3Sky; Fri, 18 Jul 2025 15:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752852747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AwcbQWZwT61L/kKhfnBg4akvLT4Ht0sP6UyxcDEs1Ks=; b=QlDCp/+dDpRPSNDnirtyteACy05BKWzcdyLfZvoumMSMlKFxbcGt4vCNWvPdTeaHGSxfyp xLDcW/bJ8YkSlHEOAq0W//0ph3/CPzuF200XEX7TfARrNo+W/nAyPZnmcAag1uyzzCVmJ5 33HBfU2FhFSXNYC0/rplyCWx8aLPlf2fBKdbfZ25TXqdQS3JdmUBh5wURcX9cVh5JXkGRX 7j3lkYWAi+NvVtsbJs7oiQVVvqiKo9pb/w+0zu3Ml145gM09EtX4tANBTKlLZBMIbi/5s9 SRcvFnp4/7llBowpsHZ5T7mvbeWsSUgqPjQsEthX30z0Xn9Vx6RW8sE0kO76+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752852747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AwcbQWZwT61L/kKhfnBg4akvLT4Ht0sP6UyxcDEs1Ks=; b=gvbXczhVO/A5mzs6G9Gasa4hz9ODtoCIE6spN+lJ5AYzxKRxChxX66H85HObqeY8V432+7 JZ3kaAwsd/ArYzX85f3fX0THQc0nXos3Qsww+mbYZkU694umHVjRAjbsyYdTjyVZVgxwvD 1xQpkEoKRtQudJd+wB00gHUPNwQcF2twT0d0k9CQCdaY63k1KUJ4s8YXDXTxDAJoZIFnyZ jgeADYH+hNCS2V9bnFVt994clzO9hVVSpgXKDLtnkUZy6JTsj+n+96a78s2EA8qm+T8+ma 8dadWXSPb45+SE3s+e1JZAa63jRlxCdGxVam5HG+5KhM/XYvrQeX7EExx0SAuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752852747; a=rsa-sha256; cv=none; b=kaqjRCvi1MJnX+I06HQ2nJprQOw71dz0pyVttpNqjvtwMuDqMrYYSzfvSwehHDTC5cKMts jwWVcTLVqemUHAqoMiFY3XBUWOvEbDMKI6F4CKbkWjVyT9LC3l9d0TTbcTM5iFwIzix04Z 80O8bSSg03kdM1D7A74NhD4jSjo/inWV5THi4ITW910gg8OUy4g8x/Ojq5xzjok20e1Jh9 HtA9oB0PveFohy+zbPwsBBL/aEiRfUpsc442e/OdHPBvzRrhu1HvDXw9d/u+FhMYLXOrew 8IDRyMwyLSDxC05z7e+ujMlRuCN5rEKJ+a+J9BezjO5zAi7WXhscv4dC6OJlww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkDLg6LPxzn7S; Fri, 18 Jul 2025 15:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IFWRj1084654; Fri, 18 Jul 2025 15:32:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IFWRpI084651; Fri, 18 Jul 2025 15:32:27 GMT (envelope-from git) Date: Fri, 18 Jul 2025 15:32:27 GMT Message-Id: <202507181532.56IFWRpI084651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bab21ae7629c - main - kldstat: Memory zeroing using memset() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bab21ae7629cb564664063de81d6ec729182b735 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bab21ae7629cb564664063de81d6ec729182b735 commit bab21ae7629cb564664063de81d6ec729182b735 Author: Nazarenko Nikita Vladimirovich AuthorDate: 2025-07-17 22:34:46 +0000 Commit: Warner Losh CommitDate: 2025-07-18 15:30:52 +0000 kldstat: Memory zeroing using memset() Use memset() instead of the outdated bzero() function when zeroing memory. bzero() was in the POSIX.1-2001 standard. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1774 Closes: https://github.com/freebsd/freebsd-src/pull/1774 --- sbin/kldstat/kldstat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c index 79c647576440..3a90f1c97eb4 100644 --- a/sbin/kldstat/kldstat.c +++ b/sbin/kldstat/kldstat.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #define PTR_WIDTH ((int)(sizeof(void *) * 2 + 2)) @@ -51,7 +51,7 @@ printmod(int modid) { struct module_stat stat; - bzero(&stat, sizeof(stat)); + memset(&stat, 0, sizeof(stat)); stat.version = sizeof(struct module_stat); if (modstat(modid, &stat) < 0) { warn("can't stat module id %d", modid); From nobody Fri Jul 18 16:06:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkF6n2lDfz62VBb; Fri, 18 Jul 2025 16:07:13 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkF6m6dVlz3n8N; Fri, 18 Jul 2025 16:07:12 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-ae36dc91dc7so379575266b.2; Fri, 18 Jul 2025 09:07:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752854830; x=1753459630; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OSXYdoWzeY6obGtyf3PjXszuefbkrbfDNF9MmOSsHw4=; b=UXkBdyeD3TERudLQGnDSy45XBZJ9ABLY+YgD81be1uhk92s4hHvGSyw8B7Vq9jYvpI p55HAgFyIWv6Y3mREvaa4+JdSXmRGD9qfP08nvufqFMK3Hme3ZMxMqyxIGpVQaP0FYMB 2IhEPCsHOANhcQXmbKKN2iHgX4dUDcPt8KjqV8TAg0iD5ST0E38Wv4dle16DqtkNW43m GZi3r47+K1eOkS1TarOCOml++/mGds5U7HucbxB+W7b9ef1z4KnfNH5yi2yDCBsZ3nqb 79k2bWfOmXGE8CpFJLRs4ZG/qP3vT+nxgnamScnRXt7GtScqswI6LPyLOKlfyG/AML0g 44Iw== X-Forwarded-Encrypted: i=1; AJvYcCWHUs6Y5itDlyV8bXVAIAyeP2G716Lp0JznaIc+m3jLSwPH+lmA6C/UiRYdCGIrfmLrMxQN9yEjYr9GGVNN/xFoNEkuALE=@freebsd.org, AJvYcCXtGnZ2z2IEWVh5woO6iXXAU+pWoaYGbxddvLwCblvggxxNZeai/rmDbWuyree4umw/LulLdLF6FYtNoGJoogPmLwRk@freebsd.org X-Gm-Message-State: AOJu0Yw3fOBRNpiwUEDiBA5SEoQkE/jRvHt2GQ+xjwdF0XS0yLnXELFU /Zvm9LTo+JZLcvszvdrsC7Lf6sMH0l436LtogMUe20LbDYyysFGXkKSOGoRrcQtzAVhBNH43105 kEMhpmJ8Xg7Gf4/Tms60axxP4MWVAWoYcnQ== X-Gm-Gg: ASbGnctvwnErOEcXnMHAQGpWDUE+0vOfljwxJAw3A2JUQ9pY/4zagjCeY0ZdVZrQSaa rSmhyvEdtzbcszRkpe2Y+H1+CkCZP03yU4wwEUgFOjVtLNRbJg1fXXasyIVcpff5QnVtVwDuvU9 UziZZdL9Cky5AXqnF7czQtqV2kTmrrxa7utECUTepGGl4HptkECsqJtmrt3aC8aVvmi+WqJsbbL Mf3xoFwAz8g9rYn4A== X-Google-Smtp-Source: AGHT+IEAhfXjaiw1MCJWwktpP879ACf6ouoq9kNRu78tA5mef0BGnGu0K6BaPySaekuqTMD3nQCL5Ym4JvGVUUWJVVc= X-Received: by 2002:a17:906:9f85:b0:ae6:f15e:88c4 with SMTP id a640c23a62f3a-ae9cdda86e5mr1203628566b.10.1752854829647; Fri, 18 Jul 2025 09:07:09 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507172154.56HLsGLL095197@gitrepo.freebsd.org> In-Reply-To: <202507172154.56HLsGLL095197@gitrepo.freebsd.org> From: Alan Somers Date: Fri, 18 Jul 2025 10:06:56 -0600 X-Gm-Features: Ac12FXyxud1IhKDf_9krqT38geWJjKJti6ANg2BmnZhIyF5x03ZConqHtwwV2rg Message-ID: Subject: Re: git: 29af6d2e2ec9 - main - msdosfs: replace '/' in direntries with '?' To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000076cc48063a36510e" X-Rspamd-Queue-Id: 4bkF6m6dVlz3n8N X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] --00000000000076cc48063a36510e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Should we move this logic up into kern_getdirentries? msdosfs is not the only file system vulnerable to this problem. On Thu, Jul 17, 2025 at 3:54=E2=80=AFPM Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D29af6d2e2ec9fe8df7cf1e1a0bf3597= 028831b18 > > commit 29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18 > Author: Konstantin Belousov > AuthorDate: 2025-07-17 01:12:05 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-17 21:53:54 +0000 > > msdosfs: replace '/' in direntries with '?' > > PR: 288266 > Reported by: Robert Morris > Reviewed by: markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D51365 > --- > sys/fs/msdosfs/msdosfs_conv.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.= c > index da4848169173..208b64930e61 100644 > --- a/sys/fs/msdosfs/msdosfs_conv.c > +++ b/sys/fs/msdosfs/msdosfs_conv.c > @@ -797,19 +797,24 @@ mbsadjpos(const char **instr, size_t inlen, size_t > outlen, int weight, int flag, > static u_char * > dos2unixchr(u_char *outbuf, const u_char **instr, size_t *ilen, int > lower, struct msdosfsmount *pmp) > { > - u_char c, *outp; > - size_t len, olen; > + u_char c, *outp, *outp1; > + size_t i, len, olen; > > outp =3D outbuf; > if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { > olen =3D len =3D 4; > > + outp1 =3D outp; > if (lower & (LCASE_BASE | LCASE_EXT)) > msdosfs_iconv->convchr_case(pmp->pm_d2u, (const > char **)instr, > ilen, (char **)&outp, > &olen, KICONV_LOWER); > else > msdosfs_iconv->convchr(pmp->pm_d2u, (const char > **)instr, > ilen, (char **)&outp, &olen)= ; > + for (i =3D 0; i < outp - outp1; i++) { > + if (outp1[i] =3D=3D '/') > + outp1[i] =3D '?'; > + } > len -=3D olen; > > /* > @@ -826,6 +831,8 @@ dos2unixchr(u_char *outbuf, const u_char **instr, > size_t *ilen, int lower, struc > c =3D dos2unix[c]; > if (lower & (LCASE_BASE | LCASE_EXT)) > c =3D u2l[c]; > + if (c =3D=3D '/') > + c =3D '?'; > *outp++ =3D c; > outbuf[1] =3D '\0'; > } > --00000000000076cc48063a36510e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Should we move this logic up into kern_getdirentries?= =C2=A0 msdosfs is not the only file system vulnerable to this problem.
On Thu, Jul 17, 2025 at 3:54=E2=80=AFPM Konstantin Belouso= v <kib@freebsd.org> wrote:
=
The branch main has= been updated by kib:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18
commit 29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18
Author:=C2=A0 =C2=A0 =C2=A0Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-07-17 01:12:05 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-07-17 21:53:54 +0000

=C2=A0 =C2=A0 msdosfs: replace '/' in direntries with '?'
=C2=A0 =C2=A0 PR:=C2=A0 =C2=A0 =C2=A0288266
=C2=A0 =C2=A0 Reported by:=C2=A0 =C2=A0 Robert Morris <rtm@lcs.mit.edu>
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 markj
=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0The FreeBSD Foundation
=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 1 week
=C2=A0 =C2=A0 Differential revision:=C2=A0 https://reviews.freebsd= .org/D51365
---
=C2=A0sys/fs/msdosfs/msdosfs_conv.c | 11 +++++++++--
=C2=A01 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c<= br> index da4848169173..208b64930e61 100644
--- a/sys/fs/msdosfs/msdosfs_conv.c
+++ b/sys/fs/msdosfs/msdosfs_conv.c
@@ -797,19 +797,24 @@ mbsadjpos(const char **instr, size_t inlen, size_t ou= tlen, int weight, int flag,
=C2=A0static u_char *
=C2=A0dos2unixchr(u_char *outbuf, const u_char **instr, size_t *ilen, int l= ower, struct msdosfsmount *pmp)
=C2=A0{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0u_char c, *outp;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0size_t len, olen;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0u_char c, *outp, *outp1;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0size_t i, len, olen;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 outp =3D outbuf;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (pmp->pm_flags & MSDOSFSMNT_KICONV &a= mp;& msdosfs_iconv) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 olen =3D len =3D 4;=

+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0outp1 =3D outp;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (lower & (LC= ASE_BASE | LCASE_EXT))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 msdosfs_iconv->convchr_case(pmp->pm_d2u, (const char **)in= str,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ilen, (char **)&outp, &olen, KICONV_LOW= ER);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 msdosfs_iconv->convchr(pmp->pm_d2u, (const char **)instr,<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0ilen, (char **)&outp, &olen);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i <= ; outp - outp1; i++) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (outp1[i] =3D=3D '/')
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0outp1[i] =3D '?';
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 len -=3D olen;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
@@ -826,6 +831,8 @@ dos2unixchr(u_char *outbuf, const u_char **instr, size_= t *ilen, int lower, struc
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c =3D dos2unix[c];<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (lower & (LC= ASE_BASE | LCASE_EXT))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 c =3D u2l[c];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (c =3D=3D '/= ')
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0c =3D '?';
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *outp++ =3D c;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 outbuf[1] =3D '= \0';
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
--00000000000076cc48063a36510e-- From nobody Fri Jul 18 16:28:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkFbl48Xhz62WN5; Fri, 18 Jul 2025 16:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkFbl32RDz424r; Fri, 18 Jul 2025 16:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752856131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NZHK7kOEXOGjIzCleoaZLEW2WAsk2MKisou9vp9uUnc=; b=TZmPmhCHmYPHCj5cwYCDYMTxdGFwist1yLyCrxvu33860lScTSuQFLKzvRwoiVKHZ8bueS IQ4inYf6vS3oyATC7J8UBAdsCXxR+HCyPz2+goT+NtVTv5nC8cRievdhiVd8wMtIToH1tG +GWetkO+xu4788V2hvEIotdF5K12kUDXXpK47utMnTHpDJejovD5knvXWL+5tlsYv3ZZTO K/cw9G2VYlI7kNfadOYAjmk+pdVCg3zKINTLetCff7bPcgH7y3Bumd8T07pJztOHbYMhGf KzWjxyYE65iTy+7zRg6JWghNz+J6cb740v4VQf4D9dxL50CfxOi/z/Yzym6Fug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752856131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NZHK7kOEXOGjIzCleoaZLEW2WAsk2MKisou9vp9uUnc=; b=IL8kONO+1LT64EKaXTBrx2u31Hoikqo+6i8OgWMD9wf6VNTeBPBFnTL5m/bxsaHSntSd6X 7ZNYz0WfGYZPb1Yo0GeWaTHkp3okufAcJHpjJDxscF+Wae7O1d9UsaY4ruqDTq7MTB70KJ 375ee2GVZCaXMls26e3jzIihAK1xQiROsYxb2xjauwoMlS01Cz0HWnuYoGSks8PgMTPn1A ifUNo0a1j00U18yuD4jhEWk+k56kPToW34JjRzYDsPngPFrZ66oOCrRe3/wvmiuGq8Z3bD /eCN9ELCqAfsyF1DLsBi+t94etsjHy9VJeIzbWAEbpZBw8Y7+iXWuGujijf3dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752856131; a=rsa-sha256; cv=none; b=JedYBS5efJ+7NXHo8sJ4Mspz9vHWmb1scaK1GH/tKXRfFSZ+E7ntN7JwiIRPMLX6tm8jPZ myQ+M4ywv8uIH1uQlTiy31nF9LM9yJ/U9yszH+DVteZ6Cj2D0PVG2I6pX/h4YX8MeRE8wr V6S7TtsvzJNCOvmqeoZ7gDRrnPxF8iFnXrWgp6hI59KVFu8skGXliv/24U/vai2lEDSilM aNrjkXL7RiuPBTkwQrsVfdcFIA+WidUJMvZHeu6mHCu03XiQkrzpYvxx7L8Xt7gwIDlVrz MwpOhpirs1FqehR1Mq/8F5WzDGIAFDsQ8PGL418jOIsZCdWu/y5i1hAONIM05w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkFbl2cyMzpYM; Fri, 18 Jul 2025 16:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IGSpaK080655; Fri, 18 Jul 2025 16:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IGSpBU080652; Fri, 18 Jul 2025 16:28:51 GMT (envelope-from git) Date: Fri, 18 Jul 2025 16:28:51 GMT Message-Id: <202507181628.56IGSpBU080652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 655fcdde1aff - main - release: Install wireless firmware to bootonly media List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 655fcdde1aff164a3a02ad073334611117e20d4c Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=655fcdde1aff164a3a02ad073334611117e20d4c commit 655fcdde1aff164a3a02ad073334611117e20d4c Author: Joseph Mingrone AuthorDate: 2025-07-16 13:46:34 +0000 Commit: Joseph Mingrone CommitDate: 2025-07-18 16:27:32 +0000 release: Install wireless firmware to bootonly media Also install wireless firmware packages to the bootonly ISO and the mini-memstick image so users can fetch installation files over a wireless connection. Reported by: Mark Philips Reviewed by: bz, emaste, imp, releng (cperciva) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51348 --- release/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/release/Makefile b/release/Makefile index 7cafd7ddb787..5d7d1402d6f8 100644 --- a/release/Makefile +++ b/release/Makefile @@ -276,6 +276,7 @@ bootonly: .if ${.MAKE.OS} == "FreeBSD" && (!defined(NOPKG) || empty(NOPKG)) # Install packages onto release media. ${PKG_INSTALL} pkg || true + ${PKG_INSTALL} wifi-firmware-iwlwifi-kmod wifi-firmware-rtw88-kmod || true ${PKG_CLEAN} || true .endif # Set up installation environment From nobody Fri Jul 18 17:50:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkHPp0cK8z62Zlg; Fri, 18 Jul 2025 17:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkHPn6lCYz3tTc; Fri, 18 Jul 2025 17:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752861021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QU7hiPoGk7aM/v6Yll5U28Xy9NnA0sv/kF3UCtQGUeM=; b=YN+VnP4S103OzIcBtbiPxRECSSPy259cW16d1pyCl9Dw29jhTvIJQfLZ2Xi7H1H1Aeg6Ae Na/V1HN3mnHkSM3+67dbDqM1c5xXNTivMz2d1GywPYIoC5rHb0BVcwWFxVLFmvhCS6nyB6 2fQ1I5iXXNT1JPB5MeGUqBwCEFOtDu8hJYunvdjabw8ZtjtG4gPqfr7cMsPaZ5bLvX34Xk k7c51Q5Z2wZ3Pl3EfULh3MD30+JaFlKUaDHtKxAPpTxY/xFypBBC/WY/q0J6E0bGBp7umc G8xih43wBWf7ctlrqsIKVK8EOC/SNhhro3zPPx6Yuy04px+7yYw3pqBYwRhPhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752861021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QU7hiPoGk7aM/v6Yll5U28Xy9NnA0sv/kF3UCtQGUeM=; b=Z1zrtZf4nTmDqh5XS86MdPZew2+SZb+Ecr+n1i1Lr1N7Z6dFJmwF6ITYGOCU/2nVqARRWh JdBuTrZXakJHsRe2SCg0zheDeLz7dWsVwFo0w3dsxp597Ez/FsRKrIgde0OXPjPB4JJggR rp/tbEQ3flZkkbRZhYdOeSwUi7v72nAjBwdDrQa9AYhP+tLmLA8QjCyeT32DXf8kaHaPHL mBndZYt5IctQPDWh3w7gGp6mquISd2JvzdYLegAiV2V5KGMB8Rs7nicXjlXwmpWqfdsMaS ci+qXqfD+dQX3TeRkBZUWulef6cHym5MhEvjqBQ4nZGHUm/xoa/vuotWI7Q3Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752861021; a=rsa-sha256; cv=none; b=ozWqxgiLMI8v8RMs3LpLtQIV+KWfW3mRs17IZFSkEPYnhqr512i7pt7F9SVnc/qQ5OSSK0 vkd2411kMHvCad6UQXWIstXEpwS05WZWzLfTUR5/3h5IPe054zeS06dkFIDuxiEvccS4i5 rFQaVOc2ImBhGS2c2NhrUTEEZaPKpCpVB/8kE70B/syWH73bZ4YsGZpyMq7u46t9YvPpum yvgZieTEZNgPSGCVp9fY3roMgFyLsqwz0dROrmqHbnaGiB/xMLAGVJMbFRxlx3WPoaJ4WO 6ULlkAm02LnQ0gS4yUDyop4IzcFWxtclxlj4OYFvZMikTp0uPNJz8+eKR75kIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkHPn6LSrzr6C; Fri, 18 Jul 2025 17:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IHoL9K040941; Fri, 18 Jul 2025 17:50:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IHoLIw040938; Fri, 18 Jul 2025 17:50:21 GMT (envelope-from git) Date: Fri, 18 Jul 2025 17:50:21 GMT Message-Id: <202507181750.56IHoLIw040938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d63ffdd1ef63 - main - tzcode: Fix time zone change detection. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d63ffdd1ef6368407b35d415237b95cc739d8073 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d63ffdd1ef6368407b35d415237b95cc739d8073 commit d63ffdd1ef6368407b35d415237b95cc739d8073 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-18 17:48:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-18 17:49:34 +0000 tzcode: Fix time zone change detection. Prior to the 2022g import, tzloadbody() returned -1 on error. Now it returns an errno code. When I updated the time zone change detection logic to match, I improperly returned errno in all cases, which means that if the time zone file has not changed since we last loaded it, tzloadbody() returns a random errno value instead of 0. Fixes: bc42155199b5 MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51405 --- contrib/tzcode/localtime.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index f5814a43da54..69b5f0183e2c 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -408,10 +408,8 @@ change_in_tz(const char *name) static char old_name[PATH_MAX]; static struct stat old_sb; struct stat sb; - int error; - error = stat(name, &sb); - if (error != 0) + if (stat(name, &sb) != 0) return -1; if (strcmp(name, old_name) != 0) { @@ -510,13 +508,11 @@ tzloadbody(char const *name, struct state *sp, bool doextend, * 'doextend' to ignore TZDEFRULES; the change_in_tz() * function can only keep state for a single file. */ - int ret = change_in_tz(name); - if (ret <= 0) { - /* - * Returns an errno value if there was an error, - * and 0 if the timezone had not changed. - */ + switch (change_in_tz(name)) { + case -1: return errno; + case 0: + return 0; } } fid = _open(name, O_RDONLY | O_BINARY); From nobody Fri Jul 18 17:50:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkHPq3lQdz62b0v; Fri, 18 Jul 2025 17:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkHPq0Vrpz3tm3; Fri, 18 Jul 2025 17:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752861023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOHqFIPsCGuZCqIQk1uuckLZZmC3Y9YfGaZwA39ki1Y=; b=HS54pN3mZv07Ok572YZ/KxAjBy/t58INUJvhoOhs9SxRyjO8VFXUwHSIduKe2VP7w3Rps5 UmdQpdCnQQhMNhvhC/gCj+1cCf7GruIO+VMCfmVnDHvif22npy9xMPcIXwZgyCMT9MehQU z3DvSHPqcj0NsWyenC8NGrrUGghedc1qiyhrtfB6v9cze/+dNjbQ4Khfgv7/1y28+mvNz8 O7YwcTa76S0sSUVAvhSJWJ5IuTta6PwGpRP/uet5BBQsyT1cWnGTOn8w5+atKX8XCgqwG8 sUWN+RVIkJcIQOQUV9JCol3U9C3epsy4KePJhfNF92geWR+jh49v/uPlunHftw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752861023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOHqFIPsCGuZCqIQk1uuckLZZmC3Y9YfGaZwA39ki1Y=; b=iZ/s5ku4eTiyPgzRA/oRSb1zHS9BGvuwjhrhg6Bt4dG14ukNhOvTnAY7irCiacbhiG/WtB Eu3kfb0rsCJDGYyY2h4h9LArAAs/mdXjVGv6wv0EIyORUtisY82mfuT5WAVVqkrxnjeSZL 9hhOjPkUozUXTPvWUyCrPTy+iQjADF6kVg74Os6J8SISu9GwxPNte5P5XTfhJqXITz4JtO 2GH2qJKQbuo7I14C6YYmjLaq8xSAei2FQgCySybmvHiBTvrx7TpXr11kOh2i4rJii7TzXP hHqaTwiqafAkmRo7uWfeo6CJA2m+8/HdM9/X2duAx0zkq0hKgVzBDima3NTe+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752861023; a=rsa-sha256; cv=none; b=Dtnh0YeYTFC5Z55zI9NunVZTHs56p9LPcu89eipyiUUYfuejRlEmV8Imhm3fFQ6+zxrYAk CXR+jQmjHnacf/Hpldt5Ov060w0GBtuobgo4bGJr8+tfynNeORpNq2BlAAScvKOdNysyB3 U8HXPFcSVt+doJbrLrkzRaN2bSGvaQD8lsGppClfM85iUjBvkI2qc5opppm4zUSUCW7TgO sgNbkO0LNqkE67WIHfW19AwunjgjMEt4MZRqfuUsIEfO/oabCRDRTQuT0N2ppcava7AhBU jSldeb1C6c16bpEkUTeBzo+mQpAApCxcHAr48oHgH6D/JKFg2qwRJr+YCxKFFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkHPp6wRDzrL0; Fri, 18 Jul 2025 17:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IHoMQv040977; Fri, 18 Jul 2025 17:50:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IHoMcE040974; Fri, 18 Jul 2025 17:50:22 GMT (envelope-from git) Date: Fri, 18 Jul 2025 17:50:22 GMT Message-Id: <202507181750.56IHoMcE040974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 57ee56578cc5 - main - libc: Test time zone change detection. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57ee56578cc55b3da9a0dee64b385507be2dc80a Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=57ee56578cc55b3da9a0dee64b385507be2dc80a commit 57ee56578cc55b3da9a0dee64b385507be2dc80a Author: Dag-Erling Smørgrav AuthorDate: 2025-07-18 17:49:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-18 17:49:57 +0000 libc: Test time zone change detection. While here, clean the detection code up a bit. Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51343 --- contrib/tzcode/localtime.c | 18 +- lib/libc/stdtime/Makefile.inc | 1 + lib/libc/stdtime/Symbol.map | 6 + lib/libc/tests/stdtime/Makefile | 5 +- lib/libc/tests/stdtime/detect_tz_changes_test.c | 281 ++++++++++++++++++++++++ tools/build/mk/OptionalObsoleteFiles.inc | 4 + 6 files changed, 301 insertions(+), 14 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 69b5f0183e2c..5c3ef7ed47af 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -18,6 +18,7 @@ #ifndef DETECT_TZ_CHANGES_INTERVAL #define DETECT_TZ_CHANGES_INTERVAL 61 #endif +int __tz_change_interval = DETECT_TZ_CHANGES_INTERVAL; #include #endif #include @@ -1372,22 +1373,13 @@ recheck_tzdata() { static time_t last_checked; struct timespec now; - time_t current_time; - int error; - /* - * We want to recheck the timezone file every 61 sec. - */ - error = clock_gettime(CLOCK_MONOTONIC, &now); - if (error < 0) { - /* XXX: Can we somehow report this? */ + if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) return 0; - } - current_time = now.tv_sec; - if ((current_time - last_checked > DETECT_TZ_CHANGES_INTERVAL) || - (last_checked > current_time)) { - last_checked = current_time; + if ((now.tv_sec - last_checked >= __tz_change_interval) || + (last_checked > now.tv_sec)) { + last_checked = now.tv_sec; return 1; } diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc index 5d0ce7765b63..647cbe6f40ba 100644 --- a/lib/libc/stdtime/Makefile.inc +++ b/lib/libc/stdtime/Makefile.inc @@ -18,6 +18,7 @@ CFLAGS.${src}+= -I${LIBC_SRCTOP}/stdtime CFLAGS.localtime.c+= -DALL_STATE -DTHREAD_SAFE .if ${MK_DETECT_TZ_CHANGES} != "no" CFLAGS.localtime.c+= -DDETECT_TZ_CHANGES +CFLAGS.Version.map+= -DDETECT_TZ_CHANGES .endif MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 tzset.3 diff --git a/lib/libc/stdtime/Symbol.map b/lib/libc/stdtime/Symbol.map index 669d4d47907b..6a34cd3ea590 100644 --- a/lib/libc/stdtime/Symbol.map +++ b/lib/libc/stdtime/Symbol.map @@ -35,3 +35,9 @@ FBSD_1.8 { daylight; timezone; }; + +FBSDprivate_1.0 { +#ifdef DETECT_TZ_CHANGES + __tz_change_interval; +#endif +}; diff --git a/lib/libc/tests/stdtime/Makefile b/lib/libc/tests/stdtime/Makefile index c7a7f5b9436f..adb883cc5b9a 100644 --- a/lib/libc/tests/stdtime/Makefile +++ b/lib/libc/tests/stdtime/Makefile @@ -1,6 +1,9 @@ -.include +.include ATF_TESTS_C+= strptime_test +.if ${MK_DETECT_TZ_CHANGES} != "no" +ATF_TESTS_C+= detect_tz_changes_test +.endif TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/} diff --git a/lib/libc/tests/stdtime/detect_tz_changes_test.c b/lib/libc/tests/stdtime/detect_tz_changes_test.c new file mode 100644 index 000000000000..9722546747fd --- /dev/null +++ b/lib/libc/tests/stdtime/detect_tz_changes_test.c @@ -0,0 +1,281 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static const time_t then = 1751328000; /* 2025-07-01 00:00:00 UTC */ +static const char *tz_change_interval_sym = "__tz_change_interval"; +static int *tz_change_interval_p; +static const int tz_change_interval = 3; +static int tz_change_timeout = 90; + +static bool debugging; + +static void +debug(const char *fmt, ...) +{ + va_list ap; + + if (debugging) { + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fputc('\n', stderr); + } +} + +static void +change_tz(const char *tzn) +{ + static const char *zfn = "/usr/share/zoneinfo"; + static const char *tfn = "root/etc/.localtime"; + static const char *dfn = "root/etc/localtime"; + ssize_t clen; + int zfd, sfd, dfd; + + ATF_REQUIRE((zfd = open(zfn, O_DIRECTORY | O_SEARCH)) >= 0); + ATF_REQUIRE((sfd = openat(zfd, tzn, O_RDONLY)) >= 0); + ATF_REQUIRE((dfd = open(tfn, O_CREAT | O_TRUNC | O_WRONLY)) >= 0); + do { + clen = copy_file_range(sfd, NULL, dfd, NULL, SSIZE_MAX, 0); + ATF_REQUIRE_MSG(clen != -1, "failed to copy %s/%s: %m", + zfn, tzn); + } while (clen > 0); + ATF_CHECK_EQ(0, close(dfd)); + ATF_CHECK_EQ(0, close(sfd)); + ATF_CHECK_EQ(0, close(zfd)); + ATF_REQUIRE_EQ(0, rename(tfn, dfn)); + debug("time zone %s installed", tzn); +} + +/* + * Test time zone change detection. + * + * The parent creates a chroot containing only /etc/localtime, initially + * set to UTC. It then forks a child which enters the chroot, repeatedly + * checks the current time zone, and prints it to stdout if it changes + * (including once on startup). Meanwhile, the parent waits for output + * from the child. Every time it receives a line of text from the child, + * it checks that it is as expected, then changes /etc/localtime within + * the chroot to the next case in the list. Once it reaches the end of + * the list, it closes a pipe to notify the child, which terminates. + * + * Note that ATF and / or Kyua may have set the timezone before the test + * case starts (even unintentionally). Therefore, we start the test only + * after we've received and discarded the first report from the child, + * which should come almost immediately on startup. + */ +ATF_TC(detect_tz_changes); +ATF_TC_HEAD(detect_tz_changes, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test timezone change detection"); + atf_tc_set_md_var(tc, "require.user", "root"); + atf_tc_set_md_var(tc, "timeout", "600"); +} +ATF_TC_BODY(detect_tz_changes, tc) +{ + static const struct tzcase { + const char *tzfn; + const char *expect; + } tzcases[] = { + /* + * A handful of time zones and the expected result of + * strftime("%z (%Z)", tm) when that time zone is active + * and tm represents a date in the summer of 2025. + */ + { "America/Vancouver", "-0700 (PDT)" }, + { "America/New_York", "-0400 (EDT)" }, + { "Europe/London", "+0100 (BST)" }, + { "Europe/Paris", "+0200 (CEST)" }, + { "Asia/Kolkata", "+0530 (IST)" }, + { "Asia/Tokyo", "+0900 (JST)" }, + { "Australia/Canberra", "+1000 (AEST)" }, + { "UTC", "+0000 (UTC)" }, + { 0 }, + }; + char obuf[1024] = ""; + char ebuf[1024] = ""; + struct pollfd fds[3]; + int opd[2], epd[2], spd[2]; + time_t changed, now; + const struct tzcase *tzcase = NULL; + struct tm *tm; + size_t olen = 0, elen = 0; + ssize_t rlen; + long curoff = LONG_MIN; + pid_t pid; + int nfds, status; + + /* speed up the test if possible */ + tz_change_interval_p = dlsym(RTLD_SELF, tz_change_interval_sym); + if (tz_change_interval_p != NULL && + *tz_change_interval_p > tz_change_interval) { + debug("reducing detection interval from %d to %d", + *tz_change_interval_p, tz_change_interval); + *tz_change_interval_p = tz_change_interval; + tz_change_timeout = tz_change_interval * 3; + } + /* prepare chroot */ + ATF_REQUIRE_EQ(0, mkdir("root", 0755)); + ATF_REQUIRE_EQ(0, mkdir("root/etc", 0755)); + change_tz("UTC"); + time(&changed); + /* output, error, sync pipes */ + if (pipe(opd) != 0 || pipe(epd) != 0 || pipe(spd) != 0) + atf_tc_fail("failed to pipe"); + /* fork child */ + if ((pid = fork()) < 0) + atf_tc_fail("failed to fork"); + if (pid == 0) { + /* child */ + dup2(opd[1], STDOUT_FILENO); + close(opd[0]); + close(opd[1]); + dup2(epd[1], STDERR_FILENO); + close(epd[0]); + close(epd[1]); + close(spd[0]); + unsetenv("TZ"); + ATF_REQUIRE_EQ(0, chroot("root")); + ATF_REQUIRE_EQ(0, chdir("/")); + fds[0].fd = spd[1]; + fds[0].events = POLLIN; + for (;;) { + ATF_REQUIRE(poll(fds, 1, 100) >= 0); + if (fds[0].revents & POLLHUP) { + /* parent closed sync pipe */ + _exit(0); + } + ATF_REQUIRE((tm = localtime(&then)) != NULL); + if (tm->tm_gmtoff == curoff) + continue; + olen = strftime(obuf, sizeof(obuf), "%z (%Z)", tm); + ATF_REQUIRE(olen > 0); + fprintf(stdout, "%s\n", obuf); + fflush(stdout); + curoff = tm->tm_gmtoff; + } + _exit(2); + } + /* parent */ + close(opd[1]); + close(epd[1]); + close(spd[1]); + /* receive output until child terminates */ + fds[0].fd = opd[0]; + fds[0].events = POLLIN; + fds[1].fd = epd[0]; + fds[1].events = POLLIN; + fds[2].fd = spd[0]; + fds[2].events = POLLIN; + nfds = 3; + for (;;) { + ATF_REQUIRE(poll(fds, 3, 1000) >= 0); + time(&now); + if (fds[0].revents & POLLIN && olen < sizeof(obuf)) { + rlen = read(opd[0], obuf + olen, sizeof(obuf) - olen); + ATF_REQUIRE(rlen >= 0); + olen += rlen; + } + if (olen > 0) { + ATF_REQUIRE_EQ('\n', obuf[olen - 1]); + obuf[--olen] = '\0'; + /* tzcase will be NULL at first */ + if (tzcase != NULL) { + debug("%s", obuf); + ATF_REQUIRE_STREQ(tzcase->expect, obuf); + debug("change to %s detected after %d s", + tzcase->tzfn, (int)(now - changed)); + if (tz_change_interval_p != NULL) { + ATF_CHECK((int)(now - changed) >= + *tz_change_interval_p - 1); + ATF_CHECK((int)(now - changed) <= + *tz_change_interval_p + 1); + } + } + olen = 0; + /* first / next test case */ + if (tzcase == NULL) + tzcase = tzcases; + else + tzcase++; + if (tzcase->tzfn == NULL) { + /* test is over */ + break; + } + change_tz(tzcase->tzfn); + changed = now; + } + if (fds[1].revents & POLLIN && elen < sizeof(ebuf)) { + rlen = read(epd[0], ebuf + elen, sizeof(ebuf) - elen); + ATF_REQUIRE(rlen >= 0); + elen += rlen; + } + if (elen > 0) { + ATF_REQUIRE_EQ(elen, fwrite(ebuf, 1, elen, stderr)); + elen = 0; + } + if (nfds > 2 && fds[2].revents & POLLHUP) { + /* child closed sync pipe */ + break; + } + /* + * The timeout for this test case is set to 10 minutes, + * because it can take that long to run with the default + * 61-second interval. However, each individual tzcase + * entry should not take much longer than the detection + * interval to test, so we can detect a problem long + * before Kyua terminates us. + */ + if ((now - changed) > tz_change_timeout) { + close(spd[0]); + if (tz_change_interval_p == NULL && + tzcase == tzcases) { + /* + * The most likely explanation in this + * case is that libc was built without + * time zone change detection. + */ + atf_tc_skip("time zone change detection " + "does not appear to be enabled"); + } + atf_tc_fail("timed out waiting for change to %s " + "to be detected", tzcase->tzfn); + } + } + close(opd[0]); + close(epd[0]); + close(spd[0]); /* this will wake up and terminate the child */ + if (olen > 0) + ATF_REQUIRE_EQ(olen, fwrite(obuf, 1, olen, stdout)); + if (elen > 0) + ATF_REQUIRE_EQ(elen, fwrite(ebuf, 1, elen, stderr)); + ATF_REQUIRE_EQ(pid, waitpid(pid, &status, 0)); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE_EQ(0, WEXITSTATUS(status)); +} + +ATF_TP_ADD_TCS(tp) +{ + debugging = !getenv("__RUNNING_INSIDE_ATF_RUN") && + isatty(STDERR_FILENO); + ATF_TP_ADD_TC(tp, detect_tz_changes); + return (atf_no_error()); +} diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 1e63e4616909..4c127b392138 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1441,6 +1441,10 @@ OLD_LIBS+=${DEBUG_LIBS} .endif .endif +.if ${MK_DETECT_TZ_CHANGES} == no +OLD_FILES+=tests/lib/libc/stdtime/detect_tz_changes_test +.endif + .if ${MK_DIALOG} == no OLD_FILES+=usr/bin/dialog OLD_FILES+=usr/bin/dpv From nobody Fri Jul 18 18:30:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkJJ751rLz62d5T; Fri, 18 Jul 2025 18:30:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkJJ70hwFz3QQT; Fri, 18 Jul 2025 18:30:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752863431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pbAmUYjYoRbobYaC+b10GgS8r96Ij5W0wcKaOF6+pTo=; b=OX7qwe+joPNnd5ROe30rsw5wClCA7+eadbT1diMOCSDHqB+fAgdZ87hugC4gRZqgdwraJe ZOENHyicq62chXMhnSsUuiItoZQmbxSL2oZ1QWE9eUFcWrcy5M3jGUpkP1KgyAp8nmecI7 cGrH8W8KXp5yjb2s1hlsn3mFn/oA1OXOJlOC1dvRbsP3FooB/psq9NL5qEfbhffB8w2h/1 J88hkXLIp+VTWsbYwPeXyLMl6AX0Z1yfOYWHFfh1nARLzpw3PdGx2BuOu4ljnupWybJrsQ hyNcPaF7MEQZZ+l0y5x3BYScq5lHPFoTi6pdVju+WObnr52tu28O3hKh2o6Jrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752863431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pbAmUYjYoRbobYaC+b10GgS8r96Ij5W0wcKaOF6+pTo=; b=Ow9g7cAQPQQaoQoCpcWdejNZd+mvLkrHqhTX/1c/ojdRN9oH220Rt0slhL25H1GgWC8g10 mNSNS93rWBvtEnz+di0byQZctfMFL2OcNUMq4F/9pcHqr3zQFnv59bWOq536QP4NFcgHDE o90SXtRnmm1Qqj1GAZAqLOVEAn7DD1kG3sH/0XTq9sWldial0DjzOeCXM2dEv3PbLA6Rvl Rcmc13adq2MOme+1g3XtDZ7J9pGyQXD1NacVw1cW87U5LTnsOoEXie9l5OzGwko+TC3zZ8 8uM3k0Hhm8BeBjG2UaCP/SYkNXlHnVvZV08Yzvm26kDyCNRkCwbKd7n6FaVhpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752863431; a=rsa-sha256; cv=none; b=cHlp+IM5oWHGx9bTuHejf4z3hdgfrN0JryO3GqILm/++9mXUg8N8/sEbwG6h1tZHsoD9nh 5Hqk8pgblLGwb5ZrNY5frakZd4FppeQOldGgRGICLHgmiC6W7FydWUm+dd6GmpouVYpjzF I7/NKmKUlVUGuzw37k7Cg1ez3ofX2a2DJZT+oBg+ydRRDYrAVYjTKKjo7RritnjWL18LiR 38lh/7KffAiG62o4j+HOGfzX8qDIOY0DTAM4ZmdM4H/Ib0EagmiWi70X3X22zQrV82Etyt tzmgRPmHGC/jPKKD2Y+XxPFMJsBNKqG2I5hcLHZcIE2NBMsO1G0aTb2AWUu10w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkJJ700fTzs5B; Fri, 18 Jul 2025 18:30:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IIUU40016656; Fri, 18 Jul 2025 18:30:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IIUUQA016653; Fri, 18 Jul 2025 18:30:30 GMT (envelope-from git) Date: Fri, 18 Jul 2025 18:30:30 GMT Message-Id: <202507181830.56IIUUQA016653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 2420e64c463a - main - rpctls_impl.c: Fix handling of hung rpc tls daemon List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2420e64c463a4873a7f0cb86837148bc66a6474a Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2420e64c463a4873a7f0cb86837148bc66a6474a commit 2420e64c463a4873a7f0cb86837148bc66a6474a Author: Rick Macklem AuthorDate: 2025-07-18 18:27:50 +0000 Commit: Rick Macklem CommitDate: 2025-07-18 18:27:50 +0000 rpctls_impl.c: Fix handling of hung rpc tls daemon Commit 26ee05939209 replaced soshutdown() with soclose() for the case where the RPC TLS daemon has not removed the socket from the RB tree during an upcall. It turns out that soshutdown() is needed for the "else" case, which is the case that occurs when the daemon is stuck in SSL_accept() or SSL_connect(). This patch adds a soshutdown() call to this else case, which unsticks the daemon when the other end does not do the actual TLS handshake. This can occur if the daemon is not running at the other end. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D51083 Fixes: 26ee05939209 ("rpctls_impl.c: Fix handling of socket for daemon failure") --- sys/rpc/rpcsec_tls/rpctls_impl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index 93fe283e65fd..51fe270b13d9 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -240,6 +240,14 @@ rpctls_rpc_failed(struct upsock *ups, struct socket *so) * failed to do the handshake. */ mtx_unlock(&rpctls_lock); + /* + * Do a shutdown on the socket, since the daemon is + * probably stuck in SSL_accept() or SSL_connect() trying to + * read the socket. Do not soclose() the socket, since the + * daemon will close() the socket after SSL_accept() + * returns an error. + */ + soshutdown(so, SHUT_RD); } } From nobody Fri Jul 18 18:50:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkJlf3YKkz62f4b; Fri, 18 Jul 2025 18:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkJld3q8lz3gXC; Fri, 18 Jul 2025 18:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752864653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TBBnOxoLfGsQQ4XB1YK1weWXGNvpogffTVYmJyHvz9A=; b=OyqKW9NykQNcTZx0NM0yDW5ee6wTaJlG8V6YX/oofmHqecw9JH0zd+dh9KXFc54szq+4Sf FSNgZAaMRdq6n+sT/Ay9770JFVtOJ5tRvaM+UHy5At0H+05CZu7Gul2iRq3uTEuAbC4NHB kpX6YJZK4Xccs3el4YB8Lll12NOPy1NgwNwTIaGBvpueYVSD4GqGP1wJpSFcqi8qED0ysc D7oZFR4kA/kV7fCTaAiQf9mYlurP74ym3eWW7TYsU17RqiXCDYRLRcqupiHm7oSiwWtTaH SKsP5Az8t8KuYnL971ohzMUEsVsDgSocASawr2XoroZM58Mevi2S3vWFRzZ0eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752864653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TBBnOxoLfGsQQ4XB1YK1weWXGNvpogffTVYmJyHvz9A=; b=HcKm/rhBccXL2qqML6kEtO1LDTxq10Fo1O4hK/fTIL5DbeCNj0CG4cE1WXyuGQRN6mb7be 0Vo4K7hekLeA+aG4vJakCzlPPcrguDwTe05Diy1Q1CO0xKwHXvSNklzwLuPPVcFqcRNMAb n8CF8PsCbcLCwkriznysmlM1Ljej6gj0LbgTXnSoxYeOGuIKnOgVrrkQHmlFFsxknFy+FM CA28GlBYxfEuZw4bIn4QvSVB0ZeNcP4coj+YW1P2Q8G9e8+gUZh2XY1sXhqaXm6spgHTja 2St4ktDv2tG858jqgD4QlmeUoRVzLVt3vfEwupPZPOWum2pKiexq369BV7Acvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752864653; a=rsa-sha256; cv=none; b=vXLwXm3I6WqAaBdF1XKMGI23+QTOIQBlJTlbSBiMQps9EizvSB4wKtGc0Z8wY0i4M+/UBa CTMlDGrHeNPVZ3MQDgCSptkvgojBO765PI4q7jHpYZyIQjZTtxnVE4S6q/O2rC17mr+FKo yZhIMMkp9kSXh9INk49IAL4YIFUwJzBRqBWZoY9QPszu4RhXBS9OWeTSpFtonaPr5KycMJ AfdiQFEIYqWAGb1+5vG/q6xl7rLRVGHz3Vt43x8GFhQalZsAPFqKlP6NSeUFhT3ez29V2k 9ZMarF0J6A20c4jREQCBZL7oRS53+mjje9GYo5QZvoVrCetoBrCzOR2us8KE3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkJld3B6JzspN; Fri, 18 Jul 2025 18:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IIorTf055584; Fri, 18 Jul 2025 18:50:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IIorhK055581; Fri, 18 Jul 2025 18:50:53 GMT (envelope-from git) Date: Fri, 18 Jul 2025 18:50:53 GMT Message-Id: <202507181850.56IIorhK055581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: cf2ff49e6e5e - main - nfs_nfsdserv.c: Fix nfsrvd_openattr() for vnode locking List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf2ff49e6e5e3b9ac28e4f853a6ec9d9599d69b1 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=cf2ff49e6e5e3b9ac28e4f853a6ec9d9599d69b1 commit cf2ff49e6e5e3b9ac28e4f853a6ec9d9599d69b1 Author: Rick Macklem AuthorDate: 2025-07-18 18:47:59 +0000 Commit: Rick Macklem CommitDate: 2025-07-18 18:47:59 +0000 nfs_nfsdserv.c: Fix nfsrvd_openattr() for vnode locking Without this patch, nfsrvd_openattr() requests an unlocked vnode via VOP_LOOKUP(). This is not allowed for "options DEBUG_VFS_LOCKS" kernels, so this patch requests a locked vnode and then unlocks it. Fixes: e4c7b2b6053f ("nfsv4: Add support to NFSv4 for named attributes") --- sys/fs/nfsserver/nfs_nfsdserv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index f7564ade401b..3acf07d5253b 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -4353,9 +4353,10 @@ nfsrvd_openattr(struct nfsrv_descript *nd, __unused int isdgram, int error = 0; NFSNAMEICNDSET(&cn, nd->nd_cred, LOOKUP, OPENNAMED | ISLASTCN | - NOFOLLOW); + NOFOLLOW | LOCKLEAF); cn.cn_nameptr = "."; cn.cn_namelen = 1; + cn.cn_lkflags = LK_SHARED; NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); if (*tl == newnfs_true) cn.cn_flags |= CREATENAMED; @@ -4374,6 +4375,8 @@ nfsrvd_openattr(struct nfsrv_descript *nd, __unused int isdgram, if (nd->nd_repstat == ENOATTR) nd->nd_repstat = NFSERR_NOENT; } + if (nd->nd_repstat == 0) + NFSVOPUNLOCK(*vpp); vput(dp); NFSEXITCODE2(0, nd); From nobody Fri Jul 18 19:12:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKDm1W2Mz62gGc; Fri, 18 Jul 2025 19:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKDm0MPqz3xGG; Fri, 18 Jul 2025 19:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752865960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4n2SryGSZVHCtDogsHjurHB2+frw2AHW/Rre66tl1n4=; b=b8IgwemxESoBmOqh2pZKUJet3TXd/6csssgCTZLv0tnvAD7kK2sJ0H/OY8VVQfAWy/EEVj fAdjDxeB6xqDvg/OjbbWTYawjVa5/CbOTa0fn/DBepQayT84Ba7Vvk7YWkG+VNV/6KZ1Ye YAXrXucbA9Oz05XMXl6pVXxZ5XoJTxM/9PeAp1UAlOQWP0qcfmZYgfKiwTgDootXIvcOfh 7awU1XfzFuDGw395FZLIRc41w+xzOvwydSIXNbE/xpMIC4Sju7kjXoycXskj+XO2PYKBBu QaLRnmXyT4qF+HSEAjvyO/dDALPBgZ8JFONi51UPZkiMJ6GCZoJCdrf2lWqsiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752865960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4n2SryGSZVHCtDogsHjurHB2+frw2AHW/Rre66tl1n4=; b=D2irfeqrLnqBFrn5bIRgc1qVhQA20Wxn/FuhGgwyjatDWatGy/mPeylEk33CQ8eFQi/cFL nWmHSRRLoml5lg8rUi9m6oYGm/CBLVdHRc1UO1CUyJ5i7fa2A86N6wA+EQFqnMxfpwS4Qo 1rtQheJX7HdmnN2jWRm+8Fz1UeD678vNYU2P72rg9kQb3v0m8QtuyNODC7H0YR+sXxc0CZ +VOASBr8A/vgkklSKFuC0tdz5M3tErq4OT/O079fkOl7iyscTFrhAWtzUj369NgbqMlIWF wDMA1mvHCBamOlw9H93be2QXn8GKc7DZP6vQy1JWPnbtUsUCdr+xDVTGb2/EmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752865960; a=rsa-sha256; cv=none; b=m0yvdKpW9FU7kTY/sl/PrieybTLAdA/dVLZrWfolXOlj8RAQv4zE7swIcahwBU/Zt7ky+j Pnq3FU77nEt6A/3AyRHk3Aw4nFd1P7xnh00o628S9xchdupwa0/bTrLcbxOr4douIS1AMr 1przZrzxZNNFF1Xpjq8IAi8G1xa1z7YkwBi2tSfA+ZtJ192nXPZVEKg9VVYmwZdEKa4DsK 0roJpqcdIktLlKjaLg5DpTUi6EaSKm8bIeoB9OWHOxYG9hkxnlIt5y8AA/xHCTzagGDAqF ka2/A+nUdIZTuFUAA/8zsUtR+8dpa9xOscp2xT75pDxvFMm2qxv30X/g5lvVUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKDl61gczt9Q; Fri, 18 Jul 2025 19:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJCdqU099846; Fri, 18 Jul 2025 19:12:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJCdZQ099843; Fri, 18 Jul 2025 19:12:39 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:12:39 GMT Message-Id: <202507181912.56IJCdZQ099843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 798605131350 - main - pf tests: make mbuf:inet6_in_mbuf_len more robust List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7986051313507636e7bd971e9db03dce8d723e32 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7986051313507636e7bd971e9db03dce8d723e32 commit 7986051313507636e7bd971e9db03dce8d723e32 Author: Kristof Provost AuthorDate: 2025-07-18 09:54:25 +0000 Commit: Kristof Provost CommitDate: 2025-07-18 19:12:18 +0000 pf tests: make mbuf:inet6_in_mbuf_len more robust The mbuf:inet6_in_mbuf_len test sometimes fails because it encountered unexpected extra packets. These turn out to be MLD packets, so block these packets on the host with pf so they don't disturb what we're actually trying to test. Reviewed by: igoro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D51408 --- tests/sys/netpfil/pf/mbuf.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/sys/netpfil/pf/mbuf.sh b/tests/sys/netpfil/pf/mbuf.sh index d845f793a969..e3f138bb73b9 100644 --- a/tests/sys/netpfil/pf/mbuf.sh +++ b/tests/sys/netpfil/pf/mbuf.sh @@ -105,6 +105,12 @@ inet6_in_mbuf_len_body() epair=$(vnet_mkepair) ifconfig ${epair}a inet6 2001:db8::1/64 up no_dad + # Ensure we don't unintentionally send MLD packets to alcatraz + pfctl -e + echo "block + pass out inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv, echoreq, echorep } + " | pfctl -g -f - + # Set up a simple jail with one interface vnet_mkjail alcatraz ${epair}b jexec alcatraz ifconfig ${epair}b inet6 2001:db8::2/64 up no_dad From nobody Fri Jul 18 19:16:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKJs5qBjz62g56; Fri, 18 Jul 2025 19:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKJs3qrDz42FH; Fri, 18 Jul 2025 19:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jb8yPXaImzKwDmb1/6ioawBEbfPekZzBhL7Uoz0jjRw=; b=g2EO9tHDlguihmX2ePbELzbdJ30BfT7IMLYyBeorU4SPO2xVca6yobNgsiPMdhrSsC81Ka yV7aeL/9DzNu31CHbcTtFdVuBSG1aQWNdjnFXPq7UiVSUxuv3KaUH173gRgWTJ1jrwPMWD 3wwution9MfoZXyAfUbVK7jYJ6xJ/HQtlFGn0KRT4LG95rdjiAs8K9NQgAc30VLND7B/n6 74A0uGP8FDjIUVGhRUG3N2wFBPME6rnf9EBjpv/Jqbns75GeuCHsSJ/tNHHjNYSXrbqeRb y43dMpP02ZG6EihamLv0YU+SHeQXBeohc8lKauv/hmF45el7FGVtwqyVgAnS3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jb8yPXaImzKwDmb1/6ioawBEbfPekZzBhL7Uoz0jjRw=; b=TD7DXpYoZ/ayStZy2fiCiXIyc+XveX068H7+07thniT4DKijBqGx0jLpk5nPPu1V65LY57 Okbw1dtEt3pFjKJpMdnKlybGBX1vexIMK9zjDkAuRBiSr/noQqS0n4Ah68O1mFN1Y+wpvv pS0nkYqbiBSLLDrR24/dsKg04u9Jl4ugGt5joMdB1R87rQSQiFKZE3P5TiMmXo3XpX78Hp YMcCRDggBB+mChiCiMiZwd93gGA3lhVbx6R42756tr8Br56EZ/Xqfh0EoqfPej9LWxn+nA fsLVV++U9ozkhK8dAAjURa5Pyf4OGOqi0a7FQVdlYwGHa85e5Y328+1cFgTkyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866173; a=rsa-sha256; cv=none; b=WqwcTxdtSNPpa4jCcneuvgIS+4KwlMOJ1gZzEyBxvf5R0gjpOiMGLWE8gnGcb1FIQY4kgX 5O86DoAMl4BrZebpy1k4jXJoOx4mL8qeYLAATv+mnSOAW/JKOZcY7bjpIwRFDw46yMCaJD I/0GEIJNcavgSkFD27vhgQ+9MK0vCCgXr5S/UuIOXl8yg+7rtNKOIcjxaAOe6iXlGrcPd7 M4JAYAQQeg1XtY/tQg+S9kUv1ecKb2Jo6IzF2kQrZHtMQ9tDA+MWj4ql/chkE9/O4MLpbP IaRK1d+VbBf2QqdT36Th4hghofaoar9emiInRys6kIxJi5PvdJ/6+t7bqx1DXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKJs3Bksztl4; Fri, 18 Jul 2025 19:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGDgU000887; Fri, 18 Jul 2025 19:16:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGDx1000884; Fri, 18 Jul 2025 19:16:13 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:13 GMT Message-Id: <202507181916.56IJGDx1000884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bc761988b724 - main - ice: Add host SR-IOV support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc761988b724587fe9ed5b99858b05ef842243ac Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bc761988b724587fe9ed5b99858b05ef842243ac commit bc761988b724587fe9ed5b99858b05ef842243ac Author: Krzysztof Galazka AuthorDate: 2025-01-15 23:21:04 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:16 +0000 ice: Add host SR-IOV support Enable basic SR-IOV support for E800 adapters. Authored-by: Eric Joyner Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/conf/files.amd64 | 4 + sys/dev/ice/ice_features.h | 2 + sys/dev/ice/ice_iflib.h | 16 + sys/dev/ice/ice_iov.c | 1732 ++++++++++++++++++++++++++++++++++++++++++++ sys/dev/ice/ice_iov.h | 115 +++ sys/dev/ice/ice_lib.c | 20 + sys/dev/ice/ice_lib.h | 4 + sys/dev/ice/ice_vf_mbx.c | 471 ++++++++++++ sys/dev/ice/ice_vf_mbx.h | 67 ++ sys/dev/ice/if_ice_iflib.c | 117 +++ sys/modules/ice/Makefile | 1 + 11 files changed, 2549 insertions(+) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 0584fc29d039..678d288c2d86 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -191,6 +191,10 @@ dev/ice/irdma_di_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iov.c optional ice pci pci_iov \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_vf_mbx.c optional ice pci pci_iov \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/dev/ice/ice_features.h b/sys/dev/ice/ice_features.h index 821abe4806ca..5b23757b1c98 100644 --- a/sys/dev/ice/ice_features.h +++ b/sys/dev/ice/ice_features.h @@ -91,7 +91,9 @@ enum feat_list { static inline void ice_disable_unsupported_features(ice_bitmap_t __unused *bitmap) { +#ifndef PCI_IOV ice_clear_bit(ICE_FEATURE_SRIOV, bitmap); +#endif #ifndef DEV_NETMAP ice_clear_bit(ICE_FEATURE_NETMAP, bitmap); #endif diff --git a/sys/dev/ice/ice_iflib.h b/sys/dev/ice/ice_iflib.h index 3a5dc201189a..e1d5307a9516 100644 --- a/sys/dev/ice/ice_iflib.h +++ b/sys/dev/ice/ice_iflib.h @@ -139,6 +139,9 @@ struct ice_irq_vector { * @tc: traffic class queue belongs to * @q_handle: qidx in tc; used in TXQ enable functions * + * ice_iov.c requires the following parameters (when PCI_IOV is defined): + * @itr_idx: ITR index to use for this queue + * * Other parameters may be iflib driver specific */ struct ice_tx_queue { @@ -153,6 +156,9 @@ struct ice_tx_queue { u32 me; u16 q_handle; u8 tc; +#ifdef PCI_IOV + u8 itr_idx; +#endif /* descriptor writeback status */ qidx_t *tx_rsq; @@ -175,6 +181,9 @@ struct ice_tx_queue { * @stats: queue statistics * @tc: traffic class queue belongs to * + * ice_iov.c requires the following parameters (when PCI_IOV is defined): + * @itr_idx: ITR index to use for this queue + * * Other parameters may be iflib driver specific */ struct ice_rx_queue { @@ -187,6 +196,9 @@ struct ice_rx_queue { struct ice_irq_vector *irqv; u32 me; u8 tc; +#ifdef PCI_IOV + u8 itr_idx; +#endif struct if_irq que_irq; }; @@ -332,6 +344,10 @@ struct ice_softc { ice_declare_bitmap(feat_cap, ICE_FEATURE_COUNT); ice_declare_bitmap(feat_en, ICE_FEATURE_COUNT); +#ifdef PCI_IOV + struct ice_vf *vfs; + u16 num_vfs; +#endif struct ice_resmgr os_imgr; /* For mirror interface */ struct ice_mirr_if *mirr_if; diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c new file mode 100644 index 000000000000..75b50af0d1bc --- /dev/null +++ b/sys/dev/ice/ice_iov.c @@ -0,0 +1,1732 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright (c) 2025, Intel Corporation + * 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 Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file ice_iov.c + * @brief Virtualization support functions + * + * Contains functions for enabling and managing PCIe virtual function devices, + * including enabling new VFs, and managing VFs over the virtchnl interface. + */ + +#include "ice_iov.h" + +static struct ice_vf *ice_iov_get_vf(struct ice_softc *sc, int vf_num); +static void ice_iov_ready_vf(struct ice_softc *sc, struct ice_vf *vf); +static void ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf); +static void ice_iov_setup_intr_mapping(struct ice_softc *sc, struct ice_vf *vf); + +static void ice_vc_version_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_get_vf_res_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_add_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_del_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static bool ice_vc_isvalid_ring_len(u16 ring_len); +static void ice_vc_cfg_vsi_qs_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_cfg_rss_key_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_set_rss_hena_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_enable_queues_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_notify_vf_link_state(struct ice_softc *sc, struct ice_vf *vf); +static void ice_vc_disable_queues_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_cfg_irq_map_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_get_stats_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_eth_stats_to_virtchnl_eth_stats(struct ice_eth_stats *istats, + struct virtchnl_eth_stats *vstats); +static void ice_vc_cfg_rss_lut_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_cfg_promisc_mode_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_add_vlan_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static void ice_vc_del_vlan_msg(struct ice_softc *sc, struct ice_vf *vf, + u8 *msg_buf); +static enum virtchnl_status_code ice_iov_err_to_virt_err(int ice_err); +static int ice_vf_validate_mac(struct ice_vf *vf, const uint8_t *addr); + +/** + * ice_iov_attach - Initialize SR-IOV PF host support + * @sc: device softc structure + * + * Initialize SR-IOV PF host support at the end of the driver attach process. + * + * @pre Must be called from sleepable context (calls malloc() w/ M_WAITOK) + * + * @returns 0 if successful, or + * - ENOMEM if there is no memory for the PF/VF schemas or iov device + * - ENXIO if the device isn't PCI-E or doesn't support the same SR-IOV + * version as the kernel + * - ENOENT if the device doesn't have the SR-IOV capability + */ +int +ice_iov_attach(struct ice_softc *sc) +{ + device_t dev = sc->dev; + nvlist_t *pf_schema, *vf_schema; + int error; + + pf_schema = pci_iov_schema_alloc_node(); + vf_schema = pci_iov_schema_alloc_node(); + + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); + pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", + IOV_SCHEMA_HASDEFAULT, TRUE); + pci_iov_schema_add_bool(vf_schema, "allow-set-mac", + IOV_SCHEMA_HASDEFAULT, FALSE); + pci_iov_schema_add_bool(vf_schema, "allow-promisc", + IOV_SCHEMA_HASDEFAULT, FALSE); + pci_iov_schema_add_uint16(vf_schema, "num-queues", + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); + pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", + IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); + + error = pci_iov_attach(dev, pf_schema, vf_schema); + if (error != 0) { + device_printf(dev, + "pci_iov_attach failed (error=%s)\n", + ice_err_str(error)); + ice_clear_bit(ICE_FEATURE_SRIOV, sc->feat_en); + } else + ice_set_bit(ICE_FEATURE_SRIOV, sc->feat_en); + + return (error); +} + +/** + * ice_iov_detach - Teardown SR-IOV PF host support + * @sc: device softc structure + * + * Teardown SR-IOV PF host support at the start of the driver detach process. + * + * @returns 0 if successful or IOV support hasn't been setup, or + * - EBUSY if VFs still exist + */ +int +ice_iov_detach(struct ice_softc *sc) +{ + device_t dev = sc->dev; + int error; + + error = pci_iov_detach(dev); + if (error != 0) { + device_printf(dev, + "pci_iov_detach failed (error=%s)\n", + ice_err_str(error)); + } + + return (error); +} + +/** + * ice_iov_init - Called by the OS before the first VF is created. + * @sc: device softc structure + * @num_vfs: number of VFs to setup resources for + * @params: configuration parameters for the PF + * + * @returns 0 if successful or an error code on failure + */ +int +ice_iov_init(struct ice_softc *sc, uint16_t num_vfs, const nvlist_t *params __unused) +{ + /* Allocate array of VFs, for tracking */ + sc->vfs = (struct ice_vf *)malloc(sizeof(struct ice_vf) * num_vfs, M_ICE, M_NOWAIT | + M_ZERO); + if (sc->vfs == NULL) + return (ENOMEM); + + /* Initialize each VF with basic information */ + for (int i = 0; i < num_vfs; i++) + sc->vfs[i].vf_num = i; + + /* Save off number of configured VFs */ + sc->num_vfs = num_vfs; + + return (0); +} + +/** + * ice_iov_get_vf - Get pointer to VF at given index + * @sc: device softc structure + * @vf_num: Index of VF to retrieve + * + * @remark will throw an assertion if vf_num is not in the + * range of allocated VFs + * + * @returns a pointer to the VF structure at the given index + */ +static struct ice_vf * +ice_iov_get_vf(struct ice_softc *sc, int vf_num) +{ + MPASS(vf_num < sc->num_vfs); + + return &sc->vfs[vf_num]; +} + +/** + * ice_iov_add_vf - Called by the OS for each VF to create + * @sc: device softc structure + * @vfnum: index of VF to configure + * @params: configuration parameters for the VF + * + * @returns 0 if successful or an error code on failure + */ +int +ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, const nvlist_t *params) +{ + struct ice_tx_queue *txq; + struct ice_rx_queue *rxq; + device_t dev = sc->dev; + struct ice_vsi *vsi; + struct ice_vf *vf; + int vf_num_queues; + const void *mac; + size_t size; + int error; + int i; + + vf = ice_iov_get_vf(sc, vfnum); + vf->vf_flags = VF_FLAG_ENABLED; + + /* This VF needs at least one VSI */ + vsi = ice_alloc_vsi(sc, ICE_VSI_VF); + if (vsi == NULL) + return (ENOMEM); + vf->vsi = vsi; + vsi->vf_num = vfnum; + + vf_num_queues = nvlist_get_number(params, "num-queues"); + /* Validate and clamp value if invalid */ + if (vf_num_queues < 1 || vf_num_queues > ICE_MAX_SCATTERED_QUEUES) + device_printf(dev, "Invalid num-queues (%d) for VF %d\n", + vf_num_queues, vf->vf_num); + if (vf_num_queues < 1) { + device_printf(dev, "Setting VF %d num-queues to 1\n", vf->vf_num); + vf_num_queues = 1; + } else if (vf_num_queues > ICE_MAX_SCATTERED_QUEUES) { + device_printf(dev, "Setting VF %d num-queues to %d\n", + vf->vf_num, ICE_MAX_SCATTERED_QUEUES); + vf_num_queues = ICE_MAX_SCATTERED_QUEUES; + } + vsi->qmap_type = ICE_RESMGR_ALLOC_SCATTERED; + + /* Reserve VF queue allocation from PF queues */ + ice_alloc_vsi_qmap(vsi, vf_num_queues, vf_num_queues); + vsi->num_tx_queues = vsi->num_rx_queues = vf_num_queues; + + /* Assign Tx queues from PF space */ + error = ice_resmgr_assign_scattered(&sc->tx_qmgr, vsi->tx_qmap, + vsi->num_tx_queues); + if (error) { + device_printf(sc->dev, "Unable to assign VF Tx queues: %s\n", + ice_err_str(error)); + goto release_vsi; + } + + /* Assign Rx queues from PF space */ + error = ice_resmgr_assign_scattered(&sc->rx_qmgr, vsi->rx_qmap, + vsi->num_rx_queues); + if (error) { + device_printf(sc->dev, "Unable to assign VF Rx queues: %s\n", + ice_err_str(error)); + goto release_vsi; + } + + vsi->max_frame_size = ICE_MAX_FRAME_SIZE; + + /* Allocate queue structure memory */ + vsi->tx_queues = (struct ice_tx_queue *) + malloc(sizeof(struct ice_tx_queue) * vsi->num_tx_queues, M_ICE, + M_NOWAIT | M_ZERO); + if (!vsi->tx_queues) { + device_printf(sc->dev, "VF-%d: Unable to allocate Tx queue memory\n", + vfnum); + error = ENOMEM; + goto release_vsi; + } + for (i = 0, txq = vsi->tx_queues; i < vsi->num_tx_queues; i++, txq++) { + txq->me = i; + txq->vsi = vsi; + } + + /* Allocate queue structure memory */ + vsi->rx_queues = (struct ice_rx_queue *) + malloc(sizeof(struct ice_rx_queue) * vsi->num_rx_queues, M_ICE, + M_NOWAIT | M_ZERO); + if (!vsi->rx_queues) { + device_printf(sc->dev, "VF-%d: Unable to allocate Rx queue memory\n", + vfnum); + error = ENOMEM; + goto free_txqs; + } + for (i = 0, rxq = vsi->rx_queues; i < vsi->num_rx_queues; i++, rxq++) { + rxq->me = i; + rxq->vsi = vsi; + } + + /* Allocate space to store the IRQ vector data */ + vf->num_irq_vectors = vf_num_queues + 1; + vf->tx_irqvs = (struct ice_irq_vector *) + malloc(sizeof(struct ice_irq_vector) * (vf->num_irq_vectors), + M_ICE, M_NOWAIT); + if (!vf->tx_irqvs) { + device_printf(sc->dev, + "Unable to allocate TX irqv memory for VF-%d's %d vectors\n", + vfnum, vf->num_irq_vectors); + error = ENOMEM; + goto free_rxqs; + } + vf->rx_irqvs = (struct ice_irq_vector *) + malloc(sizeof(struct ice_irq_vector) * (vf->num_irq_vectors), + M_ICE, M_NOWAIT); + if (!vf->rx_irqvs) { + device_printf(sc->dev, + "Unable to allocate RX irqv memory for VF-%d's %d vectors\n", + vfnum, vf->num_irq_vectors); + error = ENOMEM; + goto free_txirqvs; + } + + /* Assign VF interrupts from PF space */ + if (!(vf->vf_imap = + (u16 *)malloc(sizeof(u16) * vf->num_irq_vectors, + M_ICE, M_NOWAIT))) { + device_printf(dev, "Unable to allocate VF-%d imap memory\n", vfnum); + error = ENOMEM; + goto free_rxirqvs; + } + error = ice_resmgr_assign_contiguous(&sc->dev_imgr, vf->vf_imap, vf->num_irq_vectors); + if (error) { + device_printf(dev, "Unable to assign VF-%d interrupt mapping: %s\n", + vfnum, ice_err_str(error)); + goto free_imap; + } + + if (nvlist_exists_binary(params, "mac-addr")) { + mac = nvlist_get_binary(params, "mac-addr", &size); + bcopy(mac, vf->mac, ETHER_ADDR_LEN); + + if (nvlist_get_bool(params, "allow-set-mac")) + vf->vf_flags |= VF_FLAG_SET_MAC_CAP; + } else + /* + * If the administrator has not specified a MAC address then + * we must allow the VF to choose one. + */ + vf->vf_flags |= VF_FLAG_SET_MAC_CAP; + + if (nvlist_get_bool(params, "mac-anti-spoof")) + vf->vf_flags |= VF_FLAG_MAC_ANTI_SPOOF; + + if (nvlist_get_bool(params, "allow-promisc")) + vf->vf_flags |= VF_FLAG_PROMISC_CAP; + + vsi->mirror_src_vsi = nvlist_get_number(params, "mirror-src-vsi"); + + vf->vf_flags |= VF_FLAG_VLAN_CAP; + + /* Create and setup VSI in HW */ + error = ice_initialize_vsi(vsi); + if (error) { + device_printf(sc->dev, "Unable to initialize VF %d VSI: %s\n", + vfnum, ice_err_str(error)); + goto release_imap; + } + + ice_iov_ready_vf(sc, vf); + + return (0); + +release_imap: + ice_resmgr_release_map(&sc->dev_imgr, vf->vf_imap, + vf->num_irq_vectors); +free_imap: + free(vf->vf_imap, M_ICE); + vf->vf_imap = NULL; +free_rxirqvs: + free(vf->rx_irqvs, M_ICE); + vf->rx_irqvs = NULL; +free_txirqvs: + free(vf->tx_irqvs, M_ICE); + vf->tx_irqvs = NULL; +free_rxqs: + free(vsi->rx_queues, M_ICE); + vsi->rx_queues = NULL; +free_txqs: + free(vsi->tx_queues, M_ICE); + vsi->tx_queues = NULL; +release_vsi: + ice_release_vsi(vsi); + vf->vsi = NULL; + return (error); +} + +/** + * ice_iov_uninit - Called by the OS when VFs are destroyed + * @sc: device softc structure + */ +void +ice_iov_uninit(struct ice_softc *sc) +{ + struct ice_vf *vf; + struct ice_vsi *vsi; + + /* Release per-VF resources */ + for (int i = 0; i < sc->num_vfs; i++) { + vf = &sc->vfs[i]; + vsi = vf->vsi; + + /* Free VF interrupt reservation */ + if (vf->vf_imap) { + free(vf->vf_imap, M_ICE); + vf->vf_imap = NULL; + } + + /* Free queue interrupt mapping trackers */ + if (vf->tx_irqvs) { + free(vf->tx_irqvs, M_ICE); + vf->tx_irqvs = NULL; + } + if (vf->rx_irqvs) { + free(vf->rx_irqvs, M_ICE); + vf->rx_irqvs = NULL; + } + + if (!vsi) + continue; + + /* Free VSI queues */ + if (vsi->tx_queues) { + free(vsi->tx_queues, M_ICE); + vsi->tx_queues = NULL; + } + if (vsi->rx_queues) { + free(vsi->rx_queues, M_ICE); + vsi->rx_queues = NULL; + } + + ice_release_vsi(vsi); + vf->vsi = NULL; + } + + /* Release memory used for VF tracking */ + if (sc->vfs) { + free(sc->vfs, M_ICE); + sc->vfs = NULL; + } + sc->num_vfs = 0; +} + +/** + * ice_iov_ready_vf - Setup VF interrupts and mark it as ready + * @sc: device softc structure + * @vf: driver's VF structure for the VF to update + * + * Clears VF reset triggering bit, sets up the PF<->VF interrupt + * mapping and marks the VF as active in the HW so that the VF + * driver can use it. + */ +static void +ice_iov_ready_vf(struct ice_softc *sc, struct ice_vf *vf) +{ + struct ice_hw *hw = &sc->hw; + u32 reg; + + /* Clear the triggering bit */ + reg = rd32(hw, VPGEN_VFRTRIG(vf->vf_num)); + reg &= ~VPGEN_VFRTRIG_VFSWR_M; + wr32(hw, VPGEN_VFRTRIG(vf->vf_num), reg); + + /* Setup VF interrupt allocation and mapping */ + ice_iov_setup_intr_mapping(sc, vf); + + /* Indicate to the VF that reset is done */ + wr32(hw, VFGEN_RSTAT(vf->vf_num), VIRTCHNL_VFR_VFACTIVE); + + ice_flush(hw); +} + +/** + * ice_reset_vf - Perform a hardware reset (VFR) on a VF + * @sc: device softc structure + * @vf: driver's VF structure for VF to be reset + * + * Performs a VFR for the given VF. This function busy waits until the + * reset completes in the HW, notifies the VF that the reset is done + * by setting a bit in a HW register, then returns. + * + * @remark This also sets up the PF<->VF interrupt mapping and allocations in + * the hardware after the hardware reset is finished, via + * ice_iov_setup_intr_mapping() + */ +static void +ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf) +{ + u16 global_vf_num, reg_idx, bit_idx; + struct ice_hw *hw = &sc->hw; + int status; + u32 reg; + int i; + + global_vf_num = vf->vf_num + hw->func_caps.vf_base_id; + + reg = rd32(hw, VPGEN_VFRTRIG(vf->vf_num)); + reg |= VPGEN_VFRTRIG_VFSWR_M; + wr32(hw, VPGEN_VFRTRIG(vf->vf_num), reg); + + /* clear the VFLR bit for the VF in a GLGEN_VFLRSTAT register */ + reg_idx = (global_vf_num) / 32; + bit_idx = (global_vf_num) % 32; + wr32(hw, GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx)); + ice_flush(hw); + + /* Wait until there are no pending PCI transactions */ + wr32(hw, PF_PCI_CIAA, + ICE_PCIE_DEV_STATUS | (global_vf_num << PF_PCI_CIAA_VF_NUM_S)); + + for (i = 0; i < ICE_PCI_CIAD_WAIT_COUNT; i++) { + reg = rd32(hw, PF_PCI_CIAD); + if (!(reg & PCIEM_STA_TRANSACTION_PND)) + break; + + DELAY(ICE_PCI_CIAD_WAIT_DELAY_US); + } + if (i == ICE_PCI_CIAD_WAIT_COUNT) + device_printf(sc->dev, + "VF-%d PCI transactions stuck\n", vf->vf_num); + + /* Disable TX queues, which is required during VF reset */ + status = ice_dis_vsi_txq(hw->port_info, vf->vsi->idx, 0, 0, NULL, NULL, + NULL, ICE_VF_RESET, vf->vf_num, NULL); + if (status) + device_printf(sc->dev, + "%s: Failed to disable LAN Tx queues: err %s aq_err %s\n", + __func__, ice_status_str(status), + ice_aq_str(hw->adminq.sq_last_status)); + + /* Then check for the VF reset to finish in HW */ + for (i = 0; i < ICE_VPGEN_VFRSTAT_WAIT_COUNT; i++) { + reg = rd32(hw, VPGEN_VFRSTAT(vf->vf_num)); + if ((reg & VPGEN_VFRSTAT_VFRD_M)) + break; + + DELAY(ICE_VPGEN_VFRSTAT_WAIT_DELAY_US); + } + if (i == ICE_VPGEN_VFRSTAT_WAIT_COUNT) + device_printf(sc->dev, + "VF-%d Reset is stuck\n", vf->vf_num); + + ice_iov_ready_vf(sc, vf); +} + +/** + * ice_vc_get_vf_res_msg - Handle VIRTCHNL_OP_GET_VF_RESOURCES msg from VF + * @sc: device private structure + * @vf: VF tracking structure + * @msg_buf: raw message buffer from the VF + * + * Receives a message from the VF listing its supported capabilities, and + * replies to the VF with information about what resources the PF has + * allocated for the VF. + * + * @remark This always replies to the VF with a success status; it does not + * fail. It's up to the VF driver to reject or complain about the PF's response. + */ +static void +ice_vc_get_vf_res_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) +{ + struct ice_hw *hw = &sc->hw; + struct virtchnl_vf_resource *vf_res; + u16 vf_res_len; + u32 vf_caps; + + /* XXX: Only support one VSI per VF, so this size doesn't need adjusting */ + vf_res_len = sizeof(struct virtchnl_vf_resource); + vf_res = (struct virtchnl_vf_resource *)malloc(vf_res_len, M_ICE, M_WAITOK | M_ZERO); + + vf_res->num_vsis = 1; + vf_res->num_queue_pairs = vf->vsi->num_tx_queues; + vf_res->max_vectors = vf_res->num_queue_pairs + 1; + + vf_res->rss_key_size = ICE_GET_SET_RSS_KEY_EXTEND_KEY_SIZE; + vf_res->rss_lut_size = ICE_VSIQF_HLUT_ARRAY_SIZE; + vf_res->max_mtu = 0; + + vf_res->vf_cap_flags = VF_BASE_MODE_OFFLOADS; + if (msg_buf != NULL) { + vf_caps = *((u32 *)(msg_buf)); + + if (vf_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) + vf_res->vf_cap_flags |= VIRTCHNL_VF_CAP_ADV_LINK_SPEED; + } + + vf_res->vsi_res[0].vsi_id = vf->vsi->idx; + vf_res->vsi_res[0].num_queue_pairs = vf->vsi->num_tx_queues; + vf_res->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV; + vf_res->vsi_res[0].qset_handle = 0; + + ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_GET_VF_RESOURCES, + VIRTCHNL_STATUS_SUCCESS, (u8 *)vf_res, vf_res_len, NULL); + + free(vf_res, M_ICE); +} + +/** + * ice_vc_version_msg - Handle VIRTCHNL_OP_VERSION msg from VF + * @sc: device private structure + * @vf: VF tracking structure + * @msg_buf: raw message buffer from the VF + * + * Receives a version message from the VF, and responds to the VF with + * the version number that the PF will use. + * + * @remark This always replies to the VF with a success status; it does not + * fail. + */ +static void +ice_vc_version_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) +{ + struct virtchnl_version_info *recv_vf_version; + struct ice_hw *hw = &sc->hw; + device_t dev = sc->dev; + + recv_vf_version = (struct virtchnl_version_info *)msg_buf; + + /* VFs running the 1.0 API expect to get 1.0 back */ + if (VF_IS_V10(recv_vf_version)) { + vf->version.major = 1; + vf->version.minor = VIRTCHNL_VERSION_MINOR_NO_VF_CAPS; + } else { + vf->version.major = VIRTCHNL_VERSION_MAJOR; + vf->version.minor = VIRTCHNL_VERSION_MINOR; + + if ((recv_vf_version->major != VIRTCHNL_VERSION_MAJOR) || + (recv_vf_version->minor != VIRTCHNL_VERSION_MINOR)) + device_printf(dev, + "%s: VF-%d requested version (%d.%d) differs from PF version (%d.%d)\n", + __func__, vf->vf_num, + recv_vf_version->major, recv_vf_version->minor, + VIRTCHNL_VERSION_MAJOR, VIRTCHNL_VERSION_MINOR); + } + + ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_VERSION, + VIRTCHNL_STATUS_SUCCESS, (u8 *)&vf->version, sizeof(vf->version), + NULL); +} + +/** + * ice_vf_validate_mac - Validate MAC address before adding it + * @vf: VF tracking structure + * @addr: MAC address to validate + * + * Validate a MAC address before adding it to a VF during the handling + * of a VIRTCHNL_OP_ADD_ETH_ADDR operation. Notably, this also checks if + * the VF is allowed to set its own arbitrary MAC addresses. + * + * Returns 0 if MAC address is valid for the given vf + */ +static int +ice_vf_validate_mac(struct ice_vf *vf, const uint8_t *addr) +{ + + if (ETHER_IS_ZERO(addr) || ETHER_IS_BROADCAST(addr)) + return (EINVAL); + + /* + * If the VF is not allowed to change its MAC address, don't let it + * set a MAC filter for an address that is not a multicast address and + * is not its assigned MAC. + */ + if (!(vf->vf_flags & VF_FLAG_SET_MAC_CAP) && + !(ETHER_IS_MULTICAST(addr) || !bcmp(addr, vf->mac, ETHER_ADDR_LEN))) + return (EPERM); + + return (0); +} + +/** + * ice_vc_add_eth_addr_msg - Handle VIRTCHNL_OP_ADD_ETH_ADDR msg from VF + * @sc: device private structure + * @vf: VF tracking structure + * @msg_buf: raw message buffer from the VF + * + * Receives a list of MAC addresses from the VF and adds those addresses + * to the VSI's filter list. + */ +static void +ice_vc_add_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) +{ + enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; + struct virtchnl_ether_addr_list *addr_list; + struct ice_hw *hw = &sc->hw; + int error = 0; + + addr_list = (struct virtchnl_ether_addr_list *)msg_buf; + + for (int i = 0; i < addr_list->num_elements; i++) { + u8 *addr = addr_list->list[i].addr; + + /* The type flag is currently ignored; every MAC address is + * treated as the LEGACY type + */ + + error = ice_vf_validate_mac(vf, addr); + if (error == EPERM) { + device_printf(sc->dev, + "%s: VF-%d: Not permitted to add MAC addr for VSI %d\n", + __func__, vf->vf_num, vf->vsi->idx); + v_status = VIRTCHNL_STATUS_ERR_PARAM; + continue; + } else if (error) { + device_printf(sc->dev, + "%s: VF-%d: Did not add invalid MAC addr for VSI %d\n", + __func__, vf->vf_num, vf->vsi->idx); + v_status = VIRTCHNL_STATUS_ERR_PARAM; + continue; + } + + error = ice_add_vsi_mac_filter(vf->vsi, addr); + if (error) { + device_printf(sc->dev, + "%s: VF-%d: Error adding MAC addr for VSI %d\n", + __func__, vf->vf_num, vf->vsi->idx); + v_status = VIRTCHNL_STATUS_ERR_PARAM; + goto done; + } + } + +done: + ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR, + v_status, NULL, 0, NULL); +} + +/** + * ice_vc_del_eth_addr_msg - Handle VIRTCHNL_OP_DEL_ETH_ADDR msg from VF + * @sc: device private structure + * @vf: VF tracking structure + * @msg_buf: raw message buffer from the VF + * + * Receives a list of MAC addresses from the VF and removes those addresses + * from the VSI's filter list. + */ +static void +ice_vc_del_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) +{ + enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; + struct virtchnl_ether_addr_list *addr_list; + struct ice_hw *hw = &sc->hw; + int error = 0; + + addr_list = (struct virtchnl_ether_addr_list *)msg_buf; + + for (int i = 0; i < addr_list->num_elements; i++) { + error = ice_remove_vsi_mac_filter(vf->vsi, addr_list->list[i].addr); + if (error) { + device_printf(sc->dev, + "%s: VF-%d: Error removing MAC addr for VSI %d\n", + __func__, vf->vf_num, vf->vsi->idx); + v_status = VIRTCHNL_STATUS_ERR_PARAM; + goto done; + } + } + +done: + ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR, + v_status, NULL, 0, NULL); +} + +/** + * ice_vc_add_vlan_msg - Handle VIRTCHNL_OP_ADD_VLAN msg from VF + * @sc: PF's softc structure + * @vf: VF tracking structure + * @msg_buf: message buffer from VF + * + * Adds the VLANs in msg_buf to the VF's VLAN filter list. + */ +static void +ice_vc_add_vlan_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) +{ + struct ice_hw *hw = &sc->hw; + struct virtchnl_vlan_filter_list *vlan_list; + int status = 0; + enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; + struct ice_vsi *vsi = vf->vsi; + + vlan_list = (struct virtchnl_vlan_filter_list *)msg_buf; + + if (vlan_list->vsi_id != vsi->idx) { + device_printf(sc->dev, + "VF-%d: Message has invalid VSI ID (expected %d, got %d)\n", + vf->vf_num, vsi->idx, vlan_list->vsi_id); + v_status = VIRTCHNL_STATUS_ERR_PARAM; + goto done; + } + + status = ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, + vlan_list->num_elements); + if (status) { + device_printf(sc->dev, + "VF-%d: Failure adding VLANs to VSI %d, err %s aq_err %s\n", + vf->vf_num, vsi->idx, ice_status_str(status), + ice_aq_str(sc->hw.adminq.sq_last_status)); + v_status = ice_iov_err_to_virt_err(status); + goto done; + } + +done: + ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, + v_status, NULL, 0, NULL); +} + +/** + * ice_vc_del_vlan_msg - Handle VIRTCHNL_OP_DEL_VLAN msg from VF + * @sc: PF's softc structure + * @vf: VF tracking structure + * @msg_buf: message buffer from VF + * + * Removes the VLANs in msg_buf from the VF's VLAN filter list. + */ +static void +ice_vc_del_vlan_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) +{ + struct ice_hw *hw = &sc->hw; + struct virtchnl_vlan_filter_list *vlan_list; + int status = 0; + enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; + struct ice_vsi *vsi = vf->vsi; + + vlan_list = (struct virtchnl_vlan_filter_list *)msg_buf; + + if (vlan_list->vsi_id != vsi->idx) { + device_printf(sc->dev, + "VF-%d: Message has invalid VSI ID (expected %d, got %d)\n", + vf->vf_num, vsi->idx, vlan_list->vsi_id); + v_status = VIRTCHNL_STATUS_ERR_PARAM; + goto done; + } + + status = ice_remove_vlan_hw_filters(vsi, vlan_list->vlan_id, + vlan_list->num_elements); + if (status) { + device_printf(sc->dev, + "VF-%d: Failure deleting VLANs from VSI %d, err %s aq_err %s\n", + vf->vf_num, vsi->idx, ice_status_str(status), + ice_aq_str(sc->hw.adminq.sq_last_status)); + v_status = ice_iov_err_to_virt_err(status); + goto done; + } + +done: + ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, + v_status, NULL, 0, NULL); +} + +/** + * ice_vc_validate_ring_len - Check to see if a descriptor ring length is valid + * @ring_len: length of ring + * + * Check whether a ring size value is valid. + * *** 1810 LINES SKIPPED *** From nobody Fri Jul 18 19:16:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKJv2CfJz62gJS; Fri, 18 Jul 2025 19:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKJt4CHvz4243; Fri, 18 Jul 2025 19:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vC6fJ69LCjkkcvkKERndkU8xTgUN+Z12Q1dIcAgB2QM=; b=ThEbHDpJhNKpev2FQpRKD2cGRj3NJiKoFAQDqvEEYgrXH4VJnZcAZhE/Z7eb+eVIG31PL/ Ic+dL5dtjNAKQLOIu3jht9RhQDX+zhDVpNJrT6rdLUIL4ZJ4YBJCaze6+M6bwN24cZx93I 1hYSEfa+fpZR10w5we8w5i/iyXM2nRuvW2GZ3JoVOPgbzjrPt4LZbyzWKNQha7r856Xhlb Jip/Sdu03g4cvSEQqg/NaJbXGzs5MggwEqzZVW4mOApu4Kg7C5IUQBFSdsaZpimaMPlPxS Gohr5GJEBcKE5VcmzvyhvmtOVJtefOfCM09tB856cLgsrOwcMDHm2hcPwcag6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vC6fJ69LCjkkcvkKERndkU8xTgUN+Z12Q1dIcAgB2QM=; b=GTr+Jq0Ko51Hlhupr/CGnlgD1fdHJeSrpR5MF4R4jyojHDpMcH+skL6ghxiUPnaKocaKuq Y+3Tnw0xd9W0dZu09dsozFbLLqgOELOBWHwYmhbzm2pmXz9xBvw7ZGrpFxwpm6yB0f8hX0 VPhaimhAJaal9qe+YhUNBD8ENypXCmViKz9hRiET8/STj19NkO1BmVzZiPplbXD4Zug1y4 kkyRBjAxZ4YGDXkkSZbiw2YVtgkYuPw9ptsr/rCUfRuE2/k6+nN2psx4XNW4rQawvTgOum TeJjHYcoJ8c2yR7okXTqf3VLFJAGRKdA0QCZzfwCMuLCYjfdEjC/SMlcYKOJIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866174; a=rsa-sha256; cv=none; b=S0GfxZBDd1Bvn3FcPeUEfhzVM+fhJZV7+oh1tD7sx+9hqqMVItaLVMUeKS7VpkPOp1tN9O Ma9SXSJrP0rki1lhVAy91Rp5eGZFpbUtZGfegyzgRiaEB0ipnmUwqxoG5Pynn0tR+oQAip 55HyoeVKxVwKi4YHQ19yWqa2L1dRsYeP4aEaKiH5PyvDEyvmdfOiPiLJ9z6b9cHp+K5q4j g3Ff0lw3V9A9MFGnPJvgDUu62WGHeHvswqHQv5DVPYQGarmqELpNTp9ZazLmsphkJMkTZr UPdIdzLkHIr/BXG7m0KqD2FppFxUsDH8vbSD1TIg9QQcsny2UN3RGSumITaXMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKJt3qBmztn8; Fri, 18 Jul 2025 19:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGEWi000919; Fri, 18 Jul 2025 19:16:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGEjo000916; Fri, 18 Jul 2025 19:16:14 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:14 GMT Message-Id: <202507181916.56IJGEjo000916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 160becc7dc3d - main - ice: Add broadcast filter while creating VF List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 160becc7dc3db59b2f43eb8b6e02019c94821f40 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=160becc7dc3db59b2f43eb8b6e02019c94821f40 commit 160becc7dc3db59b2f43eb8b6e02019c94821f40 Author: Krzysztof Galazka AuthorDate: 2025-01-15 23:43:43 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:16 +0000 ice: Add broadcast filter while creating VF Filter for unicast MAC address is configured with a virtual channel message, but filter for a broadcast traffic was missing. It caused issues with e.g. ARP. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index 75b50af0d1bc..0d04c06b3140 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -369,6 +369,14 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, const nvlist_t *params) goto release_imap; } + /* Add the broadcast address */ + error = ice_add_vsi_mac_filter(vsi, broadcastaddr); + if (error) { + device_printf(sc->dev, "Unable to add broadcast filter VF %d VSI: %s\n", + vfnum, ice_err_str(error)); + goto release_imap; + } + ice_iov_ready_vf(sc, vf); return (0); From nobody Fri Jul 18 19:16:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKJw103Rz62g59; Fri, 18 Jul 2025 19:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKJv5nV5z42LB; Fri, 18 Jul 2025 19:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=85aj+FgqhIPhQTpl95/sjhey+5EJEhmg4OeXC4YlX6A=; b=e9CU8osaVY+yXelwMEiboDQVO+6G5NoCnXUyNNyDSnUkjLC3IyukIrh934+luCPgCmFtGw /qrCXE/8uFx2gU8exxTft6FFz0OiLF6fjMFCwpRgIUxwgLUpifg7QN+1bcNGth00qxNd/W +if5Am/+lFqjVq7BWQBdbIOQLlptgFQgHtSqM/O6lvY99Np1XjUuxmk68yIQckeJ3D9VMf /oRvnjXvRb+92GQWEx0wDP7VKbNv105SmFbnvizHKHsV4BjdYFc4n0eG5UmxuSAQhaHXy/ 7eGVDtlSv/o3gq1kezNWl0Jutj+1+xR/QdlpN6iJZQvz7JaV1LEUSkkx0rKZUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=85aj+FgqhIPhQTpl95/sjhey+5EJEhmg4OeXC4YlX6A=; b=WCT5odMenBRX7sFde3Mk4gu4sZK2dFxz07AthqPG03rRFSYsL6E44x5FOJcQXuEMISOGCu jFpLI8E0VklrUsf9xY8uGdAf3dByNqktzuHMGYb5V5fMii5RRcP3vrwlpKCKmbK4Rv1z9V mP1hjXqY3IkHg3IqvYtdQRs82jZawvUKlvnO1r68HbszZfDI0WSsUlY/Fyc8sCuldNllGi MNCOW0E0CdzdjOe0YN5WnVgAh+ugxoPRb2Z7OmLx4ZqFFekdVkdFB30Z4LFVcUK9yCuVxQ 2rRB2zDZneL/y77d2T3/WSBxTHluXaWDnBz6lXyMOjy8HSWMo4ULmWqrHVt56w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866175; a=rsa-sha256; cv=none; b=OyRhfffgDcCPGthm/fsiIu8r7Y6Luo39HDjJ6AeXX+BNSZ8h/m+XW+MM4NvlfhdouX/0Y4 2N5rJ+qg2NrBngnsF1TTrpfeKE4Jdj2wdw4i1M9lgmz7ttQfycEWFt6G6KonnpcAQbnuyM Ia7GHQWIj5s6r+LqzlT21Qb0shLilWChpYAm3zjJQ0jGKqQsl1Seki7Nvvq8CBs/fG50jS Jd9aCfTXXtgkB3Ghlq8NqOGIlet1quQrjdX0vJOZxYcY0lJ+q6he7EH8oo2u/9Gqf7rKYx S8p2FuL6lqyF9rU5Pa6Nv8Y/aIOEKszqmaQV4wuEJlr+qXhOoGLAkU/uog/84Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKJv52m7zt81; Fri, 18 Jul 2025 19:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGFlg000951; Fri, 18 Jul 2025 19:16:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGFj3000949; Fri, 18 Jul 2025 19:16:15 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:15 GMT Message-Id: <202507181916.56IJGFj3000949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 21f339571328 - main - ice(4): Fix panic when VF uses less queues then available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21f33957132876c8a5815b793fd72e8310230caf Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=21f33957132876c8a5815b793fd72e8310230caf commit 21f33957132876c8a5815b793fd72e8310230caf Author: Krzysztof Galazka AuthorDate: 2025-02-12 13:41:01 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:16 +0000 ice(4): Fix panic when VF uses less queues then available VF driver may request to configure MSI-X vectors for less queues than assigned by PF. Don't try to configure unassigned vectors to avoid panic. While at that make the loop process whole array of vectors received in a VIRTCHNL_OP_CFG_IRQ_MAP message from a VF. It's not guarantied that vector '0', which is used for other interrupt causes and is not mapped to a queue, will be always on the last position. Condition inside the loop already handles that vector correctly. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index 0d04c06b3140..b11fb225f30a 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -1242,7 +1242,7 @@ ice_vc_cfg_irq_map_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) vvm = vimi->vecmap; /* Save off information from message */ - for (int i = 0; i < vimi->num_vectors - 1; i++, vvm++) { + for (int i = 0; i < vimi->num_vectors; i++, vvm++) { struct ice_tx_queue *txq; struct ice_rx_queue *rxq; int bit; @@ -1305,12 +1305,14 @@ ice_vc_cfg_irq_map_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) /* Write to T/RQCTL registers to actually map vectors to queues */ for (int i = 0; i < vf->vsi->num_rx_queues; i++) - ice_configure_rxq_interrupt(hw, vsi->rx_qmap[i], - vsi->rx_queues[i].irqv->me, vsi->rx_queues[i].itr_idx); + if (vsi->rx_queues[i].irqv != NULL) + ice_configure_rxq_interrupt(hw, vsi->rx_qmap[i], + vsi->rx_queues[i].irqv->me, vsi->rx_queues[i].itr_idx); for (int i = 0; i < vf->vsi->num_tx_queues; i++) - ice_configure_txq_interrupt(hw, vsi->tx_qmap[i], - vsi->tx_queues[i].irqv->me, vsi->tx_queues[i].itr_idx); + if (vsi->tx_queues[i].irqv != NULL) + ice_configure_txq_interrupt(hw, vsi->tx_qmap[i], + vsi->tx_queues[i].irqv->me, vsi->tx_queues[i].itr_idx); ice_flush(hw); From nobody Fri Jul 18 19:16:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKJx4BZkz62gV5; Fri, 18 Jul 2025 19:16:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKJw6Rvyz42LF; Fri, 18 Jul 2025 19:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KKVfJevkL6kgOCuUCKEI+7YhwHsq7+zA/ByN8rmaDnE=; b=OUzSKA1db+pNwDaXj2P+nU/XPIrM1976mW9xjLfata2818b35OuVpHbqUR19BoclrrVEwN QHBDM+nwQ4TIcX4FeLXI1mU53etiSwB0ow2XBo2zBE2PFPKNk/zmZrANvFabWTTxhBUHCj OevObUdCtPj8g0h+GA9aB8sPtITFBU+uy7pn5aTCUThzhWwNR+yWb1MOdtX5alKWFhoXha obIDakjPvT7vvFuVOLqUnTIYSONATEtT5jv+mhAppr43pAj0YdAjsh7cG5Hqspb+jDZIm+ 7BxjGizMQj1cRiE254OaWjdGstdDxfMhXbt/Mb3iGlVzTrngrzeWCLGfqBawiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KKVfJevkL6kgOCuUCKEI+7YhwHsq7+zA/ByN8rmaDnE=; b=NltfFa6+XkM9kSxYgtDBgH56ZQTWmzzhnlPWPSoSWGERKal/UqAYzQZbHBEfZAH8sZywtN TDelSgjNN5joJg2Hg+5OI2KReurdiiY0SCtFwTdw+Qc5AHDeyGIQh8uVKWm9qkMFetjY7H 7M9vF/OAW8doG4va6x5m5ZK8UeIeI0EFkdHuy5Wy4YVjImgcWxKYnkj/x3hC51CD4MeRRi aXbQBjUNL3KzEwsSni4WMG2MzIFqNzwOKZESiMxYawjsgk5vMcdY3xJsSPqn0BlR0K2pvJ pDj8CjTH+pTaReqAFGRnO45pR7BaRmcR+nd3v86QrnduB5EOmolodpis3lvn+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866176; a=rsa-sha256; cv=none; b=Xn9nENBOR7eF+LtHMUjjN1TF/nf5HJHwM7+cLcOTVNPXKm4WeV8B4sWzR2fqGvDZeTtTjC quB50qk9LCHmQaPOk6jdvmqDyvNiPBVDPAHctpADEHy6EVYqIhXrGSrg2buI30sgensc3Z 7uOQ9nqrIzuz/bQEt8WYrk8mJDbw5x+dBB/w7pM7FrxjPvnrGOMaL/sPdDjXgqy5iobnM+ kQ06ZR3LqUZKu141M31vumggQCkb/d8cspaspsHnYvC6CVyFZ1GR0BnVKpnqBwGkxOeYA2 Ound6/VqRJigJisR2ARUsseAbTjiZdYSszDZ6p8cDrsxaG2XEC5iqdvvQcitkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKJw60xWztk5; Fri, 18 Jul 2025 19:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGGtK000983; Fri, 18 Jul 2025 19:16:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGGcG000980; Fri, 18 Jul 2025 19:16:16 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:16 GMT Message-Id: <202507181916.56IJGGcG000980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 925a15b969a5 - main - ice(4): Add basic VFLR handler List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 925a15b969a586bc9beec1afdc477f0d6e0aa625 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=925a15b969a586bc9beec1afdc477f0d6e0aa625 commit 925a15b969a586bc9beec1afdc477f0d6e0aa625 Author: Krzysztof Galazka AuthorDate: 2025-02-12 16:17:53 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:16 +0000 ice(4): Add basic VFLR handler PF driver needs to tear down and setup VF configuration after a reset event, e.g. due to reloading a VF driver. Re-use ice_reset_vf function for that by adding new parameter, which decides if new reset has to be triggered. This most likely does not cover all necessary steps and will be extended in future commits. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 41 +++++++++++++++++++++++++++++++++++------ sys/dev/ice/ice_iov.h | 2 ++ sys/dev/ice/if_ice_iflib.c | 21 ++++++++++++++++++--- 3 files changed, 55 insertions(+), 9 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index b11fb225f30a..af0bef7bf2f0 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -41,7 +41,8 @@ static struct ice_vf *ice_iov_get_vf(struct ice_softc *sc, int vf_num); static void ice_iov_ready_vf(struct ice_softc *sc, struct ice_vf *vf); -static void ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf); +static void ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf, + bool trigger_vflr); static void ice_iov_setup_intr_mapping(struct ice_softc *sc, struct ice_vf *vf); static void ice_vc_version_msg(struct ice_softc *sc, struct ice_vf *vf, @@ -461,6 +462,31 @@ ice_iov_uninit(struct ice_softc *sc) sc->num_vfs = 0; } +/** + * ice_iov_handle_vflr - Process VFLR event + * @sc: device softc structure + * + * Identifys which VFs have been reset and re-configure + * them. + */ +void +ice_iov_handle_vflr(struct ice_softc *sc) +{ + struct ice_hw *hw = &sc->hw; + struct ice_vf *vf; + u32 reg, reg_idx, bit_idx; + + for (int i = 0; i < sc->num_vfs; i++) { + vf = &sc->vfs[i]; + + reg_idx = (hw->func_caps.vf_base_id + vf->vf_num) / 32; + bit_idx = (hw->func_caps.vf_base_id + vf->vf_num) % 32; + reg = rd32(hw, GLGEN_VFLRSTAT(reg_idx)); + if (reg & BIT(bit_idx)) + ice_reset_vf(sc, vf, false); + } +} + /** * ice_iov_ready_vf - Setup VF interrupts and mark it as ready * @sc: device softc structure @@ -494,6 +520,7 @@ ice_iov_ready_vf(struct ice_softc *sc, struct ice_vf *vf) * ice_reset_vf - Perform a hardware reset (VFR) on a VF * @sc: device softc structure * @vf: driver's VF structure for VF to be reset + * @trigger_vflr: trigger a reset or only handle already executed reset * * Performs a VFR for the given VF. This function busy waits until the * reset completes in the HW, notifies the VF that the reset is done @@ -504,7 +531,7 @@ ice_iov_ready_vf(struct ice_softc *sc, struct ice_vf *vf) * ice_iov_setup_intr_mapping() */ static void -ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf) +ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf, bool trigger_vflr) { u16 global_vf_num, reg_idx, bit_idx; struct ice_hw *hw = &sc->hw; @@ -514,9 +541,11 @@ ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf) global_vf_num = vf->vf_num + hw->func_caps.vf_base_id; - reg = rd32(hw, VPGEN_VFRTRIG(vf->vf_num)); - reg |= VPGEN_VFRTRIG_VFSWR_M; - wr32(hw, VPGEN_VFRTRIG(vf->vf_num), reg); + if (trigger_vflr) { + reg = rd32(hw, VPGEN_VFRTRIG(vf->vf_num)); + reg |= VPGEN_VFRTRIG_VFSWR_M; + wr32(hw, VPGEN_VFRTRIG(vf->vf_num), reg); + } /* clear the VFLR bit for the VF in a GLGEN_VFLRSTAT register */ reg_idx = (global_vf_num) / 32; @@ -1581,7 +1610,7 @@ ice_vc_handle_vf_msg(struct ice_softc *sc, struct ice_rq_event_info *event) ice_vc_version_msg(sc, vf, msg); break; case VIRTCHNL_OP_RESET_VF: - ice_reset_vf(sc, vf); + ice_reset_vf(sc, vf, true); break; case VIRTCHNL_OP_GET_VF_RESOURCES: ice_vc_get_vf_res_msg(sc, vf, msg); diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h index 4da94259e00f..c2ac5fcd5c94 100644 --- a/sys/dev/ice/ice_iov.h +++ b/sys/dev/ice/ice_iov.h @@ -108,6 +108,8 @@ int ice_iov_init(struct ice_softc *sc, uint16_t num_vfs, const nvlist_t *params) int ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, const nvlist_t *params); void ice_iov_uninit(struct ice_softc *sc); +void ice_iov_handle_vflr(struct ice_softc *sc); + void ice_vc_handle_vf_msg(struct ice_softc *sc, struct ice_rq_event_info *event); void ice_vc_notify_all_vfs_link_state(struct ice_softc *sc); diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 359964d17cd6..1469d2916465 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -1712,6 +1712,11 @@ ice_if_msix_intr_assign(if_ctx_t ctx, int msix) /* For future interrupt assignments */ sc->last_rid = rid + sc->irdma_vectors; +#ifdef PCI_IOV + /* Create soft IRQ for handling VF resets */ + iflib_softirq_alloc_generic(ctx, NULL, IFLIB_INTR_IOV, sc, 0, "iov"); +#endif + return (0); fail: for (; i >= 0; i--, vector--) @@ -2456,6 +2461,15 @@ ice_if_update_admin_status(if_ctx_t ctx) /* Check and update link status */ ice_update_link_status(sc, false); +#ifdef PCI_IOV + /* + * Schedule VFs' reset handler after global resets + * and other events were processed. + */ + if (ice_testandclear_state(&sc->state, ICE_STATE_VFLR_PENDING)) + iflib_iov_intr_deferred(ctx); +#endif + /* * If there are still messages to process, we need to reschedule * ourselves. Otherwise, we can just re-enable the interrupt. We'll be @@ -3457,12 +3471,13 @@ ice_if_iov_vf_add(if_ctx_t ctx, uint16_t vfnum, const nvlist_t *params) * Performs the necessar teardown or setup required for a VF after * a VFLR is initiated. * - * @remark This is unimplemented + * @remark This is a wrapper for ice_iov_handle_vflr */ static void -ice_if_vflr_handle(if_ctx_t ctx __unused) +ice_if_vflr_handle(if_ctx_t ctx) { - return; + struct ice_softc *sc = (struct ice_softc *)iflib_get_softc(ctx); + ice_iov_handle_vflr(sc); } #endif /* PCI_IOV */ From nobody Fri Jul 18 19:16:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKJy6fmdz62gV6; Fri, 18 Jul 2025 19:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKJy0XcNz42Fh; Fri, 18 Jul 2025 19:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FWqc6neON3ymTgPmI/9PYIOfplviVSGnKyrW/yZMwws=; b=M9PKbrtHOftyhjw1ecL1oWKmmu9Q+eGo14TkwSU2SmSu3ingTyudPzH6KY6eAwlJ8NIn2i 1HMrDoTLcGrGWk9F6pVn5AfALXInoxqADSMaJSkxKYHO9uYiXhHdkcHEatm7lUwEANat97 NdTLAYFQO3DFTUsiEQwAJyvVLz/VOT+yq2zeNT1HWgAVxLflMRqCylPtnmi2rfYZF4Zsm8 6f94hHEC/7QGBuecEeIm+cmJk0pYk6SkMJh1FUKcVmCF8dpMcJcBP3TTL3+Smb5PSARJGp s5jDhK5TVfUP0m4XIxrWtlWG57kgpVxQfNmgOz6BmFq4OXHJFlBwnUnCzgruxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FWqc6neON3ymTgPmI/9PYIOfplviVSGnKyrW/yZMwws=; b=dGn5+QwPYPNrNLHQil18DoKi2ZIvr9jfwF/L1gUoEGTCPpLkWWcf7hH2PPkM4QJ8fo42vK BF4hZDL+Baw3mltxM/leX3PuMAecPJ+VxdlDuoMZ03EZ+42q8HFqArl3nT+TJaURMQlTVj NNl/kmDcYsLInrcpANjasRgFqoT6F71UaF/08zD7qcAEV5V0HeZIddHcPEIZlXvzPalToz fYTQ7NKhueOPfkhA78arvUU3BVKtibzlRPrU3oZDPGHYMJVlfuVRcwPCvqEHjXCNeWxays SocIPhEzbSCSsf8vU83/yvKSAucB9dKcN/kOpUtG8ZUhhvqohb1akZe6U81YyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866178; a=rsa-sha256; cv=none; b=Qt5UAxVXfrGIDlHwG+fnqVmJbQXNjRBW0oRVQcC5vVZtaEfuid013+iR5+ksDFVwoIlHeh USAwxNUJZL1LJVXgQg3uFCqa0jPP7X4iS0VHO7/XVqCH0BrfUC00hfChqjC2V+ArKx80og QoN0g9ASTo99a89nvePXSX+vgppsoOkQeOrUg6Xg6dGtkQQHJJ/A14UdNodCGVOZtMmnMb bgY9YJpQFVdrZOZEFW+KJo0nE0p66zkDOZf+AKeC84IL8eSW9CPjvKq5IBAC2P7vWoo7hH cj5Kx7MH3s4X1zPzeVmUne8TH3b14yZGaHrd+Ra9BjMuaYy+seHjxXmPkWHGFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKJx71Ptztl5; Fri, 18 Jul 2025 19:16:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGHRL001015; Fri, 18 Jul 2025 19:16:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGHjt001012; Fri, 18 Jul 2025 19:16:17 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:17 GMT Message-Id: <202507181916.56IJGHjt001012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d6958f3faec0 - main - ice(4): Fix re-enabling VF queues List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6958f3faec023dfb7be5c01133c1a70c779e7b5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d6958f3faec023dfb7be5c01133c1a70c779e7b5 commit d6958f3faec023dfb7be5c01133c1a70c779e7b5 Author: Krzysztof Galazka AuthorDate: 2025-03-06 21:47:31 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:16 +0000 ice(4): Fix re-enabling VF queues On receiving a virtual channel request from VF driver tried to configure and enable Tx and Rx queues without making sure that they were disabled. It caused issue with reloading a VF driver without a reset e.g. in case it crashed. Fix that by always disabling all Rx and Tx queues. While at that make sure that only queues requested by VF driver are enabled. VF driver may use less queues than assigned to the function when it was created. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 31 ++++++++++++++++++++++++++----- sys/dev/ice/ice_lib.c | 8 ++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index af0bef7bf2f0..3785a6c8dd13 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -925,7 +925,9 @@ ice_vc_cfg_vsi_qs_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) struct virtchnl_queue_pair_info *vqpi; enum virtchnl_status_code status = VIRTCHNL_STATUS_SUCCESS; struct ice_vsi *vsi = vf->vsi; - int error = 0; + struct ice_tx_queue *txq; + struct ice_rx_queue *rxq; + int i, error = 0; vqci = (struct virtchnl_vsi_queue_config_info *)msg_buf; @@ -935,11 +937,30 @@ ice_vc_cfg_vsi_qs_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) goto done; } - vqpi = vqci->qpair; - for (int i = 0; i < vqci->num_queue_pairs; i++, vqpi++) { - struct ice_tx_queue *txq; - struct ice_rx_queue *rxq; + ice_vsi_disable_tx(vf->vsi); + ice_control_all_rx_queues(vf->vsi, false); + + /* + * Clear TX and RX queues config in case VF + * requests different number of queues. + */ + for (i = 0; i < vsi->num_tx_queues; i++) { + txq = &vsi->tx_queues[i]; + + txq->desc_count = 0; + txq->tx_paddr = 0; + txq->tc = 0; + } + for (i = 0; i < vsi->num_rx_queues; i++) { + rxq = &vsi->rx_queues[i]; + + rxq->desc_count = 0; + rxq->rx_paddr = 0; + } + + vqpi = vqci->qpair; + for (i = 0; i < vqci->num_queue_pairs; i++, vqpi++) { /* Initial parameter validation */ if (vqpi->txq.vsi_id != vf->vsi->idx || vqpi->rxq.vsi_id != vf->vsi->idx || diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index 3e8b9c85c5ae..442111e5ffaf 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -1675,6 +1675,10 @@ ice_cfg_vsi_for_tx(struct ice_vsi *vsi) struct ice_tlan_ctx tlan_ctx = { 0 }; struct ice_tx_queue *txq = &vsi->tx_queues[i]; + /* Last configured queue */ + if (txq->desc_count == 0) + break; + pf_q = vsi->tx_qmap[txq->me]; qg->txqs[0].txq_id = htole16(pf_q); @@ -1803,6 +1807,10 @@ ice_cfg_vsi_for_rx(struct ice_vsi *vsi) for (i = 0; i < vsi->num_rx_queues; i++) { MPASS(vsi->mbuf_sz > 0); + /* Last configured queue */ + if (vsi->rx_queues[i].desc_count == 0) + break; + err = ice_setup_rx_ctx(&vsi->rx_queues[i]); if (err) return err; From nobody Fri Jul 18 19:16:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKJz2ttPz62g2W; Fri, 18 Jul 2025 19:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKJz1KgHz42CS; Fri, 18 Jul 2025 19:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PMlNhXlvww7QaYXsOMlpLiKJ6Li3qiPcmx/Y6CZnmkc=; b=Rw/rKCoSBFYpnZTjmaolMGcn4bvabJeoWyTSmpOTkO9qJSOmyMhjIiii3nXUudoV87+YAR c9kVzhyjNKeKPgE3JXigNItiFgwjPmcubpNhFg4xD/mwuI2CtZDlG76OofiwULllkmvDyu LpDETU+8A2EP06e6sAcE4KUrvsT6ViUJOk3d8nI0FJmp2lj5Wo5yRLRW2fKoTtH3Ux7UzE kx9hTC3BEPFFh6ViaQv/oiJXCEGSeA31uLy6mr22sZbBBeaqW2zIs9L8Id8Yn+gAS06O8K HSOQEZb62K2T0BgfHlGLNbcLyDbN610cwv00Ld57ie3pSur0unYKkDh1W0TTMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PMlNhXlvww7QaYXsOMlpLiKJ6Li3qiPcmx/Y6CZnmkc=; b=I51ZzIHDPgyjxLoO789y7xPek0wTi2K/zw+Py51HUwBaSLJCkeAoXXNFcz/YEaBJ8dQdzt 5mqb2ko3RMupRHn3YVswbGMoSlNWDMKVOEIIGcrb91BQzoDWwnl3f+dyB/LDavSXS65RgJ pTNLa3mP+B/tVsvLjoza4+ujweHObxlnc3bxHj1A9XHwXYY4bqMUroZl740GAYxDwxrCPR ZZIv5Z0DPqQG+XMJ+JXmP4SeYClN8DOwCIX6/BUNFslQ7khyrVmzixgbCXXYwGFZNJgTMJ KpmhlLFmMZ1PRG0/jNE6TmVFeOGivPzH3oV2ZwmrdBLlmtoUCFT0qKsC1HDNmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866179; a=rsa-sha256; cv=none; b=Sh0n6WFFrO8wn0a8UuARPAAlZj6nVgPiyfF+Fj5s4/Z2QADAjnroN5VmgyD21ZgYaRSduy faoaHuftRonID9idlZ39D+++VXlEPoO4ly6nnaXAX67YY5Vh0E2mLiGMXw/AN8A5DK7mtU +150dZdT0j/Bw04kxDwK/KOc891r3ogxnfO+bfPctsa8NW8E3PcYKKcsTHoBgBfB7/Thva 3HL2aT04tvjiHvrtpqwrr31GvZ1DfygpswaMy1myiBhgRobinxeim9XMw18E4vkdKBbwT7 XG5qOgzHooINMkcs3qdqn2rz0UG2kj3kTRY4vqCG2wFs9z6UTo9vOVGFU+rDLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKJz0WNnzt82; Fri, 18 Jul 2025 19:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGIgZ001056; Fri, 18 Jul 2025 19:16:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGIMI001053; Fri, 18 Jul 2025 19:16:18 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:18 GMT Message-Id: <202507181916.56IJGIMI001053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 69bb592fa3da - main - ice(4): Fix set RSS hena virtchnl op handler List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69bb592fa3daed00982bbdf75c3b41898e476d9b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=69bb592fa3daed00982bbdf75c3b41898e476d9b commit 69bb592fa3daed00982bbdf75c3b41898e476d9b Author: Krzysztof Galazka AuthorDate: 2025-03-12 07:50:46 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:17 +0000 ice(4): Fix set RSS hena virtchnl op handler Remove existing RSS HENA configuration to make sure that only config requested by VF is applied and allow VFs to disable RSS completely. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index 3785a6c8dd13..05393083af16 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -1139,17 +1139,34 @@ ice_vc_set_rss_hena_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; struct ice_vsi *vsi = vf->vsi; + MPASS(vsi != NULL); + vrh = (struct virtchnl_rss_hena *)msg_buf; - status = ice_add_avf_rss_cfg(hw, vsi->idx, vrh->hena); - if (status) { - device_printf(sc->dev, - "ice_add_avf_rss_cfg status %s, error %s\n", - ice_status_str(status), - ice_aq_str(hw->adminq.sq_last_status)); - v_status = ice_iov_err_to_virt_err(status); + /* + * Remove existing configuration to make sure only requested + * config is applied and allow VFs to disable RSS completly. + */ + status = ice_rem_vsi_rss_cfg(hw, vsi->idx); + if (vrh->hena) { + /* + * Problem with removing config is not fatal, when new one + * is requested. Warn about it but try to apply new config + * anyway. + */ + if (status) + device_printf(sc->dev, + "ice_rem_vsi_rss_cfg status %s, error %s\n", + ice_status_str(status), + ice_aq_str(hw->adminq.sq_last_status)); + status = ice_add_avf_rss_cfg(hw, vsi->idx, vrh->hena); + if (status) + device_printf(sc->dev, + "ice_add_avf_rss_cfg status %s, error %s\n", + ice_status_str(status), + ice_aq_str(hw->adminq.sq_last_status)); } - + v_status = ice_iov_err_to_virt_err(status); ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_SET_RSS_HENA, v_status, NULL, 0, NULL); } From nobody Fri Jul 18 19:16:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKK12cW5z62gMv; Fri, 18 Jul 2025 19:16:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKK02Qcbz4278; Fri, 18 Jul 2025 19:16:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDvxn17trmHg+OCI1ovQvW7+L29Kbc+Ver/TtIvtUvQ=; b=u9dVzjYVdsiSPZqem0u03Nr0WLRTl71M8Ayd9ig2x2Cr7zZ/am+5gY3GCg0/lUecvwW6Jz DSNanl/7LRvsNWuqLFyBmtUwZY/j6qaENCzZLZPe4/cdRP0F81Xt6NrgEf8DNO1voIXddc 0cH32ERTI/TAro49AMV1fcPYe524mJP++0QoBQ0uR3FxySnHRLN6y3p7qnTSpPhu4EleXW kHuGP+Pt6P75okMDNENuSFf0cVU9mjZfhG2Xh3wudfeYzt3nFPm/E/fU8i0kPExD/Bxusq cwC3/NjcPN0KfuafVLv/cAEIXX3PiyDoFm78OSeAu/RYcJqzn1ezqnxIt7LXcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDvxn17trmHg+OCI1ovQvW7+L29Kbc+Ver/TtIvtUvQ=; b=czQ+vKCte8qmIDXF98YwndFaQykrNuUDQo3EWk8kDNjMo+q7gkm63sHxrHFyG4hd8FTGmn TXjRm9jirmmhNzlSXEDGLoQABVDZl5IYk5TfNKIMNk7phQrDkP8PzLGkXt0ZEQVhK5Trh9 b1o3+nN8Gv49zi2l7igsWSpid6hOszu4kKOJZTm7+OD1pyAhgP2neX6+A84X/mny/wNjPR d+BLc0krtcKhSDFjZLZiQFdmd4Ntlraq6WZWduKXLMcJzZLOLVq6KEM7MtJwMGlc2fWfrn smc5AQh7GB2Arkk4AlDQcnVawBq9ijOn6i1UH81VRGeibm/EnfAmWa6zwhMoIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866180; a=rsa-sha256; cv=none; b=X8WlYdFBGBcG5q5rFTooUJGLI2PSCHaSNy85xLPflu0239P9hCY9lS7S7PUXXxbzWM1Xyj QBpDqRHC8iiokAR4cuwmJILOq+a+Qpm7VFNwuHbvnZQS84D8ZLcQKoMI5/NdqIUS7INIb/ 2CnstOgzWnevBKOdygzFu9d9Q6PcdIK2rKXnvCvFvyEg0L9CZgSdG/3BoNdwMu3gt5w1qk ito2mwrp4EVH2bUq7GLQ5ew/g8Fg0F5syVLTCaSzpV4j2c5aXG/bYUW53FY860YG+9JWIx 5ZIeztTawV93Wm+y0x+hf4boDhura8ugC40MyKmoHb/DH3dbG/NCGoweAKEFow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKK01PHCzt83; Fri, 18 Jul 2025 19:16:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGKPJ001089; Fri, 18 Jul 2025 19:16:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGKaj001086; Fri, 18 Jul 2025 19:16:20 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:20 GMT Message-Id: <202507181916.56IJGKaj001086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 51ed28c12f30 - main - ice(4): Enable WB_ON_ITR capability for VFs (#76) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51ed28c12f30519bd803fc367dd942398f0de6e3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=51ed28c12f30519bd803fc367dd942398f0de6e3 commit 51ed28c12f30519bd803fc367dd942398f0de6e3 Author: Krzysztof Galazka AuthorDate: 2025-03-13 08:46:30 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:17 +0000 ice(4): Enable WB_ON_ITR capability for VFs (#76) Let VF driver know that HW supports WB_ON_ITR feature. It allows polling mode driver such as DPDK to configure an immediate write-back of completed descriptors. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index 05393083af16..fc37a0e7679c 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -631,6 +631,9 @@ ice_vc_get_vf_res_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) if (vf_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) vf_res->vf_cap_flags |= VIRTCHNL_VF_CAP_ADV_LINK_SPEED; + + if (vf_caps & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) + vf_res->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_WB_ON_ITR; } vf_res->vsi_res[0].vsi_id = vf->vsi->idx; From nobody Fri Jul 18 19:16:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKK33C5nz62g2h; Fri, 18 Jul 2025 19:16:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKK240xgz42JG; Fri, 18 Jul 2025 19:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rjXHpSSHkHcUbsL/o3L74bhzxTUgI1y/qpuvJwRj99o=; b=ZzvzLzQN3PxnON/QEEfo/gzNkaSwU4/tT6dIOQgUKT70SC6SvM61zkSiOanzOq+hH/baA5 S9e9Wox6x7tfvHZE2ESRhQrlc+vYo4alJ5BleWI9q7Wrd4ZADQa60AwJtsjZ9rCmuy0t5F lddNC2UOrCucPS4kU8s+rvFzF/10M/2Mh//z1Pbn/tJjtSWsQqkK/LhQeU4CXzqi7y28HQ fCoqhrin8KU9Rjjk7RJfGfK3YEaPSlY78aCpWFCLHSc+OyUzCpetZTTkWNfNsLkh7IwPR/ Whk9pRLWA8on3NZvhnpFsTW2cHPrctubRfYm+dsDEmwdMn5DxSfPEdihJYsCAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rjXHpSSHkHcUbsL/o3L74bhzxTUgI1y/qpuvJwRj99o=; b=gtAC/QZNpr3nRXPbioS5ci8lapJEUUGqaWL5cjk5oeCMaOlshnBfqGE4+FeAl+8azPNk8g 7X1D6JHEZGl2hx+aT5tXyiStwnuTzOFcPnzhZM5qgngEgu/azFezrBs/MEvqg/7gjJnhGk y6HpKSrbsZd9PNIUcDfLAgMLyWfiaG5wpjYT+f5Jr9WBqoDxSgjue1ABaUD4weDG9kPk+a R6ji/QBYbotA3sW8507NuKzbbndTSzQauLOIPq5RfZZD6/wcFpW6/2xa3kwarj77jLlDyz idlMU6EvwzKjC3jdwXB7+gbPas3n2cVKe07r8paGTUoVw9vqugvodRVCKlnU1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866182; a=rsa-sha256; cv=none; b=TWd9QEPKneaeU6qmR0w5TmjOFZPWrFNk8eNGgYf9VSU3ec/goflBmvu8Ehau2cQvmwzZAj dHKgVNITuCu7MH59dOWOm11MFy/YqWCQippEZ5csCtjaDL9p9maS1xvMRu5izSN6dfR7ul U0D02ax9Ddmc8ilIE7ybXAefVTAwhnoLPfCaO9AIrptzQ0fzpAEi2V8TcpzOCBQI370XL6 rVOmdIoviOm9igVzbdzg0hNvu76PUJ1L+amqUEtDLMAsILT1rTiHwVdHVRmbfHuUq8E06R 7HC8r2IK//wEIxrZezaq1eYuWvQk2cAg1dZ43UJ6/1tfWAq60Q23FtrNZ2YzkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKK23HPmztl6; Fri, 18 Jul 2025 19:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGMr2001158; Fri, 18 Jul 2025 19:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGMCk001155; Fri, 18 Jul 2025 19:16:22 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:22 GMT Message-Id: <202507181916.56IJGMCk001155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 046472590365 - main - ice(4): Fix setting VF MAC address List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 046472590365c3bf1e076efa49471d52a033da35 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=046472590365c3bf1e076efa49471d52a033da35 commit 046472590365c3bf1e076efa49471d52a033da35 Author: Krzysztof Galazka AuthorDate: 2025-06-17 15:01:34 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:17 +0000 ice(4): Fix setting VF MAC address MAC address assigned to a Virtual Function using iovctl configuration was not passed to the VF, but its presence caused ICE to reject random address generated by the VF. This lead to VF not being able to send or recieve traffic. Send the administratively assigned MAC address to a VF in a response to the 'Get VF Resources' virtual channel command. While at that replace bcopy with memcpy for consistency, and shorten an over 80 characters line. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index e06c7eb56f7a..c5a3e1060e44 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -345,7 +345,7 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, const nvlist_t *params) if (nvlist_exists_binary(params, "mac-addr")) { mac = nvlist_get_binary(params, "mac-addr", &size); - bcopy(mac, vf->mac, ETHER_ADDR_LEN); + memcpy(vf->mac, mac, ETHER_ADDR_LEN); if (nvlist_get_bool(params, "allow-set-mac")) vf->vf_flags |= VF_FLAG_SET_MAC_CAP; @@ -617,12 +617,14 @@ ice_vc_get_vf_res_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) { struct ice_hw *hw = &sc->hw; struct virtchnl_vf_resource *vf_res; + struct virtchnl_vsi_resource *vsi_res; u16 vf_res_len; u32 vf_caps; /* XXX: Only support one VSI per VF, so this size doesn't need adjusting */ vf_res_len = sizeof(struct virtchnl_vf_resource); - vf_res = (struct virtchnl_vf_resource *)malloc(vf_res_len, M_ICE, M_WAITOK | M_ZERO); + vf_res = (struct virtchnl_vf_resource *)malloc(vf_res_len, M_ICE, + M_WAITOK | M_ZERO); vf_res->num_vsis = 1; vf_res->num_queue_pairs = vf->vsi->num_tx_queues; @@ -643,10 +645,13 @@ ice_vc_get_vf_res_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) vf_res->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_WB_ON_ITR; } - vf_res->vsi_res[0].vsi_id = vf->vsi->idx; - vf_res->vsi_res[0].num_queue_pairs = vf->vsi->num_tx_queues; - vf_res->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV; - vf_res->vsi_res[0].qset_handle = 0; + vsi_res = &vf_res->vsi_res[0]; + vsi_res->vsi_id = vf->vsi->idx; + vsi_res->num_queue_pairs = vf->vsi->num_tx_queues; + vsi_res->vsi_type = VIRTCHNL_VSI_SRIOV; + vsi_res->qset_handle = 0; + if (!ETHER_IS_ZERO(vf->mac)) + memcpy(vsi_res->default_mac_addr, vf->mac, ETHER_ADDR_LEN); ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_GET_VF_RESOURCES, VIRTCHNL_STATUS_SUCCESS, (u8 *)vf_res, vf_res_len, NULL); From nobody Fri Jul 18 19:16:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKK20qSPz62gRs; Fri, 18 Jul 2025 19:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKK12jNBz42Ln; Fri, 18 Jul 2025 19:16:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QFNcd5naY1HJlp8pt5q7lZk1odKFJrHPMOsE/Wi0Hxc=; b=Ts3PxVMZk/1uIwfM7G27JlyL2NTsVRv24jVuJjpSP3Sp5JIkZekl27JU3KD1rH1LB+bsAx 6TR3aOR90EZfzH+4l7UrvfijbQcqxh1S+btEwcjUDY5BfYXub7AwDcg0WSL8M4jidf3k8n PHFIBYsc7OhgvRRNkbXVBU6pxWHkwvyyXDcaKTreQMmml5gXorId+RVnaHFaTIGFi5fJ+i YVUO9fHMiljekVcysg0SMKJVLvJo0hUYGFPx4zuExEoRu3gZZfjAXvCMPemADWEsPb9xqK iT4ZGsrqULGCzEOjr27ex1Y0CoHIg0dSRhtB0vzZqTuWJ5XvRuf3cyzBBoxtVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QFNcd5naY1HJlp8pt5q7lZk1odKFJrHPMOsE/Wi0Hxc=; b=Q6Def2pYYF44ZEz7QzcoU6kWuVbox6S2rhvTjYxbeN4qhQ20KBdPBDiASv/QbA7ysckXsL tkbIbZGTCxvxkPLBrHgxYNhFK9Vx5dIZzSiOGcXmJctjy4IkxCqj22F5u028uxwG/Zei6u um0EJumq4p9zefNYkdczaXW1VK9Ka+UP7zb9e0CT8XWyhSJTY2iEgM0hECtulDfv3tmWJ3 ccxihatwtxNwoK4qQZKxTWX9VuVxpdiwJBnOfvUHN5aaT7rGjLxUw4lFWRZRvG9WLiQokz qhAnNTtCtK2NS6y17PfKOssXXW48x1Ow2I5W9GigrsUOwIvkO7QSSmvr5yctag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866181; a=rsa-sha256; cv=none; b=TfpKQgtxCFFaMBoY5w/FS2dLdHNfu2G96Kq3Tje2rRZN7SAlxqc+Vo4ibF5OJJnc7kLqTI UgZYlgx8k1fIGpcxy4oygNi8gJkFkVJ/OWzruZrvOxB1W/0nvLTOFFqaf481dqnpzTf1XT WmR3t0HSWmRHsRX9LnOptfLArLfyADry+aQrS6aDDulq5s+Nhv890lRX3ArrJfN1JDJtY9 /H85WLPNzpbn7OVP4PL2Oin6gsHqnDQzCMD7XQpYv9rjZhOdoS2ALmcKf3VNODuOpcYEW0 BQqMPLZqIXalHehPkgGAzjPJG8J7noy52e9zsCobhJm+xKQyQkJDxivyxirdaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkKK12826ztPX; Fri, 18 Jul 2025 19:16:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IJGLI5001125; Fri, 18 Jul 2025 19:16:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGLMK001122; Fri, 18 Jul 2025 19:16:21 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:21 GMT Message-Id: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 430f1acc451c - main - ice(4): Add MAC filter and VLAN resource limits to VFs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 Author: Eric Joyner AuthorDate: 2024-10-17 22:19:09 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:17 +0000 ice(4): Add MAC filter and VLAN resource limits to VFs Adds two new parameters to iovctl config for VLAN filter limits and MAC filter limits and gives them defaults of 64 and 16, respectively. These are intended to limit the number of resources that a VF can consume so that any one VF cannot starve an other VFs or the PF of filters. Signed-off-by: Eric Joyner Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- sys/dev/ice/ice_iov.h | 8 ++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index fc37a0e7679c..e06c7eb56f7a 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc) IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); + pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed", + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT); + pci_iov_schema_add_uint16(vf_schema, "max-mac-filters", + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT); error = pci_iov_attach(dev, pf_schema, vf_schema); if (error != 0) { @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, const nvlist_t *params) vsi->mirror_src_vsi = nvlist_get_number(params, "mirror-src-vsi"); + vf->vlan_limit = nvlist_get_number(params, "max-vlan-allowed"); + vf->mac_filter_limit = nvlist_get_number(params, "max-mac-filters"); + vf->vf_flags |= VF_FLAG_VLAN_CAP; /* Create and setup VSI in HW */ @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; struct virtchnl_ether_addr_list *addr_list; struct ice_hw *hw = &sc->hw; + u16 added_addr_cnt = 0; int error = 0; addr_list = (struct virtchnl_ether_addr_list *)msg_buf; + if (addr_list->num_elements > + (vf->mac_filter_limit - vf->mac_filter_cnt)) { + v_status = VIRTCHNL_STATUS_ERR_NO_MEMORY; + goto done; + } + for (int i = 0; i < addr_list->num_elements; i++) { u8 *addr = addr_list->list[i].addr; @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) "%s: VF-%d: Error adding MAC addr for VSI %d\n", __func__, vf->vf_num, vf->vsi->idx); v_status = VIRTCHNL_STATUS_ERR_PARAM; - goto done; + continue; } + /* Don't count VF's MAC against its MAC filter limit */ + if (memcmp(addr, vf->mac, ETHER_ADDR_LEN)) + added_addr_cnt++; } + vf->mac_filter_cnt += added_addr_cnt; + done: ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR, v_status, NULL, 0, NULL); @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; struct virtchnl_ether_addr_list *addr_list; struct ice_hw *hw = &sc->hw; + u16 deleted_addr_cnt = 0; int error = 0; addr_list = (struct virtchnl_ether_addr_list *)msg_buf; @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) "%s: VF-%d: Error removing MAC addr for VSI %d\n", __func__, vf->vf_num, vf->vsi->idx); v_status = VIRTCHNL_STATUS_ERR_PARAM; - goto done; + continue; } + /* Don't count VF's MAC against its MAC filter limit */ + if (memcmp(addr_list->list[i].addr, vf->mac, ETHER_ADDR_LEN)) + deleted_addr_cnt++; } -done: + if (deleted_addr_cnt >= vf->mac_filter_cnt) + vf->mac_filter_cnt = 0; + else + vf->mac_filter_cnt -= deleted_addr_cnt; + ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR, v_status, NULL, 0, NULL); } @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) goto done; } + if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) { + v_status = VIRTCHNL_STATUS_ERR_NO_MEMORY; + goto done; + } + status = ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, vlan_list->num_elements); if (status) { @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) goto done; } + vf->vlan_cnt += vlan_list->num_elements; + done: ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, v_status, NULL, 0, NULL); @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) goto done; } + if (vlan_list->num_elements >= vf->vlan_cnt) + vf->vlan_cnt = 0; + else + vf->vlan_cnt -= vlan_list->num_elements; + done: ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, v_status, NULL, 0, NULL); diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h index c2ac5fcd5c94..c4fb3e932e3f 100644 --- a/sys/dev/ice/ice_iov.h +++ b/sys/dev/ice/ice_iov.h @@ -85,6 +85,11 @@ struct ice_vf { u16 vf_num; struct virtchnl_version_info version; + u16 mac_filter_limit; + u16 mac_filter_cnt; + u16 vlan_limit; + u16 vlan_cnt; + u16 num_irq_vectors; u16 *vf_imap; struct ice_irq_vector *tx_irqvs; @@ -101,6 +106,9 @@ struct ice_vf { #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC | \ FLAG_VF_MULTICAST_PROMISC) +#define ICE_DEFAULT_VF_VLAN_LIMIT 64 +#define ICE_DEFAULT_VF_FILTER_LIMIT 16 + int ice_iov_attach(struct ice_softc *sc); int ice_iov_detach(struct ice_softc *sc); From nobody Fri Jul 18 19:43:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkKwG4zt3z62hT4 for ; Fri, 18 Jul 2025 19:43:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKwG2JDKz3RHZ for ; Fri, 18 Jul 2025 19:43:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-879c737bc03so78552739f.0 for ; Fri, 18 Jul 2025 12:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1752867803; x=1753472603; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZQvdFUADie1A78OurJ6dWShyBmBQ9ggFJl2u5d/3KFU=; b=RoVy6WClHe06GDDGmHhuKRPv5F/8sTYBoDiAM4QI0ILg9i2M/4ASRCHRi2K+C2pNlc X00d0/aNspXvFFVd16nQMG9jb9KuqnnVOZBt4VTrGAUKzkZ90kBcYN+wQu1pyWv59bxS 4jrTHX+5EqjVSip4WA8VL7g5yhdER3dufP0/R20uo0QrJvf8srF4P7zkVnBWVUedmAGh yRbkiXVwYDnZQyL4q4Jg3J1LEOqfdA4ij1FpJL7xUQqIJOYGo930gYpTsNX4viVYQK2L 6G9iYfJwsat3IuQSzh1nWHWR9Pr3Cm2ykDl4bzdnQA2i+xZ95Z/XI+umu/5Y+3jWaVho y/3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752867803; x=1753472603; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZQvdFUADie1A78OurJ6dWShyBmBQ9ggFJl2u5d/3KFU=; b=t/DpecBCFID+PmlpQBts1xfhwKgnrs+8XPYzUr7CsIE4qnhP7TJ0MdkBB/bEDeYomV yZrpveRvX9AOfskdNP9zLR5no4sCuUHtko4O++3VD8keE81qRAwrTBkcs1hEZAHCznyU sTL2hSptoUblTmiZcMc8sczTYkfmejVuz/k3pcW8o8EkE4Ffn8ntwb9IAod8cmqpwTlc aOErBDa1RzIParANqQ0shSxDMH7h3LuMwdritOZbgSJaZNZgidrcrimoXJLeVBZKI+jx AhyUjVEyyHuBs2foU58M+PYMMiivgzobuqP+BmZYsXREFpip2aN0HjckjVgiEEJkCwVP NmSw== X-Forwarded-Encrypted: i=1; AJvYcCVsHOEfNsNs45+Z7YppkY2aIXSfeKmjYkap/sTOxnSMjeWzLIntbnxdFuLN6btkSGG9rXBQrEFwOCRsJA5VUKncenRcbw==@freebsd.org X-Gm-Message-State: AOJu0YwJKDSs5OVDS6Eqb+5fZphNqm5IX9/nOI04204sucatz3VYt3+9 jRnDpFEBxWTQyEdFFPXdk5f3XIbybz1iKGWTQACottMGgE4/U9c7m046mSQTSTag9hw= X-Gm-Gg: ASbGncsqCAMxu1BL0RS0sbmguY/OISLM4oK2N9Bfn5HMyW4gjIbh4kJdgQxyntC7wM+ O/kjA64Apx8yv7KJclQ6zgzpk+HPA2ygdeItIaXHqP7qdLId7GA/GnIJ3J8fBfReso3WIL1GpkN wk8Arckb0VQ/MKV8DiGc9MCXoAz8Jtw6HcbOCwD/OrV9yBHFnrTPT4OXPFRL4FLctBOcBEqgMxw n3C0t3lZu60qX4R13RLUd3+uuROZOq6Cpjk6GAI3FFkabE6mpkhLntW4BJTwJTK3l3E7pYlkxqr 4mTPOfrmBtreqhLGrgOJQF5DZmN4rsCE755apWJNvvkXUnKsq2BrMnvZBBVtC9ga2a9nztK8MFd oT++M2FO5ngsJPvY= X-Google-Smtp-Source: AGHT+IH0w3/4OauNlLVgyv8gdEUyCbzlzT6udq9bVwkP5vkNNfRXNjtwahrjlZ4v9chTLDYpv6Yo3Q== X-Received: by 2002:a05:6e02:97:b0:3de:287b:c445 with SMTP id e9e14a558f8ab-3e282c4f886mr115235445ab.0.1752867803446; Fri, 18 Jul 2025 12:43:23 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3e298160723sm6033095ab.15.2025.07.18.12.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jul 2025 12:43:22 -0700 (PDT) Date: Fri, 18 Jul 2025 19:43:21 +0000 From: Shawn Webb To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d63ffdd1ef63 - main - tzcode: Fix time zone change detection. Message-ID: <35gxd7qvcs7nzwh3zdoh6hnb3htjnzowwitbgi6i647qtj4evj@gpwzez6ggzbd> X-Operating-System: FreeBSD mutt-hbsd 14.3-STABLE-HBSD FreeBSD 14.3-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202507181750.56IHoLIw040938@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xgrqnlhdjneuctbv" Content-Disposition: inline In-Reply-To: <202507181750.56IHoLIw040938@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bkKwG2JDKz3RHZ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --xgrqnlhdjneuctbv Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: d63ffdd1ef63 - main - tzcode: Fix time zone change detection. MIME-Version: 1.0 On Fri, Jul 18, 2025 at 05:50:21PM +0000, Dag-Erling Sm=F8rgrav wrote: > The branch main has been updated by des: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd63ffdd1ef6368407b35d41523= 7b95cc739d8073 >=20 > commit d63ffdd1ef6368407b35d415237b95cc739d8073 > Author: Dag-Erling Sm=F8rgrav > AuthorDate: 2025-07-18 17:48:59 +0000 > Commit: Dag-Erling Sm=F8rgrav > CommitDate: 2025-07-18 17:49:34 +0000 >=20 > tzcode: Fix time zone change detection. > =20 > Prior to the 2022g import, tzloadbody() returned -1 on error. Now it > returns an errno code. When I updated the time zone change detection > logic to match, I improperly returned errno in all cases, which means > that if the time zone file has not changed since we last loaded it, > tzloadbody() returns a random errno value instead of 0. > =20 > Fixes: bc42155199b5 > MFC after: 1 week > Sponsored by: Klara, Inc. > Sponsored by: NetApp, Inc. > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D51405 > --- > contrib/tzcode/localtime.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) >=20 > diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c > index f5814a43da54..69b5f0183e2c 100644 > --- a/contrib/tzcode/localtime.c > +++ b/contrib/tzcode/localtime.c > @@ -408,10 +408,8 @@ change_in_tz(const char *name) > static char old_name[PATH_MAX]; > static struct stat old_sb; > struct stat sb; > - int error; > =20 > - error =3D stat(name, &sb); > - if (error !=3D 0) > + if (stat(name, &sb) !=3D 0) > return -1; > =20 > if (strcmp(name, old_name) !=3D 0) { > @@ -510,13 +508,11 @@ tzloadbody(char const *name, struct state *sp, bool= doextend, > * 'doextend' to ignore TZDEFRULES; the change_in_tz() > * function can only keep state for a single file. > */ > - int ret =3D change_in_tz(name); > - if (ret <=3D 0) { > - /* > - * Returns an errno value if there was an error, > - * and 0 if the timezone had not changed. > - */ > + switch (change_in_tz(name)) { > + case -1: > return errno; > + case 0: > + return 0; > } > } > fid =3D _open(name, O_RDONLY | O_BINARY); >=20 Hey DES, This commit broke buildworld: =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D /usr/src/contrib/tzcode/localtime.c:512:11: error: no case matching constan= t switch condition '1' [-Werror] 512 | switch (change_in_tz(name)) { | ^~~~~~~~~~~~~~~~~~ /usr/src/contrib/tzcode/localtime.c:433:25: note: expanded from macro 'chan= ge_in_tz' 433 | #define change_in_tz(X) 1 =3D=3D=3D=3D END LOG =3D=3D=3D=3D Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --xgrqnlhdjneuctbv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmh6o9IACgkQ/y5nonf4 4fpFHg/+JCgMWIOJXY/VozvqPHl5FaGiVWeP3fN8QAyEYRnqmceEAnBqt2Rgwmso 72BS30P/YIlpQLlyx7zaXowPXLs1D+E2wCAZOZ4Q950Gcsvr6EX2YHJOupNKRJxM xGjQqLO45fZ2NNYd5Y9AzJv3XAcgvxUt7CUlBcosrA/CebFHZC4WRo1V4IBkZPq/ 8h2vzy2H5QckARXsVAVMgY78/xspDsNSGptQp7c1bnA14o2Z6BEo07T41JDNQCn2 GTC0fA8cbndIPm+WrvRfl66t05zvzludLNkSd+9RMUup6teKVOjIJXo1uKbQ3mBa 8o1JMC8JNmvYQB94NgiX/yrn9DkYorlgzwFyh3s39jKFXYDYNQkTdalp0sXzSlSa 1/8Ttt9lfgDCQOOgBI+OBNqfEhkciYAR8/WQQ/Ix0iE/4O7mDSBE9rx1UtL+ntP5 /9gqPVFarUaMnKi5rb0NWBkDLPriEJzYMpzg4EQpYd27NhxdwnndK+6pNFi3J8us VAOGDYGxcwKYulP1UGKf5TACVg0YSQiEUlY4rTHAk4QJc2Pee2XioKgqXNzDIb9Q xBesJrIoRY/5ySHRXXQKvhYx1mwa0TU9qOspwEfJe+U9zPrsyH7OqsnbhEsJmsF/ DIKkNgusaIHR7T5nCal+4KIcfqom/fbw1U9mv6PKUBN9bvTNLFY= =/6yA -----END PGP SIGNATURE----- --xgrqnlhdjneuctbv-- From nobody Fri Jul 18 19:47:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkL1V5f18z62j89 for ; Fri, 18 Jul 2025 19:47:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkL1V1td4z3VbJ for ; Fri, 18 Jul 2025 19:47:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-31c38e75dafso2089190a91.2 for ; Fri, 18 Jul 2025 12:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1752868076; x=1753472876; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hYiejbGWvJIaR+aZETpY4p6KMfGHrFdMRArkBW5PWys=; b=JZ/ZD4/wroyFzvKZDx4P02DakHLJVQFNaUYQq0bNdnBy4K4AEJ8bgaH2zsUt1jhu9f 5tSQmxw3N31ey0zNSqGkYCuMx2i6IsY9CzUyMuafx6BWQH6zRqhmDJLB8gY6zTJlFmNu GueGM+IRyu4nRsnyvW+kwWn9EL3RJZgE/H48ZsW/qgOhqM13L1uOlEswIs2Pxd3uvkf+ ghF5AQa3eGjD4ls60JZc5o6dpBcy0r/RdT9gLeoRgmBcDvGHbRSVgPJumz6rzeK2/AZC AMF6sFAd97OcUB6qxXym/+oGMagfk8cXfvpTtnDRHLunCRYCHiPrkXtqpdEGeS8pHj7I cIHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752868076; x=1753472876; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hYiejbGWvJIaR+aZETpY4p6KMfGHrFdMRArkBW5PWys=; b=d8socSRnBl2ddVJf9BiwU+U1qum9TwqysarQYvz7lYAGA/rzVGjxZwEPlZ09NVpfx7 +BTUTziF/hW//K128973XfFHGGwZ3vi16YdCldlLg5aK8Sgc8zatAId823dA+xbuymEQ +8nmvasMOfCF8DvxAjPUHtmkdV0HCZDGU3/cFOXbBYRqcjA+kBkAq3mu/uAz4Z0pPPIX 9IjJigQD86xaXGzjzk2XrNM9qv7lv2FJBoA+PFWk9jJy7lOrKKeTpxSLIEBl0cfx5mVy 5th1Z2Es6f1hrYyU3QuSKcGUo0H7kZe5AJ5oav3d4uilA6I4tLcZ9fhx4dB2na8h4z7P 122g== X-Forwarded-Encrypted: i=1; AJvYcCWVRqd3qBDvuwNI2fqsxdfCejUzJwo7wDipYElYx4V59eg8lGCktplKcE+CjlBEpKzP96A/Aqiv0ey+C3SzBVysmd75Mw==@freebsd.org X-Gm-Message-State: AOJu0YwEjH70BucQLRDDWCziOouoR5wVQ5J77MEP/OQN/pXzez42Rn7P NR2yfpyf3tPYzVVx+dZQ4rozKcGGxTx0b8zEl7+RX7REGAgIGuqd8wk/t4A0ymM5BKcFQY8dJDG Tfjjk3ziWgJhEwAsUgiaJt825MLCvTuM58AgZvRLtOA== X-Gm-Gg: ASbGncswMaDm2wTVdAfQDbxR6VvftEgEzqsK8ib+Aw23GUvt9pB4tgT/s9Kz1DPAsrH b15eEu2LVxQKEk6kqB90jh1DDSmnzZTTmqyWNsN2EmCBFfbT7fvrj65alOe3IHXnwjnpwtx7GPJ DNfkhkL5U0dgQCOxxZ8v309OUxGfCjtTA3/zaLshKy2ARe+bUQe2e73kjZOOycC+y7qFO14vosY Kw5abF3QsCK6QPK7+FdKBIFdZGRfgWPHMWk X-Google-Smtp-Source: AGHT+IEbzxfNJT8KdZiNQTWuhnRLFlEwmsBLCcaS9dznTkForxn8zWC8FCkza+XWkyLR6zoXgYa1N/yg6MY1DV176Jo= X-Received: by 2002:a17:90b:58c7:b0:312:ec:412f with SMTP id 98e67ed59e1d1-31c9f3df46fmr19692760a91.14.1752868075984; Fri, 18 Jul 2025 12:47:55 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507181750.56IHoLIw040938@gitrepo.freebsd.org> <35gxd7qvcs7nzwh3zdoh6hnb3htjnzowwitbgi6i647qtj4evj@gpwzez6ggzbd> In-Reply-To: <35gxd7qvcs7nzwh3zdoh6hnb3htjnzowwitbgi6i647qtj4evj@gpwzez6ggzbd> From: Warner Losh Date: Fri, 18 Jul 2025 13:47:44 -0600 X-Gm-Features: Ac12FXz1uvbuS6roW4Gc4s4pZ411oJ45DyPPR3KT4vn4aBoQi1BtByFpTKFO7b4 Message-ID: Subject: Re: git: d63ffdd1ef63 - main - tzcode: Fix time zone change detection. To: Shawn Webb Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bkL1V1td4z3VbJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Fri, Jul 18, 2025 at 1:43=E2=80=AFPM Shawn Webb wrote: > > On Fri, Jul 18, 2025 at 05:50:21PM +0000, Dag-Erling Sm=C3=B8rgrav wrote: > > The branch main has been updated by des: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd63ffdd1ef6368407b35d415= 237b95cc739d8073 > > > > commit d63ffdd1ef6368407b35d415237b95cc739d8073 > > Author: Dag-Erling Sm=C3=B8rgrav > > AuthorDate: 2025-07-18 17:48:59 +0000 > > Commit: Dag-Erling Sm=C3=B8rgrav > > CommitDate: 2025-07-18 17:49:34 +0000 > > > > tzcode: Fix time zone change detection. > > > > Prior to the 2022g import, tzloadbody() returned -1 on error. Now = it > > returns an errno code. When I updated the time zone change detecti= on > > logic to match, I improperly returned errno in all cases, which mea= ns > > that if the time zone file has not changed since we last loaded it, > > tzloadbody() returns a random errno value instead of 0. > > > > Fixes: bc42155199b5 > > MFC after: 1 week > > Sponsored by: Klara, Inc. > > Sponsored by: NetApp, Inc. > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D51405 > > --- > > contrib/tzcode/localtime.c | 14 +++++--------- > > 1 file changed, 5 insertions(+), 9 deletions(-) > > > > diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c > > index f5814a43da54..69b5f0183e2c 100644 > > --- a/contrib/tzcode/localtime.c > > +++ b/contrib/tzcode/localtime.c > > @@ -408,10 +408,8 @@ change_in_tz(const char *name) > > static char old_name[PATH_MAX]; > > static struct stat old_sb; > > struct stat sb; > > - int error; > > > > - error =3D stat(name, &sb); > > - if (error !=3D 0) > > + if (stat(name, &sb) !=3D 0) > > return -1; > > > > if (strcmp(name, old_name) !=3D 0) { > > @@ -510,13 +508,11 @@ tzloadbody(char const *name, struct state *sp, bo= ol doextend, > > * 'doextend' to ignore TZDEFRULES; the change_in_tz() > > * function can only keep state for a single file. > > */ > > - int ret =3D change_in_tz(name); > > - if (ret <=3D 0) { > > - /* > > - * Returns an errno value if there was an error, > > - * and 0 if the timezone had not changed. > > - */ > > + switch (change_in_tz(name)) { > > + case -1: > > return errno; > > + case 0: > > + return 0; > > } > > } > > fid =3D _open(name, O_RDONLY | O_BINARY); > > > > Hey DES, > > This commit broke buildworld: > > =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D > /usr/src/contrib/tzcode/localtime.c:512:11: error: no case matching const= ant switch condition '1' [-Werror] > 512 | switch (change_in_tz(name)) { > | ^~~~~~~~~~~~~~~~~~ > /usr/src/contrib/tzcode/localtime.c:433:25: note: expanded from macro 'ch= ange_in_tz' > 433 | #define change_in_tz(X) 1 > =3D=3D=3D=3D END LOG =3D=3D=3D=3D Jenkins is also super cranky. Warner P.S. I'd just sent a private email with this when this one arrived. From nobody Fri Jul 18 20:25:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkLrW6MKJz62kwv; Fri, 18 Jul 2025 20:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkLrW5V3hz465Z; Fri, 18 Jul 2025 20:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752870315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yqswQCaXwwRIOlP19LRhvslzABEf9+4rdMILvXJIb5A=; b=nE6leZ71X48nHPzj//m1fNqFc9Vb3j6Xu7DtvlQOigox165JJ7ZWFzI++tMXuyiA0O/gIG VqsYfqzkudrxZ+Jy41luTp17Q4RIsltMqJLbV5mPLuK2Vvb/bvKhAnIH2y4p25JEpdu6eO KfXwTQGNNJarLcrEI1lFJgbiLbsdkTuRzXy/B3fTZ5QsJZ1HmvPoDnz89osYbOulGC69S7 JlvWKerTNfDnY8Ry77Bx9Ccf7TbrQzqh3qv3n+mmDtP5eMjpDBQhxANgorK+bh5Pqb4suk RTrl/ZbzhZYdP2bZr4RK/uofrtpzGJVp+HQAE8I/Bh87/JBHYEv9zjEo+71VGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752870315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yqswQCaXwwRIOlP19LRhvslzABEf9+4rdMILvXJIb5A=; b=Zl34XolSLe3xZX5/ofJq7/TTVPiBQJUfRR5dLWa/aa5Qvp4YvoEm+1TUEuKG2h3r7qyaTZ 2lYF5gB9uhNhi/CjmRyTWuUQa27EMZUFGUcF/ikAziX6je9KaNruS0gvs2eqw3Usozk/NK 3db8w7IT4p1QMDpejzcYTwSqx5RI/vJEa4wQ3WVEHfwU3FjWwzrKcFR1vnEuCryYFD/F7J ++ZPTTXNyEAwytb45Z60euVeHYdj8qgrtKPJqpv/gIaoAOx8KWNRBeKKNGRiNkvZP2bz3P oSPpUdjNSKw5jtsmQSKEXGnmbmOHC63vx9mGSkKsAWn8Zb05WJ+4Co7LJT9j6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752870315; a=rsa-sha256; cv=none; b=gbf64a0bww8/6rcbtC0kZ9nLs797iLlpJp/VlX/W2O5rBG5HsIAl6lSVSuJsC46MrrjhaU +i1+C40AkScu6TTFjD6gHleT7UkFaenglGfYVakToXGiTrpABkaiht0cZMs6WzaqYw2wT7 5RGWl2Plre4OcDlYZlcnJduwj5kJoPrQ2l7kVk7VhWRVH6D7/6Lfsmn857JYms3dy5mhTB /EjL/KjDUGfwrTyc77DeDR9dFUXjXEK9tjxRTfWdoYodAB/qMZFCGuLTcoO0Hk6VE56T05 2tFgrdE7yn5lB03txKteFcGIt7r2TuPgJUmua5ujUmgdg551cx3TG9kTsJoaCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkLrW527rzw5y; Fri, 18 Jul 2025 20:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IKPFCX031346; Fri, 18 Jul 2025 20:25:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IKPFhY031343; Fri, 18 Jul 2025 20:25:15 GMT (envelope-from git) Date: Fri, 18 Jul 2025 20:25:15 GMT Message-Id: <202507182025.56IKPFhY031343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 31938394def0 - main - stress2/fullpath2: Clean up the vn_fullpath DTrace one-liner List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31938394def0b96d1c5ca25d3329da146ad019a3 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=31938394def0b96d1c5ca25d3329da146ad019a3 commit 31938394def0b96d1c5ca25d3329da146ad019a3 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-16 11:23:38 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-18 20:24:38 +0000 stress2/fullpath2: Clean up the vn_fullpath DTrace one-liner - Remove -w; there is no need for destructive actions here. - Remove the glob from before "vn_fullpath"; the probe description matches vn_fullpath only anyway, so there is no need for the glob here. PR 288222 Reviewed by: christos Approved by: christos (mentor) Fixes: 113f2f0c76a7 stress2: Updated dtrace comment Differential Revision: https://reviews.freebsd.org/D51341 --- tools/test/stress2/misc/fullpath2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/stress2/misc/fullpath2.sh b/tools/test/stress2/misc/fullpath2.sh index f0037851482d..413f832420d4 100755 --- a/tools/test/stress2/misc/fullpath2.sh +++ b/tools/test/stress2/misc/fullpath2.sh @@ -123,7 +123,7 @@ static volatile u_int *share; #define NB 1024 #define RUNTIME 300 -/* dtrace -w -n 'fbt::*vn_fullpath:entry {@rw[execname,probefunc] = count(); }' */ +/* dtrace -n 'fbt::vn_fullpath:entry {@rw[execname,probefunc] = count(); }' */ static void getfiles(pid_t pid) From nobody Fri Jul 18 20:33:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkM280bzRz62l9X; Fri, 18 Jul 2025 20:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkM276Mr7z4JSn; Fri, 18 Jul 2025 20:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752870815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKFEsSRAaCWl1C+FwfvWR4/suspFNfHoAVG/raFbB3o=; b=NLrq4R85tn2x4obs6y4F4ExzEWM1CTsrko5EELnSIDCewV/IN+P+/ln7j3jmrP8d4w3JrS YsAOvaWt4mD21OfOSCzW3U/x/+WnUfjhL/QvBUdrUdlCAmZgpKFZJL8c5mkomyEs3yyD2n sKzyz0+MwEfuhGY2mdy4PRZMi1Z5C+h4fu3NXl3Lg9UAGPZ+VI872bWFpJh8FI2DdsvGMq zeK6OXSw8TBHmpWz2lDlUU+Mtuvg6fW7/uIM8qA4FkVk+tyV2bF/kuDwnTRvfjAL73iWUg CFS4aDy/o0r2HQcBFM8RDUYPlcAM9LkObFHQkUOyyWyMVjG+iXaSQVCJ3x59nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752870815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKFEsSRAaCWl1C+FwfvWR4/suspFNfHoAVG/raFbB3o=; b=tjscLF4D92YoHi/uihfXYXlAm/vs5FfOqCs/0DChFdG1xt8bJnDn57/C0EDZ2ldgmLwsXu 0Snd+R6nTrefwv/wm1Vlhym4p8Qc3g6SOrCw4v+Mm5zrBv5K+Qy3UG0uKaKQ39aVte6Rzm 9tmgak8ukgtwWnW2sDQaOaD8WyodWKY4ZnjKy7BWv+qXFmBopmlbarn1BZL/Nww1MijUd+ 7boJCI6DxdMpGSgM/LdRB8DXuaf+ciBs5SZd/q4+s+viNHfCYO2Q/w5nNlOSCnBgEUs66S BlTYWIgujKP4Qh/9WP/tqrDvyL7J49iy6zbi10zq9119UXfqJj64TNezcw70SQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752870815; a=rsa-sha256; cv=none; b=ttZKHq+paDLZrQSDgIoaEIy/ndNR5LQpPK96PFGs7CYRhA3icKLqfH5rRGHVV2G57pk3u9 4Juy/3w/29pimHOgQJkpACRsgJqgf1ieI33X8oZgHOsE9JCcOF9qAsw0CbyUOEVOl3wp8q 7bn25qG4R0ypkeytov9oOKmZYssZSwnajVQlze0UVq+u+O+CVFMT+iJKlAzMsP6rthjwA9 VxxNRS16hq1Vx3CDrqejHzESk//C6Vt7Dql8CG4iyMnT203JAS5/jlEHN6bQ9UMmqIe7KL JUbyEZoZcCSnu9AxCT/3phgVfVmfaySuXEB7uJfdEkeLuQUyjHcagm9v1waeZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkM275QTQzvtr; Fri, 18 Jul 2025 20:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IKXZS0050167; Fri, 18 Jul 2025 20:33:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IKXZSW050164; Fri, 18 Jul 2025 20:33:35 GMT (envelope-from git) Date: Fri, 18 Jul 2025 20:33:35 GMT Message-Id: <202507182033.56IKXZSW050164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f92ff79720fb - main - random: Add NIST SP 800-90B entropy source health test implementations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f92ff79720fb60ac5ea2488dfb3f1818361a1544 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f92ff79720fb60ac5ea2488dfb3f1818361a1544 commit f92ff79720fb60ac5ea2488dfb3f1818361a1544 Author: Mark Johnston AuthorDate: 2025-07-18 20:19:45 +0000 Commit: Mark Johnston CommitDate: 2025-07-18 20:33:06 +0000 random: Add NIST SP 800-90B entropy source health test implementations This patch implements the noise source health tests described in chapter four of NIST SP 800-90B[1]. The repetition count test and adaptive proportion test both help identify cases where a noise source is stuck and generating the same output too frequently. The tests are disabled by default, but making an implementation available may help implementors conform to FIPS validation requirements. This implementation aims to comply with the requirements listed in section 4.3 of the document. To enable health testing, set the kern.random.nist_healthtest_enabled tunable to 1. Startup testing is implemented as specified in the document: the first 1024 samples from a source are evaluated according to the two tests, and they are discarded. The RANDOM_CACHED and RANDOM_PURE_VMGENID sources are excluded from testing, as they are effectively a one-time source of entropy, and statistical testing doesn't seem to provide much use. Since the first 1024 samples from entropy sources are discarded by the implementation, it is possible that we might end up with insufficient entropy during early boot if no boot-time entropy source (i.e., /entropy) is provided. If this is a problem, it could be remediated by modifying the implementation to poll applicable sources (e.g., RDRAND) to complete startup testing quickly, rather than relying on the random kthread. The entry point for the tests is random_harvest_healthtest(), intended to be called from individual CSPRNG implementations in order to leverage their locking context, e.g., the entropy pool lock in Fortuna. The Fortuna implementation is modified to call this entry point, mainly to demonstrate how the health tests can be integrated. The tests operate on the entropy buffer plus the embedded timestamp, treating them as a single value. We could alternately apply the tests to the buffer and timestamp separately. The main parameters for the tests themselves are H, the expected min-entropy of samples, and alpha, the desired false positive error rate. This implementation selects H=1 and alpha=2^{-34}; since each sample includes a CPU cycle counter value, it seems reasonable to expect at least one bit of entropy from among the low bits of the high-frequency counter present on systems where FreeBSD is commonly deployed, and the false positive rate was somewhat arbitrarily selected; for more details see the comment in random_healthtest_init(). When a health test fails, a message is printed to the console and the source is disabled. On-demand testing is also supported via the kern.random.nist_healthtest_ondemand sysctl. This can be used be an administrator to re-enable a disabled source, following the same startup testing mentioned above. [1] https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90B.pdf Reviewed by: cem MFC after: 3 months Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51154 --- sys/dev/random/fortuna.c | 7 ++ sys/dev/random/random_harvestq.c | 229 +++++++++++++++++++++++++++++++++++++++ sys/dev/random/random_harvestq.h | 2 + 3 files changed, 238 insertions(+) diff --git a/sys/dev/random/fortuna.c b/sys/dev/random/fortuna.c index c4282c723a44..8363de99a60a 100644 --- a/sys/dev/random/fortuna.c +++ b/sys/dev/random/fortuna.c @@ -341,6 +341,13 @@ random_fortuna_process_event(struct harvest_event *event) u_int pl; RANDOM_RESEED_LOCK(); + /* + * Run SP 800-90B health tests on the source if so configured. + */ + if (!random_harvest_healthtest(event)) { + RANDOM_RESEED_UNLOCK(); + return; + } /*- * FS&K - P_i = P_i| * Accumulate the event into the appropriate pool diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 395310b115fb..29d4cd4d6857 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -88,6 +88,8 @@ static void random_sources_feed(void); static __read_mostly bool epoch_inited; static __read_mostly epoch_t rs_epoch; +static const char *random_source_descr[ENTROPYSOURCE]; + /* * How many events to queue up. We create this many items in * an 'empty' queue, then transfer them to the 'harvest' queue with @@ -299,6 +301,230 @@ random_sources_feed(void) explicit_bzero(entropy, sizeof(entropy)); } +/* + * State used for conducting NIST SP 800-90B health tests on entropy sources. + */ +static struct health_test_softc { + uint32_t ht_rct_value[HARVESTSIZE + 1]; + u_int ht_rct_count; /* number of samples with the same value */ + u_int ht_rct_limit; /* constant after init */ + + uint32_t ht_apt_value[HARVESTSIZE + 1]; + u_int ht_apt_count; /* number of samples with the same value */ + u_int ht_apt_seq; /* sequence number of the last sample */ + u_int ht_apt_cutoff; /* constant after init */ + + uint64_t ht_total_samples; + bool ondemand; /* Set to true to restart the state machine */ + enum { + INIT = 0, /* initial state */ + DISABLED, /* health checking is disabled */ + STARTUP, /* doing startup tests, samples are discarded */ + STEADY, /* steady-state operation */ + FAILED, /* health check failed, discard samples */ + } ht_state; +} healthtest[ENTROPYSOURCE]; + +#define RANDOM_SELFTEST_STARTUP_SAMPLES 1024 /* 4.3, requirement 4 */ +#define RANDOM_SELFTEST_APT_WINDOW 512 /* 4.4.2 */ + +static void +copy_event(uint32_t dst[static HARVESTSIZE + 1], + const struct harvest_event *event) +{ + memset(dst, 0, sizeof(uint32_t) * (HARVESTSIZE + 1)); + memcpy(dst, event->he_entropy, event->he_size); + dst[HARVESTSIZE] = event->he_somecounter; +} + +static void +random_healthtest_rct_init(struct health_test_softc *ht, + const struct harvest_event *event) +{ + ht->ht_rct_count = 1; + copy_event(ht->ht_rct_value, event); +} + +/* + * Apply the repitition count test to a sample. + * + * Return false if the test failed, i.e., we observed >= C consecutive samples + * with the same value, and true otherwise. + */ +static bool +random_healthtest_rct_next(struct health_test_softc *ht, + const struct harvest_event *event) +{ + uint32_t val[HARVESTSIZE + 1]; + + copy_event(val, event); + if (memcmp(val, ht->ht_rct_value, sizeof(ht->ht_rct_value)) != 0) { + ht->ht_rct_count = 1; + memcpy(ht->ht_rct_value, val, sizeof(ht->ht_rct_value)); + return (true); + } else { + ht->ht_rct_count++; + return (ht->ht_rct_count < ht->ht_rct_limit); + } +} + +static void +random_healthtest_apt_init(struct health_test_softc *ht, + const struct harvest_event *event) +{ + ht->ht_apt_count = 1; + ht->ht_apt_seq = 1; + copy_event(ht->ht_apt_value, event); +} + +static bool +random_healthtest_apt_next(struct health_test_softc *ht, + const struct harvest_event *event) +{ + uint32_t val[HARVESTSIZE + 1]; + + if (ht->ht_apt_seq == 0) { + random_healthtest_apt_init(ht, event); + return (true); + } + + copy_event(val, event); + if (memcmp(val, ht->ht_apt_value, sizeof(ht->ht_apt_value)) == 0) { + ht->ht_apt_count++; + if (ht->ht_apt_count >= ht->ht_apt_cutoff) + return (false); + } + + ht->ht_apt_seq++; + if (ht->ht_apt_seq == RANDOM_SELFTEST_APT_WINDOW) + ht->ht_apt_seq = 0; + + return (true); +} + +/* + * Run the health tests for the given event. This is assumed to be called from + * a serialized context. + */ +bool +random_harvest_healthtest(const struct harvest_event *event) +{ + struct health_test_softc *ht; + + ht = &healthtest[event->he_source]; + + /* + * Was on-demand testing requested? Restart the state machine if so, + * restarting the startup tests. + */ + if (atomic_load_bool(&ht->ondemand)) { + atomic_store_bool(&ht->ondemand, false); + ht->ht_state = INIT; + } + + switch (ht->ht_state) { + case __predict_false(INIT): + /* Store the first sample and initialize test state. */ + random_healthtest_rct_init(ht, event); + random_healthtest_apt_init(ht, event); + ht->ht_total_samples = 0; + ht->ht_state = STARTUP; + return (false); + case DISABLED: + /* No health testing for this source. */ + return (true); + case STEADY: + case STARTUP: + ht->ht_total_samples++; + if (random_healthtest_rct_next(ht, event) && + random_healthtest_apt_next(ht, event)) { + if (ht->ht_state == STARTUP && + ht->ht_total_samples >= + RANDOM_SELFTEST_STARTUP_SAMPLES) { + printf( + "random: health test passed for source %s\n", + random_source_descr[event->he_source]); + ht->ht_state = STEADY; + } + return (ht->ht_state == STEADY); + } + ht->ht_state = FAILED; + printf( + "random: health test failed for source %s, discarding samples\n", + random_source_descr[event->he_source]); + /* FALLTHROUGH */ + case FAILED: + return (false); + } +} + +static bool nist_healthtest_enabled = false; +SYSCTL_BOOL(_kern_random, OID_AUTO, nist_healthtest_enabled, + CTLFLAG_RDTUN, &nist_healthtest_enabled, 0, + "Enable NIST SP 800-90B health tests for noise sources"); + +static void +random_healthtest_init(enum random_entropy_source source) +{ + struct health_test_softc *ht; + + ht = &healthtest[source]; + KASSERT(ht->ht_state == INIT, + ("%s: health test state is %d for source %d", + __func__, ht->ht_state, source)); + + /* + * If health-testing is enabled, validate all sources except CACHED and + * VMGENID: they are deterministic sources used only a small, fixed + * number of times, so statistical testing is not applicable. + */ + if (!nist_healthtest_enabled || + source == RANDOM_CACHED || source == RANDOM_PURE_VMGENID) { + ht->ht_state = DISABLED; + return; + } + + /* + * Set cutoff values for the two tests, assuming that each sample has + * min-entropy of 1 bit and allowing for an error rate of 1 in 2^{34}. + * With a sample rate of RANDOM_KTHREAD_HZ, we expect to see an false + * positive once in ~54.5 years. + * + * The RCT limit comes from the formula in section 4.4.1. + * + * The APT cutoff is calculated using the formula in section 4.4.2 + * footnote 10 with the window size changed from 512 to 511, since the + * test as written counts the number of samples equal to the first + * sample in the window, and thus tests W-1 samples. + */ + ht->ht_rct_limit = 35; + ht->ht_apt_cutoff = 330; +} + +static int +random_healthtest_ondemand(SYSCTL_HANDLER_ARGS) +{ + u_int mask, source; + int error; + + mask = 0; + error = sysctl_handle_int(oidp, &mask, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + while (mask != 0) { + source = ffs(mask) - 1; + if (source < nitems(healthtest)) + atomic_store_bool(&healthtest[source].ondemand, true); + mask &= ~(1u << source); + } + return (0); +} +SYSCTL_PROC(_kern_random, OID_AUTO, nist_healthtest_ondemand, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + random_healthtest_ondemand, "I", + "Re-run NIST SP 800-90B startup health tests for a noise source"); + static int random_check_uint_harvestmask(SYSCTL_HANDLER_ARGS) { @@ -424,6 +650,9 @@ random_harvestq_init(void *unused __unused) hc_source_mask = almost_everything_mask; RANDOM_HARVEST_INIT_LOCK(); harvest_context.hc_active_buf = 0; + + for (int i = 0; i < ENTROPYSOURCE; i++) + random_healthtest_init(i); } SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_init, NULL); diff --git a/sys/dev/random/random_harvestq.h b/sys/dev/random/random_harvestq.h index 7804bf52aa4f..1d462500df85 100644 --- a/sys/dev/random/random_harvestq.h +++ b/sys/dev/random/random_harvestq.h @@ -49,4 +49,6 @@ random_get_cyclecount(void) return ((uint32_t)get_cyclecount()); } +bool random_harvest_healthtest(const struct harvest_event *event); + #endif /* SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED */ From nobody Fri Jul 18 20:33:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkM2B3K1Gz62lFr; Fri, 18 Jul 2025 20:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkM286yhQz4JSt; Fri, 18 Jul 2025 20:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752870817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cQZAYJAIxi1UtuZcqWoLoFwen9QJjNyO01MZz6WibxU=; b=rGJLWJuGS843Emq/+fBvnLLfU3XEFyVPaPz1GnKNdUWhGOLydoNzL+ssjezOy77GPcXd4A tuxtpeL9NkVRJ5/cVtqQcrl2R5n2v9ywdzQ/sByDRcoCwpYFxqAwTtFbHP4rgE5MPXraj7 3DrfdJVIiA4cqRdf6oiII655orCRlGnCU/QI2DYVbWElGTmRgTUrl4mhKK0i0vVVxuKvBx TqHTcdA+1s+fgWP4ssmiTL/lQaphzdQWYFM6JxwIFNrbNMJB0wUIBEyQJslk5vJk8LHmoT wBHnyWCNXEGyYjkZaBQsqs0AKcZ7sczI8cbDTK1PrUmpARHZOa6F4rt3XqV4vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752870817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cQZAYJAIxi1UtuZcqWoLoFwen9QJjNyO01MZz6WibxU=; b=Da37B2yxHUa+TyFTt3xTdIKbZqLBkuZy7Q2Yd/hGmF1nykE00etm2mkB/XxwUyO+bdOowt ZpIcR1bOW6RiWz5pTHO0zlN+yJgYHQBJaA1JFJiSxfx6z3HBD5+UrMvurre+kytzqnUc3Q W2fL9LNUTd6Q1rzxmIpH4NGDcjSpQULvCuotZLAYHZa94/SuufvPdV4Cr/UVhO/f4X8F8p a7biwXgyWnfIDP4wyzL1sdOnip7ZiYW7YaLz3KGiy6eVXDLVpby2t57bOMtGG8aKiZwBd+ gp2rCJ6AC9fnzzIA5KJCORM8bIo31LIPfgt8NQahCuIeFzSMrG38G/bNAHzWYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752870817; a=rsa-sha256; cv=none; b=Gi27/SA2T4wau8m4bVqKFXPZrtU1/IQA0zEgYUr8gaW76Whed1dQqq4VKvTurqrHwWFZwm 4V8o6zxtqa6eW0AWHiLDjCHjuNNrzfn5bBKWSsrYGZKKDhIeXdIn8HRn9ZwcT3j5Kf4Ifx JU2TVUOgBlfHbJWvOCM3g3xGFZIL9yB0zA+CR8g/Vo6ltLyyR2vV5yXCyugAGsQK58ytJ2 BxJMbdY3UPzwULA1wfxJc9gcb82DqNU96CsBBkmm3h2lC+v0vZ3J+qM8o9qASA/hv2StpT 1ZZBV4yI2LiM+D5EEMn9UH8qAcKmGGOKbQDfqmp49ZjiNoZ0WyLv6IWVuGDCUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkM286LkPzwNp; Fri, 18 Jul 2025 20:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IKXa2r050201; Fri, 18 Jul 2025 20:33:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IKXaVF050198; Fri, 18 Jul 2025 20:33:36 GMT (envelope-from git) Date: Fri, 18 Jul 2025 20:33:36 GMT Message-Id: <202507182033.56IKXaVF050198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fa8db724ae6e - main - random: Treat writes to /dev/random as separate from /entropy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa8db724ae6ea301830ceaea9f37c28016c2d14a Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fa8db724ae6ea301830ceaea9f37c28016c2d14a commit fa8db724ae6ea301830ceaea9f37c28016c2d14a Author: Mark Johnston AuthorDate: 2025-07-18 20:23:09 +0000 Commit: Mark Johnston CommitDate: 2025-07-18 20:33:06 +0000 random: Treat writes to /dev/random as separate from /entropy RANDOM_CACHED is overloaded to refer both to entropy obtained from files loaded by the boot loader, and entropy obtained via writes to /dev/random. Introduce a new source, RANDOM_RANDOMDEV, to refer to the latter. This is to enable treating RANDOM_CACHED as a special case in the NIST health test implementation. Update the default harvest_mask in rc.conf to include RANDOM_RANDOMDEV, preserving the old behaviour of accepting writes to /dev/random. Bump __FreeBSD_version for modules which register a pure source, since all of their values have now shifted. Reviewed by: cem MFC after: 3 months Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51155 --- libexec/rc/rc.conf | 2 +- sys/dev/random/random_harvestq.c | 3 ++- sys/dev/random/randomdev.c | 2 +- sys/sys/random.h | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 00f4b718bfad..d502361eca37 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -694,7 +694,7 @@ entropy_file="/entropy" # Set to NO to disable late (used when going multi-user) entropy_dir="/var/db/entropy" # Set to NO to disable caching entropy via cron. entropy_save_sz="4096" # Size of the entropy cache files. entropy_save_num="8" # Number of entropy cache files to save. -harvest_mask="511" # Entropy device harvests all but the very invasive sources. +harvest_mask="4607" # Entropy device harvests all but the very invasive sources. # (See 'sysctl kern.random.harvest' and random(4)) osrelease_enable="YES" # Update /var/run/os-release on boot (or NO). osrelease_file="/var/run/os-release" # File to update for os-release. diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 29d4cd4d6857..c7762967c4fb 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -588,7 +588,8 @@ static const char *random_source_descr[ENTROPYSOURCE] = { [RANDOM_SWI] = "SWI", [RANDOM_FS_ATIME] = "FS_ATIME", [RANDOM_UMA] = "UMA", - [RANDOM_CALLOUT] = "CALLOUT", /* ENVIRONMENTAL_END */ + [RANDOM_CALLOUT] = "CALLOUT", + [RANDOM_RANDOMDEV] = "RANDOMDEV", /* ENVIRONMENTAL_END */ [RANDOM_PURE_OCTEON] = "PURE_OCTEON", /* PURE_START */ [RANDOM_PURE_SAFE] = "PURE_SAFE", [RANDOM_PURE_GLXSB] = "PURE_GLXSB", diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c index 9d1c7b1167c8..ced4dd8067d9 100644 --- a/sys/dev/random/randomdev.c +++ b/sys/dev/random/randomdev.c @@ -312,7 +312,7 @@ randomdev_accumulate(uint8_t *buf, u_int count) for (i = 0; i < RANDOM_KEYSIZE_WORDS; i += sizeof(event.he_entropy)/sizeof(event.he_entropy[0])) { event.he_somecounter = random_get_cyclecount(); event.he_size = sizeof(event.he_entropy); - event.he_source = RANDOM_CACHED; + event.he_source = RANDOM_RANDOMDEV; event.he_destination = destination++; /* Harmless cheating */ memcpy(event.he_entropy, entropy_data + i, sizeof(event.he_entropy)); p_random_alg_context->ra_event_processor(&event); diff --git a/sys/sys/random.h b/sys/sys/random.h index 254ba9451d0a..5abf762cd200 100644 --- a/sys/sys/random.h +++ b/sys/sys/random.h @@ -85,7 +85,8 @@ enum random_entropy_source { RANDOM_FS_ATIME, RANDOM_UMA, /* Special!! UMA/SLAB Allocator */ RANDOM_CALLOUT, - RANDOM_ENVIRONMENTAL_END = RANDOM_CALLOUT, + RANDOM_RANDOMDEV, + RANDOM_ENVIRONMENTAL_END = RANDOM_RANDOMDEV, /* Fast hardware random-number sources from here on. */ RANDOM_PURE_START, RANDOM_PURE_OCTEON = RANDOM_PURE_START, From nobody Fri Jul 18 20:48:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkMMf0hGdz61mwm; Fri, 18 Jul 2025 20:48:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkMMd6bdPz3D8G; Fri, 18 Jul 2025 20:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752871725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=42RR5ACKsuO2o6XC0gxCXG4EBV0Am4OFYTp9VFE0mMc=; b=x2Ozdv3cTIClEkNRY4idFSaSwE4Yn0F4heuafbOJTgeLg/wVX9tYWmt6Sh7SDzrlhP+jrt h/liIcJoG9NC9MFItIhqF1HknUxrfK4UvC44oj1W1SCpHCoesaw1Pop+evYvm9KvLtElHO fyRgVgKzsh/XL/F5rgCN00+LIhzP/6iMhvQhExO5009HWf4LqZsOGkOVnrnqG5PYtTWw06 zoiqW5LdYvpvLLjCC4l/QzNaU4RNUbuJsNC9PVB+eA0tk9V1rOFqPdf2DTbv55JIMTdDjc gSFsYh2Y7hp4awRSF1wdkz/HjQSWwYwjFIOaucFp4sNwGPOoguJlaVeMU4IAsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752871725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=42RR5ACKsuO2o6XC0gxCXG4EBV0Am4OFYTp9VFE0mMc=; b=Abaf6v89GqOi2nTNNA5rBUg+vot4pQIoDMpgHODDVVmw8s8s8Y7z6yRAWCy5ckmSFWoO33 Lcph3+nz1ToN0Avd3/iDmcCfXbBBCWfxxiYdQXmVNiqL/AD6Yp6vZNKnWVkQ0aGJU21WdL onPVbwRO8k+pj8CAwsWUTnNVD6Wt34na3Rivh/kXjxvy4Y4VM8iF0QxZ5yEcz7kaQlehqR KRTuUsjH3Ym8pWKW2aLajV8SMsyta7rbVphP9O8ZNvKWY0qvQcXTSRPfQFCZX8X696K93i O+Ke9ek72eQldoCcM8vk1XTPNWKo9Sbdelb8ylgna9PDQdnK3bolnNHRS1/T0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752871725; a=rsa-sha256; cv=none; b=EhLBVQTFuJfbXmRTDjVW0oj71ntLiVXYI5aC5kfEuFPnpfoXoRnEZ0vjGZ8d10hOiSg7IU fBtXp2kzpmD0kGSvVHqYz+TNDJhxKwd4nkWnl9bW/1eBVoOtu8bLxRLmfOfdgC6XYlqxZ1 l5baaGzCnUQpHOffmDjBg74O5DZx8IQhzDZdGk8N90qTh7DXomp/Ob/hBqaC0MycqnX1ux pYiNI3hRPHShi+p5VNZgPh/IcRVHV67pDtC3zbmEjnTFy79mXbytLRRim4CfTRyVm3+Vt5 sbN8eaOII0LtB8EF392gOp7O0VM3R4rnthTKFn5B4TiLjL4407Rve+fjxml9IQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkMMd5xRjzvvM; Fri, 18 Jul 2025 20:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56IKmjLX070089; Fri, 18 Jul 2025 20:48:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IKmj0O070086; Fri, 18 Jul 2025 20:48:45 GMT (envelope-from git) Date: Fri, 18 Jul 2025 20:48:45 GMT Message-Id: <202507182048.56IKmj0O070086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0bf113e9041f - main - tzcode: Add an explicit "the timezone file has changed" case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bf113e9041fe20e8c671fe6b2cca8612dc77b77 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0bf113e9041fe20e8c671fe6b2cca8612dc77b77 commit 0bf113e9041fe20e8c671fe6b2cca8612dc77b77 Author: Mark Johnston AuthorDate: 2025-07-18 20:39:52 +0000 Commit: Mark Johnston CommitDate: 2025-07-18 20:47:59 +0000 tzcode: Add an explicit "the timezone file has changed" case This is required for the WITHOUT_DETECT_TZ_CHANGES case, since there the value being tested is a numeric literal. Fixes: d63ffdd1ef63 ("tzcode: Fix time zone change detection.") --- contrib/tzcode/localtime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 5c3ef7ed47af..a6ec3d8e4e21 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -514,6 +514,8 @@ tzloadbody(char const *name, struct state *sp, bool doextend, return errno; case 0: return 0; + case 1: + break; } } fid = _open(name, O_RDONLY | O_BINARY); From nobody Fri Jul 18 22:41:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkPtB2fzFz61v87; Fri, 18 Jul 2025 22:41:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkPt9564jz3qTK; Fri, 18 Jul 2025 22:41:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56IMfeCL099897; Sat, 19 Jul 2025 01:41:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56IMfeCL099897 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56IMfevk099896; Sat, 19 Jul 2025 01:41:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Jul 2025 01:41:40 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 29af6d2e2ec9 - main - msdosfs: replace '/' in direntries with '?' Message-ID: References: <202507172154.56HLsGLL095197@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bkPt9564jz3qTK X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Fri, Jul 18, 2025 at 10:06:56AM -0600, Alan Somers wrote: > Should we move this logic up into kern_getdirentries? msdosfs is not the > only file system vulnerable to this problem. It is relatively hard to do in kern_getdirentries(), and perhaps would cause a severe performance hit for filesystems that do not need it. The issue is that uio might be for UIO_USERSPACE (and less likely UIO_NOCOPY). So we must allocate the transient buffer, then call VOP_READDIR() for that buffer, then do the validation, and then copyout to the final uio. Another thing, there are more VOP_READDIR() uses than only kern_getdirents(). Worst part, we do trust UFS and ZFS which are the most perf-sensitive. I did looked at generic checker, might be guided by some MNTK_-level flag, but decided to just patch msdosfs. > > On Thu, Jul 17, 2025 at 3:54 PM Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18 > > > > commit 29af6d2e2ec9fe8df7cf1e1a0bf3597028831b18 > > Author: Konstantin Belousov > > AuthorDate: 2025-07-17 01:12:05 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-17 21:53:54 +0000 > > > > msdosfs: replace '/' in direntries with '?' > > > > PR: 288266 > > Reported by: Robert Morris > > Reviewed by: markj > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D51365 > > --- > > sys/fs/msdosfs/msdosfs_conv.c | 11 +++++++++-- > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c > > index da4848169173..208b64930e61 100644 > > --- a/sys/fs/msdosfs/msdosfs_conv.c > > +++ b/sys/fs/msdosfs/msdosfs_conv.c > > @@ -797,19 +797,24 @@ mbsadjpos(const char **instr, size_t inlen, size_t > > outlen, int weight, int flag, > > static u_char * > > dos2unixchr(u_char *outbuf, const u_char **instr, size_t *ilen, int > > lower, struct msdosfsmount *pmp) > > { > > - u_char c, *outp; > > - size_t len, olen; > > + u_char c, *outp, *outp1; > > + size_t i, len, olen; > > > > outp = outbuf; > > if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { > > olen = len = 4; > > > > + outp1 = outp; > > if (lower & (LCASE_BASE | LCASE_EXT)) > > msdosfs_iconv->convchr_case(pmp->pm_d2u, (const > > char **)instr, > > ilen, (char **)&outp, > > &olen, KICONV_LOWER); > > else > > msdosfs_iconv->convchr(pmp->pm_d2u, (const char > > **)instr, > > ilen, (char **)&outp, &olen); > > + for (i = 0; i < outp - outp1; i++) { > > + if (outp1[i] == '/') > > + outp1[i] = '?'; > > + } > > len -= olen; > > > > /* > > @@ -826,6 +831,8 @@ dos2unixchr(u_char *outbuf, const u_char **instr, > > size_t *ilen, int lower, struc > > c = dos2unix[c]; > > if (lower & (LCASE_BASE | LCASE_EXT)) > > c = u2l[c]; > > + if (c == '/') > > + c = '?'; > > *outp++ = c; > > outbuf[1] = '\0'; > > } > > From nobody Fri Jul 18 22:44:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkPxV69V4z61vP9; Fri, 18 Jul 2025 22:44:46 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkPxV3p5Mz3t4K; Fri, 18 Jul 2025 22:44:46 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-aec5a714ae9so283382166b.3; Fri, 18 Jul 2025 15:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752878685; x=1753483485; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O/YkYOqurgHWqIPii4JdACzUcgMTTCCRgMSPqUqdTy4=; b=eA4siLVExrffFa6aWs+qJLLajMGrIrnW+szt8bmzzEzUl1GIxPL8dq49UyMUCoa0sQ iPaBw7vTgW/XxZJ4u1hbECAXbicZ1NYi7t4Ux8mMlmii5JJX/yx34ljS2UrMUlYFAqez yLeKFbtMpoRapRyrrj1LU0Al/9ZMj3anlR6u4X6QKnQ2sD5VbgSZ34bwBOda1QwQTaHz 3CrxmuK0ELVY64goAA2iRt6L3IdP4pmM5vqsa81s9EmCYaWO9t2nKNa5dEm6voNox8g+ AlImrJ/XEmIcxZsvTiXpKzB0rex1e4RjPcnaLHAwOWqoNwDKsgfKxb29uY/0/ZikR0Ey MR5Q== X-Forwarded-Encrypted: i=1; AJvYcCUcNIIYtyH7BdxcOMN3yyRewgivfSUTCjyHOyQnJM/gN+e/k35DpO4uRU4nDRcKiB/23gWyr+HhtNyClWuaQBd3Vcsc@freebsd.org, AJvYcCVFok6hCDMGILpGy7t/i6/56PjdcvhGOqKp0m7GsCRWmocVsQrIxboQQeSBY/vmyEMz9pwa1wIni7FwZKAotlUzj4hoRPw=@freebsd.org X-Gm-Message-State: AOJu0Yy9DLytpQN2K/+zawlnsblwz8JnSx5gBuIs7hGvKuiFOwVLSrAF I9hs9llflD4GLp1gSSCprIqmY7F6vfCTTI0quUEkvHcPeDcQjK3c8DjKpCJWlvlIPuZ1DDs1sLQ BGyVvsgYnhw1DlMUirCY4VKttdd1K9gs= X-Gm-Gg: ASbGncs9ltzAgt27OP9M2KUtGO/B+rzxpQ7wq/tHHTK08ywAYjgSo54zACFt22gHfpe +SOLL57xor3XIf7QuhzETaAlgdnP2IDngFS/FcxiQySbhiKXrF04SBPqhFx0gTlxn9sQWaKJOB1 vsJiLaOA3q8ciwDI6PdAQ3d8rZY3r/AlU6btpIN3gafMokOLIrmKG4AMBEiZzE6Lytih2UnvRxd 5U2IBM= X-Google-Smtp-Source: AGHT+IFkFrSdbl1ZhAm2S7VUeYe5a1NC3m69sJH7nez6uoKcMTdKKaOLTE9AVJaFpVeo3EwikUDerwdfjKEScveRz2U= X-Received: by 2002:a17:907:2d94:b0:ae0:de30:8569 with SMTP id a640c23a62f3a-ae9c99442c6mr1256374866b.1.1752878684423; Fri, 18 Jul 2025 15:44:44 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507172154.56HLsGLL095197@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Fri, 18 Jul 2025 16:44:32 -0600 X-Gm-Features: Ac12FXyY5O1eEQepiloUTOL3V6vuBCriAy580KvuGJ-nHffKAM0fVIzB8xjsUFs Message-ID: Subject: Re: git: 29af6d2e2ec9 - main - msdosfs: replace '/' in direntries with '?' To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000051ccd7063a3bdf78" X-Rspamd-Queue-Id: 4bkPxV3p5Mz3t4K X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] --00000000000051ccd7063a3bdf78 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jul 18, 2025 at 4:42=E2=80=AFPM Konstantin Belousov wrote: > On Fri, Jul 18, 2025 at 10:06:56AM -0600, Alan Somers wrote: > > Should we move this logic up into kern_getdirentries? msdosfs is not t= he > > only file system vulnerable to this problem. > It is relatively hard to do in kern_getdirentries(), and perhaps would > cause a severe performance hit for filesystems that do not need it. > > The issue is that uio might be for UIO_USERSPACE (and less likely > UIO_NOCOPY). > So we must allocate the transient buffer, then call VOP_READDIR() for tha= t > buffer, then do the validation, and then copyout to the final uio. > > Another thing, there are more VOP_READDIR() uses than only > kern_getdirents(). > Worst part, we do trust UFS and ZFS which are the most perf-sensitive. > > I did looked at generic checker, might be guided by some MNTK_-level flag= , > but decided to just patch msdosfs. > > That explanation makes sense. I guess I need to patch fusefs, too. We definitely don't want to trust that one. --00000000000051ccd7063a3bdf78 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jul 18, 2025 at 4:42=E2=80=AFPM Konst= antin Belousov <kostikbel@gmail.c= om> wrote:
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 4be9c6f38e78 - main - clnt_rc.c: Fix the case where a TLS handshake fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4be9c6f38e7859b8c913a75f7d900cd79ef6692a Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4be9c6f38e7859b8c913a75f7d900cd79ef6692a commit 4be9c6f38e7859b8c913a75f7d900cd79ef6692a Author: Rick Macklem AuthorDate: 2025-07-19 00:39:08 +0000 Commit: Rick Macklem CommitDate: 2025-07-19 00:39:08 +0000 clnt_rc.c: Fix the case where a TLS handshake fails When a TLS handshake fails during a NFS-over-TLS mount attempt, the socket was left around because it needed to be dereferenced. The dereference was not happening in clnt_vc_destroy() because ct_closeit was not set to TRUE. This patch moves the code that sets ct_closeit to TRUE up to before the rpctls_connect() call, so that ct_closeit is set to TRUE if it fails and clnt_vc_destroy() will then dereference the socket. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D51084 --- sys/rpc/clnt_rc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index 9e87af578885..44b63e38a8e6 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -198,6 +198,12 @@ clnt_reconnect_connect(CLIENT *cl) newclient = clnt_vc_create(so, (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers, rc->rc_sendsz, rc->rc_recvsz, rc->rc_intr); + /* + * CLSET_FD_CLOSE must be done now, in case rpctls_connect() + * fails just below. + */ + if (newclient != NULL) + CLNT_CONTROL(newclient, CLSET_FD_CLOSE, 0); if (rc->rc_tls && newclient != NULL) { CURVNET_SET(so->so_vnet); stat = rpctls_connect(newclient, rc->rc_tlscertname, so, @@ -236,7 +242,6 @@ clnt_reconnect_connect(CLIENT *cl) goto out; } - CLNT_CONTROL(newclient, CLSET_FD_CLOSE, 0); CLNT_CONTROL(newclient, CLSET_CONNECT, &one); CLNT_CONTROL(newclient, CLSET_TIMEOUT, &rc->rc_timeout); CLNT_CONTROL(newclient, CLSET_RETRY_TIMEOUT, &rc->rc_retry); From nobody Sat Jul 19 14:31:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkpxz3KhMz61tRQ; Sat, 19 Jul 2025 14:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkpxy5HCLz3kZ6; Sat, 19 Jul 2025 14:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752935494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=phl/CLpDbkRCb65uoI2KX7JIE0nqsoAWiuHaagnuaDQ=; b=NWXYblkeQ5EwPXBTNr9d+AxvdBOrZyitOAfZbZcKYROGMlYxutzTSfzcublP7ga/gdjdlH hVI6Z3iiCwpnNsrfCGoarRTTQVPmp6Ww71Q0DKYPPL/iu/57RL70iwbbL/NbjKhWO92Q2J 37sccgbA9Ss6rORSJHgWM9VHFq2lFOzE5iLCw4mzAHB3JeGylCp2zo9ZDHsOq5MhOSDLWV HsBUfsV/CbQgaE2xh/4YFTOP2BtugY1KkbIyljP8iHQoJJ1E5xNPxfsdwuuRCwFwa1B6kW 9dGUOsMkn0CxNojcSr6k7N+aBBjDG2xxZNP9hkEO6k0RrY0KFawpD86hmuJlHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752935494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=phl/CLpDbkRCb65uoI2KX7JIE0nqsoAWiuHaagnuaDQ=; b=yZeHhbmO0fBXdKoPJnnrrDXB0yfvbZ8thrbKVHji7nEqwaAvLJegR2dW9y11QnY6r+zruY UTyxtO4aLeFVWNVxWXsDHGFEr0Z6VYIu20aEKonNhAcU8qmCsLH14sAyWAM5YU5KOT6Re6 ILD+dsvlxq9kDyT0m+MFOy/YqZtDdSWiIiD5k+TjcSNerXpzwA3yoF4X0Lmckd5uiaCbLY A2nt7fvebob9ozbOP4dQuICZNKpjqxh3kbvvC42O3x+fJYML0MbT8v8gtfWnQlXUz/9pKj 2Q09tr5uX53de0Ydd7Zq3OU5c5FXH3G4lZXq+SwqWr1udsad65lj5/WtoICgSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752935494; a=rsa-sha256; cv=none; b=MTg5Tsd986C7TzgCYPOLpNV2x4fWGmDKjlaYQZitX38/Nb74d1VI6o+7IyCaXz4dsu/4qb r84/YIEyJvLbpEp/0aUKiWjCRVN4gKHVZ2ELX4Azi/aUnnp0Sgvmeqd4EC0aEQ9TFsjSGf 2e8xahMXrxzFdBQ0xt8MzQwDxFgPU3ctB0k32y+1TxICItsccLth4voaLhKmJfoEwt+B2X SCsQbWlLjx7RhKOiCOsqTfWlnVzmgfqUsEETs69emaehfFojg35HNALzBQbMBoTEzpu+Vs d5KMY0QMvYvdHsI1+y0HwbkHG2zGwY9bqUtW1+EJdFAZOoJJ7lOeM+LEM2TXsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkpxy4v4ZzVhX; Sat, 19 Jul 2025 14:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JEVY9P074574; Sat, 19 Jul 2025 14:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JEVYAP074571; Sat, 19 Jul 2025 14:31:34 GMT (envelope-from git) Date: Sat, 19 Jul 2025 14:31:34 GMT Message-Id: <202507191431.56JEVYAP074571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e46c15a0f848 - main - tcp: fix the test that a duplicate ACK has no data List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e46c15a0f848174f58bb08fed8e173a76b4c473a Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e46c15a0f848174f58bb08fed8e173a76b4c473a commit e46c15a0f848174f58bb08fed8e173a76b4c473a Author: Michael Tuexen AuthorDate: 2025-07-19 13:03:22 +0000 Commit: Michael Tuexen CommitDate: 2025-07-19 13:03:22 +0000 tcp: fix the test that a duplicate ACK has no data When processing a TCP segment, data is removed from the head or the tail. The test whether a segment has no data on it should depend on the TCP segment before the removal. Without this, received segments might trigger a fast retransmit even when they should not. Reported by: syzbot+fc97a2b5a0f7ea161161@syzkaller.appspotmail.com Reviewed by: Peter Lei MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51425 --- sys/netinet/tcp_input.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7c032e13f37a..f0921032ef31 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1515,7 +1515,9 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, struct tcpopt to; int tfo_syn; u_int maxseg = 0; + bool no_data; + no_data = (tlen == 0); thflags = tcp_get_flags(th); tp->sackhint.last_sack_ack = 0; sack_changed = SACK_NOCHANGE; @@ -1754,7 +1756,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, tp->ts_recent = to.to_tsval; } - if (tlen == 0) { + if (no_data) { if (SEQ_GT(th->th_ack, tp->snd_una) && SEQ_LEQ(th->th_ack, tp->snd_max) && !IN_RECOVERY(tp->t_flags) && @@ -2557,7 +2559,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, if (SEQ_LEQ(th->th_ack, tp->snd_una)) { maxseg = tcp_maxseg(tp); - if (tlen == 0 && + if (no_data && (tiwin == tp->snd_wnd || (tp->t_flags & TF_SACK_PERMIT))) { /* @@ -3113,8 +3115,7 @@ step6: (tp->snd_wl1 == th->th_seq && (SEQ_LT(tp->snd_wl2, th->th_ack) || (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd))))) { /* keep track of pure window updates */ - if (tlen == 0 && - tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) + if (no_data && tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) TCPSTAT_INC(tcps_rcvwinupd); tp->snd_wnd = tiwin; tp->snd_wl1 = th->th_seq; From nobody Sat Jul 19 14:54:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkqSG59J7z61vkB; Sat, 19 Jul 2025 14:54:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkqSF6TMPz41rF; Sat, 19 Jul 2025 14:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752936861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EPjOLmuClH3UcV0vSaA/JBuKHdnTHvLKcXijbOJbG/U=; b=x8PgqXKDOHfQytoTaWe/Jbp4Jei0RAKiRHjygPB8I0wH2/ok5pAVnLlaDCDdyKIxU/iO7d kktraRz2aVdeW6vtbrT0QXl9w0gVh9SPFLGozm8UcaN7IGsEV8hVVbDQpz/rYgymjNFCZ6 NHlnSLk1UWzkRtG2ZMrXYdsWEodtGKW6br0gEW/CMqFmc+GBVNWugVg/yvy0/SC1eKI+c5 baAsXGKOToHkq1rRlzGHQhXGmrmGqGHgNWqi8wJTzcePtQvfS6Tyzyck6KMJRuHivddFjZ TKaptS14H2oLP9aOTvXjtbLAtmZow0YIQdebUJNrhV46HRqGsw+6RsSMxls2Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752936861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EPjOLmuClH3UcV0vSaA/JBuKHdnTHvLKcXijbOJbG/U=; b=LmooHfU20Y65duya8hERUa/1/RcBbLk+F1xShABWZLNPGo+trm3h5ydLszNC/ZnlkSpwyi Z5O116LwVfAQLZaNYH6fbHvCwxk7vucf1CfEZhd/KD+U9QPgR86ZsYFYissrBuS+TnTC9r Cy0+Iz5M3uRb18cn5Kcmpy51diS5NO2i10GH0b67cr7l8C2YMB/Z46YhuDaecpISC8JC4T 6LqhLRSsEoLy7eXi5lnkZB0ivGXTR9BCo+NlcC186jill+roMDwMonYhePu03bttrDQ/2P yzNytDXBVUqnaU7eBDnESg/2OH0f3MfN5nA4EZ0rKjTCXoHrkcOu/6Xrpar83A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752936861; a=rsa-sha256; cv=none; b=XEgLiUwpo61WzExnBtR9B2Ph1pL8aldFUie+PSmL9j8TVLmagWrCtNYhQlBwWiNl2ivGxm nDuf/jNYoomhLDShQxW+MZK6m8kj/tdwLXjGjR0y7Cx7Gd7R7SUkvmZ23W5Xe8UiUJ/fWI SpSB2twZCpim7+vhm0K1K+AQryQ0jbJyMTnEWexLBBBtmJ73YBMzj5ryY6WpqHjIFBeyC+ DolesAkSTWftFMFdj5c6Zvn7gJN1jFnR6ltj+8aKey0wHgCCdA7H95O3uTI6PCKAhwKR+I FdLKoglMkkP+PZ7RZn9whd/NP901qgbhlaemmStuQ3C5OB6xr6qZHLLYvFLQAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkqSF5XcwzXMb; Sat, 19 Jul 2025 14:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JEsLQf017502; Sat, 19 Jul 2025 14:54:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JEsL0p017498; Sat, 19 Jul 2025 14:54:21 GMT (envelope-from git) Date: Sat, 19 Jul 2025 14:54:21 GMT Message-Id: <202507191454.56JEsL0p017498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: a28a65140f11 - main - rpcsec_gss.c: Avoid panics in clnt_nl_call() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a28a65140f11b54c4555d7c30ef5ae42fdf4c8a0 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a28a65140f11b54c4555d7c30ef5ae42fdf4c8a0 commit a28a65140f11b54c4555d7c30ef5ae42fdf4c8a0 Author: Rick Macklem AuthorDate: 2025-07-19 14:51:40 +0000 Commit: Rick Macklem CommitDate: 2025-07-19 14:51:40 +0000 rpcsec_gss.c: Avoid panics in clnt_nl_call() When rpc_gss_init() calls gssd upcall functions like gssd_import_name(), clnt_nl_call() gets calls. clnt_nl_call() requires that the currect vnet be set up. The calling sequence looks something like: rpc_gss_init()->gssd_import_name()->gssd_import_name_1()-> clnt_call_private()->clnt_nl_call() (The call to rpc_gss_init() can happen from various places, such as nfs_getauth() and clnt_vc_call().) rpc_gss_init() does not know what socket is being used for NFS client->server RPCs and may be called from various places when any VOP_xxx()->RPC call is made. As such, the calling thread might be running within a jail. However, the gssd upcalls for the NFS client must always be done to the gssd running outside of any jails. This patch sets the CURVNET to vnet0 in rpc_gss_init() to fix the problem, since that is the vnet that always should be used. This must somehow be changed if NFS mounts in vnet jails is enabled. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D51086 --- sys/rpc/rpcsec_gss/rpcsec_gss.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss.c b/sys/rpc/rpcsec_gss/rpcsec_gss.c index 62c71937a185..983dd251f81f 100644 --- a/sys/rpc/rpcsec_gss/rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/rpcsec_gss.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -771,6 +772,17 @@ rpc_gss_init(AUTH *auth, rpc_gss_options_ret_t *options_ret) gd->gd_cred.gc_proc = RPCSEC_GSS_INIT; gd->gd_cred.gc_seq = 0; + /* + * XXX Threads from inside jails can get here via calls + * to clnt_vc_call()->AUTH_REFRESH()->rpc_gss_refresh() + * but the NFS mount is always done outside of the + * jails in vnet0. Since the thread credentials won't + * necessarily have cr_prison == vnet0 and this function + * has no access to the socket, using vnet0 seems the + * only option. This is broken if NFS mounts are enabled + * within vnet prisons. + */ + KGSS_CURVNET_SET_QUIET(vnet0); /* * For KerberosV, if there is a client principal name, that implies * that this is a host based initiator credential in the default @@ -994,12 +1006,14 @@ out: gss_delete_sec_context(&min_stat, &gd->gd_ctx, GSS_C_NO_BUFFER); } + KGSS_CURVNET_RESTORE(); mtx_lock(&gd->gd_lock); gd->gd_state = RPCSEC_GSS_START; wakeup(gd); mtx_unlock(&gd->gd_lock); return (FALSE); } + KGSS_CURVNET_RESTORE(); mtx_lock(&gd->gd_lock); gd->gd_state = RPCSEC_GSS_ESTABLISHED; From nobody Sat Jul 19 17:09:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bktRf2fLdz6247p; Sat, 19 Jul 2025 17:09:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bktRd6hx0z3FyS; Sat, 19 Jul 2025 17:09:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752944942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Knxd5lM4bNhDKwGfTnesajDz5OYHZfjLN4ILBy6QX8=; b=gL5PG3U7mfoLUFCj/LTdp+HL491E2xsF7NFLig0tPXcnOoYSGgyi/GI3z1SS1nJQzA3eLC RU7PZ8Qu6JTsrkqPjEpGXHQrSZ/IOCMLwyOmE7Lkmq8SXeTaPEgL8qTUCkuzhhobuxmAgn 9lg0voLiYYEk640BHi1Xclb6RJ8zrtgqQ64yah8nZNICLD2j2ZhyZmU+HaGZcVFFwj3+UN kKyyHaqBTsuc4oWEKHQD0G1LFSxcfoGLBxXqlQKxIHAKmgLKJIU6yWTBMx5kjiTF2YkxPc fpETf3oiWqbpu60AK8S0fnqbtEGeoSGeWQ9f7Aw4zEDDMmKqXM3Yl5y+VefiNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752944942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Knxd5lM4bNhDKwGfTnesajDz5OYHZfjLN4ILBy6QX8=; b=k0hCGqm9jIQ2f1j1s9sH71+A8FSKqBUV+3rwTfdCJQeZjAAMguRyC9WjVUmNZHzSdv1W4g kJuJQyFGt97WMDQeGfUImt57+gYw9I9XMksdO/J/3AbflnMe8Wq+v9c3C+S+phHHjiIGGG /0bC+0lewrSoP4YRJrr+OAQIZEpQ3jaNqOrrHEbzMMDl8sm9fim1Vbo5rdLsVq1XipWf+g 7m0FDXyJk4yrAHpG7LHnLVkc2bfMdPyasnGGmYrj9NiQ/EbOJUxO667K8UPXR3u6QplTcO U6CWR+zzZvyD2/Cr1MkPcFvj/90ho2z58Q4m1dPnYj9T3Xbqy6kKUcwNEYVgUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752944942; a=rsa-sha256; cv=none; b=Z3qmtzesRFrsFo/ivdM+g4UtpxWcR2v/ZBUAsZrwF+/j+zTAmcJmv1I5GuAc8UrEiJ8t5t ALiWqoBM7AE/6C/1BPlHQ9eNc4Kp57FrLr0hTN4pt9FwM22NVyflfIuOlfyw/GqAVsEcyX k+XG+zso/yCzKd4cgRBlUTdXHkhvq1giOS9K0bsG8BFr5zmFJoPa9L8yDL9N3G4peTcEfb pOOQjt+6dxYJXTKmmY313nl7rnH+dmXp05bydBsompajuJWrGHqv54MCYTOmWNvdU28Nen k8JoBmmLwJpsgwmsW9gi2KxiLeLpsD4zY13uNEodVFnzYufXoBmdSNmGjfpRaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bktRd5yzXzbcL; Sat, 19 Jul 2025 17:09:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JH91GP065052; Sat, 19 Jul 2025 17:09:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JH91hu065049; Sat, 19 Jul 2025 17:09:01 GMT (envelope-from git) Date: Sat, 19 Jul 2025 17:09:01 GMT Message-Id: <202507191709.56JH91hu065049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 2fc051d09093 - main - if_genet: Consistently use the boolean form List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fc051d090933203e1af6a8452cdd87a4c76ad5b Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2fc051d090933203e1af6a8452cdd87a4c76ad5b commit 2fc051d090933203e1af6a8452cdd87a4c76ad5b Author: Zhenlei Huang AuthorDate: 2025-07-19 17:07:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-19 17:07:54 +0000 if_genet: Consistently use the boolean form The variable eaddr_found is declared as bool. This change improves readability a little. No functional change intended. MFC after: 3 days --- sys/arm64/broadcom/genet/if_genet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index 0602f076b257..da973a778706 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -349,7 +349,7 @@ gen_attach(device_t dev) } /* If address was not found, create one based on the hostid and name. */ - if (eaddr_found == 0) + if (!eaddr_found) ether_gen_addr(sc->ifp, &eaddr); /* Attach ethernet interface */ ether_ifattach(sc->ifp, eaddr.octet); From nobody Sat Jul 19 17:09:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bktRg29Fxz624Cn; Sat, 19 Jul 2025 17:09:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bktRf6hrvz3G5H; Sat, 19 Jul 2025 17:09:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752944942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRRPnfGn/Kvx1t8Lfw1iWBmzJuEVj+u+m879lNTVofw=; b=F05hvkBGinofyzbgMNWYB8Be75BFvW/4pijwToPEw3sdT5p+U8aqkO+42LzwVovskE9C6U tGXemcb6fGH2VojNWg/Mf9XPg4EMCswwoL6z+PP7nGUW4NqYfnOqZ7+II1nWFW9VeI1wWa 0+0C3f36KUfTaTURhFyTv3HdCPj4eE1l++IruG/DslnxfK4xCRaFL7jEjxOBL7jCT6du03 wSgqh65eGca03Y5NmsD++HarzN1xaSrqDUI7lBIizFpG+fbsfh7w1GrvtEDoO2HVD9n5qM 5wczLAQdMldXesadM0WpbAj22/KUt1aBhIMr3BakupuufEQl7tMkki98lG5j+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752944942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRRPnfGn/Kvx1t8Lfw1iWBmzJuEVj+u+m879lNTVofw=; b=GASP6p8XKrrqBdr4u5DexAyFCEEOGBxE5pzSmunakknf3Yps+e54iAxVAiZCcZR6BMhpIl C9XLvsD3MK1Rw/u7VCjE9LrU++mtISCIeDrKKrgu7/CE/czfwtaFtfhKDAZqBNJd2ihDRX hVNJm8e+ybTl+lbtXFBpJdbwezAfbZQ2X7MGe9B8K4bKlbmhlWlxmVezi13mhKQfcZ6FKc Wtshws0yn57yTs1yif4h+dg6AwJ/FOZtkNF7nQq5HCjR0oTdaDuAV1VtJ6/4FSb86uZ7IG EO0AUwHcSXpOt7/ZAyj/Uzoa42XS8t5yohq6lShOIcMFgVqYFR+xUhGgu/c4CQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752944942; a=rsa-sha256; cv=none; b=gTJ2H8yhtgX0ELI5hlwIa0gWEolaOfkYpTcYzHb22bkbWeS7o60o+9fqUlVy708FlmsFof 5XJchGCJ10Ijf14xRujNllBn0uU4/IIZhku/luTYNpS9iXj2GQINqaGYKtrBUmP13FHuuM x7MzOdvJ3Oq/ZW8kkGkCv9RInslz2gJFaCmmQPBZ1v3M6vzUR7yB5mbefnkDluH8idpyrX k8yA2+1823z0S3vTYqOgeiTE3kPvdnKtniEpSoHRbXXkTaA5GVsgEo+cu191LGRCOPdT0J GbycSGzggAJ5+1Pl0yj6QmEBUl1H8R3olWFQfnEdh9s377Dg8RDdPNs0WSSCrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bktRf5v6czbyp; Sat, 19 Jul 2025 17:09:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JH92Uf065092; Sat, 19 Jul 2025 17:09:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JH9231065089; Sat, 19 Jul 2025 17:09:02 GMT (envelope-from git) Date: Sat, 19 Jul 2025 17:09:02 GMT Message-Id: <202507191709.56JH9231065089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f46e95ae3add - main - if_genet: Plug memory leaks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f46e95ae3addc9f7b975c187f71125825a38ffb1 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f46e95ae3addc9f7b975c187f71125825a38ffb1 commit f46e95ae3addc9f7b975c187f71125825a38ffb1 Author: Zhenlei Huang AuthorDate: 2025-07-19 17:07:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-19 17:07:54 +0000 if_genet: Plug memory leaks The rx_buf_tag should be checked when destroying rx dma mappings. PR: 288309 Reviewed by: zlei Submitted by: Mike Belanger MFC after: 3 days --- sys/arm64/broadcom/genet/if_genet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index da973a778706..182b5582fb7c 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -653,7 +653,7 @@ gen_bus_dma_teardown(struct gen_softc *sc) error); } - if (sc->tx_buf_tag != NULL) { + if (sc->rx_buf_tag != NULL) { for (i = 0; i < RX_DESC_COUNT; i++) { error = bus_dmamap_destroy(sc->rx_buf_tag, sc->rx_ring_ent[i].map); From nobody Sat Jul 19 17:42:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkvB93nL1z625tY; Sat, 19 Jul 2025 17:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkvB91X7hz3fPl; Sat, 19 Jul 2025 17:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752946945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dQOu+bA9r3Rd111+kG/KWbJTs63MT7VD6bRqlzqqlVo=; b=c1yRQVI3YSXeBzMGFMXrcvvkRj8ChvaCL6lIsUCv6xN+rx/fMzlI03+e2JZc+/QKMnThhS ikeUdzhMwQKGMc9mpHzlXk5CvIZUn1Kn6ysxfHjOnvSOXUwPRNwTX+M2xrhSaE5dVPYoyO 1TgT1VQox6QgfAFKnLOw7pd+V2zfvEAQ5UR/3GlEf8UNzjkWoYJiW08XeiS33PbuLhWIlw W0fjBCxTPU7KolBhX6ldGHbIIQZCFyJhXE32USIu3QaXvCDHc4hhBqzjvnKE+8MgLZeTgN 9+C0nHepyR5XiIUAWulushuJTD0+4TGBfz/xNOOth1WWm9LaVY5WvDKccSPj1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752946945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dQOu+bA9r3Rd111+kG/KWbJTs63MT7VD6bRqlzqqlVo=; b=tTMe93eZo88Nbh/3tAjPEtQibmtDEiweL9o+B04P2p6d8lWBclD8FMYNgCszDyHEC8bC+E Bf3zCdrwOKst4iDUZOWiVKP8sOJX25VEACVX3mKe8sgMn4Ku5yg4hJ6BS8ANsvd4POMvNp We53dfWzckGrlIjfh/M0g6b/gZguOYNVi3IkTmDvDKbggHzExNu3bWfK4GtyRo2aRRwCPu WrLJmD/Pn2szf8n7Q40BJvtr3hwePGKP+GVTpSl5/AD/xsBybruI+4qNDYzwB14+QO3PvH Ct30xarbRcFL7A+ghR78CrquZVgjSqjqpGYlc8ZAESi5ThxXVQXJU9rgk1HsGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752946945; a=rsa-sha256; cv=none; b=aYrKLffxS1n3XekFxWj31rPupqTcbtoN1CHYGQP5NlvRqC+/LkYNA3gj7eSiKA1dSbc1MY yvw6Txiow169qxymAYQgHk5ajbjCskw1uvfux0li/elbKV5aSkWwoW0YMND76NneEym3mF vgCFF8FeRMOFNaXBtT2jPlgYHrdrA2Z1YJuwZMPLBcWtc4k8S8yusSBoDllslMote6JKy/ Js5H0VPbSFX1Fq9QR42ZljjOW2pKlnt0+EopLuFbuY9pzYyvat8dP8YgohtuyP11YD3FDd payC2JZyCm+4FHn1OTbE2kz1gDoTZWnkOV9uDP4MdrXPFoAdJlJ5S+CfAYVIdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkvB90t7qzd1s; Sat, 19 Jul 2025 17:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JHgPEq037489; Sat, 19 Jul 2025 17:42:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JHgIX2037462; Sat, 19 Jul 2025 17:42:18 GMT (envelope-from git) Date: Sat, 19 Jul 2025 17:42:18 GMT Message-Id: <202507191742.56JHgIX2037462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: a8c56be47166 - main - Merge bmake-20250707 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8c56be47166295d37600ff81fc1857db87b3a9b Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a8c56be47166295d37600ff81fc1857db87b3a9b commit a8c56be47166295d37600ff81fc1857db87b3a9b Merge: f46e95ae3add 3d772e596c1a Author: Simon J. Gerraty AuthorDate: 2025-07-19 17:37:32 +0000 Commit: Simon J. Gerraty CommitDate: 2025-07-19 17:41:12 +0000 Merge bmake-20250707 Merge commit '3d772e596c1acf76f555c1f51fd8d834e56b0c35' contrib/bmake/ChangeLog | 27 +++ contrib/bmake/FILES | 8 +- contrib/bmake/VERSION | 2 +- contrib/bmake/arch.c | 6 +- contrib/bmake/bmake.1 | 79 +++++++- contrib/bmake/bmake.cat1 | 45 ++++- contrib/bmake/compat.c | 11 +- contrib/bmake/cond.c | 89 +++++---- contrib/bmake/for.c | 12 +- contrib/bmake/job.c | 42 ++-- contrib/bmake/job.h | 4 +- contrib/bmake/main.c | 54 ++--- contrib/bmake/make.1 | 79 +++++++- contrib/bmake/make.c | 6 +- contrib/bmake/make.h | 5 +- contrib/bmake/make_malloc.c | 7 +- contrib/bmake/mk/ChangeLog | 4 + contrib/bmake/mk/prog.mk | 8 +- contrib/bmake/parse.c | 19 +- contrib/bmake/str.c | 9 +- contrib/bmake/unit-tests/Makefile | 7 +- .../bmake/unit-tests/char-005c-reverse-solidus.exp | 13 ++ .../bmake/unit-tests/char-005c-reverse-solidus.mk | 131 ++++++++++++ contrib/bmake/unit-tests/check-expect.lua | 219 ++++++++++----------- contrib/bmake/unit-tests/cmd-errors-jobs.exp | 4 +- contrib/bmake/unit-tests/cmd-errors-jobs.mk | 6 +- contrib/bmake/unit-tests/cmd-errors-lint.exp | 2 +- contrib/bmake/unit-tests/cmd-errors-lint.mk | 4 +- contrib/bmake/unit-tests/cmd-errors.exp | 2 +- contrib/bmake/unit-tests/cmd-errors.mk | 4 +- contrib/bmake/unit-tests/cmdline-undefined.exp | 20 +- contrib/bmake/unit-tests/cmdline-undefined.mk | 26 +-- contrib/bmake/unit-tests/cond-cmp-numeric-eq.exp | 4 +- contrib/bmake/unit-tests/cond-cmp-numeric-eq.mk | 6 +- contrib/bmake/unit-tests/cond-cmp-numeric.exp | 8 +- contrib/bmake/unit-tests/cond-cmp-numeric.mk | 10 +- contrib/bmake/unit-tests/cond-cmp-string.exp | 16 +- contrib/bmake/unit-tests/cond-cmp-string.mk | 18 +- contrib/bmake/unit-tests/cond-eof.exp | 6 +- contrib/bmake/unit-tests/cond-eof.mk | 8 +- contrib/bmake/unit-tests/cond-func-defined.exp | 4 +- contrib/bmake/unit-tests/cond-func-defined.mk | 6 +- contrib/bmake/unit-tests/cond-func-make.exp | 2 +- contrib/bmake/unit-tests/cond-func-make.mk | 4 +- contrib/bmake/unit-tests/cond-func.exp | 12 +- contrib/bmake/unit-tests/cond-func.mk | 14 +- contrib/bmake/unit-tests/cond-late.exp | 2 +- contrib/bmake/unit-tests/cond-late.mk | 16 +- contrib/bmake/unit-tests/cond-op-and-lint.exp | 2 +- contrib/bmake/unit-tests/cond-op-and-lint.mk | 4 +- contrib/bmake/unit-tests/cond-op-and.exp | 10 +- contrib/bmake/unit-tests/cond-op-and.mk | 12 +- contrib/bmake/unit-tests/cond-op-not.exp | 2 +- contrib/bmake/unit-tests/cond-op-not.mk | 4 +- contrib/bmake/unit-tests/cond-op-or-lint.exp | 2 +- contrib/bmake/unit-tests/cond-op-or-lint.mk | 4 +- contrib/bmake/unit-tests/cond-op-or.exp | 10 +- contrib/bmake/unit-tests/cond-op-or.mk | 12 +- contrib/bmake/unit-tests/cond-op-parentheses.exp | 8 +- contrib/bmake/unit-tests/cond-op-parentheses.mk | 10 +- contrib/bmake/unit-tests/cond-op.exp | 14 +- contrib/bmake/unit-tests/cond-op.mk | 16 +- contrib/bmake/unit-tests/cond-short.exp | 2 +- contrib/bmake/unit-tests/cond-short.mk | 4 +- contrib/bmake/unit-tests/cond-token-number.exp | 8 +- contrib/bmake/unit-tests/cond-token-number.mk | 10 +- contrib/bmake/unit-tests/cond-token-plain.exp | 24 ++- contrib/bmake/unit-tests/cond-token-plain.mk | 50 +++-- contrib/bmake/unit-tests/cond-token-string.exp | 2 +- contrib/bmake/unit-tests/cond-token-string.mk | 4 +- contrib/bmake/unit-tests/cond-token-var.exp | 6 +- contrib/bmake/unit-tests/cond-token-var.mk | 8 +- contrib/bmake/unit-tests/dep-op-missing.exp | 2 +- contrib/bmake/unit-tests/deptgt-begin.exp | 2 +- contrib/bmake/unit-tests/deptgt-begin.mk | 6 +- contrib/bmake/unit-tests/deptgt-path-suffix.exp | 2 +- contrib/bmake/unit-tests/deptgt-path-suffix.mk | 4 +- contrib/bmake/unit-tests/deptgt.exp | 6 +- contrib/bmake/unit-tests/deptgt.mk | 8 +- contrib/bmake/unit-tests/directive-dinclude.exp | 2 +- contrib/bmake/unit-tests/directive-dinclude.mk | 4 +- .../bmake/unit-tests/directive-export-gmake.exp | 2 +- contrib/bmake/unit-tests/directive-export-gmake.mk | 4 +- contrib/bmake/unit-tests/directive-for-errors.exp | 6 +- contrib/bmake/unit-tests/directive-for-errors.mk | 8 +- contrib/bmake/unit-tests/directive-for-escape.exp | 10 +- contrib/bmake/unit-tests/directive-for-escape.mk | 12 +- contrib/bmake/unit-tests/directive-for-lines.exp | 12 +- contrib/bmake/unit-tests/directive-for-lines.mk | 20 +- contrib/bmake/unit-tests/directive-for.exp | 22 +-- contrib/bmake/unit-tests/directive-for.mk | 23 ++- .../bmake/unit-tests/directive-hyphen-include.exp | 2 +- .../bmake/unit-tests/directive-hyphen-include.mk | 4 +- contrib/bmake/unit-tests/directive-if.exp | 2 +- contrib/bmake/unit-tests/directive-if.mk | 4 +- contrib/bmake/unit-tests/directive-include.exp | 2 +- contrib/bmake/unit-tests/directive-include.mk | 4 +- .../bmake/unit-tests/directive-misspellings.exp | 8 +- contrib/bmake/unit-tests/directive-misspellings.mk | 10 +- contrib/bmake/unit-tests/directive-sinclude.exp | 2 +- contrib/bmake/unit-tests/directive-sinclude.mk | 4 +- contrib/bmake/unit-tests/directive-unexport.exp | 2 +- contrib/bmake/unit-tests/directive-unexport.mk | 3 +- contrib/bmake/unit-tests/directive-warning.exp | 6 +- contrib/bmake/unit-tests/directive-warning.mk | 5 +- contrib/bmake/unit-tests/directive.exp | 4 +- contrib/bmake/unit-tests/directive.mk | 6 +- contrib/bmake/unit-tests/moderrs.exp | 14 +- contrib/bmake/unit-tests/moderrs.mk | 16 +- contrib/bmake/unit-tests/opt-debug-file.exp | 6 +- contrib/bmake/unit-tests/opt-debug-file.mk | 14 +- contrib/bmake/unit-tests/opt-debug-lint.exp | 4 +- contrib/bmake/unit-tests/opt-debug-lint.mk | 6 +- contrib/bmake/unit-tests/opt-jobs-internal.exp | 18 +- contrib/bmake/unit-tests/parse.exp | 6 +- contrib/bmake/unit-tests/parse.mk | 8 +- contrib/bmake/unit-tests/var-op-assign.exp | 2 +- contrib/bmake/unit-tests/var-op-assign.mk | 4 +- contrib/bmake/unit-tests/var-op-expand.exp | 14 +- contrib/bmake/unit-tests/var-op-expand.mk | 8 +- contrib/bmake/unit-tests/varmisc.exp | 2 +- contrib/bmake/unit-tests/varmisc.mk | 4 +- contrib/bmake/unit-tests/varmod-edge.exp | 4 +- contrib/bmake/unit-tests/varmod-edge.mk | 6 +- contrib/bmake/unit-tests/varmod-ifelse.exp | 43 ++-- contrib/bmake/unit-tests/varmod-ifelse.mk | 11 +- contrib/bmake/unit-tests/varmod-match-escape.exp | 14 +- contrib/bmake/unit-tests/varmod-match-escape.mk | 10 +- contrib/bmake/unit-tests/varmod-match.exp | 20 +- contrib/bmake/unit-tests/varmod-match.mk | 28 +-- contrib/bmake/unit-tests/varmod-mtime.exp | 6 +- contrib/bmake/unit-tests/varmod-mtime.mk | 8 +- contrib/bmake/unit-tests/varmod-order.exp | 6 +- contrib/bmake/unit-tests/varmod-order.mk | 8 +- contrib/bmake/unit-tests/varmod-range.exp | 2 +- contrib/bmake/unit-tests/varmod-range.mk | 4 +- contrib/bmake/unit-tests/varmod.exp | 49 +++-- contrib/bmake/unit-tests/varmod.mk | 49 +++-- contrib/bmake/unit-tests/varname-circumflex.exp | 9 + contrib/bmake/unit-tests/varname-circumflex.mk | 47 +++++ contrib/bmake/unit-tests/varname-vpath.exp | 8 +- contrib/bmake/unit-tests/varname.exp | 4 +- contrib/bmake/unit-tests/varname.mk | 6 +- contrib/bmake/unit-tests/varparse-errors.exp | 28 +-- contrib/bmake/unit-tests/varparse-errors.mk | 30 +-- contrib/bmake/var.c | 38 ++-- usr.bin/bmake/Makefile.config | 2 +- usr.bin/bmake/unit-tests/Makefile | 7 +- 148 files changed, 1300 insertions(+), 814 deletions(-) diff --cc contrib/bmake/make.1 index f05653af7e31,1ac72f11aa83..de67759290c4 --- a/contrib/bmake/make.1 +++ b/contrib/bmake/make.1 @@@ -2823,8 -2879,8 +2890,9 @@@ Basic use of suffix rules (for files on not trying to chain transformations together, etc.) is also reasonably portable. .Sh SEE ALSO -.Xr mkdep 1 +.Xr mkdep 1 , +.Xr style.Makefile 5 + .\" .Sh STANDARDS .Sh HISTORY A .Nm diff --cc contrib/bmake/unit-tests/char-005c-reverse-solidus.exp index 000000000000,351ef95040e5..351ef95040e5 mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/char-005c-reverse-solidus.exp +++ b/contrib/bmake/unit-tests/char-005c-reverse-solidus.exp diff --cc contrib/bmake/unit-tests/char-005c-reverse-solidus.mk index 000000000000,7a151ac46322..7a151ac46322 mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/char-005c-reverse-solidus.mk +++ b/contrib/bmake/unit-tests/char-005c-reverse-solidus.mk diff --cc contrib/bmake/unit-tests/varname-circumflex.exp index 000000000000,184b021fd5e5..184b021fd5e5 mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/varname-circumflex.exp +++ b/contrib/bmake/unit-tests/varname-circumflex.exp diff --cc contrib/bmake/unit-tests/varname-circumflex.mk index 000000000000,270f7123781b..270f7123781b mode 000000,100644..100644 --- a/contrib/bmake/unit-tests/varname-circumflex.mk +++ b/contrib/bmake/unit-tests/varname-circumflex.mk diff --cc usr.bin/bmake/Makefile.config index 78babc2f1382,000000000000..8ff6c81b8c78 mode 100644,000000..100644 --- a/usr.bin/bmake/Makefile.config +++ b/usr.bin/bmake/Makefile.config @@@ -1,28 -1,0 +1,28 @@@ +# This is a generated file, do NOT edit! +# See contrib/bmake/bsd.after-import.mk +# + +SRCTOP?= ${.CURDIR:H:H} + +# things set by configure + - _MAKE_VERSION?=20250618 ++_MAKE_VERSION?=20250707 + +prefix?= /usr +srcdir= ${SRCTOP}/contrib/bmake +CC?= cc +MAKE_OS?= +DEFAULT_SYS_PATH?= .../share/mk:/usr/share/mk + +EGREP= egrep +CPPFLAGS+= +CFLAGS+= ${CPPFLAGS} -DHAVE_CONFIG_H +LDFLAGS+= +LIBOBJS+= ${LIBOBJDIR}stresep$U.o +LDADD+= +USE_META?= yes +USE_FILEMON?= dev +FILEMON_H?= /usr/include/dev/filemon/filemon.h +BMAKE_PATH_MAX?= 1024 +# used if MAXPATHLEN not defined +CPPFLAGS+= -DBMAKE_PATH_MAX=${BMAKE_PATH_MAX} diff --cc usr.bin/bmake/unit-tests/Makefile index 1b9a47febe11,000000000000..d4ee6f33f862 mode 100644,000000..100644 --- a/usr.bin/bmake/unit-tests/Makefile +++ b/usr.bin/bmake/unit-tests/Makefile @@@ -1,920 -1,0 +1,921 @@@ +# This is a generated file, do NOT edit! +# See contrib/bmake/bsd.after-import.mk +# - # $Id: Makefile,v 1.239 2025/06/15 21:32:16 sjg Exp $ ++# $Id: Makefile,v 1.240 2025/06/30 18:40:54 sjg Exp $ +# - # $NetBSD: Makefile,v 1.367 2025/06/13 20:23:16 rillig Exp $ ++# $NetBSD: Makefile,v 1.369 2025/06/29 09:40:13 rillig Exp $ +# +# Unit tests for make(1) +# +# The main targets are: +# +# all: +# run all the tests +# test: +# run 'all', and compare to expected results +# accept: +# move generated output to expected results +# +# Settable variables +# +# TEST_MAKE +# The make program to be tested. +# +# +# Adding a test case +# +# Each feature should get its own set of tests in its own suitably +# named makefile (*.mk), with its own set of expected results (*.exp), +# and it should be added to the TESTS list. +# + +.MAIN: all + +# we use these below but we might be an older make +.MAKE.OS?= ${uname -s:L:sh} +.MAKE.UID?= ${id -u:L:sh} + +# for many tests we need a TMPDIR that will not collide +# with other users. +.if ${.OBJDIR} != ${.CURDIR} +# easy +TMPDIR:= ${.OBJDIR}/tmp +.elif defined(TMPDIR) +TMPDIR:= ${TMPDIR}/uid${.MAKE.UID} +.else +TMPDIR:= /tmp/uid${.MAKE.UID} +.endif +# make sure it exists +.if !exist(${TMPDIR}) +_!= mkdir -p ${TMPDIR} +.endif +# and clean it up - outside the context of +# any target that might be using it. +.END: rm-tmpdir +rm-tmpdir: .NOMETA + @rm -rf ${TMPDIR} + +# Each test is in a sub-makefile. +# Keep the list sorted. +# Any test that is commented out must be ignored in +# src/tests/usr.bin/make/t_make.sh as well. +#TESTS+= archive +#TESTS+= archive-suffix ++TESTS+= char-005c-reverse-solidus +TESTS+= cmd-errors +TESTS+= cmd-errors-jobs +TESTS+= cmd-errors-lint +TESTS+= cmd-interrupt +TESTS+= cmdline +TESTS+= cmdline-redirect-stdin +TESTS+= cmdline-undefined +TESTS+= comment +TESTS+= compat-error +TESTS+= cond-cmp-numeric +TESTS+= cond-cmp-numeric-eq +TESTS+= cond-cmp-numeric-ge +TESTS+= cond-cmp-numeric-gt +TESTS+= cond-cmp-numeric-le +TESTS+= cond-cmp-numeric-lt +TESTS+= cond-cmp-numeric-ne +TESTS+= cond-cmp-string +TESTS+= cond-cmp-unary +TESTS+= cond-eof +TESTS+= cond-func +TESTS+= cond-func-commands +TESTS+= cond-func-defined +TESTS+= cond-func-empty +TESTS+= cond-func-exists +TESTS+= cond-func-make +TESTS+= cond-func-make-main +TESTS+= cond-func-target +TESTS+= cond-late +TESTS+= cond-op +TESTS+= cond-op-and +TESTS+= cond-op-and-lint +TESTS+= cond-op-not +TESTS+= cond-op-or +TESTS+= cond-op-or-lint +TESTS+= cond-op-parentheses +TESTS+= cond-short +TESTS+= cond-token-number +TESTS+= cond-token-plain +TESTS+= cond-token-string +TESTS+= cond-token-var +TESTS+= cond-undef-lint +TESTS+= counter +TESTS+= counter-append +TESTS+= dep +TESTS+= dep-colon +TESTS+= dep-colon-bug-cross-file +TESTS+= dep-double-colon +TESTS+= dep-double-colon-indep +TESTS+= dep-duplicate +TESTS+= dep-exclam +TESTS+= dep-none +TESTS+= dep-op-missing +TESTS+= dep-percent +TESTS+= dep-var +TESTS+= dep-wildcards +TESTS+= depsrc +TESTS+= depsrc-end +TESTS+= depsrc-exec +TESTS+= depsrc-ignore +TESTS+= depsrc-made +TESTS+= depsrc-make +TESTS+= depsrc-meta +TESTS+= depsrc-nometa +TESTS+= depsrc-nometa_cmp +TESTS+= depsrc-nopath +TESTS+= depsrc-notmain +TESTS+= depsrc-optional +TESTS+= depsrc-phony +TESTS+= depsrc-precious +TESTS+= depsrc-recursive +TESTS+= depsrc-silent +TESTS+= depsrc-use +TESTS+= depsrc-usebefore +TESTS+= depsrc-usebefore-double-colon +TESTS+= depsrc-wait +TESTS+= deptgt +TESTS+= deptgt-begin +TESTS+= deptgt-begin-fail +TESTS+= deptgt-begin-fail-indirect +TESTS+= deptgt-default +TESTS+= deptgt-delete_on_error +TESTS+= deptgt-end +TESTS+= deptgt-end-fail +TESTS+= deptgt-end-fail-all +TESTS+= deptgt-end-fail-indirect +TESTS+= deptgt-end-jobs +TESTS+= deptgt-error +TESTS+= deptgt-ignore +TESTS+= deptgt-interrupt +TESTS+= deptgt-main +TESTS+= deptgt-makeflags +TESTS+= deptgt-no_parallel +TESTS+= deptgt-nopath +TESTS+= deptgt-notparallel +TESTS+= deptgt-objdir +TESTS+= deptgt-order +TESTS+= deptgt-path +TESTS+= deptgt-path-suffix +TESTS+= deptgt-phony +TESTS+= deptgt-posix +TESTS+= deptgt-precious +TESTS+= deptgt-shell +TESTS+= deptgt-silent +TESTS+= deptgt-silent-jobs +TESTS+= deptgt-stale +TESTS+= deptgt-suffixes +TESTS+= dir +TESTS+= dir-expand-path +TESTS+= directive +TESTS+= directive-dinclude +TESTS+= directive-elif +TESTS+= directive-elifdef +TESTS+= directive-elifmake +TESTS+= directive-elifndef +TESTS+= directive-elifnmake +TESTS+= directive-else +TESTS+= directive-endfor +TESTS+= directive-endif +TESTS+= directive-error +TESTS+= directive-export +TESTS+= directive-export-env +TESTS+= directive-export-impl +TESTS+= directive-export-gmake +TESTS+= directive-export-literal +TESTS+= directive-for +TESTS+= directive-for-break +TESTS+= directive-for-empty +TESTS+= directive-for-errors +TESTS+= directive-for-escape +TESTS+= directive-for-generating-endif +TESTS+= directive-for-if +TESTS+= directive-for-lines +TESTS+= directive-for-null +TESTS+= directive-hyphen-include +TESTS+= directive-if +TESTS+= directive-if-nested +TESTS+= directive-ifdef +TESTS+= directive-ifmake +TESTS+= directive-ifndef +TESTS+= directive-ifnmake +TESTS+= directive-include +TESTS+= directive-include-fatal +TESTS+= directive-include-guard +TESTS+= directive-info +TESTS+= directive-misspellings +TESTS+= directive-sinclude +TESTS+= directive-undef +TESTS+= directive-unexport +TESTS+= directive-unexport-env +TESTS+= directive-warning +TESTS+= dollar +TESTS+= doterror +TESTS+= dotwait +TESTS+= error +TESTS+= # escape # broken by reverting POSIX changes +TESTS+= export +TESTS+= export-all +TESTS+= export-env +TESTS+= export-variants +TESTS+= gnode-submake +TESTS+= hanoi-include +TESTS+= impsrc +TESTS+= include-main +TESTS+= job-flags +TESTS+= job-output +TESTS+= job-output-long-lines +TESTS+= job-output-null +TESTS+= jobs-empty-commands +TESTS+= jobs-empty-commands-error +TESTS+= jobs-error-indirect +TESTS+= jobs-error-nested +TESTS+= jobs-error-nested-make +TESTS+= lint +TESTS+= make-exported +TESTS+= meta-cmd-cmp +TESTS+= moderrs +TESTS+= modmisc +.if ${.MAKE.UID} > 0 +TESTS+= objdir-writable +.endif +TESTS+= opt +TESTS+= opt-backwards +TESTS+= opt-chdir +TESTS+= opt-debug +TESTS+= opt-debug-all +TESTS+= opt-debug-archive +TESTS+= opt-debug-curdir +TESTS+= opt-debug-cond +TESTS+= opt-debug-dir +TESTS+= opt-debug-errors +TESTS+= opt-debug-errors-jobs +TESTS+= opt-debug-file +TESTS+= opt-debug-for +TESTS+= opt-debug-graph1 +TESTS+= opt-debug-graph2 +TESTS+= opt-debug-graph3 +TESTS+= opt-debug-hash +TESTS+= opt-debug-jobs +TESTS+= opt-debug-lint +TESTS+= opt-debug-loud +TESTS+= opt-debug-meta +TESTS+= opt-debug-making +TESTS+= opt-debug-no-rm +TESTS+= opt-debug-parse +TESTS+= opt-debug-suff +TESTS+= opt-debug-targets +TESTS+= opt-debug-varraw +TESTS+= opt-debug-var +TESTS+= opt-debug-x-trace +TESTS+= opt-define +TESTS+= opt-env +TESTS+= opt-file +TESTS+= opt-ignore +TESTS+= opt-include-dir +TESTS+= opt-jobs +TESTS+= opt-jobs-internal +TESTS+= opt-jobs-no-action +TESTS+= opt-keep-going +TESTS+= opt-keep-going-indirect +TESTS+= opt-keep-going-multiple +TESTS+= opt-m-include-dir +TESTS+= opt-no-action +TESTS+= opt-no-action-at-all +TESTS+= opt-no-action-runflags +TESTS+= opt-no-action-touch +TESTS+= opt-query +TESTS+= opt-raw +TESTS+= opt-silent +TESTS+= opt-touch +TESTS+= opt-touch-jobs +TESTS+= opt-tracefile +TESTS+= opt-var-expanded +TESTS+= opt-var-literal +TESTS+= opt-version +TESTS+= opt-warnings-as-errors +TESTS+= opt-where-am-i +TESTS+= opt-x-reduce-exported +TESTS+= order +TESTS+= parse +TESTS+= parse-var +TESTS+= phony-end +TESTS+= posix +TESTS+= posix-execution +TESTS+= posix-expansion +TESTS+= posix-varassign +TESTS+= # posix1 # broken by reverting POSIX changes +TESTS+= recursive +TESTS+= sh +TESTS+= sh-dots +TESTS+= sh-errctl +TESTS+= sh-flags +TESTS+= sh-jobs +TESTS+= sh-jobs-error +TESTS+= sh-leading-at +TESTS+= sh-leading-hyphen +TESTS+= sh-leading-plus +TESTS+= sh-meta-chars +TESTS+= sh-multi-line +TESTS+= sh-single-line +TESTS+= shell-csh +TESTS+= shell-custom +.if exists(/bin/ksh) +TESTS+= shell-ksh +.endif +TESTS+= shell-sh +TESTS+= suff +TESTS+= suff-add-later +TESTS+= suff-clear-regular +TESTS+= suff-clear-single +TESTS+= suff-incomplete +TESTS+= suff-lookup +TESTS+= suff-main +TESTS+= suff-main-several +TESTS+= suff-phony +TESTS+= suff-rebuild +TESTS+= suff-self +TESTS+= suff-transform-debug +TESTS+= suff-transform-endless +TESTS+= suff-transform-expand +TESTS+= suff-transform-select +TESTS+= suff-use +TESTS+= sunshcmd +TESTS+= ternary +TESTS+= unexport +TESTS+= unexport-env +TESTS+= use-inference +TESTS+= var-readonly +TESTS+= var-scope +TESTS+= var-scope-cmdline +TESTS+= var-scope-env +TESTS+= var-scope-global +TESTS+= var-scope-local +TESTS+= var-scope-local-legacy +TESTS+= var-eval-short +TESTS+= var-op +TESTS+= var-op-append +TESTS+= var-op-assign +TESTS+= var-op-default +TESTS+= var-op-expand +TESTS+= var-op-shell +TESTS+= var-op-sunsh +TESTS+= var-recursive +TESTS+= varcmd +TESTS+= vardebug +TESTS+= varfind +TESTS+= varmisc +TESTS+= varmod +TESTS+= varmod-assign +TESTS+= varmod-assign-shell +TESTS+= varmod-defined +TESTS+= varmod-edge +TESTS+= varmod-exclam-shell +TESTS+= varmod-extension +TESTS+= varmod-gmtime +TESTS+= varmod-hash +TESTS+= varmod-head +TESTS+= varmod-ifelse +TESTS+= varmod-indirect +TESTS+= varmod-l-name-to-value +TESTS+= varmod-localtime +TESTS+= varmod-loop +TESTS+= varmod-loop-delete +TESTS+= varmod-loop-varname +TESTS+= varmod-match +TESTS+= varmod-match-escape +TESTS+= varmod-mtime +TESTS+= varmod-no-match +TESTS+= varmod-order +TESTS+= varmod-order-numeric +TESTS+= varmod-order-reverse +TESTS+= varmod-order-shuffle +TESTS+= varmod-order-string +TESTS+= varmod-path +TESTS+= varmod-quote +TESTS+= varmod-quote-dollar +TESTS+= varmod-range +TESTS+= varmod-remember +TESTS+= varmod-root +TESTS+= varmod-select-words +TESTS+= varmod-shell +TESTS+= varmod-subst +TESTS+= varmod-subst-regex +TESTS+= varmod-sun-shell +TESTS+= varmod-sysv +TESTS+= varmod-tail +TESTS+= varmod-to-abs +TESTS+= varmod-to-lower +TESTS+= varmod-to-many-words +TESTS+= varmod-to-one-word +TESTS+= varmod-to-separator +TESTS+= varmod-to-title +TESTS+= varmod-to-upper +TESTS+= varmod-undefined +TESTS+= varmod-unique +TESTS+= varname ++TESTS+= varname-circumflex +TESTS+= varname-dollar +TESTS+= varname-dot-alltargets +TESTS+= varname-dot-curdir +TESTS+= varname-dot-includes +TESTS+= varname-dot-includedfromdir +TESTS+= varname-dot-includedfromfile +TESTS+= varname-dot-libs +TESTS+= varname-dot-make-dependfile +TESTS+= varname-dot-make-expand_variables +TESTS+= varname-dot-make-exported +TESTS+= varname-dot-make-jobs +TESTS+= varname-dot-make-jobs-prefix +TESTS+= varname-dot-make-level +TESTS+= varname-dot-make-makefile_preference +TESTS+= varname-dot-make-makefiles +TESTS+= varname-dot-make-meta-bailiwick +TESTS+= varname-dot-make-meta-created +TESTS+= varname-dot-make-meta-files +.if ${.MAKE.PATH_FILEMON:Uno:Nktrace:N/dev*} == "" && ${TMPDIR:N/tmp*:N/var/tmp*} != "" +# these tests will not work if TMPDIR is or is a subdir of +# /tmp or /var/tmp +.if ${.MAKE.PATH_FILEMON:N/dev/*} != "" || exists(${.MAKE.PATH_FILEMON}) +TESTS+= varname-dot-make-meta-ignore_filter +TESTS+= varname-dot-make-meta-ignore_paths +TESTS+= varname-dot-make-meta-ignore_patterns +TESTS+= varname-dot-make-path_filemon +.else +.warning Skipping tests that require ${.MAKE.PATH_FILEMON} +.endif +.endif +TESTS+= varname-dot-make-meta-prefix +TESTS+= varname-dot-make-mode +TESTS+= varname-dot-make-pid +TESTS+= varname-dot-make-ppid +TESTS+= varname-dot-make-save_dollars +TESTS+= varname-dot-makeflags +TESTS+= varname-dot-makeoverrides +TESTS+= varname-dot-newline +TESTS+= varname-dot-objdir +TESTS+= varname-dot-parsedir +TESTS+= varname-dot-parsefile +TESTS+= varname-dot-path +TESTS+= varname-dot-shell +TESTS+= varname-dot-suffixes +TESTS+= varname-dot-targets +TESTS+= varname-empty +TESTS+= varname-make +TESTS+= varname-make_stack_trace +TESTS+= varname-make_print_var_on_error +TESTS+= varname-make_print_var_on_error-jobs +TESTS+= varname-makefile +TESTS+= varname-makeflags +TESTS+= varname-pwd +TESTS+= varname-vpath +TESTS+= varparse-dynamic +TESTS+= varparse-errors +TESTS+= varparse-mod +TESTS+= varparse-undef-partial + +# some shells have quirks +_shell:= ${.SHELL:tA:T} +.if ${_shell} == "dash" +# dash fails -x output +BROKEN_TESTS+= opt-debug-x-trace +.elif ${_shell:N*ksh*} == "" +BROKEN_TESTS+= \ + deptgt-silent-jobs \ + job-flags \ + job-output-long-lines \ + opt-debug-x-trace \ + sh-flags \ + var-op-shell \ + +.if ${_shell:Nmksh} == "" +# more broken that pdksh +BROKEN_TESTS+= \ + opt-jobs-no-action \ + sh-errctl \ + sh-leading-hyphen \ + +.endif +.endif + +.if ${UTC_1:Uno} == "" +# this will not work if UTC_1 is set empty +BROKEN_TESTS+= varmod-localtime +.endif + +.if ${.MAKE.OS:NDarwin} == "" +BROKEN_TESTS+= shell-ksh +.endif + +.if ${.MAKE.OS:NIRIX*} == "" +BROKEN_TESTS+= \ + cmd-interrupt \ + deptgt-interrupt \ + job-output-null \ + opt-chdir \ + opt-debug-x-trace \ + sh-leading-hyphen \ + +.endif + +.if ${.MAKE.OS} == "SCO_SV" +BROKEN_TESTS+= \ + opt-debug-graph[23] \ + varmod-localtime \ + varmod-to-separator \ + +.if ${_shell} == "bash" +BROKEN_TESTS+= job-output-null +.else +BROKEN_TESTS+= \ + cmd-interrupt \ + job-flags \ + +.endif +.endif + +# Some tests just do not work on some platforms or environments +# so allow for some filtering. +.if !empty(BROKEN_TESTS) +.warning Skipping broken tests: ${BROKEN_TESTS:O:u} +TESTS:= ${TESTS:${BROKEN_TESTS:S,^,N,:ts:}} +.endif + +# Ideas for more tests: +# char-0020-space.mk - # char-005C-backslash.mk +# escape-cond-str.mk +# escape-cond-func-arg.mk +# escape-varmod.mk +# escape-varmod-define.mk +# escape-varmod-match.mk +# escape-varname.mk +# escape-varassign-varname.mk +# escape-varassign-varname-cmdline.mk +# escape-varassign-value.mk +# escape-varassign-value-cmdline.mk +# escape-dependency-source.mk +# escape-dependency-target.mk +# escape-for-varname.mk +# escape-for-item.mk +# posix-*.mk (see posix.mk and posix1.mk) + +# Additional environment variables for some of the tests. +# The base environment is -i PATH="$PATH". +ENV.depsrc-optional+= TZ=UTC +ENV.deptgt-phony+= MAKESYSPATH=. +ENV.directive-undef= ENV_VAR=env-value +ENV.opt-env= FROM_ENV=value-from-env +ENV.opt-m-include-dir= ${MAKEOBJDIR:DMAKEOBJDIR=${MAKEOBJDIR}} +ENV.varmisc= FROM_ENV=env +ENV.varmisc+= FROM_ENV_BEFORE=env +ENV.varmisc+= FROM_ENV_AFTER=env +ENV.varmod-localtime+= TZ=${UTC_1:UEurope/Berlin} +ENV.varname-vpath+= VPATH=varname-vpath.dir:varname-vpath.dir2 + +# Override make flags for some of the tests; default is -k. +# If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of +# settings FLAGS.test=-dv here, since that is closer to the test code. +FLAGS.cond-func-make= via-cmdline +FLAGS.doterror= # none, especially not -k +FLAGS.jobs-error-indirect= # none, especially not -k +FLAGS.jobs-error-nested= # none, especially not -k +FLAGS.jobs-error-nested-make= # none, especially not -k +FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmdline-plain' + +# Some tests need extra postprocessing. +SED_CMDS.deptgt-phony= ${STD_SED_CMDS.dd} +SED_CMDS.dir= ${STD_SED_CMDS.dd} +SED_CMDS.directive-include-guard= \ + -e '/\.MAKEFLAGS/d' \ + -e '/^Parsing .*:[1-9][0-9]*:/d' \ + -e '/^SetFilenameVars:/d' \ + -e '/^ParseDependency/d' \ + -e '/^ParseEOF:/d' +SED_CMDS.export= -e '/^[^=_A-Za-z0-9]*=/d' +.if ${.MAKE.OS:NCygwin} == "" +SED_CMDS.export+= -e '/^WINDIR=/d' -e '/^SYSTEMROOT=/d' +.endif +SED_CMDS.export-all= ${SED_CMDS.export} +SED_CMDS.export-env= ${SED_CMDS.export} +SED_CMDS.cmdline= -e 's,uid${.MAKE.UID}/,,' +SED_CMDS.job-output-long-lines= \ + ${:D Job separators on their own line are ok. } \ + -e '/^--- job-[ab] ---$$/d' \ + ${:D Plain output lines are ok as well. } \ + ${:D They may come in multiples of 1024 or as 10000. } \ + -e '/^aa*$$/d' \ + -e '/^bb*$$/d' \ + ${:D The following lines should rather not occur since the job } \ + ${:D marker should always be at the beginning of the line. } \ + -e '/^aa*--- job-b ---$$/d' \ + -e '/^bb*--- job-a ---$$/d' +SED_CMDS.opt-chdir= -e 's,\(nonexistent\).[1-9][0-9]*,\1,' \ + -e '/name/s,file,File,' \ + -e 's,no such,No such,' \ + -e 's,Filename,File name,' + +# meta line numbers can vary based on filemon implementation +SED_CMDS.meta-ignore= -e 's,\(\.meta:\)[1-9][0-9]*:,\1:,' + +SED_CMDS.opt-chdir= -e 's,\(nonexistent\).[1-9][0-9]*,\1,' +SED_CMDS.opt-debug-graph1= ${STD_SED_CMDS.dg1} +SED_CMDS.opt-debug-graph2= ${STD_SED_CMDS.dg2} +SED_CMDS.opt-debug-graph3= ${STD_SED_CMDS.dg3} +SED_CMDS.opt-debug-hash= -e 's,\(entries\)=[1-9][0-9],\1=,' +SED_CMDS.opt-debug-jobs= ${STD_SED_CMDS.dj} +SED_CMDS.opt-debug-lint+= ${STD_SED_CMDS.regex} +SED_CMDS.opt-jobs-no-action= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.opt-no-action-runflags= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.opt-where-am-i= -e '/usr.obj/d' +# For Compat_RunCommand, useShell == false. +SED_CMDS.sh-dots= -e 's,^.*\.\.\.:.*,,' +# For Compat_RunCommand, useShell == true. +SED_CMDS.sh-dots+= -e 's,^make: exec(\(.*\)): .*$$,,' +SED_CMDS.sh-dots+= -e 's,^\(\*\*\* Error code \)[1-9][0-9]*,\1,' +# Race condition between the child's stdout and make's status. +SED_CMDS.sh-errctl= ${STD_SED_CMDS.dj} +SED_CMDS.sh-errctl+= -e '/^Process with pid/d' +SED_CMDS.sh-errctl+= -e '/^JobFinish:/d' +SED_CMDS.sh-flags= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.shell-csh= ${STD_SED_CMDS.white-space} +SED_CMDS.sh-leading-hyphen= ${STD_SED_CMDS.shell} +SED_CMDS.suff-main+= ${STD_SED_CMDS.dg1} +SED_CMDS.suff-main-several+= ${STD_SED_CMDS.dg1} +SED_CMDS.suff-transform-debug+= ${STD_SED_CMDS.dg1} +SED_CMDS.var-op-shell+= ${STD_SED_CMDS.shell} +SED_CMDS.var-op-shell+= -e '/command/s,No such.*,not found,' +SED_CMDS.var-op-shell+= ${STD_SED_CMDS.white-space} +SED_CMDS.vardebug+= -e 's,${.SHELL},,' +SED_CMDS.varmod-mtime+= -e "s,\(mtime for .*\): .*,\1: ," +SED_CMDS.varmod-subst-regex+= ${STD_SED_CMDS.regex} +SED_CMDS.varparse-errors+= ${STD_SED_CMDS.timestamp} +SED_CMDS.varname-dot-make-meta-ignore_filter+= ${SED_CMDS.meta-ignore} +SED_CMDS.varname-dot-make-meta-ignore_paths+= ${SED_CMDS.meta-ignore} +SED_CMDS.varname-dot-make-meta-ignore_patterns+= ${SED_CMDS.meta-ignore} +SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: [^:]*:,make: :,' +SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: [^:]*:,make: :,' +SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g' +SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g' +SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g' +SED_CMDS.varname-empty= ${.OBJDIR .PARSEDIR .PATH .SHELL .SYSPATH:L:@v@-e '/\\$v/d'@} + +# Some tests need an additional round of postprocessing. +POSTPROC.depsrc-wait= sed -e '/^---/d' -e 's,^\(: Making 3[abc]\)[123]$$,\1,' +POSTPROC.deptgt-suffixes= awk '/^\#\*\*\* Suffixes/,/^never-stop/' +POSTPROC.gnode-submake= awk '/Begin input graph/, /^$$/' +POSTPROC.varname-dot-make-mode= sed 's,^\(: Making [abc]\)[123]$$,\1,' + +# Some tests reuse other tests, which makes them unnecessarily fragile. +export-all.rawout: export.mk +unexport.rawout: export.mk +unexport-env.rawout: export.mk + +# End of the configuration section. + +# Some standard sed commands, to be used in the SED_CMDS above. + +# In tests that use the debugging option -dd, ignore debugging output that is +# only logged in -DCLEANUP mode. +STD_SED_CMDS.dd= -e '/^OpenDirs_Done:/d' +STD_SED_CMDS.dd+= -e '/^CachedDir /d' +STD_SED_CMDS.dd+= -e 's, ${DEFSYSPATH:U/usr/share/mk} , ,' + +# Omit details such as process IDs from the output of the -dg1 option. +STD_SED_CMDS.dg1= -e '/\#.* \.$$/d' +STD_SED_CMDS.dg1+= -e '/\.MAKE.PATH_FILEMON/d' +STD_SED_CMDS.dg1+= -e '/^\#.*\/mk/d' +STD_SED_CMDS.dg1+= -e 's, ${DEFSYSPATH:U/usr/share/mk}$$, ,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE\.[A-Z_]* *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE\.JOBS\.C *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(MACHINE[_ARCH]* *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(MAKE *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.SHELL *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e '/\.SYSPATH/d' + +STD_SED_CMDS.dg2= ${STD_SED_CMDS.dg1} +STD_SED_CMDS.dg2+= -e 's,\(last modified\) ..:..:.. ... ..\, ....,\1 ,' +STD_SED_CMDS.dg3= ${STD_SED_CMDS.dg2} + +# Omit details such as process IDs from the output of the -dj option. +STD_SED_CMDS.dj= -e 's, pid [0-9][0-9]*, pid ,' +STD_SED_CMDS.dj+= -e 's,^\(.Command\): ${.SHELL:T},\1: ,' +# The "-q" may be there or not, see jobs.c, variable shells. +STD_SED_CMDS.dj+= -e 's,^\(.Command: \) -q,\1,' + +# Reduce the noise for tests running with the -n option, since there is no +# other way to suppress the echoing of the commands. +STD_SED_CMDS.hide-from-output= \ + -e '/^echo hide-from-output/d' \ + -e 's,hide-from-output ,,' \ + -e 's,hide-from-output,,' + +# Normalize the output for error messages from the shell. +# +# $shell -c '...' +# NetBSD sh ...: not found +# NetBSD ksh ksh: ...: not found +# bash 5.0.18 bash: ...: command not found +# bash 5.1.0 bash: line 1: ...: command not found +# dash dash: 1: ...: not found +# +# $shell -c '< /nonexistent' +# NetBSD sh sh: cannot open /nonexistent: no such file +# NetBSD ksh ksh: cannot open /nonexistent: No such file or directory +# bash 5.0.18 bash: /nonexistent: No such file or directory +# bash 5.1.0 bash: line 1: /nonexistent: No such file or directory +# dash dash: 1: cannot open /nonexistent: No such file +# +# echo '< /nonexistent' | $shell +# NetBSD sh sh: cannot open /nonexistent: no such file +# NetBSD ksh ksh: [1]: cannot open /nonexistent: No such file or directory +# bash 5.0.18 bash: line 1: /nonexistent: No such file or directory +# bash 5.1.0 bash: line 1: /nonexistent: No such file or directory +# dash dash: 1: cannot open /nonexistent: No such file +# +STD_SED_CMDS.shell+= -e 's,^${.SHELL},${.SHELL:T},' +STD_SED_CMDS.shell+= -e 's,^${.SHELL:T}: line [0-9][0-9]*: ,,' +STD_SED_CMDS.shell+= -e 's,^${.SHELL:T}: [0-9][0-9]*: ,,' +STD_SED_CMDS.shell+= -e 's,^${.SHELL:T}: ,,' +STD_SED_CMDS.shell+= -e 's,: command not found,: not found,' *** 178 LINES SKIPPED *** From nobody Sat Jul 19 19:47:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bkxyk1KpZz62FBv; Sat, 19 Jul 2025 19:47:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkxyj4dJlz3pRF; Sat, 19 Jul 2025 19:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752954461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b7NbsnS41HqAD0y9CGjPlp+2Yob1ZZED7QlZFf8fDDE=; b=SwP1HO/EhvPv42xkhdI05brym85Qi0rmnggCDovE4VR2xqRMR4K0ynGod72ykBjUs5vLRE H4BaL/C1ILa/eQczv22Y/vov0dnOsgEZe2xIH6CUzG3eJIzddrVFFp7y9TZepa7q3b9XmN XrAesH9qKZmDKkYD+zbTVMHmP89NpbGlratIbxjzbsPuLx24kspmwRMq3K8s0VyIOlxJOE GhQs38ee6JRXA8MbePotVDJO40q9c+XlXNnk+i7OmHcvdb7NPyGWbrh1i9u+feMx/AprL2 3RYh0W2Fl6CvAbGxx5Rk+bdWI7HzVvnLJXtLVWfXEKjsZcojyv+DuClbOaFKFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752954461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b7NbsnS41HqAD0y9CGjPlp+2Yob1ZZED7QlZFf8fDDE=; b=xWOg5VVdY0HGRA+1eAYGdOUQoUIJqOpZMbuuhpUbqyU0EFnb1e01rRK+jlFeGkN4CmkYNk Oxmh7tqz6NVsIlnqyRh0+iGKG38gVifAFEf7PIn8e1JBwkhSLuC04OjfzLsyYByiSnK3F5 nHHiVVKum4L6q8ZEzUSPnpP4QlrOlannFqY21SoQAzLAPKzqYEAf+PY/MVJvkV++nLPEWc 7Lj29zWI2S7q14QUg4EtJ6T6djZUkjEgfPRQCqls6LC/u0Po5lWrfu+Jfwvk+aEDHXj870 FeryNlpcxxQNnsFnqUwJsyi2HLnRgBrDfjEenQi9b4LnCq+pFy9AhNigcZnZ1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752954461; a=rsa-sha256; cv=none; b=vmCCdLClXR3gkvFhuKVX4HrnQBahdsS7TzldDn/SwyAa86mb3RFtjGelhDUxXYCrWqG8YG ZTzbuRPn0Twr8VNCf2SIL4J3RTqoqfwHdCa+bJZcpABs1eGN5d33J8bmYAhbvyt7/ZvcwE P3Ko5FtjDnqdTpz528SJeLRNQr2OOWaO920DCyUDhM8zXLJ3BlYHxy5H+pZ1eGj3qNucxq Q3Xw9T+lHZ/fhQVxJx5aGcnMhYXDirDz57V0hYZSx1kpqhmIymDL52bW7O01M1Zg8C3o+d gu1ta85DaiBt7FzcmdVTiQpl5oPLJB8et6PKQBmpZb8nhheqNilXS0pYT0QqSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bkxyj3s7Zzg4F; Sat, 19 Jul 2025 19:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JJlftG065421; Sat, 19 Jul 2025 19:47:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JJlfsA065418; Sat, 19 Jul 2025 19:47:41 GMT (envelope-from git) Date: Sat, 19 Jul 2025 19:47:41 GMT Message-Id: <202507191947.56JJlfsA065418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b153804256c5 - main - mld: allow sysctls to be set per vnet List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b153804256c53736ce45f1ef7a610d99efece0f7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b153804256c53736ce45f1ef7a610d99efece0f7 commit b153804256c53736ce45f1ef7a610d99efece0f7 Author: Kristof Provost AuthorDate: 2025-07-18 11:22:54 +0000 Commit: Kristof Provost CommitDate: 2025-07-19 19:47:06 +0000 mld: allow sysctls to be set per vnet Allow net.inet6.mld.use_allow, net.inet6.mld.v2enable and net.inet6.mld.v1enable to be set per vnet. While here convert them to booleans. Reviewed by: glebius, zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D51409 --- sys/netinet6/mld6.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 06fe9e8820c9..a825658bd9ee 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -234,17 +234,20 @@ static SYSCTL_NODE(_net_inet6_mld, OID_AUTO, ifinfo, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_mld_ifinfo, "Per-interface MLDv2 state"); -static int mld_v1enable = 1; -SYSCTL_INT(_net_inet6_mld, OID_AUTO, v1enable, CTLFLAG_RWTUN, - &mld_v1enable, 0, "Enable fallback to MLDv1"); +VNET_DEFINE_STATIC(bool, mld_v1enable) = true; +#define V_mld_v1enable VNET(mld_v1enable) +SYSCTL_BOOL(_net_inet6_mld, OID_AUTO, v1enable, CTLFLAG_VNET | CTLFLAG_RWTUN, + &VNET_NAME(mld_v1enable), 0, "Enable fallback to MLDv1"); -static int mld_v2enable = 1; -SYSCTL_INT(_net_inet6_mld, OID_AUTO, v2enable, CTLFLAG_RWTUN, - &mld_v2enable, 0, "Enable MLDv2"); +VNET_DEFINE_STATIC(bool, mld_v2enable) = true; +#define V_mld_v2enable VNET(mld_v2enable) +SYSCTL_BOOL(_net_inet6_mld, OID_AUTO, v2enable, CTLFLAG_VNET | CTLFLAG_RWTUN, + &VNET_NAME(mld_v2enable), 0, "Enable MLDv2"); -static int mld_use_allow = 1; -SYSCTL_INT(_net_inet6_mld, OID_AUTO, use_allow, CTLFLAG_RWTUN, - &mld_use_allow, 0, "Use ALLOW/BLOCK for RFC 4604 SSM joins/leaves"); +VNET_DEFINE_STATIC(bool, mld_use_allow) = true; +#define V_mld_use_allow VNET(mld_use_allow) +SYSCTL_BOOL(_net_inet6_mld, OID_AUTO, use_allow, CTLFLAG_VNET | CTLFLAG_RWTUN, + &VNET_NAME(mld_use_allow), 0, "Use ALLOW/BLOCK for RFC 4604 SSM joins/leaves"); /* * Packed Router Alert option structure declaration. @@ -481,7 +484,7 @@ mld_domifattach(struct ifnet *ifp) mbufq_init(&mli->mli_gq, MLD_MAX_RESPONSE_PACKETS); if ((ifp->if_flags & IFF_MULTICAST) == 0) mli->mli_flags |= MLIF_SILENT; - if (mld_use_allow) + if (V_mld_use_allow) mli->mli_flags |= MLIF_USEALLOW; MLD_LOCK(); @@ -614,7 +617,7 @@ mld_v1_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, is_general_query = 0; - if (!mld_v1enable) { + if (!V_mld_v1enable) { CTR3(KTR_MLD, "ignore v1 query %s on ifp %p(%s)", ip6_sprintf(ip6tbuf, &mld->mld_addr), ifp, if_name(ifp)); @@ -790,7 +793,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, NET_EPOCH_ASSERT(); - if (!mld_v2enable) { + if (!V_mld_v2enable) { CTR3(KTR_MLD, "ignore v2 query src %s on ifp %p(%s)", ip6_sprintf(ip6tbuf, &ip6->ip6_src), ifp, if_name(ifp)); @@ -1076,7 +1079,7 @@ mld_v1_input_report(struct ifnet *ifp, const struct ip6_hdr *ip6, NET_EPOCH_ASSERT(); - if (!mld_v1enable) { + if (!V_mld_v1enable) { CTR3(KTR_MLD, "ignore v1 report %s on ifp %p(%s)", ip6_sprintf(ip6tbuf, &mld->mld_addr), ifp, if_name(ifp)); From nobody Sat Jul 19 22:49:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl20D20PLz62RYM; Sat, 19 Jul 2025 22:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl20C5Qpyz3bD8; Sat, 19 Jul 2025 22:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752965355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=40GwJ5XAiLUGHWS+UUOJ6gPtITdIN0ll4TRkWGebo8U=; b=DLohLsiAvL+7FbBVJKl+gYn/6mVWre85yQHfosm6u08dg9NtYwWM5VrmeGI1GXoTkEX0/B Dney2q8EnUzusS0vhbGSgcHWKM9dZZ4AfeA80m8sG7rgF8ABOMrhj4olQnJrTEDdLQqm6H y3Xo6OmCcdkBC/hTSjiTgchBje/vCLj49/EucfGk7y9EFsmsc6ePWmu/9ypNtoMh2dVrSA jQDEVnhpmUzL9SSSB29zfOm3Bf6F0046RNCWhkSjz1E9O0vcZZGLuvyy0JiLgLwIVyAMuZ CyHlRLon1fNT9fUVwoWvcS/lLGwEVyrMbiHedBhvbtmh0BUJAPOaV/Fv9jS/Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752965355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=40GwJ5XAiLUGHWS+UUOJ6gPtITdIN0ll4TRkWGebo8U=; b=MhBUcXFdpMaiSd7f+peycs0ekauZoehEuAg7gbT+Y/l7oS7ISLOQ+b9KNJ7gdCzhCE1sBa 6qOLOK4rQsIf5Q7wJ4a2rPUvywBylVHAbmF208sQl/Csf/XojQ1wbH6Xo7A6lurKBdrTuy 8yiye6Ci4uDnmZCb5gzxyK1teoKSWjfykw11GPvYJo74lFAtlvVwreokmmmuKLGquUf81u 3ELgJvgyqbs8b4yH2HA7F4l5U55gDPEqkuDlxVwMPfYQfoP0PFjXEt5lFeTEXEO2EMiUFJ 15p9ZQGBNi3rCxg/xLpqxnujUb/QrjrchIO4ve8ePFE1TXgQSY2AassbHaghOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752965355; a=rsa-sha256; cv=none; b=PvR10+rj6O8TpgPdk1uhBTIUx9iSah+MftSuTQkiCBV9BJ7fwnXZSfgpRpkwYD+LByhNkE huU6avfeiMlGPwiS62JYUpgDeXRYST2s1N2cbx2jXGWz7ysBMg/tt+ZO7ZEl0ZQEy0pbiQ g8bnyfszJMQNjAw3sJ1jbaBisWAXVYwChIR1ctGnPAC98tPny68+A7Guox/YpW6P4asF2Z hDeOnKcURnPlndA2/O3TukxlMKD5XddIGZngkVnFegoHEt7FGY78kL/soLd1A6xQzZs+e/ QvtJlbYzko0WDAF4OLZAZ67tcvitUHAOOFdO4HhOF7D+rYPui8KGZqFNDv8AkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl20C4yrqzmqB; Sat, 19 Jul 2025 22:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JMnF0O006541; Sat, 19 Jul 2025 22:49:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JMnFEa006537; Sat, 19 Jul 2025 22:49:15 GMT (envelope-from git) Date: Sat, 19 Jul 2025 22:49:15 GMT Message-Id: <202507192249.56JMnFEa006537@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c00baac0ab46 - main - nfsd: Avoid relocking vnode for NFSv4 Readdir List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c00baac0ab46f54951a29b834e064935b749ae9a Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c00baac0ab46f54951a29b834e064935b749ae9a commit c00baac0ab46f54951a29b834e064935b749ae9a Author: Rick Macklem AuthorDate: 2025-07-19 22:45:40 +0000 Commit: Rick Macklem CommitDate: 2025-07-19 22:45:40 +0000 nfsd: Avoid relocking vnode for NFSv4 Readdir Without this patch, nfsv4_fillattr() relocks the vnode to test to see if extended attributes are supported. This is inefficient and could cause deadlocks if Readdir ever asks for this attribute. At this time, no extant NFSv4 client asks for this attribute for Readdir, but this patch fixes the problem in case a future client does so, by moving the test for extended attribute support to before the nfsv4_fillattr() call where the vnode is still locked. MFC after: 2 weeks --- sys/fs/nfs/nfs_commonsubs.c | 19 +++---------------- sys/fs/nfs/nfs_var.h | 6 +++--- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- sys/fs/nfsclient/nfs_clstate.c | 2 +- sys/fs/nfsserver/nfs_nfsdport.c | 24 ++++++++++++++++++------ sys/fs/nfsserver/nfs_nfsdserv.c | 16 ++++++++++++++-- 6 files changed, 40 insertions(+), 29 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 4c498e96a3c0..a3580d7f71f5 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -647,7 +647,8 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vattr *vap, NFSATTRBIT_TIMECREATE)) NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMECREATE); (void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0, - &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); + &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL, + false); break; } } @@ -2646,7 +2647,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, int reterr, int supports_nfsv4acls, int at_root, uint64_t mounted_on_fileno, - struct statfs *pnfssf) + struct statfs *pnfssf, bool xattrsupp) { int bitpos, retnum = 0; u_int32_t *tl; @@ -2660,8 +2661,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, struct nfsfsinfo fsinf; struct timespec temptime; NFSACL_T *aclp, *naclp = NULL; - size_t atsiz; - bool xattrsupp; short irflag; long has_pathconf; #ifdef QUOTA @@ -2747,18 +2746,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, } } - /* Check to see if Extended Attributes are supported. */ - xattrsupp = false; - if (NFSISSET_ATTRBIT(retbitp, NFSATTRBIT_XATTRSUPPORT)) { - if (NFSVOPLOCK(vp, LK_SHARED) == 0) { - error = VOP_GETEXTATTR(vp, EXTATTR_NAMESPACE_USER, - "xxx", NULL, &atsiz, cred, p); - NFSVOPUNLOCK(vp); - if (error != EOPNOTSUPP) - xattrsupp = true; - } - } - /* * Put out the attribute bitmap for the ones being filled in * and get the field for the number of attributes returned. diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 3b6c1ec90c06..a1f40e2b8c13 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -395,8 +395,8 @@ int nfsrv_putopbit(struct nfsrv_descript *, nfsopbit_t *); void nfsrv_wcc(struct nfsrv_descript *, int, struct nfsvattr *, int, struct nfsvattr *); int nfsv4_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, NFSACL_T *, - struct vattr *, fhandle_t *, int, nfsattrbit_t *, - struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *); + struct vattr *, fhandle_t *, int, nfsattrbit_t *, struct ucred *, + NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *, bool); void nfsrv_fillattr(struct nfsrv_descript *, struct nfsvattr *); struct mbuf *nfsrv_adj(struct mbuf *, int, int); void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *); @@ -735,7 +735,7 @@ int nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct nfsrv_descript *, NFSPROC_T *); int nfsvno_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, struct nfsvattr *, fhandle_t *, int, nfsattrbit_t *, - struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t); + struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, bool); int nfsrv_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *, NFSACL_T *, NFSPROC_T *); int nfsv4_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *, diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index e0e66baca44d..9a10a51b0d33 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -5436,7 +5436,7 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPROC_T *p, NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); (void) nfsv4_fillattr(nd, vp->v_mount, vp, aclp, NULL, NULL, 0, - &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); + &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL, false); error = nfscl_request(nd, vp, p, cred); if (error) return (error); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 1ae5ed1a75ca..c7e22c610a4e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3701,7 +3701,7 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) if (!error) (void) nfsv4_fillattr(nd, NULL, NULL, NULL, &va, NULL, 0, &rattrbits, NULL, p, 0, 0, 0, 0, - (uint64_t)0, NULL); + (uint64_t)0, NULL, false); break; case NFSV4OP_CBRECALL: NFSCL_DEBUG(4, "cbrecall\n"); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 43ee0383669f..ef57453d11fa 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2112,7 +2112,8 @@ int nfsvno_fillattr(struct nfsrv_descript *nd, struct mount *mp, struct vnode *vp, struct nfsvattr *nvap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, struct thread *p, int isdgram, int reterr, - int supports_nfsv4acls, int at_root, uint64_t mounted_on_fileno) + int supports_nfsv4acls, int at_root, uint64_t mounted_on_fileno, + bool xattrsupp) { struct statfs *sf; int error; @@ -2131,7 +2132,7 @@ nfsvno_fillattr(struct nfsrv_descript *nd, struct mount *mp, struct vnode *vp, } error = nfsv4_fillattr(nd, mp, vp, NULL, &nvap->na_vattr, fhp, rderror, attrbitp, cred, p, isdgram, reterr, supports_nfsv4acls, at_root, - mounted_on_fileno, sf); + mounted_on_fileno, sf, xattrsupp); free(sf, M_TEMP); NFSEXITCODE2(0, nd); return (error); @@ -2448,7 +2449,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram, struct nfsvattr nva, at, *nvap = &nva; struct mbuf *mb0, *mb1; struct nfsreferral *refp; - int nlen, r, error = 0, getret = 1, usevget = 1; + int nlen, r, error = 0, getret = 1, ret, usevget = 1; int siz, cnt, fullsiz, eofflag, ncookies, entrycnt; caddr_t bpos0, bpos1; u_int64_t off, toff, verf __unused; @@ -2462,6 +2463,8 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram, uint64_t mounted_on_fileno; struct thread *p = curthread; int bextpg0, bextpg1, bextpgsiz0, bextpgsiz1; + size_t atsiz; + bool xattrsupp; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -2936,9 +2939,18 @@ again: *tl++ = newnfs_true; txdr_hyper(*cookiep, tl); dirlen += nfsm_strtom(nd, dp->d_name, nlen); + xattrsupp = false; if (nvp != NULL) { supports_nfsv4acls = nfs_supportsnfsv4acls(nvp); + if (NFSISSET_ATTRBIT(&attrbits, + NFSATTRBIT_XATTRSUPPORT)) { + ret = VOP_GETEXTATTR(nvp, + EXTATTR_NAMESPACE_USER, + "xxx", NULL, &atsiz, + nd->nd_cred, p); + xattrsupp = ret != EOPNOTSUPP; + } NFSVOPUNLOCK(nvp); } else supports_nfsv4acls = 0; @@ -2958,13 +2970,13 @@ again: nvp, nvap, &nfh, r, &rderrbits, nd->nd_cred, p, isdgram, 0, supports_nfsv4acls, at_root, - mounted_on_fileno); + mounted_on_fileno, xattrsupp); } else { dirlen += nfsvno_fillattr(nd, new_mp, nvp, nvap, &nfh, r, &attrbits, nd->nd_cred, p, isdgram, 0, supports_nfsv4acls, at_root, - mounted_on_fileno); + mounted_on_fileno, xattrsupp); } if (nvp != NULL) vrele(nvp); @@ -6356,7 +6368,7 @@ nfsrv_setacldsdorpc(fhandle_t *fhp, struct ucred *cred, NFSPROC_T *p, * the same type (VREG). */ nfsv4_fillattr(nd, NULL, vp, aclp, NULL, NULL, 0, &attrbits, NULL, - NULL, 0, 0, 0, 0, 0, NULL); + NULL, 0, 0, 0, 0, 0, NULL, false); error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); if (error != 0) { diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 3acf07d5253b..1ae765917178 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -241,7 +241,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, { struct nfsvattr nva; fhandle_t fh; - int at_root = 0, error = 0, supports_nfsv4acls; + int at_root = 0, error = 0, ret, supports_nfsv4acls; struct nfsreferral *refp; nfsattrbit_t attrbits, tmpbits; struct mount *mp; @@ -250,6 +250,8 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, uint64_t mounted_on_fileno = 0; accmode_t accmode; struct thread *p = curthread; + size_t atsiz; + bool xattrsupp; if (nd->nd_repstat) goto out; @@ -307,6 +309,15 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, &nva, &attrbits, p); if (nd->nd_repstat == 0) { supports_nfsv4acls = nfs_supportsnfsv4acls(vp); + xattrsupp = false; + if (NFSISSET_ATTRBIT(&attrbits, + NFSATTRBIT_XATTRSUPPORT)) { + ret = VOP_GETEXTATTR(vp, + EXTATTR_NAMESPACE_USER, + "xxx", NULL, &atsiz, nd->nd_cred, + p); + xattrsupp = ret != EOPNOTSUPP; + } mp = vp->v_mount; if (nfsrv_enable_crossmntpt != 0 && vp->v_type == VDIR && @@ -340,7 +351,8 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, (void)nfsvno_fillattr(nd, mp, vp, &nva, &fh, 0, &attrbits, nd->nd_cred, p, isdgram, 1, supports_nfsv4acls, - at_root, mounted_on_fileno); + at_root, mounted_on_fileno, + xattrsupp); vfs_unbusy(mp); } vrele(vp); From nobody Sat Jul 19 23:44:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl3CR4Vbkz62VCg; Sat, 19 Jul 2025 23:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl3CR1JFYz47Zy; Sat, 19 Jul 2025 23:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752968643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R9yUYS/emvYIhT3l9zsj0jjK6nYbVO6xb3lvHdFM5jk=; b=fkEIh29fDjMdSjJjTTxZ6Ux2pmm89nBsqyuEGiovkfz3XQX5FJ4/v206TC5uMSEy2u8NiR 3MSdnyKPTapLwgo6PROx5lI5Wn2r/Z4kdCj3Sh1LyETa7yrecG7EQeVQgbbT2PW8Qp+2Xo qmQLQ4Kz9ys7IK82E4lZNnVK4MuPwjBndgSA+oy1/70UCv/bJN0EguxuNKUMolJEpw+2Sk CsyKBs2OJig+6YTm2/aBtJEJ3dd+9hnK/F1k5eaH62P1IR6Z7gDiuGS+B2vunojFx6J0nS pGd+1WDo1Xh8jieTtMDVQdF1txzT4fq6lKV6pTLQiaI7VFfqguFxjh25xsBU6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752968643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R9yUYS/emvYIhT3l9zsj0jjK6nYbVO6xb3lvHdFM5jk=; b=iU0NvseHxN37zUKJ9H4JP8jjyl31nHyU5AtSAnedhg0wVeThJdbCcTwqTtFIi7//aFEZs2 KiuXUql0kYuTKPNKgHYQ2ThL4PB3WOs0Rw38wzOWOs3BBXvEBsNW+NQla/hypH9bidMUUy FgQp8vUlPP+HkjClMqc/qDJEi8aFtykwbKf7RbA9XQjhmoXF5Dwbkc/euMvON45I3L+tsn V0cKXkzoHoMAIgcZjBngMbashCljueJHcnStgYT39O4arzB005ZbXhSaxFmCTqNnogPyw9 BWYI3SpyRiDh5plevIaAyBjE/r7So3sJVxVya4eHNrMyYrVhxP7Rt8p1KXl7VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752968643; a=rsa-sha256; cv=none; b=B8qHQdbsEXH0bJrF1dRBqHc6p5yPq2I06H5Bww8idizdjrtIfeOFeCqt/teCRcRBQNxEtU P1mqA+h9fkqN/GUrLPm4CWnqIYNUGYolJ4PFSQdpcakmAoxGkV42qAa5UG1I3vry00ZCgP QL/S/3hXn/K//iaKwSRKfMPdD4DVwoyyEmk9O4CIXv6bTDdmxBnLax3DoEZLvrCaGJWrNB GmDpervuq/mNQDr5XVzRk4NilvJ32d5x0PbHJaNPHjE4Yhewr4oQCn56G7dBhD1aWcsmBy US/Yevzzd+4waVQWa0OQEEdcXsCsyZGDr1PLdwDcrfqZK4jE/DAGvNOUQMbUdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl3CR0lqlznhK; Sat, 19 Jul 2025 23:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JNi3Fq017227; Sat, 19 Jul 2025 23:44:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JNi2am017224; Sat, 19 Jul 2025 23:44:02 GMT (envelope-from git) Date: Sat, 19 Jul 2025 23:44:02 GMT Message-Id: <202507192344.56JNi2am017224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 392a82b25405 - main - nfsd: Fix handling of VOP_PATHCONF() for attribute replies List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 392a82b25405760b61c22d8342d107ae4a724e65 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=392a82b25405760b61c22d8342d107ae4a724e65 commit 392a82b25405760b61c22d8342d107ae4a724e65 Author: Rick Macklem AuthorDate: 2025-07-19 23:40:29 +0000 Commit: Rick Macklem CommitDate: 2025-07-19 23:40:29 +0000 nfsd: Fix handling of VOP_PATHCONF() for attribute replies des@ reported a panic in the NFSv4 server, where nfsv4_fillattr() did a VOP_PATHCONF() without having "vp" locked. Relocking the vnode is inefficient and, for Readdir, may cause deadlocks. As such, this patch handles VOP_PATHCONF() in the same way that the code checks for ACL support, by doing the VOP_PATHCONF() before the calls to nfsv4_filllattr() where the vnode is still locked. Reported by: des Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D51410 Fixes: c5d72d29fe0e ("nfsv4: Add support for the NFSv4 hidden and system attributes") --- sys/fs/nfs/nfs_commonsubs.c | 17 +++++------------ sys/fs/nfs/nfs_var.h | 6 ++++-- sys/fs/nfsclient/nfs_clrpcops.c | 3 ++- sys/fs/nfsclient/nfs_clstate.c | 2 +- sys/fs/nfsserver/nfs_nfsdport.c | 29 +++++++++++++++++++++++------ sys/fs/nfsserver/nfs_nfsdserv.c | 17 +++++++++++++++-- 6 files changed, 50 insertions(+), 24 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index a3580d7f71f5..a957315aaa12 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -648,7 +648,7 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vattr *vap, NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMECREATE); (void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0, &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL, - false); + false, false, false); break; } } @@ -2647,7 +2647,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, int reterr, int supports_nfsv4acls, int at_root, uint64_t mounted_on_fileno, - struct statfs *pnfssf, bool xattrsupp) + struct statfs *pnfssf, bool xattrsupp, bool has_hiddensystem, + bool has_namedattr) { int bitpos, retnum = 0; u_int32_t *tl; @@ -2662,7 +2663,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, struct timespec temptime; NFSACL_T *aclp, *naclp = NULL; short irflag; - long has_pathconf; #ifdef QUOTA struct dqblk dqb; uid_t savuid; @@ -2767,11 +2767,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACLSUPPORT); NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACL); } - if (cred == NULL || p == NULL || vp == NULL || - VOP_PATHCONF(vp, _PC_HAS_HIDDENSYSTEM, - &has_pathconf) != 0) - has_pathconf = 0; - if (has_pathconf == 0) { + if (!has_hiddensystem) { NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_HIDDEN); NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_SYSTEM); } @@ -2815,10 +2811,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, break; case NFSATTRBIT_NAMEDATTR: NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - if (VOP_PATHCONF(vp, _PC_HAS_NAMEDATTR, - &has_pathconf) != 0) - has_pathconf = 0; - if (has_pathconf != 0) + if (has_namedattr) *tl = newnfs_true; else *tl = newnfs_false; diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index a1f40e2b8c13..54f60a753c50 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -396,7 +396,8 @@ void nfsrv_wcc(struct nfsrv_descript *, int, struct nfsvattr *, int, struct nfsvattr *); int nfsv4_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, NFSACL_T *, struct vattr *, fhandle_t *, int, nfsattrbit_t *, struct ucred *, - NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *, bool); + NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *, bool, bool, + bool); void nfsrv_fillattr(struct nfsrv_descript *, struct nfsvattr *); struct mbuf *nfsrv_adj(struct mbuf *, int, int); void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *); @@ -735,7 +736,8 @@ int nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct nfsrv_descript *, NFSPROC_T *); int nfsvno_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, struct nfsvattr *, fhandle_t *, int, nfsattrbit_t *, - struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, bool); + struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, bool, bool, + bool); int nfsrv_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *, NFSACL_T *, NFSPROC_T *); int nfsv4_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *, diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 9a10a51b0d33..2f3c59b68518 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -5436,7 +5436,8 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPROC_T *p, NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); (void) nfsv4_fillattr(nd, vp->v_mount, vp, aclp, NULL, NULL, 0, - &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL, false); + &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL, false, false, + false); error = nfscl_request(nd, vp, p, cred); if (error) return (error); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index c7e22c610a4e..99a781640c53 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3701,7 +3701,7 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) if (!error) (void) nfsv4_fillattr(nd, NULL, NULL, NULL, &va, NULL, 0, &rattrbits, NULL, p, 0, 0, 0, 0, - (uint64_t)0, NULL, false); + (uint64_t)0, NULL, false, false, false); break; case NFSV4OP_CBRECALL: NFSCL_DEBUG(4, "cbrecall\n"); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index ef57453d11fa..4f0d5946d6b9 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2113,7 +2113,7 @@ nfsvno_fillattr(struct nfsrv_descript *nd, struct mount *mp, struct vnode *vp, struct nfsvattr *nvap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, struct thread *p, int isdgram, int reterr, int supports_nfsv4acls, int at_root, uint64_t mounted_on_fileno, - bool xattrsupp) + bool xattrsupp, bool has_hiddensystem, bool has_namedattr) { struct statfs *sf; int error; @@ -2132,7 +2132,7 @@ nfsvno_fillattr(struct nfsrv_descript *nd, struct mount *mp, struct vnode *vp, } error = nfsv4_fillattr(nd, mp, vp, NULL, &nvap->na_vattr, fhp, rderror, attrbitp, cred, p, isdgram, reterr, supports_nfsv4acls, at_root, - mounted_on_fileno, sf, xattrsupp); + mounted_on_fileno, sf, xattrsupp, has_hiddensystem, has_namedattr); free(sf, M_TEMP); NFSEXITCODE2(0, nd); return (error); @@ -2464,7 +2464,8 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram, struct thread *p = curthread; int bextpg0, bextpg1, bextpgsiz0, bextpgsiz1; size_t atsiz; - bool xattrsupp; + long pathval; + bool has_hiddensystem, has_namedattr, xattrsupp; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -2940,6 +2941,8 @@ again: txdr_hyper(*cookiep, tl); dirlen += nfsm_strtom(nd, dp->d_name, nlen); xattrsupp = false; + has_hiddensystem = false; + has_namedattr = false; if (nvp != NULL) { supports_nfsv4acls = nfs_supportsnfsv4acls(nvp); @@ -2951,6 +2954,18 @@ again: nd->nd_cred, p); xattrsupp = ret != EOPNOTSUPP; } + if (VOP_PATHCONF(nvp, + _PC_HAS_HIDDENSYSTEM, &pathval) != + 0) + pathval = 0; + has_hiddensystem = pathval > 0; + pathval = 0; + if (NFSISSET_ATTRBIT(&attrbits, + NFSATTRBIT_NAMEDATTR) && + VOP_PATHCONF(nvp, _PC_HAS_NAMEDATTR, + &pathval) != 0) + pathval = 0; + has_namedattr = pathval > 0; NFSVOPUNLOCK(nvp); } else supports_nfsv4acls = 0; @@ -2970,13 +2985,15 @@ again: nvp, nvap, &nfh, r, &rderrbits, nd->nd_cred, p, isdgram, 0, supports_nfsv4acls, at_root, - mounted_on_fileno, xattrsupp); + mounted_on_fileno, xattrsupp, + has_hiddensystem, has_namedattr); } else { dirlen += nfsvno_fillattr(nd, new_mp, nvp, nvap, &nfh, r, &attrbits, nd->nd_cred, p, isdgram, 0, supports_nfsv4acls, at_root, - mounted_on_fileno, xattrsupp); + mounted_on_fileno, xattrsupp, + has_hiddensystem, has_namedattr); } if (nvp != NULL) vrele(nvp); @@ -6368,7 +6385,7 @@ nfsrv_setacldsdorpc(fhandle_t *fhp, struct ucred *cred, NFSPROC_T *p, * the same type (VREG). */ nfsv4_fillattr(nd, NULL, vp, aclp, NULL, NULL, 0, &attrbits, NULL, - NULL, 0, 0, 0, 0, 0, NULL, false); + NULL, 0, 0, 0, 0, 0, NULL, false, false, false); error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); if (error != 0) { diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 1ae765917178..9eebcda548c6 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -251,7 +251,8 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, accmode_t accmode; struct thread *p = curthread; size_t atsiz; - bool xattrsupp; + long pathval; + bool has_hiddensystem, has_namedattr, xattrsupp; if (nd->nd_repstat) goto out; @@ -318,6 +319,17 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, p); xattrsupp = ret != EOPNOTSUPP; } + if (VOP_PATHCONF(vp, _PC_HAS_HIDDENSYSTEM, + &pathval) != 0) + pathval = 0; + has_hiddensystem = pathval > 0; + pathval = 0; + if (NFSISSET_ATTRBIT(&attrbits, + NFSATTRBIT_NAMEDATTR) && + VOP_PATHCONF(vp, _PC_HAS_NAMEDATTR, + &pathval) != 0) + pathval = 0; + has_namedattr = pathval > 0; mp = vp->v_mount; if (nfsrv_enable_crossmntpt != 0 && vp->v_type == VDIR && @@ -352,7 +364,8 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, &fh, 0, &attrbits, nd->nd_cred, p, isdgram, 1, supports_nfsv4acls, at_root, mounted_on_fileno, - xattrsupp); + xattrsupp, has_hiddensystem, + has_namedattr); vfs_unbusy(mp); } vrele(vp); From nobody Sat Jul 19 23:58:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl3Wb11W5z62W7k; Sat, 19 Jul 2025 23:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl3WZ3CQjz3GN0; Sat, 19 Jul 2025 23:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752969482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hcv2Yq3ijgkA4IWWSPZh7uqV/Orhc4kcCan9aJlugIc=; b=MO+JFBOp1f1HF0WgclXGUwy8xKsPf9m+9kbIOaZc38zTlpwqaDos6VTHrPEJCEBQnEbyO5 EToIAeXgKjjP5GZN9qANsi7SciJVXIGVH4wcUKUKs/pYUAsrKtxSWBCB2d1swgW6Hh+/O2 XXJ3CDLMFoDwbvnzKpms41x60qITgHZCka+MnOv6Uiq347FWCf9MltQ1e04FcBw2eFYTUf nPxLW/kEno4+3NF2VxTfdFUyk14fmTOQ10IA59NW8ufUb19EhiUuOm2tQYti7EpKMO39Dk SjvJNqO9gbhLiICwdehe9R0jTUERplFBoon26r+FSBGkwilFSq1GmZDZ8EEP0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752969482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hcv2Yq3ijgkA4IWWSPZh7uqV/Orhc4kcCan9aJlugIc=; b=NUxU7F1rjM/LgAoIhcC6neYK6/HAKo1sXs9UaXrc5X7Zjr1BaGDgQ6p1kb9k75W4s+ruAb D0c7F+fJakxan/wTjUuHxtAv4ydWODsXRizyXzWkzpr7hxauiP9jlZVq5sdOmQNkM+7Ynn Wg72cak9ELNticx6H7zjB5663sek1jQbGBBHOofGEyCQbY+Dzl5kiPkZ0sBH0qfF9CNtIU 8TDsfsbWQACuFmn0bEedd7vPPEioX0+ol70VzEMTRmy3EqHUZM7Z/OYuEpUwt98wuq6A7n i4dRSFSrWRsyN68/yQkvdAoKG1x1I6nYepJyCjsVm+3hgPndda42FHkNNifdVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752969482; a=rsa-sha256; cv=none; b=kPby/bT+cTJRNeN0x3EztqqkRxwYT5EfvkLs5Dr1KP71ekLkfegM/rFABFWkUW3Bx7U3sD zR6v+ob9Ul/EaYhePX+wlx8yiH1pEeGR4c3grAmKHLlEW30LqYZ/wrVG45KT/PCZQ5PSSh S0UQLFuyqZBccQnm5Jfc2ljJZfA/tEnLH6zkBHA2gUdoq53F4DMj4D40ssQGNiEAoIF8dX CLRC6uXaJTR7aMjb6HrI5+T+mLlxpdy3cbg8Oi4sNjdVMaGoIUYvxX2E0XEfLmbhJGT06c YOmQbtvxQtQOZSDzZdm+LP1Ol9jLKiL80SW6tp3Jxs8qGUy0n9sEAQItq4bI0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl3WZ2hGBzpKV; Sat, 19 Jul 2025 23:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56JNw2dK037412; Sat, 19 Jul 2025 23:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JNw2ik037409; Sat, 19 Jul 2025 23:58:02 GMT (envelope-from git) Date: Sat, 19 Jul 2025 23:58:02 GMT Message-Id: <202507192358.56JNw2ik037409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 04055decc91c - main - param.h: Bump __FreeBSD_version for 392a82 and c00baa List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04055decc91c5911498bfcb924d26f37803ecb3a Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=04055decc91c5911498bfcb924d26f37803ecb3a commit 04055decc91c5911498bfcb924d26f37803ecb3a Author: Rick Macklem AuthorDate: 2025-07-19 23:55:29 +0000 Commit: Rick Macklem CommitDate: 2025-07-19 23:55:29 +0000 param.h: Bump __FreeBSD_version for 392a82 and c00baa Commits 392a82b225 and c00baac0ab both changed the internal API between the NFS modules. As such, all these modules need to be rebuilt from sources. Bump __FreeBSD_version to 1500053 for this. --- 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 a8e9635242dd..bd739eacae6f 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -74,7 +74,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500052 +#define __FreeBSD_version 1500053 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Sun Jul 20 00:03:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl3dX3198z62WY0; Sun, 20 Jul 2025 00:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl3dW5sQKz3K6T; Sun, 20 Jul 2025 00:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752969791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=40vOroIbH2NPTwDjCFntCwu9vjVjHD9rW8SAc162HXQ=; b=R8q+zHZxsq75yaVf/dkEw2oOsg+FlvpnaxYVi21ZMvbYsVIw0eHb/lCT3MXxRgl1O2Ril+ cfnP1X/XngeyQtUP6IzpbzEjgUzHS7tdC8VhXtMspvCT4B66vMNRDPcILhJRVebSaQbwoZ JbiJi6k9ZRBDwR5IsYdZfbeZtgBPTE98q2xKfVBGyB8u1pzletrAxud3ZLopW2ApInXhCb geX5AsAG7ElT4YfqwRpRoVUN1v0qXvig8m0sDk3x/z/JtEX1fGqVtRkJKB6IsRHd0yRiEV dekGMwRFuBL0hmc8YJzTFeEKvypKdM89wL8TcgnFgn2F7WApQ39h0eVoqj1RZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752969791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=40vOroIbH2NPTwDjCFntCwu9vjVjHD9rW8SAc162HXQ=; b=LJ82SitsNwFsz49m3nrwFHEc+nYA3Wvs51O8QgwtV3CMQnKehbUpY+N6MF9seBfZCfVj/1 B+9Wgq7hQY7r1gpY+V9B9fwGML4oWs1xwgQFgSqM7ypfgmFgMvLLVUvRhvTzRp2TkIOYym naYePOzZXgPj2Zg4lSo5XdYbV8x1jyCQvK4dmw1nzA24NhtZBTdam1SaKMYHQByKqd7boX qfDFtJgPZZ71W8cMdYQUmE01vdXXtojgcTizy1OrihT04cXGFXif4fi7SAYu6CaDH2Dsb3 fXgOphaymb8PEeAqoUi07/X3CHDKsIlh072qHmrqFYCOQTyjtqMq3TRM8v/7qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752969791; a=rsa-sha256; cv=none; b=SwVQnRIl3CuDNpRogchNnT+co98c/2JHlUy59Si0G164dTa3RmFrxF6ppwWTp65ijm0U4y /bsDLuBkqpW9fgkUm5GCUd47DeZobbRyj+9HANNBmisCWxBcwqWH8FAkgxFbPhHQUWsuah ck/6lkAvgHWyyjYdI4UlrGqYHl5E4BlYrHZZW0RMm2uuWjmoYInMvtLRLI5r95P8RBVoMm M2qcKu+RpO5VRwfdzzWFU6VJgwBgfOPAxejgeMNsL1yY8sd2C3AD8ihgmkmihLQ0HTagZf FufHVMlcUu3SUK7gp40tNYiHVu/Yb2HlzSN62C1GUegApLDJOcOtdMlsQvUACg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl3dW5Bzvzpr8; Sun, 20 Jul 2025 00:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56K03BwR055485; Sun, 20 Jul 2025 00:03:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56K03B4j055482; Sun, 20 Jul 2025 00:03:11 GMT (envelope-from git) Date: Sun, 20 Jul 2025 00:03:11 GMT Message-Id: <202507200003.56K03B4j055482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: f690a2da8f23 - main - UPDATING: Add an entry for commits 392a82b225 and c00baac0ab List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f690a2da8f232fe12669801213d17938e1c58b4b Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f690a2da8f232fe12669801213d17938e1c58b4b commit f690a2da8f232fe12669801213d17938e1c58b4b Author: Rick Macklem AuthorDate: 2025-07-19 23:59:58 +0000 Commit: Rick Macklem CommitDate: 2025-07-19 23:59:58 +0000 UPDATING: Add an entry for commits 392a82b225 and c00baac0ab --- UPDATING | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPDATING b/UPDATING index 2b8320c1204d..196443581158 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250719: + Commits 392a82b225 and c00baac0ab both changed the + internal API between the NFS modules. As such, all + these modules need to be rebuilt from sources. + __FreeBSD_version was bumped to 1500053 for this. + 20250710: The shar(1) utility has been removed from base. The sysutils/freebsd-shar port was created to maintain this version of From nobody Sun Jul 20 00:25:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl47r0yJhz62XRd; Sun, 20 Jul 2025 00:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl47r0JdNz3XWK; Sun, 20 Jul 2025 00:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oLXZ4i+ZVu5vrifx1Pb35IcOCp5V4KNxbPb2szNG74=; b=MW45+CpRSy25AsofroveBE4YOAU+pFWJ+Yhr4KCMvhHl4TIn3MCuT9c2l9i5ffCaEA1jBR SIa04jCaQYJ76hPuEsuxfpWBIhyB1fqP6FChf6vTULdbLIX9PfATQdR8jom+KHF7VW9hkf 3KsEgrcjDMYloNwOGvSdKa56fvty1vcnKjpv2JYC5QIgFf3YXWseflgfiNRnlw1su6YKGT q2XDKDbK9UiKk4Xa0ucbzDTrndz7Ss67va1lnSFkN04aMwsllc8m5hWuvf+FC9gj6To8vI gPqihZU22c24+BO86xhPgMd8gFBsjSASW01QsyQ4MnDMkuV+JlEK/YCSlg1FxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oLXZ4i+ZVu5vrifx1Pb35IcOCp5V4KNxbPb2szNG74=; b=P5ibW82WYUG3Bdj3Vh6HielrwsDYszN4DIIFNivq9wbdaCeyAa+CHp/xmat3+/+7H1gHBu isSm2reqWQiXq44WZJpWFtjwybZrbDV6AdrSPZwvU7dOVrhb9TfNlkvDiutnAcsLXlk6bT 9JNAqgXe/QUau9iD4zMgGvVyOdWXORi5ysDAMsyDKtxNq+5Pzz85v793ZpEoM7VOfGW2kK v2OC1OyQqoxNxXvzSyVKzTz1iWAlL3/mrug4U3gXXk4NVzg/sofMv7K87hTVaiOo87zwKP KTwTXeVjkmINUGwsKN3hS/CeH2fL+i5iYMwA0krNDkLAB0E/KmYZVrpxqqSUGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752971160; a=rsa-sha256; cv=none; b=Rb5PBSAiwIfP3nxshBNGLRGmB4vxFAxCcUEMGbb+Ki9sNi3JMuasdJrr5XIuOPYkoz9J3K g056DWsMgZqwiN3/oCh+f2G5KSckeuvslEjm3z236OvC0wLWSRzZ8iicYzCKsHJoe+dceZ P9sRV5MoxS3zfQvRYElputWcQJbaHoA3I22omCd92n5oDOdcLcwy50PsCVokSviYnwKWbM HZAUZBWFhV8Y7iBPpwEWULc2efY9Yi1PaYhqcN9TzTjkZufa1jSObcNzW9aZifkSU3nCaq qpJxXS5Cwnvt24BL9r/VgCEDzazTZkWFjfKPPsZQGOn7g7x3Znlm323cTHgN3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl47q6gfBzqCj; Sun, 20 Jul 2025 00:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56K0PxoP093358; Sun, 20 Jul 2025 00:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56K0PxNE093355; Sun, 20 Jul 2025 00:25:59 GMT (envelope-from git) Date: Sun, 20 Jul 2025 00:25:59 GMT Message-Id: <202507200025.56K0PxNE093355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cf07a18b58cf - main - amd64 pmap: make large map sizing depend on kva_layout instead of pml4 indexes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf07a18b58cfc0771b89bc504e16c1c7314643f8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf07a18b58cfc0771b89bc504e16c1c7314643f8 commit cf07a18b58cfc0771b89bc504e16c1c7314643f8 Author: Konstantin Belousov AuthorDate: 2025-07-16 23:54:43 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-20 00:25:45 +0000 amd64 pmap: make large map sizing depend on kva_layout instead of pml4 indexes Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51364 --- sys/amd64/amd64/pmap.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 14f57ca94ba7..a7d17db19a3e 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2475,6 +2475,7 @@ pmap_init(void) struct pmap_preinit_mapping *ppim; vm_page_t m, mpte; pml4_entry_t *pml4e; + unsigned long lm_max; int error, i, ret, skz63; /* L1TF, reserve page @0 unconditionally */ @@ -2600,10 +2601,15 @@ pmap_init(void) lm_ents = 8; TUNABLE_INT_FETCH("vm.pmap.large_map_pml4_entries", &lm_ents); - if (lm_ents > LMEPML4I - LMSPML4I + 1) - lm_ents = LMEPML4I - LMSPML4I + 1; + lm_max = (kva_layout.lm_high - kva_layout.lm_low) / NBPML4; + if (lm_ents > lm_max) { + printf( + "pmap: shrinking large map from requested %d slots to %ld slots\n", + lm_ents, lm_max); + lm_ents = lm_max; + } #ifdef KMSAN - if (lm_ents > KMSANORIGPML4I - LMSPML4I) { + if (!la57 && lm_ents > KMSANORIGPML4I - LMSPML4I) { printf( "pmap: shrinking large map for KMSAN (%d slots to %ld slots)\n", lm_ents, KMSANORIGPML4I - LMSPML4I); @@ -2615,8 +2621,7 @@ pmap_init(void) lm_ents, (u_long)lm_ents * (NBPML4 / 1024 / 1024 / 1024)); if (lm_ents != 0) { large_vmem = vmem_create("large", kva_layout.lm_low, - (vmem_size_t)kva_layout.lm_high - kva_layout.lm_low, - PAGE_SIZE, 0, M_WAITOK); + (vmem_size_t)lm_ents * NBPML4, PAGE_SIZE, 0, M_WAITOK); if (large_vmem == NULL) { printf("pmap: cannot create large map\n"); lm_ents = 0; From nobody Sun Jul 20 00:26:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl47s4ZmQz62XHB; Sun, 20 Jul 2025 00:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl47s0ZvGz3XWS; Sun, 20 Jul 2025 00:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7l0Tt+IjVJaAv2r+XeLVd+kN2IV6su7qgVQb4hTGJ3k=; b=yZfXwh60QB2oKulQTHOS3Ix/39U9yaAOyZDIw00W6qldi1v5/ps9h1Wv/i4kQK2RpYY0/I sBzCzxPaEiy2Oy6Zypp0qsS4q3Og771G7Hy9uTxhgLoz46MllMcM6iI3pNVY2m8p2KRpSG rDNeDM54ny5p0AsEmiIOEUo04voOK+17rmU7dly36RJK7dT7zB7g4beYOhUXYfQeydnSyp 7mu0UAFLFxtexqmaoOXCqvYATnnFDB3/bfYJ6rdg0F6GLgClD8+KwjQJDMDlgBYQMFlJWB RlsTAWtaUYM5tWWfh0Sp/NaqB05OXBpKe5+TJRxw23dZSvnhIfTWmLdMyaH3sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7l0Tt+IjVJaAv2r+XeLVd+kN2IV6su7qgVQb4hTGJ3k=; b=tB43AHyyqnxrDsQeRx7/jADxomXOeN0IKTaoNLkTSCeXBZa6vf86cb3TObYdKXMlc92xc7 8zpnI52Gvvg2GLffMMiIwtS/RtEfkp+/Bu9Sonfjlr0yTwK9UlU0tGL7swWy1F4p7ClvXX cIOaMtWj23LMlYFMASbWOOvigfykpCRZ8S7UofayIZDG5NzSqj+A1tnBrCbl6pkw144yGq cxM/Curelw7hYa1ZuIPllWe3qocyL+iyZSozL0AjkRBQJWTDTHwGaR3JXV9Adi5oIXzmrF LWueYgZ3uwOq6m40AfrNaBEv9rnZe+KQoQdd43e4KFKCDJZnCVtWTeeSWRX16Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752971161; a=rsa-sha256; cv=none; b=WSHE5qcYRzGN835J1pM/WTfe2TovYlpDWfBVd/cunkYBOfK0eQLEoxmaOrVqnqB3op0WFA jSj4+UoJ33x0dnyiu4vjPwFNcHVcEus8iPmv1kE4qQXQsOit1VBnA1Os31cRasdnG5lC7e MPQD4OyqN3SQL7WuCaFiXHNKnzbMbT77B38AhHaJjf9NdVLXtx852DPzuWHYeaEv7NLLcH mr/X+Ew13eQ4yMxsEKuLmlqB40BIa6HwZ3zoQ1p2icN3P7aX2QASJXnhDAacoAQma4LqQT aLyYm5N+Q4QtWSi2Ye2OxeMUpJOOnWjnQ/sWaGOgWT89KsiMswBufDzxWTmG/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl47s02Nkzq6P; Sun, 20 Jul 2025 00:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56K0Q03S093398; Sun, 20 Jul 2025 00:26:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56K0Q0WG093395; Sun, 20 Jul 2025 00:26:00 GMT (envelope-from git) Date: Sun, 20 Jul 2025 00:26:00 GMT Message-Id: <202507200026.56K0Q0WG093395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 31afa16f92df - main - amd64 pmap: for LA57 move large map out of kernel pml4 slot List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31afa16f92df9ed2cee96b8ee56449ea60a9ccf1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=31afa16f92df9ed2cee96b8ee56449ea60a9ccf1 commit 31afa16f92df9ed2cee96b8ee56449ea60a9ccf1 Author: Konstantin Belousov AuthorDate: 2025-07-16 23:55:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-20 00:25:45 +0000 amd64 pmap: for LA57 move large map out of kernel pml4 slot and allow it to consume up to 32 pml5 slots (32 x 2048 TB), same as DMAP. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51364 --- sys/amd64/amd64/pmap.c | 42 ++++++++++++++++++++++++++++++------------ sys/amd64/include/pmap.h | 7 ++++++- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index a7d17db19a3e..0850b326bc3a 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -497,8 +497,8 @@ struct kva_layout_s kva_layout_la57 = { .kva_min = KV5ADDR(NPML5EPG / 2, 0, 0, 0, 0), /* == rec_pt */ .dmap_low = KV5ADDR(DMPML5I, 0, 0, 0, 0), .dmap_high = KV5ADDR(DMPML5I + NDMPML5E, 0, 0, 0, 0), - .lm_low = KV4ADDR(LMSPML4I, 0, 0, 0), - .lm_high = KV4ADDR(LMEPML4I + 1, 0, 0, 0), + .lm_low = KV5ADDR(LMSPML5I, 0, 0, 0, 0), + .lm_high = KV5ADDR(LMEPML5I + 1, 0, 0, 0, 0), .km_low = KV4ADDR(KPML4BASE, 0, 0, 0), .km_high = KV4ADDR(KPML4BASE + NKPML4E - 1, NPDPEPG - 1, NPDEPG - 1, NPTEPG - 1), @@ -2626,6 +2626,15 @@ pmap_init(void) printf("pmap: cannot create large map\n"); lm_ents = 0; } + if (la57) { + for (i = 0; i < howmany((vm_offset_t)NBPML4 * + lm_ents, NBPML5); i++) { + m = pmap_large_map_getptp_unlocked(); + kernel_pmap->pm_pmltop[LMSPML5I + i] = X86_PG_V | + X86_PG_RW | X86_PG_A | X86_PG_M | + pg_nx | VM_PAGE_TO_PHYS(m); + } + } for (i = 0; i < lm_ents; i++) { m = pmap_large_map_getptp_unlocked(); pml4e = pmap_pml4e(kernel_pmap, kva_layout.lm_low + @@ -10768,19 +10777,28 @@ pmap_large_map_getptp(void) static pdp_entry_t * pmap_large_map_pdpe(vm_offset_t va) { + pml4_entry_t *pm4; vm_pindex_t pml4_idx; vm_paddr_t mphys; - pml4_idx = pmap_pml4e_index(va); - KASSERT(LMSPML4I <= pml4_idx && pml4_idx < LMSPML4I + lm_ents, - ("pmap_large_map_pdpe: va %#jx out of range idx %#jx LMSPML4I " - "%#jx lm_ents %d", - (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); - KASSERT((kernel_pml4[pml4_idx] & X86_PG_V) != 0, - ("pmap_large_map_pdpe: invalid pml4 for va %#jx idx %#jx " - "LMSPML4I %#jx lm_ents %d", - (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); - mphys = kernel_pml4[pml4_idx] & PG_FRAME; + KASSERT(va >= kva_layout.lm_low && va < kva_layout.lm_low + + (vm_offset_t)NBPML4 * lm_ents, ("va %#lx not in large map", va)); + if (la57) { + pm4 = pmap_pml4e(kernel_pmap, va); + mphys = *pm4 & PG_FRAME; + } else { + pml4_idx = pmap_pml4e_index(va); + + KASSERT(LMSPML4I <= pml4_idx && pml4_idx < LMSPML4I + lm_ents, + ("pmap_large_map_pdpe: va %#jx out of range idx %#jx " + "LMSPML4I %#jx lm_ents %d", + (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); + KASSERT((kernel_pml4[pml4_idx] & X86_PG_V) != 0, + ("pmap_large_map_pdpe: invalid pml4 for va %#jx idx %#jx " + "LMSPML4I %#jx lm_ents %d", + (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); + mphys = kernel_pml4[pml4_idx] & PG_FRAME; + } return ((pdp_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pdpe_index(va)); } diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 08e96027a5ed..a0ca97f2d5a0 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -202,9 +202,14 @@ #define KMSANSHADPML4I (KPML4BASE - NKMSANSHADPML4E) #define KMSANORIGPML4I (DMPML4I - NKMSANORIGPML4E) -/* Large map: index of the first and max last pml4 entry */ +/* + * Large map: index of the first and max last pml4/la48 and pml5/la57 + * entry. + */ #define LMSPML4I (PML4PML4I + 1) #define LMEPML4I (KASANPML4I - 1) +#define LMSPML5I (DMPML5I + NDMPML5E) +#define LMEPML5I (LMSPML5I + 32 - 1) /* 32 slots for large map */ /* * XXX doesn't really belong here I guess... From nobody Sun Jul 20 00:26:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl47t5NSxz62XV7; Sun, 20 Jul 2025 00:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl47t1frbz3Xhs; Sun, 20 Jul 2025 00:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmQ/ZTkmIQ0ZHsCyOybQWC/xYu/wpcptvPK9sSHs7pU=; b=SKiB7eUsgc3i66jhc0tCwX8tGm66VEpDDSW8fd9ne4SLTvDsU5At2QlJ0k4ZqkucRpsWba TluBoLk/1UH22yCq87i7ZUVAP0zAR48evZu5XsBzm73wzEz4eU0qre5mFDR55yihbJnhCS K/8D1VDhGYeipV6EzofSKD6GSXmhmXPllT4LZOBCwoEezOP++rEIhcsWhg31uAb1zBJAy1 aGGYHGVPjIsVEvCNqhsXnJHSEz6C9M2VB+NdhNz/+agZtv5yEHQpxYp03aRf/RKNLcrhHb s1DmNjIXdDHpZjefUv2mbyjrsbr6f/n+Qp9hlB5snQSDQ0m+BxKvL+HOinwKrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmQ/ZTkmIQ0ZHsCyOybQWC/xYu/wpcptvPK9sSHs7pU=; b=urkGFATUAEUt0cqW1IYoV0KD69Lle4AQfQ0lCFX2vo8o1QIgFTUgAGA7smkvYS4q8uygIQ TyMobFfJ2U/EPW5s1Dn5xRHowdmiJrYlSMjaOafg7QtbVX9AwKjR9ljuKd+LSHkW5lgr3u yNVddDClm2jdopph89ljpPNiIG6KhozZgSJJb42Rs1YeRdOKYA2HJyIn+jEJ0XkVzrOqbY +spuLoGraTlSdFPiR6gwFomYOE3eLYi3tl4VYfKeWTni8gA+ADzqTCRFC6FMeZHaVZgplf BLKuMHhj2mf/O3hU6SsjOEIR6pcPMmPFmncA/l6kI6nEpB1btQf8pHxfjZdDZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752971162; a=rsa-sha256; cv=none; b=yVJLKDwkTD853+oh1bYNj259dy+VXSt+JqFLXaSZwMg5QozwfwbvgVn7RrRF8kpkaulYG4 uIDR0sRt8BYjU/9m/brNLis8v0Q9YsP6gKFMYsM17skEoMTQqTHY9bms9co5bWLqDc7Dyq uOLc3wsZOr9YziGVet/Uyo805n6RAIK8+nbDrR8kE65jV9vxp45hcEheQJ2RCZhXB4uHWV 1QpK8XCNO0g56W5WIAgq7qTK5D/T5x+SuKjWrcHk+/OnO3gy4FL5mLP2Ws8i/Y2hQkLGk3 IwRQIFIuVKDpI4eC+64SViYBJSKOc5+syBWp9UuSZpP59/dXuaETw5/unu8+Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl47t0yz9zq33; Sun, 20 Jul 2025 00:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56K0Q2Yu093436; Sun, 20 Jul 2025 00:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56K0Q2RO093433; Sun, 20 Jul 2025 00:26:02 GMT (envelope-from git) Date: Sun, 20 Jul 2025 00:26:02 GMT Message-Id: <202507200026.56K0Q2RO093433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 059d0584d382 - main - amd64 vmparam.h: update KVA map List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 059d0584d382db1650230029327073073cf55c05 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=059d0584d382db1650230029327073073cf55c05 commit 059d0584d382db1650230029327073073cf55c05 Author: Konstantin Belousov AuthorDate: 2025-07-17 00:12:38 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-20 00:25:45 +0000 amd64 vmparam.h: update KVA map Also designate the start address of the kernel pml4 entry. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51364 --- sys/amd64/include/vmparam.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index e4cc05cbb889..ef352e776af6 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -181,9 +181,9 @@ * 0x0100000000000000 - 0xf0ffffffffffffff does not exist (hole) * 0xff00000000000000 - 0xff00ffffffffffff recursive page table (2048TB slot) * 0xff01000000000000 - 0xff20ffffffffffff direct map (32 x 2048TB slots) - * 0xff21000000000000 - 0xffff807fffffffff unused - * 0xffff808000000000 - 0xffff847fffffffff large map (can be tuned up) - * 0xffff848000000000 - 0xfffff77fffffffff unused (large map extends there) + * 0xff21000000000000 - 0xff40ffffffffffff large map + * 0xff41000000000000 - 0xffff7fffffffffff unused + * 0xffff800000000000 - 0xfffff5ffffffffff unused (start of kernel pml4 entry) * 0xfffff60000000000 - 0xfffff7ffffffffff 2TB KMSAN origin map, optional * 0xfffff78000000000 - 0xfffff7bfffffffff 512GB KASAN shadow map, optional * 0xfffff80000000000 - 0xfffffbffffffffff 4TB unused From nobody Sun Jul 20 00:26:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl47w1pMtz62XVB; Sun, 20 Jul 2025 00:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl47v2PKVz3XnS; Sun, 20 Jul 2025 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CowpEy4nqTRosXz4Y9Ajr0eX2IN/2j5UBGM3/iB4e2A=; b=LoVq0jbEVtV2WmkJ5rtLlIEkOD3F8kw3RbnIKOfOzjemKx9eU8fmv0jMWUA+viuNj5xvZf vOu+TXTfDbP+kuU5xGPDtWgF4Jd5S49TZQRxK3jdD/fEKLG2PqY9mnOE8UNcO3Ek7889N4 OhfxcQ2QrhAUb2sNYaUPZdP01MKPXTSOdiVH01aZSqPKR2PAtifiJy6CujvfEtDXciqcL9 WVS/rm/gtuikgKeaQFII1nweabWo3sqEmgRlM7qVbKM/MZ9w9Qfd1Bc2p9JrOi+2olpinl BzKXlfl2qGmrES4utaZXGtqEC7cHYebGnBRou2dwe3I41vD3BZou8UfHkXrM9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752971163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CowpEy4nqTRosXz4Y9Ajr0eX2IN/2j5UBGM3/iB4e2A=; b=YPAIiRa8mnuebkKICRlbq2WJ95ln2Ib2G6RD+0m7VcA4DkncbW+A9wW9JIjepADNM1vRjF Zt56o+GK3TgXZtuoHSJ5m7n9crgUo0PGOvK5BCX9xSUIH1sJlZxpIUI8e1WmPUAf/bzLqe IiRtGkwHrwKVJ5YuNHSH7cyQOXjvciOPVXS656+rt0Paf1tJBkpcGz8EIQZTkFsWAOv3IT +J0ZXkzoCujUrNqJ4rsqALl634WTeydgQzjRLefwpm6usUgLD5lFKBZ0rKdhodAQMfgeMV KscqgREa0x8h9gnda5mIx4Q1iPy3MnmaaafpaAbT5dVTXA88q6wOjrVufqdNCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752971163; a=rsa-sha256; cv=none; b=V9Ffkw+whXo3htwsuVPdG2NVxD4Tfwv1qMQtWUedxae0P9mfznHOF8/1U4YzGub1ZdFez0 thRXrCSX2Z4Pm8aIR1XLRp+6VOq9cbqvlSfxtjjt8nGioblnW0aUUOoFew7PWvaoweOacd GFfD7VMbfF6pYO0MvfNw26/WnosPr3tFyDyyJBDm3wvYkW4ZeWMF3Fkio9kvmm+lBG2toQ YyHMYTkYQ1IlkwvP6AgtRgFbaOsRVfZ2eDyQvRQytNZFiOijyRm0gyie1CZ2lu5E7m9gA8 OcqIAXJwJxhpWZgzG+51ZGCp71FFedgPoyGfIrCY912y80JwtfNkq6wDMIRPNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl47v1zQ8zqLF; Sun, 20 Jul 2025 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56K0Q3hQ093475; Sun, 20 Jul 2025 00:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56K0Q3a8093470; Sun, 20 Jul 2025 00:26:03 GMT (envelope-from git) Date: Sun, 20 Jul 2025 00:26:03 GMT Message-Id: <202507200026.56K0Q3a8093470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5f33006f8742 - main - amd64 sysctl vm.pmap.kernel_maps: do not desinformate for la57 case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f33006f87423285776aff9de0ee89cca1db0969 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5f33006f87423285776aff9de0ee89cca1db0969 commit 5f33006f87423285776aff9de0ee89cca1db0969 Author: Konstantin Belousov AuthorDate: 2025-07-18 03:58:19 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-20 00:25:45 +0000 amd64 sysctl vm.pmap.kernel_maps: do not desinformate for la57 case For !la57, direct map, large map, and recursive mapping are not in top pml4 region. Bigger change would be adding the dump of whole pml5 KVA mappings. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51364 --- sys/amd64/amd64/pmap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0850b326bc3a..51e793c7f8b6 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -12167,10 +12167,12 @@ sysctl_kmaps(SYSCTL_HANDLER_ARGS) for (sva = 0, i = pmap_pml4e_index(sva); i < NPML4EPG; i++) { switch (i) { case PML4PML4I: - sbuf_printf(sb, "\nRecursive map:\n"); + if (!la57) + sbuf_printf(sb, "\nRecursive map:\n"); break; case DMPML4I: - sbuf_printf(sb, "\nDirect map:\n"); + if (!la57) + sbuf_printf(sb, "\nDirect map:\n"); break; #ifdef KASAN case KASANPML4I: @@ -12189,7 +12191,8 @@ sysctl_kmaps(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, "\nKernel map:\n"); break; case LMSPML4I: - sbuf_printf(sb, "\nLarge map:\n"); + if (!la57) + sbuf_printf(sb, "\nLarge map:\n"); break; } From nobody Sun Jul 20 00:58:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bl4sm1qrPz62ZDg; Sun, 20 Jul 2025 00:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bl4sl6DWsz44cR; Sun, 20 Jul 2025 00:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752973131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pAxG/2PMjVk0BuXfRv4dvxF8kuZmSxWkELvypKMEwLk=; b=eznupIfCMlSAbadG54Wga8m7ES1HVVtt1qkKHh8PsrJZFJY5nrixbTUmIZoco/6robeF8P PGA1+SfMnxNsceWPQ+S1N16oJk6Osf1fgSy5v08U0vu1lXvp2WUEzfk0o5htfHYMmm6c1M qAPzptZAKFNvJKT1WhzbSOD7RWcStyM3RKiQAkSX4NKTspO+Ah4z9gG1TwoBd2khTPZG9v RS8EIJufOofYh15IeekRbvRemp7UWO8UW143aJqXc2MJPZqbS7qsM7QqEeyJuYr26CGQnd VlSWhyTqoYbetKAUlZYjzGEVe4jUyGDnkghi4QErS7pPpXL4PkZAovMEsnhX3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752973131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pAxG/2PMjVk0BuXfRv4dvxF8kuZmSxWkELvypKMEwLk=; b=A6DB2uYSXQk7IDijHiDtmLNt3+QoAx1BJUAbfsh3gCbyVpIUOqcxm0ZVD8iuVNkUNk8N7/ kR6s61Fme2VyJRMG2G42kFgNZMz9y9n2zxpcXZwq0pZL96LG4NWJMBwIqY3ZHNtcjpHv8J vN04NinjsFxdP92Gf0m3U/uRH543Mqs/GcQInuSE0NSKLfizEN+EbHQdaFcHH7Kf4Lse+F tefos/DXkosuoCwPwxxF7l0uVL/QeR4hEwMLdvSnzhqc/BheE4gLqfoKTvMqcFSxy7vQWB dpbbPn32WZAxs4IhPkaZ7uyMCu8+KrjFmkWhuFYeBl2EaIMzivKmk2q/9zRRNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752973131; a=rsa-sha256; cv=none; b=uTbGdB4a2KKZDMMmrj5Ve1GdCqHny4Fi1KQtMHhXC7icBdc68kMBCextnYfMKryI8PUqpy X93Abug+ipRtIWaz9/e8UDM3qscptaEJ2ue/Y1wdFNcSXi0lTNlN00/7vpKT74EHfO6d7M XdXVX+dV35Ring+GkzTmZxz9PFOhYLQBobaGcoBLio1ZghLUzSAGncJdbE0/LYs1mi3HLD 7mQEn8+TnvsOFZRYc/g4VxLIDY8AD7DnleBDaTO4boWwZrziAQNkWvPm3/TJ1ltyWFyGLs RiQhQOIhwtSYi/aWnpx0wBp+ht+3Y2CRN0PowHH+6w9po8orR/1LMvtTp6Te7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bl4sl5TDRzqcm; Sun, 20 Jul 2025 00:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56K0wpGd050544; Sun, 20 Jul 2025 00:58:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56K0wp4w050541; Sun, 20 Jul 2025 00:58:51 GMT (envelope-from git) Date: Sun, 20 Jul 2025 00:58:51 GMT Message-Id: <202507200058.56K0wp4w050541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 71901e4915a9 - main - amd64 pmap: restore the name for pml4 local in pmap_large_map_pdpe() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71901e4915a948f0da815761b8ca4e5ee27bf045 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=71901e4915a948f0da815761b8ca4e5ee27bf045 commit 71901e4915a948f0da815761b8ca4e5ee27bf045 Author: Konstantin Belousov AuthorDate: 2025-07-20 00:52:10 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-20 00:58:32 +0000 amd64 pmap: restore the name for pml4 local in pmap_large_map_pdpe() This was suggested by alc but not committed. Fixes: 31afa16f92df9ed2cee96b8ee56449ea60a9ccf1 Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/pmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 51e793c7f8b6..b2bfe633adcc 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -10777,15 +10777,15 @@ pmap_large_map_getptp(void) static pdp_entry_t * pmap_large_map_pdpe(vm_offset_t va) { - pml4_entry_t *pm4; + pml4_entry_t *pml4; vm_pindex_t pml4_idx; vm_paddr_t mphys; KASSERT(va >= kva_layout.lm_low && va < kva_layout.lm_low + (vm_offset_t)NBPML4 * lm_ents, ("va %#lx not in large map", va)); if (la57) { - pm4 = pmap_pml4e(kernel_pmap, va); - mphys = *pm4 & PG_FRAME; + pml4 = pmap_pml4e(kernel_pmap, va); + mphys = *pml4 & PG_FRAME; } else { pml4_idx = pmap_pml4e_index(va); From nobody Sun Jul 20 10:38:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blKkC6MkFz61w3Q; Sun, 20 Jul 2025 10:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blKkC5TLNz3gtF; Sun, 20 Jul 2025 10:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753007891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s4eQ6BnUXo9pfYPdVxf5vXlPbKVgLUmtIhUZRO6Pn4I=; b=qk5I5nPdzr70qiNGiCejG0fPcvP0zp9nqN+46L+lgHSgTgi+q+iWnI86FC0RotlP0VKuY9 Xh8E8JN1aOcoUGLahmbyxGlDdtJz5jf1YEmS3NjZadx964tFAS9p3gTvveytmbIIibEkJV DAMMZ2HlBnhn9ugIGn6V/J2+qtcUfDNp2dNcCBMU/k0ffjFSzBNT29AFBwOpJW786BVKd6 eCbteZC9jPBJbspJyhWGHvLjpmd9F/TPIzERBMvC5fb7+AePCeZjL9Vu3pB4X0ouKz9q2a ohCiO1xbGznPBD5CecWPge2knCP2rsag/xUI8El/4WPFTumWEvPAimOmLvDtIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753007891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s4eQ6BnUXo9pfYPdVxf5vXlPbKVgLUmtIhUZRO6Pn4I=; b=xf1WnnbQYNjz5VnUaJJ3WYfe1ax8mO9ywK9Dpl1n5sCRl26ja0ymOewa8lnNN6S2aMiV6m 4/JkHpMkKgpX6DzN1KUh2AGQAlR5SfP9b3icvhTrSwVK25lPuxfIxTtFbV3V+6Qk73wwjj pHEDcraNmXtB97KKASoYyB4BYAs8wHuZFof5bLnfpQkDRMrreRte+345QEwFWQA2v9wWwW hNOakOAmtR9Dd8/JO8Qeup9OlFPZFCeuN9/0gjogsgVY91LiiZ/KT8YQs9xd6Oe6Q/AL5a tdAjI0IodpAcn2OlTOzxwXbZUAvZwFNrd9QfvivMTszSyTCuRvOmb+nHQIY1jQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753007891; a=rsa-sha256; cv=none; b=lx1cEwrkWEG1KXZ2uNPtu5Qyileke8KVsHj57bWcPz3x5spL6EqairDCsbM5VEtFPo7DV0 ukczsJbvth8obUPu05Wj1bIcZq698sECC7Tt9sug/P0NG2n/Nj1iEoBNr4EpStlbZ+eHph VGNJ0X1H1dtuH2jMzeaFdVBUOa3v87mh0zDhX0rhk7o5C8Ahkm09hceJq80AtCeF3eh83b WUZ8vIsVH7ALO/4JRFUnRJoFcfQwErBmY8SyIAcdJKaFtOrIVHdOvfg9jTSpaFdU7SfnOM UMrTPUUwH+pSpb9o0Nz0XBgEJp8Sw24hiPMpgmIJTJsrtPrfLHnpnZAknvcc1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blKkC4r4xz17V4; Sun, 20 Jul 2025 10:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KAcBP3042812; Sun, 20 Jul 2025 10:38:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KAcBDh042809; Sun, 20 Jul 2025 10:38:11 GMT (envelope-from git) Date: Sun, 20 Jul 2025 10:38:11 GMT Message-Id: <202507201038.56KAcBDh042809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 5d5848648013 - main - trim(8): minor output correction List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d5848648013a189fc766e4ee3a121362905b836 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=5d5848648013a189fc766e4ee3a121362905b836 commit 5d5848648013a189fc766e4ee3a121362905b836 Author: Eugene Grosbein AuthorDate: 2025-07-20 10:36:33 +0000 Commit: Eugene Grosbein CommitDate: 2025-07-20 10:36:33 +0000 trim(8): minor output correction "trim /dev/da*" would print the following line multiple times when given multiple agruments: dry run: add -f to actually perform the operation Print it once before looping over arguments. Also, note possible suffixes P and E after offset/length as per expand_number(3). --- usr.sbin/trim/trim.8 | 18 ++++++++++-------- usr.sbin/trim/trim.c | 11 ++++++----- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/usr.sbin/trim/trim.8 b/usr.sbin/trim/trim.8 index 1ac10d7e3d46..a4874c54c183 100644 --- a/usr.sbin/trim/trim.8 +++ b/usr.sbin/trim/trim.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 18, 2019 +.Dd July 20, 2025 .Dt TRIM 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Bk -words .Sm off .Ar offset -.Op Cm K | k | M | m | G | g | T | t ] +.Op Cm K | k | M | m | G | g | T | t | P | p | E | e ] .Sm on .Xc .Ek @@ -68,13 +68,13 @@ Overrides .It Fl l Xo .Sm off .Ar offset -.Op Cm K | k | M | m | G | g | T | t +.Op Cm K | k | M | m | G | g | T | t | P | p | E | e .Sm on .Xc .It Fl o Xo .Sm off .Ar offset -.Op Cm K | k | M | m | G | g | T | t +.Op Cm K | k | M | m | G | g | T | t | P | p | E | e .Sm on .Xc Specify the length @@ -88,12 +88,14 @@ unless one or both of these options are presented. The argument may be suffixed with one of .Cm K , .Cm M , -.Cm G +.Cm G , +.Cm T , +.Cm P or -.Cm T +.Cm E (either upper or lower case) to indicate a multiple of -Kilobytes, Megabytes, Gigabytes or Terabytes -respectively. +Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or +Exabytes, respectively. .It Fl q Do not output anything except of possible error messages (quiet mode). Overrides diff --git a/usr.sbin/trim/trim.c b/usr.sbin/trim/trim.c index 3e187faa0fb3..582dc095d642 100644 --- a/usr.sbin/trim/trim.c +++ b/usr.sbin/trim/trim.c @@ -114,7 +114,7 @@ main(int argc, char **argv) * * trim -f -- /dev/da0 -r rfile */ - + if (strcmp(argv[optind-1], "--") != 0) { for (ch = optind; ch < argc; ch++) if (argv[ch][0] == '-') @@ -127,6 +127,9 @@ main(int argc, char **argv) if (argc < 1) usage(name); + if (dryrun) + printf("dry run: add -f to actually perform the operation\n"); + while ((fname = *argv++) != NULL) if (trim(fname, offset, length, dryrun, verbose) < 0) error++; @@ -213,10 +216,8 @@ trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose) printf("trim %s offset %ju length %ju\n", path, (uintmax_t)offset, (uintmax_t)length); - if (dryrun) { - printf("dry run: add -f to actually perform the operation\n"); + if (dryrun) return (0); - } fd = opendev(path, O_RDWR | O_DIRECT); arg[0] = offset; @@ -237,7 +238,7 @@ static void usage(const char *name) { (void)fprintf(stderr, - "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t]] [-r rfile] [-Nfqv] device ...\n", + "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t|Pt|Ee]] [-r rfile] [-Nfqv] device ...\n", name); exit(EX_USAGE); } From nobody Sun Jul 20 10:43:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blKqw5jqPz61wc1; Sun, 20 Jul 2025 10:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blKqw3t3kz3mH3; Sun, 20 Jul 2025 10:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753008188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXmipyk4IEXmNdNIxh+D313vu93DkP9i6rFU/iwTs9w=; b=QK+hsl+J15rOwxh7Na95MARz5wIIoLuCMOU1O7Rx+Mr4+37SPEhzkXFHTH1kW+FBkTai+R ztEIVMLwSZKPkfBVAwHKIQD+vCAEiTOtjy7xP1Z2WqiQJ6MCQrhMEhqX3pnKOx/zP9+PB3 S99hM/XiunxYob469PDYnsxvqZBGLhc5N0SLqUeOAmj5RH32Bw14ZN5ux+5vlt48T0gkBM WduGw8ivDoZ00deexNeIBhWVbagkkrI7kuCM6a5SG5TNLOshU/oD4nAaFet3P+/p0Bip4o zTyZqvmnbNZi2bHn1J8zPplzBFX7LE8wR8WszPDr/egK75lxIyhTQNq1bzsviQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753008188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXmipyk4IEXmNdNIxh+D313vu93DkP9i6rFU/iwTs9w=; b=ObszMoFeOalF8vD6ySa984BgBy+8AomCyjJ74QVlgUDlJKqLqqAsxGJSuzFAQzNTHSYz6f esOH0LeVgbtm+ln/bcKbXQlZXv14RqZV45jofges1uSuZrfTD0RkRQa3AxSAZH0T//5MjP IGKZ/gqtiGvKZ7do8cy73ld9w5MrVKREICYey1s+O6KY3VRRv7+SSFSaUHm8lRlcPnSXcl r/CQuV6RCLCJuxLgPdJElMwhLfeJzG1uu5gqjAUVZNj9FOCkg3HsdIRDLEjT/hkJ86WRA/ h46q+tqbPal+BklFoNEuS2InSIqrVSIlzgKx7RM6O4VkPtfbd1qxmOI5Z79TZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753008188; a=rsa-sha256; cv=none; b=CCgsS9KIYJfhppX/Kx/O+qSkCnOW47kM59KB3sRCnsPPyEtXuvD9ImC9gVeBCVG6MkKfe0 uyNeAMrqycrx/j2CCOHvpQCwPoDt1kHD/Iow9yV/PvEs00wGVPZgthAe7XD8MGo3nmtvjF e6r+RLlLU5PTSFgw0GYjG+ljjcAwdRP+fK3gCxPSfff/B0wcjytgcC47s6t7etWuHdV9Ui qvHEQK/p1y4pP5FOlnTbfeDaaKdhYoGxSsy1lJKXsa7Y8FxX0oaBvuGz89FSTzbJlBrd3l 30+H+QjWoinGsS7fWVJyuExb9HMWXJYixZLtIrC4aPDCGd+0Gkq7f/wvYA/lTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blKqw3KjSz185G; Sun, 20 Jul 2025 10:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KAh85B060552; Sun, 20 Jul 2025 10:43:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KAh8eE060549; Sun, 20 Jul 2025 10:43:08 GMT (envelope-from git) Date: Sun, 20 Jul 2025 10:43:08 GMT Message-Id: <202507201043.56KAh8eE060549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: f1b934c8138c - main - trim(8): fix usage line List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1b934c8138cfd98a70e305d54b2b431c842ec21 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=f1b934c8138cfd98a70e305d54b2b431c842ec21 commit f1b934c8138cfd98a70e305d54b2b431c842ec21 Author: Eugene Grosbein AuthorDate: 2025-07-20 10:42:27 +0000 Commit: Eugene Grosbein CommitDate: 2025-07-20 10:42:27 +0000 trim(8): fix usage line Fix usage line after previous change. --- usr.sbin/trim/trim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/trim/trim.c b/usr.sbin/trim/trim.c index 582dc095d642..27f57ac2fb72 100644 --- a/usr.sbin/trim/trim.c +++ b/usr.sbin/trim/trim.c @@ -238,7 +238,7 @@ static void usage(const char *name) { (void)fprintf(stderr, - "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t|Pt|Ee]] [-r rfile] [-Nfqv] device ...\n", + "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t|P|p|E|e]] [-r rfile] [-Nfqv] device ...\n", name); exit(EX_USAGE); } From nobody Sun Jul 20 11:11:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blLSR6k8zz61yKs; Sun, 20 Jul 2025 11:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blLSR3fC5z49w9; Sun, 20 Jul 2025 11:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753009879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6CU/HtisAuD9EjhVA/Vtp9PhqX3cNm6ksMvSUZGDnUI=; b=u9i4IJ4ksMSx1HM+o1GsUtriK7/GzhtkAcaCpq3Y/sITAASfoUELm1eA9FsBF7kgUZJSWy sFdPq6Vd2PWG6Lb6Amc1j3uI9TmCbKq9IXkC3a3CSUeIqsk+fGUmph6aSk8Sp2TVWQeiSy HQQNEfV73xZEm0i4cFyRPzddVcJLSvdXOk9nG2p7GePj+3aFf0ds24+SIc5EFxCNt37XV4 7mE+WTEte3OH425O3sGGMVlfviRuAfmi7ozGtXwbxCC3sQi1/pnbctyr9vcN/YiRCylITO B+omIsdmby/hrtLuQT0q6ePTLkiWSfklCA5vTJ3UTRcGgvOcG/gh6MDEkVVlNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753009879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6CU/HtisAuD9EjhVA/Vtp9PhqX3cNm6ksMvSUZGDnUI=; b=sq4Qdb3t3h/++ErDDUx6vnim7LNXiq79RchrEpfJmJ17AUmt9C02TzDy4LxDZoDMl0vqUa REBTvhylj5QPLG2UEtEkw+cTFUkQ4Azv4MOjmWs++Nd1rE26t9OdY6MUuoZWi+3l3k4z0B zyfa8wA+W+BMCKun1dqwHRe6G+6UmDWQfyM1WiTAtEMHgMrJ/chQ6FlaCte1QvuAQMS6f1 mKL3k6dn3ug6k5Mh5FXF5rdTqb/r6x9YRZds/VfrDcxTJfTVOFJa/TCI4mO/fld7JZEdj9 bELtmgKu30gPQy7zEZwjxYBfdxzuMs0Mw83L45aqZSe74qteLDyjZCvYnRhm6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753009879; a=rsa-sha256; cv=none; b=NT+LNlqCIk8w/bhk2y+X+7MpYf0HfxA3MBXfdj9Z9USrrC918sxjOX38Sy4FB9PIpPIH9K wQJmfGjsnsHYO33kVwWCfc0Dm3zVpy1ZdEoGfUp+fICp0cxf3YmlMIttAsQL6ENKM16sWr wyQ0KlBaTNMprb6mzyv/JsQNcfbtvFP1S5tAQ4d3gpRu5KXN0QayXYzXVe/imRSSLD+Dn3 IpFtmpcPARgq+l59yY2MrsT7WSZuKO+m21b0xYlEVCzfPNotp0VUgUB4h4gAvnLUe0TUL2 XtyZX9Q86CeO7av9hDNp3txwFxXKgfYtCHJa3MQn9/GH524w2pXbAIvzYTc0OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blLSR38Psz17mW; Sun, 20 Jul 2025 11:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KBBJ4H014254; Sun, 20 Jul 2025 11:11:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KBBJNM014242; Sun, 20 Jul 2025 11:11:19 GMT (envelope-from git) Date: Sun, 20 Jul 2025 11:11:19 GMT Message-Id: <202507201111.56KBBJNM014242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: d38b81a7eb60 - main - Cross ref sa(4) to mtio(4) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d38b81a7eb60d7cb8396448c6b9ab171ddcfb207 Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=d38b81a7eb60d7cb8396448c6b9ab171ddcfb207 commit d38b81a7eb60d7cb8396448c6b9ab171ddcfb207 Author: Poul-Henning Kamp AuthorDate: 2025-07-20 11:10:39 +0000 Commit: Poul-Henning Kamp CommitDate: 2025-07-20 11:11:09 +0000 Cross ref sa(4) to mtio(4) --- share/man/man4/sa.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/sa.4 b/share/man/man4/sa.4 index 96b11ebe5360..699a940a34d1 100644 --- a/share/man/man4/sa.4 +++ b/share/man/man4/sa.4 @@ -457,7 +457,8 @@ One EOM notification will be sent, BPEW status will be set for one position query, and then the driver state will be reset to normal. .Sh SEE ALSO .Xr mt 1 , -.Xr cam 4 +.Xr cam 4 , +.Xr mtio 4 .Sh AUTHORS .An -nosplit The From nobody Sun Jul 20 11:30:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blLtn6CXPz620KB; Sun, 20 Jul 2025 11:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blLtn4wqHz3Bnl; Sun, 20 Jul 2025 11:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753011041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rbvpg285GXO0oYa2gtFo1eYCIzpTB8+EOgzNyv92DCw=; b=sz2t3+piIuhadtNeYPJjZDr8qMaygHcLtzQmAPpQDPvrnW4whv2ciZ4LPiXuxrN0tY1ryK e+wxKnTU8ZIih++rhNTXpvxPEdAccOibv9JWoQEDCGHvDfo0v0xbcrLGX8bk3hKnR/AT9o xL2egzIpn6I9WWJg7S1DtiRPoBrUPsr3mY4N8a80T4I9G56PU67WZfVdrQ5MKx65gUkP0e KnyQsLpGNgJIbFrjQ8RQJAdIEyNui5ABNTkUcA+VTDJw00up/1t/9vdEV7zlA32VBNR5RG 2iz5oyz0ZOtEjDznWYdCTns92vBDa3jx6/V6IBSUizk3W/3xD8X9sKq6Z+ngxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753011041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rbvpg285GXO0oYa2gtFo1eYCIzpTB8+EOgzNyv92DCw=; b=TEMI519figKM3ETaevvhnQvSboWaNRl3ThII63FP4XJgs2cY7hs/uXAYwZ3x/HffRL68+0 Q+1c+l7F4kR7ehyJ7cy8ZwjUt+69bVJBy+ggp6fpNImZ89EakCQVJhFV1JE1xA611rTiZE B+VewQ42I0/MCOSB02mfP4mMhsACo6J2+/GCMnU0HQEsL9MDrR6HjcdsFnMF2I7A8FrjG6 +sEX4YeZG6vQcmDQ8kZOr8MVftPVrwyrNqI9rTfwTBtynCRV1s+H6XiShlQcHoY907BUam iI71QRXlTsruoiYvV3cmPbHRYphLWR+3R+nDIatje2/7AoydwxTLK+dvhlGQyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753011041; a=rsa-sha256; cv=none; b=QE0OuepZZhuajacR61pZQ4JYjInKG7EQVKRpmLXs2GU71bAN4HLWqb+E35u5FfDgnP+JOI SjIsJbfNIt5K73AUel1y88QGsZYvirJP/JIGvZzw9ayN/6fckHk+XshShSzgXgNtqmpp0l KxFKT/uvrNfCyih/Z8X+otgvRKQ4/158qUY7aaILca3ZNOE6F2LY8aSu7aB57A7NMv+LQw bh7/DMZTAOORT06nruiEg+2p6LIRZ93EutvvUA2M+Yndc8v+VXWHL/edszEkdtsOrHvtt3 +AS39e9jMb9iso+lpxnKL21+vf2ae67HFmg4f7xVXrPimzUsmoWR+pRDFsXsGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blLtn48YMz18qZ; Sun, 20 Jul 2025 11:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KBUfbw048317; Sun, 20 Jul 2025 11:30:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KBUfmx048314; Sun, 20 Jul 2025 11:30:41 GMT (envelope-from git) Date: Sun, 20 Jul 2025 11:30:41 GMT Message-Id: <202507201130.56KBUfmx048314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: a1fa30cea6e3 - main - tcp: remove duplicate tcp_bblogging_on checks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1fa30cea6e3bc66ba7243c69f2e5248ea3f79d5 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a1fa30cea6e3bc66ba7243c69f2e5248ea3f79d5 commit a1fa30cea6e3bc66ba7243c69f2e5248ea3f79d5 Author: Nick Banks AuthorDate: 2025-07-20 11:28:35 +0000 Commit: Michael Tuexen CommitDate: 2025-07-20 11:28:35 +0000 tcp: remove duplicate tcp_bblogging_on checks Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_hpts.c | 71 +++++++++++++++++++++++------------------------ sys/netinet/tcp_log_buf.c | 2 +- sys/netinet/tcp_log_buf.h | 8 +++--- 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 91f8251589e4..3b92a3d08f51 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -433,38 +433,40 @@ static void tcp_hpts_log(struct tcp_hpts_entry *hpts, struct tcpcb *tp, struct timeval *tv, int slots_to_run, int idx, bool from_callout) { - union tcp_log_stackspecific log; - /* - * Unused logs are - * 64 bit - delRate, rttProp, bw_inuse - * 16 bit - cwnd_gain - * 8 bit - bbr_state, bbr_substate, inhpts; - */ - memset(&log, 0, sizeof(log)); - log.u_bbr.flex1 = hpts->p_nxt_slot; - log.u_bbr.flex2 = hpts->p_cur_slot; - log.u_bbr.flex3 = hpts->p_prev_slot; - log.u_bbr.flex4 = idx; - log.u_bbr.flex5 = hpts->p_curtick; - log.u_bbr.flex6 = hpts->p_on_queue_cnt; - log.u_bbr.flex7 = hpts->p_cpu; - log.u_bbr.flex8 = (uint8_t)from_callout; - log.u_bbr.inflight = slots_to_run; - log.u_bbr.applimited = hpts->overidden_sleep; - log.u_bbr.delivered = hpts->saved_curtick; - log.u_bbr.timeStamp = tcp_tv_to_usectick(tv); - log.u_bbr.epoch = hpts->saved_curslot; - log.u_bbr.lt_epoch = hpts->saved_prev_slot; - log.u_bbr.pkts_out = hpts->p_delayed_by; - log.u_bbr.lost = hpts->p_hpts_sleep_time; - log.u_bbr.pacing_gain = hpts->p_cpu; - log.u_bbr.pkt_epoch = hpts->p_runningslot; - log.u_bbr.use_lt_bw = 1; - TCP_LOG_EVENTP(tp, NULL, - &tptosocket(tp)->so_rcv, - &tptosocket(tp)->so_snd, - BBR_LOG_HPTSDIAG, 0, - 0, &log, false, tv); + if (hpts_does_tp_logging && tcp_bblogging_on(tp)) { + union tcp_log_stackspecific log; + /* + * Unused logs are + * 64 bit - delRate, rttProp, bw_inuse + * 16 bit - cwnd_gain + * 8 bit - bbr_state, bbr_substate, inhpts; + */ + memset(&log, 0, sizeof(log)); + log.u_bbr.flex1 = hpts->p_nxt_slot; + log.u_bbr.flex2 = hpts->p_cur_slot; + log.u_bbr.flex3 = hpts->p_prev_slot; + log.u_bbr.flex4 = idx; + log.u_bbr.flex5 = hpts->p_curtick; + log.u_bbr.flex6 = hpts->p_on_queue_cnt; + log.u_bbr.flex7 = hpts->p_cpu; + log.u_bbr.flex8 = (uint8_t)from_callout; + log.u_bbr.inflight = slots_to_run; + log.u_bbr.applimited = hpts->overidden_sleep; + log.u_bbr.delivered = hpts->saved_curtick; + log.u_bbr.timeStamp = tcp_tv_to_usectick(tv); + log.u_bbr.epoch = hpts->saved_curslot; + log.u_bbr.lt_epoch = hpts->saved_prev_slot; + log.u_bbr.pkts_out = hpts->p_delayed_by; + log.u_bbr.lost = hpts->p_hpts_sleep_time; + log.u_bbr.pacing_gain = hpts->p_cpu; + log.u_bbr.pkt_epoch = hpts->p_runningslot; + log.u_bbr.use_lt_bw = 1; + TCP_LOG_EVENTP(tp, NULL, + &tptosocket(tp)->so_rcv, + &tptosocket(tp)->so_snd, + BBR_LOG_HPTSDIAG, 0, + 0, &log, false, tv); + } } static void @@ -1353,10 +1355,7 @@ again: } CURVNET_SET(inp->inp_vnet); /* Lets do any logging that we might want to */ - if (hpts_does_tp_logging && tcp_bblogging_on(tp)) { - tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, - from_callout); - } + tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); if (tp->t_fb_ptr != NULL) { kern_prefetch(tp->t_fb_ptr, &did_prefetch); diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index 75d693bc019b..e24790ece43d 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -2878,7 +2878,7 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) /* double check log state now that we have the lock */ if (inp->inp_flags & INP_DROPPED) goto done; - if (tp->_t_logstate != TCP_LOG_STATE_OFF) { + if (tcp_bblogging_on(tp)) { struct timeval tv; tcp_log_eventspecific_t log; diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index fef32e16b2e4..3e7eef8a1cda 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -539,12 +539,12 @@ struct tcpcb; NULL, NULL, 0, NULL); \ } while (0) #endif /* TCP_LOG_FORCEVERBOSE */ +/* Assumes/requires the caller has already checked tcp_bblogging_on(tp). */ #define TCP_LOG_EVENTP(tp, th, rxbuf, txbuf, eventid, errornum, len, stackinfo, th_hostorder, tv) \ do { \ - if (tcp_bblogging_on(tp)) \ - tcp_log_event(tp, th, rxbuf, txbuf, eventid, \ - errornum, len, stackinfo, th_hostorder, \ - NULL, NULL, 0, tv); \ + KASSERT(tcp_bblogging_on(tp), ("bblogging is off")); \ + tcp_log_event(tp, th, rxbuf, txbuf, eventid, errornum, len, \ + stackinfo, th_hostorder, NULL, NULL, 0, tv); \ } while (0) #ifdef TCP_BLACKBOX From nobody Sun Jul 20 12:35:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blNKR4fD1z623Zy; Sun, 20 Jul 2025 12:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blNKR1bC1z43jk; Sun, 20 Jul 2025 12:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753014923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xaf3GIl/f8wkLdHheGPkN0rdLiM+yu8Jv9s7rM8Aai4=; b=ZYXN2VfckAGJ7iPDUq5k4FWIdHjWLyDDShjE9b8ftFfF2nHXuIM7gazwEyRK4XvvWNdt5t H3VVsr3HhQA5TN9eo8ntl31ASUJklZH+Gx9T4iHJUqGA6AdesWw7BP/ksAq85KlaQ/Hpqb U4PM9Xgc14vhh6JIoFpUZ4C0TXr6aY9zuxEL99EYqXCzlaYljrtTQyNWV+suixXYINz8zb bQpV+CAJl0Gs/Yn3rE87xF0cXJJq2kTTElUqYG9Jhgwm+uUu8DVt90OzehSXNVuIKJsPB9 2WmwgSF6cjAZXIPm0hn/r+lJ1Fx2XVqE+icEhqjQ6q65WJhoa88GE7CeZvBVLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753014923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xaf3GIl/f8wkLdHheGPkN0rdLiM+yu8Jv9s7rM8Aai4=; b=EF+iox+9oWPZgwL1Fc0xDrjrCzCHLBD/G0CgP/xVTC3N/QHJY8meWhnJsB0ta+CeIewTsU QtJAzWanlV8ba65RVegqiAoAaqRavPcq3IcjhWu8pe4FBK029mI4pYG4Li9RsjFqP7Fx93 WbMbUwN4yBkgtpRX6YUwskDLMa+KnQNXWi93WDCq7ySODV9fStaJtsAHGaPo0cep+rl8F3 JowriDf2bOMFE1p7IyQiu+N26kxAMYCfwSrrZRWccE19FKSEFFZi0rDqlzZ+sLYQqqhzgO I2OVHlLUJbkO+GOsXqfx60hmFy5PUCbv+EdLF6OyIwdkAoknZiJnMMkU/3I6xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753014923; a=rsa-sha256; cv=none; b=JCEp4mDqSK0kwO2I1vkwDZ7NcM6dVJFWOMypWaYPwAhT7NewhR96TzwUjfZN04qMgXIjg1 10EYsctPPssTpCfglqV28nmDG2YRvYP8vkY57RJ6o6nRcM4s3ZEy2cPYMoGtsd0FnTV4j3 5BmJ8dg2gPKuzbJ86liahopvp4zbrki6305fTgeH+V3L9QkYU+CgZtxlmrarnkv86HbLQa hkEHFl8ThXfFz70jpkz8L/3Uw0Z1vU0cRghFzsFfXZOOdEG0+AIaZNF6pnqN7rhyG2pWXv yZcxv2KslxoD5Gs5mIcphadZS1myPx1ByTs7iOzG+dYOBIdN6bWD7PM7++idgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blNKR0Z2sz1B3X; Sun, 20 Jul 2025 12:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KCZMp0069100; Sun, 20 Jul 2025 12:35:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KCZM3G069097; Sun, 20 Jul 2025 12:35:22 GMT (envelope-from git) Date: Sun, 20 Jul 2025 12:35:22 GMT Message-Id: <202507201235.56KCZM3G069097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 22bebbb211e3 - main - tcp hpts: use consistently inline instead of __inline List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22bebbb211e304f09a29764f24ad9cfb82cee7f0 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=22bebbb211e304f09a29764f24ad9cfb82cee7f0 commit 22bebbb211e304f09a29764f24ad9cfb82cee7f0 Author: Nick Banks AuthorDate: 2025-07-20 12:33:31 +0000 Commit: Michael Tuexen CommitDate: 2025-07-20 12:33:31 +0000 tcp hpts: use consistently inline instead of __inline Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_hpts.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/netinet/tcp_hpts.h b/sys/netinet/tcp_hpts.h index b097a2b98db9..a623d959db9a 100644 --- a/sys/netinet/tcp_hpts.h +++ b/sys/netinet/tcp_hpts.h @@ -165,25 +165,25 @@ extern int32_t tcp_min_hptsi_time; * The following functions should also be available * to userspace as well. */ -static __inline uint32_t +static inline uint32_t tcp_tv_to_hptstick(const struct timeval *sv) { return ((sv->tv_sec * 100000) + (sv->tv_usec / HPTS_TICKS_PER_SLOT)); } -static __inline uint32_t +static inline uint32_t tcp_tv_to_usectick(const struct timeval *sv) { return ((uint32_t) ((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); } -static __inline uint32_t +static inline uint32_t tcp_tv_to_mssectick(const struct timeval *sv) { return ((uint32_t) ((sv->tv_sec * HPTS_MSEC_IN_SEC) + (sv->tv_usec/HPTS_USEC_IN_MSEC))); } -static __inline uint64_t +static inline uint64_t tcp_tv_to_lusectick(const struct timeval *sv) { return ((uint64_t)((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); @@ -199,7 +199,7 @@ get_hpts_min_sleep_time(void) return (tcp_min_hptsi_time + HPTS_TICKS_PER_SLOT); } -static __inline uint32_t +static inline uint32_t tcp_gethptstick(struct timeval *sv) { struct timeval tv; @@ -210,7 +210,7 @@ tcp_gethptstick(struct timeval *sv) return (tcp_tv_to_hptstick(sv)); } -static __inline uint64_t +static inline uint64_t tcp_get_u64_usecs(struct timeval *tv) { struct timeval tvd; @@ -221,7 +221,7 @@ tcp_get_u64_usecs(struct timeval *tv) return (tcp_tv_to_lusectick(tv)); } -static __inline uint32_t +static inline uint32_t tcp_get_usecs(struct timeval *tv) { struct timeval tvd; From nobody Sun Jul 20 12:39:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blNQH1ZHlz62448; Sun, 20 Jul 2025 12:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blNQH09mZz45df; Sun, 20 Jul 2025 12:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753015175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8Xa8DjX7a4+oFkPRBk/Q5K5BtUQVbxlgHGODpSustQ=; b=f1OSED/i1+C0vFJen4m7p2cyQQVR2cAU8T5xHUkUhZzq5TUaxT7y8eZ38yWzAPOw4lOY/i lMZukAvU/iF5JCmnYHZAUN6SjMAh4PbGcRGbJ0h5X1SNUetIiQqIh9yBaH/g/GkVcJdiIz I1Zr1VWMj9CSu6jurcozCVlmC0rD/t/85okwSdR2gs9HoOFe5JPZ6C2+NMmrHaK/e8EPey iBuD0kpxggONH/NBF8hwqCC75SiQVJxc3gEzhZKv7AIV2qLJ3q5w22rkKbY0sJag6rE08K n9Gb/SuyAl6CjC9p1ruJE2FTjjPsql0NTDnCobSHgvlJmM9gnqxD0n0ICbQRMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753015175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8Xa8DjX7a4+oFkPRBk/Q5K5BtUQVbxlgHGODpSustQ=; b=DeF/f3v7vdc6n0zxnG9KgSkfj7De/QiPtWbFfuw1COXJzrfTXh1+SU/F+rx/zHj8DCJ2nq 7kCcmCK7M7AoqS/RUJI0Dv3K3JmsO/VbOY+0lcuesPud8ta1eaW/f4Yk+2wnduBj7Q8wPC 7rfAS+f1G9dlgUbdYB7jZ6K4G5J2zeIivYpjgcfnY4G+pGWnb1qdan5Hzt1oWsHwfIMU1n Uj9HbeZocfxhbCeKlBS6hChBWJsY7u/9IFcYDKaYhAQkbq7XCrDYXBsuiFV6p90wz1mf8q g1SqBqZLsGa9lEx1f65QcVQeYiWropf1qVNWfst0FLn2ijB5klvUHIYV4GcYKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753015175; a=rsa-sha256; cv=none; b=hdSnHQGZ9p4kWf7GJAdl46OiKPFjQCKf2lZnDR8frQekwVg0WfyBITfSj0z78CxukBAM5I n+tyvTfGSxxpTt1heNGDpNG5cEtT6JsLLCP8H87pK24iD8ennd0fUHlggyqdCOEjXdHz/j xG8e5Xm3AO/vbDeKTJA/eqMlb9r5zstsFsin6dQ06H/szzr7X2PpZO4G6fldaIwlMj7YQx ZG9RvOHGtMdUKN5/S9IS5R1dgbiZ/vWtB+0yJiMYwu4ioBlYp1OXkis/DwrPwMAyAWJ++G ul9NAKKaSGYq2TtDyfFk1as0vDwJRJsuexlSQ4gKWt10PFqkxomrPWO/oCkNUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blNQG6jSPz1B3Z; Sun, 20 Jul 2025 12:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KCdYvd070443; Sun, 20 Jul 2025 12:39:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KCdYNk070440; Sun, 20 Jul 2025 12:39:34 GMT (envelope-from git) Date: Sun, 20 Jul 2025 12:39:34 GMT Message-Id: <202507201239.56KCdYNk070440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3ad8fd6f3046 - main - tcp hpts: remove unused line argument from tcp_set_hpts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ad8fd6f30466789111e088c16fcab4d94f63232 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3ad8fd6f30466789111e088c16fcab4d94f63232 commit 3ad8fd6f30466789111e088c16fcab4d94f63232 Author: Nick Banks AuthorDate: 2025-07-20 12:37:42 +0000 Commit: Michael Tuexen CommitDate: 2025-07-20 12:37:42 +0000 tcp hpts: remove unused line argument from tcp_set_hpts Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_hpts.c | 2 +- sys/netinet/tcp_hpts.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 3b92a3d08f51..b60cdf45af52 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1486,7 +1486,7 @@ no_run: } void -__tcp_set_hpts(struct tcpcb *tp, int32_t line) +tcp_set_hpts(struct tcpcb *tp) { struct tcp_hpts_entry *hpts; int failed; diff --git a/sys/netinet/tcp_hpts.h b/sys/netinet/tcp_hpts.h index a623d959db9a..f5856ed8e688 100644 --- a/sys/netinet/tcp_hpts.h +++ b/sys/netinet/tcp_hpts.h @@ -149,8 +149,7 @@ uint32_t tcp_hpts_insert_diag(struct tcpcb *tp, uint32_t slot, int32_t line, #define tcp_hpts_insert(inp, slot) \ tcp_hpts_insert_diag((inp), (slot), __LINE__, NULL) -void __tcp_set_hpts(struct tcpcb *tp, int32_t line); -#define tcp_set_hpts(a) __tcp_set_hpts(a, __LINE__) +void tcp_set_hpts(struct tcpcb *tp); void tcp_set_inp_to_drop(struct inpcb *inp, uint16_t reason); From nobody Sun Jul 20 13:03:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blNxP3c9zz625JQ; Sun, 20 Jul 2025 13:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blNxP2VxJz3PJj; Sun, 20 Jul 2025 13:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753016585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hen477/CQRd6GN6dWXyioShw4WnISChak09ze8dlP6s=; b=uAP3lxf+A/cV1O0rWZ5AK3ZxetWcuSeqI43p5UtV/XO4OfIyyxB27mKLKoVRS1+1vGLYR4 0BLXrqUpxPGyjpPWbQsQBxdjgyNUtclLwRrv0e4hB/AzS/6GOVLBjcpQ6KL4ih82aePtcH K3c7vLGuOlGtb4BJshz0tlgdNhaejmUEBPBH87moogcPlLO4t45BWMYJ73loR4lsMrqtSO WHB18TO/chCbxk6ajI+Sy2qW9sz5HGnYAmN19eVCoHnEB2Bf9KfZWWUgBvF0S63zJn/dDa x15Q5zbKxdQkeOCMQP7oki81GBi5ILcd0nvzrjC52ZyIxq9epdkrDaVP870m1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753016585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hen477/CQRd6GN6dWXyioShw4WnISChak09ze8dlP6s=; b=T+yDXd6Nlvlq5gL2UZBOsQABAs6s4G9UsMKa+71kov4RA96eQhdMHbj+8spycFOP01wlCH oUEZYr7pyIkPM6/ISzXWVCpfBNVc4+s3XM81r28CQ8RTfk8oRJWGYQRy20VCw0yUCkrrX8 g+qzdRE7Wn+DelFVEOdiG55DevMB5rSQrNtUL8FhBwfD1bsFLRmsDy8d7l5zGDDM0txnYZ 7CJ4XNndJdW3PNhFljqRPm80FWWAZ/4RZHYcD4OAk0MVBLFmB6lDBYneZBwGUNa9ZD29bg ePzm3qHwwcJAAVtFKw+8SHB3pQgHLxBBqjEs2E+Sd3i5I+uAN2v4XBTTUVFXCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753016585; a=rsa-sha256; cv=none; b=oqvRdeZ2m2HcbqUbmfG3DIcHpwrHYfLYXWUe37pKarWpqJyNiTUhNd4RacdvMXTJRq47Dc p8JPMhIq7DrucjB6LsBWKwzD7xqlhOni/7hIHB2lfjZIFFFxt9cIeP7XjlP/YuXqk/LsGQ eei12guzK+P00NZR/dNH8pkMLZocuGCsrYksmE+0IvhJ+Cg2C0od6mjMIA5qC9g+qdSHAp AsZfARNO0emH78a3gjpzIz3dv/ekZ6Lr/WOpnQYKEAZvVo8Wf1aAtXYb79pnZziSnRWUAe 5ajql1NJkncvnlHMeomFQfyN5zkRtUs5VFrDvOYOFKH8aois8YQprzBfw8UD0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blNxP24Xsz1CRh; Sun, 20 Jul 2025 13:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KD358A025827; Sun, 20 Jul 2025 13:03:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KD35lN025824; Sun, 20 Jul 2025 13:03:05 GMT (envelope-from git) Date: Sun, 20 Jul 2025 13:03:05 GMT Message-Id: <202507201303.56KD35lN025824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 7dc73fa66935 - main - tcp: cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7dc73fa6693564cecc36cda6788cb21c0c922ced Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7dc73fa6693564cecc36cda6788cb21c0c922ced commit 7dc73fa6693564cecc36cda6788cb21c0c922ced Author: Michael Tuexen AuthorDate: 2025-07-20 13:01:00 +0000 Commit: Michael Tuexen CommitDate: 2025-07-20 13:01:00 +0000 tcp: cleanup Don't use the variable rstreason temporarily with a different semantic. No functional change intended. Reviewed by: Nick Banks MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51438 --- sys/netinet/tcp_input.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index f0921032ef31..1f60c0e07b13 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1055,6 +1055,8 @@ findpcb: * socket appended to the listen queue in SYN_RECEIVED state. */ if ((thflags & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK) { + int result; + /* * Parse the TCP options here because * syncookies need access to the reflected @@ -1064,8 +1066,8 @@ findpcb: /* * NB: syncache_expand() doesn't unlock inp. */ - rstreason = syncache_expand(&inc, &to, th, &so, m, port); - if (rstreason < 0) { + result = syncache_expand(&inc, &to, th, &so, m, port); + if (result < 0) { /* * A failing TCP MD5 signature comparison * must result in the segment being dropped @@ -1073,7 +1075,7 @@ findpcb: * to the sender. */ goto dropunlock; - } else if (rstreason == 0) { + } else if (result == 0) { /* * No syncache entry, or ACK was not for our * SYN/ACK. Do our protection against double From nobody Sun Jul 20 15:19:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blRzC2Pgyz62F8b; Sun, 20 Jul 2025 15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blRzB56srz47TN; Sun, 20 Jul 2025 15:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753024790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmSNT7Jg30mtS/6zci1xjLDwi5E1a8O5wHWMF0uTk4s=; b=IIDdrNMCKB9Uywz/xApmtrYmCRCvetZSj/40k/GHOeM7/LY+9wwoh7nPcGYr86sWEhz7NM 8005UJmY5xfHDEZ4UzI/i1rbPtkf8995Xt5/acn+tGgJGNVrOOqw2Ki8XDtDjcgtmXwdg9 94+RF9WXZkm7Zgi8o16dNa075+OLSIaGViXl8iHyGt6CnaTpAz8YCu+hhkbrNfrDeVkJT3 seOkY0q3gwMQbTB9nMyf4TjvwYtmXwGgv5JI4EH3lh4WeL6H6rhN2lecrMEzlXVn0dyNZU WYiwtuiAD88TPpAF6ciSOGboRCqrjTOQnd/V3NWFHykvJnwLviwzMYkaahTFeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753024790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmSNT7Jg30mtS/6zci1xjLDwi5E1a8O5wHWMF0uTk4s=; b=J7KlCfeG/KjJ7GUvfz95TgRGRZbdYXVnUkBFon81HcalYxMiVz6P2jzklxneTNr+K9n1fH A1YDZKVu1QBaj6MRIq0TtWSPeAgY6oltcYeKkMMn8gV4cZ+Y8TBntLJSx2Al12tURHvD4D 9Tj4clNXGXfrKOmhGesDj4tb0f9ONkzGpknqtxTgQsmpwovarGTAlVcrx6lmtdXhuGaNlb brQquV5lM/gK7osmXskAA7X5Rsn4jjbdhQ6Ng9zeL6X36q7It3rEx3hCZBYazLgMgcOz4Z lke8iegQGS8GgQUO+h5FFJEGGdYogK+wSI8MCS8B9Zuj+e/VS6Xxf4nqQ0KZxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753024790; a=rsa-sha256; cv=none; b=E7Nfk8+akcy/FvAUWPue4tNH2au4n29cumbBl01WTe0UjhHuQ/7jCK3askqdtamZ5S/yFU EezovhMEYf6ZzQXL9cfF3mAp+MT29oIgNxch/tYbjRjfbNIdhk8VFdF42Y5SRZ9mz9D7e0 Ga2hmCl7ybj5h9n23ZWsVIYhFuNpNIeeX27nPrcN/wFbG+fsGmiJHS3W/+Bnp+uC8YyNuN THtKjJkFInAGht4SZ3amAjFtZHhU83NuqLemsz29gfhh8ODBZ4kVfhBK7pq5Vxcjxh5p+I VmDJ97TnKtkfWGj28SwkuEbjQB4LUuiP4RY+dPq9uiU9npvb+6IGGx0g/F80NA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blRzB4Mzgz2gr; Sun, 20 Jul 2025 15:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KFJoR4072033; Sun, 20 Jul 2025 15:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KFJoK8072030; Sun, 20 Jul 2025 15:19:50 GMT (envelope-from git) Date: Sun, 20 Jul 2025 15:19:50 GMT Message-Id: <202507201519.56KFJoK8072030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 8dfc688a9374 - main - fhopen.2: Fix named_attribute man section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8dfc688a93748d48e33b3da891623e5c865e0523 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8dfc688a93748d48e33b3da891623e5c865e0523 commit 8dfc688a93748d48e33b3da891623e5c865e0523 Author: Rick Macklem AuthorDate: 2025-07-20 15:16:21 +0000 Commit: Rick Macklem CommitDate: 2025-07-20 15:17:01 +0000 fhopen.2: Fix named_attribute man section This is a content change. Fixes: dedbb972d294 ("fhopen.2: Update man page for O_NAMEDATTR flag") --- lib/libsys/fhopen.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libsys/fhopen.2 b/lib/libsys/fhopen.2 index aba53f1dd907..b281ac3d8949 100644 --- a/lib/libsys/fhopen.2 +++ b/lib/libsys/fhopen.2 @@ -31,7 +31,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 6, 2025 +.Dd July 20, 2025 .Dt FHOPEN 2 .Os .Sh NAME @@ -140,7 +140,7 @@ is no longer valid. .Xr fstatfs 2 , .Xr getfh 2 , .Xr open 2 , -.Xr named_attribute 9 +.Xr named_attribute 7 .Sh HISTORY The .Fn fhopen , From nobody Sun Jul 20 15:25:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blS626PxMz62FB0; Sun, 20 Jul 2025 15:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blS624r1Bz4FF2; Sun, 20 Jul 2025 15:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753025146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LaXrS4Zxdrj4yE0pj0owZ0O5OCqDhTM5Mvjpz3WrVJM=; b=DAa3Y92N3Usc1a3XUuPxYz3JIU4bEyZOy3yr18wDlNA8jvkesSzYBa4R8h3PtXTkf74Zig 55qWgT5ZgEPcU4Dgs5JFi8GLaMMe04Ohtr+6ZR3zJ8TOxejbjLlvuIL2qktZ5nhPLHq23+ ggVnvndSjOCnurdNdoO6glzEBRCe6m/Zes7IC6NQ0cWB2GOEnN20YyCd38Ajc8ihVecX+F 5xgNtiAayikKSWLT7Rufmjmc1BzwhpcDYJ3autFX9yZchyqtkrJuR7QtT6xWzMbL9ObLMd msQdx2MTxEMPoP+6m6kvKH3CBOIxEUrDifkxAZq5ETFcEnd/61Wcmm1EnCQk1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753025146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LaXrS4Zxdrj4yE0pj0owZ0O5OCqDhTM5Mvjpz3WrVJM=; b=tLKyc9ydgy61v5DOOzZYF/Q4+YJ1l3K/ddRtk3SKIdAr6sa6hmvT6MQAVckZamcOhUcy5W iFPUk2KHkOQdzBQPWk6FMPWFSTtGI9hrmdwma1RAl+l0qGOMmsLMCqEg4XNe/f8/0QicAI 08V2K7mAgvdSxlW5rnO443IS0ZG+X5j1S3mBEMfTe/DHjHftHlfyE8vajpG2sX0fQDRtNe Xo28LbHCQvrGrnBA23D4UqH4XgBuq5jrCyahnV8ZiOJPIKT+K1a4VfvWTdljcp875/Dv/F wb8lrZ3sAdUUjfyU4X/tnkR+2EDAkCbAra0dlw2GvOkPQxD3aZbxicbqMOldRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753025146; a=rsa-sha256; cv=none; b=T/Ju+F501jT31nMRAjKJtqUbsiRwH72vosl8wKu2zkELHf9H5JP3bpsAFxZlPoJx+UrOfg QdPc+k3lxX0+BPllIH0oiWUWAIhWQYjSvAkELlZMtwtGmGdJaDb7EEBeU3qejLzNrzt7zr VK6NgVGRVvTq0O2YK8OP2FVERBGTl95k/1FS8RL9WHbPXJEGSKIJP07OjZuj9388t57VW2 rHVGZqMi2MH4IwGImK8+04rwV8nDoZ1e+Py4/Le+Xqdc5O33w00UB/h5/rr7Y3JJgFeFcv vvDHannWwjfEeoxoRjyZ+9XdR+Ied2ZefsHImrAAE8WjFNnjE/xUbsC2qQ7spg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blS623zKKz3Dk; Sun, 20 Jul 2025 15:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KFPkHV089046; Sun, 20 Jul 2025 15:25:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KFPkdn089043; Sun, 20 Jul 2025 15:25:46 GMT (envelope-from git) Date: Sun, 20 Jul 2025 15:25:46 GMT Message-Id: <202507201525.56KFPkdn089043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 76e911dba504 - main - statfs.2: Fix named_attribute man section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76e911dba5045b3aa39570d7da68a97213d2355b Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=76e911dba5045b3aa39570d7da68a97213d2355b commit 76e911dba5045b3aa39570d7da68a97213d2355b Author: Rick Macklem AuthorDate: 2025-07-20 15:23:02 +0000 Commit: Rick Macklem CommitDate: 2025-07-20 15:23:02 +0000 statfs.2: Fix named_attribute man section This is a content change. Fixes: 964d0fd62431 ("statfs.2: Update man page for the MNT_NAMEDATTR flag") --- lib/libsys/statfs.2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2 index 49e8b5120558..ab65def11ebb 100644 --- a/lib/libsys/statfs.2 +++ b/lib/libsys/statfs.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 7, 2025 +.Dd July 20, 2025 .Dt STATFS 2 .Os .Sh NAME @@ -127,7 +127,7 @@ Mandatory Access Control (MAC) support for individual objects .Xr mac 4 ) . .It Dv MNT_NAMEDATTR The file system supports named attributes as described in -.Xr named_attribute 9 . +.Xr named_attribute 7 . .It Dv MNT_NFS4ACLS ACLs in NFSv4 variant are supported. .It Dv MNT_NOATIME @@ -264,7 +264,7 @@ each file or directory name or disk label .Sh SEE ALSO .Xr fhstatfs 2 , .Xr getfsstat 2 , -.Xr named_attribute 9 +.Xr named_attribute 7 .Sh HISTORY The .Fn statfs From nobody Sun Jul 20 16:03:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blSxb546wz62HR1; Sun, 20 Jul 2025 16:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blSxb3qfDz3QH4; Sun, 20 Jul 2025 16:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753027411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5DDc+U0OVAt30EjSqmUzvaey7Uy3lAljxjm6Obt+Gto=; b=s/DzR1PzxBXYGL2RhRsdr6rNCRuwTeTF49SB7Ah6tygDA7IQkiytVEp9RjZyJhAKrZJ1m7 vKNxgtRJoHecuKeqbbcTsEEzlzE+MzcMZ7iAlubidbWWJM2ViPPqfL8VaxfJhhD8TR/JvW HWHeC8/HQgq1rCCbtzr40l6ADMeLoLYiz2iErDzDyoROUTHKzPLV7IIV5yIeFez3L8FxhO Q9nYuQFyWhXPZsGPs/YgfA4q65UiLxHtT4bVU+3x5w+vEAMBB/ImO8WHVFnpa3ouVr74bz 7P+wdYvwgTuDpxWw73C5k+7L07/VRnyOVAyqxWMA9UN8RY0x4/PNUDMcDOPqzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753027411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5DDc+U0OVAt30EjSqmUzvaey7Uy3lAljxjm6Obt+Gto=; b=rc9eMEj0YV6R+bk1G5CyOKcY8WgzGGELetTLG3aJRQJ+P8zZUUQZqA8QODIm5OVnoGpwXY xD+9p+YpasC/MyTSUMvpGJbHEBP6pntTl4HPhYgJBx0cT+wP1x2tPFfeNYUasYxKGasynh n6Y60FSl26c+2+d4yhTNT6cTGoDHuRJ+4IdMh7LTqDqjg64mv5qXU5dStzDGGE4oOv9syt DWPxPXyiHJXQTKpEyvSbIl/Le8GAKNnqG0K7gzsqAQRFjgd0YlUvajsaM02JSHO5S0R6O/ YNVMND5Xev0pcaC0K9LiZChhyV2dSJRKIZzXfWUqiVoDmphkYRfJZHRcJvvPDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753027411; a=rsa-sha256; cv=none; b=mkjjpVsUhpkr87Y/qaePIYR3G+1bNMuvKg4f45FsbgWU72WjJxVFpC5jXtnJkUKn01GUYv mr1KOrC4F1zlaH2EchR/KQGJ47y4vtHemItS6IWgqY9oaNmE6uJqLAoE278YeFhiYQjUkt 2yLDd1TlPvqcQRcvHwosAug052Z4/7ilkqicJZNYexrz0j390IjJyNN9etOX1k3TmbRztP fCX1gJvtVu7ZRUahlAd2K8vGHrToJJ0jTYTl8hcv3FEqQjLEmzjvmIhDXQH0MJYpjgPpEs 1o2r0aQIer4XeOoT0J12nDb4KOWv0X793/JVWpRgYNTA8mS4pXIv2xV+TR40WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blSxb3RCnz3Vx; Sun, 20 Jul 2025 16:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KG3ViL064576; Sun, 20 Jul 2025 16:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KG3VHj064574; Sun, 20 Jul 2025 16:03:31 GMT (envelope-from git) Date: Sun, 20 Jul 2025 16:03:31 GMT Message-Id: <202507201603.56KG3VHj064574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: 46be8a71d54d - main - committers-src: add myself (obiwac@) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46be8a71d54d6efa4dd24331a4d6a32a1e694ea7 Auto-Submitted: auto-generated The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=46be8a71d54d6efa4dd24331a4d6a32a1e694ea7 commit 46be8a71d54d6efa4dd24331a4d6a32a1e694ea7 Author: Aymeric Wibo AuthorDate: 2025-07-19 22:28:46 +0000 Commit: Aymeric Wibo CommitDate: 2025-07-20 16:01:59 +0000 committers-src: add myself (obiwac@) Add obiwac@ (myself) as new src committer with mckusick@ and jrm@ as mentors. Reviewed by: mckusick (mentor), jrm (mentor) Approved by: mckusick (mentor), jrm (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51428 --- share/misc/committers-src.dot | 5 +++++ usr.bin/calendar/calendars/calendar.freebsd | 1 + 2 files changed, 6 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 313f40ad8e51..0f9f8242c5c2 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -299,6 +299,7 @@ nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] n_hibma [label="Nick Hibma\nn_hibma@FreeBSD.org\n1998/11/26"] +obiwac [label="Aymeric Wibo\nobiwac@FreeBSD.org\n2025/07/15"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] oh [label="Oskar Holmlund\noh@FreeBSD.org\n2021/04/21"] olce [label="Olivier Certner\nolce@FreeBSD.org\n2023/12/01"] @@ -711,6 +712,8 @@ joerg -> schweikh jtl -> ngie jtl -> thj +jrm -> obiwac + julian -> glebius julian -> davidxu julian -> archie @@ -799,6 +802,8 @@ mav -> eugen mav -> freqlabs mav -> ram +mckusick -> obiwac + mdf -> gleb mdodd -> jake diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index 0b1a37f43723..1ca63b371f65 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -259,6 +259,7 @@ 06/11 Alonso Cardenas Marquez born in Arequipa, Peru, 1979 06/14 Josh Paetzel born in Minneapolis, Minnesota, United States, 1973 06/15 Second quarterly status reports are due on 06/30 +06/15 Aymeric Wibo born in Plaistow, London, United Kingdom, 2004 06/17 Tilman Linneweh born in Weinheim, Baden-Wuerttemberg, Germany, 1978 06/18 Li-Wen Hsu born in Taipei, Taiwan, Republic of China, 1984 06/18 Roman Bogorodskiy born in Saratov, Russian Federation, 1986 From nobody Sun Jul 20 17:40:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blW5B5nTCz62Nlr; Sun, 20 Jul 2025 17:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blW5B3LVpz3cj5; Sun, 20 Jul 2025 17:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753033214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wLHv1CLunBhyECLb0L9hlPFaXeR42M+puozKXYH1Xbc=; b=UqjoiTof83xceR0hDsXsLIoxsb+jEPt50HnbLj5+9AyWQvGgpORn31/EYSy7NGMs1uOYEl ELq8yQihOI8dv8w+U94jKqTTx17LBtVanhoU7X+DS0REetRjrAYEa5YSiw+WvJfhnCzHRA 0w9NfdtqBLxZnI11eoNkW2xydfEtDUulrvnvfntpyrlGAJfPeTYE6Rt9kxYScMue4CQk+6 n45azOVgJ9UGI839bOQPDV+Km0Gow8Rq2N1XAGXkD3Ktism/9gf+Ft8z9I8SDyN2yH0dHy JH8ClMJGVVGfz/ymhoq1kRhdupeq25D+sWK3Z0yr0JzRoSfrZ1n2TMzlqE81WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753033214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wLHv1CLunBhyECLb0L9hlPFaXeR42M+puozKXYH1Xbc=; b=ccs5rCkTq2BCxV2A2YrkdsXuGJY1EcUTpZsbHNigSPpl81ZjzSs7QPnaSH8d2Xfhuqq4Lh Ua9SFZDJShYifsRx+F3pfSrrifNIzLneUX4E5VFUsa9CQOIeuLtW2Ft3qnWM9bBzMPd5x/ ywxCXxjsa49GdcmTkqjKOMjNJZozyw2DM+R5lx3jCOzfRNiwL2LhPXue+dSpzut277+NQZ gsd9Od3xzkLUP11eNGZIJR7k1Yt5+eV0XVBw4RkzwMlCpR37gX4VDARPJdpH4PI+HmZeBU PaPYFZ/88hM8CI0rNkSmrdP+PJejOTfdHsn6SSu+mEZA6xicDh0vKs4VKZC2pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753033214; a=rsa-sha256; cv=none; b=tdQbsqJl/0x8dL22klJlWz+9jyvsApgwReVdKWXCOeMkKDh9NHS6p2ZMtWiypCg5S1IzSQ BlzsOpbuDHVf3/tMeiiwkrfmF2dkEwutfUmy7jGcSoonM7AkcHIHMrkHgY/F0906oH5Nsn FTvcjzOCwIgEVt9kxXmlaRHTtg6oYQWxgGT21DxKcEyidzVaIf0dwpOJOYcIGdG3RxaooS u38Ez6FSgJ//CIgbrnhEusYTAgt+jOzZnaV/wk+2JqYHPKNbPy0NyEVOt9RPvtgFQau0pT YCmHhHYsr6LxSAGS/mU3gCx0gVnSMmuqFGQ0l6GcI7gI4V8ZT4wCgF7rYKvHsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blW5B2kdYz6CR; Sun, 20 Jul 2025 17:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56KHeEHr042181; Sun, 20 Jul 2025 17:40:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56KHeEKT042081; Sun, 20 Jul 2025 17:40:14 GMT (envelope-from git) Date: Sun, 20 Jul 2025 17:40:14 GMT Message-Id: <202507201740.56KHeEKT042081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 76bafc906926 - main - MFV: less v679. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76bafc90692608c1db8df3276e966212201c270c Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=76bafc90692608c1db8df3276e966212201c270c commit 76bafc90692608c1db8df3276e966212201c270c Merge: 46be8a71d54d 9006df9a94bf Author: Xin LI AuthorDate: 2025-07-20 17:33:52 +0000 Commit: Xin LI CommitDate: 2025-07-20 17:33:52 +0000 MFV: less v679. MFC after: 2 weeks contrib/less/NEWS | 10 ++++++++++ contrib/less/decode.c | 2 +- contrib/less/help.c | 2 +- contrib/less/less.h | 9 +++++---- contrib/less/less.nro | 2 +- contrib/less/lessecho.nro | 2 +- contrib/less/lesskey.nro | 2 +- contrib/less/os.c | 6 +++--- contrib/less/version.c | 4 +++- 9 files changed, 26 insertions(+), 13 deletions(-) From nobody Sun Jul 20 21:40:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4blcQQ6TP2z62dQ5; Sun, 20 Jul 2025 21:40:30 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blcQP3pKQz3p9l; Sun, 20 Jul 2025 21:40:29 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=zabbadoz.net header.s=20240622 header.b=JREfaGaP; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 2003:a:140a:2200:6:594:fffe:19 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net; dmarc=pass (policy=none) header.from=zabbadoz.net Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 28F73A64809; Sun, 20 Jul 2025 21:40:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zabbadoz.net; s=20240622; t=1753047617; bh=JI3xnDoMp09hzAbnT+nxyVNbuxaUqCHkcIl+aZo85w0=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=JREfaGaPw5ug44EqvX9um3tOYlj0njFrDkCqAmKGZf+9+uQzM0bU3xnPzC4Fb4oqU UmBfvg/VN5WUITEzaYEu0lrrnrGAB3F25tpbpH6P9Ad7fZgCdZQSs9x8ZeEgoWWZVS s1qVoR4TKG9CUlDX488UENM2Y/+rSYszdMsh6shf22HxXgMTx6kSuO0QFPpInIQ2q3 vPNkl5vCMio4XUeU1ua0/Y1lbo48czexInC+nMI7+Xu12FMcnBmduqTMtbthi6pJrW 4XJDT414LiJyz+Xme+gQRsZejB3PUFFyqIWHERP7s81hDcRQPd+roHuY6sbUoI6WAb VXDXjZkM0vz0wwMMFRvGjDE01ZWHeRWZF2iA7CaXCbagUk387/4XlGLB/LnRozc1IN Sx30W3comSH4mLn+5vjGwABbm5YNUOTCW068nQTy6NdNSKX6AD36dydlLVipu46yRb N2WeTDRrV7Ak/dUDYx6MGJczeI4LatuaXIH0Cjt9px83gB5dH+9QbxBu7GTP+7gxuP 7hXz6tyOKyzxqwTL2bpm/rKarpFaBhtogLywUJN0UplnMBKko0DwO7FvK8d4cuEQAk DG9xRCABcg6CmNnxvt/ZvXDt4A6e99yOkFa/HQcy4aGVZiDUJ5LXuXdY3JGuraCtsZ aHCBQDkbo1U8hpJPZ/lVAKCs= Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 373902D029E2; Sun, 20 Jul 2025 21:40:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id 1-owy431V2FA; Sun, 20 Jul 2025 21:40:20 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:a66b:b6ff:fe40:39a9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 29DF42D029D8; Sun, 20 Jul 2025 21:40:19 +0000 (UTC) Date: Sun, 20 Jul 2025 21:40:19 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Simon J. Gerraty" cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e67aef419093 - main - Add DEBUG_PRINTF to stand.h In-Reply-To: <202507172337.56HNbQvv083962@gitrepo.freebsd.org> Message-ID: <2n0q6oq1-9r92-q0p4-r97n-p167q13p4p4p@yvfgf.mnoonqbm.arg> References: <202507172337.56HNbQvv083962@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spamd-Result: default: False [-3.08 / 15.00]; NEURAL_HAM_SHORT(-0.95)[-0.949]; NEURAL_HAM_MEDIUM(-0.92)[-0.918]; DMARC_POLICY_ALLOW(-0.50)[zabbadoz.net,none]; NEURAL_HAM_LONG(-0.22)[-0.218]; R_DKIM_ALLOW(-0.20)[zabbadoz.net:s=20240622]; R_SPF_ALLOW(-0.20)[+ip6:2003:a:140a:2200:6:594:fffe:19]; MIME_GOOD(-0.10)[text/plain]; MISSING_XM_UA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:3320, ipnet:2003::/19, country:DE]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[zabbadoz.net:+] X-Rspamd-Queue-Id: 4blcQP3pKQz3p9l X-Spamd-Bar: --- On Thu, 17 Jul 2025, Simon J. Gerraty wrote: > The branch main has been updated by sjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e67aef419093b08984b8a2de535bc3e4ce13e087 > > commit e67aef419093b08984b8a2de535bc3e4ce13e087 > Author: Simon J. Gerraty > AuthorDate: 2025-07-17 23:36:17 +0000 > Commit: Simon J. Gerraty > CommitDate: 2025-07-17 23:36:17 +0000 > > Add DEBUG_PRINTF to stand.h Given stand.h is included in other parts of the kernel and I don't know even how indrectly for the error case I have, this feels problematic. I know the experimental USB code I am testing has it's own cleamup to do but I did run into the conflict of DEBUG_PRINTF being re-defined there. Given the generic name I wonder if this should be STAND_DPRINTF or other? I admit, there's not much code exporting DEBUG_PRINTF or DPRINTF macros so this may just be the one and only case; not sure how much other vendor code is out there... > stand/ is mostly debugged with printfs, in an ad hoc and sometimes > fragile manner. For example BOOTP_DEBUG in bootp.c cannot be defined > unless NETIF_DEBUG is defined in dev_net.c or build fails for lack of the > symbol debug. > > The DEBUG_PRINTF implementation in stand.h addresses that and allows > for more control over debug output. It is compatible with the > usage in libsecureboot. > > Simply define _DEBUG_LEVEL to the desired level of debug > or in the case of libsecureboot _DEBUG_LEVEL_VAR to the variable that > will hold that value - default is _debug which is static so each > translation unit can be controlled independently. > > The 1st arg to DEBUG_PRINTF is a level which must be greater than or > equal to _DEBUG_LEVEL_VAR if the printf is to be called. > See libsecureboot for more examples. > > Reviewed by: imp > Sponsored by: Juniper Networks, Inc. > Differential Revision: https://reviews.freebsd.org/D51269 > --- > lib/libsecureboot/h/libsecureboot.h | 1 + > stand/common/dev_net.c | 57 ++++++++------------------- > stand/libsa/bootp.c | 78 +++++++++---------------------------- > stand/libsa/pkgfs.c | 33 +++++++++------- > stand/libsa/stand.h | 13 +++++++ > 5 files changed, 68 insertions(+), 114 deletions(-) .... > diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h > index e1188fb73a26..8b7d93074ef2 100644 > --- a/stand/libsa/stand.h > +++ b/stand/libsa/stand.h > @@ -558,4 +558,17 @@ void tslog_getbuf(void ** buf, size_t * len); > > __END_DECLS > > +/* define _DEBUG_LEVEL n or _DEBUG_LEVEL_VAR before include */ > +#ifndef DEBUG_PRINTF > +# if defined(_DEBUG_LEVEL) || defined(_DEBUG_LEVEL_VAR) > +# ifndef _DEBUG_LEVEL_VAR > +# define _DEBUG_LEVEL_VAR _debug > +static int _debug = _DEBUG_LEVEL; > +# endif > +# define DEBUG_PRINTF(n, args) if (_DEBUG_LEVEL_VAR >= n) printf args > +# else > +# define DEBUG_PRINTF(n, args) > +# endif > +#endif > + > #endif /* STAND_H */ > -- Bjoern A. Zeeb r15:7