From nobody Mon Mar 3 00:06:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5fHb2nLPz59TYH; Mon, 03 Mar 2025 00:06: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 4Z5fHb1Jkcz3wJK; Mon, 03 Mar 2025 00:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740960395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4LuLoKM1MpZ2lb7fORLBjqSGiw07okgScjfOQe8ZZ18=; b=Ol6x1V0WvImbADlkhpYOlhwZ7maPQ2PuuWicj2Y4c3sZ18pUX0pISSJ7QiTjYzdpHwpvP7 qz5zfKXQdAVst/DPcgtB1Y4GShpOH+Y2bkhVQHF6Q6jsu6E/sDqfjZINFMRpGDy7trupUo FiyBpSWyfuKg4jePJP5f9LAi7aC6M0OXArRPX+WR9wKUAZzIUOH/x2NgcbAIjiF1q4Hre8 GxiuRV8vUMjhEoCbreLKs1kRubPDRobcKM29UOoGnWAy5PUflIYpsdUhy892BvPa+CSlfK VPmqDpLR4G7I7lLLR4jZRmDJkYSjXqcPLzr78/A1ab6wS7BPb6KoYSsg+z0Oyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740960395; a=rsa-sha256; cv=none; b=YvzURsemVPM7WytH++dVoVSON/IihhTyGX0nKBDviPo1seTskU/34U2IhP2jo7XHp2rZ+B Ay6mAJAYuwh2rpftpaAGfDPg+3W5f13cK3GLr9i3gPr08ivqC0w/FvBLOnYfedqHCP/rZR YlbiWtnk6wSyNYuuKZRk3snNQJFMww2C8OI1Y4cCUf2xEjvfFnEH34FXbUdFMqtnbqPR3g LvIesU443JpwyA+Tn05bgB2R4aFF7yMyiUoMum/nBgCUjzdJYQbuYlo+q9gScbp4qQ/kRc G59Oc+Txm6Ot9eKD7ktUuZV1Xqp8kLZserA9ncLEyv5bzS98k9C1IspEadaRIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740960395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4LuLoKM1MpZ2lb7fORLBjqSGiw07okgScjfOQe8ZZ18=; b=EOAUKjhfI4g4+VXHoBTd02qq0+tXnJEpz+2toPZa/5lLbp0m68aEtXrYBVqk3G4vOipvM7 STpSHbI4TB1qQrwUX3AMapsKMFK8upSaH0dEoTZyoBgjKWPIS6rj9r/speEu6LYY+sttuP T/a8MH8ESSfNvflklxxOnNlLjsZ3Da1beVB6So34Zh+16t/2ab50KQVBNVzk2od0RIGO7f MiAKvinRm7AWIlQx8T8t38QXvj8+WSraFS3qyitYbO8M+3fdU3LdYFApZuNxlMPyw1eczG nbQZVIK/3UiHCNMf0Cnl51R2gjLnDyUfexScLl+2bJ2nJ+Fp6mh+8smj4jRkhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5fHb0rRYz7ss; Mon, 03 Mar 2025 00:06: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 52306Zu3098891; Mon, 3 Mar 2025 00:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52306YTj098888; Mon, 3 Mar 2025 00:06:34 GMT (envelope-from git) Date: Mon, 3 Mar 2025 00:06:34 GMT Message-Id: <202503030006.52306YTj098888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 991dbf9f4327 - main - vm_page: drop page_iter_lookup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 991dbf9f4327bfff0098e472f9395d889c4a546c Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=991dbf9f4327bfff0098e472f9395d889c4a546c commit 991dbf9f4327bfff0098e472f9395d889c4a546c Author: Doug Moore AuthorDate: 2025-03-03 00:05:02 +0000 Commit: Doug Moore CommitDate: 2025-03-03 00:05:02 +0000 vm_page: drop page_iter_lookup The functions vm_page_iter_lookup and vm_page_iter_lookup_ge are just wrappers around vm_radix_iter_lookup and vm_radix_iter_lookup_ge, respectively. They server no real purpose, so drop them and use the vm_radix versions everywhere. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49203 --- sys/vm/device_pager.c | 5 +++-- sys/vm/swap_pager.c | 12 ++++++------ sys/vm/vm_kern.c | 4 ++-- sys/vm/vm_object.c | 8 ++++---- sys/vm/vm_page.c | 31 ------------------------------- sys/vm/vm_page.h | 2 -- 6 files changed, 15 insertions(+), 47 deletions(-) diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 24241d118c7a..0691d43a5946 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -267,7 +268,7 @@ cdev_pager_free_page(vm_object_t object, vm_page_t m) struct pctrie_iter pages; vm_page_iter_init(&pages, object); - vm_page_iter_lookup(&pages, m->pindex); + vm_radix_iter_lookup(&pages, m->pindex); cdev_mgtdev_pager_free_page(&pages, m); } else if (object->type == OBJT_DEVICE) dev_pager_free_page(object, m); @@ -292,7 +293,7 @@ cdev_mgtdev_pager_free_pages(vm_object_t object) vm_page_iter_init(&pages, object); VM_OBJECT_WLOCK(object); retry: - for (m = vm_page_iter_lookup_ge(&pages, 0); m != NULL; + for (m = vm_radix_iter_lookup_ge(&pages, 0); m != NULL; m = vm_radix_iter_step(&pages)) { if (!vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL)) { pctrie_iter_reset(&pages); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index dbe0b6710367..0dee95fb2c5e 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1966,7 +1966,7 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) * found page has pending operations, sleep and restart * the scan. */ - m = vm_page_iter_lookup(&pages, blks.index + i); + m = vm_radix_iter_lookup(&pages, blks.index + i); if (m != NULL && (m->oflags & VPO_SWAPINPROG) != 0) { m->oflags |= VPO_SWAPSLEEP; VM_OBJECT_SLEEP(object, &object->handle, PSWP, @@ -2393,7 +2393,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, continue; swp_pager_update_freerange(&range, sb->d[i]); if (freed != NULL) { - m = vm_page_iter_lookup(&pages, blks.index + i); + m = vm_radix_iter_lookup(&pages, blks.index + i); if (m == NULL || vm_page_none_valid(m)) fc++; } @@ -2511,7 +2511,7 @@ swap_pager_seek_data(vm_object_t object, vm_pindex_t pindex) VM_OBJECT_ASSERT_RLOCKED(object); vm_page_iter_init(&pages, object); - m = vm_page_iter_lookup_ge(&pages, pindex); + m = vm_radix_iter_lookup_ge(&pages, pindex); if (m != NULL && pages.index == pindex && vm_page_any_valid(m)) return (pages.index); swblk_iter_init_only(&blks, object); @@ -2546,7 +2546,7 @@ swap_pager_seek_hole(vm_object_t object, vm_pindex_t pindex) VM_OBJECT_ASSERT_RLOCKED(object); vm_page_iter_init(&pages, object); swblk_iter_init_only(&blks, object); - while (((m = vm_page_iter_lookup(&pages, pindex)) != NULL && + while (((m = vm_radix_iter_lookup(&pages, pindex)) != NULL && vm_page_any_valid(m)) || ((sb = swblk_iter_lookup(&blks, pindex)) != NULL && sb->d[pindex % SWAP_META_PAGES] != SWAPBLK_NONE)) @@ -2591,7 +2591,7 @@ swap_pager_scan_all_shadowed(vm_object_t object) pv = ps = pi = backing_offset_index - 1; for (;;) { if (pi == pv) { - p = vm_page_iter_lookup_ge(&backing_pages, pv + 1); + p = vm_radix_iter_lookup_ge(&backing_pages, pv + 1); pv = p != NULL ? p->pindex : backing_object->size; } if (pi == ps) @@ -2633,7 +2633,7 @@ swap_pager_scan_all_shadowed(vm_object_t object) * object and we might as well give up now. */ new_pindex = pi - backing_offset_index; - pp = vm_page_iter_lookup(&pages, new_pindex); + pp = vm_radix_iter_lookup(&pages, new_pindex); /* * The valid check here is stable due to object lock being diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 2b85dbde1dd6..8945061aabdc 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -650,14 +650,14 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size) end = offset + size; VM_OBJECT_WLOCK(object); vm_page_iter_init(&pages, object); - m = vm_page_iter_lookup(&pages, atop(offset)); + m = vm_radix_iter_lookup(&pages, atop(offset)); domain = vm_page_domain(m); if (__predict_true((m->oflags & VPO_KMEM_EXEC) == 0)) arena = vm_dom[domain].vmd_kernel_arena; else arena = vm_dom[domain].vmd_kernel_rwx_arena; for (; offset < end; offset += PAGE_SIZE, - m = vm_page_iter_lookup(&pages, atop(offset))) { + m = vm_radix_iter_lookup(&pages, atop(offset))) { vm_page_xbusy_claim(m); vm_page_unwire_noq(m); vm_page_iter_free(&pages, m); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 0f0f8cc6f5bf..9269103d8d91 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1577,7 +1577,7 @@ vm_object_split(vm_map_entry_t entry) vm_page_iter_limit_init(&pages, orig_object, offidxstart + size); retry: pctrie_iter_reset(&pages); - for (m = vm_page_iter_lookup_ge(&pages, offidxstart); m != NULL; + for (m = vm_radix_iter_lookup_ge(&pages, offidxstart); m != NULL; m = vm_radix_iter_step(&pages)) { /* * We must wait for pending I/O to complete before we can @@ -1681,7 +1681,7 @@ vm_object_collapse_scan_wait(struct pctrie_iter *pages, vm_object_t object, } VM_OBJECT_WLOCK(backing_object); vm_page_iter_init(pages, backing_object); - return (vm_page_iter_lookup_ge(pages, 0)); + return (vm_radix_iter_lookup_ge(pages, 0)); } static void @@ -1702,7 +1702,7 @@ vm_object_collapse_scan(vm_object_t object) * Our scan */ vm_page_iter_init(&pages, backing_object); - for (p = vm_page_iter_lookup_ge(&pages, 0); p != NULL; p = next) { + for (p = vm_radix_iter_lookup_ge(&pages, 0); p != NULL; p = next) { /* * Check for busy page */ @@ -1997,7 +1997,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, vm_page_iter_limit_init(&pages, object, end); again: pctrie_iter_reset(&pages); - for (p = vm_page_iter_lookup_ge(&pages, start); p != NULL; + for (p = vm_radix_iter_lookup_ge(&pages, start); p != NULL; p = vm_radix_iter_step(&pages)) { /* * Skip invalid pages if asked to do so. Try to avoid acquiring diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index e9c371e62d70..4d9a57544487 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1836,21 +1836,6 @@ vm_page_iter_limit_init(struct pctrie_iter *pages, vm_object_t object, vm_radix_iter_limit_init(pages, &object->rtree, limit); } -/* - * vm_page_iter_lookup: - * - * Returns the page associated with the object/offset pair specified, and - * stores the path to its position; if none is found, NULL is returned. - * - * The iter pctrie must be locked. - */ -vm_page_t -vm_page_iter_lookup(struct pctrie_iter *pages, vm_pindex_t pindex) -{ - - return (vm_radix_iter_lookup(pages, pindex)); -} - /* * vm_page_lookup_unlocked: * @@ -1935,22 +1920,6 @@ vm_page_find_least(vm_object_t object, vm_pindex_t pindex) return (m); } -/* - * vm_page_iter_lookup_ge: - * - * Returns the page associated with the object with least pindex - * greater than or equal to the parameter pindex, or NULL. Initializes the - * iterator to point to that page. - * - * The iter pctrie must be locked. - */ -vm_page_t -vm_page_iter_lookup_ge(struct pctrie_iter *pages, vm_pindex_t pindex) -{ - - return (vm_radix_iter_lookup_ge(pages, pindex)); -} - /* * Returns the given page's successor (by pindex) within the object if it is * resident; if none is found, NULL is returned. diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 05c16212a995..1cac80c6a8ef 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -645,7 +645,6 @@ void vm_page_deactivate_noreuse(vm_page_t); void vm_page_dequeue(vm_page_t m); void vm_page_dequeue_deferred(vm_page_t m); vm_page_t vm_page_find_least(vm_object_t, vm_pindex_t); -vm_page_t vm_page_iter_lookup_ge(struct pctrie_iter *, vm_pindex_t); void vm_page_free_invalid(vm_page_t); vm_page_t vm_page_getfake(vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); @@ -656,7 +655,6 @@ void vm_page_invalid(vm_page_t m); void vm_page_iter_free(struct pctrie_iter *pages, vm_page_t m); void vm_page_iter_init(struct pctrie_iter *, vm_object_t); void vm_page_iter_limit_init(struct pctrie_iter *, vm_object_t, vm_pindex_t); -vm_page_t vm_page_iter_lookup(struct pctrie_iter *, vm_pindex_t); bool vm_page_iter_remove(struct pctrie_iter *pages, vm_page_t m); bool vm_page_iter_rename(struct pctrie_iter *old_pages, vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex); From nobody Mon Mar 3 00:08:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5fKt4n66z59Tkc; Mon, 03 Mar 2025 00:08: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 4Z5fKt01dlz40KP; Mon, 03 Mar 2025 00:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740960514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pcRkdxmP2tjkkhmejP/xqrRf1clpssJFKBqOWIJJzbY=; b=j3zCH3Xock36e7MVvKrKb16vWGKiqeICHvWKzduszqXnGRxW1Y9r/goxfIwV3uvAyWf5Ef 7RpXxsPTuoguzOqHNmDXqso78uT242zmV2VA9xn9kSTnja4CTKJer/HQyDFAdUqkozfay0 DupqLVEdZlOm6TpnEBuxrvP2LKgTdCD9issmftDi1i25x/TNdL35jIrIJtgnsV7M56t80H tdnHV54YRST44pTESZ/AwG4glC7la1Jo1MNJ0jmcDBJSdnecz1hBH4snLj0l0xKPlm1DUA BvEhZSmChzOaD7KRyv0uB2aiWkIjpfRvW/C1X91sgN5DN7d9umxENjbpK/q/Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740960514; a=rsa-sha256; cv=none; b=wTwzpS02buVsY1QDF+KDjOrHdu80HCBngFFdLJeewV8tI2CXTARr7JHfq/J/1VZDsU2Iu9 vCq1QNlayJ40aZJr1DmuZFh0kuW5w0oc+ZsMPlnRIa4X6XV+oQopm18m0smEvwsPoSVoiF wWn+cm4cKq7aoAeGn8m1RsB1I+R37boz/IL0j+9XooyDTtCLyKxfISvMF15p3ww7UgUYMy w29UZt0YuWihPy6KYoBQ+wdCtej8BMGtkf/TIS5JEL0JhYRVsiHBYZ2hJHr6J4fXgVUhQn eVdtLy4LTUY6G9B2KN205NUbcq7NzDGHhsQ88UDkvLYaR28UC05Mf7LOlt20WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740960514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pcRkdxmP2tjkkhmejP/xqrRf1clpssJFKBqOWIJJzbY=; b=J8S9DozQRLo3Zx0hbotoGMQ9nSAX7U0QiK99+lKPEkYW3rG6UJ4UIAEt0dRhbRAKlouYXl Spuc9gZc7hMZ3yn9ZzKRSxs2pY5uTNCn7MPhVu1unPV5XKSdWJgAz57q9sM4zB2Ex6b7U7 7QcgHAi4uDMMHE5hkTZJAzt/WszGFfFcwRvzf6lOsBhzcoq3hkM7dKjBxm6FVIXQveiXtU k9rUTzMPS9MtLQUrOuKAHLqTQd7p2W0z5ueS6E3R34WglbwdWH6VYNhzvAb0uAoW3PmnB8 VU5wkHN2Y2g5bjSgUDfQP2ch3/BxGzEQxjzFmahGqEag+qJ7zwKMPMciMgufJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5fKs66K9z7Zj; Mon, 03 Mar 2025 00:08: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 52308Xjp099620; Mon, 3 Mar 2025 00:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52308XWa099617; Mon, 3 Mar 2025 00:08:33 GMT (envelope-from git) Date: Mon, 3 Mar 2025 00:08:33 GMT Message-Id: <202503030008.52308XWa099617@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: bb9c3f5121b4 - main - amdiommu: fix typo in the bit description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb9c3f5121b42eeda2972d282a54d4eff800297c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bb9c3f5121b42eeda2972d282a54d4eff800297c commit bb9c3f5121b42eeda2972d282a54d4eff800297c Author: Konstantin Belousov AuthorDate: 2025-03-03 00:06:30 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-03 00:08:29 +0000 amdiommu: fix typo in the bit description Noted by: alc Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/amd_reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/iommu/amd_reg.h b/sys/x86/iommu/amd_reg.h index 53b8b0cb42fc..fab6d03ea64a 100644 --- a/sys/x86/iommu/amd_reg.h +++ b/sys/x86/iommu/amd_reg.h @@ -263,7 +263,7 @@ * IOMMU Extended Feature2 register fields. * All currently defined bits are RO. */ -#define AMDIOMMU_EFR2_TMPMSUP 0x0000000000000004ull /* Tired Mem Migration */ +#define AMDIOMMU_EFR2_TMPMSUP 0x0000000000000004ull /* Tiered Mem Migration */ #define AMDIOMMU_EFR2_GCR3TRPM 0x0000000000000008ull /* GPA based GCR3 pointer in DTE */ #define AMDIOMMU_EFR2_GAPPID 0x0000000000000010ull /* masking of GAPIC PPI */ #define AMDIOMMU_EFR2_SNPAVIC_MASK 0x00000000000000e0ull /* SNP-enabled Adv intr features */ From nobody Mon Mar 3 00:46:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5g9r600Kz5Vb5y; Mon, 03 Mar 2025 00:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5g9r3MGwz3bs0; Mon, 03 Mar 2025 00:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740962800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHuCuHHqBAQkET0sx0Zw9brZz2QqW3Bgj74TZezJoZ0=; b=SZ0GjCA2dRAV3ywsR+1cfE2gRNYvQxI60HwTVVYACIqzLChgB8xeon+6b5kS93upCM/uPc wTDwq91M1JY7WD2XMiU6IH2I2z/Q+mnKzhYERTjMJgzLjtU7WyxUZ5ZhoH73Am36qMrWde rZVfVbDayO/8XxbohqQttYZy6hr0zLHHdNf6rYHXqHWM9mJNbn0WYiuSs/S4G7LThHry49 HA5ABLA5UCoEVIbqXA7TEEj/LF5R6YePfi0Wf/Vz5XlPI1Pnl6Hvlqsb3Nl4LXfjIT+HMu zYc06ybiG2xDB6wjdOFhaSQ8ojIsFomfX6BdvLiraSq20gIVLswKPIkAksbQSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740962800; a=rsa-sha256; cv=none; b=wRWxvhsuIMdtPd2uDpbe+Cd73tp8y1JP5YsQUNGp58C213dghkeSb9Bol3544UBiEnHbyd zRwuA5n0CqvEGvv7oTvFFkMv06Q+9O4P65hlrNeN/6ycFlIz8fTiildd+Rj9zaF1OQBD8r o1pgKFCpc0+vBzx8x3anH8ojd0h5djSpwe3ovWL6NGF4VTeiDnx5nAkv0ps0vaJe1Sta8y Y10SjLo1/3VKJllibL5Za6Xnhpr4wbu0sBSLe0ykXzPyewopQQ+KWJiQgkG68bEOgtCZk0 bc34Xhi4BvkX1rwbjYOFPfSFg7uUdHlK4kqkCdIELaCmkzH3NE4b9jy51lK89A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740962800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHuCuHHqBAQkET0sx0Zw9brZz2QqW3Bgj74TZezJoZ0=; b=Z8D1ZNR/nUg9AzVlKJ/jsYoYZcdQWxGL1BqHXV0mshQYJt6eSYWqK9vFW+pkj3H1/5mFCF WMha+tCtF+FtDBQEsb2pOUf2hIP1n1AOBf4R01IrtGa13uG8fgM1rsPTj5QKtSJT/uQrR7 Bhs7m8O4AIFHMZZ1Gh0f6YBps6OwN//heLqYIN0SZ5bu6ZNhEcEx65QN6bFWFPPvfXHCcu sTts0WagH1jirl6L0mFkVp1ozPm2Z3ytb4Uxc10chZB1Z6TPHU/TVoYI0tEKi/OlcU3tkX vI8tuZn7o0IJtpPhDZgel71sX/6EIgdkYvR632ZWdoywuTthrBAAUFOgEuXVtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5g9r2rvkz94J; Mon, 03 Mar 2025 00:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5230kepF072817; Mon, 3 Mar 2025 00:46:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5230keuJ072814; Mon, 3 Mar 2025 00:46:40 GMT (envelope-from git) Date: Mon, 3 Mar 2025 00:46:40 GMT Message-Id: <202503030046.5230keuJ072814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ravi Pokala Subject: git: 916476b149a3 - stable/14 - if_infininband: Support BPF write for broadcast frames List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 916476b149a3f3177d1213ae46fa3858c46ce5ad Auto-Submitted: auto-generated The branch stable/14 has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=916476b149a3f3177d1213ae46fa3858c46ce5ad commit 916476b149a3f3177d1213ae46fa3858c46ce5ad Author: Nicholas Dance AuthorDate: 2025-02-05 23:33:20 +0000 Commit: Ravi Pokala CommitDate: 2025-03-03 00:41:29 +0000 if_infininband: Support BPF write for broadcast frames To support DHCP for IPoIB links, DHCP clients and servers require the ability to transmit link-layer broadcasts on the IB interfaces. BPF provides the mechanism for doing this. This change updates the if_infiniband driver to be capable of accepting link-layer broadcast requests via BPF using Ethernet formatted frames (the driver currently registers with BPF as DLT_EN10MB). Only Broadcast frames can reliably be interpreted using the Ethernet header format so detect unicast and multicast frames are rejected if passed in using the Ethernet format. This doesn't impact the ability to support native unicast, broadcast or multicast frames if native infiniband header support is added to BPF at a later date. Further the above, this commit also addresses an issue in the existing code that can result in separation of part of the packet header from the rest of the payload if a BPF write was attempted. This was caused by mbuf preallocation of the infiniband header length regardless of length of the prepend data. Reviewed by: rpokala; Greg Foster Tested by: Greg Foster MFC after: 1 week Sponsored by: Vdura Pull Request: https://github.com/freebsd/freebsd-src/pull/1591 (cherry picked from commit 8d079c6a9a5dfdc75adaf9bc31f2ee8111b849a1) --- sys/net/if_infiniband.c | 57 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/sys/net/if_infiniband.c b/sys/net/if_infiniband.c index 98ea87098fea..7ef22911803b 100644 --- a/sys/net/if_infiniband.c +++ b/sys/net/if_infiniband.c @@ -150,6 +150,43 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb) mb->m_pkthdr.len += sizeof(*ibh); } +/* + * For clients using BPF to send broadcasts. + * + * This driver binds to BPF as an EN10MB (Ethernet) device type. As such, it is + * expected BPF and BPF users will send frames with Ethernet headers, which + * we'll do our best to handle. We can't resolve non-native unicast or multicast + * link-layer addresses, but we can handle broadcast frames. + * + * phlen is populated with IB header size if ibh was populated, 0 otherwise. + */ +static int +infiniband_resolve_bpf(struct ifnet *ifp, const struct sockaddr *dst, + struct mbuf *mb, const struct route *ro, struct infiniband_header *ibh, + int *phlen) +{ + struct ether_header *eh = (struct ether_header *)ro->ro_prepend; + /* If the prepend data & address length don't have the signature of a frame + * forwarded by BPF, allow frame to passthrough. */ + if (((ro->ro_flags & RT_HAS_HEADER) == 0) || + (ro->ro_plen != ETHER_HDR_LEN)) { + *phlen = 0; + return (0); + } + + /* Looks like this frame is from BPF. Handle broadcasts, reject otherwise */ + if (!ETHER_IS_BROADCAST(eh->ether_dhost)) + return (EOPNOTSUPP); + + memcpy(ibh->ib_hwaddr, ifp->if_broadcastaddr, sizeof(ibh->ib_hwaddr)); + ibh->ib_protocol = eh->ether_type; + mb->m_flags &= ~M_MCAST; + mb->m_flags |= M_BCAST; + + *phlen = INFINIBAND_HDR_LEN; + return (0); +} + static void update_mbuf_csumflags(struct mbuf *src, struct mbuf *dst) { @@ -307,7 +344,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, struct llentry *lle = NULL; struct infiniband_header *ih; int error = 0; - int hlen; /* link layer header length */ + int hlen = 0; /* link layer header length */ uint32_t pflags; bool addref; @@ -317,10 +354,20 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, phdr = NULL; pflags = 0; if (ro != NULL) { - /* XXX BPF uses ro_prepend */ + /* XXX BPF and ARP use ro_prepend */ if (ro->ro_prepend != NULL) { - phdr = ro->ro_prepend; - hlen = ro->ro_plen; + ih = (struct infiniband_header *)linkhdr; + /* Assess whether frame is from BPF and handle */ + error = infiniband_resolve_bpf(ifp, dst, m, ro, ih, &hlen); + if (error != 0) + goto bad; + + if (hlen != 0) { + phdr = linkhdr; + } else { + phdr = ro->ro_prepend; + hlen = ro->ro_plen; + } } else if (!(m->m_flags & (M_BCAST | M_MCAST))) { if ((ro->ro_flags & RT_LLE_CACHE) != 0) { lle = ro->ro_lle; @@ -387,7 +434,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, * Add local infiniband header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, INFINIBAND_HDR_LEN, M_NOWAIT); + M_PREPEND(m, hlen, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; From nobody Mon Mar 3 01:39:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5hMD4ppXz5VgQP; Mon, 03 Mar 2025 01:39: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 4Z5hMD42Llz4Kx0; Mon, 03 Mar 2025 01:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740965992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1HTLqtgbnwfNOIuuus6BhRyOwJCMnwaNNuWsVBTSz8=; b=GpsfKrx5U4N4TiPMwOejfrythSfGeiKL56QlnIDt06IkhJ1j7iaB6E9azYOM/l09DQjVa5 MC/92sfRJWcJzuEnblTgEdRTC4bW2zqlVxr/Ls1BPHqyIeoPz3Hdn0VXZvoxFRMYryCBUj bmo/IgoDhyEYCB9NQMpKupihqlmM2ajj8w8/TPkdJLC9a9aNycWeK3+2ksWORs76Oe6G/3 1suzVppeXhMQj8ZjOVhGpKxUVq9fhGSK/f4LHVcUN5vGhAgGOp1mqQN4H6CZNDq+pybANR Iitr2s6+IPc34y6CJlvSZKfCT6rt7kQXL0PddJsQeska65izzufEFFMYeoSUUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740965992; a=rsa-sha256; cv=none; b=xBSHJMzQP5SVmQES10ljde8ymRCQl9zyQvZhhZkxuA5EVBH6gRKqG5BxENNiCVg/X3Ci2E Di5RzZw8DM8omAHWOqxPAvtQOehiJw3XQc/caK/120TDzobT590Q5969g0U2BXZPr6mUKv MxuQ9qtkxrIWmR+xGI4lYqBTuBFg7Sl7v38OT8Q3HrZDGpF/7uo1IYeianfMstw0c7uTqj t1Evg0ywsfAM0mH7WlRl9fdzawhNiAYUtVoHJHUn8wyCrj9/k4sUzpQllGqvXnoaCLY+kw 9tDTHAcUYNlc1v9FTP7Dim2fcPgW6TGKwWXJqa8DjlGbOotIs7su4FTZAYuDyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740965992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1HTLqtgbnwfNOIuuus6BhRyOwJCMnwaNNuWsVBTSz8=; b=q+afr/3wM+1O2OYU3CAYuQrRQaXHrJsp1Cbis7aXS6vAXrzjyY+ACtHvndN6rimrVOG1BG 1iQiAc0Mn1/zSRsdQU6Z1m7Dc7apKhPQa5xJinSkRVHfhwKvvINtl2QSrdoftXUiIaLkS8 0wqCNPymkyUhMdG72VnTYFB+OqJrTM/0ooRL/QvWMfFLRENN7S1f/wvGKgek8oavxMEF8T kKaPpT20p14HAyaAP5ZfJZ0/W8ecnkDQo/KSbCUrxXwp31FVN18RdAoqGKTJmh0ng0qqG1 hkQlNtx1PvOpxuqA3/KzlDwHA5YzPUkzOHeP+Dyly6GJRoN7VF8A5oiesQFazw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5hMD38wdzBKX; Mon, 03 Mar 2025 01:39: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 5231dqfi066739; Mon, 3 Mar 2025 01:39:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5231dqkb066736; Mon, 3 Mar 2025 01:39:52 GMT (envelope-from git) Date: Mon, 3 Mar 2025 01:39:52 GMT Message-Id: <202503030139.5231dqkb066736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Lo Subject: git: 42ba6765c932 - stable/13 - ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 42ba6765c9328dd283e76ba26c048868033c89b2 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=42ba6765c9328dd283e76ba26c048868033c89b2 commit 42ba6765c9328dd283e76ba26c048868033c89b2 Author: Kevin Lo AuthorDate: 2025-02-28 08:12:00 +0000 Commit: Kevin Lo CommitDate: 2025-03-03 01:39:28 +0000 ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 (cherry picked from commit 5c7087c349fc1d826807aa1a11912c9e774e3321) --- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 5f1f64e02b82..0b866e7a39af 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -297,7 +297,7 @@ static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); vf_mailbox |= hw->mbx.vf_mailbox; - hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; + hw->mbx.vf_mailbox |= vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS; return vf_mailbox; } From nobody Mon Mar 3 01:55:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5hj56GyKz5VhVs; Mon, 03 Mar 2025 01:55: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 4Z5hj55LLwz3CZk; Mon, 03 Mar 2025 01:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740966921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/bkljQduyE15WAaHwVjPKeiRXzoE7TNnOkE9yQXok1s=; b=g9+ab6M6Perc6cuCzguhq1N1sE29xBjv1G6r/tJ0UjbhpkUXl2mC1H4obL3oB1R1uFuXwH yBXDnWjTw+IgevLlaN/Kj9nFBcPUF92o37hoMtp2gRotsNpPdYSc0o3GGCGMpTKmsjVMy9 6CGBXq5E1TD0envoAVdDD5t4UHmz3gkw1CANDC4qLS2FvO0ZoRsyKJD0/so38cPEGqd8q8 WD2txrZcloRWpmMOkSBuFm6lUzLVmM4joxnb8++ZRwcIUPJ1f5lPcb9CIGw6zS46AdKtVM vwxJ5Jv3U/dXPmBVUekz1Z65fjYZ9Nb2mQFhGyhJUvW3jWVb827brwH9IyWdHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740966921; a=rsa-sha256; cv=none; b=pCBFWMaFW3fd2ZTsFt8j4AYPTfbN2RqwxOhK2q/FRdbBHNogLp5azGKWIrIwLzH2ra5o7o QTV+JCmsPMxAEjv3XoPld8ARRx/oxQwIBUIqjkGwUGGLIMuHxSoTJGec64TaoX0OzsomqJ TDcQX8wnMXm0NXST6szo0y6BnOAth0N7cXvil+mBBWNJf/g8O2HaTWNr7z9wjAjOgZf2qx PeXSqbRsehAYu+/rG1bgSrHXKaVlFAf0x9mFllA69fhUD1P3pHdbp7ZX/+GJZ3R1Fj1gx7 Ui7Dhw3e/f3ROsJF9D/rX2zbLK20SgQF+6ASgyntRF8eknW0xVLM4pB28HT6Yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740966921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/bkljQduyE15WAaHwVjPKeiRXzoE7TNnOkE9yQXok1s=; b=rcjf9brxu6HiY/ffSrXA4G3Rl0BXqwniu43yXiMFUsVT/nVlsCu7+7CDn8wgfnk82rCLgI 9PxpCWQpsi0X+2ivR0Ubp97tb1YT11W1Qa4EJaQRFeq+PnzE2uDPBQ7H5Mo5DV8tnTeaOi r5uP5xAc1u933vO8iulxZlW63rtpUJfPXBqis4lBm0fY7bwcY/girb5/HG4CruUPkNysxI PERNsasoE11VPnqoNRlDNBswDBL7jAEatYq1E7ExeSEFF+dnqJ665FbO1WBvrF0NT+9n34 KUEQEmpbdJz5bn0wglb7TJys6/8DMYy9xDZZ6XJEeqcDBX7dER/JHBRthYcKMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5hj54d9mzBXN; Mon, 03 Mar 2025 01:55: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 5231tLaq002178; Mon, 3 Mar 2025 01:55:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5231tLSN002175; Mon, 3 Mar 2025 01:55:21 GMT (envelope-from git) Date: Mon, 3 Mar 2025 01:55:21 GMT Message-Id: <202503030155.5231tLSN002175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9f5457996e00 - stable/14 - nfscl: Move delegation high water variables into clientID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f5457996e005e12db7737bddaada55c83f55e6a Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9f5457996e005e12db7737bddaada55c83f55e6a commit 9f5457996e005e12db7737bddaada55c83f55e6a Author: Rick Macklem AuthorDate: 2025-02-17 00:01:54 +0000 Commit: Rick Macklem CommitDate: 2025-03-03 01:54:10 +0000 nfscl: Move delegation high water variables into clientID Without this patch, the variables used to maintain a high water limit for delegations are global and apply to all mounts. This patch moves them into the clientID structure, which makes them per mount. This is needed to add support for the CB_RECALL_ANY callback in a future commit. The only effect of this patch is an increase in the total number of delegations held if there are multiple NFSv4 mounts to NFSv4 servers with delegations enabled. Since the default of NFSCLDELEGHIGHWATER is fairly small, this should not have a significant impact. (cherry picked from commit f5aff1871d3273b3cd3621ea5d3e37cdd807e66f) --- sys/fs/nfs/nfsclstate.h | 2 ++ sys/fs/nfsclient/nfs_clstate.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h index d9f5ed13b54f..84088a2a4fd2 100644 --- a/sys/fs/nfs/nfsclstate.h +++ b/sys/fs/nfs/nfsclstate.h @@ -116,6 +116,8 @@ struct nfsclclient { struct proc *nfsc_renewthread; struct nfsmount *nfsc_nmp; time_t nfsc_expire; + int nfsc_delegcnt; + int nfsc_deleghighwater; u_int32_t nfsc_clientidrev; u_int32_t nfsc_rev; u_int32_t nfsc_renew; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index e803c2cfb973..ad30a306c31d 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -94,8 +94,6 @@ NFSCLSTATEMUTEX; int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ -static int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; -static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, u_int8_t *, int, u_int8_t *, u_int8_t *, u_int32_t, @@ -463,7 +461,7 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, nfsdl_hash); dp->nfsdl_timestamp = NFSD_MONOSEC + 120; nfsstatsv1.cldelegates++; - nfscl_delegcnt++; + clp->nfsc_delegcnt++; } else { /* * A delegation already exists. If the new one is a Write @@ -923,6 +921,8 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, for (i = 0; i < NFSCLLAYOUTHASHSIZE; i++) LIST_INIT(&clp->nfsc_layouthash[i]); clp->nfsc_flags = NFSCLFLAGS_INITED; + clp->nfsc_delegcnt = 0; + clp->nfsc_deleghighwater = NFSCLDELEGHIGHWATER; clp->nfsc_clientidrev = 1; clp->nfsc_cbident = nfscl_nextcbident(); nfscl_fillclid(nmp->nm_clval, uuid, clp->nfsc_id, @@ -1755,10 +1755,10 @@ nfscl_freedeleg(struct nfscldeleghead *hdp, struct nfscldeleg *dp, bool freeit) TAILQ_REMOVE(hdp, dp, nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); + dp->nfsdl_clp->nfsc_delegcnt--; if (freeit) free(dp, M_NFSCLDELEG); nfsstatsv1.cldelegates--; - nfscl_delegcnt--; } /* @@ -2868,7 +2868,7 @@ tryagain: nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list); - nfscl_delegcnt--; + clp->nfsc_delegcnt--; nfsstatsv1.cldelegates--; } NFSLOCKCLSTATE(); @@ -2898,7 +2898,8 @@ tryagain: * The tailq list is in LRU order. */ dp = TAILQ_LAST(&clp->nfsc_deleg, nfscldeleghead); - while (nfscl_delegcnt > nfscl_deleghighwater && dp != NULL) { + while (clp->nfsc_delegcnt > clp->nfsc_deleghighwater && + dp != NULL) { ndp = TAILQ_PREV(dp, nfscldeleghead, nfsdl_list); if (dp->nfsdl_rwlock.nfslock_usecnt == 0 && dp->nfsdl_rwlock.nfslock_lock == 0 && @@ -2925,7 +2926,7 @@ tryagain: TAILQ_REMOVE(&clp->nfsc_deleg, dp, nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list); - nfscl_delegcnt--; + clp->nfsc_delegcnt--; nfsstatsv1.cldelegates--; } } From nobody Mon Mar 3 01:56:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5hkN4Qj1z5VhW4; Mon, 03 Mar 2025 01:56: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 4Z5hkN3jXvz3D4M; Mon, 03 Mar 2025 01:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740966988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vvEDs1B00Sl/E9H0l3nWSI5Uk8N6GVDebY38JCamzaM=; b=JwklflnZQMQWCBcU6zgbi1ybW8K/d6tix9+xXJxTmPvVP+2DZ4qvwlcsVfKVk+F9C2OXhV j7tKPowAIC1s2CslF5gZuiIZk53sfkrRCyRZ2W90VIiNfN8R1I1h8LD6JF/rOnqZvfO5cJ Q7RCCLSgE/A0go5DNJq2B9WzSpvjelyPKD5d6XmUwXt0IheoGw3o5XrlxiL/k8wIT2QakE ir3grE+s60qPMlKn3hXdMLVpxCbFWXjN1PXyG1Bq5T2dsxX49rfqgNFxc/flja0k+9plBW lFS77wZDJ2nXFpbA4C//nU+zZJk4SJzAVaf5UD7sV7hseLRD8nxV108EZ4nS8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740966988; a=rsa-sha256; cv=none; b=ImCI6b1u4qy08CQto2T5/Nx0b3ui+HB41W4rbw1rd30r2VhAGV/M/AlKJFrF42VCLQbnw0 nF5WPinUuL+z+8k1BiHrYbaW9fGZGskZsg5h3QP8sbP+iFbYH6f4eAcoVlxP3TABkI+Y/o fvGzO4cEiMPaIuRV6JAnP4IlkV8lNSOke1NlqGMGo5qC+wxU+RhCJcA5oBNZivS2aObTAw D/9KxlAka7x1J+9fTcsJu23Ras39LcjFG4RZkb7g8UHS7PBw/UnwRdi6SvuzYGQXJokYGV gk/U01QogUl6eBN5cWZEHz5X1M4vgeyJdIJoRA+ArD1bNv0LFNH9i6fYU+6iuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740966988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vvEDs1B00Sl/E9H0l3nWSI5Uk8N6GVDebY38JCamzaM=; b=VHI95rgfKw+wceUpjcU6ubRe4eSq0QX1aJle5329sAmAAlcvNfhgFnrmLmMpUJx7SJHHw4 lZDjuozHU/x5sz0qdEglVR3h0Hc2EThpca+19gWyk3syJ2ue24upZdggQEpn74yjg6UnE2 L66Af9YHQVzPXwreUKjl6U6gsaCwQqtXZYpLJwxPBzqz0xz1r2RoROkLBP1cvv3myBPQud 9DoxzDhOzoxwPzkW5t38QJ6IfdgHnpCyF0VWRRx1/jtsS0SEXfaZ7vQ/IFt3Se1Xuy2fiQ 1OsBis9Bw+4EgAaL4LuQgztVGcLU/djpAdYmvtHvX2ZVb9mlVDLVz0qcG7ux5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5hkN3BkKzBXP; Mon, 03 Mar 2025 01:56: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 5231uS1P002621; Mon, 3 Mar 2025 01:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5231uSTM002618; Mon, 3 Mar 2025 01:56:28 GMT (envelope-from git) Date: Mon, 3 Mar 2025 01:56:28 GMT Message-Id: <202503030156.5231uSTM002618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: b27900b8d9db - stable/14 - nfscl: Move layout high water variables into clientID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b27900b8d9db139725bdb4e8e239a0d9ef308e4b Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b27900b8d9db139725bdb4e8e239a0d9ef308e4b commit b27900b8d9db139725bdb4e8e239a0d9ef308e4b Author: Rick Macklem AuthorDate: 2025-02-17 23:41:34 +0000 Commit: Rick Macklem CommitDate: 2025-03-03 01:55:37 +0000 nfscl: Move layout high water variables into clientID Commit f5aff1871d32 moved the delegation high water variables into the clientID structure, so that they are now per mount instead of global. This patch does the same for the layout highwater variables. It happens that the layout highwater variables are not actually used. This patch changes the code to use them. This is needed to add support for the CB_RECALL_ANY callback in a future commit. This patch only affects NFSv4.1/4.2 mounts with the "pnfs" mount option. The effect on these mounts will be minimal, since layouts are returned when they are stale and this normally ensures that the highwater mark is never hit. (cherry picked from commit 7e26f1c21049b5a1a2f490d8ac1909ccb24f0db2) --- sys/fs/nfs/nfsclstate.h | 2 ++ sys/fs/nfsclient/nfs_clstate.c | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h index 84088a2a4fd2..92669ff8d1aa 100644 --- a/sys/fs/nfs/nfsclstate.h +++ b/sys/fs/nfs/nfsclstate.h @@ -118,6 +118,8 @@ struct nfsclclient { time_t nfsc_expire; int nfsc_delegcnt; int nfsc_deleghighwater; + int nfsc_layoutcnt; + int nfsc_layouthighwater; u_int32_t nfsc_clientidrev; u_int32_t nfsc_rev; u_int32_t nfsc_renew; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index ad30a306c31d..12894e3dcb84 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -94,7 +94,6 @@ NFSCLSTATEMUTEX; int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ -static int nfscl_layoutcnt = 0; static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, u_int8_t *, int, u_int8_t *, u_int8_t *, u_int32_t, struct nfscllockowner **, struct nfsclopen **); @@ -923,6 +922,8 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, clp->nfsc_flags = NFSCLFLAGS_INITED; clp->nfsc_delegcnt = 0; clp->nfsc_deleghighwater = NFSCLDELEGHIGHWATER; + clp->nfsc_layoutcnt = 0; + clp->nfsc_layouthighwater = NFSCLLAYOUTHIGHWATER; clp->nfsc_clientidrev = 1; clp->nfsc_cbident = nfscl_nextcbident(); nfscl_fillclid(nmp->nm_clval, uuid, clp->nfsc_id, @@ -2982,13 +2983,14 @@ tryagain2: lyp = TAILQ_LAST(&clp->nfsc_layout, nfscllayouthead); while (lyp != NULL) { nlyp = TAILQ_PREV(lyp, nfscllayouthead, nfsly_list); - if (lyp->nfsly_timestamp < NFSD_MONOSEC && + if ((lyp->nfsly_timestamp < NFSD_MONOSEC || + clp->nfsc_layoutcnt > clp->nfsc_layouthighwater) && (lyp->nfsly_flags & (NFSLY_RECALL | NFSLY_RETONCLOSE)) == 0 && lyp->nfsly_lock.nfslock_usecnt == 0 && lyp->nfsly_lock.nfslock_lock == 0) { NFSCL_DEBUG(4, "ret stale lay=%d\n", - nfscl_layoutcnt); + clp->nfsc_layoutcnt); recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_NOWAIT); if (recallp == NULL) @@ -5293,7 +5295,7 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, LIST_INSERT_HEAD(NFSCLLAYOUTHASH(clp, fhp, fhlen), lyp, nfsly_hash); lyp->nfsly_timestamp = NFSD_MONOSEC + 120; - nfscl_layoutcnt++; + clp->nfsc_layoutcnt++; nfsstatsv1.cllayouts++; } else { if (retonclose != 0) @@ -5668,7 +5670,7 @@ nfscl_freelayout(struct nfscllayout *layp) LIST_REMOVE(rp, nfsrecly_list); free(rp, M_NFSLAYRECALL); } - nfscl_layoutcnt--; + layp->nfsly_clp->nfsc_layoutcnt--; nfsstatsv1.cllayouts--; free(layp, M_NFSLAYOUT); } From nobody Mon Mar 3 05:32:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5nW913jBz5nhJR; Mon, 03 Mar 2025 05:32: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 4Z5nW90XG1z3sZt; Mon, 03 Mar 2025 05:32:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740979925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cahrw5t6PTzQYC2TIv7o5Nk6+TZpWVtyx/SuK0RXH/U=; b=PkJdVRMoQnmHvtnKCcZigI9zrgOs6Q1ZwezZ86NG58uwi7cQipOgLJKWgpPOi+DqHUdP/g HQv0vo9jmQOXErknRpbYSOQ3WXp0ndVE5nTVh2OdlLcA1O3UQbNGGUyM3DWaR8m5z3LDnN ulYC0ta/ByxDXGEY32KpYZy6oVNUZ1KLhgKsbpgjZFJtBgAcRygHFMmnwPGxuGc1OGDOmA vfVc2hl6EtHT73A/h34+K+Y6lr5cuP824Z4tp/DYCLTsrT8h8di88cx2tQLS500No4zfgY yYdTLojBLpatAlIwGRNF9k5VrDUft4R2kbrw3llgrT2KDe6vja5n26l0GpjzHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740979925; a=rsa-sha256; cv=none; b=hrnQ6QWF7jzKZHKl4Vm9ondwiHgJp8XAkxXGrDj5O5oNQI7Axiw144AAcFB+aomNg7otL1 LqUdVuWCSE2pf5/9AFMOCSUVW0iHddKuFiuZldgTkg5p/ht66Ja+wilZhpRd1MPoH5RZDU CNGqPFO+6O5nrZ7bOeAbAD3omPpSD/QO5iyx86N2ILKcf8sUGwQEuRBNBE1GCE6a3WLfpN ktRG2wvW//CUwHiTSJiooi2LSHifYFC34E3gfd24uNc8YXnpo78IDPab9z9haQEpnMDQnn fjYcyPVK+SRAvSr51o94bCmGU6USGhUpdrsVHQG2VahPhZWtvFbaYPnZsrq6Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740979925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cahrw5t6PTzQYC2TIv7o5Nk6+TZpWVtyx/SuK0RXH/U=; b=QejS4RKEcAiS0Aeaq4iS/Z2wUZqO7sOhm8iYVvRgOybPL0RMXcC2owoeBSVgJBfRBjCkzE c4YYfbnm65C9Qr1YT5cICUtQN56XN1zD4I+9hFIodlxw/lv9P9efpZispALaKhxEacuvCl fVu7y7qfRQKCUYvmCETw2TL4i/v/HNpE/W0pgwBkTMbMJFs3KIv7hCqF31DbrqEfYjc73i SENo9N+SF8e7+ftra100DT2pp1KQ2SnCS9yqwBGEZhaZ3w8YzL/klf/QOVEpU6IJMGPO7X HqEscveiXtcVuKyiIkaOwHDc3IEFeBYhUrQi7Zc6IL2qkv5XnCx5vvvG9FojRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5nW907yDzbVY; Mon, 03 Mar 2025 05:32: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 5235W4dk013800; Mon, 3 Mar 2025 05:32:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5235W4CK013797; Mon, 3 Mar 2025 05:32:04 GMT (envelope-from git) Date: Mon, 3 Mar 2025 05:32:04 GMT Message-Id: <202503030532.5235W4CK013797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 8f652eb792ba - stable/14 - stand: Fix brand positioning on framebuffer console List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8f652eb792baf5902a367f68ea02014fdc47313d Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8f652eb792baf5902a367f68ea02014fdc47313d commit 8f652eb792baf5902a367f68ea02014fdc47313d Author: Jose Luis Duran AuthorDate: 2025-02-24 14:36:10 +0000 Commit: Jose Luis Duran CommitDate: 2025-03-03 05:29:47 +0000 stand: Fix brand positioning on framebuffer console The drawer.lua script ignores the values in loader_brand_x and loader_brand_y on framebuffer consoles, always positioning the brand at (1, 1). Allow it to be positioned by accepting the x and y values just like the text version. For example: /boot/lua/gfx-nanobsd.lua: return { brand = { graphic = { "" }, requires_color = true, image = "/boot/images/freebsd-logo-rev.png" } } /boot/loader.conf.d/bootloader.conf: loader_logo="none" loader_brand="nanobsd" loader_brand_x="15" PR: 255202 Reviewed by: manu, imp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49092 (cherry picked from commit 7d1d7f42302d80c33243501601b77323acc0717f) --- stand/lua/drawer.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index e55702ffee6c..8c4307220642 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -327,7 +327,7 @@ local function drawbrand() if core.isFramebufferConsole() and gfx.term_putimage ~= nil and branddef.image ~= nil then - if gfx.term_putimage(branddef.image, 1, 1, 0, 7, 0) + if gfx.term_putimage(branddef.image, x, y, 0, 7, 0) then return true end From nobody Mon Mar 3 07:55:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5rhP0wgSz5nwF0; Mon, 03 Mar 2025 07:55: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 4Z5rhP0Pnvz47hs; Mon, 03 Mar 2025 07:55:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740988517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OK/8X5gYH487//AEFeqjw6BtSi2msqSv2t+vv91JMhU=; b=ReS7O8gtkJ2K6P34Wt63TEh4Iyv6MxkYsW5aUG54G+ajOlaeLFL+gB0rbyt3VzxHJzSn5A 3VJK1U10q79JS57kAt6sHD4kpCNZ6u5FW2Jj6bO7bXtobZPb/IA9bRbfgURW6eFDGVVdpe 6QhHEkCKduWr7Hwediu3Xuc2SJN1evl7cLXtmlC2uCJ3jOkNUepcOo+agha/xMq5A46xnj X3vXYcj+DqIVCrwnDU1nAlGN1mhFP04G+u7JZCmkbBZ3cFZLMBcgQfRSglLIvolu9u09Bd wUNTTQVxWPZNeMyRrKvzIoMD+dqO5MlM5B56Inn0+CJfZBu9jCIykTlLjjJS0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740988517; a=rsa-sha256; cv=none; b=c+PM9zGWQlqLpOCZsqsuDJNVvOaE+H9f3RMMUnl02z+X9K7Di/lT0IevAquXeRGqC85+N3 t3sp6cDiHGkS3qgB89KIfoUkIxla4Y6glwKgcnGn/cmFfUu5up2aOPupfebvqnR+xvrkf6 ut0NhJQZGOBZqUdKY3yY1zs6C5lmD+PEYtvzWHp6bs4L6HiMza4IVIbxhwkPtbTS6LoBrx LovHypJjZjg34dOfenTiy+5NWHnr1MUQCBrASunnfpBrr10lZFvsqY02Xv4jFOscAfnWdY g+rl3lHFFbnKusqGQ+c8VZ1LfVAj+oKfg5V4tVYATvM2LVEHSACAskqrAtv5SQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740988517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OK/8X5gYH487//AEFeqjw6BtSi2msqSv2t+vv91JMhU=; b=CGiAGzp/Icjdz98R5SQdrmwnSd7ZVfVqdZqtOpKO5wZYR6Jl8RmvRQ4k5MM0K6Y7ZKIZkb COBQp/PjVb5z1LNGmlQgWjq2eFUov3zsv5lY9P73WBFlsSR6CRUkV7GhpOwnkjdNa7dzu1 C/cZuL+M3aHPAsZvdxQaOVvef3KMYgIfUN+i5ptXxLfAXgCnJ801LhUoNAuEsgskSilCcp oOqJhXhOzfjOoPoynWQmLp0+55J+l5Zciv9cNbgBR1RBeFB8N7PS6ArLMgiXuk/pDOs45Y xT1NAwa2kRkS4EBOB6akKLguuhWyCo3p+Lo9t8hYUJ5nzjzMlE7kxcgv/dkiDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5rhN6sQgzfjM; Mon, 03 Mar 2025 07:55: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 5237tGkI074710; Mon, 3 Mar 2025 07:55:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5237tGA7074707; Mon, 3 Mar 2025 07:55:16 GMT (envelope-from git) Date: Mon, 3 Mar 2025 07:55:16 GMT Message-Id: <202503030755.5237tGA7074707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: c46af893cd7a - main - tests: Require python3 when using Scapy List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c46af893cd7aaff322b6f867539bc8fe5bcde6f9 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=c46af893cd7aaff322b6f867539bc8fe5bcde6f9 commit c46af893cd7aaff322b6f867539bc8fe5bcde6f9 Author: Jose Luis Duran AuthorDate: 2025-03-03 07:52:33 +0000 Commit: Jose Luis Duran CommitDate: 2025-03-03 07:52:33 +0000 tests: Require python3 when using Scapy python3 is a symbolic link that points to the current python 3.X version. It is possible for a system to have python (python 3.X) without the python3 (symlink) package. Test scripts that use Scapy are invoked using python3, so add it as a required program. Reviewed by: ngie, asomers Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D49007 --- tests/sys/net/if_bridge_test.sh | 4 ++-- tests/sys/net/if_vlan.sh | 2 +- tests/sys/netinet/divert.sh | 4 ++-- tests/sys/netinet/forward.sh | 8 ++++---- tests/sys/netinet/redirect.sh | 2 +- tests/sys/netinet6/divert.sh | 2 +- tests/sys/netinet6/exthdr.sh | 2 +- tests/sys/netinet6/forward6.sh | 12 ++++++------ tests/sys/netinet6/frag6/frag6.subr | 2 +- tests/sys/netinet6/mld.sh | 2 +- tests/sys/netinet6/ndp.sh | 2 +- tests/sys/netinet6/redirect.sh | 2 +- tests/sys/netinet6/scapyi386.sh | 2 +- tests/sys/netpfil/common/forward.sh | 2 +- tests/sys/netpfil/common/tos.sh | 2 +- tests/sys/netpfil/pf/dup.sh | 2 +- tests/sys/netpfil/pf/ether.sh | 4 ++-- tests/sys/netpfil/pf/forward.sh | 4 ++-- tests/sys/netpfil/pf/fragmentation_compat.sh | 8 ++++---- tests/sys/netpfil/pf/fragmentation_no_reassembly.sh | 6 +++--- tests/sys/netpfil/pf/fragmentation_pass.sh | 18 +++++++++--------- tests/sys/netpfil/pf/get_state.sh | 2 +- tests/sys/netpfil/pf/icmp.sh | 2 +- tests/sys/netpfil/pf/icmp6.sh | 2 +- tests/sys/netpfil/pf/killstate.sh | 16 ++++++++-------- tests/sys/netpfil/pf/max_states.sh | 2 +- tests/sys/netpfil/pf/modulate.sh | 4 ++-- tests/sys/netpfil/pf/pass_block.sh | 2 +- tests/sys/netpfil/pf/pflog.sh | 2 +- tests/sys/netpfil/pf/pflow.sh | 8 ++++---- tests/sys/netpfil/pf/pfsync.sh | 12 ++++++------ tests/sys/netpfil/pf/route_to.sh | 8 ++++---- tests/sys/netpfil/pf/rtable.sh | 4 ++-- tests/sys/netpfil/pf/scrub.sh | 16 ++++++++-------- tests/sys/netpfil/pf/scrub_compat.sh | 16 ++++++++-------- tests/sys/netpfil/pf/scrub_pass.sh | 12 ++++++------ tests/sys/netpfil/pf/set_tos.sh | 4 ++-- tests/sys/netpfil/pf/src_track.sh | 8 ++++---- tests/sys/netpfil/pf/syncookie.sh | 6 +++--- tests/sys/netpfil/pf/tcp.sh | 2 +- 40 files changed, 110 insertions(+), 110 deletions(-) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 66656be1d84f..46ebb17edbdc 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -271,7 +271,7 @@ span_head() { atf_set descr 'Bridge span test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } span_body() @@ -420,7 +420,7 @@ stp_validation_head() { atf_set descr 'Check STP validation' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } stp_validation_body() diff --git a/tests/sys/net/if_vlan.sh b/tests/sys/net/if_vlan.sh index 41dac6222cbb..424eac705b94 100755 --- a/tests/sys/net/if_vlan.sh +++ b/tests/sys/net/if_vlan.sh @@ -257,7 +257,7 @@ bpf_pcp_head() { atf_set descr 'Set VLAN PCP through BPF' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } bpf_pcp_body() diff --git a/tests/sys/netinet/divert.sh b/tests/sys/netinet/divert.sh index c3b1896b995e..d50620d94a09 100755 --- a/tests/sys/netinet/divert.sh +++ b/tests/sys/netinet/divert.sh @@ -41,7 +41,7 @@ ipdivert_ip_output_remote_success_head() { atf_set descr 'Test diverting IPv4 packet to remote destination' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } ipdivert_ip_output_remote_success_body() { @@ -96,7 +96,7 @@ ipdivert_ip_input_local_success_head() { atf_set descr 'Test diverting IPv4 packet to remote destination' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } ipdivert_ip_input_local_success_body() { diff --git a/tests/sys/netinet/forward.sh b/tests/sys/netinet/forward.sh index 3ae83eb3edc5..be69e91b6137 100755 --- a/tests/sys/netinet/forward.sh +++ b/tests/sys/netinet/forward.sh @@ -34,7 +34,7 @@ fwd_ip_icmp_iface_fast_success_head() { atf_set descr 'Test valid IPv4 on-stick fastforwarding to iface' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip_icmp_iface_fast_success_body() { @@ -90,7 +90,7 @@ fwd_ip_icmp_gw_fast_success_head() { atf_set descr 'Test valid IPv4 on-stick fastforwarding to gw' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip_icmp_gw_fast_success_body() { @@ -150,7 +150,7 @@ fwd_ip_icmp_iface_slow_success_head() { atf_set descr 'Test valid IPv4 on-stick "slow" forwarding to iface' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip_icmp_iface_slow_success_body() { @@ -204,7 +204,7 @@ fwd_ip_icmp_gw_slow_success_head() { atf_set descr 'Test valid IPv4 on-stick "slow" forwarding to gw' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip_icmp_gw_slow_success_body() { diff --git a/tests/sys/netinet/redirect.sh b/tests/sys/netinet/redirect.sh index 4a069d515bb0..ad5b562da57a 100755 --- a/tests/sys/netinet/redirect.sh +++ b/tests/sys/netinet/redirect.sh @@ -34,7 +34,7 @@ valid_redirect_head() { atf_set descr 'Test valid IPv4 redirect' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } valid_redirect_body() { diff --git a/tests/sys/netinet6/divert.sh b/tests/sys/netinet6/divert.sh index 788f539dfe9a..e2dc3e26d97e 100755 --- a/tests/sys/netinet6/divert.sh +++ b/tests/sys/netinet6/divert.sh @@ -41,7 +41,7 @@ ipdivert_ip6_output_remote_success_head() { atf_set descr 'Test valid IPv6 redirect' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } ipdivert_ip6_output_remote_success_body() { diff --git a/tests/sys/netinet6/exthdr.sh b/tests/sys/netinet6/exthdr.sh index 350307f13eae..3d866d85ea83 100755 --- a/tests/sys/netinet6/exthdr.sh +++ b/tests/sys/netinet6/exthdr.sh @@ -32,7 +32,7 @@ exthdr_head() { atf_set descr 'Test IPv6 extension header code paths' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } exthdr_body() { diff --git a/tests/sys/netinet6/forward6.sh b/tests/sys/netinet6/forward6.sh index 40d17837d6f2..e4b027bf281a 100755 --- a/tests/sys/netinet6/forward6.sh +++ b/tests/sys/netinet6/forward6.sh @@ -34,7 +34,7 @@ fwd_ip6_gu_icmp_iface_fast_success_head() { atf_set descr 'Test valid IPv6 global unicast fast-forwarding to interface' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip6_gu_icmp_iface_fast_success_body() { @@ -104,7 +104,7 @@ fwd_ip6_gu_icmp_gw_gu_fast_success_head() { atf_set descr 'Test valid IPv6 global unicast fast-forwarding to GU gw' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip6_gu_icmp_gw_gu_fast_success_body() { @@ -178,7 +178,7 @@ fwd_ip6_gu_icmp_gw_ll_fast_success_head() { atf_set descr 'Test valid IPv6 global unicast fast-forwarding to LL gw' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip6_gu_icmp_gw_ll_fast_success_body() { @@ -253,7 +253,7 @@ fwd_ip6_gu_icmp_iface_slow_success_head() { atf_set descr 'Test valid IPv6 global unicast fast-forwarding to interface' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip6_gu_icmp_iface_slow_success_body() { @@ -322,7 +322,7 @@ fwd_ip6_gu_icmp_gw_gu_slow_success_head() { atf_set descr 'Test valid IPv6 global unicast fast-forwarding to GU gw' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip6_gu_icmp_gw_gu_slow_success_body() { @@ -397,7 +397,7 @@ fwd_ip6_gu_icmp_gw_ll_slow_success_head() { atf_set descr 'Test valid IPv6 global unicast fast-forwarding to LL gw' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } fwd_ip6_gu_icmp_gw_ll_slow_success_body() { diff --git a/tests/sys/netinet6/frag6/frag6.subr b/tests/sys/netinet6/frag6/frag6.subr index 70e7386b60cc..238c9619c398 100644 --- a/tests/sys/netinet6/frag6/frag6.subr +++ b/tests/sys/netinet6/frag6/frag6.subr @@ -31,7 +31,7 @@ frag6_head() { atf_set descr 'Test IPv6 fragmentation code' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } frag6_body() diff --git a/tests/sys/netinet6/mld.sh b/tests/sys/netinet6/mld.sh index 7229aa34dc52..d98624daedf5 100755 --- a/tests/sys/netinet6/mld.sh +++ b/tests/sys/netinet6/mld.sh @@ -32,7 +32,7 @@ mldraw01_head() { atf_set descr 'Test for correct Ethernet Destination MAC address' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } mldraw01_body() { diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh index 378759eb9ba4..bac9764ee3c9 100755 --- a/tests/sys/netinet6/ndp.sh +++ b/tests/sys/netinet6/ndp.sh @@ -134,7 +134,7 @@ atf_test_case "ndp_slaac_default_route" "cleanup" ndp_slaac_default_route_head() { atf_set descr 'Test default route installation via SLAAC' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } ndp_slaac_default_route_body() { diff --git a/tests/sys/netinet6/redirect.sh b/tests/sys/netinet6/redirect.sh index 64efe7339ffd..aa0731d89101 100644 --- a/tests/sys/netinet6/redirect.sh +++ b/tests/sys/netinet6/redirect.sh @@ -34,7 +34,7 @@ valid_redirect_head() { atf_set descr 'Test valid IPv6 redirect' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } valid_redirect_body() { diff --git a/tests/sys/netinet6/scapyi386.sh b/tests/sys/netinet6/scapyi386.sh index bb9ee4cfcd2a..2d91f25dd01e 100755 --- a/tests/sys/netinet6/scapyi386.sh +++ b/tests/sys/netinet6/scapyi386.sh @@ -32,7 +32,7 @@ scapyi386_head() { atf_set descr 'Test for correct Ethernet Destination MAC address' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } scapyi386_body() { diff --git a/tests/sys/netpfil/common/forward.sh b/tests/sys/netpfil/common/forward.sh index 939ce55f2d33..fa1f97aa0390 100644 --- a/tests/sys/netpfil/common/forward.sh +++ b/tests/sys/netpfil/common/forward.sh @@ -33,7 +33,7 @@ v4_head() { atf_set descr 'Basic forwarding test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } v4_body() diff --git a/tests/sys/netpfil/common/tos.sh b/tests/sys/netpfil/common/tos.sh index 39f756be8fe9..3b689d7f67d0 100644 --- a/tests/sys/netpfil/common/tos.sh +++ b/tests/sys/netpfil/common/tos.sh @@ -33,7 +33,7 @@ tos_head() { atf_set descr 'set-tos test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } tos_body() diff --git a/tests/sys/netpfil/pf/dup.sh b/tests/sys/netpfil/pf/dup.sh index 68631251144a..64a08083bca0 100644 --- a/tests/sys/netpfil/pf/dup.sh +++ b/tests/sys/netpfil/pf/dup.sh @@ -33,7 +33,7 @@ dup_to_head() { atf_set descr 'dup-to test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } dup_to_body() diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh index 104baf468aa4..f0fdce50a7d3 100644 --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -643,7 +643,7 @@ short_pkt_head() { atf_set descr 'Test overly short Ethernet packets' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } short_pkt_body() @@ -686,7 +686,7 @@ bridge_to_head() { atf_set descr 'Test bridge-to keyword' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } bridge_to_body() diff --git a/tests/sys/netpfil/pf/forward.sh b/tests/sys/netpfil/pf/forward.sh index 31abfad82c13..5d7d48a5dd9a 100644 --- a/tests/sys/netpfil/pf/forward.sh +++ b/tests/sys/netpfil/pf/forward.sh @@ -35,7 +35,7 @@ v4_head() atf_set require.user root # We need scapy to be installed for out test scripts to work - atf_set require.progs scapy + atf_set require.progs python3 scapy } v4_body() @@ -94,7 +94,7 @@ v6_head() { atf_set descr 'Basic IPv6 forwarding test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } v6_body() diff --git a/tests/sys/netpfil/pf/fragmentation_compat.sh b/tests/sys/netpfil/pf/fragmentation_compat.sh index e9b89f5ff170..1f4550ebd69e 100644 --- a/tests/sys/netpfil/pf/fragmentation_compat.sh +++ b/tests/sys/netpfil/pf/fragmentation_compat.sh @@ -74,7 +74,7 @@ v6_head() { atf_set descr 'IPv6 fragmentation test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } v6_body() @@ -230,7 +230,7 @@ overreplace_head() { atf_set descr 'ping fragment that overlaps fragment at index boundary and replace it' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } overreplace_body() @@ -248,7 +248,7 @@ overindex_head() { atf_set descr 'ping fragment that overlaps the first fragment at index boundary' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } overindex_body() @@ -266,7 +266,7 @@ overlimit_head() { atf_set descr 'ping fragment at index boundary that cannot be requeued' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } overlimit_body() diff --git a/tests/sys/netpfil/pf/fragmentation_no_reassembly.sh b/tests/sys/netpfil/pf/fragmentation_no_reassembly.sh index fb5c15ac2ff8..7cab89f5debb 100644 --- a/tests/sys/netpfil/pf/fragmentation_no_reassembly.sh +++ b/tests/sys/netpfil/pf/fragmentation_no_reassembly.sh @@ -32,7 +32,7 @@ match_full_v4_head() { atf_set descr 'Matching non-fragmented IPv4 packets' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } match_full_v4_body() @@ -63,7 +63,7 @@ match_fragment_v4_head() { atf_set descr 'Matching fragmented IPv4 packets' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } match_fragment_v4_body() @@ -93,7 +93,7 @@ compat_override_v4_head() { atf_set descr 'Scrub rules override "set reassemble" for IPv4' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } compat_override_v4_body() diff --git a/tests/sys/netpfil/pf/fragmentation_pass.sh b/tests/sys/netpfil/pf/fragmentation_pass.sh index 9255e6f738cf..5deaba18301d 100644 --- a/tests/sys/netpfil/pf/fragmentation_pass.sh +++ b/tests/sys/netpfil/pf/fragmentation_pass.sh @@ -77,7 +77,7 @@ v6_head() { atf_set descr 'IPv6 fragmentation test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } v6_body() @@ -305,7 +305,7 @@ overreplace_head() { atf_set descr 'ping fragment that overlaps fragment at index boundary and replace it' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } overreplace_body() @@ -323,7 +323,7 @@ overindex_head() { atf_set descr 'ping fragment that overlaps the first fragment at index boundary' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } overindex_body() @@ -341,7 +341,7 @@ overlimit_head() { atf_set descr 'ping fragment at index boundary that cannot be requeued' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } overlimit_body() @@ -359,7 +359,7 @@ overhole_head() { atf_set descr 'ping fragment at index boundary which modifies pf hole counter' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } overhole_body() @@ -377,7 +377,7 @@ adjhole_head() { atf_set descr 'overlapping ping fragments which modifies pf hole counter' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } adjhole_body() @@ -443,7 +443,7 @@ no_df_head() { atf_set descr 'Test removing of DF flag' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } no_df_body() @@ -482,7 +482,7 @@ reassemble_slowpath_head() { atf_set descr 'Test reassembly on the slow path' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } reassemble_slowpath_body() @@ -611,7 +611,7 @@ dummynet_fragmented_head() { atf_set descr 'Test dummynet on NATed fragmented traffic' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } dummynet_fragmented_body() diff --git a/tests/sys/netpfil/pf/get_state.sh b/tests/sys/netpfil/pf/get_state.sh index 35adf64f6b11..eb2bc854c800 100644 --- a/tests/sys/netpfil/pf/get_state.sh +++ b/tests/sys/netpfil/pf/get_state.sh @@ -33,7 +33,7 @@ many_head() { atf_set descr 'Test retrieving many states' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } many_body() diff --git a/tests/sys/netpfil/pf/icmp.sh b/tests/sys/netpfil/pf/icmp.sh index f4c8ec5e5836..279e3c7a29d5 100644 --- a/tests/sys/netpfil/pf/icmp.sh +++ b/tests/sys/netpfil/pf/icmp.sh @@ -33,7 +33,7 @@ cve_2019_5598_head() { atf_set descr 'Test CVE-2019-5598' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } cve_2019_5598_body() diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index eb286e23ef4c..c55af906e3a6 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -33,7 +33,7 @@ zero_id_head() { atf_set descr 'Test ICMPv6 echo with ID 0 keep being blocked' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } zero_id_body() diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index 36743b1d8016..5d8e040d3cbb 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -47,7 +47,7 @@ v4_head() { atf_set descr 'Test killing states by IPv4 address' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } v4_body() @@ -110,7 +110,7 @@ v6_head() { atf_set descr 'Test killing states by IPv6 address' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } v6_body() @@ -177,7 +177,7 @@ label_head() { atf_set descr 'Test killing states by label' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } label_body() @@ -241,7 +241,7 @@ multilabel_head() { atf_set descr 'Test killing states with multiple labels by label' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } multilabel_body() @@ -321,7 +321,7 @@ gateway_head() { atf_set descr 'Test killing states by route-to/reply-to address' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } gateway_body() @@ -462,7 +462,7 @@ interface_head() { atf_set descr 'Test killing states based on interface' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } interface_body() @@ -518,7 +518,7 @@ id_head() { atf_set descr 'Test killing states by id' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } id_body() @@ -579,7 +579,7 @@ nat_head() { atf_set descr 'Test killing states by their NAT-ed IP address' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } nat_body() diff --git a/tests/sys/netpfil/pf/max_states.sh b/tests/sys/netpfil/pf/max_states.sh index 3548d838e3a6..1bf6814f9283 100755 --- a/tests/sys/netpfil/pf/max_states.sh +++ b/tests/sys/netpfil/pf/max_states.sh @@ -31,7 +31,7 @@ max_states_head() { atf_set descr 'Max states per rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } max_states_body() diff --git a/tests/sys/netpfil/pf/modulate.sh b/tests/sys/netpfil/pf/modulate.sh index 98d5df14a44d..1abe22cff391 100644 --- a/tests/sys/netpfil/pf/modulate.sh +++ b/tests/sys/netpfil/pf/modulate.sh @@ -31,7 +31,7 @@ modulate_v4_head() { atf_set descr 'IPv4 TCP sequence number modulation' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } modulate_v4_body() @@ -54,7 +54,7 @@ modulate_v6_head() { atf_set descr 'IPv6 TCP sequence number modulation' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } modulate_v6_body() diff --git a/tests/sys/netpfil/pf/pass_block.sh b/tests/sys/netpfil/pf/pass_block.sh index b8ad5a86b102..e955068d014b 100644 --- a/tests/sys/netpfil/pf/pass_block.sh +++ b/tests/sys/netpfil/pf/pass_block.sh @@ -232,7 +232,7 @@ urpf_head() { atf_set descr "Test unicast reverse path forwarding check" atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } urpf_body() diff --git a/tests/sys/netpfil/pf/pflog.sh b/tests/sys/netpfil/pf/pflog.sh index a315b88bd4c0..0758723c604d 100644 --- a/tests/sys/netpfil/pf/pflog.sh +++ b/tests/sys/netpfil/pf/pflog.sh @@ -34,7 +34,7 @@ malformed_head() { atf_set descr 'Test that we do not log malformed packets as passing' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } malformed_body() diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index f0552eb061da..1122096d2e31 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -85,7 +85,7 @@ state_defaults_head() { atf_set descr 'Test set state-defaults pflow' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } state_defaults_body() @@ -146,7 +146,7 @@ v6_head() { atf_set descr 'Test pflow over IPv6' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } v6_body() @@ -188,7 +188,7 @@ nat_head() { atf_set descr 'Test pflow export for NAT44' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } nat_body() @@ -239,7 +239,7 @@ rule_head() { atf_set descr 'Test per-rule pflow option' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } rule_body() diff --git a/tests/sys/netpfil/pf/pfsync.sh b/tests/sys/netpfil/pf/pfsync.sh index 0f3505460b50..7f545b43a066 100644 --- a/tests/sys/netpfil/pf/pfsync.sh +++ b/tests/sys/netpfil/pf/pfsync.sh @@ -126,7 +126,7 @@ defer_head() { atf_set descr 'Defer mode pfsync test' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } defer_body() @@ -907,7 +907,7 @@ route_to_1301_head() { atf_set descr 'Test route-to with pfsync version 13.1' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } route_to_1301_body() @@ -947,7 +947,7 @@ route_to_1301_bad_ruleset_head() { atf_set descr 'Test route-to with pfsync version 13.1 and incompatible ruleset' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } route_to_1301_bad_ruleset_body() @@ -997,7 +997,7 @@ route_to_1301_bad_rpool_head() { atf_set descr 'Test route-to with pfsync version 13.1 and different interface' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } route_to_1301_bad_rpool_body() @@ -1045,7 +1045,7 @@ route_to_1400_bad_ruleset_head() { atf_set descr 'Test route-to with pfsync version 14.0' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } route_to_1400_bad_ruleset_body() @@ -1085,7 +1085,7 @@ route_to_1400_bad_ifname_head() { atf_set descr 'Test route-to with pfsync version 14.0' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } route_to_1400_bad_ifname_body() diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 06a320f5fac2..0354d1f59306 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -256,7 +256,7 @@ icmp_nat_head() { atf_set descr 'Test that ICMP packets are correct for route-to + NAT' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } icmp_nat_body() @@ -516,7 +516,7 @@ ifbound_reply_to_head() { atf_set descr 'Test that reply-to states bind to the expected interface' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } ifbound_reply_to_body() @@ -572,7 +572,7 @@ ifbound_reply_to_v6_head() { atf_set descr 'Test that reply-to states bind to the expected interface for IPv6' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } ifbound_reply_to_v6_body() @@ -632,7 +632,7 @@ ifbound_reply_to_rdr_dummynet_head() { atf_set descr 'Test that reply-to states bind to the expected non-default-route interface after rdr and dummynet' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } ifbound_reply_to_rdr_dummynet_body() diff --git a/tests/sys/netpfil/pf/rtable.sh b/tests/sys/netpfil/pf/rtable.sh index 62b37462e948..bb2cada57049 100644 --- a/tests/sys/netpfil/pf/rtable.sh +++ b/tests/sys/netpfil/pf/rtable.sh @@ -31,7 +31,7 @@ forward_v4_head() { atf_set descr 'Test IPv4 forwarding with rtable' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } forward_v4_body() @@ -78,7 +78,7 @@ forward_v6_head() { atf_set descr 'Test IPv6 forwarding with rtable' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } forward_v6_body() diff --git a/tests/sys/netpfil/pf/scrub.sh b/tests/sys/netpfil/pf/scrub.sh index b9efdaf5205c..6a5b748bed7b 100644 --- a/tests/sys/netpfil/pf/scrub.sh +++ b/tests/sys/netpfil/pf/scrub.sh @@ -32,7 +32,7 @@ max_mss_v4_head() { atf_set descr 'Test IPv4 scrub "mss" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } max_mss_v4_body() @@ -57,7 +57,7 @@ max_mss_v6_head() { atf_set descr 'Test IPv6 scrub "mss" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } max_mss_v6_body() @@ -82,7 +82,7 @@ set_tos_v4_head() { atf_set descr 'Test IPv4 scub "set-tos" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } set_tos_v4_body() @@ -103,7 +103,7 @@ set_tos_v6_head() { atf_set descr 'Test IPv6 scub "set-tos" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } set_tos_v6_body() @@ -124,7 +124,7 @@ min_ttl_v4_head() { atf_set descr 'Test IPv4 scub "min-ttl" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } min_ttl_v4_body() @@ -145,7 +145,7 @@ min_ttl_v6_head() { atf_set descr 'Test IPv6 scub "min-ttl" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } min_ttl_v6_body() @@ -166,7 +166,7 @@ no_scrub_v4_head() { atf_set descr 'Test IPv4 "no scrub" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } no_scrub_v4_body() @@ -189,7 +189,7 @@ no_scrub_v6_head() { atf_set descr 'Test IPv6 "no scrub" rule' atf_set require.user root - atf_set require.progs scapy + atf_set require.progs python3 scapy } no_scrub_v6_body() diff --git a/tests/sys/netpfil/pf/scrub_compat.sh b/tests/sys/netpfil/pf/scrub_compat.sh index cf69da3f3b74..6e1499309869 100644 --- a/tests/sys/netpfil/pf/scrub_compat.sh +++ b/tests/sys/netpfil/pf/scrub_compat.sh @@ -33,7 +33,7 @@ max_mss_v4_head() { atf_set descr 'Test IPv4 scrub "mss" rule' atf_set require.user root - atf_set require.progs scapy *** 231 LINES SKIPPED *** From nobody Mon Mar 3 12:52:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z5zGq1dVhz5pPgB; Mon, 03 Mar 2025 12:52: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 4Z5zGq131zz3brc; Mon, 03 Mar 2025 12:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741006323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=idZ4+aBR4Nryk1CNMs8PBIvFej4YpdBA2D7JO9vTSI0=; b=HnHktHchIKEBVFHI0M1VbRBaDgsiW+C6CK3xtPwr/zzBy6EgKkvXocdPbd2ahL9MDjr54f IOFc5sWM6igE+Em89yIMlDYDKvY57OLtwNR3/kdz1Xmrmdve8bVBEm7AvmbsvHhU3CT8EN 4PFTJzjQsuq43KljUiJ+eP2hv/ba6DSvnnqf22WUMjjPW39jXmual0hOH7GlUT2rQWB+sM eAdLB9fpdcAR2GmjjwgVLaE4lWsw05B5pvwZrV7EXd2t10y38XqyYHrz6RGfWzqHaRCjEm qqBtnDFKczI+cyM/TP6uA6rXlNEOGZG0GWVK+kXJ/Fm6PLJtyIFCmJglB9XClg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741006323; a=rsa-sha256; cv=none; b=RYf3KRRMESchCkvmkL4VLR7m082WH7Bg4fl+tHnsIasFz/7Rw0sEjfiyu/ssKPSIwkBlQU fc4RaXx5foqeakbrujw/ejw4wFbq0fJYyTYFQHlrz2fpez+nPqklT0Co+h6zVMgeSE6ieZ J5qGjUraLG1PsNO+wnEB8nmVPnNdzaqFy8nwDwHXR2hmNkK227wB1W8Nyu1uoCuuwl+6B2 rQev085FksnwmEEfOQluT/ILbQ6TmcRwoXPqGChmWylAhKmtXxpU8qPwcU9hpvawA2TnNm Glaz7PLCG9rDGnK/b+g+d2f9mFcI5SOyXUn+zhOcVbSGyk01I2bspvUa93j+yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741006323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=idZ4+aBR4Nryk1CNMs8PBIvFej4YpdBA2D7JO9vTSI0=; b=nHl580ZvD1etqUQYKQ8j+QqUV/3uvFt7pB0+h9pY9xmjbH6tWX4J5/7wai4OrL22HLPf3G DPKIV/F5+OL8GssiYsc+VKuIpFkJjme6LguIRZW+s69rWnzKrLNxbDVpoH2kuIZcilZWhw m9gtJiJcfFQCZDQtX/HTcG4S9N/oEhO2nSbSAbovxyGJQEfMtpW2IIvDCbkYnvLlv0lTRY kzc3e9jxYX0uBHjZ3KPPwfGZJcBsEeI7bMRuqmgR5X6lAVQD0ZdJU5uzKSkqL72y8Dzbj3 62HcxQmYbbtWbVWl4ZwTgk6yB4wK8WuXJgJdFIBfzQe8I4qUWRf+tMpStdLIIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z5zGq0f63zpQx; Mon, 03 Mar 2025 12:52: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 523Cq2fc031898; Mon, 3 Mar 2025 12:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Cq2kN031896; Mon, 3 Mar 2025 12:52:02 GMT (envelope-from git) Date: Mon, 3 Mar 2025 12:52:02 GMT Message-Id: <202503031252.523Cq2kN031896@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: f8bd05add215 - main - pf tests: add missing pflog_init to pflog:rdr_action List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8bd05add2158a433e1f5b9ffd18a9e164c4cfaf Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8bd05add2158a433e1f5b9ffd18a9e164c4cfaf commit f8bd05add2158a433e1f5b9ffd18a9e164c4cfaf Author: Kristof Provost AuthorDate: 2025-03-03 10:34:36 +0000 Commit: Kristof Provost CommitDate: 2025-03-03 12:51:27 +0000 pf tests: add missing pflog_init to pflog:rdr_action Without it we tried to run the test even if pflog wasn't loaded. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/pflog.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/netpfil/pf/pflog.sh b/tests/sys/netpfil/pf/pflog.sh index 0758723c604d..fdd9af6316d0 100644 --- a/tests/sys/netpfil/pf/pflog.sh +++ b/tests/sys/netpfil/pf/pflog.sh @@ -331,6 +331,8 @@ rdr_head() rdr_action_body() { + pflog_init + j="pflog:rdr_action" epair_c=$(vnet_mkepair) epair_srv=$(vnet_mkepair) From nobody Mon Mar 3 14:00:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z60p80hkQz5pW5k; Mon, 03 Mar 2025 14:00: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 4Z60p649Cbz3j63; Mon, 03 Mar 2025 14:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741010446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XlcO5RErseNq1FUWSoNmx+9X9eC0WKExrnxCZj6xpeA=; b=xp4cI5iL1u0Snu5PU9kHvOEbaCvxQlSB3C6SIbLb/YTkR7JRA35VZmZy84Ry9zTMvf9qRE VTcWdr6ZdL2TyhCk+vHFQI+G24g8IEo7Fyrwi9/+/oCUC2J+7YZ5lgzbwNQJC+578KzSII izbQnzkBnkmsDFy2uJ2sKMv72zt+37WyVtmdeCn5S25PJe0ImLtmqEncovVEEN2Jvz+WhR HEwtrpRNwGWi5qt3O9iTaTV6Xpo3iEb+6TeLgvcWDiYS/UAnUK+iw3K3TKe2lqPMXZ/EQF r/U2LIa9b9xwZeDSPk2V5jsmjhZgbw/g00HrMDenA2BTf1KfFP9IzEAqs2U6Ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741010446; a=rsa-sha256; cv=none; b=dCOIegChiRzycOT3m7vd4uEHOFqfCo1fjxKniezCcFW3POqYgORRLZuXuOFAbdxGe/Ib9F bY2HEmw9M9DwIbtkOUyTPdVNElURAUYmUWHUvD6Z2mv/g/3rkpeJechDBM/ZwDFlzokcnr qkDdKMc8u2kk30V0u12AyQsSRcs9vhN2k3YHHoVnoq6257D7Na9QVThdglZ580l6T2ebHy jbnAyh2ibY+bn1CHsTZ2vh2qGCQGT8ad8GLldQ1ScSHGgSLg+v0SL98i0G5hDQe+n2DrUy V1/ylskkm0CXWXvibka6TpYDfqAkKGm6E6BH/UQiZC+vnEY8xLpn6n49JQiEPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741010446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XlcO5RErseNq1FUWSoNmx+9X9eC0WKExrnxCZj6xpeA=; b=mqQiKHMc+w6g1SnAmYOsNEwU6ALPTzNk7LWy1GEYwbicXeBWyn5vrbLcm28eR0UP5GgkES KBQqlfzSvIxzw2YPIY92hmAIMC2fbWqnFsp1cWkAUk4dWxTHla0KYq2BkThM1CXjQwYK0A t12WyC4NF4WGJ7EVWBMMr2CDxU7n5c2yGy3THQjR2wTwMTSodsT6yZAgif7rhwdHCM8kZl SotblWqz9/dtP3rVsOJvE+KtIe8PeW/FfpugwoNYhJvYn3gGYFaUfkmsTL87n8XgDyoKU6 NAfiAYRYvQ2VbA4+hNyzWltOzMtOSnmmgc0ugubEq78J6DLGIrz9edqN7XzMvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z60p63lSXzqm2; Mon, 03 Mar 2025 14:00: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 523E0ksS061036; Mon, 3 Mar 2025 14:00:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523E0kXJ061033; Mon, 3 Mar 2025 14:00:46 GMT (envelope-from git) Date: Mon, 3 Mar 2025 14:00:46 GMT Message-Id: <202503031400.523E0kXJ061033@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: 44c70602c8a6 - main - stf.4: Remove spurious word List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 44c70602c8a6add87a234154d005b9c3ff3e4825 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=44c70602c8a6add87a234154d005b9c3ff3e4825 commit 44c70602c8a6add87a234154d005b9c3ff3e4825 Author: Matt Simerson AuthorDate: 2025-02-24 16:11:52 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-03 13:58:21 +0000 stf.4: Remove spurious word Improve grammar by removing spurious word. MFC after: 3 days Approved by: emaste, carlavilla (mentor) Pull Request: https://github.com/freebsd/freebsd-src/pull/1605 --- share/man/man4/stf.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/stf.4 b/share/man/man4/stf.4 index 2c0296b204d9..c93600c15e0a 100644 --- a/share/man/man4/stf.4 +++ b/share/man/man4/stf.4 @@ -201,7 +201,7 @@ The IPv4 WAN address. The prefix length of the IPv4 WAN address. .El .Pp -These can parameters are all configured through +These parameters are all configured through .Xr ifconfig 8 . .Pp The IPv6 address and prefix length can be configured like any other IPv6 address. From nobody Mon Mar 3 14:56:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z622w1pvCz5pbtJ; Mon, 03 Mar 2025 14:56: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 4Z622w1B6vz3nRk; Mon, 03 Mar 2025 14:56:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741013816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Weo0Oewxhz/Hp2otyfr9mOzMU6rBi9LiUR0tLNvWT9E=; b=s1KSxALcn1fmzhsR/PfmnNTfdXH0jd73a4q2a+koZ/huz1IidX7xH2teoVSzb+hRshJl/Y gakKKu85Rl7AJ3KXAdTm11wdCXSW6MhSJcbypNDLt3zEKMsNowYVWrfnrLUFWqAzVgsCEb NE23DADSoVzIH02Ix0RGIFy2gYrJce/gEy8N951Q03g44p/KQ260Gnsp5SGsgp10+cUFw/ XlCZxEBhiiAvthJmKF4vQC1w7HfvZAcop7iV9fcYdCOgDwwOBnDjPt6UtZR8PDTUcive0N c/ckdfaeA8Qt+o1V6D31W9VhyaNUXdTUdPlt4B0hoSrz9smetOvbTsy3Y6Dl7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741013816; a=rsa-sha256; cv=none; b=as45TOxrw059XW9NHr13ZehbtXOYcY+92XR1kBfMxJOxaKMUcaob+ZgLcDJb27iiEpysfO At8RrZZrhSVuD4vr9vuo+8BSNKUxe2DrhlBaPE+cYXlL+tvyfPGP7jTNEjGD5LrxrOIsVA vFbsTPoN10e5mHW0KDYC1E6Xw5rvCdEKMi/p6V5C1v5EuWsbJgbE+evbmUIzgNxrcfam/k C9gGk3ofYxXIUmjd1GugM8E3ZnyfqI0qa3Xl8+kFkGWVCIG7ahp35a4SQEaAffYPBzooij YOeMqLtLpV9M/8xLBbriwOhq0250zLnjcFLzlPtaniBVOQDptba6JVo8ZOhfoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741013816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Weo0Oewxhz/Hp2otyfr9mOzMU6rBi9LiUR0tLNvWT9E=; b=kemU5Y1U+25/QztZPWB8CcTpYVqTelw8/ZSBqYELYANjPIDgGgo0Ok2DifDX2UIXM8yHK2 pUFhfbfq6qTGa/n7bCYDtxPIJLQUJJVHL0iQ7qWB/IOOelun/CpQFlKx6e6l7X1eVk7TY6 rcCLL0Y/V6wKu/1WNO6dJ5TQ2leokXLkady3NsxJZUxqW5sHS19YOqtYRCKkoyweL9KfdM iaKvqP2e8zOa3+2R+4/A13dhOSrovldhrIOYd/zeet7L+AdUfYYEYspi4anNSLr8qRArIn d6NghDU209HjTABD5WIHDSttmTpmb/7wycJCMC6tiBHzgFuboRr3RvV/uJsSng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z622w0THYzsc3; Mon, 03 Mar 2025 14:56: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 523Eut7h059564; Mon, 3 Mar 2025 14:56:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523EutRx059561; Mon, 3 Mar 2025 14:56:55 GMT (envelope-from git) Date: Mon, 3 Mar 2025 14:56:55 GMT Message-Id: <202503031456.523EutRx059561@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: 8a2c189e8938 - main - ports.7/history: Don't forget macOS! List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 8a2c189e893811a44b30696a1af9b5c7800ab60b Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=8a2c189e893811a44b30696a1af9b5c7800ab60b commit 8a2c189e893811a44b30696a1af9b5c7800ab60b Author: Alexander Ziaee AuthorDate: 2025-03-03 14:50:53 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-03 14:52:59 +0000 ports.7/history: Don't forget macOS! Jordan Hubbard, one of the original authors of the FreeBSD Ports Collection, later went on to create MacPorts, an evolution of the idea written in TCL instead of Makefiles. Further, NetBSD's pkgsrc is available natively on macOS. In either case, the idea of ports which originated here spread to macOS. Note that in the HISTORY section. MFC after: 3 days Reviewed by: carlavilla,Jessica Hawkwell on Community Discord Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D49205 --- share/man/man7/ports.7 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7 index 6b8eb27ea287..1e924b291608 100644 --- a/share/man/man7/ports.7 +++ b/share/man/man7/ports.7 @@ -744,9 +744,9 @@ The Ports Collection appeared in .Fx 1.0 . It has since spread to -.Nx -and -.Ox . +.Nx , +.Ox , +and macOS. .Sh AUTHORS .An -nosplit This manual page was originated by From nobody Mon Mar 3 14:58:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z624F2rDVz5pbtP; Mon, 03 Mar 2025 14:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z624F21dZz3p4S; Mon, 03 Mar 2025 14:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741013885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ta1acVhpQBo77rYf/JPrm1BhUkbG/bLNl75joAInQg=; b=ZQ6ddyzrpQvxk31nZsJ8n99lU1+b1e179jgPeDq+Um9QdVlA496vJVtvibEDJrOG/hO6rx Mlp6NT7Bb1A/bR3SRlZoQnRr60X0AeoSpFfnKh9sOfG5Gkng0KN+1O+v5XhiKw0VDryVXb q9+bhDvVFn1yoJ61sbj3LEGoTAstH8MVFwcKaIL5A1bvBDj7QjqNfihcbOWbJA7HyytvDq S9mAi6gUVfRV2EdRU68Yuynw2TEZzxnWblBHIphssosHOBKu2AGz8ZgshKzJB7U7i2tz0Q stFsUttxTNxEFxoqp+RwXzfqzSbHmnUVwkCj1NjH/1io/6oFOj7Bjw/7r/aeZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741013885; a=rsa-sha256; cv=none; b=jRwprLlEQciwhfu8rRrSv4xCI3tG969s1U++Kezb00neZ0LtGNIA6qlNjXs/66h5fN/fnc WMKYKSigCRrIY0H4k7E3STEwc7mgYflT24mgBw+r3QsZsUATYeMs3gwCsoqsJgUPZBm+LW Ze7pfh6pJVtalIJd2Bdg/v3C0wzBAdc8Xw4TlCP9b+8cbp/P1PmcVnOLRRq+C4mD0yXYlk EVsXFH1PaiB8rkpfSUcYCw4j3Txt27LWj0TIhw6fTtkIJA0W0ueeS8yIL/dSULUdhBKOXL 5NpgEFthML3hL/n9YmQFtn1kJoRXLKlekIV2naVYlSuWW85ZggwypHWa4HlHLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741013885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ta1acVhpQBo77rYf/JPrm1BhUkbG/bLNl75joAInQg=; b=PZ5rH3aDCgJz45Uso1zXm0e4JW5+NqJbk+3oJgNYqJTEe/5rUg5QrP0hZKRGyKoRKSpM0Z +UWbUV4OIaNiYvOhrbtTXPVjkPrj3fgOo/sOgkTkPqArFmXino647wtTIojnMAKpWc/6k6 4SRwyUttLnZGF6ala55mq+H7jdTEBJ99ujUXSXT2jEzfuUulgfpfvHk3Ok51u79dtYieIC 6y5u0ZgHccCTNU6n+1IwqRbwgtNoFE1KptBOvteunM/YTxUHH6w95MA/ecnNEvqS9D3U6H Grqh3F0ROqbWSU4Q13+PfE7I04bEryD0ex96jNs0IarOmIS75bCQffdjEE3aBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z624F1d4HzsQP; Mon, 03 Mar 2025 14:58: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 523Ew5Fj060017; Mon, 3 Mar 2025 14:58:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Ew5LA060014; Mon, 3 Mar 2025 14:58:05 GMT (envelope-from git) Date: Mon, 3 Mar 2025 14:58:05 GMT Message-Id: <202503031458.523Ew5LA060014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 588838aa2484 - stable/14 - libkern: strdup.c, strndup.c: Prefer memcpy() over bcopy() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 588838aa2484619c93231aedb22c24e761d244da Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=588838aa2484619c93231aedb22c24e761d244da commit 588838aa2484619c93231aedb22c24e761d244da Author: Zhenlei Huang AuthorDate: 2025-02-17 15:37:59 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-03 14:56:34 +0000 libkern: strdup.c, strndup.c: Prefer memcpy() over bcopy() The newly allocated memory can not overlap with the string if the string is properly null-terminated or the maxlen is a valid lengh, i.e no out of bounds reads. Prefer memcpy() over memmove(), aka bcopy(), for slight performance gain. No functional change intended. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D49026 (cherry picked from commit 90a3b6a7a4e4c8201ba1bb90fb8e2b088f3a5788) --- sys/libkern/strdup.c | 2 +- sys/libkern/strndup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/libkern/strdup.c b/sys/libkern/strdup.c index f5685fcc554f..38f5c8f194c3 100644 --- a/sys/libkern/strdup.c +++ b/sys/libkern/strdup.c @@ -47,7 +47,7 @@ strdup_flags(const char *string, struct malloc_type *type, int flags) copy = malloc(len, type, flags); if (copy == NULL) return (NULL); - bcopy(string, copy, len); + memcpy(copy, string, len); return (copy); } diff --git a/sys/libkern/strndup.c b/sys/libkern/strndup.c index f8867c140e67..9065153d7232 100644 --- a/sys/libkern/strndup.c +++ b/sys/libkern/strndup.c @@ -43,7 +43,7 @@ strndup(const char *string, size_t maxlen, struct malloc_type *type) len = strnlen(string, maxlen) + 1; copy = malloc(len, type, M_WAITOK); - bcopy(string, copy, len); + memcpy(copy, string, len); copy[len - 1] = '\0'; return (copy); } From nobody Mon Mar 3 16:08:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63dT6xRyz5pjVY; Mon, 03 Mar 2025 16:08: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 4Z63dT6Hqsz3xPb; Mon, 03 Mar 2025 16:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXCFQzrc6JYJ/43OjuFeV1nhe20wrIWqs7Tal7rrXoo=; b=NrhEW6qBQF9TotY7AKFIWSS2MDwaSX9Iuzg06rDi74vZnoo6i2dMgovNJ81gxz7phJSmrG 59FOO8I8oYU7so9ntimBVE4BxZIkrpRWlN8C/AqfzaqmQCXHKiPlE+z6txJIGZ/QKIwp6I MrJ7zaGU0522tnRM3ajZetZp5n1GV5qeHB13O8ioTOw6o8ig+YYhk023OpMXPMi615Co66 0rI3/uYSXlrYP+blC2NXcrPRRSZdk3JsrRUXFu7KTWp0iaqWvTuZ6PWH9p2O4ibrcStcmb fCIoANnTV73q7UXbCB/bduwd3U/y8NiH0+gHxadSW623VDQKeI3v2U6Lgx3Gow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018109; a=rsa-sha256; cv=none; b=oylTvShdUk72Pdz1XDmYVJ1I4m2MQWeimQPGtOoiMEx20ZqYWfH9z68i3Drh3Dyj8YoWbS wZXwAQ8I8x1euYCYMjKJw0LWlEx6suuYxUMNYJ2Fd2DT+65TjftpVZKqmfCUISiVgndG4O Azfz+AwqdsNL2vdTNQVdpU1hiYo/Q2iE8Retxsp2T0WWntLU+ZuWz6ACfOaJaAXJxh6qRf EZi5HY5Q35YBQH+tVFz33VyUvMlmPOU9tgOZAI3H6C2gtfewlVOn2zT9G2qkiD+fdYlrbo w2X0njpjo7JdosSBka9cSbnFK8yG0I/CB0SkSNsxcYOUQtOSHMwyufthZENpww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXCFQzrc6JYJ/43OjuFeV1nhe20wrIWqs7Tal7rrXoo=; b=r3LZHaqqaVt2LcRcKFpUNfMdl/mrfV7rYO1AOBin0HxMIDu3r9o/t8hK00Lbr5nNo356F7 xqFsT52VEbGrTVz3RqVQyKFhZnW6M/YhA02ISqfqCngJZtuftmdMz2BajAN5w+WQx4nZzw 5O1gqR9QnnWJUMOj6iHDig9dH+maf2jzoO1SaKgX7d16frWyoOydYJhIH60rlV4/MrAq9c VcHHOVWM/Ktq/EX+/Igjw4FkL9lq4giV3lS2HdQjzRnB7iKIu3Z15dUcI7C/cRlqOL88fd 2TXZ0QXt0lWcV+ugivu/uZFxo2t3KKKB+hmSerqhkRMn+OHld4A5Bmp0Ppp9Nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63dT5vGPzvZH; Mon, 03 Mar 2025 16:08: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 523G8TjP090686; Mon, 3 Mar 2025 16:08:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523G8Tdf090683; Mon, 3 Mar 2025 16:08:29 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:08:29 GMT Message-Id: <202503031608.523G8Tdf090683@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: a373ea07650b - main - pf: fix pf_map_addr() not to cause dividing by 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a373ea07650b13f4d398d1341c932082bdb05d3a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a373ea07650b13f4d398d1341c932082bdb05d3a commit a373ea07650b13f4d398d1341c932082bdb05d3a Author: Kristof Provost AuthorDate: 2025-02-28 14:58:15 +0000 Commit: Kristof Provost CommitDate: 2025-03-03 16:07:16 +0000 pf: fix pf_map_addr() not to cause dividing by 0 This fixes problem when using table or dynamic interface addresses for source-hash. Also avoid calling arc4random_uniform() with upper_bound == 0. ok mikeb Obtained from: OpenBSD, yasuoka , c30ec822b8 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_lb.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index cb1d7af258f3..ea9fbc46af63 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -518,7 +518,10 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, case PF_POOL_RANDOM: if (rpool->cur->addr.type == PF_ADDR_TABLE) { cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; - rpool->tblidx = (int)arc4random_uniform(cnt); + if (cnt == 0) + rpool->tblidx = 0; + else + rpool->tblidx = (int)arc4random_uniform(cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(rpool->cur->addr.p.tbl, &rpool->tblidx, &rpool->counter, af, NULL)) { @@ -528,7 +531,10 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, PF_ACPY(naddr, &rpool->counter, af); } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; - rpool->tblidx = (int)arc4random_uniform(cnt); + if (cnt == 0) + rpool->tblidx = 0; + else + rpool->tblidx = (int)arc4random_uniform(cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, &rpool->tblidx, &rpool->counter, af, @@ -583,7 +589,10 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, pf_hash(saddr, (struct pf_addr *)&hash, &rpool->key, af); if (rpool->cur->addr.type == PF_ADDR_TABLE) { cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; - rpool->tblidx = (int)(hashidx % cnt); + if (cnt == 0) + rpool->tblidx = 0; + else + rpool->tblidx = (int)(hashidx % cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(rpool->cur->addr.p.tbl, &rpool->tblidx, &rpool->counter, af, NULL)) { @@ -593,7 +602,10 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, PF_ACPY(naddr, &rpool->counter, af); } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; - rpool->tblidx = (int)(hashidx % cnt); + if (cnt == 0) + rpool->tblidx = 0; + else + rpool->tblidx = (int)(hashidx % cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, &rpool->tblidx, &rpool->counter, af, From nobody Mon Mar 3 16:08:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63dW2B6Kz5pjb7; Mon, 03 Mar 2025 16:08: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 4Z63dW09hHz3xMc; Mon, 03 Mar 2025 16:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JqofZa+NGiJnPY13sionM9SdJT1e9cOrFxVRF1Jm5z4=; b=JM0t8Y8IaewgWUctTvMMUDfphDoc9jF3lQb8sxkSpFUltD2c/PyW6OedL/cOcudysXW3mO aozIkK3bmQpILgVCgNE+3rL+uyjksNPN/aVs1u3ZdNdA2Ciu/HO7tu7MAxhSDJX6Q4FUqY WPsD3vB1DPd1LMFgPdlEsF+zyMhBQTE1hdMnbNNcyU9/JPH/3cGYPMXznIPWQa2j8Ic4DI FXJAj3hMvJtGRY0WyNDMWnTnmX8tP9inPm6a0VIAp7IZpRO4dT3rV08m1LgIT3WeWpoFA/ NN32Og1ulPSMQyOHPPbopMSU8mvkiYYIUE1vbmXTNzxhIPuxSDJerFg6ePSnfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018111; a=rsa-sha256; cv=none; b=v6hNRRYmZfF2T7BXV21m7W00iHYFm2B4aa7mpBJag+tsyzjM3Pd5TyoSlXHLRPxbmBvj0m /3EcPkl5evU2QLWyLZvHNUxdANpNpHEsQ39+FgBELR8TPTaO80aVPW91LRxEvRvppF1QCI 12OxBPkSrq+zEK1YinGRJ5GGHEe2Fs05p51CLZP2fLxUzRB+UeJ97r7VetAIBdhZizGkM0 35KKonEU2sgDR3P7QbTo3/dGZFIs0pkactU92R+8bz8GUrqcwrraLF2Cm3rFwL8sJBYeuC 1ea7T8cm7WASPltbGPLIyEXw/ioTSVhouTEcSpFy8Ghu1GwYqoFTjAF7Y3WulA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JqofZa+NGiJnPY13sionM9SdJT1e9cOrFxVRF1Jm5z4=; b=I+KS2+EAfz+kwpnCcoOBhLGcG9GrTj4Ug3p2Qw9NUrt/dr/ZdXvebXu+Jh/vQwJeq3GYNc 5lW5152z1hkq2GRZPVpR2tU5DV3Ka6p+EI6IUA96x4PhKpKORdxjWu0cuwi4f8ywS2iwFQ Qcm7yoTHzxybpoAVlP7fYXWKqhnQWC7fBdSOLR58SBuXncf77UKTmSMTH7BfK4sWE6CmoY uCDcJ68paIW/S27ApfUn3km9WH3Y+7P0Q4PVGo4x2lwwf07huq8Yt0a1zAX36OVllTrJ/f iEYBNof8T6ESHuBLgmZglfRalMmPenUPmlLydddPKpHq7ag/yDERW9EeXBRS1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63dV6tPSzvXw; Mon, 03 Mar 2025 16:08: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 523G8UIA090719; Mon, 3 Mar 2025 16:08:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523G8UDR090716; Mon, 3 Mar 2025 16:08:30 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:08:30 GMT Message-Id: <202503031608.523G8UDR090716@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: f32a25504461 - main - pf tests: test source-hash and random on empty table or interface without address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f32a255044616604a3a038840feab785c005d10d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f32a255044616604a3a038840feab785c005d10d commit f32a255044616604a3a038840feab785c005d10d Author: Kristof Provost AuthorDate: 2025-03-03 09:38:39 +0000 Commit: Kristof Provost CommitDate: 2025-03-03 16:07:17 +0000 pf tests: test source-hash and random on empty table or interface without address Attempt to provoke the crashes fixed by the previous commit. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/nat.sh | 141 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index 19dd39fe5848..f7026feb5078 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -301,10 +301,151 @@ nat6_nolinklocal_cleanup() pft_cleanup } +empty_table_common() +{ + option=$1 + + pft_init + + epair_wan=$(vnet_mkepair) + epair_lan=$(vnet_mkepair) + + vnet_mkjail srv ${epair_wan}a + jexec srv ifconfig ${epair_wan}a 192.0.2.2/24 up + + vnet_mkjail rtr ${epair_wan}b ${epair_lan}a + jexec rtr ifconfig ${epair_wan}b 192.0.2.1/24 up + jexec rtr ifconfig ${epair_lan}a 198.51.100.1/24 up + jexec rtr sysctl net.inet.ip.forwarding=1 + + ifconfig ${epair_lan}b 198.51.100.2/24 up + route add default 198.51.100.1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "table " \ + "nat on ${epair_wan}b inet from 198.51.100.0/24 -> ${option}" \ + "pass" + + # Sanity checks + atf_check -s exit:0 -o ignore \ + jexec rtr ping -c 1 192.0.2.2 + atf_check -s exit:0 -o ignore \ + ping -c 1 198.51.100.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + # Provoke divide by zero + ping -c 1 192.0.2.2 + true +} + +atf_test_case "empty_table_source_hash" "cleanup" +empty_table_source_hash_head() +{ + atf_set descr 'Test source-hash on an emtpy table' + atf_set require.user root +} + +empty_table_source_hash_body() +{ + empty_table_common "source-hash" +} + +empty_table_source_hash_cleanup() +{ + pft_cleanup +} + +atf_test_case "empty_table_random" "cleanup" +empty_table_random_head() +{ + atf_set descr 'Test random on an emtpy table' + atf_set require.user root +} + +empty_table_random_body() +{ + empty_table_common "random" +} + +empty_table_random_cleanup() +{ + pft_cleanup +} + +no_addrs_common() +{ + option=$1 + + pft_init + + epair_wan=$(vnet_mkepair) + epair_lan=$(vnet_mkepair) + + vnet_mkjail srv ${epair_wan}a + jexec srv ifconfig ${epair_wan}a 192.0.2.2/24 up + + vnet_mkjail rtr ${epair_wan}b ${epair_lan}a + jexec rtr route add -net 192.0.2.0/24 -iface ${epair_wan}b + jexec rtr ifconfig ${epair_lan}a 198.51.100.1/24 up + jexec rtr sysctl net.inet.ip.forwarding=1 + + ifconfig ${epair_lan}b 198.51.100.2/24 up + route add default 198.51.100.1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "nat on ${epair_wan}b inet from 198.51.100.0/24 -> (${epair_wan}b) ${option}" \ + "pass" + + # Provoke divide by zero + ping -c 1 192.0.2.2 + true +} + +atf_test_case "no_addrs_source_hash" "cleanup" +no_addrs_source_hash_head() +{ + atf_set descr 'Test source-hash on an interface with no addresses' + atf_set require.user root +} + +no_addrs_source_hash_body() +{ + no_addrs_common "source-hash" +} + +no_addrs_source_hash_cleanup() +{ + pft_cleanup +} + +atf_test_case "no_addrs_random" "cleanup" +no_addrs_random_head() +{ + atf_set descr 'Test random on an interface with no addresses' + atf_set require.user root +} + +no_addrs_random_body() +{ + no_addrs_common "random" +} + +no_addrs_random_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "exhaust" atf_add_test_case "nested_anchor" atf_add_test_case "endpoint_independent" atf_add_test_case "nat6_nolinklocal" + atf_add_test_case "empty_table_source_hash" + atf_add_test_case "no_addrs_source_hash" + atf_add_test_case "empty_table_random" + atf_add_test_case "no_addrs_random" } From nobody Mon Mar 3 16:12:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63k06yyjz5pjW5; Mon, 03 Mar 2025 16:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z63k06HlDz40St; Mon, 03 Mar 2025 16:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsJY5TkH9DF19kD5RapnFnBBDZxHvkyyNncpHJlpWmo=; b=BJsU9s+dqfz0uGqA+sOv+SYUPKkWvroh4Seit4G14ECBqfvDhl2F4JfkH8IfPMCOeo1QVU Od3v1WeY+g2pnSg0Lcdi3DFUbDqPouB+g88u4hZuN/cnDWWs0PQYN+jiO7FMClbxJIB0Pp DYtaj10MhGE0GXqmTimKCo7XtpKfe+JVPZW+TPDR57vD+VTkzYbDlL6uuRcvpkBQXTwjlP tp3rjadNwQbQExiMn6hVP99KaPZy4/XGU/NDxcWWMUGYwsg+9XnmU3fwhw0WQpDZD/qK4J xiE/hZ70kFtfHNbielW5oHbK9htdbF14uEXSuy7en+pXJ/UPvpqBWbnPDTlXyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018344; a=rsa-sha256; cv=none; b=bS/uNZ7A3bGr+mokufOfzMoDb3GQsXCJhah5tvbs7Ihmf1Fkzb4K2I8oWZkhjHKRUTTn4p bNrw15NkKV+qhzWRbv6yEk3+28FPQpF6RHnFH8nJs4ulZKqHxU4a6isl15985B4HZ4v7M8 vpaZ2jY8L6/L0BtOKd3l1ONCCywfP4ZLRnXWjL/+LtghKD4EhVABEn5bG1DdrWg5fGtbdm Myaro7fLPbxhaaX6ox+SW8Mc92POn9kXk+CP7uGXtVKHO5mUYQbxDAdWYzlJRUuyOxL05g MxP4c5aqDSPgle9ty8W6FkdhoxWs1/QQPeXt8HUDZxHJApBgDpJKqtKly4Y41A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsJY5TkH9DF19kD5RapnFnBBDZxHvkyyNncpHJlpWmo=; b=xC1BsZ5xpujAXNQZtCkLjoNJ4l/JwgPcKpVL5xIX8EKAL0kZ7v/cUGO+MPXbTLxpqknNQ3 dAekwTjLYiYUZX0OYkzZhpJkRQRqYi2OtWlP8Zc8pr/z+tQ/69/IsFZEST6QZ4fQvPGcPI RRTEFzClGHYBQp1+0oj2gMiuqE/WAT9KWNkoHy1aii1qkuZ9YXu7t7EKV3p0TNLej+A4w3 PbIdJXdmQDtPWJ3NLF+jnCm8UZsZfZVKcgzJiUSSg23oCSUcEX1RMSU9uuw4vQxs2/9tBy qPXlZpDAuhITp62/AqgwReT6oKqFRU3JD9XXHAwW0lSwadZSxOR4ZZCk0P2dBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63k05Rfjzv8n; Mon, 03 Mar 2025 16:12: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 523GCOEu007142; Mon, 3 Mar 2025 16:12:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GCOm4007139; Mon, 3 Mar 2025 16:12:24 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:12:24 GMT Message-Id: <202503031612.523GCOm4007139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 125877c92d16 - main - arm64: Split EFI map parsing code to a common file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 125877c92d1661c6a1f567aa9a3e9c399a514789 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=125877c92d1661c6a1f567aa9a3e9c399a514789 commit 125877c92d1661c6a1f567aa9a3e9c399a514789 Author: Mitchell Horne AuthorDate: 2025-03-01 00:04:38 +0000 Commit: Mitchell Horne CommitDate: 2025-03-03 16:12:15 +0000 arm64: Split EFI map parsing code to a common file Motivation: I would like to enable the EFI memory map parsing on riscv, which is preferable to parsing memory regions from the device tree. I could easily duplicate the functionality, but it can be shared without much extra effort. There are a couple of similar implementations existing already. In this commit, the arm64 version of the code is moved to the new file, and enabled for this platform. No functional change intended. armv7 and riscv will follow. amd64 could be converted to use this interface too, but it doesn't use the common "physmem" interfaces for managing physical memory, and would therefore require further tweaks. I am not inclined to make this change at this time. Reviewed by: imp, andrew Discussed with: emaste (copyright attribution) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47746 --- sys/arm64/arm64/machdep.c | 175 ++------------------------------------------- sys/conf/files.arm64 | 1 + sys/kern/subr_efi_map.c | 178 ++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/efi_map.h | 22 ++++++ 4 files changed, 206 insertions(+), 170 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 22c74b21cf48..a94cdaa61775 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -457,172 +458,6 @@ arm64_get_writable_addr(void *addr, void **out) return (false); } -typedef void (*efi_map_entry_cb)(struct efi_md *, void *argp); - -static void -foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void *argp) -{ - struct efi_md *map, *p; - size_t efisz; - int ndesc, i; - - /* - * Memory map data provided by UEFI via the GetMemoryMap - * Boot Services API. - */ - efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; - map = (struct efi_md *)((uint8_t *)efihdr + efisz); - - if (efihdr->descriptor_size == 0) - return; - ndesc = efihdr->memory_size / efihdr->descriptor_size; - - for (i = 0, p = map; i < ndesc; i++, - p = efi_next_descriptor(p, efihdr->descriptor_size)) { - cb(p, argp); - } -} - -/* - * Handle the EFI memory map list. - * - * We will make two passes at this, the first (exclude == false) to populate - * physmem with valid physical memory ranges from recognized map entry types. - * In the second pass we will exclude memory ranges from physmem which must not - * be used for general allocations, either because they are used by runtime - * firmware or otherwise reserved. - * - * Adding the runtime-reserved memory ranges to physmem and excluding them - * later ensures that they are included in the DMAP, but excluded from - * phys_avail[]. - * - * Entry types not explicitly listed here are ignored and not mapped. - */ -static void -handle_efi_map_entry(struct efi_md *p, void *argp) -{ - bool exclude = *(bool *)argp; - - switch (p->md_type) { - case EFI_MD_TYPE_RECLAIM: - /* - * The recomended location for ACPI tables. Map into the - * DMAP so we can access them from userspace via /dev/mem. - */ - case EFI_MD_TYPE_RT_CODE: - /* - * Some UEFI implementations put the system table in the - * runtime code section. Include it in the DMAP, but will - * be excluded from phys_avail. - */ - case EFI_MD_TYPE_RT_DATA: - /* - * Runtime data will be excluded after the DMAP - * region is created to stop it from being added - * to phys_avail. - */ - if (exclude) { - physmem_exclude_region(p->md_phys, - p->md_pages * EFI_PAGE_SIZE, EXFLAG_NOALLOC); - break; - } - /* FALLTHROUGH */ - case EFI_MD_TYPE_CODE: - case EFI_MD_TYPE_DATA: - case EFI_MD_TYPE_BS_CODE: - case EFI_MD_TYPE_BS_DATA: - case EFI_MD_TYPE_FREE: - /* - * We're allowed to use any entry with these types. - */ - if (!exclude) - physmem_hardware_region(p->md_phys, - p->md_pages * EFI_PAGE_SIZE); - break; - default: - /* Other types shall not be handled by physmem. */ - break; - } -} - -static void -add_efi_map_entries(struct efi_map_header *efihdr) -{ - bool exclude = false; - foreach_efi_map_entry(efihdr, handle_efi_map_entry, &exclude); -} - -static void -exclude_efi_map_entries(struct efi_map_header *efihdr) -{ - bool exclude = true; - foreach_efi_map_entry(efihdr, handle_efi_map_entry, &exclude); -} - -static void -print_efi_map_entry(struct efi_md *p, void *argp __unused) -{ - const char *type; - static const char *types[] = { - "Reserved", - "LoaderCode", - "LoaderData", - "BootServicesCode", - "BootServicesData", - "RuntimeServicesCode", - "RuntimeServicesData", - "ConventionalMemory", - "UnusableMemory", - "ACPIReclaimMemory", - "ACPIMemoryNVS", - "MemoryMappedIO", - "MemoryMappedIOPortSpace", - "PalCode", - "PersistentMemory" - }; - - if (p->md_type < nitems(types)) - type = types[p->md_type]; - else - type = ""; - printf("%23s %012lx %012lx %08lx ", type, p->md_phys, - p->md_virt, p->md_pages); - if (p->md_attr & EFI_MD_ATTR_UC) - printf("UC "); - if (p->md_attr & EFI_MD_ATTR_WC) - printf("WC "); - if (p->md_attr & EFI_MD_ATTR_WT) - printf("WT "); - if (p->md_attr & EFI_MD_ATTR_WB) - printf("WB "); - if (p->md_attr & EFI_MD_ATTR_UCE) - printf("UCE "); - if (p->md_attr & EFI_MD_ATTR_WP) - printf("WP "); - if (p->md_attr & EFI_MD_ATTR_RP) - printf("RP "); - if (p->md_attr & EFI_MD_ATTR_XP) - printf("XP "); - if (p->md_attr & EFI_MD_ATTR_NV) - printf("NV "); - if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE) - printf("MORE_RELIABLE "); - if (p->md_attr & EFI_MD_ATTR_RO) - printf("RO "); - if (p->md_attr & EFI_MD_ATTR_RT) - printf("RUNTIME"); - printf("\n"); -} - -static void -print_efi_map_entries(struct efi_map_header *efihdr) -{ - - printf("%23s %12s %12s %8s %4s\n", - "Type", "Physical", "Virtual", "#Pages", "Attr"); - foreach_efi_map_entry(efihdr, print_efi_map_entry, NULL); -} - /* * Map the passed in VA in EFI space to a void * using the efi memory table to * find the PA and return it in the DMAP, if it exists. We're used between the @@ -659,7 +494,7 @@ efi_early_map(vm_offset_t va) { struct early_map_data emd = { .va = va }; - foreach_efi_map_entry(efihdr, efi_early_map_entry, &emd); + efi_map_foreach_entry(efihdr, efi_early_map_entry, &emd); if (emd.pa == 0) return NULL; return (void *)PHYS_TO_DMAP(emd.pa); @@ -942,7 +777,7 @@ initarm(struct arm64_bootparams *abp) efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); if (efihdr != NULL) - add_efi_map_entries(efihdr); + efi_map_add_entries(efihdr); #ifdef FDT else { /* Grab physical memory regions information from device tree. */ @@ -972,7 +807,7 @@ initarm(struct arm64_bootparams *abp) pmap_bootstrap(lastaddr - KERNBASE); /* Exclude entries needed in the DMAP region, but not phys_avail */ if (efihdr != NULL) - exclude_efi_map_entries(efihdr); + efi_map_exclude_entries(efihdr); /* Do the same for reserve entries in the EFI MEMRESERVE table */ if (efi_systbl_phys != 0) exclude_efi_memreserve(efi_systbl_phys); @@ -1051,7 +886,7 @@ initarm(struct arm64_bootparams *abp) if (boothowto & RB_VERBOSE) { if (efihdr != NULL) - print_efi_map_entries(efihdr); + efi_map_print_entries(efihdr); physmem_print_tables(); } diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 13c7d9b1875d..de3134ad9124 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -6,6 +6,7 @@ kern/msi_if.m optional intrng kern/pic_if.m optional intrng kern/subr_devmap.c standard +kern/subr_efi_map.c standard kern/subr_intr.c optional intrng kern/subr_physmem.c standard libkern/strlen.c standard diff --git a/sys/kern/subr_efi_map.c b/sys/kern/subr_efi_map.c new file mode 100644 index 000000000000..29a94858f6c1 --- /dev/null +++ b/sys/kern/subr_efi_map.c @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2018 Andrew Turner + * + * SPDX-License-Identifier: BSD-2-Clause + */ +#include +#include +#include +#include +#include + +#include +#include + +void +efi_map_foreach_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void *argp) +{ + struct efi_md *map, *p; + size_t efisz; + int ndesc, i; + + /* + * Memory map data provided by UEFI via the GetMemoryMap + * Boot Services API. + */ + efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; + map = (struct efi_md *)((uint8_t *)efihdr + efisz); + + if (efihdr->descriptor_size == 0) + return; + ndesc = efihdr->memory_size / efihdr->descriptor_size; + + for (i = 0, p = map; i < ndesc; i++, + p = efi_next_descriptor(p, efihdr->descriptor_size)) { + cb(p, argp); + } +} + +/* + * Handle the EFI memory map list. + * + * We will make two passes at this, the first (exclude == false) to populate + * physmem with valid physical memory ranges from recognized map entry types. + * In the second pass we will exclude memory ranges from physmem which must not + * be used for general allocations, either because they are used by runtime + * firmware or otherwise reserved. + * + * Adding the runtime-reserved memory ranges to physmem and excluding them + * later ensures that they are included in the DMAP, but excluded from + * phys_avail[]. + * + * Entry types not explicitly listed here are ignored and not mapped. + */ +static void +handle_efi_map_entry(struct efi_md *p, void *argp) +{ + bool exclude = *(bool *)argp; + + switch (p->md_type) { + case EFI_MD_TYPE_RECLAIM: + /* + * The recomended location for ACPI tables. Map into the + * DMAP so we can access them from userspace via /dev/mem. + */ + case EFI_MD_TYPE_RT_CODE: + /* + * Some UEFI implementations put the system table in the + * runtime code section. Include it in the DMAP, but will + * be excluded from phys_avail. + */ + case EFI_MD_TYPE_RT_DATA: + /* + * Runtime data will be excluded after the DMAP + * region is created to stop it from being added + * to phys_avail. + */ + if (exclude) { + physmem_exclude_region(p->md_phys, + p->md_pages * EFI_PAGE_SIZE, EXFLAG_NOALLOC); + break; + } + /* FALLTHROUGH */ + case EFI_MD_TYPE_CODE: + case EFI_MD_TYPE_DATA: + case EFI_MD_TYPE_BS_CODE: + case EFI_MD_TYPE_BS_DATA: + case EFI_MD_TYPE_FREE: + /* + * We're allowed to use any entry with these types. + */ + if (!exclude) + physmem_hardware_region(p->md_phys, + p->md_pages * EFI_PAGE_SIZE); + break; + default: + /* Other types shall not be handled by physmem. */ + break; + } +} + +void +efi_map_add_entries(struct efi_map_header *efihdr) +{ + bool exclude = false; + efi_map_foreach_entry(efihdr, handle_efi_map_entry, &exclude); +} + +void +efi_map_exclude_entries(struct efi_map_header *efihdr) +{ + bool exclude = true; + efi_map_foreach_entry(efihdr, handle_efi_map_entry, &exclude); +} + +static void +print_efi_map_entry(struct efi_md *p, void *argp __unused) +{ + const char *type; + static const char *types[] = { + "Reserved", + "LoaderCode", + "LoaderData", + "BootServicesCode", + "BootServicesData", + "RuntimeServicesCode", + "RuntimeServicesData", + "ConventionalMemory", + "UnusableMemory", + "ACPIReclaimMemory", + "ACPIMemoryNVS", + "MemoryMappedIO", + "MemoryMappedIOPortSpace", + "PalCode", + "PersistentMemory" + }; + + if (p->md_type < nitems(types)) + type = types[p->md_type]; + else + type = ""; + printf("%23s %012lx %012lx %08lx ", type, p->md_phys, + p->md_virt, p->md_pages); + if (p->md_attr & EFI_MD_ATTR_UC) + printf("UC "); + if (p->md_attr & EFI_MD_ATTR_WC) + printf("WC "); + if (p->md_attr & EFI_MD_ATTR_WT) + printf("WT "); + if (p->md_attr & EFI_MD_ATTR_WB) + printf("WB "); + if (p->md_attr & EFI_MD_ATTR_UCE) + printf("UCE "); + if (p->md_attr & EFI_MD_ATTR_WP) + printf("WP "); + if (p->md_attr & EFI_MD_ATTR_RP) + printf("RP "); + if (p->md_attr & EFI_MD_ATTR_XP) + printf("XP "); + if (p->md_attr & EFI_MD_ATTR_NV) + printf("NV "); + if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE) + printf("MORE_RELIABLE "); + if (p->md_attr & EFI_MD_ATTR_RO) + printf("RO "); + if (p->md_attr & EFI_MD_ATTR_RT) + printf("RUNTIME"); + printf("\n"); +} + +void +efi_map_print_entries(struct efi_map_header *efihdr) +{ + + printf("%23s %12s %12s %8s %4s\n", + "Type", "Physical", "Virtual", "#Pages", "Attr"); + efi_map_foreach_entry(efihdr, print_efi_map_entry, NULL); +} diff --git a/sys/sys/efi_map.h b/sys/sys/efi_map.h new file mode 100644 index 000000000000..4edabd4e5812 --- /dev/null +++ b/sys/sys/efi_map.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2018 Andrew Turner + * + * SPDX-License-Identifier: BSD-2-Clause + */ +#ifndef _SYS_EFI_MAP_H_ +#define _SYS_EFI_MAP_H_ + +#include +#include + +typedef void (*efi_map_entry_cb)(struct efi_md *, void *argp); + +void efi_map_foreach_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, + void *argp); + +void efi_map_add_entries(struct efi_map_header *efihdr); +void efi_map_exclude_entries(struct efi_map_header *efihdr); +void efi_map_print_entries(struct efi_map_header *efihdr); + +#endif /* !_SYS_EFI_MAP_H_ */ From nobody Mon Mar 3 16:12:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63k22ByHz5pjbl; Mon, 03 Mar 2025 16:12: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 4Z63k16trtz40WF; Mon, 03 Mar 2025 16:12:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RSK7pHfXCkRjNL7qXLTg8ByUfGhTmmYmDcv4Jy275sA=; b=Im//KW9vg1EvZ2MT/vjjHZrqxt/EkNfbdUCZ43NuhjS0O8x/lM9e2BWILgvUQ+hW67yH6D zMplAfrBRdaAnyp/pCgdEMNuhRc+GmoyvuOd64rPef+WXO1c+qoA9rd4bUZFsVPW4o/8Qi V0TtQFmXbbkq57ysR4e983Qjzumz4QRqspVsMeoYRrmssbmvBpyj29Dg2SX9e0IvLZHFFh Qw1aMP/rg4uj57gVueYECzaK5Vav3HM59YKK2KirCXPzHxhaZbeU41AkfCUsVJnsiSX12X qDiR9CU8yZc2LYFJxVUurTF/fdQjodENmtJRG+Bxs56CQK/d2l+6vq9GFNqUFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018346; a=rsa-sha256; cv=none; b=d7LisJzqENZOJ0Fr95CgObI3ddOkIC2MKsvBVcBGqYo30GSbwkD6HTsrXM/OSMIZRNG5jg RJxR364EGCXMWR+0/+j98lxHRHg2hFUXwpNlp+xrdyWvq8dxNEKr2+BArXZO72nvRBeSyp XZ5jv7RHXb/09kvctKee/25r9lItd8c9cCUrnzv8bLSiyBtmrztAr6Ddebi4hrjgR3MixB A5rbpKAQ8QgoBvjz2ra9Bz3qtjQPr+5HQA0EqRGs4fMJaz00LtEfgvL0OlxRRQ4JBN90Qn Yg8glWKth+ZC/qe7DdSy/pt6u9DoHlrJXrRljuw25a+1KYvl2Aew0/d6gJMS5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RSK7pHfXCkRjNL7qXLTg8ByUfGhTmmYmDcv4Jy275sA=; b=knZVMBz27hbwellNhZ/seK24bA4k5gRU0ByD4qTGtAqSdX5wL58ewEWPFKKYRrtxjbCdYx ++O0p6+wEn3Zum8NSeweGUBvtHP4wDJxBN1XGGKRdokKwvRcmVL+/Qgw43JFt+B8f5O1i4 sDlcMfiY81DAs1ChEu8S9cIECBXXvZwnQUmugy2WB+Ka9yb1leAI5J+M/ji8UGNBwGAI22 nJIO5dxgPSgmMIoaMF1EIgqU4RKMkqzTxoN9x/hHpos+SHNb+fp3OCJnSR/vc2FzJOE8Tf Abvu+1pOAhGHaXh6pT9/OkS+JSLkshHmH0vRf4LT7i4kHvuA4EuckZp5q7U1nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63k16RRVzvlJ; Mon, 03 Mar 2025 16:12: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 523GCPkC007175; Mon, 3 Mar 2025 16:12:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GCP2o007172; Mon, 3 Mar 2025 16:12:25 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:12:25 GMT Message-Id: <202503031612.523GCP2o007172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: cb0fb2812914 - main - exclude_efi_memreserve(): use the right type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb0fb2812914aac78ec77e5704176ef45440f139 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=cb0fb2812914aac78ec77e5704176ef45440f139 commit cb0fb2812914aac78ec77e5704176ef45440f139 Author: Mitchell Horne AuthorDate: 2024-11-26 15:55:29 +0000 Commit: Mitchell Horne CommitDate: 2025-03-03 16:12:15 +0000 exclude_efi_memreserve(): use the right type efi_systbl_phys is a physical address. Thus, prefer vm_paddr_t to vm_offset_t. No functional change. Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index a94cdaa61775..93343a1972af 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -508,7 +508,7 @@ efi_early_map(vm_offset_t va) * anything since msgbufp isn't initialized, let alone a console... */ static void -exclude_efi_memreserve(vm_offset_t efi_systbl_phys) +exclude_efi_memreserve(vm_paddr_t efi_systbl_phys) { struct efi_systbl *systbl; struct uuid efi_memreserve = LINUX_EFI_MEMRESERVE_TABLE; From nobody Mon Mar 3 16:12:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63k417N9z5pjdn; Mon, 03 Mar 2025 16:12: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 4Z63k32NNgz40WT; Mon, 03 Mar 2025 16:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kLsh57pUjSnY8HLnuruog6//dBWYnU+8GyIIDdUQX/w=; b=sq3Tkkc1YFnOk018ASUj35CWyJ0G5BPO8LyjZdJWH7XqBsvBxz+Ie2dgeMVT2HGAXBWBaV OJbiG/rJLpqtfiW5K7+42HWoql+DVxmz+86JrhKRa4RllRdFqt9md0vzzifiluD37YiXUn F8lMZU52+gcD3CQd0nHlMdJJveMyHbTOHsy5EDrcYyzrvpBjCnVhnHRPvvqUQKKcu/BXCk rmDpZoSyh8sFRJE2TV4kp9/GuCcIR23hoDPzTqC+LPZk+syiXubilxirsS1XQilXBavTGF TjhLkOrSAujI2mN2OwT36O8mh78ezjm+6OYGtVDF7DKtQExe1IyP3rS3zD8JUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018347; a=rsa-sha256; cv=none; b=Iq4sb1eEUhf1FtT4m74JmIom+ubGPkGioIGuNcky2+OLNWa9r035NNg5RZyqwpDUU0Niz6 tL71CT9cSSG0QNdUoJdBJBtKHm/Gaer6q9wPxJF0KyyPO070WvRyv/vAc/DJUIJZIFzPV4 iO8LOWqAFAIu/AM5iEl/LDBR4nXOYu3aLI32Erx3Sus0RbrWjud//8PkrzFc1ctVRr9Bd1 aWrkqRpGPZZIb/z3GBEGUS/FSYPCbUOaPXUexx+4XMTGshZbO5x7u4WtGgihfK2DXPObvy OHJ7np0kKdqyznxjPPUkMCimlvnHnVjL0RPBynk/9dejODlEskYSU5xVHOQhHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kLsh57pUjSnY8HLnuruog6//dBWYnU+8GyIIDdUQX/w=; b=YME+JLLOhGuxHD5ccxOkf+EK5ds2DBhef6Hioq8CURZjXHmrb2MVBHwL54PMIfKl8FGenA wyN8RU1jfYLSDZjHg1fmOMi1e30O/tl4rW2siqx1PBPZ2Mcx6BBa/j8djenDhhj3z67mwj QNgjsGOmwYUmXSZpDzoDWk+abtf2BRfEfagIoPpEmBVfIEbWwHBSEvz1EhpxCaZ08IbLtd 3HNe2srdbcA+ESjjo+1bstgOEZCB2bAaRZL2E3JAqdGiU6L5KHEqeHE+03fOcD5Uq4i8Yv JEHnLRT9UxY1EgZB2PAXhrDktXuVZZhk+vamSpNqrPGvbD5s88GWKJgv25YotQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63k30JqYzvLr; Mon, 03 Mar 2025 16:12: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 523GCQDY007208; Mon, 3 Mar 2025 16:12:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GCQnR007205; Mon, 3 Mar 2025 16:12:26 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:12:26 GMT Message-Id: <202503031612.523GCQnR007205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 8bfd5cefbc71 - main - arm: switch to subr_efi_map.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bfd5cefbc7143adffa34d74bc539802a01f0f26 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8bfd5cefbc7143adffa34d74bc539802a01f0f26 commit 8bfd5cefbc7143adffa34d74bc539802a01f0f26 Author: Mitchell Horne AuthorDate: 2025-03-03 15:45:32 +0000 Commit: Mitchell Horne CommitDate: 2025-03-03 16:12:15 +0000 arm: switch to subr_efi_map.c Reduce code duplication by switching to the new shared interface. Practically, the kernel may lose a few pages to (unused) EFI runtime services. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49132 --- sys/arm/arm/machdep.c | 25 ++++++++--- sys/arm/arm/machdep_boot.c | 107 --------------------------------------------- sys/conf/files.arm | 1 + sys/kern/subr_efi_map.c | 4 +- 4 files changed, 21 insertions(+), 116 deletions(-) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index e45ef9834e81..31f888313d59 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -462,20 +463,22 @@ initarm(struct arm_boot_params *abp) efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); if (efihdr != NULL) { - arm_add_efi_map_entries(efihdr, mem_regions, &mem_regions_sz); + efi_map_add_entries(efihdr); + efi_map_exclude_entries(efihdr); } else #endif { /* Grab physical memory regions information from device tree. */ if (fdt_get_mem_regions(mem_regions, &mem_regions_sz,NULL) != 0) panic("Cannot get physical memory regions"); - } - physmem_hardware_regions(mem_regions, mem_regions_sz); - /* Grab reserved memory regions information from device tree. */ - if (fdt_get_reserved_regions(mem_regions, &mem_regions_sz) == 0) - physmem_exclude_regions(mem_regions, mem_regions_sz, - EXFLAG_NODUMP | EXFLAG_NOALLOC); + physmem_hardware_regions(mem_regions, mem_regions_sz); + + /* Grab reserved memory regions information from device tree. */ + if (fdt_get_reserved_regions(mem_regions, &mem_regions_sz) == 0) + physmem_exclude_regions(mem_regions, mem_regions_sz, + EXFLAG_NODUMP | EXFLAG_NOALLOC); + } /* * Set TEX remapping registers. @@ -632,6 +635,14 @@ initarm(struct arm_boot_params *abp) arm_kdb_init(); /* Apply possible BP hardening. */ cpuinfo_init_bp_hardening(); + +#ifdef EFI + if (boothowto & RB_VERBOSE) { + if (efihdr != NULL) + efi_map_print_entries(efihdr); + } +#endif + return ((void *)STACKALIGN(thread0.td_pcb)); } diff --git a/sys/arm/arm/machdep_boot.c b/sys/arm/arm/machdep_boot.c index e2416f86ad23..8a6c63af3c92 100644 --- a/sys/arm/arm/machdep_boot.c +++ b/sys/arm/arm/machdep_boot.c @@ -389,110 +389,3 @@ fake_preload_metadata(struct arm_boot_params *abp __unused, void *dtb_ptr, return (lastaddr); } - -#ifdef EFI -void -arm_add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr, - int *mrcnt) -{ - struct efi_md *map, *p; - const char *type; - size_t efisz; - int ndesc, i, j; - - static const char *types[] = { - "Reserved", - "LoaderCode", - "LoaderData", - "BootServicesCode", - "BootServicesData", - "RuntimeServicesCode", - "RuntimeServicesData", - "ConventionalMemory", - "UnusableMemory", - "ACPIReclaimMemory", - "ACPIMemoryNVS", - "MemoryMappedIO", - "MemoryMappedIOPortSpace", - "PalCode", - "PersistentMemory" - }; - - *mrcnt = 0; - - /* - * Memory map data provided by UEFI via the GetMemoryMap - * Boot Services API. - */ - efisz = roundup2(sizeof(struct efi_map_header), 0x10); - map = (struct efi_md *)((uint8_t *)efihdr + efisz); - - if (efihdr->descriptor_size == 0) - return; - ndesc = efihdr->memory_size / efihdr->descriptor_size; - - if (boothowto & RB_VERBOSE) - printf("%23s %12s %12s %8s %4s\n", - "Type", "Physical", "Virtual", "#Pages", "Attr"); - - for (i = 0, j = 0, p = map; i < ndesc; i++, - p = efi_next_descriptor(p, efihdr->descriptor_size)) { - if (boothowto & RB_VERBOSE) { - if (p->md_type < nitems(types)) - type = types[p->md_type]; - else - type = ""; - printf("%23s %012llx %012llx %08llx ", type, p->md_phys, - p->md_virt, p->md_pages); - if (p->md_attr & EFI_MD_ATTR_UC) - printf("UC "); - if (p->md_attr & EFI_MD_ATTR_WC) - printf("WC "); - if (p->md_attr & EFI_MD_ATTR_WT) - printf("WT "); - if (p->md_attr & EFI_MD_ATTR_WB) - printf("WB "); - if (p->md_attr & EFI_MD_ATTR_UCE) - printf("UCE "); - if (p->md_attr & EFI_MD_ATTR_WP) - printf("WP "); - if (p->md_attr & EFI_MD_ATTR_RP) - printf("RP "); - if (p->md_attr & EFI_MD_ATTR_XP) - printf("XP "); - if (p->md_attr & EFI_MD_ATTR_NV) - printf("NV "); - if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE) - printf("MORE_RELIABLE "); - if (p->md_attr & EFI_MD_ATTR_RO) - printf("RO "); - if (p->md_attr & EFI_MD_ATTR_RT) - printf("RUNTIME"); - printf("\n"); - } - - switch (p->md_type) { - case EFI_MD_TYPE_CODE: - case EFI_MD_TYPE_DATA: - case EFI_MD_TYPE_BS_CODE: - case EFI_MD_TYPE_BS_DATA: - case EFI_MD_TYPE_FREE: - /* - * We're allowed to use any entry with these types. - */ - break; - default: - continue; - } - - j++; - if (j >= FDT_MEM_REGIONS) - break; - - mr[j].mr_start = p->md_phys; - mr[j].mr_size = p->md_pages * EFI_PAGE_SIZE; - } - - *mrcnt = j; -} -#endif /* EFI */ diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 5ada97ccad30..0188dda87c96 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -108,6 +108,7 @@ kern/msi_if.m optional intrng kern/pic_if.m optional intrng kern/subr_busdma_bufalloc.c standard kern/subr_devmap.c standard +kern/subr_efi_map.c optional efi kern/subr_physmem.c standard kern/subr_sfbuf.c standard libkern/arm/aeabi_unwind.c standard diff --git a/sys/kern/subr_efi_map.c b/sys/kern/subr_efi_map.c index 29a94858f6c1..4085d7f1cdb9 100644 --- a/sys/kern/subr_efi_map.c +++ b/sys/kern/subr_efi_map.c @@ -139,8 +139,8 @@ print_efi_map_entry(struct efi_md *p, void *argp __unused) type = types[p->md_type]; else type = ""; - printf("%23s %012lx %012lx %08lx ", type, p->md_phys, - p->md_virt, p->md_pages); + printf("%23s %012jx %012jx %08jx ", type, (uintmax_t)p->md_phys, + (uintmax_t)p->md_virt, (uintmax_t)p->md_pages); if (p->md_attr & EFI_MD_ATTR_UC) printf("UC "); if (p->md_attr & EFI_MD_ATTR_WC) From nobody Mon Mar 3 16:12:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63k46HCxz5pjW9; Mon, 03 Mar 2025 16:12: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 4Z63k426Ljz40N2; Mon, 03 Mar 2025 16:12:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPKM4IO85K7Iws4zUOAgHxoXF2XFAtM+5Z8VJyYSeOo=; b=qOUza8b5BcGkb726fRNDipMuf+BrWoQzKZjXNqnR0xFKTX9afy1R/1XU4E1C5SssS1r8zz FrvkaXCRMpBpzMBwyoa8iOig4zW1ey/vcWcv6a2OAB3JjEeCM8cPtIXJO4zfqwiPmhYQAh nTqpDO87iuADNrUdu2v9jFfemorpg0wyfO40kDXUzuCM0IYQlJHZGetafPbpZI2PgfGBUw m+DZRL4QvO4ARE+c9PV1rZnBHayFkv/i/9lYxO+OXM8s5ym7JLGDwWIBbOxkak4Wwcldut FsMVMtfL3Cu84Smc27FL1wQRYRi9SzXF/Z47F632JENjFPTzUXV41OU6k2mrJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018348; a=rsa-sha256; cv=none; b=w3m/BdewKj8FZhMLMBIlgAvQBXvQyjkMA4NlzKEIPuTyn6BO5tkg9CpWG3h3Hwq6mQmls5 Dt03vitnVQXBlZZYAmBTLC1yYrPDPGcTT7AKFUcBJssZTUCZszHEiPlbZmkoGU7YWow33M el5n4GmElL+jIEZ8yboY+EvOTh3dINAkC8E3AxW20RnAPn5gDvHlcSzR1MYABgcxCOOPvH 54O0+DpsYHxlL7mtRz/67Wp648ewE+gXDyl0lIEQtoG62KRBuE9AnQLFfEo2i0POKF4TkB 5wZNoZFnuZMV1whcC89Yxhb+3gwEVuksue3fWOM3XXeV+QN3TjfB8tgP5SrU6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPKM4IO85K7Iws4zUOAgHxoXF2XFAtM+5Z8VJyYSeOo=; b=snrRvIh5tlqq4b4CUPCa5Q+nkihCPAf/o4rSTi4qrD2cyTUUt81NNEpE/pFZ1MR8K0Rntc D4oOMtwiLUsuJj/Q7fefrPrvbOzsziLaPsCxv/2Z/2urqTT28M9uismrWDssLF+eXwK3Zd xqJ8ZSk2lGb/T4mnSnbEZUPAVr9TnrFHAJdVPi6toXBNqy1pXW1nFNU5DvK/EdRNyquxgE YFYnjhiDzV2aGp1b4yxnQP7bWRvfucgdDELWp8tc+gd7xLiwPKIj0Ae8W6quyyYdq+aWjo BdavsQO9orj9TiBOWQo+303H9cAg8uCyq/XGG6RCS1GrgNjvLekvbw+R4dLB0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63k41HsBzvYV; Mon, 03 Mar 2025 16:12: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 523GCSLE007246; Mon, 3 Mar 2025 16:12:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GCSQJ007243; Mon, 3 Mar 2025 16:12:28 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:12:28 GMT Message-Id: <202503031612.523GCSQJ007243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: a2e2178402af - main - riscv: parse memory regions from EFI map header List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2e2178402afff939cb90e75c65ded0a9da8ac5c Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a2e2178402afff939cb90e75c65ded0a9da8ac5c commit a2e2178402afff939cb90e75c65ded0a9da8ac5c Author: Mitchell Horne AuthorDate: 2025-03-03 15:49:17 +0000 Commit: Mitchell Horne CommitDate: 2025-03-03 16:12:15 +0000 riscv: parse memory regions from EFI map header Using the newly isolated efi_map interface (subr_efi_map.c). The primary goal is a greater adherence to the EFI firmware's view of memory, and protection of its reserved regions. This is a better source of truth than the device tree. For example, regions marked as RuntimeServicesData must be excluded from general memory allocations for EFI runtime services to eventually be enabled on the platform (planned but not currently in progress). The secondary impact is when loading a new/custom device tree via loader(8); use of the EFI map ensures that reservations made by firmware (OpenSBI, u-boot) are maintained. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49131 --- sys/conf/files.riscv | 1 + sys/riscv/riscv/machdep.c | 63 ++++++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index cc18ecb6eb36..0d782239c89c 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -30,6 +30,7 @@ kern/msi_if.m standard kern/pic_if.m standard kern/subr_devmap.c standard kern/subr_dummy_vdso_tc.c standard +kern/subr_efi_map.c standard kern/subr_intr.c standard kern/subr_physmem.c standard libkern/bcopy.c standard diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index 8d32d348df7d..03f5926c3739 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -468,6 +469,7 @@ void initriscv(struct riscv_bootparams *rvbp) { struct mem_region mem_regions[FDT_MEM_REGIONS]; + struct efi_map_header *efihdr; struct pcpu *pcpup; int mem_regions_sz; vm_offset_t lastaddr; @@ -516,21 +518,40 @@ initriscv(struct riscv_bootparams *rvbp) } pcpup->pc_hart = boot_hart; -#ifdef FDT - /* - * Exclude reserved memory specified by the device tree. Typically, - * this contains an entry for memory used by the runtime SBI firmware. - */ - if (fdt_get_reserved_mem(mem_regions, &mem_regions_sz) == 0) { - physmem_exclude_regions(mem_regions, mem_regions_sz, - EXFLAG_NODUMP | EXFLAG_NOALLOC); + efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, + MODINFO_METADATA | MODINFOMD_EFI_MAP); + if (efihdr != NULL) { + efi_map_add_entries(efihdr); + efi_map_exclude_entries(efihdr); } +#ifdef FDT + else { + /* Exclude reserved memory specified by the device tree. */ + if (fdt_get_reserved_mem(mem_regions, &mem_regions_sz) == 0) { + physmem_exclude_regions(mem_regions, mem_regions_sz, + EXFLAG_NODUMP | EXFLAG_NOALLOC); + } - /* Grab physical memory regions information from device tree. */ - if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, NULL) != 0) { - panic("Cannot get physical memory regions"); + /* Grab physical memory regions information from device tree. */ + if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, NULL) != 0) + panic("Cannot get physical memory regions"); + physmem_hardware_regions(mem_regions, mem_regions_sz); + + /* + * XXX: Unconditionally exclude the lowest 2MB of physical + * memory, as this area is assumed to contain the SBI firmware, + * and this is not properly reserved in all cases (e.g. in + * older firmware like BBL). + * + * This is a little fragile, but it is consistent with the + * platforms we support so far. + * + * TODO: remove this when the all regular booting methods + * properly report their reserved memory in the device tree. + */ + physmem_exclude_region(mem_regions[0].mr_start, L2_SIZE, + EXFLAG_NODUMP | EXFLAG_NOALLOC); } - physmem_hardware_regions(mem_regions, mem_regions_sz); #endif /* @@ -541,19 +562,6 @@ initriscv(struct riscv_bootparams *rvbp) /* Do basic tuning, hz etc */ init_param1(); -#ifdef FDT - /* - * XXX: Unconditionally exclude the lowest 2MB of physical memory, as - * this area is assumed to contain the SBI firmware. This is a little - * fragile, but it is consistent with the platforms we support so far. - * - * TODO: remove this when the all regular booting methods properly - * report their reserved memory in the device tree. - */ - physmem_exclude_region(mem_regions[0].mr_start, L2_SIZE, - EXFLAG_NODUMP | EXFLAG_NOALLOC); -#endif - /* Bootstrap enough of pmap to enter the kernel proper */ kernlen = (lastaddr - KERNBASE); pmap_bootstrap(rvbp->kern_phys, kernlen); @@ -588,8 +596,11 @@ initriscv(struct riscv_bootparams *rvbp) if (env != NULL) strlcpy(kernelname, env, sizeof(kernelname)); - if (boothowto & RB_VERBOSE) + if (boothowto & RB_VERBOSE) { + if (efihdr != NULL) + efi_map_print_entries(efihdr); physmem_print_tables(); + } early_boot = 0; From nobody Mon Mar 3 16:12:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63k657pWz5pjlf; Mon, 03 Mar 2025 16:12: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 4Z63k63rHPz40Kj; Mon, 03 Mar 2025 16:12:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RYcMZ8JJAfOqoQUem62w/VyAjda7BFW6cO1aVXIfA1g=; b=QmwbtuLAltXVsbVlPWo96z4A9FYNpP2sg1wDrN0mGTm1Klg8AvDh+ABnqVxiUTVzTs3ez5 vEJ0rU2Efjh8h6bqlBoth+fPUUAJr4VKnoyWja8BuODDtTxw3gjm6dYo4fDTbF49QG7cu8 epLa8YoFOGrrR6iTquWzPcBtW/9ZEDIdElwvrtI27lHsp/gJ/BMR9yu/CkepVTi4NtczQ0 ir0b0Zg5/hnHn75USVtVClyUK8aVTq58zQK8ITfiKm30EUxPZk5e8cKCq/nQqn67ECTsIK qz0+H7DQJnR4O/jAZ+9q3nrLM8X3mytqXdw4YwTXMX1YqGvsGADy6zOWVtVvaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018350; a=rsa-sha256; cv=none; b=AVLniSYgt7c8DRMc+LVvLZuASvbI8xFJ67ObiC/uZeiwdu1m4CV1RdC4RW3ikzuSQlrDNQ vPEpXVBCPryz1eM4p8ImRjAC6PBVQn/qDy7y/nKbf2S1n3g6YPXJ+8gDP+AHI97Yv6OPkS 4QSIxO3Peo9DVA2fCRRn2QGlgweyhkylNuIdKF/p4gptwEHfGx9aMSvVvutTZUICIRBJcZ Ac9+MWppZDezits7EgbIOFI6kNVthbzcWupkj4gU5EWwI5pT+pR+czFpm4VAoQzrycevGE ZlbT6dnnHWLSTt9FrkftMgvxHD6ccOoaDSw/Xk5HIAIphYXvjAEnLDrmpiMDxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RYcMZ8JJAfOqoQUem62w/VyAjda7BFW6cO1aVXIfA1g=; b=IOlcbAoutDocizrulZBTBEgKcVJCoSnKm/AnXIRlt5f9kiBSxIVyFULOnDkhFBbTOULt4C xsEmeOHMUb66aHLR6v7mTuxVg/Qrx1zdzNi27tXDgdHgKoNlBDCqthX0FBFFM0hpPDdhhB w1WclwzFnTzPfzvsKGe+jvUbNHyW/mjQJ6l1X7dcL04E3gn+4VWr8zm+PLLZia90HV7rtm 4CsPlmtFOQHH2bFJZI2yDBBjBkwxdWhfRBgyxLbbPwVADtBrPSOGfxcnthWviCKJyCTLco fymYqATX4VcYdSOCvJP3m1lVD5O6Ynj+DgPi6GLTPXLvHm6PPmRqGpBIHOHplg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63k637J1zv4f; Mon, 03 Mar 2025 16:12: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 523GCUCU007336; Mon, 3 Mar 2025 16:12:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GCUpZ007328; Mon, 3 Mar 2025 16:12:30 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:12:30 GMT Message-Id: <202503031612.523GCUpZ007328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 62c0997d4317 - main - efiprot.h: add definitions for RISCV_EFI_BOOT_PROTOCOL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62c0997d4317390685afdd35a28396f2a6f0b2a3 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=62c0997d4317390685afdd35a28396f2a6f0b2a3 commit 62c0997d4317390685afdd35a28396f2a6f0b2a3 Author: Mitchell Horne AuthorDate: 2025-03-03 15:46:56 +0000 Commit: Mitchell Horne CommitDate: 2025-03-03 16:12:15 +0000 efiprot.h: add definitions for RISCV_EFI_BOOT_PROTOCOL It seems like this file was vendored (sorta) originally, but we have not kept it in sync with the original source, if it still exists. Follow the precedent in commit acf82d2659879, and just add the definition to the bottom of the file, keeping its style conventions. Defined here: https://github.com/riscv-non-isa/riscv-uefi Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48885 --- stand/efi/include/efiprot.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/stand/efi/include/efiprot.h b/stand/efi/include/efiprot.h index be11ea83b3a2..5b8ac2309c8e 100644 --- a/stand/efi/include/efiprot.h +++ b/stand/efi/include/efiprot.h @@ -632,4 +632,31 @@ typedef struct _EFI_COMPONENT_NAME2 { CHAR8 **SupportedLanguages; } EFI_COMPONENT_NAME2; +// +// RISC-V EFI Boot Protocol +// +// https://github.com/riscv-non-isa/riscv-uefi +// + +#define RISCV_EFI_BOOT_PROTOCOL_GUID \ + { 0xccd15fec, 0x6f73, 0x4eec, {0x83, 0x95, 0x3e, 0x69, 0xe4, 0xb9, 0x40, 0xbf} } + +INTERFACE_DECL(_RISCV_EFI_BOOT_PROTOCOL); + +#define RISCV_EFI_BOOT_PROTOCOL_REVISION 0x00010000 +#define RISCV_EFI_BOOT_PROTOCOL_LATEST_VERSION \ + RISCV_EFI_BOOT_PROTOCOL_REVISION + +typedef +EFI_STATUS +(EFIAPI *EFI_GET_BOOT_HARTID) ( + IN struct _RISCV_EFI_BOOT_PROTOCOL *This, + OUT UINTN *BootHartId + ); + +typedef struct _RISCV_EFI_BOOT_PROTOCOL { + UINT64 Revision; + EFI_GET_BOOT_HARTID GetBootHartId; +} RISCV_EFI_BOOT_PROTOCOL; + #endif From nobody Mon Mar 3 16:12:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63k600Pbz5pjR6; Mon, 03 Mar 2025 16:12: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 4Z63k53W9vz40Hd; Mon, 03 Mar 2025 16:12:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IpsiCpH5DaRbUEWjZiFOtZ6zbwoYpV7oyKwNVnFCtUo=; b=e6e4NNb1RPi+zVu1mqBb2lK4k8tgUA/E8QnCMo55lgidrxDvDdtqCcqkGTLn4mDasg41cc Uz5XApwpTPlvDgEkuuWcctrpT4JLXSfYTTlqmNJV6QO4vnmoRcBeUJ5XkX0POSMGQKloll 4rrq9JnSyOjUohttDLcolF8swXMyA8w6SpGsqfdxu3Xm2wHt++MEb+XbGORX397U/G++vu l8DX/+h36Jdbu83XzJbRYBNqsmvq4B1GeZ80ofwuqNTK0NEW2fQ927GD5q/yDYfB8GQIHQ n8fN2jScxzQhV0jKrcKYcuBXp8FE8hJVKM5yNfpKtENYdsxsSEq4GsZZvu2oSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018349; a=rsa-sha256; cv=none; b=vIQrXqTmLRTThS8CXUULZ/F0s61bFxmnadXSEhDBEwsfuY4KGaY1/rwM/Wje5++yvJy07l rZxCtiecwYtDogAIu9d1KoxGZ+0BEtCUxcKV9+yPXXo6UVFKa0PIW2fSIBa3eUx47FMrjY z2t7Pl+xL7JiYLpnVmDCu+VfZ6uuJtRvMk52vPg9jZ014/Yd+SDvLp+oic+bhXmvxq2EhX lsLBzkrurlZ9a/sCOmO6lofhsFfpNlF1OeyJzaxpeRbcMLTSiAnaSV7bqXGnNG7zH2Lkx4 JtJB+NJWeajFEx3K7LL94ywtJs1DSjHjiSOKAbo9PkEsUdAe6LOZt+O1URPiew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IpsiCpH5DaRbUEWjZiFOtZ6zbwoYpV7oyKwNVnFCtUo=; b=bZXrRj2TniMzArAX107isqF3aToBPHu0hBd4czi2GDJKYDvdmjnO2MbYxadWdXR0O/jp6b 1J1khOUTLAKthAgsMEhkkiaA0k6oh4+bUfnqFonImVZvoaQqhUmzb0daO0fFLJgCaf9/+w mzFvY4GH7wPuE4uLVUus7R/A5Z9Q1x0GOV+dY9q7lKwPfdED4H/Jd7YlwXD9b1XeEEipLC 8vJDos7p7GvYYHzEfxTgTzE+RSHhJmMgu9K+YXtc3hncaoLT+xxRl/KYJ8wp8jp7He2G/l 3OltjUB2qt+kP07VBTHk1lbOUsiK4V7ZZDSG4l7t4ec6y3ZHF/lImznaClux+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 4Z63k52GGgzvZl; Mon, 03 Mar 2025 16:12: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 523GCTQW007281; Mon, 3 Mar 2025 16:12:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GCTO4007278; Mon, 3 Mar 2025 16:12:29 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:12:29 GMT Message-Id: <202503031612.523GCTO4007278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: e2a08ac9ce42 - main - riscv: enable EFI framebuffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2a08ac9ce424f543a2f03c67fb882fdabbdd32a Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e2a08ac9ce424f543a2f03c67fb882fdabbdd32a commit e2a08ac9ce424f543a2f03c67fb882fdabbdd32a Author: Mitchell Horne AuthorDate: 2025-03-03 15:46:39 +0000 Commit: Mitchell Horne CommitDate: 2025-03-03 16:12:15 +0000 riscv: enable EFI framebuffer Pass framebuffer information from loader(8) to the kernel via the MODINFOMD_EFI_FB metadata field. Enable the vt_efifb driver. A small tweak is required to work around the lack of VM_MEMATTR_WRITE_COMBINING on this platform; we use VM_MEMATTR_UNCACHEABLE instead. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48884 --- stand/efi/loader/bootinfo.c | 2 +- sys/dev/vt/hw/efifb/efifb.c | 9 +++++++-- sys/riscv/conf/GENERIC | 1 + sys/riscv/include/metadata.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 3e74a9228b5e..ca86a319613f 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -182,7 +182,7 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) struct efi_map_header *efihdr; bool do_vmap; -#if defined(__amd64__) || defined(__aarch64__) || defined(__i386__) +#ifdef MODINFOMD_EFI_FB struct efi_fb efifb; efifb.fb_addr = gfx_state.tg_fb.fb_addr; diff --git a/sys/dev/vt/hw/efifb/efifb.c b/sys/dev/vt/hw/efifb/efifb.c index eda05ec3d203..ad49b6735998 100644 --- a/sys/dev/vt/hw/efifb/efifb.c +++ b/sys/dev/vt/hw/efifb/efifb.c @@ -96,9 +96,11 @@ vt_efifb_init(struct vt_device *vd) { struct fb_info *info; struct efi_fb *efifb; - int memattr; + vm_memattr_t memattr; int roff, goff, boff; - char attr[16]; + +#ifdef VM_MEMATTR_WRITE_COMBINING + char attr[16]; /* * XXX TODO: I think there's more nuance here than we're acknowledging, @@ -122,6 +124,9 @@ vt_efifb_init(struct vt_device *vd) memattr = VM_MEMATTR_UNCACHEABLE; } } +#else + memattr = VM_MEMATTR_UNCACHEABLE; +#endif info = vd->vd_softc; if (info == NULL) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 34426f167963..8dca3bdb3369 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -140,6 +140,7 @@ device uart_ns8250 # ns8250-type UART driver # Console device vt +device vt_efifb device kbdmux # RTC diff --git a/sys/riscv/include/metadata.h b/sys/riscv/include/metadata.h index fbc0afce5c10..6ade03e15ea3 100644 --- a/sys/riscv/include/metadata.h +++ b/sys/riscv/include/metadata.h @@ -30,6 +30,7 @@ #define MODINFOMD_DTBP 0x1001 #define MODINFOMD_EFI_MAP 0x1002 +#define MODINFOMD_EFI_FB 0x1003 struct efi_map_header { size_t memory_size; From nobody Mon Mar 3 16:12:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z63k76tSfz5pjR9; Mon, 03 Mar 2025 16:12: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 4Z63k7494Rz40V8; Mon, 03 Mar 2025 16:12:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Is0vRIVR57w4u2WHBip5byzR7IqR+cnTtr4aXLgdLq8=; b=BNGFWIJ6sTwWBUNS7xbqIN4px8Rwx2FB9H5HNix5yNbkjAbm/Y/w6X+vY/g7pTrBLrDlDM P9HamfXHqaMVOx8FE0W2fqM4Fqmswd28LiJGOJAG7v41takY+3+6vLl1H/GZnmw9h/1FBb HMzB30yW17ner34r+VGtJBtsCxLc133qvFIBfI/X6BYw3R5pbzjC0nY1OdXV4p9xJL6+B1 AJL+Ao3moBkFELfyRIxpraLdhX7JOgq0rLmgx2bPSGeHzX7xt0Ex/msluEFJC7BhFHalae BiUfLUIWH/95APLsnUIjiwrXhzB3cpURdDIzEfz6l/qSnz+ZhELA24siAB+otg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741018351; a=rsa-sha256; cv=none; b=gWBJSXAUFUfYK5sPT+dMZELF/jFjNR0Z6nSnRXAa2pQlYDXcOUW6o8OJOIF3DDU1iQen2R c5xO1icyNYgn43j+z+FzxLbDrwk5zI6uvRQiiKY6rCPXI23XgMTy5AJs+TEpBLjFx54jm2 eHLnr8g+pEkUWCYi4UBwp5JLKiTUj82atE5jEWpksxNrMDKe7kZ8G5lXEdcvbAhSZe78u7 32rhsc77BVwmLkf9lJMULAP3rQc3g05BO1c5Ikq4Hbp78A+qoWD1WWldDENlNhV79Nn7zC /4s5QI2a8eYf/IwCFR+qyqOXnU3ZC2YcrsGKudAey4xu8r7ZG3J+GpeHPQGa8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741018351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Is0vRIVR57w4u2WHBip5byzR7IqR+cnTtr4aXLgdLq8=; b=YH3ct6QDkuTORoTIOCDdqR3/YlJiQoWYaCwhwB9eBqAsNyXFySd+ttwa1dfnKafujqhfnw Utxi6K9Rz30C24bnW90/G4owqrxpbHhRPFFPVyKECjTmXrg+8S4c7STcbu/Age8kk/AGV5 0nT9P+oz/BtRQ3XarbmsDlTxYPovGyMCOqr16lJalVATdr+NzmipEFyxoxG4MzxIV2K5OD YTFSxzfREiKPnk8dgoiEsMwX02WgzrrZaG0xyx0OQm9qEWzAQBvMdK7uVcZE5hQyInrSSW xeMzDPvuTsv2RJXvO8JHfAyE2hHSUKcJZ9dCyfqL/Hg8d/YIyOUkf8tUi0OUNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z63k73jLSzv4h; Mon, 03 Mar 2025 16:12: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 523GCVOA008225; Mon, 3 Mar 2025 16:12:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GCV5C008222; Mon, 3 Mar 2025 16:12:31 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:12:31 GMT Message-Id: <202503031612.523GCV5C008222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 04a812ae94e4 - main - riscv/stand: pass boot hart in loader metadata List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04a812ae94e44982ee7f86e5de8a5caccdbc8a81 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=04a812ae94e44982ee7f86e5de8a5caccdbc8a81 commit 04a812ae94e44982ee7f86e5de8a5caccdbc8a81 Author: Mitchell Horne AuthorDate: 2025-03-03 15:47:23 +0000 Commit: Mitchell Horne CommitDate: 2025-03-03 16:12:15 +0000 riscv/stand: pass boot hart in loader metadata Use the RISCV_EFI_BOOT_PROTOCOL to fetch the boot hart ID, and communicate this to the kernel via new metadata field (MODINFOMD_BOOT_HART). If the boot hart is not found this way, fall back to the (now deprecated) device-tree method. The assumption that a hart ID can be represented with a 32-bit unsigned integer is unchanged in the kernel, but from the loader we pass the full 64-bit value. This ensures that this API won't need to change in the future, should the wider value become necessary. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48887 --- stand/efi/loader/arch/riscv/exec.c | 25 ++++++++++++++++ sys/kern/subr_module.c | 10 +++++++ sys/riscv/include/metadata.h | 1 + sys/riscv/riscv/machdep.c | 61 +++++++++++++++++++++++++------------- 4 files changed, 77 insertions(+), 20 deletions(-) diff --git a/stand/efi/loader/arch/riscv/exec.c b/stand/efi/loader/arch/riscv/exec.c index 0fc28cba78c1..9da61229ef68 100644 --- a/stand/efi/loader/arch/riscv/exec.c +++ b/stand/efi/loader/arch/riscv/exec.c @@ -2,6 +2,7 @@ * Copyright (c) 2001 Benno Rice * Copyright (c) 2007 Semihalf, Rafal Jaworowski * All rights reserved. + * Copyright (c) 2024 The FreeBSD Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,6 +41,28 @@ #include "bootstrap.h" #include "loader_efi.h" +static void +riscv_set_boot_hart(struct preloaded_file *fp) +{ + EFI_GUID riscvboot = RISCV_EFI_BOOT_PROTOCOL_GUID; + RISCV_EFI_BOOT_PROTOCOL *proto; + EFI_STATUS status = 0; + uint64_t boot_hartid = ULONG_MAX; + + status = BS->LocateProtocol(&riscvboot, NULL, (void **)&proto); + if (EFI_ERROR(status)) { + return; + } + + status = proto->GetBootHartId(proto, &boot_hartid); + if (EFI_ERROR(status)) { + return; + } + + file_addmetadata(fp, MODINFOMD_BOOT_HARTID, sizeof(boot_hartid), + &boot_hartid); +} + static int __elfN(exec)(struct preloaded_file *fp) { @@ -52,6 +75,8 @@ __elfN(exec)(struct preloaded_file *fp) if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return (EFTYPE); + riscv_set_boot_hart(fp); + e = (Elf_Ehdr *)&fmp->md_data; efi_time_fini(); diff --git a/sys/kern/subr_module.c b/sys/kern/subr_module.c index 596961606577..d07990cebdc3 100644 --- a/sys/kern/subr_module.c +++ b/sys/kern/subr_module.c @@ -442,6 +442,11 @@ preload_modinfo_type(struct sbuf *sbp, int type) case MODINFOMD_SPLASH: sbuf_cat(sbp, "MODINFOMD_SPLASH"); break; +#endif +#ifdef MODINFOMD_BOOT_HARTID + case MODINFOMD_BOOT_HARTID: + sbuf_cat(sbp, "MODINFOMD_BOOT_HARTID"); + break; #endif default: sbuf_cat(sbp, "unrecognized metadata type"); @@ -503,6 +508,11 @@ preload_modinfo_value(struct sbuf *sbp, uint32_t *bptr, int type, int len) case MODINFO_METADATA | MODINFOMD_HOWTO: sbuf_printf(sbp, "0x%08x", *bptr); break; +#ifdef MODINFOMD_BOOT_HARTID + case MODINFO_METADATA | MODINFOMD_BOOT_HARTID: + sbuf_printf(sbp, "0x%lu", *(uint64_t *)bptr); + break; +#endif case MODINFO_METADATA | MODINFOMD_SHDR: case MODINFO_METADATA | MODINFOMD_ELFHDR: case MODINFO_METADATA | MODINFOMD_FW_HANDLE: diff --git a/sys/riscv/include/metadata.h b/sys/riscv/include/metadata.h index 6ade03e15ea3..ddbad3fae3b4 100644 --- a/sys/riscv/include/metadata.h +++ b/sys/riscv/include/metadata.h @@ -31,6 +31,7 @@ #define MODINFOMD_DTBP 0x1001 #define MODINFOMD_EFI_MAP 0x1002 #define MODINFOMD_EFI_FB 0x1003 +#define MODINFOMD_BOOT_HARTID 0x1004 struct efi_map_header { size_t memory_size; diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index 03f5926c3739..fea4ca9a7b92 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -419,6 +419,45 @@ fake_preload_metadata(struct riscv_bootparams *rvbp) /* Support for FDT configurations only. */ CTASSERT(FDT); +static void +parse_boot_hartid(void) +{ + uint64_t *mdp; +#ifdef FDT + phandle_t chosen; + uint32_t hart; +#endif + + mdp = (uint64_t *)preload_search_info(preload_kmdp, + MODINFO_METADATA | MODINFOMD_BOOT_HARTID); + if (mdp != NULL && *mdp < UINT32_MAX) { + boot_hart = (uint32_t)*mdp; + goto out; + } + +#ifdef FDT + /* + * Deprecated: + * + * Look for the boot hart ID. This was either passed in directly from + * the SBI firmware and handled by locore, or was stored in the device + * tree by an earlier boot stage. + */ + chosen = OF_finddevice("/chosen"); + if (OF_getencprop(chosen, "boot-hartid", &hart, sizeof(hart)) != -1) { + boot_hart = hart; + } +#endif + + /* We failed... */ + if (boot_hart == BOOT_HART_INVALID) { + panic("Boot hart ID was not properly set"); + } + +out: + PCPU_SET(hart, boot_hart); +} + #ifdef FDT static void parse_fdt_bootargs(void) @@ -462,6 +501,8 @@ parse_metadata(void) if (kern_envp == NULL) parse_fdt_bootargs(); #endif + parse_boot_hartid(); + return (lastaddr); } @@ -474,10 +515,6 @@ initriscv(struct riscv_bootparams *rvbp) int mem_regions_sz; vm_offset_t lastaddr; vm_size_t kernlen; -#ifdef FDT - phandle_t chosen; - uint32_t hart; -#endif char *env; TSRAW(&thread0, TS_ENTER, __func__, NULL); @@ -502,22 +539,6 @@ initriscv(struct riscv_bootparams *rvbp) } lastaddr = parse_metadata(); -#ifdef FDT - /* - * Look for the boot hart ID. This was either passed in directly from - * the SBI firmware and handled by locore, or was stored in the device - * tree by an earlier boot stage. - */ - chosen = OF_finddevice("/chosen"); - if (OF_getencprop(chosen, "boot-hartid", &hart, sizeof(hart)) != -1) { - boot_hart = hart; - } -#endif - if (boot_hart == BOOT_HART_INVALID) { - panic("Boot hart ID was not properly set"); - } - pcpup->pc_hart = boot_hart; - efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); if (efihdr != NULL) { From nobody Mon Mar 3 16:24:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64003zwVz5pkt2; Mon, 03 Mar 2025 16:24: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 4Z64003JPTz42jQ; Mon, 03 Mar 2025 16:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741019072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TASwFqmk8TYHOZzDzYO4CumpQ48H0NoqPoi20T1xAfg=; b=H5+qzvt9Vb+GB/7Nej09eh75EoENcZnJnHClvGfknj9HeBJH1NbZuxw1sIL+kxi7icWcWy Ad4Lzqiq+zfvSK4UzbnnLVRRy9YEfWAnVscY5PhVlLnN138xvFPC2qrZ4RcsS95AYglrzA 05PFgVjm7IqLlweX2YdjcnY9DxGJ+o3F7hsMbnqw2r4FIOt5EVqOXEUWkanM/PDJsDipdk A/wxCWtAwyOGSp2s5LeczuvC/jUqX2K+kuYMIin7JRo/C9Na+puEU/X6ilKaEfge7vMMrs jgb8N5EOgt2FkzooDBRbLUM/IDau5FfPnwwDcSouH5xYtecNUBXBpl+to+1i9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741019072; a=rsa-sha256; cv=none; b=jxafAiK+7pwZ7rKKI8FPlaA0kozJSPlV5fmbDjXkgQTRGDS5PZQVj6xYcSVGFS4gtpcYFb nhQw7GgYVWxIKk1mIoUSRI0ms7ZsZrh0XGfwdNpJ+tqkKrp3qxtlo2PMVLeGAdlHtvSmEJ s68XeriVqz0llhwt4eaL1y70XvYYMrHUt5MvgTSETpF/1OkP/LUhTFzzWJwlCCp9K3MMgB aV9dhb56MKp9IAPCZruUVdkrWF40tNn15LBBBEFQoun19cGkMuMZX4jF3mO8fMXGu6iNvM 2NxGJUNx9tnSDJMj4+xL64KZ4XYd5TsGfAE3P0aZOjnhBKyOJR/nTzKIUFz9JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741019072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TASwFqmk8TYHOZzDzYO4CumpQ48H0NoqPoi20T1xAfg=; b=ZPTxsVCJQY8yfDv1eVi/USmyKfZZOf5CFGi2XuES3mc9I98e7l8RhvkbBwm/L+4PBaIK2g 5nNi7+YmAFfTscyL5z3UUkqqylDQ0gXF3Yc1UDl3eEoiL9nAxOQJwiUNOC4uOBOqVX65jo XXiDBSTO1iPkH5VQDXLyosWHc1a8226lYgUc+uUws7EJssANF2vpd4w1D+HNBydGbzirC1 S5FAeRuCLMiPGzueJt6f8qqi0kzHtePGAWWHwG85hYTwHr0zMcbI0TAgPHGSqqtCb3iHWY 6hwvLEhIqFALEcBGgl6QkOqZcDaQwj3kmEpNpptzfUpTrWjSrnVmPsN3GUL0fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64002Zcczv9K; Mon, 03 Mar 2025 16:24: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 523GOW55027358; Mon, 3 Mar 2025 16:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GOW0I027355; Mon, 3 Mar 2025 16:24:32 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:24:32 GMT Message-Id: <202503031624.523GOW0I027355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7bcd307814d8 - stable/14 - Cirrus-CI: Bump image to (supported) 13.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7bcd307814d891567155cd8c6736e2c868e8cca2 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7bcd307814d891567155cd8c6736e2c868e8cca2 commit 7bcd307814d891567155cd8c6736e2c868e8cca2 Author: Ed Maste AuthorDate: 2025-02-21 18:07:32 +0000 Commit: Ed Maste CommitDate: 2025-03-03 16:24:21 +0000 Cirrus-CI: Bump image to (supported) 13.4 Sponsored by: The FreeBSD Foundation (cherry picked from commit 5bd7cf837c5fd30a04a45e20c1dcf18d113d98c4) --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8daaef148ca7..5ec1a583255b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-3-release-amd64 + image: freebsd-13-4-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Mon Mar 3 16:25:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z640g5tfJz5pkhC; Mon, 03 Mar 2025 16:25: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 4Z640g59Pvz43H8; Mon, 03 Mar 2025 16:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741019107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s66Q0mR8BiDnptTmd6ahKG3pcermwi29BM05QP/A84s=; b=R+X5mWACUK6Exe55rTHRcsh6vhwCaftFu/BOqlx8pCX8U0YMmSiXjtLg3RL66Rex90b9u0 OiMFYL4zM2eyvRIMP3KKEnr+07hE6evjVWpS8OmrztA00h8ou8qvb5+xwbV0JsQO1recoI /Vm5VXoICw9oBYb2wBCY3aRYPRQltFnLerOJ95sKmMR4AXUCvkXQZMh9y+FBSMLtg5gwZB hVw5VjUhhURI4bTnKuwzsqrnK/fQvr1qBTH86jsipV9F+cR8s40KWiXaY9xT2KNlLOUzdt YJaehAj6C5k5UuvExpGwwb8tfSPWQqmP7Roy5z220C8kMLjXqYbstzMTxOK6vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741019107; a=rsa-sha256; cv=none; b=JMgpg+8wMLJnhd+m7yzRkwluSjIkgD1GE8vMvw8KfgOO14j5Lc2MdG0kyiNaNI7hpAsmgJ m0fdg8+08Vzkqq4QdhXeLpwaRs5iXyPpp/S4zDgK1vDxAlRCS08Qlug4erBprpoX1/t4oK boS+zDZ4yEdw6UdT0q/gXg6L1bZ60lZuURcEwo10nNcDbFfaOOM8jcfQeD2ZlJdSpFpotX IQwoqYGIuh2vJwLoHsMmo40KZntHWd0NeJlG9OBLXucCnArSHEwe0WSWdSAAO5cguAK7e7 6JZBZJuCVh7nfPBd+G1WII9ThoMPKcWFeKfo4dUpnjhYh3ZkwVaXxkz/qrNCQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741019107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s66Q0mR8BiDnptTmd6ahKG3pcermwi29BM05QP/A84s=; b=b8f6yZ5zJ5EBQObR8QZHL/ffHEbdyfAIAlHFg9lvTInO9P610B/tX6jZF8YFIta3I9gw9C tnLiSRU6KK+toXSUxgkwz2Kpt6jeSdnQWNDJoYnOnhtcrGGyp5iHWC8e7W24M/fo16fRLj +TshvZ/agPjP3czaFVva+5F8gw5Z9OKpRO2x/XoeO03tj5V0A3HO9sDEp5HNZwIKVkjxAj 6Ho71O4QjLccbgrhOhV/5G6tjUJBzGZ5QrVY90NBB+OwKti+na/GnKgnYsegAz9pBXpIND nfUcl2b4bXPVLeZdgq0+m4qFJ5x7IymTAVFXFHr3JuJyu/YA7MHfWtAvlbUUVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z640g4cz7zvqD; Mon, 03 Mar 2025 16:25: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 523GP7pM027682; Mon, 3 Mar 2025 16:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GP770027679; Mon, 3 Mar 2025 16:25:07 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:25:07 GMT Message-Id: <202503031625.523GP770027679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 206ed99650cf - stable/13 - Cirrus-CI: Bump image to (supported) 13.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 206ed99650cf0fbdf31d0a1d710ba9cefe48ceae Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=206ed99650cf0fbdf31d0a1d710ba9cefe48ceae commit 206ed99650cf0fbdf31d0a1d710ba9cefe48ceae Author: Ed Maste AuthorDate: 2025-02-21 18:07:32 +0000 Commit: Ed Maste CommitDate: 2025-03-03 16:24:57 +0000 Cirrus-CI: Bump image to (supported) 13.4 Sponsored by: The FreeBSD Foundation (cherry picked from commit 5bd7cf837c5fd30a04a45e20c1dcf18d113d98c4) (cherry picked from commit 7bcd307814d891567155cd8c6736e2c868e8cca2) --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index bd4e7316a3d6..52266dd1674f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-3-release-amd64 + image: freebsd-13-4-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Mon Mar 3 16:52:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64br6y6Hz5pmy1; Mon, 03 Mar 2025 16:52: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 4Z64br6C1yz45TQ; Mon, 03 Mar 2025 16:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741020728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFMNBwXxgKVTGt0MIAkuI101cBW0WHdn9LrBb3rQW/w=; b=PBBvweMADCSLRTsGdl2kSCjeB6dnpAFPMHsrrwqsMtaBWpGaerhiDJn45mUwaSwIXjONGM qaql17PzZDJCpe9ML41j6RYVU88Qir0askPrfnG7LHnMDowdhB0OcaNJdMWvzE5m/Jk/C2 QUh0MhMGl39DiMq8jWHZT4gYVxe7dlu0kNETITQsKK5AefBw3puETA3fiLbzii759Sz44i 83WohQ4Q23qgKUrsXAXeQNtQvoSyrZ8uCH0oiTdbSwWmqYxhvCcFOYGq3FRHoymWkyXC1C LXPzLWKNrciMpmp8MxZbb2gbhSem8h9oMo2kCZwpIuulbrNSaBE3joUkl0CznA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741020728; a=rsa-sha256; cv=none; b=cQ9A9uT75HI3zCWD+CfoXKLjvUvP6nz/M+jTGSlL8kXjZa8VP1pVrghACTBIdjYDracLf0 jsdQ3iKWn41Z2XjLnOdht3wa4mwSEtyssZtN7LgR9l+A3WRBNPhly/F7OysUZnSvFtTpNo Gv7S0bqFFMZ3p33EHm6BcQXAUfkhXfLI5cspIkN29Ux8POMUb+oi60HZ+ZLHCJtTs+/dkK bw0NvIV+TSz+ewMjKaJbe0GBEE6U0hOKuX/06Nz9s5Su3mxwnz5JhBjwjtvZ/fvy3SYDZR sjmtNMhMqwyPwHGGvktRt7c/w5Vdt7Mi+wBShuI0j945PY6k23IppEui5EnvCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741020728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFMNBwXxgKVTGt0MIAkuI101cBW0WHdn9LrBb3rQW/w=; b=CQgMkipqOsL/MPhfw6UVM4LXPPdeq7S90g0iwhaSYDBGE+al0kMz6TDuXNGDvt0gcpCzw9 /3Nr6jPrnoevEhxxKdwMcOl7rvmu2NsfsksqSaGmWODx+QGkuifKaTwlcpkYB4pXXp/0dS 7GRNvxXVxOJ8rIJyV+WNp5++E5oTQ6LSXnE8dVsjQClltDsMH0HZUEIwIbdYPxco0PqdHI SUoLEfPRjY1q5DxEQNjOmdWz8Abtr6mC4UKyYuHeRODt+w5SGwJTtsyyu+WehhZd0t2dGu yLh5d9+6QQZxPK+GShSTwzvrr2YUMiLp0Ny60I1WscFSOOgB3kiPmfhZtU78Kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64br5nv0zwJL; Mon, 03 Mar 2025 16:52: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 523Gq8of079300; Mon, 3 Mar 2025 16:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gq8Ku079297; Mon, 3 Mar 2025 16:52:08 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:52:08 GMT Message-Id: <202503031652.523Gq8Ku079297@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: bd9709c2b336 - main - .cirrus-ci: Update the non-manual GCC build job to GCC 14 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd9709c2b33646d71d4d4b9c50b5b179c6041760 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bd9709c2b33646d71d4d4b9c50b5b179c6041760 commit bd9709c2b33646d71d4d4b9c50b5b179c6041760 Author: John Baldwin AuthorDate: 2025-03-03 16:51:47 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:51:47 +0000 .cirrus-ci: Update the non-manual GCC build job to GCC 14 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D49159 --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5ec1a583255b..2bcb1985e68e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -131,12 +131,12 @@ task: TOOLCHAIN: aarch64-gcc14 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s - - name: amd64-gcc13 World and kernel build and boot smoke test (FreeBSD repo) + - name: amd64-gcc14 World and kernel build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' && $CIRRUS_BRANCH =~ 'pull/.*' env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN: amd64-gcc13 + TOOLCHAIN: amd64-gcc14 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s timeout_in: 120m From nobody Mon Mar 3 16:52:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64bt20Fyz5pnH7; Mon, 03 Mar 2025 16:52: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 4Z64bt04czz45Lq; Mon, 03 Mar 2025 16:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741020730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=291Yl09Rdb1PihYDtLacIppWzQioYURX9qrrmu43UWw=; b=FkkgQ9LPeMKQByYUzoPvzI1tcjZ1aR+IDQ4EeYJrjtHWoql7Tmj4LA+oAbZ6nhKFbhdEn0 f2Q3jO8Yqc4jRw1HSihlQp+yblr/n2M1EbmutBVycqcMRyXuFbqTK9T+pvHBVNv1i9SAwE zKH1eXJFjYOhv1kqnpLGK2Zb7RazbjN/8HHQmNQ3kg2hogEHj5ZN64cQoflnbUOJ+8YMiE hACJbJJ8zuO7pXOZVC8O+uT7h4UkCGhNxLIXH9W+uqoYqZE2fGL7upqyZnKD6N5alaiYzW mdl/Fxh9K4pp9at0STyAX1CJdpAOl4S0ATB5FDS9TSkMpQrynIA0gEL9OVS75g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741020730; a=rsa-sha256; cv=none; b=pH25DAi47buXkmnigMiBa7KveyFa9bv4iZVGOaSxAm+BaZvgmZ+jCQJ4Y2at37IO5gIGjV WAEkupcvnb1b1AhWGg3mLyEfr3EIeRTnuLD9yILs394V59ttACRtuvSeZkfH4xujJ8hDt3 fJEIM4Z0mGyY1FHRxbkuHtcNwTq0s6BpnWx/uJ4JeS+JncOwFePfGYIbpgoBLjHTWmhnbY e98ctsMuvNqA64rwMNDhMlViuz2kyJXLV9/nLyNBAPBBv2I+sNQQBndSCt6bupAw2h+GLf d73OMyGihk8R/nEFKCPWy2DvoScTCMidLOeVrWJDEk681bqBBlr2+5MJyywIUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741020730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=291Yl09Rdb1PihYDtLacIppWzQioYURX9qrrmu43UWw=; b=sCSIKW/m3JE2BmMBbeszaOIydeihRDhnFGEptTXlbMdXQuHtlHkrHvRyqFkMmong0DJrDC P7Y+gLxePe7ptQ1JhEY59M5VGcscTW9XcJXzDQsX9nwHh7AqTrhdTFSBO86Q+ixUxsHvbe 40aDt1eU+0h+QzHNsRmtlIweO/a+nknYKzp226WLx7AQjioainj4mac9E7EoH3rHpDKkkF HIFKw2kKPJsJdH8ysLPXfihijkTR7HBu9SnwpxjdJHAiRNHWbfJhbWih9VgooE7CGrfOlg 5LnqhcE/hcDRfFRmjEWxIE6J+M9dQnOKykH1myPtHfEQkw9eFo9+cBc5AF69gQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64bs6jGxzwKl; Mon, 03 Mar 2025 16:52: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 523Gq9XS079332; Mon, 3 Mar 2025 16:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gq9m9079329; Mon, 3 Mar 2025 16:52:09 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:52:09 GMT Message-Id: <202503031652.523Gq9m9079329@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: d4c81623acce - main - universe: Update the default GCC toolchain to GCC 14 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4c81623accede21c756b97e255367bdb664d1e6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d4c81623accede21c756b97e255367bdb664d1e6 commit d4c81623accede21c756b97e255367bdb664d1e6 Author: John Baldwin AuthorDate: 2025-03-03 16:51:53 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:51:53 +0000 universe: Update the default GCC toolchain to GCC 14 Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D49160 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b094a7ff8149..4afec2a80c60 100644 --- a/Makefile +++ b/Makefile @@ -540,7 +540,7 @@ TARGET_ARCHES_${target}= ${MACHINE_ARCH_LIST_${target}} .endfor .if defined(USE_GCC_TOOLCHAINS) -_DEFAULT_GCC_VERSION= gcc12 +_DEFAULT_GCC_VERSION= gcc14 _GCC_VERSION= ${"${USE_GCC_TOOLCHAINS:Mgcc*}" != "":?${USE_GCC_TOOLCHAINS}:${_DEFAULT_GCC_VERSION}} TOOLCHAINS_amd64= amd64-${_GCC_VERSION} TOOLCHAINS_arm= armv7-${_GCC_VERSION} From nobody Mon Mar 3 16:56:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jJ090vz5pnPW; Mon, 03 Mar 2025 16:56: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 4Z64jH61BPz465P; Mon, 03 Mar 2025 16:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qQ2XtcDHAxEkIdtMPRGGFvrOE7ypUTaCytpogXZBBec=; b=Mrd/YHwOAOuug+48WfnJo2qksTyqxPf4ErP8mOI0Xw9/MuU4Z28JOePTa/8a97DTLtsWFU WnhfXWzOx8KHsd0tBRH7yKHiDnLsV67T/tMSrtGxbnhMTgY/VfRKy6vJVSxxhLnZgxeiuE Z5gd3lDNReDk0Yhjx0S7CNntNFL+d5+TENbzxfsIGs3fGlMovC6HGuk0W8Dlu6kRORLVXq YaYWKHASCq9BkgnQ9C10pY8bpyOPK4kxIDLpETW6U6ISFibLggCIxfi1jKavF9buMWtyK2 uHWS7tzv24RPDX6lAIOr57wKXTc7P1IekJDnT0yvDmHEKBwP3P7yV1ZE4Wzlcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021011; a=rsa-sha256; cv=none; b=LpdyIuUmBKkNgNmKRj04IdE60KNxf+7psgYmCHtPNZAtgKb60MmQ4/Dt5bJDuO6DPe3yBN N//lRTb1WgZ4c16fdwMkJmG+IuipXku8NUr0bDEtM5MOnSTyEvhitoa90aW2qw1GS+zvYC Pvf2OeiaZw9b0HJgv6UqrgwL0tyBcFg9vbHMreE8ouVzWc1o1VTj5VNfcUSJBy8HS+qn+k r5uQXgv91qu0hisKJuH1UfARojBYPx5oHtHlOmRnUH0gy8tRJ+6A0PhOgRHihi1g7A0e9K TSCa8bZKXEeYKcOrhNA+vlC34wc5e8EwJkMDQ2SMLDxvrDXnx0ihfUa9EhD3ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qQ2XtcDHAxEkIdtMPRGGFvrOE7ypUTaCytpogXZBBec=; b=wCJ3+jHwAld/thKIgE/IF2Tl7nnSR+n7xJmMzK7iK/hts0kuF+P13yVa2G+DBTxrcT8a9L u9u1rty7NbdRVZAImlIoRZ31mhen7HRL97m0h8h3a6mFnQM62qml/pOWIbSck0ac36v1Pz HNaZ/45dEPIL2x+aAeJNsqGcDcdcbredCnIc6jWDlqjjwImD22FF48toPg2VOOvpcWraE1 CDLFh7UAjx6FV1lQiP/g7jZyaDo+dswktYMg0oG/tIq/ODQ4zHMzfYitz05qKCxe4sGhME rWi1k1uZgVDL8Kv5ci1uL3GeQz/+d5dmFTr6Rp7xEWL/Q+DUnTIDyR5blaKfOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jH5Qs7zwJb; Mon, 03 Mar 2025 16:56: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 523GupYC083462; Mon, 3 Mar 2025 16:56:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GupGH083459; Mon, 3 Mar 2025 16:56:51 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:51 GMT Message-Id: <202503031656.523GupGH083459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8e8058b7373b - stable/14 - kqueue.2: Editorial pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e8058b7373b2af1e2113a303d34434579d5cb6e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8058b7373b2af1e2113a303d34434579d5cb6e commit 8e8058b7373b2af1e2113a303d34434579d5cb6e Author: John Baldwin AuthorDate: 2024-12-30 19:09:48 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 kqueue.2: Editorial pass - Use consistent language to describe user values unchanged by the kernel. - Replace passive language with active in a few places. - Add a history note for kqueuex() and kqueue1(). - Add an MLINK and synopsis for kqueue1(). - Various wording and markup tweaks. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D48203 (cherry picked from commit 9b1585384d53d0f9cc4585a6efd8cc95116407d7) --- lib/libc/sys/Makefile.inc | 1 + lib/libc/sys/kqueue.2 | 65 ++++++++++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 7628f121feac..f01b085f712b 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -443,6 +443,7 @@ MLINKS+=jail.2 jail_attach.2 \ jail.2 jail_set.2 MLINKS+=kldunload.2 kldunloadf.2 MLINKS+=kqueue.2 kevent.2 \ + kqueue.2 kqueue1.2 \ kqueue.2 kqueuex.2 \ kqueue.2 EV_SET.3 MLINKS+=link.2 linkat.2 diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 066ad717111a..d6e949baa24c 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -38,6 +38,8 @@ .Ft int .Fn kqueuex "u_int flags" .Ft int +.Fn kqueue1 "int flags" +.Ft int .Fo kevent .Fa "int kq" .Fa "const struct kevent *changelist" @@ -92,26 +94,35 @@ which will allow sharing of the kqueue between two processes. The .Fn kqueuex system call also creates a new kernel event queue, and additionally takes -the +a .Fa flags argument, which is a bitwise-inclusive OR of the following flags: .Bl -tag -width "KQUEUE_CLOEXEC" -.It Fa KQUEUE_CLOEXEC +.It Dv KQUEUE_CLOEXEC The returned file descriptor is automatically closed on .Xr execve 2 .El +.Pp The -.Ql fd = kqueue() -call is equivalent to -.Ql fd = kqueuex(0) . +.Fn kqueue +system call is equivalent to calling +.Fn kqueuex +with +.Fa flags +set to 0. .Pp -For compatibility with -.Nx , -the +The .Fn kqueue1 -function is provided, which accepts the -.Dv O_CLOEXEC -flag with the expected semantic. +function exists for compatibility with +.Nx . +The +.Fa flags +argument accepts zero or more of the following values: +.Bl -tag -width O_CLOEXEC +.It Dv O_CLOEXEC +The returned file descriptor is automatically closed on +.Xr execve 2 +.El .Pp The .Fn kevent @@ -211,24 +222,25 @@ Filter-specific data value. Opaque user-defined value passed through the kernel unchanged. .It Fa ext Extended data passed to and from kernel. -The +The meaning of the .Fa ext[0] and .Fa ext[1] -members use is defined by the filter. -If the filter does not use them, the members are copied unchanged. +members is defined by the filter. +If a filter does not use them, +these members are passed through the kernel unchanged. The .Fa ext[2] and .Fa ext[3] -members are always passed through the kernel as-is, -making additional context available to application. +members are always passed through the kernel unchanged, +providing additional user-defined values. .El .Pp The .Va flags field can contain the following values: -.Bl -tag -width EV_DISPATCH +.Bl -tag -width EV_KEEPUDATA .It Dv EV_ADD Adds the event to the kqueue. Re-adding an existing event @@ -270,12 +282,12 @@ to hold the .Dv EV_ERROR event, then subsequent changes will not get processed. .It Dv EV_ONESHOT -Causes the event to return only the first occurrence of the filter +Return only the first occurrence of the filter being triggered. After the user retrieves the event from the kqueue, it is deleted. .It Dv EV_CLEAR -After the event is retrieved by the user, its state is reset. +Reset the state of the event after it is retrieved by the user. This is useful for filters which report state transitions instead of the current state. Note that some filters may automatically @@ -287,18 +299,16 @@ See .Sx RETURN VALUES below. .It Dv EV_KEEPUDATA -Causes -.Fn kevent -to leave unchanged any +Preserve the .Fa udata associated with an existing event. This allows other aspects of the event to be modified without requiring the caller to know the .Fa udata -value presently associated. +value previously registered with the event. This is especially useful with .Dv NOTE_TRIGGER -or flags like +or .Dv EV_ENABLE . This flag may not be used with .Dv EV_ADD . @@ -872,6 +882,13 @@ and .Fn kevent system calls first appeared in .Fx 4.1 . +The +.Fn kqueuex +system call +and +.Fn kevent1 +function first appeared in +.Fx 14.0 . .Sh AUTHORS The .Fn kqueue From nobody Mon Mar 3 16:56:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jK28DVz5pnV1; Mon, 03 Mar 2025 16:56: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 4Z64jJ6d85z45xl; Mon, 03 Mar 2025 16:56:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33J46NGIp8M1LVwXL2GRq68DQtMsttjj7voFTXjy62U=; b=QoGjsqiHwsixnRkjYxCCLVHGydt5RZLS7l1kiq7th2Kbi4jefm7OlA5MHAD4bots8NrqqM I7xizBBzRtA8Wf+4WTNAPkdDGvY+lJYA0DglC/vo2RF4SfPjHsoA2HXsFu+oF5DSMUAgeq CM8zCCaQZZflXszKdl9GIDGO3Zmnigg19fFjBBSOhA/q1AzTqVX80XS+64A2j1zoh6w5kl wOObU0X+RRDotd02y95oXDdoG0VTpE7KgJKsv/JA0opusNwOV7fFGzLs1MeGBgrc3OMfZy zeyNPTtEfYTWBuEn230OqIfLHBD9CSSkS3ceyEJMkBEzn74y88kMbp+BsYHanw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021012; a=rsa-sha256; cv=none; b=jW+GjbCZ0M391pM3gLOhOTJWVpM4VNuxdDgYMPC1RsXG9AmhjyAuhxy3iDKLqa9l+FdTuc Qr7R8xLR+XRD29Se/CWj08XlB6xbIEJMo6UIPMsV7rtm8Wh/rtztgFSANpZE8lXB3KrNxL RCVIzvEp9j5H53zWnGTDZh8qjIHXEEWV5uR7ameFoelAqMH+fGbqRKveKUwApmElrPn637 qJKQQzDXCkecgbBoLK4p/OsMXfTNwUQgiOaXiQhwSNeeeqQJz0xzbfikJbwJNgLyu9lJgK Q+YFKBLqZM5i3P0/4UQfQPsTU+hgp2y6uxO59Mw847jkRoc2hr8WnPiCU6iM0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33J46NGIp8M1LVwXL2GRq68DQtMsttjj7voFTXjy62U=; b=NC0gQJleGph8wQqFaUctakqZ3QjEQmw0H035Lt+MeuUQ8bCHyiVZJLj7lbZlaa5sUcQZ2j /Eoe8bWM1nydlxls9Wfz2D/iSZoAgFReoFTiUHv2xT9l5Q02gL1HMZ6WGeL4I7BOza56lD UVRVt6C8YdffXv6xbqLZonVgX12EX5T6DQ5b365GRo/lphq+xV0FfHK3ywJG37OiZJPzA6 83VslsJG78RYbDcbDwGOiOS2eVdKJyXVY+T9k7nIHZ3UIhCxAPpLPCfrqBMBFRnMzc+dIk Dd69hvOr15Vv0hqcqSKIjdO2HtR0RY06UxH+bMVECF4CdP57/Zc16r00aoqMng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jJ64R9zwc7; Mon, 03 Mar 2025 16:56: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 523Guqus083503; Mon, 3 Mar 2025 16:56:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Guqxk083500; Mon, 3 Mar 2025 16:56:52 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:52 GMT Message-Id: <202503031656.523Guqxk083500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f31e3922bd84 - stable/14 - open.2: Editorial pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f31e3922bd844c9f962263dfec361c769611a524 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f31e3922bd844c9f962263dfec361c769611a524 commit f31e3922bd844c9f962263dfec361c769611a524 Author: John Baldwin AuthorDate: 2025-01-03 15:48:24 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 open.2: Editorial pass - Use a typical tagged list for the open flags instead of a literal block. This permits using markup in the flag descriptions. Also, drop the offset to avoid indenting the entire list. - Note that O_RESOLVE_BENEATH only applies to openat(2) - Use a clearer description of O_CLOEXEC (what it means, not the internal flag it sets) - Note that exactly one permission flag is required. - Split up a paragraph on various flags so that each flag gets its own paragraph. Some flags already had their own paragraph, so this is more consistent. It also makes it clearer which flag a sentence is talking about when a flag has more than one sentence. - Appease some errors from igor and man2ps - In the discussion about a returned directory descriptor opened with O_SEARCH, avoid the use of Fa fd since the descriptor in question is a return value and not an argument to open or openat. - Various and sundry markup and language tweaks Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D48253 (cherry picked from commit 826509a3c3642db6a110f8f43ae8860c40c72ad2) --- lib/libc/sys/open.2 | 184 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 123 insertions(+), 61 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 4cdceb336532..ea4bc9160da1 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 25, 2024 +.Dd January 3, 2025 .Dt OPEN 2 .Os .Sh NAME @@ -114,7 +114,8 @@ The argument to .Fn openat must be strictly relative to a file descriptor -.Fa fd . +.Fa fd ; +that is, .Fa path must not be an absolute path and must not contain ".." components which cause the path resolution to escape the directory hierarchy @@ -137,46 +138,98 @@ If the .Dv vfs.lookup_cap_dotdot_nonlocal MIB is set to zero, ".." is not allowed if found on non-local filesystem. .Pp -The flags specified are formed by +The +.Fa flags +are formed by .Em or Ns 'ing -the following values -.Pp -.Bd -literal -offset indent -compact -O_RDONLY open for reading only -O_WRONLY open for writing only -O_RDWR open for reading and writing -O_EXEC open for execute only -O_SEARCH open for search only, an alias for O_EXEC -O_NONBLOCK do not block on open -O_APPEND append on each write -O_CREAT create file if it does not exist -O_TRUNC truncate size to 0 -O_EXCL error if create and file exists -O_SHLOCK atomically obtain a shared lock -O_EXLOCK atomically obtain an exclusive lock -O_DIRECT eliminate or reduce cache effects -O_FSYNC synchronous writes (historical synonym for O_SYNC) -O_SYNC synchronous writes -O_DSYNC synchronous data writes -O_NOFOLLOW do not follow symlinks -O_NOCTTY ignored -O_TTY_INIT ignored -O_DIRECTORY error if file is not a directory -O_CLOEXEC set FD_CLOEXEC upon open -O_VERIFY verify the contents of the file -O_RESOLVE_BENEATH path resolution must not cross the fd directory -O_PATH record only the target path in the opened descriptor -O_EMPTY_PATH openat, open file referenced by fd if path is empty -.Ed +the following values: +.Pp +.Bl -tag -width O_RESOLVE_BENEATH +.It Dv O_RDONLY +open for reading only +.It Dv O_WRONLY +open for writing only +.It Dv O_RDWR +open for reading and writing +.It Dv O_EXEC +open for execute only +.It Dv O_SEARCH +open for search only +(an alias for +.Dv O_EXEC +typically used with +.Dv O_DIRECTORY ) +.It Dv O_NONBLOCK +do not block on open +.It Dv O_APPEND +set file pointer to the end of the file before each write +.It Dv O_CREAT +create file if it does not exist +.It Dv O_TRUNC +truncate size to 0 +.It Dv O_EXCL +fail if +.Dv O_CREAT +is set and the file exists +.It Dv O_SHLOCK +atomically obtain a shared lock +.It Dv O_EXLOCK +atomically obtain an exclusive lock +.It Dv O_DIRECT +read and write directly from the backing store +.It Dv O_FSYNC +synchronous data and metadata writes +.Pq historical synonym for Dv O_SYNC +.It Dv O_SYNC +synchronous data and metadata writes +.It Dv O_DSYNC +synchronous data writes +.It Dv O_NOFOLLOW +do not follow symlinks +.It Dv O_NOCTTY +ignored +.It Dv O_TTY_INIT +ignored +.It Dv O_DIRECTORY +error if file is not a directory +.It Dv O_CLOEXEC +automatically close file on +.Xr execve 2 +.It Dv O_VERIFY +verify the contents of the file with +.Xr mac_veriexec 4 +.It Dv O_RESOLVE_BENEATH +.Pq Xr openat 2 only +path resolution must not cross the +.Fa fd +directory +.It Dv O_PATH +record only the target path in the opened descriptor +.It Dv O_EMPTY_PATH +.Pq Xr openat 2 only +open file referenced by +.Fa fd +if path is empty +.El +.Pp +Exactly one of the flags +.Dv O_RDONLY , +.Dv O_WRONLY , +.Dv O_RDWR , +or +.Dv O_EXEC +must be provided. .Pp Opening a file with .Dv O_APPEND -set causes each write on the file -to be appended to the end. +set causes each write on the resulting file descriptor +to be appended to the end of the file. +.Pp If .Dv O_TRUNC is specified and the file exists, the file is truncated to zero length. +.Pp If .Dv O_EXCL is set with @@ -184,7 +237,8 @@ is set with and the file already exists, .Fn open -returns an error. +fails with +.Er EEXIST . This may be used to implement a simple exclusive access locking mechanism. If @@ -194,12 +248,13 @@ a symbolic link, .Fn open will fail even if the symbolic link points to a non-existent name. -If the +.Pp +If .Dv O_NONBLOCK -flag is specified and the +is specified and the .Fn open -system call would result -in the process being blocked for some reason (e.g., waiting for +system call would +block for some reason (for example, waiting for carrier on a dialup line), .Fn open returns immediately. @@ -245,6 +300,8 @@ The system will attempt to avoid caching the data you read or write. If it cannot avoid caching the data, it will minimize the impact the data has on the cache. Use of this flag can drastically reduce performance if not used with care. +The semantics of this flag are filesystem dependent, +and some filesystems may ignore it entirely. .Pp .Dv O_NOCTTY may be used to ensure the OS does not assign this file as the @@ -302,16 +359,14 @@ reside in the directory hierarchy beneath the starting directory. Absolute paths or even the temporal escape from beneath of the starting directory is not allowed. .Pp -When -.Fa fd +When a directory is opened with .Dv O_SEARCH , execute permissions are checked at open time. -The -.Fa fd +The returned file descriptor may not be used for any read operations like .Xr getdirentries 2 . -The primary use for this descriptor will be as the lookup descriptor for the +The primary use of this descriptor is as the lookup descriptor for the .Fn *at family of functions. If @@ -319,7 +374,9 @@ If was not requested at open time, then the .Fn *at functions use the current directory permissions for the directory referenced -by the descriptor at the time of the call. +by the descriptor at the time of the +.Fn *at +call. .Pp .Dv O_PATH returns a file descriptor that can be used as a directory file descriptor for @@ -328,9 +385,9 @@ and other system calls taking a file descriptor argument, like .Xr fstatat 2 and others. The other functionality of the returned file descriptor is limited to -the descriptor-level operations. -It can be used for -.Bl -tag -width readlinkat(2) -offset indent -compact +the following descriptor-level operations: +.Pp +.Bl -tag -width __acl_aclcheck_fd -offset indent -compact .It Xr fcntl 2 but advisory locking is not allowed .It Xr dup 2 @@ -344,12 +401,14 @@ socket using a .Dv SCM_RIGHTS message .It Xr kqueue 2 -using for +only with .Dv EVFILT_VNODE .It Xr readlinkat 2 -.It Xr __acl_get_fd 2 , Xr __acl_aclcheck_fd 2 +.It Xr __acl_get_fd 2 +.It Xr __acl_aclcheck_fd 2 .El -But operations like +.Pp +Other operations like .Xr read 2 , .Xr ftruncate 2 , and any other that operate on file and not on file descriptor (except @@ -358,18 +417,19 @@ are not allowed. .Pp A file descriptor created with the .Dv O_PATH -flag can be opened into normal (operable) file descriptor by +flag can be opened as a normal (operable) file descriptor by specifying it as the .Fa fd argument to .Fn openat -with empty +with an empty .Fa path -and flag -.Dv O_EMPTY_PATH . +and the +.Dv O_EMPTY_PATH +flag. Such an open behaves as if the current path of the file referenced by .Fa fd -is passed, except that the path walk permissions are not checked. +is passed, except that path walk permissions are not checked. See also the description of .Dv AT_EMPTY_PATH flag for @@ -380,6 +440,8 @@ If successful, .Fn open returns a non-negative integer, termed a file descriptor. It returns \-1 on failure. +The file descriptor value returned is the lowest numbered descriptor +currently not in use by the process. The file pointer used to mark the current position within the file is set to the beginning of the file. .Pp @@ -394,7 +456,7 @@ A sleeping open of a fifo (see .Xr mkfifo 2 ) is restarted as normal. .Pp -When a new file is created it is given the group of the directory +When a new file is created, it is assigned the group of the directory which contains it. .Pp Unless @@ -405,9 +467,9 @@ the new descriptor is set to remain open across system calls; see .Xr close 2 , .Xr fcntl 2 -and +and the description of the .Dv O_CLOEXEC -description. +flag. .Pp The system imposes a limit on the number of file descriptors open simultaneously by one process. @@ -511,7 +573,7 @@ or is specified but the underlying file system does not support locking. .It Bq Er EOPNOTSUPP The named file is a special file mounted through a file system that -does not support access to it (e.g.\& NFS). +does not support access to it (for example, NFS). .It Bq Er EWOULDBLOCK .Dv O_NONBLOCK and one of @@ -688,7 +750,7 @@ system call is believed to be compatible with .\" .St -p1003.1-2017 , .\" XXX: This should be replaced in the future when an appropriate argument to .\" the St macro is available: -p1003.1-2017 -.No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) , +.No IEEE Std 1003.1-2008, 2017 Edition ("POSIX.1") , which specifies that behavior for .Dv O_SEARCH , in the absence of the flag the implementation checks the current From nobody Mon Mar 3 16:56:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jL249Pz5pn7d; Mon, 03 Mar 2025 16:56: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 4Z64jL0dtSz46B4; Mon, 03 Mar 2025 16:56:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghxyJL+O+7LTOO+dXvb6evIBVu2Hzo9N2CVeXNN10aU=; b=c+CTW02N/Tv8JAqxJm8sCqloWTC6Q6iEr9sDKR6Idd51SYIQNydF/zzG/KZ2h25hK8Kwt9 JCOxvMMqlznCWVpeP6MUiv+tr7vxcaGLEz5n6QOCaoTEYdb5geyp6e4rsWzi0gvWpUEdmr JVEJRseBov9Q4gv0/P/FqfU9sgkHUdmiIvwT1A7P6eFQ+N5oq8gJhm4J/6vNn0WKVa64bl tq1M05IHAeFxfc8tUGrK0W3DAyRD3GBKn1E8wrTjhlRsBS+qMQXO586qMKgFNVqqBjImsb PHjFJySR5QTWqZ5lMFHC0kO4U+m965r/ouybmafB0Hae8hecOFfiLoNsqqKpPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021014; a=rsa-sha256; cv=none; b=ymZKVLd5NFToWVw0CvD9B83Mq59Y4wtLmUEKIuiDf/RDNcud/lM9CyNAViBFVm1FfYY7DY cZYPEAbLUUPygE78tik+7gzOckRaGJ6K51WUD9RZwoAkDaaFtBBJCGoQcqM204o6VT5vDi 4sCC0RTpbgtCjmx5rEboPgR7F4jWDy4BA38o5ao1pETKjv0S+1HNQZ1BVqs9cUiJEbS+4H vDMNETqhCbU6zYx+EsTCKKw6a4nCOMyKqNnu9MWEZNT3dc6BoJLxHcLIkKpQLEll55hYzy 78G0Y+BtpW0NlQLBKE8+N67jxPujyQl5TEcC0GjnZvhYFK28/qsLi0hvVxer1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghxyJL+O+7LTOO+dXvb6evIBVu2Hzo9N2CVeXNN10aU=; b=uOx1K1cfPQ8keFEHqND7+rY24xF85COEiF0YDWxG2ljr/HS4KTxfQuLnL+O5IcwUPvtVqs YEtPfMOqFSI9pDAq5BnezNT3Gc7Zq34Yu+pm0uzmIFh4XM7+wAC8tdvf6umbih4IIUm0o6 L9hDzdAQuNl+OIVfxNDBJTnowdAAJpYMBiuRu60z2dDulQlc3cYs1wzLlt9eOnj14CKkwI HCZKWURVT5u5Tgbsk/6ptOEyP2Q6AexdrXAZZ6VpvZ+i8Vn2KdzmklaGeauTOktMFaacmp n87OcIkIoOyn9LubDznM3eRU7w6Jwhxd1GIucWo0eIqEH60uRDB4MHGSgimJKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jL00CTzwZZ; Mon, 03 Mar 2025 16:56: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 523Gur4M083544; Mon, 3 Mar 2025 16:56:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GurPS083539; Mon, 3 Mar 2025 16:56:53 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:53 GMT Message-Id: <202503031656.523GurPS083539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6ed9a9237d63 - stable/14 - nv.9: Editorial pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ed9a9237d631a44f7e3e7b360ed353579f2a7b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6ed9a9237d631a44f7e3e7b360ed353579f2a7b4 commit 6ed9a9237d631a44f7e3e7b360ed353579f2a7b4 Author: John Baldwin AuthorDate: 2025-01-03 15:51:28 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 nv.9: Editorial pass Various rewording tweaks and clarifications to some behavior (e.g. nvlist_size doesn't require calling nvlist_pack first). Reviewed by: pjd Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48256 (cherry picked from commit ae1cc4182b3fa6abe4de85ab201a198917dda73a) --- share/man/man9/cnv.9 | 36 ++-- share/man/man9/dnv.9 | 26 +-- share/man/man9/nv.9 | 482 +++++++++++++++++++++++++++++++-------------------- 3 files changed, 330 insertions(+), 214 deletions(-) diff --git a/share/man/man9/cnv.9 b/share/man/man9/cnv.9 index de37c8271eb9..fa5310e174e1 100644 --- a/share/man/man9/cnv.9 +++ b/share/man/man9/cnv.9 @@ -23,14 +23,14 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 18, 2018 +.Dd January 3, 2025 .Dt CNV 9 .Os .Sh NAME .Nm cnvlist_get , .Nm cnvlist_take , .Nm cnvlist_free -.Nd "API for managing name/value pairs by cookie." +.Nd "API for managing name/value pairs by cookie" .Sh LIBRARY .Lb libnv .Sh SYNOPSIS @@ -115,7 +115,7 @@ The .Nm libnv library permits easy management of name/value pairs and can send and receive them over sockets. -For more information, also see +For more information, see .Xr nv 9 . .Pp The concept of cookies is explained in @@ -128,25 +128,28 @@ from .Pp The .Fn cnvlist_name -function returns the name of an element associated with the given cookie. +function returns the name of an element associated with +.Fa cookie . .Pp The .Fn cnvlist_type -function returns the type of an element associated with the given cookie. +function returns the type of an element associated with +.Fa cookie . Types which can be returned are described in .Xr nv 9 . .Pp The .Nm cnvlist_get -family of functions obtains the value associated with the given cookie. +functions return the value associated with +.Fa cookie . Returned strings, nvlists, descriptors, binaries, or arrays must not be modified -by the user, since they still belong to the nvlist. +by the user since they still belong to the nvlist. The nvlist must not be in an error state. .Pp The .Nm cnvlist_take -family of functions returns the value associated with the given cookie and -removes the element from the nvlist. +functions return the value associated with the given cookie and +remove the element from the nvlist. When the value is a string, binary, or array value, the caller is responsible for freeing the returned memory with .Fn free 3 . @@ -154,18 +157,21 @@ When the value is an nvlist, the caller is responsible for destroying the returned nvlist with .Fn nvlist_destroy . When the value is a descriptor, the caller is responsible for closing the -returned descriptor with the +returned descriptor with .Fn close 2 . .Pp The .Nm cnvlist_free -family of functions removes an element of the supplied cookie and frees all -resources. -If an element of the given cookie has the wrong type or does not exist, the +functions remove the element identified by +.Fa cookie +and free any associated resources. +If the element identified by +.Fa cookie +has the wrong type or does not exist, the program -is aborted. +aborts. .Sh EXAMPLES -The following example demonstrates how to deal with cnvlist API. +The following example demonstrates how to deal with the cnvlist API. .Bd -literal int type; void *cookie, *scookie, *bcookie; diff --git a/share/man/man9/dnv.9 b/share/man/man9/dnv.9 index 8c89d6599801..16f603df8392 100644 --- a/share/man/man9/dnv.9 +++ b/share/man/man9/dnv.9 @@ -23,13 +23,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 26, 2016 +.Dd January 3, 2025 .Dt DNV 9 .Os .Sh NAME .Nm dnvlist_get , .Nm dnvlist_take -.Nd "API for getting name/value pairs. Nonexistent pairs do not raise an error." +.Nd "API for getting name/value pairs with a default value" .Sh LIBRARY .Lb libnv .Sh SYNOPSIS @@ -63,26 +63,32 @@ The .Nm libnv library permits easy management of name/value pairs and can send and receive them over sockets. -For more information, also see +For more information, see .Xr nv 9 . .Pp The .Nm dnvlist_get -family of functions returns the value associated with the specified name. -If an element of the specified name does not exist, the function returns the +functions return the value associated with +.Fa name . +If an element named +.Fa name +does not exist, the function returns the value provided in .Fa defval . Returned strings, nvlists, descriptors, binaries, or arrays must not be modified -by the user. -They still belong to the nvlist. +by the user since they still belong to the nvlist. If the nvlist is in an error state, attempts to use any of these functions will cause the program to abort. .Pp The .Nm dnvlist_take -family of functions returns the value associated with the specified name and -removes the element from the nvlist. -If an element of the supplied name does not exist, the value provided in +functions return the value associated with +.Fa name +and removes the associated element from +.Fa nvl . +If an element named +.Fa name +does not exist, the value provided in .Nm defval is returned. When the value is a string, binary, or array value, the caller is diff --git a/share/man/man9/nv.9 b/share/man/man9/nv.9 index 67c05247fdfb..4e4542c146ef 100644 --- a/share/man/man9/nv.9 +++ b/share/man/man9/nv.9 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 2, 2023 +.Dd January 3, 2025 .Dt NV 9 .Os .Sh NAME @@ -280,11 +280,12 @@ .Sh DESCRIPTION The .Nm libnv -library allows to easily manage name value pairs as well as send and receive +library permits creating and managing name value pairs as well as +sending and receiving them over sockets. A group (list) of name value pairs is called an .Nm nvlist . -The API supports the following data types: +The API supports the following data types for values: .Bl -ohang -offset indent .It Sy null ( NV_TYPE_NULL ) There is no data associated with the name. @@ -330,7 +331,7 @@ The .Fn nvlist_create function allocates memory and initializes an nvlist. .Pp -The following flag can be provided: +The following flags can be provided: .Pp .Bl -tag -width "NV_FLAG_IGNORE_CASE" -compact -offset indent .It Dv NV_FLAG_IGNORE_CASE @@ -342,28 +343,36 @@ Names in the nvlist do not have to be unique. The .Fn nvlist_destroy function destroys the given nvlist. -Function does nothing if -.Dv NULL -nvlist is provided. -Function never modifies the -.Va errno -global variable. +This function does nothing if +.Fa nvl +is +.Dv NULL . +This function never modifies +.Va errno . .Pp The .Fn nvlist_error -function returns any error value that the nvlist accumulated. -If the given nvlist is -.Dv NULL -the +function returns the first error set on +.Fa nvl . +If +.Fa nvl +is not in the error state, +this function returns zero. +If +.Fa nvl +is +.Dv NULL , .Er ENOMEM -error will be returned. +is returned. .Pp The .Fn nvlist_set_error -function sets an nvlist to be in the error state. +function sets an the error value for +.Fa nvl . Subsequent calls to .Fn nvlist_error -will return the given error value. +will return +.Fa error . This function cannot be used to clear the error state from an nvlist. This function does nothing if the nvlist is already in the error state. .Pp @@ -371,16 +380,24 @@ The .Fn nvlist_empty function returns .Dv true -if the given nvlist is empty and +if +.Fa nvl +is empty and .Dv false otherwise. -The nvlist must not be in error state. +The nvlist must not be in the error state. .Pp The .Fn nvlist_flags -function returns flags used to create the nvlist with the -.Fn nvlist_create -function. +function returns the flags used to create +.Fa nvl +with the +.Fn nvlist_create , +.Fn nvlist_recv , +.Fn nvlist_unpack , +or +.Fn nvlist_xfer +functions. .Pp The .Fn nvlist_in_array @@ -392,7 +409,8 @@ is part of an array that is a member of another nvlist. .Pp The .Fn nvlist_clone -functions clones the given nvlist. +function clones +.Fa nvl . The clone shares no resources with its origin. This also means that all file descriptors that are part of the nvlist will be duplicated with the @@ -401,154 +419,170 @@ system call before placing them in the clone. .Pp The .Fn nvlist_dump -dumps nvlist content for debugging purposes to the given file descriptor +function dumps nvlist content for debugging purposes to the file descriptor .Fa fd . .Pp The .Fn nvlist_fdump -dumps nvlist content for debugging purposes to the given file stream +dumps nvlist content for debugging purposes to the file stream .Fa fp . .Pp The .Fn nvlist_size -function returns the size of the given nvlist after converting it to binary -buffer with the +function returns the size of the binary buffer that would be generated by the .Fn nvlist_pack function. .Pp The .Fn nvlist_pack function converts the given nvlist to a binary buffer. -The function allocates memory for the buffer, which should be freed with the +The function allocates memory for the buffer which should be freed with the .Xr free 3 function. If the .Fa sizep argument is not .Dv NULL , -the size of the buffer will be stored there. -The function returns +the size of the buffer is stored there. +This function returns .Dv NULL in case of an error (allocation failure). If the nvlist contains any file descriptors .Dv NULL will be returned. -The nvlist must not be in error state. +The nvlist must not be in the error state. .Pp The .Fn nvlist_unpack -function converts the given buffer to the nvlist. +function converts a binary buffer to a new nvlist. The .Fa flags -argument defines what type of the top level nvlist is expected to be. -Flags are set up using the -.Fn nvlist_create -function. -If the nvlist flags do not match the flags passed to -.Fn nvlist_unpack , -the nvlist will not be returned. -Every nested nvlist list should be checked using -.Fn nvlist_flags -function. -The function returns +argument has the same meaning as the +.Fa flags +argument passed to +.Fn nvlist_create . +If +.Fa flags +do not match the flags used to create the initial nvlist before it was packed, +this function will fail. +The flags of nested nvlists are not validated by this function. +The caller is responsible for validating the flags on any nested nvlists using +.Fn nvlist_flags . +This function returns the new nvlist on success or .Dv NULL in case of an error. .Pp The .Fn nvlist_send -function sends the given nvlist over the socket given by the -.Fa sock -argument. -Note that nvlist that contains file descriptors can only be send over +function sends +.Fa nvl +over the socket +.Fa sock . +Note that nvlists that contain file descriptors can only be sent over .Xr unix 4 domain sockets. .Pp The .Fn nvlist_recv -function receives nvlist over the socket given by the -.Fa sock -argument. -The +function receives an nvlist over the socket +.Fa sock . +As with +.Fn nvlist_unpack , +the .Fa flags -argument defines what type of the top level nvlist is expected to be. -Flags are set up using the -.Fn nvlist_create -function. -If the nvlist flags do not match the flags passed to -.Fn nvlist_recv , -the nvlist will not be returned. -Every nested nvlist list should be checked using -.Fn nvlist_flags -function. +argument is used to construct the new nvlist and must match the flags used +to construct the original nvlist written to +.Fa sock +by the peer. +The flags of nested nvlists are not validated by this function. +The caller is responsible for validating the flags on any nested nvlists using +.Fn nvlist_flags . +This function returns the new nvlist on success or +.Dv NULL +in case of an error. .Pp The .Fn nvlist_xfer -function sends the given nvlist over the socket given by the +function sends +.Fa nvl +over the socket .Fa sock -argument and receives nvlist over the same socket. +argument and then receives a new nvlist over the same socket. The .Fa flags -argument defines what type of the top level nvlist is expected to be. -Flags are set up using the -.Fn nvlist_create -function. -If the nvlist flags do not match the flags passed to -.Fn nvlist_xfer , -the nvlist will not be returned. -Every nested nvlist list should be checked using -.Fn nvlist_flags -function. -The given nvlist is always destroyed. +argument applies to the new nvlist similar to +.Fn nvlist_recv . +The nvlist +.Fa nvl +is always destroyed. +This function returns the new nvlist on success or +.Dv NULL +in case of an error. .Pp The .Fn nvlist_next -function iterates over the given nvlist returning names and types of subsequent +function iterates over +.Fa nvl +returning the names and types of subsequent elements. The .Fa cookiep -argument allows the function to figure out which element should be returned -next. -The +argument determines which element is returned. +If .Va *cookiep -should be set to -.Dv NULL -for the first call and should not be changed later. -Returning +is +.Dv NULL , +the values for the first element in the list are returned. +Otherwise, +.Va *cookiep +should contain the result of a prior call to +.Fn nvlist_next +in which case values for the next element from +.Fa nvl +are returned. +This function returns .Dv NULL -means there are no more elements on the nvlist. +when there are no more elements on +.Fa nvl . The .Fa typep -argument can be NULL. -Elements may not be removed from the nvlist while traversing it. -The nvlist must not be in error state. -Note that -.Fn nvlist_next -will handle -.Va cookiep -being set to +argument can be .Dv NULL . -In this case first element is returned or -.Dv NULL -if nvlist is empty. -This behavior simplifies removing the first element from the list. +Elements may not be removed from +.Fa nvl +the nvlist while traversing it. +.Fa nvl +must not be in the error state. +Additional actions can be performed on an element identified by a cookie +via the +.Xr cnv 9 +API . .Pp The .Fn nvlist_exists function returns .Dv true -if element of the given name exists (besides of its type) or +if an element named +.Fa name +exists in +.Fa nvl +(regardless of type) or .Dv false otherwise. -The nvlist must not be in error state. +The nvlist must not be in the error state. .Pp The .Fn nvlist_exists_type function returns .Dv true -if element of the given name and the given type exists or +if an element named +.Fa name +of type +.Fa type +exists or .Dv false otherwise. -The nvlist must not be in error state. +The nvlist must not be in the error state. .Pp The .Fn nvlist_exists_null , @@ -565,11 +599,13 @@ The .Fn nvlist_exists_descriptor_array functions return .Dv true -if element of the given name and the given type determined by the function name +if element named +.Fa name +with the type determined by the function name exists or .Dv false otherwise. -The nvlist must not be in error state. +The nvlist must not be in the error state. .Pp The .Fn nvlist_add_null , @@ -586,18 +622,23 @@ The .Fn nvlist_add_string_array , .Fn nvlist_add_nvlist_array , .Fn nvlist_add_descriptor_array -functions add element to the given nvlist. -When adding string or binary buffer the functions will allocate memory -and copy the data over. -When adding nvlist, the nvlist will be cloned and clone will be added. -When adding descriptor, the descriptor will be duplicated using the +functions add an element to +.Fa nvl . +When adding a string or binary buffer, these functions allocate memory +and copy the data. +When adding an nvlist, the +.Fa value +nvlist is cloned and the clone is added to +.Fa nvl . +When adding a file descriptor, the descriptor is duplicated via the .Xr dup 2 -system call and the new descriptor will be added. -The array functions will fail if there are any +system call and the new file descriptor is added. +The array functions fail if there are any .Dv NULL elements in the array, or if the array pointer is .Dv NULL . -If an error occurs while adding new element, internal error is set which can be +If an error occurs while adding a new element, +an internal error is set which can be examined using the .Fn nvlist_error function. @@ -612,17 +653,27 @@ The .Fn nvlist_move_string_array , .Fn nvlist_move_nvlist_array , .Fn nvlist_move_descriptor_array -functions add new element to the given nvlist, but unlike +functions add an element to +.Fa nvl , +but unlike the .Fn nvlist_add_ -functions they will consume the given resource. -In the case of strings, descriptors, or nvlists every elements must be -unique, or it could cause a double free. -The array functions will fail if there are any +functions they consume the given resource. +For string, file descriptor, binary buffer, or nvlist values, +no value should be moved into an nvlist multiple times; +doing so will cause that value to be freed multiple times. +Note that strings or binary buffers must be allocated with +.Xr malloc 3 , +and the pointers will be released via +.Xr free 3 +when +.Fa nvl +is destroyed. +The array functions fail if there are any .Dv NULL elements, or if the array pointer is .Dv NULL . If an error occurs while adding new element, the resource is destroyed and -internal error is set which can be examined using the +an internal error is set which can be examined using the .Fn nvlist_error function. .Pp @@ -638,37 +689,61 @@ The .Fn nvlist_get_string_array , .Fn nvlist_get_nvlist_array , .Fn nvlist_get_descriptor_array -functions return the value that corresponds to the given key name. -In the case of strings, nvlists, descriptors, binary, or arrays, the returned -resource should not be modified - they still belong to the nvlist. -If an element of the given name does not exist, the program will be aborted. -To avoid this, the caller should check for the existence of the name before -trying to obtain the value, or use the -.Xr dnvlist 3 -extension, which can provide a default value in the case of a missing element. -The nvlist must not be in error state. +functions return the value of the first element in +.Fa nvl +named +.Fa name . +For string, nvlist, file descriptor, binary buffer, or array values, +the returned resource must not be modified - it still belongs to +.Fa nvl . +.Pp +If an element named +.Fa name +does not exist, the program aborts. +To avoid this, the caller should check for the existence of the element before +trying to obtain the value or use the +.Xr dnv 9 +extension which provides a default value in the case of a missing element. +.Pp +The nvlist must not be in the error state. .Pp The .Fn nvlist_get_parent -function returns the parent nvlist of the nested nvlist. +function returns the parent nvlist of +.Fa nvl . .Pp The .Fn nvlist_get_array_next -function returns the next element from the array or -.Dv NULL -if the nvlist is not in array or it is the last element. -Note that -.Fn nvlist_get_array_next -only works if you added the nvlist array using the -.Fn nvlist_move_nvlist_array +function returns the next element after +.Fa nvl +from an array of nvlists. +If +.Fa nvl +is not in an array of nvlists or it is the last element, +this function returns +.Dv NULL . +An nvlist is only in an nvlist array if it was added to an nvlist array using +.Fn nvlist_add_nvlist_array , +.Fn nvlist_append_nvlist_array , or -.Fn nvlist_add_nvlist_array -functions. +.Fn nvlist_move_nvlist_array . .Pp The .Fn nvlist_get_pararr -function returns the next element in the array, or if not available -the parent of the nested nvlist. +function returns the next element after +.Fn nvl +from an array of nvlists. +If +.Fn nvl +is the last element in an array of nvlists, +the parent nvlist of +.Fa nvl is +returned. +If +.Fn nvl +is not in an array of nvlists, +.Dv NULL +is returned. .Pp The .Fn nvlist_take_bool , @@ -682,42 +757,38 @@ The .Fn nvlist_take_string_array , .Fn nvlist_take_nvlist_array , .Fn nvlist_take_descriptor_array -functions return value associated with the given name and remove the element -from the nvlist. -In case of string and binary values, the caller is responsible for free returned -memory using the +functions return the value of the element named +.Fa name +and remove the element from +.Fa nvl . +For string and binary buffer values, the caller is responsible for freeing +the returned value using the .Xr free 3 function. -In case of nvlist, the caller is responsible for destroying returned nvlist +For nvlist values, the caller is responsible for destroying the returned nvlist using the .Fn nvlist_destroy function. -In case of descriptor, the caller is responsible for closing returned descriptor +For file descriptor values, the caller is responsible for closing the +returned descriptor using the .Fn close 2 system call. -If an element of the given name does not exist, the program will be aborted. -To avoid that the caller should check for the existence of the given name -before trying to obtain the value, or use the -.Xr dnvlist 3 -extension, which can provide a default value in the case of a missing element. -In the case of an array of strings or binary values, the caller is responsible -for freeing every element of the array using the -.Xr free 3 -function. -In the case of an array of nvlists, the caller is responsible for destroying -every element of array using the -.Fn nvlist_destroy -function. -In the case of descriptors, the caller is responsible for closing every -element of array using the -.Fn close 2 -system call. -In every case involving an array, the caller must also free the pointer to -the array using the +For array values, the caller is responsible for destroying every element of +the array based on the element type. +In addition, the caller must also free the pointer to the array using the .Xr free 3 function. -The nvlist must not be in error state. +.Pp +If an element named +.Fa name +does not exist, the program aborts. +To avoid this, the caller should check for the existence of the element before +trying to obtain the value or use the +.Xr dnv 9 +extension which provides a default value in the case of a missing element. +.Pp +The nvlist must not be in the error state. .Pp The .Fn nvlist_append_bool_array , @@ -725,28 +796,46 @@ The .Fn nvlist_append_string_array , .Fn nvlist_append_nvlist_array , .Fn nvlist_append_descriptor_array -functions append an element to the existing array using the same semantics -as the add functions (i.e. the element will be copied when applicable). -If the array for a given key does not exist, then it will be created +functions append an element to an existing array using the same semantics +as the add functions (that is, the element will be copied when applicable). +If the array named +.Fa name +does not exist, then it will be created as if using the .Fn nvlist_add__array function. -The internal error is set on append failure. +If an error occurs while appending a new element, +an internal error is set on +.Fa nvl . .Pp The .Fn nvlist_free -function removes element of the given name from the nvlist (besides of its type) +function removes the first element named +.Fa name +from +.Fa nvl +(regardless of type) and frees all resources associated with it. -If element of the given name does not exist, the program will be aborted. -The nvlist must not be in error state. +If no element named +.Fa name +exists, the program aborts. +The nvlist must not be in the error state. .Pp The .Fn nvlist_free_type -function removes element of the given name and the given type from the nvlist +function removes the first element named +.Fa name +of type +.Fa type +from +.Fa nvl and frees all resources associated with it. -If element of the given name and the given type does not exist, the program -will be aborted. -The nvlist must not be in error state. +If no element named +.Fa name +of type +.Fa type +exists, the program aborts. +The nvlist must not be in the error state. .Pp The .Fn nvlist_free_null , @@ -761,20 +850,31 @@ The .Fn nvlist_free_string_array , .Fn nvlist_free_nvlist_array , .Fn nvlist_free_descriptor_array -functions remove element of the given name and the given type determined by the -function name from the nvlist and free all resources associated with it. -If element of the given name and the given type does not exist, the program -will be aborted. -The nvlist must not be in error state. +functions remove the first element named +.Fa name +with the type determined by the function name from +.Fa nvl +free all resources associated with it. +If no element named +.Fa name +with the appropriate type exists, the program aborts. +The nvlist must not be in the error state. .Sh NOTES The .Fn nvlist_pack and .Fn nvlist_unpack -functions handle the byte-order conversions, so the binary buffer can be -packed/unpacked by the hosts with the different endianness. +functions handle byte-order conversions, so binary buffers can be +packed and unpacked on hosts with different endianness. +.Pp +The +.Fn nvlist_recv , +.Fn nvlist_send , +and +.Fn nvlist_xfer +functions can transfer nvlists between hosts with different endianness. .Sh EXAMPLES -The following example demonstrates how to prepare an nvlist and send it over +The following example demonstrates how to prepare an nvlist and send it over a .Xr unix 4 domain socket. .Bd -literal @@ -786,16 +886,18 @@ if (fd < 0) err(1, "open(\\"/tmp/foo\\") failed"); nvl = nvlist_create(0); + /* - * There is no need to check if nvlist_create() succeeded, + * There is no need to check if nvlist_create() succeeded * as the nvlist_add_() functions can cope. * If it failed, nvlist_send() will fail. */ nvlist_add_string(nvl, "filename", "/tmp/foo"); nvlist_add_number(nvl, "flags", O_RDONLY); + /* * We just want to send the descriptor, so we can give it - * for the nvlist to consume (that's why we use nvlist_move + * for the nvlist to consume (that is why we use nvlist_move * not nvlist_add). */ nvlist_move_descriptor(nvl, "fd", fd); @@ -806,7 +908,7 @@ if (nvlist_send(sock, nvl) < 0) { nvlist_destroy(nvl); .Ed .Pp -Receiving nvlist and getting data: +Receiving an nvlist and retrieving element values: .Bd -literal nvlist_t *nvl; const char *command; @@ -817,25 +919,27 @@ nvl = nvlist_recv(sock, 0); if (nvl == NULL) err(1, "nvlist_recv() failed"); -/* For command we take pointer to nvlist's buffer. */ +/* For command we accept a pointer to the nvlist's internal buffer. */ command = nvlist_get_string(nvl, "command"); + /* * For filename we remove it from the nvlist and take * ownership of the buffer. */ filename = nvlist_take_string(nvl, "filename"); -/* The same for the descriptor. */ + +/* The same for the file descriptor. */ fd = nvlist_take_descriptor(nvl, "fd"); printf("command=%s filename=%s fd=%d\n", command, filename, fd); +/* command is freed by nvlist_destroy() */ nvlist_destroy(nvl); free(filename); close(fd); -/* command was freed by nvlist_destroy() */ .Ed .Pp -Iterating over nvlist: +Iterating over an nvlist: .Bd -literal nvlist_t *nvl; const char *name; @@ -898,7 +1002,7 @@ nvl = nvlist_recv(sock, 0); if (nvl == null) err(1, "nvlist_recv() failed"); -cookie = null; +cookie = NULL; do { while ((name = nvlist_next(nvl, &type, &cookie)) != NULL) { if (type == NV_TYPE_NVLIST) { From nobody Mon Mar 3 16:56:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jM5gngz5pnV3; Mon, 03 Mar 2025 16:56: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 4Z64jM0xrfz46DJ; Mon, 03 Mar 2025 16:56:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8eaCogNpW6/QdRfs+0F3wag/UbcM2Gsyd3vZbH549dU=; b=huJKqgJ0NEUoS2XWawfcQOskR/T+1gnj87sT2+IEIx6iC5/GoIQdAYz3axB4uIUwl7dRBY a5lDej1Pxt/AOKGfCrNVxw/qo2ebEqv1FPAko/Vh67ETt1RuYW/x4/npcHZ7OubE1SgdrH IxLBubmqq3krO1CAwLCgE/cIwx0yBB8R/1rLRU0oH+de6EZg34XgKQYmLtv4ZMAwEyVWHm rgK3FUjjr6pSeKPagWHxQzZumvOsOOcU1AC3yCOEOYjAwwBvVLSH/w7JKppB0MFpsJ+u+4 KyOaoG4WFvisHfBLPg41NX7QR42feUO99FLzDeAHMXqD2JbWd1lrS6XAcoUibw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021015; a=rsa-sha256; cv=none; b=CI5OgfarJjd4yPh822DW6deJSntySXOLqsZM0zZ1pHuHxFUgw9pd+m093cPQzO46Vu7PiF jYMh1DWx3SxRZK7SOAxU35We0MgmnpcHnxhqdtSH1v2Coi0hcJNVqu25Z3m2PPkPoiYuCz Tft7AYpVae2ZICV9igZ1xN4OmEFM3Xiw7q1pe2DRqoAn8ZfFX7BFtASm6L6p5H0aUMRkXf 8TmpefOXWzcYPlJ0RJFAD+XD2g63R5uPGeRqdhwmOnBzRCTJpjOzyiVE7+sLejp/0L4K99 l//rLDNQscrjqqjPqQw8DD1WX2IFQCW0Tbu039xr+3GjJZyb72ur7vmqer2fbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8eaCogNpW6/QdRfs+0F3wag/UbcM2Gsyd3vZbH549dU=; b=o9Q9zhPXQJQgfzQH7qasEjgyzOLGCUDtxPaKKz+K1JfIz7Ny+6kPj+3hH5aR5PAbkrq/uF 0PyM0zglekkVY2Z6kxbd0y7GS1oQmDIbNxl+1drvr0MjD0QzAiKXiR/h6nHflyho2uw5ke RUy2tbrtbxjVaecrHuIYt42wj3Hsw6CvaoalEnssuifS8UN4AH2X7ORyx8mxkeUG+YAjOa ioKxDzB4pMKtA95ZoE0sNOtOhI4ZmA7IqwUmNPWMM2Az4H4cnyjNl9GMdAya8Lx7yIl/9e /LKCxKeRQAEbHcTCy+tsfXKUhgeuMlIAHFRKideh12mAuHJA3CNplJsBlJldkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jM0VHYzwrD; Mon, 03 Mar 2025 16:56: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 523GusJS083578; Mon, 3 Mar 2025 16:56:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GusO0083575; Mon, 3 Mar 2025 16:56:54 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:54 GMT Message-Id: <202503031656.523GusO0083575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a088781bc36d - stable/14 - nv.9: Add a new subsection documenting kernel-specific behavior List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a088781bc36d6a4aba053c3a94f810fec9d9f899 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a088781bc36d6a4aba053c3a94f810fec9d9f899 commit a088781bc36d6a4aba053c3a94f810fec9d9f899 Author: John Baldwin AuthorDate: 2025-01-03 15:51:51 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 nv.9: Add a new subsection documenting kernel-specific behavior Reviewed by: emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48257 (cherry picked from commit ecb5fe3c5e483e09544645ba84281b4a8cba4edf) --- share/man/man9/nv.9 | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/share/man/man9/nv.9 b/share/man/man9/nv.9 index 4e4542c146ef..8c99f1d12200 100644 --- a/share/man/man9/nv.9 +++ b/share/man/man9/nv.9 @@ -859,7 +859,7 @@ If no element named .Fa name with the appropriate type exists, the program aborts. The nvlist must not be in the error state. -.Sh NOTES +.Ss Notes The .Fn nvlist_pack and @@ -873,6 +873,36 @@ The and .Fn nvlist_xfer functions can transfer nvlists between hosts with different endianness. +.Ss Kernel Considerations +The +.Nm nv , +.Nm cnv , +and +.Nm dnv +APIs can be used in the kernel with the following differences: +.Bl -bullet +.It +File descriptor and file descriptor array value types are not supported. +.It +.Fn nvlist_recv , +.Fn nvlist_send , +and +.Fn nvlist_xfer +are not supported. +.It +All memory allocations use the +.Dv M_NVLIST +memory type with +.Xr malloc 9 +and +.Xr free 9 . +As a result, any allocated buffers moved into an nvlist must be allocated with +.Dv M_NVLIST , +and buffers returned by functions such as +.Fn nvlist_pack +must be freed with +.Dv M_NVLIST . +.El .Sh EXAMPLES The following example demonstrates how to prepare an nvlist and send it over a .Xr unix 4 From nobody Mon Mar 3 16:56:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jN4R8pz5pnV6; Mon, 03 Mar 2025 16:56: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 4Z64jN1zmYz45xw; Mon, 03 Mar 2025 16:56:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bDwGkA+PE3XJfr7DqXM6+FRcybSqj3O9IiJLNJzxreE=; b=Fb2oAccH4zdsCFukTQ55sfzUlIECxHPlN7qP8z3Lo7f0bxdjeDwJKSea5A7Ox0qBBC95nN RdrcOr21EoJWRkm4Yi0tYAUfSEMZt9zGLjBWqggpsQOmKF6BiqMXuhxCu+t9Ldx49BgUPD ISA1lUAmAKMdavPzxQZ/8zOACjkeoWNYEXh9W/zcLip7XGakdAaJixFCpsEeF0EOjf7/FY qAL5WD6Q4dA2ONImQs9dncsoQvwT2PpyAf6DBBEIz3cR4tElT0otX5KWeld7AIhny8O8Rq tpu6IQ5lc1FqAqiIlhZEteAD0DBb4KykAUGho8+IoA1ltLa5DWtzvJGyRy7d/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021016; a=rsa-sha256; cv=none; b=spWilObByHD9/oVMDLUnT65zCmxEEr4ULi4c6vVQrCFP4PMnWnlumh9wM4FchlUSyNbfGs 8w08g9rI71R9w5dRDzkxgU4z1aPCprEasAtY8wC0pziysALkBlWpSlEzRCXHdvG2cZT5An NZe71r8dqqPuZwJNERm0zZG3T+2e/YdnsSaYUjgLCZJKmp3MvC5kfszQ+rq3Q2n0Xkzzb+ vRujxuT3z8sHzTlXbXKobonLqsbOPyqM4zzo61UP9XflcaIWXzq46zeOsLlXylRRDUlKYj veNTWSHN0sMnOkZl2PBbLhfROi/NNGO9ClAWxbJ+Zyt8vnrENHDgWCOHx7Hipg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bDwGkA+PE3XJfr7DqXM6+FRcybSqj3O9IiJLNJzxreE=; b=TaySs2uk7D+5Rhkg/lYpdsE2t3pMB5eUtmvUk70FTzpF9n4pHGAkDfbv1YHuUo2SM1rUil 7n3xxDW44Y4cYz/pPRAlJDJ4nvQoqw+69fiy54OMDrvtH1Q5ezlwk1351lHYQKdzEXofOJ CijtgTt8SxYxn/IloLeQOXsJfje5rO6vqfiRefOA++3AxMu/hbPg5wAeZd+XQmwcpeQ+UI Z72AN4l2rLYyw0rXYT6+ca9+0UpQL73V4raiFtzxCcGZKugFdsX0EK35HHA66Zx9p7ib2n 8uSCkTt19FhrXPt/kCrSqZ4xv0k3ZoXFfI8kXvVkXdX5NMDxcKZoofUIDzTmJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jN1TRdzwc8; Mon, 03 Mar 2025 16:56: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 523Guu0Y083613; Mon, 3 Mar 2025 16:56:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GuuZK083610; Mon, 3 Mar 2025 16:56:56 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:56 GMT Message-Id: <202503031656.523GuuZK083610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: dab1feb75e3d - stable/14 - cpu_machdep.9: New manpage describing the semantics of several cpu_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dab1feb75e3d637c08ada1885da6f5a26563179d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dab1feb75e3d637c08ada1885da6f5a26563179d commit dab1feb75e3d637c08ada1885da6f5a26563179d Author: John Baldwin AuthorDate: 2025-01-03 16:02:43 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 cpu_machdep.9: New manpage describing the semantics of several cpu_* This page is not exhaustive but covers all of the MD interface functions currently declared in . Requested by: kib Reviewed by: kib Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D48022 (cherry picked from commit 9c87cbbcaaedbc4e07d5c9d0248bf76f72531f57) --- share/man/man9/Makefile | 21 +++ share/man/man9/cpu_machdep.9 | 397 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 418 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index abf7ba82e6b3..90aad3dcfdcd 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -67,6 +67,7 @@ MAN= accept_filter.9 \ contigmalloc.9 \ copy.9 \ counter.9 \ + cpu_machdep.9 \ cpuset.9 \ cr_bsd_visible.9 \ cr_cansee.9 \ @@ -907,6 +908,26 @@ MLINKS+=counter.9 counter_u64_alloc.9 \ counter.9 SYSCTL_ADD_COUNTER_U64.9 \ counter.9 SYSCTL_COUNTER_U64_ARRAY.9 \ counter.9 SYSCTL_ADD_COUNTER_U64_ARRAY.9 +MLINKS+=cpu_machdep.9 cpu_copy_thread.9 \ + cpu_machdep.9 cpu_exec_vmspace_reuse.9 \ + cpu_machdep.9 cpu_exit.9 \ + cpu_machdep.9 cpu_fetch_syscall_args.9 \ + cpu_machdep.9 cpu_fork.9 \ + cpu_machdep.9 cpu_fork_kthread_handler.9 \ + cpu_machdep.9 cpu_idle.9 \ + cpu_machdep.9 cpu_idle_wakeup.9 \ + cpu_machdep.9 cpu_procctl.9 \ + cpu_machdep.9 cpu_ptrace.9 \ + cpu_machdep.9 cpu_set_syscall_retval.9 \ + cpu_machdep.9 cpu_set_upcall.9 \ + cpu_machdep.9 cpu_set_user_tls.9 \ + cpu_machdep.9 cpu_switch.9 \ + cpu_machdep.9 cpu_sync_core.9 \ + cpu_machdep.9 cpu_thread_alloc.9 \ + cpu_machdep.9 cpu_thread_clean.9 \ + cpu_machdep.9 cpu_thread_exit.9 \ + cpu_machdep.9 cpu_thread_free.9 \ + cpu_machdep.9 cpu_throw.9 MLINKS+=cpuset.9 CPUSET_T_INITIALIZER.9 \ cpuset.9 CPUSET_FSET.9 \ cpuset.9 CPU_CLR.9 \ diff --git a/share/man/man9/cpu_machdep.9 b/share/man/man9/cpu_machdep.9 new file mode 100644 index 000000000000..9ab42807eac1 --- /dev/null +++ b/share/man/man9/cpu_machdep.9 @@ -0,0 +1,397 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 (holder) +.\" +.\" This software was developed by SRI International, the University of +.\" Cambridge Computer Laboratory (Department of Computer Science and +.\" Technology), and Capabilities Limited under Defense Advanced Research +.\" Projects Agency (DARPA) Contract No. FA8750-24-C-B047 ("DEC"). +.\" +.Dd January 3, 2025 +.Dt cpu_machdep 9 +.Os +.Sh NAME +.Nm cpu_machdep , +.Nm cpu_copy_thread , +.Nm cpu_exec_vmspace_reuse , +.Nm cpu_exit , +.Nm cpu_fetch_syscall_args , +.Nm cpu_fork , +.Nm cpu_fork_kthread_handler , +.Nm cpu_idle , +.Nm cpu_idle_wakeup , +.Nm cpu_procctl , +.Nm cpu_set_syscall_retval , +.Nm cpu_set_upcall , +.Nm cpu_set_user_tls , +.Nm cpu_switch , +.Nm cpu_sync_core , +.Nm cpu_thread_alloc , +.Nm cpu_thread_clean , +.Nm cpu_thread_exit , +.Nm cpu_thread_free , +.Nm cpu_throw +.Nd machine-dependent interfaces to handle CPU and thread state +.Sh SYNOPSIS +.In sys/proc.h +.In sys/ptrace.h +.Ft void +.Fn cpu_copy_thread "struct thread *td" "struct thread *td0" +.Ft bool +.Fn cpu_exec_vmspace_reuse "struct proc *p" "struct vm_map *map" +.Ft void +.Fn cpu_exit "struct thread *td" +.Ft int +.Fn cpu_fetch_syscall_args "struct thread *td" +.Ft void +.Fo cpu_fork +.Fa "struct thread *td1" "struct proc *p2" "struct thread *td2" "int flags" +.Fc +.Ft void +.Fo cpu_fork_kthread_handler +.Fa "struct thread *td" "void (*func)(void *)" "void *arg" +.Fc +.Ft void +.Fn cpu_idle "int busy" +.Ft int +.Fn cpu_idle_wakeup "int cpu" +.Ft int +.Fo cpu_procctl +.Fa "struct thread *td" "int idtype" "id_t id" "int com" "void *data" +.Fc +.Ft int +.Fn cpu_ptrace "struct thread *_td" "int req" "void *addr" "int data" +.Ft void +.Fn cpu_set_syscall_retval "struct thread *td" "int error" +.Ft int +.Fo cpu_set_upcall +.Fa "struct thread *td" "void (*entry)(void *)" "void *arg" "stack_t *stack" +.Fc +.Ft int +.Fn cpu_set_user_tls "struct thread *td" "void *tls_base" +.Ft void +.Fn cpu_switch "struct thread *old" "struct thread *new" "struct mtx *mtx" +.Ft void +.Fn cpu_sync_core "void" +.Ft void +.Fn cpu_thread_alloc "struct thread *td" +.Ft void +.Fn cpu_thread_clean "struct thread *td" +.Ft void +.Fn cpu_thread_exit "struct thread *td" +.Ft void +.Fn cpu_thread_free "struct thread *td" +.Ft void +.Fn cpu_throw "struct thread *old" "struct thread *new" +.Sh DESCRIPTION +These functions provide architecture-specific implementations of +machine-independent abstractions. +.Pp +.Fn cpu_exec_vmspace_reuse +returns true if +.Fn exec_new_vmspace +can reuse an existing +.Vt struct vmspace +.Pq Fa map +for the process +.Fa p +during +.Xr execve 2 . +This is only invoked if +.Fa map +is not shared with any other consumers. +If this returns false, +.Fn exec_new_vmspace +will create a new +.Vt struct vmspace . +.Pp +.Fn cpu_exit +releases machine-dependent resources other than the address space for the +process containing +.Fa td +during process exit. +.Pp +.Fn cpu_fork +copies and updates machine-dependent state +(for example, the pcb and user registers) from the forking thread +.Fa td1 +in an existing process to the new thread +.Fa td2 +in the new process +.Fa p2 . +This function must set up the new thread's kernel stack and pcb so that +.Fa td2 +calls +.Fn fork_exit +when it begins execution passing a pointer to +.Fn fork_return +as the +.Fa callout +argument and +.Fa td2 +as the +.Fa arg +argument. +.Pp +.Fn cpu_fork_kthread_handler +adjusts a new thread's initial pcb and/or kernel stack to pass +.Fa func +and +.Fa arg +as the +.Fa callout +and +.Fa arg +arguments to +.Fn fork_exit . +This must be called before a new thread is scheduled to run and is +used to set the +.Dq main +function for kernel threads. +.Pp +.Fn cpu_copy_thread +copies machine-dependent state (for example, the pcb and user registers) from +.Fa td +to +.Fa td0 +when creating a new thread in the same process. +This function must set up the new thread's kernel stack and pcb so that +.Fa td0 +calls +.Fn fork_exit +when it begins execution passing a pointer to +.Fn fork_return +as the +.Fa callout +argument and +.Fa td0 +as the +.Fa arg +argument. +.Pp +.Fn cpu_set_upcall +updates a new thread's initial user register state to call +.Fa entry +with +.Fa arg +as the sole argument using the user stack described in +.Fa stack . +.Pp +.Fn cpu_set_user_tls +sets a new thread's initial user thread pointer register to +reference the user TLS base pointer +.Fa tls_base . +.Pp +.Fn cpu_fetch_syscall_args +fetches the current system call arguments for the native FreeBSD ABI from the +current thread's user register state and/or user stack. +The arguments are saved in the +.Fa td_sa +member of +.Fa td . +.Pp +.Fn cpu_set_syscall_retval +updates the user register state for +.Fa td +to store system call error and return values. +If +.Fa error +is 0, +indicate success and return the two values in +.Fa td_retval . +If +.Fa error +is +.Dv ERESTART, +adjust the user PC to re-invoke the current system call after returning +to user mode. +If +.Fa error +is +.Dv EJUSTRETURN , +leave the current user register state unchanged. +For any other value of +.Fa error , +indicate error and return +.Fa error +as the error code. +.Pp +.Fn cpu_idle +waits for the next interrupt to occur on the current CPU. +If an architecture supports low power idling, +this function should place the CPU into a low power state while waiting. +.Fa busy +is a hint from the scheduler. +If +.Fa busy +is non-zero, +the scheduler expects a short sleep, +so the CPU should prefer low-latency over maximum power savings. +If +.Fa busy +is zero, +the CPU should maximumize power savings including deferring unnecessary +clock interrupts via +.Fn cpu_idleclock . +.Pp +.Fn cpu_idle_wakeup +awakens the idle CPU with the ID +.Fa cpu +from a low-power state. +.Pp +.Fn cpu_procctl +handles any machine-dependent +.Xr procctl 2 +requests. +.Pp +.Fn cpu_ptrace +handles any machine-dependent +.Xr ptrace 2 +requests. +.Pp +.Fn cpu_switch +switches the current CPU between threads by swapping register state. +This function saves the current CPU register state in the pcb of +.Fa old +and loads register values from the pcb of +.Fa new +before returning. +While the pcb generally contains caller-save kernel register state, +it can also contain user registers that are not saved in the trapframe. +.Pp +After saving the current CPU register state of +.Fa old , +.Fn cpu_switch +stores +.Fa mtx +in the +.Fa td_lock +member of +.Fa old +transferring ownership of the old thread. +No data belonging to +.Fa old +can be accessed after that store. +Specifically, the old thread's kernel stack must not be accessed after +this point. +.Pp +When +.Dv SCHED_ULE +is being used, +this function must wait (via spinning) for the +.Fa td_lock +member of +.Fa new +to change to a value not equal to +.Va &blocked_lock +before loading register values from +.Fa new +or accessing its kernel stack. +.Pp +From the caller's perspective, +.Fn cpu_switch +returns when +.Fa old +is rescheduled in the future, +possibly on a different CPU. +However, the implementation of +.Fn cpu_switch +returns immediately on the same CPU into the previously-saved context of +.Fa new . +.Pp +.Fn cpu_throw +is similar to +.Fn cpu_switch +but does not save any state for +.Fa old +or write to the old thread's +.Fa td_lock +member. +.Pp +.Fn cpu_sync_core +ensures that all possible speculation and out-of-order execution is +serialized on the current CPU. +Note that this is called from an IPI handler so only has to handle +additional serialization beyond that provided by handling an IPI. +.Ss Thread Object Lifecycle +These functions support the management of machine-dependent thread +state in conjunction with a thread object's lifecycle. +.Pp +The general model is that a thread object is allocated each time a +new kernel thread is created either by system calls like +.Xr fork 2 +or +.Xr thr_new 2 +or when kernel-only threads are created via +.Xr kproc_create 9 , +.Xr kproc_kthread_add 9 , +or +.Xr kthread_add 9 . +When a kernel thread exits, +the thread object is freed. +However, there is one special case to support an optimization where each +free process object caches a thread object. +When a process exits, the last thread object is not freed but remains +attached to the process. +When the process object is later reused for a new process in +.Xr fork 2 , +the kernel recycles that last thread object and uses it as the initial +thread in the new process. +When a thread is recycled, some of the steps in the thread allocation +and free cycle are skipped as an optimization. +.Pp +.Fn cpu_thread_alloc +initializes machine-dependent fields in +.Fa td +after allocating a new kernel stack. +This function typically sets the +.Fa td_pcb +and initial +.Fa td_frame +pointers. +.Fn cpu_thread_alloc +is called both when allocating a new thread object and +when a recycled thread allocates a new kernel stack. +Note that this function is +.Em not +called if a recycled thread reuses its existing kernel stack. +.Pp +.Fn cpu_thread_clean +releases any machine-dependent resources for the last thread in a +process during +.Xr wait 2 . +The thread is a candidate for recycling so should be reset to run as a +new thread in case it is recycled by a future +.Xr fork 2 . +.Pp +.Fn cpu_thread_exit +cleans any machine-dependent state in +.Fa td +while it is exiting. +This is called by the exiting thread so cannot free state needed during +in-kernel execution. +.Pp +.Fn cpu_thread_free +releases any machine-dependent state in +.Fa td +when it is being freed. +This is called for any thread that was not the last thread in a process +once it has finished execution. +.Sh SEE ALSO +.Xr fork 2 , +.Xr procctl 2 , +.Xr ptrace 2 , +.Xr thr_new 2 , +.Xr wait 2 , +.Xr kproc_create 9 , +.Xr kproc_kthread_add 9 , +.Xr kthread_add 9 , +.Xr mi_switch 9 +.Sh AUTHORS +This manual page was +developed by SRI International, the University of Cambridge Computer +Laboratory (Department of Computer Science and Technology), and +Capabilities Limited under contract +.Pq FA8750-24-C-B047 +.Pq Do DEC Dc . From nobody Mon Mar 3 16:56:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jQ1920z5pnKG; Mon, 03 Mar 2025 16:56: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 4Z64jP2rdBz45y5; Mon, 03 Mar 2025 16:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u5cH7t47h99mkHYth1W6eN58kGw3nGXP1tD/sVJwb50=; b=ItgPCWK/DwCGlGEiEzMqfmqmwKQgJxjUM9+GZ9MA8aKVVoTej8LQ06G9c+fX6eLipeBejZ 7k5NE+b95vVVXY0EcDwRB9p3MkMKMpmeZJLFLU/w312twka4T57tloHS+sIze+6KVjcmRW 3oXCHI9PnPN7MjMoR6Hrew+Ru7WBs0tHYi3d19i485yprF/bzcxylLGDR/EXkG03dL/4vm bVllEyCg9/KArb8HxXBrmZlstqSP39Yp/RQdI9hayfgUVFRu160XM0AMAXhF6WrKqrbnCa m9+C09+GZCrluJH1PiLVECOxXGulCCwUfoGXBETko0QaMqk21D1MF3Mi/ZCO7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021017; a=rsa-sha256; cv=none; b=ZJ8D2AQu8SKam46O+eYAPi/PeQ+oKBufzPyQDfV4rKA4RjQQMkTdRFjOEMlOgqHIg0Cvvz PLXsFMcrZROVRv/ljzvHSA/nGyZXBMhj1RN/oLU+HsUN72auo6cWj71qgILbFn1ymaQVCc pf/OGar/IfNc0TwqXzgnRUxMGXl3aKd+cSc7QMY3/XpMNuMN5H90q78WBKbptOFWoq2AnN /H3ve6RzryqVWyevLtC073D9/1mhYa1qU+Fuwl1PA5OItl4a5CU+4/VmOJzb0CmcOblZ1e seAezHSb9mznmG9C3bfkZ/Wr6ZOpwihGngV9lvd0Fm1f+03dBjR1huCMI111fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u5cH7t47h99mkHYth1W6eN58kGw3nGXP1tD/sVJwb50=; b=vplKhRSOjxV3FRVKXgnJEg1tjLBjYZm3FjQuviMvWyDAeKN79FjGQKpHvnw/x5Ymu/vo9g RWdNzqHbsh2uY9g6Edj5ZqcchZu3yLHCxolOPHUn7aIkOQrNs3ofCOhNTSCK+VEmQtyB6H MWWnKHe9lxykCnwMyffGEIY5Ambuz+L4+ZTPXdsE/r8CvG0RedPcfVHulk9/tOODRG0Oa8 gLdeHFgoNz9uySAF2N+EUUy94nmgseDvoer4iEDG4MYBYRev0xPVrkQhvkocv3dPPlpd6w JXU3+vKIDL8dysefRH3f8v7zOQMYbdsbA2YDYGxZwBKwSLgSakoMpBJgM0A6gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jP2QJ2zwrF; Mon, 03 Mar 2025 16:56: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 523Guvkv083652; Mon, 3 Mar 2025 16:56:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GuvAu083649; Mon, 3 Mar 2025 16:56:57 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:57 GMT Message-Id: <202503031656.523GuvAu083649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0cfebe47d9e3 - stable/14 - mi_switch.9: Remove cpu_switch, cpu_throw List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0cfebe47d9e3a41fa15a10f690697edc9eaaa83c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0cfebe47d9e3a41fa15a10f690697edc9eaaa83c commit 0cfebe47d9e3a41fa15a10f690697edc9eaaa83c Author: Ed Maste AuthorDate: 2025-01-07 16:04:00 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 mi_switch.9: Remove cpu_switch, cpu_throw cpu_machdep.9 was added to document cpu_*, but cpu_switch and cpu_throw were already documented in mi_switch.9, and MLINKed. cpu_machdep.9 seems like the correct place for this, so remove them from mi_switch.9. Some of the removed text was stale, although there are few notes that ought to be added to cpu_machdep.9 in a future commit. Reported by: tools/pkgbase/metalog_reader.lua Reviewed by: jhb Sponsored by: The FreeBSD Foundation Fixes: 9c87cbbcaaed ("cpu_machdep.9: New manpage describing the semantics of several cpu_*") Differential Revision: https://reviews.freebsd.org/D48360 (cherry picked from commit f73c9b5da190954a81e9e70e2caa8e9168623bfd) --- share/man/man9/Makefile | 2 -- share/man/man9/mi_switch.9 | 68 +++------------------------------------------- 2 files changed, 4 insertions(+), 66 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 90aad3dcfdcd..fdfdb2e888d9 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1592,8 +1592,6 @@ MLINKS+=microuptime.9 binuptime.9 \ microuptime.9 getsbinuptime.9 \ microuptime.9 nanouptime.9 \ microuptime.9 sbinuptime.9 -MLINKS+=mi_switch.9 cpu_switch.9 \ - mi_switch.9 cpu_throw.9 MLINKS+=mod_cc.9 CCV.9 \ mod_cc.9 DECLARE_CC_MODULE.9 MLINKS+=mtx_pool.9 mtx_pool_alloc.9 \ diff --git a/share/man/man9/mi_switch.9 b/share/man/man9/mi_switch.9 index 549ec497434c..e04c2ee35ace 100644 --- a/share/man/man9/mi_switch.9 +++ b/share/man/man9/mi_switch.9 @@ -31,23 +31,17 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 9, 2023 +.Dd January 7, 2025 .Dt MI_SWITCH 9 .Os .Sh NAME -.Nm mi_switch , -.Nm cpu_switch , -.Nm cpu_throw +.Nm mi_switch .Nd switch to another thread context .Sh SYNOPSIS .In sys/param.h .In sys/proc.h .Ft void .Fn mi_switch "int flags" -.Ft void -.Fn cpu_switch "struct thread *oldtd" "struct thread *newtd" "struct mtx *lock" -.Ft void -.Fn cpu_throw "struct thread *oldtd" "struct thread *newtd" .Sh DESCRIPTION The .Fn mi_switch @@ -168,63 +162,9 @@ running thread .Fa oldtd to the chosen thread .Fa newtd . -First, it saves the context of -.Fa oldtd -to its Process Control Block -.Po -PCB, -.Vt struct pcb -.Pc , -pointed at by -.Va oldtd->td_pcb . -The function then updates important per-CPU state such as the -.Dv curthread -variable, and activates -.Fa newtd\&'s -virtual address space using its associated -.Xr pmap 9 -structure. -Finally, it reads in the saved context from -.Fa newtd\&'s -PCB. -CPU instruction flow continues in the new thread context, on -.Fa newtd\&'s -kernel stack. -The return from -.Fn cpu_switch -can be understood as a completion of the function call initiated by -.Fa newtd -when it was previously switched out, at some point in the distant (relative to -CPU time) past. -.Pp -The -.Fa mtx -argument to -.Fn cpu_switch -is used to pass the mutex which will be stored as -.Fa oldtd\&'s -thread lock at the moment that -.Fa oldtd -is completely switched out. -This is an implementation detail of -.Fn sched_switch . -.Pp -.Fn cpu_throw -is similar to -.Fn cpu_switch -except that it does not save the context of the old thread. -This function is useful when the kernel does not have an old thread -context to save, such as when CPUs other than the boot CPU perform their -first task switch, or when the kernel does not care about the state of the -old thread, such as in -.Xr thread_exit 9 -when the kernel terminates the current thread and switches into a new -thread, -.Fa newtd . -The -.Fa oldtd -argument is unused. .Sh SEE ALSO +.Xr cpu_switch 9 , +.Xr cpu_throw 9 , .Xr critical_exit 9 , .Xr issignal 9 , .Xr kern_yield 9 , From nobody Mon Mar 3 16:56:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jR2d2qz5pnKH; Mon, 03 Mar 2025 16:56: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 4Z64jQ4G2Tz46Bd; Mon, 03 Mar 2025 16:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldRH4fVbBKAevMCwLuqnCl4WifpK5Y8qUfSAbZc+S6c=; b=Kwx4/Tgf8ObBIYIrIetX78n1LxHL52cLgu82G5BsYnoUES5cFuuxB1QXQ3WQFaIbXC2GoL oxs/bREMaW6720L+DH976DAMqdxggRzEyA2XwQM1kPu8QOuL/V3RkHNgBWedUhKTcUmc6w YwoZqZ4W04+buiGDn6+QcD3ByoU04g6CCebNkFGrL+bsrQF0/egRKuzYr2VaQ6WRKoq/gH KiSWZ3A55s1fL/H1MjHp4l1/dm6Gho6xrWHIwr/LnSINLX100gGzxX/CmoWUQtArv3lECX ea5O0WkDiqB0DeioEwrIjuYjstrYO6/ByMQ87J2QXYcMe2sj2HDmG3km/Yj88Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021018; a=rsa-sha256; cv=none; b=axtlTDP4GnXnnzdtibEKk/g5tRT75rO4hpiRPaLrpgz/bsVm9qxfZr/fn4iqhOO9lD8h2A WJuf38iIwDOCaxOuQBLTyXhLjCEMM/UcHATBAGZQR2MFQwOqrv42EFBEnKKk4eqcxwrGEi DVqwHXxA995ABbmXb85xTvOkfkw6W1u6RqWiO2DyHL4BFXay/fo93CJt4dWNjZ2ZkCwaD4 0gQTTGXzja0WDkhgJxYkrnh0gSXqYkbYwSM7x+fww2e9P/gaC71aVWDee0z6GPRqiq9fA4 5iNhdVtlk1JqkCEgenZttc2x580/+L/fzUNGLJh680aZ+Z93oaR548SFY8eaCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldRH4fVbBKAevMCwLuqnCl4WifpK5Y8qUfSAbZc+S6c=; b=njPd1/t243wlkpLtF2KvE68HgFwW3otkOiOC3/OCVp4Go62+FMFYepUc1Yh36wL0y8Fz/G HKhWcqPc0nX0PDqtWfoDFUSJqscny229HPdlcZ+wdqh9axAxRsJucxFGTeEWCzXg3bKqTR KmfWxq7C0IwrOgGW5HmHkVHINf+iUKyo8tOm/WEnOWF9u/QwS3hV+Dp8POjQf/PudbwLd+ Oc6asFfeE1/cdZUtp+R+XTptt0kcdrmt+LLycfSEhYX33OyARySzPapKHt6VEccFEOX/+8 w2iL8Wujby4emU0LzQYA1eBi4hGtqgYR6zqu16kZLIuDe0mKdPkRyqispB/PDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jQ36rJzwtk; Mon, 03 Mar 2025 16:56: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 523Guwcq083689; Mon, 3 Mar 2025 16:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523GuwAQ083686; Mon, 3 Mar 2025 16:56:58 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:58 GMT Message-Id: <202503031656.523GuwAQ083686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 939bcd2c20b4 - stable/14 - cpu_set_upcall / linux_clone_thread: Remove calls to cpu_thread_clean List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 939bcd2c20b42f550c7b89a52a105bfbbb8b5db1 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=939bcd2c20b42f550c7b89a52a105bfbbb8b5db1 commit 939bcd2c20b42f550c7b89a52a105bfbbb8b5db1 Author: John Baldwin AuthorDate: 2025-01-03 16:03:08 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 cpu_set_upcall / linux_clone_thread: Remove calls to cpu_thread_clean This is intended to clean state of a thread at the end of its lifecycle during wait(), not the beginning of its life cycle. Reviewed by: kib Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D48023 (cherry picked from commit 0e742cc77454d0872ac2f6e7fd755b6d0322b711) --- sys/amd64/amd64/vm_machdep.c | 10 ---------- sys/compat/linux/linux_fork.c | 2 -- sys/i386/i386/vm_machdep.c | 10 ---------- 3 files changed, 22 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 9e77ac7af2d7..36001bc5b5b6 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -617,16 +617,6 @@ int cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { - - /* - * Do any extra cleaning that needs to be done. - * The thread may have optional components - * that are not present in a fresh thread. - * This may be a recycled thread so make it look - * as though it's newly allocated. - */ - cpu_thread_clean(td); - #ifdef COMPAT_FREEBSD32 if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { /* diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index 4ce3bc192b4e..1c9189162a09 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -301,8 +301,6 @@ linux_clone_thread(struct thread *td, struct l_clone_args *args) else em->child_clear_tid = NULL; - cpu_thread_clean(newtd); - linux_set_upcall(newtd, args->stack); PROC_LOCK(p); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index e05791967fba..d252438dc186 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -492,16 +492,6 @@ int cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { - - /* - * Do any extra cleaning that needs to be done. - * The thread may have optional components - * that are not present in a fresh thread. - * This may be a recycled thread so make it look - * as though it's newly allocated. - */ - cpu_thread_clean(td); - /* * Set the trap frame to point at the beginning of the entry * function. From nobody Mon Mar 3 16:56:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jS1xWvz5pnKJ; Mon, 03 Mar 2025 16:57: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 4Z64jR4zRRz463j; Mon, 03 Mar 2025 16:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWHoZbjmL3gwVG3DWMseWgn2JO+BcLbStlhzU+JuanE=; b=UviTTe9wmfXb6XaJ3xkgF8E4aJQetEdPuIJBHNVCzzz6nqspKcfkLbMi/G8s9d8lK/Ccg/ jt9WFD2pLy6rJQgRpS6XFrJJlv1/EZ5kT2cGsDi93+Pqqkbxfc1qWAilFc4Mtqzskhcmef 1/1/waKr5lMEY/ouyroWPidlfc2T0j/eC4v74bU3fz4jm3hgreGwBg6k7cxMHDwPtF67iV ImGBg3lcNgd8u5mlBB7uFzFqqaQ2kwru4iXvxCk5GzJsDp4fTa2+V2sERgmA6a58uxNzTq g9Ljg7cVTTmB0HfHhF66VaQQciFrZgHKehTlnOws53mDgV8wRoh2r2s+9gVowQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021019; a=rsa-sha256; cv=none; b=m84yZt4FfUYiWIXibCKDR54vjUgek99/RyGpKZixsbwjGQpFjnU1UDEKklWElMg88AWBV7 WGEFh+gYMob2Mk/V9NNSksXFVbXVY7fO017drpDxyqs80UxgmpGBNdk20O405sXt8Nj81C Tk6zLEVUFfqCCn3Ir84qmhkYB8AaZ4D8cTp1mw6AxZJRKHsat+LTMVB7yOqauPsthZikT1 tU9A17si7G/B5J0hEgEQ1ArSk1nqGy6buIA9KHpyt1y0QUwAOGjzVOcuc4Dcqo0hxg9Nnu iWgMs+DF4I9/+qeGaHcro1IkL/E6VYxVnM3wI8ia648W/yQhsyEgHzEVd9m6qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWHoZbjmL3gwVG3DWMseWgn2JO+BcLbStlhzU+JuanE=; b=Eibg1tef02eQkkPrwar/x50SMLkXh3malLX4JvajlNtF3oGv5hv1Ij/mK7AMW5BjAxbzXg D2HpMf0WhmQj8ckCa+aJ2V0RX8PflbnxYCdhg9E+OK8jsEUbXgvDET03rnsVPQXM+pfl/S cX5RvzusA+oW6RqB2w5NwF6rpA1h5dWHJuNcgvVaCdxYBv+5c/P1uK2SnhkpObGaK9pJsS aYBntkfZLLDjPsmC634FtVciMtuKB85HhhxNUXwesQnO+OzDMC3/sfYnwzJb56PDsk50m9 jNT/XJxRN/X0PiXOQdPy6DOo0lM4ERVRJknyjqa+4YhInsvSK+oo/w2r8IngEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jR4MYMzwZb; Mon, 03 Mar 2025 16:56: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 523Guxam083726; Mon, 3 Mar 2025 16:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gux0H083723; Mon, 3 Mar 2025 16:56:59 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:56:59 GMT Message-Id: <202503031656.523Gux0H083723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3c6989af4bfc - stable/14 - BUS_CHILD_DETACHED.9: This is also called if DEVICE_ATTACH fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3c6989af4bfce195e5fab85d26e00ce28b7d6d0a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3c6989af4bfce195e5fab85d26e00ce28b7d6d0a commit 3c6989af4bfce195e5fab85d26e00ce28b7d6d0a Author: John Baldwin AuthorDate: 2025-01-09 20:09:21 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 BUS_CHILD_DETACHED.9: This is also called if DEVICE_ATTACH fails Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48363 (cherry picked from commit 6af088c736c2fd9e64f2ad9449b7df1a109e6241) --- share/man/man9/BUS_CHILD_DETACHED.9 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man9/BUS_CHILD_DETACHED.9 b/share/man/man9/BUS_CHILD_DETACHED.9 index 4cc00a49465b..8b59d1362d3d 100644 --- a/share/man/man9/BUS_CHILD_DETACHED.9 +++ b/share/man/man9/BUS_CHILD_DETACHED.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 21, 2012 +.Dd January 9, 2025 .Dt BUS_CHILD_DETACHED 9 .Os .Sh NAME @@ -39,7 +39,10 @@ .Sh DESCRIPTION The .Fn BUS_CHILD_DETACHED -method is invoked by the new-bus framework after a device is detached. +method is invoked by the new-bus framework after a device is detached +or if a driver's attach routine +.Pq see Xr DEVICE_ATTACH 9 +fails. A bus driver can provide an implementation of this method to reclaim any resources allocated on behalf of the child or to cleanup state not properly released by a From nobody Mon Mar 3 16:57:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jT2mR0z5pnMR; Mon, 03 Mar 2025 16:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z64jS5QRXz46C0; Mon, 03 Mar 2025 16:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OeF2QLJYBCycuCU7plLW8V1/c0Db/iOTSafAEjZA04M=; b=K3ap9LsDWJnN6RGnJ+ICDAMUlg0g8k+IfwXKqr9AZzGr2klWmF14lBpWevYoYGW7p7Ip+z 3EIgnB+IYCH3aNVnGXVspWlicVHNpHfmCfWABWUJXWtkB2a1ChNW6zXp+KE3nxEpzwfpBs oViyOq9rCDtuLXZyavHT+k/RqU/CAbpe7TenEFMtX+qB4Oyjq285e3hLUSUybRjp8lawtp RKUlpo/MowprLnfJct/DOsyrPWChyJoAaZM5IXPtMEQFIx8jsyYLZWfacB4xu5z2yOXlvk Yp/aR6+aXje8sOPX4ZMn/QhEK8li6GZphqGyYKRZKEwPK+Py97HSryqg4YEEOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021020; a=rsa-sha256; cv=none; b=Uv85seAvMPSQ0t0+QvHLzW2GN8STqObDvbgKTp6HcBFyAjqisS9MwUAQHfBbA1m7efdNCT JBKJk8jPxiUHhOoP69H60jDEej20duL1OeASU/mKSl2n4oCqpDGbpN/svT0JaCZJDfCyKC gHPVSJJ0ghcGGgcSy2SyzJO1u4/XfH1SqY2wV4MbJUjCImHI4ULjzuHo4zWbbKPkVCZnmg jtVGSSbwuNyFwyHFZukX1ScQRCbw1DZL0N2yzNFUu/o6WnPK7y8O4/w5nNbBK5lYbPfvBv uAhjMYVqn2AKQhqAe8ecvJLDTr5lIf8AQlS+rmpBXIjQCx9WKbXyFDqsNie9dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OeF2QLJYBCycuCU7plLW8V1/c0Db/iOTSafAEjZA04M=; b=POj+0mqhdTQk9sEqRzg+HPuaX3i5IlXPqHAf4kdRifqXLEia3vjiRxxdaWD0lSJqUWt/5d J21r77Wir00FKMt6X7nyNsOo3XjAmZ9ntPe7Mr8rt9NVEznajuE8n77aKgSHMGaL4zWPUw AK7odusQ51bU2cOWRH0kTxeGWa1IpxatOQL9E4+EfsfpZ5pdMZajybth4aC09HOoaTlnU2 RnrpnORtxlWIXcqHE3YIMdJvdzmL9OS9LQj8OrTT7Ukt+/NTJibvVyRXb+dsDqLiAhs8Zz NldQ/0sjLdVfahwqysHsi/3ifFXi9ZZOKBzkV42zTAo2sjYZyk8zbSPKN4ltcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jS4zjzzwtl; Mon, 03 Mar 2025 16:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 523Gv0Sg083767; Mon, 3 Mar 2025 16:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gv0AF083764; Mon, 3 Mar 2025 16:57:00 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:57:00 GMT Message-Id: <202503031657.523Gv0AF083764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f1ef0525f34d - stable/14 - DEVICE_IDENTIFY.9: Modernize description and use cases List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f1ef0525f34d5c21f330e60ff0366d38db509710 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f1ef0525f34d5c21f330e60ff0366d38db509710 commit f1ef0525f34d5c21f330e60ff0366d38db509710 Author: John Baldwin AuthorDate: 2025-01-09 20:20:16 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 DEVICE_IDENTIFY.9: Modernize description and use cases Mention adding devices based on firmware tables and software-only pseudo-devices as use cases for identify methods as those are more common than reading random I/O ports to identify a legacy ISA device. Describe how device_find_chid can be used to avoid duplicates. While here, explicitly note that devices added in identify methods typically use a fixed device name. Trim the cross-references a bit. Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D48367 (cherry picked from commit ccabc7c2e556ac0b14da9b682b706ccaf251c0fe) --- share/man/man9/DEVICE_IDENTIFY.9 | 52 +++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/share/man/man9/DEVICE_IDENTIFY.9 b/share/man/man9/DEVICE_IDENTIFY.9 index 4892e66eb214..9feb18f43f18 100644 --- a/share/man/man9/DEVICE_IDENTIFY.9 +++ b/share/man/man9/DEVICE_IDENTIFY.9 @@ -26,44 +26,46 @@ .\" (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 January 15, 2017 +.Dd January 9, 2025 .Dt DEVICE_IDENTIFY 9 .Os .Sh NAME .Nm DEVICE_IDENTIFY -.Nd identify a device, register it +.Nd identify new child devices and register them .Sh SYNOPSIS .In sys/param.h .In sys/bus.h .Ft void .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent" .Sh DESCRIPTION -The identify function for a device is only needed for devices on buses -that cannot identify their children independently, e.g.\& the ISA bus. -It is used to recognize the device (usually done by accessing non-ambiguous -registers in the hardware) and to tell the kernel about it and thus -creating a new device instance. +The identify method of a device driver is used to add devices that cannot be +enumerated by the standard method on a bus device. +Devices can be enumerated in various ways including accessing non-ambiguous +device registers and parsing firmware tables. +Software-only pseudo devices are also often enumerated via identify methods. .Pp +For each newly identified device, +a new device instance should be created by invoking the .Xr BUS_ADD_CHILD 9 -is used to register the device as a child of the bus. -The device's resources (such as IRQ and I/O ports) are registered -with the kernel by calling -.Fn bus_set_resource -for each resource (refer to +method. +If the identify method is able to discover other properties about the new +device, those should also be set. +For example, device resources should be added to the device by calling .Xr bus_set_resource 9 -for more information). +for each resource. .Pp -Since the device tree and the device driver tree are disjoint, the -.Fn DEVICE_IDENTIFY -routine needs to take this into account. -If you load and unload your device driver that has the identify -routine, the child node has the potential for adding the same node -multiple times unless specific measure are taken to preclude that -possibility. +An identify method might be invoked multiple times. +If a device driver is unloaded and loaded, +the identify method will be called a second time after being reloaded. +As a result, the identify method should avoid duplicate devices. +Devices added by identify methods typically use a fixed device name +in which case +.Xr device_find_child 9 +can be used to detect existing devices. .Sh EXAMPLES The following pseudo-code shows an example of a function that probes for a piece of hardware and registers it and its resource -(an I/O port) with the kernel. +(an I/O port) with the parent bus device. .Bd -literal void foo_identify(driver_t *driver, device_t parent) @@ -72,7 +74,7 @@ foo_identify(driver_t *driver, device_t parent) retrieve_device_information; if (devices matches one of your supported devices && - not already in device tree) { + device_get_child(parent, "foo", -1) == NULL) { child = BUS_ADD_CHILD(parent, 0, "foo", -1); bus_set_resource(child, SYS_RES_IOPORT, 0, FOO_IOADDR, 1); } @@ -82,11 +84,7 @@ foo_identify(driver_t *driver, device_t parent) .Xr BUS_ADD_CHILD 9 , .Xr bus_set_resource 9 , .Xr device 9 , -.Xr device_add_child 9 , -.Xr DEVICE_ATTACH 9 , -.Xr DEVICE_DETACH 9 , -.Xr DEVICE_PROBE 9 , -.Xr DEVICE_SHUTDOWN 9 +.Xr device_find_child 9 .Sh AUTHORS This manual page was written by .An Alexander Langer Aq Mt alex@FreeBSD.org . From nobody Mon Mar 3 16:57:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jV1BSyz5pnRl; Mon, 03 Mar 2025 16:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z64jT6gRQz4694; Mon, 03 Mar 2025 16:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=poGNCMLIo1X1T/RQRYBlFRe4veJZvDd+RhKeeKJIRqM=; b=O2bR+m0BQhesvYv1EmZKsaI6D5SgdNKdl6MNY7i6VzyJFODlFf8DqxnLDabtgceu5Mh9DX bHV4GG9iPCGaqOOkEOb7rCuSRL2RDpXfuis+P4Gi2ti6dcT0A5c20anUJh64zdZZ6UY89m IN0fNJZqWCp9+d0gN+SYxEj4wQEEYrErS91LUgeu70ygHciD4rN6J3BxCl02n8aE/uJUeL ykcSeys6pJWOdzlGyBm8a3Vc5kGl3uN8FcGEjBYwAC9mWQrnZxtbCEnr8WT8ErrUbuhnVY J010VLmWymousdXeI8wINsjVfHAjirfqA9V5nB6rrRJbGFDl7TzeLsLJk1z4Ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021022; a=rsa-sha256; cv=none; b=m6psRAtiKGxSPKyvH0zGCOPtO8pYqh/fA9o1iN+TMWIN2caA+SvygBQv+tb0p3dZ5wDhVp MmweqWc/ivdgvXBCI+24Ettk4uIPZ/TI8dstE71havw4L58IXWA9AOXXII+16poD8z1F2F 7dD9xPQjsff++dgahgPtqGRi4b+DXkfs3jS+IoOjYXQNuhjzrFz7jb5G0Kr425K1x/WMfQ Mcp4GQXv3+Ge/wqBqtcx4Klsim+z1AaE8RXVFj1UK6MGabiA46glbaloquHHjYx2R1v460 M3qh0PqbpoJ/wv+vyCm4g0QBLkEAr+ilnzIs6UQ8sc3rib15Beu6nTRxSNOsBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=poGNCMLIo1X1T/RQRYBlFRe4veJZvDd+RhKeeKJIRqM=; b=auwExUbSgzQ6P0shqQXkXKY6T2TDl5Xn2y9oFhUzgetljTSWLze0nUfl3UpzcUQg3pgOr9 E4LefH6b3so4nQrImHPyTMKcqZmfedFPEdy5HxXJAS7ZjI1MG7W1ufa0dB4cnByDCvLUg+ HB6O0xmvNKgP1kKCm1IgIblGfBzStfqizdtobD+28Y3v/arV8kSyYupg+QY0JZ/k61DRV8 S5VE5sSNeM03K5QvcUP5gwFIRrTPki2hKfxQhzabjVzOMEVNoKP0wQT2EymRHJKZDcF7Ai Zkx9mlGETGqpNjd0eHp1T8m2QSQIa5lanWJhD8Kt+0UMTz7kMRd4JKrspAASUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jT5wyMzwZc; Mon, 03 Mar 2025 16:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 523Gv12r083801; Mon, 3 Mar 2025 16:57:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gv1bA083798; Mon, 3 Mar 2025 16:57:01 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:57:01 GMT Message-Id: <202503031657.523Gv1bA083798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0960dc0d5bf4 - stable/14 - BUS_HINTED_CHILD.9: New manpage to document this bus method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0960dc0d5bf4f8e4c432a67a995104584bc1c940 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0960dc0d5bf4f8e4c432a67a995104584bc1c940 commit 0960dc0d5bf4f8e4c432a67a995104584bc1c940 Author: John Baldwin AuthorDate: 2025-01-16 15:51:44 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 BUS_HINTED_CHILD.9: New manpage to document this bus method Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D48366 (cherry picked from commit 4276dfa8c4b9e75ab29f2c53a7af36c2f77ab563) --- share/man/man9/BUS_HINTED_CHILD.9 | 36 ++++++++++++++++++++++++++++++++++++ share/man/man9/Makefile | 1 + 2 files changed, 37 insertions(+) diff --git a/share/man/man9/BUS_HINTED_CHILD.9 b/share/man/man9/BUS_HINTED_CHILD.9 new file mode 100644 index 000000000000..699bb06e8dd8 --- /dev/null +++ b/share/man/man9/BUS_HINTED_CHILD.9 @@ -0,0 +1,36 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 John Baldwin +.Dd January 6, 2025 +.Dt BUS_HINTED_CHILD 9 +.Os +.Sh NAME +.Nm BUS_HINTED_CHILD +.Nd notify a bus device about a potential child device identified by hints +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_HINTED_CHILD "device_t dev" "const char *dname" "int dunit" +.Sh DESCRIPTION +The +.Fn BUS_HINTED_CHILD +method is invoked by the +.Xr bus_enumerate_hinted_children 9 +function for each set of named hints whose +.Dq at +hint matches the bus device +.Fa dev . +Typically, this method should determine if the set of hints for the given +device name and unit sufficiently describe a new device. +If so, a new device should be added via +.Xr BUS_ADD_CHILD 9 . +.Sh SEE ALSO +.Xr BUS_ADD_CHILD 9 , +.Xr device 9 +.Sh HISTORY +The +.Fn BUS_HINTED_CHILD +method first appeared in +.Fx 6.2 . diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index fdfdb2e888d9..7d06be6eb6a0 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -47,6 +47,7 @@ MAN= accept_filter.9 \ BUS_GET_CPUS.9 \ BUS_GET_PROPERTY.9 \ bus_get_resource.9 \ + BUS_HINTED_CHILD.9 \ bus_map_resource.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ From nobody Mon Mar 3 16:57:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jW2hpWz5pnXk; Mon, 03 Mar 2025 16:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z64jW14Hsz46CM; Mon, 03 Mar 2025 16:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EYmd5y21u9PBNs9JNBNGVL0oItb1LxnIB9X31jJzdkw=; b=od2TpPit2Y7CYDJoXEAyjRk9xT67Rolt4cGNbAohezE5QgCC8YYcUFm4axgXrh4Z7Tm/EA lcNG/bq8Dnrj9OKik8UkIoQX+6gLwNoaqvAGZAj0cZK0OijTSsXwdNGW3bcYqF/sRyb3xZ 5osnUN6jjmxVgwAe4gsCl+k7wgH1EHKik99o3nSOVOMNoWIRcKW7Ks15b7PvCTYuQv3YLZ Vptq3YGP7FhcSOiVPs9yxJqmupWlzh7fDyPLGkwTFc+WYpVy8UjemEtEzIoadyfjm1xVqN q3K2B3xm3CYfc97dbJDlt4xOo5OHGdYIHUh5ru24ehCduRTNMzDciwnca7CYKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021023; a=rsa-sha256; cv=none; b=ThDXMKyP4b0P89LM21bRuKsUseu9QUW5B8OJtGc7IzGJVLHEEGWZ2CMGwWbkQGUg1nUMAB lP6j9XgNrdJ9dR742pfrGODgX92dK0yRoN60zH280pryBdp6zc1gocKNXm7zGLSBwkc9I8 whmeuZ2Rj5NmjsJQ/AOZaUY4g9YnsOOm69sLs6f97OPJhjIVrstgqB+ERGbHs+Z7rtuGDb 0i8ozhtpIyWQi9IG8nep5E0cdkX5vRA8YWlOSCMdylYhMLHzg6Yi7fzG85Kp/xgB4C0bNF LsArejIvoutuPhUz/2z9UJrEO41tDZC7UVqp9CmWxfrnaGVHq/NdWnffZyX7eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EYmd5y21u9PBNs9JNBNGVL0oItb1LxnIB9X31jJzdkw=; b=sqMlfcOVAn20psIHFDLxLZx5uAT8bIqZwE6XfIOj1zwNI2uhftHqA4iN5t+75iiTu9wd7S p83PPaX8aJiDF5c63It58kwxbPep2cj8Xk86CcBNSn1fWy/RhBpQV1RJTvD8UQTN7ZVzga d04oLtEWE2RmlaiPgQctkUZ/90U1FTjh7jQAiycSDcR8LMtIqjXzbhfZ81eEXOeEG/Zy4C u5wUf8i1Jeey9kY5NseZIeALpOgaRObl+8NXrkXCsAgwzy86hsVwP3JHFKfupS8qOApj8m dPg5R4w7bwhFjcx6HpuU1fVi3SBczeLcM4mBLTSEGVKo7mMrJgh3QGPHZXwEtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jV6tRpzwnv; Mon, 03 Mar 2025 16:57: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 523Gv2RK083835; Mon, 3 Mar 2025 16:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gv2w6083832; Mon, 3 Mar 2025 16:57:02 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:57:02 GMT Message-Id: <202503031657.523Gv2w6083832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4be4d213f065 - stable/14 - bus_generic_print_child.9: Add bus_print_child_{header,footer} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4be4d213f065968c30bec62a2c9ad57710732afd Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4be4d213f065968c30bec62a2c9ad57710732afd commit 4be4d213f065968c30bec62a2c9ad57710732afd Author: John Baldwin AuthorDate: 2025-01-16 15:55:02 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:20 +0000 bus_generic_print_child.9: Add bus_print_child_{header,footer} These functions are already described in the body, just add them in the NAME and SYNOPSIS sections along with MLINKS. Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D48370 (cherry picked from commit 2759653c8523f279cf0715d5cf641d2e029b6614) --- share/man/man9/Makefile | 2 ++ share/man/man9/bus_generic_print_child.9 | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 7d06be6eb6a0..5263f231b929 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -691,6 +691,8 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dmamem_free.9 \ bus_dma.9 bus_dma_tag_create.9 \ bus_dma.9 bus_dma_tag_destroy.9 +MLINKS+=bus_generic_print_child.9 bus_print_child_footer.9 \ + bus_generic_print_child.9 bus_print_child_header.9 MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9 MLINKS+=BUS_GET_CPUS.9 bus_get_cpus.9 MLINKS+=bus_map_resource.9 bus_unmap_resource.9 \ diff --git a/share/man/man9/bus_generic_print_child.9 b/share/man/man9/bus_generic_print_child.9 index 8c3bd4b0fc71..1adca331b016 100644 --- a/share/man/man9/bus_generic_print_child.9 +++ b/share/man/man9/bus_generic_print_child.9 @@ -26,11 +26,13 @@ .\" (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 January 15, 2017 +.Dd January 16, 2025 .Dt BUS_GENERIC_PRINT_CHILD 9 .Os .Sh NAME -.Nm bus_generic_print_child +.Nm bus_generic_print_child , +.Nm bus_print_child_footer , +.Nm bus_print_child_header .Nd generic implementation of .Dv DEVICE_PRINT_CHILD for buses @@ -39,6 +41,10 @@ for buses .In sys/bus.h .Ft int .Fn bus_generic_print_child "device_t dev" "device_t child" +.Ft int +.Fn bus_print_child_footer "device_t dev" "device_t child" +.Ft int +.Fn bus_print_child_header "device_t dev" "device_t child" .Sh DESCRIPTION This implementation prints out the default device announcement message. Given device 'foo0' on bus 'bar0' where foo0 has the name "FooCard 1234" the From nobody Mon Mar 3 16:57:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jY065Bz5pnPm; Mon, 03 Mar 2025 16:57: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 4Z64jX1Nkfz46W4; Mon, 03 Mar 2025 16:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ojit7FG3vU7YeBPutFSThyNwfI2iisEJ7zRwUCkXJJY=; b=x33LOdQXwzcibNIauSHWOrDRI5/vUVjKQmEGZK2TYxbfqLABiPd3AgSciJ9DKDv8utKCad tRbmoc7Yt9z9411IvojeVmK0UgPT4XH6fkkupGyyLGXtBkXGf017gOQhCpvPuZ4oro3yGP mJ1g1RsibZOcheC98AHC/YViySppZ9CWF4zlYJ6Fgbi1WZhpJrbukzBdYHCXpJYfhxAcSN 7eAncJ6o4Kk5r2UUlso1Tt8O2tQ+51khYoxCG1KqHaL2vMvBkBzZ6/94oId/cqmGAT7nd5 aNIueRiePwO2HPbji//sVU4hmXDpfkA1ImrpnNvZ5+s+z67IpQ91BMM3zwIbPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021024; a=rsa-sha256; cv=none; b=NV3kMasJpZLtHdsZsc1c1+yEKf1eOs3GPnUWZjQ5bxjrYo0u1a1cBy+0PCara5Fh4Zc/gB nrQXbhMG67ALJhhhxaI0Gf5P6mUl+iDauKkNUSC+qVmFuPwNh9BXs6gCDz223WrHvC8QyS LTf5EmXeZex3GVEOljpcPabW+YSqusN98+0OTiGwqvJlO2RSjkYJ21bIsLzuM+lTXbYtoA KKuirDDjJpy6zDxcMrwWyoOXoDOdxPfjlp7tmeP428VD1XzeAVd+SosFOmD4m2B0bjvi8J 34WJG/oqSIX4TU9wrPL5RVIbxRXvKZRJelRmwy+nDv5cMVJUw57E/qglh2XAyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ojit7FG3vU7YeBPutFSThyNwfI2iisEJ7zRwUCkXJJY=; b=mi8RVaENoAoLrErY/ZGAudq9xU1DcMyA0ual9rBr3mC5NsCU0ObEkWmcnqWeb6XzjNtRVb +GnNEceN3bv008ggMrGXRIOnVUGLA7bBXr6MYwTKOPsJZuud8MTT0q5Ds3UPZzQqWLIOsI YOghZ6wXC6Ns/oT1dWl6FFV2evujzZE98P6F6nRthJtoIoIl6wMpkPfTWcsNye15iBeMR5 1j4q/jLBWsnCfZY2cdMz21RGISUiNSe924M40+W6DWKAJaJAkr+MozRFXi7JhLnRb2IFWM gNV934O1kclBRn26WvMukQfCvRy1QLzaqyIKQbUODmzGyngP7Hq2shb5tKMQ6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jX0llHzwc9; Mon, 03 Mar 2025 16:57: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 523Gv4op083872; Mon, 3 Mar 2025 16:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gv3HO083869; Mon, 3 Mar 2025 16:57:03 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:57:03 GMT Message-Id: <202503031657.523Gv3HO083869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7e58d899fd93 - stable/14 - BUS_CONFIG_INTR.9: Describe bus_config_intr() wrapper function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e58d899fd93ca35facffa8d22bf14dc71c6e05e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7e58d899fd93ca35facffa8d22bf14dc71c6e05e commit 7e58d899fd93ca35facffa8d22bf14dc71c6e05e Author: John Baldwin AuthorDate: 2025-01-16 15:55:20 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:21 +0000 BUS_CONFIG_INTR.9: Describe bus_config_intr() wrapper function Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D48372 (cherry picked from commit e2012b81cb87793be589cffa0a89d9b230df7c93) --- share/man/man9/BUS_CONFIG_INTR.9 | 16 +++++++++++++--- share/man/man9/Makefile | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/share/man/man9/BUS_CONFIG_INTR.9 b/share/man/man9/BUS_CONFIG_INTR.9 index cf6ecbb4b823..aaeb6c3ec089 100644 --- a/share/man/man9/BUS_CONFIG_INTR.9 +++ b/share/man/man9/BUS_CONFIG_INTR.9 @@ -23,12 +23,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 15, 2017 +.Dd January 16, 2025 .Dt BUS_CONFIG_INTR 9 .Os .\" .Sh NAME -.Nm BUS_CONFIG_INTR +.Nm BUS_CONFIG_INTR , +.Nm bus_config_intr .Nd "configure interrupt polarity and trigger mode" .\" .Sh SYNOPSIS @@ -36,9 +37,13 @@ .In sys/bus.h .Ft int .Fo BUS_CONFIG_INTR +.Fa "device_t bus" "device_t dev" "int irq" "enum intr_trigger trig" +.Fa "enum intr_polarity pol" +.Fc +.Ft int +.Fo bus_config_intr .Fa "device_t dev" "int irq" "enum intr_trigger trig" "enum intr_polarity pol" .Fc -.\" .Sh DESCRIPTION The .Fn BUS_CONFIG_INTR @@ -53,6 +58,11 @@ that it is called prior to .Xr BUS_SETUP_INTR 9 . .Pp The +.Fn bus_config_intr +function is a simple wrapper around +.Fn BUS_CONFIG_INTR . +.Pp +The .Fa trig argument can be one of: .Bl -tag -width ".Dv INTR_TRIGGER_CONFORM" diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 5263f231b929..b4adf70ae2aa 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -673,6 +673,7 @@ MLINKS+=buf_ring.9 buf_ring_alloc.9 \ MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9 MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9 MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9 +MLINKS+=BUS_CONFIG_INTR.9 bus_config_intr.9 MLINKS+=BUS_DESCRIBE_INTR.9 bus_describe_intr.9 MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dmamap_create.9 \ From nobody Mon Mar 3 16:57:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jZ2XMVz5pnRs; Mon, 03 Mar 2025 16:57: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 4Z64jY2x1gz46Lb; Mon, 03 Mar 2025 16:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qp9c9IYCPiijEJT/wQepaRuAlUR38c6GmkQ8Wzoaxc=; b=fxvu7ijKkJjHp/A47GCWsCCdTjiQVTSyZweN9RIGYAyG8YxHD4fRkAMnwbfw6J8o2hx3sK HUFIA1YnP91Tb1oBkdg7+URgqFAaYVVOKHvHhRcXMXM9pn62C9zFJ07d0WrOOYbw05sjwh DcCVUzio9gX6uILlS+7twMXlroeoG8H7/hBrXkoKLl8xQobOgGor2gW4bpmritAhcNGAev rPR7XyuSuJv7HsB0V8gUDq3f1fIsecMSMNJZWZRUc3SDq2sXA1D2uum1Tpifs9qWNbZBaK 6V8xYK+931gpSQYDR8Cv+RG8sf/DIZ1b9jCdHUcCMuK5kosE80m4IO1+6khcNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021025; a=rsa-sha256; cv=none; b=W+NRAS1jz8o9E0e3BEw1jqgYCo9HUqbjS9kF/VCqj71A52r/o0suwqZ7RmROzVXgFgwJnk eAvbvQ1vx4PluM7G4cplw2qFV3hbV85fXo85boVOAhqMmIV+f/XVXWMygrMP4d0tHSpiHL RVlyHv//tsHPlGaRO3wayc36exJK+7bXGFaLAHuyU4wXZe8W7LcHXNGSHZwfBl/gx8kS0J ntApgnMTeqeymKfrjtbPfJKvab3AaQFlzCCur41Y8jyJfxXHQq6NBokzxK6nSMPmVRNu4V Z5cwMa/TcmvgS1MNmAnRKiwRG5imUtKgEmcKBrlgMOJEkHDKGrPnJ+gjc+9HoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qp9c9IYCPiijEJT/wQepaRuAlUR38c6GmkQ8Wzoaxc=; b=BtJyqKpM3wrq+drqxh4bX2w37R/bZBJm8p+Z30mIZw1nu0szu1u9q4S898w+Xsp2aoAiqF XwmhpJ2dxVXU8B2gOLNo5BKB9lkekYEOeeBq7sA+l1Fo4OYfE3eh1KhKtb5jEjbBT7Cz50 fuMGFGDXlzuwDpm6je/AJ0IhWg5ys0puyW2Od0xk6pVJ37/yYnOd3nFtGF+JjnP2Wa49L7 gINBddyS9FDqwGS4SCJSw+7fr9D+GD6ok3vdNkV3ev9IrGzVhCM9fEj7wixncJZ6oN0ClT NUsC64MVxzzIYTuIM36q1cSwVHOCDrIiogauawqCN0iPD4A6iEiqko5ora3+QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jY1hwzzwZd; Mon, 03 Mar 2025 16:57: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 523Gv5YA083909; Mon, 3 Mar 2025 16:57:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gv5Nj083906; Mon, 3 Mar 2025 16:57:05 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:57:05 GMT Message-Id: <202503031657.523Gv5Nj083906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 858f3ef5a0cb - stable/14 - device_probe_and_attach.9: Document more device functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 858f3ef5a0cb66b9f8c7ac5df7de9b0851fe57ce Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=858f3ef5a0cb66b9f8c7ac5df7de9b0851fe57ce commit 858f3ef5a0cb66b9f8c7ac5df7de9b0851fe57ce Author: John Baldwin AuthorDate: 2025-02-05 19:44:57 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:21 +0000 device_probe_and_attach.9: Document more device functions Split out separate descriptions of device_probe and device_attach and include extra details (such as the effect of a disabled hint during device_attach). Reframe device_probe_and_attach as a recommended wrapper function around device_probe and device_attach. While here, add a description of device_detach. Differential Revision: https://reviews.freebsd.org/D48364 (cherry picked from commit d7fa71dfedd6db18ded3971c6f42b3699b5627d7) --- share/man/man9/Makefile | 3 + share/man/man9/device_probe_and_attach.9 | 128 ++++++++++++++++++++++++++++--- 2 files changed, 120 insertions(+), 11 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index b4adf70ae2aa..6a8f9a9f5622 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1043,6 +1043,9 @@ MLINKS+=device_set_desc.9 device_get_desc.9 \ device_set_desc.9 device_set_descf.9 \ device_set_desc.9 device_set_desc_copy.9 MLINKS+=device_set_flags.9 device_get_flags.9 +MLINKS+=device_probe_and_attach.9 device_attach.9 \ + device_probe_and_attach.9 device_detach.9 \ + device_probe_and_attach.9 device_probe.9 MLINKS+=devstat.9 devicestat.9 \ devstat.9 devstat_new_entry.9 \ devstat.9 devstat_end_transaction.9 \ diff --git a/share/man/man9/device_probe_and_attach.9 b/share/man/man9/device_probe_and_attach.9 index 5d5de52cee66..0c438be3a483 100644 --- a/share/man/man9/device_probe_and_attach.9 +++ b/share/man/man9/device_probe_and_attach.9 @@ -26,33 +26,139 @@ .\" (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 16, 1998 +.Dd February 5, 2025 .Dt DEVICE_PROBE_AND_ATTACH 9 .Os .Sh NAME +.Nm device_attach , +.Nm device_detach , +.Nm device_probe , .Nm device_probe_and_attach -.Nd initialise a device +.Nd manage device's connection to a device driver .Sh SYNOPSIS .In sys/param.h .In sys/bus.h .Ft int +.Fn device_attach "device_t dev" +.Ft int +.Fn device_detach "device_t dev" +.Ft int +.Fn device_probe "device_t dev" +.Ft int .Fn device_probe_and_attach "device_t dev" .Sh DESCRIPTION -This function is called during autoconfiguration to initialise the -devices in the system. -For each device, the +These functions manage the relationship between a device and device drivers. +.Pp +.Fn device_probe +invokes the .Xr DEVICE_PROBE 9 -method of each suitable driver is called and if a probe succeeds, a -description of the device is printed and the +method of each suitable driver and to find the driver with the best match for +.Fa dev . +If a matching driver is found, +.Fa dev +is set to the +.Dv DS_ALIVE +state and zero is returned. +If +.Fa dev +is already attached to a device driver or has been disabled via +.Xr device_disable 9 , +then it will not be probed and -1 is returned. +.Pp +.Fn device_attach +fully attaches a device driver to +.Fa dev . +This function prints a description of the device and invokes the +.Xr DEVICE_ATTACH 9 +method. +If the +.Xr DEVICE_ATTACH 9 +method succeeds, +.Fa dev +is set to the +.Dv DS_ATTACHED +state and zero is returned. +If the .Xr DEVICE_ATTACH 9 -method is called. -If the device is disabled using -.Xr device_disable 9 -then it will not be probed. +method fails, +.Xr BUS_CHILD_DETACHED 9 +is called and an error value is returned. +.Pp +If the device name and unit are disabled by a hint, +.Fn device_attach +disables the device, demotes it to the +.Dv DS_NOTPRESENT +state, +and returns +.Dv ENXIO . +The device retains its device name and unit and can be re-enabled via +.Xr devctl 8 . +.Pp +.Fn device_probe_and_attach +is a wrapper function around +.Fn device_probe +and +.Fn device_attach +that fully initialises a device. +If +.Fa dev +is already attached or disabled, +.Fn device_probe_and_attach +leaves the device unchanged and returns zero. +Otherwise, +.Fn device_probe +is used to identify a device driver for +.Fa dev +and +.Fn device_attach +finalizes attaching the driver to +.Fa dev . +Device drivers should generally use this function to initialize a device +rather than direct calls to +.Fn device_probe +and +.Fn device_attach . +.Pp +.Fn device_detach +detaches the device driver from +.Fa dev . +This function invokes the +.Xr DEVICE_DETACH 9 +method to tear down device driver state for +.Fa dev . +If the method fails, +its error value is returned and +.Fa dev +remains attached. +If the method succeeds, +otherwise, +.Xr BUS_CHILD_DETACHED 9 +is called, +the device is set to the +.Dv DS_NOTPRESENT +state, +and zero is returned. +If a device is busy, +.Fn device_detach +fails with +.Dv EBUSY +and leaving +.Fa dev +unchanged. .Sh RETURN VALUES Zero is returned on success, otherwise an appropriate error is returned. +In addition, +.Fn device_probe +returns -1 if +.Fa dev +is disabled or already attached. .Sh SEE ALSO +.Xr devctl 8 , +.Xr BUS_CHILD_DETACHED 9 , .Xr device 9 , +.Xr DEVICE_ATTACH 9 , +.Xr DEVICE_DETACH 9 , +.Xr DEVICE_PROBE 9 , .Xr driver 9 .Sh AUTHORS This manual page was written by From nobody Mon Mar 3 16:57:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jc3j3Qz5pn7j; Mon, 03 Mar 2025 16:57:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z64jb4kmcz46Tk; Mon, 03 Mar 2025 16:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yFckkXVP4nk9VJuK87IC5u54a/RLmtbWcxNio1ZyJ0U=; b=sEX/cl4cc/OHjL2WvSy/919/CqvwSR3FWc8ZkEkCBXBNKjIWwUyJ8daXeah0+tm4WvlaWt XueXxFbtD4Hw9lXCcQKs0FGsqs0aiDv65vTcsj6RSZqczdLBExNo4MPpAPEU9zcu+NcVBN n8698umKpDJyr7EW/puM04y8v7jG21E4/1gmLM52WdGwk2kw4vBLbg2sjEK3ZIISsHzHRm a+gr/nUVb5z1jUpDzzJX3ht3jsMYpoY/Kk89j8gAOnqRUlNGrvPYhsmWw4oGQlvavivCin eNUGhzDx5dxgIp7YMECbBkkS87Kwjuhj2nJl2z2clCw4gnvTdvqETp8QQQiQYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021027; a=rsa-sha256; cv=none; b=cxuDlp2b9W9Fu6CxMmmzNKKPTb2zqna9molUrmLL9dIylXYHn1lqcUxa9fz113JNsh+drL fmSFeDpziZRwSuFzLBJ44OCt1MFn9Rw4iuere8tJh2Un7BO++YSEOm+yqHiRJMcIN2Guyo MbXdoOifG4GJUreu58Hirj1axv2jC8EFXaa3BL+M3DNnviBLnDWjVvcEWk7Rh8NqyblXk5 NcSzwmlfXFjOc/+1n2g/BfJG8xkqhwX4Q0uU/zxdH2/90j5Dsxeezz48YLlw4JVQ8Ha/F0 JI1aObemMaw1Ff563arSohUrlVsNClkwd1ADbqhs1MNL//z3eFkvHYJj55sByQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yFckkXVP4nk9VJuK87IC5u54a/RLmtbWcxNio1ZyJ0U=; b=n03Fbl58QsIgFJyjhAJEGusGGMFbViOu/hUepfEORDqwaNYfNyu5JcKHx1ffbAaiPtVcaY bJXNX2EJ39Dkf6iEHCAiPQwsZr9/TJbmK72E502pY40wU0apbJKEZCrRhWLVIxBL9h/Gq4 rRRQyeadwk41ojEba95bncNaACg4Fh713RsP/V0x2c21+vSw01T+rEPjeCD45leIxa29hH 0jl5BZnnF9V/2/gvwPTgL4gnZFbuKkCZDXrCpWsOIkHnIp8sonCEit7F0YUkVPPTE6TUM/ TtUd8ta2mrkK2A9oC9KPD7QPXE9lBI+yra3UMdUi/i7z8iUX+DILKQSzaurPVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jb3S4YzwL3; Mon, 03 Mar 2025 16:57: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 523Gv771083975; Mon, 3 Mar 2025 16:57:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gv7dt083972; Mon, 3 Mar 2025 16:57:07 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:57:07 GMT Message-Id: <202503031657.523Gv7dt083972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: df124faf6656 - stable/14 - bus_generic_print_child.9: Document bus_print_domain List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: df124faf665685ee5049fa044cf0f07f2a9d340c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df124faf665685ee5049fa044cf0f07f2a9d340c commit df124faf665685ee5049fa044cf0f07f2a9d340c Author: John Baldwin AuthorDate: 2025-02-05 19:49:01 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:21 +0000 bus_generic_print_child.9: Document bus_print_domain While here, cross-reference BUS_PRINT_CHILD (and fix a stale reference to DEVICE_PRINT_CHILD which doesn't exist) and expand the text describing the role of the helper functions. Differential Revision: https://reviews.freebsd.org/D48373 (cherry picked from commit 36ecb25e6158f16356938432defd9f9df67a1366) --- share/man/man9/Makefile | 3 +- share/man/man9/bus_generic_print_child.9 | 69 ++++++++++++++++++++++++++------ 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 6a8f9a9f5622..3ee1d2bb0108 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -692,7 +692,8 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dmamem_free.9 \ bus_dma.9 bus_dma_tag_create.9 \ bus_dma.9 bus_dma_tag_destroy.9 -MLINKS+=bus_generic_print_child.9 bus_print_child_footer.9 \ +MLINKS+=bus_generic_print_child.9 bus_print_child_domain.9 \ + bus_generic_print_child.9 bus_print_child_footer.9 \ bus_generic_print_child.9 bus_print_child_header.9 MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9 MLINKS+=BUS_GET_CPUS.9 bus_get_cpus.9 diff --git a/share/man/man9/bus_generic_print_child.9 b/share/man/man9/bus_generic_print_child.9 index 1adca331b016..8a72c8e743ec 100644 --- a/share/man/man9/bus_generic_print_child.9 +++ b/share/man/man9/bus_generic_print_child.9 @@ -26,43 +26,88 @@ .\" (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 January 16, 2025 +.Dd February 5, 2025 .Dt BUS_GENERIC_PRINT_CHILD 9 .Os .Sh NAME .Nm bus_generic_print_child , +.Nm bus_print_child_domain , .Nm bus_print_child_footer , .Nm bus_print_child_header .Nd generic implementation of -.Dv DEVICE_PRINT_CHILD -for buses +.Xr BUS_PRINT_CHILD 9 .Sh SYNOPSIS .In sys/param.h .In sys/bus.h .Ft int .Fn bus_generic_print_child "device_t dev" "device_t child" .Ft int +.Fn bus_print_child_domain "device_t dev" "device_t child" +.Ft int .Fn bus_print_child_footer "device_t dev" "device_t child" .Ft int .Fn bus_print_child_header "device_t dev" "device_t child" .Sh DESCRIPTION -This implementation prints out the default device announcement message. -Given device 'foo0' on bus 'bar0' where foo0 has the name "FooCard 1234" the +.Fn bus_generic_print_child +prints out the default device announcement message. +Given device +.Sq foo0 +on bus +.Sq bar0 +where foo0 has the description +.Dq FooCard 1234 +and is associated with the NUMA domain 1, +the following would be printed: +.Bd -literal -offset indent +foo0: numa-domain 1 on bar0 +.Ed .Pp -foo0: on bar0 -.Pp -bus_generic_print_child itself calls two functions -.Fn bus_print_child_header +.Fn bus_generic_print_child +calls the three helper functions +.Fn bus_print_child_header , +.Fn bus_print_child_domain , and .Fn bus_print_child_footer . -The former prints "foo0: " and the latter "on bar0". -These routines should be used if possible in your own code if +.Pp +.Fn bus_print_child_header +outputs the device name and unit followed by the device description +in angle brackets +.Po +.Dq foo0: +.Pc . +.Pp +.Fn bus_print_child_domain +outputs +.Dq \& numa-domain +followed by the domain number if +.Fn bus_get_domain +returns a valid domain for the device +.Po +.Dq numa-domain 1 +.Pc . +If +.Fa dev +is not associated witha valid domain, +nothing is output. +.Pp +.Fn bus_print_child_footer +outputs the string +.Dq \& on +followed by the parent device's name and unit +.Po +.Dq \& on bar0 +.Pc . +.Pp +These functions can be used to implement +.Xr BUS_PRINT_CHILD 9 +in a bus driver if .Fn bus_generic_print_child -does not completely suit your needs. +is not sufficient. .Sh RETURN VALUES The number of characters output. .Sh SEE ALSO +.Xr BUS_PRINT_CHILD 9 , .Xr device 9 .Sh AUTHORS This manual page was written by From nobody Mon Mar 3 16:57:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z64jZ6gSbz5pnXq; Mon, 03 Mar 2025 16:57: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 4Z64jZ3PWLz46J8; Mon, 03 Mar 2025 16:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldI8jR9Awq/9qaf+sTSwjX9fi+y21cceBDAvXNogqWE=; b=GlPfdq3ALaRzJqT3HYiZiTpk19dgqnKN0SjG6WWq+pd7naNKuI/ioGo2fewSWOorojPf69 gC/PJkzPfzqRZ8En//CIOb6oezzHHUf2BKnDDV4ZSJ9huyFNCS9jLmmBGxcrTGMI7EZ0mt sz3RCtu/BjFt3VuJnkc2685xDr5vGlJPK3Wgzx2A+7jQ/+MOjsxYTmC0uF2BPmBiJoEvhk fJeZsSqRt4w/twZ5O84SfXxgncMalhVCNn5iOzgqJDuXS3AoIkYBg9W62rforjMaxLeIRh ZvaJPO3U3nlyD+hDo6j2mM8D7fH1hoK8frwyngU9giDn02TBmNO2zBhnf44tOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741021026; a=rsa-sha256; cv=none; b=JPfrQE6/Lz1i9ZsQrk5VUjwm6Rf3jR+rGGwYKnpjgcqPXk03I2ohdJBef9rye71v6fGGDq KFZda+YPivHm56JDcGQhz6qO8mTyYUREf2tuTdzQcULgjE/6Qsy/74JavyBhWG/Df/85U4 JMPSOdYoNdh5u1L3+MO0vhXBGBpcNvTaF4TBFkh2u20QNZKKgkoHDzBSpf58sxF5csusvw dCoAqIlDgOXA6ThCChqcxlnd/4x1349532MH0Bzp1PeCX6F1kVpHUBXnS90a8Q4Fgk9v2K 0BfMOq3x1W5hOpmHcgero95So6Mch8uP+6gSvwyad20YfmYNIzWUKGK4Mirz3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741021026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldI8jR9Awq/9qaf+sTSwjX9fi+y21cceBDAvXNogqWE=; b=SvfGuMncspK6iOKjVukjDYk6Z+HSzKW4R8IC+GlN6d/Vip+2BbLFsRwWi2M7qc1AOdNjCh JmYduXC6dT8F7mWq1FBttImHs5A2FO6JumLI8h2DIkJ2A8SSLk+m5Q2Fht8DoZTCiFCu9P TOy3+SXbLrTd98X8mUyfafX3Zx3jjS2a80soliM7MSoSVhyn+1zG6WAahFqtJK3d2+bbTn MKbycjClJm5X8bADDruAT3DXTVmjQ/Nu2TgUh41ke7MuyHSLT782JGUrmVxFjn5pEhFMPC CVVFnLIZoJf5XqKEV+yrcFxdBtGnw5R2Yuo82i23e6uuttYZj/YiGjGACYpTuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z64jZ2S5KzwcB; Mon, 03 Mar 2025 16:57: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 523Gv6jU083942; Mon, 3 Mar 2025 16:57:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Gv6Dg083939; Mon, 3 Mar 2025 16:57:06 GMT (envelope-from git) Date: Mon, 3 Mar 2025 16:57:06 GMT Message-Id: <202503031657.523Gv6Dg083939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d2c8377a80ad - stable/14 - device_delete_child.9: Reference device_detach.9 and BUS_CHILD_DELETED.9 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2c8377a80ad955eb85bbfd760a327d0ed38a7e5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c8377a80ad955eb85bbfd760a327d0ed38a7e5 commit d2c8377a80ad955eb85bbfd760a327d0ed38a7e5 Author: John Baldwin AuthorDate: 2025-02-05 19:45:54 +0000 Commit: John Baldwin CommitDate: 2025-03-03 16:56:21 +0000 device_delete_child.9: Reference device_detach.9 and BUS_CHILD_DELETED.9 Refer to device_detach(9) for the description of detaching a device. Note that descendants of the child device are also deleted (though in theory a proper detach routine should have already deleted these). Finally, note that BUS_CHILD_DELETED(9) is invoked on each deleted device. Differential Revision: https://reviews.freebsd.org/D48365 (cherry picked from commit 3f93f96c26e51a42822c61e73252f4aeb6bb303a) --- share/man/man9/device_delete_child.9 | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/share/man/man9/device_delete_child.9 b/share/man/man9/device_delete_child.9 index f6c08cb52e16..819c7f5e36b9 100644 --- a/share/man/man9/device_delete_child.9 +++ b/share/man/man9/device_delete_child.9 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 16, 1998 +.Dd February 5, 2025 .Dt DEVICE_DELETE_CHILD 9 .Os .Sh NAME @@ -41,13 +41,26 @@ The specified device is removed from .Fa dev and deleted. -If the device is currently attached, it is first detached (see -.Xr DEVICE_ATTACH 9 -and -.Xr DEVICE_DETACH 9 ) . +If the device is currently attached, it is first detached via +.Xr device_detach 9 . +If +.Fn device_detach +fails, +its error value is returned. +Otherwise, +all descendant devices of +.Fa child +are deleted and zero is returned. +.Pp +The +.Xr BUS_CHILD_DELETED 9 +method is invoked for each device that is deleted. +This permits the parent device's driver to tear down any state associated +with child devices such as ivars. .Sh RETURN VALUES Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO +.Xr BUS_CHILD_DELETED 9 , .Xr device_add_child 9 .Sh AUTHORS This manual page was written by From nobody Mon Mar 3 19:00:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z67SJ1FlBz5qDZ1; Mon, 03 Mar 2025 19:00: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 4Z67SH355Lz3Qww; Mon, 03 Mar 2025 19:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741028447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P5pj82ueB9zJC0xp/0ucTxBjvm9W6M9bkMGr3Axj2dQ=; b=YwHUI3iySNzkd8hkhSRA9LNMPLshntx/DIpvyyN62P2NQgI9lghOmczadKWGWtsHitpnQO j+yI+QVTzbVWynObda8Qf3DgH5vYXQTUZpqTsrKgXRTRo/+kLBe2si19ZJqJFgUiebGcEO IMQ10ZVX4a2C47/yVtVF84zecAaWVXLLcraqvDMGTuxJg9UbBSQCGUWEdki5vJekjLuscH CIIZXbtA0x70FnXtXRK2ZI0rrYMjNbZfy6hw+9yUzTMQPUOG506Yq7Zd7fF1Z9MqwiRnGc 29k8rSKVkJy43qa2s/J69vkGwq0uz0GjLoc8K2fCDYJFP2gZUlWi7xVM4kpTkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741028447; a=rsa-sha256; cv=none; b=KA55xMYPcKxRgDofIMqu541VHy5QcrnibU5QYSIUEdmf3NHXL7sM1+PM0AF1wkDHjV2P9A MUiEqd7LsxmUZmVppRu1SqLQRxm6o7BlInmjer96YXi7M0O10NWCIVhRfQ2rHJkMwCMaMb GpgoMDPTWb6f3ulUfjm06QAyowLf72iH1B7X+DUMGQGWaIL4QLoMNQcD7NHGPbkzdwjvdt 0E5+yoBjyZooDt1MbnjTN47SYUOIcxTsJvEKopWMTNft3hJZM52WXzSjFVP3CveNF+6h79 d/r1ob4LHoTA1evwE1aS9MCPy+/nIZESOHQt2nIzohpGj+s0yqNg4G3P1N++Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741028447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P5pj82ueB9zJC0xp/0ucTxBjvm9W6M9bkMGr3Axj2dQ=; b=aVHpw7W6zhnHjC3JZBNonR6h2KtvQi2vs6SqVtZxE8yr/Gz4WuxGq+cJF8RxEmz8EDb5/p O8dkhtXhxMkA6Ln9pf10/VZZdXjBCZr+gp5uEu1A6XSCDUyr9a4fswDsAWXVHd1s4BEEqT /YvjbxMStXLE7bui76eJopmJpGVtLfcjlL73JUkNSFMnu/JrFuL010gYC5L8e/tAunnQov +wW/YX+TbYTDUIpxuGVquOpwe+kKM+zizOQm0TraC8joV49VxFya1FcFN3l4IBuCXsWfWI dJw7ewnSW9TP/GSGHqXTbEaq8I5+Ng1eQfRgPug1ti9aR5NWxrLeb3fK31ftbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z67SH2ckmz10cV; Mon, 03 Mar 2025 19:00: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 523J0lQL019672; Mon, 3 Mar 2025 19:00:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523J0lMG019668; Mon, 3 Mar 2025 19:00:47 GMT (envelope-from git) Date: Mon, 3 Mar 2025 19:00:47 GMT Message-Id: <202503031900.523J0lMG019668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 4a77657cbc01 - main - ipfw: migrate ipfw to 32-bit size rule numbers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a77657cbc011ea657ccb079fff6b58b295eccb0 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=4a77657cbc011ea657ccb079fff6b58b295eccb0 commit 4a77657cbc011ea657ccb079fff6b58b295eccb0 Author: Andrey V. Elsukov AuthorDate: 2025-03-03 18:15:17 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-03-03 18:15:17 +0000 ipfw: migrate ipfw to 32-bit size rule numbers This changes ABI due to the changed opcodes and includes the following: * rule numbers and named object indexes converted to 32-bits * all hardcoded maximum rule number was replaced with IPFW_DEFAULT_RULE macro * now it is possible to grow maximum numbers or rules in build time * several opcodes converted to ipfw_insn_u32 to keep rulenum: O_CALL, O_SKIPTO * call stack modified to keep u32 rulenum. The behaviour of O_CALL opcode was changed to avoid possible packets looping. Now when call stack is overflowed or mbuf tag allocation failed, a packet will be dropped instead of skipping to next rule. * 'return' action now have two modes to specify return point: 'next-rulenum' and 'next-rule' * new lookup key added for O_IP_DST_LOOKUP opcode 'lookup rulenum' * several opcodes converted to keep u32 named object indexes in special structure ipfw_insn_kidx * tables related opcodes modified to use two structures: ipfw_insn_kidx and ipfw_insn_table * added ability for table value matching for specific value type in 'table(name,valtype=value)' opcode * dynamic states and eaction code converted to use u32 rulenum and named objects indexes * added insntod() and insntoc() macros to cast to specific ipfw instruction type * default sockopt version was changed to IP_FW3_OPVER=1 * FreeBSD 7-11 rule format support was removed * added ability to generate special rtsock messages via log opcode * added IP_FW_SKIPTO_CACHE sockopt to enable/disable skipto cache. It helps to reduce overhead when many rules are modified in batch. * added ability to keep NAT64LSN states during sets swapping Obtained from: Yandex LLC Relnotes: yes Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D46183 --- sbin/ipfw/ipfw.8 | 18 +- sbin/ipfw/ipfw2.c | 593 +++++--- sbin/ipfw/ipfw2.h | 4 +- sbin/ipfw/nat64lsn.c | 16 + sbin/ipfw/tables.c | 2 +- sbin/route/route.c | 1 + sys/net/route.h | 1 + sys/netinet/ip_fw.h | 227 ++- sys/netinet6/ip_fw_nat64.h | 10 +- sys/netpfil/ipfw/ip_fw2.c | 471 +++--- sys/netpfil/ipfw/ip_fw_compat.c | 714 +++++++++ sys/netpfil/ipfw/ip_fw_dynamic.c | 257 ++-- sys/netpfil/ipfw/ip_fw_eaction.c | 71 +- sys/netpfil/ipfw/ip_fw_iface.c | 10 +- sys/netpfil/ipfw/ip_fw_log.c | 315 +++- sys/netpfil/ipfw/ip_fw_nat.c | 10 +- sys/netpfil/ipfw/ip_fw_private.h | 136 +- sys/netpfil/ipfw/ip_fw_sockopt.c | 2171 ++++++++-------------------- sys/netpfil/ipfw/ip_fw_table.c | 483 ++----- sys/netpfil/ipfw/ip_fw_table.h | 16 +- sys/netpfil/ipfw/ip_fw_table_algo.c | 11 +- sys/netpfil/ipfw/ip_fw_table_value.c | 52 +- sys/netpfil/ipfw/nat64/ip_fw_nat64.h | 48 + sys/netpfil/ipfw/nat64/nat64clat.c | 8 +- sys/netpfil/ipfw/nat64/nat64clat.h | 2 +- sys/netpfil/ipfw/nat64/nat64clat_control.c | 80 +- sys/netpfil/ipfw/nat64/nat64lsn.c | 390 +++-- sys/netpfil/ipfw/nat64/nat64lsn.h | 68 +- sys/netpfil/ipfw/nat64/nat64lsn_control.c | 285 ++-- sys/netpfil/ipfw/nat64/nat64stl.c | 10 +- sys/netpfil/ipfw/nat64/nat64stl.h | 6 +- sys/netpfil/ipfw/nat64/nat64stl_control.c | 76 +- sys/netpfil/ipfw/nptv6/nptv6.c | 49 +- sys/netpfil/ipfw/pmod/tcpmod.c | 6 +- sys/sys/socket.h | 4 +- 35 files changed, 3389 insertions(+), 3232 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index bc78ae1c655b..348e9a58f2ce 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,5 +1,5 @@ .\" -.Dd December 6, 2024 +.Dd March 3, 2025 .Dt IPFW 8 .Os .Sh NAME @@ -40,10 +40,10 @@ in-kernel NAT. .Ss SYSCTL SHORTCUTS .Nm .Cm enable -.Brq Cm firewall | altq | one_pass | debug | verbose | dyn_keepalive +.Brq Cm firewall | altq | one_pass | debug | verbose | dyn_keepalive | skipto_cache .Nm .Cm disable -.Brq Cm firewall | altq | one_pass | debug | verbose | dyn_keepalive +.Brq Cm firewall | altq | one_pass | debug | verbose | dyn_keepalive | skipto_cache .Ss LOOKUP TABLES .Nm .Oo Cm set Ar N Oc Cm table Ar name Cm create Ar create-options @@ -1395,6 +1395,16 @@ Matches any IPv4 or IPv6 address for which an entry exists in the lookup table If an optional 32-bit unsigned .Ar value is also specified, an entry will match only if it has this value. +If +.Ar value +is specified in form +.Ar valtype=value , +then specified value type field will be checked. +It can be +.Ar skipto, pipe, fib, nat, dscp, tag, divert, netgraph, limit, nh4 +and +.Ar mark. + See the .Sx LOOKUP TABLES section below for more information on lookup tables. @@ -1865,7 +1875,7 @@ One or more of source and destination addresses and ports can be specified. .It Cm lookup Bro Cm dst-ip | dst-port | dst-mac | src-ip | src-port | src-mac | uid | -.Cm jail | dscp | mark Brc Ar name +.Cm jail | dscp | mark | rulenum Brc Ar name Search an entry in lookup table .Ar name that matches the field specified as argument. diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index cc0970207749..be796808380f 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -290,6 +290,12 @@ static struct _s_x rule_actions[] = { { NULL, 0 } /* terminator */ }; +static struct _s_x return_types[] = { + { "next-rulenum", RETURN_NEXT_RULENUM }, + { "next-rule", RETURN_NEXT_RULE }, + { NULL, 0 } /* terminator */ +}; + static struct _s_x rule_action_params[] = { { "altq", TOK_ALTQ }, { "log", TOK_LOG }, @@ -300,7 +306,7 @@ static struct _s_x rule_action_params[] = { /* * The 'lookup' instruction accepts one of the following arguments. - * Arguments are passed as v[1] in O_DST_LOOKUP options. + * Arguments are passed as o.arg1 and o->value in O_DST_LOOKUP option. */ static struct _s_x lookup_keys[] = { { "dst-ip", LOOKUP_DST_IP }, @@ -313,9 +319,29 @@ static struct _s_x lookup_keys[] = { { "jail", LOOKUP_JAIL }, { "dscp", LOOKUP_DSCP }, { "mark", LOOKUP_MARK }, + { "rulenum", LOOKUP_RULENUM }, { NULL, 0 }, }; +/* + * table(name,valuename=value) instruction accepts one of the + * following arguments as valuename. + */ +static struct _s_x tvalue_names[] = { + { "tag", TVALUE_TAG }, + { "pipe", TVALUE_PIPE }, + { "divert", TVALUE_DIVERT }, + { "skipto", TVALUE_SKIPTO }, + { "netgraph", TVALUE_NETGRAPH }, + { "fib", TVALUE_FIB }, + { "nat", TVALUE_NAT }, + { "nh4", TVALUE_NH4 }, + { "dscp", TVALUE_DSCP }, + { "limit", TVALUE_LIMIT }, + { "mark", TVALUE_MARK }, + { NULL, 0 } +}; + static struct _s_x rule_options[] = { { "tagged", TOK_TAGGED }, { "uid", TOK_UID }, @@ -415,12 +441,12 @@ static int ipfw_show_config(struct cmdline_opts *co, struct format_opts *fo, static void ipfw_list_tifaces(void); struct tidx; -static uint16_t pack_object(struct tidx *tstate, const char *name, int otype); -static uint16_t pack_table(struct tidx *tstate, const char *name); +static uint32_t pack_object(struct tidx *tstate, const char *name, int otype); +static uint32_t pack_table(struct tidx *tstate, const char *name); -static char *table_search_ctlv(ipfw_obj_ctlv *ctlv, uint16_t idx); +static char *table_search_ctlv(ipfw_obj_ctlv *ctlv, uint32_t idx); static void object_sort_ctlv(ipfw_obj_ctlv *ctlv); -static char *object_search_ctlv(ipfw_obj_ctlv *ctlv, uint16_t idx, +static char *object_search_ctlv(ipfw_obj_ctlv *ctlv, uint32_t idx, uint16_t type); int @@ -650,6 +676,7 @@ do_set3(int optname, ip_fw3_opheader *op3, size_t optlen) { op3->opcode = optname; + op3->version = IP_FW3_OPVER; /* use last version */ if (g_co.debug_only) { struct debug_header dbg = { @@ -690,6 +717,7 @@ do_get3(int optname, ip_fw3_opheader *op3, size_t *optlen) socklen_t len; op3->opcode = optname; + op3->version = IP_FW3_OPVER; /* use last version */ if (g_co.debug_only) { struct debug_header dbg = { @@ -1284,6 +1312,15 @@ print_flags(struct buf_pr *bp, char const *name, const ipfw_insn *cmd, } } +static void +print_tvalue(struct buf_pr *bp, const ipfw_insn_table *cmd) +{ + const char *name; + + name = match_value(tvalue_names, IPFW_TVALUE_TYPE(&cmd->o)); + bprintf(bp, ",%s=%u", name != NULL ? name: "", cmd->value); +} + /* * Print the ip address contained in a command. @@ -1295,33 +1332,46 @@ print_ip(struct buf_pr *bp, const struct format_opts *fo, struct hostent *he = NULL; const struct in_addr *ia; const uint32_t *a = ((const ipfw_insn_u32 *)cmd)->d; - uint32_t len = F_LEN((const ipfw_insn *)cmd); + uint32_t len = F_LEN(&cmd->o); char *t; bprintf(bp, " "); - if (cmd->o.opcode == O_IP_DST_LOOKUP && len > F_INSN_SIZE(ipfw_insn_u32)) { - const char *arg; - - arg = match_value(lookup_keys, a[1]); - t = table_search_ctlv(fo->tstate, - ((const ipfw_insn *)cmd)->arg1); - bprintf(bp, "lookup %s %s", arg, t); - return; - } - if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { + switch (cmd->o.opcode) { + case O_IP_SRC_ME: + case O_IP_DST_ME: bprintf(bp, "me"); return; - } - if (cmd->o.opcode == O_IP_SRC_LOOKUP || - cmd->o.opcode == O_IP_DST_LOOKUP) { + + case O_IP_DST_LOOKUP: + if ((len == F_INSN_SIZE(ipfw_insn_kidx) || + len == F_INSN_SIZE(ipfw_insn_table)) && + IPFW_LOOKUP_TYPE(&cmd->o) != LOOKUP_NONE) { + const char *key; + + key = match_value(lookup_keys, + IPFW_LOOKUP_TYPE(&cmd->o)); + t = table_search_ctlv(fo->tstate, + insntoc(&cmd->o, kidx)->kidx); + if (len == F_INSN_SIZE(ipfw_insn_table)) { + bprintf(bp, "lookup %s:%#x %s", + (key != NULL ? key : ""), + insntoc(&cmd->o, table)->value, t); + } else + bprintf(bp, "lookup %s %s", key != NULL ? key: + "", t); + return; + } + /* FALLTHROUGH */ + case O_IP_SRC_LOOKUP: t = table_search_ctlv(fo->tstate, - ((const ipfw_insn *)cmd)->arg1); + insntoc(&cmd->o, kidx)->kidx); bprintf(bp, "table(%s", t); - if (len == F_INSN_SIZE(ipfw_insn_u32)) - bprintf(bp, ",%u", *a); + if (len == F_INSN_SIZE(ipfw_insn_table)) + print_tvalue(bp, insntoc(&cmd->o, table)); bprintf(bp, ")"); return; } + if (cmd->o.opcode == O_IP_SRC_SET || cmd->o.opcode == O_IP_DST_SET) { const uint32_t *map = (const uint32_t *)&cmd->mask; struct in_addr addr; @@ -1427,10 +1477,10 @@ print_mac_lookup(struct buf_pr *bp, const struct format_opts *fo, bprintf(bp, " "); - t = table_search_ctlv(fo->tstate, cmd->arg1); + t = table_search_ctlv(fo->tstate, insntoc(cmd, kidx)->kidx); bprintf(bp, "table(%s", t); - if (len == F_INSN_SIZE(ipfw_insn_u32)) - bprintf(bp, ",%u", ((const ipfw_insn_u32 *)cmd)->d[0]); + if (len == F_INSN_SIZE(ipfw_insn_table)) + print_tvalue(bp, insntoc(cmd, table)); bprintf(bp, ")"); } @@ -1497,10 +1547,9 @@ print_dscp(struct buf_pr *bp, const ipfw_insn_u32 *cmd) } } -#define insntod(cmd, type) ((const ipfw_insn_ ## type *)(cmd)) struct show_state { struct ip_fw_rule *rule; - const ipfw_insn *eaction; + const ipfw_insn_kidx *eaction; uint8_t *printed; int flags; #define HAVE_PROTO 0x0001 @@ -1583,7 +1632,7 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, switch (cmd->opcode) { case O_PROB: - d = 1.0 * insntod(cmd, u32)->d[0] / 0x7fffffff; + d = 1.0 * insntoc(cmd, u32)->d[0] / 0x7fffffff; bprintf(bp, "prob %f ", d); break; case O_PROBE_STATE: /* no need to print anything here */ @@ -1596,30 +1645,36 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, case O_IP_SRC_SET: if (state->flags & HAVE_SRCIP) bprintf(bp, " src-ip"); - print_ip(bp, fo, insntod(cmd, ip)); + print_ip(bp, fo, insntoc(cmd, ip)); break; case O_IP_DST: - case O_IP_DST_LOOKUP: case O_IP_DST_MASK: case O_IP_DST_ME: case O_IP_DST_SET: - if (state->flags & HAVE_DSTIP) + case O_IP_DST_LOOKUP: + /* + * Special handling for O_IP_DST_LOOKUP when + * lookup type is not LOOKUP_NONE. + */ + if ((state->flags & HAVE_DSTIP) != 0 && ( + cmd->opcode != O_IP_DST_LOOKUP || + IPFW_LOOKUP_TYPE(cmd) == LOOKUP_NONE)) bprintf(bp, " dst-ip"); - print_ip(bp, fo, insntod(cmd, ip)); + print_ip(bp, fo, insntoc(cmd, ip)); break; case O_IP6_SRC: case O_IP6_SRC_MASK: case O_IP6_SRC_ME: if (state->flags & HAVE_SRCIP) bprintf(bp, " src-ip6"); - print_ip6(bp, insntod(cmd, ip6)); + print_ip6(bp, insntoc(cmd, ip6)); break; case O_IP6_DST: case O_IP6_DST_MASK: case O_IP6_DST_ME: if (state->flags & HAVE_DSTIP) bprintf(bp, " dst-ip6"); - print_ip6(bp, insntod(cmd, ip6)); + print_ip6(bp, insntoc(cmd, ip6)); break; case O_MAC_SRC_LOOKUP: bprintf(bp, " src-mac"); @@ -1630,11 +1685,11 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, print_mac_lookup(bp, fo, cmd); break; case O_FLOW6ID: - print_flow6id(bp, insntod(cmd, u32)); + print_flow6id(bp, insntoc(cmd, u32)); break; case O_IP_DSTPORT: case O_IP_SRCPORT: - print_newports(bp, insntod(cmd, u16), state->proto, + print_newports(bp, insntoc(cmd, u16), state->proto, (state->flags & (HAVE_SRCIP | HAVE_DSTIP)) == (HAVE_SRCIP | HAVE_DSTIP) ? cmd->opcode: 0); break; @@ -1649,10 +1704,10 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, state->proto = cmd->arg1; break; case O_MACADDR2: - print_mac(bp, insntod(cmd, mac)); + print_mac(bp, insntoc(cmd, mac)); break; case O_MAC_TYPE: - print_newports(bp, insntod(cmd, u16), + print_newports(bp, insntoc(cmd, u16), IPPROTO_ETHERTYPE, cmd->opcode); break; case O_FRAG: @@ -1695,26 +1750,27 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, s = "recv"; else /* if (cmd->opcode == O_VIA) */ s = "via"; - switch (insntod(cmd, if)->name[0]) { + switch (insntoc(cmd, if)->name[0]) { case '\0': bprintf(bp, " %s %s", s, - inet_ntoa(insntod(cmd, if)->p.ip)); + inet_ntoa(insntoc(cmd, if)->p.ip)); break; case '\1': bprintf(bp, " %s table(%s)", s, table_search_ctlv(fo->tstate, - insntod(cmd, if)->p.kidx)); + insntoc(cmd, if)->p.kidx)); break; default: bprintf(bp, " %s %s", s, - insntod(cmd, if)->name); + insntoc(cmd, if)->name); } break; case O_IP_FLOW_LOOKUP: - s = table_search_ctlv(fo->tstate, cmd->arg1); + s = table_search_ctlv(fo->tstate, + insntoc(cmd, kidx)->kidx); bprintf(bp, " flow table(%s", s); - if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn_u32)) - bprintf(bp, ",%u", insntod(cmd, u32)->d[0]); + if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn_table)) + print_tvalue(bp, insntoc(cmd, table)); bprintf(bp, ")"); break; case O_IPID: @@ -1749,7 +1805,7 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, } bprintf(bp, " %s %u", s, cmd->arg1); } else - print_newports(bp, insntod(cmd, u16), 0, + print_newports(bp, insntoc(cmd, u16), 0, cmd->opcode); break; case O_IPVER: @@ -1759,7 +1815,7 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, bprintf(bp, " ipprecedence %u", cmd->arg1 >> 5); break; case O_DSCP: - print_dscp(bp, insntod(cmd, u32)); + print_dscp(bp, insntoc(cmd, u32)); break; case O_IPOPT: print_flags(bp, "ipoptions", cmd, f_ipopts); @@ -1768,7 +1824,7 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, print_flags(bp, "iptos", cmd, f_iptos); break; case O_ICMPTYPE: - print_icmptypes(bp, insntod(cmd, u32)); + print_icmptypes(bp, insntoc(cmd, u32)); break; case O_ESTAB: bprintf(bp, " established"); @@ -1781,30 +1837,30 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, break; case O_TCPACK: bprintf(bp, " tcpack %d", - ntohl(insntod(cmd, u32)->d[0])); + ntohl(insntoc(cmd, u32)->d[0])); break; case O_TCPSEQ: bprintf(bp, " tcpseq %d", - ntohl(insntod(cmd, u32)->d[0])); + ntohl(insntoc(cmd, u32)->d[0])); break; case O_UID: - pwd = getpwuid(insntod(cmd, u32)->d[0]); + pwd = getpwuid(insntoc(cmd, u32)->d[0]); if (pwd != NULL) bprintf(bp, " uid %s", pwd->pw_name); else bprintf(bp, " uid %u", - insntod(cmd, u32)->d[0]); + insntoc(cmd, u32)->d[0]); break; case O_GID: - grp = getgrgid(insntod(cmd, u32)->d[0]); + grp = getgrgid(insntoc(cmd, u32)->d[0]); if (grp != NULL) bprintf(bp, " gid %s", grp->gr_name); else bprintf(bp, " gid %u", - insntod(cmd, u32)->d[0]); + insntoc(cmd, u32)->d[0]); break; case O_JAIL: - bprintf(bp, " jail %d", insntod(cmd, u32)->d[0]); + bprintf(bp, " jail %d", insntoc(cmd, u32)->d[0]); break; case O_VERREVPATH: bprintf(bp, " verrevpath"); @@ -1827,7 +1883,8 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, else bprintf(bp, " record-state"); bprintf(bp, " :%s", - object_search_ctlv(fo->tstate, cmd->arg1, + object_search_ctlv(fo->tstate, + insntoc(cmd, kidx)->kidx, IPFW_TLV_STATE_NAME)); break; case O_LIMIT: @@ -1835,9 +1892,10 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, bprintf(bp, " limit"); else bprintf(bp, " set-limit"); - print_limit_mask(bp, insntod(cmd, limit)); + print_limit_mask(bp, insntoc(cmd, limit)); bprintf(bp, " :%s", - object_search_ctlv(fo->tstate, cmd->arg1, + object_search_ctlv(fo->tstate, + insntoc(cmd, kidx)->kidx, IPFW_TLV_STATE_NAME)); break; case O_IP6: @@ -1851,7 +1909,7 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, bprintf(bp, " ip4"); break; case O_ICMP6TYPE: - print_icmp6types(bp, insntod(cmd, u32)); + print_icmp6types(bp, insntoc(cmd, u32)); break; case O_EXT_HDR: print_ext6hdr(bp, cmd); @@ -1860,7 +1918,7 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, if (F_LEN(cmd) == 1) bprint_uint_arg(bp, " tagged ", cmd->arg1); else - print_newports(bp, insntod(cmd, u16), + print_newports(bp, insntoc(cmd, u16), 0, O_TAGGED); break; case O_SKIP_ACTION: @@ -1871,12 +1929,10 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo, if (cmd->arg1 == IP_FW_TARG) bprintf(bp, " tablearg"); else - bprintf(bp, " %#x", - ((const ipfw_insn_u32 *)cmd)->d[0]); + bprintf(bp, " %#x", insntoc(cmd, u32)->d[0]); - if (((const ipfw_insn_u32 *)cmd)->d[1] != 0xFFFFFFFF) - bprintf(bp, ":%#x", - ((const ipfw_insn_u32 *)cmd)->d[1]); + if (insntoc(cmd, u32)->d[1] != 0xFFFFFFFF) + bprintf(bp, ":%#x", insntoc(cmd, u32)->d[1]); break; default: @@ -1929,14 +1985,14 @@ print_fwd(struct buf_pr *bp, const ipfw_insn *cmd) uint16_t port; if (cmd->opcode == O_FORWARD_IP) { - sa = insntod(cmd, sa); + sa = insntoc(cmd, sa); port = sa->sa.sin_port; if (sa->sa.sin_addr.s_addr == INADDR_ANY) bprintf(bp, "fwd tablearg"); else bprintf(bp, "fwd %s", inet_ntoa(sa->sa.sin_addr)); } else { - sa6 = insntod(cmd, sa6); + sa6 = insntoc(cmd, sa6); port = sa6->sa.sin6_port; bprintf(bp, "fwd "); if (getnameinfo((const struct sockaddr *)&sa6->sa, @@ -1948,6 +2004,26 @@ print_fwd(struct buf_pr *bp, const ipfw_insn *cmd) bprintf(bp, ",%u", port); } +static void +print_logdst(struct buf_pr *bp, uint16_t arg1) +{ + char const *comma = ""; + + bprintf(bp, " logdst ", arg1); + if (arg1 & IPFW_LOG_SYSLOG) { + bprintf(bp, "%ssyslog", comma); + comma = ","; + } + if (arg1 & IPFW_LOG_IPFW0) { + bprintf(bp, "%sipfw0", comma); + comma = ","; + } + if (arg1 & IPFW_LOG_RTSOCK) { + bprintf(bp, "%srtsock", comma); + comma = ","; + } +} + static int print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, struct show_state *state, const ipfw_insn *cmd) @@ -1959,8 +2035,9 @@ print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, switch (cmd->opcode) { case O_CHECK_STATE: bprintf(bp, "check-state"); - if (cmd->arg1 != 0) - s = object_search_ctlv(fo->tstate, cmd->arg1, + if (insntoc(cmd, kidx)->kidx != 0) + s = object_search_ctlv(fo->tstate, + insntoc(cmd, kidx)->kidx, IPFW_TLV_STATE_NAME); else s = NULL; @@ -1985,7 +2062,7 @@ print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, else if (cmd->arg1 == ICMP_UNREACH_NEEDFRAG && cmd->len == F_INSN_SIZE(ipfw_insn_u16)) bprintf(bp, "needfrag %u", - ((const ipfw_insn_u16 *)cmd)->ports[0]); + insntoc(cmd, u16)->ports[0]); else print_reject_code(bp, cmd->arg1); break; @@ -1998,7 +2075,7 @@ print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, print_unreach6_code(bp, cmd->arg1); break; case O_SKIPTO: - bprint_uint_arg(bp, "skipto ", cmd->arg1); + bprint_uint_arg(bp, "skipto ", insntoc(cmd, u32)->d[0]); break; case O_PIPE: bprint_uint_arg(bp, "pipe ", cmd->arg1); @@ -2023,15 +2100,16 @@ print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, print_fwd(bp, cmd); break; case O_LOG: - if (insntod(cmd, log)->max_log > 0) - bprintf(bp, " log logamount %d", - insntod(cmd, log)->max_log); - else - bprintf(bp, " log"); + bprintf(bp, " log"); + if (insntoc(cmd, log)->max_log > 0) + bprintf(bp, " logamount %d", + insntoc(cmd, log)->max_log); + if (cmd->arg1 != IPFW_LOG_DEFAULT) + print_logdst(bp, cmd->arg1); break; case O_ALTQ: #ifndef NO_ALTQ - print_altq_cmd(bp, insntod(cmd, altq)); + print_altq_cmd(bp, insntoc(cmd, altq)); #endif break; case O_TAG: @@ -2060,8 +2138,9 @@ print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, * NOTE: in case when external action has no named * instances support, the second opcode isn't needed. */ - state->eaction = cmd; - s = object_search_ctlv(fo->tstate, cmd->arg1, + state->eaction = insntoc(cmd, kidx); + s = object_search_ctlv(fo->tstate, + state->eaction->kidx, IPFW_TLV_EACTION); if (match_token(rule_eactions, s) != -1) bprintf(bp, "%s", s); @@ -2081,11 +2160,12 @@ print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, * we calculate TLV type using IPFW_TLV_EACTION_NAME() * macro. */ - s = object_search_ctlv(fo->tstate, cmd->arg1, 0); + s = object_search_ctlv(fo->tstate, + insntoc(cmd, kidx)->kidx, 0); if (s == NULL) s = object_search_ctlv(fo->tstate, - cmd->arg1, IPFW_TLV_EACTION_NAME( - state->eaction->arg1)); + insntoc(cmd, kidx)->kidx, IPFW_TLV_EACTION_NAME( + state->eaction->kidx)); bprintf(bp, " %s", s); break; case O_EXTERNAL_DATA: @@ -2117,17 +2197,18 @@ print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, bprintf(bp, "reass"); break; case O_CALLRETURN: - if (cmd->len & F_NOT) - bprintf(bp, "return"); - else - bprint_uint_arg(bp, "call ", cmd->arg1); + if (cmd->len & F_NOT) { + s = match_value(return_types, cmd->arg1); + bprintf(bp, "return %s", s ? s: ""); + } else + bprint_uint_arg(bp, "call ", insntoc(cmd, u32)->d[0]); break; case O_SETMARK: if (cmd->arg1 == IP_FW_TARG) { bprintf(bp, "setmark tablearg"); break; } - bprintf(bp, "setmark %#x", ((const ipfw_insn_u32 *)cmd)->d[0]); + bprintf(bp, "setmark %#x", insntoc(cmd, u32)->d[0]); break; default: bprintf(bp, "** unrecognized action %d len %d ", @@ -2233,9 +2314,16 @@ print_address(struct buf_pr *bp, struct format_opts *fo, count = portcnt = 0; for (l = state->rule->act_ofs, cmd = state->rule->cmd; l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { - if (match_opcode(cmd->opcode, opcodes, nops)) + if (match_opcode(cmd->opcode, opcodes, nops)) { + /* + * Special handling for O_IP_DST_LOOKUP when + * lookup type is not LOOKUP_NONE. + */ + if (cmd->opcode == O_IP_DST_LOOKUP && + IPFW_LOOKUP_TYPE(cmd) != LOOKUP_NONE) + continue; count++; - else if (cmd->opcode == portop) + } else if (cmd->opcode == portop) portcnt++; } if (count == 0) @@ -2292,6 +2380,12 @@ static const int dst_opcodes[] = { O_IP_DST_SET, O_IP6_DST, O_IP6_DST_MASK, O_IP6_DST_ME }; +#if IPFW_DEFAULT_RULE > 65535 +#define RULENUM_FORMAT "%06d" +#else +#define RULENUM_FORMAT "%05d" +#endif + static void show_static_rule(struct cmdline_opts *co, struct format_opts *fo, struct buf_pr *bp, struct ip_fw_rule *rule, struct ip_fw_bcounter *cntr) @@ -2313,7 +2407,8 @@ show_static_rule(struct cmdline_opts *co, struct format_opts *fo, warn("init_show_state() failed"); return; } - bprintf(bp, "%05u ", rule->rulenum); + + bprintf(bp, RULENUM_FORMAT " ", rule->rulenum); /* only if counters are available */ if (cntr != NULL) { @@ -2423,23 +2518,21 @@ show_dyn_state(struct cmdline_opts *co, struct format_opts *fo, { struct protoent *pe; struct in_addr a; - uint16_t rulenum; char buf[INET6_ADDRSTRLEN]; - if (d->expire == 0 && d->dyn_type != O_LIMIT_PARENT) + if (!d->expire && !(d->type == O_LIMIT_PARENT)) return; - bcopy(&d->rule, &rulenum, sizeof(rulenum)); - bprintf(bp, "%05d", rulenum); + bprintf(bp, RULENUM_FORMAT, d->rulenum); if (fo->pcwidth > 0 || fo->bcwidth > 0) { bprintf(bp, " "); pr_u64(bp, &d->pcnt, fo->pcwidth); pr_u64(bp, &d->bcnt, fo->bcwidth); bprintf(bp, "(%ds)", d->expire); } - switch (d->dyn_type) { + switch (d->type) { case O_LIMIT_PARENT: - bprintf(bp, " PARENT %d", d->count); + bprintf(bp, " PARENT %u", d->count); break; case O_LIMIT: bprintf(bp, " LIMIT"); @@ -2531,9 +2624,8 @@ ipfw_sets_handler(char *av[]) ipfw_range_tlv rt; const char *msg; size_t size; - uint32_t masks[2]; + uint32_t masks[2], rulenum; int i; - uint16_t rulenum; uint8_t cmd; av++; @@ -2584,7 +2676,7 @@ ipfw_sets_handler(char *av[]) if (av[0] == NULL || av[1] == NULL || av[2] == NULL || av[3] != NULL || _substrcmp(av[1], "to") != 0) errx(EX_USAGE, "syntax: set move [rule] X to Y\n"); - rulenum = atoi(av[0]); + rulenum = (uint32_t)strtoul(av[0], NULL, 10); rt.new_set = atoi(av[2]); if (cmd == IP_FW_XMOVE) { rt.start_rule = rulenum; @@ -2637,6 +2729,18 @@ ipfw_sets_handler(char *av[]) errx(EX_USAGE, "invalid set command %s\n", *av); } +static void +manage_skipto_cache(int op) +{ + ipfw_cmd_header req; + + memset(&req, 0, sizeof(req)); + req.size = sizeof(req); + req.cmd = op ? SKIPTO_CACHE_ENABLE : SKIPTO_CACHE_DISABLE; + + do_set3(IP_FW_SKIPTO_CACHE, &req.opheader, sizeof(req)); +} + void ipfw_sysctl_handler(char *av[], int which) { @@ -2661,6 +2765,8 @@ ipfw_sysctl_handler(char *av[], int which) } else if (_substrcmp(*av, "dyn_keepalive") == 0) { sysctlbyname("net.inet.ip.fw.dyn_keepalive", NULL, 0, &which, sizeof(which)); + } else if (_substrcmp(*av, "skipto_cache") == 0) { + manage_skipto_cache(which); #ifndef NO_ALTQ } else if (_substrcmp(*av, "altq") == 0) { altq_set_enabled(which); @@ -2679,7 +2785,6 @@ prepare_format_dyn(struct cmdline_opts *co, struct format_opts *fo, { ipfw_dyn_rule *d; int width; - uint8_t set; d = (ipfw_dyn_rule *)_state; /* Count _ALL_ states */ @@ -2688,13 +2793,9 @@ prepare_format_dyn(struct cmdline_opts *co, struct format_opts *fo, if (fo->show_counters == 0) return; - if (co->use_set) { - /* skip states from another set */ - bcopy((char *)&d->rule + sizeof(uint16_t), &set, - sizeof(uint8_t)); - if (set != co->use_set - 1) - return; - } + /* skip states from another set */ + if (co->use_set != 0 && d->set != co->use_set - 1) + return; width = pr_u64(NULL, &d->pcnt, 0); if (width > fo->pcwidth) @@ -2822,24 +2923,17 @@ static void list_dyn_state(struct cmdline_opts *co, struct format_opts *fo, void *_arg, void *_state) { - uint16_t rulenum; - uint8_t set; ipfw_dyn_rule *d; struct buf_pr *bp; d = (ipfw_dyn_rule *)_state; bp = (struct buf_pr *)_arg; - bcopy(&d->rule, &rulenum, sizeof(rulenum)); - if (rulenum > fo->last) + if (d->rulenum > fo->last) return; - if (co->use_set) { - bcopy((char *)&d->rule + sizeof(uint16_t), - &set, sizeof(uint8_t)); - if (set != co->use_set - 1) - return; - } - if (rulenum >= fo->first) { + if (co->use_set != 0 && d->set != co->use_set - 1) + return; + if (d->rulenum >= fo->first) { show_dyn_state(co, fo, bp, d); printf("%s\n", bp->buf); bp_flush(bp); @@ -3165,7 +3259,7 @@ eaction_check_name(const char *name) return (0); } -static uint16_t +static uint32_t pack_object(struct tidx *tstate, const char *name, int otype) { ipfw_obj_ntlv *ntlv; @@ -3202,7 +3296,7 @@ pack_object(struct tidx *tstate, const char *name, int otype) return (ntlv->idx); } -static uint16_t +static uint32_t pack_table(struct tidx *tstate, const char *name) { @@ -3212,12 +3306,32 @@ pack_table(struct tidx *tstate, const char *name) return (pack_object(tstate, name, IPFW_TLV_TBL_NAME)); } +static void +fill_table_value(ipfw_insn *cmd, char *s) +{ + char *p; + int i; + + p = strchr(s, '='); + if (p != NULL) { + *p++ = '\0'; + i = match_token(tvalue_names, s); + if (i == -1) + errx(EX_USAGE, + "format: unknown table value name %s", s); + } else { + i = TVALUE_TAG; + p = s; + } + + IPFW_SET_TVALUE_TYPE(cmd, i); + insntod(cmd, table)->value = strtoul(p, NULL, 0); +} + void -fill_table(struct _ipfw_insn *cmd, char *av, uint8_t opcode, - struct tidx *tstate) +fill_table(ipfw_insn *cmd, char *av, uint8_t opcode, struct tidx *tstate) { - uint32_t *d = ((ipfw_insn_u32 *)cmd)->d; - uint16_t uidx; + ipfw_insn_kidx *c = insntod(cmd, kidx); char *p; if ((p = strchr(av + 6, ')')) == NULL) @@ -3227,19 +3341,19 @@ fill_table(struct _ipfw_insn *cmd, char *av, uint8_t opcode, if (p) *p++ = '\0'; - if ((uidx = pack_table(tstate, av + 6)) == 0) + if ((c->kidx = pack_table(tstate, av + 6)) == 0) errx(EX_DATAERR, "Invalid table name: %s", av + 6); cmd->opcode = opcode; - cmd->arg1 = uidx; if (p) { - cmd->len |= F_INSN_SIZE(ipfw_insn_u32); - d[0] = strtoul(p, NULL, 0); - } else - cmd->len |= F_INSN_SIZE(ipfw_insn); + cmd->len |= F_INSN_SIZE(ipfw_insn_table); + fill_table_value(cmd, p); + } else { + IPFW_SET_LOOKUP_TYPE(cmd, LOOKUP_NONE); + cmd->len |= F_INSN_SIZE(ipfw_insn_kidx); + } } - /* * fills the addr and mask fields in the instruction as appropriate from av. * Update length as appropriate. @@ -3470,7 +3584,7 @@ ipfw_delete(char *av[]) { ipfw_range_tlv rt; char *sep; - int i, j; + uint32_t i, j; int exitval = EX_OK; int do_set = 0; @@ -3503,8 +3617,8 @@ ipfw_delete(char *av[]) rt.set = i & 31; rt.flags = IPFW_RCFLAG_SET; } else { - rt.start_rule = i & 0xffff; *** 9719 LINES SKIPPED *** From nobody Mon Mar 3 19:00:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z67SK1dg3z5qDlQ; Mon, 03 Mar 2025 19:00: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 4Z67SJ3ryTz3Qrc; Mon, 03 Mar 2025 19:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741028448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMEmrxMcDlLO2BJBxSVa/A+d0g+MnIkO+H+b7IjaAJY=; b=IEwjZWVxAifrVYh27g5pK7W9fXoMxYI9vQL0lZWMApLzSgAdB2Ga3imHNhUUkErITtUspz zhznLcc5+vgZcK4TaOUppTTzJP4voHMEsX72uWSgRq06MgBvRLpD9cICbz0++LTeUj06LK mHkvzduzmRBuvuYeugOcveUZ/wDrrBQyG8d/gP8Akdgikw1ylG7oMU+EuyX1/F0g6IDhHs 2q/r1kwGu4k3zxuXOAIuJLHtL90zEvxLNh0EAGXcN5Pag68/qYBeC9GE2DrmRlXTBI4/T2 Yy2OlSnacBWcQ4Km24d3XTclxxvr5es1rT440Nsk9TCg4AuuEtiDn9W0+4JD2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741028448; a=rsa-sha256; cv=none; b=x68c0K0l0vDdQgdY0mmndApKUZnrRLSsUL8WwX9Nu1nrVSBamDRxLk0Yqx0LKXN/6SuPId ayrw3dAnrtP1KnqD8lRIXEhJVAT5vGmelYJ/+qK5POFXNi6ikwMyF0Q7n52EOdF9J9Cfmj 71nqPTCMXbr57nWOCMmCO/wf3DyGdPg/IJ+ebCkxwLsQLHsGKsPYTQ14GsA5kU85XTeE4Q iSSeBRjXNn9yIwUevJr6gP2XSHNqUrHEefm24ZpYiO5eBluxWXdYuTTP6zJqk/RAiXe9j/ Tfij+4gFdNLje8fyP9FwuXBqFgH6iiAMXcYFPqqllr6gfqFZQdjDGRLn145HPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741028448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMEmrxMcDlLO2BJBxSVa/A+d0g+MnIkO+H+b7IjaAJY=; b=Hz2vsZ+SJMGeqwZmJP+3QEm7+AFkIfrgsOFG/d0yMQ947soqeaGcL2WTCF3lt00f+62Ru6 mUDAQ0paUCCKv7xK3Duh3IzmPFXz4kIRQodYMT2C7iGD2+e9yNu5HcUEnbFWTza1MBkC+Y B7OP5M96a3dnm/+IEJiAxfCdDf2fGp/Uap01vwzT61XTcxTIEh7V3uzBVBOBTTTdOY3xbv r7USrsPdvI2umdi/mt61AIAC8x6zMlQYHGQ+zRuG+tuw+NZPQBNy5VHEZYxdFAFFS7Ro4Q kS9484QZBdYd8DZG8uM281pKhKqpwwT//JcKwzLqSsaZEeRd939++g4t1lLbUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z67SJ3BP1z10fd; Mon, 03 Mar 2025 19:00: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 523J0mkR019712; Mon, 3 Mar 2025 19:00:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523J0mv4019709; Mon, 3 Mar 2025 19:00:48 GMT (envelope-from git) Date: Mon, 3 Mar 2025 19:00:48 GMT Message-Id: <202503031900.523J0mv4019709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 6ba1c5abb957 - main - ipfw: add UPDATING note and modify __FreeBSD_version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ba1c5abb9575aaf4ef0a7efb085d42be252e645 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=6ba1c5abb9575aaf4ef0a7efb085d42be252e645 commit 6ba1c5abb9575aaf4ef0a7efb085d42be252e645 Author: Andrey V. Elsukov AuthorDate: 2025-03-03 18:58:24 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-03-03 18:58:24 +0000 ipfw: add UPDATING note and modify __FreeBSD_version --- UPDATING | 7 +++++++ sys/sys/param.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 4740237f6b0b..15941028c5bb 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250303: + Commit 4a77657cbc01 changed the ABI between ipfw(8) and ipfw(4). + Please note that the old ipfw(8) binary will not work with the new + ipfw(4) module. Therefore, it is recommended to disable ipfw during + the upgrade, otherwise the host system may become inaccessible because + ipfw rules cannot be installed with the old binary. + 20250214: Commit 4517fbfd4251 modified the internal API between the nfscommon and nfscl modules. As such, both of these modules diff --git a/sys/sys/param.h b/sys/sys/param.h index 6645130e2614..ca6957ccdb14 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500033 +#define __FreeBSD_version 1500034 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Mon Mar 3 20:49:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z69sK3C8Vz5nfhQ; Mon, 03 Mar 2025 20:49: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 4Z69sJ6FrZz3vHq; Mon, 03 Mar 2025 20:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741034948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9tD8t8dfG7pJwQe+cvPgSfUcn8QZpc+8zRzpH8Gqt8=; b=PGHz/3H4nDgc/gueWC2hc/MjkBqZ3+l1psEl9EFcv08qOIEX5FHqepUVWBVmKB9RVjNiZJ qB5d8e9GcyQvjFB8Fg5aMWuDd/sHe4FhFMGquNYXjSkyyJ+3k+L1gjrJkSm7Yv2o9LoC1N ZoqnT3LPEqpr5O+4r8DvqyGkg+urc7SsuI2ZGWU/hIP5i5RPU6r0NFRmKwrR7yYQa/oggt 3+6zLDhe3ehdLTaTkP/OAqP0Yena2Pey5w7q1BwAdLJahDJTez+9RzFOB5rKnn1juCUknU eItosG2yyBosYh9ib7s/UodBnA75fsfG9j7T7Dzir4FR3RfVDMh3qJZper2PuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741034948; a=rsa-sha256; cv=none; b=epWxPwXKaEY2feJy1cy82UEjOlXfAerystlN+B9RHvjBpDyX9ck2Qj2NKITPF4enrK+LDc fXyXWob1/BJVV/y206nDMGvlwua+EZZzJ588gWkI6Hv7368eY5C0W6bPn5ND8CnIB2VMe5 VcVz9IoLf0mbgzT4Dcxf8X5Jj9nTdNOGk4no4Z3sBIY6FOD5VwCTTcURQRJxKmHO1soFYd C3ULv4uP37uGOVWTjDjc8SJmn+ZYICwQCdsOmhFlVyBiZo+ld8A6Oc23KilMkRc0TsAKln wSCdVmNGZbqKxms3LXcXH4QPpBM1GDvvKrzWtLkiwqBjSCKXR7MDq3TSzmG1jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741034948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9tD8t8dfG7pJwQe+cvPgSfUcn8QZpc+8zRzpH8Gqt8=; b=gcXqj5xmCOcCjKmXYy4V7AEQxFGxXkSMnBOheQUHeZW0vSeIBVUhWXPD6M1FVg0yyNWz6M cdpnSG/59Z1jEuD4dW7CVSOsCOQG1niL9z+L6oTOWA8tEy4i0DR3ZF9fTTqGSaa/p179d2 Xh3auCrcor2EH9c3DXGG9l77PFTQ2IbgBKrNLFATt/oPsLQtuai4K4BIab4hnUoAJx3vFa A8va2rVpHHoYsQbGag7pqkbIiFNXcr6PDvryfK+jiuwNyJE56nncwoGGDtiJjler37GaAx ZMgIAE5MrrFhnAFlNel15MHTJEFcxB7zjk5B6/ZfQfDRHonZJtRKQ3/jq8KR/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z69sJ5hR1z133s; Mon, 03 Mar 2025 20:49: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 523Kn8lL014055; Mon, 3 Mar 2025 20:49:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523Kn8i0014052; Mon, 3 Mar 2025 20:49:08 GMT (envelope-from git) Date: Mon, 3 Mar 2025 20:49:08 GMT Message-Id: <202503032049.523Kn8i0014052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Ambrisko Subject: git: 1c9c4a25e600 - main - enic: fix potential panic due to not understanding what iflib had allocated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ambrisko X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c9c4a25e600bcfad3eec891d43221b55ddf7e19 Auto-Submitted: auto-generated The branch main has been updated by ambrisko: URL: https://cgit.FreeBSD.org/src/commit/?id=1c9c4a25e600bcfad3eec891d43221b55ddf7e19 commit 1c9c4a25e600bcfad3eec891d43221b55ddf7e19 Author: Doug Ambrisko AuthorDate: 2025-03-03 20:46:15 +0000 Commit: Doug Ambrisko CommitDate: 2025-03-03 20:49:01 +0000 enic: fix potential panic due to not understanding what iflib had allocated For safety I was trying to clear out the descriptor but the full descriptor was not allocated. Remove any code trying to do that so the same mistake won't be made. This was found when looking to MFC the prior change and having the loader, load the module. Remove cq->ntxqsets since the completion queue is part of the RX and TX sets --- sys/dev/enic/if_enic.c | 19 ++++++++----------- sys/dev/enic/vnic_cq.c | 2 -- sys/dev/enic/vnic_cq.h | 4 ---- sys/dev/enic/vnic_dev.c | 9 ++------- sys/dev/enic/vnic_dev.h | 1 - sys/dev/enic/vnic_rq.c | 2 -- sys/dev/enic/vnic_wq.c | 6 ++---- 7 files changed, 12 insertions(+), 31 deletions(-) diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c index 26776244778e..35620fece6bf 100644 --- a/sys/dev/enic/if_enic.c +++ b/sys/dev/enic/if_enic.c @@ -494,8 +494,7 @@ enic_attach_pre(if_ctx_t ctx) ifmedia_add(softc->media, IFM_ETHER | IFM_10_FL, 0, NULL); /* - * Allocate the CQ here since TX is called first before RX for now - * assume RX and TX are the same + * Allocate the CQ here since TX is called first before RX. */ if (softc->enic.cq == NULL) softc->enic.cq = malloc(sizeof(struct vnic_cq) * @@ -504,8 +503,6 @@ enic_attach_pre(if_ctx_t ctx) if (softc->enic.cq == NULL) return (ENOMEM); - softc->enic.cq->ntxqsets = softc->enic.wq_count + softc->enic.rq_count; - /* * Allocate the consistent memory for stats and counters upfront so * both primary and secondary processes can access them. @@ -735,7 +732,7 @@ enic_tx_queues_alloc(if_ctx_t ctx, caddr_t * vaddrs, uint64_t * paddrs, for (q = 0; q < ntxqsets; q++) { struct vnic_wq *wq; struct vnic_cq *cq; - unsigned int cq_wq; + unsigned int cq_wq; wq = &softc->enic.wq[q]; cq_wq = enic_cq_wq(&softc->enic, q); @@ -755,7 +752,6 @@ enic_tx_queues_alloc(if_ctx_t ctx, caddr_t * vaddrs, uint64_t * paddrs, wq->head_idx = 0; wq->tail_idx = 0; - wq->ring.size = wq->ring.desc_count * wq->ring.desc_size; wq->ring.descs = vaddrs[q * ntxqs + 0]; wq->ring.base_addr = paddrs[q * ntxqs + 0]; @@ -768,7 +764,6 @@ enic_tx_queues_alloc(if_ctx_t ctx, caddr_t * vaddrs, uint64_t * paddrs, cq->ring.desc_count = softc->scctx->isc_ntxd[q]; cq->ring.desc_avail = cq->ring.desc_count - 1; - cq->ring.size = cq->ring.desc_count * cq->ring.desc_size; cq->ring.descs = vaddrs[q * ntxqs + 1]; cq->ring.base_addr = paddrs[q * ntxqs + 1]; @@ -824,7 +819,6 @@ enic_rx_queues_alloc(if_ctx_t ctx, caddr_t * vaddrs, uint64_t * paddrs, cq->ring.desc_count = softc->scctx->isc_nrxd[1]; cq->ring.desc_avail = cq->ring.desc_count - 1; - cq->ring.size = cq->ring.desc_count * cq->ring.desc_size; cq->ring.descs = vaddrs[q * nrxqs + 0]; cq->ring.base_addr = paddrs[q * nrxqs + 0]; @@ -840,7 +834,6 @@ enic_rx_queues_alloc(if_ctx_t ctx, caddr_t * vaddrs, uint64_t * paddrs, rq->ring.desc_count = softc->scctx->isc_nrxd[0]; rq->ring.desc_avail = rq->ring.desc_count - 1; - rq->ring.size = rq->ring.desc_count * rq->ring.desc_size; rq->ring.descs = vaddrs[q * nrxqs + 1]; rq->ring.base_addr = paddrs[q * nrxqs + 1]; rq->need_initial_post = true; @@ -1241,7 +1234,9 @@ enic_setup_txq_sysctl(struct vnic_wq *wq, int i, struct sysctl_ctx_list *ctx, { struct sysctl_oid *txsnode; struct sysctl_oid_list *txslist; - struct vnic_stats *stats = wq[i].vdev->stats; + struct vnic_stats *stats; + + stats = wq[i].vdev->stats; txsnode = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "hstats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Host Statistics"); @@ -1277,7 +1272,9 @@ enic_setup_rxq_sysctl(struct vnic_rq *rq, int i, struct sysctl_ctx_list *ctx, { struct sysctl_oid *rxsnode; struct sysctl_oid_list *rxslist; - struct vnic_stats *stats = rq[i].vdev->stats; + struct vnic_stats *stats; + + stats = rq[i].vdev->stats; rxsnode = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "hstats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Host Statistics"); diff --git a/sys/dev/enic/vnic_cq.c b/sys/dev/enic/vnic_cq.c index 72de29e5a381..bd3629530a61 100644 --- a/sys/dev/enic/vnic_cq.c +++ b/sys/dev/enic/vnic_cq.c @@ -40,6 +40,4 @@ void vnic_cq_clean(struct vnic_cq *cq) ENIC_BUS_WRITE_4(cq->ctrl, CQ_HEAD, 0); ENIC_BUS_WRITE_4(cq->ctrl, CQ_TAIL, 0); ENIC_BUS_WRITE_4(cq->ctrl, CQ_TAIL_COLOR, 1); - - vnic_dev_clear_desc_ring(&cq->ring); } diff --git a/sys/dev/enic/vnic_cq.h b/sys/dev/enic/vnic_cq.h index b4549ee58c64..7f875d57ed74 100644 --- a/sys/dev/enic/vnic_cq.h +++ b/sys/dev/enic/vnic_cq.h @@ -71,10 +71,6 @@ struct vnic_cq { unsigned int tobe_rx_coal_timeval; ktime_t prev_ts; #endif - int ntxqsets; - int nrxqsets; - int ntxqsets_start; - int nrxqsets_start; }; void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable, diff --git a/sys/dev/enic/vnic_dev.c b/sys/dev/enic/vnic_dev.c index 2d555cb2b34d..a8228aed69aa 100644 --- a/sys/dev/enic/vnic_dev.c +++ b/sys/dev/enic/vnic_dev.c @@ -168,17 +168,12 @@ unsigned int vnic_dev_desc_ring_size(struct vnic_dev_ring *ring, ring->desc_size = VNIC_ALIGN(desc_size, desc_align); - ring->size = ring->desc_count * ring->desc_size; - ring->size_unaligned = ring->size + ring->base_align; + ring->size_unaligned = ring->desc_count * ring->desc_size \ + + ring->base_align; return ring->size_unaligned; } -void vnic_dev_clear_desc_ring(struct vnic_dev_ring *ring) -{ - memset(ring->descs, 0, ring->size); -} - static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, int wait) { diff --git a/sys/dev/enic/vnic_dev.h b/sys/dev/enic/vnic_dev.h index 5e2d01d985f3..66583f4d278d 100644 --- a/sys/dev/enic/vnic_dev.h +++ b/sys/dev/enic/vnic_dev.h @@ -69,7 +69,6 @@ unsigned long vnic_dev_get_res_type_len(struct vnic_dev *vdev, enum vnic_res_type type); unsigned int vnic_dev_desc_ring_size(struct vnic_dev_ring *ring, unsigned int desc_count, unsigned int desc_size); -void vnic_dev_clear_desc_ring(struct vnic_dev_ring *ring); int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring *ring, unsigned int desc_count, unsigned int desc_size); void vnic_dev_free_desc_ring(struct vnic_dev *vdev, diff --git a/sys/dev/enic/vnic_rq.c b/sys/dev/enic/vnic_rq.c index ef30563fa2f3..4c02347579b1 100644 --- a/sys/dev/enic/vnic_rq.c +++ b/sys/dev/enic/vnic_rq.c @@ -93,6 +93,4 @@ void vnic_rq_clean(struct vnic_rq *rq) } ENIC_BUS_WRITE_4(rq->ctrl, RX_POSTED_INDEX, fetch_index); - - vnic_dev_clear_desc_ring(&rq->ring); } diff --git a/sys/dev/enic/vnic_wq.c b/sys/dev/enic/vnic_wq.c index 995af3270a21..1d3120798798 100644 --- a/sys/dev/enic/vnic_wq.c +++ b/sys/dev/enic/vnic_wq.c @@ -37,9 +37,9 @@ int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev, ring->last_count = 0; ring->desc_avail = ring->desc_count - 1; - ring->size = ring->desc_count * ring->desc_size; ring->base_align = 512; - ring->size_unaligned = ring->size + ring->base_align; + ring->size_unaligned = ring->desc_count * ring->desc_size \ + + ring->base_align; return (err); @@ -180,6 +180,4 @@ void vnic_wq_clean(struct vnic_wq *wq) ENIC_BUS_WRITE_4(wq->ctrl, TX_FETCH_INDEX, 0); ENIC_BUS_WRITE_4(wq->ctrl, TX_POSTED_INDEX, 0); ENIC_BUS_WRITE_4(wq->ctrl, TX_ERROR_STATUS, 0); - - vnic_dev_clear_desc_ring(&wq->ring); } From nobody Mon Mar 3 21:30:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6Bmg0MN5z5nlNk; Mon, 03 Mar 2025 21:30: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 4Z6Bmf6rbXz4N0t; Mon, 03 Mar 2025 21:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741037411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MHPctHLni/CGh83O4o42Q/mRdgfuWl4dVJNXmj3l+VE=; b=dnTAH4HJlfaKVjWznZ+1o/2OsJqJL/dqdcbqR1WFJ/1zTJCZKLTS8W4pTly1Mo4lmY9oRa 7ypwDkvUh0BZltaHlu/RuCPtCBrAONmnNS5/5T3piztTCVSnqprflQX2lZValjoqDXdTsK NxkQWPbVvGKNGhgkdvEqO0GhZl10hd/2dnmFCxpfLu8jWTFCmFTCCtLA1itFMOF118OHi0 Qf5I0cQ5lu7P7NN+83zCIASFloRiFpeL9JUbpXMm+crs1yGJMdHbGMPbhkFkcQ9oGD/cHx wTJ7FbPAio0idjfAD1ki0I7SqdPr+f812sft1kyU2TgD1O0HpX85ohY5AgqkmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741037411; a=rsa-sha256; cv=none; b=EFIxl3wyqxWpzUeBjP1/YmJaFBfohojPwsQYZpZALtMFoOxcdeqfdwKW0gWf44IJuWWHdd srH79kyPbNJ0TP/csMVzQGXwkqL34Qg7/eDqIHNCK2Yw4CItgySq3jjv8Z2tHkVCVlhFhI vHAEc7b1YJqSd0pQ1jTMDAQ+Kdv/mn/W5d7HKR1MUG8DaJK5XonVzfyW+hJ7XhhXEEqURz 5w9QtMXS9VhOZpZxs0ZZVjl+3fN5lEM+mfljdzDa8O+RyYqzQ1XI0R9a6BW+kQWeCWnAHY evuZRvJiJYU/os9zPLhrK8kHemLUmCHx+eLPM2edwsCLoC/Utc8p5eCvCum/7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741037411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MHPctHLni/CGh83O4o42Q/mRdgfuWl4dVJNXmj3l+VE=; b=U39/iJiCTN8qWe8roq1elt9vCmNh9K7b/v6u5XFjFGM7hHiAmP6ffjvgmNXxz2yRmQf5mC CerLjQwHji9AMx/XGzeRnkxRhDhOqWme63R5ff6niyoGa8xNSR7LtA6R0bnsDwNrOGAVtY /AFBZJ2SX0x+dhqjYd+Y0d7KKVcw3T2Exdjjm2FkkCzpxtNbghQsOqbFyrEc6wkAZ3aTEZ lTCp0rObdjkhgUK7qjIPsjJVBJtw4g/fJa8q9WljrGuQkYEfcb7G+ClRwxP5hwW7uso6HJ Ralu1+RfK79TjIRlTP8zpv/r1duPdw87+wSB2QZVeMcIma+unn9EB4F6G6J+kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6Bmf5ympz14DV; Mon, 03 Mar 2025 21:30: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 523LUAnO092989; Mon, 3 Mar 2025 21:30:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523LUAhJ092980; Mon, 3 Mar 2025 21:30:10 GMT (envelope-from git) Date: Mon, 3 Mar 2025 21:30:10 GMT Message-Id: <202503032130.523LUAhJ092980@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: cd6ed24ba4dc - main - drm2 tegra: Use vm_radix_iter_lookup instead of vm_page_iter_lookup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd6ed24ba4dc18897211fa7f55bb2393cf1ab25c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cd6ed24ba4dc18897211fa7f55bb2393cf1ab25c commit cd6ed24ba4dc18897211fa7f55bb2393cf1ab25c Author: John Baldwin AuthorDate: 2025-03-03 21:29:20 +0000 Commit: John Baldwin CommitDate: 2025-03-03 21:29:20 +0000 drm2 tegra: Use vm_radix_iter_lookup instead of vm_page_iter_lookup Fixes: 991dbf9f4327 ("vm_page: drop page_iter_lookup") --- sys/arm/nvidia/drm2/tegra_bo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm/nvidia/drm2/tegra_bo.c b/sys/arm/nvidia/drm2/tegra_bo.c index 6d380b95a4a9..8952d09eec3d 100644 --- a/sys/arm/nvidia/drm2/tegra_bo.c +++ b/sys/arm/nvidia/drm2/tegra_bo.c @@ -43,6 +43,7 @@ #include #include +#include static void tegra_bo_destruct(struct tegra_bo *bo) @@ -62,7 +63,7 @@ tegra_bo_destruct(struct tegra_bo *bo) vm_page_iter_init(&pages, bo->cdev_pager); VM_OBJECT_WLOCK(bo->cdev_pager); for (i = 0; i < bo->npages; i++) { - m = vm_page_iter_lookup(&pages, i); + m = vm_radix_iter_lookup(&pages, i); vm_page_busy_acquire(m, 0); cdev_mgtdev_pager_free_page(&pages, m); m->flags &= ~PG_FICTITIOUS; From nobody Mon Mar 3 21:38:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6ByD0mGfz5nlw6; Mon, 03 Mar 2025 21:38: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 4Z6ByC55v9z3H6Q; Mon, 03 Mar 2025 21:38:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741037907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9hloEnziclR4TIhkUx3FiU7L/7fYJtQ3hZRW9Yt9Ew=; b=iDPdkzPB60fhUQAS/TWRBvAX1Z0UXeCzturGvPHxw/D9+XVXhgiwhdYAxJZkcF2HouMTtJ 6dyATojCXmxPz98BA6bTU8pCtMTZ2w7F6vi5shfoFlU6wx8rPkrZJHfOqDF3waMKTT7cB3 dAr9HmVPty0avmcma7M6sdGCAheKGIGpAW+rmtrXU48qVxiP7+IcbiUZ7xIgeXu+tlsR4K 0fo6Hm8KNTCnQwyAlNBuiDdp1xRCxH1Ty7tPtClIkhCQJEEW3CRNEXP84R+iFeHw8eSeX9 FTlXyrMbULPKpjv+spRFh7J6pEDUYs2BfOc1/P+An9CTT0b7riaXD1pgxhhw5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741037907; a=rsa-sha256; cv=none; b=Qzt/Yv4xq+d5ggTJ/nn+RGzjup883tvOhS7xUAWvAJmATwMAGW0SJfmZ85P6sgQvEoLxra AAS9sUnkdY82kM+Xwad2fBzvGyCffRyEXHByqOm74QAs5woI8ugo/JjmtY08V4gbJJucsL LC2DdJ+IfR9/gJPsWJO82qafvnHuogO9IntfwbAkjIvKPct3rHynFtrb/OnewaJwMa9uzC ylr3/Rsl23TKwXhQBJicMHAxTGdImOpKLE88SCONSsCcu8/14TRMsqy2wPKmp6PDb9YOke kTHHIpYoFpE1NvLNYIwF/iktPNKA3f8I7VUCxrOMjSfclNlSPk3FiVmMGB+G7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741037907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9hloEnziclR4TIhkUx3FiU7L/7fYJtQ3hZRW9Yt9Ew=; b=FyEThqpWIM6kkC2vM7A4dJlpeaujokolzA2V/IY2qMLRNd5OxOw5wMDJKfqCLKKY3FoUj+ 9NAlN9PuWz9v2b8+BuJaNzLi4FvqKfa5qhrQ6EO/nZRM1NjkDRuifj1Y4sZpfnAKdANLob 1kNru+NCAfdMJENnCkUjNPNmreYnDUwSLIyPDVH8PJHP2Fnsg/OVq0PyKKDJQGzHFLWBs0 wR/AuCdLcg+mEFSuiz2IF2neWqXzOAnn+QsdIh278K+dCuHmADD4edmTIQ3gn9K1GFubIz Tw5z3Z68eUU4Qt6/gfGWov6oNX19nIp8TZ5U5AWb6NpNJzwr5A2ev/1O8n0dWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6ByC4FPfz14tV; Mon, 03 Mar 2025 21:38: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 523LcROH007822; Mon, 3 Mar 2025 21:38:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523LcRUr007819; Mon, 3 Mar 2025 21:38:27 GMT (envelope-from git) Date: Mon, 3 Mar 2025 21:38:27 GMT Message-Id: <202503032138.523LcRUr007819@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: 498b0abe55ea - main - sys/efi_map.h: Forward declare struct efi_map_header List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 498b0abe55eaace4615ca5cfba1fe6cc6129a3dd Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=498b0abe55eaace4615ca5cfba1fe6cc6129a3dd commit 498b0abe55eaace4615ca5cfba1fe6cc6129a3dd Author: John Baldwin AuthorDate: 2025-03-03 21:37:00 +0000 Commit: John Baldwin CommitDate: 2025-03-03 21:38:13 +0000 sys/efi_map.h: Forward declare struct efi_map_header This fixes build failures in the test-includes stage of buildworld on powerpc which does not define a struct efi_map_header type in its header. Fixes: 125877c92d16 ("arm64: Split EFI map parsing code to a common file") --- sys/sys/efi_map.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/efi_map.h b/sys/sys/efi_map.h index 4edabd4e5812..8b458cd08b00 100644 --- a/sys/sys/efi_map.h +++ b/sys/sys/efi_map.h @@ -10,6 +10,8 @@ #include #include +struct efi_map_header; + typedef void (*efi_map_entry_cb)(struct efi_md *, void *argp); void efi_map_foreach_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, From nobody Mon Mar 3 21:53:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6CHp1sG5z5nnM5; Mon, 03 Mar 2025 21:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6CHp10Wkz3TSJ; Mon, 03 Mar 2025 21:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741038822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=REHjZAU2mmp9RXDNRHWIeT4/U9CPa/9jDMWdE7IHBvo=; b=yIL5YXyvTOz/iVLJxOGrAylOL7PqZppFhDTraR+r9DW5onDTUgODxRKg3ANymf5NWQgs80 SwQY6jZ5CzjIdnTiPKzlXkAOun22CMbntbLdn5ODa/CRTwn74k2JbxwZe1NntcOYfxxLRl jsIHo1rByfk1zusrPAwY8jwfZ5bptVEsKEZ9YApmq0OF7ivH1ixCtASq9wYwqhxCfytnus 5uEiqeMOK79BMd4O5W7qxCgafJEIo3OlrsJiPnKZCZhodUTF6l7XLCgt3ZGUtEjzsepvt7 0Ufyb6pvrCq3U0Nfc7Zpwz8oekAEFPBgABZcRaXqKFjMlKTvbg384hjy3slmdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741038822; a=rsa-sha256; cv=none; b=HTaGxZP7duuvlEYqvIw2bXJQGY2A6GmIAg1TgPmO9ol873qfPne5+vEEMf5/havdHFRy+M pNuvJdUUfNuyAuvGRk3fEX8EwD63vb8KSzj9/Twf3O+/xs38od10L4qvxaYLzxyl5eBctb x8ZKEIf+ZpVOZp5iff9A9l5mEQwy73oQj7L1FKTLgxmqteFWbpfGrmxQlQX2Gygqr9Q2U+ Khr+R2qdcpiusQLnZviigdYscy6VIpdVKLGg8zu7gEIuEntL0k4+CakzHeUkvkJLybA8F1 rXOGuSQvKzf4QjMGcQnNBSVeyTmXC/oa35A0UDNETAEdNHAYMt+W5KrfR/5joQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741038822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=REHjZAU2mmp9RXDNRHWIeT4/U9CPa/9jDMWdE7IHBvo=; b=LbXXQg5l8GTdBiaPGaRwu/IBkD6DqZa+Vh27KC3pTp6c0GUfXqF5dy8hrza/UgpXybjTXN aocG9qgFfQ5AhegDjemor4p8XoupkAG+Sg2oDX4gx1sSkPTxEmuHRVhspsWcPjX9SUfOk4 lFpvBQ+PkkJHtG+SWIFXgzL8yUoIF2u8GieBZiUHA0j6W8shJP4uRoHaW21VRx5OIET4cM 7r1I02pGJxcLDVboAq3Xc48KjvLgYPD1TmKqKxF0ks8CrN0nfD7TLoYtUFPc17o7O8zqYj ZwXzspsIWaS6Lx0X0cx+VZkd9m8L0kJleSgsvLY5qHt7JpUIr65SYUJPW+yVhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6CHp0bXjz14k8; Mon, 03 Mar 2025 21:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 523Lrfpi042788; Mon, 3 Mar 2025 21:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523LrfpL042785; Mon, 3 Mar 2025 21:53:41 GMT (envelope-from git) Date: Mon, 3 Mar 2025 21:53:41 GMT Message-Id: <202503032153.523LrfpL042785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: ccf7b62bd88c - main - loader: allow fs modules to use ioctl() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccf7b62bd88c6c8beba915eab058f99212a32d35 Auto-Submitted: auto-generated The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf7b62bd88c6c8beba915eab058f99212a32d35 commit ccf7b62bd88c6c8beba915eab058f99212a32d35 Author: Toomas Soome AuthorDate: 2025-03-03 21:52:55 +0000 Commit: Toomas Soome CommitDate: 2025-03-03 21:52:55 +0000 loader: allow fs modules to use ioctl() Currently only directly opened disk device is allowed to access ioctl() - that is, when file has F_RAW flag set. The problem is, file systems might need to determine the device parameters, and we could use already opened device descriptor to communicate this information. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49077 --- stand/libsa/ioctl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stand/libsa/ioctl.c b/stand/libsa/ioctl.c index 0c8613499ceb..cc592a454812 100644 --- a/stand/libsa/ioctl.c +++ b/stand/libsa/ioctl.c @@ -70,12 +70,12 @@ ioctl(int fd, u_long cmd, void *arg) errno = EBADF; return (-1); } - if (f->f_flags & F_RAW) { + if (f->f_dev == NULL) + errno = EIO; + else errno = (f->f_dev->dv_ioctl)(f, cmd, arg); - if (errno) - return (-1); - return (0); - } - errno = EIO; - return (-1); + + if (errno != 0) + return (-1); + return (0); } From nobody Mon Mar 3 21:54:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6CK53S4Cz5nn4c; Mon, 03 Mar 2025 21:54: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 4Z6CK537gvz3VMV; Mon, 03 Mar 2025 21:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741038889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A70jEwo0caPK1nJZ+7klec1K1wPOFPntHptyfRleUts=; b=ZwWbkoojDMedCsLSFoMwMgdbNMS6bCpDoN9QGfWdkRZwJsgZ5w2vGkLDEImG8zxTM7cz/u 3DlQPgD/33enSgcoKr1zo2HKismgooaQgaGJBfYXwB92AR7L/d8a9Vr2E1fgYMmGx0kUQu 6aqnZUrfOCE7rxqRpsnR23FX/J6w0Z8IHZsM22QsQ92DDlkFI89ARd+uS0byX/xhO3lWYZ g4GjmXsT9WM5PBA11m7Mb3C8HM14vdpW+0jPH3pgBdU35yOp0GnY21zsmubBL7kw/6oEEu eH1FilM/ufJ+TbOeyggQPAD4E2rmmDHRRm2hifXnspqlBV64SXnlMGRz/+KOQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741038889; a=rsa-sha256; cv=none; b=Q2XCpX3dFBrbkRTxopwyfdwW0tzCPPt1Pj22nDcOx98ubQ7OJrnHRGKUQ7wIM/E0BCR3e3 PxjW6J5Y3Qnhg9vXh1msZ+sysaVvGIfDXmcLKYUSy11LQf6nHGohCtycB2L11mDO4U3RIe z9ZUGATN9ct2qmcXWsu7EazGWcyrF6pSLbZO0k0jsp3mumzcbADMRFvFwdOhX8K6EJ+3E0 f6wDjh9lLOLnQIQNIpDyMQSUk8ObuMBp9xc45Agtkl03RukIecRWR54nobV9gDHQVKf8PA 6FZsYu9O5XvzubqFQN+7nNUsemkao29Z+xelZZtYSOV7wCZ9a5Y/mTPcJN0Xrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741038889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A70jEwo0caPK1nJZ+7klec1K1wPOFPntHptyfRleUts=; b=KAxtKg7c73nG2TyN5eXkwMbsyGehKwDZrdQZmhZ7pdnMCsUp9PaZiY4lgRVifVV4JrkrKf z4c0KQ1yHTr6CBfg5mKfXpOUYWKXqGe+qfpVfuEp+mZJyRQza7hU6Y3R/S3EfFLFTQoehH v4AsFlshM+JbBLdkmloHRbRG559waGL5ISdQBXt/DXqAXBI7kaddQP+pQNONqrWXF0HC6o lqlQn/bVeuEfJBO368NMxOrCrknsLbzkhtV2jN5Pc6PzEwkJv7eRsIG0x8QGhr2HqKB/Yu MYxT8A2ZaLhOgAzlj57dJ9iLQdcdv3/x3MkDsjBSrL3wdlqVCjqhYq92lGjwiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6CK52fckz15HZ; Mon, 03 Mar 2025 21:54: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 523LsnK8043240; Mon, 3 Mar 2025 21:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 523LsnOh043237; Mon, 3 Mar 2025 21:54:49 GMT (envelope-from git) Date: Mon, 3 Mar 2025 21:54:49 GMT Message-Id: <202503032154.523LsnOh043237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: e7c0cb720898 - main - loader: dosfs should be able to work with different sector sizes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7c0cb720898fd36487c4e6b0aff52435084e6bf Auto-Submitted: auto-generated The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=e7c0cb720898fd36487c4e6b0aff52435084e6bf commit e7c0cb720898fd36487c4e6b0aff52435084e6bf Author: Toomas Soome AuthorDate: 2025-03-03 21:54:23 +0000 Commit: Toomas Soome CommitDate: 2025-03-03 21:54:23 +0000 loader: dosfs should be able to work with different sector sizes The current dosfs is only able to use 512B sector sizes, add support for 4kn disks (incidentally this should also add support for 1024B and 2048B sectors, have not tested those). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49078 --- stand/libsa/dosfs.c | 194 ++++++++++++++++++++++++++++++++++------------------ stand/libsa/dosfs.h | 3 + 2 files changed, 131 insertions(+), 66 deletions(-) diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c index 123350263d09..aca198cdf6fa 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -32,6 +32,7 @@ */ #include +#include #include #include @@ -71,10 +72,6 @@ struct fs_ops dosfs_fsops = { .fo_unmount = dos_unmount }; -#define SECSIZ 512 /* sector size */ -#define SSHIFT 9 /* SECSIZ shift */ -#define DEPSEC 16 /* directory entries per sector */ -#define DSHIFT 4 /* DEPSEC shift */ #define LOCLUS 2 /* lowest cluster number */ #define FATBLKSZ 0x20000 /* size of block in the FAT cache buffer */ @@ -92,14 +89,43 @@ typedef struct { u_char heads[2]; /* drive heads */ u_char hidsec[4]; /* hidden sectors */ u_char lsecs[4]; /* huge sectors */ - u_char lspf[4]; /* huge sectors per FAT */ - u_char xflg[2]; /* flags */ - u_char vers[2]; /* filesystem version */ - u_char rdcl[4]; /* root directory start cluster */ - u_char infs[2]; /* filesystem info sector */ - u_char bkbs[2]; /* backup boot sector */ + union { + struct { + u_char drvnum; /* Int 13 drive number */ + u_char rsvd1; /* Reserved */ + u_char bootsig; /* Boot signature (0x29) */ + u_char volid[4]; /* Volume serial number */ + u_char vollab[11]; /* Volume label */ + u_char fstype[8]; /* Informational */ + } f12_f16; + struct { + u_char lspf[4]; /* huge sectors per FAT */ + u_char xflg[2]; /* flags */ + u_char vers[2]; /* filesystem version */ + u_char rdcl[4]; /* root directory cluster */ + u_char infs[2]; /* filesystem info sector */ + u_char bkbs[2]; /* backup boot sector */ + u_char reserved[12]; /* Reserved */ + u_char drvnum; /* Int 13 drive number */ + u_char rsvd1; /* Reserved */ + u_char bootsig; /* Boot signature (0x29) */ + u_char volid[4]; /* Volume serial number */ + u_char vollab[11]; /* Volume label */ + u_char fstype[8]; /* Informational */ + } f32; + } fstype; } DOS_BPB; +typedef struct { + u_char fsi_leadsig[4]; /* Value 0x41615252 */ + u_char fsi_reserved1[480]; + u_char fsi_structsig[4]; /* Value 0x61417272 */ + u_char fsi_free_count[4]; /* Last known free cluster count */ + u_char fsi_next_free[4]; /* First free cluster */ + u_char fsi_reserved2[12]; + u_char fsi_trailsig[4]; /* Value 0xAA550000 */ +} DOS_FSINFO; + /* Initial portion of DOS boot sector */ typedef struct { u_char jmp[3]; /* usually 80x86 'jmp' opcode */ @@ -117,16 +143,18 @@ static DOS_DE dot[2] = { }; /* The usual conversion macros to avoid multiplication and division */ -#define bytsec(n) ((n) >> SSHIFT) -#define secbyt(s) ((s) << SSHIFT) -#define entsec(e) ((e) >> DSHIFT) -#define bytblk(fs, n) ((n) >> (fs)->bshift) -#define blkbyt(fs, b) ((b) << (fs)->bshift) -#define secblk(fs, s) ((s) >> ((fs)->bshift - SSHIFT)) -#define blksec(fs, b) ((b) << ((fs)->bshift - SSHIFT)) +#define bytsec(fs, n) ((n) >> (fs)->sshift) +#define secbyt(fs, s) ((s) << (fs)->sshift) +#define depsec(fs) (1 << (fs)->dshift) +#define entsec(fs, e) ((e) >> (fs)->dshift) +#define bytblk(fs, n) ((n) >> (fs)->bshift) +#define blkbyt(fs, b) ((b) << (fs)->bshift) +#define secblk(fs, s) ((s) >> ((fs)->bshift - (fs)->sshift)) +#define blksec(fs, b) ((b) << ((fs)->bshift - (fs)->sshift)) /* Convert cluster number to offset within filesystem */ -#define blkoff(fs, b) (secbyt((fs)->lsndta) + blkbyt(fs, (b) - LOCLUS)) +#define blkoff(fs, b) (secbyt(fs, (fs)->lsndta) + \ + blkbyt(fs, (b) - LOCLUS)) /* Convert cluster number to logical sector number */ #define blklsn(fs, b) ((fs)->lsndta + blksec(fs, (b) - LOCLUS)) @@ -154,17 +182,17 @@ static int fatcnt(DOS_FS *, u_int); static int fatget(DOS_FS *, u_int *); static int fatend(u_int, u_int); static int ioread(DOS_FS *, uint64_t, void *, size_t); -static int ioget(struct open_file *, daddr_t, void *, size_t); +static int ioget(DOS_FS *, daddr_t, void *, size_t); static int -dos_read_fatblk(DOS_FS *fs, struct open_file *fd, u_int blknum) +dos_read_fatblk(DOS_FS *fs, u_int blknum) { int err; size_t io_size; daddr_t offset_in_fat, max_offset_in_fat; offset_in_fat = ((daddr_t)blknum) * FATBLKSZ; - max_offset_in_fat = secbyt(fs->spf); + max_offset_in_fat = secbyt(fs, (daddr_t)fs->spf); io_size = FATBLKSZ; if (offset_in_fat > max_offset_in_fat) offset_in_fat = max_offset_in_fat; @@ -172,7 +200,7 @@ dos_read_fatblk(DOS_FS *fs, struct open_file *fd, u_int blknum) io_size = ((size_t)(max_offset_in_fat - offset_in_fat)); if (io_size != 0) { - err = ioget(fd, fs->lsnfat + bytsec(offset_in_fat), + err = ioget(fs, fs->lsnfat + bytsec(fs, offset_in_fat), fs->fatbuf, io_size); if (err != 0) { fs->fatbuf_blknum = ((u_int)(-1)); @@ -193,23 +221,34 @@ static int dos_mount_impl(DOS_FS *fs, struct open_file *fd) { int err; + unsigned secsz; u_char *buf; fs->fd = fd; - if ((buf = malloc(secbyt(1))) == NULL) + err = ioctl(fd->f_id, DIOCGSECTORSIZE, &secsz); + if (err != 0) { + return (err); + } + + buf = malloc(secsz); + if (buf == NULL) return (errno); - if ((err = ioget(fs->fd, 0, buf, secbyt(1))) || + + if ((err = ioget(fs, 0, buf, secsz)) || (err = parsebs(fs, (DOS_BS *)buf))) { free(buf); return (err); } - free(buf); + fs->secbuf = buf; - if ((fs->fatbuf = malloc(FATBLKSZ)) == NULL) + if ((fs->fatbuf = malloc(FATBLKSZ)) == NULL) { + free(buf); return (errno); - err = dos_read_fatblk(fs, fd, 0); + } + err = dos_read_fatblk(fs, 0); if (err != 0) { + free(buf); free(fs->fatbuf); return (err); } @@ -292,6 +331,7 @@ dos_unmount_impl(DOS_FS *fs) { if (fs->links) return (EBUSY); + free(fs->secbuf); free(fs->fatbuf); free(fs); return (0); @@ -305,7 +345,7 @@ dos_open(const char *path, struct open_file *fd) { DOS_DE *de; DOS_FILE *f; - DOS_FS *fs; + DOS_FS *fs = NULL; dos_mnt_t *mnt; const char *dev; u_int size, clus; @@ -408,7 +448,7 @@ dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid) if (c != 0) off += blkoff(f->fs, (uint64_t)c); else - off += secbyt(f->fs->lsndir); + off += secbyt(f->fs, f->fs->lsndir); err = ioread(f->fs, off, buf, n); if (err != 0) goto out; @@ -588,36 +628,54 @@ dos_readdir(struct open_file *fd, struct dirent *d) static int parsebs(DOS_FS *fs, DOS_BS *bs) { - u_int sc; + u_int sc, RootDirSectors; - if ((bs->jmp[0] != 0x69 && - bs->jmp[0] != 0xe9 && - (bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) || - bs->bpb.media < 0xf0) + if (bs->bpb.media < 0xf0) return (EINVAL); - if (cv2(bs->bpb.secsiz) != SECSIZ) + + /* Check supported sector sizes */ + switch (cv2(bs->bpb.secsiz)) { + case 512: + case 1024: + case 2048: + case 4096: + fs->sshift = ffs(cv2(bs->bpb.secsiz)) - 1; + break; + + default: return (EINVAL); + } + if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1)) return (EINVAL); - fs->bsize = secbyt(fs->spc); + fs->bsize = secbyt(fs, fs->spc); fs->bshift = ffs(fs->bsize) - 1; - if ((fs->spf = cv2(bs->bpb.spf))) { + fs->dshift = ffs(secbyt(fs, 1) / sizeof (DOS_DE)) - 1; + fs->dirents = cv2(bs->bpb.dirents); + fs->spf = cv2(bs->bpb.spf); + fs->lsnfat = cv2(bs->bpb.ressec); + + if (fs->spf != 0) { if (bs->bpb.fats != 2) return (EINVAL); - if (!(fs->dirents = cv2(bs->bpb.dirents))) + if (fs->dirents == 0) return (EINVAL); } else { - if (!(fs->spf = cv4(bs->bpb.lspf))) + fs->spf = cv4(bs->bpb.fstype.f32.lspf); + if (fs->spf == 0) return (EINVAL); - if (!bs->bpb.fats || bs->bpb.fats > 16) + if (bs->bpb.fats == 0 || bs->bpb.fats > 16) return (EINVAL); - if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS) + fs->rdcl = cv4(bs->bpb.fstype.f32.rdcl); + if (fs->rdcl < LOCLUS) return (EINVAL); } - if (!(fs->lsnfat = cv2(bs->bpb.ressec))) - return (EINVAL); + + RootDirSectors = ((fs->dirents * sizeof (DOS_DE)) + + (secbyt(fs, 1) - 1)) / secbyt(fs, 1); + fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats; - fs->lsndta = fs->lsndir + entsec(fs->dirents); + fs->lsndta = fs->lsndir + RootDirSectors; if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs))) return (EINVAL); if (fs->lsndta > sc) @@ -625,7 +683,7 @@ parsebs(DOS_FS *fs, DOS_BS *bs) if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS) return (EINVAL); fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32; - sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1; + sc = (secbyt(fs, fs->spf) << 1) / (fs->fatsz >> 2) - 1; if (fs->xclus > sc) fs->xclus = sc; return (0); @@ -672,7 +730,7 @@ namede(DOS_FS *fs, const char *path, DOS_DE **dep) static int lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep) { - static DOS_DIR dir[DEPSEC]; + DOS_DIR *dir; u_char lfn[261]; u_char sfn[13]; u_int nsec, lsec, xdn, chk, sec, ent, x; @@ -686,9 +744,10 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep) } if (!clus && fs->fatsz == 32) clus = fs->rdcl; - nsec = !clus ? entsec(fs->dirents) : fs->spc; + nsec = !clus ? entsec(fs, fs->dirents) : fs->spc; lsec = 0; xdn = chk = 0; + dir = (DOS_DIR *)fs->secbuf; for (;;) { if (!clus && !lsec) lsec = fs->lsndir; @@ -697,9 +756,10 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep) else return (EINVAL); for (sec = 0; sec < nsec; sec++) { - if ((err = ioget(fs->fd, lsec + sec, dir, secbyt(1)))) + if ((err = ioget(fs, lsec + sec, dir, + secbyt(fs, 1)))) return (err); - for (ent = 0; ent < DEPSEC; ent++) { + for (ent = 0; ent < depsec(fs); ent++) { if (!*dir[ent].de.name) return (ENOENT); if (*dir[ent].de.name != 0xe5) { @@ -866,14 +926,14 @@ fatget(DOS_FS *fs, u_int *c) /* ensure that current 128K FAT block is cached */ offset = fatoff(fs->fatsz, val_in); nbyte = fs->fatsz != 32 ? 2 : 4; - if (offset + nbyte > secbyt(fs->spf)) + if (offset + nbyte > secbyt(fs, fs->spf)) return (EINVAL); blknum = offset / FATBLKSZ; offset %= FATBLKSZ; if (offset + nbyte > FATBLKSZ) return (EINVAL); if (blknum != fs->fatbuf_blknum) { - err = dos_read_fatblk(fs, fs->fd, blknum); + err = dos_read_fatblk(fs, blknum); if (err != 0) return (err); } @@ -918,53 +978,55 @@ static int ioread(DOS_FS *fs, uint64_t offset, void *buf, size_t nbyte) { char *s; - size_t n; + size_t n, secsiz; int err; uint64_t off; - u_char local_buf[SECSIZ]; + secsiz = secbyt(fs, 1); s = buf; - if ((off = offset & (SECSIZ - 1))) { + if ((off = offset & (secsiz - 1))) { offset -= off; - if ((n = SECSIZ - off) > nbyte) + if ((n = secsiz - off) > nbyte) n = nbyte; - err = ioget(fs->fd, bytsec(offset), local_buf, - sizeof(local_buf)); + err = ioget(fs, bytsec(fs, offset), fs->secbuf, secsiz); if (err != 0) return (err); - memcpy(s, local_buf + off, n); - offset += SECSIZ; + memcpy(s, fs->secbuf + off, n); + offset += secsiz; s += n; nbyte -= n; } - n = nbyte & (SECSIZ - 1); + n = nbyte & (secsiz - 1); if (nbyte -= n) { - if ((err = ioget(fs->fd, bytsec(offset), s, nbyte))) + if ((err = ioget(fs, bytsec(fs, offset), s, nbyte))) return (err); offset += nbyte; s += nbyte; } if (n != 0) { - err = ioget(fs->fd, bytsec(offset), local_buf, - sizeof(local_buf)); + err = ioget(fs, bytsec(fs, offset), fs->secbuf, secsiz); if (err != 0) return (err); - memcpy(s, local_buf, n); + memcpy(s, fs->secbuf, n); } return (0); } /* - * Sector-based I/O primitive + * Sector-based I/O primitive. Note, since strategy functions are operating + * in terms of 512B sectors, we need to do necessary conversion here. */ static int -ioget(struct open_file *fd, daddr_t lsec, void *buf, size_t size) +ioget(DOS_FS *fs, daddr_t lsec, void *buf, size_t size) { size_t rsize; int rv; + struct open_file *fd = fs->fd; /* Make sure we get full read or error. */ rsize = 0; + /* convert native sector number to 512B sector number. */ + lsec = secbyt(fs, lsec) >> 9; rv = (fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, size, buf, &rsize); if ((rv == 0) && (size != rsize)) diff --git a/stand/libsa/dosfs.h b/stand/libsa/dosfs.h index 44fe8eac2595..9d844001a057 100644 --- a/stand/libsa/dosfs.h +++ b/stand/libsa/dosfs.h @@ -94,12 +94,15 @@ typedef union { typedef struct { struct open_file *fd; /* file descriptor */ + u_char *secbuf; /* sector cache */ u_char *fatbuf; /* FAT cache buffer */ u_int fatbuf_blknum; /* number of 128K block in FAT cache buffer */ u_int links; /* active links to structure */ + u_int sshift; /* sector shift */ u_int spc; /* sectors per cluster */ u_int bsize; /* cluster size in bytes */ u_int bshift; /* cluster conversion shift */ + u_int dshift; /* directory entries shift */ u_int dirents; /* root directory entries */ u_int spf; /* sectors per fat */ u_int rdcl; /* root directory start cluster */ From nobody Tue Mar 4 02:21:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6KDx1gSnz5pFmw; Tue, 04 Mar 2025 02:21: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 4Z6KDw6ThZz3rGY; Tue, 04 Mar 2025 02:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741054897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t86nqDKNPs1FrfhqtXa4V+960xnYfPnpDz/KFTTnS2k=; b=sqwasiJ79jPH3yRVJhJ6uqTvu5zWMk2v3AvKsesul6Kk+IfYjZY1JhEQWuv0GDzgIa1c10 Zn92jbisziGfNmb5HGv8RNHp21c36NF3vfosckd17iTaJgoRvZIbs2W4x91fxKvHjqkkX9 Xs4Fov73PBHARfTcr12i4AeBSMNbonvOfthuy6aQL+Pj4kzuUKOWcg2Kqe1sFf4MGw92tK q0y9O1E+6jPA92G1iY3zyOl/PIuZjLFDSLJ9SkPo//1cBTvc+cbp1MfAxM6+MXUTpF084y 3qouNSXOnf7TuKBA/vx2XMpvhzJzdEexOWGce2ULpqZk/1PXopiiGTysPKCc/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741054897; a=rsa-sha256; cv=none; b=Oitp3fne/HwWN9PSe+TAwxvfhbpl+/d9JEMx+lihM1zhV9HcrBArnyF6WAPfJlYvM0bKSX pHXN4s3GbBE/kmN5jKI7LPTbpSD6c29eUsd+jxbT/hcjs9U30qf33BdwDHCH2H3/qaR0YO gMcuiFZ9iQuuqQXYMfh6giElVOacEojpFzicgj3Z6BCew7jF/BjJ+vl4n/uhgbdlgvX76H Lo/OaIxsV9Q20lqJHEE3syikz7G5sCTQI03WRmG2yA7jHmUySsnzvGbWPOj/+GfQSXLsFv 69OnjNM8eSDzCxXi2gSTh94HURDbsriiXOAU6NlifX7P9w7AJAqd+dh7RIDyEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741054896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t86nqDKNPs1FrfhqtXa4V+960xnYfPnpDz/KFTTnS2k=; b=hh/Vh6XlvWDQRBsdogTpiSFUciVGiuwtuAd+A5tEccXSeXQ/PVaaTHUdPI3HhpSNOVLqJ3 pV95RzuUXm9SC4W2i1oGmdFT9dnLoID9fiWH0KDaZfrM6Y8ExQx8GphGWEC3CzJYHCJK3o d8Eav0j77kDHWIrfUzlnx/hJHcq3AvvAtwZx7XswAxO3ROKcGAUfLt0QScZy2cCRySjiMI ecR6UUWUYc9wnLqA+A4qyT4c7LWnsHwmy++bTm+WwlWbnEDho9H7BF+cIAllGltjtrTreA jitSA9jrJ67aLV32eE7qCFVJ8h2QVhhc1BcHJBS10F0g9au+gk1X2w0lDqYeYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6KDw60grz1D37; Tue, 04 Mar 2025 02:21: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 5242LaXM044479; Tue, 4 Mar 2025 02:21:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5242Lag6044476; Tue, 4 Mar 2025 02:21:36 GMT (envelope-from git) Date: Tue, 4 Mar 2025 02:21:36 GMT Message-Id: <202503040221.5242Lag6044476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6ff42c4fafb7 - stable/14 - nfscl: Add support for CB_RECALL_ANY to the NFSv4.1/4.2 client List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ff42c4fafb7684805f1a756c345fcbf1a29c993 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6ff42c4fafb7684805f1a756c345fcbf1a29c993 commit 6ff42c4fafb7684805f1a756c345fcbf1a29c993 Author: Rick Macklem AuthorDate: 2025-02-18 22:34:12 +0000 Commit: Rick Macklem CommitDate: 2025-03-04 02:20:46 +0000 nfscl: Add support for CB_RECALL_ANY to the NFSv4.1/4.2 client Commit f5aff1871d32 and 7e26f1c21049 moved the delegation and layout high water variables into the clientID structure. This patch uses those variables to implement the CB_RECALL_ANY NFSv4.1/4.2 callback. This patch only affects NFSv4.1/4.2 mounts to non-FreeBSD NFS servers that use CB_RECALL_ANY. The Linux knfsd is one example of such a server. (cherry picked from commit 8dc0889f56dd6ac5c33ce79337a971af4b9ff127) --- sys/fs/nfs/nfsproto.h | 11 +++++++++++ sys/fs/nfsclient/nfs_clstate.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index 323746ebbb6c..995754f42b15 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -744,6 +744,17 @@ #define NFSSECINFONONAME_CURFH 0 #define NFSSECINFONONAME_PARENT 1 +/* Bits for CB_RECALL_ANY. */ +#define NFSRCA4_RDATA_DLG 0x00000001 +#define NFSRCA4_WDATA_DLG 0x00000002 +#define NFSRCA4_DIR_DLG 0x00000004 +#define NFSRCA4_FILE_LAYOUT 0x00000008 +#define NFSRCA4_BLK_LAYOUT 0x00000010 +#define NFSRCA4_OBJ_LAYOUT_MIN 0x00000100 +#define NFSRCA4_OBJ_LAYOUT_MAX 0x00000200 +#define NFSRCA4_FF_LAYOUT_READ 0x00010000 +#define NFSRCA4_FF_LAYOUT_RW 0x00020000 + #if defined(_KERNEL) || defined(KERNEL) /* Conversion macros */ #define vtonfsv2_mode(t,m) \ diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 12894e3dcb84..b00de78ef591 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3959,6 +3959,40 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) } NFSUNLOCKCLSTATE(); break; + case NFSV4OP_CBRECALLANY: + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + i = fxdr_unsigned(int, *tl++); + j = fxdr_unsigned(int, *tl); + if (i < 0 || j != 1) + error = NFSERR_BADXDR; + if (error == 0) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + j = fxdr_unsigned(int, *tl); + if (i < 100) + i = 100; + else if (i > 100000) + i = 100000; + NFSLOCKCLSTATE(); + clp = nfscl_getclntsess(sessionid); + if (clp == NULL) + error = NFSERR_SERVERFAULT; + if (((j & NFSRCA4_RDATA_DLG) != 0 || + (j & NFSRCA4_WDATA_DLG) != 0) && + error == 0 && i < + clp->nfsc_deleghighwater) + clp->nfsc_deleghighwater = i; + if (error == 0 && + ((!NFSHASFLEXFILE(clp->nfsc_nmp) && + (j & NFSRCA4_FILE_LAYOUT) != 0 && + i < clp->nfsc_layouthighwater) || + (NFSHASFLEXFILE(clp->nfsc_nmp) && + (j & (NFSRCA4_FF_LAYOUT_READ | + NFSRCA4_FF_LAYOUT_RW)) != 0 && + i < clp->nfsc_layouthighwater))) + clp->nfsc_layouthighwater = i; + NFSUNLOCKCLSTATE(); + } + break; default: if (i == 0 && minorvers != NFSV4_MINORVERSION) error = NFSERR_OPNOTINSESS; From nobody Tue Mar 4 04:20:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6MtQ0JTgz5pRs1; Tue, 04 Mar 2025 04:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6MtP52HPz42lF; Tue, 04 Mar 2025 04:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k3PvC0thFRWQ5IjAlAXLaZIyad9pXFvCCSFUKBoxv7A=; b=G1EGzWOdP8BD5aWbhPE5PoYc2R+K6uFzGJJcsN9F3XeUQQXQ/QiogVhUvv0QWuxmpwaGTv maF8Hi1m0HF+zfZ70qSfLkYJpfykl82IOGHr4OYUqyn9T10RGCrx1ZzIDGp4YXvjAgf/yb SHG0uWNtS2xY1YbfxTrvGNnFzMQJ6SbJ4+sHhtb6yE6fLo7eZlIkbUiEdjI6OF6UiZ409R gVJbDJtSCqGA7MAwhz62aOAC/+cE5vLrXatBEFSDyicYQsq3KkFYMBCbMaUaxjWPzDHf9F qNQ9q7emmi31kHvb8FHY/VasUKxzaDXYub+5M8GjPiOaXoYbcCYaJKmnbAvycA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741062045; a=rsa-sha256; cv=none; b=DmatdYH1PZI+xAr4AJ1AOUbJqvueKdJX9NASQ39UzdkrpNNbAAe8FIAKHHhJ/MkR34TQk5 rCSVtSBKYwVJtu5dB2dEaeS8Bu5IAy4sVUXPNjQqaACk11dIq74G5SvKQ3gBO47B0Ati1H Wfp8y5VQ8c9MVlc6E2TUEqTQ1HGuXlE2Vi0im29caqVMGMFGOQTEqY0//Cyw76uBwpA+CA 3Z2nKw8f82598U0Iap5sgbva9SplK25UhSkLowjSDn7zoyGsc++8zzpEJ/OoHAvuW/3ERt G4mTpOR/fsfcKVfGj4D57WiCGIpZQuGYp5EbrIn8anJocM8fZZyU6KpRGPcG1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k3PvC0thFRWQ5IjAlAXLaZIyad9pXFvCCSFUKBoxv7A=; b=Vwb4fLpg2qxV8afIA8sUIbBDmZvUNx5UBxXQzgAryycTuQE1JywBAtV6qewt3NZ3nODx3F mEvlSxmEh6RfAUUsiR7Jt+Yf+0MXkqWMYdVRNy1WoDq4w0nocmmldRxxGxu7Qcm8fjDGmQ bGMBHUr3PoMc8fufk/xXwShxv5ydNZNbgmi3EwfFc0VH53QRDOLqfpzPi30O2+WpUa2WsG g9lRSKt1UKlgtFlEkpnfAGiz3WKhyjy4Ah+7ssacyC64eP1vSJzpe5WPwT7X+a0z4uolsd uO9a+BibitYGexJHju3HS2UlGDusUO4smHezljY4N7Nz5HrWnIVY+W1AW1vTFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6MtP3fQkz1GrW; Tue, 04 Mar 2025 04:20: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 5244Kj7X065892; Tue, 4 Mar 2025 04:20:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5244KjGi065889; Tue, 4 Mar 2025 04:20:45 GMT (envelope-from git) Date: Tue, 4 Mar 2025 04:20:45 GMT Message-Id: <202503040420.5244KjGi065889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 69b6dc0b920b - stable/14 - libc/gen: split user-visible opendir()-like functions into separate source files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 69b6dc0b920baaf7bd12b83df08ff78155052261 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=69b6dc0b920baaf7bd12b83df08ff78155052261 commit 69b6dc0b920baaf7bd12b83df08ff78155052261 Author: Konstantin Belousov AuthorDate: 2025-02-20 23:32:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-04 04:19:08 +0000 libc/gen: split user-visible opendir()-like functions into separate source files (cherry picked from commit d40daefca64750c1076822bdbd3c409a9519f513) --- lib/libc/gen/Makefile.inc | 2 + lib/libc/gen/fdopendir.c | 56 ++++++ lib/libc/gen/opendir.c | 312 +---------------------------- lib/libc/gen/opendir2.c | 340 ++++++++++++++++++++++++++++++++ lib/libc/gen/telldir.h | 1 + libexec/rtld-elf/rtld-libc/Makefile.inc | 2 +- 6 files changed, 401 insertions(+), 312 deletions(-) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 332edfcd6695..f9f6f3139379 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -54,6 +54,7 @@ SRCS+= __getosreldate.c \ exec.c \ exect.c \ fdevname.c \ + fdopendir.c \ feature_present.c \ fmtcheck.c \ fmtmsg.c \ @@ -112,6 +113,7 @@ SRCS+= __getosreldate.c \ nlist.c \ nrand48.c \ opendir.c \ + opendir2.c \ pause.c \ pmadvise.c \ popen.c \ diff --git a/lib/libc/gen/fdopendir.c b/lib/libc/gen/fdopendir.c new file mode 100644 index 000000000000..67c0766b6d83 --- /dev/null +++ b/lib/libc/gen/fdopendir.c @@ -0,0 +1,56 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "gen-private.h" +#include "telldir.h" + +/* + * Open a directory with existing file descriptor. + */ +DIR * +fdopendir(int fd) +{ + + if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) + return (NULL); + return (__opendir_common(fd, DTF_HIDEW | DTF_NODUP, true)); +} diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index a3864b0939fc..df288d416a2f 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -45,8 +45,6 @@ __SCCSID("@(#)opendir.c 8.8 (Berkeley) 5/1/95"); #include "gen-private.h" #include "telldir.h" -static DIR * __opendir_common(int, int, bool); - /* * Open a directory. */ @@ -54,313 +52,5 @@ DIR * opendir(const char *name) { - return (__opendir2(name, DTF_HIDEW|DTF_NODUP)); -} - -/* - * Open a directory with existing file descriptor. - */ -DIR * -fdopendir(int fd) -{ - - if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) - return (NULL); - return (__opendir_common(fd, DTF_HIDEW|DTF_NODUP, true)); -} - -DIR * -__opendir2(const char *name, int flags) -{ - int fd; - DIR *dir; - int saved_errno; - - if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) - return (NULL); - if ((fd = _open(name, - O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) - return (NULL); - - dir = __opendir_common(fd, flags, false); - if (dir == NULL) { - saved_errno = errno; - _close(fd); - errno = saved_errno; - } - return (dir); -} - -static int -opendir_compar(const void *p1, const void *p2) -{ - - return (strcmp((*(const struct dirent * const *)p1)->d_name, - (*(const struct dirent * const *)p2)->d_name)); -} - -/* - * For a directory at the top of a unionfs stack, the entire directory's - * contents are read and cached locally until the next call to rewinddir(). - * For the fdopendir() case, the initial seek position must be preserved. - * For rewinddir(), the full directory should always be re-read from the - * beginning. - * - * If an error occurs, the existing buffer and state of 'dirp' is left - * unchanged. - */ -bool -_filldir(DIR *dirp, bool use_current_pos) -{ - struct dirent **dpv; - char *buf, *ddptr, *ddeptr; - off_t pos; - int fd2, incr, len, n, saved_errno, space; - - len = 0; - space = 0; - buf = NULL; - ddptr = NULL; - - /* - * Use the system page size if that is a multiple of DIRBLKSIZ. - * Hopefully this can be a big win someday by allowing page - * trades to user space to be done by _getdirentries(). - */ - incr = getpagesize(); - if ((incr % DIRBLKSIZ) != 0) - incr = DIRBLKSIZ; - - /* - * The strategy here is to read all the directory - * entries into a buffer, sort the buffer, and - * remove duplicate entries by setting the inode - * number to zero. - * - * We reopen the directory because _getdirentries() - * on a MNT_UNION mount modifies the open directory, - * making it refer to the lower directory after the - * upper directory's entries are exhausted. - * This would otherwise break software that uses - * the directory descriptor for fchdir or *at - * functions, such as fts.c. - */ - if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) - return (false); - - if (use_current_pos) { - pos = lseek(dirp->dd_fd, 0, SEEK_CUR); - if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { - saved_errno = errno; - _close(fd2); - errno = saved_errno; - return (false); - } - } - - do { - /* - * Always make at least DIRBLKSIZ bytes - * available to _getdirentries - */ - if (space < DIRBLKSIZ) { - space += incr; - len += incr; - buf = reallocf(buf, len); - if (buf == NULL) { - saved_errno = errno; - _close(fd2); - errno = saved_errno; - return (false); - } - ddptr = buf + (len - space); - } - - n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); - if (n > 0) { - ddptr += n; - space -= n; - } - if (n < 0) { - saved_errno = errno; - _close(fd2); - errno = saved_errno; - return (false); - } - } while (n > 0); - _close(fd2); - - ddeptr = ddptr; - - /* - * There is now a buffer full of (possibly) duplicate - * names. - */ - dirp->dd_buf = buf; - - /* - * Go round this loop twice... - * - * Scan through the buffer, counting entries. - * On the second pass, save pointers to each one. - * Then sort the pointers and remove duplicate names. - */ - for (dpv = NULL;;) { - n = 0; - ddptr = buf; - while (ddptr < ddeptr) { - struct dirent *dp; - - dp = (struct dirent *) ddptr; - if ((long)dp & 03L) - break; - if ((dp->d_reclen <= 0) || - (dp->d_reclen > (ddeptr + 1 - ddptr))) - break; - ddptr += dp->d_reclen; - if (dp->d_fileno) { - if (dpv) - dpv[n] = dp; - n++; - } - } - - if (dpv) { - struct dirent *xp; - - /* - * This sort must be stable. - */ - mergesort(dpv, n, sizeof(*dpv), opendir_compar); - - dpv[n] = NULL; - xp = NULL; - - /* - * Scan through the buffer in sort order, - * zapping the inode number of any - * duplicate names. - */ - for (n = 0; dpv[n]; n++) { - struct dirent *dp = dpv[n]; - - if ((xp == NULL) || - strcmp(dp->d_name, xp->d_name)) { - xp = dp; - } else { - dp->d_fileno = 0; - } - if (dp->d_type == DT_WHT && - (dirp->dd_flags & DTF_HIDEW)) - dp->d_fileno = 0; - } - - free(dpv); - break; - } else { - dpv = malloc((n+1) * sizeof(struct dirent *)); - if (dpv == NULL) - break; - } - } - - dirp->dd_len = len; - dirp->dd_size = ddptr - dirp->dd_buf; - return (true); -} - -static bool -is_unionstack(int fd) -{ - int unionstack; - - unionstack = _fcntl(fd, F_ISUNIONSTACK, 0); - if (unionstack != -1) - return (unionstack); - - /* - * Should not happen unless running on a kernel without the op, - * but no use rendering the system useless in such a case. - */ - return (0); -} - -/* - * Common routine for opendir(3), __opendir2(3) and fdopendir(3). - */ -static DIR * -__opendir_common(int fd, int flags, bool use_current_pos) -{ - DIR *dirp; - int incr; - int saved_errno; - bool unionstack; - - if ((dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) - return (NULL); - - dirp->dd_buf = NULL; - dirp->dd_fd = fd; - dirp->dd_flags = flags; - dirp->dd_loc = 0; - dirp->dd_lock = NULL; - dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); - LIST_INIT(&dirp->dd_td->td_locq); - dirp->dd_td->td_loccnt = 0; - dirp->dd_compat_de = NULL; - - /* - * Use the system page size if that is a multiple of DIRBLKSIZ. - * Hopefully this can be a big win someday by allowing page - * trades to user space to be done by _getdirentries(). - */ - incr = getpagesize(); - if ((incr % DIRBLKSIZ) != 0) - incr = DIRBLKSIZ; - - /* - * Determine whether this directory is the top of a union stack. - */ - unionstack = false; - if (flags & DTF_NODUP) { - unionstack = is_unionstack(fd); - } - - if (unionstack) { - if (!_filldir(dirp, use_current_pos)) - goto fail; - dirp->dd_flags |= __DTF_READALL; - } else { - dirp->dd_len = incr; - dirp->dd_buf = malloc(dirp->dd_len); - if (dirp->dd_buf == NULL) - goto fail; - if (use_current_pos) { - /* - * Read the first batch of directory entries - * to prime dd_seek. This also checks if the - * fd passed to fdopendir() is a directory. - */ - dirp->dd_size = _getdirentries(dirp->dd_fd, - dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); - if (dirp->dd_size < 0) { - if (errno == EINVAL) - errno = ENOTDIR; - goto fail; - } - dirp->dd_flags |= __DTF_SKIPREAD; - } else { - dirp->dd_size = 0; - dirp->dd_seek = 0; - } - } - - return (dirp); - -fail: - saved_errno = errno; - free(dirp->dd_buf); - free(dirp); - errno = saved_errno; - return (NULL); + return (__opendir2(name, DTF_HIDEW | DTF_NODUP)); } diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c new file mode 100644 index 000000000000..30a9030693e4 --- /dev/null +++ b/lib/libc/gen/opendir2.c @@ -0,0 +1,340 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "gen-private.h" +#include "telldir.h" + +DIR * +__opendir2(const char *name, int flags) +{ + int fd; + DIR *dir; + int saved_errno; + + if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) + return (NULL); + if ((fd = _open(name, + O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) + return (NULL); + + dir = __opendir_common(fd, flags, false); + if (dir == NULL) { + saved_errno = errno; + _close(fd); + errno = saved_errno; + } + return (dir); +} + +static int +opendir_compar(const void *p1, const void *p2) +{ + + return (strcmp((*(const struct dirent * const *)p1)->d_name, + (*(const struct dirent * const *)p2)->d_name)); +} + +/* + * For a directory at the top of a unionfs stack, the entire directory's + * contents are read and cached locally until the next call to rewinddir(). + * For the fdopendir() case, the initial seek position must be preserved. + * For rewinddir(), the full directory should always be re-read from the + * beginning. + * + * If an error occurs, the existing buffer and state of 'dirp' is left + * unchanged. + */ +bool +_filldir(DIR *dirp, bool use_current_pos) +{ + struct dirent **dpv; + char *buf, *ddptr, *ddeptr; + off_t pos; + int fd2, incr, len, n, saved_errno, space; + + len = 0; + space = 0; + buf = NULL; + ddptr = NULL; + + /* + * Use the system page size if that is a multiple of DIRBLKSIZ. + * Hopefully this can be a big win someday by allowing page + * trades to user space to be done by _getdirentries(). + */ + incr = getpagesize(); + if ((incr % DIRBLKSIZ) != 0) + incr = DIRBLKSIZ; + + /* + * The strategy here is to read all the directory + * entries into a buffer, sort the buffer, and + * remove duplicate entries by setting the inode + * number to zero. + * + * We reopen the directory because _getdirentries() + * on a MNT_UNION mount modifies the open directory, + * making it refer to the lower directory after the + * upper directory's entries are exhausted. + * This would otherwise break software that uses + * the directory descriptor for fchdir or *at + * functions, such as fts.c. + */ + if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) + return (false); + + if (use_current_pos) { + pos = lseek(dirp->dd_fd, 0, SEEK_CUR); + if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } + + do { + /* + * Always make at least DIRBLKSIZ bytes + * available to _getdirentries + */ + if (space < DIRBLKSIZ) { + space += incr; + len += incr; + buf = reallocf(buf, len); + if (buf == NULL) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + ddptr = buf + (len - space); + } + + n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); + if (n > 0) { + ddptr += n; + space -= n; + } + if (n < 0) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } while (n > 0); + _close(fd2); + + ddeptr = ddptr; + + /* + * There is now a buffer full of (possibly) duplicate + * names. + */ + dirp->dd_buf = buf; + + /* + * Go round this loop twice... + * + * Scan through the buffer, counting entries. + * On the second pass, save pointers to each one. + * Then sort the pointers and remove duplicate names. + */ + for (dpv = NULL;;) { + n = 0; + ddptr = buf; + while (ddptr < ddeptr) { + struct dirent *dp; + + dp = (struct dirent *) ddptr; + if ((long)dp & 03L) + break; + if ((dp->d_reclen <= 0) || + (dp->d_reclen > (ddeptr + 1 - ddptr))) + break; + ddptr += dp->d_reclen; + if (dp->d_fileno) { + if (dpv) + dpv[n] = dp; + n++; + } + } + + if (dpv) { + struct dirent *xp; + + /* + * This sort must be stable. + */ + mergesort(dpv, n, sizeof(*dpv), opendir_compar); + + dpv[n] = NULL; + xp = NULL; + + /* + * Scan through the buffer in sort order, + * zapping the inode number of any + * duplicate names. + */ + for (n = 0; dpv[n]; n++) { + struct dirent *dp = dpv[n]; + + if ((xp == NULL) || + strcmp(dp->d_name, xp->d_name)) { + xp = dp; + } else { + dp->d_fileno = 0; + } + if (dp->d_type == DT_WHT && + (dirp->dd_flags & DTF_HIDEW)) + dp->d_fileno = 0; + } + + free(dpv); + break; + } else { + dpv = malloc((n+1) * sizeof(struct dirent *)); + if (dpv == NULL) + break; + } + } + + dirp->dd_len = len; + dirp->dd_size = ddptr - dirp->dd_buf; + return (true); +} + +static bool +is_unionstack(int fd) +{ + int unionstack; + + unionstack = _fcntl(fd, F_ISUNIONSTACK, 0); + if (unionstack != -1) + return (unionstack); + + /* + * Should not happen unless running on a kernel without the op, + * but no use rendering the system useless in such a case. + */ + return (0); +} + +/* + * Common routine for opendir(3), __opendir2(3) and fdopendir(3). + */ +DIR * +__opendir_common(int fd, int flags, bool use_current_pos) +{ + DIR *dirp; + int incr; + int saved_errno; + bool unionstack; + + if ((dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) + return (NULL); + + dirp->dd_buf = NULL; + dirp->dd_fd = fd; + dirp->dd_flags = flags; + dirp->dd_loc = 0; + dirp->dd_lock = NULL; + dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); + LIST_INIT(&dirp->dd_td->td_locq); + dirp->dd_td->td_loccnt = 0; + dirp->dd_compat_de = NULL; + + /* + * Use the system page size if that is a multiple of DIRBLKSIZ. + * Hopefully this can be a big win someday by allowing page + * trades to user space to be done by _getdirentries(). + */ + incr = getpagesize(); + if ((incr % DIRBLKSIZ) != 0) + incr = DIRBLKSIZ; + + /* + * Determine whether this directory is the top of a union stack. + */ + unionstack = false; + if (flags & DTF_NODUP) { + unionstack = is_unionstack(fd); + } + + if (unionstack) { + if (!_filldir(dirp, use_current_pos)) + goto fail; + dirp->dd_flags |= __DTF_READALL; + } else { + dirp->dd_len = incr; + dirp->dd_buf = malloc(dirp->dd_len); + if (dirp->dd_buf == NULL) + goto fail; + if (use_current_pos) { + /* + * Read the first batch of directory entries + * to prime dd_seek. This also checks if the + * fd passed to fdopendir() is a directory. + */ + dirp->dd_size = _getdirentries(dirp->dd_fd, + dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); + if (dirp->dd_size < 0) { + if (errno == EINVAL) + errno = ENOTDIR; + goto fail; + } + dirp->dd_flags |= __DTF_SKIPREAD; + } else { + dirp->dd_size = 0; + dirp->dd_seek = 0; + } + } + + return (dirp); + +fail: + saved_errno = errno; + free(dirp->dd_buf); + free(dirp); + errno = saved_errno; + return (NULL); +} diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h index aafa6ac71b1e..6d113491e819 100644 --- a/lib/libc/gen/telldir.h +++ b/lib/libc/gen/telldir.h @@ -103,6 +103,7 @@ struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); void _fixtelldir(DIR *dirp, long oldseek, long oldloc); +DIR *__opendir_common(int, int, bool); #define RDU_SKIP 0x0001 #define RDU_SHORT 0x0002 diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 91eb6f5cabec..8a9480bc746e 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -17,7 +17,7 @@ CFLAGS+= -I${SRCTOP}/libexec/rtld-elf/rtld-libc # redirects all calls to interposed functions to use the non-interposed version # instead. .PATH: ${LIBC_SRCTOP}/gen -SRCS+= opendir.c closedir.c readdir.c telldir.c +SRCS+= fdopendir.c opendir.c opendir2.c closedir.c readdir.c telldir.c # Avoid further dependencies by providing simple implementations of libc # functions such as __error(), etc. From nobody Tue Mar 4 04:20:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6MtR0PwTz5pRh8; Tue, 04 Mar 2025 04:20: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 4Z6MtQ5z1Yz433D; Tue, 04 Mar 2025 04:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4I1VnXhqgVTUeycBizcDfh17QJvVd+Cblg8AQCpr9TI=; b=pG02bLE8PslwTOI6ggUbFh3vgoZHjQ7tav+jZ0pzRuGQI8Ad+IGnhBLd1TyyH4hAJ48Ybb hvuKEU4KcWZhdnMI1hw9TOXvIYZcC+MuZ0Ep6/SWvcmYWYtaoI7ez2cygUOB4aQGbNKB7k 5heClitzqDTJBn1ZBJxD2o1pipj27beO3gRyvd8W6acH0N2aX1oJwF4tr3qq+OfgNbkBDZ uI16kukPplzyK9quZz7BT3t/hxnFc2lpXkYh9B1K+uwfrfnMBRsWLoN8ejNKEBZwUTKHyJ LcvLBzxwL/OIso5cSubUoZj8EPJg4gRRb7c3UmsJTK8UDN+1GKD45hT5dcTD3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741062046; a=rsa-sha256; cv=none; b=g12HsknsCAO0KMM9175CGA7IecmgU0w+39xZFPdF87zXj8U7mQa0NgTWQbwJfW+dXwQ8H+ OCfudmjqJpcCNPg0XBMfviUqwBzs+NTfxuGQtQVvDowUsMtih9N5NAr7EuPIKVRHjnlI/N s8+3VUaNaYQjp7ciUy6g+hSzxaCwOOIwifXxSKC1zgEWt5/ZKPnddoGS53vGv+JwL7quKL OEdusAAnZFyx+1KdeA11hdjeB0DoiGeFc3Ur7o5l8CRrT2eQEq+bcc7ThniN9wlLUU1zLr FvSnH6SasktcB+iFwV9cLF1eRuEz414FrQYM7QDTMtn2vTBGRxC/z41tLTdQHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4I1VnXhqgVTUeycBizcDfh17QJvVd+Cblg8AQCpr9TI=; b=FR97O7LBCjv1VMQNcfXfOzyLpmfP98lbe0Hh/WJyFE3YT+fL4wsjVrTn0bWqrK8b5mg1Uu 3BxuO7soFysEWgB1LJeMvmp9JHzmrqqst9yK6o/+/v4xTXU6sgby7zi3HeXsroF/+1VxxB 2zWJ431ypKY519uGX8qqGfkeOoEt5dHOWRHotR9i36H9pIRXI1PhHcWzWy7YLTnUrAdw0Q JFkoluBqpJcBcgm9jghoMJLVssFz2D2vJZ1nWeebpLGN6yZCWqfRYcNUrHAt4VLV0Sz3zG e0hiHwAZTWoB4vsbTfBmlxkeZQe2natQK3F12Jmyz6xaQcjo3YVtvHp9xVTcYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6MtQ4YT1z1Gpt; Tue, 04 Mar 2025 04:20: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 5244KkOS065926; Tue, 4 Mar 2025 04:20:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5244Kkrk065923; Tue, 4 Mar 2025 04:20:46 GMT (envelope-from git) Date: Tue, 4 Mar 2025 04:20:46 GMT Message-Id: <202503040420.5244Kkrk065923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9460df357344 - stable/14 - fts(3): be less strict when automount does its job under us walking autofs mount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9460df357344a2848f9cab07a5228cd9615800e1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9460df357344a2848f9cab07a5228cd9615800e1 commit 9460df357344a2848f9cab07a5228cd9615800e1 Author: Konstantin Belousov AuthorDate: 2025-02-21 13:07:43 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-04 04:19:08 +0000 fts(3): be less strict when automount does its job under us walking autofs mount PR: 284914 (cherry picked from commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf) --- lib/libc/gen/fts.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index ff51d2b224c2..a718c4e1e85c 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -1145,6 +1145,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) { int ret, oerrno, newfd; struct stat sb; + struct statfs sf; newfd = fd; if (ISSET(FTS_NOCHDIR)) @@ -1157,9 +1158,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) goto bail; } if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) { - errno = ENOENT; /* disinformation */ - ret = -1; - goto bail; + if (_fstatfs(newfd, &sf) != 0 || + (sf.f_flags & MNT_AUTOMOUNTED) == 0) { + errno = ENOENT; /* disinformation */ + ret = -1; + goto bail; + } + /* autofs might did the mount under us, accept. */ + p->fts_dev = sb.st_dev; + p->fts_ino == sb.st_ino; } ret = fchdir(newfd); bail: From nobody Tue Mar 4 04:20:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6MtS1P57z5pRcF; Tue, 04 Mar 2025 04:20: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 4Z6MtR5wLbz4354; Tue, 04 Mar 2025 04:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ilymp5auoNW5B78NOOhw5hJ8lDoD8H9C9RccmG207gU=; b=pfLde9Sv7ikxIwClYCGuGhhImOlZrpCl0pNyU1pXRov7k6WRGfH73/2oDTEXvzGWBmh+7Q rdqXSIdc4A/P4yqdw9V9tG2Tmv6u2Q3f6ozF3vcM67IRu0J3uEXHgGdt4mBYXmsRt9wg+Q YDsWUuHcAozqY6BqWWqnEWjPfOrQiJvImdgwFeKaeq8xdFCfB781A2K7Nz3i15x/Keo7y9 7txuLuyHLIjYUNX6zsxFyYPgq321WeR0qX3ORN6VyYKj+5VhTbJufvFfS8B/ZoKp/UFHXc u267UbXx4DBA33KnCoC8A7q/MaOKW4J96OlC6ndiS4B9idD7TWKG7PApRbwQeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741062047; a=rsa-sha256; cv=none; b=EugOc05QExdU1uv3zEVRC1uQGctQdtwhGe3cR5iOEdIVN8V8mjCCSIK9iK26OY0VKocPmg 0pOl4LCfFKI1IpbU8JdhGRM+7GhUDEsXrwHLiiR6oKh+bhRcLKm7dsOED6IGDd/JE5Eu5B ubjkt3lpmQ6+FkQT+k6qR4r7XvOc58Oi+lwm/6Zz4WbVtsYc4cZTUqOxAy07Hey1dhXFhA +1OHpZVZm5XZlUzDDfAmd+gyxdu4+JaNJc1/Hn8In6b4TnON5PhnNVrFHD1oWxAVhovu5b LOrsmYlTOwQerahnxgr0ONxVt/FbDLzhSaDUduRGfYLAwlEDlefHgrcvcIDjZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ilymp5auoNW5B78NOOhw5hJ8lDoD8H9C9RccmG207gU=; b=Dm+gVNL2jiDVTIVrG5YTZP8mdWOubW2jXL2tTjDs6cTFDjyM893t/ZkH+cwXf0k4Edcgvg nn4qRLdRPMxM8oVAvU9wZRMEo/sIQya6Dv0XGS2iNz0H8UYBAEBA0VRB3rk6M4C1h0gRFy JYEAi22B92QQrYzro7ED0rYUZeH98Jzt3ZppxRKafSMumPFbNZZIakGQQeTAEABf+VG9UE jugrkQlbWDiXmca6N1VCpcdm60ZgtTwOK0nlzFNqZ8VF6ILKg9NmEZjJbn4ADOC4Q9xxiE rs+yYHp0aplP+3iOJZJp3CFn1CXSe1gy673gq8fTyFeFvCDioWIEwxPzz9WCjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6MtR5Vlkz1HMK; Tue, 04 Mar 2025 04:20: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 5244Kl70065959; Tue, 4 Mar 2025 04:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5244KlLI065956; Tue, 4 Mar 2025 04:20:47 GMT (envelope-from git) Date: Tue, 4 Mar 2025 04:20:47 GMT Message-Id: <202503040420.5244KlLI065956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2d1b1c1aaa68 - stable/14 - libc/gen/fts.c: fix assignment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2d1b1c1aaa6883f8494846e36fc4e3a9c49d3c53 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2d1b1c1aaa6883f8494846e36fc4e3a9c49d3c53 commit 2d1b1c1aaa6883f8494846e36fc4e3a9c49d3c53 Author: Stefan Eßer AuthorDate: 2025-02-27 09:29:17 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-04 04:19:08 +0000 libc/gen/fts.c: fix assignment Fixes: e59991206b fts(3): be less strict when automount does its job under us walking autofs mount (cherry picked from commit ab6a311c720e93c860d3dd4a335264d725db7a0d) --- lib/libc/gen/fts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index a718c4e1e85c..64828ff73d60 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -1166,7 +1166,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) } /* autofs might did the mount under us, accept. */ p->fts_dev = sb.st_dev; - p->fts_ino == sb.st_ino; + p->fts_ino = sb.st_ino; } ret = fchdir(newfd); bail: From nobody Tue Mar 4 04:25:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6Mzk2zjZz5pSBc; Tue, 04 Mar 2025 04:25: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 4Z6Mzk2Q5tz46FR; Tue, 04 Mar 2025 04:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kbpZZNb804iiUdsDXYOyEnUy7rAVLn1RPMUMsWF8dRI=; b=DIvmu2W+s6G2/RjIi3Svzy/adP6cYpNJbqDtvRKBM36TZ8O/7XQuo4GEBidE3WHcxVMNFT 1M+BDrFWgsHY6QR5Ykv3b42Uq2bm/oh4e28X6wqq2K3tHSrfaVrUBl3W6CSMlVJA97SUxQ cjfM57gFSX2AB15cqhimijs62n9FcfX2vnMlzposXNHuMOmy7borkF9Bq6nIEn5D5rJCkL 4a5BQDEPx8dUkmSWUMpP3lYGjSKvbUlcU917sVAhH/4PBkqDXYlWb/xlc+JxmWRQV7ez9b FQFFNc4KCEECF7+aSVKG5G/Hq/lr3rXrSbtAxI+OA6MlMpOHy9mvbDpISZzmFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741062322; a=rsa-sha256; cv=none; b=a/agzwG4tqasQtTNmZLWRr8bH2+dTsmyDUUc7JSDFHkwyHujxWhwexixpvgpGYqoN1/DAk lHV3/eT+5T+7qHtETLtkwhqT3H+tSBR4KeMkh4/Rv3733ZrYiZ6Pk5Wwr4MpflG4NVMv/B yiaN2jVEy1PJc71nekl9LgpvGJZCzOOJzfiQ7t+Y4VveCzBOSXd5tmmWu5ljX+fwjyWFuv XCFFSM6ugz5SwZvdhjWtWb+XbXlaKaH0ngOLI3ziXzLWKD6ETSAapU91Ggv3+jEP75RK8o FiaKP0T0U/KmJ1Lw3Kk8spewOwehhH2Yzp2uCuN+thfjnQEgxGhO160S8sqhzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741062322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kbpZZNb804iiUdsDXYOyEnUy7rAVLn1RPMUMsWF8dRI=; b=aWyxu+xoVp65OUXjheLbxbZulwDM7ig7cp9Up8ak1tUIzw40CEQGcf21vME36wTupYDIUF k3eoBYic96cqwa3IzcwRQ1zwM+3moT+egstkh9poC/vilqAvi5XWQHCRPB31pEzKgcQrR0 OLmYiFTmdkRlw4Ymne9DrB3mHYKKU1dAYn92HfghLEFsKBKdAeBzHb8PhAx020tcLz1q/E 2GZbdmc3GemO5c4vlumm1rMZMSZsecH7gzF1VNLoRzNv3XTI5EwYd/v1sgVBIRWOeQrZq6 WhRnbOb0w5gPfH9R5uBi4p90dymCiLUxOdiggIZvLwfpeuRtq2v/7BVaveIEUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6Mzk1nYDz1H95; Tue, 04 Mar 2025 04:25: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 5244PMh0072927; Tue, 4 Mar 2025 04:25:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5244PMkO072924; Tue, 4 Mar 2025 04:25:22 GMT (envelope-from git) Date: Tue, 4 Mar 2025 04:25:22 GMT Message-Id: <202503040425.5244PMkO072924@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: cb991a228179 - main - amd64 csu: microoptimize startup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb991a228179639cc0568fdd5d4b4b07b6f47b5a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cb991a228179639cc0568fdd5d4b4b07b6f47b5a commit cb991a228179639cc0568fdd5d4b4b07b6f47b5a Author: Konstantin Belousov AuthorDate: 2025-03-02 23:54:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-04 04:24:59 +0000 amd64 csu: microoptimize startup Reorder operations to reduce moving the values among registers. Use the LEA instruction to combine arithmetic with the moves. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D49206 --- lib/csu/amd64/crt1_s.S | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/csu/amd64/crt1_s.S b/lib/csu/amd64/crt1_s.S index f7ea076d94f1..3ceea9289330 100644 --- a/lib/csu/amd64/crt1_s.S +++ b/lib/csu/amd64/crt1_s.S @@ -49,15 +49,12 @@ _start: #ifdef GCRT subq $16, %rsp #endif - movq %rsi, %rcx - movq %rdi, %rsi /* argv = ap */ - addq $8, %rsi /* argv += 1 */ - movq %rdi, %rdx /* env = ap */ - addq $16, %rdx /* env += 2 */ - movslq (%rdi), %rax - movl %eax, %edi /* argc = *(long *)(void *)ap */ - shlq $3, %rax - addq %rax, %rdx /* env += argc */ + movq %rsi, %rcx /* cleanup */ + movslq (%rdi), %rax /* long *ap; tmpargc = *ap */ + leaq 0x8(%rdi), %rsi /* argv = ap + 1 */ + leaq 0x10(%rdi, %rax, 8), %rdx /* env = ap + 2 + tmpargc */ + movl %eax, %edi /* argc = tmpargc */ + #ifdef PIC /* * XXX. %rip relative addressing is not intended for use in the From nobody Tue Mar 4 04:58:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6Nk25kxjz5pVq7; Tue, 04 Mar 2025 04:58: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 4Z6Nk24HPlz3Vds; Tue, 04 Mar 2025 04:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741064314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vnYrnhLhKh/9d1IxFtpGVMwj8dEUpveO9R7BYu+ST8M=; b=D6BF810kFS5GTYIo/D1F3UEUBNgd1IMT9G9Sp+8UtbRAffFApG2y4N/GL8PRi6vhHKeEF9 P9bj26E01L9T+3R5FN+jMs0gclBlYBFZGmRgErymMtBHqOrmtVj3X7RaML69HvUdjcdDwU KR30IsvSEtcf8ZSFT2TM+H8xaZT6it/5N+Y7iqzQRNNyH2WQa8+Kr7aTiLrhWwO7zRgeer 8LyPmQnsQLPOKgxxmetZF50S5NC7mVwRdMN0RadDZSBzqF5l2cea91029BGcNSa7l0X7IX aUZwrKied9YhVyGXIhqpRypTDNxg4SLFmX2pU+Pjymev4aPUi64oq7Ys6nl2Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741064314; a=rsa-sha256; cv=none; b=KnpZRm7Kh4tQy3p/6SXtC6ROxmHc9y8CFYgMnYB3rAl3vBO3Y8hEH74wA9rP3zRrCXFmf8 QB90DD5qQamUWsTkAl1vilZMkl5B4CkL1CYmZESOvns4waOdCUyuz8WVSD7h4xL+kxCb6U DGO2wlSUxb2LJIgphEkDO6Cxy3h77CUO/DOI0IAp5GgcKf6Ka0t33HNd9po6BjqbO4/yXU bzzDM03GAjzcBg3RlaRrQeVzfuN9E+HMI3JSSOZz649ZKJlWs/FNnJd6sQGED/Mqd8Ctp+ HUaPNTHLnSM6067hQXPaFMqtenq8w23rYK8kSDGHp9C6Ag3Ebrto9I1NHpZKlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741064314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vnYrnhLhKh/9d1IxFtpGVMwj8dEUpveO9R7BYu+ST8M=; b=UNc5IulsFOTEz9O8dVRDk3jvE5PTqy7I81fRTnS8VjIG7IJsjyBVB9/KZcjrgpjr6Q9wJ2 EmRmozb9Lks5XhspWMtYV/hCCvTt9YsXLH9NlYwZF38QjaFTbBFXe5wVn/1NHIk63g+j7H MFifoyeL6Td+ZPH29Nkf1TUwlslfQEyEyOcZoxb8sZr/XWJeYKF9jLfxQnCsq57UgrKmcN pz026kl816bQ0Po4U9o1bNDdVjNxFoGYx8x4gbrkDt83e3orN84wuaYuGM0KLFe0/4BDLc 6RIvLwPeRdRV9HAqylteTR7U1mseojFxUoleYy/qSfXC1xUXjx4Ugfp8mfoHzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6Nk23HkKz1JBD; Tue, 04 Mar 2025 04:58: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 5244wY7u029664; Tue, 4 Mar 2025 04:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5244wY5M029661; Tue, 4 Mar 2025 04:58:34 GMT (envelope-from git) Date: Tue, 4 Mar 2025 04:58:34 GMT Message-Id: <202503040458.5244wY5M029661@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: 85af37e15958 - main - mlx5en: Fix domain set usage in TLS tag import functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85af37e15958bd050093e6368afe6afe8e7a5ced Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=85af37e15958bd050093e6368afe6afe8e7a5ced commit 85af37e15958bd050093e6368afe6afe8e7a5ced Author: Slava Shwartsman AuthorDate: 2025-02-24 18:08:58 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-04 04:58:07 +0000 mlx5en: Fix domain set usage in TLS tag import functions Use the correct device pointer to obtain the domain set for memory allocation. Previously, the functions were incorrectly using the arg parameter directly instead of accessing mlx5_core_dev. Signed-off-by: Slava Shwartsman Sponsored by: NVidia networking MFC after: 1 week --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c | 2 +- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c index 0759cd84c307..6c83de5f3580 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c @@ -118,7 +118,7 @@ mlx5e_tls_tag_import(void *arg, void **store, int cnt, int domain, int flags) for (i = 0; i != cnt; i++) { ptag = malloc_domainset(sizeof(*ptag), M_MLX5E_TLS, - mlx5_dev_domainset(arg), flags | M_ZERO); + mlx5_dev_domainset(priv->mdev), flags | M_ZERO); if (ptag == NULL) return (i); ptag->tls = &priv->tls; 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 55768038c20f..8b8f2e570245 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 @@ -388,11 +388,12 @@ static int mlx5e_tls_rx_tag_import(void *arg, void **store, int cnt, int domain, int flags) { struct mlx5e_tls_rx_tag *ptag; + struct mlx5_core_dev *mdev = arg; int i; for (i = 0; i != cnt; i++) { ptag = malloc_domainset(sizeof(*ptag), M_MLX5E_TLS_RX, - mlx5_dev_domainset(arg), flags | M_ZERO); + mlx5_dev_domainset(mdev), flags | M_ZERO); mtx_init(&ptag->mtx, "mlx5-tls-rx-tag-mtx", NULL, MTX_DEF); INIT_WORK(&ptag->work, mlx5e_tls_rx_work); store[i] = ptag; From nobody Tue Mar 4 05:35:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6PXm4xZ1z5pYyJ; Tue, 04 Mar 2025 05:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6PXm3jq4z3wCs; Tue, 04 Mar 2025 05:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741066536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zm+oJqimgo9SNG3b+x1GQNY00fuY0bfHksiRkqaG8z8=; b=FGN4YTcaI9bWoajSR2ch1LsFmuiCxIEFX5KVJDmD3BYxEHdtr2hZwIE8laQhMxnJCGHOPn 9K/K9xGJHIaYnuq8RnkGZdDp+9tR6x3i0FuCJGJgymU68H75Y+OWIgHnOw1QxCIEhYJMCD DJeJ575AOWpQROE7pNPbH1sxH6fhJpp/6tkAf9t3vpAiV8XhB9DGfTLF09dnkM25NVR5Ho spF+OnP0cBWDvpjDAt0QtrKnetYpdZ5zqX4LJPzMGMI/5ba9F/3dCUSfocg6mPBBp4Kz4z WGs0qpLMZ2FupORHYZ5OyL39QAHJeMysqkag3TE1KyoRWu8fuT7kERR9l8P6xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741066536; a=rsa-sha256; cv=none; b=NGCBYu6Xrtubnx7EedtOfkVj+Z7JiEKdWpfNo3IwiM6uRjN3qV1V11ss7NOjUtuqN8rxOP dLBBWGkAWGs/Ly5qfiP3GCr19ajtsuZGeOUOyF514QJcTapTSXxSkAxUFe/wjOKZ5Vf3cx JEZdeD3Q14x15TgFFZrFH48Ee/Zvbg4p2SNCAHSlFlLma0Lv/By6VZN0MSCiT9XwWtIwxG k8HZ4fBKoYmCQZ/yFtxAoJ0Sk8jn2RfFKFVgtgSsIfopLhjlWvkjhf4Uhncfh0pjV/hSeE Q7YoN75HEKb+u0RAfUAwegfHZ5qN4nXjxIBnr+lQRTQa9XacnaGzC2qse5D6SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741066536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zm+oJqimgo9SNG3b+x1GQNY00fuY0bfHksiRkqaG8z8=; b=UKqq/Ucl6wT9TK4uUaScbnXjqWn/bYlxZ3ziAl+1AgRkmftHqW2Uzw7+9BgqZ/AuNjaGRm 9q5fMI9XxAAmXx0qLl5W/3rWryf0o8C87NfjOrDShOFr43AMesZDU1MrkfO1HDiTdT3cvu xbsTAyUgP8xdQX11jdQZlr7vMOoDr/iFPlMYLDu8jgc03JLguleU82g41BDnNl6ByvTCab KJFprZZArbG78P88xmgQY45EqAoupmjBnOLrCVpW4Lja4qSK7e4bhHyWIccFheQ6dIb7Yr HXqHHOD5YpySInyFa/tikDGcMkvsn9i+wt6e63O1Al4tp8kEV0QmgAcy8m9WIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6PXm3J5vz1KD0; Tue, 04 Mar 2025 05:35: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 5245Za1u003708; Tue, 4 Mar 2025 05:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5245Zamm003705; Tue, 4 Mar 2025 05:35:36 GMT (envelope-from git) Date: Tue, 4 Mar 2025 05:35:36 GMT Message-Id: <202503040535.5245Zamm003705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: c6c63b92effd - main - vm_object: don't reset new iterator List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6c63b92effd6d0662977f11bf429127b9dc4407 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=c6c63b92effd6d0662977f11bf429127b9dc4407 commit c6c63b92effd6d0662977f11bf429127b9dc4407 Author: Doug Moore AuthorDate: 2025-03-04 05:31:18 +0000 Commit: Doug Moore CommitDate: 2025-03-04 05:31:18 +0000 vm_object: don't reset new iterator Don't call pctrie_iter_reset on a just-initialized iterator. Let the code jumping back up do the resetting. Add an assertion at the jump destination to check that a reset happened. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49207 --- sys/sys/pctrie.h | 6 ++++++ sys/vm/device_pager.c | 2 ++ sys/vm/vm_object.c | 9 +++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index 42473dc8e632..dac18b58498b 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -47,6 +47,12 @@ pctrie_iter_reset(struct pctrie_iter *it) it->node = NULL; } +static __inline bool +pctrie_iter_is_reset(struct pctrie_iter *it) +{ + return (it->node == NULL); +} + static __inline void pctrie_iter_init(struct pctrie_iter *it, struct pctrie *ptree) { diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 0691d43a5946..0b3a2eb54d75 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -293,6 +293,8 @@ cdev_mgtdev_pager_free_pages(vm_object_t object) vm_page_iter_init(&pages, object); VM_OBJECT_WLOCK(object); retry: + KASSERT(pctrie_iter_is_reset(&pages), + ("%s: pctrie_iter not reset for retry", __func__)); for (m = vm_radix_iter_lookup_ge(&pages, 0); m != NULL; m = vm_radix_iter_step(&pages)) { if (!vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL)) { diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 9269103d8d91..79a28c4d77b0 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1576,7 +1576,8 @@ vm_object_split(vm_map_entry_t entry) vm_object_set_flag(orig_object, OBJ_SPLIT); vm_page_iter_limit_init(&pages, orig_object, offidxstart + size); retry: - pctrie_iter_reset(&pages); + KASSERT(pctrie_iter_is_reset(&pages), + ("%s: pctrie_iter not reset for retry", __func__)); for (m = vm_radix_iter_lookup_ge(&pages, offidxstart); m != NULL; m = vm_radix_iter_step(&pages)) { /* @@ -1590,6 +1591,7 @@ retry: VM_OBJECT_WUNLOCK(new_object); if (vm_page_busy_sleep(m, "spltwt", 0)) VM_OBJECT_WLOCK(orig_object); + pctrie_iter_reset(&pages); VM_OBJECT_WLOCK(new_object); goto retry; } @@ -1611,6 +1613,7 @@ retry: VM_OBJECT_WUNLOCK(new_object); VM_OBJECT_WUNLOCK(orig_object); vm_radix_wait(); + pctrie_iter_reset(&pages); VM_OBJECT_WLOCK(orig_object); VM_OBJECT_WLOCK(new_object); goto retry; @@ -1996,7 +1999,8 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, vm_object_pip_add(object, 1); vm_page_iter_limit_init(&pages, object, end); again: - pctrie_iter_reset(&pages); + KASSERT(pctrie_iter_is_reset(&pages), + ("%s: pctrie_iter not reset for retry", __func__)); for (p = vm_radix_iter_lookup_ge(&pages, start); p != NULL; p = vm_radix_iter_step(&pages)) { /* @@ -2025,6 +2029,7 @@ again: if (vm_page_tryxbusy(p) == 0) { if (vm_page_busy_sleep(p, "vmopar", 0)) VM_OBJECT_WLOCK(object); + pctrie_iter_reset(&pages); goto again; } if ((options & OBJPR_VALIDONLY) != 0 && vm_page_none_valid(p)) { From nobody Tue Mar 4 08:05:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6St7467fz5pnWn; Tue, 04 Mar 2025 08:05:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6St73Vy3z3SZs; Tue, 04 Mar 2025 08:05:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741075551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5/xcR1fPTKjSZL/MkKCUGYlSczA5zLfYx0F06Ieop4I=; b=PrPBzSjleXDsvMLKrqkkSiWIzCLTj6GmF+4PmDTzW+nIyRRTjh4Z+9FE2zNygy5iUIhkmr 7WVN5lix5ZPDNl7/I1aVNVEN/b+PxFXn+eh/T5KzX1e+VeG24+emUcr/R/u8W65mSsQg3M 4WkW69/qUxTwSvlM0AJNiuSFT6HUy1xExMUf1qBPVCgjPWDEXOrTUjvE/vzDSR8CMapRgl lz3yX4jsjtsKNxah9LpoHjOvdK0w31IaN2en4Wh29R7OY90ut7ABlN5U9zowAMf8icyQvU wf1D3mAqgF4NtmcFkmtPmbjNpZQioQU+gikiAprNPkTE0legM0Mf6wb4nMjnww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741075551; a=rsa-sha256; cv=none; b=NJ5T2v6MpI8AIfnNycxdsiv3nR+BOumHu/72qf15Tgw4AG1p+vVUfH9PUa85humHeFBJY0 gciopY4pM9lKiGur3E2i/wSRYfsByjaibzQdWiJJDfzDqYiBAZpU6ai6YYFOB4R4omnrcR DObY6Q8K+P3AZlzAIDpLrLleVe/EmGBMgP0n/NGDIwYzRMj4DXDxPZ6YVUIRXL2ICoVNWL bu7RwOp2FCqnYGGOatwmnuHZfn8tUhDEVUQv+ncUIMupOdvCbBkwcS/tD/nSMtRIY4LcR5 bh9d23QIw9VT9manMbx3d3xdboBD0/df1Gix1v1YVfAdCL+46+1jZnIeA0mEDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741075551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5/xcR1fPTKjSZL/MkKCUGYlSczA5zLfYx0F06Ieop4I=; b=FJyMbOzUtTvYOYed/+o/UGlZ6RQde6oeBknYu0VCdgxiYzDHEDQeFWF0U+6+DCKQfV1lzf ENimi9AmBGO0P1Cpe2aH9fpatv29pvuQX1h5RrUeR1Zn6br9RA+ur8K9n7fAFvLbPGufej wLR2rOr2qgpz513pq1v82j2tmbn63S8hI4DFXWOB0ncuNsFQ/Q843Z7Uag4LCvc6cWeQ1/ dNa4o4re7ilImfyqMTRcVB8Fje0aecpzM9hF+PKTJpIQ09Sn+7X5EvbhBdt4udENGJhg7/ Q/5uSgmuKPhDTwZla0h767HUHI5vx/M7I8a5ZOCV7OMltLWGYvDoLQCqaZjiVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6St72yshz1Nv3; Tue, 04 Mar 2025 08:05: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 52485pDT088636; Tue, 4 Mar 2025 08:05:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52485pYn088632; Tue, 4 Mar 2025 08:05:51 GMT (envelope-from git) Date: Tue, 4 Mar 2025 08:05:51 GMT Message-Id: <202503040805.52485pYn088632@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: 7e51bc6cdd5c - main - pf: Introduce unhandled_af() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 7e51bc6cdd5c317109e25b0b64230d00d68dceb3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7e51bc6cdd5c317109e25b0b64230d00d68dceb3 commit 7e51bc6cdd5c317109e25b0b64230d00d68dceb3 Author: Kristof Provost AuthorDate: 2025-03-03 16:26:39 +0000 Commit: Kristof Provost CommitDate: 2025-03-04 08:05:37 +0000 pf: Introduce unhandled_af() For cases where code conditionally does something based on an address family and later assumes one of the paths was taken. This was initially just calls to panic until guenther suggested a function to reduce the amount of strings needed. This reduces the amount of noise with static analysers and acts as a sanity check. ok guenther@ bluhm@ Obtained from: OpenBSD, jsg , ba4138390b Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 38 +++++++++++++++++++++++++++++++++++++- sys/netpfil/pf/pf_ioctl.c | 6 ++++++ sys/netpfil/pf/pf_table.c | 37 +++++++++++++++++++++++++++++-------- sys/netpfil/pf/pflow.c | 4 ++-- 5 files changed, 75 insertions(+), 11 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b9b7f71c07d1..2aaef12e3431 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2280,6 +2280,7 @@ VNET_DECLARE(struct pf_krule *, pf_rulemarker); #define V_pf_rulemarker VNET(pf_rulemarker) #endif +void unhandled_af(int) __dead2; int pf_start(void); int pf_stop(void); void pf_initialize(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 72e648b84b2f..ad6be0c67c2a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -601,6 +601,8 @@ pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af) return (-1); break; #endif /* INET6 */ + default: + unhandled_af(af); } return (0); } @@ -616,7 +618,7 @@ pf_is_loopback(sa_family_t af, struct pf_addr *addr) case AF_INET6: return IN6_IS_ADDR_LOOPBACK(&addr->v6); default: - panic("Unknown af %d", af); + unhandled_af(af); } } @@ -696,6 +698,8 @@ pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, case AF_INET6: PF_ACPY(pd->src, &nk->addr[pd->sidx], pd->af); break; + default: + unhandled_af(pd->af); } } if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af)) { @@ -708,6 +712,8 @@ pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, case AF_INET6: PF_ACPY(pd->dst, &nk->addr[pd->didx], pd->af); break; + default: + unhandled_af(pd->af); } } break; @@ -740,6 +746,8 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) h = murmur3_32_hash32((uint32_t *)&addr->v6, sizeof(addr->v6)/sizeof(uint32_t), V_pf_hashseed); break; + default: + unhandled_af(af); } return (h & V_pf_srchashmask); @@ -803,6 +811,8 @@ pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) case AF_INET6: memcpy(&dst->v6, &src->v6, sizeof(dst->v6)); break; + default: + unhandled_af(af); } } #endif /* INET6 */ @@ -931,6 +941,8 @@ pf_overload_task(void *v, int pending) p.pfra_ip6addr = pfoe->addr.v6; break; #endif + default: + unhandled_af(pfoe->af); } PF_RULES_WLOCK(); @@ -2174,6 +2186,8 @@ pf_isforlocal(struct mbuf *m, int af) return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); } #endif + default: + unhandled_af(af); } return (false); @@ -2335,6 +2349,8 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, } break; #endif /* INET6 */ + default: + unhandled_af(pd->af); } HTONS(*virtual_type); return (0); /* These types match to their own state */ @@ -2960,6 +2976,8 @@ pf_print_host(struct pf_addr *addr, u_int16_t p, sa_family_t af) break; } #endif /* INET6 */ + default: + unhandled_af(af); } } @@ -3333,6 +3351,8 @@ pf_change_ap(struct mbuf *m, struct pf_addr *a, u_int16_t *p, u_int16_t *ic, } break; #endif /* INET6 */ + default: + unhandled_af(af); } if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | @@ -3639,6 +3659,8 @@ pf_change_icmp_af(struct mbuf *m, int off, struct pf_pdesc *pd, ip6->ip6_src = src->v6; ip6->ip6_dst = dst->v6; break; + default: + unhandled_af(naf); } /* adjust payload offset and total packet length */ @@ -3877,6 +3899,8 @@ pf_translate_icmp_af(int af, void *arg) icmp4->icmp_void = htonl(ptr); } break; + default: + unhandled_af(af); } #endif /* INET && INET6 */ @@ -3983,6 +4007,8 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, len = sizeof(struct ip6_hdr) + tlen; break; #endif /* INET6 */ + default: + unhandled_af(af); } m = m_gethdr(M_NOWAIT, MT_DATA); @@ -4148,6 +4174,8 @@ pf_send_sctp_abort(sa_family_t af, struct pf_pdesc *pd, off += sizeof(struct ip6_hdr); break; #endif /* INET6 */ + default: + unhandled_af(af); } /* SCTP header */ @@ -4231,6 +4259,8 @@ pf_send_tcp(const struct pf_krule *r, sa_family_t af, pfse->pfse_type = PFSE_IP6; break; #endif /* INET6 */ + default: + unhandled_af(af); } pfse->pfse_m = m; @@ -7648,6 +7678,8 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, icmpsum = &pd->hdr.icmp6.icmp6_cksum; break; #endif /* INET6 */ + default: + panic("unhandled proto %d", pd->proto); } if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &virtual_id, @@ -7849,6 +7881,8 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, pd2.ip_sum = NULL; break; #endif /* INET6 */ + default: + unhandled_af(pd->af); } if (PF_ANEQ(pd->dst, pd2.src, pd->af)) { @@ -8052,6 +8086,8 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, (caddr_t )&h2_6); break; #endif /* INET6 */ + default: + unhandled_af(pd->af); } m_copyback(pd->m, pd2.off, 8, (caddr_t)&th); } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index e622186f671f..787715412fc2 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2406,6 +2406,12 @@ relock_DIOCKILLSTATES: return (killed); } +void +unhandled_af(int af) +{ + panic("unhandled af %d", af); +} + int pf_start(void) { diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 666ec18ec377..462b8c3aa782 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -754,12 +754,17 @@ pfr_lookup_addr(struct pfr_ktable *kt, struct pfr_addr *ad, int exact) PF_RULES_ASSERT(); bzero(&sa, sizeof(sa)); - if (ad->pfra_af == AF_INET) { + switch (ad->pfra_af) { + case AF_INET: FILLIN_SIN(sa.sin, ad->pfra_ip4addr); head = &kt->pfrkt_ip4->rh; - } else if ( ad->pfra_af == AF_INET6 ) { + break; + case AF_INET6: FILLIN_SIN6(sa.sin6, ad->pfra_ip6addr); head = &kt->pfrkt_ip6->rh; + break; + default: + unhandled_af(ad->pfra_af); } if (ADDR_NETWORK(ad)) { pfr_prepare_network(&mask, ad->pfra_af, ad->pfra_net); @@ -957,10 +962,16 @@ pfr_route_kentry(struct pfr_ktable *kt, struct pfr_kentry *ke) PF_RULES_WASSERT(); bzero(ke->pfrke_node, sizeof(ke->pfrke_node)); - if (ke->pfrke_af == AF_INET) + switch (ke->pfrke_af) { + case AF_INET: head = &kt->pfrkt_ip4->rh; - else if (ke->pfrke_af == AF_INET6) + break; + case AF_INET6: head = &kt->pfrkt_ip6->rh; + break; + default: + unhandled_af(ke->pfrke_af); + } if (KENTRY_NETWORK(ke)) { pfr_prepare_network(&mask, ke->pfrke_af, ke->pfrke_net); @@ -978,10 +989,16 @@ pfr_unroute_kentry(struct pfr_ktable *kt, struct pfr_kentry *ke) struct radix_node *rn; struct radix_head *head = NULL; - if (ke->pfrke_af == AF_INET) + switch (ke->pfrke_af) { + case AF_INET: head = &kt->pfrkt_ip4->rh; - else if (ke->pfrke_af == AF_INET6) + break; + case AF_INET6: head = &kt->pfrkt_ip6->rh; + break; + default: + unhandled_af(ke->pfrke_af); + } if (KENTRY_NETWORK(ke)) { pfr_prepare_network(&mask, ke->pfrke_af, ke->pfrke_net); @@ -1051,7 +1068,7 @@ pfr_sockaddr_to_pf_addr(const union sockaddr_union *sa, struct pf_addr *a) memcpy(&a->v6, &sa->sin6.sin6_addr, sizeof(a->v6)); break; default: - panic("Unknown AF"); + unhandled_af(sa->sa.sa_family); } } @@ -2079,6 +2096,8 @@ pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af) break; } #endif /* INET6 */ + default: + unhandled_af(af); } match = (ke && !ke->pfrke_not); if (match) @@ -2131,7 +2150,7 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af, } #endif /* INET6 */ default: - panic("%s: unknown address family %u", __func__, af); + unhandled_af(af); } if ((ke == NULL || ke->pfrke_not) != notrule) { if (op_pass != PFR_OP_PASS) @@ -2261,6 +2280,8 @@ pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, uaddr.sin6.sin6_family = AF_INET6; addr = (struct pf_addr *)&uaddr.sin6.sin6_addr; break; + default: + unhandled_af(af); } if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index ae9d162bb6bf..00890589814d 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -1216,7 +1216,7 @@ pflow_sendout_ipfix(struct pflow_softc *sc, enum pflow_family_t af) + sc->sc_count_nat4 * sizeof(struct pflow_ipfix_nat4); break; default: - panic("Unsupported AF %d", af); + unhandled_af(af); } pflowstat_inc(pflow_packets); @@ -1444,7 +1444,7 @@ nlattr_add_sockaddr(struct nl_writer *nw, int attr, const struct sockaddr *s) break; } default: - panic("Unknown address family %d", s->sa_family); + unhandled_af(s->sa_family); } nlattr_set_len(nw, off); From nobody Tue Mar 4 12:16:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6ZQv5Pw1z5phZD; Tue, 04 Mar 2025 12:16: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 4Z6ZQv3CMbz3DyL; Tue, 04 Mar 2025 12:16:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741090567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KeRyk0ovGCdGLKanMiEuRndhimURQVH/3sbXhrl2ixA=; b=lrPLvfk2wkdS/BtWGcWxkqhYUUmpTsCsE0r9Y8nLzqFudnwZwEIXe1YE/32QeMElffC9dI 5+DvpExEaktx1u6uhE6EmweOGL+/mvrKZ1RJnNo+HUWj3CRYxzp7T4pUmLwosIB3+Zp9Sb a7kiH1MPDjLdHrNKJTOBnrIIWMfLZm9QY8HiSTRYa5UZ9gZ1KJMIj6tqGpNci9+Axszdoc C8WgHxYTifbg4/WASCQK0T9KO+QY8PJoS7z9eX4oDc22vNi/7v7OXp3bG0XwRt1p3kQCh2 Vjw2dNeBNXT/80L8q/UxbXVMEmUMKw1TcVqAoQSYYLu0BPL3Np25nAUOJV4HeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741090567; a=rsa-sha256; cv=none; b=vmkf1LBaZgUcm1r8pkjO399cD3gdN8sLwI/+ExFdOs2l0SRSYX7pucXoWL0cwusTsX7Gnd 8LRkOU+ajkj14laqbpKd6mdVI9WUPLg92d/vQz1eYsTpUPTu1039XVA+SGND5xbmGjE8JH EM1vL9veTCTEQg7VXzjQozj/EdZfPUc0QTOEbUeJ+ZjKosbyZzGrxpjcDAgWF4HTpdmcCN 8yoWiMYq0yXjYw+4bJC7v+g7NgBSAEyG7sLNPyK/2ZAnU2nEXHptB83b4Noz+t8Nf7NgRw hr+uP2hLYZtl8OtZg4KT+OtbMrWc5pqtM7OmbDkxN0u84q44Snq4xE6aYwp+4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741090567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KeRyk0ovGCdGLKanMiEuRndhimURQVH/3sbXhrl2ixA=; b=Iz/oBYqMWB3zWA8ZzIHFFhBygo8voi7FrI4+fKrnEWVmfuCAYfVXvmihJJ6YQ01RYR77AU 9Ibv6VRL5o2TIBhwFCQFh0IfH3X135fpI1szxD2kKdrODA9jzCKNP3wnQqqmNluLw+x8ux 45WHrrhkH0ltexKTkb/Oq3iGaSzb7IeOMNqLUEpnl8HRs9l6GwWBm8haDrHDon3+HsyH+y AmdcNZWcmdnBwqK1DcTGp0DKZyHajm+tXiPZ8uW7oGazSbIfpE88dw34KZotaJ1JfUMy9C 0asifyie+B9kx4QL5e2nYn2afOX0m0dIS4Km2cNOk+3gNuPaffY9oZyAAAe2Qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6ZQv2pqnz30w; Tue, 04 Mar 2025 12:16: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 524CG7kA055807; Tue, 4 Mar 2025 12:16:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524CG7pB055804; Tue, 4 Mar 2025 12:16:07 GMT (envelope-from git) Date: Tue, 4 Mar 2025 12:16:07 GMT Message-Id: <202503041216.524CG7pB055804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 2624ba37e633 - main - pfctl: Fix printing af-to "to" pool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2624ba37e6336febb40ab6317d8e4ea63b60fa44 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=2624ba37e6336febb40ab6317d8e4ea63b60fa44 commit 2624ba37e6336febb40ab6317d8e4ea63b60fa44 Author: Kajetan Staszkiewicz AuthorDate: 2025-03-03 10:43:21 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-03-04 12:14:07 +0000 pfctl: Fix printing af-to "to" pool We can't depend on pool->cur, that is used only inside of kernel for iterating over members of the pool, it is not filled in during loading of ruleset. Reviewed by: kp Approved by: kp (mentor) Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D49213 --- sbin/pfctl/pfctl_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index bb458bce24fb..eb3a0826578e 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1245,7 +1245,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" af-to %s from ", r->naf == AF_INET ? "inet" : "inet6"); print_pool(&r->nat, r->nat.proxy_port[0], r->nat.proxy_port[1], r->naf ? r->naf : r->af, PF_NAT); - if (r->rdr.cur != NULL && !TAILQ_EMPTY(&r->rdr.list)) { + if (!TAILQ_EMPTY(&r->rdr.list)) { printf(" to "); print_pool(&r->rdr, r->rdr.proxy_port[0], r->rdr.proxy_port[1], r->naf ? r->naf : r->af, From nobody Tue Mar 4 13:45:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6cQJ24Sqz5pqts; Tue, 04 Mar 2025 13:45: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 4Z6cQH6PD8z3trZ; Tue, 04 Mar 2025 13:45:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741095943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WlbiLHKVFh0FvDl/zv8a5UUOrWEkaERBPlEufjbNY8o=; b=Ir0M7A6NNY2IbWIiLLAQe9vF8qXoHsiLfMlZqKe169yHhsNyXsxFydx3eb+kVPgLJvkUKv S69jnpskLjzHZHgqmwIw5RA0TMtCbROoN1Eht0Qs3R5ObaNnHVJ+cfj3cgOxwdRmyk8qVb wmgucEPc02h/pcINZlZOnEmVT9dDb6qGDegRkuiGjRZQmmGkvpFP+p1EH2G+NR1SdNH64f 9vE6m+7pyeVYw5nvkUSsokVrcsiMgaSYPSA+GiIBJ5ixzWmoFKcWSA13db8ngozF4LAjVf IMzZmP1gbc/ohb5ahTvxI0efKbh+MZ+rJaUAUE27KMwF5jAR7Ar9zxBA1xcbrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741095943; a=rsa-sha256; cv=none; b=GCUaQEoo8LAoqRfmiPuW06vjOXW7bwICTIeLo1OqWtnCuNp3pSIYm7BDs9hj6SgXkbgNcw /j8Yh+VhZtcZaLoq4uVcTMcWRG08YDErqoQHEaHN8bLKaQm17BSfiMVilUpWB5AnWb6dNI C2Wx8P0G/R3yxQbxVr+9aKR2AkN4X3Vzv0fTjbE0IgTXxhdZFmNimgt4BNyD2iYCHkHs7A XoyJw1ZfXKGTjlqJE4GE7HHN91VjfXAAPTgfQ0GIM3UKRTLFAbnc5N2bg/yfVE8ZsvxGKW YxF5qBldid0tKUdaO7z9g6LScK3gnt5FxJnDZcITcYFYGdO9aPsDjfk8DelSEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741095943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WlbiLHKVFh0FvDl/zv8a5UUOrWEkaERBPlEufjbNY8o=; b=ZUKnThTNvQJUrzn7lrHBn5SR7+F9CfwgR//iXumaB+jcmgztgA5JtEsjhQS67Li5zRxNGx uPQX9aJyDHm64sZOAXhznjwOwWPJWSRRYRm9ASoTxtPencGhONC0oDXB0rQVIXpIz7gCVp mLVTa0f7tCbWNQDm4HyC5CvTXlj9+XfcjU5dsMl2eGCYd7UFOU/w1ly4oM3FT4XEPj7kR2 bwqj4SfI50aajCnmtW1ws5qlseJXLe5nMRuIPw6Y41JQOq1DYqBMkd859Xk9Z4GzueZP+Q J5QjtGWhNAzb0U4Qcg4sMJ55wwKPJxiARCqhIdHjexkXRnBVu2FJYOJRhyFVcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6cQH5QxKz5Mq; Tue, 04 Mar 2025 13:45: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 524Djhsu023757; Tue, 4 Mar 2025 13:45:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Djh60023754; Tue, 4 Mar 2025 13:45:43 GMT (envelope-from git) Date: Tue, 4 Mar 2025 13:45:43 GMT Message-Id: <202503041345.524Djh60023754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: f60149306ccf - stable/14 - release: build OCI images with shell scripts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f60149306ccf784ddaa517132a8be47bb523984d Auto-Submitted: auto-generated The branch stable/14 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=f60149306ccf784ddaa517132a8be47bb523984d commit f60149306ccf784ddaa517132a8be47bb523984d Author: Doug Rabson AuthorDate: 2024-12-12 16:42:00 +0000 Commit: Doug Rabson CommitDate: 2025-03-04 09:46:03 +0000 release: build OCI images with shell scripts This avoids the need for buildah and skopeo for building releases. Reviewed by: cpersiva MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D48574 (cherry picked from commit e8a5b9fd73f4f437a03c85e7644daa55652e224b) --- release/Makefile.oci | 6 +- release/release.sh | 38 ------------- release/scripts/make-oci-image.sh | 105 +++++++++++++++++++++++++++++++---- release/tools/oci-image-dynamic.conf | 2 +- release/tools/oci-image-minimal.conf | 3 +- release/tools/oci-image-static.conf | 3 +- 6 files changed, 99 insertions(+), 58 deletions(-) diff --git a/release/Makefile.oci b/release/Makefile.oci index da35156c5a95..e4b5df580055 100644 --- a/release/Makefile.oci +++ b/release/Makefile.oci @@ -26,11 +26,7 @@ OCI_TARGETS+= container-image-${_IMG}.txz container-image-${_IMG}.txz: ${OCI_DEPS_${_IMG}} # Adjust PATH so that we run pwd_mkdb from the bootstrap tools env PATH=${OBJTOP}/tmp/legacy/bin:${PATH:Q} \ - sh ${.CURDIR}/scripts/make-oci-image.sh ${.CURDIR} ${REVISION} ${BRANCH} ${TARGET_ARCH} ${_IMG} - skopeo copy \ - containers-storage:localhost/freebsd${REVISION:R}-${_IMG}:latest \ - oci-archive:${.OBJDIR}/container-image-${_IMG}.tar:freebsd${REVISION:R}-${_IMG}:${REVISION}-${BRANCH}-${TARGET_ARCH} - ${XZ_CMD} < ${.OBJDIR}/container-image-${_IMG}.tar > ${.OBJDIR}/container-image-${_IMG}.txz + sh ${.CURDIR}/scripts/make-oci-image.sh ${.CURDIR} ${REVISION} ${BRANCH} ${TARGET_ARCH} ${_IMG} container-image-${_IMG}.txz .endfor oci-release: ${OCI_TARGETS} diff --git a/release/release.sh b/release/release.sh index d6752e016994..5a6de297f7a1 100755 --- a/release/release.sh +++ b/release/release.sh @@ -292,44 +292,6 @@ extra_chroot_setup() { fi fi - if [ ! -z "${WITH_OCIIMAGES}" ]; then - # Install buildah and skopeo from ports if the ports tree is available; - # otherwise install the pkg. - if [ -d ${CHROOTDIR}/usr/ports ]; then - # Trick the ports 'run-autotools-fixup' target to do the right - # thing. - _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) - REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) - BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) - UNAME_r=${REVISION}-${BRANCH} - GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS" - GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" - GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" - GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" - PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" - PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" - PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" - PBUILD_FLAGS="${PBUILD_FLAGS} WRKDIRPREFIX=/tmp/ports" - PBUILD_FLAGS="${PBUILD_FLAGS} DISTDIR=/tmp/distfiles" - for _PORT in sysutils/buildah sysutils/skopeo; do - eval chroot ${CHROOTDIR} env ${PBUILD_FLAGS} make -C \ - /usr/ports/${_PORT} \ - FORCE_PKG_REGISTER=1 deinstall install clean distclean - done - else - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - pkg install -y sysutils/buildah sysutils/skopeo - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - pkg clean -y - fi - # Use the vfs storage driver so that this works whether or not - # the build directory is on ZFS. The images are small so the - # performance difference is negligible. - eval chroot ${CHROOTDIR} sed -I .bak -e '/^driver/s/zfs/vfs/' /usr/local/etc/containers/storage.conf - # Remove any stray images from previous builds - eval chroot ${CHROOTDIR} buildah rmi -af - fi - if [ ! -z "${EMBEDDEDPORTS}" ]; then _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) diff --git a/release/scripts/make-oci-image.sh b/release/scripts/make-oci-image.sh index 6180ed9d53b4..0fd64602b403 100644 --- a/release/scripts/make-oci-image.sh +++ b/release/scripts/make-oci-image.sh @@ -7,21 +7,23 @@ rev=$1; shift branch=$1; shift arch=$1; shift image=$1; shift +output=$1; shift major=${rev%.*} minor=${rev#*.} abi=FreeBSD:${major}:${arch} +ver=${rev}-${branch}-${arch} echo "Building OCI freebsd${major}-${image} image for ${abi}" . ${curdir}/tools/oci-image-${image}.conf -init_workdir() { +init_repo() { + local workdir=$1; shift local abi=$1; shift - local workdir=$(mktemp -d -t oci-images) - mkdir ${workdir}/repos + mkdir -p ${workdir}/repos cat > ${workdir}/repos/base.conf < ${workdir}/config.json + local config_hash=$(sha256 -q < ${workdir}/config.json) + local config_size=$(stat -f %z ${workdir}/config.json) + + echo "{\"schemaVersion\":2,\"mediaType\":\"application/vnd.oci.image.manifest.v1+json\",\"config\":{\"mediaType\":\"application/vnd.oci.image.config.v1+json\",\"digest\":\"sha256:${config_hash}\",\"size\":${config_size}},\"layers\":[{\"mediaType\":\"application/vnd.oci.image.layer.v1.tar+gzip\",\"digest\":\"sha256:${root_hash}\",\"size\":${root_size}}],\"annotations\":{}}" > ${workdir}/manifest.json + local manifest_hash=$(sha256 -q < ${workdir}/manifest.json) + local manifest_size=$(stat -f %z ${workdir}/manifest.json) + + mkdir -p ${workdir}/oci/blobs/sha256 + echo "{\"imageLayoutVersion\": \"1.0.0\"}" > ${workdir}/oci/oci-layout + echo "{\"schemaVersion\":2,\"manifests\":[{\"mediaType\":\"application/vnd.oci.image.manifest.v1+json\",\"digest\":\"sha256:${manifest_hash}\",\"size\":${manifest_size},\"annotations\":{\"org.opencontainers.image.ref.name\":\"freebsd-${image}:${ver}\"}}]}" > ${workdir}/oci/index.json + ln ${workdir}/rootfs.tar.gz ${workdir}/oci/blobs/sha256/${root_hash} + ln ${workdir}/config.json ${workdir}/oci/blobs/sha256/${config_hash} + ln ${workdir}/manifest.json ${workdir}/oci/blobs/sha256/${manifest_hash} + + tar -C ${workdir}/oci --xz --strip-components 1 --no-read-sparse -a -cf ${output} . +} + +# Prefix with "container-image-" so that we can create a unique work area under +# ${.OBJDIR}. We can assume that make has set our working directory to +# ${.OBJDIR}. +workdir=${PWD}/container-image-${image} +init_repo ${workdir} ${abi} + if [ -n "${OCI_BASE_IMAGE}" ]; then - base_image=freebsd${major}-${OCI_BASE_IMAGE} + base_workdir=${PWD}/container-image-${OCI_BASE_IMAGE} else - base_image=scratch + base_workdir= fi -c=$(buildah from --arch ${arch} ${base_image}) -m=$(buildah mount $c) +create_container ${workdir} ${base_workdir} oci_image_build -buildah unmount $c -buildah commit --rm $c freebsd${major}-${image}:latest +commit_container ${workdir} ${image} ${output} diff --git a/release/tools/oci-image-dynamic.conf b/release/tools/oci-image-dynamic.conf index b146ff2cf7c3..61cb90187764 100644 --- a/release/tools/oci-image-dynamic.conf +++ b/release/tools/oci-image-dynamic.conf @@ -7,5 +7,5 @@ OCI_BASE_IMAGE=static oci_image_build() { - install_packages ${abi} ${workdir} $m FreeBSD-clibs FreeBSD-openssl-lib + install_packages ${abi} ${workdir} FreeBSD-clibs FreeBSD-openssl-lib } diff --git a/release/tools/oci-image-minimal.conf b/release/tools/oci-image-minimal.conf index 82e2ce6a1bd3..93aad1e39250 100644 --- a/release/tools/oci-image-minimal.conf +++ b/release/tools/oci-image-minimal.conf @@ -8,7 +8,8 @@ OCI_BASE_IMAGE=dynamic oci_image_build() { - install_packages ${abi} ${workdir} $m \ + set_cmd ${workdir} /bin/sh + install_packages ${abi} ${workdir} \ FreeBSD-runtime \ FreeBSD-certctl \ FreeBSD-kerberos-lib \ diff --git a/release/tools/oci-image-static.conf b/release/tools/oci-image-static.conf index 552328e66f3c..753a03af653b 100644 --- a/release/tools/oci-image-static.conf +++ b/release/tools/oci-image-static.conf @@ -8,12 +8,13 @@ OCI_BASE_IMAGE= oci_image_build() { local srcdir=${curdir}/.. + local m=${workdir}/rootfs mtree -deU -p $m/ -f ${srcdir}/etc/mtree/BSD.root.dist > /dev/null mtree -deU -p $m/var -f ${srcdir}/etc/mtree/BSD.var.dist > /dev/null mtree -deU -p $m/usr -f ${srcdir}/etc/mtree/BSD.usr.dist > /dev/null mtree -deU -p $m/usr/include -f ${srcdir}/etc/mtree/BSD.include.dist > /dev/null mtree -deU -p $m/usr/lib -f ${srcdir}/etc/mtree/BSD.debug.dist > /dev/null - install_packages ${abi} ${workdir} $m FreeBSD-caroot FreeBSD-zoneinfo + install_packages ${abi} ${workdir} FreeBSD-caroot FreeBSD-zoneinfo cp ${srcdir}/etc/master.passwd $m/etc pwd_mkdb -p -d $m/etc $m/etc/master.passwd || return $? cp ${srcdir}/etc/group $m/etc || return $? From nobody Tue Mar 4 13:53:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6cbh5Mbbz5pr8X; Tue, 04 Mar 2025 13:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6cbh4n5wz3yBg; Tue, 04 Mar 2025 13:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741096432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=768GkO8PiVtJhQ2HRatc19vHRtfkdF4FEDsiBklbJt8=; b=ZZ/3jnmleimPaTa4aSd3zZ9XqV6a/lB1tnrePkORYbHZlpNA7E7a5xw4YBoyH558luD9VF 5He+qqve1uksbgW0PWJCEzQ02xd23aJ71SJSUf8OeTp8kS6ZSrsJs2xHDE7P3rYwbLapgu 1vH6kwVc7C0aaQ6WfPfsfFOrW0XXWIYFUP1cdrGA1XEBsdoTUg/Rg9vQyimMvrQnUBktxn bgKA316wAFJkwNgNwkhXbTZDVBZqqTfJZI85QiuEYooCcdJMePObbMW6PO6sn6+wdUH1fi 1cfw07j+l2JVpo9uLqZplu1tcHRCIxxJmDy3fgxO/MyD3lFYiEEu94C87H4Hig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741096432; a=rsa-sha256; cv=none; b=ImIwCc39C9SKniyBPQCb8dBY100PLMnG3e/SJK6hvc4xGImh4+JsJafY+7yNNed57EGO3N LAzidmRBGJFB+Qm1ng33r2pakwihdkL+ejsYddzMM1vcBMiXwnzSV7UzZlLrsk5zpW4c0V yrrN3BxdqXL35CiuGXCLU1CDGpLC06+P4PXuXXGQM0Asu6lIsSYNSsseHDBBNiXw3cwIF0 tdfDEtdzsHJH7kRZm/IulKPtVts/bd4buO5Bns10dznWFU0AMbYr8/JTD9S8vrT35AoLOP Ar75JJ9k1i6Cj7cN96yl+M6eLOWtUJa/zYOcy/K7ic5tHBkdQ7xHITENVX4p6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741096432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=768GkO8PiVtJhQ2HRatc19vHRtfkdF4FEDsiBklbJt8=; b=ceGqM1977CWf9+OS+/WtMvioRslxjn+XjrFcKZCFA1LZkzREhw9o3xSev0a5aQh36eaatF foeIRWMuTcJTlxGfFGCwlRrlNOOBjao8W0IMlrN/vxlIlInGW1Dr5Rqzz+uhgQuLkIXVn5 VGgMc8WxGiwd+6DVIeosRsO0lHP9tld45+ePQT3T2oI752Q6I1I9lgiH1SHes55iuwwmqM PP+Wigk1k9C6aMb4FhhaTysohiO5O+Jau8veHKPrNPI9pFN/qfj+giFUNOpQ3ndXnMHf+F hIdm6c42dzOe+a2tEHYBNE+W6hF1HRqZvap8FZnUKlP6l9foz8FSsjwGx1simQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6cbh4LXbz5lh; Tue, 04 Mar 2025 13:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 524DrqNT041655; Tue, 4 Mar 2025 13:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524DrqPO041652; Tue, 4 Mar 2025 13:53:52 GMT (envelope-from git) Date: Tue, 4 Mar 2025 13:53:52 GMT Message-Id: <202503041353.524DrqPO041652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 49a4838a0d94 - main - vmm: Emulate testb imm8,r/m8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49a4838a0d94e145a826abf02aa03ff444e614e3 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=49a4838a0d94e145a826abf02aa03ff444e614e3 commit 49a4838a0d94e145a826abf02aa03ff444e614e3 Author: Jose Luis Duran AuthorDate: 2025-03-04 13:51:47 +0000 Commit: Jose Luis Duran CommitDate: 2025-03-04 13:51:47 +0000 vmm: Emulate testb imm8,r/m8 Add support for "testb imm8,r/m8" emulation. PR: 261940 PR: 282852 Reviewed by: markj, emaste Approved by: emaste (mentor) Obtained from: Illumos (https://www.illumos.org/issues/14483) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49208 --- sys/amd64/vmm/vmm_instruction_emul.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index 51769faf5893..c53e32889000 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -236,6 +236,12 @@ static const struct vie_op one_byte_opcodes[256] = { .op_byte = 0x8F, .op_type = VIE_OP_TYPE_POP, }, + [0xF6] = { + /* XXX Group 3 extended opcode - not just TEST */ + .op_byte = 0xF6, + .op_type = VIE_OP_TYPE_TEST, + .op_flags = VIE_OP_F_IMM8, + }, [0xF7] = { /* XXX Group 3 extended opcode - not just TEST */ .op_byte = 0xF7, @@ -1284,6 +1290,12 @@ emulate_test(struct vcpu *vcpu, uint64_t gpa, struct vie *vie, error = EINVAL; switch (vie->op.op_byte) { + case 0xF6: + /* + * F6 /0 test r/m8, imm8 + */ + size = 1; /* override for byte operation */ + /* FALLTHROUGH */ case 0xF7: /* * F7 /0 test r/m16, imm16 From nobody Tue Mar 4 14:10:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6czy19rnz5pt1Q; Tue, 04 Mar 2025 14:11:26 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:13b:240c::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E6" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6czw6k2hz48vd; Tue, 04 Mar 2025 14:11:24 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail202005 header.b=g3IpmSY3; dmarc=none; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 2a01:4f8:13b:240c::25 as permitted sender) smtp.mailfrom=herbert@gojira.at Date: Tue, 04 Mar 2025 15:10:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1741097474; bh=9pd6x0nmd3rEU44Bp4DuYjDeIK4H5A9kT3dS7TK4ux4=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=g3IpmSY3sE9KGmD0CRXetpJAX0dOo0nxaV2OQ/smwkVoPIcAy+h7Rxy7PMNN/h5Dr 8qxhScdkzXt1yLzTZIw89Ggn6JKZVHgjwR7qHbZ7vZkQwHUvPzQT0rclQV+yji+V0K Znj3SF80+yj5YT6ZfH5V6dcXZMNG7b44t/585ZRUSXp29kLcgtZaddSTgSZl1T2Roj 4DKVajvj4uzv7A5ar6eoU9AeRrUstV/OIXHdHDT0vtK627gry4shW7fEgh/l/gTbDj Pel51sfXWXvw6mt5R13CXb8ikM29T02vy1DXRM4iY02Ldo5QTCi70ZzyuRNhkFcA52 fl4uXIBnmvQjA== Message-ID: <87bjugsx7t.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: Alexander Ziaee Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency In-Reply-To: <202502272222.51RMM0fg033513@gitrepo.freebsd.org> References: <202502272222.51RMM0fg033513@gitrepo.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Result: default: False [-2.35 / 15.00]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.85)[-0.850]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:240c::25]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail202005]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[gojira.at]; DKIM_TRACE(0.00)[gojira.at:+] X-Rspamd-Queue-Id: 4Z6czw6k2hz48vd X-Spamd-Bar: -- On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: > > The branch main has been updated by ziaee: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 > > commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 > Author: Alexander Ziaee > AuthorDate: 2025-02-19 15:54:27 +0000 > Commit: Alexander Ziaee > CommitDate: 2025-02-27 22:20:22 +0000 > > wifi manuals: Mlink + document description consistency > > Interfaces all have an mlink to if_$foo. Add these for the missing ones > and remove an incorrect one from rtwn_pci. Wireless network drivers are > all accessible via `apropos -s4 "wireless network driver", except two > which are "wireless network device". I actually prefer the latter, but > make them all consistent upon the more common parlance. Tag SPDX on one > of the files I touched, while here. > > MFC after: 3 days > Reviewed by: bz, carlavilla, mhorne > Approved by: carlavilla, mhorne (mentors) > Differential Revision: https://reviews.freebsd.org/D49063 > --- > share/man/man4/Makefile | 4 +++- > share/man/man4/uath.4 | 4 +++- > share/man/man4/upgt.4 | 2 +- > 3 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > index 13afc9b8d399..8e0af19eec3d 100644 > --- a/share/man/man4/Makefile > +++ b/share/man/man4/Makefile > @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 > MLINKS+=ral.4 if_ral.4 > MLINKS+=re.4 if_re.4 > MLINKS+=rl.4 if_rl.4 > -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 > +MLINKS+=rtw88.4 if_rtw89.4 > +MLINKS+=rtw89.4 if_rtw89.4 > +MLINKS+=rtwn.4 if_rtwn.4 ^^^^^^^^^ $ grep if_rtwn.4 ObsoleteFiles.inc OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz From nobody Tue Mar 4 14:25:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6dJT17TPz5q8Gl; Tue, 04 Mar 2025 14:25:45 +0000 (UTC) (envelope-from bz@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 4Z6dJT0DZ2z3H95; Tue, 04 Mar 2025 14:25:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741098345; 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=lY6nLzjOi5KGoF4mv5yH3VlNw2s8CzryzXFH+hHcaGY=; b=u9nap6HupjzMAIpG7H2sH1KTZCT1UC7teTS3FfLGDZgmxTtsKiUVnbUF9ZXH9/L1HpA6Zy xK/7IQvQarUcgpt5Dp0aRzAJWntN+j7+lFZlokwMSwRLV9CfQWpJ0ilPV0G91X8zULxvNR zozcHXtijGc3jDlHZYbVOP0WGtvaHpeQaP/3kAdgPY0+cx5XUJepLTWgIOrWR0t4ZMgtF9 73WvpW4GkUyb86C6k9qDhqGhSwo2E7NFiNLLqp1TU8konflibKAIcDvTog4mtHI3mL1bls +ZXjbjyVI/IqUbZRc7gCtOt6WEBk8LAJp7pf+zSrC2RcaTFZwH7j/3EvnwqAIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741098345; a=rsa-sha256; cv=none; b=UB7RtaI30RU+6uGyJXDHCE4740MofJvTX1KJFgo7rzTqldPNVJ9TeiGi8B92y3GJt3qWRd tusy11PT/A/VXPkxvAifhjC1M47bRuJmu+Rz7ERRTwC8Ab6V+bhRyslm2pvX+QSqteVhkU ZKA7v5W6MhvMYYt2xeO5fIa6P/1gl+7vAIE09HfXiMHczT5OnNWHpS169AidRBRl4KGb0R Splc1mKourxnNueRKWQZmSklgmyk+UvAe4Z57J8u0EtlGPi3oHn8AAsZM0I6gp9uJGYSOl zjVmwmIa/K1t3w++ErEUb5IXQ0M2uweWy0ljoBut3lin8UQrqeUI7VHhmJE/Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741098345; 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=lY6nLzjOi5KGoF4mv5yH3VlNw2s8CzryzXFH+hHcaGY=; b=yrPdYmn35NAQMr5GEA0lX/VsF8b6rO63SdJ9w0A4OV7ay8PlyS47F9McR6T5yAogPGPkKM 6hBpVO1UNNH0sMAaXPttwEoI5pnFfrDglOgWhTU+pLE1k/2idCJWnjMtQsomjFPaYPuCYf LZgghfrt58SOZ693fJle+CF9rXs3OhGjIaItrVPwX9nKZVIM+dbHYgIo95XrGWQYZnR4xC S247NshOrZIhAWEMs3WEg4ptEvEN2TaZiGJtMCaSzklemy6DDX4Q3QdO77RTQG+YFDInFh d+nugpit80lEV0xwl+Seaeb3rx6oXwJuPq23iuqfiAortxm756Z1KrsMnybsog== 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)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z6dJS5qk0z17Dc; Tue, 04 Mar 2025 14:25:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 45968A64805; Tue, 04 Mar 2025 14:25:41 +0000 (UTC) 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 DE35A2D029E0; Tue, 4 Mar 2025 14:25:42 +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 UGyPDWbrHWPv; Tue, 4 Mar 2025 14:25:41 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:da44:89ff:fedd:d5ab]) (using 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 A2C292D029D8; Tue, 4 Mar 2025 14:25:41 +0000 (UTC) Date: Tue, 4 Mar 2025 14:25:40 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Herbert J. Skuhra" cc: Alexander Ziaee , Adrian Chadd , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency In-Reply-To: <87bjugsx7t.wl-herbert@gojira.at> Message-ID: <95401978-p196-n4n8-4458-98qs07n2162n@SerrOFQ.bet> References: <202502272222.51RMM0fg033513@gitrepo.freebsd.org> <87bjugsx7t.wl-herbert@gojira.at> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: > On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: >> >> The branch main has been updated by ziaee: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 >> >> commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 >> Author: Alexander Ziaee >> AuthorDate: 2025-02-19 15:54:27 +0000 >> Commit: Alexander Ziaee >> CommitDate: 2025-02-27 22:20:22 +0000 >> >> wifi manuals: Mlink + document description consistency >> >> Interfaces all have an mlink to if_$foo. Add these for the missing ones >> and remove an incorrect one from rtwn_pci. Wireless network drivers are >> all accessible via `apropos -s4 "wireless network driver", except two >> which are "wireless network device". I actually prefer the latter, but >> make them all consistent upon the more common parlance. Tag SPDX on one >> of the files I touched, while here. >> >> MFC after: 3 days >> Reviewed by: bz, carlavilla, mhorne >> Approved by: carlavilla, mhorne (mentors) >> Differential Revision: https://reviews.freebsd.org/D49063 >> --- >> share/man/man4/Makefile | 4 +++- >> share/man/man4/uath.4 | 4 +++- >> share/man/man4/upgt.4 | 2 +- >> 3 files changed, 7 insertions(+), 3 deletions(-) >> >> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile >> index 13afc9b8d399..8e0af19eec3d 100644 >> --- a/share/man/man4/Makefile >> +++ b/share/man/man4/Makefile >> @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 >> MLINKS+=ral.4 if_ral.4 >> MLINKS+=re.4 if_re.4 >> MLINKS+=rl.4 if_rl.4 >> -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 >> +MLINKS+=rtw88.4 if_rtw89.4 >> +MLINKS+=rtw89.4 if_rtw89.4 >> +MLINKS+=rtwn.4 if_rtwn.4 > ^^^^^^^^^ > $ grep if_rtwn.4 ObsoleteFiles.inc > OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz In fact that is probably correct but things are confusing. The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those should have the man page and links (so contrary to what was done). rtwn.ko is just the common code if I am not mistaken (Adrian should know better). But everyone is just referring to the driver as rtwn and I fear if there is no man page to be found as man rtwn / man if_rtwn people will be confused. I wanted to do the same with rtw88 but was told to keep it all together as one so rtwn is an excemption. That all said, yes, it needs a further cleanup. -- Bjoern A. Zeeb r15:7 From nobody Tue Mar 4 15:14:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6fNd4gyzz5qDHm; Tue, 04 Mar 2025 15:14: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 4Z6fNd40ftz3kZG; Tue, 04 Mar 2025 15:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741101265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZgC/7g5DW5poEicOBuRRQxmTTvvW94cwaoiYwN8AYoU=; b=yMCBzGyGGQ2CcuQE4Ue5LJqI0fvZO6UqxwLPtRMg7tM1zIlLw6pqWKdzLeXMpD33k6ze9g moPiiC59CTbUIvHRQ5P/x3CbO7Rxj2Gfao3DjaJcR4I+95eeWnMfATrx0jwtwRhNShFCzN l6Ea+CU3y/7Jl4PNOtkH0Os6QRe5I/8BCNOmBTMQBGwp8k+VMLFnJ7kmhLXXQJuqiqoT2u EoQ00xLh+69RRwKBKM6HTgS0jG/P5+ctAe1TSN+0GEDqTEbHcCVUoi3G3Y6FFkgWAgadO/ +wpY8E5ZQNuUVsozQERwLXo5wLYDm8BJlWKx3EdaH5+9S7ZgGefOXYYRNtwaIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741101265; a=rsa-sha256; cv=none; b=hu13Fr3mNjpGG1J5gQ3dGLR80B6WbbHYZaglVM1tGiivw5IlCCl76U7c9+Btots0QgWufm OMvQPB7Kt4MGcFuXUVJw/N9/TpiHZBX28jjC+fTyoNE8hZy73e7KaeB2TGvfk0L0u3tQEe MaWugeQ7G3xZ0i9jkJumkWsk5cdpQC/p/Jcbs2NLN/nE5H4nZaeakQd67Xd9lE0fwJ0Mip cCnPMagh8FU+Nck9cAAE6Wna30TAmE5OD4EcsTxh68MvbqD55AqxhaO9BvM7qZPbkqXxHh LyP6MOUpQIyjAICflZ7BD9LmNXkVC2aX5CuPn57zWvegZ10JVkxc6OM4RHTf4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741101265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZgC/7g5DW5poEicOBuRRQxmTTvvW94cwaoiYwN8AYoU=; b=bSPDadqdNDDwYeCYOVwRLn0v9dZEoOX+FeJ9HCVE63fUBxv8dcw8F/+22dC5CWFi35AdW1 HjjnRxbniHE8L2hVNwJIeWskTGri4ELNpt3k+fPGRKawuPTzlOzRyny81GMX2LAJoHl0Dr MBFuh3RX5bGkuXgpfZ3GSaWzokvRcp6gq5PoPDbYSod3LExdTNeEreWiXgR9UuRDdLHAXL ZrzLC3xtUtshMFsI/DPmKNKI/jESnE2rFQK2w84KtQBnF9Y4YREhUEd5d5da13ybbzVYBl bBBrduhwrPLsSD6JhS6c+lg7mDCNuys+9fwQg80i7Xt11k5QLe+2brEQIDrkFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6fNd3Xtfz792; Tue, 04 Mar 2025 15:14: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 524FEPAQ091921; Tue, 4 Mar 2025 15:14:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524FEPZV091918; Tue, 4 Mar 2025 15:14:25 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:14:25 GMT Message-Id: <202503041514.524FEPZV091918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: d09ec2eeb0d8 - stable/14 - armada38x: implement gateclk clkdev methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d09ec2eeb0d81528066fdb05db8a121f0f1e0c01 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d09ec2eeb0d81528066fdb05db8a121f0f1e0c01 commit d09ec2eeb0d81528066fdb05db8a121f0f1e0c01 Author: Mitchell Horne AuthorDate: 2024-04-15 20:18:25 +0000 Commit: Mitchell Horne CommitDate: 2025-03-04 15:11:46 +0000 armada38x: implement gateclk clkdev methods Implement basic clkdev methods required by the generic clk_gate device. This should make it functional, and prevent panics when invoking the clock's CLKNODE_GET_GATE method (e.g. with `sysctl -a`). Additionally, we need to fill in other key fields of the clk_gate_def structure before registering each clk. PR: 278188 Reported by: solo_code@protonmail.com Tested by: solo_code@protonmail.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48419 (cherry picked from commit 6f2775548278c76e7c33b15aaaaa759270a8dcd5) --- sys/arm/mv/clk/armada38x_gateclk.c | 99 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/sys/arm/mv/clk/armada38x_gateclk.c b/sys/arm/mv/clk/armada38x_gateclk.c index d00a01b0da67..1be3830cf375 100644 --- a/sys/arm/mv/clk/armada38x_gateclk.c +++ b/sys/arm/mv/clk/armada38x_gateclk.c @@ -44,11 +44,22 @@ #include "clkdev_if.h" +#define ARMADA38X_GATECLK_MAXREG 0 + +static struct resource_spec armada38x_gateclk_specs[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define RD4(_sc, addr) bus_read_4(_sc->res, addr) +#define WR4(_sc, addr, val) bus_write_4(_sc->res, addr, val) + struct armada38x_gateclk_softc { - struct clkdom *clkdom; - struct mtx mtx; - const char* parent; + struct resource *res; + struct clkdom *clkdom; + struct mtx mtx; + const char* parent; }; static struct clk_gate_def gateclk_nodes[] = @@ -220,10 +231,75 @@ static struct clk_gate_def gateclk_nodes[] = static int armada38x_gateclk_probe(device_t dev); static int armada38x_gateclk_attach(device_t dev); +static int +armada38x_gateclk_write_4(device_t dev, bus_addr_t addr, uint32_t val) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + WR4(sc, addr, val); + return (0); +} + +static int +armada38x_gateclk_read_4(device_t dev, bus_addr_t addr, uint32_t *val) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + *val = RD4(sc, addr); + return (0); +} + +static int +armada38x_gateclk_modify_4(device_t dev, bus_addr_t addr, uint32_t clr, + uint32_t set) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + uint32_t reg; + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + reg = RD4(sc, addr); + reg &= ~clr; + reg |= set; + WR4(sc, addr, reg); + + return (0); +} + +static void +armada38x_gateclk_device_lock(device_t dev) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + mtx_lock(&sc->mtx); +} + +static void +armada38x_gateclk_device_unlock(device_t dev) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + mtx_unlock(&sc->mtx); +} + static device_method_t armada38x_gateclk_methods[] = { DEVMETHOD(device_probe, armada38x_gateclk_probe), DEVMETHOD(device_attach, armada38x_gateclk_attach), + /* clkdev interface */ + DEVMETHOD(clkdev_write_4, armada38x_gateclk_write_4), + DEVMETHOD(clkdev_read_4, armada38x_gateclk_read_4), + DEVMETHOD(clkdev_modify_4, armada38x_gateclk_modify_4), + DEVMETHOD(clkdev_device_lock, armada38x_gateclk_device_lock), + DEVMETHOD(clkdev_device_unlock, armada38x_gateclk_device_unlock), + DEVMETHOD_END }; @@ -255,6 +331,7 @@ static int armada38x_gateclk_attach(device_t dev) { struct armada38x_gateclk_softc *sc; + struct clk_gate_def *defp; phandle_t node; int i, error; clk_t clock; @@ -262,6 +339,11 @@ armada38x_gateclk_attach(device_t dev) sc = device_get_softc(dev); node = ofw_bus_get_node(dev); + if (bus_alloc_resources(dev, armada38x_gateclk_specs, &sc->res) != 0) { + device_printf(dev, "Cannot allocate resources.\n"); + return (ENXIO); + } + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); sc->clkdom = clkdom_create(dev); @@ -277,8 +359,15 @@ armada38x_gateclk_attach(device_t dev) sc->parent = clk_get_name(clock); for (i = 0; i < nitems(gateclk_nodes); ++i) { - gateclk_nodes[i].clkdef.parent_names = &sc->parent; - error = clknode_gate_register(sc->clkdom, &gateclk_nodes[i]); + /* Fill clk_gate fields. */ + defp = &gateclk_nodes[i]; + defp->clkdef.parent_names = &sc->parent; + defp->offset = 0; + defp->mask = 0x1; + defp->on_value = 1; + defp->off_value = 0; + + error = clknode_gate_register(sc->clkdom, defp); if (error != 0) { device_printf(dev, "Cannot create gate nodes\n"); return (error); From nobody Tue Mar 4 15:25:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6fct2RKPz5qDj5; Tue, 04 Mar 2025 15:25: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 4Z6fct0hmnz3pBX; Tue, 04 Mar 2025 15:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741101902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=deI8bh15sX2iTg7jW5FF39oFVK+8sg/AzxDhiwdwSMc=; b=N7Vtg7iCjnRo7ZDCZZc4s84V3we5euKYdVZAMyviNURSjGWUFVHfCmZhq8SDw73khTAtaU c+50+kiX2DPgeE9weB7xIW+aFihE5WkQFdt5PqGhMoCNo9bNo4IKb9K4WvfZ9SIbQ3cIJ6 TiOCyKZLg72oAWm6hSDxqLEHWKcCsT78LaZjYzuVM8jxc8gAY+sd2WsHxPwvisUOkJPx7m X9sAZrIBOTXMZwy+FWsFviuZF4coB/lTem5wUoG/pKRSbl513SXv+R0E4VI3eCPxOQG4TV 5tantGDLZ2T1NtkH9xbu+YK8LorVWy6KwUbuA7Yu90o+Tcem0RuxgJ5HuHdzEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741101902; a=rsa-sha256; cv=none; b=ecWTMVlGaHkBIaavoeZced6sZlfZqRtTOJheaf5Hi722NGwTc6MxCM6QReG/F9yY2M+lXa 4k1ni7xm5qUJxGDO5KW9ri3g0BI17OEB0Uzb8hHeRKDit4V5xtOgCIcdglETOFpuB5XIAi L43rjoWu+Lq1UtABPbBlfeftiHLxwjPAJxdwuGJ67+LkMBvlRLfrN9zoeBJv/jSzbcXJfR bRR+Ey9bGfpl5gBdqOGlPBPqslVVa8R4JDbcBegEKK4uiwGvokRUVqH4IHzHOu/e8kJgZ2 ECnWs/yqyev8+6GYpx+PqHRkP75sx59X1q6YHn8eQsFTb3O+Xvedt2oWuM4w/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741101902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=deI8bh15sX2iTg7jW5FF39oFVK+8sg/AzxDhiwdwSMc=; b=KEc2LjvO6S3DnvfjotmqRPLksM8L1qsYTRnEGzt554VrJUx+BoqdXlBCEDNj1cTBv825Uc d6+U/Sva6bYqYp1Z1xAx0d0PtnQOelmdziiOvMB+n/oJCtQRiFTPdQBZV4J256GjKM+m2i E597zZSSyHHkJMf1301RMjd75hjXje6Ibw3lkzriSnB7UhwHfKYVbvn2XhjXylXaZWB1dd 2YI7bh0cYe96ewFV98p1a8/Id/zFwXBUQPrnkmY6iFqbsVYZKeFiGbITlwrFQ8k/nhOzqO qcayDRGFHIofu1tcdT+FktR5VJbWx3h8r1Y4f6FgkDiYXImryXEhGMBvb+pGxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6fct0FXrz7w5; Tue, 04 Mar 2025 15:25: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 524FP1vE011567; Tue, 4 Mar 2025 15:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524FP1gm011564; Tue, 4 Mar 2025 15:25:01 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:25:01 GMT Message-Id: <202503041525.524FP1gm011564@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: d1a37f280be4 - main - LinuxKPI: 802.11: remove ieee80211_node_get_txrate_dot11rate() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1a37f280be46a707b42c3eca5f8b6a38ecf726b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d1a37f280be46a707b42c3eca5f8b6a38ecf726b commit d1a37f280be46a707b42c3eca5f8b6a38ecf726b Author: Bjoern A. Zeeb AuthorDate: 2025-03-04 15:20:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 15:24:05 +0000 LinuxKPI: 802.11: remove ieee80211_node_get_txrate_dot11rate() net80211 ieee80211_node_get_txrate_dot11rate() does not yet support VHT and that means we get a lot of log lines when doing VHT for a debugging statement even if it's not active. Remove the calls to ieee80211_node_get_txrate_dot11rate() as with hw/fw based rate control (modern iwlwifi) they are pointless anyway as they are currently. Sponsored by: The FreeBSD Foundation X-MFC: only if net80211 gets MFCed Reported by: J.R. Oldroyd (jr opal.com) Fixes: 706745001093 (I should have noticed during review) --- sys/compat/linuxkpi/common/src/linux_80211.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 14c7bab163b6..33b33651b6ad 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6921,12 +6921,6 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, } if (ni != NULL) { -#ifdef LINUXKPI_DEBUG_80211 - int old_rate; - - old_rate = - ieee80211_node_get_txrate_dot11rate(ni->ni_vap->iv_bss); -#endif txs.pktlen = skb->len; txs.flags |= IEEE80211_RATECTL_STATUS_PKTLEN; if (info->status.rates[0].count > 1) { @@ -6943,16 +6937,13 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, txs.flags |= IEEE80211_RATECTL_STATUS_RSSI; } - IMPROVE("only update of rate matches but that requires us to get a proper rate"); + IMPROVE("only update rate if needed but that requires us to get a proper rate from mo_sta_statistics"); ieee80211_ratectl_tx_complete(ni, &txs); ieee80211_ratectl_rate(ni->ni_vap->iv_bss, NULL, 0); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) { - printf("TX-RATE: %s: old %d new %d " - "long_retries %d\n", __func__, - old_rate, - ieee80211_node_get_txrate_dot11rate(ni->ni_vap->iv_bss), + printf("TX-RATE: %s: long_retries %d\n", __func__, txs.long_retries); } #endif From nobody Tue Mar 4 15:26:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6ff33Fkqz5qDfl; Tue, 04 Mar 2025 15:26: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 4Z6ff31DwSz3pXt; Tue, 04 Mar 2025 15: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=1741101963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/mGrRmOVLPokIjf16xaqzl+xLJIVIw7+L047syGI4c8=; b=hXlcDJqlIdRZbuZ9xIroDpw6l92vbMJhdNmpimuN5+h3QHWPbD0q5yRRyftnQikeuEiuin Rv1fONg5NEJb2oGrRRFXh8NhhBj+wWxnIlGnviakNYTkA+QnIPfW0PoSZKo8yDrRc6vbaR cbh0cMnFqKKeiUJJKDb0SSwfkyOD8cKtnrv7mtHfQExLHX2l0gcqMSWLJ05wEM4ouyn/cj jRNMJY9Ni6XxAqAn6UO3POcC7Rc/0oMVJaZ6a26hZ2H94B8+UUoErjMUYfyzGFElIkDG6j c76eLGNmo/qo+Z2MzW3fk9c8lD5M7KrqxYY0BbSnqukRYpLbrVRuAmCcKFTzvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741101963; a=rsa-sha256; cv=none; b=q0KW9U/cwRL8lOYipYFK1zM3Vj8FHEpiVSgPoCF4C7+w5yhVsAat7VLV4zeVCOEXmVwo6o xvA4TGLw2sEOWGTPw5qGaDzvumhWbIMvV10jwuJWm2FAJru7h8qsEjpQMvLDItP6i+aUbs gtboF33ZeW90WYKhiyqfatb+LCf3vhDg2046pAJcRAHS6dvjEHj5XA3po80M4B3SoPWyBm 7hq7+f5JAba4wW589m2qqt19WbPWS9dUz/dcW9dDs8n87cOLUqUrNPV2GBHlGvYZQ4EbB+ jHimrmaJNUyzZPHAmklUXhuGMAy4Ih0XS0GUm/ezxnYqBu46tDVuwrM4Yptl2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741101963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/mGrRmOVLPokIjf16xaqzl+xLJIVIw7+L047syGI4c8=; b=ppipdjqRxAqIEvIjjPAuzPAfqDnW18fBo5/p+hUHGv4xPr7p5qFdfqv5jQumtYIVdUukA6 6SVtRg8aRGw71kRzSDigGrH10v34/SnOrvhs2pSsNhr4Qm+xdNvSxDslmq4b/yIqaT1R1J 4PznI0R+1iL7g9r4BVt+s19dMroIIfppNfMn5B7aaSBvuGmEjrv9QYgAna6x6ObhiTpFPl kmtzK99D1Q49EV0NYCFWNOgFZM56DcW/B5LfLaNTMjDKQm+KqylbJM8ka3iyYbxSTncCD5 LKq2UVJNFjU4sHLMatoVzgKqQ88II9t+N5HJbqJ0Ave77IwFLgD60c3h/j8XdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6ff30lCGz86h; Tue, 04 Mar 2025 15: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 524FQ3DS011978; Tue, 4 Mar 2025 15: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 524FQ2OA011975; Tue, 4 Mar 2025 15:26:02 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:26:02 GMT Message-Id: <202503041526.524FQ2OA011975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 3816452ecac6 - main - Revert "riscv: enable allwinner RTC" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3816452ecac64dcd2708c67fe0a1193d5e06feac Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3816452ecac64dcd2708c67fe0a1193d5e06feac commit 3816452ecac64dcd2708c67fe0a1193d5e06feac Author: Mitchell Horne AuthorDate: 2025-03-04 15:20:55 +0000 Commit: Mitchell Horne CommitDate: 2025-03-04 15:25:56 +0000 Revert "riscv: enable allwinner RTC" It caused a regression on A10/A20 platforms. Revert until the proper fix can be determined. This reverts commit 9ddd516b886218af809dbf40eeda1ed388e2879c. PR: 285054 Reported by: mmel --- sys/arm/allwinner/aw_rtc.c | 24 ++++++++---------------- sys/riscv/allwinner/files.allwinner | 1 - sys/riscv/conf/std.allwinner | 1 - 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/sys/arm/allwinner/aw_rtc.c b/sys/arm/allwinner/aw_rtc.c index a13c0e7d926e..9938601f17ce 100644 --- a/sys/arm/allwinner/aw_rtc.c +++ b/sys/arm/allwinner/aw_rtc.c @@ -134,7 +134,6 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, - { "allwinner,sun20i-d1-rtc", (uintptr_t) &h3_conf }, { "allwinner,sun50i-h5-rtc", (uintptr_t) &h3_conf }, { "allwinner,sun50i-h6-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } @@ -148,13 +147,11 @@ struct aw_rtc_softc { static struct clk_fixed_def aw_rtc_osc32k = { .clkdef.id = 0, - .clkdef.name = "osc32k", .freq = 32768, }; static struct clk_fixed_def aw_rtc_iosc = { .clkdef.id = 2, - .clkdef.name = "iosc", }; static void aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev); @@ -252,29 +249,24 @@ aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev) { phandle_t node; int nclocks; - /* - * If the device tree gives us specific output names for the clocks, - * use them. - */ node = ofw_bus_get_node(dev); nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames); - if (nclocks > 0) { - if (nclocks != 3) { - device_printf(dev, - "Found %d clocks instead of 3, aborting\n", - nclocks); - return; - } + /* No clocks to export */ + if (nclocks <= 0) + return; - aw_rtc_osc32k.clkdef.name = clknames[0]; - aw_rtc_iosc.clkdef.name = clknames[2]; + if (nclocks != 3) { + device_printf(dev, "Having only %d clocks instead of 3, aborting\n", nclocks); + return; } clkdom = clkdom_create(dev); + aw_rtc_osc32k.clkdef.name = clknames[0]; if (clknode_fixed_register(clkdom, &aw_rtc_osc32k) != 0) device_printf(dev, "Cannot register osc32k clock\n"); + aw_rtc_iosc.clkdef.name = clknames[2]; aw_rtc_iosc.freq = sc->conf->iosc_freq; if (clknode_fixed_register(clkdom, &aw_rtc_iosc) != 0) device_printf(dev, "Cannot register iosc clock\n"); diff --git a/sys/riscv/allwinner/files.allwinner b/sys/riscv/allwinner/files.allwinner index 73fa9660e2d2..423a89c10c78 100644 --- a/sys/riscv/allwinner/files.allwinner +++ b/sys/riscv/allwinner/files.allwinner @@ -1,6 +1,5 @@ arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt -arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_syscon.c optional syscon arm/allwinner/aw_sid.c optional aw_sid nvmem arm/allwinner/aw_timer.c optional aw_timer fdt diff --git a/sys/riscv/conf/std.allwinner b/sys/riscv/conf/std.allwinner index 2b1e0d4e09dc..1bf6b027a4cb 100644 --- a/sys/riscv/conf/std.allwinner +++ b/sys/riscv/conf/std.allwinner @@ -7,7 +7,6 @@ options SOC_ALLWINNER_D1 device aw_ccu # Allwinner clock controller device aw_gpio # Allwinner GPIO controller -device aw_rtc # Allwinner Real-time Clock device aw_sid # Allwinner Secure ID EFUSE device aw_timer # Allwinner Timer device aw_usbphy # Allwinner USB PHY From nobody Tue Mar 4 15:46:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g655hc0z5qG3T; Tue, 04 Mar 2025 15:46: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 4Z6g654PR4z42LQ; Tue, 04 Mar 2025 15:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2B7C/6PzgfOqZaBVHoUI0Kyszt6PdEc1BIWr9RDVFCw=; b=ZL778sXgwo5dTm8A4qaEEI+h/KQ9AHSDjpnfPDJW4L/LpsxuNL52yICJsxRsJ0krOxrhUZ 7QoYsel62hbyUTba40/woGAqUTKuTtj7omUjEKPar1h8vkHbo0cloQ1c8MMlhV+bu/6nkk m748B3+Xt4jaaRcNd7cHFTpo1Pr4NfGDTsARcwxVQqWglFP5l2t31m5o9fmVnORKtXyptJ +EOp80WoSW9E/l0lKukzC/ey4wjem52J8AX9DVnHYEqef3Nb4y5YMdMqb4rdbHYEdWvrJX d1zlo06L8JC8xQCVm+TD7GrgqTMpYiD249eWK2A7hMobG1WMjBG/qmtob8jWNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103213; a=rsa-sha256; cv=none; b=rkVoy5GJiz0W+RPC0Egxgvmcbgbm5b/oQi/5skuLgI37PgZQPyydHi9Cm6GC/sutQSLwi9 k5gRE6Dz/DVUJc0Nn5f9jDMwIJLlfeTLAQK2+miA5UwlFiY7WHNk8BtN/FFMT5BaOvLeD9 xVjKfofOOZy/+kuevUgYZYhsf+Eb5P0j9rkClOfx2D3ILx43J6M9ZS0OWlM/qYGNrCG/XH 5w5/5EvBekWVUk9nnA1f8sNfOnQAdhzgxQmDr0HAAOhcmewwNFj/YIXxdq98k6SKOcVil7 z3Qjt8jVGniFAimmvWw+6UVYvDT++dFh04sr7f/XPAtXw1VkytpkeQJbtwhZTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2B7C/6PzgfOqZaBVHoUI0Kyszt6PdEc1BIWr9RDVFCw=; b=djzqtsG1Fx84Dj9z6aF8jbQ6Idz2HkbpKTp7i1KLfVAmqmeeWOgM8ODaj5VI+nPli0BuE3 rAX+ilysbA1N+LJ2cfQI8sypSTqkzH0LI+K5gatur6TAB3OPzEdydn31KnKNS9FD0M3vom 9xZSrXEEYdh3rMZZDNEkyJkrE8aF5jvFT/azSv+fQjGVxcxoms38U4gl7d6cCttp1O2swa B60lY1cuR6kBTeiH/NnnPKcYlmg+WmkxTSflNICpN+X39kbainhCTytWUyxoF6Mb7q19Ui f5E0fuVetRP2jLoJ0ldq4MmKXb9kU1cy6uUeFlaDcowDh5brNzsFnufOWvY2ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g653qM4z8H4; Tue, 04 Mar 2025 15:46: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 524FkrSN049698; Tue, 4 Mar 2025 15:46:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fkrsq049695; Tue, 4 Mar 2025 15:46:53 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:46:53 GMT Message-Id: <202503041546.524Fkrsq049695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a86dfa429690 - stable/14 - sound: Do not return an error from chn_notify() if the children list is empty List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a86dfa4296907f8a6170585b2bfd208db64a884d Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a86dfa4296907f8a6170585b2bfd208db64a884d commit a86dfa4296907f8a6170585b2bfd208db64a884d Author: Christos Margiolis AuthorDate: 2025-02-25 11:42:59 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 +0000 sound: Do not return an error from chn_notify() if the children list is empty An empty children list does not mean that there is an error. Reported by: Florian Walpen Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48156 (cherry picked from commit 164651f16c860049a4ad2098206def8ca7a39b4a) --- sys/dev/sound/pcm/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 4b0ca128391b..4d275d00762a 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2360,7 +2360,7 @@ chn_notify(struct pcm_channel *c, u_int32_t flags) CHN_LOCKASSERT(c); if (CHN_EMPTY(c, children)) - return (ENODEV); + return (0); err = 0; From nobody Tue Mar 4 15:46:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g671V6gz5qGbB; Tue, 04 Mar 2025 15:46: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 4Z6g6656zkz423t; Tue, 04 Mar 2025 15:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tVOTN2hwfYmZ/726dmXOOoIhpjC7RS/W4XVzKorZ7PQ=; b=Po1RbyiTIYDWP9vnhaeXMtlMGc9IhFhzsIaCS3vvUt12oStaphs1+Ebcy84ld1dI7tVrKE t1YNdx0VOGnpd0OMGV6ISnP2pGs5jhpKSJyYRriYZJzMlH0/bnvFHkhTMVpVvtRT1U8fWs K0H83GABlPU4KS5ezv389GTNP5TgJDelVTbrKzCYw9Zvn+VoPu1tLeogShcSwTHoyhL/Na dkJBDFK4QHRFcgRxgeeBitOcH63VBzoldFJys5cH+Hg86f2VD2ETBDDg5OB9tTcwe7/Z/X Qo7Gj4Bp82rW9xn4fnaGqSFO0iRM4H9G3puB8Rh9RGslPvNweTxT8QxiorbS1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103214; a=rsa-sha256; cv=none; b=J13G9EfKjrmiT5FbFSwdS7LbcZaiO2CQkjIvEoCXpNNXAmz6iF6yrGmTKllyLLjChJZcU/ rCkin2wKje8NVI6YDV64TCzqmSwomW11+HAF8d2kkt839I6oRy4XWnRClNlGAMlDescfMH q+2SIltmEfzP92/H2FqYxD6Xrz+3WNfPfNBHxC6G42Nee5xY3Ne/O/MonihD493pQDEvPC PIq4E6k++98xmGW6MkfYfh/GLVDnUa2QWguSzHvXxf/KSgywywAxFW1V0XmJWqC0Y+Llml eO8HaIWPQ+EPonJJ2oVjkk0cZV1pbsRlCJX2vhL/bqndoFzJIHnP/cWZtnBGLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tVOTN2hwfYmZ/726dmXOOoIhpjC7RS/W4XVzKorZ7PQ=; b=pZBgFjmi5+5B/KueSrYPVGqyVe/2CvGek1GtD4WLRgfulpGVJDPm0OilLIOmdeQx/wpb4r Ybg9quMdv6QJVnZwn7WavA38q8jvOAVzBpXb2jI4TEVQ/ypeb2c/yl1pu/3enJSrAPxLYh +UqfPsgFVqyijnz1glm4X6SJ0p0KWaoIV6DVZ3UlkmCk4HciTJ/NOBXufJUlKWALiIA9LW GOfWG8u0t/7C/k/bvQoCrcBlJbe/ecPFWB7AZzf/u1HEjQH9sdHSdki4Y1W3qX8njrEZMX IZ8RHVfuhMKLPC/wbaLoAWvdqk1+t1JhDPPWhkIAkCxsOtzH9zdoYKnY7nacYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g664jHCz85N; Tue, 04 Mar 2025 15:46: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 524Fksaa049732; Tue, 4 Mar 2025 15:46:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fks5p049729; Tue, 4 Mar 2025 15:46:54 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:46:54 GMT Message-Id: <202503041546.524Fks5p049729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8233ccc3bcee - stable/14 - sound: Do not fail from vchan_destroy() if children list is empty List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8233ccc3bcee6dbe6179eca605d8a354a861cf7e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8233ccc3bcee6dbe6179eca605d8a354a861cf7e commit 8233ccc3bcee6dbe6179eca605d8a354a861cf7e Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:11 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 +0000 sound: Do not fail from vchan_destroy() if children list is empty vchan_destroy() should be able to call chn_kill() regardless of whether the channel has been added to the children list yet or not. Also remove the CHN_F_BUSY check. There is no reason we shouldn't execute the code below if the parent is not busy. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48185 (cherry picked from commit 405b1e50926d4162fb9503644073c0184a8b37d9) --- sys/dev/sound/pcm/vchan.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 4165d0712b94..ea8a50b316fe 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -838,15 +838,8 @@ vchan_destroy(struct pcm_channel *c) CHN_UNLOCK(c); - if (!(parent->flags & CHN_F_BUSY)) - return (EBUSY); - - if (CHN_EMPTY(parent, children)) - return (EINVAL); - /* remove us from our parent's children list */ CHN_REMOVE(parent, c, children); - if (CHN_EMPTY(parent, children)) { parent->flags &= ~(CHN_F_BUSY | CHN_F_HAS_VCHAN); chn_reset(parent, parent->format, parent->speed); From nobody Tue Mar 4 15:46:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g680wSCz5qGYC; Tue, 04 Mar 2025 15:46: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 4Z6g675RXJz4223; Tue, 04 Mar 2025 15:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7frXsOnyFa0yAH4EyobVwtbAIxn8LDe7ZZzn8LTjAE=; b=BOQ1Hq3AGvw+NhKfnQ6XSHwvbGSv8eETxmfYIHvDrIhI0zyG0z5ORHLn1mTAV+YvkLuYB0 6TUFrAwMly/WUSBiXqQ62XR0URUpND6dR9FtwMnepAcgeh4UTDhtDu9XHf1Pn82Q2/igv+ N5tut4CQawkOXyEXTPy0XPqYP8pyfR/ZFXg5GYwdCnxNZphM29K+ICKqD6RrwFd2nPF25K YGtxyg0nngxBzD782Ty+8um7+AJW2+GbCQeVdgkaoHFpbUeI2hFY0ioBHlWRKaosyYBR6C GuANyDgBuyhz4feyDhtR7xPXCICnXvsn5SGroY2WdzNAi+Qn60eYJNfYMQvxUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103215; a=rsa-sha256; cv=none; b=tBMvfDRjojnAntiZzYF5NPS6x6onCZlfDb5noVVN0kIrgja1RVumG6mof5oFMqXaMVAmlp mngBvXQ9qST12Pi8zV4EskWI4VeH/nbmt1eUJmBwzH2LaT/XGBcXKUckH2ALRfoml8jV+D epgEeLmY4de9anBDbvI8Zqj8zhjurtdJMHTzUYOADEb5t4HoYzreq3OEAH9tkMJAEg8aw1 KnqWNRRcJ2qK9Hcsvs4L8xPW5yWeutt5GIDBru5+2coioeRUcpSqkb2tzWTYUF+TGKzsbT NuT+Vhg8HQfsY4kNupzdCKf0Z5jmaKh49gcrmVhH7ve11i7z2wPijBogqlfc0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7frXsOnyFa0yAH4EyobVwtbAIxn8LDe7ZZzn8LTjAE=; b=kMfsbksl+2xHJmS0GoYvHgZ3Lfok3Of1ysnYwKlO04cXyCyAZr4O6n6vsE59nIjhSeNCqJ wE9tXKx1jw977G2j7x6nTJfUtwnu/2hr/FclV9Xi8g+015foC3lXs30P7/kmYHLNNeJrdV PjFfbnedD/VZn691U6xjTH82TAl+9J7VVEaIJdzSrJfz7YBqn4xZdcow/V1wmzIE+kiT/i m/mfTuNIJVvBeoWsehKliED/DQ/Fs2xBquU/cignh9pToy2qIIBBIc2aTZI5rh/dclYexF VB2Vq5Z/hEl+m9M//Yo9h5ZSOL3jmXjNDFFM6lmHyOQKRMGe6s+vTVD9NbuuSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g674zCBz8Bj; Tue, 04 Mar 2025 15:46: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 524FktDI049770; Tue, 4 Mar 2025 15:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524FktwE049767; Tue, 4 Mar 2025 15:46:55 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:46:55 GMT Message-Id: <202503041546.524FktwE049767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 5fc710ae2d78 - stable/14 - sound: Call vchan_destroy() on vchan_create() failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5fc710ae2d78d0f8625513b04d131011bde1f7c8 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5fc710ae2d78d0f8625513b04d131011bde1f7c8 commit 5fc710ae2d78d0f8625513b04d131011bde1f7c8 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:19 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 +0000 sound: Call vchan_destroy() on vchan_create() failure Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48183 (cherry picked from commit 2546ab1b3632a9ebfe88d9d5dc55700e653bff5d) --- sys/dev/sound/pcm/vchan.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index ea8a50b316fe..4ee7e01066d3 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -811,11 +811,8 @@ vchan_create(struct pcm_channel *parent) return (ret); fail: - CHN_REMOVE(parent, ch, children); - parent->flags &= ~CHN_F_HAS_VCHAN; - CHN_UNLOCK(parent); - chn_kill(ch); - CHN_LOCK(parent); + CHN_LOCK(ch); + vchan_destroy(ch); return (ret); } From nobody Tue Mar 4 15:46:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g690zlWz5qGNk; Tue, 04 Mar 2025 15:46: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 4Z6g686PH9z42LY; Tue, 04 Mar 2025 15:46:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ugFB3xVQC8oUc+S9pvcRvJF9Es+TYOHguPVe9UaoKGI=; b=t7PohaDnbonkqNgHYn7c/W0a0QT/t8fio91iRtq/7VfZx6U77zJDVIh+CHe0EKlx0OMsf/ y6B+PCfJ/5omckXt7uwJDy5/lcpygg1wfQZQwc68j5gL0B8UPdxUE+GtMbzY/DLfgzzXE/ zLp+KkiYS1luUkLHcFbWLjKxkxeFgQGB3TDm54dQnS+WkrJdwth/onmdj+wDv3eB0EBPFf KzQSFgVkWYXUgNbYMZnB383LZuD7G1UiAuy1D5whw+UiuaA6uGam3iHnldrDA9a4YOT+pP mkFeVthSlmceumV120Nx49dfkRJ9zfjik+5M9NNAOiiAlA0CdyKR0p8UUslFzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103216; a=rsa-sha256; cv=none; b=cZ4aFPOffnz+VZOdvN/7sXTqC37PHqwVpaA05wKhy3FA8w/W+7UT4RyblViR57UGYY0XGF JBDXOKvAPXjs3TjwrbgBko+dPMoAG3gdyu9zZ5srCZ23UKkRWj9edDJTHH+Ybwx97/hgCJ XYfa5rm0CBENi0E+4krN1rI2/WHaGnikd0qYnXrUPjBsvJtyq5hJbkuZgHPc0xKncmhA7J pJxJ7245Tw5+utuoskZseX6vFkeFXN98xKMdEPSLdc/tKU6nX5N1/JzC+Vx2HiQXZItyHF bvYfOZJPNuM7XAOr7EuGZjwQdQI9dd4u+fz3GjVDokpP7W664wF1Z148pPnvOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ugFB3xVQC8oUc+S9pvcRvJF9Es+TYOHguPVe9UaoKGI=; b=C02J4P/U5QWeYOmCVSL7lZv/9NeQ/wZi1KDOp34CHbNut0dF6fSOFqDY7DZqze6w1mg5N3 1Eu6nIWHsXTRoAusl1q2V/h5p7JimPoROkritAArAOijEYVL2BYNgDrSIZH06O9vVeBg4P QOvEFccg/Yg7gAkO/2dDF8z+dgePYrfID6LbZwviXRVOyKPndKhpdUXTCmRJBdbvBweeUf /QHs0JlcmHLFvEy/R7ALPJYs/9ffgvaYt8DXUl+NK3tbAb8EOGC50zxJO8UfTJecR/M9C9 ypA+/bKD10P/Eh81QlBg/xZrpOWfBAly1Jz6f6nRhBagoFRLn6wCccGLf8dMhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g685tfRz8H5; Tue, 04 Mar 2025 15:46: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 524FkuNJ049805; Tue, 4 Mar 2025 15:46:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fkuap049802; Tue, 4 Mar 2025 15:46:56 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:46:56 GMT Message-Id: <202503041546.524Fkuap049802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8be87b77e419 - stable/14 - sound: Initialize channels with sane default rate and format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8be87b77e419d959339f815325a763da83d24123 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8be87b77e419d959339f815325a763da83d24123 commit 8be87b77e419d959339f815325a763da83d24123 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:26 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 +0000 sound: Initialize channels with sane default rate and format There is no good reason to initialize with AFMT_U8 at 8000Hz. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48434 (cherry picked from commit e89ee05b7cf1a54d0d6ed56e4d451fdd9a10db43) --- sys/dev/sound/pcm/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 4d275d00762a..58315610312e 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1205,8 +1205,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, c->direction = direction; c->type = dir; c->unit = alloc_unr(chn_getunr(d, c->type)); - c->format = SND_FORMAT(AFMT_U8, 1, 0); - c->speed = DSP_DEFAULT_SPEED; + c->format = SND_FORMAT(AFMT_S16_LE, 2, 0); + c->speed = 48000; c->pid = -1; c->latency = -1; c->timeout = 1; From nobody Tue Mar 4 15:46:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6B4YQjz5qGVq; Tue, 04 Mar 2025 15:46: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 4Z6g6B0DPKz4240; Tue, 04 Mar 2025 15:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SPASJDxi2V8kBVvbcTrp2IgoOUCsGfCDccyeboKSK8Q=; b=CXCD0FK8oDtV8gpGWmwhmcVOptJkGlEnwDr06P5K3bY+aBvl4VAyuOZ7n6kMUNy1kSIFrV ndfxeFuWR9JqwXn+bSPOS4xzE9CU2CKK8mQkq9/wBHnFBGLvltLri9TA62Sd0KdLxHMShg G0e67nct85xkx3xi3x+yddu6pWRc1r8Gjkaz400Lm/hiUwnvMzP8bG467anHWc0goymq6F R6z/daGTyR5FWbtOcPn92NIgCOWpITgWoMlo/H0ApkXULeo5MR/Eg9+ktg6lpFFDmjqMt+ eVyXD7lv9EO1UCRs3uENdbzqd75Bl605893ZBXWdmX12RDffHV9d/U4wOLKO9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103218; a=rsa-sha256; cv=none; b=PDlmZ7Lyfk1+XlXuduk2IDoEE0jzJjuvTfaeIITCeV9snZJQRmY2u79onLPwZL+z5aLrrH 0WIm8EBflwjHUJ1gyAUHVQ4m6Fv+bTpYt45eGFGWrJk0QewxskiYQyT+mNl9uqiDKPf0O7 voQ65cZk/A8TWur6peT0dFXbtNYKEggh+CScasSF1GYNjJ0Hv59BgoZkqCZ5UD7vIT2ZhX WvYnv/TGISPFPn5eTRkdZOLZBwUMAst//czEJFY81DvJZzjJtM7DKGFjro3KDAX77VPylv NYnRMqB9TwxdPzUruT+nSQUcZekFYNCTj0b8XW09C+y8MpzRkCKe5OR93wrdew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SPASJDxi2V8kBVvbcTrp2IgoOUCsGfCDccyeboKSK8Q=; b=LebGeIXxeQHcP9SSHvspHrokE8pUwEF3N4EKNSOPKeTzT3/+EUMAt0/9m0n+hRivrCUx5w Q79SHRqu+wQ12fxWuLO0+9fYaxadf7VOoxYw1iZw0DRSqv/vg6nWWEY5BpuD5/SsvfWzlj pPXT4yKidbOJvLLd4PI1lF3MtsVwMXyWC/jNq+S1xhzhTjOrBglRgmav/xHef5peN0QHNo kW/tkIpl2k5esr5FYzqr1WHxYF71El2dOWsGqlrm4pYAiOGUmvUuksGyc02NhmN8KDlqt2 oOl+fZcx1Evh4/1g9K13TCOuXv7wYWukRg0TsNTb+aieouOVpm2UgLls8EIhrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g696sRPz8Bk; Tue, 04 Mar 2025 15:46: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 524Fkv5W049842; Tue, 4 Mar 2025 15:46:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fkv04049839; Tue, 4 Mar 2025 15:46:57 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:46:57 GMT Message-Id: <202503041546.524Fkv04049839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a8fc61770121 - stable/14 - sound: Report actual vchanrate and vchanformat in sysctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a8fc617701219d9d466332085381c266e9e686e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a8fc617701219d9d466332085381c266e9e686e3 commit a8fc617701219d9d466332085381c266e9e686e3 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:33 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 +0000 sound: Report actual vchanrate and vchanformat in sysctl Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48435 (cherry picked from commit d39be38a353323d05744eeb3e08267108e55b9b1) --- sys/dev/sound/pcm/vchan.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 4ee7e01066d3..b0caec3acfec 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -497,9 +497,7 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", __func__, direction, c->direction)); - CHN_LOCK(c); - newspd = c->speed; - CHN_UNLOCK(c); + newspd = *vchanrate; ret = sysctl_handle_int(oidp, &newspd, 0, req); if (ret != 0 || req->newptr == NULL) { @@ -530,7 +528,6 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) ret = chn_reset(c, c->format, newspd); if (ret == 0) { - *vchanrate = c->speed; if (restart != 0) { CHN_FOREACH(ch, c, children.busy) { CHN_LOCK(ch); @@ -543,6 +540,7 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) } } } + *vchanrate = c->speed; CHN_UNLOCK(c); @@ -605,15 +603,11 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", __func__, direction, c->direction)); - CHN_LOCK(c); - bzero(fmtstr, sizeof(fmtstr)); - if (snd_afmt2str(c->format, fmtstr, sizeof(fmtstr)) != c->format) + if (snd_afmt2str(*vchanformat, fmtstr, sizeof(fmtstr)) != *vchanformat) strlcpy(fmtstr, "", sizeof(fmtstr)); - CHN_UNLOCK(c); - ret = sysctl_handle_string(oidp, fmtstr, sizeof(fmtstr), req); if (ret != 0 || req->newptr == NULL) { PCM_RELEASE_QUICK(d); @@ -637,7 +631,6 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) ret = chn_reset(c, newfmt, c->speed); if (ret == 0) { - *vchanformat = c->format; if (restart != 0) { CHN_FOREACH(ch, c, children.busy) { CHN_LOCK(ch); @@ -650,6 +643,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) } } } + *vchanformat = c->format; CHN_UNLOCK(c); From nobody Tue Mar 4 15:47:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6F2BWdz5qGQ5; Tue, 04 Mar 2025 15:47: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 4Z6g6D2ZhQz422N; Tue, 04 Mar 2025 15:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KjgTLevZb+CsnKGayMeJ4RSoBUh4xtazFd1/bXKrwWA=; b=R4vA2m2NhpMe8LDYgZjSqQi0+xsRFhjb/751FrURV8NzAqtGs/o1qruvpNZdnkZxgs+Qky ZpgXaD9szunyF8fbUL6S50pN+w1jGyj3iISaH3/mZLN0TYpQ36+lpnr/NgoSlN7jVYcgxi ZFsD7ePelRKwJxnfmsAajOf81zC6JkACBPoGBo1iKy2PLVlFMpDbFERek57kZ0TMvZ+K6k RJmVDDrgY/4zVHhgNNxcpvqxhO7BiKEOLO9vmG6OSW9mIpNro84j47RuC/5c7eiZT1Q7On RHNZeVDgqHPE+x6KSptO+e+t8b0JbtbyGmn5TC1D4IYWtZpztSpg33o187ZCAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103220; a=rsa-sha256; cv=none; b=uCLUzmvKdODmDBiLPgQJE7NJizr/vjRcdm+lcs1bEpxzkPpOE/+R1A8QHiG9VZuvHEeTv/ vpS1fjtzgas2dZmlPXeGNOrbuo+WdTcqnZrt75oca9gNKnQkGvJ9SKSi03Sb+KQiRSzVNY iCr5w1sb2wiNrz2hwFSrJDRz84IsbV5qWjREJwOdtX/s4Y/73qbB7oN1bAmObCffMAviMw y4lcl6mTI4wb0wE7ui3U+L3v+CCE/n9es9snsDf0Eb6OKbc3X0Edmaf1dIpZbMS8PdlbQY Wv2INI5Gj/LIEPbyTnkIo9nGcgP+Kj/UY1HLrSewI+e58zh6z5VXu+nh0chCIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KjgTLevZb+CsnKGayMeJ4RSoBUh4xtazFd1/bXKrwWA=; b=e4mZQnIvQkA8drFdi8uGrbXqMUXJbVJMgE4tdTgb1vSkdAHCR6KjO8B5UsyAhd+ugSo3AV IZTBgFam6CaUNERTMDuLL0+newIFY6ELRG+2/5nAl0/qoDdGgtBet+zcL1UZ3g05odJ08K SdQAq3HZSdPtHIDE0dp2MGQA3vCKlvke+GViMZbQVjwdGj40gkYC1hNm6GX1pwPiwcfkoa xIhRhoaqHvp/IUVNp12tPmXR7ezj7gvglk4AdIDFTnKQQU/xuACdN+iJ+rApN5opfey6Um k5uceRs6PtRFMMdPEvz4XFgaa8RxTVBMB72eDuHzaTbV2mno5W1N36QYra08og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6D1NFKz8FY; Tue, 04 Mar 2025 15:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 524Fl0nk049924; Tue, 4 Mar 2025 15:47:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl0Iw049921; Tue, 4 Mar 2025 15:47:00 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:00 GMT Message-Id: <202503041547.524Fl0Iw049921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 58e17fd3c455 - stable/14 - sound: Cache vchanmode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 58e17fd3c4553f2c0db447cda237363f3017d27a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=58e17fd3c4553f2c0db447cda237363f3017d27a commit 58e17fd3c4553f2c0db447cda237363f3017d27a Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:46 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Cache vchanmode We already cache vchanrate and vchanformat. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48335 (cherry picked from commit b50f53cf872eca6b9a174a51fa183e8c2f88d97c) --- sys/dev/sound/pcm/sound.h | 4 ++-- sys/dev/sound/pcm/vchan.c | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index fddf5bfef1a8..1cb97325572b 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -238,8 +238,8 @@ struct snddev_info { struct mtx *lock; struct cdev *mixer_dev; struct cdev *dsp_dev; - uint32_t pvchanrate, pvchanformat; - uint32_t rvchanrate, rvchanformat; + uint32_t pvchanrate, pvchanformat, pvchanmode; + uint32_t rvchanrate, rvchanformat, rvchanmode; int32_t eqpreamp; struct sysctl_ctx_list play_sysctl_ctx, rec_sysctl_ctx; struct sysctl_oid *play_sysctl_tree, *rec_sysctl_tree; diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 297120199fe7..379d647cbcf8 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -356,7 +356,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) struct snddev_info *d; struct pcm_channel *c; uint32_t dflags; - int direction, ret; + int *vchanmode, direction, ret; char dtype[16]; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); @@ -373,6 +373,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) return (ENODEV); } direction = PCMDIR_PLAY; + vchanmode = &d->pvchanmode; break; case VCHAN_REC: if ((d->flags & SD_F_RVCHANS) == 0) { @@ -380,6 +381,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) return (ENODEV); } direction = PCMDIR_REC; + vchanmode = &d->rvchanmode; break; default: PCM_UNLOCK(d); @@ -402,14 +404,12 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", __func__, direction, c->direction)); - CHN_LOCK(c); - if (c->flags & CHN_F_VCHAN_PASSTHROUGH) + if (*vchanmode & CHN_F_VCHAN_PASSTHROUGH) strlcpy(dtype, "passthrough", sizeof(dtype)); - else if (c->flags & CHN_F_VCHAN_ADAPTIVE) + else if (*vchanmode & CHN_F_VCHAN_ADAPTIVE) strlcpy(dtype, "adaptive", sizeof(dtype)); else strlcpy(dtype, "fixed", sizeof(dtype)); - CHN_UNLOCK(c); ret = sysctl_handle_string(oidp, dtype, sizeof(dtype), req); if (ret == 0 && req->newptr != NULL) { @@ -436,6 +436,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) c->flags &= ~CHN_F_VCHAN_DYNAMIC; c->flags |= dflags; CHN_UNLOCK(c); + *vchanmode = dflags; } PCM_RELEASE_QUICK(d); From nobody Tue Mar 4 15:46:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6D1dPkz5qGSY; Tue, 04 Mar 2025 15:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6C0bqwz428q; Tue, 04 Mar 2025 15:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ktz3bEuYop93xPnEYC1RLXx3cVOQRbocN79Z0uWRi3g=; b=AbMJhp8fR83AM2CD4CYHzydlWIJ/844lcp9bm8oPKxcNV3Py9iR/Yq9z4/Bu5O5Opa9iSv MdUS69+ENDRqxnX/0gbkpJlzZyIdhsaThKUomGQZDM+bGfUOdq4lM2fAlxMj2LUHlDOCRY GNEnPgbtla4hx2YzgbEwexhn7eda7gQjE/8Ogy8wb1DR58LRDv2CoHJrpiYT3cH/TZP3KP Afz6TL3HZsQ8UN9ABwt3GcHUxg8ORYCW1gfNRHoFSApAmJrjp4yX/4RcBk3aD+fuQAu7Gy F0Ugw5WTNnVBu9lPk2wxGgenyZsVZhlakQr7U0nNQkQtopW26/u3qfg0cUAf2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103219; a=rsa-sha256; cv=none; b=Zujp/TfC0D2BJCjOB3vE+eIZfAYUl9zJuNlMnG06A7rA54Xaed2s1WQyn03GrD2iTo2kt6 8/YbZ1bCxxQ3RX7Erxc63TayYLIjVcXeJEbB6JFXKtVIrOILsdwh2N2AAtF0+yumU0TaXH fdhqcdQh6qJXo/F+W5e9nMXJpXYqMNR8zmQ4ilPHLIZTlWAPDpK6xqqgCoHFXvsJnMgePP O8tv1V7BL3uns7L98yBjtoHxgTzQJT2BLO0nNg7zvHJ1zevf2DZg54XGgFotjFdocvJFTa PoouXvho6+IcRbdp57WgMnw/Y9qsdCmT/uExMWGdCCeBsneJ+Gjzic/Pzal/sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ktz3bEuYop93xPnEYC1RLXx3cVOQRbocN79Z0uWRi3g=; b=E9dR25b2uKJd9bGFpoeZor5j8l+K7pQDrXyRhjk9ZXqTnpMIM6xPR3Qh/4hSGUx71g/QdD MtbbqEOZEtQeOf8ChE4QqQ0D93oojddI13j+5je0Q4P3jbOChcgMi9nNPd7Ood7/i1iUim jAWbC5kl7pV526YbXzndDTRVnpD2xQUXhQz4ppNUyl8/H1NOq7eT3BH1lMQ3qwm13xBMrg PutfAEj2QP2ioVSUkFuIyC4LA7Qfdv26GxSqWuKKy5Do0ImgXdElYBco2giuTlW3yCA9DD +EsunjH66i38sSCDLM/c8epVLFktWIDEdwHQzyvR13G2uLLBqeG2asCmOtbFDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6C0C3vz8H6; Tue, 04 Mar 2025 15:46: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 524FkxDc049883; Tue, 4 Mar 2025 15:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fkwhn049880; Tue, 4 Mar 2025 15:46:58 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:46:58 GMT Message-Id: <202503041546.524Fkwhn049880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 960ee8094913 - stable/14 - sound: Allocate vchans on-demand List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 960ee8094913f1f96c6a432d84ae1f153b1a562c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=960ee8094913f1f96c6a432d84ae1f153b1a562c commit 960ee8094913f1f96c6a432d84ae1f153b1a562c Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:39 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 +0000 sound: Allocate vchans on-demand Refactor pcm_chnalloc() and merge with parts of vchan_setnew() (now removed) and dsp_open()’s channel creation into a new dsp_chn_alloc() function. The function is responsible for either using a free HW channel (if vchans are disabled), or allocating a new vchan. Clean up allocated vchans associated with a given dsp_cdevpriv on dsp_close() instead of leaving them unused. hw.snd.vchans_enable (previously hw.snd.maxautovchans) and dev.pcm.X.{play|rec}.vchans now work as tunables to only enable/disable vchans, as opposed to setting their number and/or (de-)allocating vchans. Since these sysctls do not trigger any (de-)allocations anymore, their effect is instantaneous, whereas before we could have frozen the machine (when trying to allocate new vchans) when setting dev.pcm.X.{play|rec}.vchans to a very large value. Create a new "primary" channel sublist so that we do not waste time looping through all channels in dsp_chn_alloc(), since we are only looking for a parent channel to either use, or add a new vchan to. This guarantees a steady traversal speed, as the parent channels are most likely going to be just a handful (2). What was currently in place was a loop through the whole channel list, which meant that the traversal would take longer the more channels were added to that list. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47917 (cherry picked from commit 02d4eeabfd73e6a827f5d42601e99aad92060b04) --- share/man/man4/pcm.4 | 23 ++-- sys/dev/sound/pcm/channel.c | 14 ++- sys/dev/sound/pcm/channel.h | 3 + sys/dev/sound/pcm/dsp.c | 233 ++++++++++++++++++++---------------- sys/dev/sound/pcm/sound.c | 70 ++--------- sys/dev/sound/pcm/sound.h | 13 +- sys/dev/sound/pcm/vchan.c | 285 +++++++++++++------------------------------- sys/dev/sound/pcm/vchan.h | 7 +- 8 files changed, 254 insertions(+), 394 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index e406bd2c8343..ecaf732aad25 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 24, 2024 +.Dd December 4, 2024 .Dt SOUND 4 .Os .Sh NAME @@ -358,14 +358,12 @@ A value of 0 will use a low and aggressive latency profile which can result in possible underruns if the application cannot keep up with a rapid irq rate, especially during high workload. The default value is 1, which is considered a moderate/safe latency profile. -.It Va hw.snd.maxautovchans -Global VCHAN setting that only affects devices with at least one playback or -recording channel available. -The sound system will dynamically create up to this many VCHANs. -Set to -.Dq 0 -if no VCHANs are desired. -Maximum value is 256. +.It Va hw.snd.vchans_enable +Global VCHAN setting to enable (1) or disable (0) VCHANs. +This setting can be overridden for an individual device by using the +.Va dev.pcm.%d.[play|rec].vchans +tunables. +Default is enabled. .It Va hw.snd.report_soft_formats Controls the internal format conversion if it is available transparently to the application software. @@ -432,11 +430,8 @@ The recommended way to use bitperfect mode is to disable VCHANs and enable this sysctl. Default is disabled. .It Va dev.pcm.%d.[play|rec].vchans -The current number of VCHANs allocated per device. -This can be set to preallocate a certain number of VCHANs. -Setting this value to -.Dq 0 -will disable VCHANs for this device. +Enable (1) or disable (0) VCHANs. +Default is enabled. .It Va dev.pcm.%d.[play|rec].vchanformat Format for VCHAN mixing. All playback paths will be converted to this format before the mixing diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 58315610312e..17c11dc33b7a 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1172,7 +1172,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, struct feeder_class *fc; struct snd_dbuf *b, *bs; char buf[CHN_NAMELEN]; - int i, direction; + int err, i, direction; PCM_BUSYASSERT(d); PCM_LOCKASSERT(d); @@ -1279,8 +1279,18 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_WAITOK); } + if ((c->flags & CHN_F_VIRTUAL) == 0) { + CHN_LOCK(c); + err = chn_reset(c, c->format, c->speed); + CHN_UNLOCK(c); + if (err != 0) + goto fail; + } + PCM_LOCK(d); CHN_INSERT_SORT_ASCEND(d, c, channels.pcm); + if ((c->flags & CHN_F_VIRTUAL) == 0) + CHN_INSERT_SORT_ASCEND(d, c, channels.pcm.primary); switch (c->type) { case PCMDIR_PLAY: @@ -1332,6 +1342,8 @@ chn_kill(struct pcm_channel *c) PCM_LOCK(d); CHN_REMOVE(d, c, channels.pcm); + if ((c->flags & CHN_F_VIRTUAL) == 0) + CHN_REMOVE(d, c, channels.pcm.primary); switch (c->type) { case PCMDIR_PLAY: diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 6eaad8cc2c0b..31c617a6df78 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -160,6 +160,9 @@ struct pcm_channel { struct { SLIST_ENTRY(pcm_channel) link; } opened; + struct { + SLIST_ENTRY(pcm_channel) link; + } primary; } pcm; } channels; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index dcbdd581c82a..88e0580c5c45 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -37,6 +37,7 @@ #endif #include +#include #include #include #include @@ -158,6 +159,81 @@ dsp_unlock_chans(struct dsp_cdevpriv *priv, uint32_t prio) CHN_UNLOCK(priv->wrch); } +static int +dsp_chn_alloc(struct snddev_info *d, struct pcm_channel **ch, int direction, + int flags, struct thread *td) +{ + struct pcm_channel *c; + char *comm; + pid_t pid; + int err; + bool vdir_enabled; + + KASSERT(d != NULL && ch != NULL && + (direction == PCMDIR_PLAY || direction == PCMDIR_REC), + ("%s(): invalid d=%p ch=%p direction=%d", + __func__, d, ch, direction)); + PCM_BUSYASSERT(d); + + pid = td->td_proc->p_pid; + comm = td->td_proc->p_comm; + + vdir_enabled = (direction == PCMDIR_PLAY && d->flags & SD_F_PVCHANS) || + (direction == PCMDIR_REC && d->flags & SD_F_RVCHANS); + + *ch = NULL; + CHN_FOREACH(c, d, channels.pcm.primary) { + CHN_LOCK(c); + if (c->direction != direction) { + CHN_UNLOCK(c); + continue; + } + /* Find an available primary channel to use. */ + if ((c->flags & CHN_F_BUSY) == 0 || + (vdir_enabled && (c->flags & CHN_F_HAS_VCHAN))) + break; + CHN_UNLOCK(c); + } + if (c == NULL) + return (EBUSY); + + /* + * We can have the following cases: + * - vchans are enabled, add a new vchan to the primary channel. + * - vchans are disabled, use the primary channel directly. + */ + if (vdir_enabled && ((c->flags & CHN_F_BUSY) == 0 || + c->flags & CHN_F_HAS_VCHAN)) { + err = vchan_create(c, ch); + CHN_UNLOCK(c); + if (err != 0) + return (err); + CHN_LOCK(*ch); + } else if ((c->flags & CHN_F_BUSY) == 0) { + *ch = c; + } else { + CHN_UNLOCK(c); + return (ENODEV); + } + + (*ch)->flags |= CHN_F_BUSY; + if (flags & O_NONBLOCK) + (*ch)->flags |= CHN_F_NBIO; + if (flags & O_EXCL) + (*ch)->flags |= CHN_F_EXCLUSIVE; + (*ch)->pid = pid; + strlcpy((*ch)->comm, (comm != NULL) ? comm : CHN_COMM_UNKNOWN, + sizeof((*ch)->comm)); + + if ((err = chn_reset(*ch, (*ch)->format, (*ch)->speed)) != 0) + return (err); + chn_vpc_reset(*ch, SND_VOL_C_PCM, 0); + + CHN_UNLOCK(*ch); + + return (0); +} + #define DSP_F_VALID(x) ((x) & (FREAD | FWRITE)) #define DSP_F_DUPLEX(x) (((x) & (FREAD | FWRITE)) == (FREAD | FWRITE)) #define DSP_F_SIMPLEX(x) (!DSP_F_DUPLEX(x)) @@ -168,7 +244,7 @@ static void dsp_close(void *data) { struct dsp_cdevpriv *priv = data; - struct pcm_channel *rdch, *wrch; + struct pcm_channel *rdch, *wrch, *parent; struct snddev_info *d; int sg_ids; @@ -214,12 +290,20 @@ dsp_close(void *data) if (sg_ids != 0) free_unr(pcmsg_unrhdr, sg_ids); - CHN_LOCK(rdch); - chn_abort(rdch); /* won't sleep */ - rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | - CHN_F_DEAD | CHN_F_EXCLUSIVE); - chn_reset(rdch, 0, 0); - chn_release(rdch); + if (rdch->flags & CHN_F_VIRTUAL) { + parent = rdch->parentchannel; + CHN_LOCK(parent); + CHN_LOCK(rdch); + vchan_destroy(rdch); + CHN_UNLOCK(parent); + } else { + CHN_LOCK(rdch); + chn_abort(rdch); /* won't sleep */ + rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | + CHN_F_DEAD | CHN_F_EXCLUSIVE); + chn_reset(rdch, 0, 0); + chn_release(rdch); + } } if (wrch != NULL) { /* @@ -231,12 +315,20 @@ dsp_close(void *data) if (sg_ids != 0) free_unr(pcmsg_unrhdr, sg_ids); - CHN_LOCK(wrch); - chn_flush(wrch); /* may sleep */ - wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | - CHN_F_DEAD | CHN_F_EXCLUSIVE); - chn_reset(wrch, 0, 0); - chn_release(wrch); + if (wrch->flags & CHN_F_VIRTUAL) { + parent = wrch->parentchannel; + CHN_LOCK(parent); + CHN_LOCK(wrch); + vchan_destroy(wrch); + CHN_UNLOCK(parent); + } else { + CHN_LOCK(wrch); + chn_flush(wrch); /* may sleep */ + wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | + CHN_F_DEAD | CHN_F_EXCLUSIVE); + chn_reset(wrch, 0, 0); + chn_release(wrch); + } } PCM_LOCK(d); } @@ -254,10 +346,9 @@ static int dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { struct dsp_cdevpriv *priv; - struct pcm_channel *rdch, *wrch, *ch; + struct pcm_channel *ch; struct snddev_info *d; - uint32_t fmt, spd; - int error, rderror, wrerror, dir; + int error, dir; /* Kind of impossible.. */ if (i_dev == NULL || td == NULL) @@ -267,11 +358,11 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (!DSP_REGISTERED(d)) return (EBADF); + if (PCM_CHANCOUNT(d) >= PCM_MAXCHANS) + return (ENOMEM); + priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); priv->sc = d; - priv->rdch = NULL; - priv->wrch = NULL; - priv->volch = NULL; error = devfs_set_cdevpriv(priv, dsp_close); if (error != 0) @@ -334,98 +425,30 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_ACQUIRE(d); PCM_UNLOCK(d); - fmt = SND_FORMAT(AFMT_U8, 1, 0); - spd = DSP_DEFAULT_SPEED; - - rdch = NULL; - wrch = NULL; - rderror = 0; - wrerror = 0; - - if (DSP_F_READ(flags)) { - /* open for read */ - rderror = pcm_chnalloc(d, &rdch, PCMDIR_REC, - td->td_proc->p_pid, td->td_proc->p_comm); - - if (rderror == 0 && chn_reset(rdch, fmt, spd) != 0) - rderror = ENXIO; - - if (rderror != 0) { - if (rdch != NULL) - chn_release(rdch); - if (!DSP_F_DUPLEX(flags)) { - PCM_RELEASE_QUICK(d); - PCM_GIANT_EXIT(d); - return (rderror); - } - rdch = NULL; - } else { - if (flags & O_NONBLOCK) - rdch->flags |= CHN_F_NBIO; - if (flags & O_EXCL) - rdch->flags |= CHN_F_EXCLUSIVE; - chn_vpc_reset(rdch, SND_VOL_C_PCM, 0); - CHN_UNLOCK(rdch); - } - } - if (DSP_F_WRITE(flags)) { - /* open for write */ - wrerror = pcm_chnalloc(d, &wrch, PCMDIR_PLAY, - td->td_proc->p_pid, td->td_proc->p_comm); - - if (wrerror == 0 && chn_reset(wrch, fmt, spd) != 0) - wrerror = ENXIO; - - if (wrerror != 0) { - if (wrch != NULL) - chn_release(wrch); - if (!DSP_F_DUPLEX(flags)) { - if (rdch != NULL) { - /* - * Lock, and release previously created - * record channel - */ - CHN_LOCK(rdch); - chn_release(rdch); - } - PCM_RELEASE_QUICK(d); - PCM_GIANT_EXIT(d); - return (wrerror); - } - wrch = NULL; - } else { - if (flags & O_NONBLOCK) - wrch->flags |= CHN_F_NBIO; - if (flags & O_EXCL) - wrch->flags |= CHN_F_EXCLUSIVE; - chn_vpc_reset(wrch, SND_VOL_C_PCM, 0); - CHN_UNLOCK(wrch); + error = dsp_chn_alloc(d, &priv->wrch, PCMDIR_PLAY, flags, td); + if (error != 0) { + PCM_RELEASE_QUICK(d); + PCM_GIANT_EXIT(d); + return (error); } + PCM_LOCK(d); + CHN_INSERT_HEAD(d, priv->wrch, channels.pcm.opened); + PCM_UNLOCK(d); } - - PCM_LOCK(d); - - if (wrch == NULL && rdch == NULL) { - PCM_RELEASE(d); + if (DSP_F_READ(flags)) { + error = dsp_chn_alloc(d, &priv->rdch, PCMDIR_REC, flags, td); + if (error != 0) { + PCM_RELEASE_QUICK(d); + PCM_GIANT_EXIT(d); + return (error); + } + PCM_LOCK(d); + CHN_INSERT_HEAD(d, priv->rdch, channels.pcm.opened); PCM_UNLOCK(d); - PCM_GIANT_EXIT(d); - if (wrerror != 0) - return (wrerror); - if (rderror != 0) - return (rderror); - return (EINVAL); } - if (rdch != NULL) - CHN_INSERT_HEAD(d, rdch, channels.pcm.opened); - if (wrch != NULL) - CHN_INSERT_HEAD(d, wrch, channels.pcm.opened); - priv->rdch = rdch; - priv->wrch = wrch; - - PCM_RELEASE(d); - PCM_UNLOCK(d); + PCM_RELEASE_QUICK(d); PCM_GIANT_LEAVE(d); return (0); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index b8f4efea8789..391c8e61dc19 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -107,62 +107,6 @@ snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep); } -int -pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, - pid_t pid, char *comm) -{ - struct pcm_channel *c; - int err, vchancount; - bool retry; - - KASSERT(d != NULL && ch != NULL && - (direction == PCMDIR_PLAY || direction == PCMDIR_REC), - ("%s(): invalid d=%p ch=%p direction=%d pid=%d", - __func__, d, ch, direction, pid)); - PCM_BUSYASSERT(d); - - *ch = NULL; - vchancount = (direction == PCMDIR_PLAY) ? d->pvchancount : - d->rvchancount; - retry = false; - -retry_chnalloc: - /* Scan for a free channel. */ - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction != direction) { - CHN_UNLOCK(c); - continue; - } - if (!(c->flags & CHN_F_BUSY)) { - c->flags |= CHN_F_BUSY; - c->pid = pid; - strlcpy(c->comm, (comm != NULL) ? comm : - CHN_COMM_UNKNOWN, sizeof(c->comm)); - *ch = c; - - return (0); - } - CHN_UNLOCK(c); - } - /* Maybe next time... */ - if (retry) - return (EBUSY); - - /* No channel available. We also cannot create more VCHANs. */ - if (!(vchancount > 0 && vchancount < snd_maxautovchans)) - return (ENOTSUP); - - /* Increase the VCHAN count and try to get the new channel. */ - err = vchan_setnew(d, direction, vchancount + 1); - if (err == 0) { - retry = true; - goto retry_chnalloc; - } - - return (err); -} - static int sysctl_hw_snd_default_unit(SYSCTL_HANDLER_ARGS) { @@ -303,7 +247,10 @@ pcm_setstatus(device_t dev, char *str) if (d->playcount > 0 || d->reccount > 0) d->flags |= SD_F_AUTOVCHAN; - vchan_setmaxauto(d, snd_maxautovchans); + if (d->playcount > 0) + d->flags |= SD_F_PVCHANS; + if (d->reccount > 0) + d->flags |= SD_F_RVCHANS; strlcpy(d->status, str, SND_STATUSLEN); sndstat_register(dev, d->status); @@ -516,6 +463,7 @@ pcm_register(device_t dev, void *devinfo, int numplay __unused, CHN_INIT(d, channels.pcm); CHN_INIT(d, channels.pcm.busy); CHN_INIT(d, channels.pcm.opened); + CHN_INIT(d, channels.pcm.primary); return (0); } @@ -732,9 +680,7 @@ sound_global_init(void) if (snd_unit < 0) snd_unit = -1; - if (snd_maxautovchans < 0 || - snd_maxautovchans > SND_MAXVCHANS) - snd_maxautovchans = 0; + snd_vchans_enable = true; if (chn_latency < CHN_LATENCY_MIN || chn_latency > CHN_LATENCY_MAX) @@ -758,11 +704,11 @@ sound_global_init(void) feeder_rate_round = FEEDRATE_ROUNDHZ; if (bootverbose) - printf("%s: snd_unit=%d snd_maxautovchans=%d " + printf("%s: snd_unit=%d snd_vchans_enable=%d " "latency=%d " "feeder_rate_min=%d feeder_rate_max=%d " "feeder_rate_round=%d\n", - __func__, snd_unit, snd_maxautovchans, + __func__, snd_unit, snd_vchans_enable, chn_latency, feeder_rate_min, feeder_rate_max, feeder_rate_round); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index f0dc454ac131..fddf5bfef1a8 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -99,8 +99,6 @@ struct snd_mixer; #define SOUND_PREFVER SOUND_MODVER #define SOUND_MAXVER SOUND_MODVER -#define SND_MAXVCHANS 256 - #define SD_F_SIMPLEX 0x00000001 #define SD_F_AUTOVCHAN 0x00000002 #define SD_F_SOFTPCMVOL 0x00000004 @@ -113,6 +111,8 @@ struct snd_mixer; #define SD_F_EQ_ENABLED 0x00000200 /* EQ enabled */ #define SD_F_EQ_BYPASSED 0x00000400 /* EQ bypassed */ #define SD_F_EQ_PC 0x00000800 /* EQ per-channel */ +#define SD_F_PVCHANS 0x00001000 /* Playback vchans enabled */ +#define SD_F_RVCHANS 0x00002000 /* Recording vchans enabled */ #define SD_F_EQ_DEFAULT (SD_F_EQ | SD_F_EQ_ENABLED) #define SD_F_EQ_MASK (SD_F_EQ | SD_F_EQ_ENABLED | \ @@ -134,12 +134,15 @@ struct snd_mixer; "\012EQ_ENABLED" \ "\013EQ_BYPASSED" \ "\014EQ_PC" \ + "\015PVCHANS" \ + "\016RVCHANS" \ "\035PRIO_RD" \ "\036PRIO_WR" #define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL) #define PCM_REGISTERED(x) (PCM_ALIVE(x) && ((x)->flags & SD_F_REGISTERED)) +#define PCM_MAXCHANS 10000 #define PCM_CHANCOUNT(d) \ (d->playcount + d->pvchancount + d->reccount + d->rvchancount) @@ -168,9 +171,6 @@ extern struct unrhdr *pcmsg_unrhdr; SYSCTL_DECL(_hw_snd); -int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, - pid_t pid, char *comm); - int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo); unsigned int pcm_getbuffersize(device_t dev, unsigned int minbufsz, unsigned int deflt, unsigned int maxbufsz); int pcm_register(device_t dev, void *devinfo, int numplay, int numrec); @@ -224,6 +224,9 @@ struct snddev_info { struct { SLIST_HEAD(, pcm_channel) head; } opened; + struct { + SLIST_HEAD(, pcm_channel) head; + } primary; } pcm; } channels; unsigned playcount, reccount, pvchancount, rvchancount; diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index b0caec3acfec..297120199fe7 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -61,7 +61,7 @@ struct vchan_info { int trigger; }; -int snd_maxautovchans = 16; +bool snd_vchans_enable = true; static void * vchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, @@ -277,7 +277,7 @@ vchan_getparentchannel(struct snddev_info *d, *ch = NULL; break; } - } else if (c->flags & CHN_F_HAS_VCHAN) { + } else { /* No way!! */ if (*ch != NULL) { CHN_UNLOCK(c); @@ -299,8 +299,7 @@ static int sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) { struct snddev_info *d; - int direction, vchancount; - int err, cnt; + int err, enabled, flag; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) @@ -311,43 +310,44 @@ sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: - direction = PCMDIR_PLAY; - vchancount = d->pvchancount; - cnt = d->playcount; + /* Exit if we do not support this direction. */ + if (d->playcount < 1) { + PCM_UNLOCK(d); + return (ENODEV); + } + flag = SD_F_PVCHANS; break; case VCHAN_REC: - direction = PCMDIR_REC; - vchancount = d->rvchancount; - cnt = d->reccount; + if (d->reccount < 1) { + PCM_UNLOCK(d); + return (ENODEV); + } + flag = SD_F_RVCHANS; break; default: PCM_UNLOCK(d); return (EINVAL); - break; } - if (cnt < 1) { - PCM_UNLOCK(d); - return (ENODEV); - } + enabled = (d->flags & flag) != 0; PCM_ACQUIRE(d); PCM_UNLOCK(d); - cnt = vchancount; - err = sysctl_handle_int(oidp, &cnt, 0, req); - - if (err == 0 && req->newptr != NULL && vchancount != cnt) { - if (cnt < 0) - cnt = 0; - if (cnt > SND_MAXVCHANS) - cnt = SND_MAXVCHANS; - err = vchan_setnew(d, direction, cnt); + err = sysctl_handle_int(oidp, &enabled, 0, req); + if (err != 0 || req->newptr == NULL) { + PCM_RELEASE_QUICK(d); + return (err); } + if (enabled <= 0) + d->flags &= ~flag; + else + d->flags |= flag; + PCM_RELEASE_QUICK(d); - return err; + return (0); } static int @@ -368,15 +368,22 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: + if ((d->flags & SD_F_PVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_PLAY; break; case VCHAN_REC: + if ((d->flags & SD_F_RVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_REC; break; default: PCM_UNLOCK(d); return (EINVAL); - break; } PCM_ACQUIRE(d); @@ -450,7 +457,7 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) struct snddev_info *d; struct pcm_channel *c, *ch; struct pcmchan_caps *caps; - int *vchanrate, vchancount, direction, ret, newspd, restart; + int *vchanrate, direction, ret, newspd, restart; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); if (!PCM_REGISTERED(d) || !(d->flags & SD_F_AUTOVCHAN)) @@ -461,24 +468,24 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: + if ((d->flags & SD_F_PVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_PLAY; - vchancount = d->pvchancount; vchanrate = &d->pvchanrate; break; case VCHAN_REC: + if ((d->flags & SD_F_RVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_REC; - vchancount = d->rvchancount; vchanrate = &d->rvchanrate; break; default: PCM_UNLOCK(d); return (EINVAL); - break; - } - - if (vchancount < 1) { - PCM_UNLOCK(d); - return (EINVAL); } PCM_ACQUIRE(d); @@ -555,7 +562,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) struct snddev_info *d; struct pcm_channel *c, *ch; uint32_t newfmt; - int *vchanformat, vchancount, direction, ret, restart; + int *vchanformat, direction, ret, restart; char fmtstr[AFMTSTR_LEN]; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); @@ -567,24 +574,24 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) switch (VCHAN_SYSCTL_DIR(oidp->oid_arg1)) { case VCHAN_PLAY: + if ((d->flags & SD_F_PVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_PLAY; - vchancount = d->pvchancount; vchanformat = &d->pvchanformat; break; case VCHAN_REC: + if ((d->flags & SD_F_RVCHANS) == 0) { + PCM_UNLOCK(d); + return (ENODEV); + } direction = PCMDIR_REC; - vchancount = d->rvchancount; vchanformat = &d->rvchanformat; break; default: PCM_UNLOCK(d); return (EINVAL); - break; - } - - if (vchancount < 1) { - PCM_UNLOCK(d); - return (EINVAL); } PCM_ACQUIRE(d); @@ -660,7 +667,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) "play.vchanrate" : "rec.vchanrate" int -vchan_create(struct pcm_channel *parent) +vchan_create(struct pcm_channel *parent, struct pcm_channel **child) { struct snddev_info *d; struct pcm_channel *ch; @@ -676,9 +683,6 @@ vchan_create(struct pcm_channel *parent) PCM_BUSYASSERT(d); CHN_LOCKASSERT(parent); - if (!(parent->flags & CHN_F_BUSY)) - return (EBUSY); - if (!(parent->direction == PCMDIR_PLAY || parent->direction == PCMDIR_REC)) return (EINVAL); @@ -713,10 +717,12 @@ vchan_create(struct pcm_channel *parent) */ CHN_INSERT_SORT_DESCEND(parent, ch, children); + *child = ch; + if (parent->flags & CHN_F_HAS_VCHAN) return (0); - parent->flags |= CHN_F_HAS_VCHAN; + parent->flags |= CHN_F_HAS_VCHAN | CHN_F_BUSY; parent_caps = chn_getcaps(parent); if (parent_caps == NULL) { @@ -807,6 +813,7 @@ vchan_create(struct pcm_channel *parent) fail: CHN_LOCK(ch); vchan_destroy(ch); + *child = NULL; return (ret); } @@ -878,166 +885,40 @@ vchan_sync(struct pcm_channel *c) return (ret); } -int -vchan_setnew(struct snddev_info *d, int direction, int newcnt) -{ - struct pcm_channel *c, *ch, *nch; - struct pcmchan_caps *caps; - int i, err, vcnt; - - PCM_BUSYASSERT(d); - - if ((direction == PCMDIR_PLAY && d->playcount < 1) || - (direction == PCMDIR_REC && d->reccount < 1)) - return (ENODEV); - - if (!(d->flags & SD_F_AUTOVCHAN)) - return (EINVAL); - - if (newcnt < 0 || newcnt > SND_MAXVCHANS) - return (E2BIG); - - if (direction == PCMDIR_PLAY) - vcnt = d->pvchancount; - else if (direction == PCMDIR_REC) - vcnt = d->rvchancount; - else - return (EINVAL); - - if (newcnt > vcnt) { - /* add new vchans - find a parent channel first */ - ch = NULL; - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction == direction && - ((c->flags & CHN_F_HAS_VCHAN) || (vcnt == 0 && - !(c->flags & (CHN_F_BUSY | CHN_F_VIRTUAL))))) { - /* - * Reuse hw channel with vchans already - * created. - */ - if (c->flags & CHN_F_HAS_VCHAN) { - ch = c; - break; - } - /* - * No vchans ever created, look for - * channels with supported formats. - */ - caps = chn_getcaps(c); - if (caps == NULL) { - CHN_UNLOCK(c); - continue; - } - for (i = 0; caps->fmtlist[i] != 0; i++) { - if (caps->fmtlist[i] & AFMT_CONVERTIBLE) - break; - } - if (caps->fmtlist[i] != 0) { - ch = c; - break; - } - } - CHN_UNLOCK(c); - } - if (ch == NULL) - return (EBUSY); - ch->flags |= CHN_F_BUSY; - err = 0; - while (err == 0 && newcnt > vcnt) { - err = vchan_create(ch); - if (err == 0) - vcnt++; - else if (err == E2BIG && newcnt > vcnt) - device_printf(d->dev, - "%s: err=%d Maximum channel reached.\n", - __func__, err); - } - if (vcnt == 0) - ch->flags &= ~CHN_F_BUSY; - CHN_UNLOCK(ch); - if (err != 0) - return (err); - } else if (newcnt < vcnt) { - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction != direction || - CHN_EMPTY(c, children) || - !(c->flags & CHN_F_HAS_VCHAN)) { - CHN_UNLOCK(c); - continue; - } - CHN_FOREACH_SAFE(ch, c, nch, children) { - CHN_LOCK(ch); - if (vcnt == 1 && ch->flags & CHN_F_BUSY) { - CHN_UNLOCK(ch); - break; - } - if (!(ch->flags & CHN_F_BUSY)) { - err = vchan_destroy(ch); - if (err == 0) - vcnt--; - } else - CHN_UNLOCK(ch); - if (vcnt == newcnt) - break; - } - CHN_UNLOCK(c); - break; - } *** 125 LINES SKIPPED *** From nobody Tue Mar 4 15:47:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6G1wNXz5qGVr; Tue, 04 Mar 2025 15:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6F3SKTz42N7; Tue, 04 Mar 2025 15:47:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wqWu0y8h7abkSVCGHL8zbDgbsBws/Gt2bBwjyccdE4w=; b=o0e8ZalkV4siYv13xARsrBRsbtB4oIiDb331fG3ZAPBbfcWH+WWT0/tQ8oCN8Do11njj5u CtyGqIupWN38Sfmt3GVH7jW1kRQph27okzoWIl2nb8BnOM0lC9zWaMQX6jnKH/m9/kGF+V o7JT82ihb3DZR4FN+Osn6DbdGxygvsFEBEoaFh/6j6pbE0K4yc45LXbfFgD9MvMXioNh6e /b9jG3iSlwa0qz75YAR3X7pVpFa5fdf8EhzUd+Un3jqSdBwZrbanhdh2I5aYA1T+mO9CZT CMzi5qPsgxTB9WHS0DQQiqKiSJ6QAw9zSq+GDafbba4/RNssRIpcJphSg5hkVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103221; a=rsa-sha256; cv=none; b=qERDdLuM6O+/CyCz8hO4TUCw7UHKEImRZLXawS3YfFLyzJmyTl5Hv+pBdVkT+NcS1j/zve A885qNFcRMPtjefHac4r6v1X5Rkanx7YxaaxP57vMFo6rcLGaitxedHhj6ncLLgQOMIz7l 9SwzhZBRP+AeeJD4cr7jjMzt7pSw4b9LadkgPueYGZ2t+88Rg+EFwMLQdMy8V3mja+ZIoL wtNXI2h/WKrFreMW7ii32m+PY8+Z2qjuTkfZpSJkMZ7lQgdi6xpRf7aNuXOKKz018/DyDH 3yAgm5nPbEwnEeKc17fiPNShlUU3OkZgSmdL80diQavu3vNcHjoc/ZOu8ojvsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wqWu0y8h7abkSVCGHL8zbDgbsBws/Gt2bBwjyccdE4w=; b=Jwb82hePi7tO8u+Ojk4NeUdgbV3UoBt2twCPYF78CZ5ckAEG+FtKU444uYHJx3EMBQDSuP l81jNhIvUvWfpGFt70rhfQVI5xnT4X6W3SHEfA1J24hmj3T5dO4j652I3NgUMzKzwZOv1E Ud91L2m9U0ggbKjrNGKdLs9MCVCF8/NGT8BsGW8dsagWHAx9PwLYhU20nepTsO9Gxgh5iQ lP57ajheVSFsBAQLZjYyrHGgNZrkUxXFgR6IooO+vrv1Tw4Ra9LmBaRHcJEtF9tRL5MkJN 9QG3V60kZbm7PGU6X3wnjICeFlvgkHiu+RdLGzoAaNHxs6KnsIuNHgmYSAiSbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6F1vzKz7tl; Tue, 04 Mar 2025 15:47: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 524Fl1AZ049958; Tue, 4 Mar 2025 15:47:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl13O049955; Tue, 4 Mar 2025 15:47:01 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:01 GMT Message-Id: <202503041547.524Fl13O049955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 905ae2bc6a27 - stable/14 - sound: Handle multiple primary channel cases in vchan sysctls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 905ae2bc6a27b4e94643a337908dc4a59de2283a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=905ae2bc6a27b4e94643a337908dc4a59de2283a commit 905ae2bc6a27b4e94643a337908dc4a59de2283a Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:52 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Handle multiple primary channel cases in vchan sysctls vchan_getparentchannel() is used by various vchan sysctl functions to fetch the first primary channel. However, this assumes that all devices have only one primary channel per direction. If a device does not meet this assumption, then the sysctl functions will be applying the configurations on the first primary channel only. Since we now have the "primary" channel sublist, we can retire vchan_getparentchannel() and iterate through the "primary" list in each sysctl function and apply the settings to all primary channels. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48336 (cherry picked from commit 1cbafcd13796934a7896064cdb23fd4e37d58821) --- sys/dev/sound/pcm/vchan.c | 227 ++++++++++++++++------------------------------ 1 file changed, 80 insertions(+), 147 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 379d647cbcf8..45f0a8b00bd2 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -253,48 +253,6 @@ static kobj_method_t vchan_methods[] = { }; CHANNEL_DECLARE(vchan); -static void -vchan_getparentchannel(struct snddev_info *d, - struct pcm_channel **wrch, struct pcm_channel **rdch) -{ - struct pcm_channel **ch, *wch, *rch, *c; - - KASSERT(d != NULL, ("%s(): NULL snddev_info", __func__)); - - PCM_BUSYASSERT(d); - PCM_UNLOCKASSERT(d); - - wch = NULL; - rch = NULL; - - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - ch = (c->direction == PCMDIR_PLAY) ? &wch : &rch; - if (c->flags & CHN_F_VIRTUAL) { - /* Sanity check */ - if (*ch != NULL && *ch != c->parentchannel) { - CHN_UNLOCK(c); - *ch = NULL; - break; - } - } else { - /* No way!! */ - if (*ch != NULL) { - CHN_UNLOCK(c); - *ch = NULL; - break; - } - *ch = c; - } - CHN_UNLOCK(c); - } - - if (wrch != NULL) - *wrch = wch; - if (rdch != NULL) - *rdch = rch; -} - static int sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) { @@ -391,19 +349,6 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) PCM_ACQUIRE(d); PCM_UNLOCK(d); - if (direction == PCMDIR_PLAY) - vchan_getparentchannel(d, &c, NULL); - else - vchan_getparentchannel(d, NULL, &c); - - if (c == NULL) { - PCM_RELEASE_QUICK(d); - return (EINVAL); - } - - KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", - __func__, direction, c->direction)); - if (*vchanmode & CHN_F_VCHAN_PASSTHROUGH) strlcpy(dtype, "passthrough", sizeof(dtype)); else if (*vchanmode & CHN_F_VCHAN_ADAPTIVE) @@ -412,26 +357,29 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) strlcpy(dtype, "fixed", sizeof(dtype)); ret = sysctl_handle_string(oidp, dtype, sizeof(dtype), req); - if (ret == 0 && req->newptr != NULL) { - if (strcasecmp(dtype, "passthrough") == 0 || - strcmp(dtype, "1") == 0) - dflags = CHN_F_VCHAN_PASSTHROUGH; - else if (strcasecmp(dtype, "adaptive") == 0 || - strcmp(dtype, "2") == 0) - dflags = CHN_F_VCHAN_ADAPTIVE; - else if (strcasecmp(dtype, "fixed") == 0 || - strcmp(dtype, "0") == 0) - dflags = 0; - else { - PCM_RELEASE_QUICK(d); - return (EINVAL); - } + if (ret != 0 || req->newptr == NULL) { + PCM_RELEASE_QUICK(d); + return (ret); + } + + if (strcasecmp(dtype, "passthrough") == 0 || strcmp(dtype, "1") == 0) + dflags = CHN_F_VCHAN_PASSTHROUGH; + else if (strcasecmp(dtype, "adaptive") == 0 || strcmp(dtype, "2") == 0) + dflags = CHN_F_VCHAN_ADAPTIVE; + else if (strcasecmp(dtype, "fixed") == 0 || strcmp(dtype, "0") == 0) + dflags = 0; + else { + PCM_RELEASE_QUICK(d); + return (EINVAL); + } + + CHN_FOREACH(c, d, channels.pcm.primary) { CHN_LOCK(c); - if (dflags == (c->flags & CHN_F_VCHAN_DYNAMIC) || + if (c->direction != direction || + dflags == (c->flags & CHN_F_VCHAN_DYNAMIC) || (c->flags & CHN_F_PASSTHROUGH)) { CHN_UNLOCK(c); - PCM_RELEASE_QUICK(d); - return (0); + continue; } c->flags &= ~CHN_F_VCHAN_DYNAMIC; c->flags |= dflags; @@ -492,19 +440,6 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) PCM_ACQUIRE(d); PCM_UNLOCK(d); - if (direction == PCMDIR_PLAY) - vchan_getparentchannel(d, &c, NULL); - else - vchan_getparentchannel(d, NULL, &c); - - if (c == NULL) { - PCM_RELEASE_QUICK(d); - return (EINVAL); - } - - KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", - __func__, direction, c->direction)); - newspd = *vchanrate; ret = sysctl_handle_int(oidp, &newspd, 0, req); @@ -518,39 +453,45 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) return (EINVAL); } - CHN_LOCK(c); - - if (newspd != c->speed && VCHAN_ACCESSIBLE(c)) { - if (CHN_STARTED(c)) { - chn_abort(c); - restart = 1; - } else - restart = 0; - - if (feeder_rate_round) { - caps = chn_getcaps(c); - RANGE(newspd, caps->minspeed, caps->maxspeed); - newspd = CHANNEL_SETSPEED(c->methods, - c->devinfo, newspd); + CHN_FOREACH(c, d, channels.pcm.primary) { + CHN_LOCK(c); + if (c->direction != direction) { + CHN_UNLOCK(c); + continue; } - ret = chn_reset(c, c->format, newspd); - if (ret == 0) { - if (restart != 0) { - CHN_FOREACH(ch, c, children.busy) { - CHN_LOCK(ch); - if (VCHAN_SYNC_REQUIRED(ch)) - vchan_sync(ch); - CHN_UNLOCK(ch); + if (newspd != c->speed && VCHAN_ACCESSIBLE(c)) { + if (CHN_STARTED(c)) { + chn_abort(c); + restart = 1; + } else + restart = 0; + + if (feeder_rate_round) { + caps = chn_getcaps(c); + RANGE(newspd, caps->minspeed, caps->maxspeed); + newspd = CHANNEL_SETSPEED(c->methods, + c->devinfo, newspd); + } + + ret = chn_reset(c, c->format, newspd); + if (ret == 0) { + if (restart != 0) { + CHN_FOREACH(ch, c, children.busy) { + CHN_LOCK(ch); + if (VCHAN_SYNC_REQUIRED(ch)) + vchan_sync(ch); + CHN_UNLOCK(ch); + } + c->flags |= CHN_F_DIRTY; + ret = chn_start(c, 1); } - c->flags |= CHN_F_DIRTY; - ret = chn_start(c, 1); } } - } - *vchanrate = c->speed; + *vchanrate = c->speed; - CHN_UNLOCK(c); + CHN_UNLOCK(c); + } PCM_RELEASE_QUICK(d); @@ -598,19 +539,6 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) PCM_ACQUIRE(d); PCM_UNLOCK(d); - if (direction == PCMDIR_PLAY) - vchan_getparentchannel(d, &c, NULL); - else - vchan_getparentchannel(d, NULL, &c); - - if (c == NULL) { - PCM_RELEASE_QUICK(d); - return (EINVAL); - } - - KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", - __func__, direction, c->direction)); - bzero(fmtstr, sizeof(fmtstr)); if (snd_afmt2str(*vchanformat, fmtstr, sizeof(fmtstr)) != *vchanformat) @@ -628,32 +556,37 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) return (EINVAL); } - CHN_LOCK(c); - - if (newfmt != c->format && VCHAN_ACCESSIBLE(c)) { - if (CHN_STARTED(c)) { - chn_abort(c); - restart = 1; - } else - restart = 0; - - ret = chn_reset(c, newfmt, c->speed); - if (ret == 0) { - if (restart != 0) { - CHN_FOREACH(ch, c, children.busy) { - CHN_LOCK(ch); - if (VCHAN_SYNC_REQUIRED(ch)) - vchan_sync(ch); - CHN_UNLOCK(ch); + CHN_FOREACH(c, d, channels.pcm.primary) { + CHN_LOCK(c); + if (c->direction != direction) { + CHN_UNLOCK(c); + continue; + } + if (newfmt != c->format && VCHAN_ACCESSIBLE(c)) { + if (CHN_STARTED(c)) { + chn_abort(c); + restart = 1; + } else + restart = 0; + + ret = chn_reset(c, newfmt, c->speed); + if (ret == 0) { + if (restart != 0) { + CHN_FOREACH(ch, c, children.busy) { + CHN_LOCK(ch); + if (VCHAN_SYNC_REQUIRED(ch)) + vchan_sync(ch); + CHN_UNLOCK(ch); + } + c->flags |= CHN_F_DIRTY; + ret = chn_start(c, 1); } - c->flags |= CHN_F_DIRTY; - ret = chn_start(c, 1); } } - } - *vchanformat = c->format; + *vchanformat = c->format; - CHN_UNLOCK(c); + CHN_UNLOCK(c); + } PCM_RELEASE_QUICK(d); From nobody Tue Mar 4 15:47:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6J6HrNz5qGVs; Tue, 04 Mar 2025 15:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6H4L0Fz42DT; Tue, 04 Mar 2025 15:47:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D8/homlH4ngPnz2qBuZzzmVNkvvI3aLLNj7bnq9NZHA=; b=bKY01nVd9yPYUb9kcLuYtUxM4WekFU2zrE0Gf2S0APLMCS4W5ls75IObgp1fyzCrFSK2tD C88PV2pmlL7Akx20oxZ25f85RCRrTgQTCvLaSkCALXsTh81XmfFpQtGEkWSIAQL/ZfW1BJ 422T9s3TChFSZ+h8veocvnHY+zxAkAus2V497Yk+M8kJbftcMREKa4n+mlQP8NE0hvoX24 HunXLDN7vmBc10TVZae3vz5us02TFelUw1jMfRY8/8se8IhOApKg8R4h0BqdFi3l2xhFy1 8pTQaHg29AXsi71ubTL6oZeaF/oVUqBA5MLxodNKdvzS6XmNlH+MQ5xCsUmZUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103223; a=rsa-sha256; cv=none; b=FDUTzqc7aZ6oC/RKyqbRTtUv3QTYGxO9TbDtXUOPf8nOoKL41lVX8v0Qy2UAq3kyT7EwKc /G/QycKOxErusDY5hSw/dY5pk/SgYxoZMT73XLMMZ9C+veEQl2mxwfOxBqyxOg1+3CWsg1 nL1Qy88tj3KUiOut0FXj/0FVsdf3mckNPtKfcwqboaP5OsAoSnsQYb0geD4NipuSjAAzH6 S5I+zUYCtATCHeOdC1IjYkVUrN8I9SDoqhEYUdWz+OJvjD6m+ro5BM3W++oC3ZD4TEVsQy S4xe0Nt1VBk+H4uCV5c3PmeubX11Wy+1xNvQ1mmQoqCvk4K0/DrQX/GJV7nEVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D8/homlH4ngPnz2qBuZzzmVNkvvI3aLLNj7bnq9NZHA=; b=KUdD53UK1vbfSP4pGjddLAEOk6MuCB8wnul4zFvzE0a6nxoZYDYPFz8nBU+taAHT5uY9kI DMo26flFRgYCHyu1dp9blet9r5PuQh+2KO/onR/Bix/q6Ra+OzVBFSekX1cPpiyE+fQqY6 yJdoW2Y9bRqI7ETvjNc2EK/UgNgtE7VOAou382nhCRSSNK2sfVeOdfqcIFTDQ/P1g5tD7N EWqKHgJL8hVNiS8VTrVFyY0AgPk2j5Fy8FRt4AhhkjNy+OqqlEDFjS6e2+y5wzwq4Pg3A0 aM4CJSz9pTAYQzLn/Sr4QQpqwJLiy9B7IWpzmohei/TO6BYo77bzC5SEROL1EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6H3ZKxz8FZ; Tue, 04 Mar 2025 15:47: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 524Fl3gC050031; Tue, 4 Mar 2025 15:47:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl37i050028; Tue, 4 Mar 2025 15:47:03 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:03 GMT Message-Id: <202503041547.524Fl37i050028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 9091f61d2f2c - stable/14 - sound: Get rid of redundant variables in chn_setspeed() and chn_setformat() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9091f61d2f2c947a29b4f7709232070e90f5cec2 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9091f61d2f2c947a29b4f7709232070e90f5cec2 commit 9091f61d2f2c947a29b4f7709232070e90f5cec2 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:05 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Get rid of redundant variables in chn_setspeed() and chn_setformat() Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D48011 (cherry picked from commit 4e1b75bebf41b6e446d72c755fa420836341ade2) --- sys/dev/sound/pcm/channel.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 17c11dc33b7a..19b2db321cee 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2104,21 +2104,20 @@ chn_setparam(struct pcm_channel *c, uint32_t format, uint32_t speed) int chn_setspeed(struct pcm_channel *c, uint32_t speed) { - uint32_t oldformat, oldspeed, format; + uint32_t oldformat, oldspeed; int ret; oldformat = c->format; oldspeed = c->speed; - format = oldformat; - ret = chn_setparam(c, format, speed); + ret = chn_setparam(c, c->format, speed); if (ret != 0) { if (snd_verbose > 3) device_printf(c->dev, "%s(): Setting speed %d failed, " "falling back to %d\n", __func__, speed, oldspeed); - chn_setparam(c, c->format, oldspeed); + chn_setparam(c, oldformat, oldspeed); } return (ret); @@ -2127,7 +2126,7 @@ chn_setspeed(struct pcm_channel *c, uint32_t speed) int chn_setformat(struct pcm_channel *c, uint32_t format) { - uint32_t oldformat, oldspeed, speed; + uint32_t oldformat, oldspeed; int ret; /* XXX force stereo */ @@ -2138,9 +2137,8 @@ chn_setformat(struct pcm_channel *c, uint32_t format) oldformat = c->format; oldspeed = c->speed; - speed = oldspeed; - ret = chn_setparam(c, format, speed); + ret = chn_setparam(c, format, c->speed); if (ret != 0) { if (snd_verbose > 3) device_printf(c->dev, From nobody Tue Mar 4 15:47:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6J2DJ6z5qGYL; Tue, 04 Mar 2025 15:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6G3PfRz42DJ; Tue, 04 Mar 2025 15:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h5bNEsK1YaQAeaL6WannOlQbomp66rNEMeGFz9WTCtM=; b=c4jW7BRCRzEnvb1FVNt3wTA+95dwiqkSuPd9uxmXJV0xnNzjEDYXE/uY32poTawXYn4y4Q 74rKc5fbs0LAEUQ3WGK88i8s0pqa4Y4c058OxITGKC4s7RHLMoAhuPDqaJ8NGMSi0nvDg2 fLu5JAnlBnTAa/ZsHrIakZmQHU4wWTZiYJe3s+cvYg0RcRPaJF33Jwu2HrjZkU1XdcYveG /vIejgQlEa4Nz1gWdYHzLy1Sh16eoxF84bxf8JZHAG4x1qsLv9yWBIPsjbQ6ibSS0sfTri sGJPN6WIsdbzUmRiFIZhghFDX6J6kVGh0ziTSloEzthGH9AIYKpe/mJdMKJrig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103222; a=rsa-sha256; cv=none; b=gx9oqIAobSkJ/cJCGgr+aZ/bs/TOX4B38jR9rJ4MWm4HzRO0l1nMG8KPjnA/xbbfnS97Rw SpNrzLhY07bVDJPZ/lvqaFTke3vMrrTjt9x/PLOQnm90vnWTP6PHrDzxyATFT0prrV7RON r9kDBPBlnD4fGdZt7jZmbX1MnBqKuoa7OZ1eAGTvFa8j3MCV8cxaqoBtbI2Qj8I2ZdOfT/ BJnLPYQykollmtC3hLW4DHqOrsCG+4d7iDwAVMfNaMNSxvhxnslmh5ZyMw8UcyBfr8Dpzp fKy5/5Ztp42ur7hrh6VjlFOxQeJ+Ns4s9mpS3SPR3u39v92A6Mmy8MiUTFE1PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h5bNEsK1YaQAeaL6WannOlQbomp66rNEMeGFz9WTCtM=; b=upWvIkucv9baqXeodLjk1HmbrehYxkUDqa5eDTMrCkJzoKuKPKd0xVNP/padmxJkyDz4LU 9AqHTbbHqnd9U/uKMIG/uAOCd7a1UOSzd/J7jEscvNfyG41lc2IDUWRB/LdP+nvcYZ8SFv JoFcN4oR4zf9XwFLwwkURTCLvsAraa5ClSa7ozRDUIF798RBpQCfjr14lQZKKI+r7C/may eElx3xXgC3HL0bvYF+xYBPm5T8BfTx6C8RIP6a+e0JVxHKQI06HxRZi2tL5Es6LzwOB3P1 XF8OtrmVZeX4FcmQuAASrhQg/ab/+6YnDSHPCkfulX/lT0Lnt7PA47kueDBpfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6G2xpFz8Z3; Tue, 04 Mar 2025 15:47: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 524Fl2Zq049996; Tue, 4 Mar 2025 15:47:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl27X049993; Tue, 4 Mar 2025 15:47:02 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:02 GMT Message-Id: <202503041547.524Fl27X049993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 5dc0c867c8ca - stable/14 - sound: Remove SNDBUF_LOCKASSERT() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5dc0c867c8cae68cf867c82432ce013d83214cc6 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5dc0c867c8cae68cf867c82432ce013d83214cc6 commit 5dc0c867c8cae68cf867c82432ce013d83214cc6 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:59 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Remove SNDBUF_LOCKASSERT() It's a no-op. There is no lock associated with the buffer. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D48008 (cherry picked from commit 6524d2a5affd02623e6909fff0ca03ba21882a0c) --- sys/dev/sound/pcm/buffer.c | 22 ---------------------- sys/dev/sound/pcm/buffer.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 8bf3631afb7a..de535ec2dcba 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -461,39 +461,30 @@ sndbuf_getsel(struct snd_dbuf *b) unsigned int sndbuf_getxrun(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->xrun; } void sndbuf_setxrun(struct snd_dbuf *b, unsigned int xrun) { - SNDBUF_LOCKASSERT(b); - b->xrun = xrun; } unsigned int sndbuf_gethwptr(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->hp; } void sndbuf_sethwptr(struct snd_dbuf *b, unsigned int ptr) { - SNDBUF_LOCKASSERT(b); - b->hp = ptr; } unsigned int sndbuf_getready(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rl >= 0) && (b->rl <= b->bufsize), ("%s: b->rl invalid %d", __func__, b->rl)); return b->rl; @@ -502,7 +493,6 @@ sndbuf_getready(struct snd_dbuf *b) unsigned int sndbuf_getreadyptr(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rp >= 0) && (b->rp <= b->bufsize), ("%s: b->rp invalid %d", __func__, b->rp)); return b->rp; @@ -511,7 +501,6 @@ sndbuf_getreadyptr(struct snd_dbuf *b) unsigned int sndbuf_getfree(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rl >= 0) && (b->rl <= b->bufsize), ("%s: b->rl invalid %d", __func__, b->rl)); return b->bufsize - b->rl; @@ -520,7 +509,6 @@ sndbuf_getfree(struct snd_dbuf *b) unsigned int sndbuf_getfreeptr(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rp >= 0) && (b->rp <= b->bufsize), ("%s: b->rp invalid %d", __func__, b->rp)); KASSERT((b->rl >= 0) && (b->rl <= b->bufsize), ("%s: b->rl invalid %d", __func__, b->rl)); @@ -530,40 +518,30 @@ sndbuf_getfreeptr(struct snd_dbuf *b) u_int64_t sndbuf_getblocks(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->total / b->blksz; } u_int64_t sndbuf_getprevblocks(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->prev_total / b->blksz; } u_int64_t sndbuf_gettotal(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->total; } u_int64_t sndbuf_getprevtotal(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->prev_total; } void sndbuf_updateprevtotal(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - b->prev_total = b->total; } diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h index 2c5d6e7c214b..ddf4083ec19f 100644 --- a/sys/dev/sound/pcm/buffer.h +++ b/sys/dev/sound/pcm/buffer.h @@ -26,8 +26,6 @@ * SUCH DAMAGE. */ -#define SNDBUF_LOCKASSERT(b) - #define SNDBUF_F_MANAGED 0x00000008 #define SNDBUF_NAMELEN 48 From nobody Tue Mar 4 15:47:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6L2nlyz5qGkf; Tue, 04 Mar 2025 15:47: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 4Z6g6J4cTrz42TJ; Tue, 04 Mar 2025 15:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kobJJfs8it/M/PRCXY36fcRhYlPFIXSai65KcIXp5VM=; b=JYzAthRtFSQJygiHgHUJWY7lXnXmS+6HM+rA56Eov5PSpwtyU3Ww93Db8LSzyDCdkQ63eY 3vJHWOhTy10BUaQnGUPfOJMnwfUw2GIqfcy+uVjMSZoFh7kqQ0nWt3HLq3Y+TY+bfRnm8c p0IY39cp2nsUE6TsT+Lp9zGUzH4U4zbeCE7UM3ysOyVbPaVamQlNHCviDXePjh5D7g1lAK w/8D2QSUPqgdS10eY8b/wAPgkC/AGnaURKWFgNmHTpYrbPAND6dsgAo0JkTE90Mn3aC26b zQ+MsYDwdq6YJ3GMOgp4q9AccswHzyy8Rg3Z6C5HaP04WKD26EjKFvnXg7C0Zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103224; a=rsa-sha256; cv=none; b=jIpDv9Ll0v+nJCxdD+CJ7sXDnyfwvSpfwywlBldOmLTwh1DCRyBtTzAdJ60FTRrBA8qIz5 Z0BhP5jbcetwsa2ADwuicpQuPkZXmt1Sl2wYykKKVjK0C+p9fZ0gPESfvfVHy5UWIDPszO 6ZZ+mbukNfRO/fhHLN0cTEwGAjNNgogk5A9f0pFgh5ruT7xMyJ3czT/+3YsQmT0PW5mviD cHKtXwwe7HRYKbQW8m4kV+oQ6fIKKEIPfQzSd5zuV6rOjA2Wk2sUw+lhI75+8FaqnQHllc YLmHn1yDBz049prhxxOTsaXd9FcVbnzCDvhHKgkzyvoseZuOYH3HXuz2UTZ8aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kobJJfs8it/M/PRCXY36fcRhYlPFIXSai65KcIXp5VM=; b=Lj+wgzyMUr8p+NICedOBpiC2PJjYj9+JcP4EWuNJvCoc5JWzJbQ3rCAF1IalznYQnJgoGh GsCMUSeAFU5/OvEltOY/vr1Wn3YZYHOrQ3aqn6n+MYTaAwzzn3sKT5kXmHsYjPnlxxfmMe 6uYU+0zOgz0SoAjYGcDFYAhteMFjRHuJTqhJ2NoD/MWl+iYSbqE54m6VujyWcHlxCJIQXc kFAaZYK7gEZch+61AhReW/heiKk9b/4bRD1SbZehzbYeUJDfhJCU73KBrfci5G3wYTKCIN ShNhgkoyi59nL6woLjDyPESy0DGEzG3RMwMMLV/2q9BO/6K1t8rBzdVOoA6DMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6J42Pnz8Fb; Tue, 04 Mar 2025 15:47: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 524Fl4Jn050070; Tue, 4 Mar 2025 15:47:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl4QW050067; Tue, 4 Mar 2025 15:47:04 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:04 GMT Message-Id: <202503041547.524Fl4QW050067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 21e0d2aa35bf - stable/14 - sound: Return if the new speed/format is the same as the current one List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 21e0d2aa35bf41951f1835eac0dd58be257cbc17 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=21e0d2aa35bf41951f1835eac0dd58be257cbc17 commit 21e0d2aa35bf41951f1835eac0dd58be257cbc17 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:12 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Return if the new speed/format is the same as the current one This gives us a slight performance boost since we do not have to go through chn_setparam() and the driver functions. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D48012 (cherry picked from commit 40616b7e41ff96b6d7522445b00f27f26d593a85) --- sys/dev/sound/pcm/channel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 19b2db321cee..c3ee50d51c4b 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2110,6 +2110,9 @@ chn_setspeed(struct pcm_channel *c, uint32_t speed) oldformat = c->format; oldspeed = c->speed; + if (c->speed == speed) + return (0); + ret = chn_setparam(c, c->format, speed); if (ret != 0) { if (snd_verbose > 3) @@ -2138,6 +2141,9 @@ chn_setformat(struct pcm_channel *c, uint32_t format) oldformat = c->format; oldspeed = c->speed; + if (c->format == format) + return (0); + ret = chn_setparam(c, format, c->speed); if (ret != 0) { if (snd_verbose > 3) From nobody Tue Mar 4 15:47:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6N2BVQz5qGdn; Tue, 04 Mar 2025 15:47: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 4Z6g6L6VXzz42Wj; Tue, 04 Mar 2025 15:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ISU8kJjHONdAaRvxW7gC8BZrcymf7F/c8W70ElsRbl0=; b=lRa3ov39FfXCQN/Askf743KUH3b5bdw+p+aIXA7dvx4UhtdcBbtfKwj3k41FirTcyGZKPr Iw4ywUfdU6mcsElpDxbZSLkHBinWtqWUEskIFLNTRK7BUdhN60HJoRtXvlBmuD9uxFs3No MT9oDUD536TZubJbvZRO2szY1zrmUdd14YUjRtZVtVuqrBd80UHI4u/MzphfwOBzrm3R9J 7rvboFAGSeb0y2oPFXcQe3lj/hky5x/kfaE3XFmhQ/qRYCfMFyTXVCfO1P3ky+IVQoHD1Y U1j2AYB70jppHprPMdecXSUhKsVkZPLQVyENaB275o2dNt1tvQs0ctkB2xtGfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103226; a=rsa-sha256; cv=none; b=I900xBpZVbeCjm3BJWxwaTMsVCUhjVhjM5CuqG3h5yw+uIyYfJUxiube0QQcgmSdZyNKcy DyNhnrm3pXucTB6Sugv9TCrvA2gA0lPNf25FqqcOpWU9UKwhMIBLc8TxJJnqUfN6iOPBJl vch/gy+RI/5WOuEKarOLS4DMcAtZRFlh9KvJMsgY/jjSFp3kfSW98X+Ja5iZ8Y7yhiBRmZ 7xAuXYD79kq2emW4IUEh/N4u76Asl1HnmUHJ7Acnwc7rzbMGdB60kSwhg0lvRx1U17SNek gkXygTsKBRAvYqawarhLqZgG/zK8r5+rnzODAztvGuVQSxaP2V1/Xdzg0C952A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ISU8kJjHONdAaRvxW7gC8BZrcymf7F/c8W70ElsRbl0=; b=I0Rt2xewoBXm0knrUNRRR11jz2KUKJTX4p4b5jqvhLpWaBgQqQrtuVYxocMDXiTfsWGZvc 39Gxdxt4HKHkUT8dkY+vlG41qF623Liw6WHsAq2OQ4/KpqA8Csu/GY7eD0fB+AslVRgirc ewVXabp8EOaBZlIYEIi8Jy9CU/N0QnTQAVK105H6G8xq2zALxpxpu+xBjRPjzE1o56VSrd X29HxTLjFpMys/gqTVLYYp4Icq5+o5/t0oumC3yyUqqx9Hoo70B7P0n+bw1QlDa4RcXYRi ndqtE2wNSNw9AcIuMus61PUNnGTNazqnTgJkyZednqapuPfCHQlfLSQEN+hcsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6L65Rpz7xW; Tue, 04 Mar 2025 15:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 524Fl6nZ050136; Tue, 4 Mar 2025 15:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl69o050133; Tue, 4 Mar 2025 15:47:06 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:06 GMT Message-Id: <202503041547.524Fl69o050133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: cd4615c223b3 - stable/14 - sound: Simplify locking during device creation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cd4615c223b3f4ef1c892b682f57c83eebafde1c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cd4615c223b3f4ef1c892b682f57c83eebafde1c commit cd4615c223b3f4ef1c892b682f57c83eebafde1c Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:24 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Simplify locking during device creation The mechanism of acquiring SD_F_BUSY in pcm_init() and releasing it in pcm_register() is a leftover from the previous device creation scheme, where pcm_init() (previously pcm_register()) would create the sysctl nodes, as well as the device node. In this scenario, acquiring SD_F_BUSY was necessary, in order to avoid races in case the device was accessed before it was ready for use. Commit 66f3eb14e955 ("sound: Move sysctl and /dev/dspX creation to pcm_setstatus()") fixed this issue, so we can simplify things now. Only acquire SD_F_BUSY in pcm_addchan(), because chn_init() expects to be called with SD_F_BUSY acquired. While here, move the sndstat_register() call further down to be more robust. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48482 (cherry picked from commit fd906e47b18f53b09524647bf8431dc6170b8dfd) --- sys/dev/sound/pcm/sound.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 391c8e61dc19..9459b207bba0 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -136,9 +136,9 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) struct snddev_info *d = device_get_softc(dev); struct pcm_channel *ch; - PCM_BUSYASSERT(d); - PCM_LOCK(d); + PCM_WAIT(d); + PCM_ACQUIRE(d); ch = chn_init(d, NULL, cls, dir, devinfo); if (!ch) { device_printf(d->dev, "chn_init(%s, %d, %p) failed\n", @@ -146,6 +146,7 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) PCM_UNLOCK(d); return (ENODEV); } + PCM_RELEASE(d); PCM_UNLOCK(d); return (0); @@ -239,8 +240,6 @@ pcm_setstatus(device_t dev, char *str) if (d->flags & SD_F_REGISTERED) return (EINVAL); - PCM_BUSYASSERT(d); - if (d->playcount == 0 || d->reccount == 0) d->flags |= SD_F_SIMPLEX; @@ -253,17 +252,10 @@ pcm_setstatus(device_t dev, char *str) d->flags |= SD_F_RVCHANS; strlcpy(d->status, str, SND_STATUSLEN); - sndstat_register(dev, d->status); - - PCM_LOCK(d); /* Done, we're ready.. */ d->flags |= SD_F_REGISTERED; - PCM_RELEASE(d); - - PCM_UNLOCK(d); - /* * Create all sysctls once SD_F_REGISTERED is set else * tunable sysctls won't work: @@ -277,6 +269,8 @@ pcm_setstatus(device_t dev, char *str) else if (snd_unit_auto == 1) snd_unit = pcm_best_unit(snd_unit); + sndstat_register(dev, d->status); + return (dsp_make_dev(dev)); } @@ -435,7 +429,6 @@ pcm_register(device_t dev, void *devinfo, int numplay __unused, d->dev = dev; d->lock = snd_mtxcreate(device_get_nameunit(dev), "sound cdev"); cv_init(&d->cv, device_get_nameunit(dev)); - PCM_ACQUIRE_QUICK(d); i = 0; if (resource_int_value(device_get_name(dev), device_get_unit(dev), From nobody Tue Mar 4 15:47:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6M246Hz5qGdm; Tue, 04 Mar 2025 15:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6K5cHxz429s; Tue, 04 Mar 2025 15:47:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GbVAZAlLFO8BpVn8KpraqpCktVoWd3NlEgDJ7B6pHw4=; b=EcjzXcO1uL2mWEN+0OyjQ93QmhMGd6F1GGDRItn9C6eGyTHjaFZgNx8V70s3s2of2z3TD0 gwstHNNFXmbljt89EXPKAQbJf3MNjcUzJWUFqZXOCbdKtMW/srxwp/QpW7vukpQtgKPfVh zmbxTM/rdWzxFFjCDLGqQU1KNL5O9ODOJfqU6/d35V5kiFw/98N/BajsKmMZoj1toZGCG0 8g/rn05CHnkDlYTxU8nHGF+iERLONmEf2zCP7xA9DpWFihlK67MWZmWcoVifSd0i3ui/Gd G6o69TQrnNqQQ4YDxfJgPWHoYqwj9Y08BiipcZN6fAMWuuEwz0bFvqgqBCdycQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103225; a=rsa-sha256; cv=none; b=FWDhayhgI2I/JwyAg66tyB7fmE3AEbQ9/223+skegWw/6Cp6UjJB/yPEunZScIupv6YoYY bhGQNpkGPYP7VT8qBpcuELsUrJcvx4ixxLD5j26B4CswcaHuxJWU4ecp0njW+///jPLUvD B2WIdyNjI9rg8o0PEF1MaNutfFj4rn5xAA7a/cbRZjZHwWHwuLZuU+BYBSXngJBJuCl50x ojhROvahCeeGkBdsu7XZ4buHmIsdjkTO6t1eVFFpY+wkrrNyuSCGe2dogh5XBc6etYm0xh 5J3fyXTdAX+KW+3XJz69qwov6hnKWo0gMKeuSKI23Xy31tvl+Q0jYqbvzvGXHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GbVAZAlLFO8BpVn8KpraqpCktVoWd3NlEgDJ7B6pHw4=; b=WCN1kZaDQju9zOA3HTHEvCiu4S8lD/eJa5v2/3BbNYnsCkrj/wXdoVB2gUgpfFdR4n4Slz bvDETiR+6mAiClDFt7inalkGCYw4iAnWiDd4Pk9Ti6GcJxUpCCh0EL6xG14jPUABdpwsoI aIRKaLqWguBaCIZYERRz0HtnAsKZaSjuUoOphTezX16OK8pmjrjBUPnOi10vZbZVnROBgI 6eO4w/Zw/OmLsNZMmdRfMHn6zEdOwZUmcw0UbknFHYe+Gm/erSWAHchTTGbeqcD1zkFnWz Q4r8KZZW4lpyxNnIUhZhUWbxBrg99JcY7KqdLvhjo2y6LUSc71JlJvPPWTY18Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6K563Pz8XJ; Tue, 04 Mar 2025 15:47: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 524Fl5kI050103; Tue, 4 Mar 2025 15:47:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl5ms050100; Tue, 4 Mar 2025 15:47:05 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:05 GMT Message-Id: <202503041547.524Fl5ms050100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: bd9a9c001951 - stable/14 - snd_uaudio: Remove undefined functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bd9a9c0019517bb1433172e59c9df3c0cb171eb8 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bd9a9c0019517bb1433172e59c9df3c0cb171eb8 commit bd9a9c0019517bb1433172e59c9df3c0cb171eb8 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:18 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 snd_uaudio: Remove undefined functions Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D48424 (cherry picked from commit 352aa9ad1d77a8ea8e4afef66691dc1a06344618) --- sys/dev/sound/usb/uaudio.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.h b/sys/dev/sound/usb/uaudio.h index 08144701efe5..54b31a4e7bd2 100644 --- a/sys/dev/sound/usb/uaudio.h +++ b/sys/dev/sound/usb/uaudio.h @@ -64,8 +64,4 @@ extern void uaudio_mixer_set(struct uaudio_softc *, struct snd_mixer *, extern uint32_t uaudio_mixer_setrecsrc(struct uaudio_softc *, struct snd_mixer *, uint32_t src); -int uaudio_get_vendor(device_t dev); -int uaudio_get_product(device_t dev); -int uaudio_get_release(device_t dev); - #endif /* _UAUDIO_H_ */ From nobody Tue Mar 4 15:47:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6P2LHnz5qGh9; Tue, 04 Mar 2025 15:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6N09tqz42cy; Tue, 04 Mar 2025 15:47:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GCKTucyDM7QJTG+rPa0kLCMc+E4B7rBaoczZaOQK9Xk=; b=tdfcHv+LozoRXqhI5K5HaNf6Awrl1yy1KJ9NpdTpiZSFK8nELrhQhW4m+4n1NEbkT9vhN3 bzLy4LkUyPbmiSpZZ8R8r6hD1wcR6i5zSL2ouFFdbpFh8ZhEj8h9OPEgMdpQb70HJJ5h2I 8mEQkx4S+QWtZfzIUXPoFf7qRtKApnXdh6u4yI9aFkBCvngXZ4YRyWuXHkXDrw9+IVfMNt d40+vP+auytikKpXJvBHMAfW3/kIPHl0joA1jrl1cDJUhGNzqmbTO3DLD8QJRpa/7HkZsZ RUrT1ENHmeQJbDWOhhsYd+IQ3PiIZ+lTaTECOTudscQb9D2ocshK4PzJXrN+6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103228; a=rsa-sha256; cv=none; b=epJZbbnXS+ES/0lIETY0jMixARfzqeatlqQHimSa3lgMLVdYEA3scPZNPxNo0c50hS+/Y+ WkjppCf6PoS7VD/zKanLT8Nl++w6BOO0gT8PemwUsCG3Dt8aACQOQovQqALpBhYYk/vHBY O/v5YtZ18l4vxFATRvG42HwS3TppuIqFDVZAU4YfQjh0SLgUGrwqul1ZNqR3RoXybREpCq /A83V7f6j187KOY4nZ2q5O0TJ2pP7A+X/zY1x/1g5YK2ua04UlwwZedsw/Kcv62LsfVpsW Tr9WN/H7z/rheojFgTzNiww4ChugTq2fo+hmTZ/PU81RkG53h7Hhvem7n4Cm6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GCKTucyDM7QJTG+rPa0kLCMc+E4B7rBaoczZaOQK9Xk=; b=UHdKAWJ6DOOqiG2rZeiBvJuzh5g9rrw7+w3o0DerTISulLHYaNI7vdwD14tQ2/10GnvdGJ iKJjW38A8Z2bPP6RMrKktrbtJYBaNVLe5kAAcyR/rV1X+4OGplDJJHGn3fyT3rre+q6rH9 NmON21RGDiteAj1AQRvPa/LhdC4xa3G1ilrtzwS8EPP4JfYmyhagutF5tKMWsyGaU4uoBG D9GaDcj0fx8SuF8umYGOhyC2PzvW3v9O1AGkwWzmyOFgE2sWpm2Lwy0wXegnWa2snZYtwz NK7GZzcFzbGvSW4p6qKHBOGhJW1lUjreLhqHUbSTwDkdqYbCLbTgvQW5EPoGKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6M6qdjz8H7; Tue, 04 Mar 2025 15:47: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 524Fl7s9050169; Tue, 4 Mar 2025 15:47:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl7qZ050166; Tue, 4 Mar 2025 15:47:07 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:07 GMT Message-Id: <202503041547.524Fl7qZ050166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 127a39c54c2b - stable/14 - sound: Update comment and channel insertion in vchan_create() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 127a39c54c2bb56189bd44353d54e34c8ff220bd Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=127a39c54c2bb56189bd44353d54e34c8ff220bd commit 127a39c54c2bb56189bd44353d54e34c8ff220bd Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:30 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Update comment and channel insertion in vchan_create() The comment and rationale behind choosing CHN_INSERT_SORT_DESCEND() instead of CHN_INSERT_SORT_ASCEND() are no longer relevant as of FILLME ("sound: Allocate vchans on-demand"). Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48962 (cherry picked from commit 2868776c9c6f5313a5676786f642b766f103d780) --- sys/dev/sound/pcm/vchan.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 45f0a8b00bd2..27739fe68852 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -644,12 +644,7 @@ vchan_create(struct pcm_channel *parent, struct pcm_channel **child) PCM_UNLOCK(d); CHN_LOCK(parent); - /* - * Add us to our parent channel's children in reverse order - * so future destruction will pick the last (biggest number) - * channel. - */ - CHN_INSERT_SORT_DESCEND(parent, ch, children); + CHN_INSERT_SORT_ASCEND(parent, ch, children); *child = ch; From nobody Tue Mar 4 15:47:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6S1Lh3z5qGYc; Tue, 04 Mar 2025 15:47: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 4Z6g6R3pS7z42h2; Tue, 04 Mar 2025 15:47:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21PZLXJGtbmNmpN5RfEbMOyX0sA37zEswmd8V+MF4kg=; b=BGpMZEwSConnL6z4VzOpD08/FmdfdcxxGW27Yw0LimPoiuOKrDstkoKyoOPtmqcP2TupC1 VOZ3tvJImJZUac8bSr88dp/8XMbUP3Xk6UpDJWtfmxh5yEZoOXe6afogIAgyX/N34Rvqir K8YBS0Kg3mcJCgFl9pzRHoOX/dyuixiHmOOtzx9hPEVv5KBRGu5axgSR/kJ9N+44r65kv3 uhIsN7UMix3SsbrrNbMCcSGqohWaJ3tSWin27s0Oq9XxKhIITC/Fy1eL3pAob1CdA4bVr3 d6iXqwA64Vbd9SiDCcO5CmunOmW/gyZdSqsEewHNDi753LvcAPv5MiGaMh51gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103231; a=rsa-sha256; cv=none; b=yH/IB/mDVR/9WDAIzF/WFY2yi4IUCAJ7lAs5WX/gvb+TBjpn5DxtEGO2ecrL+NjXGwC8aG EHPaqPukDedmnYxJKzONzZ5DS1qgO2MIRLxUHbyTC+JNvSxdI4hFiQYjyS+aD0zIV6FaXg w2BljrQiT48TjqKV+Bq33Csc/fEnL24MOvWoyYpgAM89Urm75AioyDDecMlh7nB0KJpfP1 4D2y0LRxxhfeHYgWvEvg+o5J59QZPlmkJdEfahYZG/OiD2q8JxJiXzjJGpYLTIfn4vJ+Fc bzGErO7EAByU/JYfUyETpXDIfmHNphCT2qE8ARSWdjEGVEzqc5dnjRL0N35YgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21PZLXJGtbmNmpN5RfEbMOyX0sA37zEswmd8V+MF4kg=; b=ADwVP++niOhvwvG3+D6TaUSGHfUWXkZ40C7LWfO1kh1si8ZAAvt0/SlKfmuNX5isBA9MY3 Qok8HEGdFt3g39ea3KKwPpcH+zJsABAqR+wc1SJ4jMY2cvYL5pywSmeFu7YNDdcbuNO1hT yrUV3S+cICc7aJ3sj6VE90ap1WNKiJ3WgHSL6K+KWGAod0mFyFfU/g+Y1BOVkUJk24K2Xd MWw+w8cKpIaYf14Fr5FxeRfxZP/cgDziORbVCRwhPQnikNXAGXK+yexwSsj2MosflqM2NE 4agTTPY5/5XUQebLqyHNsdKKvPjxfhjfOI6iKQVm9NifNna9lhtiAhqh8OADhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6R2lD8z8H9; Tue, 04 Mar 2025 15:47: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 524FlBX1050271; Tue, 4 Mar 2025 15:47:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524FlBdT050268; Tue, 4 Mar 2025 15:47:11 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:11 GMT Message-Id: <202503041547.524FlBdT050268@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 311b84540e73 - stable/14 - mixer(3): Do not skip devices with no volume control List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 311b84540e737a55d032aa46975ea2379350077a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=311b84540e737a55d032aa46975ea2379350077a commit 311b84540e737a55d032aa46975ea2379350077a Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:49 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:07 +0000 mixer(3): Do not skip devices with no volume control Some devices might not have a software volume control, but still be able to be set as recording sources. PR: 279787 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D48730 (cherry picked from commit f121de8fbcbc8aa82f9fb59039c502406b7c88b6) --- lib/libmixer/mixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c index 4abbed9b27d3..2be3a48eb755 100644 --- a/lib/libmixer/mixer.c +++ b/lib/libmixer/mixer.c @@ -113,14 +113,14 @@ dunit: TAILQ_INIT(&m->devs); for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { - if (!MIX_ISDEV(m, i)) + if (!MIX_ISDEV(m, i) && !MIX_ISREC(m, i)) continue; if ((dp = calloc(1, sizeof(struct mix_dev))) == NULL) goto fail; dp->parent_mixer = m; dp->devno = i; dp->nctl = 0; - if (_mixer_readvol(dp) < 0) + if (MIX_ISDEV(m, i) && _mixer_readvol(dp) < 0) goto fail; (void)strlcpy(dp->name, names[i], sizeof(dp->name)); TAILQ_INIT(&dp->ctls); From nobody Tue Mar 4 15:47:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6Q6krbz5qGYY; Tue, 04 Mar 2025 15:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6Q2Hyfz42S4; Tue, 04 Mar 2025 15:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7wNhIVMmZ+ynnN1WKBhdqS0vTa/EqOodmeVHX9uZuHw=; b=k3BjX2X3CzKFjcZ9rik+bF7eYcacDiJpOnkxkAKvg6EJUkvNudXJGzQM/I/CtT29NmZ/UB nLkKHX4T5jRNjHW6UUIHIysOpE+8axAg2JQJ33Gl+lyiX+t+j1Nrk0g3KbRvVJbH1XuYO4 TVVDCyy+iV1H0NBu8B2f5+T7YppSgmz87FbBSTmzqUr6VRPHNbFS8P0rSNAS8ofdxMIT4x qMDvY8Ddh9GnyXJp2Z7xCw4tcnGGA59gViwqlhu0l2kawjKoZDIrcX5ARdNKXlTVryA7th 9F56Ts+GJ/p5K9kAhP976L1j1/87+PBCWrcXtcUoi5OrljGdPEMLeMxaBbTvQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103230; a=rsa-sha256; cv=none; b=hgVefaM5ZaWgs61yCLDbwTdOcDH0FhdS3McU+fd+KNC7OlGuQ9/jhop1NfbAHxnzE99EKl dZFhmg0eMRsVYSlbS4cJoiIgE+7E8vDp1O9jC8UJmne/YdLURJSlUSt93EJZ1EoIykOQck /OCIq38kBtY9DPAAt7O11kzkbLcbCZX8P81IDKGva8DiFT0MpVHKLXNYRWuGSa4Bn0UitT xHtMX/XLg+mJP9dnHxMew/A4Jm3YB2AN4HE48M/zQoVpbZBzubaGXdYISsrEIH7VqP5nS7 ZuAc8EGktd4MGEoWwncQkVfoVauiRHcuyYGnDpE5XC3i1WBk9r2NUJ0tRUwQdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7wNhIVMmZ+ynnN1WKBhdqS0vTa/EqOodmeVHX9uZuHw=; b=x9AtM9b98+vSNcU92hb07L1kOKN+r/8AVsrZNWPuDOpeTA4raY2ZNHFqvV03RYT7ecHL5R 7K0SwKNWf+2IXbKjcu1hT8OKQ1ZYuP4OACnfciM1mkxsLQs3O8OsGsqgDpkJbPeAonJ91u qMARzwSmipreF/ZywCrF3mjjF90fH+4Jo0AmVdO2rEL66ndp5zON2pSedIQYHRknf6XKuR Lyx6GWb6g6sudp20YMH+09j4xinLw8OnAiXXicOi5oj1TVYfepXzB4b6oCyT6MkpGZ7DEj f4/fGeW5Hb4BAqtR1kLHAvbruxQeNvBUt8Av6xKbe8evR9sOsuuitoRpvd09xA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6Q1syxz8H8; Tue, 04 Mar 2025 15:47: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 524FlAdf050238; Tue, 4 Mar 2025 15:47:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524FlADP050235; Tue, 4 Mar 2025 15:47:10 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:10 GMT Message-Id: <202503041547.524FlADP050235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 0a309ec1b802 - stable/14 - snd_uaudio.4: Move non-uaudio-specific BUGS paragraph to pcm.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0a309ec1b80251afd69923a0a8e9692094533e05 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0a309ec1b80251afd69923a0a8e9692094533e05 commit 0a309ec1b80251afd69923a0a8e9692094533e05 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:43 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:07 +0000 snd_uaudio.4: Move non-uaudio-specific BUGS paragraph to pcm.4 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49019 (cherry picked from commit cfdee707fb18a0fde4bed4e85414f8803461249d) --- share/man/man4/pcm.4 | 9 ++++++++- share/man/man4/snd_uaudio.4 | 9 +-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index ecaf732aad25..181dbf0aade9 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 4, 2024 +.Dd February 15, 2025 .Dt SOUND 4 .Os .Sh NAME @@ -670,3 +670,10 @@ It was then rewritten for .Sh BUGS Some features of your sound card (e.g., global volume control) might not be supported on all devices. +.Pp +Some audio devices might refuse to work properly unless the sample rate is +configured the same for both recording and playback, even if only simplex is +used. +See the +.Va dev.pcm.%d.[play|rec].vchanrate +sysctls. diff --git a/share/man/man4/snd_uaudio.4 b/share/man/man4/snd_uaudio.4 index 6e2509b8f2ac..00329a6d8e40 100644 --- a/share/man/man4/snd_uaudio.4 +++ b/share/man/man4/snd_uaudio.4 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 26, 2024 +.Dd February 15, 2025 .Dt SND_UAUDIO 4 .Os .Sh NAME @@ -156,13 +156,6 @@ and modified for by .An Hiten Pandya Aq Mt hmp@FreeBSD.org . .Sh BUGS -Some USB audio devices might refuse to work properly unless the sample -rate is configured the same for both recording and playback, even if -only simplex is used. -See the -.Va dev.pcm.%d.[play|rec].vchanrate -sysctls. -.Pp The PCM framework in .Fx currently does not support the full set of USB audio mixer controls. From nobody Tue Mar 4 15:47:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6P3KRCz5qGdq; Tue, 04 Mar 2025 15:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6g6P1G4Vz42d7; Tue, 04 Mar 2025 15:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XRc33ompDDMEkqZRDzeQ6Wn8/t4qNUI5kzib74H0dUI=; b=GCP9b1Ic2ib1JEPcFBnTMhCU/cd6t7iVyaqlPJdkRQACredeHD2U6eO975rorZjoFs2I2Y saG2z+rZxGGmKQrveDbqdaomvh2/rJ0e/Hgagvz9KQrL0gsuOsttgveiny2875ayTOdwME kEJppErTpE/pAMUyUmmnajRgDFkztjVkDN52ae9j624ftUU1273dpKSOhdSWSZxzjsElfV 7ub9T61TpTxjjI5jZziJIHOWwus43Eu1NlhIDBqLpwJ1sOPPUxLk7FvgS5d6s7ERuApza3 jgPrVXhyEQYoxAbrlJdCtD7TWCMxxU6LBv/T+VdL/lrvEY+auoxGoV69iFgrdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103229; a=rsa-sha256; cv=none; b=wm80+s6Zq7ktQUjCWeurmh5nUywDfB8NY5Q9h4hujSdb6fIrNpheStzNkkxXQbYA2BUiTS SNjS5vp9KIln58LdeZ5nZT1nHDDAM3aSPmoc8zepKLq92XeXtJnyy6mx9dSR6KAt/HX83W KJyWYX3JZK9KFgy+Ky+zRuMaskdqw2pKmHE+BLvsXi08ZQSaYaD8DL/1/GTrpSWJkpjckR VEKFp6Lk4OUdQZzJ2CoH28Bo168A06cLLDNov1ir5zTGOASpm99jwQoq9EUI70lmGgRvEg nhLmvwkzu2p2GrcvuOy+NKQpMfv0I6MOFGubofAE86hz5qr/GXAf/fWHI+TLQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XRc33ompDDMEkqZRDzeQ6Wn8/t4qNUI5kzib74H0dUI=; b=hiK6+2cM5cpC7ICskYFeIgrwXw9dvWklUm9to802UvZ5HmKW5fqLR5Un1DuBBQ07HDE+4Y E+bVB0X4Parc0mDKQMk9rwttTKl0h7hLi0EJEeJEPOxzoPs5/EX6jBiZB5UFNkjDzVIcb9 +TNCpH6PiyxYyYItq4vnjqA1H3XzDZxZC8Hxnw/9/ac+vnc2HIPKstQwzLm36zUlFXIxpX GiyFlmBsFrB/UnniOjb3dk1q+BbXJv907j3fPUPQwg7RiarpAvH7D9v6xcKK/SFyEGsits K0WOapH63ElX3dwqHjfcmWo6dRoUgOmGqEZNpmU+EfTSTSRHjPlm0cAxZ5/8oA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6P0bvXz8XK; Tue, 04 Mar 2025 15:47: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 524Fl94g050201; Tue, 4 Mar 2025 15:47:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Fl9mR050198; Tue, 4 Mar 2025 15:47:09 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:09 GMT Message-Id: <202503041547.524Fl9mR050198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 858504a1d89f - stable/14 - sound: Call chn_kill() in chn_init() failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 858504a1d89f3e1cb89f6126b3b59e80716fb3df Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=858504a1d89f3e1cb89f6126b3b59e80716fb3df commit 858504a1d89f3e1cb89f6126b3b59e80716fb3df Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:37 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 +0000 sound: Call chn_kill() in chn_init() failure Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48966 (cherry picked from commit bc7e65e950154572d8c9a04dc033075bf37aae40) --- sys/dev/sound/pcm/channel.c | 50 ++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index c3ee50d51c4b..0a0059411399 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1179,11 +1179,19 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, switch (dir) { case PCMDIR_PLAY: + d->playcount++; + /* FALLTHROUGH */ case PCMDIR_PLAY_VIRTUAL: + if (dir == PCMDIR_PLAY_VIRTUAL) + d->pvchancount++; direction = PCMDIR_PLAY; break; case PCMDIR_REC: + d->reccount++; + /* FALLTHROUGH */ case PCMDIR_REC_VIRTUAL: + if (dir == PCMDIR_REC_VIRTUAL) + d->rvchancount++; direction = PCMDIR_REC; break; default: @@ -1292,40 +1300,10 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, if ((c->flags & CHN_F_VIRTUAL) == 0) CHN_INSERT_SORT_ASCEND(d, c, channels.pcm.primary); - switch (c->type) { - case PCMDIR_PLAY: - d->playcount++; - break; - case PCMDIR_PLAY_VIRTUAL: - d->pvchancount++; - break; - case PCMDIR_REC: - d->reccount++; - break; - case PCMDIR_REC_VIRTUAL: - d->rvchancount++; - break; - default: - __assert_unreachable(); - } - return (c); fail: - free_unr(chn_getunr(d, c->type), c->unit); - feeder_remove(c); - if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) - sndbuf_free(b); - if (bs) - sndbuf_destroy(bs); - if (b) - sndbuf_destroy(b); - CHN_LOCK(c); - chn_lockdestroy(c); - - kobj_delete(c->methods, M_DEVBUF); - free(c, M_DEVBUF); - + chn_kill(c); PCM_LOCK(d); return (NULL); @@ -1368,12 +1346,14 @@ chn_kill(struct pcm_channel *c) chn_trigger(c, PCMTRIG_ABORT); CHN_UNLOCK(c); } - free_unr(chn_getunr(c->parentsnddev, c->type), c->unit); + free_unr(chn_getunr(d, c->type), c->unit); feeder_remove(c); - if (CHANNEL_FREE(c->methods, c->devinfo)) + if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); - sndbuf_destroy(bs); - sndbuf_destroy(b); + if (bs) + sndbuf_destroy(bs); + if (b) + sndbuf_destroy(b); CHN_LOCK(c); c->flags |= CHN_F_DEAD; chn_lockdestroy(c); From nobody Tue Mar 4 15:47:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6g6V4LM7z5qGQL; Tue, 04 Mar 2025 15:47: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 4Z6g6S4N3bz42Q9; Tue, 04 Mar 2025 15:47:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+XSMxeyEbPtt+YpboUvuxgcWEi6A0ixrY6BLbs0jsyg=; b=j4RwED3N0UwpYYBtWaNu8qhOOv1KeybIgP5OuG31+Tdx8vcc4xEjsMsyN7W5VG+1V88RCW mNnCuwcvuFkYIrpCc1LYTQtIUZpoA4cuTEnjH66dCoTnXR0/uVahWdXUjFy5ti8/7ocofa DZe+uvakxwFDD6t6ByuFsUwS5CooH9doyGCmGxTz6qYEYxXjkWc6UQdM/QKpCO1ZyaL8L+ fGOzNhLMSvB/n1iDkZjW+fTLwSykbb1vbL/qb5I8bC11nHdab/xuKxkYp4PrwrUKDemy7B +svBTmtLgxNeQjLqKhh2MWpZelSLcLo7Pblz8mhCwjgBW0cW9K5/pQPD1lzxJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103232; a=rsa-sha256; cv=none; b=LehPfawQ2lhLy4y2aUcVABTV74DY6pAPcqUM27S2WLRhoaEtUK87H1bi21kCxOGkbXn6Vb 800njMq0kagF3Sr2aEFB8Sp9P6djpnAkKv6/U5HwIxDzWkw3+c1EQAYk1yUWzgcAzsB6Yf rgnz/O74LAygoEnh32FvD+IEhsYuWNPVuaEIJTkcCSmp9SHkBOQVQqj8XvDCuuTsVWStAY Bj7hGvVOguXC11KQrpbiOgyxXbjVm0KzZOrEVWsoEiTiP3a0ski5K+Qk9jmEYhRDxLV9aA qbeDlgqHAtHR3Qfo8v0DzE0gz3IWg+zTQ1PdNgPBCW0mX+PNg61soXaWk3xc6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+XSMxeyEbPtt+YpboUvuxgcWEi6A0ixrY6BLbs0jsyg=; b=QiT5yvX9iDq2yKmrfPon+9T+LMusptaGYA4HXrfuZfda6Uv4RbTsErbttq+JMFBJoBwJ2g 7drLVAoBCVgeCHgHkhKjYsjoZlP2+t/l6Hqv484FuaxOpmrgT755ETcD7t2Zqy5cUOmIja +1TEelZgdE+KfsHekSI5RIGs22u0lEqnhnBOJgqbCsKLtd1OY9F2BFcInUMHtikeFAqZYC a+nD8WUyIBId9+ttRo693uBxhZ59a1xROBNcWA6dOS4ev5jta1ut+oYCdgTRE75OHHr1s1 ijgAVvu5v+8Hwj7UCg2faDrH5/hBeDp/ayUjjObUDopOlt3w/Y5J24N9u3tlwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6g6S3gtbz85P; Tue, 04 Mar 2025 15:47: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 524FlCOX050304; Tue, 4 Mar 2025 15:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524FlCE5050300; Tue, 4 Mar 2025 15:47:12 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:47:12 GMT Message-Id: <202503041547.524FlCE5050300@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8278fd982926 - stable/14 - RELNOTES: Add 960ee8094913 note List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8278fd982926c3c9962ec3430723118fb99cc767 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8278fd982926c3c9962ec3430723118fb99cc767 commit 8278fd982926c3c9962ec3430723118fb99cc767 Author: Christos Margiolis AuthorDate: 2025-03-04 15:26:25 +0000 Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:29 +0000 RELNOTES: Add 960ee8094913 note Sponsored by: The FreeBSD Foundation --- RELNOTES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index 812dc613957b..97abbfcafafb 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,16 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +960ee8094913: + hw.snd.maxautovchans has been retired. The commit introduced a + hw.snd.vchans_enable sysctl, which along with + dev.pcm.X.{play|rec}.vchans, from now on work as tunables to only + enable/disable vchans, as opposed to setting their number and/or + (de-)allocating vchans. Since these sysctls do not trigger any + (de-)allocations anymore, their effect is instantaneous, whereas before + we could have frozen the machine (when trying to allocate new vchans) + when setting dev.pcm.X.{play|rec}.vchans to a very large value. + ead3cd3ef628: Add a new -a command line option to mountd(8). If this command line option is specified, when From nobody Tue Mar 4 15:57:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6gL20227z5qHcs; Tue, 04 Mar 2025 15:57: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 4Z6gL16XBHz3FZQ; Tue, 04 Mar 2025 15:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wK//iu4tV3nuWBNx71Bigigq0YiDElacAyoox2qKKnE=; b=wLSrHXiLhU41gaEk6Tp+tZrWXDGIGYxJOlW/KfuPJBwExTJKEtK1Zr8EgNKTZ3lY99a0zP FNe9HDEwbNevKFdBofbMridDIelCsYkHBxpOVfAabpDvRnDYzeY0zF776AcIqjyyZK3JSP OGHONROR6KpkTOhzlcXZunCIdv2dH0hjf496mULvRzQbIIEbHhBbRSlRdAG940hkcmxEHV R/noflrTz1obnldpTvqac4FnpKHsnZOWZMa85JKU4tyf+dxIXKGaD0IQW1/m9IRIXYqv7J vhcBc/h3XjRKOtnRFF0fBBMCeBhdSDEyz7Y9ahLttsu30ZKSwSSCDOWaiWrQRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741103833; a=rsa-sha256; cv=none; b=rXxh7yDtv9EtO9uZdfFwHknejG+IIaxn6RgDrFsLhUVSdnsZzaEjaHlraYnA04qCEJ/ogZ Qqosp95Pskd4KvccTmhn0t+Y8tMHfiA+oo9Zi7KsyBqtGhZ5FgB9X2Zio61bs00nkuW2Mv g3vRHamGPsBNx0Yzc31NLtISBlwC6T34bblP6NwsfRp4Ro6Fiz0zkIFe43pwQCZwaxn9sG e6KzbdcOpWLBw2jJ0eI6DiGVekXRxq1/E1lfPa0Zcg+CH7A6RPZCdJjRk3PtHsp5LJv+j0 o/1mMOhWR+cHneqtJe66RPmUxcvoa9pt8YEnDCg8Ikai5Me1MmU2qCboU0gwvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741103833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wK//iu4tV3nuWBNx71Bigigq0YiDElacAyoox2qKKnE=; b=x0U44mFiJW2RugEIPR6k0fIh7vLAwrM/+XEHmc/kfuVYq12UwYuVxyzaHDBfstVvmQzIAO xhufpwzgMjirFxqB2/hre9I0ZvJdXvvY0Nc8kOI6wA8+gu2/pmpRkhJXKi0SkuWNRE60t/ x8SEUa+RsiwvmOAm34ga0soGfrCcVOHs/MUPWzlBNo1yc0Qv8ZI4D3i0zkshLbe8jgwtJV txr8moIOxKU+LfPFxq3YVHxeqdhfMoXch/qVrZ+hmLRq4h8gl0Z3uXGddMdSQkPwNJ2VMV lx4VbfZKSoV4jq2xdfPL7CyDg8XsGHq19/JpWQRW11CoTiCN7uR87xUZXQalJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6gL167ZRz8rs; Tue, 04 Mar 2025 15:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 524FvDnt069058; Tue, 4 Mar 2025 15:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524FvDjv069055; Tue, 4 Mar 2025 15:57:13 GMT (envelope-from git) Date: Tue, 4 Mar 2025 15:57:13 GMT Message-Id: <202503041557.524FvDjv069055@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: 394a9a5b1c2a - main - net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 394a9a5b1c2ad7b679a00c3087c41378abfa74a1 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=394a9a5b1c2ad7b679a00c3087c41378abfa74a1 commit 394a9a5b1c2ad7b679a00c3087c41378abfa74a1 Author: Bjoern A. Zeeb AuthorDate: 2025-03-03 11:43:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 15:56:49 +0000 net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags net80211 used MMIC flags for CCMP instead of only for TKIP. LinuxKPI 802.11 compat code (and later net80211) had a comment about this. Given LinuxKPI seems to be the only consumer for these flags currently outside of net80211 itself, clean them up before implementing TKIP in LinuxKPI after all and before GCMP comes into the tree. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D49219 --- sys/compat/linuxkpi/common/src/linux_80211.c | 10 ++++------ sys/net80211/_ieee80211.h | 5 +++-- sys/net80211/ieee80211_crypto.c | 7 ++++--- sys/net80211/ieee80211_crypto_ccmp.c | 11 +++-------- sys/net80211/ieee80211_crypto_tkip.c | 2 +- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 33b33651b6ad..be0006769e33 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6224,14 +6224,12 @@ lkpi_convert_rx_status(struct ieee80211_hw *hw, } if (rx_status->flag & RX_FLAG_MMIC_STRIPPED) rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; - if (rx_status->flag & RX_FLAG_MIC_STRIPPED) { - /* net80211 re-uses M[ichael]MIC for MIC too. Confusing. */ - rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; - } + if (rx_status->flag & RX_FLAG_MMIC_ERROR) + rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_MMIC; + if (rx_status->flag & RX_FLAG_MIC_STRIPPED) + rx_stats->c_pktflags |= IEEE80211_RX_F_MIC_STRIP; if (rx_status->flag & RX_FLAG_IV_STRIPPED) rx_stats->c_pktflags |= IEEE80211_RX_F_IV_STRIP; - if (rx_status->flag & RX_FLAG_MMIC_ERROR) - rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_MIC; if (rx_status->flag & RX_FLAG_FAILED_FCS_CRC) rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_FCSCRC; #endif diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 8d5583a826e5..2db2fabac3a9 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -585,16 +585,17 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_F_AMPDU 0x00000010 /* This is the start of an decap AMPDU list */ #define IEEE80211_RX_F_AMPDU_MORE 0x00000020 /* This is another decap AMPDU frame in the batch */ #define IEEE80211_RX_F_FAIL_FCSCRC 0x00000040 /* Failed CRC/FCS */ -#define IEEE80211_RX_F_FAIL_MIC 0x00000080 /* Failed MIC check */ +#define IEEE80211_RX_F_FAIL_MMIC 0x00000080 /* Failed Michael MIC (MMIC) check */ #define IEEE80211_RX_F_DECRYPTED 0x00000100 /* Hardware decrypted */ #define IEEE80211_RX_F_IV_STRIP 0x00000200 /* Decrypted; IV stripped */ -#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; [Micheal] MIC ([M]MIC) stripped */ +#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; Micheal MIC (MMIC) stripped */ #define IEEE80211_RX_F_SHORTGI 0x00000800 /* This is a short-GI frame */ #define IEEE80211_RX_F_CCK 0x00001000 #define IEEE80211_RX_F_OFDM 0x00002000 #define IEEE80211_RX_F_HT 0x00004000 #define IEEE80211_RX_F_VHT 0x00008000 #define IEEE80211_RX_F_PN_VALIDATED 0x00010000 /* Decrypted; PN validated */ +#define IEEE80211_RX_F_MIC_STRIP 0x00020000 /* Decrypted; MIC stripped */ /* Channel width */ #define IEEE80211_RX_FW_20MHZ 1 diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index e1fac3a624e8..daa2e0c1d6ec 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -791,9 +791,9 @@ ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k, * Handle demic / mic errors from hardware-decrypted offload devices. */ if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_DECRYPTED)) { - if (rxs->c_pktflags & IEEE80211_RX_F_FAIL_MIC) { + if ((rxs->c_pktflags & IEEE80211_RX_F_FAIL_MMIC) != 0) { /* - * Hardware has said MIC failed. We don't care about + * Hardware has said MMIC failed. We don't care about * whether it was stripped or not. * * Eventually - teach the demic methods in crypto @@ -804,7 +804,8 @@ ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k, return (0); } - if (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) { + if ((rxs->c_pktflags & + (IEEE80211_RX_F_MIC_STRIP|IEEE80211_RX_F_MMIC_STRIP)) != 0) { /* * Hardware has decrypted and not indicated a * MIC failure and has stripped the MIC. diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 404996b1cbca..87730679c47f 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -295,11 +295,7 @@ finish: m_adj(m, ccmp.ic_header); } - /* - * XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer. - * Well no as it's a MIC not MMIC but we re-use the same flag for now. - */ - if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) == 0) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MIC_STRIP) == 0) m_adj(m, -ccmp.ic_trailer); /* @@ -683,10 +679,9 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen } /* - * If the MIC (we use MMIC despite not being Micheal) was stripped - * by HW/driver we are done. + * If the MIC was stripped by HW/driver we are done. */ - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) != 0) + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MIC_STRIP) != 0) return (1); if (memcmp(mic, a, ccmp.ic_trailer) != 0) { diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index 4cfb7542f8ff..bba413f3eb28 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -394,7 +394,7 @@ tkip_demic(struct ieee80211_key *k, struct mbuf *m, int force) * directly notify as a michael failure to the upper * layers. */ - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_FAIL_MIC)) { + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_FAIL_MMIC)) { struct ieee80211vap *vap = ctx->tc_vap; ieee80211_notify_michael_failure(vap, wh, k->wk_rxkeyix != IEEE80211_KEYIX_NONE ? From nobody Tue Mar 4 16:00:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6gPK2vD7z5qHkV; Tue, 04 Mar 2025 16:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6gPJ58w7z3H42; Tue, 04 Mar 2025 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741104004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMmUSKyKsLy7+G5ISTYgMMShd2aXqCY86fi/oivrqdc=; b=naBXIiGNV/0ikkvlbgxML7CnvTNc8ckdYvFTi+wHkGhCxrl5acBIDrV3FVp/XiKaJBN70S 0IGoJTRL5N8nKhlPCmnor+NtVouZIJ5sgEY3YwQZwFpkDrjfdylByvWBK+tSvdN+XyyODZ R/NUwBiVmQCdjF3j1CD6y3yX4TsFj9noPYJtHM+C6LK8yg1fnnCkGvzMIuDw/qM/zlCXqR bHZZNPb8jsSIHiEdyzp8cuq7d3IOMVV7/wBPXRm0b+F7ncKanBVZ3ssdDbdE4CFEb94OoM D9LTkbg2OljZ+GqCbisabVZYA/6Z8/edZziz42X0IFmC5H4K7Q5+iUrxz9qxSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741104004; a=rsa-sha256; cv=none; b=loWIHjj1NeWFwqywxXCHvDtMQf36lUYptnWK3sSGu4Yzdt+Q1fLcoaRgICCOhdamKw4H/C GtdHBcONicmfVdB+NgTxu9lJ0abSSnSmnPsMG8X5U6OHzo1rF49aRLrYkNDaSA80piHKZT /dZp7phhRJUVemuGfqOXUqQxpPJiHz7O6Gx64AtkQyeUvd5UjQHiqv0r+QNaLo2U+TnSlf Ec6i6L6tckXJKU1EkDxr+MsZZwpzBL6iId24yopg554ugqAm19mTygH+yrku+xwVdKM/ba Lp7oKw4qMCCL4WZRXKfeaayAxUZJBX7I1VRR7NIS4MBXqCLVKBNcIZWXbJg1wA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741104004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMmUSKyKsLy7+G5ISTYgMMShd2aXqCY86fi/oivrqdc=; b=mmfODVwQaOa3F0fNruLil2JHBAuh1yzDfCkd9KAZNmylvk13/tBWER5DlLlKEuKKcrkGzv Lb8FrHk0iKDOtlF5ao4ecLnLnmhxyGEV0MXVyz4LN+J53e+j9uH+aOG4iNDJtEx/s7rApd QydeOFoEyp3anv5KCf7DL4wJTTXQ82YgR9U++MQMxkZdERlMehdt9G7fC7dZdRJlTNfIOn fG9gUroG1h+/FVHepTTLfUcf8gHLUI+dMcxyJ2kcbos5mFE6QbuR41GSP5RjKh1QAYO7IC tOutq/puQgBt9EEE6a8nOFWt0jRwMlPZRDLes0QeoI8cKYnHYiex0SNV5JXK8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6gPJ4mQLz8tQ; Tue, 04 Mar 2025 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 524G04lh073575; Tue, 4 Mar 2025 16:00:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524G04dc073569; Tue, 4 Mar 2025 16:00:04 GMT (envelope-from git) Date: Tue, 4 Mar 2025 16:00:04 GMT Message-Id: <202503041600.524G04dc073569@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: 80b64ef0a10b - main - pf: don't assert on address family in pf_addrcpy() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 80b64ef0a10b87ff2f79d1a6e18ecdf3e3bee1b1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=80b64ef0a10b87ff2f79d1a6e18ecdf3e3bee1b1 commit 80b64ef0a10b87ff2f79d1a6e18ecdf3e3bee1b1 Author: Kristof Provost AuthorDate: 2025-03-04 11:56:08 +0000 Commit: Kristof Provost CommitDate: 2025-03-04 15:59:49 +0000 pf: don't assert on address family in pf_addrcpy() This gets called (through PF_ACPY()) on user supplied input, so we can't assume that the address family must be AF_INET or AF_INET6. Reported-by: syzbot+14dec0c55b8f512e271c@syzkaller.appspotmail.com Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ad6be0c67c2a..349b10c346a7 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -811,8 +811,6 @@ pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) case AF_INET6: memcpy(&dst->v6, &src->v6, sizeof(dst->v6)); break; - default: - unhandled_af(af); } } #endif /* INET6 */ From nobody Tue Mar 4 16:23:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6gwl4D6fz5qKPR; Tue, 04 Mar 2025 16:23:51 +0000 (UTC) (envelope-from jhb@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 4Z6gwl3Z0Lz3S6Q; Tue, 04 Mar 2025 16:23:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741105431; 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=91otFGb4OcAEX1OgzppYTkOQKphw9FXfBRzl/Y5UeGI=; b=S5v/w/PZXAUmWDR7QObjzoG9XkkZiSWgoFM0zKq+GBDKZwIERacreMYr3bVE9Q61eBiNHV RpAvuimzHQ1e6mJUlgqyyVAVeI6lvfWFTU7uK00uFK+kRC9CbMYkDQp7nZXlCG6WdUNXbZ lrLZw4q/S04HRrpYa+VsfvS5PavU2U2GjE/DESSdC1JsjUMKXwiyFIlv8I2EZaeFccPQzS 9a9UoIFdMLaNDP5lABpgzdhzgKqga9jbqtj3CMjtWPsNKnhyh42z/CMZnP2VS/pmUXAhtL zZ+GP7oxcMI2O4R4rt/dnahkVlpHCps9nrKNhuCxspMeXXQ/f1kTPTEfqYvycA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741105431; a=rsa-sha256; cv=none; b=qaL3JaSoUVAeLVx7Dn6x0ARN5TYa6hm87p/JnN8ba59nxGAWFQncZZ9MJF16Nh8QgF/ukQ Q3IWxP3JX4Z06BraJ95XgkoPvR99excRC+ec9NJxIL014s0css2w5c1szDYTTqLjbUqPPD RJJnOeRCZO6SqEfhsmDPwzNkIinUcfCg1BZKps/3p7NQvfJ6f3phW1+fka5kyofbEzTkEu dyi211UyE6Q/kzc8XN1s1k/U1K1LD0nKDR6/fHJUe8tkVOuT6afZlhe1CDUIkuqlAQUl85 ZvlNdeao8WHXYx7pA7xqteza9C201g2ZFq7ivjGN2WRFMzJVhAd8g/TQZMsPKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741105431; 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=91otFGb4OcAEX1OgzppYTkOQKphw9FXfBRzl/Y5UeGI=; b=sicdSCAijyc4BCoAR0FxhK+kvmjdYY5j/mk7mkp1MReRYe5PpmvEsKI54f4bX+BZYRLTKE cKy9xR1OOmXDUoHuTiq8loGGm4lSs5HPsSOMPuQ4UM4+r0o7Qsdg5vghrkfR7IBMQMj5kh np+yMFMlryXjmcCcIA/jIhMWL4YMX/PUKclCvPCvDYY7ihLCkUbd/ersNCSnFb19hrfDts Lzr22YRUeXCJymTs2O/Hg2LJGQw1GaiwsYgohMh8MzInGw8JKuf3vTNZ/N9wsYcmV3Vp7Y vj1/0LN/ZNLul60VsJLoeUBrKZwjpZUW02XJPsNTM/nM9IHeFMkT5QLRnWA/AA== Received: from [IPV6:2601:5c0:4200:b830:540:c3c7:ff75:4b22] (unknown [IPv6:2601:5c0:4200:b830:540:c3c7:ff75:4b22]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z6gwl0G89z19nh; Tue, 04 Mar 2025 16:23:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 4 Mar 2025 11:23:50 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency Content-Language: en-US To: "Bjoern A. Zeeb" , "Herbert J. Skuhra" Cc: Alexander Ziaee , Adrian Chadd , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202502272222.51RMM0fg033513@gitrepo.freebsd.org> <87bjugsx7t.wl-herbert@gojira.at> <95401978-p196-n4n8-4458-98qs07n2162n@SerrOFQ.bet> From: John Baldwin In-Reply-To: <95401978-p196-n4n8-4458-98qs07n2162n@SerrOFQ.bet> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/4/25 09:25, Bjoern A. Zeeb wrote: > On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: > >> On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: >>> >>> The branch main has been updated by ziaee: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 >>> >>> commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 >>> Author: Alexander Ziaee >>> AuthorDate: 2025-02-19 15:54:27 +0000 >>> Commit: Alexander Ziaee >>> CommitDate: 2025-02-27 22:20:22 +0000 >>> >>> wifi manuals: Mlink + document description consistency >>> >>> Interfaces all have an mlink to if_$foo. Add these for the missing ones >>> and remove an incorrect one from rtwn_pci. Wireless network drivers are >>> all accessible via `apropos -s4 "wireless network driver", except two >>> which are "wireless network device". I actually prefer the latter, but >>> make them all consistent upon the more common parlance. Tag SPDX on one >>> of the files I touched, while here. >>> >>> MFC after: 3 days >>> Reviewed by: bz, carlavilla, mhorne >>> Approved by: carlavilla, mhorne (mentors) >>> Differential Revision: https://reviews.freebsd.org/D49063 >>> --- >>> share/man/man4/Makefile | 4 +++- >>> share/man/man4/uath.4 | 4 +++- >>> share/man/man4/upgt.4 | 2 +- >>> 3 files changed, 7 insertions(+), 3 deletions(-) >>> >>> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile >>> index 13afc9b8d399..8e0af19eec3d 100644 >>> --- a/share/man/man4/Makefile >>> +++ b/share/man/man4/Makefile >>> @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 >>> MLINKS+=ral.4 if_ral.4 >>> MLINKS+=re.4 if_re.4 >>> MLINKS+=rl.4 if_rl.4 >>> -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 >>> +MLINKS+=rtw88.4 if_rtw89.4 >>> +MLINKS+=rtw89.4 if_rtw89.4 >>> +MLINKS+=rtwn.4 if_rtwn.4 >> ^^^^^^^^^ >> $ grep if_rtwn.4 ObsoleteFiles.inc >> OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz > > In fact that is probably correct but things are confusing. > > The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those > should have the man page and links (so contrary to what was done). > rtwn.ko is just the common code if I am not mistaken (Adrian should know > better). > > But everyone is just referring to the driver as rtwn and I fear if there > is no man page to be found as man rtwn / man if_rtwn people will be > confused. > > I wanted to do the same with rtw88 but was told to keep it all together > as one so rtwn is an excemption. > > That all said, yes, it needs a further cleanup. The manpages should just be rtwn/if_rtwn. The bus attachment doesn't matter. We don't have separate manpages when a storage adapter has been supported on both PCI and ISA in the past, you just had the ahc(4) driver (for example). USB vs PCI is the same. It should just be a single manpage for the driver regardless of the attachment. If the driver has separate modules that can be documented in the one manpage, but the list of supported chipsets, etc. is presumably shared hence the shared driver name and common code. In particular, the thing a user sees in dmesg is 'rtwn0', not 'rtwn_pci0' so the manpage needs to be tied to what a user sees as a device name in dmesg. -- John Baldwin From nobody Tue Mar 4 16:55:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6hcy0hQkz5qMPZ; Tue, 04 Mar 2025 16:55: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 4Z6hcy081xz3fd6; Tue, 04 Mar 2025 16:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741107314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=joVJDB8M7OUwiQPzFn/WhOUvOLUkxRemNpjK51AAb/k=; b=eYeUZvUGzhWuI3Tn7431gtImabGOaa03tLiJwX6WLzEwkiVLeMnrrcfbg7MQ+im1byM6db KBUVOVRXSn5TRc3uuy2N8c2zLg+AlOmicsPOgiRVL8WxRJQqd+zZynBNyFCSP6pA+U8Lfd gisVoiRlc+FHhK9327GOoMsWtFMsh4me2heg9o/i3hDJTo4+amXVz6OSX/RlxECaopA5vI 1R5bm24YlzYGuyYgVAOK/cCCfv/Cq1U4wb4f/CYbAfuF/VBZSo/joUQWyfaO+9oJVmo9s3 QaeH1bHokeJ7eMqxOYLmhVLtzK/YlGjSshvDeQTmePw+7IZ5BgD7jjA5AWUJrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741107314; a=rsa-sha256; cv=none; b=Y9vsN4g36KUo9dUGSKkI+NCwriI4ptRzv75HyBwziWRZHnhnyJE9+BpsWgroIehhe7nNAW 9OUefPwzub61QBDM9a1v6vSzTAKTOd4/u6cEhF+cqvKG9KlDCwv5rSVE9Qbksmjt1HLZeR vOk8xeAThk60IRAJIdOW6x4VF9qGD2VEwdtzWX66IZoCpTs8YGOFbAayeEPeUAEByKYDiM gDMYAwgB4/EDrz2/jcFlsvhKoZeIsH2dE+Y/HGpbYP0qNwk0pcufNO2KMxnQ/D/4DbpfKq d2JPRrpN8W/BxO4wZDiiy3LVZo7XXF3Mi/BjuecWOe4LgqgDuZ5IR3U63SSOTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741107314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=joVJDB8M7OUwiQPzFn/WhOUvOLUkxRemNpjK51AAb/k=; b=xAlUuuo0oY9/JKGEw6cpuhnNr8rzOBN7llahWax/OkMc04PnH0XDDYj3PYJZOmThVe1X5P u5NbSTGaspGeqiYzzh3N5KesoQhrGweoXVn6KXvCjSzJ/A+T6KRQWfUBhsRe+VKhVDc5u8 jHBtVfeCeC0MP92i/rG7FX6cuvbVSpSXsQzorgXDQo0FnReo1K2YS+aT15R0M6WDFAUZkq BHMFq220ZsjPKKOBWGK5TVAdjMIxVIC9tgS0BiTQKaOyuAXUG2KgVk/uRnBybMrlLXIav6 XoczbY1BPgZoXwewW91BC5axymkTEb18bV99fXSuHTbrH1ky/96Unfhxt6pONQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6hcx6rjfzBBs; Tue, 04 Mar 2025 16:55: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 524GtDq5081169; Tue, 4 Mar 2025 16:55:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524GtDBw081164; Tue, 4 Mar 2025 16:55:13 GMT (envelope-from git) Date: Tue, 4 Mar 2025 16:55:13 GMT Message-Id: <202503041655.524GtDBw081164@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: 70703aa922b4 - main - netinet: allow per protocol random IP id control, single out IPSEC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 70703aa922b41faedfd72211633884bb580ceeac Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=70703aa922b41faedfd72211633884bb580ceeac commit 70703aa922b41faedfd72211633884bb580ceeac Author: acazuc AuthorDate: 2025-03-03 13:21:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-04 16:45:32 +0000 netinet: allow per protocol random IP id control, single out IPSEC A globally enabled random IP id generation maybe useful in most IP contexts, but it may be unnecessary in the case of IPsec encapsulated packets because IPsec can be configured to use anti-replay windows. This commit adds a new net.inet.ipsec.random_id sysctl to control whether or not IPsec packets should use random IP id generation. Rest of the protocols/modules are still controlled by the global net.inet.ip.random_id, but can be easily augmented with a knob. Reviewed by: glebius Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D49164 --- share/man/man4/ipsec.4 | 6 +++++- sys/netinet/ip_carp.c | 4 ++-- sys/netinet/ip_gre.c | 2 +- sys/netinet/ip_id.c | 22 +++++++++++----------- sys/netinet/ip_mroute.c | 2 +- sys/netinet/ip_output.c | 2 +- sys/netinet/ip_var.h | 4 +++- sys/netinet/raw_ip.c | 2 +- sys/netinet/sctp_output.c | 4 ++-- sys/netipsec/ipsec.c | 4 ++++ sys/netipsec/ipsec.h | 3 +++ sys/netipsec/ipsec_output.c | 2 +- sys/netpfil/ipfilter/netinet/fil.c | 2 +- sys/netpfil/ipfilter/netinet/ip_nat.c | 4 ++-- sys/netpfil/ipfw/nat64/nat64_translate.c | 4 ++-- sys/netpfil/pf/if_pfsync.c | 2 +- sys/netpfil/pf/pf.c | 4 ++-- sys/netpfil/pf/pf_norm.c | 2 +- 18 files changed, 44 insertions(+), 31 deletions(-) diff --git a/share/man/man4/ipsec.4 b/share/man/man4/ipsec.4 index 96a10dfb7700..9fd6207c2f14 100644 --- a/share/man/man4/ipsec.4 +++ b/share/man/man4/ipsec.4 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 6, 2017 +.Dd March 4, 2025 .Dt IPSEC 4 .Os .Sh NAME @@ -239,6 +239,7 @@ for tweaking the kernel's IPsec behavior: .It "net.inet.ipsec.debug integer yes" .It "net.inet.ipsec.natt_cksum_policy integer yes" .It "net.inet.ipsec.check_policy_history integer yes" +.It "net.inet.ipsec.random_id integer yes" .It "net.inet6.ipsec6.ecn integer yes" .It "net.inet6.ipsec6.debug integer yes" .El @@ -298,6 +299,9 @@ have been decrypted and authenticated. If this variable is set to a non-zero value, each packet handled by IPsec is checked against the history of IPsec security associations. The IPsec security protocol, mode, and SA addresses must match. +.It Li ipsec.random_id +Enables randomization of encapsulated IPv4 packets ID. +By default, ID randomization is not enabled. .El .Pp Variables under the diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 6fde7bd70c6b..c01d1bdd8cff 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1256,7 +1256,7 @@ carp_send_ad_locked(struct carp_softc *sc) ip->ip_ttl = CARP_DFLTTL; ip->ip_p = IPPROTO_CARP; ip->ip_sum = 0; - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { @@ -1395,7 +1395,7 @@ vrrp_send_ad_locked(struct carp_softc *sc) ip->ip_ttl = CARP_DFLTTL; ip->ip_p = IPPROTO_CARP; ip->ip_sum = 0; - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c index c9356edb0608..01a6ef4cd670 100644 --- a/sys/netinet/ip_gre.c +++ b/sys/netinet/ip_gre.c @@ -534,7 +534,7 @@ in_gre_output(struct mbuf *m, int af, int hlen) #ifdef INET6 case AF_INET6: gi->gi_ip.ip_tos = 0; /* XXX */ - ip_fillid(&gi->gi_ip); + ip_fillid(&gi->gi_ip, V_ip_random_id); break; #endif } diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c index 12dd6c8bf972..738b7eceb448 100644 --- a/sys/netinet/ip_id.c +++ b/sys/netinet/ip_id.c @@ -97,9 +97,9 @@ * user wants to, we can turn on random ID generation. */ VNET_DEFINE_STATIC(int, ip_rfc6864) = 1; -VNET_DEFINE_STATIC(int, ip_do_randomid) = 0; #define V_ip_rfc6864 VNET(ip_rfc6864) -#define V_ip_do_randomid VNET(ip_do_randomid) + +VNET_DEFINE(int, ip_random_id) = 0; /* * Random ID state engine. @@ -126,7 +126,7 @@ VNET_DEFINE_STATIC(struct mtx, ip_id_mtx); VNET_DEFINE_STATIC(counter_u64_t, ip_id); #define V_ip_id VNET(ip_id) -static int sysctl_ip_randomid(SYSCTL_HANDLER_ARGS); +static int sysctl_ip_random_id(SYSCTL_HANDLER_ARGS); static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS); static void ip_initid(int); static uint16_t ip_randomid(void); @@ -136,7 +136,7 @@ static void ipid_sysuninit(void); SYSCTL_DECL(_net_inet_ip); SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id, CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_MPSAFE, - &VNET_NAME(ip_do_randomid), 0, sysctl_ip_randomid, "IU", + &VNET_NAME(ip_random_id), 0, sysctl_ip_random_id, "IU", "Assign random ip_id values"); SYSCTL_INT(_net_inet_ip, OID_AUTO, rfc6864, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_rfc6864), 0, @@ -151,22 +151,22 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_total, CTLFLAG_RD | CTLFLAG_VNET, &VNET_NAME(random_id_total), 0, "Count of IP IDs created"); static int -sysctl_ip_randomid(SYSCTL_HANDLER_ARGS) +sysctl_ip_random_id(SYSCTL_HANDLER_ARGS) { int error, new; - new = V_ip_do_randomid; + new = V_ip_random_id; error = sysctl_handle_int(oidp, &new, 0, req); if (error || req->newptr == NULL) return (error); if (new != 0 && new != 1) return (EINVAL); - if (new == V_ip_do_randomid) + if (new == V_ip_random_id) return (0); - if (new == 1 && V_ip_do_randomid == 0) + if (new == 1 && V_ip_random_id == 0) ip_initid(8192); /* We don't free memory when turning random ID off, due to race. */ - V_ip_do_randomid = new; + V_ip_random_id = new; return (0); } @@ -238,7 +238,7 @@ ip_randomid(void) } void -ip_fillid(struct ip *ip) +ip_fillid(struct ip *ip, bool do_randomid) { /* @@ -249,7 +249,7 @@ ip_fillid(struct ip *ip) */ if (V_ip_rfc6864 && (ip->ip_off & htons(IP_DF)) == htons(IP_DF)) ip->ip_id = 0; - else if (V_ip_do_randomid) + else if (do_randomid) ip->ip_id = ip_randomid(); else { counter_u64_add(V_ip_id, 1); diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index e224d2e6daf5..d30bd42ec578 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -2466,7 +2466,7 @@ pim_register_send_rp(struct ip *ip, struct vif *vifp, struct mbuf *mb_copy, ip_outer->ip_tos = ip->ip_tos; if (ip->ip_off & htons(IP_DF)) ip_outer->ip_off |= htons(IP_DF); - ip_fillid(ip_outer); + ip_fillid(ip_outer, V_ip_random_id); pimhdr = (struct pim_encap_pimhdr *)((caddr_t)ip_outer + sizeof(pim_encap_iphdr)); *pimhdr = pim_encap_pimhdr; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 35aaf85d6a4e..9d72300e8b68 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -368,7 +368,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) { ip->ip_v = IPVERSION; ip->ip_hl = hlen >> 2; - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); } else { /* Header already set, fetch hlen from there */ hlen = ip->ip_hl << 2; diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index 0f2ed8c43e64..18ca5861a40e 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -204,6 +204,7 @@ extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); VNET_DECLARE(int, rsvp_on); VNET_DECLARE(int, drop_redirect); +VNET_DECLARE(int, ip_random_id); #define V_ip_id VNET(ip_id) #define V_ip_defttl VNET(ip_defttl) @@ -216,6 +217,7 @@ VNET_DECLARE(int, drop_redirect); #define V_ip_mrouter VNET(ip_mrouter) #define V_rsvp_on VNET(rsvp_on) #define V_drop_redirect VNET(drop_redirect) +#define V_ip_random_id VNET(ip_random_id) void inp_freemoptions(struct ip_moptions *); int inp_getmoptions(struct inpcb *, struct sockopt *); @@ -235,7 +237,7 @@ struct mbuf * ip_reass(struct mbuf *); void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *, struct mbuf *); -void ip_fillid(struct ip *); +void ip_fillid(struct ip *, bool); int rip_ctloutput(struct socket *, struct sockopt *); int ipip_input(struct mbuf **, int *, int); int rsvp_input(struct mbuf **, int *, int); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 0d677d954f11..7b6104da5402 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -601,7 +601,7 @@ rip_send(struct socket *so, int pruflags, struct mbuf *m, struct sockaddr *nam, * but we got this limitation from the beginning of history. */ if (ip->ip_id == 0) - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); /* * XXX prevent ip_output from overwriting header fields. diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 02ad901259f4..e4bdb4291972 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -4071,7 +4071,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, ip->ip_off = htons(0); } /* FreeBSD has a function for ip_id's */ - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); ip->ip_ttl = inp->ip_inp.inp.inp_ip_ttl; ip->ip_len = htons(packet_length); @@ -11197,7 +11197,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, ip->ip_hl = (sizeof(struct ip) >> 2); ip->ip_tos = 0; ip->ip_off = htons(IP_DF); - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); ip->ip_ttl = MODULE_GLOBAL(ip_defttl); if (port) { ip->ip_p = IPPROTO_UDP; diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c index 8d604a24eeea..6bacc68b7441 100644 --- a/sys/netipsec/ipsec.c +++ b/sys/netipsec/ipsec.c @@ -119,6 +119,7 @@ VNET_DEFINE(int, ip4_ah_trans_deflev) = IPSEC_LEVEL_USE; VNET_DEFINE(int, ip4_ah_net_deflev) = IPSEC_LEVEL_USE; /* ECN ignore(-1)/forbidden(0)/allowed(1) */ VNET_DEFINE(int, ip4_ipsec_ecn) = 0; +VNET_DEFINE(int, ip4_ipsec_random_id) = 0; VNET_DEFINE_STATIC(int, ip4_filtertunnel) = 0; #define V_ip4_filtertunnel VNET(ip4_filtertunnel) @@ -201,6 +202,9 @@ SYSCTL_INT(_net_inet_ipsec, IPSECCTL_MIN_PMTU, min_pmtu, SYSCTL_INT(_net_inet_ipsec, IPSECCTL_ECN, ecn, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_ipsec_ecn), 0, "Explicit Congestion Notification handling."); +SYSCTL_INT(_net_inet_ipsec, IPSECCTL_RANDOM_ID, random_id, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_ipsec_random_id), 0, + "Assign random ip_id values."); SYSCTL_INT(_net_inet_ipsec, OID_AUTO, crypto_support, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(crypto_support), 0, "Crypto driver selection."); diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h index f8c5b10e7bd6..3acb6a4044f1 100644 --- a/sys/netipsec/ipsec.h +++ b/sys/netipsec/ipsec.h @@ -260,6 +260,7 @@ struct ipsecstat { #define IPSECCTL_DEBUG 12 #define IPSECCTL_ESP_RANDPAD 13 #define IPSECCTL_MIN_PMTU 14 +#define IPSECCTL_RANDOM_ID 15 #ifdef _KERNEL #include @@ -293,6 +294,7 @@ VNET_DECLARE(int, ip4_ah_net_deflev); VNET_DECLARE(int, ip4_ipsec_dfbit); VNET_DECLARE(int, ip4_ipsec_min_pmtu); VNET_DECLARE(int, ip4_ipsec_ecn); +VNET_DECLARE(int, ip4_ipsec_random_id); VNET_DECLARE(int, crypto_support); VNET_DECLARE(int, async_crypto); VNET_DECLARE(int, natt_cksum_policy); @@ -310,6 +312,7 @@ VNET_DECLARE(int, natt_cksum_policy); #define V_ip4_ipsec_dfbit VNET(ip4_ipsec_dfbit) #define V_ip4_ipsec_min_pmtu VNET(ip4_ipsec_min_pmtu) #define V_ip4_ipsec_ecn VNET(ip4_ipsec_ecn) +#define V_ip4_ipsec_random_id VNET(ip4_ipsec_random_id) #define V_crypto_support VNET(crypto_support) #define V_async_crypto VNET(async_crypto) #define V_natt_cksum_policy VNET(natt_cksum_policy) diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 8d8a304e7af4..b394ff81d9c6 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -1200,7 +1200,7 @@ ipsec_encap(struct mbuf **mp, struct secasindex *saidx) ip->ip_src = saidx->src.sin.sin_addr; ip->ip_dst = saidx->dst.sin.sin_addr; ip_ecn_ingress(V_ip4_ipsec_ecn, &ip->ip_tos, &itos); - ip_fillid(ip); + ip_fillid(ip, V_ip4_ipsec_random_id); break; #endif /* INET */ #ifdef INET6 diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index c1b49196b712..2a75190a3ec7 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -5952,7 +5952,7 @@ ipf_updateipid(fr_info_t *fin) id = (u_short)sum; ip->ip_id = htons(id); } else { - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); id = ntohs(ip->ip_id); if ((fin->fin_flx & FI_FRAG) != 0) (void) ipf_frag_ipidnew(fin, (u_32_t)id); diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index b8a0e7d2075b..a13c6129a287 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -5117,7 +5117,7 @@ ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) } ip = MTOD(m, ip_t *); - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); s2 = ntohs(ip->ip_id); s1 = ip->ip_len; @@ -5560,7 +5560,7 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) } ip = MTOD(m, ip_t *); - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); sum1 = ntohs(ip->ip_len); ip->ip_len = ntohs(ip->ip_len); ip->ip_len += fin->fin_plen; diff --git a/sys/netpfil/ipfw/nat64/nat64_translate.c b/sys/netpfil/ipfw/nat64/nat64_translate.c index 2924a9b2d19a..393780c969fe 100644 --- a/sys/netpfil/ipfw/nat64/nat64_translate.c +++ b/sys/netpfil/ipfw/nat64/nat64_translate.c @@ -520,7 +520,7 @@ nat64_init_ip4hdr(const struct ip6_hdr *ip6, const struct ip6_frag *frag, ip->ip_ttl -= IPV6_HLIMDEC; ip->ip_sum = 0; ip->ip_p = (proto == IPPROTO_ICMPV6) ? IPPROTO_ICMP: proto; - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); if (frag != NULL) { ip->ip_off = htons(ntohs(frag->ip6f_offlg) >> 3); if (frag->ip6f_offlg & IP6F_MORE_FRAG) @@ -845,7 +845,7 @@ nat64_icmp_reflect(struct mbuf *m, uint8_t type, oip->ip_len = htons(n->m_pkthdr.len); oip->ip_ttl = V_ip_defttl; oip->ip_p = IPPROTO_ICMP; - ip_fillid(oip); + ip_fillid(oip, V_ip_random_id); oip->ip_off = htons(IP_DF); oip->ip_src = ip->ip_dst; oip->ip_dst = ip->ip_src; diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 98a2367b79b0..b2aaf3add25c 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1900,7 +1900,7 @@ pfsync_sendout(int schedswi, int c) len -= sizeof(union inet_template) - sizeof(struct ip); ip->ip_len = htons(len); - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); break; } #endif diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 349b10c346a7..e0b664772544 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3527,7 +3527,7 @@ pf_translate_af(struct pf_pdesc *pd) ip4->ip_hl = hlen >> 2; ip4->ip_tos = pd->tos; ip4->ip_len = htons(hlen + (pd->tot_len - pd->off)); - ip_fillid(ip4); + ip_fillid(ip4, V_ip_random_id); ip4->ip_ttl = pd->ttl; ip4->ip_p = pd->proto; ip4->ip_src = pd->nsaddr.v4; @@ -3630,7 +3630,7 @@ pf_change_icmp_af(struct mbuf *m, int off, struct pf_pdesc *pd, ip4->ip_v = IPVERSION; ip4->ip_hl = sizeof(*ip4) >> 2; ip4->ip_len = htons(sizeof(*ip4) + pd2->tot_len - olen); - ip_fillid(ip4); + ip_fillid(ip4, V_ip_random_id); ip4->ip_off = htons(IP_DF); ip4->ip_ttl = pd2->ttl; if (pd2->proto == IPPROTO_ICMPV6) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 98539be8c6ce..fd72fec62a3b 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2254,7 +2254,7 @@ pf_scrub(struct pf_pdesc *pd) pd->act.flags & PFSTATE_RANDOMID && !(h->ip_off & ~htons(IP_DF))) { uint16_t ip_id = h->ip_id; - ip_fillid(h); + ip_fillid(h, V_ip_random_id); h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0); } #endif From nobody Tue Mar 4 17:07:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6hvQ6Qydz5qNhk for ; Tue, 04 Mar 2025 17:07:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 4Z6hvQ2KtKz3ksP for ; Tue, 04 Mar 2025 17:07:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2f9b9c0088fso3811a91.0 for ; Tue, 04 Mar 2025 09:07:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1741108063; x=1741712863; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wuMJyCuuAm7PLMzJGqvNmSWAwanhtj73QNSH38kTItA=; b=E58JTO+G9HT+TJG7Ezwj4OTmDp67rVTgM7l/D5mXFR9Zn3+WBexk8Bd+N5jajZ9tms fwXmp/bRgAh3VftOH+nYbXmOe2L8FqxHi3je17gMhBkFcSIyFeXJ3HBFbzJLBSNTv7VB ACgMaqpFQThj7JUf3hUx+lc6Ni7iBCtIKGveL9Ni03vsDLj3Yf6YRlza/YKhbOzDFsyg 8uA5S3zKAkc/DGwyZqhgxxw3TNdoLn3yeqbLXzQN9l4+6zDU2z6/cAz28tBx3WYJYovJ gApb6obBfhOa3UeheZieU0PHybeq5+s3n4+nefCIdFY97YGRcT+5BCQp/YWERS9ybQqx 9fQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741108063; x=1741712863; 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=wuMJyCuuAm7PLMzJGqvNmSWAwanhtj73QNSH38kTItA=; b=VWRVdwSwZTekTyElIU96fTBICBUST1yOHqklR47V2MxAx+7wdCw1BK8komQRcyw9m6 mj+M6zqMiHOYmBBVuzCrAd5fB40VCg1B5yiLSsulaBqNDe19PWVK8B8zEQyomTdRQRXQ qKfi5oPDsT9+h4jRVJY6F0vqQ1KoWpZNdfMqJ/UOk5PKU4RBhvm3k9oyiUlSVZfclmsk VPaOcrNFOBMlTmkx+u5d+w5rdEcupXnFt35IRxHHHHbvCozzTftF+NQxoP7e3WG4puVX 4dI+9/8MumkHx8sMqxdFgxrTrwqeFE9j/c7yPmMjaFkuSDHlQGjW5GfZ0Fhf4vVNU+FL 6Q2A== X-Forwarded-Encrypted: i=1; AJvYcCVXgc20Q8laGlIF2abUGJB3hVhhgnt05PyHNrzFD/t3fY/nsaFd/wbZ4JWhITrTSHe4FzQmrc7C6GQ/si2mxBx6MbWY@freebsd.org X-Gm-Message-State: AOJu0Yx73g6b5BkRIHBmzpU8s/EiPKjoWdRzzMlgqSQIDHVU2nGj/Cab oBbK42YJ/9UTY5CHiU3Wdwh69R4Uir6fIDZHNrMdRmICrsLlL8nTpR6hRDEpu7zzKOBtjGLWRQ8 dedegyRaar8PVLLB3ZT2SHBsirfJfjDYNH2CkpADoDOb7AmIeEQo= X-Gm-Gg: ASbGncsEzAD6FfC8IwfijsCzyZHbq667xYYJSE0KTg21B5EPoLkbacXceFWRIgXWtuP VwvjTMDsSvT4Hr7bTs4iCvddU6+ttUJk6A5YVbolyfiiEx2adSaMJdP/LYtq0IfVtPMP34VSI2m brZC0ThQCDXappz+/YcjBee37n X-Google-Smtp-Source: AGHT+IFIExQwPpf8Tlj8YMYc5RUeCRkNoHs9kSpEPHZ+ezB8rXHpccVqhyrxwFnZwGUCFV0jGgNp8lwFf8+OiI8lIiU= X-Received: by 2002:a17:90b:2e44:b0:2ee:8cbb:de28 with SMTP id 98e67ed59e1d1-2ff33b9da35mr7155559a91.8.1741108062967; Tue, 04 Mar 2025 09:07:42 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202502272222.51RMM0fg033513@gitrepo.freebsd.org> <87bjugsx7t.wl-herbert@gojira.at> <95401978-p196-n4n8-4458-98qs07n2162n@SerrOFQ.bet> In-Reply-To: From: Warner Losh Date: Tue, 4 Mar 2025 09:07:32 -0800 X-Gm-Features: AQ5f1Jp8wL43PosVCrEhCC83USLxLGtHU82ORCuS_bnpOoEq6Yzzyt0fInwmHzs Message-ID: Subject: Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency To: John Baldwin Cc: "Bjoern A. Zeeb" , "Herbert J. Skuhra" , Alexander Ziaee , Adrian Chadd , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009bf715062f874f5e" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Z6hvQ2KtKz3ksP X-Spamd-Bar: ---- --0000000000009bf715062f874f5e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 4, 2025 at 8:23=E2=80=AFAM John Baldwin wrote= : > On 3/4/25 09:25, Bjoern A. Zeeb wrote: > > On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: > > > >> On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: > >>> > >>> The branch main has been updated by ziaee: > >>> > >>> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D4262dbc57982383eb61a8b7806de6dd= 4b7802da8 > >>> > >>> commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 > >>> Author: Alexander Ziaee > >>> AuthorDate: 2025-02-19 15:54:27 +0000 > >>> Commit: Alexander Ziaee > >>> CommitDate: 2025-02-27 22:20:22 +0000 > >>> > >>> wifi manuals: Mlink + document description consistency > >>> > >>> Interfaces all have an mlink to if_$foo. Add these for the > missing ones > >>> and remove an incorrect one from rtwn_pci. Wireless network > drivers are > >>> all accessible via `apropos -s4 "wireless network driver", excep= t > two > >>> which are "wireless network device". I actually prefer the > latter, but > >>> make them all consistent upon the more common parlance. Tag SPDX > on one > >>> of the files I touched, while here. > >>> > >>> MFC after: 3 days > >>> Reviewed by: bz, carlavilla, mhorne > >>> Approved by: carlavilla, mhorne (mentors) > >>> Differential Revision: https://reviews.freebsd.org/D49063 > >>> --- > >>> share/man/man4/Makefile | 4 +++- > >>> share/man/man4/uath.4 | 4 +++- > >>> share/man/man4/upgt.4 | 2 +- > >>> 3 files changed, 7 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > >>> index 13afc9b8d399..8e0af19eec3d 100644 > >>> --- a/share/man/man4/Makefile > >>> +++ b/share/man/man4/Makefile > >>> @@ -764,7 +764,9 @@ MLINKS+=3Dptnet.4 if_ptnet.4 > >>> MLINKS+=3Dral.4 if_ral.4 > >>> MLINKS+=3Dre.4 if_re.4 > >>> MLINKS+=3Drl.4 if_rl.4 > >>> -MLINKS+=3Drtwn_pci.4 if_rtwn_pci.4 > >>> +MLINKS+=3Drtw88.4 if_rtw89.4 > >>> +MLINKS+=3Drtw89.4 if_rtw89.4 > >>> +MLINKS+=3Drtwn.4 if_rtwn.4 > >> ^^^^^^^^^ > >> $ grep if_rtwn.4 ObsoleteFiles.inc > >> OLD_FILES+=3Dusr/share/man/man4/if_rtwn.4.gz > > > > In fact that is probably correct but things are confusing. > > > > The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those > > should have the man page and links (so contrary to what was done). > > rtwn.ko is just the common code if I am not mistaken (Adrian should kno= w > > better). > > > > But everyone is just referring to the driver as rtwn and I fear if ther= e > > is no man page to be found as man rtwn / man if_rtwn people will be > > confused. > > > > I wanted to do the same with rtw88 but was told to keep it all together > > as one so rtwn is an excemption. > > > > That all said, yes, it needs a further cleanup. > > The manpages should just be rtwn/if_rtwn. The bus attachment doesn't > matter. > We don't have separate manpages when a storage adapter has been supported > on both PCI and ISA in the past, you just had the ahc(4) driver (for > example). > USB vs PCI is the same. It should just be a single manpage for the drive= r > regardless of the attachment. If the driver has separate modules that ca= n > be documented in the one manpage, but the list of supported chipsets, etc= . > is presumably shared hence the shared driver name and common code. In > particular, the thing a user sees in dmesg is 'rtwn0', not 'rtwn_pci0' so > the manpage needs to be tied to what a user sees as a device name in dmes= g. > Yea, the man page should mention the detail that we have separate .ko's, bu= t otherwise I agree with John here. Warner --0000000000009bf715062f874f5e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Mar 4, = 2025 at 8:23=E2=80=AFAM John Baldwin <jhb@freebsd.org> wrote:
On 3/4/25 09:25, Bjoern A. Zeeb wrote:
> On Tue, 4 Mar 2025, Herbert J. Skuhra wrote:
>
>> On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote:
>>>
>>> The branch main has been updated by ziaee:
>>>
>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D4262dbc57982383eb61a8b7806de6dd4b= 7802da8
>>>
>>> commit 4262dbc57982383eb61a8b7806de6dd4b7802da8
>>> Author:=C2=A0 =C2=A0 =C2=A0Alexander Ziaee <ziaee@FreeBSD.o= rg>
>>> AuthorDate: 2025-02-19 15:54:27 +0000
>>> Commit:=C2=A0 =C2=A0 =C2=A0Alexander Ziaee <ziaee@FreeBSD.o= rg>
>>> CommitDate: 2025-02-27 22:20:22 +0000
>>>
>>>=C2=A0 =C2=A0 =C2=A0 wifi manuals: Mlink + document description= consistency
>>>
>>>=C2=A0 =C2=A0 =C2=A0 Interfaces all have an mlink to if_$foo. A= dd these for the missing ones
>>>=C2=A0 =C2=A0 =C2=A0 and remove an incorrect one from rtwn_pci.= Wireless network drivers are
>>>=C2=A0 =C2=A0 =C2=A0 all accessible via `apropos -s4 "wire= less network driver", except two
>>>=C2=A0 =C2=A0 =C2=A0 which are "wireless network device&qu= ot;. I actually prefer the latter, but
>>>=C2=A0 =C2=A0 =C2=A0 make them all consistent upon the more com= mon parlance. Tag SPDX on one
>>>=C2=A0 =C2=A0 =C2=A0 of the files I touched, while here.
>>>
>>>=C2=A0 =C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 3 days
>>>=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 bz, carlavilla, mhorne
>>>=C2=A0 =C2=A0 =C2=A0 Approved by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 carlavilla, mhorne (mentors)
>>>=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0 http= s://reviews.freebsd.org/D49063
>>> ---
>>>=C2=A0 =C2=A0share/man/man4/Makefile | 4 +++-
>>>=C2=A0 =C2=A0share/man/man4/uath.4=C2=A0 =C2=A0| 4 +++-
>>>=C2=A0 =C2=A0share/man/man4/upgt.4=C2=A0 =C2=A0| 2 +-
>>>=C2=A0 =C2=A03 files changed, 7 insertions(+), 3 deletions(-) >>>
>>> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile=
>>> index 13afc9b8d399..8e0af19eec3d 100644
>>> --- a/share/man/man4/Makefile
>>> +++ b/share/man/man4/Makefile
>>> @@ -764,7 +764,9 @@ MLINKS+=3Dptnet.4 if_ptnet.4
>>>=C2=A0 =C2=A0MLINKS+=3Dral.4 if_ral.4
>>>=C2=A0 =C2=A0MLINKS+=3Dre.4 if_re.4
>>>=C2=A0 =C2=A0MLINKS+=3Drl.4 if_rl.4
>>> -MLINKS+=3Drtwn_pci.4 if_rtwn_pci.4
>>> +MLINKS+=3Drtw88.4 if_rtw89.4
>>> +MLINKS+=3Drtw89.4 if_rtw89.4
>>> +MLINKS+=3Drtwn.4 if_rtwn.4
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0^^^^^^^^^
>> $ grep if_rtwn.4 ObsoleteFiles.inc
>> OLD_FILES+=3Dusr/share/man/man4/if_rtwn.4.gz
>
> In fact that is probably correct but things are confusing.
>
> The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those
> should have the man page and links (so contrary to what was done).
> rtwn.ko is just the common code if I am not mistaken (Adrian should kn= ow
> better).
>
> But everyone is just referring to the driver as rtwn and I fear if the= re
> is no man page to be found as man rtwn / man if_rtwn people will be > confused.
>
> I wanted to do the same with rtw88 but was told to keep it all togethe= r
> as one so rtwn is an excemption.
>
> That all said, yes, it needs a further cleanup.

The manpages should just be rtwn/if_rtwn.=C2=A0 The bus attachment doesn= 9;t matter.
We don't have separate manpages when a storage adapter has been support= ed
on both PCI and ISA in the past, you just had the ahc(4) driver (for exampl= e).
USB vs PCI is the same.=C2=A0 It should just be a single manpage for the dr= iver
regardless of the attachment.=C2=A0 If the driver has separate modules that= can
be documented in the one manpage, but the list of supported chipsets, etc.<= br> is presumably shared hence the shared driver name and common code.=C2=A0 In=
particular, the thing a user sees in dmesg is 'rtwn0', not 'rtw= n_pci0' so
the manpage needs to be tied to what a user sees as a device name in dmesg.=

Yea, the man page should mention the d= etail that we have separate .ko's, but
otherwise I agree with= John here.

Warner=C2=A0
--0000000000009bf715062f874f5e-- From nobody Tue Mar 4 17:10:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6hzC5SnSz5qNlf; Tue, 04 Mar 2025 17:11:03 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Received: from forward500d.mail.yandex.net (forward500d.mail.yandex.net [IPv6:2a02:6b8:c41:1300:1:45:d181:d500]) (using TLSv1.3 with cipher TLS_AES_256_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 4Z6hzC2SvPz3n5n; Tue, 04 Mar 2025 17:11:03 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Authentication-Results: mx1.freebsd.org; none Received: from mail-nwsmtp-mxback-production-main-180.klg.yp-c.yandex.net (mail-nwsmtp-mxback-production-main-180.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:3ca7:0:640:87cd:0]) by forward500d.mail.yandex.net (Yandex) with ESMTPS id B25C461730; Tue, 4 Mar 2025 20:10:59 +0300 (MSK) Received: from mail.yandex.ru (2a02:6b8:c42:fe4c:0:640:1a4:0 [2a02:6b8:c42:fe4c:0:640:1a4:0]) by mail-nwsmtp-mxback-production-main-180.klg.yp-c.yandex.net (mxback/Yandex) with HTTPS id qAn2PF8LwqM0-UWueGmDq; Tue, 04 Mar 2025 20:10:59 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1741108259; bh=q4jAcNOOH/JSe9IF0WPpEwVcC5Yx/LcUB/m51Mu06p0=; h=Message-Id:References:Date:Subject:To:In-Reply-To:From; b=AOl3kGCKBwCiA0XXi+Uikoh0DAL+rpzsaha7fOfHMXxxdmjrllilZAN6vWQLaMgz7 4OwIEWsNerTMhf6WktqEDvxOKh47fl22ncM6Yn5k5oWF7Q4ZfAEnw7JN0U8CXf5XNE QOjN16++D2q0ZFYrn6QZ+tRnqYAq1R0FVMMdCnmM= Received: by mail-sendbernar-production-main-33.klg.yp-c.yandex.net with HTTP; Tue, 04 Mar 2025 20:10:59 +0300 From: Ruslan Makhmatkhanov To: Bjoern A. Zeeb , "src-committers@FreeBSD.org" , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" In-Reply-To: <202503041557.524FvDjv069055@gitrepo.freebsd.org> References: <202503041557.524FvDjv069055@gitrepo.freebsd.org> Subject: Re: git: 394a9a5b1c2a - main - net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 04 Mar 2025 20:10:59 +0300 Message-Id: <735281741108147@mail.yandex.ru> Content-Transfer-Encoding: base64 Content-Type: text/html; charset=utf-8 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:13238, ipnet:2a02:6b8::/32, country:RU] X-Rspamd-Queue-Id: 4Z6hzC2SvPz3n5n X-Spamd-Bar: ---- PGRpdj7CoDwvZGl2PjxkaXY+wqA8L2Rpdj48ZGl2Pi0tLS0tLS0tLS0tLS0tLS08L2Rpdj48ZGl2 PtCa0L7QvNGDOiBzcmMtY29tbWl0dGVyc0BmcmVlYnNkLm9yZyAoc3JjLWNvbW1pdHRlcnNAZnJl ZWJzZC5vcmcpLCBkZXYtY29tbWl0cy1zcmMtYWxsQGZyZWVic2Qub3JnIChkZXYtY29tbWl0cy1z cmMtYWxsQGZyZWVic2Qub3JnKSwgZGV2LWNvbW1pdHMtc3JjLW1haW5AZnJlZWJzZC5vcmcgKGRl di1jb21taXRzLXNyYy1tYWluQGZyZWVic2Qub3JnKTs8L2Rpdj48ZGl2PtCi0LXQvNCwOiBnaXQ6 IDM5NGE5YTViMWMyYSAtIG1haW4gLSBuZXQ4MDIxMTogTGludXhLUEkgODAyLjExOiBjbGVhbiB1 cCBNSUMgdnMuIE1NSUMgcnggZmxhZ3M7PC9kaXY+PGRpdj4wNC4wMy4yMDI1LCAxODo1NywgIkJq b2VybiBBLiBaZWViIiAmbHQ7YnpAZnJlZWJzZC5vcmcmZ3Q7OjwvZGl2PjxkaXY+PGJyIC8+VGhl IGJyYW5jaCBtYWluIGhhcyBiZWVuIHVwZGF0ZWQgYnkgYno6PGJyIC8+PGJyIC8+VVJMOiBodHRw czovL2NnaXQuRnJlZUJTRC5vcmcvc3JjL2NvbW1pdC8/aWQ9Mzk0YTlhNWIxYzJhZDdiNjc5YTAw YzMwODdjNDEzNzhhYmZhNzRhMTxiciAvPjxiciAvPmNvbW1pdCAzOTRhOWE1YjFjMmFkN2I2Nzlh MDBjMzA4N2M0MTM3OGFiZmE3NGExPGJyIC8+QXV0aG9yOiBCam9lcm4gQS4gWmVlYiAmbHQ7YnpA RnJlZUJTRC5vcmcmZ3Q7PGJyIC8+QXV0aG9yRGF0ZTogMjAyNS0wMy0wMyAxMTo0MzowMCArMDAw MDxiciAvPkNvbW1pdDogQmpvZXJuIEEuIFplZWIgJmx0O2J6QEZyZWVCU0Qub3JnJmd0OzxiciAv PkNvbW1pdERhdGU6IDIwMjUtMDMtMDQgMTU6NTY6NDkgKzAwMDA8YnIgLz48YnIgLz7CoMKgwqDC oG5ldDgwMjExOiBMaW51eEtQSSA4MDIuMTE6IGNsZWFuIHVwIE1JQyB2cy4gTU1JQyByeCBmbGFn czxiciAvPsKgwqDCoMKgPGRpdj5bc2tpcHBlZF08L2Rpdj48YnIgLz4tLS0gYS9zeXMvbmV0ODAy MTEvX2llZWU4MDIxMS5oPGJyIC8+KysrIGIvc3lzL25ldDgwMjExL19pZWVlODAyMTEuaDxiciAv PkBAIC01ODUsMTYgKzU4NSwxNyBAQCBzdHJ1Y3QgaWVlZTgwMjExX21pbW9faW5mbyB7PCEtLSAt LT48YnIgLz7CoCNkZWZpbmUgSUVFRTgwMjExX1JYX0ZfQU1QRFUgMHgwMDAwMDAxMCAvKiBUaGlz IGlzIHRoZSBzdGFydCBvZiBhbiBkZWNhcCBBTVBEVSBsaXN0ICovPGJyIC8+wqAjZGVmaW5lIElF RUU4MDIxMV9SWF9GX0FNUERVX01PUkUgMHgwMDAwMDAyMCAvKiBUaGlzIGlzIGFub3RoZXIgZGVj YXAgQU1QRFUgZnJhbWUgaW4gdGhlIGJhdGNoICovPGJyIC8+wqAjZGVmaW5lIElFRUU4MDIxMV9S WF9GX0ZBSUxfRkNTQ1JDIDB4MDAwMDAwNDAgLyogRmFpbGVkIENSQy9GQ1MgKi88YnIgLz4tI2Rl ZmluZSBJRUVFODAyMTFfUlhfRl9GQUlMX01JQyAweDAwMDAwMDgwIC8qIEZhaWxlZCBNSUMgY2hl Y2sgKi88YnIgLz4rI2RlZmluZSBJRUVFODAyMTFfUlhfRl9GQUlMX01NSUMgMHgwMDAwMDA4MCAv KiBGYWlsZWQgTWljaGFlbCBNSUMgKE1NSUMpIGNoZWNrICovPGRpdj48ZGl2PsKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIF5eXl5eXl5ePC9kaXY+PGRpdj5UaGlzIHNwZWxsZWQg TWljaGFlbCwgd2hpbGUgaXQncyBzcGVsbGVkIE1pY2hlYWwgbGF0ZXIuIFdoaWNoIG9uZSBzdXBw b3NlZCB0byBiZSBjb3JyZWN0PzwvZGl2PjwvZGl2PjxkaXY+PGJyIC8+wqAjZGVmaW5lIElFRUU4 MDIxMV9SWF9GX0RFQ1JZUFRFRCAweDAwMDAwMTAwIC8qIEhhcmR3YXJlIGRlY3J5cHRlZCAqLzxi ciAvPsKgI2RlZmluZSBJRUVFODAyMTFfUlhfRl9JVl9TVFJJUCAweDAwMDAwMjAwIC8qIERlY3J5 cHRlZDsgSVYgc3RyaXBwZWQgKi88YnIgLz4tI2RlZmluZSBJRUVFODAyMTFfUlhfRl9NTUlDX1NU UklQIDB4MDAwMDA0MDAgLyogRGVjcnlwdGVkOyBbTWljaGVhbF0gTUlDIChbTV1NSUMpIHN0cmlw cGVkICovPGJyIC8+KyNkZWZpbmUgSUVFRTgwMjExX1JYX0ZfTU1JQ19TVFJJUCAweDAwMDAwNDAw IC8qIERlY3J5cHRlZDsgTWljaGVhbCBNSUMgKE1NSUMpIHN0cmlwcGVkICovPC9kaXY+PGRpdj7C oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoF5eXl5e Xl5ePGJyIC8+wqAjZGVmaW5lIElFRUU4MDIxMV9SWF9GX1NIT1JUR0kgMHgwMDAwMDgwMCAvKiBU aGlzIGlzIGEgc2hvcnQtR0kgZnJhbWUgKi88YnIgLz7CoCNkZWZpbmUgSUVFRTgwMjExX1JYX0Zf Q0NLIDB4MDAwMDEwMDA8YnIgLz7CoCNkZWZpbmUgSUVFRTgwMjExX1JYX0ZfT0ZETSAweDAwMDAy MDAwPGJyIC8+wqA8L2Rpdj48ZGl2Pltza2lwcGVkXTwvZGl2PjxkaXY+wqA8L2Rpdj48ZGl2Pjxk aXY+LS3CoDwvZGl2PjxkaXY+UmVnYXJkcyw8L2Rpdj48ZGl2PlJ1c2xhbjwvZGl2PjwvZGl2Pjxk aXY+wqA8L2Rpdj48L2Rpdj4= From nobody Tue Mar 4 19:56:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6mf019b6z5qcHj; Tue, 04 Mar 2025 19:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6mf00KYcz3tdr; Tue, 04 Mar 2025 19:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741118184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2njkWt1l/9u7eTFWtu/q/ccACZj/4nXyhKCLEvCkcEY=; b=vYFTk5qRWfHvaen66UzsbtT8i28dGPDVZ8N3fuE/jbHawcsmZp01ncD+po1/G8Rm6OiHGg RXltF7jgoL6Ip3HH7089LjQ5p/zxobz0XnhVjuzitNWXH5FqeS3Etq6q+gM8LXd5zl/zWW GJHwfEV78kfHZ44upx/R53bLLQbwQceSb8YdVQH9jCJT6tHxLXhFi4andRbjjeWEb9spQL yJQ+GJZX39Epuxc+ftEzeTT927vxAx//d7RHjpP8yEbnsFDPo7hR+vxPB3wChSwTrd1o3t Inr2zuqf1KpfLe88iSB+ByxEgRT0hNnQvKmncTuaSmZLU8Y9kBy8s9ctHu7tBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741118184; a=rsa-sha256; cv=none; b=IVC8yN0GigHMfUA56c6GM9XafzUREYGbr4mC6D9HsBOOFXEfagsUOZwasnnBGKzAqTdMiY BtPx2n/hu9FbWUe3UFT993tnxDVKtmP9Xg14Q7V4G2fKM55UIpuAs28lQYXzotQ5zSdHkl DRF+Z5IH50OjxOxXy3MD80wReRaCUis9zc/L0rzU3kWiz2oy3rwKClpAMXiirhfQRXnX0i f7qBJ59dPHoXxMPMkzkLCZMVBtAytjJ6txwdp+loxyeWAfaQ6xGYEg2668AoK/H+F7NSUO alB0RP2K0A0yeqxp2sbOBZmHohZQgIJCjU//uoF42Fp5/4b3vQVJpsoJBUMsyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741118184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2njkWt1l/9u7eTFWtu/q/ccACZj/4nXyhKCLEvCkcEY=; b=tIRQvLGiLP+6b/VjCKg1JM84hswvW+QIKtCBRIK6vHUjf36V/i7or/28YXxTCEb8AeBGCW pLc3WCszao63lKyAL7vTHra5/lFDOBRwcXFTZCZ+xVJAgoHgQS+dyj/vAOo2H+octxKcKJ yKOSNkhOSTac6HkP8OEIIf7BETVu1PIv8gSlFSw031QSls3i61AoEkJuOJcRoiFvPQTX3L Lb4lmI2Hw00wkLasglq0JqacqOfyHGwgZTTddeNpbuqxczEdvju3UzVsL0VU7dMOhiNbhB UF7w0Y+EgtBZnRsRKiu2qjXf9Kge24lnjc5P4hEvzex6KKCFLtq1JtROL/UbdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6mdz72tXzYjB; Tue, 04 Mar 2025 19:56: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 524JuNjg017772; Tue, 4 Mar 2025 19:56:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524JuNZU017769; Tue, 4 Mar 2025 19:56:23 GMT (envelope-from git) Date: Tue, 4 Mar 2025 19:56:23 GMT Message-Id: <202503041956.524JuNZU017769@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: 429b03a00ba7 - main - libc: fix _FORTIFY_SOURCE build on aarch64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 429b03a00ba74ae0188cce3f3064cfac023e18c5 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=429b03a00ba74ae0188cce3f3064cfac023e18c5 commit 429b03a00ba74ae0188cce3f3064cfac023e18c5 Author: Kyle Evans AuthorDate: 2025-03-04 19:53:34 +0000 Commit: Kyle Evans CommitDate: 2025-03-04 19:53:34 +0000 libc: fix _FORTIFY_SOURCE build on aarch64 As with their amd64 counterparts, we need to undef these string funcs that _FORTIFY_SOURCE will have defined macros for to avoid breaking the build. Fixes: bea89d038ac ("lib/libc/aarch64/string: add strlcat SIMD [...]") Fixes: 3dc5429158c ("lib/libc/aarch64/string: add strncat SIMD [...]") --- lib/libc/aarch64/string/strlcat.c | 2 ++ lib/libc/aarch64/string/strncat.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/libc/aarch64/string/strlcat.c b/lib/libc/aarch64/string/strlcat.c index c3c996163ade..fe2e75d091c5 100644 --- a/lib/libc/aarch64/string/strlcat.c +++ b/lib/libc/aarch64/string/strlcat.c @@ -8,6 +8,8 @@ #include +#undef strlcat /* _FORTIFY_SOURCE */ + void *__memchr_aarch64(const void *, int, size_t); size_t __strlcpy(char *restrict, const char *restrict, size_t); diff --git a/lib/libc/aarch64/string/strncat.c b/lib/libc/aarch64/string/strncat.c index 33b278ac5e04..2c63ab50b3c3 100644 --- a/lib/libc/aarch64/string/strncat.c +++ b/lib/libc/aarch64/string/strncat.c @@ -8,6 +8,8 @@ #include +#undef strncat /* _FORTIFY_SOURCE */ + void *__memccpy(void *restrict, const void *restrict, int, size_t); char * From nobody Tue Mar 4 19:57:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6mgf3ND2z5qchr; Tue, 04 Mar 2025 19:57: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 4Z6mgf2l4Sz3vwF; Tue, 04 Mar 2025 19:57:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741118270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Er28Z1+IDYwLp/yMvsLlJuJZS5/GLJRTa5FXTqFyjUA=; b=xwJZtMlapUxZWP+n/G3CkmHak+fVGal/w5M833SsT3+Zl72J7AoCZ6A2fsGFOeTPyiw6bu KGXKug03f9wAMQy+6n/Wj1R+C1owT7OeHDHboTkBCS5oW3VN5qS8HvgPPxkHpZ+0f2GZLU IcCkDHb14xU4hpoVos5Eq4pqstQdzI27homd0ffi23FqQsnFMqCs/XiPsiGP5NPr9KeN0U ZxM7/BnN8JJMJvJHSYClMUGpCSFSlZWFRa2opfUM9jlt11QCwCizLgPtSGuUWB6+DdUlQH LRmj+JkMjSGH19iWsWRtsCo7FanhCYeFp/yrBynwpG0adsyx7+y1HK3r8hDedw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741118270; a=rsa-sha256; cv=none; b=OtFrCLPoYPdyIczb7WdPafX5m4dUeW2WtlPmXKOOQJ9erLRd6eSU3W7fRw+rrjps3+Nkwz Gclis1iRSvDtCaebwQwhH8dPJdFv/Fzg3OFG4UhF7CKXTOMmgNdyWdrrm4/G65rO0eeLQn 0RzNwzdmIkgN2+bBam1KB43zUiyDqUi2mmM2AivfCLd51Zko3SAstFSSWCl1dmOdzB0/AH UfFzADBhlpumek+8JLZ9ucFcqMgAKAucspV5B+SKqS5JRaS27tWDhPXGaBIKAVn4A8o3kf Uwy/bPvB+g4hqY/ILpNRWRXyLvorskCTk0OoFcAS/d14VToKh9n2DmwZsdEFtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741118270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Er28Z1+IDYwLp/yMvsLlJuJZS5/GLJRTa5FXTqFyjUA=; b=SdYD1/7yfGeh/HuEXk6C2cmAzCECx25gqpphW/qzvvWf/X2OGOyq3URrbPHNyk+u4wCIlh dMTuDTnx7np8OdXN8pPyAItSaeiAE0aIJnxWOwSRgygbUuKJP949WdAQmrR+vH8qhcKe/J r3MToO5Hn3BtWJ63YB+gXQ00p5gR7rf5QDMmFotK4CG/Resk72TM5me83YfJY9yxCulqqC G68dcqbw457adoIKrWdCJ0GS8uwjHR0m9N6evPHliFcCb8GI5JE0lJcyaq1ZuLiSWdZVjL EODz8Uu5CDE2z+gxveenlIDrYGas3LQmWHDrrH5j7WmXS/HiAPjJWhbma6ybUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6mgf2FH6zYrk; Tue, 04 Mar 2025 19:57: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 524JvoZD018300; Tue, 4 Mar 2025 19:57:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Jvouj018297; Tue, 4 Mar 2025 19:57:50 GMT (envelope-from git) Date: Tue, 4 Mar 2025 19:57:50 GMT Message-Id: <202503041957.524Jvouj018297@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: 2bef0d54f74d - main - kern: wg: remove overly-restrictive address family check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bef0d54f74dad6962ef7d1dfa407e95cb4fb4ad Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2bef0d54f74dad6962ef7d1dfa407e95cb4fb4ad commit 2bef0d54f74dad6962ef7d1dfa407e95cb4fb4ad Author: Kyle Evans AuthorDate: 2025-03-04 19:57:34 +0000 Commit: Kyle Evans CommitDate: 2025-03-04 19:57:34 +0000 kern: wg: remove overly-restrictive address family check IPv4 packets can be routed via an IPv6 nexthop, so the handling of the parsed address family is more strict than it needs to be. If we have a valid header that matches a known peer, then we have no reason to decline the packet. Convert it to an assertion that it matches the destination as viewed by the stack below it, instead. `dst` may be the gateway instead of the destination in the case of a nexthop, so the `af` assignment must be switched to use the destination in all cases. Add a test case that approximates a setup like in the PR and demonstrates the issue. PR: 284857 Reviewed by: markj (earlier version), zlei Differential Revision: https://reviews.freebsd.org/D49172 --- sys/dev/wg/if_wg.c | 8 ++--- tests/sys/net/if_wg.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 5 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 6683d0505b26..83e5d9e5ceb3 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2335,7 +2335,7 @@ wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) memcpy(&af, dst->sa_data, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); if (af == AF_UNSPEC) { xmit_err(ifp, m, NULL, af); return (EAFNOSUPPORT); @@ -2360,10 +2360,8 @@ wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro xmit_err(ifp, m, NULL, AF_UNSPEC); return (ret); } - if (parsed_af != af) { - xmit_err(ifp, m, NULL, AF_UNSPEC); - return (EAFNOSUPPORT); - } + + MPASS(parsed_af == af); mtu = (ro != NULL && ro->ro_mtu > 0) ? ro->ro_mtu : if_getmtu(ifp); return (wg_xmit(ifp, m, parsed_af, mtu)); } diff --git a/tests/sys/net/if_wg.sh b/tests/sys/net/if_wg.sh index b43b40f25018..e5df6afface1 100644 --- a/tests/sys/net/if_wg.sh +++ b/tests/sys/net/if_wg.sh @@ -92,6 +92,84 @@ wg_basic_cleanup() vnet_cleanup } +atf_test_case "wg_basic_crossaf" "cleanup" +wg_basic_crossaf_head() +{ + atf_set descr 'Create a wg(4) tunnel and pass IPv4 traffic over an IPv6 nexthop' + atf_set require.user root +} + +wg_basic_crossaf_body() +{ + local epair pri1 pri2 pub1 pub2 wg1 wg2 + local endpoint1 endpoint2 tunnel1 tunnel2 + local testnet testlocal testremote + + kldload -n if_wg || atf_skip "This test requires if_wg and could not load it" + + pri1=$(wg genkey) + pri2=$(wg genkey) + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + tunnel1=2001:db8:1::1 + tunnel2=2001:db8:1::2 + + testnet=192.168.3.0/24 + testlocal=192.168.3.1 + testremote=192.168.3.2 + + epair=$(vnet_mkepair) + + vnet_init + + vnet_mkjail wgtest1 ${epair}a + vnet_mkjail wgtest2 ${epair}b + + jexec wgtest1 ifconfig ${epair}a ${endpoint1}/24 up + jexec wgtest2 ifconfig ${epair}b ${endpoint2}/24 up + + wg1=$(jexec wgtest1 ifconfig wg create) + echo "$pri1" | jexec wgtest1 wg set $wg1 listen-port 12345 \ + private-key /dev/stdin + pub1=$(jexec wgtest1 wg show $wg1 public-key) + wg2=$(jexec wgtest2 ifconfig wg create) + echo "$pri2" | jexec wgtest2 wg set $wg2 listen-port 12345 \ + private-key /dev/stdin + pub2=$(jexec wgtest2 wg show $wg2 public-key) + + atf_check -s exit:0 -o ignore \ + jexec wgtest1 wg set $wg1 peer "$pub2" \ + endpoint ${endpoint2}:12345 allowed-ips ${tunnel2}/128,${testnet} + atf_check -s exit:0 \ + jexec wgtest1 ifconfig $wg1 inet6 ${tunnel1}/64 up + + atf_check -s exit:0 -o ignore \ + jexec wgtest2 wg set $wg2 peer "$pub1" \ + endpoint ${endpoint1}:12345 allowed-ips ${tunnel1}/128,${testnet} + atf_check -s exit:0 \ + jexec wgtest2 ifconfig $wg2 inet6 ${tunnel2}/64 up + + atf_check -s exit:0 jexec wgtest1 ifconfig $wg1 inet ${testlocal}/32 + atf_check -s exit:0 jexec wgtest2 ifconfig $wg2 inet ${testremote}/32 + + # Generous timeout since the handshake takes some time. + atf_check -s exit:0 -o ignore jexec wgtest1 ping -c 1 -t 5 "$tunnel2" + + # Setup our IPv6 endpoint and routing + atf_check -s exit:0 -o ignore \ + jexec wgtest1 route add -inet ${testnet} -inet6 "$tunnel2" + atf_check -s exit:0 -o ignore \ + jexec wgtest2 route add -inet ${testnet} -inet6 "$tunnel1" + # Now ping an address on the other side + atf_check -s exit:0 -o ignore jexec wgtest1 ping -c 1 -t 3 ${testremote} +} + +wg_basic_crossaf_cleanup() +{ + vnet_cleanup +} + atf_test_case "wg_basic_netmap" "cleanup" wg_basic_netmap_head() { @@ -349,6 +427,7 @@ wg_vnet_parent_routing_cleanup() atf_init_test_cases() { atf_add_test_case "wg_basic" + atf_add_test_case "wg_basic_crossaf" atf_add_test_case "wg_basic_netmap" atf_add_test_case "wg_key_peerdev_shared" atf_add_test_case "wg_key_peerdev_makeshared" From nobody Tue Mar 4 20:39:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6nbt6jb6z5qgRG; Tue, 04 Mar 2025 20:39: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 4Z6nbt5pFXz3R58; Tue, 04 Mar 2025 20:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741120778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rvgUDn3j0bsX+17rsebOHsdRMQFzVjpkgnRGUTU7bOU=; b=kSnNwFoFPIun9/BWwVzadek6IhlP0vXuwYUewfSjx/pK/vqR4ENB1MNOX7pnJyi/q/7PL9 NWf+fQxbY+PGEQgYgptiH5uZrGfKeRnC3jotfj+LhobKfGnhzGL1Yxx11JNOe2epjg3yLb y/oYJgn2d38o8dp9yN+2XksNpXIWXiD7+4SzhyfmZDWRSgwN8yzlDdkIGFQsEqn5RI+DuT lu7g4TjouMIiAkpJ3tbK+mbfKl4yhBXbF1pv3X3TvDk2uXm5Wrfy9CYVVx5kNFeExw3SMJ jA0Xro0P/m5vZQ16570reoBZ9uPJyjLDY/yFJrxQ4Y6CzjtcFURxOBCJvpBHkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741120778; a=rsa-sha256; cv=none; b=D0JOPT35XxkkiQ/DW24rD5Hlk28sw7eQVYE1Hnu+fvRMVYLlzWQgfgI9Ri4Vh2DlZhHt/7 w5rcBQuTrwbgwezCePtrT3ouOJicHMJalGVG4sr36rqOkLhQBFuySD+ikWsojctSxMlwYf aE3ax4ISGTj0jD2wsWQb2yLl0j4RUtJhDTBRExAj+86/ucVnIQjCRdDLuTm/8IOFau6XPF Z4zvk9OX7neqbJnQmFCV9FCDwYPJonKD/J+xM18Q198cKuxKr7JyNSibfuGCdwPjgW1DPR oqJQZQI2wEwiS9FitzyvLqtzK6+EIOm437v9H7c0HjzKK+CwnW18pDgANe0jGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741120778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rvgUDn3j0bsX+17rsebOHsdRMQFzVjpkgnRGUTU7bOU=; b=sIxlzP+bIsdUHjUt5S8PBuvHTbrBGaWumHMrsnTOlIlwfKpbaCx0atLx8iEKkMlALmQqWB wmvDyhQlw9bn6dwVrK/Ixn0271ntfRza1+Ojfh7l2gbf/cMYD1kRaClOqk06t0GCN9AlNi duCijFyGXuvgYIVCQ8LRyKH2z/w74gLrxPTLUNrorfJuBcLoype+bILyEfUV7hm1XiL+Gz N7xVpRjXBmSEyoA8iVm67/NzXtpfxNDbMnQ3xmUkyh8K9D7aLfSr6ovlk+jsWK7DMrXphT TVZtkYuGrOJtzLrwW9vSm/5wcLoFCUgdnwTQ+/73lVQBVTKb5iwrBMqF5RLdiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6nbt5LcJzZf7; Tue, 04 Mar 2025 20:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 524KdcMB093572; Tue, 4 Mar 2025 20:39:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Kdcu3093569; Tue, 4 Mar 2025 20:39:38 GMT (envelope-from git) Date: Tue, 4 Mar 2025 20:39:38 GMT Message-Id: <202503042039.524Kdcu3093569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 278a726eec5a - main - ipf: Correct ippool.5 man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 278a726eec5a49284df1f54a586be0fe0ce2e0cf Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=278a726eec5a49284df1f54a586be0fe0ce2e0cf commit 278a726eec5a49284df1f54a586be0fe0ce2e0cf Author: Cy Schubert AuthorDate: 2025-03-04 20:37:20 +0000 Commit: Cy Schubert CommitDate: 2025-03-04 20:39:07 +0000 ipf: Correct ippool.5 man page The file URL must be enclosed in quotes. MFC after: 3 days --- sbin/ipf/ippool/ippool.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ipf/ippool/ippool.5 b/sbin/ipf/ippool/ippool.5 index d631de355a0e..b45675bea069 100644 --- a/sbin/ipf/ippool/ippool.5 +++ b/sbin/ipf/ippool/ippool.5 @@ -121,7 +121,7 @@ addresses from. To do this simply use a "file://" URL where you would specify an actual IP address. .PP .nf -pool ipf/tree (name rfc1918;) { file:///etc/ipf/rfc1918; }; +pool ipf/tree (name rfc1918;) { "file:///etc/ipf/rfc1918;" }; .fi .PP The contents of the file might look something like this: From nobody Tue Mar 4 20:51:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6nsk44r1z5qhBL; Tue, 04 Mar 2025 20:51: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 4Z6nsk241cz3cpZ; Tue, 04 Mar 2025 20:51:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741121498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yL1W5PdkPipn0bwnj/1Weyn7QIi65v1e1iXids91eRQ=; b=bmdSwvdGTYwQZFcSxLH4xVa18z9gzmJtStdbFKlMsp1fAJ2Zn7W9CcfJGTOuIzOmayLJjE ehT+NoUJBQm5DW70jFRyOjte0J5jpGiFojI+C87O1ruOyqTbpNIcndhDs3WgkDLThZlqHz uQrjwwZ4myEauDVCf1VFnM2XLdRnoLDowNRjKXMw9yZ0UWh3yXDRFg6eZhcXfY7nBhp2Cb 4of4a2Kp2hIFAe41mY4TtI3eMKQLFGhFwR4+ht+qkto/5tTCVQ0J2bBrRwkNAp5Y/kxaE2 boZO11SkLQpGiapXcUoCLLiwolx5pJWhHAMWT72zXPagdRslKnznF10IbsAfgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741121498; a=rsa-sha256; cv=none; b=f1BVcwpXTsX45/j161APheN2bXMz8H9R4juc5S8KY+Hbz86zkFMyKVDsLcaoFWfO2f04Eh iWnm6SG3fzKrmCkHHTkls7deAAQykYbJDG35G/9b3Gcbcgc/s98pjn+hQ+AOvx0ek0k75o Kesc6vdLvA8gukOSd14RyD2/sGMuuQS57fJZT5J4QfkByuQwTblJxVGOLZW4wOOE/WR4z8 T0cq2sb2LIo4ytoqW5V1JpwYKhl3LgkrqLFO9auxpHnbNw2NuMhUNBfZ03h0GuMnsxnwA/ KARLqCJ8+iYbCZSIgjYh5pkqGtKTEFicJNhvxbu99/Nvvd8DfENFdynndu9hkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741121498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yL1W5PdkPipn0bwnj/1Weyn7QIi65v1e1iXids91eRQ=; b=INCH+egj76DCL+MleBmzwk4OxgEWeW4kcCyBl/+pELRkcPOh2bboQkwyB8mAnJA4lB4cAT 2BpOHebEfZs0NJo2UQpv0DJW4lAQzu8eqIpIgBw/EUqhcu/soo6NxaPEctzMHfkMpiwwWb l5mwc4tYAIGNFTcWio+e30nl6h8BuqQGS7XlI83NA2aaiv1x2c9q+zVz1IZ5Eo67fyfPju QrTq4MNJTjZQm3UZe8iTNnx5E8p05nFqnfofoYjy3hKRDq8eZG5S0KEmUD4I/4+aBMLpI4 XRnNQa9j61ykfhXVC4co+RDdHeiwU+2YUShOBJYfT/g2KZlgHzGn6C7lz6I+0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6nsk1dvWzZqZ; Tue, 04 Mar 2025 20:51: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 524Kpcoe025683; Tue, 4 Mar 2025 20:51:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524KpcoG025676; Tue, 4 Mar 2025 20:51:38 GMT (envelope-from git) Date: Tue, 4 Mar 2025 20:51:38 GMT Message-Id: <202503042051.524KpcoG025676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: e62ff34a6761 - main - sys.mk: Improve ports compatibility hack guard List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e62ff34a6761025203b77ffb241c926ac8d218c8 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e62ff34a6761025203b77ffb241c926ac8d218c8 commit e62ff34a6761025203b77ffb241c926ac8d218c8 Author: Brooks Davis AuthorDate: 2025-03-04 20:50:32 +0000 Commit: Brooks Davis CommitDate: 2025-03-04 20:51:10 +0000 sys.mk: Improve ports compatibility hack guard Back in 9ca543438039 and include of bsd.cpu.mk in sys.mk was added as a hack for ports Makefiles. This works fine in general (for values of fine that include not being able to use MK_ variables in bsd.cpu.mk), but has surprising effects on MacOS with a case insensitive filesystems. There we build things in paths like share/docs/IPv6 where ../../Mk/bsd.port.mk matches share/mk/bsd.port.mk. Fix this issue by checking for ../../Mk/Uses which seems highly unlikely to match something in share/mk. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D49232 --- share/mk/sys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 44db9266784f..26f31c104088 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -321,7 +321,7 @@ __MAKE_SHELL?=/bin/sh # the ports files are modernized, and a reasonable transition # period has passed, include it while we're in a ports tree here # to preserve historic behavior. -.if exists(${.CURDIR}/../../Mk/bsd.port.mk) +.if exists(${.CURDIR}/../../Mk/Uses) .include .endif From nobody Tue Mar 4 20:58:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6p293sQpz5qhgT; Tue, 04 Mar 2025 20:58:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6p293H5Fz3k6C; Tue, 04 Mar 2025 20:58:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741121937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJ719O/nZuqam/ImAtuD8BzGIQs5Ac5yPuL1G9IQZJ8=; b=VZfBK6Qagbs7eoN5zBfHAcPrgrPr8sk7U/lyZxA6dtwQb6n54RGM0c2tYNfkB0M9VKc9Ow J9K8iLRHeSc06X5Q8+GkChJst6fFNB57CmmqbWLqaNU3y4jjQWuRsv+B9QcLwkE0aLbG66 ndNzLXdbEFgNYqCHA2+3Vak0t+hQ8pPWVI00Fa6TmUFiZCc3HEBtdK2sDUsLixA06eGH/1 jYDtgq7bZpuSdRPoYWAwXJngiF3XTLHFqLm+qlZGKEz0BaT9nBs5Vz0BmgfEhuGQhrxLhB /1H1RCR4HMqaQARsRpL3Vak/DI4qSdLEIjAns5zL+LKk/qf5ec86KIu1VAc+QQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741121937; a=rsa-sha256; cv=none; b=w6M+3GUp1qYIMktaq1S0/ZprK/xq9y8oe1FBGu7OxROvdrZtmLmq46GAmL3UDC30fZU33Z XX1n4N4kM7YXiNLeMlJC1k/LELWLopLZdbto192m5lgNqjVJwJFRPVbt0XAkhwo2vlXbfi R9ZuPD9HNJ5u8SFEsRYwKoE1uhCKG0N9ATz2dbLijP7CfJTGsOwvbrEFbMicAj0Ki/nAil FSHbG7m8q+6jpoFNyZhe56q1pKRCabgA9G6QgIo8HgTVhfAPo8zE0ExmTo+ew6Aya0mlTZ bPoO/LUH0VgWuOcWeW8v1LGM7WRSC9HeoFzxiMP5qvqDhzt3Kd+B7T6xVVyzlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741121937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJ719O/nZuqam/ImAtuD8BzGIQs5Ac5yPuL1G9IQZJ8=; b=D4ckAcR+kat4bRAwC0cwLgN4Y+ubKEHBm7kTW8YZgz7R7Mq0Y3PMfN0++eYWiOSjRE2r3V 8ubQRyEk7CszHxHInMg3xqmIPohePHz+FpEFS+dnNmdqs4UjNB8fYsFNb/+hF7AvaR6ril 1ojMhYPnMPejSYoEOsivvxnFL3NbAaxh+j8HW4x2KNFZZ7FtKFCAmOdVFlnhfWEy5w3GiG j8LenmL9TSLIE1Q2749vhEny0ECAWV4elpkCg22HT2oHDhr83Bymh1C4fUoA9qycsdFnrI eGknlkO6iIxtgT4MbOhjk5sAlXdJjWhd4uw2MAuGpmDwWUTpiarUIac9SJgFwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6p292PWCzbHW; Tue, 04 Mar 2025 20:58: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 524Kwv8m030060; Tue, 4 Mar 2025 20:58:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524KwvZk030057; Tue, 4 Mar 2025 20:58:57 GMT (envelope-from git) Date: Tue, 4 Mar 2025 20:58:57 GMT Message-Id: <202503042058.524KwvZk030057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e4bcef6daba7 - stable/14 - makefs: Make cd9660 Rock Ridge inodes reproducible List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e4bcef6daba71546570c623e6091fdef982a596b Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e4bcef6daba71546570c623e6091fdef982a596b commit e4bcef6daba71546570c623e6091fdef982a596b Author: Ed Maste AuthorDate: 2025-02-26 16:44:12 +0000 Commit: Ed Maste CommitDate: 2025-03-04 20:57:26 +0000 makefs: Make cd9660 Rock Ridge inodes reproducible Rock Ridge extensions include an inode field: "POSIX File Serial Number" shall have the same meaning as and may be used for the st_ino field of POSIX:5.6.1. This field shall be recorded according to ISO 9660:7.3.3. Directory Records which share the value of this field are defined as links (see POSIX:2.2.2.17) and, by definition, point to the same file or directory. Previously we'd store the source file's st_ino (except that in metalog mode we'd record 0 for files with nlink = 1). This had two issues: the generated ISO image was nonreproducible due to the arbitrary inode numbers, and files without hard links would falsely be detected (by certain tools) as hard links to each other. Note that the kernel's cd9660(5) file system ignores the Rock Ridge PX File Serial Number, so this issue isn't observed by mounting such a file system. Instead of using the source inode directly, assign target inode numbers sequentially. Use a map so that files with the same source inode (hard links) still receive the same target inode number. PR: 284795 PR: 285027 Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49141 (cherry picked from commit 518cdd344ec51584478f39b9a9cac77fc0766ce1) (cherry picked from commit 337f5e7a44c4d5ac29e0b0c0fe957bb3b9bae222) (cherry picked from commit a18be39aafc1b55fd67603ee6a6d820d0fcd877f) --- usr.sbin/makefs/cd9660.h | 13 +++++++ usr.sbin/makefs/cd9660/iso9660_rrip.c | 73 ++++++++++++++++++++++++++++++----- usr.sbin/makefs/cd9660/iso9660_rrip.h | 2 +- 3 files changed, 78 insertions(+), 10 deletions(-) diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index 2892d6d206c2..1ff37f9fa433 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -51,6 +51,7 @@ #include #include #include +#include #include "makefs.h" #include "iso.h" @@ -203,6 +204,12 @@ typedef struct _volume_descriptor struct _volume_descriptor *next; } volume_descriptor; +struct inode_map_node { + RB_ENTRY(inode_map_node) entry; + uint64_t key; + uint64_t value; +}; + typedef struct _iso9660_disk { int sectorSize; struct iso_primary_descriptor primaryDescriptor; @@ -249,7 +256,11 @@ typedef struct _iso9660_disk { unsigned rock_ridge_move_count; cd9660node *rr_moved_dir; + uint64_t rr_inode_next; + RB_HEAD(inode_map_tree, inode_map_node) rr_inode_map; + int archimedes_enabled; + int chrp_boot; /* Spec breaking options */ @@ -276,6 +287,8 @@ typedef struct _iso9660_disk { } iso9660_disk; +RB_PROTOTYPE(inode_map_tree, inode_map_node, entry, inode_map_node_cmp); + /************ FUNCTIONS **************/ int cd9660_valid_a_chars(const char *); int cd9660_valid_d_chars(const char *); diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c index a4ce5c09b24b..31c6e38a96fe 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.c +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -47,7 +47,7 @@ #include "iso9660_rrip.h" #include -static void cd9660_rrip_initialize_inode(cd9660node *); +static void cd9660_rrip_initialize_inode(iso9660_disk *, cd9660node *); static int cd9660_susp_handle_continuation(iso9660_disk *, cd9660node *); static int cd9660_susp_handle_continuation_common(iso9660_disk *, cd9660node *, int); @@ -70,6 +70,11 @@ cd9660_susp_initialize(iso9660_disk *diskStructure, cd9660node *node, if (node->dot_dot_record != 0) TAILQ_INIT(&(node->dot_dot_record->head)); + if (diskStructure->rr_inode_next == 0) { + RB_INIT(&diskStructure->rr_inode_map); + diskStructure->rr_inode_next = 1; + } + /* SUSP specific entries here */ if ((r = cd9660_susp_initialize_node(diskStructure, node)) < 0) return r; @@ -101,6 +106,7 @@ int cd9660_susp_finalize(iso9660_disk *diskStructure, cd9660node *node) { cd9660node *temp; + struct inode_map_node *mapnode, *mapnodetmp; int r; assert(node != NULL); @@ -117,6 +123,16 @@ cd9660_susp_finalize(iso9660_disk *diskStructure, cd9660node *node) if ((r = cd9660_susp_finalize(diskStructure, temp)) < 0) return r; } + + if (diskStructure->rr_inode_next != 0) { + RB_FOREACH_SAFE(mapnode, inode_map_tree, + &(diskStructure->rr_inode_map), mapnodetmp) { + RB_REMOVE(inode_map_tree, + &(diskStructure->rr_inode_map), mapnode); + free(mapnode); + } + diskStructure->rr_inode_next = 0; + } return 1; } @@ -323,7 +339,7 @@ cd9660_susp_initialize_node(iso9660_disk *diskStructure, cd9660node *node) } static void -cd9660_rrip_initialize_inode(cd9660node *node) +cd9660_rrip_initialize_inode(iso9660_disk *diskStructure, cd9660node *node) { struct ISO_SUSP_ATTRIBUTES *attr; @@ -337,7 +353,7 @@ cd9660_rrip_initialize_inode(cd9660node *node) /* PX - POSIX attributes */ attr = cd9660node_susp_create_node(SUSP_TYPE_RRIP, SUSP_ENTRY_RRIP_PX, "PX", SUSP_LOC_ENTRY); - cd9660node_rrip_px(attr, node->node); + cd9660node_rrip_px(diskStructure, attr, node->node); TAILQ_INSERT_TAIL(&node->head, attr, rr_ll); @@ -390,7 +406,8 @@ cd9660_rrip_initialize_node(iso9660_disk *diskStructure, cd9660node *node, /* PX - POSIX attributes */ current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, SUSP_ENTRY_RRIP_PX, "PX", SUSP_LOC_ENTRY); - cd9660node_rrip_px(current, parent->node); + cd9660node_rrip_px(diskStructure, current, + parent->node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); /* TF - timestamp */ @@ -405,7 +422,8 @@ cd9660_rrip_initialize_node(iso9660_disk *diskStructure, cd9660node *node, /* PX - POSIX attributes */ current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, SUSP_ENTRY_RRIP_PX, "PX", SUSP_LOC_ENTRY); - cd9660node_rrip_px(current, grandparent->node); + cd9660node_rrip_px(diskStructure, current, + grandparent->node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); /* TF - timestamp */ @@ -422,7 +440,7 @@ cd9660_rrip_initialize_node(iso9660_disk *diskStructure, cd9660node *node, TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } } else { - cd9660_rrip_initialize_inode(node); + cd9660_rrip_initialize_inode(diskStructure, node); if (node == diskStructure->rr_moved_dir) { cd9660_rrip_add_NM(node, RRIP_DEFAULT_MOVE_DIR_NAME); @@ -630,8 +648,45 @@ cd9660_createSL(cd9660node *node) } } +static int +inode_map_node_cmp(struct inode_map_node *a, struct inode_map_node *b) +{ + if (a->key < b->key) + return (-1); + if (a->key > b->key) + return (1); + return (0); +} + +RB_GENERATE(inode_map_tree, inode_map_node, entry, inode_map_node_cmp); + +static uint64_t +inode_map(iso9660_disk *diskStructure, uint64_t in) +{ + struct inode_map_node lookup = { .key = in }; + struct inode_map_node *node; + + /* + * Always assign an inode number if src inode unset. mtree mode leaves + * src inode unset for files with st_nlink == 1. + */ + if (in != 0) { + node = RB_FIND(inode_map_tree, &(diskStructure->rr_inode_map), + &lookup); + if (node != NULL) + return (node->value); + } + + node = emalloc(sizeof(struct inode_map_node)); + node->key = in; + node->value = diskStructure->rr_inode_next++; + RB_INSERT(inode_map_tree, &(diskStructure->rr_inode_map), node); + return (node->value); +} + int -cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *v, fsnode *pxinfo) +cd9660node_rrip_px(iso9660_disk *diskStructure, struct ISO_SUSP_ATTRIBUTES *v, + fsnode *pxinfo) { v->attr.rr_entry.PX.h.length[0] = 44; v->attr.rr_entry.PX.h.version[0] = 1; @@ -643,8 +698,8 @@ cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *v, fsnode *pxinfo) v->attr.rr_entry.PX.uid); cd9660_bothendian_dword(pxinfo->inode->st.st_gid, v->attr.rr_entry.PX.gid); - cd9660_bothendian_dword(pxinfo->inode->st.st_ino, - v->attr.rr_entry.PX.serial); + cd9660_bothendian_dword(inode_map(diskStructure, + pxinfo->inode->st.st_ino), v->attr.rr_entry.PX.serial); return 1; } diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.h b/usr.sbin/makefs/cd9660/iso9660_rrip.h index 5e1e8b5130f0..4c738d27ba45 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.h +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.h @@ -224,7 +224,7 @@ int cd9660_susp_finalize_node(iso9660_disk *, cd9660node *); int cd9660_rrip_finalize_node(cd9660node *); /* POSIX File attribute */ -int cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *, fsnode *); +int cd9660node_rrip_px(iso9660_disk *, struct ISO_SUSP_ATTRIBUTES *, fsnode *); /* Device number */ int cd9660node_rrip_pn(struct ISO_SUSP_ATTRIBUTES *, fsnode *); From nobody Tue Mar 4 21:44:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6q2r0t8rz5qm6K; Tue, 04 Mar 2025 21:44: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 4Z6q2q5B7Tz3HW9; Tue, 04 Mar 2025 21:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741124675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rC6O/vwvxS+ACax/wt/CE+pICQ4+wCgb8N87vm0HniU=; b=C2i+pEAWwNxRkdiRo6lkP2J1yPVpWesxra2YlFPCh9YougB5UTNnrOz7DVD3lry2fVmnj4 DlhwA4Wns6SOYe8kl2QRyhFahhNgxAYkpO29qj/f7vDWlnKDI1VugJK5HyeLTuX8oXFVI5 WtoyBLXn/G+F7FwEck6ljCtPlKMA3E55t8S/PMW1lgDPCWnLQVy85tggxL3irgxJN5qaUZ HMyvQ5WAaJ/+82vwvtQxpQ01DltqI9fyaW82Cxyaq3TBlj5t/+cdogy1v4/DJ9a2aKCkaZ Nawvl1h2ICkppWOyIpgbZIqGjJOZiYsY7bF4Ebd582huWKlhy+5PamkiG5f65g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741124675; a=rsa-sha256; cv=none; b=OU86n7tcQ0LjxQDiFJWrv5eWFc8A3Z9aES9KX7da4VFDKVRd5DPWPoQ8PzEBtKlBUZiEGV Z0ZxGZXtPgehWcYM11iqrPk1qNL7OIsyP6NlVcvXQrO2rc0NAvYZ5vhENn3DnT/6qKNwS8 Z4lkNwNnTioYp0+7oTN3tos6IDHstAnsPCqHxJ1cukVs4Ro26qlXJLcU/mA3jEt8yDMST5 cWwLPmsjaGmLAtMEwMvnafZwbvmhtNSBi6+2W5TL7OzK+rTzLETdGQJLD3Bbly1gcnS1d4 LKJw0olaTYolpLHAzsFYyvg1aqmilny//SEtE/iASc0PYoNg4IT2SBKX2xOOww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741124675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rC6O/vwvxS+ACax/wt/CE+pICQ4+wCgb8N87vm0HniU=; b=O16oKy7RVeDTxUD4VJy/pWrbfVuW+v44biey2ThEcz6oZbVDi7Ij7Jkhv4sKvKc3Ci57vm ISPbNK6I629dnJzys9psKgWvLGKiX04sLh7X1af2eLvkAH6CF42Eb2IfyIw4Ddu0pfZPYg Y0zXml1EhWTIXo0oYQL/q3gktCrV0xEdEk0vH5yQSnu4wtPp8jgAGUiFToYiKUL8ilzYsS 2DLkrL++ae23sKcyJTH/MNa6W7jsZsBBScM6u1iUZk9p48WRoryENMywQWohJID/6+3TRc vLdj6q6Uuxvr/LFDVRONRydX5q93/FiFThL7S1xJi4jUCCgfzR/ZBo2QBpHeng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6q2q4Cdgzc3f; Tue, 04 Mar 2025 21:44: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 524LiZF9022240; Tue, 4 Mar 2025 21:44:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524LiZ9T022237; Tue, 4 Mar 2025 21:44:35 GMT (envelope-from git) Date: Tue, 4 Mar 2025 21:44:35 GMT Message-Id: <202503042144.524LiZ9T022237@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: ca48e43ba9ee - main - usb: Kill left-over cdefs.h includes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca48e43ba9ee73a07cdbad8365117793b01273bb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ca48e43ba9ee73a07cdbad8365117793b01273bb commit ca48e43ba9ee73a07cdbad8365117793b01273bb Author: Warner Losh AuthorDate: 2025-03-04 21:42:28 +0000 Commit: Warner Losh CommitDate: 2025-03-04 21:44:22 +0000 usb: Kill left-over cdefs.h includes These includes were for __FBSD_RCSID() macro. They weren't formatted like the rest of the tree so weren't trimmed automatically when that script was run. Trim them now. MFC After: 1 week Sponsored by: Netflix --- sys/dev/usb/controller/dwc3/dwc3.c | 1 - sys/dev/usb/controller/dwc_otg_acpi.c | 1 - sys/dev/usb/controller/ehci_fsl.c | 1 - sys/dev/usb/controller/ehci_imx.c | 1 - sys/dev/usb/controller/ehci_msm.c | 1 - sys/dev/usb/controller/ehci_mv.c | 1 - sys/dev/usb/controller/ehci_pci.c | 1 - sys/dev/usb/controller/generic_ehci.c | 1 - sys/dev/usb/controller/generic_ehci_acpi.c | 1 - sys/dev/usb/controller/generic_ehci_fdt.c | 1 - sys/dev/usb/controller/generic_xhci.c | 1 - sys/dev/usb/controller/generic_xhci_acpi.c | 1 - sys/dev/usb/controller/generic_xhci_fdt.c | 1 - sys/dev/usb/controller/ohci_pci.c | 1 - sys/dev/usb/controller/uhci_pci.c | 1 - sys/dev/usb/controller/xhci_pci.c | 1 - sys/dev/usb/controller/xlnx_dwc3.c | 2 -- sys/dev/usb/input/atp.c | 1 - sys/dev/usb/input/uhid.c | 1 - sys/dev/usb/input/ukbd.c | 1 - sys/dev/usb/input/ums.c | 1 - sys/dev/usb/input/usbhid.c | 1 - sys/dev/usb/input/wmt.c | 1 - sys/dev/usb/input/wsp.c | 1 - sys/dev/usb/misc/udbp.c | 1 - sys/dev/usb/misc/ugold.c | 1 - sys/dev/usb/misc/uled.c | 1 - sys/dev/usb/net/if_aue.c | 1 - sys/dev/usb/net/if_axe.c | 1 - sys/dev/usb/net/if_axge.c | 1 - sys/dev/usb/net/if_cdce.c | 1 - sys/dev/usb/net/if_cdceem.c | 1 - sys/dev/usb/net/if_cue.c | 1 - sys/dev/usb/net/if_ipheth.c | 1 - sys/dev/usb/net/if_kue.c | 1 - sys/dev/usb/net/if_mos.c | 1 - sys/dev/usb/net/if_muge.c | 1 - sys/dev/usb/net/if_rue.c | 1 - sys/dev/usb/net/if_smsc.c | 1 - sys/dev/usb/net/if_udav.c | 1 - sys/dev/usb/net/if_urndis.c | 1 - sys/dev/usb/net/ruephy.c | 1 - sys/dev/usb/serial/ubsa.c | 1 - sys/dev/usb/serial/ubser.c | 1 - sys/dev/usb/serial/uchcom.c | 1 - sys/dev/usb/serial/ucycom.c | 1 - sys/dev/usb/serial/ufoma.c | 1 - sys/dev/usb/serial/uftdi.c | 1 - sys/dev/usb/serial/uipaq.c | 1 - sys/dev/usb/serial/ulpt.c | 1 - sys/dev/usb/serial/umcs.c | 1 - sys/dev/usb/serial/umct.c | 1 - sys/dev/usb/serial/umodem.c | 1 - sys/dev/usb/serial/uplcom.c | 1 - sys/dev/usb/serial/usb_serial.c | 1 - sys/dev/usb/serial/uslcom.c | 1 - sys/dev/usb/serial/uvscom.c | 1 - sys/dev/usb/storage/umass.c | 1 - sys/dev/usb/storage/urio.c | 1 - sys/dev/usb/template/usb_template_multi.c | 1 - sys/dev/usb/template/usb_template_serialnet.c | 1 - sys/dev/usb/wlan/if_rsu.c | 1 - sys/dev/usb/wlan/if_rum.c | 1 - sys/dev/usb/wlan/if_run.c | 1 - sys/dev/usb/wlan/if_uath.c | 1 - sys/dev/usb/wlan/if_ural.c | 1 - sys/dev/usb/wlan/if_urtw.c | 1 - sys/dev/usb/wlan/if_zyd.c | 1 - 68 files changed, 69 deletions(-) diff --git a/sys/dev/usb/controller/dwc3/dwc3.c b/sys/dev/usb/controller/dwc3/dwc3.c index 7ba6165431ac..39b5d3ae4cb1 100644 --- a/sys/dev/usb/controller/dwc3/dwc3.c +++ b/sys/dev/usb/controller/dwc3/dwc3.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "opt_platform.h" #include "opt_acpi.h" diff --git a/sys/dev/usb/controller/dwc_otg_acpi.c b/sys/dev/usb/controller/dwc_otg_acpi.c index 5d509911a54a..d8deaa80e94e 100644 --- a/sys/dev/usb/controller/dwc_otg_acpi.c +++ b/sys/dev/usb/controller/dwc_otg_acpi.c @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include "opt_acpi.h" #include diff --git a/sys/dev/usb/controller/ehci_fsl.c b/sys/dev/usb/controller/ehci_fsl.c index ed3d4c64f4f8..ce1749775ab2 100644 --- a/sys/dev/usb/controller/ehci_fsl.c +++ b/sys/dev/usb/controller/ehci_fsl.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "opt_bus.h" #include diff --git a/sys/dev/usb/controller/ehci_imx.c b/sys/dev/usb/controller/ehci_imx.c index caba6b7da85a..149b26f04760 100644 --- a/sys/dev/usb/controller/ehci_imx.c +++ b/sys/dev/usb/controller/ehci_imx.c @@ -31,7 +31,6 @@ * SUCH DAMAGE. */ -#include /* * EHCI driver for Freescale i.MX SoCs which incorporate the USBOH3 controller. */ diff --git a/sys/dev/usb/controller/ehci_msm.c b/sys/dev/usb/controller/ehci_msm.c index 7f06ad6a1600..2586df634b3c 100644 --- a/sys/dev/usb/controller/ehci_msm.c +++ b/sys/dev/usb/controller/ehci_msm.c @@ -31,7 +31,6 @@ * SUCH DAMAGE. */ -#include #include "opt_bus.h" #include diff --git a/sys/dev/usb/controller/ehci_mv.c b/sys/dev/usb/controller/ehci_mv.c index 817cd68257c8..5dc72d4af3d8 100644 --- a/sys/dev/usb/controller/ehci_mv.c +++ b/sys/dev/usb/controller/ehci_mv.c @@ -35,7 +35,6 @@ * FDT attachment driver for the USB Enhanced Host Controller. */ -#include #include "opt_bus.h" #include diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c index bc75669a8d20..d7298ab89df7 100644 --- a/sys/dev/usb/controller/ehci_pci.c +++ b/sys/dev/usb/controller/ehci_pci.c @@ -30,7 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller. * diff --git a/sys/dev/usb/controller/generic_ehci.c b/sys/dev/usb/controller/generic_ehci.c index 35a9564631e0..bd7dc32b1ea8 100644 --- a/sys/dev/usb/controller/generic_ehci.c +++ b/sys/dev/usb/controller/generic_ehci.c @@ -32,7 +32,6 @@ * Generic EHCI driver based on the Allwinner A10 EHCI driver */ -#include #include "opt_bus.h" #include diff --git a/sys/dev/usb/controller/generic_ehci_acpi.c b/sys/dev/usb/controller/generic_ehci_acpi.c index f565590fa09a..d947215ad355 100644 --- a/sys/dev/usb/controller/generic_ehci_acpi.c +++ b/sys/dev/usb/controller/generic_ehci_acpi.c @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include "opt_bus.h" #include diff --git a/sys/dev/usb/controller/generic_ehci_fdt.c b/sys/dev/usb/controller/generic_ehci_fdt.c index af22d0bdef73..df2dc7fba4b9 100644 --- a/sys/dev/usb/controller/generic_ehci_fdt.c +++ b/sys/dev/usb/controller/generic_ehci_fdt.c @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ -#include #include "opt_bus.h" #include diff --git a/sys/dev/usb/controller/generic_xhci.c b/sys/dev/usb/controller/generic_xhci.c index f64e1fd01ba0..16bda77e043d 100644 --- a/sys/dev/usb/controller/generic_xhci.c +++ b/sys/dev/usb/controller/generic_xhci.c @@ -27,7 +27,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/dev/usb/controller/generic_xhci_acpi.c b/sys/dev/usb/controller/generic_xhci_acpi.c index 2cb5977e0cf1..e24fe1b1bcc3 100644 --- a/sys/dev/usb/controller/generic_xhci_acpi.c +++ b/sys/dev/usb/controller/generic_xhci_acpi.c @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include "opt_acpi.h" #include diff --git a/sys/dev/usb/controller/generic_xhci_fdt.c b/sys/dev/usb/controller/generic_xhci_fdt.c index 66fc1ab65a23..8aab938cbc77 100644 --- a/sys/dev/usb/controller/generic_xhci_fdt.c +++ b/sys/dev/usb/controller/generic_xhci_fdt.c @@ -27,7 +27,6 @@ * SUCH DAMAGE. */ -#include #include "opt_bus.h" #include diff --git a/sys/dev/usb/controller/ohci_pci.c b/sys/dev/usb/controller/ohci_pci.c index 027be4ce9588..0edcebcb0b38 100644 --- a/sys/dev/usb/controller/ohci_pci.c +++ b/sys/dev/usb/controller/ohci_pci.c @@ -30,7 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* * USB Open Host Controller driver. * diff --git a/sys/dev/usb/controller/uhci_pci.c b/sys/dev/usb/controller/uhci_pci.c index 0dc2763aed8d..97f6d09f9e65 100644 --- a/sys/dev/usb/controller/uhci_pci.c +++ b/sys/dev/usb/controller/uhci_pci.c @@ -30,7 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* Universal Host Controller Interface * * UHCI spec: http://www.intel.com/ diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index c436f60aefcf..b50e33ea36ce 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/sys/dev/usb/controller/xlnx_dwc3.c b/sys/dev/usb/controller/xlnx_dwc3.c index ab2e9b899b2a..c450734e4225 100644 --- a/sys/dev/usb/controller/xlnx_dwc3.c +++ b/sys/dev/usb/controller/xlnx_dwc3.c @@ -29,8 +29,6 @@ * Xilinx DWC3 glue */ -#include - #include #include #include diff --git a/sys/dev/usb/input/atp.c b/sys/dev/usb/input/atp.c index fa78f7d7221b..41ab37c6f1cc 100644 --- a/sys/dev/usb/input/atp.c +++ b/sys/dev/usb/input/atp.c @@ -58,7 +58,6 @@ * giving me an opportunity to do this work. */ -#include #include #include #include diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c index 098ec4364df7..a31081663f0c 100644 --- a/sys/dev/usb/input/uhid.c +++ b/sys/dev/usb/input/uhid.c @@ -4,7 +4,6 @@ * $NetBSD: uhid.c,v 1.54 2002/09/23 05:51:21 simonb Exp $ */ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 9ff093628312..57e9beac34b6 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -1,4 +1,3 @@ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 067feed13e92..523ec4d05db9 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -30,7 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index e88588182ae5..3bb7d5e594e3 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -30,7 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* * HID spec: https://www.usb.org/sites/default/files/documents/hid1_11.pdf */ diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 23692e77a0fa..03e4da35a9fe 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ -#include /* * MS Windows 7/8/10 compatible USB HID Multi-touch Device driver. * https://msdn.microsoft.com/en-us/library/windows/hardware/jj151569(v=vs.85).aspx diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index a8d6c14c7421..4c41dcdbba8f 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "opt_evdev.h" #include diff --git a/sys/dev/usb/misc/udbp.c b/sys/dev/usb/misc/udbp.c index 61f77837ffbd..1d348557e1a1 100644 --- a/sys/dev/usb/misc/udbp.c +++ b/sys/dev/usb/misc/udbp.c @@ -30,7 +30,6 @@ * */ -#include /* Driver for arbitrary double bulk pipe devices. * The driver assumes that there will be the same driver on the other side. * diff --git a/sys/dev/usb/misc/ugold.c b/sys/dev/usb/misc/ugold.c index d322348ee333..1b5f54bc679b 100644 --- a/sys/dev/usb/misc/ugold.c +++ b/sys/dev/usb/misc/ugold.c @@ -19,7 +19,6 @@ /* Driver for Microdia's HID based TEMPer Temperature sensor */ -#include #include #include #include diff --git a/sys/dev/usb/misc/uled.c b/sys/dev/usb/misc/uled.c index 6fc325522f20..7608524cddee 100644 --- a/sys/dev/usb/misc/uled.c +++ b/sys/dev/usb/misc/uled.c @@ -25,7 +25,6 @@ * */ -#include #include #include #include diff --git a/sys/dev/usb/net/if_aue.c b/sys/dev/usb/net/if_aue.c index 3bd6dd50f7b7..84268c60a780 100644 --- a/sys/dev/usb/net/if_aue.c +++ b/sys/dev/usb/net/if_aue.c @@ -35,7 +35,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include /* * ADMtek AN986 Pegasus and AN8511 Pegasus II USB to ethernet driver. * Datasheet is available from http://www.admtek.com.tw. diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c index ed40a1e415c3..117a3daa170f 100644 --- a/sys/dev/usb/net/if_axe.c +++ b/sys/dev/usb/net/if_axe.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include /* * ASIX Electronics AX88172/AX88178/AX88778 USB 2.0 ethernet driver. * Used in the LinkSys USB200M and various other adapters. diff --git a/sys/dev/usb/net/if_axge.c b/sys/dev/usb/net/if_axge.c index cae1d61feb34..cb8f0fafff45 100644 --- a/sys/dev/usb/net/if_axge.c +++ b/sys/dev/usb/net/if_axge.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include /* * ASIX Electronics AX88178A/AX88179/AX88179A USB 2.0/3.0 gigabit ethernet * driver. diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index cbb6ae76ef0c..25697c8ec4c9 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -47,7 +47,6 @@ * http://www.usb.org/developers/devclass_docs/NCM10.zip */ -#include #include #include #include diff --git a/sys/dev/usb/net/if_cdceem.c b/sys/dev/usb/net/if_cdceem.c index 07ce7328a3ca..b4978e5ea394 100644 --- a/sys/dev/usb/net/if_cdceem.c +++ b/sys/dev/usb/net/if_cdceem.c @@ -37,7 +37,6 @@ * https://usb.org/sites/default/files/CDC_EEM10.pdf */ -#include #include #include #include diff --git a/sys/dev/usb/net/if_cue.c b/sys/dev/usb/net/if_cue.c index e7b6d6cbbca4..a65bafee066f 100644 --- a/sys/dev/usb/net/if_cue.c +++ b/sys/dev/usb/net/if_cue.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include /* * CATC USB-EL1210A USB to ethernet driver. Used in the CATC Netmate * adapters and others. diff --git a/sys/dev/usb/net/if_ipheth.c b/sys/dev/usb/net/if_ipheth.c index dfb9463cf024..f70113c53eb4 100644 --- a/sys/dev/usb/net/if_ipheth.c +++ b/sys/dev/usb/net/if_ipheth.c @@ -31,7 +31,6 @@ * the Apple iPhone Ethernet driver. */ -#include #include #include #include diff --git a/sys/dev/usb/net/if_kue.c b/sys/dev/usb/net/if_kue.c index 9398b7ac98ee..55c531e278fb 100644 --- a/sys/dev/usb/net/if_kue.c +++ b/sys/dev/usb/net/if_kue.c @@ -32,7 +32,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include /* * Kawasaki LSI KL5KUSB101B USB to ethernet adapter driver. * diff --git a/sys/dev/usb/net/if_mos.c b/sys/dev/usb/net/if_mos.c index b0ad55e726b5..442bfb27d83f 100644 --- a/sys/dev/usb/net/if_mos.c +++ b/sys/dev/usb/net/if_mos.c @@ -80,7 +80,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include /* * Moschip MCS7730/MCS7830/MCS7832 USB to Ethernet controller * The datasheet is available at the following URL: diff --git a/sys/dev/usb/net/if_muge.c b/sys/dev/usb/net/if_muge.c index dd4a89aa8b05..a39343b2e3c9 100644 --- a/sys/dev/usb/net/if_muge.c +++ b/sys/dev/usb/net/if_muge.c @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ -#include /* * USB-To-Ethernet adapter driver for Microchip's LAN78XX and related families. * diff --git a/sys/dev/usb/net/if_rue.c b/sys/dev/usb/net/if_rue.c index 1c11e70e63a6..d1b46887cd20 100644 --- a/sys/dev/usb/net/if_rue.c +++ b/sys/dev/usb/net/if_rue.c @@ -58,7 +58,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include /* * RealTek RTL8150 USB to fast ethernet controller driver. * Datasheet is available from diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c index 58809de4ad3a..0ebbf8482446 100644 --- a/sys/dev/usb/net/if_smsc.c +++ b/sys/dev/usb/net/if_smsc.c @@ -26,7 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include /* * Microchip LAN9xxx devices (https://www.microchip.com/en-us/product/lan9500a) * diff --git a/sys/dev/usb/net/if_udav.c b/sys/dev/usb/net/if_udav.c index 6517a4a0e7b7..1554f0a4cd57 100644 --- a/sys/dev/usb/net/if_udav.c +++ b/sys/dev/usb/net/if_udav.c @@ -44,7 +44,6 @@ * External PHYs */ -#include #include #include #include diff --git a/sys/dev/usb/net/if_urndis.c b/sys/dev/usb/net/if_urndis.c index 0a7cb3fed953..4b0582442e30 100644 --- a/sys/dev/usb/net/if_urndis.c +++ b/sys/dev/usb/net/if_urndis.c @@ -20,7 +20,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include diff --git a/sys/dev/usb/net/ruephy.c b/sys/dev/usb/net/ruephy.c index 05ed5cc6586a..2b5358ab8d0c 100644 --- a/sys/dev/usb/net/ruephy.c +++ b/sys/dev/usb/net/ruephy.c @@ -27,7 +27,6 @@ * */ -#include /* * driver for RealTek RTL8150 internal PHY */ diff --git a/sys/dev/usb/serial/ubsa.c b/sys/dev/usb/serial/ubsa.c index 5ff207a17c62..38782d5aef11 100644 --- a/sys/dev/usb/serial/ubsa.c +++ b/sys/dev/usb/serial/ubsa.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/sys/dev/usb/serial/ubser.c b/sys/dev/usb/serial/ubser.c index 91fefceb8240..978639a809be 100644 --- a/sys/dev/usb/serial/ubser.c +++ b/sys/dev/usb/serial/ubser.c @@ -64,7 +64,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* * BWCT serial adapter driver */ diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c index a61b5a92364c..a886b25c89d7 100644 --- a/sys/dev/usb/serial/uchcom.c +++ b/sys/dev/usb/serial/uchcom.c @@ -57,7 +57,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* * Driver for WinChipHead CH341/340, the worst USB-serial chip in the * world. diff --git a/sys/dev/usb/serial/ucycom.c b/sys/dev/usb/serial/ucycom.c index 664cb7f05263..5ab1810a0d11 100644 --- a/sys/dev/usb/serial/ucycom.c +++ b/sys/dev/usb/serial/ucycom.c @@ -1,4 +1,3 @@ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/serial/ufoma.c b/sys/dev/usb/serial/ufoma.c index 66002f57e3b9..3fc6a7a609ba 100644 --- a/sys/dev/usb/serial/ufoma.c +++ b/sys/dev/usb/serial/ufoma.c @@ -1,6 +1,5 @@ /* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */ -#include #define UFOMA_HANDSFREE /*- * SPDX-License-Identifier: BSD-2-Clause diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index 3b0400d9b353..b06dc38432be 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include /* * NOTE: all function names beginning like "uftdi_cfg_" can only * be called from within the config thread function ! diff --git a/sys/dev/usb/serial/uipaq.c b/sys/dev/usb/serial/uipaq.c index 2b282009a8bb..f24f1e215767 100644 --- a/sys/dev/usb/serial/uipaq.c +++ b/sys/dev/usb/serial/uipaq.c @@ -43,7 +43,6 @@ * Contact isis@cs.umd.edu if you have any questions/comments about this driver */ -#include #include #include #include diff --git a/sys/dev/usb/serial/ulpt.c b/sys/dev/usb/serial/ulpt.c index b1e4232ff2a3..ec25ad737596 100644 --- a/sys/dev/usb/serial/ulpt.c +++ b/sys/dev/usb/serial/ulpt.c @@ -1,4 +1,3 @@ -#include /* $NetBSD: ulpt.c,v 1.60 2003/10/04 21:19:50 augustss Exp $ */ /*- diff --git a/sys/dev/usb/serial/umcs.c b/sys/dev/usb/serial/umcs.c index 18135e3bf67d..8b9b7807ac61 100644 --- a/sys/dev/usb/serial/umcs.c +++ b/sys/dev/usb/serial/umcs.c @@ -39,7 +39,6 @@ * quad-port mos7840. * */ -#include #include #include #include diff --git a/sys/dev/usb/serial/umct.c b/sys/dev/usb/serial/umct.c index 4329cf293098..bf6c672907e0 100644 --- a/sys/dev/usb/serial/umct.c +++ b/sys/dev/usb/serial/umct.c @@ -1,4 +1,3 @@ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/serial/umodem.c b/sys/dev/usb/serial/umodem.c index 08d3be554915..59aa5b21e85f 100644 --- a/sys/dev/usb/serial/umodem.c +++ b/sys/dev/usb/serial/umodem.c @@ -1,6 +1,5 @@ /* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/serial/uplcom.c b/sys/dev/usb/serial/uplcom.c index 88278ef5790e..1fd73f1f7665 100644 --- a/sys/dev/usb/serial/uplcom.c +++ b/sys/dev/usb/serial/uplcom.c @@ -1,6 +1,5 @@ /* $NetBSD: uplcom.c,v 1.21 2001/11/13 06:24:56 lukem Exp $ */ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c index dfae051ecfd6..e62bfdb8ff1d 100644 --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ -#include /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/sys/dev/usb/serial/uslcom.c b/sys/dev/usb/serial/uslcom.c index 1c27788f77ce..26b937d0b200 100644 --- a/sys/dev/usb/serial/uslcom.c +++ b/sys/dev/usb/serial/uslcom.c @@ -1,6 +1,5 @@ /* $OpenBSD: uslcom.c,v 1.17 2007/11/24 10:52:12 jsg Exp $ */ -#include /* * Copyright (c) 2006 Jonathan Gray * diff --git a/sys/dev/usb/serial/uvscom.c b/sys/dev/usb/serial/uvscom.c index ee34f0ad3f3d..b9add5c1b37b 100644 --- a/sys/dev/usb/serial/uvscom.c +++ b/sys/dev/usb/serial/uvscom.c @@ -1,6 +1,5 @@ /* $NetBSD: usb/uvscom.c,v 1.1 2002/03/19 15:08:42 augustss Exp $ */ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c index 9137f3eb895e..58f36e756dce 100644 --- a/sys/dev/usb/storage/umass.c +++ b/sys/dev/usb/storage/umass.c @@ -1,4 +1,3 @@ -#include /*- * SPDX-License-Identifier: BSD-2-Clause * diff --git a/sys/dev/usb/storage/urio.c b/sys/dev/usb/storage/urio.c index e733ae4dfcba..c13aab44e435 100644 --- a/sys/dev/usb/storage/urio.c +++ b/sys/dev/usb/storage/urio.c @@ -30,7 +30,6 @@ * its contributors. */ -#include /* * 2000/3/24 added NetBSD/OpenBSD support (from Alex Nemirovsky) * 2000/3/07 use two bulk-pipe handles for read and write (Dirk) diff --git a/sys/dev/usb/template/usb_template_multi.c b/sys/dev/usb/template/usb_template_multi.c index 2533459be799..be36e5ea70df 100644 --- a/sys/dev/usb/template/usb_template_multi.c +++ b/sys/dev/usb/template/usb_template_multi.c @@ -37,7 +37,6 @@ * USB template for CDC ACM (serial), CDC ECM (network), and CDC MSC (storage). */ -#include #ifdef USB_GLOBAL_INCLUDE_FILE #include USB_GLOBAL_INCLUDE_FILE #else diff --git a/sys/dev/usb/template/usb_template_serialnet.c b/sys/dev/usb/template/usb_template_serialnet.c index adcc561ccd21..6ee43f7f1f28 100644 --- a/sys/dev/usb/template/usb_template_serialnet.c +++ b/sys/dev/usb/template/usb_template_serialnet.c @@ -37,7 +37,6 @@ * This file contains the USB template for USB Networking and Serial */ -#include #ifdef USB_GLOBAL_INCLUDE_FILE #include USB_GLOBAL_INCLUDE_FILE #else diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c index 997a739562f6..35deed163706 100644 --- a/sys/dev/usb/wlan/if_rsu.c +++ b/sys/dev/usb/wlan/if_rsu.c @@ -15,7 +15,6 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include /* * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU. * diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 48674d84ffe3..b822766f0ba5 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -18,7 +18,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include /*- * Ralink Technology RT2501USB/RT2601USB chipset driver * http://www.ralinktech.com.tw/ diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index 81f4d172241f..00e005fd7d4d 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -17,7 +17,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include /*- * Ralink Technology RT2700U/RT2800U/RT3000U/RT3900E chipset driver. * http://www.ralinktech.com/ diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index e4493ba50a30..28c176df1f14 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -50,7 +50,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include /*- * Driver for Atheros AR5523 USB parts. * diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c index c47b8cbeb3ae..260d75a9821d 100644 --- a/sys/dev/usb/wlan/if_ural.c +++ b/sys/dev/usb/wlan/if_ural.c @@ -19,7 +19,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include /*- * Ralink Technology RT2500USB chipset driver * http://www.ralinktech.com/ diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c index 1a7a1eba4758..439faeefc408 100644 --- a/sys/dev/usb/wlan/if_urtw.c +++ b/sys/dev/usb/wlan/if_urtw.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include "opt_wlan.h" #include diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index 1815dc04cd09..1a698caef3c5 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -18,7 +18,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include /* * ZyDAS ZD1211/ZD1211B USB WLAN driver. */ From nobody Tue Mar 4 22:06:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6qWr3462z5qnFb; Tue, 04 Mar 2025 22:06: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 4Z6qWr2RB4z3bhk; Tue, 04 Mar 2025 22:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741125976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LE25L/HjHvb/89m2p29zUYzeomKV7XrFIZHaSYDoM+E=; b=AVwiVL5ovlN4bo4mls64L38dNZNgpzfunc+s2f5yeEblkJwjz3lSzeYNow5IR7NNw+CaiT BXLb0sdA0xFg4txi6x4EEvqi3b8on82s7sDlNuk6f7TpxTy+jXT8/NWNwId1DLCy0UeKBr rz8vXLEU+K1VxTnC3uLYxhfOhOJ54H255uomWvztZT+huNXAmluxv/By/zE6Zg0mlTfwiZ 93ZuoZHi+79PBzc7dJXKFtAgqrhrlBeDFEQgooVhGEbZ9H++n4pcd5ycAhm4brqdyy2HUc VvZErJ0cosX7xjTRYJMun04jaBuG5eBxy+RFdaiEV/Z1YFDHGLOalNPh14lvIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741125976; a=rsa-sha256; cv=none; b=UeKfr/8o1slyJv+sVBt79H+A0YCxqlkXcjv1zpy10dDwgLtsdxL/Pzd13KabxSaAfauzfM Yz8VKoEoeyd5iIf8QV/PYir3KulSoS84zs1xJlKZwuYoSwgzi+wVCSVxBWnD6a6d7mYqYc 8G0GZi9LGG43Cp5d55g8PmWvNmeYitsTSMgYvI45/nWugjzmJw84jajCCuRInf8hkSfYcX gOtXxPd9BdgLEZ9fg4eazkiCCqvqkLCpxmADeBYjniDGSkU0xHx4wE2IHfjrZn1oP3f8Ff ubB3nC0xF5c9ksqJKdgMAom4w1LSSOoHlK/86ZtlHa+hMyTk6LIBD+fyy56ZDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741125976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LE25L/HjHvb/89m2p29zUYzeomKV7XrFIZHaSYDoM+E=; b=MQZUNSMvXv55PQEvmPSDhbzJOEsI9d6S7S+4jMQFHX/MkYNdn91ZMn2u9M2Vh1+vGtX7b9 hSwA1TdLbPvBm08Q4CuVXhLwP0iWxIHAKZ5BVj6MBY6dTKrYBooVi8IBtf5Ban/NHfixHF ySYbW3touqHkT+AWHykLSO9D2VhMPg2FQsbCbuPo1G/zuyNsFfrONEOj2AB6S+RpDuXEw4 RWP87SBSXleMY7PrwXjBwLCxBmJadJud4lu3pK7BJ6/DY6uso1WBI4OmTfvURFfPgiSoqx Tv/JQ5o9rNah2JIIjAK6IBZsZjRWCt98Wys1eDcvTUwMnMs86hRgwyAb6q46kA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6qWr1jqDzdCQ; Tue, 04 Mar 2025 22:06: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 524M6GDm061083; Tue, 4 Mar 2025 22:06:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524M6G7X061080; Tue, 4 Mar 2025 22:06:16 GMT (envelope-from git) Date: Tue, 4 Mar 2025 22:06:16 GMT Message-Id: <202503042206.524M6G7X061080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Igor Ostapenko Subject: git: 9383629ffc92 - stable/14 - kyua: Support require.diskspace ATF metadata List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9383629ffc923fe12ae031820713f68b845af838 Auto-Submitted: auto-generated The branch stable/14 has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=9383629ffc923fe12ae031820713f68b845af838 commit 9383629ffc923fe12ae031820713f68b845af838 Author: Igor Ostapenko AuthorDate: 2025-02-02 19:14:55 +0000 Commit: Igor Ostapenko CommitDate: 2025-03-04 21:09:11 +0000 kyua: Support require.diskspace ATF metadata Reviewed by: ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48333 (cherry picked from commit 6befd3511105a17decdafbf9d3f55324c83aaea1) --- contrib/kyua/doc/kyuafile.5.in | 3 ++- contrib/kyua/engine/atf_list.cpp | 2 ++ contrib/kyua/engine/atf_list_test.cpp | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/contrib/kyua/doc/kyuafile.5.in b/contrib/kyua/doc/kyuafile.5.in index 4fe5f12fd9b1..ae1e4fe40e32 100644 --- a/contrib/kyua/doc/kyuafile.5.in +++ b/contrib/kyua/doc/kyuafile.5.in @@ -282,7 +282,8 @@ ATF: .It Va required_disk_space Amount of available disk space that the test needs to run successfully. .Pp -ATF: not mapped +ATF: +.Va require.diskspace .It Va required_files Whitespace-separated list of paths that the test requires to exist before it can run. diff --git a/contrib/kyua/engine/atf_list.cpp b/contrib/kyua/engine/atf_list.cpp index c4f348ada2f6..f6ec20d7709a 100644 --- a/contrib/kyua/engine/atf_list.cpp +++ b/contrib/kyua/engine/atf_list.cpp @@ -129,6 +129,8 @@ engine::parse_atf_metadata(const model::properties_map& props) mdbuilder.set_string("is_exclusive", value); } else if (name == "require.config") { mdbuilder.set_string("required_configs", value); + } else if (name == "require.diskspace") { + mdbuilder.set_string("required_disk_space", value); } else if (name == "require.files") { mdbuilder.set_string("required_files", value); } else if (name == "require.machine") { diff --git a/contrib/kyua/engine/atf_list_test.cpp b/contrib/kyua/engine/atf_list_test.cpp index 7648ee2c6a80..f3a36ab864f7 100644 --- a/contrib/kyua/engine/atf_list_test.cpp +++ b/contrib/kyua/engine/atf_list_test.cpp @@ -67,6 +67,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) properties["is.exclusive"] = "true"; properties["require.arch"] = "i386 x86_64"; properties["require.config"] = "var1 var2 var3"; + properties["require.diskspace"] = "10g"; properties["require.files"] = "/file1 /dir/file2"; properties["require.machine"] = "amd64"; properties["require.memory"] = "1m"; @@ -95,6 +96,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) .set_description("Some text") .set_has_cleanup(true) .set_is_exclusive(true) + .set_required_disk_space(units::bytes::parse("10g")) .set_required_memory(units::bytes::parse("1m")) .set_required_user("root") .set_timeout(datetime::delta(123, 0)) @@ -293,6 +295,26 @@ ATF_TEST_CASE_BODY(parse_atf_list__is_exclusive_support) } +ATF_TEST_CASE_WITHOUT_HEAD(parse_atf_list__disk_space_support); +ATF_TEST_CASE_BODY(parse_atf_list__disk_space_support) +{ + const std::string text = + "Content-Type: application/X-atf-tp; version=\"1\"\n" + "\n" + "ident: first\n" + "require.diskspace: 123M\n"; + std::istringstream input(text); + const model::test_cases_map tests = engine::parse_atf_list(input); + + const model::test_cases_map exp_tests = model::test_cases_map_builder() + .add("first", model::metadata_builder() + .set_required_disk_space(units::bytes::parse("123M")) + .build()) + .build(); + ATF_REQUIRE_EQ(exp_tests, tests); +} + + ATF_INIT_TEST_CASES(tcs) { ATF_ADD_TEST_CASE(tcs, parse_atf_metadata__defaults); @@ -308,4 +330,5 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, parse_atf_list__one_test_case_invalid_properties); ATF_ADD_TEST_CASE(tcs, parse_atf_list__many_test_cases); ATF_ADD_TEST_CASE(tcs, parse_atf_list__is_exclusive_support); + ATF_ADD_TEST_CASE(tcs, parse_atf_list__disk_space_support); } From nobody Tue Mar 4 22:47:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6rRv2JBCz5qrWV; Tue, 04 Mar 2025 22:47: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 4Z6rRv19bzz3sMp; Tue, 04 Mar 2025 22:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741128475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymCRrgBrqlZskM3JQAMz1wUvk2Y6oBFsr4ep6PtKrEQ=; b=HMx73fF5UWxwu4OvR/aOPVAUoCjzhexeLHcfuRPLRVa1kIlKuXfpavEnpsWPqYxooIGQO6 9bRC4UjV47ahpa0ffo564yRuv1SBr4DEaglV2hD/biOPHVRXDJ1hz0kCdXK5tHGl1NYMff 0IufFDoWTCgKk1AwmgtE76K7lSCVRoclBcFKq69L6aCr62ZUnaBmLTfn4NEDTYZjCn5Lxx pfJJZyvyH2gvOnbCMLLHae3s+3MfEM0lI1U58CXGxeJ04XDcG1gUeqNsUXY1yUGoa6Tafq GEgLGXLj59TosnbVtLpyOq2PX4ZSSQTWZmLtTF/MdPeTjYPYsX+XBoV1hXFbpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741128475; a=rsa-sha256; cv=none; b=nF7mZWT7uWWET5Md8KGIM5NiSNFCQ+uC/75etjt4rxCJeCkAnRffHs4gQ7XSJgPzVWOAMI suxaUBq+qdf3DJDiFl4iLX57+0RQnZlVyPtUpZV0F9KuZgAtXQr9DpUFzYoznYCJe8gAmH b71ekM2U64MxzXENO/u+ShGPdsbb/2ipLseXgXSsXYd6u1pr2K8zspaMbTmVcflfCJmtNW 1YOJkxPO5+hcfm59Z8Qw/FVC9j9DpgkY6RxQMkkjZT9p7fAF4O9/kU7/BQen3Qt0KK4uKo Qz8Cpi8nWc0RsQn515MCj1YCTRxynrfRRnfrbJCkeLreTeyIx0W8ZOWs6fK1AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741128475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymCRrgBrqlZskM3JQAMz1wUvk2Y6oBFsr4ep6PtKrEQ=; b=LDhK/+6ysvHAiH6p1DPvykSE9JH5J0Qzzi7RPuB6K8t6okEi8+xfycOwwQkxLwu2ZeKZc2 gitc9BMd6s8cBSNVMj89LuVVoXeE6ZUeHA3IacsyT4zMe2wFGhQlxqYg5z8jbNcCqaJVtS JsAhThkabiTALOAgiIctBdhM0Uu8Co7qW0wdh7A0nalLnGOf3F3ff2lhO9g0a6dA0kP3VE H3iQE0drbxhuBsfKi/Q9Exw2tz9qR9kdFq1PAV85tqN4Ex9fdnzL/kmcQbUuoSg3akovT1 9qlVKF+gxqA7Qhx9ZYCgwz/4S6pafAKk1jzm5FuRrMAAg+lqaqQCYQeJMuFgPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6rRv0VVyzdwK; Tue, 04 Mar 2025 22:47: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 524Mlswh036484; Tue, 4 Mar 2025 22:47:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Mls87036481; Tue, 4 Mar 2025 22:47:54 GMT (envelope-from git) Date: Tue, 4 Mar 2025 22:47:54 GMT Message-Id: <202503042247.524Mls87036481@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: 5f2893553f3c - main - net80211: fix spelling of Michael (MMIC) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f2893553f3cde7c1529f9ca3987be378a9b7025 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2893553f3cde7c1529f9ca3987be378a9b7025 commit 5f2893553f3cde7c1529f9ca3987be378a9b7025 Author: Bjoern A. Zeeb AuthorDate: 2025-03-04 22:46:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 22:46:05 +0000 net80211: fix spelling of Michael (MMIC) Sponsored by: The FreeBSD Foundation MFC after: 3 days Reported by: rm Fixes: d688c20395a9f --- sys/net80211/_ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 2db2fabac3a9..a44dff9ec6f6 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -588,7 +588,7 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_F_FAIL_MMIC 0x00000080 /* Failed Michael MIC (MMIC) check */ #define IEEE80211_RX_F_DECRYPTED 0x00000100 /* Hardware decrypted */ #define IEEE80211_RX_F_IV_STRIP 0x00000200 /* Decrypted; IV stripped */ -#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; Micheal MIC (MMIC) stripped */ +#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; Michael MIC (MMIC) stripped */ #define IEEE80211_RX_F_SHORTGI 0x00000800 /* This is a short-GI frame */ #define IEEE80211_RX_F_CCK 0x00001000 #define IEEE80211_RX_F_OFDM 0x00002000 From nobody Tue Mar 4 23:31:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6sPv69lMz5nwwL; Tue, 04 Mar 2025 23:31: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 4Z6sPv40r2z3NPk; Tue, 04 Mar 2025 23:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741131075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JNnR4qHXCV0WVs9+PE8wD8g+CFsX7LuzjkzFiNo/2Co=; b=P+5hFC2lfDixYiQGnXW4BYxB6rt/HzGtly2Fa0E4TS4VoKq7PM+lvQxwwAqWXeaKQs8ifL h68xhZUFIjI48c0gnxH5xVinro4dCyi229KOH1TKGwxgd34K37s2wyjvZsyp/jkmfidH9+ +ylPi1KQn02cEEHs7iFazlMPepe9TbW7u59Kz4Hiw6KmREUfwrsxHFCj7CKq3O7A/U7VAC eEBFNlKhcELxr8CfubdI3T253i2wvcP77/D6kt5o5H5oxYZzZkyXjwfE3PaK7yyKXmkNxO /ZEOv7aTjZs4UE7GlRVI54GIq0jl3JJZweMvehwEkPXNXiJ8XQh0i0P3RQOFhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741131075; a=rsa-sha256; cv=none; b=Ulf5KMNtJ0c+RzAwuHoejKnYPa21SPVRpBD0EPGb9r9fn4iLq126FBmI5KO7edbbgqtb5B ETwuCnzL0SKUmUeyfCwZMOZGsNFAR85ge/EV0oFfbnslT3JjHVaNNrqfj67E+5yl9DncUL t9H7S28zsVTF7B6MdnI8BvMNCGPzh5ZLgbUyMkFLEfTHWg1RIIFfLcb4XaPiKqGtXZDDre ix5QlWL4iSNj91oQwEgVoa5t3svjsm5r3zStC8uPHt7ryf38EV61Zhw65KVcBVS6ZK+B7a rJ7E31+NWcExLyZY9rhqyf/Xbtax2Nv57N4CNdSWffV/FIvL4L7ZUeYLMUXvaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741131075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JNnR4qHXCV0WVs9+PE8wD8g+CFsX7LuzjkzFiNo/2Co=; b=K/OC5dPmdiGBTcmBqFv6hD4+v4Dw3MK1oSywGtJAdGzata+QET+KcLzJwXA2Fo5P1MQ1g+ bHV6W+I/lJwt21ka9IzWGwtp5HU9ZOz+1o4EQpUHZKZh76nQ19SBSlimyttZI5XjExyQhd fJrmLtfn2IPeVHbWyr/2XSTjpHmyvGuamvoF/kxxRrpzx9er6TC7pdhd4MH4Q7ObGmq1UP LGXepnU5uQe1pxiU9aoSTZE+pP3hbtEewcY4K3xDplheYRFDx0YftzblxM4wwFNjH2VXuw yztG9a6auqebEdldlB0Kha12LsKdmsFgXZtH0JXN5T/pnPZtAfRmKLliHL7MeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6sPv3J2VzgBR; Tue, 04 Mar 2025 23:31: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 524NVFqM022416; Tue, 4 Mar 2025 23:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524NVF1W022413; Tue, 4 Mar 2025 23:31:15 GMT (envelope-from git) Date: Tue, 4 Mar 2025 23:31:15 GMT Message-Id: <202503042331.524NVF1W022413@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: eaf3ac81cf12 - main - wlanstats: add man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eaf3ac81cf12bbaecb1d6bce3a8bcdef5b9c0ffc Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eaf3ac81cf12bbaecb1d6bce3a8bcdef5b9c0ffc commit eaf3ac81cf12bbaecb1d6bce3a8bcdef5b9c0ffc Author: Bjoern A. Zeeb AuthorDate: 2025-02-28 23:45:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 23:30:12 +0000 wlanstats: add man page After two decades in tools add a basic man page to wlanstats now that it is in usr.sbin. Most users will likely ever only run it without arguments. Sponsored by: The FreeBSD Foundation MFC after: 3 days X-MFC with: 61ce422531805 Reviewed by: adrian, ziaee Differential Revision: https://reviews.freebsd.org/D49186 --- usr.sbin/wlanstats/Makefile | 2 +- usr.sbin/wlanstats/wlanstats.8 | 67 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/usr.sbin/wlanstats/Makefile b/usr.sbin/wlanstats/Makefile index 60c56d24700b..574a9c27137f 100644 --- a/usr.sbin/wlanstats/Makefile +++ b/usr.sbin/wlanstats/Makefile @@ -1,7 +1,7 @@ .include PROG= wlanstats -MAN= +MAN= wlanstats.8 CFLAGS= -I${SRCTOP}/lib/libbsdstat LIBADD= bsdstat diff --git a/usr.sbin/wlanstats/wlanstats.8 b/usr.sbin/wlanstats/wlanstats.8 new file mode 100644 index 000000000000..e032835bac43 --- /dev/null +++ b/usr.sbin/wlanstats/wlanstats.8 @@ -0,0 +1,67 @@ +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Björn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd February 20, 2025 +.Dt WLANSTATS 8 +.Os +.Sh NAME +.Nm wlanstats +.Nd query 802.11 wireless network statistics +.Sh SYNOPSIS +.Nm +.\" .Op Fl a +.Op Fl h +.Op Fl i Ar ifnet +.Op Fl l +.Op Fl m Ar station MAC address +.Op Fl o Ar fmt +.Op interval +.Sh DESCRIPTION +The +.Nm +command is a tool to query 802.11 statistics for +.Xr wlan 4 +interface. +Running +.Nm +without any options will display the current statistics +for the +.Em wlan0 +network interface. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl h +Print usage and exit. +.It Fl i Ar ifnet +Report information for the specified +.Ar ifnet +instead of the default +.Em wlan0 . +.It Fl l +List all fields names and their descriptions. +.It Fl m Ar station MAC address +Request information for the station specified by the given +.Ar MAC address. +.It Fl o Ar fmt +Set format of fields to query. +This can be either on of the pre-defined tags: +.Em default , +.Em ampdu , or +.Em amsdu +or a comma separated list of field names without space. +.El +.Pp +.Sh SEE ALSO +.Xr ifconfig 8 , +.Xr wlandebug 8 +.Pp +The +.Pa /usr/src/tools/tools/net80211 +directory contains more utilities that might be relevant to debug wireless +issues. From nobody Tue Mar 4 23:56:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6syb22ZRz5nysF; Tue, 04 Mar 2025 23:56: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 4Z6syb0H9Lz3ZXQ; Tue, 04 Mar 2025 23:56:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741132567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79RZNX/qZgh0LYoD+IceEpa58D4UpN9+UYo/Q/yZH2I=; b=wcO9a3G45zKuU3KQMDqSvE1hW1FqzFWP5elgyB5L+L0q2mnZqEdRqf8Bc7Pcl9lCW6EUI8 2YGkKEfa4jMYINxX6VshJI3LDOH739IJXziWF7R7nQY3NbYpexA3vzZG34rvlec9u9S21n FRxt4LFfCrJdpW6ZkFQOxMe8MSRruzAAopeDD3fnEMPjQr9zlk+rO/q25DvuGpENVgqzeJ BYweihv1I/LFV3XpTOtHYMwsS3nZ5tASnMOKn6zjMhVLjG9V3K28pC/fJSWU5kA86CPDOw Rz54CFUOPMuK4Pzmzg0hL1cB5zUuzqf0ZE4qJ3YaUJuzhRAGAjrQ5coYDrbCow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741132567; a=rsa-sha256; cv=none; b=S72Wpcw06PhZhQWeG2NQA05dQrHKZFalPgQgldOkOh2yuDa6lmwyweaKXfgTj00E4rwpRp fjgson+BKButqtdohmHyhxLZiE2LiYMRE2+ExwjwWzu0OfpfrgaoPjOrrC7wm9RdaBXvcL 3R7qX6apfvTtBDMMuQiCWTFjd4C6Ywf9ShSO9Y/vsgZMWy66QD0rEJ92GdlEEzSJW6idK+ thys5EgfLHAtv0QZTRYENaxS8ewwEzIsLI0/QRKoilfO1Pulno773cccl4GhWY52XV6hN8 SOy+1y33jpVkrIrLwMhIaslMEUl/UIVKpPf6dwB1eOBi9mz7gqesewmNHkrfLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741132567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79RZNX/qZgh0LYoD+IceEpa58D4UpN9+UYo/Q/yZH2I=; b=yfojnSfZWdDC22tDdfsJg6o1t2vcYOG4GCSoV43rxrJqEeRwRb2GGrJoued4yWAleXx8YE LcyqusmQY07MsmuhvvNdJCHXXBc6l2C4n3AV+AJjY6uZ6O+J7nnd6k39eYLRSUaWqgehcX 0FAlIRdoIXBD6dresaFt5c2sa8bBRWrluPoufBeXgXn3mboRHadNQfVoBpbrJP8MdTyXtl gDCq+nlNQIn+3gLxh47axK3TURzGuSmRaFrB+/UleA3ZcGb8vPLLWcIB/u9abP+YpsapWQ SOoRNfbM/6wP+vdYOk422juCznWZld2g++CsEMOGLk9/+vzC1Gtp6vA+wkdWmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6syZ6NBNzgY3; Tue, 04 Mar 2025 23:56: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 524Nu6RB066249; Tue, 4 Mar 2025 23:56:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524Nu6jx066246; Tue, 4 Mar 2025 23:56:06 GMT (envelope-from git) Date: Tue, 4 Mar 2025 23:56:06 GMT Message-Id: <202503042356.524Nu6jx066246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 0ce9a414adc3 - main - release: add cloudware oracle targets to package and upload .oci files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ce9a414adc33af29607adbd81e0760e014fcd76 Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=0ce9a414adc33af29607adbd81e0760e014fcd76 commit 0ce9a414adc33af29607adbd81e0760e014fcd76 Author: Dave Cottlehuber AuthorDate: 2025-03-04 23:56:00 +0000 Commit: Dave Cottlehuber CommitDate: 2025-03-04 23:56:00 +0000 release: add cloudware oracle targets to package and upload .oci files - requires base tar & flua, qemu-tools & curl from ports - set ORACLE_PAR_URL to upload to local file:/// dir or cloud buckets Reviewed by: emaste Approved by: cperciva Differential Revision: https://reviews.freebsd.org/D48382 Sponsored by: SkunkWerks, GmbH --- release/Makefile.oracle | 101 +++++++++++++++++++++ release/Makefile.vm | 1 + .../oracle/arm64_shape_compatibilities.json | 24 +++++ .../oracle/default_shape_compatibilities.json | 1 + release/scripts/oracle/generate_metadata.lua | 74 +++++++++++++++ release/scripts/oracle/image_capability_data.json | 96 ++++++++++++++++++++ release/scripts/oracle/image_metadata.json | 21 +++++ 7 files changed, 318 insertions(+) diff --git a/release/Makefile.oracle b/release/Makefile.oracle new file mode 100644 index 000000000000..b4f3bbdf86f2 --- /dev/null +++ b/release/Makefile.oracle @@ -0,0 +1,101 @@ +#D48382 +# Makefile for preparing & uploading Oracle Cloud images from existing +# .raw files created by cloudware-release. +# +# Overview: +# +# The base image is already created by cloudware-release. +# +# Construct the custom OCI metadata, derived from exported official OCI images. +# It is architecture-specific but appears mostly stable over time. +# Compress the raw image and place it in the same directory as the metadata. +# Make a GNU format tarball of these files. +# Upload the tarball to Oracle Cloud via a pre-approved curl URI, into +# the FreeBSD Foundation's Oracle Cloud account. +# +# These images go into the "re" bucket in us-ashburn-1 region, which +# is mounted into the FreeBSD Foundation Oracle Marketplace account. +# Once uploaded, a manual step is needed to import the images as local +# custom images. These can then be tested within the us-ashburn-1 region. +# Once tested, follow the manual Oracle Marketplace import process to +# create a new FreeBSD version, attach the images, and initiate validation +# by Oracle. This can take up to 5 working days. Once complete, a final +# manual step is needed to mark the currently private images, public. +# Syncing to all sites should take 2-3 hours after this final step. + +ORACLE_BASENAME= ${OSRELEASE}-${BUILDDATE}${GITREV:C/^(.+)/-\1/} +ORACLE_PORTS_LIST= ftp/curl emulators/qemu@tools +CLEANFILES+= cw-oracle-portinstall + +cw-oracle-portinstall: .PHONY +.if !exists(/usr/local/bin/curl) || !exists(/usr/local/bin/qemu-img) +. if !exists(${PORTSDIR}/Makefile) +. if !exists(/usr/local/sbin/pkg-static) + env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf +. endif + env ASSUME_ALWAYS_YES=yes pkg install -y ${ORACLE_PORTS_LIST} +. else + env UNAME_r=${UNAME_r} make -C \ + ${PORTSDIR}/ftp/curl \ + BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \ + all install clean + env UNAME_r=${UNAME_r} FLAVOR=tools make -C \ + ${PORTSDIR}/emulators/qemu \ + BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \ + all install clean +. endif +.endif + +.for _FS in ${ORACLE_FSLIST} +ORACLE_OCI_LIST+= cw-oracle-${_FS}.oci +ORACLE_UPLOAD_LIST+= cw-oracle-upload-${_FS} +CLEANFILES+= cw-oracle-${_FS}.oci +ORACLE_TMP_${_FS}= cw-oracle-${_FS}.oci.tmpdir +CLEANDIRS+= ${ORACLE_TMP_${_FS}} +ORACLE_METADATA= ${.CURDIR}/scripts/oracle +ORACLE_CAPABILITY= ${.CURDIR}/scripts/oracle/image_capability_data.json +ORACLE_TEMPLATE= ${.CURDIR}/scripts/oracle/image_metadata.json +ORACLE_OUTPUT_${_FS}= ${ORACLE_TMP_${_FS}}/image_metadata.json +.if ${TARGET} == "arm64" +ORACLE_SHAPES= ${ORACLE_METADATA}/arm64_shape_compatibilities.json +.else +ORACLE_SHAPES= ${ORACLE_METADATA}/default_shape_compatibilities.json +.endif + +cw-oracle-${_FS}.oci: cw-oracle-portinstall cw-oracle-${_FS}-raw + mkdir -p ${ORACLE_TMP_${_FS}} + # create architecture-specific JSON metadata + env TYPE="${TYPE}" \ + OSRELEASE="${OSRELEASE}" \ + ORACLE_CAPABILITY="${ORACLE_CAPABILITY}" \ + ORACLE_SHAPES="${ORACLE_SHAPES}" \ + ORACLE_TEMPLATE="${ORACLE_TEMPLATE}" \ + ORACLE_OUTPUT="${ORACLE_OUTPUT_${_FS}}" \ + ${ORACLE_METADATA}/generate_metadata.lua + + # convert raw to native qcow2 for zstd compression, saves ~ 8GiB + qemu-img convert -S 512b -p -O qcow2 -c -o compression_type=zstd \ + ${.OBJDIR}/${ORACLE${_FS:tu}RAWIMAGE} \ + ${ORACLE_TMP_${_FS}}/output.QCOW2 + + # Create GNU-compatible tarball using BSD tar + tar --format=gnutar -cf ${.TARGET} -C ${ORACLE_TMP_${_FS}} \ + image_metadata.json output.QCOW2 + + echo "Oracle image ${.TARGET} is ready for upload." + +cw-oracle-upload-${_FS}: cw-oracle-${_FS}.oci +.if !defined(ORACLE_PAR_URL) || empty(ORACLE_PAR_URL) + @echo "--------------------------------------------------------------" + @echo ">>> ORACLE_PAR_URL must be set for Oracle image upload" + @echo ">>> for testing, use a file:/// URL to a local directory" + @echo "--------------------------------------------------------------" + @false +.endif + echo "Please wait ... uploading cw-oracle-${_FS}.oci to ${ORACLE_BASENAME}-${_FS}.oci" + curl -s ${ORACLE_PAR_URL}/${ORACLE_BASENAME}-${_FS}.oci --upload-file cw-oracle-${_FS}.oci + echo "Uploaded cw-oracle-${_FS}.oci as ${ORACLE_BASENAME}-${_FS}.oci" + touch ${.TARGET} +.endfor + +cw-oracle-upload: cw-oracle-portinstall ${ORACLE_UPLOAD_LIST} diff --git a/release/Makefile.vm b/release/Makefile.vm index 5aa506ff6787..ec3e734285ce 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -274,5 +274,6 @@ cloudware-release: .include "${.CURDIR}/Makefile.ec2" .include "${.CURDIR}/Makefile.firecracker" .include "${.CURDIR}/Makefile.gce" +.include "${.CURDIR}/Makefile.oracle" .include "${.CURDIR}/Makefile.vagrant" .include "${.CURDIR}/Makefile.inc1" diff --git a/release/scripts/oracle/arm64_shape_compatibilities.json b/release/scripts/oracle/arm64_shape_compatibilities.json new file mode 100644 index 000000000000..dfd066b5474f --- /dev/null +++ b/release/scripts/oracle/arm64_shape_compatibilities.json @@ -0,0 +1,24 @@ +[ + { + "internalShapeName": "VM.Standard.A1.Flex", + "ocpuConstraints": { + "min": 1, + "max": 80 + }, + "memoryConstraints": { + "minInGBs": 1, + "maxInGBs": 512 + } + }, + { + "internalShapeName": "VM.Standard.A2.Flex", + "ocpuConstraints": { + "min": 1, + "max": 78 + }, + "memoryConstraints": { + "minInGBs": 1, + "maxInGBs": 946 + } + } +] diff --git a/release/scripts/oracle/default_shape_compatibilities.json b/release/scripts/oracle/default_shape_compatibilities.json new file mode 100644 index 000000000000..fe51488c7066 --- /dev/null +++ b/release/scripts/oracle/default_shape_compatibilities.json @@ -0,0 +1 @@ +[] diff --git a/release/scripts/oracle/generate_metadata.lua b/release/scripts/oracle/generate_metadata.lua new file mode 100755 index 000000000000..751b9680cc29 --- /dev/null +++ b/release/scripts/oracle/generate_metadata.lua @@ -0,0 +1,74 @@ +#!/usr/libexec/flua + +local ucl = require("ucl") + +-- read from environment variables +local os_type = os.getenv("TYPE") +local os_version = os.getenv("OSRELEASE") +-- the raw file +local capability_file = os.getenv("ORACLE_CAPABILITY") +-- the platform-specific file +local shapes_file = os.getenv("ORACLE_SHAPES") +-- base template +local template_file = os.getenv("ORACLE_TEMPLATE") +local output_file = os.getenv("ORACLE_OUTPUT") + +if not os_type or not os_version or not capability_file or + not shapes_file or not template_file or not output_file then + io.stderr:write("Error: Oracle metadata script is missing required environment variables:\n") + io.stderr:write("TYPE, OSRELEASE, ORACLE_CAPABILITY, ORACLE_SHAPES, ORACLE_TEMPLATE, ORACLE_OUTPUT\n") + os.exit(1) +end + +-- read files +local function read_file(path) + local f = io.open(path, "r") + if not f then + io.stderr:write("Error: Oracle metadata script cannot open file: " .. path .. "\n") + os.exit(1) + end + local content = f:read("*a") + f:close() + return content +end + +-- parse the template +local template = read_file(template_file) +local metadata = ucl.parser() +metadata:parse_string(template) +local data = metadata:get_object() + +-- update the simple fields +data.operatingSystem = os_type +data.operatingSystemVersion = os_version + +-- capability data is actually JSON, but needs to be inserted as a raw blob +local caps = read_file(capability_file) +-- remove all newlines and preceding spaces to match Oracle's format +caps = caps:gsub("\n", "") +caps = caps:gsub("%s+", "") +-- is it still valid JSON? +local caps_parser = ucl.parser() +if not caps_parser:parse_string(caps) then + io.stderr:write("Error: Oracle metadata script found invalid JSON in capability file\n") + os.exit(1) +end +-- insert as a raw blob +data.imageCapabilityData = caps + +-- parse and insert architecture-dependent shape compatibilities data +local shapes_data = read_file(shapes_file) +local shapes = ucl.parser() +shapes:parse_string(shapes_data) +data.additionalMetadata.shapeCompatibilities = shapes:get_object() + +-- save the metadata file +local dir = os.getenv("PWD") +local out = io.open(output_file, "w") +if not out then + io.stderr:write("Error: Oracle metadata script cannot create output file: " + .. dir .. "/" .. output_file .. "\n") + os.exit(1) +end +out:write(ucl.to_format(data, "json", {pretty = true})) +out:close() diff --git a/release/scripts/oracle/image_capability_data.json b/release/scripts/oracle/image_capability_data.json new file mode 100644 index 000000000000..01af71f73031 --- /dev/null +++ b/release/scripts/oracle/image_capability_data.json @@ -0,0 +1,96 @@ +{ + "capabilities": { + "Compute.AMD_SecureEncryptedVirtualization": { + "descriptorType": "boolean", + "defaultValue": false + }, + "Storage.BootVolumeType": { + "descriptorType": "enumstring", + "values": [ + "ISCSI", + "PARAVIRTUALIZED", + "SCSI", + "IDE", + "NVME" + ], + "defaultValue": "PARAVIRTUALIZED" + }, + "Storage.Iscsi.MultipathDeviceSupported": { + "descriptorType": "boolean", + "defaultValue": false + }, + "Storage.ParaVirtualization.EncryptionInTransit": { + "descriptorType": "boolean", + "defaultValue": true + }, + "Storage.ConsistentVolumeNaming": { + "descriptorType": "boolean", + "defaultValue": true + }, + "Compute.SecureBoot": { + "descriptorType": "boolean", + "defaultValue": false + }, + "Storage.ParaVirtualization.AttachmentVersion": { + "descriptorType": "enuminteger", + "values": [ + 1, + 2 + ], + "defaultValue": 2 + }, + "Storage.LocalDataVolumeType": { + "descriptorType": "enumstring", + "values": [ + "ISCSI", + "PARAVIRTUALIZED", + "SCSI", + "IDE", + "NVME" + ], + "defaultValue": "PARAVIRTUALIZED" + }, + "Network.AttachmentType": { + "descriptorType": "enumstring", + "values": [ + "PARAVIRTUALIZED", + "VDPA" + ], + "defaultValue": "PARAVIRTUALIZED" + }, + "Storage.RemoteDataVolumeType": { + "descriptorType": "enumstring", + "values": [ + "ISCSI", + "PARAVIRTUALIZED", + "SCSI", + "IDE", + "NVME" + ], + "defaultValue": "PARAVIRTUALIZED" + }, + "Compute.LaunchMode": { + "descriptorType": "enumstring", + "values": [ + "NATIVE", + "EMULATED", + "VDPA", + "PARAVIRTUALIZED", + "CUSTOM" + ], + "defaultValue": "PARAVIRTUALIZED" + }, + "Network.IPv6Only": { + "descriptorType": "boolean", + "defaultValue": false + }, + "Compute.Firmware": { + "descriptorType": "enumstring", + "values": [ + "BIOS", + "UEFI_64" + ], + "defaultValue": "UEFI_64" + } + } +} diff --git a/release/scripts/oracle/image_metadata.json b/release/scripts/oracle/image_metadata.json new file mode 100644 index 000000000000..eaea3dd1cad2 --- /dev/null +++ b/release/scripts/oracle/image_metadata.json @@ -0,0 +1,21 @@ +{ + "version": 2, + "externalLaunchOptions": { + "firmware": "UEFI_64", + "networkType": "PARAVIRTUALIZED", + "bootVolumeType": "PARAVIRTUALIZED", + "remoteDataVolumeType": "PARAVIRTUALIZED", + "localDataVolumeType": "PARAVIRTUALIZED", + "launchOptionsSource": "PARAVIRTUALIZED", + "pvAttachmentVersion": 2, + "pvEncryptionInTransitEnabled": false, + "consistentVolumeNamingEnabled": false + }, + "imageCapabilityData": "REPLACE", + "imageCapsFormatVersion": "23cfd738-ad9c-4f56-9281-67be6c8cd14c", + "operatingSystem": "REPLACE", + "operatingSystemVersion": "REPLACE", + "additionalMetadata": { + "shapeCompatibilities": "REPLACE" + } +} From nobody Wed Mar 5 00:51:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6vBq4l91z5p3nJ; Wed, 05 Mar 2025 00:51: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 4Z6vBq3R9Fz3C6k; Wed, 05 Mar 2025 00:51:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741135907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPDfDeLnwMBeEDk26Qm5SdZ1RN/5tFcFEIGki1AAcT0=; b=mElJ/pwXpTLaxrCqP4M9LpFSBoQ0eYMV8QN0Pw86hiUKwAPnFDBPgqD9HhPS28EOsJNQjw o7uGja5Ba3Juz+S3eU0GunJ0g8FEsSNr3y4w392WaibMV45ozPnxXW5yzFWmL5vuh9FknU rHbMxIcPZmHK0DdbFepi5MLhQvCtZHuMq5m+7iu5G4ngHkIuIV9i+g7I6lVfvWxW18qjqE 3rH2rlr+0CUC5NA2FAhA7v5akaEPo9BFU+YgX/dbJS4JUukvlpUR/8ujfAgNAo3D66lYJ7 48xF+Urp22dQSMaV0k9qe0yuPsJmLNQ7I7F8NOm7aqa95iOL5iI+l/tRJELqFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741135907; a=rsa-sha256; cv=none; b=kHxFZsftdWgXqZ59dgst2bSFT8+5kZVKIeCv0h8GPWwWa1FN178tEOn18JUt5LZdijq+G5 0qIjzkiSa7UCf3xV7Lrskq5wetkAvU9nbwabwSzeSRVWhVVIcas3YbwgmUPWCtwQq17HP/ HPXsNwi72q7pUjgb0VY4F3vBSN7xlKzXNlj59QMGnUsqX03DL7XbdXopSix2IrgHCKmQrD TNPs9Fh4jRqU0PSisbNAMjGqSW2TJZFubYDGfLbd+/fCYoR7FVxI34EU5jLGBTaFs6c8Qu LBIH7kuylR7UnEGN1u7Fg9eFtjsUfRS9klMSucZ3dB7mir6kyOJdzUTgegSyhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741135907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPDfDeLnwMBeEDk26Qm5SdZ1RN/5tFcFEIGki1AAcT0=; b=xQFvEaEtA4WJKoo2DT/RrZMadDkoK+RSdzHAO/Mr2FRDmdUt8vbFqW3WILCmB7XDsAXrKv G583cjf/7NUYiP3ub03CdBFFVM+zk4amagvFeoageX13AyLYkbGveFs4gEQCjyL6gjCeSx yDQZanguw37bI0DSrEnVxNoSjVaTFJEaYFLqRapmQ54GNuzpAFLqXDGVlFsNOaaK900m2k ZzPTHym1SBOpU6XXBbGSYuJMxKMGLTdQ3DkDmVheo6rSRzO6uKnD4giLNjHp+JR8krX6LL pxVI6W9ozfrPeDJe1V18tmLJuFvLPFKRsRTevKdcCu4wAln2V+zoXL5xQOVZag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6vBq2sNMzj2W; Wed, 05 Mar 2025 00:51: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 5250pllQ074441; Wed, 5 Mar 2025 00:51:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5250pliV074438; Wed, 5 Mar 2025 00:51:47 GMT (envelope-from git) Date: Wed, 5 Mar 2025 00:51:47 GMT Message-Id: <202503050051.5250pliV074438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8ebb0781f536 - stable/14 - acpidump: do not use pointer arithmetic to check for overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ebb0781f536be8805975a75bea9be1fa453f1bd Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ebb0781f536be8805975a75bea9be1fa453f1bd commit 8ebb0781f536be8805975a75bea9be1fa453f1bd Author: Konstantin Belousov AuthorDate: 2025-02-26 05:24:30 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-05 00:51:29 +0000 acpidump: do not use pointer arithmetic to check for overflow PR: 204945 (cherry picked from commit 8c108dccd7f878ad44aaef1f5bfb5622666bd09a) --- usr.sbin/acpi/acpidump/acpi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 31c3045ab6ea..385a0a3c36fd 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1222,13 +1222,14 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) vend = vaddr + len; while (vaddr != NULL) { - if ((vaddr + sizeof(struct TCPAevent) >= vend)|| - (vaddr + sizeof(struct TCPAevent) < vaddr)) + if ((uintptr_t)vaddr + sizeof(struct TCPAevent) >= + (uintptr_t)vend || (uintptr_t)vaddr + sizeof( + struct TCPAevent) < (uintptr_t)vaddr) break; event = (struct TCPAevent *)(void *)vaddr; - if (vaddr + event->event_size >= vend) + if ((uintptr_t)vaddr + event->event_size >= (uintptr_t)vend) break; - if (vaddr + event->event_size < vaddr) + if ((uintptr_t)vaddr + event->event_size < (uintptr_t)vaddr) break; if (event->event_type == 0 && event->event_size == 0) break; From nobody Wed Mar 5 01:19:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6vpq1HTJz5p6hw; Wed, 05 Mar 2025 01:19: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 4Z6vpp6cNKz3YQX; Wed, 05 Mar 2025 01:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741137570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liomlupZK3fRH96imfzyrmBNrkjMggCHc+aXEJ4NBSs=; b=PQoIDzdOBHfCQUQnBfmFY46G7yuHdhdJpNfRD6w8Vr3wOaYo4jWMioMBsKXWyPQPv78dXb QJ/8lTfFez/A3OCpDI0PMTcHxRf1d4gR7lTE/LnS/Vs2w+lA577UPV7jTGYMgUq2OoPbpP tYJQO7wpoZjW53M9LkPuQrq3PvIH+o97O6aShrAyyYKg6ATAK2m2w8g3PTe9uuKZQMO50Q ptqeXzRmbpd4kFIm7NU3nAYiSEZe/lZ0JRrLJoz6tKFoaVylP4PyeaCdcGWO+d7RvvO9s+ aWUxQYb5qxAGfUIwW3UXoRmP5LRqLeNCEvFJKRIvTFV46jukWEiRkLjOZqCvUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741137571; a=rsa-sha256; cv=none; b=GdRF0utNIdReGoXVGji5dwBZ88D7vNNAMSSCVUIZlBwdTS2kaPJgT+UdhhFVnlwTDNefYs RDLBYTOlHPUUDJyLQQTnk7+k/a/srpN3ImIavytJ338Cv3xFSuYF24GFDHLWNsiEc+S1d8 94f4KnkmbfcaZTD8jd+bB8l/LNFqAqSj+FobJdJZtUZjYh1PrGPZrdX0ukX70J1ARHrSL1 uEkF81rl5xBrdkaJV9lUcQ1y4Q9KDigUkGriaYqE7qREouJKsjDTfDJCdKwGf8zSFhZ1+p 6IxRDxrv3O8KzCCWI61fS2NH2QabYcSnoO/DB9QgFTIQ1N0R8PxW0ozmXgqmDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741137570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liomlupZK3fRH96imfzyrmBNrkjMggCHc+aXEJ4NBSs=; b=lhE/2oIOHUS8S3Yf98QtYIuGZk1rEDBak5UvnFfuboMpnHhRvAE0ekJZJQQL9bCgaerAaC Eco5oFbCbjh8qb5sScQmdFE3zDn9e3BT9CDR7JqpLIYHHDuPRLnHLq3LVSZyxpqXKetJqv Yqhuw8FORCaDihlW9pu0WzrBVBX7/tjDdRzaiSg8rqQx5nCyvKW6P/5GUHms5IGqunN8XJ 1tGdOIfFQBRp6ruK69frwr3qWesnFeD6GOZT1PAT5VDq7PTDx6n5vv2Jv5JwUs94NRWruQ hTuP4C6M7o2zjy7iML54+CaoYkq623/viOAjLvI7dBdfvr55A/Fisur+BfALbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6vpp62V7zjtT; Wed, 05 Mar 2025 01:19: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 5251JUjQ016504; Wed, 5 Mar 2025 01:19:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5251JUOY016501; Wed, 5 Mar 2025 01:19:30 GMT (envelope-from git) Date: Wed, 5 Mar 2025 01:19:30 GMT Message-Id: <202503050119.5251JUOY016501@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: 22b0052fdd95 - main - geli: Fix signature mismatch in mountroot callback List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22b0052fdd95f2b4b2a4fc004c4d2a1e310e1195 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=22b0052fdd95f2b4b2a4fc004c4d2a1e310e1195 commit 22b0052fdd95f2b4b2a4fc004c4d2a1e310e1195 Author: SHENGYI HONG AuthorDate: 2025-02-23 17:12:57 +0000 Commit: John Baldwin CommitDate: 2025-03-05 01:19:10 +0000 geli: Fix signature mismatch in mountroot callback This is required for kernel CFI. Reviewed by: rrs, jhb, glebius Differential Revision: https://reviews.freebsd.org/D49111 --- sys/geom/eli/g_eli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index a9f356299a8d..5bd2d465183e 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -194,7 +194,7 @@ zero_geli_intake_keys(void) } static void -zero_intake_passcache(void *dummy) +zero_intake_passcache(void *dummy __unused) { zero_boot_passcache(); zero_geli_intake_keys(); From nobody Wed Mar 5 01:19:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6vpn6yGKz5p6cY; Wed, 05 Mar 2025 01:19: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 4Z6vpn6DSqz3YF2; Wed, 05 Mar 2025 01:19:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741137569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOUi7WR4PdRKnRkU95qn2SMG3sOncIEw6fWGMUNx48U=; b=M0+Cxvr19vugCVNnyti4Y7eU5hs6rJvwdBZTXKslMkO3EcvuYQvJ9c7nNauhtKTcuUcsIW HV7dciHmNKMBFSpm0YLoNJ0Oxb6IQux17uRoh4zR15ET5EB7A6aizlih62Yzfe1/stoWSp BIU2htpPWLshvizZoOY7qN/98Hq6t8ddFO4iQIZ/xFnHLUUN8aoMYx9uVwePSbVLgf/+Xx MLbe8B9bWtdQ5drxq3QIchSdolP4BDNpqvD1/+K+4oyRO3SjdgT1+Nn4K9OdmahSBujPl5 gH/2h+dqyAvdlJvpQWBDTOp8Joypv/hS2HaGMoHKS0R/YCyZQrxPiGXj639/AQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741137569; a=rsa-sha256; cv=none; b=Oy7Ja3UQhDp38MQCEpULC1/5MH9uXM/LfBU+/ie49ZNxlVLQOCUFjOU3+D8w8zHfvVmBCU yS67qa61SSlcBHG50d04mKrxMGPc8KFS55RcoxXEzJ4b0gO0bC04cW1QWFvxT/zbdtxYe1 7IZoBUPlh+OlU+MFclzaBtYiLYqGB8kFzpFu6g53uEGe3kV1K8vNCjNbZODtK3n07Y4UiO l3+Mm2Ye22+UWiKWV/jJuDLgtiIGRA+gImyXJ1q/m413uRHtUVBqiFcFP9OPcRFR6hBO+7 7a/whyE9tfUnlfd7qzipqlkne8j91LnqP92aZw5wwJNzprixevC+75FHQI1nsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741137569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOUi7WR4PdRKnRkU95qn2SMG3sOncIEw6fWGMUNx48U=; b=Oq/ALR1nSLBhqLM9CGSVI4jMfbDSGVTp+ANZGhYuZjFi68pLsovGouvvhRtAiM4p0SHHDI i38iqKiVBIFpLDxn3sAnFabOcrf2eRunhjHD34A+dD5wz1kPVE7T3ZMnEfWq2gH9+kzKYr TFQAVROjzrZLbWMLR7ZJLXGL+ifRhpcWcQEyfoDtpNT331Ijc2k1wjhNTVVM6kkk6E4caj 2QjSIvMDl+uB7XcTxkjlhGQ/8O3JSbXNzm4X+dJU6s2uIjf769SNuB+XVcLTiqDEz5Lsk9 wjvesN3wXMdIjzUkG8NPCo0gCJu24vSIzoInRFi9i1/9mflMVDQtZTcciiZSRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6vpn5S04zjtS; Wed, 05 Mar 2025 01:19: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 5251JTJn016471; Wed, 5 Mar 2025 01:19:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5251JT3k016468; Wed, 5 Mar 2025 01:19:29 GMT (envelope-from git) Date: Wed, 5 Mar 2025 01:19:29 GMT Message-Id: <202503050119.5251JT3k016468@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: 8ee127efb045 - main - vm_lowmem: Fix signature mismatches in vm_lowmem callbacks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ee127efb045caf5ad9522f3c63c7e18f9d7279f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8ee127efb045caf5ad9522f3c63c7e18f9d7279f commit 8ee127efb045caf5ad9522f3c63c7e18f9d7279f Author: SHENGYI HONG AuthorDate: 2025-02-23 17:12:57 +0000 Commit: John Baldwin CommitDate: 2025-03-05 01:18:52 +0000 vm_lowmem: Fix signature mismatches in vm_lowmem callbacks This is required for kernel CFI. Reviewed by: rrs, jhb, glebius Differential Revision: https://reviews.freebsd.org/D49111 --- sys/compat/linuxkpi/common/src/linux_shrinker.c | 2 +- sys/dev/drm2/ttm/ttm_page_alloc.c | 2 +- sys/kern/kern_exec.c | 2 +- sys/netinet/ip_reass.c | 11 ++++++++--- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/tcp_subr.c | 2 +- sys/netinet6/frag6.c | 2 +- sys/netinet6/ip6_var.h | 2 +- sys/ufs/ufs/ufs_dirhash.c | 4 ++-- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c index 18200fa0bc01..e06490b92ed1 100644 --- a/sys/compat/linuxkpi/common/src/linux_shrinker.c +++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c @@ -120,7 +120,7 @@ shrinker_shrink(struct shrinker *s) } static void -linuxkpi_vm_lowmem(void *arg __unused) +linuxkpi_vm_lowmem(void *arg __unused, int flags __unused) { struct shrinker *s; diff --git a/sys/dev/drm2/ttm/ttm_page_alloc.c b/sys/dev/drm2/ttm/ttm_page_alloc.c index 7518ecb4dfd1..724ba0bfb4d8 100644 --- a/sys/dev/drm2/ttm/ttm_page_alloc.c +++ b/sys/dev/drm2/ttm/ttm_page_alloc.c @@ -441,7 +441,7 @@ static int ttm_pool_get_num_unused_pages(void) /** * Callback for mm to request pool to reduce number of page held. */ -static int ttm_pool_mm_shrink(void *arg) +static int ttm_pool_mm_shrink(void *arg, int flags __unused) { static unsigned int start_pool = 0; unsigned i; diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 51bbdeaaa55e..f6d0201f9b37 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1475,7 +1475,7 @@ exec_free_args_kva(void *cookie) } static void -exec_args_kva_lowmem(void *arg __unused) +exec_args_kva_lowmem(void *arg __unused, int flags __unused) { SLIST_HEAD(, exec_args_kva) head; struct exec_args_kva *argkva; diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index a95780aa2f27..177069f5e010 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -670,6 +670,11 @@ ipreass_drain(void) VNET_LIST_RUNLOCK(); } +static void +ipreass_drain_lowmem(void *arg __unused, int flags __unused) +{ + ipreass_drain(); +} /* * Initialize IP reassembly structures. @@ -711,10 +716,10 @@ ipreass_init(void) maxfrags = IP_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain, NULL, + EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain_lowmem, NULL, + LOWMEM_PRI_DEFAULT); + EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain_lowmem, NULL, LOWMEM_PRI_DEFAULT); - EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain, NULL, - LOWMEM_PRI_DEFAULT); } /* diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 185530e3bc5e..55b452743f86 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -6823,7 +6823,7 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) } static void -sctp_drain(void) +sctp_drain(void *arg __unused, int flags __unused) { struct epoch_tracker et; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 4baeb6f8f2d2..03efc759092d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1384,7 +1384,7 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, } static void -tcp_drain(void) +tcp_drain(void *ctx __unused, int flags __unused) { struct epoch_tracker et; VNET_ITERATOR_DECL(vnet_iter); diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index e976298bf984..f6bb6e94ed08 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1078,7 +1078,7 @@ frag6_drain_one(void) } void -frag6_drain(void) +frag6_drain(void *arg __unused, int flags __unused) { VNET_ITERATOR_DECL(vnet_iter); diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 1aa170f6ed2b..12b00d4f9934 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -414,7 +414,7 @@ int route6_input(struct mbuf **, int *, int); void frag6_init(void); void frag6_destroy(void); int frag6_input(struct mbuf **, int *, int); -void frag6_drain(void); +void frag6_drain(void *, int); void rip6_init(void); int rip6_ctloutput(struct socket *, struct sockopt *); diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index 92f067f5af8c..dd0405d3aeac 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -98,7 +98,7 @@ static int ufsdirhash_findslot(struct dirhash *dh, char *name, int namelen, doff_t offset); static doff_t ufsdirhash_getprev(struct direct *dp, doff_t offset); static int ufsdirhash_recycle(int wanted); -static void ufsdirhash_lowmem(void); +static void ufsdirhash_lowmem(void *, int); static void ufsdirhash_free_locked(struct inode *ip); static uma_zone_t ufsdirhash_zone; @@ -1247,7 +1247,7 @@ ufsdirhash_recycle(int wanted) * Callback that frees some dirhashes when the system is low on virtual memory. */ static void -ufsdirhash_lowmem(void) +ufsdirhash_lowmem(void *arg __unused, int flags __unused) { struct dirhash *dh, *dh_temp; int memfreed, memwanted; From nobody Wed Mar 5 03:31:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z6ylV5GHNz5pQt1; Wed, 05 Mar 2025 03:31: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 4Z6ylV1nxHz465N; Wed, 05 Mar 2025 03:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741145510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0JMwm+hJFKKRbXQHfepuwAja5HiDgt3llg38CUKeuDk=; b=r0oyY8pOJCf3PsWw4KmiABhc7rHfYbsrGOVeyUEWHjCdGvzPxHL1htoit+ffOygiAzttyz dR8Clm4GDvRcVyijaazUR1YhDiBsjkTMJrFPSQDbWtQWpnoQ/ex9ljENl/LuNB3M37A4SA OPv+K5Pr3ncuO3Jn382vBrQqzjEKMyOhBnV5On3i0UpoVRRSkvayz0oaKXQFLH7ClhwMei a6rpDH6cqugJiWhPRJ70BZGHkDYjcghzkGvTCGghfykL9B2xvDQXHjCiZPGdw6peyKknYe haiJCXkg3hZXWcM93WtFXX16fX1M1AJCfEyjfxC+KnwZ1iMpPeV/3a3Dnyq0Tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741145510; a=rsa-sha256; cv=none; b=Qpwfwh1nkz2Rcr5+a+kY2IeSsWdAgu7qY4RoaPG2ErNhvMZA8KWwJuWZHkjKnv/cFdR1Xk B6IyaSeTNURnRGqFbqNRwi1OeSHa7M9G2/83gtz7+hrc33wWIasHOSWXA5Gyv5bw3E4gSx DGeTiAmp0xeubAHsM5oBjrdu6sObB1Kn28n+DHxw8pq+FXMl1FhmCCL4GQpqby1tvyFE2T tJUrtBaUAs3BKpFYgT51JV/ggia6aa38BIvbCa6RKC299OBILE2XICDrGRf4JPjOvXf9QB b8NJHJLu29SJXQfOUP54gqg6djhYkhI0IlF1pvrK6NIDqosma+b1C0+vNnyXQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741145510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0JMwm+hJFKKRbXQHfepuwAja5HiDgt3llg38CUKeuDk=; b=fJGrUDhXEbh2Uzc/7XMOq0R6Lkp5hdOrQufldLRXrirhRPAhxBxpdVTJ47jHf26ws5y6bS AAAzi1bZSQShvMhV9oCuQXFFKqEUCGIUny+cK75LU5vHE3igmgNXlEcVQdltpRiHW9CtCP vTKOuGP8tSTmodgx6JuYld8jrCvbq+42w9/v+yE0mVim9iRCzE6WiufPnRRcqRqtA+36+J wRIgbfD5qlxhzIYN6CtlazOJ0mqqaDM9Reu5OUA5R/Lj6bBBai2K76iNcaY8IuX07FmSKF cBWYWMHcVXzyhnTyAxEm4rtYoeuTIxtu086lCRWJZABQwWfv5WMwmsp/l1EmsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z6ylV196LznbN; Wed, 05 Mar 2025 03:31: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 5253VoSJ075340; Wed, 5 Mar 2025 03:31:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5253VoHI075337; Wed, 5 Mar 2025 03:31:50 GMT (envelope-from git) Date: Wed, 5 Mar 2025 03:31:50 GMT Message-Id: <202503050331.5253VoHI075337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 057409d0259f - stable/14 - nfscl: Return appropriate reply status for NFSv4.1 callbacks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 057409d0259f9b3f4ae46c1eccc1e9227502c2ec Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=057409d0259f9b3f4ae46c1eccc1e9227502c2ec commit 057409d0259f9b3f4ae46c1eccc1e9227502c2ec Author: Rick Macklem AuthorDate: 2025-02-19 23:34:53 +0000 Commit: Rick Macklem CommitDate: 2025-03-05 03:30:00 +0000 nfscl: Return appropriate reply status for NFSv4.1 callbacks Certain NFSv4.1 callbacks are not currently supported/used by the FreeBSD client. Without this patch, NFS4ERR_NOTSUPP is replied for the callbacks. Since NFSv4.1 does not specify all of these callbacks as optional, I think it is preferable to reply NFS_OK or NFS4ERR_REJECT_DELEG instead of NFS4ERR_NOTSUPP. This patch changes the reply status for these unsupported callbacks, which the client has no use for. I am not aware of any NFSv4.1 servers that will perform any of these callbacks against the FreeBSD client at this time. (cherry picked from commit 56c8c19046c46cb9e89c2a3967f8cf2cd0ace428) --- sys/fs/nfsclient/nfs_clstate.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index b00de78ef591..af8297b68c0e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3993,6 +3993,25 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) NFSUNLOCKCLSTATE(); } break; + case NFSV4OP_CBNOTIFY: + case NFSV4OP_CBRECALLOBJAVAIL: + case NFSV4OP_CBNOTIFYLOCK: + /* + * These callbacks are not necessarily optional, + * so I think it is better to reply NFS_OK than + * NFSERR_NOTSUPP. + * All provide information for which the FreeBSD client + * does not currently have a use. + * I am not sure if any of these could be generated + * by a NFSv4.1/4.2 server for this client? + */ + error = 0; + NFSCL_DEBUG(1, "unsupp callback %d\n", op); + break; + case NFSV4OP_CBPUSHDELEG: + error = NFSERR_REJECTDELEG; + NFSCL_DEBUG(1, "unsupp callback %d\n", op); + break; default: if (i == 0 && minorvers != NFSV4_MINORVERSION) error = NFSERR_OPNOTINSESS; From nobody Wed Mar 5 05:00:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z70kL41Sgz5pYw8; Wed, 05 Mar 2025 05:00: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 4Z70kL0ShHz43sg; Wed, 05 Mar 2025 05:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741150858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKSmlFxx79N+dUJb+xiKnGB2H+lFht1pTXVagLNgFvY=; b=XKXmpmbNOB0mwsE1ctR7t+3HRznIPeAMe0nihZCSX+vyxd+JtWI6hj2EekpuDG94nQtTIP YP2/2z/H7bs2RSCuajw/qzezjZxOLwPXEy9Gutrccn7oLuwMeWXTd2B73ru5rBPNQwFM8N QGH1+LQO2YvKftR3uVPrZmX96egU/WfixYpJROektGoMciNmVtxlBFxTqikUgXFKiAzLRF 9AawE5fZDvqn0xIE6YmVzTam9khELmgSNaC96PZkZSgW+PIno7ZDDmTIa8PjR+R37S3+B9 B4aG89T0Ut5Tnol/D9oCeEEzgPK+fNkLh7BXWxPpyRVOrsKKBNLq0cdo70DtnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741150858; a=rsa-sha256; cv=none; b=VPs03ahms4HFWloX8WX4Q4nQVq2kvpDVwDS2tzJD70J6TE62GSOn7284Lq9JXEV895PRfZ loGdaSM/n8CESgtSR9spCIwdy/ChYjtgc8QgUlhX0eosh1V2hzbL7Pf11ObNDAAxJPFmJn h+UBZamRJdV61FIi1HFBkvepNhnaHBySecc19jhX+4NfWsapU1kEHjdT+S7G1qjrG19paQ UQVXS6xaI4lLrAOzD1hzdALXhvYvV3zpgqPK3qoRTBroBRdKP9TYzRoHx3ZoCLHmkIuLnQ Lw6pUJxAHkuf/C6Kwh12iT2KCVzHOTmXbXpshAQDDsY94LnGuVY96c3Osi86sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741150858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKSmlFxx79N+dUJb+xiKnGB2H+lFht1pTXVagLNgFvY=; b=ssYQKoz7n/zqSmyrLi3FxqQGcF8z7I8btESVLM3+MAfTjIKoB+mccZriYMkbNbxtkMaQzR ihwhGr30BlM1iwaMy/HWBfR+lNicJgweRwjU3QXrIkQPOJOnCpEpe0qfY3YzDQpdtOkG0b ObqzHDDX6UkPrOPGIGQoSBFsOC6CoaPQsn9XKYGDGzSTGxGtWC9TJwmfcvwOrLHUWT3bwL hccwitkcrOs7z2qaqysnKc4jbuhZnOoGbUOVLIcH0IKCp7lCH25FhQf6xRsDdxzV9FmxDi Jj6EjKLwAtH+uol+wD92awnIPxiEVMSYwWqzka2S9TvjnDro3Bhg/QB5FVNveA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z70kK0rSvzqHP; Wed, 05 Mar 2025 05:00: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 52550vcH039092; Wed, 5 Mar 2025 05:00:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52550vhk039089; Wed, 5 Mar 2025 05:00:57 GMT (envelope-from git) Date: Wed, 5 Mar 2025 05:00:57 GMT Message-Id: <202503050500.52550vhk039089@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: 2472f4dbe930 - main - udp: Do not recursively enter net epoch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2472f4dbe93049d70afe0897f66f9651b67672e9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2472f4dbe93049d70afe0897f66f9651b67672e9 commit 2472f4dbe93049d70afe0897f66f9651b67672e9 Author: Zhenlei Huang AuthorDate: 2025-03-05 04:57:30 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-05 04:57:30 +0000 udp: Do not recursively enter net epoch The only caller udp_send() has already entered net epoch before invoking udp_v4mapped_pktinfo(). No functional change intended. This partially reverts commit d74b7baeb0d4 (ifnet_byindex() actually requires network epoch). Reviewed by: ae, glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49227 --- sys/netinet/udp_usrreq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 2c68d0880100..b3d980956b66 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1040,6 +1040,8 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct sockaddr_in * src, struct in6_pktinfo *pktinfo; struct in_addr ia; + NET_EPOCH_ASSERT(); + if ((flags & PRUS_IPV6) == 0) return (0); @@ -1061,11 +1063,7 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct sockaddr_in * src, /* Validate the interface index if specified. */ if (pktinfo->ipi6_ifindex) { - struct epoch_tracker et; - - NET_EPOCH_ENTER(et); ifp = ifnet_byindex(pktinfo->ipi6_ifindex); - NET_EPOCH_EXIT(et); /* XXXGL: unsafe ifp */ if (ifp == NULL) return (ENXIO); } else From nobody Wed Mar 5 09:32:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z76mC65jpz5pWb5; Wed, 05 Mar 2025 09:32: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 4Z76mC39Y7z3xCV; Wed, 05 Mar 2025 09:32:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741167179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uIptb1NHNDcHsOHJB83oyCE0a8g/+MbF8Z42olsgiCc=; b=itXlitVcU8DZ/GwfvimU/RwtLQUiQaz/vMPGYHoaFAc67k1vTXw4d7YQIWSsaXAedbhkJ+ JO1nTP8RILPQutsSSu4fnGM9DF03LXz+cSzHrsxKLl5o0ZIfCk6KqD8JBwSBu7iZurQzBG KpvaJkJ2UjCN5N9sCxjN+iycPSnfTIOaCMHscfWlXePm/JQsBdSd/0K4P9IRwpJyVE8fnQ OwF98j1cSLE874ph+CzvvxnYSACfYDrswQtVImYwYYCwq+4BXdVXopJ+xvLPwxvB4xH46Y LwmHWfpbcB5Y68Mjz5Wwuk5XA7gAMk/Ca3SBZhOiEn1YyojNbGQX9DucC3y8Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741167179; a=rsa-sha256; cv=none; b=bO5Zhmn2N0b/3Bz8/SzkcIqtvdIyL42A+b+RpUrq97qZItUFYlNSXScylSgfN61p+/haHI 9EaP5kbZc8FEHMwwFgQFSGkdto9/oFfUlrn9OuIX8uIfuf+5BI+1h5f9kaioBIGTpMtfIH RpZ7CiZtWX91iKXNZ4k+zA8b93oEz0kGTM0FJDpkwdlOC+klH2t7ldZ5SIjiLWmvn7RNNX 4YxhJhL2QG05nikJZ9sc0h/Xr063nq1d4gH/iyTSHiqgLkTRQzUCCABJneT7rb01YNzbQk Zy9XY2267X8h3LI/c1IuyGCoqMFXHozxN6B111zyHOGxpxZGsCABUl+sIFf+XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741167179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uIptb1NHNDcHsOHJB83oyCE0a8g/+MbF8Z42olsgiCc=; b=Lp6lHIALkqV6ngRi+Pa+zdYZba/9LMn6vh2d9UXITNrayBrNlDNGKQ43xyx8h6q6/xJ211 xszd1e2YDHq43nIl7a71XnvSWj8I+9u9z2YurCA8H/Nl4dLbDeUDx8J6p2JbAsirCp2SL5 Qaar907mOwuhSkkUbwNPxHhtkc2mdu0SUJJl6PdDfZtQPBBWBjZRUU5sNVo412TWmnhCBp gxoG15dIRYmmW/+20QAhdoes5B0KVzF1Zl2ogGBDvKgTozN+V7StVCJ6rejpE9yDmdM+n1 kFOr6SVxYyoxN6aF5k0oKXFFXT08zk2YbErQQ8h+88rJfSGw8ZMgQuhP08CyDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z76mC2dtyzyZJ; Wed, 05 Mar 2025 09:32: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 5259WxXj051846; Wed, 5 Mar 2025 09:32:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5259Wxoe051841; Wed, 5 Mar 2025 09:32:59 GMT (envelope-from git) Date: Wed, 5 Mar 2025 09:32:59 GMT Message-Id: <202503050932.5259Wxoe051841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: b405250c77e6 - main - ipfw: fix dump_soptcodes() handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b405250c77e6841a8159a4081d4e0f61e49dfbf8 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=b405250c77e6841a8159a4081d4e0f61e49dfbf8 commit b405250c77e6841a8159a4081d4e0f61e49dfbf8 Author: Andrey V. Elsukov AuthorDate: 2025-03-05 09:29:22 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-03-05 09:29:22 +0000 ipfw: fix dump_soptcodes() handler Use correct indent number to dump registered socket options. It is not currently in use but can be used for debugging. PR: 283970 MFC after: 1 week --- sys/netpfil/ipfw/ip_fw_sockopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c index 907baafd878d..19f5fff2749a 100644 --- a/sys/netpfil/ipfw/ip_fw_sockopt.c +++ b/sys/netpfil/ipfw/ip_fw_sockopt.c @@ -2555,7 +2555,7 @@ dump_soptcodes(struct ip_fw_chain *chain, ip_fw3_opheader *op3, } olh->size = size; - for (n = 1; n <= count; n++) { + for (n = 0; n < count; n++) { i = (ipfw_sopt_info *)ipfw_get_sopt_space(sd, sizeof(*i)); KASSERT(i != NULL, ("previously checked buffer is not enough")); sh = &ctl3_handlers[n]; From nobody Wed Mar 5 09:38:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z76tC3yKjz5pWnG; Wed, 05 Mar 2025 09: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 4Z76tC3Hcgz411S; Wed, 05 Mar 2025 09: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=1741167491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j6g9l5peouzpLUS7X/m1h78YzDf+zJsbJCyh683BK64=; b=WfTLCtxvw/xKe6sXWf6n66DehfefZVhJnTZ8FvvF7+tACizQ4HShTVqd356gsxTMUnaTHO gZC8kNJSi5BQvudvOS9cj3LOa+Tb1xUyI7iYY32/W41E5B25h3x7tmEBLmn2pRZB9IOkpT lj/X7zpBN+InYKStdVADYGCdSMHilGocdhC0KTBuvZ+Rt21L2vhLjBAbz0GeWEzDApRaHo YRFqu4Xu3bvy5BV+zT9q6ZOWhSe2zhoxn+Bx9euS82ouigSbliseHwd+3ef5dIe3gTBVOk HpUeFSUqS45NI1nWZrl2YQuYoi6edPiJcLlzgX2/brXb/8+IjP370eMq6LRCrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741167491; a=rsa-sha256; cv=none; b=foizuar4utMzCz4VW7pwgbHpowA9NwIfD1MGeMNBsw7HoUC+rFwgI5JKiJLmyqvlFQWg3+ tv6R+9nw1E+b00EOduNsY5KubxmBismQOKNR3baaNhaCk897VdYuS/LN3z3axNqireKNCS AH16NpdRQx8IPDDbM8Y3+vJNWGIyfDmg7uAHdGc8Jz3zlYDrm0XxRAy+W1ziTTJytJH/nA Uh6JanIP7uvMnent3C7A/QKR+CZxG/p9AE5UEnbeGKUXEnZk8ZJzAS5DTTRjZV2gDaGIFY sHwc86i172+YPmTaGuvVCPPUYFqwd+mT9aD50cwmGP3TKzgzKDz2+osR2RPn7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741167491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j6g9l5peouzpLUS7X/m1h78YzDf+zJsbJCyh683BK64=; b=RSFNcpAUGKoiePgH1Jx+2vgqEWXUSoi7q88XOFmALhb+X9QnpSWBDOeAz/S1tyIvjZtpPO Mu9r1DeZ9hlN34L0wOWYCLUQyKLf6msUxHILAKAo+PyLl4jSWmHn9z+G+KZQlaSLg9o/r6 hfGL5Pr/nMlsDGo+G1SKcMS4Qnlt4GPtOIHMmvR9LbDYvc8WaQi4Fmy4tfGkf/voKmB2ZH ON3F8yVLVbSYNaAYTDY5hYjzbPDtexwWYXa7yfVdyBYuPX2DSrGn0NX8asPcy7+9hBq1o1 6NZwMjYqXua56wVHMa6IYNumdhwB7AsOd3Al48kg+ONa2eb1Jwin6/J04zXTsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z76tC2c7WzypH; Wed, 05 Mar 2025 09: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 5259cBrj053554; Wed, 5 Mar 2025 09: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 5259cB6d053551; Wed, 5 Mar 2025 09:38:11 GMT (envelope-from git) Date: Wed, 5 Mar 2025 09:38:11 GMT Message-Id: <202503050938.5259cB6d053551@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: e9a490b10d6c - main - pf: fix ICMP source address translation for nat64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: e9a490b10d6cf2006bc2442648f8b2de39aacc5f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e9a490b10d6cf2006bc2442648f8b2de39aacc5f commit e9a490b10d6cf2006bc2442648f8b2de39aacc5f Author: Kristof Provost AuthorDate: 2025-03-04 16:13:38 +0000 Commit: Kristof Provost CommitDate: 2025-03-05 09:37:56 +0000 pf: fix ICMP source address translation for nat64 While handling an ICMP error related to another state (e.g. TTL expired, port closed, fragmentation needed, ...) we can't just use the state's source address as the ICMP source address. We have to translate the IPv4 address back to an IPv6 nat64 address. Failing to do so breaks things like traceroute, where the intermediate router generates an ICMP error message, and the traceroute tool uses the source address to build the path. Use the state's source address to figure out the prefix, and copy the IPv4 IP address to the last bytes to construct the mapped IPv6 address. PR: 284944 Sponsored by: Rubicon Communications, LLC ("Netgate") In collaboration with: sashan , dac07517c7 Differential Revision: https://reviews.freebsd.org/D49143 --- sys/netpfil/pf/pf.c | 72 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e0b664772544..2b28474f36c6 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8025,10 +8025,6 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &nk->addr[didx], pd->af, nk->af)) return (PF_DROP); - if (nk->af == AF_INET) - pd->proto = IPPROTO_ICMP; - else - pd->proto = IPPROTO_ICMPV6; pf_change_ap(pd->m, pd2.src, &th.th_sport, pd->ip_sum, &th.th_sum, &nk->addr[pd2.sidx], nk->port[sidx], 1, pd->af, nk->af); @@ -8036,10 +8032,24 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, pd->ip_sum, &th.th_sum, &nk->addr[pd2.didx], nk->port[didx], 1, pd->af, nk->af); m_copyback(pd2.m, pd2.off, 8, (c_caddr_t)&th); - PF_ACPY(pd->src, - &nk->addr[pd2.sidx], nk->af); - PF_ACPY(pd->dst, + PF_ACPY(&pd->nsaddr, &nk->addr[pd2.sidx], + nk->af); + PF_ACPY(&pd->ndaddr, &nk->addr[pd2.didx], nk->af); + if (nk->af == AF_INET) { + pd->proto = IPPROTO_ICMP; + } else { + pd->proto = IPPROTO_ICMPV6; + /* + * IPv4 becomes IPv6 so we must + * copy IPv4 src addr to least + * 32bits in IPv6 address to + * keep traceroute/icmp + * working. + */ + pd->nsaddr.addr32[3] = + pd->src->addr32[0]; + } pd->naf = nk->af; return (PF_AFRT); } @@ -8148,10 +8158,6 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &nk->addr[didx], pd->af, nk->af)) return (PF_DROP); - if (nk->af == AF_INET) - pd->proto = IPPROTO_ICMP; - else - pd->proto = IPPROTO_ICMPV6; pf_change_ap(pd->m, pd2.src, &uh.uh_sport, pd->ip_sum, &uh.uh_sum, &nk->addr[pd2.sidx], nk->port[sidx], 1, pd->af, nk->af); @@ -8164,6 +8170,20 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &nk->addr[pd2.sidx], nk->af); PF_ACPY(&pd->ndaddr, &nk->addr[pd2.didx], nk->af); + if (nk->af == AF_INET) { + pd->proto = IPPROTO_ICMP; + } else { + pd->proto = IPPROTO_ICMPV6; + /* + * IPv4 becomes IPv6 so we must + * copy IPv4 src addr to least + * 32bits in IPv6 address to + * keep traceroute/icmp + * working. + */ + pd->nsaddr.addr32[3] = + pd->src->addr32[0]; + } pd->naf = nk->af; return (PF_AFRT); } @@ -8288,17 +8308,27 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &nk->addr[didx], pd->af, nk->af)) return (PF_DROP); - if (nk->af == AF_INET) - pd->proto = IPPROTO_ICMP; - else - pd->proto = IPPROTO_ICMPV6; sh.src_port = nk->port[sidx]; sh.dest_port = nk->port[didx]; m_copyback(pd2.m, pd2.off, sizeof(sh), (c_caddr_t)&sh); - PF_ACPY(pd->src, + PF_ACPY(&pd->nsaddr, &nk->addr[pd2.sidx], nk->af); - PF_ACPY(pd->dst, + PF_ACPY(&pd->ndaddr, &nk->addr[pd2.didx], nk->af); + if (nk->af == AF_INET) { + pd->proto = IPPROTO_ICMP; + } else { + pd->proto = IPPROTO_ICMPV6; + /* + * IPv4 becomes IPv6 so we must + * copy IPv4 src addr to least + * 32bits in IPv6 address to + * keep traceroute/icmp + * working. + */ + pd->nsaddr.addr32[3] = + pd->src->addr32[0]; + } pd->naf = nk->af; return (PF_AFRT); } @@ -8427,6 +8457,14 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &nk->addr[pd2.sidx], nk->af); PF_ACPY(&pd->ndaddr, &nk->addr[pd2.didx], nk->af); + /* + * IPv4 becomes IPv6 so we must copy + * IPv4 src addr to least 32bits in + * IPv6 address to keep traceroute + * working. + */ + pd->nsaddr.addr32[3] = + pd->src->addr32[0]; pd->naf = nk->af; return (PF_AFRT); } From nobody Wed Mar 5 09:38:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z76tD50C0z5pWkt; Wed, 05 Mar 2025 09:38: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 4Z76tD3Dl9z40tJ; Wed, 05 Mar 2025 09:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741167492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oam/PQNofK8ZHAK2V57+dplOt+NsXUZ6tnvlr/AWoXg=; b=xNQ1SI9astsxDDgiiHE7HCcgcINlXfpwQnJQ1powNBB2ErjSxYusLTmCPV6dsrapV3q1Ic dGVjRoLfJBHtWwZMTGlz99ZBWWL6OQq6fO2Se/iOhyFzjvTz5Bbf+4eiDpgip1Dl/H+kXN ghCwLThicioy2SEyOkr4SYJBUKZvJTPBiSfRyyRZRFlFuVG9erpq+XOjnhmt4OkS4PnpyH MDUKtsUyiOBWmk/FQs2/oKevpV8SoNSS8rAlFeUcUJ+TykDDyKRy4M17GG04bUV3+0ot9J B1Hn60iGe25FWeCCaV3GzuRj37Siwh6jEpTv7rA9nmcuKp7CqZGu04wy3x4GWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741167492; a=rsa-sha256; cv=none; b=t9qz06luFgow6kM56nc64yCrI9g/XArmFu7Uw6Fsn3HAbb3PSsPTJriAbS9qpDZjPihD4Y n7rdjUqAA+cSlVKlIY2PV+XOCHEZw21P2Z4fKKz5thc31PfJ5LxxNGjn35c/CE7/b0/3w8 9e+ud7+d7u8B3Ty/b1Vpre4ZaqBzLhgzfPJW/XWM6eWktNy/UZiTMbVvtM1XbiW3EoG2oC wlU70y9uP1cY3Wqz+mP4U3vemfsRiwcBtRyoQFRGAjhNvYwow2FGmLk+TvzMCtmGQ9D92w E3toXIFpOQHLJwfyc7L+6mjW5BkRfyZbSnnHu1mcxVxuKfqx5OSpclCS++SzxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741167492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oam/PQNofK8ZHAK2V57+dplOt+NsXUZ6tnvlr/AWoXg=; b=euXCOG1S0CI1FN++cB/tUvqnh+z8x7qQ+cQH6yo3LPfFzTHQIbRmt5bEFKQDne5ARYm8Jb 0XKUgs3+smssii9KHE9gHDSWLtE13bWDvl0VZ630AVAU5w3gmvv0ta4wvuhZxjg2mQ98Nk ICfEIG3veoCiQNFhefH1fmmDONEGfkfh6sP8g6kZ3BC2qs8EXZ8I75l2ZWmRS2NfK6hobv 5QPFW4TNB81Eso3lSGBUNT3l8pV5GlqVCyuCEhvEnbXH1cEt0J3Nsq1jyE3yvNni0ue8tB /SssDcWVjzGQzRD8n+vzAsTnx91yS1y5b25uuHdXcFqvrJ+Ijo6mrSsrvmlfVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z76tD2qnSzySh; Wed, 05 Mar 2025 09:38: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 5259cC93053587; Wed, 5 Mar 2025 09:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5259cCKd053584; Wed, 5 Mar 2025 09:38:12 GMT (envelope-from git) Date: Wed, 5 Mar 2025 09:38:12 GMT Message-Id: <202503050938.5259cCKd053584@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: 2f77491169ca - main - pf tests: test ICMP error translation with nat64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 2f77491169cacafd269fb653bec11087d85af035 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f77491169cacafd269fb653bec11087d85af035 commit 2f77491169cacafd269fb653bec11087d85af035 Author: Kristof Provost AuthorDate: 2025-02-25 13:20:18 +0000 Commit: Kristof Provost CommitDate: 2025-03-05 09:37:57 +0000 pf tests: test ICMP error translation with nat64 Ensure that when we translate an ICMPv4 to ICMPv6 message we set the correct source IP address. PR: 284944 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D49144 --- tests/sys/netpfil/pf/nat64.py | 94 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py index 070b7a82e6d9..42ab29a5aa0a 100644 --- a/tests/sys/netpfil/pf/nat64.py +++ b/tests/sys/netpfil/pf/nat64.py @@ -28,19 +28,38 @@ import pytest import selectors import socket import sys +import threading +import time from atf_python.sys.net.tools import ToolsHelper from atf_python.sys.net.vnet import VnetTestTemplate +class DelayedSend(threading.Thread): + def __init__(self, packet): + threading.Thread.__init__(self) + self._packet = packet + + self.start() + + def run(self): + import scapy.all as sp + time.sleep(1) + sp.send(self._packet) + class TestNAT64(VnetTestTemplate): REQUIRED_MODULES = [ "pf" ] TOPOLOGY = { "vnet1": {"ifaces": ["if1"]}, "vnet2": {"ifaces": ["if1", "if2"]}, - "vnet3": {"ifaces": ["if2"]}, + "vnet3": {"ifaces": ["if2", "if3"]}, + "vnet4": {"ifaces": ["if3"]}, "if1": {"prefixes6": [("2001:db8::2/64", "2001:db8::1/64")]}, "if2": {"prefixes4": [("192.0.2.1/24", "192.0.2.2/24")]}, + "if3": {"prefixes4": [("198.51.100.1/24", "198.51.100.2/24")]} } + def vnet4_handler(self, vnet): + ToolsHelper.print_output("/sbin/route add default 198.51.100.1") + def vnet3_handler(self, vnet): ToolsHelper.print_output("/sbin/sysctl net.inet.ip.forwarding=1") ToolsHelper.print_output("/sbin/sysctl net.inet.ip.ttl=62") @@ -155,7 +174,7 @@ class TestNAT64(VnetTestTemplate): import scapy.all as sp - packet = sp.IPv6(dst="64:ff9b::198.51.100.3") \ + packet = sp.IPv6(dst="64:ff9b::203.0.113.2") \ / sp.UDP(dport=1222) / sp.Raw("bar") reply = sp.sr1(packet, timeout=3) print(reply.show()) @@ -193,3 +212,74 @@ class TestNAT64(VnetTestTemplate): udp = reply.getlayer(sp.UDP) assert udp assert udp.chksum != 0 + + def common_test_source_addr(self, packet): + vnet = self.vnet_map["vnet1"] + sendif = vnet.iface_alias_map["if1"].name + + import scapy.all as sp + + print("Outbound:\n") + packet.show() + + s = DelayedSend(packet) + + # We expect an ICMPv6 error here, where we'll verify the source address of + # the outer packet + packets = sp.sniff(iface=sendif, timeout=5) + + for reply in packets: + print("Reply:\n") + reply.show() + icmp = reply.getlayer(sp.ICMPv6TimeExceeded) + if not icmp: + continue + + ip = reply.getlayer(sp.IPv6) + assert icmp + assert ip.src == "64:ff9b::c000:202" + return + + # If we don't find the packet we expect to see + assert False + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_source_addr_tcp(self): + 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=1) \ + / sp.TCP(sport=1111, dport=2222, flags="S") + self.common_test_source_addr(packet) + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_source_addr_udp(self): + 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=1) \ + / sp.UDP(sport=1111, dport=2222) / sp.Raw("foo") + self.common_test_source_addr(packet) + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_source_addr_sctp(self): + 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=1) \ + / sp.SCTP(sport=1111, dport=2222) \ + / sp.SCTPChunkInit(init_tag=1, n_in_streams=1, n_out_streams=1, a_rwnd=1500) + self.common_test_source_addr(packet) + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_source_addr_icmp(self): + 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=1) \ + / sp.ICMPv6EchoRequest() / sp.Raw("foo") + self.common_test_source_addr(packet) From nobody Wed Mar 5 09:38:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z76tG03SGz5pWL7; Wed, 05 Mar 2025 09:38: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 4Z76tF4QpRz41Bs; Wed, 05 Mar 2025 09:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741167493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1KUxfj56igzWL1WGEZ8ZoXd2p8gew80eyXiu6GEVAI=; b=cW5JbZ2uMt29kbib2ajuohcuVlNQDfmMdSXCTTi79Firl09kO6C/DjSn0JOaQ4CzbEHIPF QjRkNsJuqa/7O4pQXWTA3D2hFTTRRciiXUJV++p9SdwQwLQpVu0EVif+8zxPpf73q+Wt58 HKUb92csw+tWspv6qhvvDvUapcApNnFRiFSm8y//GKaPttJx6yAi0tL+Gtnaey2yQGUZd/ J+ZweC6WQnnjJVlMEgNzUlhdNjCL8k6M+eZdLOrg16aJR4mmbSv6FTWweJT4pFkHDC1n9I 7uNdc03Z80Py9PWrdSPzaW6GfuMoaKBxrvp+JrsZu1Q2Ne3DAK2Rc2mE9QU7YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741167493; a=rsa-sha256; cv=none; b=heas8hyHXmbi2XAxh85ah/uSxvJAukZGlimfY5Mp7TuNjxhJswwjr8yS8fZdh3eCzRgfn9 haWKHA9oUoPH+9I9/bEQFapkVf/DL9MKY3GBkIKAit4ip8mkoHOX4Js8hbzLXeBckHl9IO x54VmsEWUToBUPSSeArPuJBGp8cddPDAOwcD0FWwJBl5vxiXaCrp/OYeehadyh9rQ5lNof 7VQoj4mIAPJhYoIO/RrxPlJ3rL0uzRgl9HCrqu/lSoH4BzEtlWrHgxED9uKuJF0uKd/aav dIECHtCto5uwvTxVOboLDqA2EcoGl5/A+rypjb0YJ0SkFhtZ+rChLm65G2UT9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741167493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1KUxfj56igzWL1WGEZ8ZoXd2p8gew80eyXiu6GEVAI=; b=QCG0IlJ0eQOy4ApKo8iMp22DnFF6MyL5SUIN3Hhr7Skj/pqa8/BiTrvHrxJe6o3BxLYeSZ 2zXf+ClufFWmn2BkHl35JFoIhktxINSWs8M/jP8GsOu2CpP1nKiOXyZ84y8jec1YkRFIo/ 1xq5/2mBn7JWBkKgWlZG4KvfzM2yyVw3MUr2u/BmiK++aM673fKMlLOzbUE9t8BS10wEUr dJUL3YMUROyWxlpEgNJaFTfyTlHPVg8lvifzh5CL0UUg1Fb15rF5q3EM1jIXxSl67Bu19c ZhlChbLpSWeS54N3ma0bK7YsSkdkMQub0DQjXRdMyFLBhITlwJqNvzZuXNy1EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z76tF3SVCzycw; Wed, 05 Mar 2025 09:38: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 5259cDKm053624; Wed, 5 Mar 2025 09:38:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5259cDVC053621; Wed, 5 Mar 2025 09:38:13 GMT (envelope-from git) Date: Wed, 5 Mar 2025 09:38:13 GMT Message-Id: <202503050938.5259cDVC053621@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: 6e7f24e0a526 - main - pf: fix nat64 ICMP translation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 6e7f24e0a5262d7e040f4f6e9167c544e006176d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6e7f24e0a5262d7e040f4f6e9167c544e006176d commit 6e7f24e0a5262d7e040f4f6e9167c544e006176d Author: Kristof Provost AuthorDate: 2025-03-04 13:51:09 +0000 Commit: Kristof Provost CommitDate: 2025-03-05 09:37:57 +0000 pf: fix nat64 ICMP translation Fix more incorrect use of the iih pointer, this time causing corruption in nat64 translated ICMP error messages. Extend the relevant test case to catch this bug. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D49231 --- sys/netpfil/pf/pf.c | 4 ++-- tests/sys/netpfil/pf/nat64.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2b28474f36c6..3bf7e0e2077c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8452,7 +8452,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, nk->port[iidx] != iih->icmp_id) iih->icmp_id = nk->port[iidx]; m_copyback(pd2.m, pd2.off, ICMP_MINLEN, - (c_caddr_t)&iih); + (c_caddr_t)iih); PF_ACPY(&pd->nsaddr, &nk->addr[pd2.sidx], nk->af); PF_ACPY(&pd->ndaddr, @@ -8579,7 +8579,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, nk->port[iidx] != iih->icmp6_id) iih->icmp6_id = nk->port[iidx]; m_copyback(pd2.m, pd2.off, - sizeof(struct icmp6_hdr), (c_caddr_t)&iih); + sizeof(struct icmp6_hdr), (c_caddr_t)iih); PF_ACPY(&pd->nsaddr, &nk->addr[pd2.sidx], nk->af); PF_ACPY(&pd->ndaddr, diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py index 42ab29a5aa0a..e64b7bbd573b 100644 --- a/tests/sys/netpfil/pf/nat64.py +++ b/tests/sys/netpfil/pf/nat64.py @@ -238,7 +238,7 @@ class TestNAT64(VnetTestTemplate): ip = reply.getlayer(sp.IPv6) assert icmp assert ip.src == "64:ff9b::c000:202" - return + return reply # If we don't find the packet we expect to see assert False @@ -282,4 +282,6 @@ class TestNAT64(VnetTestTemplate): packet = sp.IPv6(dst="64:ff9b::198.51.100.2", hlim=1) \ / sp.ICMPv6EchoRequest() / sp.Raw("foo") - self.common_test_source_addr(packet) + reply = self.common_test_source_addr(packet) + icmp = reply.getlayer(sp.ICMPv6EchoRequest) + assert icmp From nobody Wed Mar 5 12:28:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7Bft4jPLz5pqGX; Wed, 05 Mar 2025 12:28: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 4Z7Bft3c77z3Gwj; Wed, 05 Mar 2025 12:28:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741177718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NtqB0xbyza9nZli0JyffMYqxb0RO9t7b01xwPYpIaak=; b=UO/+Hb/9t6km+FeSFkXH56c8E3+rOZ/su1bDuo+IPxumFZZDn7w8p+Ck5HMe3eSVBeKXmX NkxQhslJGQlD26ub8ET1pAWJvx5RKS6vSvtP2+t0U6a2pL6GOi7FTf9/ck+r41c0vHTFaq P2MkftMAf/Lat0aVdS1NIUkf5BRSnqJiJUhaKsZaQ5R4sNufBo0uMAu02IB7pdsMLxi3qV MDq+hi+1imgy4ra4sy17Pp/iJLrcIakG3ZPPwQuoLV6UNzXV/DDvjM6TVWwKFy2uXrGWGA jsvnDSF9LgyIG+yu/PyOG248Zt3dQKXV87sVYUcGcRng5QUpW0ZZ1zHcHDvBzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741177718; a=rsa-sha256; cv=none; b=AxBJrlqCk29ji5JoXTeEFQ4YfH1qr2qtHxWWUCC+9Je+SfhfyOy14Ns3HaWpTf+WJiYrp3 mCyIaHE/CWFO7oonOzVTtX9VKqIL5sA8GczDorGdjgPSWxhpPr/HfPaLgdH0+Ul/Kj4JbN xybvuQwtKaZUjArmryvoLUg0gaWg6Hch+jf0qd3CWPCU7YZbgMGIt0gdR8/T94cB4w3Ejp ATmqEMjZ6AEZ0u5fZ3WbdDEAjl39VvXSaFStJWxpey5KQmlhuasxXtUIumrIfLtHL5VXZm CzIQC9sa4ri7ZCK3x1+MqK8uAviTC560ZFhGutiG2fEGXUpvrv1axFuU8D7tOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741177718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NtqB0xbyza9nZli0JyffMYqxb0RO9t7b01xwPYpIaak=; b=KjP9kAyuQI80+XIkRVO2SSFGyGqWO0IhjNADi504xld3UCQRagAuI/8rMDNoS1F1zeh6Ce 8nI6qREqYn5yGRKAft2hhCC2r3K4DDP8ORy6AcU/hjqjOyx09NpLXdCa/S7fznOm8B0ecW S2SbSlwA4nHuAN86zdTV+OkZ4DjdT7G6Gm1+WY9FP2YHwz3Ufsi/n4oOAQRvcnYptLdmCQ Pb9IMXraxONZ2CBKcmoNnZP36tziFNdq69sFnL/GS/cr+CPoOLLKkf05mLN4yajZZ/WXc2 jIR5nZvxYI7T47aLQur6wXJ0h9Ixi7+YQmXRLqv9sS0U96wEy8LgC885EZ/9sQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7Bft2mSKz13SB; Wed, 05 Mar 2025 12:28: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 525CSc2c071736; Wed, 5 Mar 2025 12:28:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 525CScvI071733; Wed, 5 Mar 2025 12:28:38 GMT (envelope-from git) Date: Wed, 5 Mar 2025 12:28:38 GMT Message-Id: <202503051228.525CScvI071733@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: 0698ce429f78 - main - bhyve: fix CPUID L3 Cache Size reporting for AMD/SVM List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0698ce429f78f548f7eb3e54476fb312109ddd8b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0698ce429f78f548f7eb3e54476fb312109ddd8b commit 0698ce429f78f548f7eb3e54476fb312109ddd8b Author: Konstantin Belousov AuthorDate: 2024-12-17 21:09:33 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-05 12:27:58 +0000 bhyve: fix CPUID L3 Cache Size reporting for AMD/SVM Adjust leaf 0x8000_001D %ecx 3 on AMD (L3 cache params). - Report cache as 1-way associative. Glibc does not believe that there are fully associative L3 caches, ignoring the leaf and falling back to legacy way of reading cache params. - Do not report 4095 logical CPUs per L3 cache, report the true total number of emulated CPUs. The insanely large value tricked some version of glibc to overflow 32bit calculation of the L3 cache size, as reported in the PR. Also, for leaf 0x8000_0008, do not clip ApicIdSize to zero if less than 4. This effectively falls back to legacy. PR: 279901 With the help from: Florian Weimer Reviewed by: kevans, meta, mp Tested by: meta, mp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48187 --- sys/amd64/vmm/x86.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index a833b61786e7..366f1da9f850 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -150,8 +150,6 @@ x86_emulate_cpuid(struct vcpu *vcpu, uint64_t *rax, uint64_t *rbx, * pkg_id_shift and other OSes may rely on it. */ width = MIN(0xF, log2(threads * cores)); - if (width < 0x4) - width = 0; logical_cpus = MIN(0xFF, threads * cores - 1); regs[2] = (width << AMDID_COREID_SIZE_SHIFT) | logical_cpus; } @@ -256,7 +254,7 @@ x86_emulate_cpuid(struct vcpu *vcpu, uint64_t *rax, uint64_t *rbx, func = 3; /* unified cache */ break; default: - logical_cpus = 0; + logical_cpus = sockets * threads * cores; level = 0; func = 0; break; @@ -266,7 +264,14 @@ x86_emulate_cpuid(struct vcpu *vcpu, uint64_t *rax, uint64_t *rbx, regs[0] = (logical_cpus << 14) | (1 << 8) | (level << 5) | func; regs[1] = (func > 0) ? (CACHE_LINE_SIZE - 1) : 0; + + /* + * ecx: Number of cache ways for non-fully + * associative cache, minus 1. Reported value + * of zero means there is one way. + */ regs[2] = 0; + regs[3] = 0; break; From nobody Wed Mar 5 16:43:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7JJy5J51z5qRPl; Wed, 05 Mar 2025 16:43:30 +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 4Z7JJy4n37z3tDW; Wed, 05 Mar 2025 16:43:30 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741193010; 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=6uO8+wytqhyctHyrlMuqRmcsfIZfGpEGK2L3GfRoFY0=; b=NNmsxaD9CobuOg+T8L/j1P4hDP1mxx6NVN1MbCrX6zcUr+3iN9cblp3M7UcCu6BCZrz+4u YK6OazIoTDYu9OzWuqtbyRlFQuYMe5oIMtLGM+nT7AlsD4pWMTyS1jUTQ5rQ6JddS2Wj7T jpxJMyqY8xN1x7RW7TrkdeZ/ep3mvb1ghvKO7zQv9Lj16FR/2pU+SgQc/YgHJosYUpAQ8O rmh6DbNa3gJRJxHgJmd0X0EroxSHP3EfB2foEOBDlPDLK4zNf+IvEeKbjf3UsClw17+1IA RKiTiEhRqMvPhzdmmpA2r3att0KvKIWF9SRQ2J6YvdQZ4wxnzqLbhCjOI17zIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741193010; a=rsa-sha256; cv=none; b=VJsBUWQmgQK/bsv0xwH4FYEd2oj2FHMsBFxAtQVI5OR1xFYGHBoTnpFZCiiRbd+gIQEq9g zc8n+QPIyWnxW/puFntbvT1TK0wmbSujtUCg+tHhf/gCsmPHxLYn1bjyTH04u6G7+lm+Jn mKJXLzGqCaeO8Eo3KjJWichwv5dRPTSJFbSB8TfPlPpMKifMRpxie12i/6nru6xpffNi1f eREc8Hn4pFGiw7Xnr3oAv/zFkFH+sOGODOPXL6DRylVRXSCAtK1E0ZuFKdYpNRxRTncTBW N6L6qB2Aj/FLE7xgxWXOnmE+plfrG2sRCeILn3dX5v3q+CKOlb5OrWappGNacw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741193010; 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=6uO8+wytqhyctHyrlMuqRmcsfIZfGpEGK2L3GfRoFY0=; b=AydOqG4swTyLDCHZkNYo4VzVEmBVQZEa+jl2gtZbgV2Bqum+EKoSfQZAsKUIvrovc82dWN PVemn5bCyU19rJRq1T1xn5JyxJvQApoOPf0HU0kOpH8xGi/DnrFTltVz6nka3JFIm8e6dY 4lAl8jjMSoct+VP+CyZS++mgZgsUCuWJX8/2C2FHSMabRjXWTGP2QmuifHIMr6L/KlYXtQ lwFaghKxYxCrU5XJDsTyZPFzMP2PHpOTCeKgrq8iUTguZKB2KMrZaX3140CkAf2nmv9tOG CtJnM1UOV63ZOmuxycyC/cbs2GGpu75Y/ftuHsGIBEt5Vajf6LCWns8eHkrTZA== 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 4Z7JJx6rTjz9Sk; Wed, 05 Mar 2025 16:43:29 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 5 Mar 2025 08:43:27 -0800 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: 7e51bc6cdd5c - main - pf: Introduce unhandled_af() Message-ID: References: <202503040805.52485pYn088632@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202503040805.52485pYn088632@gitrepo.freebsd.org> On Tue, Mar 04, 2025 at 08:05:51AM +0000, Kristof Provost wrote: K> The branch main has been updated by kp: K> K> URL: https://cgit.FreeBSD.org/src/commit/?id=7e51bc6cdd5c317109e25b0b64230d00d68dceb3 K> K> commit 7e51bc6cdd5c317109e25b0b64230d00d68dceb3 K> Author: Kristof Provost K> AuthorDate: 2025-03-03 16:26:39 +0000 K> Commit: Kristof Provost K> CommitDate: 2025-03-04 08:05:37 +0000 K> K> pf: Introduce unhandled_af() K> K> For cases where code conditionally does something based on an address family K> and later assumes one of the paths was taken. This was initially just calls K> to panic until guenther suggested a function to reduce the amount of strings K> needed. K> K> This reduces the amount of noise with static analysers and acts as a sanity K> check. K> K> ok guenther@ bluhm@ K> K> Obtained from: OpenBSD, jsg , ba4138390b K> Sponsored by: Rubicon Communications, LLC ("Netgate") Heh, enum solves the problem at compilation time. I will try to revisit the review that had this idea. -- Gleb Smirnoff From nobody Wed Mar 5 16:52:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7JX16zYbz5qRkm; Wed, 05 Mar 2025 16:53:05 +0000 (UTC) (envelope-from kp@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 4Z7JX16FyQz3xr0; Wed, 05 Mar 2025 16:53:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741193585; 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=2UtAkrk5T0aS3W3MVvP+mJfoE/3Raf4EAoHXVJ+vbKo=; b=BmTNm2HZaOq0Db0hBjbl6NEjuar65R4ZOvNKv2Doh1Gj96ySaeD3fSxc1yydiX7IbQSVCD cKaWHv8XPVw/fzVGG+TxWtPk5oOlCseoFVKWjJhG7zeBzwLXypSndwp1mrDgB7DcaWaUcV kKowfWnLy4kdIjrLN3FM9UpwQmI+jL5bxUQEKo9PaSBmAf7zgNPTlHxjVgkvItO5JGrseF k8EgTyHa8iwivCE9Nf2soNxl2QWg2EdjKfT7CsLEH3os5+S2A3R07S7hrL6PJdZ71c8lVY QFnlZYNWdwT5GRKKydeV9unjPWQ4qqgcs/aK1ZNVzVYbSAutVDFEVeLy16+dMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741193585; a=rsa-sha256; cv=none; b=a13i3XRoVlDo0FwqQ1w8MXMXFOZo2BZw5WVNeiEHuOpNSPntwOTyf90KjmCSYNrhwoKlNo ByxrSjTyPtmQv2kAn8qUAlfezW0xmLezeiYTDBdLuwdU23cqUTSDX8F1QRQn6oFWvnXpm4 KuiZQh3e4vQUqNVbaM7fl02YLY2nEHxCyYO++W9WowSV7uvvyfGhMLTwKJoRvja1gs5kIv DhOgtrjrAEnJeYVCOeFooLz9DXLllP1/XNeDHY5Nk0bFEo6Y51LFXE+uPWOVL5ABce16/P tr4nvAJ+Uf+MiUbPI6OSLBpjdazw93sW1zWfousoFOtqzE2YSRcE0bZEayCngg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741193585; 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=2UtAkrk5T0aS3W3MVvP+mJfoE/3Raf4EAoHXVJ+vbKo=; b=gypEe1XjelfHQGRwh6yhb1bR6RWSAOHgpUoZG8r1JCud7SkgoAMXKMZRfEfHSiH+epqljC E/qph/PG0ZsVidlcqNFfqoZCO6gO6f7obf7fiJWYvOuktxCYTjZOP88ELQ4nISaNigm98a C+MpZBbbLC0oIPAfLslaWw9A9IyLeRj3eeXoD7+M8230fUWMCqCIwLSR/yPtM2e/rV2Jvm tZ0t7GWjnnXwR/cdo/oI42bqkFE3ShfE5HpYze79DLDwpIxsBhgEytop0mfA0QbTZHrs8B CqTcx6HGCAmyieRF+I0su3FVp9VOwO4HVwNFzCG8/he6cIpI1y3y1Zip6FQ6RA== 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 4Z7JX14yfXzDdv; Wed, 05 Mar 2025 16:53:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id EFD902875D; Wed, 05 Mar 2025 17:53:02 +0100 (CET) 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: 7e51bc6cdd5c - main - pf: Introduce unhandled_af() Date: Wed, 05 Mar 2025 17:52:57 +0100 X-Mailer: MailMate (2.0r6222) Message-ID: In-Reply-To: References: <202503040805.52485pYn088632@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; markup=markdown Content-Transfer-Encoding: quoted-printable On 5 Mar 2025, at 17:43, Gleb Smirnoff wrote: > On Tue, Mar 04, 2025 at 08:05:51AM +0000, Kristof Provost wrote: > K> The branch main has been updated by kp: > K> > K> URL: https://cgit.FreeBSD.org/src/commit/?id=3D7e51bc6cdd5c317109e25= b0b64230d00d68dceb3 > K> > K> commit 7e51bc6cdd5c317109e25b0b64230d00d68dceb3 > K> Author: Kristof Provost > K> AuthorDate: 2025-03-03 16:26:39 +0000 > K> Commit: Kristof Provost > K> CommitDate: 2025-03-04 08:05:37 +0000 > K> > K> pf: Introduce unhandled_af() > K> > K> For cases where code conditionally does something based on an ad= dress family > K> and later assumes one of the paths was taken. This was initiall= y just calls > K> to panic until guenther suggested a function to reduce the amoun= t of strings > K> needed. > K> > K> This reduces the amount of noise with static analysers and acts = as a sanity > K> check. > K> > K> ok guenther@ bluhm@ > K> > K> Obtained from: OpenBSD, jsg , ba4138390b > K> Sponsored by: Rubicon Communications, LLC ("Netgate") > > Heh, enum solves the problem at compilation time. I will try to revisi= t the review > that had this idea. > Oh yeah, I=E2=80=99d forgotten about that one. In any event, this is useful as a diff-reduction exercise, if nothing els= e. I=E2=80=99m hoping to be able to continue importing OpenBSD patches, b= ut there=E2=80=99s still a very long way to go before we=E2=80=99re all t= he way caught up. And even if/when we get there there=E2=80=99ll still be a substantial del= ta, because we don=E2=80=99t want to drop support for older syntax in the= way OpenBSD has, and we want to keep stuff like your multicore work and = the vnet support. And the SCTP support. And the basic Ethernet support. Anyway, lots of random thoughts to say: that=E2=80=99d be nice to have, b= ut certainly isn=E2=80=99t urgent. Best regards, Kristof From nobody Wed Mar 5 18:16:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7LNb6SWLz5qYPw; Wed, 05 Mar 2025 18: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 4Z7LNb6258z3YWM; Wed, 05 Mar 2025 18: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=1741198607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bQEJB+UQLMDVZh3NBWhjGoU6Myanq2ln8Om9zOUFVEo=; b=NZ1bPE7hroFVTbmy86MmSU8YqdhimWVzbaPM4EsFk7C7Y9igZXoP3xD4P3XpBSoGApBtwR KA3LFwrsR1VleA+zobbaRZAk43DPjWs8z5pCDTGrSDd+yXtgNIzEWL8eGjIZ0zJ2gZuaIG XxIdMnZaX8ytaZ//eV+a1zNmLoVKufErk07QCUDFqboZFabEIgD95AxsrogGZT2tU9nMWc z3UC43yvBPHn0ZTbCq92PtEF/MFnrfe5Y9+4fHucPTzB6qqVC1jdTM3FalLZZ+Ua5O2hFD bmvl0jQfiYhrIsue5hH7Y3upfCcPQSVqAlKjsoKmn52p01hnVHPuyWykotMP/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741198607; a=rsa-sha256; cv=none; b=VOMMcGzlYaH0u81veGW/S3+PgcUr2Rmy9aMbMo68SqlHAmiBhwXMrbcUMkkS9YRnp1UpuD nR2MSGcUyzl/t5nFnSCMW0K2orL07DHieAzo1J6o29U621Nx7EUxF1Dd8QsqiSp1waOWue MiQn651P8ANRcKajIG+f1OhV+W+VENyCMethBtjnisl+4DPjGLeeRAC8m23cz8D78gdY03 F9fbZBDi6l4X8syJHeSVdD3+Kg1hnXerWutnyKxcdnXGMMnL+J77z997N20SxPnWq0KH9L vM2NEFCgqrSlnd343xN1/B5vkxsLRi5EznadkqCLPrwOF+f9flOYf3BXpEH2OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741198607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bQEJB+UQLMDVZh3NBWhjGoU6Myanq2ln8Om9zOUFVEo=; b=aQXF+GAx72wDWd9zI1LBZ7KOOB9KC0yBdhSkFbeHs4pqo5yzF9R5T9HZiAlitobeV+qeO4 Ir+i7xP7hw2zxsk0+9RVadZjskzDOiNdoNcD1nLzDOhUcwj9sR1M0X33fIenaI6Gpw/2hS kIvW/LUngHpGmSdcAO5obwMgX7EyJK8Tpst1XaNrn/w1Gqz2a3/hprLsBs+6cbNjkMLRf6 xqLs+V6z5LqUmF6p775joWgtFKNReinUD5EfXidkT/lsDqL4h+Py1TDocCqw4gzhCK+HBr hil8m0czJd/bbUOYIuQkfu/bWygbmgn21ivYHA9Zf+cWd/Ja1ZSocpaioOBGZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7LNb5c9Bzmx; Wed, 05 Mar 2025 18: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 525IGlsj029717; Wed, 5 Mar 2025 18:16:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 525IGlLY029714; Wed, 5 Mar 2025 18:16:47 GMT (envelope-from git) Date: Wed, 5 Mar 2025 18:16:47 GMT Message-Id: <202503051816.525IGlLY029714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: d56f3b051f61 - main - jail: add jexec -d, to specify a working directory PR: 283170 Submitted by: DtxdF at disroot.org List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d56f3b051f6135b4a675fd75ccfcef0310368781 Auto-Submitted: auto-generated The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=d56f3b051f6135b4a675fd75ccfcef0310368781 commit d56f3b051f6135b4a675fd75ccfcef0310368781 Author: Jamie Gritton AuthorDate: 2025-03-05 10:14:47 +0000 Commit: Jamie Gritton CommitDate: 2025-03-05 10:14:47 +0000 jail: add jexec -d, to specify a working directory PR: 283170 Submitted by: DtxdF at disroot.org --- usr.sbin/jexec/jexec.8 | 10 ++++++++-- usr.sbin/jexec/jexec.c | 21 ++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/usr.sbin/jexec/jexec.8 b/usr.sbin/jexec/jexec.8 index 431978c4d0ae..afcc1839ef75 100644 --- a/usr.sbin/jexec/jexec.8 +++ b/usr.sbin/jexec/jexec.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 12, 2024 +.Dd March 5, 2025 .Dt JEXEC 8 .Os .Sh NAME @@ -32,6 +32,7 @@ .Sh SYNOPSIS .Nm .Op Fl l +.Op Fl d Ar working-directory .Op Fl u Ar username | Fl U Ar username .Ar jail Op Ar command ... .Sh DESCRIPTION @@ -48,6 +49,9 @@ is not specified then the user's shell is used. .Pp The following options are available: .Bl -tag -width indent +.It Fl d Ar working-directory +The working directory for running commands inside the jail. +The default is the jail root directory. .It Fl l Execute in a clean environment. The environment is discarded except for @@ -59,7 +63,9 @@ If a user is specified (via .Fl u or .Fl U ) , -commands are run from that (possibly jailed) user's directory. +and absent the +.Fl d +option, commands are run from that (possibly jailed) user's directory. .It Fl u Ar username The user name from host environment as whom the .Ar command diff --git a/usr.sbin/jexec/jexec.c b/usr.sbin/jexec/jexec.c index 35fd9c8d20e4..a1e443c5ba04 100644 --- a/usr.sbin/jexec/jexec.c +++ b/usr.sbin/jexec/jexec.c @@ -58,16 +58,22 @@ main(int argc, char *argv[]) { int jid; login_cap_t *lcap = NULL; - int ch, clean, uflag, Uflag; + int ch, clean, dflag, uflag, Uflag; char *cleanenv; const struct passwd *pwd = NULL; const char *username, *shell, *term; + const char *workdir; - ch = clean = uflag = Uflag = 0; + ch = clean = dflag = uflag = Uflag = 0; username = NULL; + workdir = "/"; - while ((ch = getopt(argc, argv, "lnu:U:")) != -1) { + while ((ch = getopt(argc, argv, "d:lnu:U:")) != -1) { switch (ch) { + case 'd': + workdir = optarg; + dflag = 1; + break; case 'l': clean = 1; break; @@ -102,8 +108,8 @@ main(int argc, char *argv[]) errx(1, "%s", jail_errmsg); if (jail_attach(jid) == -1) err(1, "jail_attach(%d)", jid); - if (chdir("/") == -1) - err(1, "chdir(): /"); + if (chdir(workdir) == -1) + err(1, "chdir(): %s", workdir); /* Set up user environment */ if (clean || username != NULL) { @@ -129,7 +135,7 @@ main(int argc, char *argv[]) setenv("HOME", pwd->pw_dir, 1); setenv("SHELL", *pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1); - if (clean && username && chdir(pwd->pw_dir) < 0) + if (clean && username && !dflag && chdir(pwd->pw_dir) < 0) err(1, "chdir: %s", pwd->pw_dir); endpwent(); } @@ -186,6 +192,7 @@ usage(void) { fprintf(stderr, "%s\n", - "usage: jexec [-l] [-u username | -U username] jail [command ...]"); + "usage: jexec [-l] [-d working-directory] [-u username | -U username] jail\n" + " [command ...]"); exit(1); } From nobody Wed Mar 5 18:52:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7M9z68fTz5qc3v; Wed, 05 Mar 2025 18:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7M9z5bVVz3r00; Wed, 05 Mar 2025 18:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741200759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WwEqNrrmCSBLfSD5Qgq27+hc3qAD9kEOFFn0mTobsoE=; b=ykdfjyijBzy9aM4yzjR1bFxujxTFL5ButFz379jvjB66HQBb/BjYQ7eEaa6Uib8LJv6T2W SWOB8c2C8JyhAj7s9NkHeemBRoUslHlYZoLq7cdet8Zs3sHmFOmd9fYL79HAnTl7umuYIN +rWakt/LI4G5kvJstO2oYGbJpqPKWaDww/OleqrGVJwNh1neK5l50WgSfuHKdx0jYkGQYR aXxD3o9RjnSdVmSp92IaWKLLF9r3TjBAEKf+jK11mRvsnXs2RDEXpEhfbntNFIWa46lMce 21F+i3wpxbrVVw+yh8yTK5qybRTGzy/5oMKVyanFlDR5A5CqMpGoL/BxfdxX3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741200759; a=rsa-sha256; cv=none; b=bGe6gR++7pr1jzVVRglFa6tE3gSeOhIyZ6vTkfPYSQ3stp6YuMCSjA4nlPI/ZQY09rIQOw HDCP+4G4ZOMkHrlEbdtUtkhv4eAO0Q7PoIcTVUQBbezuuvODTeqoUitPUPIwiRqiIwXDEj yxK/1Gk8wX4URmPvjV2TUWDvhLZddMoH1MvuHXNYo02BvjV7SuNRm8iY2WIRKzyagCiJCu 8pLfPsbcdjWoPJtohXuSGKSzh7nLXbKmoucbcehq6aMAxArD/cpWDQdbOp9ksd50txkR9s 0sLvFeAaEhWk7ah4q9NEYbdwKCgrlDtmrKTtk2HX7fAhJ9JJX8RZXEoDVX5Gdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741200759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WwEqNrrmCSBLfSD5Qgq27+hc3qAD9kEOFFn0mTobsoE=; b=H4gCXVFl0GtNDTT+C2Wn93jF+vRS0AlWRcjEhsiUl+3QJvVy9gkWP7PcHhep4a808I+WSq CHUVrAZsAxqLFmHtrEbYldVDETbRsvd5dpcNxsRUpjwoAVY72Nm7YeFgoL3xPfauaIeSQq JJwp86QkT7d1LcLiNdQEE4mj1mIuLATPOBd8SAqoo/bgUZGEvFNnLCu8GwZJxsO5hgg3HZ fc/Ro2SWy2kzJWFLEIEQtb0BBFeoiS1Vao9belgRgjHDQO8X20O73G2gk78Q82R0nADdTk H5XuWblj/jEOVC2BMLa+Zz0z+nCHr7rT0YkAmOw3N10U2F5N9708nQtXCWFIdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7M9z51BWz1l1; Wed, 05 Mar 2025 18:52: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 525Iqd64002903; Wed, 5 Mar 2025 18:52:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 525IqdJ0002900; Wed, 5 Mar 2025 18:52:39 GMT (envelope-from git) Date: Wed, 5 Mar 2025 18:52:39 GMT Message-Id: <202503051852.525IqdJ0002900@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: 202a2be0941e - main - witness.4: correct name of the debug.witness.witness_count sysctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 202a2be0941edeb2652d64a3dbb1894b8867f3ac Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=202a2be0941edeb2652d64a3dbb1894b8867f3ac commit 202a2be0941edeb2652d64a3dbb1894b8867f3ac Author: Alan Somers AuthorDate: 2025-03-05 17:35:54 +0000 Commit: Alan Somers CommitDate: 2025-03-05 18:52:14 +0000 witness.4: correct name of the debug.witness.witness_count sysctl MFC after: 2 weeks Sponsored by: ConnectWise --- share/man/man4/witness.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/witness.4 b/share/man/man4/witness.4 index ab23eb49d9fe..f382a9378727 100644 --- a/share/man/man4/witness.4 +++ b/share/man/man4/witness.4 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 18, 2015 +.Dd March 5, 2025 .Dt WITNESS 4 .Os .Sh NAME @@ -62,12 +62,12 @@ kernel option controls the maximum number of .Nm entries that are tracked in the kernel. The maximum number of entries can be queried via the -.Va debug.witness.count +.Va debug.witness.witness_count sysctl. It can also be set from the .Xr loader 8 via the -.Va debug.witness.count +.Va debug.witness.witness_count environment variable. .Pp The From nobody Wed Mar 5 20:28:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7PJ119jNz5qjfR; Wed, 05 Mar 2025 20:28: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 4Z7PJ102N2z3XYv; Wed, 05 Mar 2025 20:28:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741206481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QKVq2mNINFC+cRNnL6dLzys+8ri2afw/ZzPO7930cFI=; b=oPzfGk06zFK0Xe96pDw/+qn9v2IlvRrhZ5NFfYC8bgTwjnIN1uzCkSfjQdQOPGJfHKU0IG J25L89WdYynZRq9wxiN8YF12F0wg12B+48etwr94ZATu57ww4UfIlrc6KQ9egNc2sNXHnl I1JRyw96snMOPeVSsQmJwYR84ROcEjr3s3jb11oQ+9825JDbM/EWDuma5+WTSZN2QZqHOp 8YtRJDmDAN0FdwaVZ3Eworv81zhHy/RJkFpQcDqjqSgecXrpAX8bOCvcpLRMFSG/so4Jdd vTdcz1JFL8vdUM8R7tSohuO9fYFW3LEjX5K+cqRWvUDAFtKAzg0IqaD6NQnhFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741206481; a=rsa-sha256; cv=none; b=vZfNHTp0Ogj0NVJpxnwAI99SaHsUi9CllO5wsh18ZS9oQJnOlC9D5updAO3yxLVcSQSicC DQ+MNhJEOKGuYxHRQGhZLzqHfQMJhmZ9HflBxnOqPtm5B2qaWaMGVaUA9kD4Ruoj/Y3wZ7 R2OFddJ3PK/tRMsyGynngP8pnMWP2kdhHndxyG+sZkNY5eW6NKVQxwEDhpGja4KMqviUZa kKd6JBxInAETbsOohvwRJ2OwPzw8FLuJxSMYQnlFgJmAnCbA+QrPy6YgTUFw7PQfXu02wP o+aQoNh9pqSCtjZwCYqfxZ2NtLRTbsU0/sJSsAQP9DfJQ8ZUvwEHdqh2nHNI1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741206481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QKVq2mNINFC+cRNnL6dLzys+8ri2afw/ZzPO7930cFI=; b=l37SjvGN5+hQVY/6LLUqgTjozKqn4+rzn5AHVZevCTCGWyTZB1a3Wsz+dLIC5plwU9K5oP 9cWIHMrIWn2YAPYLCx70gkQ2k+Ne2S1QnWr55vhUDs3jRKe8q6ESAlnGFPm/T10CpYTJKc f8WG7Hm4Ivsl4D2i42xSMCNHmMJHNfuX2FCKMWTAYGgrwFGCMWdv+KFv3DN/HeYLdclwjq ZTTk2MlaiYi0xvgwr+3UvyRGImu9HEiTwsTfXMJyeibEcZRhN5kBnom4IAKyoolspsJViv uVPXXfNtJlGpBIB7fOLrR2Y/QKeyTBAWum49z4At7LV4Dd1+a141E2/NTlxnUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7PJ06HkVz4gQ; Wed, 05 Mar 2025 20:28: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 525KS09A074620; Wed, 5 Mar 2025 20:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 525KS0iH074617; Wed, 5 Mar 2025 20:28:00 GMT (envelope-from git) Date: Wed, 5 Mar 2025 20:28:00 GMT Message-Id: <202503052028.525KS0iH074617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: d70bac252d30 - main - acpi_pci: Add quirk for PSTAT_PME-before-detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d70bac252d30adec4feba0c866dabe2c16a756d9 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=d70bac252d30adec4feba0c866dabe2c16a756d9 commit d70bac252d30adec4feba0c866dabe2c16a756d9 Author: Colin Percival AuthorDate: 2025-02-27 00:31:08 +0000 Commit: Colin Percival CommitDate: 2025-03-05 20:25:49 +0000 acpi_pci: Add quirk for PSTAT_PME-before-detach In order to signal to Graviton [123] systems that a device is ready to be "ejected" (after a detach request is made via the EC2 API) we need to set PCIM_PSTAT_PME to 1 and PCIM_PSTAT_PMEENABLE to 0. We are not aware of any rationale for this requirement beyond "another OS kernel happens to do this", i.e. this is effectively bug-for-bug compatibility. Arguably this should be done by the ACPI _EJ0 method on these systems, but it is not. Create a new ACPI_Q_CLEAR_PME_ON_DETACH quirk and set it in EC2 AMIs, and add the PCI register write to acpi_pci_device_notify_handler when that quirk is set. Reviewed by: jhb MFC after: 1 month Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D49146 --- release/tools/ec2.conf | 7 +++++-- sys/dev/acpica/acpi_pci.c | 9 +++++++++ sys/dev/acpica/acpivar.h | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index b5a91d47decf..a8fc3854a0e2 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -72,8 +72,11 @@ ec2_common() { # Graviton 1 through Graviton 4 have a bug in their ACPI where they # mark the PL061's pins as needing to be configured in PullUp mode - # (in fact the PL061 has no pullup/pulldown resistors). - echo 'debug.acpi.quirks="8"' >> ${DESTDIR}/boot/loader.conf + # (in fact the PL061 has no pullup/pulldown resistors). Graviton 1 + # through Graviton 3 have non-functional PCI _EJ0 and need a value + # written to the PCI power status register in order to eject a + # device. + echo 'debug.acpi.quirks="24"' >> ${DESTDIR}/boot/loader.conf # Load the kernel module for the Amazon "Elastic Network Adapter" echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c index 6411af02ee58..97704111839b 100644 --- a/sys/dev/acpica/acpi_pci.c +++ b/sys/dev/acpica/acpi_pci.c @@ -391,6 +391,8 @@ acpi_pci_device_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) { device_t child, dev; ACPI_STATUS status; + int pmc; + uint16_t pmstat; int error; dev = context; @@ -416,6 +418,13 @@ acpi_pci_device_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) device_get_nameunit(child), error); return; } + if ((acpi_quirks & ACPI_Q_CLEAR_PME_ON_DETACH) && + (pci_find_cap(child, PCIY_PMG, &pmc) == 0)) { + pmstat = pci_read_config(child, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pmstat |= PCIM_PSTAT_PME; + pci_write_config(child, pmc + PCIR_POWER_STATUS, pmstat, 2); + } status = acpi_SetInteger(h, "_EJ0", 1); if (ACPI_FAILURE(status)) { bus_topo_unlock(); diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 668d0b51a1f3..830764434f48 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -230,6 +230,8 @@ extern struct mtx acpi_mutex; * compatible flag and ignoring overrides that redirect IRQ 0 to pin 2. * ACPI_Q_AEI_NOPULL: Specifies that _AEI objects incorrectly designate pins * as "PullUp" and they should be treated as "NoPull" instead. + * ACPI_Q_CLEAR_PME_ON_DETACH: Specifies that PCIM_PSTAT_(PME & ~PMEENABLE) + * should be written to the power status register as part of ACPI Eject. */ extern int acpi_quirks; #define ACPI_Q_OK 0 @@ -237,6 +239,7 @@ extern int acpi_quirks; #define ACPI_Q_TIMER (1 << 1) #define ACPI_Q_MADT_IRQ0 (1 << 2) #define ACPI_Q_AEI_NOPULL (1 << 3) +#define ACPI_Q_CLEAR_PME_ON_DETACH (1 << 4) #if defined(__amd64__) || defined(__i386__) /* From nobody Wed Mar 5 21:19:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7QQs0gJdz5qmn1; Wed, 05 Mar 2025 21:19: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 4Z7QQs055Kz3vf8; Wed, 05 Mar 2025 21:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741209541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KcWODdC49ES3SnROkXinagvelHR8A1LySK/Gi4miH8E=; b=LyIwBggi4FI1g3KdFv7M6NYiW5BI50Iu5esR/V6hK8X3eX8j2baSGlqf7KBieuW/mwUC3/ +CUAi9/2naWPm/AMzS9OjJKhotwaQJgdpI3ZjyOMGiMd/zca2VnNjHwDnqjvNfAwEBMVFL 37x2z3UwZTCW0+4/xDNrnj5jK71jlo8+tV0RXG5EGSRevjUsRqGVSymrrdsTjRh+nxx+mj nRkVlxbhUGS2PzqbXl8q37cIN04ACOqSVn0aKexPyO8JqLHPff6hS63cAIdqTKX/1WKz97 6QrsFeCY3w15ELSMG66dcnUSeB6XOH9EJNVzivRULxw30BH8FEGKLPyTdOqInQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741209541; a=rsa-sha256; cv=none; b=vmWNTB1qytefSLOkZy8t+/bELjZ5ywAtzpMWd+j6PKQl7veOxkSOUv65SyO+xktJzco8CQ c7x0znLj/E1PMdv7UuMDCeDjtTyUUd9VHGOlACjy4qoCGfHGN164OWnDj066YgnYer6oDa 0G8EkqK26H08iHBlvZb7uuLPzHGANtIrItkmAu+q0ASB9CNMuEnyA/pGkS7CmCktEIB+4m XB3OAEyUqSvTaExq5mxQP+2VDE0FZhzj1FIJ30q14BPo2AnJ/RWuVT/f+mtYiMUV3dnDN1 NvU1gCMtWvrNr0gPM5WXuJnpRpM/mapEzemokR3HbJTG/QnZt4RWtha0w/OhrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741209541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KcWODdC49ES3SnROkXinagvelHR8A1LySK/Gi4miH8E=; b=iDJdanKCLFKncqM49NwvPRoG5opdq/n0RU7UFg6kNyNBQzJikEgD4H0uVDZ3J/iJ5tUk27 VO/VuL+LaauCH+8dpUfYUhqKPdG7Gt7i/ExoJPK4x/6i79SoVHActoiFSR84iqWkfIhFcM UvfoxREcUvi+DJKrHmEk6awcPpSbCVgYe6uCHuLdXZUBicAt0qH1r9m6yYqsofpFX5RHhX Fg7QsTPSKCYHuAZvnWhYKckONorgI6pFZRxfpaiLTHrnY+42+49f9Yq2W11u+Q7AB+eXR4 Q1tJIivKU0DBeWNnSOGZ+Y7BTtZWjGusxQEr0uRZYaZOOcnOmux/66//AquQ9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7QQr6PPfz60V; Wed, 05 Mar 2025 21:19: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 525LJ0ST068882; Wed, 5 Mar 2025 21:19:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 525LJ0cg068879; Wed, 5 Mar 2025 21:19:00 GMT (envelope-from git) Date: Wed, 5 Mar 2025 21:19:00 GMT Message-Id: <202503052119.525LJ0cg068879@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: 27bf5c405bf2 - main - net80211: Fix IEEE80211_KEY_UNDEFINED() in ieee80211_node_delucastkey() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27bf5c405bf2eb69392e45c06605defc78882612 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=27bf5c405bf2eb69392e45c06605defc78882612 commit 27bf5c405bf2eb69392e45c06605defc78882612 Author: Bjoern A. Zeeb AuthorDate: 2025-03-05 00:02:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-03-05 21:18:15 +0000 net80211: Fix IEEE80211_KEY_UNDEFINED() in ieee80211_node_delucastkey() The adjustment of the check in 9763fec11b83 inverted the logic. Fix this. Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: 9763fec11b83 Reported by: KUROSAWA Takahiro (takahiro.kurosawa gmail.com) in D48980 Reviewed by: KUROSAWA Takahiro (takahiro.kurosawa gmail.com), adrian Differential Revision: https://reviews.freebsd.org/D49234 --- sys/net80211/ieee80211_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index f4185dfb04d4..a495f2f78113 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2206,7 +2206,7 @@ ieee80211_node_delucastkey(struct ieee80211_node *ni) IEEE80211_NODE_LOCK(nt); nikey = NULL; status = 1; /* NB: success */ - if (IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) { + if (!IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) { keyix = ni->ni_ucastkey.wk_rxkeyix; status = ieee80211_crypto_delkey(ni->ni_vap, &ni->ni_ucastkey); if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) { From nobody Thu Mar 6 04:52:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVF1FpCz5pRk6; Thu, 06 Mar 2025 04:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7cVF05X7z49yq; Thu, 06 Mar 2025 04:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IJuYOZIlcdptidzpFtrFcXOgWo20YcAINz0h5gtLgn8=; b=BdXCyIUhDveVCpvaW5hJGVE9erVFU99w9KhO8hXzKScibxMPfnCSfZoDFKcgVjqqVjAIPk DrzMEIsn+XJM5bGrYGp7FmL9aSD5KUyVTytMRjHfw3IzQOcrjTAMKW7wPwTlwYraCHg1pd e5BT0kvhgh3qzG/fJeWNptCCxPUDK1dwD+7juqgm/MTIyQi9JIuEuC9dUmt1jLRxDcKvHr l5qEygmY0cJjpbhSos5awyLbi5UjutscrfY5981vneaziVPeolntSTkpxhJqJfQ8v3qTNp W0+HT3+m6WHrEV9ueJCaI/lfqbRvmT7IwpPfNwoASY9KCHN1e2Z+oJ8fwmFgdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236757; a=rsa-sha256; cv=none; b=wAjKJ8exe6yjP55y+59auBcAKe1vYG8XI0RN0q3RqMcc3krWL/Ap2ltclK0QTeUQJXXpXQ jUxawLF1ouWPR4fW5Vi+p7dexnxZIrShe3qLwxQzvzgQH450FxONusYcoDdMMum/9CMal/ 7OfhhpXDa4eK1Aj6zqba6Gq72tTe+Yt98rxwq3LFAihCbl3D8oqYJIZv1RFoOdbOwWH7WF Ddr30j6+QXTvlC1V70F1Ye4HErDeaXn+SQ6BTnowvz7Iu1fACfwgJTKgX61E07VWG6Haou 9Au4Ao1AJtAm6HGgvzWGVA2SMyTs/NVPavwYTkePkb/8MF1/mmyooTY+EMwwGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IJuYOZIlcdptidzpFtrFcXOgWo20YcAINz0h5gtLgn8=; b=kJztjBqkvyPSsi+Q1ic9C5kUyWZ/C4CnveYJa3mfz9cunvfkhetyewyQfZ643Rks/GN765 tg43tkuBWiVcv4Upc5s+iTm7xAlvVPEMNPFQXzz3EnPFT2ZyESZz0Z/LYQOEtNEnXIn55H lE2oZOGBpBLbTsFl2Si+QRH8oPUw6jvFN90DDIouIMX1/cVraFv6V4a8d9r6dDbfGitMCH ZXwaFyizFnxc/JKsgiOaTdNARHJzE44VCU6AD9rNnWL6bGFieXXxSDK2kwEyirVEmNJXO9 0HXlhBbxCgjR+g+puPFILp7NuNH5jYjKVHNLxEYWcmCzU2lD7Twmm8EYnnCdcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVD6h1JzbmJ; Thu, 06 Mar 2025 04:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5264qaMQ026254; Thu, 6 Mar 2025 04:52:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qan9026251; Thu, 6 Mar 2025 04:52:36 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:36 GMT Message-Id: <202503060452.5264qan9026251@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: c7f8ffc70afa - main - bpf: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7f8ffc70afa00ae863fe9f122c5a7eb7b56f4f5 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c7f8ffc70afa00ae863fe9f122c5a7eb7b56f4f5 commit c7f8ffc70afa00ae863fe9f122c5a7eb7b56f4f5 Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:43 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:43 +0000 bpf: Use static initializers MFC after: 1 week --- sys/net/bpf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index a7e5bda97e23..263f241bcf5f 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -182,7 +182,7 @@ struct bpf_dltlist32 { * frames, ethernet frames, etc). */ CK_LIST_HEAD(bpf_iflist, bpf_if); -static struct bpf_iflist bpf_iflist; +static struct bpf_iflist bpf_iflist = CK_LIST_HEAD_INITIALIZER(); static struct sx bpf_sx; /* bpf global lock */ static int bpf_bpfd_cnt; @@ -3006,8 +3006,6 @@ bpf_drvinit(void *unused) struct cdev *dev; sx_init(&bpf_sx, "bpf global lock"); - CK_LIST_INIT(&bpf_iflist); - dev = make_dev(&bpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "bpf"); /* For compatibility */ make_dev_alias(dev, "bpf0"); From nobody Thu Mar 6 04:52:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVG2w1jz5pS0L; Thu, 06 Mar 2025 04:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7cVG0vm5z3BmG; Thu, 06 Mar 2025 04:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mb+sfYlvoudMqjwgTxzq0/J7QGvIjEU8UAXPbPzRkqg=; b=rNEXBNLtVTwe/ozvzhHEWirOsJPYYZ0sAo9HS1f3HrwLQ1uAZi8yf99BTOUnvGc9z9NjQZ kfYFJ/ZlQM7U/tuEj0/2MNBh0iWmBXGvsAIArEbjjL0r9JuFwHpO5BfVW6S+EGYioGz1Cg FssHiuKJtmqS0A0j0n1W4eAfAJ83qhyenz4fjPscuFZIJ/ND/IcAzBD8LTbtfVb58iyj5S fChyTlhS5/W0tjSt/uzRhjhuYLHo8TIuvK/qI1X5pgF7C/SN+8T8bqXscWqUZQqtIoXuRz xesZoBCwaE7mduK29x2TzfK14DSQjne5ITJvvBjqZ45zl/hzm3Lmgay+iswexQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236758; a=rsa-sha256; cv=none; b=AltW3wgv4VbvAQZ7pcdehRvDEcp10zP2mdsqz49U1PHQIz6xUXpryjGlX4Tp28oqylKtRp u7oKeNg8qE/7EE5Jh+zC/EztovGGvmqR76hXoyRLBp72Xzn4WIvliQiSHfArtEmaBU7Ap/ 5fyePHWnkWdYNxfyZq2vpLF95vMfGoU071y58lWtl4EqKlcE5fO4C6l8Gv0lHT1XppBbyR zAmDI6G4a8M0SI2a8/zmtD/SAX61TDRtnTO7gVkzpSutKvRGEIYt9wACObSvESeUDk/sif OPk6wvSJMLw+y4O0NKD/W1Nn5FbspFy5zuq6/BTHjeU6Uc0qVrWZgKaYwNsD2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mb+sfYlvoudMqjwgTxzq0/J7QGvIjEU8UAXPbPzRkqg=; b=dBwGFXZLJPBtSB2Xa7N1o2dhYSVMjrQ41GrbEkmqkUBe/18KS6j6D3ijN/2tDkQYz9aFd3 JkMDGpZ+1JCWnOcgXxFUUpDBQUX0+2oIE+cCvZdmOJz/Tp14DYzHfP51Hm8JPsQr6US4fk BL8o38uHpsWFEz1aCQIGvNsWOh91SOuNu9IqkU/fh+y6XPpXatTC3WPLK2j+VPCANARouJ iRz2TECB1FoqQpJOWujYluOQVta0k2OwiCmDAGZnus3lhnz4QsyrfWU7dU0sziYW/eqn0P jEll+JcJJi9haE+u5MYk/TLpfnfoVpq4PI5BgNOstjG8A805yA9Juz1cZq27rA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVG0W3YzcjN; Thu, 06 Mar 2025 04:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5264qbUh026288; Thu, 6 Mar 2025 04:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qbCn026285; Thu, 6 Mar 2025 04:52:37 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:37 GMT Message-Id: <202503060452.5264qbCn026285@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: b7d5bda6f109 - main - carp: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7d5bda6f109e09d8999283a9b4e4a9668df9de9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b7d5bda6f109e09d8999283a9b4e4a9668df9de9 commit b7d5bda6f109e09d8999283a9b4e4a9668df9de9 Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:44 +0000 carp: Use static initializers MFC after: 1 week --- sys/netinet/ip_carp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index c01d1bdd8cff..0ead7149c1e2 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -357,7 +357,7 @@ static void carp_ifa_delroute(struct ifaddr *); static void carp_send_ad_all(void *, int); static void carp_demote_adj(int, char *); -static LIST_HEAD(, carp_softc) carp_list; +static LIST_HEAD(, carp_softc) carp_list = LIST_HEAD_INITIALIZER(carp_list); static struct mtx carp_mtx; static struct sx carp_sx; static struct task carp_sendall_task = @@ -3036,7 +3036,6 @@ carp_mod_load(void) mtx_init(&carp_mtx, "carp_mtx", NULL, MTX_DEF); sx_init(&carp_sx, "carp_sx"); - LIST_INIT(&carp_list); carp_get_vhid_p = carp_get_vhid; carp_forus_p = carp_forus; carp_output_p = carp_output; From nobody Thu Mar 6 04:52:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVH4MFHz5pS95; Thu, 06 Mar 2025 04:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7cVH20YCz49wW; Thu, 06 Mar 2025 04:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MTQw3mvgbxfgCkmz72bnEPPRYcTRakEmgljCC8h25Y=; b=IgBpcvyP0vZixQmsOY+qfyYyRiE8L8bhxmGLRmticbPOzw8erMPQJu6bG61oXN1rN7Wg4r lrKexhNby5FjTqFvEKY/K0PED7W9ud2dxvqi7yF3CzjVUfU0k5GEG3t8l8HkMyexLFzD/g uHtXsbJSJsJzpFe3PLkoKTM0xpce3Oej7CfFRrwvBnNPPPF/F7qCH0f80r9OE8Hj62AhBl 5bJh97XUshAKIFXD4qkjXcBVgX6s9Y2V4kjFkw+TJywHnEPsob2ZqvIeN9wVS0RlNegob0 Q9/cRuEi337M/fak5WswiDvb2YHnhMRC7+YPG9dNCgRKFInIhMlF+kJ6SsEHCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236759; a=rsa-sha256; cv=none; b=fmk5Axv2LJ43IPBeYzBEz9U7/2giZ92ELs4xKHHNDUyn1mnffuXymB5w368c8oa6zfiB2I ndpA62kV6TQ37MhvTmbNDdywv05UK/H0QOHn9yn4JOO+incy/C8jRRtCqOjucGajxkTRnD 0bJBHG8xkkDWYajYtBGf9+ycwehVqHdMyZ5VlWhYaEstD4xfH3HCg79Irws2gSCf+6Da3j Oftif+8lorfyC3CpB6/pExRkXLPtHM14/abCnx+Oh/VOoCKJ6VmbSEzI2UMAhFDg7Hy2HC gjn6vFVDo+FY5CQfid7WorSQT8fjeBbyob194cjSCz5GaI3gaGyyC4Od3OEpuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MTQw3mvgbxfgCkmz72bnEPPRYcTRakEmgljCC8h25Y=; b=kcS2QAxAl8ZRlyQZgWftkWG87YJRHvHlqKSAN7k6vLTpgHgKIm8zUUsO1+8PdPOKlr5Z1s GvjuwVZdKDzjw9naDqzXnl6Dz8pLkHJXdrpjuHHp/EYl7bouzLxZjowT9ArXV54k3VDQz7 BpzMt/gtij16pyOdSnN6frFBBX9bUsW88zeUoih7SqUE1z7XlDMbHqytDXaPayE1WLsqDp DwZbMg7U4XY2SM/V564DkdnBIF2eEjfqS8vejLe9CqUXL1GHG6IBVgiF2nI2WwKMdjXNa+ 9VDk/Iv4pniI4CoFLabJHofDofqx1Xyseys2G4lxo+30vPI9+uJUDnxzYCWsjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVH1V25zchc; Thu, 06 Mar 2025 04:52: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 5264qd4N026322; Thu, 6 Mar 2025 04:52:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qdoB026319; Thu, 6 Mar 2025 04:52:39 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:39 GMT Message-Id: <202503060452.5264qdoB026319@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: fd0020f81a60 - main - bridgestp: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd0020f81a60f7c4a1401de56761cbfb2d745ca7 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=fd0020f81a60f7c4a1401de56761cbfb2d745ca7 commit fd0020f81a60f7c4a1401de56761cbfb2d745ca7 Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:44 +0000 bridgestp: Use static initializers MFC after: 1 week --- sys/net/bridgestp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index cdaf6b415417..c67f1efe3d88 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -86,7 +86,7 @@ const uint8_t bstp_etheraddr[] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; -LIST_HEAD(, bstp_state) bstp_list; +LIST_HEAD(, bstp_state) bstp_list = LIST_HEAD_INITIALIZER(bstp_list); static struct mtx bstp_list_mtx; static void bstp_transmit(struct bstp_state *, struct bstp_port *); @@ -2137,7 +2137,6 @@ bstp_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: mtx_init(&bstp_list_mtx, "bridgestp list", NULL, MTX_DEF); - LIST_INIT(&bstp_list); break; case MOD_UNLOAD: mtx_destroy(&bstp_list_mtx); From nobody Thu Mar 6 04:52:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVJ3blZz5pS3D; Thu, 06 Mar 2025 04:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7cVJ2rcXz3BvY; Thu, 06 Mar 2025 04:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HiHXdkOHK145PMLKHg4eh+W7vIxvS0bdavbWw81JbpA=; b=S/8dZZk4CrysLELdXEIo2COUp1EaNv4sy3rGTWy9YB13ethZ/J7+/OfBhmPeP4QfZ4161T Zeixg5QghA76XLyNDV3zo0canJuWBrF2kJ2Dj+69YWE2D9JetFvY1fOCJQ+TWfAwa/9XoO YeYbFlZPMlBm4xOljdFEneNTa2YWrEUwd218jjMoFotGTKFXVth1cC8tuptD7qjYiJevXB LP2T91NkB0KGtfEKLc2gFDMhP77W4GDeh7RP1NkPvp7xJU0bFLfaYGEkxFRgZ76rmKKtS6 XNhNYWnRBem2iAIv2pODxAgaE0O6PGs6TRIib0CdFypOWyPvOOaInXkvOlTmUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236760; a=rsa-sha256; cv=none; b=gSYNB4QXCj/kQ5gspDpOPU43rCwTPDcBPnNFqW7GMs5GYAVLADGlaaXqK9rwL7AFggjv0P iT/9m5+35tg4+HMC7VuGOwBAIhABFah7LpL+vBJeEga8cArvc+pRXvbjiW3RSAsG1RWPyQ ppxlAwhW9YFwP1qdpe4VQGF/sdSDoeMCi4c/rn0RHEAbTGDD8Om7uTeIS8xY5VHWzHTZeC W81E/e+utBnfLBzP3B9HTA/mNWDklYBS3BtTeg6tmjImCxsdQPbMNQfm0WYh1M6zSJeZfK F79dJniGivwQy51I7UtDrbQfPvezSiU0uIbPSqdXCltohEC2jJ6siy34tfJGqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HiHXdkOHK145PMLKHg4eh+W7vIxvS0bdavbWw81JbpA=; b=LamuH8rFJdI3A8/Z9fsxxrv/hJ18Rl+2OGvSgzvGx75B3IqeTD627BXio28WgryTYHW0xS yaF/DdkX8H+enmWkfL66NYeMU3piH8x/xIKjAjS5cl4WT2l2/SOPOHDO0DEoo9GE4n3V8i FrIs1+ERS7uD9iF08E7Va26vkHifJ2viE62ogR7B2z6scpCextdG3ODikqB4MBN2ea58hh Lj3zwU3PpFB1Kc5A+28pu+UKo5R5MQS0d2PbdCJfqtgJ4d+HlHDe0bOP5GnEc1+lkBPvsd iksXUkD+BSxgoy7Z952bYHB/XBcbE6CBI6xczh3yIwFyTQx1jDD0KoMFLohymg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVJ2RGszbjd; Thu, 06 Mar 2025 04:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5264qe2G026356; Thu, 6 Mar 2025 04:52:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qelh026353; Thu, 6 Mar 2025 04:52:40 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:40 GMT Message-Id: <202503060452.5264qelh026353@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: 59dbc829cf07 - main - if_bridge: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59dbc829cf077ae0b07577f374ffc536d5acbc6a Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=59dbc829cf077ae0b07577f374ffc536d5acbc6a commit 59dbc829cf077ae0b07577f374ffc536d5acbc6a Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:44 +0000 if_bridge: Use static initializers MFC after: 1 week --- sys/net/if_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 299b6d80dcde..5cb4a033e325 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -602,7 +602,8 @@ static const struct bridge_control bridge_control_table[] = { }; static const int bridge_control_table_size = nitems(bridge_control_table); -VNET_DEFINE_STATIC(LIST_HEAD(, bridge_softc), bridge_list); +VNET_DEFINE_STATIC(LIST_HEAD(, bridge_softc), bridge_list) = + LIST_HEAD_INITIALIZER(); #define V_bridge_list VNET(bridge_list) #define BRIDGE_LIST_LOCK_INIT(x) sx_init(&V_bridge_list_sx, \ "if_bridge list") @@ -623,7 +624,6 @@ vnet_bridge_init(const void *unused __unused) sizeof(struct bridge_rtnode), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); BRIDGE_LIST_LOCK_INIT(); - LIST_INIT(&V_bridge_list); struct if_clone_addreq req = { .create_f = bridge_clone_create, From nobody Thu Mar 6 04:52:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVL0Ls9z5pS4h; Thu, 06 Mar 2025 04:52: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 4Z7cVK3SKZz3By4; Thu, 06 Mar 2025 04:52:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O2LTymUmbeRRUmplCXRcEbnxVK5djkIAwoUfNQQj9ZY=; b=F6ViP5lJh6rRZH8Og8bB9YHAwmlwQDhfdce9mwZ2oZHuXcEf68ZSVrIfdQLmX0F3rmgcca noAnocfO56n7ZEw5Jo4BP+2QSGq2Cgaaiao3RJfZAN5p7UM2O+vlwFuBFwcqV74jBQb1Fx GKsPY6h67ep8kejuoN1CiHGMCX9LlXMBtCE3joKWrRnaD3Txv+XKgW4NB0B6+JbO6smAjM 4ZwT3YbWe2Vrehc8UvDNcFZwgI1FDqFkOlZjYpG6VSaIRXqCyQFfs8zMNKc7dq91EW8JBH /X4s2k1ZKtRUydnulGGTsMqlimiE2ZL9IVwE74D4EY3OPigEz7kmiuKcl0vtPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236761; a=rsa-sha256; cv=none; b=ZfzxTXs/yM4687VBPeC93G4e1TmqWeMLFpCWpXWFUt4FooxE+pzBjp6LTGKeoJdwLBUqWs m6dAhRENoXiLNd3+r/7VaV4xklAbCZ26q5oAgzQxXhdcLuJdlf3Hw2ikz5lbUcsJ5FvQ6+ HEK9kXuaae8C7lwV9IuuaVA0sxB3MwqnyijlHUU7N46uIajbHXcA8BoH1HuAa4p6Wfm4xU GZku1QPlKYmGg/DJ59JIxfA9pjlK8if2m7UohvELeyF9TKPL8A67yDKJlVyOd3HiJq4I7D x4hb5R3feKWrhly1NDW+EZ/GNyT7WL2QR+PydSvmEKaft0+afc0aDlXp9wIjKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O2LTymUmbeRRUmplCXRcEbnxVK5djkIAwoUfNQQj9ZY=; b=rrXVGWodCE5uuahildfSbEUa5CAKcYtp8MuycyOwDsFzVbvqtJkpBBMhJcV7dAbnZwQbbC SL8Kvj3FdB67SdBXri8Il807PNPEkJN/dKVGCZ71dUgxLz8O6U3R4x6pwL9XoBXmAiRLsT NL5zP+HksRsw+jOU7FD+7Ru4zrvwwSD9WORurDwdBG2pxU0yjrr03pyKWEqaPwMr+piVpZ MPHTvJrF+X8BIpE92kE4ywehUv6QwyaXF79WovZrqQkgQr2A1xkoWy3YX9+gzYAYkOA0Uh i+Bp26a+IShxzmhgl8Pc/y5ERmJzHPagIenim6mdFP0kLrqhKMKB1wr4oOX8eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVK31k0zcv3; Thu, 06 Mar 2025 04:52: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 5264qfeA026392; Thu, 6 Mar 2025 04:52:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qfh3026389; Thu, 6 Mar 2025 04:52:41 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:41 GMT Message-Id: <202503060452.5264qfh3026389@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: 1ba655149ed0 - main - if_clone: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ba655149ed0447f93e997a60330d9b962d061f2 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1ba655149ed0447f93e997a60330d9b962d061f2 commit 1ba655149ed0447f93e997a60330d9b962d061f2 Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:44 +0000 if_clone: Use static initializers While here, remove vnet_if_clone_init() which is therefore an empty function. MFC after: 1 week --- sys/net/if.c | 1 - sys/net/if_clone.c | 9 +-------- sys/net/if_clone.h | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index ce0c3d5c0616..21e3b1a8576a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -433,7 +433,6 @@ vnet_if_init(const void *unused __unused) CK_STAILQ_INIT(&V_ifnet); CK_STAILQ_INIT(&V_ifg_head); - vnet_if_clone_init(); } VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_if_init, NULL); diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 13d89e4e2c59..066547ceeeb3 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -128,7 +128,7 @@ static int ifc_advanced_create_wrapper(struct if_clone *ifc, char *name, size_t static struct mtx if_cloners_mtx; MTX_SYSINIT(if_cloners_lock, &if_cloners_mtx, "if_cloners lock", MTX_DEF); VNET_DEFINE_STATIC(int, if_cloners_count); -VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); +VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners) = LIST_HEAD_INITIALIZER(); #define V_if_cloners_count VNET(if_cloners_count) #define V_if_cloners VNET(if_cloners) @@ -183,13 +183,6 @@ VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); static MALLOC_DEFINE(M_CLONE, "clone", "interface cloning framework"); -void -vnet_if_clone_init(void) -{ - - LIST_INIT(&V_if_cloners); -} - /* * Lookup and create a clone network interface. */ diff --git a/sys/net/if_clone.h b/sys/net/if_clone.h index e11fc5c8cdd7..5a74ffa1cc2f 100644 --- a/sys/net/if_clone.h +++ b/sys/net/if_clone.h @@ -148,7 +148,6 @@ typedef void (*if_clone_event_handler_t)(void *, struct if_clone *); EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t); /* The below interfaces used only by net/if.c. */ -void vnet_if_clone_init(void); int if_clone_create(char *, size_t, caddr_t); int if_clone_destroy(const char *); int if_clone_list(struct if_clonereq *); From nobody Thu Mar 6 04:52:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVN1MBMz5pS4l; Thu, 06 Mar 2025 04:52: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 4Z7cVM5XSFz3BqH; Thu, 06 Mar 2025 04:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+sJyxPqlbZ0Ntc7sZB9mWaZbAOeeap6nQD3bq18I/oo=; b=aNtPMaQUA8ZsoEgBInwIdF2BDFTX+oPHpUIR5RU8fLwbNMJwT0LN82JdlOyk+I7PW6WVC8 MfM3vSfDQpS8vr9KMzaPqpMohTKmr/JaHPUdpCJ7D5owvXgw4QjnQHP0LEtpefF69Z+mY7 faH/0pi/xHxOv08GK5kO8T1Uk3UxdRQaZ3rK13Un2LjqT+oWWvRwGxAJUJsygQVYRefeP+ zHwSUw0MfcqGPObhQqtuR14XoFM/zk9g0oimlCWHS+EGs6v+PDF5wjSOemNo7sB/R/I+ft Vt/2kCmoWGpCHCL3uDTGluTJXlE0uGcRCJXvqc+jodJscOyUSoiNoFP4jP6kPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236763; a=rsa-sha256; cv=none; b=s1uLBfvJZ5HF3K1QV+5HfO4xW6UbGEsCo4ovVzBwu7IyQysdQ9TOuHu9PO1kBjb81/5fhB W9AZjGNgctMW3IczhCE8avzWDSxoGKOQmpl5GXDGzl7sokJkfimQB42/Rmk8FmhdjFvHS2 wfVTaNCYJQFx9qzNaS8DngME9duavHkSsd/vEkfM4ybrnb5qTI69PeS3ZJu1Nl3KPoKqk3 Hgz26KACrVHZnvSIyqcZsGPpIi0L2902+9XPGRs0CL9B8JW4HaTD3oIi6D4H7cLDIKpjft 9tb1rbo9yPrxSUGneQK4+E1rrSUonyMQ7buQ9p1a0dogelkQZb+SGTV4EUwwNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+sJyxPqlbZ0Ntc7sZB9mWaZbAOeeap6nQD3bq18I/oo=; b=GTKFO9eM0coE2CCtiJBBvKPvkK+e4FFz3vR7e0NzJ/w3SKka+7kVpY74Auq5CugdEbj1QX 8FKWnEUmiUnscy3IJzaTIe9JFko6Kc6Y2NkfzB7hxwtlMvIad4FLJAZI2mfon139Bvdwpv i3bulRSjtdkrHsj9tdN5mhqQMSFElYjMWp/wJKpA8m8NwwsEnZo+Fq4KuQjmIx0o0bd9Z1 JlMs/9Nq31X01YsziOEh22M+11701aM6A0Xj8EZaAFI0L6FevImQsRbGhkhtR7Y8QRgcIE wC6Vc/5mi31PPlSnmRoYHp5OtQVaRdaYkgB15JBxketM1avWqzqZ+o81pn6NqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVM4x3YzcxY; Thu, 06 Mar 2025 04:52: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 5264qhDS026466; Thu, 6 Mar 2025 04:52:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qhlF026463; Thu, 6 Mar 2025 04:52:43 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:43 GMT Message-Id: <202503060452.5264qhlF026463@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: 09de37310313 - main - tcp_ratelimit: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09de37310313d87942fc5349914be46b9cb8c808 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=09de37310313d87942fc5349914be46b9cb8c808 commit 09de37310313d87942fc5349914be46b9cb8c808 Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:45 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:45 +0000 tcp_ratelimit: Use static initializers MFC after: 1 week --- sys/netinet/tcp_ratelimit.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index 22bdf707fa89..a0e837cc7d76 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -246,10 +246,10 @@ const uint64_t desired_rates[] = { #define RS_ONE_GIGABIT_PERSEC 1000000000 #define RS_TEN_GIGABIT_PERSEC 10000000000 -static struct head_tcp_rate_set int_rs; +static struct head_tcp_rate_set int_rs = CK_LIST_HEAD_INITIALIZER(); static struct mtx rs_mtx; -uint32_t rs_number_alive; -uint32_t rs_number_dead; +uint32_t rs_number_alive = 0; +uint32_t rs_number_dead = 0; static uint32_t rs_floor_mss = 0; static uint32_t wait_time_floor = 8000; /* 8 ms */ static uint32_t rs_hw_floor_mss = 16; @@ -1778,9 +1778,6 @@ static eventhandler_tag rl_shutdown_start; static void tcp_rs_init(void *st __unused) { - CK_LIST_INIT(&int_rs); - rs_number_alive = 0; - rs_number_dead = 0; mtx_init(&rs_mtx, "tcp_rs_mtx", "rsmtx", MTX_DEF); rl_ifnet_departs = EVENTHANDLER_REGISTER(ifnet_departure_event, tcp_rl_ifnet_departure, From nobody Thu Mar 6 04:52:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVM0Cbcz5pS4k; Thu, 06 Mar 2025 04:52: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 4Z7cVL4Q79z4B84; Thu, 06 Mar 2025 04:52:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSmId327iL9SXpzzB5Lirs2sAZ2aD4FyqtFl4kBKQtU=; b=OFFbM8Rssc4Ccy5yC4YxunTVjb7FyWVHipo8z+W1P8C959KlHJ/DcZvZk893EViwGnDguQ u1+OW14DAO5ExL2846CA/4xSdh7vPWdYkT0PIKpwQXrDDDSDsjc+cDGCpz3yYbteSLDv/1 qAsM7x/ACW2+0AC88UNtQo1Jk3zdvpu6uXkWNkc/9rnNyMyGaE526V9moyqGKNTSxymBQw 3A78fqtbUdB+da+Bl5cfyMaWJQYqB1jfGexUz1tYGNAvaRjKlbBzyfZhL6CBEUyiSomoUR 9+xJwTW/00snr6prztgQMWHvOW3JHb6Yb6BZ77dz5YhRCSgXz9BfZMa4Nces1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236762; a=rsa-sha256; cv=none; b=txfNqsKEFP1YOe8DJ7n0Kz0cAwVOZqi4IjpCLSIlZNEgjsdrrPWgcHTG/sVnaa9FyWvQzN gvkwkX3aAleP9X0gJRZaoLXAYMC/ho7M/1OXz9xbctjQSkm4q0pvv6BbbqvrX/ffU/Smjz d79BWjRRwfIaqrANMvZ25kohNSdWBSHWpja1Di/WLgkq/kTnM1skW3f7MBhdI7DAy6bfxE 9M7iS+rPXqirpCKaTnC73TkT+fqbTGQ3hFuFm0kDN3gWU/P9pcYBqieFB/J3hAajUjG1Cy iv9BO1leO6ic+TY5lJ8iPxI41DOnsVc4Ax2CF6mb4OFegoSYCZBsQ7dd9xaShA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSmId327iL9SXpzzB5Lirs2sAZ2aD4FyqtFl4kBKQtU=; b=Pc/w0LaKCBdvxq4jDrYTFNURdElO1HYYxPhp9Tue97/kM64UZZXlzWDDleMchvTgmCh0/W 1iTJbPCdssRD6nnn+1whXD1f0xrDVnqspByR3qjcG5XCD/SIW7nNvKnrEwx4SCtcvureE8 X+9N3qkohaYDiFPfkVQtPzdXvxbtdxm1rdctODWr77H/QobH40EetkvXpqBSBHGW056M2U wzVVQEjtz/wCyQYG2yHoE/aJ+a/eKLbfUFxA3FQ8o38y7MpemwxX0Iy9e6cWRhH1p43giu Dy8JdmnPraA0Jn/e8rlxLJhmFJgQRiEmRk+rb9ramXdRPwWQ2bYAGzIwutZ20Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVL3zGCzcrF; Thu, 06 Mar 2025 04:52: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 5264qg7w026432; Thu, 6 Mar 2025 04:52:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qg99026429; Thu, 6 Mar 2025 04:52:42 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:42 GMT Message-Id: <202503060452.5264qg99026429@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: 36ebdd0155d0 - main - lagg: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36ebdd0155d07fc53375fb212d9ca80158dde350 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=36ebdd0155d07fc53375fb212d9ca80158dde350 commit 36ebdd0155d07fc53375fb212d9ca80158dde350 Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:44 +0000 lagg: Use static initializers MFC after: 1 week --- sys/net/if_lagg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 9bc42cb8cbe6..9867a718e148 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -102,7 +102,8 @@ struct lagg_snd_tag { struct m_snd_tag *tag; }; -VNET_DEFINE_STATIC(SLIST_HEAD(__trhead, lagg_softc), lagg_list); /* list of laggs */ +VNET_DEFINE_STATIC(SLIST_HEAD(__trhead, lagg_softc), lagg_list) = + SLIST_HEAD_INITIALIZER(); /* list of laggs */ #define V_lagg_list VNET(lagg_list) VNET_DEFINE_STATIC(struct mtx, lagg_list_mtx); #define V_lagg_list_mtx VNET(lagg_list_mtx) @@ -299,7 +300,6 @@ vnet_lagg_init(const void *unused __unused) { LAGG_LIST_LOCK_INIT(); - SLIST_INIT(&V_lagg_list); struct if_clone_addreq req = { .create_f = lagg_clone_create, .destroy_f = lagg_clone_destroy, From nobody Thu Mar 6 04:52:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7cVP5HQYz5pS9G; Thu, 06 Mar 2025 04:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7cVP0R41z3BnZ; Thu, 06 Mar 2025 04:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7teycgOjzp0rDVhNUHMm0wIN6OOlROjE4K7A37cJj5s=; b=YBuuziZuVchuLb9SBla1N5d9+ZM2ifJ9zxoCU7rpTiyKBUHbqMK+cLnQUht14mZcDEXUxs qEz0pLinbtoTCnylqAu2viASApNcBmLKddSvqFXTvBg6Mbb9IaxR7owi7roIQDemSoImcv A5TveIP0kUATrNyunCiLAEJXJskbl/4UU/0K+0iA6jFU6pSvgYFLErOy5f6JwYupsc+7T4 kfS9M1iwnPuGFGupFJxGr9ZRXtHmRHK2V1nXos6DfGYqlRvcDh+AvIeopRTynMmTgQfkKX Jf45bwXGddAiFvZXw+s3JMdsW4S25FeHdniCJ/7BW5gUfqk8fUpXzECIcZzlvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741236765; a=rsa-sha256; cv=none; b=YIGZyxC0u2fvBU6Zc4ZTSePi0Zf1sfOFmOD1ySlqz1nYkQaRi3NP9Pz4fztqx3foZG1j5N BZIPZGJWlWO6qoueQuTUdQbQBJrseya7KqdyAO+It4Csf+zi1XGbWpcbxZo3Q6CSq6vU5w Wj68/vBeSipubTYywygUgk6kEPs5SvggBeEtzoqdOa0NFUoDRu7b3sTIDRRoDyLQSgSCGC hRXIZuZZCW4+Msv+eaMNm7xQD+ouO2RJya9u2KubQG7pWFyzdJB7eExfSXtghNXcLr0i1K js3C35JYul4PgqqX8Z6eNp16lcCSbzo98M+CecTzaFC/2TibuEs2vVsv3o401A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741236765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7teycgOjzp0rDVhNUHMm0wIN6OOlROjE4K7A37cJj5s=; b=LG+bnGwHMK0oWWgqgA/GHi+BuaRQ+WD0qPan5O7pPFPTTBuzqrvmc2JmiMUcva9kC/fkU8 aE8Y6f9uCd+EofNZTNxQnYMzoVS2e55WlvGeGMu7mLlNm4ZFORA27LuLF8QzYXM5av1hpI 5lALSQ1y/aTfuvYxhIrN67e5p/GhOHCsai8syRoDuBOgukUEMrMnM9X/4wXoAgmo/w0128 b2YlubfpVZnwBkNQMy1HzvD2wLcLyflXbgnOFzgJLIkh5TOCgfpHBoAhDCP4D1+4UDv5Ds NBiySLDqa6ypxYG4XXjvYytaomZZcmrmaz14D/LWiCjnsjS9JU14p0wkfOPkuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7cVN5yBCzcGC; Thu, 06 Mar 2025 04:52: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 5264qi7Q026499; Thu, 6 Mar 2025 04:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5264qihE026496; Thu, 6 Mar 2025 04:52:44 GMT (envelope-from git) Date: Thu, 6 Mar 2025 04:52:44 GMT Message-Id: <202503060452.5264qihE026496@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: 23f453ae34c2 - main - vnet: Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23f453ae34c29b99f892da18db44ce4292ccb7c3 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=23f453ae34c29b99f892da18db44ce4292ccb7c3 commit 23f453ae34c29b99f892da18db44ce4292ccb7c3 Author: Zhenlei Huang AuthorDate: 2025-03-06 04:51:45 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-06 04:51:45 +0000 vnet: Use static initializers MFC after: 1 week --- sys/net/vnet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/vnet.c b/sys/net/vnet.c index 94be49376adf..c64aaf9f61b5 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -101,7 +101,7 @@ struct sx vnet_sxlock; sx_xunlock(&vnet_sxlock); \ } while (0) -struct vnet_list_head vnet_head; +struct vnet_list_head vnet_head = LIST_HEAD_INITIALIZER(vnet_head); struct vnet *vnet0; /* @@ -318,7 +318,6 @@ vnet_init_prelink(void *arg __unused) rw_init(&vnet_rwlock, "vnet_rwlock"); sx_init(&vnet_sxlock, "vnet_sxlock"); sx_init(&vnet_sysinit_sxlock, "vnet_sysinit_sxlock"); - LIST_INIT(&vnet_head); } SYSINIT(vnet_init_prelink, SI_SUB_VNET_PRELINK, SI_ORDER_FIRST, vnet_init_prelink, NULL); From nobody Thu Mar 6 11:03:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7mjf55d2z5pQ1V; Thu, 06 Mar 2025 11:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7mjf4W9Wz3gmx; Thu, 06 Mar 2025 11:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741258982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vt45hcr3ppc+mhmQejxl2JNQf1pGtT1mudqMh8k5ryY=; b=MmHHW+yWZIL36BUKULa5VseRu0ijgEwC5vZjtu1WabUg4QUBUAzWhgUvJoQEtudYyjAG0F xCIHWA6aXqtoXoJpGyCknesskbawJEqqH61aJOrRcQB/X+BFwQD7r1zoJ+vXLOsrJUTJ8G 0pvAHeD0SaS+L5wYTW2rjmTihKRt/yICT4fsTFaYHewPT1HNzeSkk3fpCVWy4dCFRHs8gH A3eLwx8M5quW5GmP0gqCp6kJRxnmhuDcGBNizun/prwjJPIuxR5MngJE+kRGskRlv4AKH1 7UtR7e+qmsgEsSmkeaL0HCpx+3ykJGzR+0i/IaZqB3TtwYNLPTPNMOTtYagN1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741258982; a=rsa-sha256; cv=none; b=NaOYgcZeApnb8KXJRY2rAA+mz8vDaOpzQ7D/dLdAksmPZ16MSJdEXhDhgbOoJeDBm6lHdm ZXCT0/SMZoEc681E0YfDex93oZVddcRlU+Xw2Eg+44dVgMLYZL+dMZuxffxSL8Hq1goI1H I1vPJiz3daoYmvX+SWX7c9nPzRUYUa7ReuKjNEdDZMq1hGHXoTtvtxopaUHwbxv2uglFAw aSWqAJnNZkaAG+37817IppFePe5sHkflk2FNA77HlKPeslsJA2nBhqB3TKGfKB8wvTvgC1 EOlgQt1XGshIRy/KS+k8iZgLEoz8WX6qVd1lFFR6wjwbifnonvQAmMAQr7WbXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741258982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vt45hcr3ppc+mhmQejxl2JNQf1pGtT1mudqMh8k5ryY=; b=jCzx7zz1Z/gmkGFU2wBA36tn2xFJT+NS6EBJ3yusLAUKOceQofnWr659Q7UC0bN9RJuq0a akGc+qAL6TIhVFnl8tJIbKDgrayrv4ds802vyv8vS7RdWSoHFOBIEsm9qQdjMSzFbK+H+R CJyKijUWr99uJW80kDGAphFTWxYAl7PpotuFKk11mQdx5KMA5O0INaEliToDi+TQ0/ysWJ Au7XIPLZNGVFmo+mN+pj2Rp347VLJCgkBqJ+aPCt8cCQ3+DL5xlTlPHPpjDgs3XfLPsuGm jR9tVN84VDecNNcblNBrMGpFhPB5aWVJZRIVctPKusGw9HevzRZatyIIgbG8Dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7mjf41QrzntD; Thu, 06 Mar 2025 11:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 526B32X8022655; Thu, 6 Mar 2025 11:03:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526B32Id022652; Thu, 6 Mar 2025 11:03:02 GMT (envelope-from git) Date: Thu, 6 Mar 2025 11:03:02 GMT Message-Id: <202503061103.526B32Id022652@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: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 234683726708cf5212d672d676d30056d4133859 Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=234683726708cf5212d672d676d30056d4133859 commit 234683726708cf5212d672d676d30056d4133859 Author: Mateusz Guzik AuthorDate: 2025-03-06 11:01:49 +0000 Commit: Mateusz Guzik CommitDate: 2025-03-06 11:01:49 +0000 devclass: make devclass_alloc_unit use M_NOWAIT The only caller already does this. The routine can be called with a mutex held making M_WAITOK illegal. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/subr_bus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 9506e471705c..0422352bba51 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) static int devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) { + device_t *devices; const char *s; int unit = *unitp; @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) int newsize; newsize = unit + 1; - dc->devices = reallocf(dc->devices, - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); + devices = reallocf(dc->devices, + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); + if (devices == NULL) + return (ENOMEM); + dc->devices = devices; memset(dc->devices + dc->maxunit, 0, sizeof(device_t) * (newsize - dc->maxunit)); dc->maxunit = newsize; From nobody Thu Mar 6 11:32:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7nMH68vzz5pS4L; Thu, 06 Mar 2025 11:32:11 +0000 (UTC) (envelope-from zlei@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 4Z7nMH2dWPz3rCf; Thu, 06 Mar 2025 11:32:11 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741260731; 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=sArnxEZ3utMyaYzKvo18hubCF9ygEcfBZBWhTgosCxA=; b=t2LEzzSVGjJvce71P26TgAFZByPkfncwmpzNnH9ixU6JSTlt8Tmq3CcT1/GsyE1RNSXex8 HNNUYF4Y2vknXg5F94lWr3dKlWboqRxXfyhY58HehcmTDX8UVlKOh27P9LTbJOL13PNZZ8 TKHyA0LU+IsljMryorSRgGOQHt8vqaeLoj739GmlegPo+2pmqZ7h7mjCpbAaKmbU4OH9g4 5QroV8/QqblE9YDRKwfWY17ow9YcqAnXCQ4EC5ygiryNRGdjMpay8OwOw5A36egq2pnEGe MU85ZqNzxh4vnbXmAIQLJjBNJ5IdezQDqrZZjDc7hKvTQJOgNZR5xDAvaW3sew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741260731; a=rsa-sha256; cv=none; b=niqsSthaEtWp3UaoVl+coq+eJoyr6w+x0iJoMlpz8XfJunTs6T6TKZZ+N41FfmyaUj+ykJ Djebtb9PckPwuESJC5gFNgmoEW2okU6YPz2YPRHn199Skx711gLZvoguatWp7/OodZQvtV /ljbT0WGsuljkgslq+1805GSx7izbdpsuC53V0q5l/SLz0q6/JRGscFrU7dLSboBb2f7Ev x8Me8nqhPDPwf9FP3/1XgrbwZxvneUMEp3PTXApI4WN4oBSjZCVW0BNim4NF1mJjNN/fXw q27j++BHYWeO07grLtllYUvzkYE9wU2ol/A/YSn2esEb7b0ewuHWiUw/5mKAjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741260731; 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=sArnxEZ3utMyaYzKvo18hubCF9ygEcfBZBWhTgosCxA=; b=VqTvRHcHHTA4s/lfLi57yocBXEsjitoIbqsYnD+z1SLBlGMcHD0902AkWP3aVHpHY//Zl+ 2hXuip7JuW569kyiQl6PXCJ+L0IzPutNrv0o1zP1Tva1nPL80EkC7udSrP0yafAAZJnNbP 8cixhZatwRxV5DMZSn2L/9g1WQp5/WIWjprhEYq1EinFnmfVRSzdyjajdc3Uvi9RNClGDB yodHLmBMGv8LA8txtBfAD/zP3+mTIjuLdpk0H6FxKqgDpSGgBpAwSKWC4roPCG9OBOMTnX n+gnJUrcrtuSMriEWw8nKpV7UBlvgpiGActxHTvvotnJYgq8UZwSoVcF4WMqnA== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z7nMF4WdKztwm; Thu, 06 Mar 2025 11:32:09 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_35C7DAD6-2678-417F-87A5-DCFFE513A6FC" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT Date: Thu, 6 Mar 2025 19:32:02 +0800 In-Reply-To: <202503061103.526B32Id022652@gitrepo.freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , Warner Losh , "dev-commits-src-main@freebsd.org" To: Mateusz Guzik References: <202503061103.526B32Id022652@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3696.120.41.1.10) --Apple-Mail=_35C7DAD6-2678-417F-87A5-DCFFE513A6FC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Mar 6, 2025, at 7:03 PM, Mateusz Guzik wrote: >=20 > The branch main has been updated by mjg: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d676d30056= d4133859 >=20 > commit 234683726708cf5212d672d676d30056d4133859 > Author: Mateusz Guzik > AuthorDate: 2025-03-06 11:01:49 +0000 > Commit: Mateusz Guzik > CommitDate: 2025-03-06 11:01:49 +0000 >=20 > devclass: make devclass_alloc_unit use M_NOWAIT >=20 > The only caller already does this. >=20 > The routine can be called with a mutex held making M_WAITOK = illegal. >=20 > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- > sys/kern/subr_bus.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c > index 9506e471705c..0422352bba51 100644 > --- a/sys/kern/subr_bus.c > +++ b/sys/kern/subr_bus.c > @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) > static int > devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) > { > + device_t *devices; > const char *s; > int unit =3D *unitp; >=20 > @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t = dev, int *unitp) > int newsize; >=20 > newsize =3D unit + 1; > - dc->devices =3D reallocf(dc->devices, > - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); > + devices =3D reallocf(dc->devices, > + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); I'd recommend against this. =46rom the commit message of f3d3c63442ff, = Warner said, > In addition, transition to M_WAITOK since this is a sleepable context So, the M_WAITOK is intentional. Rather than reverting this, the caller devclass_add_device() should use = M_WAITOK. ``` - dev->nameunit =3D malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); - if (!dev->nameunit) - return (ENOMEM); + dev->nameunit =3D malloc(buflen, M_BUS, M_WAITOK | M_ZERO); ``` Best regards, Zhenlei > + if (devices =3D=3D NULL) > + return (ENOMEM); > + dc->devices =3D devices; > memset(dc->devices + dc->maxunit, 0, > sizeof(device_t) * (newsize - dc->maxunit)); > dc->maxunit =3D newsize; --Apple-Mail=_35C7DAD6-2678-417F-87A5-DCFFE513A6FC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Mar 6, 2025, at 7:03 PM, Mateusz Guzik <mjg@FreeBSD.org> = wrote:

The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d67= 2d676d30056d4133859

commit = 234683726708cf5212d672d676d30056d4133859
Author: =     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2025-03-06 11:01:49 +0000
Commit: =     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2025-03-06 11:01:49 +0000

   devclass: make devclass_alloc_unit use = M_NOWAIT

   The only caller = already does this.

   The = routine can be called with a mutex held making M_WAITOK illegal.

   Sponsored by: =   Rubicon Communications, LLC ("Netgate")
---
sys/kern/subr_bus.c | 8 ++++++--
1 file = changed, 6 insertions(+), 2 deletions(-)

diff= --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index = 9506e471705c..0422352bba51 100644
--- = a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t = dc)
static int
= devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp)
{
+ device_t *devices;
= = const char *s;
int unit =3D *unitp;

@@ -1264,8 +1265,11 @@ = devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp)
= = int newsize;

newsize =3D= unit + 1;
- dc->devices =3D = reallocf(dc->devices,
-    newsize * = sizeof(*dc->devices), M_BUS, M_WAITOK);
+ devices =3D= reallocf(dc->devices,
+    newsize * = sizeof(*dc->devices), M_BUS, M_NOWAIT);

I'd = recommend against this. =46rom the commit message of f3d3c63442ff, = Warner said,
> In addition, transition to M_WAITOK = since this is a sleepable context
So, the M_WAITOK is = intentional.

Rather than reverting = this, the caller devclass_add_device() should use M_WAITOK.

```
-       dev->nameunit =3D malloc(buflen, = M_BUS, M_NOWAIT|M_ZERO);
- =       if = (!dev->nameunit)
- =               return = (ENOMEM);
+       = dev->nameunit =3D malloc(buflen, M_BUS, M_WAITOK | = M_ZERO);
```

Best regards,
Zhenlei

+ = = if (devices =3D=3D NULL)
+ return = (ENOMEM);
+ dc->devices =3D devices;
= = memset(dc->devices + dc->maxunit, 0,
=    sizeof(device_t) * (newsize - dc->maxunit));
= = dc->maxunit =3D newsize;



= --Apple-Mail=_35C7DAD6-2678-417F-87A5-DCFFE513A6FC-- From nobody Thu Mar 6 11:34:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7nQN2V08z5pS7V; Thu, 06 Mar 2025 11:34:52 +0000 (UTC) (envelope-from zlei@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 4Z7nQN2FYtz3sNW; Thu, 06 Mar 2025 11:34:52 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741260892; 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=g7w/giCe9B7hMHxWnDTVGUopc6q7+bXaDsTkPdbt430=; b=xYivmioAxR28DYLUPpm/TXk193PUKHA3D3/18SOnzxrUQaFrbHCKDkMKcNES1h3zLCQuzk ZpnsAJUT3u6f79z7fx5Ry6LKI9ByJq8JHQ4WpfbFvh/ZQtDUy29F5QkzyF81iCMvtUIRAs poVvTQlgXD4E0hNDtjZ3YiGS1hcEoyV7+Msn47Rkl1qPuK0nWk7t28/DALAAozs7Pkan/g FTNiRyvnuD65LCci2saagI18cMXGAU3Sk6Jy0+XvDpGcul5YATbO428A/QZCl0hvcmOMK0 8xgmsjv40r3XKAYfxLigzNOXbGlXXsklPaUMdzUiRiOJGrqP5aOPk4TtIuK0XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741260892; a=rsa-sha256; cv=none; b=whOgdslRQZzJAuZqvH0ZGUiW9Jqw8OrpeiA64+BHoRjTsmnXULHNoII71LuQVQURZL3P9J hFMqr2e7D/IXToSRLKIw11MQMuRkmQIHpVLz/j6KGdm6yrr7CEDEZRrl7YAmyWX+3dwpgf D8bSgUHwBUSCd/xGEAPtJrRcquqdPg9o2d4I9Lhj1OuDAzeN5pU2dla0VKPMt8oeIiVQ1O CjqKdeFero1x/yTV7VaPrzPFjFA9+FdxkbT1hUfpG7mvyRR8UoD9tSVYyK30EnT/4dI0c5 k8pPuWe7UKcevAnvRcIZ36qQlu6FqiC5exYsPKN7zXKZxPYs5hmGrcPsSoADMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741260892; 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=g7w/giCe9B7hMHxWnDTVGUopc6q7+bXaDsTkPdbt430=; b=M6jaQH5wP9v8PNiAOycRy2PFvG9eMuMb1AM0JvTwc+g5IihDi6UrbAeRSjB21RMy5NCH+r /eKwY1eK5ivL+XxWhtTNh6eYLtkU04Zdha+3JNeGRA1ZDiYcjS14OUTCi4jwUVN+1GY1zx zqBJCj+qYh9YHwrFmrQ/Ob3aDrLBpTJHi6WPcPX6SnBev2kEFKXkPGjdXXV/qQmFDvgVCp o9i9liYXCpDopNg0TRB7JKg2NEUKgoSTqM7dv+jpYg1L4X5YMkER4qI+iMIsIZvAzcv2dO yrQxPBYlEuV4s33JgABy2crLOerTx7/5Nbl1cUK7adsufqjk+tBFq7/UlA2OfQ== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z7nQL29LvzsbF; Thu, 06 Mar 2025 11:34:50 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: <6BE51FFD-DE19-42E6-B115-354BB74B4D78@FreeBSD.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_21A3F846-4569-4526-B2CD-C22C6384E294" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT Date: Thu, 6 Mar 2025 19:34:41 +0800 In-Reply-To: Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , Warner Losh , "dev-commits-src-main@freebsd.org" To: Mateusz Guzik References: <202503061103.526B32Id022652@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3696.120.41.1.10) --Apple-Mail=_21A3F846-4569-4526-B2CD-C22C6384E294 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Mar 6, 2025, at 7:32 PM, Zhenlei Huang wrote: >=20 >=20 >=20 >> On Mar 6, 2025, at 7:03 PM, Mateusz Guzik > wrote: >>=20 >> The branch main has been updated by mjg: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d676d30056= d4133859 = >>=20 >> commit 234683726708cf5212d672d676d30056d4133859 >> Author: Mateusz Guzik > >> AuthorDate: 2025-03-06 11:01:49 +0000 >> Commit: Mateusz Guzik > >> CommitDate: 2025-03-06 11:01:49 +0000 >>=20 >> devclass: make devclass_alloc_unit use M_NOWAIT >>=20 >> The only caller already does this. >>=20 >> The routine can be called with a mutex held making M_WAITOK = illegal. >>=20 >> Sponsored by: Rubicon Communications, LLC ("Netgate") >> --- >> sys/kern/subr_bus.c | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >>=20 >> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c >> index 9506e471705c..0422352bba51 100644 >> --- a/sys/kern/subr_bus.c >> +++ b/sys/kern/subr_bus.c >> @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) >> static int >> devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) >> { >> + device_t *devices; >> const char *s; >> int unit =3D *unitp; >>=20 >> @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t = dev, int *unitp) >> int newsize; >>=20 >> newsize =3D unit + 1; >> - dc->devices =3D reallocf(dc->devices, >> - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); >> + devices =3D reallocf(dc->devices, >> + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); >=20 > I'd recommend against this. =46rom the commit message of f3d3c63442ff, = Warner said, > > In addition, transition to M_WAITOK since this is a sleepable = context > So, the M_WAITOK is intentional. >=20 > Rather than reverting this, the caller devclass_add_device() should = use M_WAITOK. >=20 > ``` > - dev->nameunit =3D malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); > - if (!dev->nameunit) > - return (ENOMEM); > + dev->nameunit =3D malloc(buflen, M_BUS, M_WAITOK | M_ZERO); > ``` Emm, sorry for the noise. I missed the commit message, > The routine can be called with a mutex held making M_WAITOK illegal. >=20 > Best regards, > Zhenlei >=20 >> + if (devices =3D=3D NULL) >> + return (ENOMEM); >> + dc->devices =3D devices; >> memset(dc->devices + dc->maxunit, 0, >> sizeof(device_t) * (newsize - dc->maxunit)); >> dc->maxunit =3D newsize; --Apple-Mail=_21A3F846-4569-4526-B2CD-C22C6384E294 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Mar 6, 2025, at 7:32 PM, Zhenlei Huang <zlei@FreeBSD.org> = wrote:



On Mar 6, 2025, at 7:03 PM, = Mateusz Guzik <mjg@FreeBSD.org> wrote:

The = branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d67= 2d676d30056d4133859

commit = 234683726708cf5212d672d676d30056d4133859
Author: =     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2025-03-06 11:01:49 +0000
Commit: =     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2025-03-06 11:01:49 +0000

   devclass: make devclass_alloc_unit use = M_NOWAIT

   The only caller = already does this.

   The = routine can be called with a mutex held making M_WAITOK illegal.

   Sponsored by: =   Rubicon Communications, LLC ("Netgate")
---
sys/kern/subr_bus.c | 8 ++++++--
1 file = changed, 6 insertions(+), 2 deletions(-)

diff= --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index = 9506e471705c..0422352bba51 100644
--- = a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t = dc)
static int
devclass_alloc_unit(devclass_t = dc, device_t dev, int *unitp)
{
+ device_t = *devices;
const char *s;
int unit = =3D *unitp;

@@ -1264,8 +1265,11 @@ = devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp)
= = int newsize;

newsize =3D= unit + 1;
- dc->devices =3D = reallocf(dc->devices,
-     newsize * = sizeof(*dc->devices), M_BUS, M_WAITOK);
+ devices =3D= reallocf(dc->devices,
+     newsize * = sizeof(*dc->devices), M_BUS, M_NOWAIT);

I'd recommend against this. =46rom the commit message = of f3d3c63442ff, Warner said,
> In addition, transition to = M_WAITOK since this is a sleepable context
So, the M_WAITOK is = intentional.

Rather than reverting this, the = caller devclass_add_device() should use M_WAITOK.

```
-       = dev->nameunit =3D malloc(buflen, M_BUS, = M_NOWAIT|M_ZERO);
- =       if (!dev->nameunit)
-               return = (ENOMEM);
+       = dev->nameunit =3D malloc(buflen, M_BUS, M_WAITOK | = M_ZERO);
```

Emm, sorry for the noise. I missed the commit = message,
> The routine can be called with a mutex held = making M_WAITOK illegal.


Best regards,
Zhenlei

+ if = (devices =3D=3D NULL)
+ return (ENOMEM);
+ = = dc->devices =3D devices;
= memset(dc->devices + dc->maxunit, 0,
    sizeof(devi= ce_t) * (newsize - dc->maxunit));
= dc->maxunit =3D = newsize;



= --Apple-Mail=_21A3F846-4569-4526-B2CD-C22C6384E294-- From nobody Thu Mar 6 11:35:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7nRT3z5Vz5pSBk; Thu, 06 Mar 2025 11:35:49 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (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 4Z7nRT1yL3z3t5j; Thu, 06 Mar 2025 11:35:49 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-abf4802b242so109597166b.1; Thu, 06 Mar 2025 03:35:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741260947; x=1741865747; 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=oLYj2kguV3i2IGhabNqwlPc2ueKVwmbZFCB9rNTnOUo=; b=nXrW9efbFSR5xrS1QUd466DA8Z0AFPzw72ilsoHrEb7rvJ+rrMjjwfMljJvjS60NFy Nyxwkiwgq5/QwhucVCQGhM6CUxAAjkSJ1MJh2E2O05Ja3U6oy1RLt8y+c1+kYlxC9OCQ +R8lQLpvIaGRzgCdYhj3jj1f++PW+nAAe2hFRiOmUvco1eFm4K+Wcz78IanLmdtkM2kk tNXZr37fRVMzXG9JcsxlRRN5PYSjnHk7xlKYiDzahdbdpMJRYGz9KEdOd37keRLew9uL G7fCzeEtK5EGZpw67A6Lm+fa4soXSgBMnt05PYZpBkRG7xPVrH/Fwsk/HiScmq8Ku1RZ jvwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741260947; x=1741865747; 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=oLYj2kguV3i2IGhabNqwlPc2ueKVwmbZFCB9rNTnOUo=; b=oxulMHFk3ntiFnaVgkpJVgCqLAjl0Tfrnd591jSy4gVgRJ7yxlr0PkuRXOkDXGK2V6 +F4sWRd1hEIRcMuCLqBLUXQVgyGA4oqtKVKKbJKuJzSMv9t9KqIi3zPeV0Sd+oZL9LmR d0OCm+R0LiRwzagyjkxJyqS0d+2OJwD341mjRFMJAczvhqwLJ/O+9uphhCl78XN3pK6o lpqKWhoWcs2QQm1PDcB62Ngg/V3pr6dB+IWdM+Ywbrp0vqESaTfI7D1LkQOmC7IF5H/C /n5+M6qoTO4zV71UH3uyDvhoUr9brah/OS1z5VvoGBs+0LBWnlgV7Kpn9/1GObhUPice mP9A== X-Forwarded-Encrypted: i=1; AJvYcCU3uPmxBOtGlLAAAQPzGgiaIGuIYgipcOvmnT9fDTd6TnjIOXDoDK1xAoYzLLGEhxaIQr7I8M37bOETMr0csX0=@freebsd.org, AJvYcCWTQYXUtoWKdOdjwUpGq7os1DqralrtPhNPWfRoY486z4a0PvJGMyJRl01L3So56TijmOhkHNPKCzLCBoxfDMW/Fw0S1Yo=@freebsd.org, AJvYcCWZa7fgQNwqis2UCXj/ORbbN5tamX0gmQrpPx1HLuPuaiqCAWLMHG4bAuebfjX62w4xj+1eMGhHnpumXfzhQQ7mV+DR@freebsd.org, AJvYcCWltBmZG0FKHhQwIUVJi1XZew/Ye0yZXu4ZHIIRNaSzPfDo6HGs6cNzR80poCbdYVaOeIvk@freebsd.org X-Gm-Message-State: AOJu0Yw2BsPO54gXIIPtB6qFiSBoks3ZZRlrLe7SAgi/DVltgxRxxTek YjduJIkGoQh4RFJNKWicZwK1hHVm9eviGUD17cnmH55sSqjG2IK5ACMe1vMQAsqHI/qYxoe0Dy8 oPsocsdqW3PAMuo+4G+d3bPjjEiGQS870 X-Gm-Gg: ASbGncvLlT1/gVcpBP9B3BEhS9xXVb7XIzXZAQPLkZiEu3U6WRCjEk9za4pFDihj6ir hOehodKVltxIvN7cjFmMocwI9sN8k0M6VVtK7by0KBc8EJUhq4MoxBc6wrIoo5QJvVkfFHujPY4 fV0fRngcnMAv5as5NpPtjq3hEeqg== X-Google-Smtp-Source: AGHT+IEkgD6gYmCUgGUg8vxC5OeVWShnUveRfACWxv2Z+Vmf2Dia0Ff0kGjK38Hl5hnx41KGHpw3fZNrCmoGWMNS2AQ= X-Received: by 2002:a17:906:478b:b0:ac1:df32:ac27 with SMTP id a640c23a62f3a-ac20dafc617mr780731766b.53.1741260946447; Thu, 06 Mar 2025 03:35:46 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202503061103.526B32Id022652@gitrepo.freebsd.org> In-Reply-To: From: Mateusz Guzik Date: Thu, 6 Mar 2025 12:35:34 +0100 X-Gm-Features: AQ5f1JqyKYdyrQ4v97MuR35gDq4nG7TiHdtnyQ_el7iG2-9BySYUuw6JQC4_Uzo Message-ID: Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT To: Zhenlei Huang Cc: Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , Warner Losh , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4Z7nRT1yL3z3t5j X-Spamd-Bar: ---- On Thu, Mar 6, 2025 at 12:32=E2=80=AFPM Zhenlei Huang wr= ote: > > > > On Mar 6, 2025, at 7:03 PM, Mateusz Guzik wrote: > > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d676= d30056d4133859 > > commit 234683726708cf5212d672d676d30056d4133859 > Author: Mateusz Guzik > AuthorDate: 2025-03-06 11:01:49 +0000 > Commit: Mateusz Guzik > CommitDate: 2025-03-06 11:01:49 +0000 > > devclass: make devclass_alloc_unit use M_NOWAIT > > The only caller already does this. > > The routine can be called with a mutex held making M_WAITOK illegal. > > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- > sys/kern/subr_bus.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c > index 9506e471705c..0422352bba51 100644 > --- a/sys/kern/subr_bus.c > +++ b/sys/kern/subr_bus.c > @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) > static int > devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) > { > + device_t *devices; > const char *s; > int unit =3D *unitp; > > @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev, i= nt *unitp) > int newsize; > > newsize =3D unit + 1; > - dc->devices =3D reallocf(dc->devices, > - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); > + devices =3D reallocf(dc->devices, > + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); > > > I'd recommend against this. From the commit message of f3d3c63442ff, Warn= er said, > > In addition, transition to M_WAITOK since this is a sleepable context > So, the M_WAITOK is intentional. > > Rather than reverting this, the caller devclass_add_device() should use M= _WAITOK. > Per my commit message this is callable from a *NOT* sleepable context. Here is a splat we got at Netgate: uma_zalloc_debug: zone "malloc-16" with the following non-sleepable locks h= eld: exclusive sleep mutex SD slot mtx (sdhci) r =3D 0 (0xd8dec028) locked @ /var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeBSD-sr= c-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688 stack backtrace: #0 0xc0330ebc at witness_debugger+0x78 #1 0xc033217c at witness_warn+0x428 #2 0xc05b0a58 at uma_zalloc_debug+0x34 #3 0xc05b067c at uma_zalloc_arg+0x30 #4 0xc0291760 at malloc+0x8c #5 0xc02920ec at reallocf+0x14 #6 0xc02f8894 at devclass_add_device+0x1e8 #7 0xc02f6c78 at make_device+0xe0 #8 0xc02f6abc at device_add_child_ordered+0x30 #9 0xc0156e0c at sdhci_card_task+0x238 #10 0xc0324090 at taskqueue_run_locked+0x1b4 #11 0xc0323ea0 at taskqueue_run+0x50 #12 0xc0275f88 at ithread_loop+0x264 #13 0xc0271f28 at fork_exit+0xa0 #14 0xc05f82d4 at swi_exit+0 It may be some callers are sleepable. Perhaps a different variant accepting flags would be prudent, but I have no interest in looking into that. > ``` > - dev->nameunit =3D malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); > - if (!dev->nameunit) > - return (ENOMEM); > + dev->nameunit =3D malloc(buflen, M_BUS, M_WAITOK | M_ZERO); > ``` > > Best regards, > Zhenlei > > + if (devices =3D=3D NULL) > + return (ENOMEM); > + dc->devices =3D devices; > memset(dc->devices + dc->maxunit, 0, > sizeof(device_t) * (newsize - dc->maxunit)); > dc->maxunit =3D newsize; > > > > --=20 Mateusz Guzik From nobody Thu Mar 6 12:24:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7pWP4ynGz5pWLw; Thu, 06 Mar 2025 12:24: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 4Z7pWP4KjWz3KlJ; Thu, 06 Mar 2025 12:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741263857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DNO8GjHsO0v5N+x8Vrp/FNkl9M0FRcYgf+FtJTiuUPg=; b=IozVQi4gMt5V/gKn0T8qBIE5yPZu80+Uyit/H3UtsVx8uqRExSKnfLZsRzBFvZU4z7WjB4 /c2WDn8jPiF7+Oy2h7LRHWfVxJ/UCMX1nMHITg+7OrRj25qmnK1RwS37Zilo2pnjTwOoYq zfOOlPg+MW+PVOax+cEM7HdMZ3OdBYOYL9FVjQJiKrINSr1wxT/A3x/eS8NmVAjpMOyjAV 2zuVdGoF0yWUnV4qETFalFlvkS5nicGMD1VgqFHLI24FcQ6fh85vz/2yXuMwC+ZnNCNJMF SKWBfrPF6in9sk+Zrsl+d3kHfpUP/0jyiPz2l4dADn971Z8JlBEsaFtKlpHbAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741263857; a=rsa-sha256; cv=none; b=GGKCePZlz1bFx2Je4YN3C1uDm7A9Q3UtoxcD2GVDrlD0UFcDLav12bklfjIdgv/oiG15BN G8PO/mZYO9k+QwAzhKYMUjK6XsoWa/nW77Y6lhNz2rE77AvLAz2+Uox6ttEGbGdlYIy/ft rWhgTsNJaSAqOhAGEET54FBX5AGrBR5/hxa9uis4wp6PwsMv+tZ1AFYzSEkpb3CtkkyiMv N2M5DzDdds+i3f5LVfk+XQ+0FMbYoRBJ4wZkfalHRX5trH0MIVQwk4HWpx6RWhzESkcRAg B1gmfKSLLaqk5CKi0jMivj1Kv6FK1s85K75MZNqpwCRrK2Ctgg5nPaB+CvGcuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741263857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DNO8GjHsO0v5N+x8Vrp/FNkl9M0FRcYgf+FtJTiuUPg=; b=C6yBpVGrTtHclgj7TTGy9cg/GDjcTW9+CqGAPoH+TYAKM/Z6SUJVtfI1GiZaAhlcUmCYHF rE3ueBe0w8x1+xDNZhgFhpZLniJCTnzhXO6l8uoer8+37VvOdtOg7SeoJiLaTPE2MqY2zM 1MYAdw9TjI6k+c/YSfeYsYcuML7fNrUZY+k08STQERUlxxG08rw75FNN1BDHHclQ2embDj M/6KsCMvOwfUja8K1NTeUHAH8ul+6SrfZ/lrKn8UbWCH/3Ioz19XfnvjAQxkG33U8dXJoM ponE/E+fvlY6/QesYq2hO1sQ1/EmjQxwxzFqw6/avH0tipClrk/nvZONTYiVxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7pWP3xKmzr83; Thu, 06 Mar 2025 12:24: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 526COH1T072068; Thu, 6 Mar 2025 12:24:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526COHPC072065; Thu, 6 Mar 2025 12:24:17 GMT (envelope-from git) Date: Thu, 6 Mar 2025 12:24:17 GMT Message-Id: <202503061224.526COHPC072065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 04207850a9b9 - main - pfkey2: use correct value for a key length List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04207850a9b988d3c04e904cb5783f33da7fe184 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=04207850a9b988d3c04e904cb5783f33da7fe184 commit 04207850a9b988d3c04e904cb5783f33da7fe184 Author: Andrey V. Elsukov AuthorDate: 2025-03-06 12:18:59 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-03-06 12:18:59 +0000 pfkey2: use correct value for a key length The length of key data is specified via sadb_key_bits field. Use specified size for buffer allocation and key copying. Also add a check that the value of sadb_key_bits is not zero, as explicitly required in RFC 2367. PR: 241010 Submitted by: jean-francois.hren at stormshield eu MFC after: 1 week --- sys/netipsec/key.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 3c64a65f024d..d6b492151565 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -699,7 +699,7 @@ static struct mbuf *key_setsadbxsa2(u_int8_t, u_int32_t, u_int32_t); static struct mbuf *key_setsadbxsareplay(u_int32_t); static struct mbuf *key_setsadbxpolicy(u_int16_t, u_int8_t, u_int32_t, u_int32_t); -static struct seckey *key_dup_keymsg(const struct sadb_key *, size_t, +static struct seckey *key_dup_keymsg(const struct sadb_key *, struct malloc_type *); static struct seclifetime *key_dup_lifemsg(const struct sadb_lifetime *src, struct malloc_type *); @@ -3561,6 +3561,9 @@ key_setsaval(struct secasvar *sav, const struct sadb_msghdr *mhp) if (len == PFKEY_ALIGN8(sizeof(struct sadb_key)) && sav->alg_auth != SADB_X_AALG_NULL) error = EINVAL; + if (key0->sadb_key_bits == 0 || (sizeof(struct sadb_key) + + (key0->sadb_key_bits >> 3)) > len) + error = EINVAL; break; case SADB_X_SATYPE_IPCOMP: default: @@ -3573,7 +3576,7 @@ key_setsaval(struct secasvar *sav, const struct sadb_msghdr *mhp) goto fail; } - sav->key_auth = key_dup_keymsg(key0, len, M_IPSEC_MISC); + sav->key_auth = key_dup_keymsg(key0, M_IPSEC_MISC); if (sav->key_auth == NULL ) { ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); @@ -3599,7 +3602,12 @@ key_setsaval(struct secasvar *sav, const struct sadb_msghdr *mhp) error = EINVAL; break; } - sav->key_enc = key_dup_keymsg(key0, len, M_IPSEC_MISC); + if (key0->sadb_key_bits == 0 || (sizeof(struct sadb_key) + + (key0->sadb_key_bits >> 3)) > len) { + error = EINVAL; + break; + } + sav->key_enc = key_dup_keymsg(key0, M_IPSEC_MISC); if (sav->key_enc == NULL) { ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); @@ -4266,13 +4274,14 @@ key_setsadbxpolicy(u_int16_t type, u_int8_t dir, u_int32_t id, u_int32_t priorit * OUT: NULL no more memory */ struct seckey * -key_dup_keymsg(const struct sadb_key *src, size_t len, - struct malloc_type *type) +key_dup_keymsg(const struct sadb_key *src, struct malloc_type *type) { struct seckey *dst; + size_t len; dst = malloc(sizeof(*dst), type, M_NOWAIT); if (dst != NULL) { + len = src->sadb_key_bits >> 3; dst->bits = src->sadb_key_bits; dst->key_data = malloc(len, type, M_NOWAIT); if (dst->key_data != NULL) { From nobody Thu Mar 6 13:33:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7r2y3g6bz5pc1t; Thu, 06 Mar 2025 13:33:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7r2y2nMpz3mJ1; Thu, 06 Mar 2025 13:33:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741267994; 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=naIaQvdX10XeUYdVGzrsF1xvgpeQ3zT3uVQFW6KOHzU=; b=VJokD7ctOqlz4z1l35U8p7sro27DfEz8jXTFeNTiCXVb76+kbdnFynpnG/wGA3HJYo7ePN JgQJ07xS219eZaRfI4RyxrrUcRn3JxQWupaBeYcAmHalA0lY/Q7IptlfGIfBcz/f6OJkZH aR2O58LmbGZ2/PjcH1cNFX9juOVIiNA+WPuN3nUj1n0TZYReOMlBbIg9nU6drpThgMYOF+ KO7aj5BhBTj9SDfPqSL9eJEnFdKReWvFuv51Yb2+KHqN+JRxvZDgGmh8z34RuEnPakMiuR ZEpUXGo23jwbe6LzwCVIseIi/jZEvQlefx6N8Fx8RVJuW4pcEzO776xZtHXGcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741267994; a=rsa-sha256; cv=none; b=Zpk9I1ggzXWpQib+irJr159WxUDHMnCfcFPPOJpBe1AZIHP4zs/wHm/qvONCGlrWp9NmUy 0m0ycQgtNU4S6G9IGSzkFhNbeUaAKknzYaXAObmOvJDXLkxmBhdIIGxMbERs5Eb5y8fdsW +ZYdZUtoiM4wrnOjtjyxCh+8i5xrxTRpWEsxQEgn1l0XWywiU0YVNJo4IMahuBo0xEIBOG veXKf4Dfvtz6C8GfcQyB52TmZNDW1K+KqlXdvmlWKJDXrO/Q48Ve/HBi94wXL810Jrdq/g 1rpCTjHtqMNfmr0byzKog528Xjbs7A8E4bvWf1grH4d6+w/iYQNLwVtcxz2emg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741267994; 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=naIaQvdX10XeUYdVGzrsF1xvgpeQ3zT3uVQFW6KOHzU=; b=erX9NekCr8jKro1GdNEX656Dxb8Cc+KJlarCxqpnppWUr42RuUrpVE4LSP7nqwDhkeOf3/ z79RvMdta7Efie6msvTtoOvgUmLGYdslnDL7HTD1lHsJDpwjN2tDFGvWGfoUaDae98YJKI 3jIFhFj70AkPbdMU/YOZEDXHuLZwNDnVSba4yus6Q2Io/2qstejwIBJLhVNlb2ri6c0dGq NMBVhH3J1ZVXzg+kuP7LZHsQloVEDTmNt+RAiIYomY/tcn3wCXL1BiI9W6jsteKcu0rxpE wmDVFET5KuBqwH0KRfSr8z+V8cP/nvDa53a1V3f5HepfjSzH/JLbUOQRD6V9QA== Received: from [IPV6:2601:5c0:4200:b830:ec45:8834:27fa:4893] (unknown [IPv6:2601:5c0:4200:b830:ec45:8834:27fa:4893]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z7r2y0N3NzwmW; Thu, 06 Mar 2025 13:33:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 6 Mar 2025 08:33:12 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT Content-Language: en-US To: Mateusz Guzik , Zhenlei Huang Cc: Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , Warner Losh , "dev-commits-src-main@freebsd.org" References: <202503061103.526B32Id022652@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/6/25 06:35, Mateusz Guzik wrote: > On Thu, Mar 6, 2025 at 12:32 PM Zhenlei Huang wrote: >> >> >> >> On Mar 6, 2025, at 7:03 PM, Mateusz Guzik wrote: >> >> The branch main has been updated by mjg: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=234683726708cf5212d672d676d30056d4133859 >> >> commit 234683726708cf5212d672d676d30056d4133859 >> Author: Mateusz Guzik >> AuthorDate: 2025-03-06 11:01:49 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2025-03-06 11:01:49 +0000 >> >> devclass: make devclass_alloc_unit use M_NOWAIT >> >> The only caller already does this. >> >> The routine can be called with a mutex held making M_WAITOK illegal. >> >> Sponsored by: Rubicon Communications, LLC ("Netgate") >> --- >> sys/kern/subr_bus.c | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c >> index 9506e471705c..0422352bba51 100644 >> --- a/sys/kern/subr_bus.c >> +++ b/sys/kern/subr_bus.c >> @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) >> static int >> devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) >> { >> + device_t *devices; >> const char *s; >> int unit = *unitp; >> >> @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) >> int newsize; >> >> newsize = unit + 1; >> - dc->devices = reallocf(dc->devices, >> - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); >> + devices = reallocf(dc->devices, >> + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); >> >> >> I'd recommend against this. From the commit message of f3d3c63442ff, Warner said, >>> In addition, transition to M_WAITOK since this is a sleepable context >> So, the M_WAITOK is intentional. >> >> Rather than reverting this, the caller devclass_add_device() should use M_WAITOK. >> > > Per my commit message this is callable from a *NOT* sleepable context. > > Here is a splat we got at Netgate: > > uma_zalloc_debug: zone "malloc-16" with the following non-sleepable locks held: > exclusive sleep mutex SD slot mtx (sdhci) r = 0 (0xd8dec028) locked @ > /var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeBSD-src-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688 > stack backtrace: > #0 0xc0330ebc at witness_debugger+0x78 > #1 0xc033217c at witness_warn+0x428 > #2 0xc05b0a58 at uma_zalloc_debug+0x34 > #3 0xc05b067c at uma_zalloc_arg+0x30 > #4 0xc0291760 at malloc+0x8c > #5 0xc02920ec at reallocf+0x14 > #6 0xc02f8894 at devclass_add_device+0x1e8 > #7 0xc02f6c78 at make_device+0xe0 > #8 0xc02f6abc at device_add_child_ordered+0x30 > #9 0xc0156e0c at sdhci_card_task+0x238 > #10 0xc0324090 at taskqueue_run_locked+0x1b4 > #11 0xc0323ea0 at taskqueue_run+0x50 > #12 0xc0275f88 at ithread_loop+0x264 Just use a regular taskqueue like taskqueue_thread instead of taskqueue_swi? PCI hotplug defines its own thread taskqueue for adding and removing devices. The bug is here, IMO. Eventually new-bus will need some sort of topology lock and that will have to be an sx lock, so this code needs to change anyway. The sound code that tries to frob devices with a regular mutex also needs to change. In terms of taskqueue_swi, it's probably something that needs to go away. Generally speaking, code uses tasks for functions that need to sleep, and taskqueue_swi breaks that. I will fix sdhci to use a proper taskqueue and then revert this commit. -- John Baldwin From nobody Thu Mar 6 13:59:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7rdN16GDz5pdsT; Thu, 06 Mar 2025 13:59: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 4Z7rdN036Xz3tTJ; Thu, 06 Mar 2025 13:59:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741269576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hOGC+wGBxchikOBkCC7UQAlQyUnqEvvb+CX8Xvm6leM=; b=g+mT19fSBRhJs7bbg9NGsGMEf3O7uLPlAv8a8F3FXRUwt4Ut0DhBKv5mMixFdVeSfzhUpJ hAxZETHHolG8WDTiaK6YDy0y20qDmbbTpGkJS/pzsTJqj1jrgNOxf7TJWgKKoxSXKF7vt5 saBrE51Wr+4hyWUC7PyfVBRn1vnAEfZou4zwTWC3WR/p9Me1wdcrEVFpzs85Y0kuU1X639 wfageGZrxTHOeivjpVMrlc/+pwALke8e/EpPLUJUtgotAIWCa9nYljS8uhKv9YT3Mc6h6x f5X0snsLAa1JZLK+91PYYJLnHKrTWadEsRfg3N6WNMkiuJ14BuXmWhaDs0fFzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741269576; a=rsa-sha256; cv=none; b=Frbx1zPYbN9Nsy4n6rklJ3W1Pq8WxMNOnfqHc0HTC46u24wI5f5swyRxs7aC8ixfuK4lKC jNE9oWoeJ5yrJL0TFiFqwi6aiJNacYWrHvEIiqkXVzhuTN1CZ66XowWqlUF+sCtjxJ6gOB 5+/Tzbc9BMlguUxolEFlRtBFinmlDQ/klOJrK1sykJd1hm7lq11DvoXOGKPP9uMo6yE/Ka ZRqsx2wBQrnDJhsmb8Sz8tQNipvxTA37U1/LZD05usIi1J9ohuVsXomEWTCdWfWD6g/8JC oWLUYT5DjoI8FpPclugMum5XZQpLhi8sLwwqYxzMPfIrZk3IsqScD4qxsjg/cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741269576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hOGC+wGBxchikOBkCC7UQAlQyUnqEvvb+CX8Xvm6leM=; b=SHM0DcT7KPRiEbj9oAnus9epl3T3LYKHrKvG9B1Zr79BgT4mysUbQFphGfEn+3nhXbkH8+ I4iGneyrtVl+xpnUKWXNCIXVA6FCWhy+uONGuD0KIYLWNOnchQulLbPqXBBjjCiAZ3+q/1 FrWdw8rcUYthXW8roF/OLaAdS7dgINS96wpxHIyS48SNwp7iDsAHb7B3srKUImNtcNJ6I7 /9UI276YXxOXX67e8Fc311TKhw1gPZ4neV7NyEzBSJ5dLWICuK9zS/9mvx+B++KaLBClQf GqgBx3fqspuUWSDpcy4YJEOas286IYk82/FyWm3OuzIunLo7haNRxoWoXBnS0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7rdM6N5mztRw; Thu, 06 Mar 2025 13:59: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 526DxZqW041088; Thu, 6 Mar 2025 13:59:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526DxZJ1041085; Thu, 6 Mar 2025 13:59:35 GMT (envelope-from git) Date: Thu, 6 Mar 2025 13:59:35 GMT Message-Id: <202503061359.526DxZJ1041085@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: 180065eb09e6 - main - top: Make locale issues non-fatal. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 180065eb09e699820a1e1c45d3d00156e0effe29 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=180065eb09e699820a1e1c45d3d00156e0effe29 commit 180065eb09e699820a1e1c45d3d00156e0effe29 Author: Dag-Erling Smørgrav AuthorDate: 2025-03-06 13:43:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-03-06 13:59:23 +0000 top: Make locale issues non-fatal. If the `setlocale()` call fails, emit a warning and sleep briefly so the user has a chance to see the warning before we redraw the screen. Note that we have no way of knowing exactly what is wrong, but at least we can suggest that they check their environment. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D49230 --- usr.bin/top/top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index d35d755fdc82..8712e56d43ba 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -266,8 +266,8 @@ main(int argc, const char *argv[]) #endif if (setlocale(LC_ALL, "") == NULL) { - fprintf(stderr, "invalid locale.\n"); - exit(1); + warnx("invalid locale, check your environment"); + sleep(2); } mypid = getpid(); From nobody Thu Mar 6 14:22:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7s8M57R7z5pg1j; Thu, 06 Mar 2025 14:22: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 4Z7s8M4Gb4z46F2; Thu, 06 Mar 2025 14:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741270979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Ws5ugnQ3KGDZZBWNPApA3tKqYX7izd1Dp7FhQtaLsQ=; b=Z0IUpUmaAuMjuex/2dH7nauIFehfts6+YqXE05H8LJwVm9mrkqC2uy+vdeZrjbWuzLaxu3 3JHitYpxxNsd6F34spARPEe1lGzzTpiOZHwutjBy5/h7/GJ+EHY+UjuHSzTS/ZfDSNJk1t fa7G14TrF72n5/eqK6+HNXy4iAb7Rnyo870m7ZZu578rRZ+3shW+46CfeIWLXGOgwL1xkL vTPuTfXQuo/hbJbGQKiH7dd1lj8pPCxPlavscDNlKIq5UMt/Ih7GIaGUnVu35ky78fW3oV DoY+E/53btlLDyTTxgkVxryGpltlsJlcaNWx4QUzu55xALsEmY0bjLvxzBveBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741270979; a=rsa-sha256; cv=none; b=o2ElcIbwSAKE5nXKQCNMBk9+4XBg3qh2zWf9NMWcIo5qSwn+swU4ImBE1lQSTKs+4zmTkF v/O/meRGqJGza45+S6dcANVrp3L0XGcFblf5PTofAOyXi6jmbBUknmrR1GTX1vwY6NSJLp TAkpI19OWN4HgHBszf8D6QRi8ucRIAk7D4/Fa1iFv0/OnSzRTSfDD+bA7wmeZsJZfG6JhC E88EDzfabhCDKWHPFQrrPCDEoNTpf3NSKO31PrGUqlI7vUij+u5IAsvdzjBN/PBH3x+KPO ZlIqtlljG1Kaha8tEMzTe1X0nzfSGloTy5ZZiHc+A3kw3cNvpEy5k8lLFHqoMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741270979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Ws5ugnQ3KGDZZBWNPApA3tKqYX7izd1Dp7FhQtaLsQ=; b=TUKniG9gL//mXxYPu1oXUbg5QAokDrudWCqBsIy2CWSwh+6MAsPvTHIGXCACaXRwtlPLgP kyeGZoS/cTnhmSPI1vc2nzh66YJtpCCwACdtV7YX2tI8bcHSfkrE5ZIul16yd02b/As2DI WvPrKvEbqVT/1+UMzuHrVm5QO7Dn1octClxZfDdJwXcbAVhcxks2WwAKROALZarviFsOem EgrJHOb/7guETZcOBzXZdWouWBT8hNKIQG60iqxBuaL3/s7GElJI5bW4R/T3BNoeiaWmRw BWSqwDdrnB9N86gXdK2TFj14DajGOcGWXXz0t8tIajCwmgnpun35pXH6vMcOIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7s8M3c94zvS6; Thu, 06 Mar 2025 14:22: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 526EMxe8095551; Thu, 6 Mar 2025 14:22:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526EMxvM095548; Thu, 6 Mar 2025 14:22:59 GMT (envelope-from git) Date: Thu, 6 Mar 2025 14:22:59 GMT Message-Id: <202503061422.526EMxvM095548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 8e99c8ad8fd4 - main - pkgbase: make pkg repo reproducible List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e99c8ad8fd41d3befae62f9eee59d8c5c60a539 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8e99c8ad8fd41d3befae62f9eee59d8c5c60a539 commit 8e99c8ad8fd41d3befae62f9eee59d8c5c60a539 Author: Baptiste Daroussin AuthorDate: 2025-03-06 14:16:44 +0000 Commit: Baptiste Daroussin CommitDate: 2025-03-06 14:22:48 +0000 pkgbase: make pkg repo reproducible Add a PKG_WORKERS_THREADS variable set to 1 by default, if as a user you want speed again, then just override it. --- Makefile.inc1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index f51fe7d3b119..75fcbc0bf968 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -606,6 +606,7 @@ SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime} .else SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP} .endif +PKG_WORKERS_COUNT?= 1 PKG_NAME_PREFIX?= FreeBSD PKG_MAINTAINER?= re@FreeBSD.org @@ -2367,7 +2368,8 @@ real-sign-packages: _pkgbootstrap .PHONY .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" repo \ + @${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" \ + -o WORKERS_COUNT=${PKG_WORKERS_COUNT} repo \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ From nobody Thu Mar 6 14:24:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7s9l5W42z5pfyn; Thu, 06 Mar 2025 14:24:11 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7s9l4blBz471w; Thu, 06 Mar 2025 14:24:11 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741271051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p2jxzjy9amPUEm4vqzzGsdXI6MpyceGpJMaUg5XuB6E=; b=VutbgV2dfnq+EcqSTO2+m0m4Iwk87P3JStYARah2FrFWOaF/6GVSASDopNLM51oaV+d/ek yfxKcuJKNaO8Trck1YlEKyUG1mBRP+giibQwc/t93RC8UAhfcdh/xbdK6tqJhg3e5aQfwS hsDu0dT4RoN/zLfrKJm3bnJvyVUpBvYzqnZY1TRd72ZQbAGBALV5eWzyNIUoArUwq7/Lfl EpS4KrB0NrMyTCKCe0OdtyOHIobdIKyNfi5VZLHxxgmA23zL1oVV85rRwK9y8NFVfqGRv/ 6Y+iMO8i/ZdaxCiWnpbzoQoz70C8PRmcJN5RhHuH8vgUVm++i0S5JeEcoRn9bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741271051; a=rsa-sha256; cv=none; b=Fql0HJMQLXMgp+fXaUts/8w5geHk4Msto6N7WI/xFkbI4xGtlTeJfCj74Svu42CeXbHjo2 fnilHxoAniMlnAHSfar/W7g24yrDipmYiGOKgQiY8q0XpEYC9eeQaCZyognaTZuAg9HDBo zECYlKrZ1x+v5SprOxujNpJJCYDsT8MSIEM8T/dq26q3AiA0a5JMeZ8zEjgDGGy7FQQPFO zwyNEY6IV+NogOodsRvK0AF2nuqNSklEUk1qnp4cPniOPBq76V5m9lFAmZ/hOHQ7owDalT sYXqQXpODIEFRD+dWYnhptb6dDoQ8rgy0NrC+Rp3FBBF9R1VF4hLltAszOs8Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741271051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p2jxzjy9amPUEm4vqzzGsdXI6MpyceGpJMaUg5XuB6E=; b=R7UpjINoZr74j4USOw7nsP2AwXlWGemn56jNwGyOU/3c3EcNoxhgbERfvT+dVf3zlR6rNQ UekcZWW+gGPccq3gv6UYFvonswcAVjk+VFeqoc4QWEOMB2uQLd7xnIsJoTS2dnpFUoTMn7 MSe0jSMYBBS4DOuSr4/YSUS8KXbHqPyw3Kpa20u4WYHDFAFXa8py8Px33jKPNxx1PMP5Tz c8sm/uMxg0CHPY7Mo+EyES5cmmVqvRKFwO3yRVXpLPzxkhIBt2DkUS7vgfbfThG1dVOHfD Ytzsra7o4KFXt/IwlxPKktci/yd4i4MexZ/tbHLDZEBqNJWxbMt4oRwIFLtHhA== Received: from b.nours.eu (b.nours.eu [54.38.177.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z7s9l36mhzxvQ; Thu, 06 Mar 2025 14:24:11 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by b.nours.eu (Postfix, from userid 1001) id 252AD12F36; Thu, 06 Mar 2025 15:24:09 +0100 (CET) Date: Thu, 6 Mar 2025 15:24:09 +0100 From: Baptiste Daroussin To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8e99c8ad8fd4 - main - pkgbase: make pkg repo reproducible Message-ID: References: <202503061422.526EMxvM095548@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202503061422.526EMxvM095548@gitrepo.freebsd.org> On Thu 06 Mar 14:22, Baptiste Daroussin wrote: > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8e99c8ad8fd41d3befae62f9eee59d8c5c60a539 > > commit 8e99c8ad8fd41d3befae62f9eee59d8c5c60a539 > Author: Baptiste Daroussin > AuthorDate: 2025-03-06 14:16:44 +0000 > Commit: Baptiste Daroussin > CommitDate: 2025-03-06 14:22:48 +0000 > > pkgbase: make pkg repo reproducible > > Add a PKG_WORKERS_THREADS variable set to 1 by default, if as a user > you want speed again, then just override it. Erg I forgot to edit the commit log: Differential Revision: https://reviews.freebsd.org/D49254 Reviewed by: emaste Bapt From nobody Thu Mar 6 14:28:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7sHJ32tNz5pgJt; Thu, 06 Mar 2025 14:29:00 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 4Z7sHJ1Hnqz48jc; Thu, 06 Mar 2025 14:29:00 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5e5deb6482cso185762a12.1; Thu, 06 Mar 2025 06:29:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741271338; x=1741876138; 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=qrUAW48hTK5gu0CDCeMWApeF+DtVkEhbH10xB0SRBiA=; b=XbM8HxIs+F4/25nwbWlz9/rMYYSgydrXar4J3nmlRwOszPkOmptaGo7E0RW9bZog02 Q9no3rVB3+TL3gIT/tI9l+f3isyYoIAYwSfHXZFLmvTfe89YJB7T4+MpHYClbrFAHC9+ 3oGM+wL+dhlYSqh879TXw9Bz6onlpXS+EgG7fL33Vy8llDMU70Gj9OuOrKVAVbme93lJ 6g56tjtCkYw/+cdR4ALznHApgaGk6Xlae5ZsT1O4hg21eW596Ed/5q4JZsPiI1uiu2Gf VNUgMyMZHWKVJ/KefCG+Xx8fuc1w6SPbm9vZKG8yYxvqr2O87IgjqWlHIB0optXo4ezM WLYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741271338; x=1741876138; 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=qrUAW48hTK5gu0CDCeMWApeF+DtVkEhbH10xB0SRBiA=; b=n2gBSvStNHmk3/50mJAv+Sk6J8y/QGMZJRhsPS5KaE32AoFsmRTpq20WsofrD7+5Rt 0t8Vi5jycEhZtv9RggpNuhGxNMK2M+jMJPM+7dwfcF1hC1lvDcCaRBhckX4z3ysC2/VE 8CrMCmhDdcjBcAEm/gja3zbgfpw+LXnXiV4a2TjxRP7qaK8eLX/Jq067ITokiQpAAWAv aB/N3NBOUVyTeTptczAkPsoBToK2kzN38c9dS8gmsRW2cvUa044YujdhOwx/PaLb6sIL 5Wm5YKL/auiKwhqEWUIB9Fu1W79QMcRsPUTsGsW4odnhNo3xHkWJbUj+I5Cs93IMRDdB /zJQ== X-Forwarded-Encrypted: i=1; AJvYcCUBOZn2QXj8nEVZLlJDRw27aCfT+r2oIW5mr2t/TgaAvaW3x25tGO+zHSp9GUvmXkMaJ0KP@freebsd.org, AJvYcCUG1nxBHKqXetR5+Pkm1iPBrbv9ZVIl9IACGvAmMl8KLlomdpV+dcGvUtmqyzprDibtwIkj3N2L4ZoLTORBQFfjavKu@freebsd.org, AJvYcCWPCYtOZ+Y5S3g5SIkvIfPC3xb/NxhJiayrWWMACOHu2zIb6wuHgu1f/MaZzqWU0r+ab1qPoxXbN2Jz/zudB8P7QydB9og=@freebsd.org, AJvYcCX95jbXDO7ljzyz1OYloTKmXukB1K3/amJMbvJqklamkr6rCTCGKcYVKtl3WnQufd15NLpkPWxBcWG1XHZs1jw=@freebsd.org, AJvYcCXzuxmiQZZqhYCQDJdWHMp0dRoi1CMLll2XUNlLET9q6HFRQLGwVhz8ouF4+eqcEf4H8U8y@freebsd.org X-Gm-Message-State: AOJu0YwNQPj7m+0B3QgAd5edxPeULZnyixuuror80JhcNdypHi02SMVq G3ma9IIYDihW5griKZNZMqBarlkyQgfAit7bdR3UHDN9L1ktNLNsKvp4aXtS0Pk9yweNFtS5s8/ G40cFs80OO+k9SzaF+4BtVRG2v2MLXqVC X-Gm-Gg: ASbGncu2xVFU6c9Nepl4ctAjzSO095QxJ7mI8S9kqBOa0mGr5SxfxTzXjkZfm+pykrL uEs0OvvOm498s4wU+MqkfvV+hvIJH8jn5CBRnd0QZ6xnn6ae0i7vZPp+dTNgR+nEb3vcnMkSuC/ HuE+ApysawDMtm6PMwh2OIPYYqOA== X-Google-Smtp-Source: AGHT+IHA01TyPUUaguBJI/PZI4AtZFVePTVcjA9+pdhEp34xV0YqemvEH2vxZqmcPedAWmOVARukXUWW+tX6oGTrkWY= X-Received: by 2002:a17:907:8687:b0:ac1:17fe:c74f with SMTP id a640c23a62f3a-ac22cc5501fmr357873766b.21.1741271337823; Thu, 06 Mar 2025 06:28:57 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202503061103.526B32Id022652@gitrepo.freebsd.org> In-Reply-To: From: Mateusz Guzik Date: Thu, 6 Mar 2025 15:28:45 +0100 X-Gm-Features: AQ5f1JppXgMPth-euR0aJuysNU8aNSQPkryhamZENKrb_YuqSXX3UIrZiUv9f-M Message-ID: Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT To: John Baldwin Cc: Zhenlei Huang , Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , Warner Losh , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4Z7sHJ1Hnqz48jc X-Spamd-Bar: ---- On Thu, Mar 6, 2025 at 2:33=E2=80=AFPM John Baldwin wrote= : > > On 3/6/25 06:35, Mateusz Guzik wrote: > > On Thu, Mar 6, 2025 at 12:32=E2=80=AFPM Zhenlei Huang wrote: > >> > >> > >> > >> On Mar 6, 2025, at 7:03 PM, Mateusz Guzik wrote: > >> > >> The branch main has been updated by mjg: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d= 676d30056d4133859 > >> > >> commit 234683726708cf5212d672d676d30056d4133859 > >> Author: Mateusz Guzik > >> AuthorDate: 2025-03-06 11:01:49 +0000 > >> Commit: Mateusz Guzik > >> CommitDate: 2025-03-06 11:01:49 +0000 > >> > >> devclass: make devclass_alloc_unit use M_NOWAIT > >> > >> The only caller already does this. > >> > >> The routine can be called with a mutex held making M_WAITOK illega= l. > >> > >> Sponsored by: Rubicon Communications, LLC ("Netgate") > >> --- > >> sys/kern/subr_bus.c | 8 ++++++-- > >> 1 file changed, 6 insertions(+), 2 deletions(-) > >> > >> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c > >> index 9506e471705c..0422352bba51 100644 > >> --- a/sys/kern/subr_bus.c > >> +++ b/sys/kern/subr_bus.c > >> @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) > >> static int > >> devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) > >> { > >> + device_t *devices; > >> const char *s; > >> int unit =3D *unitp; > >> > >> @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev= , int *unitp) > >> int newsize; > >> > >> newsize =3D unit + 1; > >> - dc->devices =3D reallocf(dc->devices, > >> - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); > >> + devices =3D reallocf(dc->devices, > >> + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); > >> > >> > >> I'd recommend against this. From the commit message of f3d3c63442ff, W= arner said, > >>> In addition, transition to M_WAITOK since this is a sleepable context > >> So, the M_WAITOK is intentional. > >> > >> Rather than reverting this, the caller devclass_add_device() should us= e M_WAITOK. > >> > > > > Per my commit message this is callable from a *NOT* sleepable context. > > > > Here is a splat we got at Netgate: > > > > uma_zalloc_debug: zone "malloc-16" with the following non-sleepable loc= ks held: > > exclusive sleep mutex SD slot mtx (sdhci) r =3D 0 (0xd8dec028) locked @ > > /var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeBS= D-src-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688 > > stack backtrace: > > #0 0xc0330ebc at witness_debugger+0x78 > > #1 0xc033217c at witness_warn+0x428 > > #2 0xc05b0a58 at uma_zalloc_debug+0x34 > > #3 0xc05b067c at uma_zalloc_arg+0x30 > > #4 0xc0291760 at malloc+0x8c > > #5 0xc02920ec at reallocf+0x14 > > #6 0xc02f8894 at devclass_add_device+0x1e8 > > #7 0xc02f6c78 at make_device+0xe0 > > #8 0xc02f6abc at device_add_child_ordered+0x30 > > #9 0xc0156e0c at sdhci_card_task+0x238 > > #10 0xc0324090 at taskqueue_run_locked+0x1b4 > > #11 0xc0323ea0 at taskqueue_run+0x50 > > #12 0xc0275f88 at ithread_loop+0x264 > > Just use a regular taskqueue like taskqueue_thread instead of taskqueue_s= wi? > PCI hotplug defines its own thread taskqueue for adding and removing devi= ces. > > The bug is here, IMO. Eventually new-bus will need some sort of topology > lock and that will have to be an sx lock, so this code needs to change > anyway. The sound code that tries to frob devices with a regular mutex > also needs to change. > > In terms of taskqueue_swi, it's probably something that needs to go away. > Generally speaking, code uses tasks for functions that need to sleep, > and taskqueue_swi breaks that. > > I will fix sdhci to use a proper taskqueue and then revert this commit. > That's fine with me, but if you do, also make sure to change the M_NOWAIT into M_WAITOK in devclass_add_device: dev->nameunit =3D malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); --=20 Mateusz Guzik From nobody Thu Mar 6 14:49:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7skn10Msz5phJj for ; Thu, 06 Mar 2025 14:49:21 +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 4Z7skn0TVqz3LwQ for ; Thu, 06 Mar 2025 14:49:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ff6cf448b8so1076748a91.3 for ; Thu, 06 Mar 2025 06:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1741272555; x=1741877355; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LuWI13uaCsaDRUtYEhDZZ+HLnYAa35A70M1m9iaaXGg=; b=qBWPTIpmE5zrtTQOivV0+VwXvgb0vLku7KgbTBVNzMYHTma8doUcQwBGCZQhzb0+rQ O7tL8hhhAnwZTyJwLMAO2TsHXNQmHrJMxDLmKfKp2cJ7OkC9aEYcYQY7GkTyl3MdQtT4 h7Al42kJ9fCxLhWDgyUMrT5Ov2khQQDCmzDafdwza2Dxwyy1UvDk5NdytJc3Z4IlD6jo Oa4oYNpiMnc+dnJi+YD9auZyFy46AYjkNmGxsIVXvJ2rG3+1WR9R94yrV5VSmeoT3Z6P dZ/7s5g0Piq9ShfEkScMpPP9E7bVq6OYxjSqCGQTjdeWB5LCLALjy/kbtuSaE4xuEA6d b+Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741272555; x=1741877355; 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=LuWI13uaCsaDRUtYEhDZZ+HLnYAa35A70M1m9iaaXGg=; b=jGIbQgcUz7GSSJEZWJYBSkaJP5EFyVvcMm+5oUX66hAZwb6JBwOHR9ZokG77vnUboR /GZSpuUCrjNP33+DW0ncQ3SzGVm9dRy27/cvnc6RSRvsT2iWhr7OcA1iu3kAIynmxrRn txnO/lr4KLVo5f3Zr55KdkSFyMUb5dMyWa+DrmtGhT0DEvq4nZX2tnuGtUWCPjYYjQPR /KBbpzwLekKc5Hf9mGarsAs8lb2zdTScE7lJkQPPVJlznKR3gtTQe0SB5nG96VPzlaBg 2lvzKJ/BPzsgHUSOkgAVTDzc2Fn9/tNQaN6ssxxYZswMmntVhtM95K3EAMUSGoZwokIb bsbA== X-Forwarded-Encrypted: i=1; AJvYcCWPt8nFE0jSdTkFwCqXSU/vz9rWDbDXRSOHUYzBSRPNyeVGjYtK7Ss1B5S8tRq8dMEG7ghTgHqYEMSsySMEkue9aZOe@freebsd.org X-Gm-Message-State: AOJu0YyB4hbIJ5ZP3pG3J3yvJhXTEUAER7YczJWo5sxEuycuNEWhApIt 4y+OIBLFmkET7w9ZWmRZEN9Hr7W55GXja7nUX/YpO3FojjLu+ysZCsaTastsWMyE2v75E3LE83T pToW1kJuYsGG/uHLsgGLZeEq99HFPGHTlD9LYwA== X-Gm-Gg: ASbGncvCtoQ2sMmT8rQdtt4kULcMmRQXVmHCduDvHEjAK2v3x6ar3mFsbttZBBsPVvZ 8L8uDTU9xRdXhDuQZIMMOkwAoMh/R9wSLhnBaIj6K78hGjHy/Jl+sYllrgDYJp8tuLIk0EFzsln fb/3wEdHHedjG8lIKESOJwAskPAXmAs9d9UOovdhg+7A9ru1va/b30t9lg9cBx X-Google-Smtp-Source: AGHT+IH4LS9b/5Ax+Sch5zBblE2YNCyiO9ysgNP6NU/WMgVWG6hHYFY76nnt4/h4ncbUmRV7HjO0rwHEWqI/5tr4fYE= X-Received: by 2002:a17:90b:2402:b0:2ff:53ad:a0ec with SMTP id 98e67ed59e1d1-2ff53ada24fmr7285814a91.21.1741272554702; Thu, 06 Mar 2025 06:49:14 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202503061103.526B32Id022652@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 6 Mar 2025 06:49:03 -0800 X-Gm-Features: AQ5f1Jqwd1nJcfqZUIHjktf1P1pr3ak_iifXoXZxpCxOVrw2-lGJZHup8iu7aig Message-ID: Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT To: Mateusz Guzik Cc: Zhenlei Huang , Mateusz Guzik , src-committers , "" , Warner Losh , "" Content-Type: multipart/alternative; boundary="00000000000014a6a1062fad9ca8" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Z7skn0TVqz3LwQ X-Spamd-Bar: ---- --00000000000014a6a1062fad9ca8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 6, 2025, 3:35=E2=80=AFAM Mateusz Guzik wrot= e: > On Thu, Mar 6, 2025 at 12:32=E2=80=AFPM Zhenlei Huang = wrote: > > > > > > > > On Mar 6, 2025, at 7:03 PM, Mateusz Guzik wrote: > > > > The branch main has been updated by mjg: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d676d3005= 6d4133859 > > > > commit 234683726708cf5212d672d676d30056d4133859 > > Author: Mateusz Guzik > > AuthorDate: 2025-03-06 11:01:49 +0000 > > Commit: Mateusz Guzik > > CommitDate: 2025-03-06 11:01:49 +0000 > > > > devclass: make devclass_alloc_unit use M_NOWAIT > > > > The only caller already does this. > > > > The routine can be called with a mutex held making M_WAITOK illegal. > > > > Sponsored by: Rubicon Communications, LLC ("Netgate") > > --- > > sys/kern/subr_bus.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c > > index 9506e471705c..0422352bba51 100644 > > --- a/sys/kern/subr_bus.c > > +++ b/sys/kern/subr_bus.c > > @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) > > static int > > devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) > > { > > + device_t *devices; > > const char *s; > > int unit =3D *unitp; > > > > @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev, > int *unitp) > > int newsize; > > > > newsize =3D unit + 1; > > - dc->devices =3D reallocf(dc->devices, > > - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); > > + devices =3D reallocf(dc->devices, > > + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); > > > > > > I'd recommend against this. From the commit message of f3d3c63442ff, > Warner said, > > > In addition, transition to M_WAITOK since this is a sleepable context > > So, the M_WAITOK is intentional. > > > > Rather than reverting this, the caller devclass_add_device() should use > M_WAITOK. > > > > Per my commit message this is callable from a *NOT* sleepable context. > > Here is a splat we got at Netgate: > > uma_zalloc_debug: zone "malloc-16" with the following non-sleepable locks > held: > exclusive sleep mutex SD slot mtx (sdhci) r =3D 0 (0xd8dec028) locked @ > > /var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeBSD-= src-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688 > stack backtrace: > #0 0xc0330ebc at witness_debugger+0x78 > #1 0xc033217c at witness_warn+0x428 > #2 0xc05b0a58 at uma_zalloc_debug+0x34 > #3 0xc05b067c at uma_zalloc_arg+0x30 > #4 0xc0291760 at malloc+0x8c > #5 0xc02920ec at reallocf+0x14 > #6 0xc02f8894 at devclass_add_device+0x1e8 > #7 0xc02f6c78 at make_device+0xe0 > #8 0xc02f6abc at device_add_child_ordered+0x30 > #9 0xc0156e0c at sdhci_card_task+0x238 > #10 0xc0324090 at taskqueue_run_locked+0x1b4 > #11 0xc0323ea0 at taskqueue_run+0x50 > #12 0xc0275f88 at ithread_loop+0x264 > #13 0xc0271f28 at fork_exit+0xa0 > #14 0xc05f82d4 at swi_exit+0 > > It may be some callers are sleepable. Perhaps a different variant > accepting flags would be prudent, but I have no interest in looking > into that. > This is a big in sdhci_card_task. Newbus in general isn't callable from a sleepable context. Warner > ``` > > - dev->nameunit =3D malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); > > - if (!dev->nameunit) > > - return (ENOMEM); > > + dev->nameunit =3D malloc(buflen, M_BUS, M_WAITOK | M_ZERO); > > ``` > > > > Best regards, > > Zhenlei > > > > + if (devices =3D=3D NULL) > > + return (ENOMEM); > > + dc->devices =3D devices; > > memset(dc->devices + dc->maxunit, 0, > > sizeof(device_t) * (newsize - dc->maxunit)); > > dc->maxunit =3D newsize; > > > > > > > > > > > -- > Mateusz Guzik > --00000000000014a6a1062fad9ca8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Mar 6, 2025, 3:35=E2=80= =AFAM Mateusz Guzik <mjguzik@gmail.= com> wrote:
On Thu, Mar 6, 2= 025 at 12:32=E2=80=AFPM Zhenlei Huang <zlei@freebsd.org> wrote:
>
>
>
> On Mar 6, 2025, at 7:03 PM, Mateusz Guzik <mjg@FreeBSD.org> wrot= e:
>
> The branch main has been updated by mjg:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d676d300= 56d4133859
>
> commit 234683726708cf5212d672d676d30056d4133859
> Author:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@FreeBSD.org>
> AuthorDate: 2025-03-06 11:01:49 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@FreeBSD.org>
> CommitDate: 2025-03-06 11:01:49 +0000
>
>=C2=A0 =C2=A0 devclass: make devclass_alloc_unit use M_NOWAIT
>
>=C2=A0 =C2=A0 The only caller already does this.
>
>=C2=A0 =C2=A0 The routine can be called with a mutex held making M_WAIT= OK illegal.
>
>=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0Rubicon Communications, LLC (&q= uot;Netgate")
> ---
> sys/kern/subr_bus.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
> index 9506e471705c..0422352bba51 100644
> --- a/sys/kern/subr_bus.c
> +++ b/sys/kern/subr_bus.c
> @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc)
> static int
> devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp)
> {
> + device_t *devices;
> const char *s;
> int unit =3D *unitp;
>
> @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev= , int *unitp)
> int newsize;
>
> newsize =3D unit + 1;
> - dc->devices =3D reallocf(dc->devices,
> -=C2=A0 =C2=A0 newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); > + devices =3D reallocf(dc->devices,
> +=C2=A0 =C2=A0 newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); >
>
> I'd recommend against this. From the commit message of f3d3c63442f= f, Warner said,
> > In addition, transition to M_WAITOK since this is a sleepable con= text
> So, the M_WAITOK is intentional.
>
> Rather than reverting this, the caller devclass_add_device() should us= e M_WAITOK.
>

Per my commit message this is callable from a *NOT* sleepable context.

Here is a splat we got at Netgate:

uma_zalloc_debug: zone "malloc-16" with the following non-sleepab= le locks held:
exclusive sleep mutex SD slot mtx (sdhci) r =3D 0 (0xd8dec028) locked @
/var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeBSD-sr= c-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688
stack backtrace:
#0 0xc0330ebc at witness_debugger+0x78
#1 0xc033217c at witness_warn+0x428
#2 0xc05b0a58 at uma_zalloc_debug+0x34
#3 0xc05b067c at uma_zalloc_arg+0x30
#4 0xc0291760 at malloc+0x8c
#5 0xc02920ec at reallocf+0x14
#6 0xc02f8894 at devclass_add_device+0x1e8
#7 0xc02f6c78 at make_device+0xe0
#8 0xc02f6abc at device_add_child_ordered+0x30
#9 0xc0156e0c at sdhci_card_task+0x238
#10 0xc0324090 at taskqueue_run_locked+0x1b4
#11 0xc0323ea0 at taskqueue_run+0x50
#12 0xc0275f88 at ithread_loop+0x264
#13 0xc0271f28 at fork_exit+0xa0
#14 0xc05f82d4 at swi_exit+0

It may be some callers are sleepable. Perhaps a different variant
accepting flags would be prudent, but I have no interest in looking
into that.

This is a big in sdhci_card_task. Newbus in general isn't cal= lable from a sleepable context.


Warner

> ```
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->nameunit =3D malloc(buflen, M_BUS,= M_NOWAIT|M_ZERO);
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!dev->nameunit)
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (ENOMEM= );
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->nameunit =3D malloc(buflen, M_BUS,= M_WAITOK | M_ZERO);
> ```
>
> Best regards,
> Zhenlei
>
> + if (devices =3D=3D NULL)
> + return (ENOMEM);
> + dc->devices =3D devices;
> memset(dc->devices + dc->maxunit, 0,
>=C2=A0 =C2=A0 sizeof(device_t) * (newsize - dc->maxunit));
> dc->maxunit =3D newsize;
>
>
>
>


--
Mateusz Guzik <mjguzik gmail.com>
--00000000000014a6a1062fad9ca8-- From nobody Thu Mar 6 14:56:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7svF66fZz5pl4Q for ; Thu, 06 Mar 2025 14:56:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 4Z7svF3BWTz3QgN for ; Thu, 06 Mar 2025 14:56:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-22359001f1aso17746095ad.3 for ; Thu, 06 Mar 2025 06:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1741272999; x=1741877799; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+HCPnkoeW0uXRkQ3PIJmRPtKK/op9+myfsondPk+9uE=; b=uKZZrI6sIjjj7TOlWo7IQu+pGTvyThnhizCdaQ4pzULgJ8PGOnz4tmdZm21vDrR/Ar 0ZwCJN+sP35d5WbTpPAJWeP3U4NPCjszSuxEMiJE/Ku1bdIpjf/8TgRJtQ93uLZsX6zC q3NbUvXH+o9sqlhxPACR1EXL+2N7ObzVuPumOZ00vDBn1ZHHzule4bHGUnZjECoIf/Q4 +k7fWhKtdORCVnaICPY+7TRjhe3YkmdeXU6LHLVG5eGBi+1dr42wz72imhoy+9Y+M3o7 ddSa4dt7bdbxuqlVWXgQBym+v5Iir0E1RB9vvKzMvil+FR5uAfTDUAZASpm/zkn97Aym HxKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741272999; x=1741877799; 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=+HCPnkoeW0uXRkQ3PIJmRPtKK/op9+myfsondPk+9uE=; b=epmJAIGyRsfKaW5SuaZJTR4K6NUv2rLVbuOd4GQNJP8s7Y4iRHVrLTbkyDtkS/5sYQ ln+A+Nkh0YYi1jjcDdoD1zUhSFfdFSv+hHBPZr5CdDncsCL2DJ9JqhMDckFtyKGKY5fN 1GxHgm30fRZeCz7U7bS32QI1X14SOzlMghxsriTFWOkWJfIGBRJBd29Z9R4IaqfxG6St Wma+ZBj1p8MSp7u4GaWrHu2XaXLxM05Xllx3gzVPcPPP7K7QkVrgyFu6XHk4sCcpOpta ioY3mtgln0QvHsnrI1wXuFlgd7NnOWqBX5QCeINC8Joeo/KP8fn8QCPb75q12mZY13Cu 3BVA== X-Forwarded-Encrypted: i=1; AJvYcCXmOhq2ktHEnkuegI9WImZbMib0cRhg9b/A0/5Xx6Dnga/dFwhjDtj1QudUZZG3VuB8jRAJiM2wIHPGn8PY0+byQWzl@freebsd.org X-Gm-Message-State: AOJu0YyMieLPOYjNjMvJ7YrsmFuqn2cE6sE4xMmaqP29CwFpKFSKAVL1 C9h9lqaD0NmH0hypQtvcr90furj4opzFDgNth/w4rFi5siZGsbXfkDymaa87FVcldad4WVsAsu6 rRAL37q1Tq5j6Y4Co6O87cOGbRgi31FUiKaRBYA== X-Gm-Gg: ASbGncsmiPdyKlu2MMTIpq2KT4f6Rb/Zfdr13boySaQPTd9SMDhjCEmCI8MhUbYeaO6 i2WOn2BpObTkmF3JXXbFf4VhPg+m89s1+dPFzOOc0EEjItPP0MI4yc0PI0td0lrCGJ3mYkWVw/P xnMugBQ/tqKx7jEouPK9Muf/gaIDTQEEzyVT7JDcYwkECKEPomhKRmxj8DpEW9 X-Google-Smtp-Source: AGHT+IF8VHjMwkI04Ur4cDkeXBdzwNli1AdP4b0L6kSk1oH58Y+6NYijwmZ59oZmpm5c5w87AafhPskY56Nooc9TFME= X-Received: by 2002:a05:6a00:2e9f:b0:736:6d4d:ffa6 with SMTP id d2e1a72fcca58-73682c52f85mr11096162b3a.15.1741272998706; Thu, 06 Mar 2025 06:56:38 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202503061103.526B32Id022652@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 6 Mar 2025 06:56:27 -0800 X-Gm-Features: AQ5f1JppwZ2pTNwdQSmP4RmfNk2j3zkuqYnXfXK7PQihZwEQwVlaBrufiiPEIUI Message-ID: Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT To: John Baldwin Cc: Mateusz Guzik , Zhenlei Huang , Mateusz Guzik , src-committers , "" , Warner Losh , "" Content-Type: multipart/alternative; boundary="0000000000008ba1a2062fadb614" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Z7svF3BWTz3QgN X-Spamd-Bar: ---- --0000000000008ba1a2062fadb614 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 6, 2025, 5:33=E2=80=AFAM John Baldwin wrote: > On 3/6/25 06:35, Mateusz Guzik wrote: > > On Thu, Mar 6, 2025 at 12:32=E2=80=AFPM Zhenlei Huang wrote: > >> > >> > >> > >> On Mar 6, 2025, at 7:03 PM, Mateusz Guzik wrote: > >> > >> The branch main has been updated by mjg: > >> > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d676d3005= 6d4133859 > >> > >> commit 234683726708cf5212d672d676d30056d4133859 > >> Author: Mateusz Guzik > >> AuthorDate: 2025-03-06 11:01:49 +0000 > >> Commit: Mateusz Guzik > >> CommitDate: 2025-03-06 11:01:49 +0000 > >> > >> devclass: make devclass_alloc_unit use M_NOWAIT > >> > >> The only caller already does this. > >> > >> The routine can be called with a mutex held making M_WAITOK illega= l. > >> > >> Sponsored by: Rubicon Communications, LLC ("Netgate") > >> --- > >> sys/kern/subr_bus.c | 8 ++++++-- > >> 1 file changed, 6 insertions(+), 2 deletions(-) > >> > >> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c > >> index 9506e471705c..0422352bba51 100644 > >> --- a/sys/kern/subr_bus.c > >> +++ b/sys/kern/subr_bus.c > >> @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) > >> static int > >> devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) > >> { > >> + device_t *devices; > >> const char *s; > >> int unit =3D *unitp; > >> > >> @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev= , > int *unitp) > >> int newsize; > >> > >> newsize =3D unit + 1; > >> - dc->devices =3D reallocf(dc->devices, > >> - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); > >> + devices =3D reallocf(dc->devices, > >> + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); > >> > >> > >> I'd recommend against this. From the commit message of f3d3c63442ff, > Warner said, > >>> In addition, transition to M_WAITOK since this is a sleepable context > >> So, the M_WAITOK is intentional. > >> > >> Rather than reverting this, the caller devclass_add_device() should us= e > M_WAITOK. > >> > > > > Per my commit message this is callable from a *NOT* sleepable context. > > > > Here is a splat we got at Netgate: > > > > uma_zalloc_debug: zone "malloc-16" with the following non-sleepable > locks held: > > exclusive sleep mutex SD slot mtx (sdhci) r =3D 0 (0xd8dec028) locked @ > > > /var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeBSD-= src-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688 > > stack backtrace: > > #0 0xc0330ebc at witness_debugger+0x78 > > #1 0xc033217c at witness_warn+0x428 > > #2 0xc05b0a58 at uma_zalloc_debug+0x34 > > #3 0xc05b067c at uma_zalloc_arg+0x30 > > #4 0xc0291760 at malloc+0x8c > > #5 0xc02920ec at reallocf+0x14 > > #6 0xc02f8894 at devclass_add_device+0x1e8 > > #7 0xc02f6c78 at make_device+0xe0 > > #8 0xc02f6abc at device_add_child_ordered+0x30 > > #9 0xc0156e0c at sdhci_card_task+0x238 > > #10 0xc0324090 at taskqueue_run_locked+0x1b4 > > #11 0xc0323ea0 at taskqueue_run+0x50 > > #12 0xc0275f88 at ithread_loop+0x264 > > Just use a regular taskqueue like taskqueue_thread instead of > taskqueue_swi? > PCI hotplug defines its own thread taskqueue for adding and removing > devices. > > The bug is here, IMO. Eventually new-bus will need some sort of topology > lock and that will have to be an sx lock, so this code needs to change > anyway. The sound code that tries to frob devices with a regular mutex > also needs to change. > I should dust off the branch that i have this one. There's about a dozen places I had to change at the time... In terms of taskqueue_swi, it's probably something that needs to go away. > Generally speaking, code uses tasks for functions that need to sleep, > and taskqueue_swi breaks that. > Its a holdover from spl days for sure. I will fix sdhci to use a proper taskqueue and then revert this commit. > Thanks. You can add me to the review Warner > -- > John Baldwin > > --0000000000008ba1a2062fadb614 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Mar 6, 2025, 5:33=E2=80= =AFAM John Baldwin <jhb@freebsd.org> wrote:
On 3/6/25 06:35, Mate= usz Guzik wrote:
> On Thu, Mar 6, 2025 at 12:32=E2=80=AFPM Zhenlei Huang <
zlei@freebsd.o= rg> wrote:
>>
>>
>>
>> On Mar 6, 2025, at 7:03 PM, Mateusz Guzik <mjg@FreeBSD.org> = wrote:
>>
>> The branch main has been updated by mjg:
>>
>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D234683726708cf5212d672d676= d30056d4133859
>>
>> commit 234683726708cf5212d672d676d30056d4133859
>> Author:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@FreeBSD.org> >> AuthorDate: 2025-03-06 11:01:49 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@FreeBSD.org> >> CommitDate: 2025-03-06 11:01:49 +0000
>>
>>=C2=A0 =C2=A0 =C2=A0devclass: make devclass_alloc_unit use M_NOWAIT=
>>
>>=C2=A0 =C2=A0 =C2=A0The only caller already does this.
>>
>>=C2=A0 =C2=A0 =C2=A0The routine can be called with a mutex held mak= ing M_WAITOK illegal.
>>
>>=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Rubicon Communication= s, LLC ("Netgate")
>> ---
>> sys/kern/subr_bus.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
>> index 9506e471705c..0422352bba51 100644
>> --- a/sys/kern/subr_bus.c
>> +++ b/sys/kern/subr_bus.c
>> @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc)
>> static int
>> devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp)
>> {
>> + device_t *devices;
>> const char *s;
>> int unit =3D *unitp;
>>
>> @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t= dev, int *unitp)
>> int newsize;
>>
>> newsize =3D unit + 1;
>> - dc->devices =3D reallocf(dc->devices,
>> -=C2=A0 =C2=A0 newsize * sizeof(*dc->devices), M_BUS, M_WAITOK)= ;
>> + devices =3D reallocf(dc->devices,
>> +=C2=A0 =C2=A0 newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT)= ;
>>
>>
>> I'd recommend against this. From the commit message of f3d3c63= 442ff, Warner said,
>>> In addition, transition to M_WAITOK since this is a sleepable = context
>> So, the M_WAITOK is intentional.
>>
>> Rather than reverting this, the caller devclass_add_device() shoul= d use M_WAITOK.
>>
>
> Per my commit message this is callable from a *NOT* sleepable context.=
>
> Here is a splat we got at Netgate:
>
> uma_zalloc_debug: zone "malloc-16" with the following non-sl= eepable locks held:
> exclusive sleep mutex SD slot mtx (sdhci) r =3D 0 (0xd8dec028) locked = @
> /var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeB= SD-src-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688
> stack backtrace:
> #0 0xc0330ebc at witness_debugger+0x78
> #1 0xc033217c at witness_warn+0x428
> #2 0xc05b0a58 at uma_zalloc_debug+0x34
> #3 0xc05b067c at uma_zalloc_arg+0x30
> #4 0xc0291760 at malloc+0x8c
> #5 0xc02920ec at reallocf+0x14
> #6 0xc02f8894 at devclass_add_device+0x1e8
> #7 0xc02f6c78 at make_device+0xe0
> #8 0xc02f6abc at device_add_child_ordered+0x30
> #9 0xc0156e0c at sdhci_card_task+0x238
> #10 0xc0324090 at taskqueue_run_locked+0x1b4
> #11 0xc0323ea0 at taskqueue_run+0x50
> #12 0xc0275f88 at ithread_loop+0x264

Just use a regular taskqueue like taskqueue_thread instead of taskqueue_swi= ?
PCI hotplug defines its own thread taskqueue for adding and removing device= s.

The bug is here, IMO.=C2=A0 Eventually new-bus will need some sort of topol= ogy
lock and that will have to be an sx lock, so this code needs to change
anyway.=C2=A0 The sound code that tries to frob devices with a regular mute= x
also needs to change.

I should dust off the branch that i have this one. The= re's about a dozen places I had to change at the time...

In terms of taskqueue_swi, it's probably something that needs to go awa= y.
Generally speaking, code uses tasks for functions that need to sleep,
and taskqueue_swi breaks that.

Its a holdover from spl days for sure.
<= div dir=3D"auto">
I will fix sdhci to use a proper taskqueue and then revert this commit.
=

Than= ks. You can add me to the review=C2=A0

Warner
--
John Baldwin

--0000000000008ba1a2062fadb614-- From nobody Thu Mar 6 15:39:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7tsB4w3Sz5pnZW; Thu, 06 Mar 2025 15:39: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 4Z7tsB4l59z3l2X; Thu, 06 Mar 2025 15:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ZYryIcLkomzzL/VRemP4pwhtqUAdi9IQvzGhRmTpqk=; b=Uk3xWlbKKkzHmnoi/7N8VWVfSjZXxmixtpT/RkhpLvEsG9FA6Ik3+54MwvZeDQ8xlPxOJA APLzFXtuKDHr1pcbA2G4Ic7vDSxYZItktEzUgzLztkpBc4tHBfMufsII/lBcaRdBrnR1px 6OvtWoEDCXJvQrRoR0wqmo2UoF6yf9A9RkHR5Bwj/b6jIQLjLatoB6s2Upa3BKREik3o2p j8N62U1iLtfxOyGGOCMGpT28/Sqkykh7+EXaPIqmSzWPSWGssAFOh5T22eM8UcisYHyqqM k7TUm65+C54E/WzAK/Ahf/u3NN1w0i//QRjhovF15CynIuVdVQv8YjCbDhMXIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741275598; a=rsa-sha256; cv=none; b=xbRy10DcEkMIYns4w02PwAfnJ9letv+uG8cHPldmANIdTfOCBo8u83wpWpl0JBu8kWguw8 boXTqgYKTFb559Iqxtf19tNo7Rs9wrXEoIFIIsdPB/JV4LYYYIB+0YAzl53CXifssKKjJe VxPXChzi04oyEy5VjRUQFVzAG7ZgX7tXZr6dhpXXjfdtulzIFhb4Lr9kGZQyNvCTcRUitO uVBHnQP8g8Tcut1Klg7GfAu02C1d98mQU/yu0+6vxs0NtZE1Lx40GId2KZEjxRgDrJGG+b Y1e+ZTAkCoCSsB4aPIlXt4btOo78icYKLPhzj0hxbBkb+Ma77OA2YYn4VEzxsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ZYryIcLkomzzL/VRemP4pwhtqUAdi9IQvzGhRmTpqk=; b=doORLjiyRJl6RPt91AppOiKQK2Yr8kwuEMgaYFWYPpmnadZi41EFHcwB7/kGsetv171lBK rsFoVxn8GYRSBXVFkxAWufAGEcXhCd0augSuREzyTF2s/RX7/5O3dVM+GfiLjPHzBTc3GM eZF6YsvhPU8uJtBNB4IMKeoiHNLhYH3NEN1C5JSpvg1ruhJveU0NEEZTYeI7zqvFBLx0Co hWcr/JGFUNCJg/XT/56E3sZ8xI0p2UkULZ5krBySgTq69SVWKyh4Dv92ur7zRme+qQQqpF EpxOB6PUSAtN8FF9Ogbb/OKLDR8/Xp+Ug5uKUugIQ6enluA6JX0gbJ7oNh/5Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7tsB3wgSzww4; Thu, 06 Mar 2025 15:39: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 526FdwU1028746; Thu, 6 Mar 2025 15:39:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526FdwjK028743; Thu, 6 Mar 2025 15:39:58 GMT (envelope-from git) Date: Thu, 6 Mar 2025 15:39:58 GMT Message-Id: <202503061539.526FdwjK028743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 7be3ea2e6470 - stable/14 - pkg: clean support for repositories List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7be3ea2e64707412f656b345e8d274bf4a3715a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7be3ea2e64707412f656b345e8d274bf4a3715a4 commit 7be3ea2e64707412f656b345e8d274bf4a3715a4 Author: Baptiste Daroussin AuthorDate: 2025-01-14 11:12:00 +0000 Commit: Baptiste Daroussin CommitDate: 2025-03-06 15:31:35 +0000 pkg: clean support for repositories Rework the way the bootstrap fetches pkg, by implementing a full support for the repositories, the boostrap will now loop over all available repo and try to fetch the full package from there. It will at the first valid package found. Fallback to packagesite (which has been deprecated for a while) if needed, by transforming it into a repo, if no repo is found. MFC After: 3 weeks (cherry picked from commit dc4581589a3256667fafd46a30c67abdfd86618f) --- usr.sbin/pkg/config.c | 158 ++++++++++++++++++++++++++++++++++++++------------ usr.sbin/pkg/config.h | 24 ++++++++ usr.sbin/pkg/pkg.c | 149 +++++++++++++++++++++++------------------------ 3 files changed, 216 insertions(+), 115 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index ce3a11cf8c81..ce73a08d93f3 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -60,6 +60,8 @@ struct config_entry { bool main_only; /* Only set in pkg.conf. */ }; +static struct repositories repositories = STAILQ_HEAD_INITIALIZER(repositories); + static struct config_entry c[] = { [PACKAGESITE] = { PKG_CONFIG_STRING, @@ -212,7 +214,7 @@ boolstr_to_bool(const char *str) } static void -config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) +config_parse(const ucl_object_t *obj) { FILE *buffp; char *buf = NULL; @@ -239,29 +241,9 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) memset(buf, 0, bufsz); rewind(buffp); - if (conftype == CONFFILE_PKG) { for (j = 0; j < strlen(key); ++j) fputc(toupper(key[j]), buffp); fflush(buffp); - } else if (conftype == CONFFILE_REPO) { - if (strcasecmp(key, "url") == 0) - fputs("PACKAGESITE", buffp); - else if (strcasecmp(key, "mirror_type") == 0) - fputs("MIRROR_TYPE", buffp); - else if (strcasecmp(key, "signature_type") == 0) - fputs("SIGNATURE_TYPE", buffp); - else if (strcasecmp(key, "fingerprints") == 0) - fputs("FINGERPRINTS", buffp); - else if (strcasecmp(key, "pubkey") == 0) - fputs("PUBKEY", buffp); - else if (strcasecmp(key, "enabled") == 0) { - if ((cur->type != UCL_BOOLEAN) || - !ucl_object_toboolean(cur)) - goto cleanup; - } else - continue; - fflush(buffp); - } for (i = 0; i < CONFIG_SIZE; i++) { if (strcmp(buf, c[i].key) == 0) @@ -325,7 +307,7 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) if (c[i].envset) continue; /* Prevent overriding ABI, ASSUME_ALWAYS_YES, etc. */ - if (conftype != CONFFILE_PKG && c[i].main_only == true) + if (c[i].main_only == true) continue; switch (c[i].type) { case PKG_CONFIG_LIST: @@ -337,12 +319,91 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) } } -cleanup: free(temp_config); fclose(buffp); free(buf); } + +static void +parse_mirror_type(struct repository *r, const char *mt) +{ + if (strcasecmp(mt, "srv") == 0) + r->mirror_type = MIRROR_SRV; + r->mirror_type = MIRROR_NONE; +} + +static bool +parse_signature_type(struct repository *repo, const char *st) +{ + if (strcasecmp(st, "FINGERPRINTS") == 0) + repo->signature_type = SIGNATURE_FINGERPRINT; + else if (strcasecmp(st, "PUBKEY") == 0) + repo->signature_type = SIGNATURE_PUBKEY; + else if (strcasecmp(st, "NONE") == 0) + repo->signature_type = SIGNATURE_NONE; + else { + warnx("Signature type %s is not supported for bootstraping," + " ignoring repository %s", st, repo->name); + free(repo->url); + free(repo->name); + free(repo->fingerprints); + free(repo->pubkey); + free(repo); + return false; + } + return (true); +} + +static void +parse_repo(const ucl_object_t *o) +{ + const ucl_object_t *cur; + const char *key; + ucl_object_iter_t it = NULL; + + struct repository *repo = calloc(1, sizeof(struct repository)); + if (repo == NULL) + err(EXIT_FAILURE, "calloc"); + + repo->name = strdup(ucl_object_key(o)); + if (repo->name == NULL) + err(EXIT_FAILURE, "strdup"); + while ((cur = ucl_iterate_object(o, &it, true))) { + key = ucl_object_key(cur); + if (key == NULL) + continue; + if (strcasecmp(key, "url") == 0) { + repo->url = strdup(ucl_object_tostring(cur)); + if (repo->url == NULL) + err(EXIT_FAILURE, "strdup"); + } else if (strcasecmp(key, "mirror_type") == 0) { + parse_mirror_type(repo, ucl_object_tostring(cur)); + } else if (strcasecmp(key, "signature_type") == 0) { + if (!parse_signature_type(repo, ucl_object_tostring(cur))) + return; + } else if (strcasecmp(key, "fingerprints") == 0) { + repo->fingerprints = strdup(ucl_object_tostring(cur)); + if (repo->fingerprints == NULL) + err(EXIT_FAILURE, "strdup"); + } else if (strcasecmp(key, "pubkey") == 0) { + repo->pubkey = strdup(ucl_object_tostring(cur)); + if (repo->pubkey == NULL) + err(EXIT_FAILURE, "strdup"); + } else if (strcasecmp(key, "enabled") == 0) { + if ((cur->type != UCL_BOOLEAN) || + !ucl_object_toboolean(cur)) { + free(repo->url); + free(repo->name); + free(repo); + return; + } + } + } + STAILQ_INSERT_TAIL(&repositories, repo, next); + return; +} + /*- * Parse new repo style configs in style: * Name: @@ -368,8 +429,7 @@ parse_repo_file(ucl_object_t *obj, const char *requested_repo) if (requested_repo != NULL && strcmp(requested_repo, key) != 0) continue; - - config_parse(cur, CONFFILE_REPO); + parse_repo(cur); } } @@ -380,8 +440,12 @@ read_conf_file(const char *confpath, const char *requested_repo, { struct ucl_parser *p; ucl_object_t *obj = NULL; + const char *abi = pkg_get_myabi(); + if (abi == NULL) + errx(EXIT_FAILURE, "Fail do determine ABI"); p = ucl_parser_new(0); + ucl_parser_register_variable(p, "ABI", abi); if (!ucl_parser_add_file(p, confpath)) { if (errno != ENOENT) @@ -398,7 +462,7 @@ read_conf_file(const char *confpath, const char *requested_repo, "configuration file %s", confpath); else { if (conftype == CONFFILE_PKG) - config_parse(obj, conftype); + config_parse(obj); else if (conftype == CONFFILE_REPO) parse_repo_file(obj, requested_repo); } @@ -409,7 +473,7 @@ read_conf_file(const char *confpath, const char *requested_repo, return (0); } -static int +static void load_repositories(const char *repodir, const char *requested_repo) { struct dirent *ent; @@ -417,12 +481,9 @@ load_repositories(const char *repodir, const char *requested_repo) char *p; size_t n; char path[MAXPATHLEN]; - int ret; - - ret = 0; if ((d = opendir(repodir)) == NULL) - return (1); + return; while ((ent = readdir(d))) { /* Trim out 'repos'. */ @@ -438,7 +499,6 @@ load_repositories(const char *repodir, const char *requested_repo) continue; if (read_conf_file(path, requested_repo, CONFFILE_REPO)) { - ret = 1; goto cleanup; } } @@ -446,8 +506,6 @@ load_repositories(const char *repodir, const char *requested_repo) cleanup: closedir(d); - - return (ret); } int @@ -509,8 +567,7 @@ config_init(const char *requested_repo) } STAILQ_FOREACH(cv, c[REPOS_DIR].list, next) - if (load_repositories(cv->value, requested_repo)) - goto finalize; + load_repositories(cv->value, requested_repo); finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { @@ -521,8 +578,6 @@ finalize: c[ABI].val = abi; } - subst_packagesite(c[ABI].value != NULL ? c[ABI].value : c[ABI].val); - return (0); } @@ -561,6 +616,33 @@ config_bool(pkg_config_key k, bool *val) return (0); } +struct repositories * +config_get_repositories(void) +{ + if (STAILQ_EMPTY(&repositories)) { + /* Fall back to PACKAGESITE - deprecated - */ + struct repository *r = calloc(1, sizeof(r)); + if (r == NULL) + err(EXIT_FAILURE, "calloc"); + r->name = strdup("fallback"); + if (r->name == NULL) + err(EXIT_FAILURE, "strdup"); + subst_packagesite(c[ABI].value != NULL ? c[ABI].value : c[ABI].val); + r->url = c[PACKAGESITE].value; + if (c[SIGNATURE_TYPE].value != NULL) + if (!parse_signature_type(r, c[SIGNATURE_TYPE].value)) + exit(EXIT_FAILURE); + if (c[MIRROR_TYPE].value != NULL) + parse_mirror_type(r, c[MIRROR_TYPE].value); + if (c[PUBKEY].value != NULL) + r->pubkey = c[PUBKEY].value; + if (c[FINGERPRINTS].value != NULL) + r->fingerprints = c[FINGERPRINTS].value; + STAILQ_INSERT_TAIL(&repositories, r, next); + } + return (&repositories); +} + void config_finish(void) { int i; diff --git a/usr.sbin/pkg/config.h b/usr.sbin/pkg/config.h index 21d115e41db2..26f3ff79541b 100644 --- a/usr.sbin/pkg/config.h +++ b/usr.sbin/pkg/config.h @@ -30,6 +30,7 @@ #define _PKG_CONFIG_H #include +#include #define URL_SCHEME_PREFIX "pkg+" @@ -58,9 +59,32 @@ typedef enum { CONFFILE_REPO, } pkg_conf_file_t; +typedef enum { + SIGNATURE_NONE = 0, + SIGNATURE_FINGERPRINT, + SIGNATURE_PUBKEY, +} signature_t; + +typedef enum { + MIRROR_NONE = 0, + MIRROR_SRV, +} mirror_t; + +struct repository { + char *name; + char *url; + mirror_t mirror_type; + signature_t signature_type; + char *fingerprints; + char *pubkey; + STAILQ_ENTRY(repository) next; +}; +STAILQ_HEAD(repositories, repository); + int config_init(const char *); void config_finish(void); int config_string(pkg_config_key, const char **); int config_bool(pkg_config_key, bool *); +struct repositories *config_get_repositories(void); #endif diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 9aa8d7dfe774..f19c93c6fbb5 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -256,7 +256,7 @@ install_pkg_static(const char *path, const char *pkgpath, bool force) } static int -fetch_to_fd(const char *url, char *path, const char *fetchOpts) +fetch_to_fd(struct repository *repo, const char *url, char *path, const char *fetchOpts) { struct url *u; struct dns_srvinfo *mirrors, *current; @@ -268,18 +268,11 @@ fetch_to_fd(const char *url, char *path, const char *fetchOpts) ssize_t r; char buf[10240]; char zone[MAXHOSTNAMELEN + 13]; - static const char *mirror_type = NULL; max_retry = 3; current = mirrors = NULL; remote = NULL; - if (mirror_type == NULL && config_string(MIRROR_TYPE, &mirror_type) - != 0) { - warnx("No MIRROR_TYPE defined"); - return (-1); - } - if ((fd = mkstemp(path)) == -1) { warn("mkstemp()"); return (-1); @@ -295,7 +288,7 @@ fetch_to_fd(const char *url, char *path, const char *fetchOpts) while (remote == NULL) { if (retry == max_retry) { if (strcmp(u->scheme, "file") != 0 && - strcasecmp(mirror_type, "srv") == 0) { + repo->mirror_type == MIRROR_SRV) { snprintf(zone, sizeof(zone), "_%s._tcp.%s", u->scheme, u->host); mirrors = dns_getsrvinfo(zone); @@ -654,23 +647,31 @@ parse_cert(int fd) { } static bool -verify_pubsignature(int fd_pkg, int fd_sig) +verify_pubsignature(int fd_pkg, int fd_sig, struct repository *r) { struct pubkey *pk; - const char *pubkey; char *data; struct pkgsign_ctx *sctx; size_t datasz; bool ret; + const char *pubkey; pk = NULL; - pubkey = NULL; sctx = NULL; data = NULL; ret = false; - if (config_string(PUBKEY, &pubkey) != 0) { - warnx("No CONFIG_PUBKEY defined"); - goto cleanup; + + if (r != NULL) { + if (r->pubkey == NULL) { + warnx("No CONFIG_PUBKEY defined for %s", r->name); + goto cleanup; + } + pubkey = r->pubkey; + } else { + if (config_string(PUBKEY, &pubkey) != 0) { + warnx("No CONFIG_PUBKEY defined for %s", r->name); + goto cleanup; + } } if ((pk = read_pubkey(fd_sig)) == NULL) { @@ -704,8 +705,8 @@ verify_pubsignature(int fd_pkg, int fd_sig) } /* Verify the signature. */ - printf("Verifying signature with public key %s... ", pubkey); - if (pkgsign_verify_data(sctx, data, datasz, pubkey, NULL, 0, pk->sig, + printf("Verifying signature with public key %s.a.. ", r->pubkey); + if (pkgsign_verify_data(sctx, data, datasz, r->pubkey, NULL, 0, pk->sig, pk->siglen) == false) { fprintf(stderr, "Signature is not valid\n"); goto cleanup; @@ -724,7 +725,7 @@ cleanup: } static bool -verify_signature(int fd_pkg, int fd_sig) +verify_signature(int fd_pkg, int fd_sig, struct repository *r) { struct fingerprint_list *trusted, *revoked; struct fingerprint *fingerprint; @@ -743,9 +744,17 @@ verify_signature(int fd_pkg, int fd_sig) ret = false; /* Read and parse fingerprints. */ - if (config_string(FINGERPRINTS, &fingerprints) != 0) { - warnx("No CONFIG_FINGERPRINTS defined"); - goto cleanup; + if (r != NULL) { + if (r->fingerprints == NULL) { + warnx("No FINGERPRINTS defined for %s", r->name); + goto cleanup; + } + fingerprints = r->fingerprints; + } else { + if (config_string(FINGERPRINTS, &fingerprints) != 0) { + warnx("No FINGERPRINTS defined"); + goto cleanup; + } } snprintf(path, MAXPATHLEN, "%s/trusted", fingerprints); @@ -834,7 +843,7 @@ cleanup: } static int -bootstrap_pkg(bool force, const char *fetchOpts) +bootstrap_pkg(bool force, const char *fetchOpts, struct repository *repo) { int fd_pkg, fd_sig; int ret; @@ -842,28 +851,18 @@ bootstrap_pkg(bool force, const char *fetchOpts) char tmppkg[MAXPATHLEN]; char tmpsig[MAXPATHLEN]; const char *packagesite; - const char *signature_type; char pkgstatic[MAXPATHLEN]; const char *bootstrap_name; fd_sig = -1; ret = -1; - if (config_string(PACKAGESITE, &packagesite) != 0) { - warnx("No PACKAGESITE defined"); - return (-1); - } - - if (config_string(SIGNATURE_TYPE, &signature_type) != 0) { - warnx("Error looking up SIGNATURE_TYPE"); - return (-1); - } - - printf("Bootstrapping pkg from %s, please wait...\n", packagesite); + printf("Bootstrapping pkg from %s, please wait...\n", repo->url); /* Support pkg+http:// for PACKAGESITE which is the new format in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has no A record. */ + packagesite = repo->url; if (strncmp(URL_SCHEME_PREFIX, packagesite, strlen(URL_SCHEME_PREFIX)) == 0) packagesite += strlen(URL_SCHEME_PREFIX); @@ -874,53 +873,44 @@ bootstrap_pkg(bool force, const char *fetchOpts) snprintf(tmppkg, MAXPATHLEN, "%s/%s.XXXXXX", getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, bootstrap_name); - if ((fd_pkg = fetch_to_fd(url, tmppkg, fetchOpts)) != -1) + if ((fd_pkg = fetch_to_fd(repo, url, tmppkg, fetchOpts)) != -1) break; bootstrap_name = NULL; } if (bootstrap_name == NULL) goto fetchfail; - if (signature_type != NULL && - strcasecmp(signature_type, "NONE") != 0) { - if (strcasecmp(signature_type, "FINGERPRINTS") == 0) { - - snprintf(tmpsig, MAXPATHLEN, "%s/%s.sig.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, - bootstrap_name); - snprintf(url, MAXPATHLEN, "%s/Latest/%s.sig", - packagesite, bootstrap_name); - - if ((fd_sig = fetch_to_fd(url, tmpsig, fetchOpts)) == -1) { - fprintf(stderr, "Signature for pkg not " - "available.\n"); - goto fetchfail; - } + if (repo->signature_type == SIGNATURE_FINGERPRINT) { + snprintf(tmpsig, MAXPATHLEN, "%s/%s.sig.XXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, + bootstrap_name); + snprintf(url, MAXPATHLEN, "%s/Latest/%s.sig", + packagesite, bootstrap_name); - if (verify_signature(fd_pkg, fd_sig) == false) - goto cleanup; - } else if (strcasecmp(signature_type, "PUBKEY") == 0) { + if ((fd_sig = fetch_to_fd(repo, url, tmpsig, fetchOpts)) == -1) { + fprintf(stderr, "Signature for pkg not " + "available.\n"); + goto fetchfail; + } - snprintf(tmpsig, MAXPATHLEN, - "%s/%s.pubkeysig.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, - bootstrap_name); - snprintf(url, MAXPATHLEN, "%s/Latest/%s.pubkeysig", - packagesite, bootstrap_name); + if (verify_signature(fd_pkg, fd_sig, repo) == false) + goto cleanup; + } else if (repo->signature_type == SIGNATURE_PUBKEY) { + snprintf(tmpsig, MAXPATHLEN, + "%s/%s.pubkeysig.XXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, + bootstrap_name); + snprintf(url, MAXPATHLEN, "%s/Latest/%s.pubkeysig", + repo->url, bootstrap_name); - if ((fd_sig = fetch_to_fd(url, tmpsig, fetchOpts)) == -1) { - fprintf(stderr, "Signature for pkg not " - "available.\n"); - goto fetchfail; - } + if ((fd_sig = fetch_to_fd(repo, url, tmpsig, fetchOpts)) == -1) { + fprintf(stderr, "Signature for pkg not " + "available.\n"); + goto fetchfail; + } - if (verify_pubsignature(fd_pkg, fd_sig) == false) - goto cleanup; - } else { - warnx("Signature type %s is not supported for " - "bootstrapping.", signature_type); + if (verify_pubsignature(fd_pkg, fd_sig, repo) == false) goto cleanup; - } } if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0) @@ -930,18 +920,15 @@ bootstrap_pkg(bool force, const char *fetchOpts) fetchfail: for (int j = 0; bootstrap_names[j] != NULL; j++) { - warnx("Attempted to fetch %s/Latest/%s", packagesite, + warnx("Attempted to fetch %s/Latest/%s", repo->url, bootstrap_names[j]); } warnx("Error: %s", fetchLastErrString); if (fetchLastErrCode == FETCH_RESOLV) { fprintf(stderr, "Address resolution failed for %s.\n", packagesite); - fprintf(stderr, "Consider changing PACKAGESITE.\n"); } else { fprintf(stderr, "A pre-built version of pkg could not be found for " "your system.\n"); - fprintf(stderr, "Consider changing PACKAGESITE or installing it from " - "ports: 'ports-mgmt/pkg'.\n"); } cleanup: @@ -1025,7 +1012,7 @@ bootstrap_pkg_local(const char *pkgpath, bool force) goto cleanup; } - if (verify_signature(fd_pkg, fd_sig) == false) + if (verify_signature(fd_pkg, fd_sig, NULL) == false) goto cleanup; } else if (strcasecmp(signature_type, "PUBKEY") == 0) { @@ -1038,7 +1025,7 @@ bootstrap_pkg_local(const char *pkgpath, bool force) goto cleanup; } - if (verify_pubsignature(fd_pkg, fd_sig) == false) + if (verify_pubsignature(fd_pkg, fd_sig, NULL) == false) goto cleanup; } else { @@ -1106,6 +1093,7 @@ main(int argc, char *argv[]) signed char ch; const char *fetchOpts; char *command; + struct repositories *repositories; activation_test = false; add_pkg = false; @@ -1233,6 +1221,8 @@ main(int argc, char *argv[]) fetchDebug = 1; if ((bootstrap_only && force) || access(pkgpath, X_OK) == -1) { + struct repository *repo; + int ret = 0; /* * To allow 'pkg -N' to be used as a reliable test for whether * a system is configured to use pkg, don't bootstrap pkg @@ -1273,7 +1263,12 @@ main(int argc, char *argv[]) if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } - if (bootstrap_pkg(force, fetchOpts) != 0) + repositories = config_get_repositories(); + STAILQ_FOREACH(repo, repositories, next) { + if ((ret = bootstrap_pkg(force, fetchOpts, repo)) == 0) + break; + } + if (ret != 0) exit(EXIT_FAILURE); config_finish(); From nobody Thu Mar 6 15:39:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7tsC6HPvz5pnPj; Thu, 06 Mar 2025 15:39: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 4Z7tsC4jKsz3l4t; Thu, 06 Mar 2025 15:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ue2ViTI8+p76bOq5iJgyOGThFXtAndYGMa8TMYCnajk=; b=etvFZBB3cImdgDMhAYEHOD9xCl/fZO+LGykahRGh3hUxcdgRrVNqQxbzJ2bXKJFswZbxty pu2xI//R1ZoZUIaGTik1RkiSu3GdZOC5q3w4QcT3bZcI7bw2N5Dww0HHBUdapLJenIQr1F YCQpNVYtoW2iY2/wof1I386SBkWdpElgAW9YpYvla3ZKfLA4vffbSn57YhjcSIb1kzmB/e JhLBCICzmoRbFzdNvz3pLMT8B0WxMn9EECP3TGy2/rdb3JoHSnDRsh1bB6VvR1Z8tBVcdw tCyinyU7UH/mCEfqiGwbH0WrxA7ag2gxnRMGZ+6bQEnPAidLY4wb0mA5fqn1+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741275599; a=rsa-sha256; cv=none; b=Ns8eebLbjjyjuabIwR3ya8N5qbCbefccrrG8xThl8PwRODph3IMjh8GgUpfTrThnQeHQbu PA2DtAuxeAw8EkFGGSDnPGleAf9XddaoAVwQepKgy7wmyPsuOu8sz1uC1F9GSDWyuQcfDG Ay6VWrvAnvcPRrWd2HfIyOOfhxMnn0SKuxxTS1BzrXsUaakQvCegG31pqkrwnH6g32AkZ5 RZxfYV2xD0ZbgVp4f2Fo7hvdHMWodmNDFJVoCJEvn8A/XMCmMGWvCjuxR4Hchm4gFn8yNo JwYnG1pceSNx9pUUEDx+AI/n/KrdxmHl01dtf+zjl2ujM6nmXfmIXYpeXkaAVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ue2ViTI8+p76bOq5iJgyOGThFXtAndYGMa8TMYCnajk=; b=HzYk1lx4YGIeuDrgeaaIIT0jQ8aPbuEXVt/O2IWaHzVnVNBLrpVdGJMFwsFTGWj3x+NWA2 W6y+OGxyKKA6f9V2V3Q2ltySsuOWNROibuKIMC4iWyvRUyHbOJAeb5jdic4yfgsrnVBcFb 8jXpbkX8dx8XR3MHUe5yLiA8IoObJVkbfttWxfuoGiThIK2X9QUUyGgtjbFxwQDP8mStxL 0LVPBhOnRaDiS/VP1l148kUXRlQ+IWu2TT+S0p5ZfB1gvgCqjnKKevpySOyB1wZXzHHTmc PYpZovdBO1T7lxmFaPW84+8SSZvz7lLoDFqp24b+r98xsJkuTQ8btonMTYTEXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7tsC4CVRzww5; Thu, 06 Mar 2025 15:39: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 526Fdx8J028781; Thu, 6 Mar 2025 15:39:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526FdxOt028778; Thu, 6 Mar 2025 15:39:59 GMT (envelope-from git) Date: Thu, 6 Mar 2025 15:39:59 GMT Message-Id: <202503061539.526FdxOt028778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: c7c3f8dbcfae - stable/14 - pkg: make sure the repositories have at least an url List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7c3f8dbcfaeac5b4f881d329cf6cec92a8521df Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c7c3f8dbcfaeac5b4f881d329cf6cec92a8521df commit c7c3f8dbcfaeac5b4f881d329cf6cec92a8521df Author: Baptiste Daroussin AuthorDate: 2025-01-15 08:06:55 +0000 Commit: Baptiste Daroussin CommitDate: 2025-03-06 15:37:51 +0000 pkg: make sure the repositories have at least an url While here, factorize code to free the repository structure (cherry picked from commit eccf736c3ce6e9566fa9923080b4c24ee7f9ae2a) --- usr.sbin/pkg/config.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index ce73a08d93f3..521360c642d6 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -1,9 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2014 Baptiste Daroussin + * Copyright (c) 2014-2025 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -333,6 +332,16 @@ parse_mirror_type(struct repository *r, const char *mt) r->mirror_type = MIRROR_NONE; } +static void +repo_free(struct repository *r) +{ + free(r->name); + free(r->url); + free(r->fingerprints); + free(r->pubkey); + free(r); +} + static bool parse_signature_type(struct repository *repo, const char *st) { @@ -345,11 +354,7 @@ parse_signature_type(struct repository *repo, const char *st) else { warnx("Signature type %s is not supported for bootstraping," " ignoring repository %s", st, repo->name); - free(repo->url); - free(repo->name); - free(repo->fingerprints); - free(repo->pubkey); - free(repo); + repo_free(repo); return false; } return (true); @@ -393,13 +398,16 @@ parse_repo(const ucl_object_t *o) } else if (strcasecmp(key, "enabled") == 0) { if ((cur->type != UCL_BOOLEAN) || !ucl_object_toboolean(cur)) { - free(repo->url); - free(repo->name); - free(repo); + repo_free(repo); return; } } } + /* At least we need an url */ + if (repo->url == NULL) { + repo_free(repo); + return; + } STAILQ_INSERT_TAIL(&repositories, repo, next); return; } From nobody Thu Mar 6 15:40:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7tsF2dZ6z5pnZb; Thu, 06 Mar 2025 15:40: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 4Z7tsD5BjPz3l96; Thu, 06 Mar 2025 15:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lKQOoiccHI8r78Tdda0IXEWyFRA2xJVcFQwJYGvPUbU=; b=vRMjj7WqaxCCHGzyvBpxzt/2nvccsAWdPPaueJQ4kKKDCXtIdCp+OfNbbkX0hdQG8KcGiZ 6Sy9cs9IMceOStXXXN9sjdm+yzElP9nKxvJwaA6fM3HEkB0VFOTFLmL8xzUJeI2NIV6Sfl 0TC2TUUEZrKApovK+SV7Ym5Os/AFEZLj0KZ/YVSCWNFLYwabV3602n9Ehg9InSg3w7c81v a5W0NAi8eLELXHiKF1+5XQWw3dc7mTAU7KbqE6EeysxtfEtMi9oUtiJytAvoMKM50RBqe8 BaF0xJ1wF6CFDKrO6mL9vJxTTfmf5eXWOPgtvIXwpUvCJ42kTWdiZEZxuuLsCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741275600; a=rsa-sha256; cv=none; b=DowBUXZqg6PLcZkMLjKcsnz4PjyOZfaPsU86H61T/9lEbbp2ViCKLLCT2VRdy3S4I9DkPE 2xBrGBBXshA/oHW00+1jDwYmK6XMOpl/JPBF9TDz82ERAHD2TztWIoCzSUA3fsDnwwOb8D 6WpG8b/6Nn3pW+pjvTgmgEcsslxKOqzcWltGITUTWnLL6iqatBQscQVdlFOdulVoImUCm+ o8Q1sl4HstGyeT/HtaEVBD913zOcbFsUyKtr6R5Kv/amE37vjNjs5fT7F2i4EgUa0HR61R 8E9P+QuuXEr7EtCrvEOnhEXUiSdcxnCAYmNlzWrT31gcPxigX8/4He+gOSayBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lKQOoiccHI8r78Tdda0IXEWyFRA2xJVcFQwJYGvPUbU=; b=NROgu4lYl69YFKDVegYjCmOQ6YOgp8fuUGhU2FbBFt+HZbE2sxcYHl+N2zBxR5e+qY1sS+ KkbVkj3pYgiV3XxxN4duquaEuV/CG1+23OLevETeulp6bWZ+E/DRzfrXCiqvxmfemYvkQz IMoqQhmCN11W1i6Hwi6CT5uxc8tjQ1J6W/1Fqflq5rbeHG2hBHt4zYU7QX2lRLbk4haQ1N 4hiCkYiOoBepr++4QpiYq3MQn/nkRbqIXr3d0605dU5baflj70D6MowPxWwZjYUB8HFdob ljStfg3FtT2LPg5Y572JoLtnXn8LjB1RvR9vesKT+lBh5P+OObwcpze8qZsj0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7tsD4mBwzwRr; Thu, 06 Mar 2025 15:40: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 526Fe08T029896; Thu, 6 Mar 2025 15:40:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526Fe0qT029873; Thu, 6 Mar 2025 15:40:00 GMT (envelope-from git) Date: Thu, 6 Mar 2025 15:40:00 GMT Message-Id: <202503061540.526Fe0qT029873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 2b8f8ede6e6b - stable/14 - pkg(7): support configuration overwrite like pkg(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b8f8ede6e6b83805ceeb33d51f08282ab4445b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2b8f8ede6e6b83805ceeb33d51f08282ab4445b4 commit 2b8f8ede6e6b83805ceeb33d51f08282ab4445b4 Author: Baptiste Daroussin AuthorDate: 2025-01-15 08:18:46 +0000 Commit: Baptiste Daroussin CommitDate: 2025-03-06 15:38:16 +0000 pkg(7): support configuration overwrite like pkg(8) with pkg(8) it is possible to overwrite a configuration like adding FreeBSD { enabled: false } in /usr/local/etc/pkg/repo/overwrite.conf which allows to change any value which can have been reviously configured in anything in /etc/pkg/*.conf now the bootstrap supports the same MFC After: 3 weeks (cherry picked from commit 5c341fe5123d4aa6961066542de63dd4431d004d) --- usr.sbin/pkg/config.c | 55 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 521360c642d6..e02da1461294 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -354,51 +354,79 @@ parse_signature_type(struct repository *repo, const char *st) else { warnx("Signature type %s is not supported for bootstraping," " ignoring repository %s", st, repo->name); - repo_free(repo); - return false; + return (false); } return (true); } +static struct repository * +find_repository(const char *name) +{ + struct repository *repo; + STAILQ_FOREACH(repo, &repositories, next) { + if (strcmp(repo->name, name) == 0) + return (repo); + } + return (NULL); +} + static void parse_repo(const ucl_object_t *o) { const ucl_object_t *cur; - const char *key; + const char *key, *reponame; ucl_object_iter_t it = NULL; + bool newrepo = false; + struct repository *repo; + + reponame = ucl_object_key(o); + repo = find_repository(reponame); + if (repo == NULL) { + repo = calloc(1, sizeof(struct repository)); + if (repo == NULL) + err(EXIT_FAILURE, "calloc"); - struct repository *repo = calloc(1, sizeof(struct repository)); - if (repo == NULL) - err(EXIT_FAILURE, "calloc"); - - repo->name = strdup(ucl_object_key(o)); - if (repo->name == NULL) - err(EXIT_FAILURE, "strdup"); + repo->name = strdup(reponame); + if (repo->name == NULL) + err(EXIT_FAILURE, "strdup"); + newrepo = true; + } while ((cur = ucl_iterate_object(o, &it, true))) { key = ucl_object_key(cur); if (key == NULL) continue; if (strcasecmp(key, "url") == 0) { + free(repo->url); repo->url = strdup(ucl_object_tostring(cur)); if (repo->url == NULL) err(EXIT_FAILURE, "strdup"); } else if (strcasecmp(key, "mirror_type") == 0) { parse_mirror_type(repo, ucl_object_tostring(cur)); } else if (strcasecmp(key, "signature_type") == 0) { - if (!parse_signature_type(repo, ucl_object_tostring(cur))) + if (!parse_signature_type(repo, ucl_object_tostring(cur))) { + if (newrepo) + repo_free(repo); + else + STAILQ_REMOVE(&repositories, repo, repository, next); return; + } } else if (strcasecmp(key, "fingerprints") == 0) { + free(repo->fingerprints); repo->fingerprints = strdup(ucl_object_tostring(cur)); if (repo->fingerprints == NULL) err(EXIT_FAILURE, "strdup"); } else if (strcasecmp(key, "pubkey") == 0) { + free(repo->pubkey); repo->pubkey = strdup(ucl_object_tostring(cur)); if (repo->pubkey == NULL) err(EXIT_FAILURE, "strdup"); } else if (strcasecmp(key, "enabled") == 0) { if ((cur->type != UCL_BOOLEAN) || !ucl_object_toboolean(cur)) { - repo_free(repo); + if (newrepo) + repo_free(repo); + else + STAILQ_REMOVE(&repositories, repo, repository, next); return; } } @@ -408,7 +436,8 @@ parse_repo(const ucl_object_t *o) repo_free(repo); return; } - STAILQ_INSERT_TAIL(&repositories, repo, next); + if (newrepo) + STAILQ_INSERT_TAIL(&repositories, repo, next); return; } From nobody Thu Mar 6 15:40:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7tsG1D8Bz5pnVL; Thu, 06 Mar 2025 15:40: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 4Z7tsF5gXMz3lCQ; Thu, 06 Mar 2025 15:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXIXTJ2wuQX6J+niJT4tGUc8ccw2yTPyAPJZLzfRZas=; b=tltB73p0yOgRka6w755jKxbfu5WMNVHIk0dBJWSVXi7CSha9eUYXHcGXuHBhipLlke/XzX 9A0VjPW46uNBKSDXwOwRHs3ENSEOLQw0hO9qzqPeFJwub++cr6jP3xEGIe7+t5o1oajAj4 VseUkYw9hFDQlPjGfdcIW7MGdcSoY3tv3vCT68BE3TbCsvRgj+FHSIOKqI1o67kFM1UPDu Cf8ZQUeaB/ngZ5CfhlIW4pLtnLuQuu6/T5ytt/kLORv3d/bLXgS0Jewg1TtwpI1M+Dtg0U 4LuXuA+6b2RfkWKlKwDGJzg+/UE7nbaDkPuKvr9BAss3deEnOb2U96D8E669yA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741275601; a=rsa-sha256; cv=none; b=CBjRSZNF+PLxqaFETdGJA6oGjr+I6fOH0/1WKnRhwtnpm18UEVYfe5C2HWieDICsMm9wqs MngVOxAM2fAjlHzueeeVshBlkiEqkGdVTKGYbiQDoOx+6nd8dhGvqGfowkmkpgD698M2Js hKzno68NFraZgzOTZ0P4xvp/AQqx2YlYYyl7DTjNJ3P4a00rjdxwMffLyB8Cn561LipNxf dMuZiIFJ+6T6t7Cjwvl3LP944k7ZtyJ82sZS9Ccp1Ym/vnyoxJPSA8tCUSXd5h1uaw11Ii rOLZOBMm25+7TYXSJbDkImUZbX/kAQ5jOIdomMCCRT3M7sL0NtyRy7e2zO20Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741275601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXIXTJ2wuQX6J+niJT4tGUc8ccw2yTPyAPJZLzfRZas=; b=sDEclcvf6S9P/zACbGuBaqk1F8qx0ufnjmCxqsuO/EIFujGIInrkrqAYkFVSRo4lRtyUUz RyguqLTu8PW4MQvYo3Aqw/EUqWyJrd/IPvN+1e5PNSHwBFVWwDVdyrFPlUQQfdt+lHBGg4 5atA2JlZhniRx6uASG+SYHa8/OE44Pa4KnVut8dxLUAOq+PyeX5vlUg6yLvpv5AhhVDQo/ TKzceYcsnuImRFSXggg/qa3ns93xSFSosp5WcPZbHMM7h0rhGxGEFXbCWxt3mhS6tjWxT2 e2j/SJ2aUEx5sXkvkIRhTIroAykPHfh17beUCIdNdc2aEp/WwSukdoOn/ouR4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7tsF5CsPzww6; Thu, 06 Mar 2025 15:40: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 526Fe1XO030786; Thu, 6 Mar 2025 15:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526Fe1ju030782; Thu, 6 Mar 2025 15:40:01 GMT (envelope-from git) Date: Thu, 6 Mar 2025 15:40:01 GMT Message-Id: <202503061540.526Fe1ju030782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 0bd3f757f9cf - stable/14 - pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0bd3f757f9cff089e07688f598d70531f5ee32e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0bd3f757f9cff089e07688f598d70531f5ee32e3 commit 0bd3f757f9cff089e07688f598d70531f5ee32e3 Author: Baptiste Daroussin AuthorDate: 2025-01-16 13:50:42 +0000 Commit: Baptiste Daroussin CommitDate: 2025-03-06 15:39:14 +0000 pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME Catchup with pkg(8) by expanding more variable when parsing repositories The only missing variable now is ARCH, this will have to wait for pkg 2.0 to be the lowest supported version. (cherry picked from commit e3b4a51580fcd4a1ddf0d61feb5f325ff1de5420) --- usr.sbin/pkg/config.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index e02da1461294..16f7598fc745 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -478,11 +478,26 @@ read_conf_file(const char *confpath, const char *requested_repo, struct ucl_parser *p; ucl_object_t *obj = NULL; const char *abi = pkg_get_myabi(); + char *major, *minor; + struct utsname uts; + + if (uname(&uts)) + err(EXIT_FAILURE, "uname"); if (abi == NULL) errx(EXIT_FAILURE, "Fail do determine ABI"); p = ucl_parser_new(0); + asprintf(&major, "%d", __FreeBSD_version/100000); + if (major == NULL) + err(EXIT_FAILURE, "asprintf"); + asprintf(&minor, "%d", (__FreeBSD_version / 1000) % 100); + if (minor == NULL) + err(EXIT_FAILURE, "asprintf"); ucl_parser_register_variable(p, "ABI", abi); + ucl_parser_register_variable(p, "OSNAME", uts.sysname); + ucl_parser_register_variable(p, "RELEASE", major); + ucl_parser_register_variable(p, "VERSION_MAJOR", major); + ucl_parser_register_variable(p, "VERSION_MINOR", minor); if (!ucl_parser_add_file(p, confpath)) { if (errno != ENOENT) @@ -506,6 +521,8 @@ read_conf_file(const char *confpath, const char *requested_repo, ucl_object_unref(obj); ucl_parser_free(p); + free(major); + free(minor); return (0); } From nobody Thu Mar 6 17:57:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7xvc0tx4z5pww7 for ; Thu, 06 Mar 2025 17:57: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 4Z7xvb4llTz3T2V; Thu, 06 Mar 2025 17:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741283835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AH0Xzth1PQiImcGj1ArLNOg66kpjbApDlZQXIW1WjQc=; b=BiRV6yDHrUJDy2IEog5qfPg+pYob1BA2lr5crM/BqpP/UhrS+hKmwobMEaFPMjF7grSuhN b97yPPcMYcdKsdrAQdGxovrdxMdWzf9jCnkiKsME0szFxDEc++Xf1Tzzb41RW5jLMmweN/ 5wrbDSjB3xt4eKHGbp5T0ZY8MeCdUDpUgoRKc4XubiHoFn0S+X9JHDebivI3YO/k2fmmRj eukJI//Ut0S+xYo7QsTqAXCl/4w0lrD6p/qmV5Xd/4qdEXn0UNr1MF850XYb7eoe6yHMmn Z4I6ekqdqeKHqINOB3eud4N3yHmpoOKfwHIJgT1rXkWDJsxxzn+/hZKLibEwcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741283835; a=rsa-sha256; cv=none; b=sboh+wwJwxR+JifqTE/o486bWBW3gdG/dDnBniFufDGf4Lhks3XKTsCzXqyRnskAMOrLzs rwjVa9qsiCFRNe6HCsOnLxB+V5e5pFkqYlHBpXyAGPPWIn7wui9tUJHdYWwhOHdZytgmMA swWLhgvgV90hpFNEd4MLIsNHgh24LfebN3OhGX6VgAl2OM8/rMWznkd7vic1iO7H2MhvCL YzXPvgPAdLGlTe6HXtBcOuL3AMeDk/TP6TLBI3tCk4OQSs1g6LJqglpZygTs9j3jxUZrfj n4MLrLsOi4Ra/3Ac1BRPxeg72E3VvdaO+9v9J2bhVEHBCt35lAc2gU8QHMlUpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741283835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AH0Xzth1PQiImcGj1ArLNOg66kpjbApDlZQXIW1WjQc=; b=RTVFHMGfXp1pHNakXsWZLJpCwXzD1lLNniJ3qBYpMvlCn5+e6pIeax+BtBZBqzQ0HJw/jq E3Qw4qqe7BTwC+eqj34h7vTLHZprimiBTbUONwVevlPLzEzEiKNAB/Rb9VVVLI+Hf0bD8V uBm9zkahA8nGr9kFh8TtoPhslPhwCPpoP4dmymZ09TTC5r9fS1/b4jlKXOQpAfbeq1tcFA KY772JGsQ7VbhcOtU3XGCgHhNvudRnVRRBAxog9UA7lQJ8f/omOtJB3ugTZCZjcjR67JTi b2TKPYVECer2yrkrMbn7GY3WnqFrGKepvHsRz+E7y2HN3OnNe0a7IjLhrSTmAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7xvb3qvjz11ds; Thu, 06 Mar 2025 17:57: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 526HvFQW089732; Thu, 6 Mar 2025 17:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526HvF1u089731; Thu, 6 Mar 2025 17:57:15 GMT (envelope-from git) Date: Thu, 6 Mar 2025 17:57:15 GMT Message-Id: <202503061757.526HvF1u089731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Enji Cooper Subject: git: 108164cf95d9..1c34280346af - vendor/openssl-3.0 - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openssl-3.0 X-Git-Reftype: branch X-Git-Commit: 1c34280346af8284acdc0eae39496811d37df25d X-Git-Oldrev: 108164cf95d9594884c2dcccba2691335e6f221b X-Git-Newrev: 1c34280346af8284acdc0eae39496811d37df25d Auto-Submitted: auto-generated The branch vendor/openssl-3.0 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/log/?id=108164cf95d9..1c34280346af 1c34280346af openssl: Import OpenSSL 3.0.16 From nobody Thu Mar 6 17:58:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7xx2349Kz5px72 for ; Thu, 06 Mar 2025 17:58: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 4Z7xx22ZbRz3T8V; Thu, 06 Mar 2025 17:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741283910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zxam5RoFs1nPAxle3/XFiSjla6iFChdQ7aRsbQwPa1A=; b=M2GMpg2yiK1CIqHBheQeigEhrTVT3DhEyzWDsqgQiDd0jZW0L/pWJXRKnnFnJ+4+AWkK0D 6j/6QZyAXjPJBCDQEjlRItWpCctwbM+DrrAEBLpRZVTGMYzxNWodMxP5gdftJ9LZEQrBTx PbAgHzDdFbiQyxM21GHSZ2UExV2ctPrmV0KJ8LnjG16e992LmOg0Z0EuY+n9WktLhbPRm+ PNkLMpCBagKcsSojsUgI+DUtanK3k85pr2m543dSM0jNtCUrcNwF20Y42kL6ycgzsji3vk XpggJTRZ4lxr46Vh/4FMS5a9opEJl9iwGGmjZsgt/pShr/NRtr3orTyvd3WYUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741283910; a=rsa-sha256; cv=none; b=sB+Jf3PEQvBOunUhansl7iOuQ3jQWjgUXTVr6GRLfx8elhUYggJXJi1RSVbVcfxOAISaBa zJmeu8/qNO2/ub5q3VjD/1coW13iiZP9bDoDDHrOPcsGSA9bD+Cc9Wk57L98+l3a6qKNLb T155I6l9lOcuk+RW8ohfZ5wO7i3jHGeFsbLKqk/BiFhF+rwD1fW+cuO6PPQpPArQb6D7Cb UH9WNUirXlERy1ZfexSE8Ee57asn/V4ewGW+o/7z13scEOJ+OMmljO4KIGU6JCqPBrpzn6 45HjZCIlqgw847am4xEbVGNvd8k5UTFQ6max19lW5fVzV/n6I6+qE2DgVXeqTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741283910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zxam5RoFs1nPAxle3/XFiSjla6iFChdQ7aRsbQwPa1A=; b=eOtE6Go1GDwo5TJhj6Db1M1naBicmy2TuG5c+/SKc605nEhFAkUdVIE2xTeZ9EEsl28dLw h9DWEC/dpvqurnxptISt4HybE/1qvUA6DraKudCA+s5+oe4t0V94Nrw9S3z770CrFZ/tEu snymttqlGFDSM89aPRiZIkoM1Gk1W4M2IHX+GeIBTIMWXoiqswkmv1YUoD2EmDlFj2CUgT vv8Kxxgh8teWq9UVO5bojfCaLHQEGbiZwJc6fMtqNYQ9aOzyrphPz1N69jtmJfIC645Op/ OsJ+ToBn+o2TInuOgBxO7zhA1DCdT+DbXH9IyGFEY1C4wSpTAPmU1cTYAxkmPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7xx2251dz11YL; Thu, 06 Mar 2025 17:58: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 526HwUq7090180; Thu, 6 Mar 2025 17:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526HwUgT090179; Thu, 6 Mar 2025 17:58:30 GMT (envelope-from git) Date: Thu, 6 Mar 2025 17:58:30 GMT Message-Id: <202503061758.526HwUgT090179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Enji Cooper Subject: git: 1ffa1554130e - Create tag vendor/openssl/3.0.16 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/tags/vendor/openssl/3.0.16 X-Git-Reftype: annotated tag X-Git-Commit: 1ffa1554130e273b922bf6f995a2bffc52ab69bc Auto-Submitted: auto-generated The annotated tag vendor/openssl/3.0.16 has been created by ngie: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssl/3.0.16 tag vendor/openssl/3.0.16 Tagger: Enji Cooper TaggerDate: 2025-03-06 17:58:23 +0000 Tag OpenSSL 3.0.16 commit 1c34280346af8284acdc0eae39496811d37df25d Author: Enji Cooper AuthorDate: 2025-03-06 17:49:50 +0000 Commit: Enji Cooper CommitDate: 2025-03-06 17:49:50 +0000 openssl: Import OpenSSL 3.0.16 This release incorporates the following bug fixes and mitigations: - [CVE-2024-13176](https://www.openssl.org/news/vulnerabilities.html#CVE-2024-13176 - [CVE-2024-9143](https://www.openssl.org/news/vulnerabilities.html#CVE-2024-9143) Release notes can be found at: https://openssl-library.org/news/openssl-3.0-notes/index.html From nobody Thu Mar 6 18:22:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z7yTH4524z5q1K0; Thu, 06 Mar 2025 18:22: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 4Z7yTH2wX8z3j9n; Thu, 06 Mar 2025 18:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741285379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LnuVpKVt5g395bu6mixkhI7VjmSxoZFfNxrATa+lqso=; b=H2p9Nvuykrfvrfafy7X7I8LCBGop0qQwxZl77mHQMSUgmZi7swicQVNUhofJrtW1Gi6doB EJpneNzlDhPXgKYUXlzQoowVvDnxbnUVL2tVmJi9k+I8PpYs2zOn+/h7xZyiryZS9ze3aC 2Y4u4e7O1DDicJlzPKa12SOprC9s2WIOwXZKRB639MO3jvx5GW59kZGyJyhATiPTWLkSX9 n2WEHognQSQ6FwAFHZjsNrIf/Ux3sY1ZrUI6do3TYZSVch4X79Qu5kL3xWumZc06ztLK51 PUskU0QXv0G3wQ+aBkN4eL89MqRlyk4frD4ZupLbE3aDW07dL1kxTZzpVeT/dA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741285379; a=rsa-sha256; cv=none; b=VFi3kZhWA/NjRDZNLUy6AfwyUR4h6SEirzPifbrzeztivZFbgKxTQi+wRVcCkx2uddiND0 38ZS+dwjjcMIeoxUFSe2Lt+vtPKYPBWnUyjOPbVkdgUAuSlWu7E+nWsxydBXcZPeQcMv06 oLmdn7xxSQnRfjgbPzcpFFZYvpv4kl/DaELfCwUiKIEZuaVHXR6kqmk3Zmc4CsUkD5E+fI 5Ur0O2XSbrclYsPRZFA2R4rcG+xySCw6ypqXFM15WWKdmjkhPT4jGJIfjU4lpBFMWiVtg6 PWVkkQV4SZX3PyK0Kg8G7Z+yapJD1OrjA6ME0CpjNtlP3GRoQpAKm93iIgqIHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741285379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LnuVpKVt5g395bu6mixkhI7VjmSxoZFfNxrATa+lqso=; b=q7nsIhnf4wGoHXov7WsX9cN3IITQ0mjJ5nfuI+06RgzaixEd6rR/rLTgJW7oFV3AiUq3tR pD4IRO6/7ncjGtrS+YP5ETSsC3VeoGRrR0I9hFdrHtPeUv5Kh7FD3fELg75NGIeX6fFO6t 7OJQMm+M5cHk4iDW6hbm3toTsSD/dlppTz+/Iabk73wBg8Gr4Hqmt0nr/nJXVslP47juH/ lnDOYser2CUHTIwc20EeAvw+Zyyt3DZ45EdUcDhVlIlugoLpdSEfo/5YnJPZa1Qo8JrbBh TacfdojPnMClP0AihfXOM/9orcblHUSR0RAgK/2rorkJuUNppPd8Apuguc769Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z7yTH2PJDz11xw; Thu, 06 Mar 2025 18:22: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 526IMxGF045511; Thu, 6 Mar 2025 18:22:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526IMxQT045508; Thu, 6 Mar 2025 18:22:59 GMT (envelope-from git) Date: Thu, 6 Mar 2025 18:22:59 GMT Message-Id: <202503061822.526IMxQT045508@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: ecb3a7d43dd6 - main - netmap: Disable a buggy and unsafe test (sync_kloop_conflict) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecb3a7d43dd67809037f9066e7716a05c41d8d63 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ecb3a7d43dd67809037f9066e7716a05c41d8d63 commit ecb3a7d43dd67809037f9066e7716a05c41d8d63 Author: John Baldwin AuthorDate: 2025-03-06 18:22:25 +0000 Commit: John Baldwin CommitDate: 2025-03-06 18:22:25 +0000 netmap: Disable a buggy and unsafe test (sync_kloop_conflict) This test starts two threads to verify that two concurrent threads cannot enter the kernel loop on the same netmap context. The test even has a comment about a potential race condition where the first thread enters the loop and is stopped before the second thread tries to enter the loop. It claims it is fixed by the use of a semaphore. Unfortunately, the semaphore doesn't close the race. In the CI setup for CHERI, we run the testsuite once a week against various architectures using single CPU QEMU instances. Across multiple recent runs of the plain "aarch64" test the job ran for an entire day before QEMU was killed by a timeout. The last messages logged were from this test: 734.881045 [1182] generic_netmap_attach Emulated adapter for tap3312 created (prev was NULL) 734.882340 [ 321] generic_netmap_register Emulated adapter for tap3312 activated 734.882675 [2224] netmap_csb_validate csb_init for kring tap3312 RX0: head 0, cur 0, hwcur 0, hwtail 0 734.883042 [2224] netmap_csb_validate csb_init for kring tap3312 TX0: head 0, cur 0, hwcur 0, hwtail 1023 734.915397 [ 820] netmap_sync_kloop kloop busy_wait 1, direct_tx 0, direct_rx 0, na_could_sleep 0 736.901945 [ 820] netmap_sync_kloop kloop busy_wait 1, direct_tx 0, direct_rx 0, na_could_sleep 0 From the timestamps, the synchronous kloop was entered twice 2 seconds apart. This corresponds to the 2 second timeout on the semaphore in the test. What appears to have happened is that th1 started and entered the kernel where it spun in an endless busy loop. This starves th2 so it _never_ runs. Once the semaphore times out, th1 is preempted to run the main thread which invokes the ioctl to stop the busy loop. th1 then exits the loop and returns to userland to exit. Only after this point does th2 actually run and execute the ioctl to enter the kernel. Since th1 has already exited, th2 doesn't error and enters its own happy spin loop. The main thread hangs forever in pthread_join, and the process is unkillable (the busy loop in the kernel doesn't check for any pending signals so kill -9 is ignored and ineffective). I don't see a way to fix this test, so I've just disabled it. There is no good way to ensurce concurrency on a single CPU system when one thread wants to sit in a spin loop. Someone should fix the netmap kloop to respond to kill -9 in which case kyua could perhaps at least timeout the individual test process and kill it. Reviewed by: vmaffione Obtained from: CheriBSD Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D49220 --- tests/sys/netmap/ctrl-api-test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/sys/netmap/ctrl-api-test.c b/tests/sys/netmap/ctrl-api-test.c index 8d33b4c58d2a..6b45dbb1cfea 100644 --- a/tests/sys/netmap/ctrl-api-test.c +++ b/tests/sys/netmap/ctrl-api-test.c @@ -1596,6 +1596,7 @@ sync_kloop_csb_enable(struct TestContext *ctx) return sync_kloop_start_stop(ctx); } +#if 0 static int sync_kloop_conflict(struct TestContext *ctx) { @@ -1640,6 +1641,14 @@ sync_kloop_conflict(struct TestContext *ctx) /* Wait for one of the two threads to fail to start the kloop, to * avoid a race condition where th1 starts the loop and stops, * and after that th2 starts the loop successfully. */ + /* + * XXX: This doesn't fully close the race. th2 might fail to + * start executing since th1 can enter the kernel and hog the + * CPU on a single-CPU system until the semaphore timeout + * awakens this thread and it calls sync_kloop_stop. Once th1 + * exits the kernel, th2 can finally run and will then loop + * forever in the ioctl handler. + */ clock_gettime(CLOCK_REALTIME, &to); to.tv_sec += 2; ret = sem_timedwait(&sem, &to); @@ -1674,6 +1683,7 @@ sync_kloop_conflict(struct TestContext *ctx) ? 0 : -1; } +#endif static int sync_kloop_eventfds_mismatch(struct TestContext *ctx) @@ -2079,7 +2089,9 @@ static struct mytest tests[] = { decltest(sync_kloop_eventfds_all_direct_rx), decltest(sync_kloop_nocsb), decltest(sync_kloop_csb_enable), +#if 0 decltest(sync_kloop_conflict), +#endif decltest(sync_kloop_eventfds_mismatch), decltest(null_port), decltest(null_port_all_zero), From nobody Thu Mar 6 19:32:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z801S68tlz5q4JV; Thu, 06 Mar 2025 19:32:28 +0000 (UTC) (envelope-from jhb@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 4Z801S1gQDz3YNt; Thu, 06 Mar 2025 19:32:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741289548; 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=0vw1L4Dlaxj0SIFeeuXTSEwgnvI/jSnbfTYbD7aGF9s=; b=rlqe3/BobvV1g4bEnC+7MA1wCNF/PFq0ZRP3wQD0mcTqeIbJiJY+Shfsg8abEVEVbSOvWK eapffdBCdOzOWbdXqJ/IxfNktuojt1zlwDWXgbxWnPaNIfY0LnZoGTxEEPRopX/XTQWpbx g/QMvSg3zHVkK2uoGDx0gprqM6P/nY1DeBQis/3dbAI9eNyU3imtsya+hPwbOvQu1/eLdE HnoaT0RJ+UX40cPv5ijXZlfS1bbWRUwN43BP5Che45ekRNHD318gRPG81hLsdY1z46gLzG WIwz4Qaq+hcJq7eL6FGMx2vNdc5jABfTmrcHsHgv/XKUQNy+Bil10Jlc/TSrZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741289548; a=rsa-sha256; cv=none; b=VDCaJ4Lf9ck7r5e9rVzP9sPVCIYfu9SuyrLGUnBGZobiA5BFOW6WC6lVUiRmgV7fmbIvRc DKokN5Iv3L1P9P7LcrYwnbPpGgs0WA4bkgdvy43CndMr64pTTrM7G8WcCr4m7v6gpdonfy /6ab3+JLqbUefzwtbhlm2rA+zLIgmdqhM7JQE23YtwUYEyRhDmZOCGWJ0nKd1iFtP1YMpk ubxLpJSl6AG1QeZvDQxKPdLgA/HgDJhxkBS6g6kEB4UDjbiMcPGvo7sWr93Ms4ZwcV5BEt IgGPwpurWYechCClCIJl238rePMc6RVhjAYjm4eO3sNj5UG4Glc1brqVEafePQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741289548; 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=0vw1L4Dlaxj0SIFeeuXTSEwgnvI/jSnbfTYbD7aGF9s=; b=qivLoFDM6mnIh/S+c8NvjKwrWxyXehvy5dPEVZD0d37opaMt5nKTmgydH1nUhsObh82HJr I2X5U1yAb1kUQ7rg/VJxvmiKi5WRhsXYTpo9O+97OUJQezKwlutsuJ4tZ3/sejk3or7OxB XB530qPO7Ud66XbMmyGIAw6OfMIMowYWTa3kCaxbEXjE5QbR5XzFCoF4CkBK8a2AOv095N Vi8tnjXAB+OuAt1oCeaIqBHsQhCkUss0yomPoZh4VNd0PNZTNRn2f95FwJpdTtbi4uNTao ZX/pD5pgfPa9fW/AJ7dXZ6rlYuLaE9IcnEBHmw+LabmEGfMqL8NrwlfzhfYshw== Received: from [IPV6:2601:5c0:4200:b830:ec45:8834:27fa:4893] (unknown [IPv6:2601:5c0:4200:b830:ec45:8834:27fa:4893]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z801R63dzz13pl; Thu, 06 Mar 2025 19:32:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <137702dd-6190-452f-be0d-9d04b779ce0a@FreeBSD.org> Date: Thu, 6 Mar 2025 14:32:27 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 234683726708 - main - devclass: make devclass_alloc_unit use M_NOWAIT Content-Language: en-US To: Warner Losh Cc: Mateusz Guzik , Zhenlei Huang , Mateusz Guzik , src-committers , dev-commits-src-all@freebsd.org, Warner Losh , dev-commits-src-main@freebsd.org References: <202503061103.526B32Id022652@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/6/25 09:56, Warner Losh wrote: > On Thu, Mar 6, 2025, 5:33 AM John Baldwin wrote: > >> On 3/6/25 06:35, Mateusz Guzik wrote: >>> On Thu, Mar 6, 2025 at 12:32 PM Zhenlei Huang wrote: >>>> >>>> >>>> >>>> On Mar 6, 2025, at 7:03 PM, Mateusz Guzik wrote: >>>> >>>> The branch main has been updated by mjg: >>>> >>>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=234683726708cf5212d672d676d30056d4133859 >>>> >>>> commit 234683726708cf5212d672d676d30056d4133859 >>>> Author: Mateusz Guzik >>>> AuthorDate: 2025-03-06 11:01:49 +0000 >>>> Commit: Mateusz Guzik >>>> CommitDate: 2025-03-06 11:01:49 +0000 >>>> >>>> devclass: make devclass_alloc_unit use M_NOWAIT >>>> >>>> The only caller already does this. >>>> >>>> The routine can be called with a mutex held making M_WAITOK illegal. >>>> >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") >>>> --- >>>> sys/kern/subr_bus.c | 8 ++++++-- >>>> 1 file changed, 6 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c >>>> index 9506e471705c..0422352bba51 100644 >>>> --- a/sys/kern/subr_bus.c >>>> +++ b/sys/kern/subr_bus.c >>>> @@ -1208,6 +1208,7 @@ devclass_get_sysctl_tree(devclass_t dc) >>>> static int >>>> devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) >>>> { >>>> + device_t *devices; >>>> const char *s; >>>> int unit = *unitp; >>>> >>>> @@ -1264,8 +1265,11 @@ devclass_alloc_unit(devclass_t dc, device_t dev, >> int *unitp) >>>> int newsize; >>>> >>>> newsize = unit + 1; >>>> - dc->devices = reallocf(dc->devices, >>>> - newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); >>>> + devices = reallocf(dc->devices, >>>> + newsize * sizeof(*dc->devices), M_BUS, M_NOWAIT); >>>> >>>> >>>> I'd recommend against this. From the commit message of f3d3c63442ff, >> Warner said, >>>>> In addition, transition to M_WAITOK since this is a sleepable context >>>> So, the M_WAITOK is intentional. >>>> >>>> Rather than reverting this, the caller devclass_add_device() should use >> M_WAITOK. >>>> >>> >>> Per my commit message this is callable from a *NOT* sleepable context. >>> >>> Here is a splat we got at Netgate: >>> >>> uma_zalloc_debug: zone "malloc-16" with the following non-sleepable >> locks held: >>> exclusive sleep mutex SD slot mtx (sdhci) r = 0 (0xd8dec028) locked @ >>> >> /var/jenkins/workspace/pfSense-Plus-snapshots-25_03-main/sources/FreeBSD-src-plus-RELENG_25_03/sys/dev/sdhci/sdhci.c:688 >>> stack backtrace: >>> #0 0xc0330ebc at witness_debugger+0x78 >>> #1 0xc033217c at witness_warn+0x428 >>> #2 0xc05b0a58 at uma_zalloc_debug+0x34 >>> #3 0xc05b067c at uma_zalloc_arg+0x30 >>> #4 0xc0291760 at malloc+0x8c >>> #5 0xc02920ec at reallocf+0x14 >>> #6 0xc02f8894 at devclass_add_device+0x1e8 >>> #7 0xc02f6c78 at make_device+0xe0 >>> #8 0xc02f6abc at device_add_child_ordered+0x30 >>> #9 0xc0156e0c at sdhci_card_task+0x238 >>> #10 0xc0324090 at taskqueue_run_locked+0x1b4 >>> #11 0xc0323ea0 at taskqueue_run+0x50 >>> #12 0xc0275f88 at ithread_loop+0x264 >> >> Just use a regular taskqueue like taskqueue_thread instead of >> taskqueue_swi? >> PCI hotplug defines its own thread taskqueue for adding and removing >> devices. >> >> The bug is here, IMO. Eventually new-bus will need some sort of topology >> lock and that will have to be an sx lock, so this code needs to change >> anyway. The sound code that tries to frob devices with a regular mutex >> also needs to change. >> > > I should dust off the branch that i have this one. There's about a dozen > places I had to change at the time... > > In terms of taskqueue_swi, it's probably something that needs to go away. >> Generally speaking, code uses tasks for functions that need to sleep, >> and taskqueue_swi breaks that. >> > > Its a holdover from spl days for sure. > > I will fix sdhci to use a proper taskqueue and then revert this commit. >> > > Thanks. You can add me to the review It turned into a series. I'll post for review in a bit. -- John Baldwin From nobody Thu Mar 6 22:28:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z83wH2P2nz5qFDF; Thu, 06 Mar 2025 22:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z83wH1v7Tz3DHV; Thu, 06 Mar 2025 22:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741300095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=INAVr3pqRWd8LzuF6W7BsQ03WbqVFKYoqfMZlmeg8uI=; b=U9ZuiTRCIpEkSTfQNCK8B7kN82+SGP2ioclWADQcOD4n3oMfBHA5EF21A9dv3xdQc4iu3G nAc13Ejff4g1Wu4xqvGiAxL9c3bHcZiV+lIMu9mAKQuwdM+KKGSCy6caVkv/ruu1Q6k1g8 k+ySpZCgzP/uBE8wPZCs9Saj+5UtIFuhFjm1EwmBq8dhfoxQxQZlD+iln+4qbSN/sZf8gb Ax1VXUnoBIWfIOymII3wRkS7P6pkyDWIgZhlySh4ERiT2kr3x2Wv5xSu4bWJ2EFLST3E/j ccymtLNBoSMzalr9Yq05Pryl2uh25sb+txJuv9gt+yIAfnAkLAOu2L3mRn/mvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741300095; a=rsa-sha256; cv=none; b=T19H4W2pGvAq6ShRN0XkUFYJYraqjuANZ0kKItrNnD8FdeDsnsksNDPspBxb3n2QmEUUBz AaswfYPjXSC34trwtIVjf150ehN/mZ8C6DrVQUR7pwInXUr3cF8Q5r0npIfeGhh4Hqk2UQ 76XDEETX0uMYtgjhWxrNCdqXviny5HLr12rEfpdLVfd8kua6Y2xTNhTz2TjWESfp6BiuoY JWF/E2MwEkCJSu4W2APT/9zutYY1+vFWoohw1txqe3RdS0527FY+o5LobDdLyA5AqMeK19 saeT9rsa7YsFtLW+cfOtmtlEO+KXSSvcZbG/dV98x/3Cy8W4Pg9+FsbOXz4Q8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741300095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=INAVr3pqRWd8LzuF6W7BsQ03WbqVFKYoqfMZlmeg8uI=; b=ukSgT0ZmYvm2NEOR9PrcOdUeugqq/5K9XN32kWnylI+h5OJ6Pwghj9ztZJAsho5NsHUcP3 lExinJnajni3k0e2OwqhI6UoXg4vI878wfzjV+39+iixbvmPRNVcnT7Yfj4UVCWeIiFWc4 phVaAcRI7fwmcAw7pcZtQvFbCEaKY4g7lTd12YuTa27O2q150m6szhifnC8pAKi46Z1cgu 55MfInY+hQV9vP74QPeOD95ysR7z6BcAOLR3h/2+HVSh6DYMHUqu0mojTS0/BoRYLeAw+M j+tgF6CTAOeasNBqj1R2AFpAS04AJVNPfxtzF+2pe1BQOzNjl1NeLECg83VXpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z83wH1QSyz18Cw; Thu, 06 Mar 2025 22:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 526MSFAA096272; Thu, 6 Mar 2025 22:28:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526MSFa3096269; Thu, 6 Mar 2025 22:28:15 GMT (envelope-from git) Date: Thu, 6 Mar 2025 22:28:15 GMT Message-Id: <202503062228.526MSFa3096269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 79838a8d7e4a - stable/14 - stf.4: Remove spurious word List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 79838a8d7e4a0ec48c3853a663123ee039384670 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=79838a8d7e4a0ec48c3853a663123ee039384670 commit 79838a8d7e4a0ec48c3853a663123ee039384670 Author: Matt Simerson AuthorDate: 2025-02-24 16:11:52 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-06 22:26:50 +0000 stf.4: Remove spurious word Improve grammar by removing spurious word. MFC after: 3 days Approved by: emaste, carlavilla (mentor) Pull Request: https://github.com/freebsd/freebsd-src/pull/1605 (cherry picked from commit 44c70602c8a6add87a234154d005b9c3ff3e4825) --- share/man/man4/stf.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/stf.4 b/share/man/man4/stf.4 index 2c0296b204d9..c93600c15e0a 100644 --- a/share/man/man4/stf.4 +++ b/share/man/man4/stf.4 @@ -201,7 +201,7 @@ The IPv4 WAN address. The prefix length of the IPv4 WAN address. .El .Pp -These can parameters are all configured through +These parameters are all configured through .Xr ifconfig 8 . .Pp The IPv6 address and prefix length can be configured like any other IPv6 address. From nobody Thu Mar 6 22:32:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z840g6LM7z5qF93; Thu, 06 Mar 2025 22:32: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 4Z840f51Fhz3Fxn; Thu, 06 Mar 2025 22:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741300322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=twsUOwe8bdMwNAEV4F3FAa8v8IOYkJnvarztqFwRfP0=; b=wsWmEJDxhsiRn6XMnVTYK2xEfo8RqOg0YrLDdbP28PamaR5mrY3unsLTeIWgkTAbN+BByG ja5hFSHuzGFP7L690BA/im7YS1YFyLGK2cIlhjsYGnu1pQNVD5bRPKuGUyB8gsOWC6l1za +MseoBAEQinLaZG+XN/tDMWc9bQZzSEUoBciDWnELWomGqklcM0kpB7+xDF7w+JmBwsaFY zsMmwk5NgzilqFRWSLUgPSBG6cD7EuPlGCU3FW0g1E1h4Y/eDG64JsB5RSyDAICSnHOzJg RjaCiuk3dbUP7aZL4VkrZ01GXrkG3q2DqGBMPYFCI18/1NpmnZLm2CkykKRPCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741300322; a=rsa-sha256; cv=none; b=kXkGGPRvQiABMguS5zJeqaZCoyHC456cmf1WJxKoK3ltqw30R6cRLGl1dyt/bF1HyYYdYA ZZfLnc4WtMVrrN8+yax4bDT1WFM5tE725P7cYDqtFw8ELP87t6abBGKOapa2fXmLd2zfac dZav8zbjADG/0QnJtf8CQ2DmmLj33yNYpFoMDd1B4IeTwfZaly1VvVghhvIbm6PsCNwwWN 6/5dfOz2WPS+qPG0UpZbd0MtcAwmI5KHWf3YwryRwsyIxO8mQvq5AdIFUq2zHm39+DYeOP VwYMghVVrZSrPzG2STF3LTVwb+b6dJcuR8uQpazJoMUzMOuLsXTTIXzwi796lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741300322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=twsUOwe8bdMwNAEV4F3FAa8v8IOYkJnvarztqFwRfP0=; b=B2HnGkanqcdLciGJAVQjq8dFpbCGKaZl5ISU4qYKUmb9MQVK7uLAwYqu+gu0GY5LsQ6qxA rpTHEuYA7AqKLCeTh4xfkozDwphV2GaTL0yCBk/5GsJXJ/cw7OyUQ42UIsVJ76i+pIjYDH wVSvmlQ5SuxpDCLo3ec4yS7HfnCcSOoBPoQfUfFT7JTlciQfaqqs/tYxivZEJYzs7KDS4h 3uQOhs7oJTnq02qIWwVxIXnTRT9i5RHRTaBORV23jJCnb2CNFuT7HKjvwPUeYDgAlMK6fi 2XmFx+C6599k+XO0HbkdxUSeq/404bNQ8byG8Eo8BkH+MZkc9hx0SYaFM0NDzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z840f4cQwz18B3; Thu, 06 Mar 2025 22:32: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 526MW2sK010447; Thu, 6 Mar 2025 22:32:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526MW2Pu010444; Thu, 6 Mar 2025 22:32:02 GMT (envelope-from git) Date: Thu, 6 Mar 2025 22:32:02 GMT Message-Id: <202503062232.526MW2Pu010444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 0ba8e7f6064f - stable/14 - ports.7/history: Don't forget macOS! List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0ba8e7f6064ffdf5fd9aa1ee8efabaee93ac0e2f Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=0ba8e7f6064ffdf5fd9aa1ee8efabaee93ac0e2f commit 0ba8e7f6064ffdf5fd9aa1ee8efabaee93ac0e2f Author: Alexander Ziaee AuthorDate: 2025-03-03 14:50:53 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-06 22:31:45 +0000 ports.7/history: Don't forget macOS! Jordan Hubbard, one of the original authors of the FreeBSD Ports Collection, later went on to create MacPorts, an evolution of the idea written in TCL instead of Makefiles. Further, NetBSD's pkgsrc is available natively on macOS. In either case, the idea of ports which originated here spread to macOS. Note that in the HISTORY section. MFC after: 3 days Reviewed by: carlavilla,Jessica Hawkwell on Community Discord Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D49205 (cherry picked from commit 8a2c189e893811a44b30696a1af9b5c7800ab60b) --- share/man/man7/ports.7 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7 index 911135a8b631..e25da8ebe567 100644 --- a/share/man/man7/ports.7 +++ b/share/man/man7/ports.7 @@ -744,9 +744,9 @@ The Ports Collection appeared in .Fx 1.0 . It has since spread to -.Nx -and -.Ox . +.Nx , +.Ox , +and macOS. .Sh AUTHORS .An -nosplit This manual page was originated by From nobody Thu Mar 6 23:10:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z84ry0myTz5qHTL; Thu, 06 Mar 2025 23:10: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 4Z84ry007Tz3bXm; Thu, 06 Mar 2025 23:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741302626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=POVNH8c8AlTU5w408ENgc1DyehI4nU0PGJW6OvNj9iw=; b=aOueuZ8gyqmcqo+MWWZgEiLJe0GYWyQrTiRXvsA3Y26MRgXwc6GioWRVuZp5TQgtu4YMjb NDBkVApBtldg9+shYShQ/5W6Umd/vCMOsfw6pxWSWl8lOtTV2GCmvvXbVpsKCvqaf8kU+V aNDPYMSEv3yLp8Izzw9NhSsL2Se6Gn7bES5BcfsrvmrlxbmTt5Zo/wQmyAaBw2TitTQqjJ YpTBD7A4oom7wJ5kPBIBJrMAAoAj2GkWqU6vNhXxntH1TjpOdxa9w8UWJks0a9oz/N/g6X anxK2j2tqXpJBpcdOyw1BC/0WeQ422VUuATrSCyCCID/Lb8Eaa17FxcqttOZFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741302626; a=rsa-sha256; cv=none; b=GD1ZUR7tasnR2azLmVdCDY7c1jmgZVJWD+68a2RIfzu168idkIus8A+frieQ5hrVHbohhP Upkxn+7gCA8UwFycK7pqRZyGHXANHHcGLmaQItnO0iLbrrm83YiQotftVJ867Jt76N/Tww p9mWVY6dKlt0xJD9GRfYKwgvocxoSOBL8l0WZj8qek2KJG1gzRdIqcbWBvmTQvVu2GcWCr WfHdlaWk2KEYVOneQBDj9FHwxldsMjP0lG3qa7BX+f4hM4cl1jalCGluemRBMfJThkwwzb 0rz0oI+GUg/3VlOj8SDSlWvfFO0UEkN4dvaP75uRRVD0ya8IcPAykKOrDPOy1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741302626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=POVNH8c8AlTU5w408ENgc1DyehI4nU0PGJW6OvNj9iw=; b=DRAOUgyhZ5pH1XQqkOQuepCRLldHchtKYyMK95NbylINUqq73TiZUuvUdFtC5DuxBvjs7d ZX/HxaKOy6u3b5bWxojdZ/CaFa0kDi/wRA7trc767RwwyQZTc/ndiZDpI1jR464l17BZKy KLL+UtlSwXgmD80mo6Ap+SGhO7Ie//rWDTPctZyP+4R8VXuJGs6vMpAkpIOEYW7HZm74Pz db+WBDS5ePUKkjGJuLGJvcST5qUrLPk7VwpPyyOzTBCcR+pBt6YIGjGS1Ei5NJTlQISL7j iZuC0o7RBs7NYC7XFJOXhF9ti1uYnFbXbKgrXPaOtertZxavO6JmMY7iFY7jKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z84rx6Hfzz19Bh; Thu, 06 Mar 2025 23:10: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 526NAPWJ080590; Thu, 6 Mar 2025 23:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526NAPS9080587; Thu, 6 Mar 2025 23:10:25 GMT (envelope-from git) Date: Thu, 6 Mar 2025 23:10:25 GMT Message-Id: <202503062310.526NAPS9080587@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: b8dfc3ecf703 - main - LinuxKPI: 802.11: improve key update locking to work around net80211 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8dfc3ecf7031a0a7764cdb67d85ebe0c03d5d93 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b8dfc3ecf7031a0a7764cdb67d85ebe0c03d5d93 commit b8dfc3ecf7031a0a7764cdb67d85ebe0c03d5d93 Author: Bjoern A. Zeeb AuthorDate: 2025-03-06 13:17:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-03-06 23:02:08 +0000 LinuxKPI: 802.11: improve key update locking to work around net80211 As indicated in 11db70b6057e there was another panic on key removal which could no longer be reproduced. As originally assumed the problem was "hidden" by commit 9763fec11b83 as mentioned in 11db70b6057e. Said commit had logic inverted and 27bf5c405bf2 fixed that and with that the possible panic came back. The problem exists because some code paths out of net80211 are locked while others are not. This opens a possible race in net80211 which was tracked by extra logging in (*iv_key_update_begin)() (log lines shortend): key_update_begin: tid 100112 vap X nt Y unlocked key_update_begin: tid 100133 vap X nt Y locked One thread can be wpa_supplicant, the other is driven from the driver net80211 taskq. Further LinuxKPI needs to unlock (conditionally in case the lock is held) as a downcall to the driver/FW may sleep. This opens up possibilities for said race even further so that we observe it more reliably. This all leads to one thread calling down into the driver/firmware (unlocked) while the other will get to the same place (after acquiring the wiphy lock) before the nt re-lock happens and thus state checks did not catch this either. For LinuxKPI work around the problem utilizing (*iv_key_update_begin/end)() and taking the wiphy_lock() there holding it over the entire operation. Given we still have to conditionally unlock we need to keep track from _begin to _end on whether we have to re-lock. The checks for this need to be done under the wiphy_lock(). While a bool would suffice we use a refcount to make any future debugging easier. This isn't the most elegant solution but having the wiphy lock covering the full operation allows the 2nd thread to later run through the same code path and find the key gone (which we already checked). It remains questionable if (*iv_key_update_begin/end)() is the correct solution (as there are futher callers covering which would not need the unlock cycle) or if it should be done in the current code. The former will allow us to cover a full key store which we will need in case we will implement suspend/resume beyond what is done in native drivers/net80211 currently, if we will factor out the crypto locking for good, and fix the inconsistent locking of the nt (NODE) lock in net80211. Alternate solutions were discussed on freebsd-wireless today (2025-03-06, in the thread "Re: HEADS UP! Do not update on main currently (panic - on boot)"). Sponsored by: The FreeBSD Foundation MFC after: 3 days X-MFC with: 27bf5c405bf2 Differential Revision: https://reviews.freebsd.org/D49256 --- sys/compat/linuxkpi/common/src/linux_80211.c | 99 +++++++++++++++++++++++----- sys/compat/linuxkpi/common/src/linux_80211.h | 2 + 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index be0006769e33..ec1798d2e886 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1135,9 +1135,7 @@ _lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) struct ieee80211_sta *sta; struct ieee80211_node *ni; struct ieee80211_key_conf *kc; - struct ieee80211_node_table *nt; int error; - bool islocked; ic = vap->iv_ic; lhw = ic->ic_softc; @@ -1172,13 +1170,6 @@ _lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) return (1); } - /* This is inconsistent net80211 locking to be fixed one day. */ - nt = &ic->ic_sta; - islocked = IEEE80211_NODE_IS_LOCKED(nt); - if (islocked) - IEEE80211_NODE_UNLOCK(nt); - - wiphy_lock(hw->wiphy); kc = lsta->kc[k->wk_keyix]; /* Re-check under lock. */ if (kc == NULL) { @@ -1210,9 +1201,6 @@ _lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) free(kc, M_LKPI80211); error = 1; out: - wiphy_unlock(hw->wiphy); - if (islocked) - IEEE80211_NODE_LOCK(nt); ieee80211_free_node(ni); return (error); } @@ -1262,7 +1250,6 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) } sta = LSTA_TO_STA(lsta); - wiphy_lock(hw->wiphy); if (lsta->kc[k->wk_keyix] != NULL) { IMPROVE("Still in firmware? Del first. Can we assert this cannot happen?"); ic_printf(ic, "%s: sta %6D found with key information\n", @@ -1283,7 +1270,6 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) ic_printf(ic, "%s: CIPHER SUITE %#x (%s) not supported\n", __func__, lcipher, lkpi_cipher_suite_to_name(lcipher)); IMPROVE(); - wiphy_unlock(hw->wiphy); ieee80211_free_node(ni); return (0); } @@ -1324,7 +1310,6 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) __func__, SET_KEY, "SET", sta->addr, ":", error); lsta->kc[k->wk_keyix] = NULL; free(kc, M_LKPI80211); - wiphy_unlock(hw->wiphy); ieee80211_free_node(ni); return (0); } @@ -1337,7 +1322,6 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) kc, kc->keyidx, kc->hw_key_idx, kc->flags); #endif - wiphy_unlock(hw->wiphy); ieee80211_free_node(ni); return (1); } @@ -1348,6 +1332,86 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) return (_lkpi_iv_key_set(vap, k)); } + +static void +lkpi_iv_key_update_begin(struct ieee80211vap *vap) +{ + struct ieee80211_node_table *nt; + struct ieee80211com *ic; + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct lkpi_vif *lvif; + bool islocked; + + ic = vap->iv_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + lvif = VAP_TO_LVIF(vap); + nt = &ic->ic_sta; + + islocked = IEEE80211_NODE_IS_LOCKED(nt); + +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(vap->iv_ic, "%s: tid %d vap %p nt %p %slocked " + "lvif nt_unlocked %d\n", __func__, curthread->td_tid, + vap, nt, islocked ? "" : "un", lvif->nt_unlocked); +#endif + + /* This is inconsistent net80211 locking to be fixed one day. */ + if (islocked) + IEEE80211_NODE_UNLOCK(nt); + + wiphy_lock(hw->wiphy); + + /* + * nt_unlocked could be a bool given we are under the lock and there + * must only be a single thread. + * In case anything in the future disturbs the order the refcnt will + * help us catching problems a lot easier. + */ + if (islocked) + refcount_acquire(&lvif->nt_unlocked); +} + +static void +lkpi_iv_key_update_end(struct ieee80211vap *vap) +{ + struct ieee80211_node_table *nt; + struct ieee80211com *ic; + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct lkpi_vif *lvif; + bool islocked; + + ic = vap->iv_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + lvif = VAP_TO_LVIF(vap); + nt = &ic->ic_sta; + + islocked = IEEE80211_NODE_IS_LOCKED(nt); + MPASS(!islocked); + +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(vap->iv_ic, "%s: tid %d vap %p nt %p %slocked " + "lvif nt_unlocked %d\n", __func__, curthread->td_tid, + vap, nt, islocked ? "" : "un", lvif->nt_unlocked); +#endif + + /* + * Check under lock; see comment in lkpi_iv_key_update_begin(). + * In case the refcnt gets out of sync locking in net80211 will + * quickly barf as well (trying to unlock a lock not held). + */ + islocked = refcount_release_if_last(&lvif->nt_unlocked); + wiphy_unlock(hw->wiphy); + + /* This is inconsistent net80211 locking to be fixed one day. */ + if (islocked) + IEEE80211_NODE_LOCK(nt); +} #endif static u_int @@ -3413,6 +3477,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], mtx_init(&lvif->mtx, "lvif", NULL, MTX_DEF); INIT_LIST_HEAD(&lvif->lsta_list); lvif->lvif_bss = NULL; + refcount_init(&lvif->nt_unlocked, 0); lvif->lvif_bss_synched = false; vap = LVIF_TO_VAP(lvif); @@ -3545,6 +3610,8 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], if (lkpi_hwcrypto && lhw->ops->set_key != NULL) { vap->iv_key_set = lkpi_iv_key_set; vap->iv_key_delete = lkpi_iv_key_delete; + vap->iv_key_update_begin = lkpi_iv_key_update_begin; + vap->iv_key_update_end = lkpi_iv_key_update_end; } #endif diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index b17e6072066c..c2d29b2dcc4b 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -186,6 +186,8 @@ struct lkpi_vif { struct list_head lsta_list; struct lkpi_sta *lvif_bss; + + int nt_unlocked; /* Count of nt unlocks pending (*mo_set_key) */ bool lvif_bss_synched; bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */ From nobody Thu Mar 6 23:47:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z85gs33cRz5qKKB for ; Thu, 06 Mar 2025 23:47:37 +0000 (UTC) (envelope-from adziaee@runbox.com) Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [IPv6:2a0c:5a00:149::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z85gr3m67z3wMD; Thu, 06 Mar 2025 23:47:36 +0000 (UTC) (envelope-from adziaee@runbox.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=runbox.com header.s=selector1 header.b=TW+YebdQ; dmarc=pass (policy=quarantine) header.from=runbox.com; spf=pass (mx1.freebsd.org: domain of adziaee@runbox.com designates 2a0c:5a00:149::25 as permitted sender) smtp.mailfrom=adziaee@runbox.com Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1tqKw8-001tYX-8n; Fri, 07 Mar 2025 00:47:32 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector1; h=Message-Id:In-Reply-To:Date:Subject:CC:To:From:MIME-Version: Content-Transfer-Encoding:Content-Type; bh=g2KtfiruVobUA0jmzRgRjGvg2bEFuydMNG3nCPwbSZU=; b=TW+YebdQeen8zBhQ3km5n2cbJr ac86gXmKTqz37CwMuyACTRP9/knd/5raen3eu4ro5sJbUgFHwRbkoYq3KsojfGkk3tnxLGDIfJSL6 X9B0WgkodrPqfvphaWUFiRCUbIsdQoEj1kHmtcsP0K+htKxKpiqKyal2GjYgm4WVApxxaem+g09g3 aHjGcSOVyy94yrPxuF4m9RUoNI13TshY/jM9NBQtiPY3/ssZQwh+pxrQLk8YWE1CX4LjNlOTiAQwK 7xMfwCyu/eBuym90SZcOlJPXzxkakBtCmJuTxcw4ymLcPX0DsjXtxsz2naXZCaPY6YxMFWWTZb1L9 qGAM0BMw==; Received: from [10.9.9.127] (helo=rmmprod05.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1tqKw7-0008U5-Du; Fri, 07 Mar 2025 00:47:31 +0100 Received: from mail by rmmprod05.runbox with local (Exim 4.86_2) (envelope-from ) id 1tqKw7-0006H0-Ae; Fri, 07 Mar 2025 00:47:31 +0100 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Received: from [Authenticated alias (1070552)] by runbox.com with http (RMM6); Thu, 06 Mar 2025 23:47:31 GMT From: "Alexander Ziaee" To: "Warner Losh" , "John Baldwin" CC: "Bjoern A. Zeeb" , "Herbert J. Skuhra" , "Alexander Ziaee" , "Adrian Chadd" , "src-committers" , "dev-commits-src-all" , "dev-commits-src-main" , "Christos Margiolis" Subject: Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency Date: Thu, 06 Mar 2025 23:47:31 +0000 (UTC) X-RMM-Aliasid: 1070552 X-Mailer: RMM6 In-Reply-To: Message-Id: X-Spamd-Result: default: False [-4.20 / 15.00]; DWL_DNSWL_LOW(-1.00)[runbox.com:dkim]; NEURAL_HAM_LONG(-0.98)[-0.977]; NEURAL_HAM_MEDIUM(-0.94)[-0.943]; DMARC_POLICY_ALLOW(-0.50)[runbox.com,quarantine]; R_DKIM_ALLOW(-0.20)[runbox.com:s=selector1]; R_SPF_ALLOW(-0.20)[+ip6:2a0c:5a00:149::25:c]; NEURAL_HAM_SHORT(-0.17)[-0.175]; RCVD_IN_DNSWL_LOW(-0.10)[2a0c:5a00:149::25:from]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[runbox.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[runbox.com]; ASN(0.00)[asn:50304, ipnet:2a0c:5a00::/29, country:NO]; RCPT_COUNT_SEVEN(0.00)[10]; RCVD_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[runbox.com:+] X-Rspamd-Queue-Id: 4Z85gr3m67z3wMD X-Spamd-Bar: ---- On 2025-03-04 12:07 -05:00 EST, "Warner Losh" wrote: > On Tue, Mar 4, 2025 at 8:23=E2=80=AFAM John Baldwin wro= te: >=20 >> On 3/4/25 09:25, Bjoern A. Zeeb wrote: >> > On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: >> > >> >> On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: >> >>> >> >>> The branch main has been updated by ziaee: >> >>> >> >>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3D4262dbc57982383eb61a8b7806de6d= d4b7802da8 >> >>> >> >>> commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 >> >>> Author: Alexander Ziaee >> >>> AuthorDate: 2025-02-19 15:54:27 +0000 >> >>> Commit: Alexander Ziaee >> >>> CommitDate: 2025-02-27 22:20:22 +0000 >> >>> >> >>> wifi manuals: Mlink + document description consistency >> >>> >> >>> Interfaces all have an mlink to if_$foo. Add these for the >> missing ones >> >>> and remove an incorrect one from rtwn_pci. Wireless network >> drivers are >> >>> all accessible via `apropos -s4 "wireless network driver", exce= pt >> two >> >>> which are "wireless network device". I actually prefer the >> latter, but >> >>> make them all consistent upon the more common parlance. Tag SPDX >> on one >> >>> of the files I touched, while here. >> >>> >> >>> MFC after: 3 days >> >>> Reviewed by: bz, carlavilla, mhorne >> >>> Approved by: carlavilla, mhorne (mentors) >> >>> Differential Revision: https://reviews.freebsd.org/D49063 >> >>> --- >> >>> share/man/man4/Makefile | 4 +++- >> >>> share/man/man4/uath.4 | 4 +++- >> >>> share/man/man4/upgt.4 | 2 +- >> >>> 3 files changed, 7 insertions(+), 3 deletions(-) >> >>> >> >>> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile >> >>> index 13afc9b8d399..8e0af19eec3d 100644 >> >>> --- a/share/man/man4/Makefile >> >>> +++ b/share/man/man4/Makefile >> >>> @@ -764,7 +764,9 @@ MLINKS+=3Dptnet.4 if_ptnet.4 >> >>> MLINKS+=3Dral.4 if_ral.4 >> >>> MLINKS+=3Dre.4 if_re.4 >> >>> MLINKS+=3Drl.4 if_rl.4 >> >>> -MLINKS+=3Drtwn_pci.4 if_rtwn_pci.4 >> >>> +MLINKS+=3Drtw88.4 if_rtw89.4 >> >>> +MLINKS+=3Drtw89.4 if_rtw89.4 >> >>> +MLINKS+=3Drtwn.4 if_rtwn.4 >> >> ^^^^^^^^^ >> >> $ grep if_rtwn.4 ObsoleteFiles.inc >> >> OLD_FILES+=3Dusr/share/man/man4/if_rtwn.4.gz >> > >> > In fact that is probably correct but things are confusing. >> > >> > The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those >> > should have the man page and links (so contrary to what was done). >> > rtwn.ko is just the common code if I am not mistaken (Adrian should kn= ow >> > better). >> > >> > But everyone is just referring to the driver as rtwn and I fear if the= re >> > is no man page to be found as man rtwn / man if_rtwn people will be >> > confused. >> > >> > I wanted to do the same with rtw88 but was told to keep it all together >> > as one so rtwn is an excemption. >> > >> > That all said, yes, it needs a further cleanup. >> >> The manpages should just be rtwn/if_rtwn. The bus attachment doesn't >> matter. >> We don't have separate manpages when a storage adapter has been supported >> on both PCI and ISA in the past, you just had the ahc(4) driver (for >> example). >> USB vs PCI is the same. It should just be a single manpage for the driv= er >> regardless of the attachment. If the driver has separate modules that c= an >> be documented in the one manpage, but the list of supported chipsets, et= c. >> is presumably shared hence the shared driver name and common code. In >> particular, the thing a user sees in dmesg is 'rtwn0', not 'rtwn_pci0' so >> the manpage needs to be tied to what a user sees as a device name in dme= sg. >> >=20 > Yea, the man page should mention the detail that we have separate .ko's, = but > otherwise I agree with John here. IIUC, all interfaces should be documented as $foo with an mlink (but no add= itional name macro) to if_$foo. I've also been pushing for sound to become represen= ted the same way for consistency, which christos said (paraphrased) no objectio= n.= From nobody Fri Mar 7 00:00:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z85yC74lSz5qKxr; Fri, 07 Mar 2025 00:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z85yC6KgHz45XC; Fri, 07 Mar 2025 00:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741305603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2QrX3iWSwInKv+QCBvIyhy1VH9/kVnOlHr9gMboEMzQ=; b=GnY6/wphJA+1+7m7Ytb0RYckHi0nUADvYUnhbU184X26PpkG0GZx6/7FYZaVl6GjMBgHYT IdOof1Seq/oZb0HLmHUcCGlcKzhYj1Zs8LMCjT9fryiTboECgj9R+n0jqDert8UdDwyusR IEmYcidTUm8CSfqtg0fC2IzJ8Js7wh3AoyptyxVBV2DmMAY0BkNtnzuGXLzjoUfBNNqQ3L hPVh4txMpegQXsmxXiAciUD283PKCMtabePnk8OnQ7iNFVHzPqCVnHwbLG64TBxzyOWfyD fRKqndgaujMwpljWwZPMn/snhKv9T96kcyBT8PWJ+gWRc3XwJm/CFGHzZHpsZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741305603; a=rsa-sha256; cv=none; b=hDQcc274BLIppYTqveUgU2Ialhc6usLIB527Ua7UVSx/Cg8mUqvbSvjLgdCIAeDQYLmik+ teuLOy475Bgsj5pWNmF3KSIYt2VXOkwxqCStwfOXovDx9zS7Pt+6yXY4Fl/9zPqov4avle F6tku+6pmHDGrCUDmMc7pDQYuxWp1aJ90kiYpqSwyqIhXIDypV3hjQVZOnUm7w7oix+eDC b91t7AblobTVw84t4DvJ+aqXqNXHWs6mBYlYnnVDp54v76q73duM0RJnsOnxd7xFMttffY vtY7zvWqq48Ti5aJ2/lDfAQbWr1ZmQPV+Hqr0jszIEZ7q00KcpiWCcFV1tDGCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741305603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2QrX3iWSwInKv+QCBvIyhy1VH9/kVnOlHr9gMboEMzQ=; b=ZGOY58PF9hg9J2sKplIWy89POA/AkBKX0e2fzYNFRUyJ3jr104URccdw8fahH7Qg9BXrYG ND37b/+HAeps11XkUysBKx90aVsHTNroOp/R3jWCloKWym6IzZrPmcDI/z6xKX5s4N8hsZ DL1mNaTdVpxb0vubRiUoJpi/ZIoxUw0hkInpsYWbEyHzHDleCrTexL2LI6N0oGe/rbKcRW t3mCsqLRSJFvpoCSmypsUWiyFc2n45l67sfj3ybyvjsvZCIV6YmdoOeTQ7tAKZi7Wjdw8T YPrGWtfuvj2QaBZ/eHowQzVcj1OROquQ44OPQJrm5i2Xc4MWvgpBJTk3V21eTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z85yC5h5Yz1Bx2; Fri, 07 Mar 2025 00:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 527003jU067057; Fri, 7 Mar 2025 00:00:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527003jo067052; Fri, 7 Mar 2025 00:00:03 GMT (envelope-from git) Date: Fri, 7 Mar 2025 00:00:03 GMT Message-Id: <202503070000.527003jo067052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 882b9f3f2218 - releng/13.5 - Update in preparation for 13.5-RELEASE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 882b9f3f2218b50fc1d2d31ee71b7765c7f09f85 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=882b9f3f2218b50fc1d2d31ee71b7765c7f09f85 commit 882b9f3f2218b50fc1d2d31ee71b7765c7f09f85 Author: Colin Percival AuthorDate: 2025-03-07 00:00:00 +0000 Commit: Colin Percival CommitDate: 2025-03-07 00:00:00 +0000 Update in preparation for 13.5-RELEASE - Bump BRANCH to RELEASE - Add the anticipated RELEASE announcement date - Set a static __FreeBSD_version Approved by: re (implicit) Sponsored by: Amazon --- UPDATING | 3 +++ lib/csu/common/crtbrand.S | 2 +- sys/conf/newvers.sh | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index a40ddb1d3670..a3a7aeef51a9 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,9 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250311: + 13.5-RELEASE. + 20250117: The layout of NFS file handles for the cd9660 and ext2fs file systems has changed. An NFS server that exports any of these file systems will diff --git a/lib/csu/common/crtbrand.S b/lib/csu/common/crtbrand.S index 0ed86bfba2b2..3a78081f1bde 100644 --- a/lib/csu/common/crtbrand.S +++ b/lib/csu/common/crtbrand.S @@ -43,7 +43,7 @@ .4byte NT_FREEBSD_ABI_TAG 1: .asciz NOTE_FREEBSD_VENDOR 2: .p2align 2 -3: .4byte __FreeBSD_version +3: .4byte 1305000 4: .section .note.GNU-stack,"",%progbits diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 7d74035f3adf..6273ec61f520 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="RC1" +BRANCH="RELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Mar 7 00:00:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z85yJ5MQdz5qKxs; Fri, 07 Mar 2025 00:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z85yH5n52z45XL; Fri, 07 Mar 2025 00:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741305607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3C/r4k5dxm48TU2fL8ga4WGWxRHcWGublUM4liMm7U=; b=uBVduzmxuTZ6zOybuZdfwi2RqvguPHWDk6IQvkNVP2sdvonYadUuvBQq+oLWmJZ9fB6av7 r0eRDZf2eIKxsLyRlT4PkUW5zp2wJfpSdxjFh62C/Zm64jimBqU4PeEI8Oez1v2BtdSRee Vi9N5engZ/IEqt5x9caDMXuD6GmsmmKVeCzAd0Twv9auinT2al/fbNrfrqC/nNSXnYWPek oO37QrowWuiNi7CA6zG2A1/Mx7OUSzSLI4qKGrzDqUCMFOJMnf04QS/HwedR3vGUpFLg7S /VS/VOjcS9gcJ8Vlc97Gs0zaAYrx/5/7FxGtiafk/mh75U+r2gIT9b2z9JlShQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741305607; a=rsa-sha256; cv=none; b=LhfLpymhBR5tn4d0fD6vcomLb3drW6+Tf8tct0LQ0e2hc2aufKHG2M7xV5SzTEH8KI8hsS uSxNXT8g3yY6tMCQhZhZM8ZFBh0NlygXqU5lZA6bLQCJZjKBbt6Htrylqwct7pgBqlCW3N mwrPephBgRGULbzbL6UiUNAX1XP7j6P8XeiwR2yMgfoKCAcAts8VgyXJ34G0yJ3casTd5L a2hSaXjv5CKokPUYjx5xMwaZTCEz9dY4HojP8DtWPn//v1KgEuK9qKnVgl4SByiXuO1Gzv CRK1ox4nZzn+WLKsP5SWsSuS2UzjjyBm0VhOnHq8BTUUiE+P82I8O7ep580+HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741305607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3C/r4k5dxm48TU2fL8ga4WGWxRHcWGublUM4liMm7U=; b=XBd78zuHjaFOHYMmS8JYT7LPk4shhdqcJUvBbRgh2kzpm8XUgFnGlHhgPcMCpKmJhQ6buv QsHmD2+3jT1BCkBtevg9E4WRxzhlKyEcwsx1v1l1STLuoO2EtBFOY+zz8/niElxNbabdNE tN5NwouW3PrTd0Zb2kCafKWqk6R5P6gNhQ68beenmSwxyfPtVubfe3eVyOWGWGf+uS2ftS JLbOski36y8sAhFJ3iLNfS7mHAgGSD1K5ivD4x5GZ2zIaxjoq+JbRkNvu6uWtOyc4MckTW dex6dCG9IxERNbNUVUPIjrc0q3fc2TRFBDSotTxjfoPbNMXe2FC9RbTYxbwlvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z85yH4sd7z1C0N; Fri, 07 Mar 2025 00:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 527007da068008; Fri, 7 Mar 2025 00:00:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5270077C068005; Fri, 7 Mar 2025 00:00:07 GMT (envelope-from git) Date: Fri, 7 Mar 2025 00:00:07 GMT Message-Id: <202503070000.5270077C068005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 6cab10b07f3f - Create tag release/13.5.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/tags/release/13.5.0 X-Git-Reftype: annotated tag X-Git-Commit: 6cab10b07f3f241d647603730ae148fd44b7d3dd Auto-Submitted: auto-generated The annotated tag release/13.5.0 has been created by cperciva: URL: https://cgit.FreeBSD.org/src/tag/?h=release/13.5.0 tag release/13.5.0 Tagger: Colin Percival TaggerDate: 2025-03-07 00:00:00 +0000 Tag 13.5-RELEASE from 882b9f3f2218 -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEglY7hNBiDtwN+4ZBOJfy4i5lrT8FAmfJ4+kACgkQOJfy4i5l rT+zdRAAmejMGlQviNxYT2gltPERAn8VJZEt3obAkRGgmnL2YyIwggho9mOtki7i jAxU3HX7ERJRYz+5XyDVI1VJNtvw3Agy1UTxZ2HsnlIqY8hcjhyjN3WN3atuysCK BxIRYrw/Hg1TIfXltukwh1nonvP5zUSr22chBeWWFC397avtzLyJQBTRNgIKhNmI pSZVqsK5U1IIgjVPPnif+1ZP+Zb/AaVdj11dhzS1QtsqzlOmhwCTizNDyq6ywQjz qMmj0xLJJwNhUOfdxCkOIthzAgVJSirMwURpbD4rjxtOuoJY3txMfercTm8D6pYu V3DemRm8sT/9fm7Eo5Q32o4LQN8C1RM5/tLkWxuTwHo8zUInqfxkIWLN0Kg9JTNh NF/jyZeCsP6CM6VjOHpLmHv7ivQZq2g9AWO+pV79oU/ZkWre6mtEfbJBHctoeyBR tgUzvn84wNsFfwS2ugwFB1mlewv3aGgCP65AlMIiEXUmmhjBb/O0xQ/7uaYT/QIX +Uk8fe/Uw7B7BOYItj5YiVh07FNJLLH6cnEsfNrmuZUomOrnc6/l+Z8SA69YsDa1 v30wYvilqbGKfnjJF3O3V4autkRkyUneB+MnjPNbpTyv+K67qw20Av/1PmGllcbH Sm+ykPs5b1MwZFnPanskeTN8K2pI3ImeiSgROf9xbIG9rvXpeOk= =byqC -----END PGP SIGNATURE----- commit 882b9f3f2218b50fc1d2d31ee71b7765c7f09f85 Author: Colin Percival AuthorDate: 2025-03-07 00:00:00 +0000 Commit: Colin Percival CommitDate: 2025-03-07 00:00:00 +0000 Update in preparation for 13.5-RELEASE - Bump BRANCH to RELEASE - Add the anticipated RELEASE announcement date - Set a static __FreeBSD_version Approved by: re (implicit) Sponsored by: Amazon From nobody Fri Mar 7 00:33:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z86jH29LSz5qMvj; Fri, 07 Mar 2025 00:33: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 4Z86jG51yrz4Pr1; Fri, 07 Mar 2025 00:33:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VArXX722IsPgzav/1JxiNMep1P7k4OuDYU2+EfvAMS0=; b=o+5EPzb4AbifuIwfkxGRZ+b3+B2Wr2FfXS2nsOFEwxmUSotUfaDsbopfs+5zjXpqZbrxgk cGYfjnhxUe12J9ZzGoMmpefklkVyViwTebCcqh7N+UUNNXgbzAtTyxu/l/mTsAU6Oo6KDt Fn4etLSyF0rqF8lD2iuIRQi1B/vv4Dc+6loYu2YLzZU5EUAsMiCyBfgq9fINxcbLeLaAta lcLDo8FYgk3UZ9e0tx6E1mCKcvNu38hHl7qmSo/H7kmh4oJhaJe0yQ4DFNp3Jhy6UuK9eu IaWKwKCMhw5Bfb+CjHLVHwG2fA4KMCkHU/nOBw2MG2wbCzu2vOM1GlQ+1CfBjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741307634; a=rsa-sha256; cv=none; b=MCf6QL2U5De3Hbw9eE3d57s1B8G6EZS4EQCJoB2lNHMCCmuYeWYErPIRMMb/FE/1HSbUhw Cpcx6kxgDSGtoy9ITBigRfCfNhzdlXsl9cS9Ny+p6c5z6bvq12B0+iMli3Z7FtSjiCbSso GVBpZce8ANhY0ts0AVXcMzMNUDhNj5z0npITsAI0VSPVW9X/21jv4mlBrIdCEAo9UVjHEZ 0hMtp9MESpMrdhk7DCNYTfHgn90Rl5CPFRzSw5Ajj3OfvOKj5FZ9anOAThfINjkuvXe/T3 XcBlpWjRM8DBVrBuCnJgyxz+4Y2sYVfFaGkDElRrt5WdK2rpamjz24Nl9CEkqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VArXX722IsPgzav/1JxiNMep1P7k4OuDYU2+EfvAMS0=; b=kyKiFlk6EM7vWHksPmYMv9MezCMbBUYHV1aNvkF64254kEwT1Q9Ln/cLtg9qXx8Q55lV4C RSCBdciFbu3a38yj2bRFnDYFhNLFA5b2vYXdIcSIYGSXqgWsTBL+tlQbwPYhZTM08pvCWq K4vskKE2eYBSdPvBn0/uIeINW4asFV1FfPiTR5Uc9zUCs3Yy26H5dWNW4MIh7GtS8dW+7F vNBW0nGuH60prhePKKx4Xq7tkV1K1bmiB7uh924kqA3xiQC9/rxAP7TN987hRPRQNM//Vq +fcnRkA26bEIQni4aP31YiIt9KIwptPb1KDdLilIIJzcMnX18a8UtZoD80TIWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z86jG4Mt6z1CVt; Fri, 07 Mar 2025 00:33: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 5270XsNj036650; Fri, 7 Mar 2025 00:33:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5270XsvL036647; Fri, 7 Mar 2025 00:33:54 GMT (envelope-from git) Date: Fri, 7 Mar 2025 00:33:54 GMT Message-Id: <202503070033.5270XsvL036647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 23ad1f4bb737 - stable/14 - var_run: Clean up style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 23ad1f4bb73778c1e01600be76a4a85edcc6c330 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=23ad1f4bb73778c1e01600be76a4a85edcc6c330 commit 23ad1f4bb73778c1e01600be76a4a85edcc6c330 Author: Cy Schubert AuthorDate: 2024-11-26 15:16:22 +0000 Commit: Cy Schubert CommitDate: 2025-03-07 00:32:53 +0000 var_run: Clean up style Clean up style and make more consistent. Replace test with if-then-else to make the script more legible. Replace the call to dirname with the shell %/* operator avoiding a fork & exec. Reorder the test for $var_run_autosave before the test for /var/run on tmpfs. This avoids gratuitously scanning the mount table for a tmpfs /var/run. Initial concept by and in discussion with: Harry Schmalzbauer No functional change intended. Differnential revision: https://reviews.freebsd.org/D47773 (cherry picked from commit ed9712f8943573136fa92a0e61c8e7c10952eeb0) --- libexec/rc/rc.d/var_run | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libexec/rc/rc.d/var_run b/libexec/rc/rc.d/var_run index 9f0f7fcf37fd..6d54aedd7421 100755 --- a/libexec/rc/rc.d/var_run +++ b/libexec/rc/rc.d/var_run @@ -18,26 +18,30 @@ stop_cmd="_var_run_stop" load_rc_config $name _var_run_load() { - test -f ${var_run_mtree} && - mtree -U -i -q -f ${var_run_mtree} -p /var/run > /dev/null + if [ -f "${var_run_mtree}" ] ; then + mtree -U -i -q -f "${var_run_mtree}" -p /var/run > /dev/null + fi } _var_run_save() { - if [ ! -d $(dirname ${var_run_mtree}) ]; then - mkdir -p $(dirname ${var_run_mtree}) + if ! [ -d "${var_run_mtree%/*}" ]; then + mkdir -p "${var_run_mtree%/*}" fi - mtree -dcbj -p /var/run > ${var_run_mtree} + mtree -dcbj -p /var/run > "${var_run_mtree}" } _var_run_start() { - df -ttmpfs /var/run > /dev/null 2>&1 && + if df -ttmpfs /var/run > /dev/null 2>&1; then _var_run_load + fi } _var_run_stop() { - df -ttmpfs /var/run > /dev/null 2>&1 && - checkyesno var_run_autosave && + if checkyesno var_run_autosave; then + if df -ttmpfs /var/run > /dev/null 2>&1; then _var_run_save + fi + fi } run_rc_command "$1" From nobody Fri Mar 7 00:33:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z86jJ2wyqz5qMsL; Fri, 07 Mar 2025 00:33: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 4Z86jH5mMtz4Q23; Fri, 07 Mar 2025 00:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGKTxwKzni/NndYdE2UXW9HovFTs8xd4UHei06zoWrU=; b=w+n+rHIJr6vRq4jR89nux9kblR2RfTmexMtSrYhi5sJfFoPt9hrcWSoqmrBKSec3gPe1lT 1IkYbL/+3GECTU1J46rw6irCXsVGXv8FbUJwTHfTrBH/FjzII2QW0wu9Bw4/FpAA2pGvo2 9JzMjycs9ZkM8ZIe794gdrq2dYCY8xMIA6yj61sQaHxg88E4jpSPkDVydk0XXDtpAPYdBf H5XBu753KFPCvhWAH8G/L7PzDXGN0v9eTSuQ8VIQI5R5QHDunr1xPC5PMovpzPBXUNKJNz +kXo02cTa3Jm5Gp/5XGF4FrKODWx+K69WyAoqhVGXQOUDDaWgHL2iBbVKSctTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741307635; a=rsa-sha256; cv=none; b=n6a8BBJ5Ss/TyEIUWiJ7/AN6KbfJ5HSxi1ZbWysMXu6iOoc4xpZr8Cu2fCp8F3vlPQYOYf tj1o9pZ/dfii/7tWoC0MphfMZI4E8Xj7nQUURBkbuzQCOM00oc9hN2B83JjRHfXL4ZZ1Qx DRBwrXwCwe2RrcNvgsS1dQ/RguBGW+YCSg4raNkFGl0aKMwt/AIp7yMV/i6j4QJ+ZcBjsv iERr3V+QPNP3DVY5y0mvvhVT0bmJxTHIXwdf6MXeJrT8UsC2uE2oEmxHCWEesVEAi8Jl2s WAjPtMjvFBNS/iQk5H5sEOfN0ncCul1u9G63NotCBAlaJ04MKg1YfJ0RaILF/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGKTxwKzni/NndYdE2UXW9HovFTs8xd4UHei06zoWrU=; b=C3VBCDxbXhq/IKVaN8qvLFh5VVbBOixqqJ2SyP7x6reb+kifGLUKUh6Mke0YZ0kPlP8eGP SLAw4nFcWUUZxeJd9PvSJdFwQaf+PVGbiIbuZ5c7KWOntu8hg1eNLM6kPtAFi2HBN0L/Ui WUJSr2BYFDrIiGl559Wysjsx7x74G1UrTpuhnGfkF6zquhFIsS5tJkvhj8FtqW6Zi369Qo qm8ld5JdujzjOo0zl0C780fJqfc/l3YYrDbTRY6lx7Crt9xcmbEJEZPpzoe0M8hGy1+oHT 6QxoBfzUSY913JVEOof6SK/5hszb7Oh8Ddj2VuE+YiY8N2E5r53ODofRQMVu7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z86jH5KZFz1Cqk; Fri, 07 Mar 2025 00:33: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 5270Xt7Y036685; Fri, 7 Mar 2025 00:33:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5270XtFo036682; Fri, 7 Mar 2025 00:33:55 GMT (envelope-from git) Date: Fri, 7 Mar 2025 00:33:55 GMT Message-Id: <202503070033.5270XtFo036682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 8f7be9c63c10 - stable/14 - ipf: Correct ippool.5 man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8f7be9c63c10fd8b168266facb57f38f96394606 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8f7be9c63c10fd8b168266facb57f38f96394606 commit 8f7be9c63c10fd8b168266facb57f38f96394606 Author: Cy Schubert AuthorDate: 2025-03-04 20:37:20 +0000 Commit: Cy Schubert CommitDate: 2025-03-07 00:33:01 +0000 ipf: Correct ippool.5 man page The file URL must be enclosed in quotes. (cherry picked from commit 278a726eec5a49284df1f54a586be0fe0ce2e0cf) --- sbin/ipf/ippool/ippool.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ipf/ippool/ippool.5 b/sbin/ipf/ippool/ippool.5 index 6ead9f7fbf3f..1adda3822422 100644 --- a/sbin/ipf/ippool/ippool.5 +++ b/sbin/ipf/ippool/ippool.5 @@ -124,7 +124,7 @@ addresses from. To do this simply use a "file://" URL where you would specify an actual IP address. .PP .nf -pool ipf/tree (name rfc1918;) { file:///etc/ipf/rfc1918; }; +pool ipf/tree (name rfc1918;) { "file:///etc/ipf/rfc1918;" }; .fi .PP The contents of the file might look something like this: From nobody Fri Mar 7 00:34:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z86jS3vH8z5qMvn; Fri, 07 Mar 2025 00:34: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 4Z86jS1K74z4Q5g; Fri, 07 Mar 2025 00:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S80rGVKzm55blNaPPw1Lhm4uAeqO3/RP76SigrbEz5c=; b=T49vcGvjxUE2YahGqrKa84hYzqbw5bHRQCr+WaCLCOBish+Zt/bmpOIII/LguTJgO9RIsR 07bQvmISbWF0gEI9rSVbnIAeZM8bW8uQWbi/y55CpDvuMA4LAYIKvYCKrr+AOVEkxdx6Ap OG1U6POQwPtHI4EhDDXVzEQNBl7lqKq1k2wNH35WvIZ96q4MQ39zrzqdZiZTZP+aoHkppP EtK1i8min/brhQgjkyg21fpo7YanEp8wpPRIGG6/eb/5RpLThcYYitUcm/wDGAhIvXPe6u 65g1FvPX81e9NnxFAyTXOFu490p7o0FI4n3YgnestHHEfoRAoJ5uvgLBtKgdaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741307644; a=rsa-sha256; cv=none; b=tFlHSt+6LWWf5qIgh7JnXARFLuF2187t1yFNr4cGVAECP0Iktik7PRRN2Hosxsq2Xs9dBQ 9eFQBcag+i4BifHnjOp9iODU3i/LrAFZZn4py/M8FSeNVfVsl7vExoNTzvYyo5TUh2HrZt 3qSRCvSFCSj9E4mGNnK/W6/fwQVJv8ktj5mGbQj94JXiRKdvlWV2lNCtRciBp93zov6uh8 zfQgH5z92aHCIGsZ7Dpw9jP7mgBJGW4fjtfpGgEZlGTxSZGE4BYhNfT+XbyaVDWI53/Aw0 ShSfBlLOp2emhzq8TB3ANaDsIxMypsjh7gtzAMfnUCB7toPAJEHmAgQhJvFVbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S80rGVKzm55blNaPPw1Lhm4uAeqO3/RP76SigrbEz5c=; b=y3XnzF65iPRqlRbbQVHWh5H5UYooaJCinldsyIK2OEhr353RdRzD2MQe27CcbZWLxzjvB2 d0uVSknQVi5ojmbAlMX+WemFQE/BjlOt3FJqt+feROmlzO0sZ3vmtZS9LWn9z7TK1chPXS G6dtnWk1ZsQHY9n1yHkx53vwK/Asvs8n+ovUsSxZdF210UQZoQiXUHzQgVdg5J3HL/vh9L M94gbRoZN2nvMWGAaykjMFCvymp9k3ab7kRekezTPWs8wbq0kaPsxMKuM169R9B2UwEM2f dG+la8OQCHPiwK7tTYXnadWjmPa61HWB21cnu4jbInWck9XLNQP4vIeCeQ7lig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z86jR5XvGz1Cql; Fri, 07 Mar 2025 00:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5270Y3EC036862; Fri, 7 Mar 2025 00:34:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5270Y355036859; Fri, 7 Mar 2025 00:34:03 GMT (envelope-from git) Date: Fri, 7 Mar 2025 00:34:03 GMT Message-Id: <202503070034.5270Y355036859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 2fae556f6a8b - stable/13 - var_run: Clean up style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2fae556f6a8b10bdef22eba0d83b0880e3669496 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2fae556f6a8b10bdef22eba0d83b0880e3669496 commit 2fae556f6a8b10bdef22eba0d83b0880e3669496 Author: Cy Schubert AuthorDate: 2024-11-26 15:16:22 +0000 Commit: Cy Schubert CommitDate: 2025-03-05 04:46:14 +0000 var_run: Clean up style Clean up style and make more consistent. Replace test with if-then-else to make the script more legible. Replace the call to dirname with the shell %/* operator avoiding a fork & exec. Reorder the test for $var_run_autosave before the test for /var/run on tmpfs. This avoids gratuitously scanning the mount table for a tmpfs /var/run. Initial concept by and in discussion with: Harry Schmalzbauer No functional change intended. MFC after: 2 weeks Differnential revision: https://reviews.freebsd.org/D47773 (cherry picked from commit ed9712f8943573136fa92a0e61c8e7c10952eeb0) --- libexec/rc/rc.d/var_run | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libexec/rc/rc.d/var_run b/libexec/rc/rc.d/var_run index eb9cdbd59305..71f84d23cb3d 100755 --- a/libexec/rc/rc.d/var_run +++ b/libexec/rc/rc.d/var_run @@ -23,26 +23,30 @@ load_rc_config $name : ${var_run_autosave:="YES"} _var_run_load() { - test -f ${var_run_mtree} && - mtree -U -i -q -f ${var_run_mtree} -p /var/run > /dev/null + if [ -f "${var_run_mtree}" ] ; then + mtree -U -i -q -f "${var_run_mtree}" -p /var/run > /dev/null + fi } _var_run_save() { - if [ ! -d $(dirname ${var_run_mtree}) ]; then - mkdir -p $(dirname ${var_run_mtree}) + if ! [ -d "${var_run_mtree%/*}" ]; then + mkdir -p "${var_run_mtree%/*}" fi - mtree -dcbj -p /var/run > ${var_run_mtree} + mtree -dcbj -p /var/run > "${var_run_mtree}" } _var_run_start() { - df -ttmpfs /var/run > /dev/null 2>&1 && + if df -ttmpfs /var/run > /dev/null 2>&1; then _var_run_load + fi } _var_run_stop() { - df -ttmpfs /var/run > /dev/null 2>&1 && - checkyesno var_run_autosave && + if checkyesno var_run_autosave; then + if df -ttmpfs /var/run > /dev/null 2>&1; then _var_run_save + fi + fi } run_rc_command "$1" From nobody Fri Mar 7 00:34:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z86jT2gRHz5qMxp; Fri, 07 Mar 2025 00:34: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 4Z86jT0Xkrz4Q9k; Fri, 07 Mar 2025 00:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PezzYUYJ/YxOfy2Htrw7jJPSzeNsobuitaKJ7k2NGVY=; b=BrxOjPOSVgp0glSR83JD7+Qztp7dVoBT+7hwHg3hmpPHn4wCoLmvYGomJBhfhztyas5Ep+ DYnWKK9lOz1mee0LmSSik05897ASGuuPn1J+POlGeBjI1Vc0OJ9kfhPNjf7zBjICy5j6Qw 98XofMEzMxTwYYaIE16HaPiVw1ig27gj/WaSMbMBlp0q8521Uni9sKAuBLPgrOwbI+BLYw iXBySfYpBVpoDCKpTb1DhvCQxTK6Ml7Akltb3j7evadhQYE/x0YXddaMEnYjvGLnTzOt/v k4m6ipdUo/l6QTQ24F/f2Bcw6RWkWAepK3aKVRQR0bgmTqVTeSK6aJ68lXVk+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741307645; a=rsa-sha256; cv=none; b=vBD083eo7b0ohw5CzlpUTscQ5dEsvvcaPtQ4wy/yEidpGpwLa8HyJf9YBJYZuFZGufGBYH 6CrZoNqSPZqnDlNb2ahwZwZiqbCxlW+/Tg0C4QdiVApeQ2XoWGE8bWF2GxevJn+nqWuqcy tSa0JSx+3UoGalTjun79xsBx69u1j2m4TcC8bynlEW1D73eG98ZXELopILXgdq19FQ1/Tz 924slqTYkuEyb5AD6GwONKbdaAiNhF5PHhQXO2KHfsdGdIB89xBNbP1zB0cGqcPrZtgvoo Jch5Uo3bMzsIL9Lb28RQQ788RXGNvgyBGMiDZEQrOUilzZnl/pcjV5pPnqaYxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741307645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PezzYUYJ/YxOfy2Htrw7jJPSzeNsobuitaKJ7k2NGVY=; b=G/eGkfntOO5r5MyVPJIbUoir/L09grh8royvWEy+9v8loCkukOZaO1aqLYU4k88wv9FT6V DAu2q5ACuJNZMW/EXRoFWriPoatBJEo1X+RSsxI/9otlgoW0ZqXJaxLNQRDBNjxp4IWVXJ hkxDy/XGK0vceBH5F855ztwBW0mPZi47326dYAHSM8vR1k9G5ZeX2wE6IAKcB7mGVOtxei vtL6FafaC6mqJ8cdVVLl/eUetshdgCjOrnc9HcpUdlm3JNEaHiy5aRq2PcuSXa7AKJqRik kLrheaIMW+Ex583uDqh7rPwf0wfG/hLxpS9apkFDYe+Pm2Axue2F1CatJkDavw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z86jS6TXpz1CGs; Fri, 07 Mar 2025 00:34: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 5270Y4pq036896; Fri, 7 Mar 2025 00:34:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5270Y4Jh036893; Fri, 7 Mar 2025 00:34:04 GMT (envelope-from git) Date: Fri, 7 Mar 2025 00:34:04 GMT Message-Id: <202503070034.5270Y4Jh036893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: d2011755f36c - stable/13 - ipf: Correct ippool.5 man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d2011755f36c61d29f33c2f2bb51e4869db3a4f9 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d2011755f36c61d29f33c2f2bb51e4869db3a4f9 commit d2011755f36c61d29f33c2f2bb51e4869db3a4f9 Author: Cy Schubert AuthorDate: 2025-03-04 20:37:20 +0000 Commit: Cy Schubert CommitDate: 2025-03-07 00:33:41 +0000 ipf: Correct ippool.5 man page The file URL must be enclosed in quotes. MFC after: 3 days (cherry picked from commit 278a726eec5a49284df1f54a586be0fe0ce2e0cf) --- sbin/ipf/ippool/ippool.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ipf/ippool/ippool.5 b/sbin/ipf/ippool/ippool.5 index 6ead9f7fbf3f..1adda3822422 100644 --- a/sbin/ipf/ippool/ippool.5 +++ b/sbin/ipf/ippool/ippool.5 @@ -124,7 +124,7 @@ addresses from. To do this simply use a "file://" URL where you would specify an actual IP address. .PP .nf -pool ipf/tree (name rfc1918;) { file:///etc/ipf/rfc1918; }; +pool ipf/tree (name rfc1918;) { "file:///etc/ipf/rfc1918;" }; .fi .PP The contents of the file might look something like this: From nobody Fri Mar 7 01:48:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z88MX4Nntz5qRV8; Fri, 07 Mar 2025 01:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z88MX0l91z3qXF; Fri, 07 Mar 2025 01:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741312120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjKnnW4sOuW/vA9HEqznlXlnJhste/vb9R5gRoIlwJA=; b=OjzQDVohlPnEKboicpA7EDs2QBWGd9OiiD+nP+HmtB3RkKL2HaeZWuDZ/W6/kDApoR5MoD QD0gsqbpM4uur32vQmT/1R7qrl/nt4ZlAZ8YpVaUcv2Rn6XnS5LEF8E0g1zqOPfyMWC79A OtVda2lnGh/g+1bKlbh7WmNxIlaW2owLgDeQOsJZ9J7zGrp76PaZ4JDg9rYGyVROwUUqHG /9RyeZCNUO8Am2VJj5eltNly9bZtHZfOhmL8tG6tXZtkMNI+grRnWZvdAFnOLOBY14Yv9F jSatOLuotM5wcfzKLH7LBP/iXlqTKIBUALoftjiKQjSjB+tKQyxnVj5nNE27vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741312120; a=rsa-sha256; cv=none; b=CgBclpXN5yRjAq/RIy8eOjp72TrPd0AOoqT2cV4Sw0FvHpxmxkSY0GO5WdhD4Kgd3GQzDN cfWhuXswDDeMULm+qcYR2qAxPSJ1VFQB/yCypsl8+Sulda1mZIEjKX8ufLafADFUDSsk5n TQugrXNU8HesNsn/fMRjejiB1uZVcW6d6W7TEv3YtVo844Vvmb96CbUnY5wZWewXdilrab oPDvymu7MZGZ7BDwyYtJfJgwo5AiNfd9r+iOHiau9T6hxTxPwwfAG0+prwex/Ri9sgwKhT 3wDa4gDtyPAMACff5nIgknuM16MBMHI5XBl4llTWU9hjY6k6KfZiF5yINgg5Xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741312120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjKnnW4sOuW/vA9HEqznlXlnJhste/vb9R5gRoIlwJA=; b=e8Tm2jr6YZu1+m0GCitlZpkcv5+ugPi17KBexDil+b891Iq91pIrgiBFk5Bhq/XXAlonU0 HQW65bvE+eJQ0pkItKhN+Ut0gyGi+0KllH3vgfTHe4XTW0Ar6XpC3XatpQlxv73BuzO7XM 0bHlLnwVHYSJ/9KIx5y9v/oo9rOjMCAWIS8BNhxIW0MS6gIGSoCLakw3QlDxnvi2EkK+8k IueYKTey/LNsuuLLGzEkQVgBnWwno3FcoN+g5zfMEFyDiyXqrC3EjatdHVRu2kpso6eUg4 x93zmpjhp1CtwlLCQdELM0LvTA/r7dl5mO6heJnCG8dKQPlzHCzUqoPnybtshg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z88MW6rtFz1lZ; Fri, 07 Mar 2025 01:48: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 5271mddC068571; Fri, 7 Mar 2025 01:48:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5271mdZe068568; Fri, 7 Mar 2025 01:48:39 GMT (envelope-from git) Date: Fri, 7 Mar 2025 01:48:39 GMT Message-Id: <202503070148.5271mdZe068568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 5460bdda9d4c - main - truncate.1: improve the example section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5460bdda9d4cb3ce1d7431824b6f53c545888b53 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=5460bdda9d4cb3ce1d7431824b6f53c545888b53 commit 5460bdda9d4cb3ce1d7431824b6f53c545888b53 Author: Maxim Konovalov AuthorDate: 2025-03-07 01:45:21 +0000 Commit: Maxim Konovalov CommitDate: 2025-03-07 01:45:21 +0000 truncate.1: improve the example section Notably: * spell "Megabytes" as "megabytes" consistently; * remove a stray asterisk from the /boot/kernel/kernel listing * avoid using a shell prompt in the examples consistently * fixes the size parameter * add an example how to increase the file size PR: 273997 MFC after: 1 week --- usr.bin/truncate/truncate.1 | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/usr.bin/truncate/truncate.1 b/usr.bin/truncate/truncate.1 index 649749ddf255..f6b8b0cc37c9 100644 --- a/usr.bin/truncate/truncate.1 +++ b/usr.bin/truncate/truncate.1 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 19, 2021 +.Dd March 6, 2025 .Dt TRUNCATE 1 .Os .Sh NAME @@ -188,14 +188,14 @@ and continue processing the remaining arguments. .Sh EXAMPLES Adjust the size of the file .Pa test_file -to 10 Megabytes but do not create it if it does not exist: +to 10 megabytes but do not create it if it does not exist: .Bd -literal -offset indent -truncate -c -s +10M test_file +truncate -c -s 10M test_file .Ed .Pp Same as above but create the file if it does not exist: .Bd -literal -offset indent -truncate -s +10M test_file +truncate -s 10M test_file ls -l test_file -rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file .Ed @@ -208,18 +208,28 @@ with the same size: .Bd -literal -offset indent truncate -r /boot/kernel/kernel test_file test_file2 ls -l /boot/kernel/kernel test_file* --r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel* +-r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel -rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file -rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 .Ed .Pp -Downsize +Increase the size of the file .Pa test_file -in 5 Megabytes: +by 5 megabytes but do not create it if it does not exist: .Bd -literal -offset indent -# truncate -s -5M test_file +truncate -s +5M test_file ls -l test_file* --rw-r--r-- 1 root wheel 26109672 Jul 22 19:17 test_file +-rw-r--r-- 1 root wheel 36595432 Sep 20 19:17 test_file +-rw-r--r-- 1 root wheel 31352552 Sep 20 19:15 test_file2 +.Ed +.Pp +Reduce the size of the file +.Pa test_file +by 5 megabytes: +.Bd -literal -offset indent +truncate -s -5M test_file +ls -l test_file* +-rw-r--r-- 1 root wheel 31352552 Jul 22 19:19 test_file -rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 .Ed .Sh SEE ALSO From nobody Fri Mar 7 04:03:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8CLv3Hs2z5qZsY; Fri, 07 Mar 2025 04:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8CLv2g6Wz3xt6; Fri, 07 Mar 2025 04:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgftDIdWzU3w+yjteAskvoDTcUuP7ktGvxzNWhFkwbk=; b=by+YkkdJF4tZoF6Ksm7bQs6ahRMDiyWjGqe0waMF8i4mN3XRVdUBVwHwtjw9BmUQpZ+Aqe 1NqZSINDyAwwq1C2m04BVnve3UqcyrSifwsByHswNHaBVfWarXMCeCiQO2uA/Enw/NDpsi PSlUGn0XkIwYWkEVIISWSZQrOjkwgP+cbj7/w+W5w+i7phySmsS+r/SwJDjfsIvu9K6GT8 GLiXTNfCw3ORKCdUsl+o46l9FNH2iDYWZVvRyp42vidPEg3XIwj+TGHFnzM3cxka0r6zll UjSclLhfY7Pj3+dsmttWEIO3ZZ39KkvQqr6pb3woFYQR5KKYaOkEL3To51S68A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741320199; a=rsa-sha256; cv=none; b=bA+jYW1WGrnHMNIyHaRzM9HJrl1fxDnGbNEIMyK33Y5akwqYEkeLGTiFtjOI/NMDfQTpx4 nzVkdoBxC5/cP4oIExryYRO3TfiSHYcGVvMIzNg7ZK7gW60yk5EKPjVkDU0985O7qSgnMt cl45uAqOmIoN2RfJAXtdpMq+u1xh9c1p+7ejc9aWEfoZdsQcPi6COealZhUuaZvGfoFcsZ fGI0LbMC/I6A2sEHUc8p3WWqkHf2sJReQV3yhMc+iqwM9Xxs+d/EGKsba8SrKXSPHP27iK jf3GyKt2pYXrSrKCidtUWLuui0eUzyBViX/EvDk7KADBN0ZvK3v9E10zCRwwRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgftDIdWzU3w+yjteAskvoDTcUuP7ktGvxzNWhFkwbk=; b=Pr4XwXveWmpsFqUfwqOy0KDUHunmXGoreTgM1BM8wAj/327soF9134QM0syao5gsZ03dSG HZ81ckE8m0MdUxyIcp8OpihSPszWfpJJ/4H9Ws4FOfT2qC8HEtd/AJJ5dkFZwiFQR9XJQF GxmOeltoTJpOK4eFglr+KiNlaMy95J7vTgBDHxCRpkXIDxL54VC17xo6Lp3O4zpPYZwhVc ARWCTrazPOZiAhF6hc4xOHqzT2SWuZvHOLj5jnNPh7QkY4n4HJSRSO/4txH64NY1KxgefE eKILIYAp8S6Wey5rBzSbeneUWzwm19tD0TGVcnlD/rSHvIg1fqIMB5QOxXy1lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8CLv27KYz52p; Fri, 07 Mar 2025 04:03: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 52743JWD030274; Fri, 7 Mar 2025 04:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52743Jg3030271; Fri, 7 Mar 2025 04:03:19 GMT (envelope-from git) Date: Fri, 7 Mar 2025 04:03:19 GMT Message-Id: <202503070403.52743Jg3030271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1b2715c0581e - stable/14 - netinet: Make in_localaddr() return bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1b2715c0581ec725968131b2ca8d2238df2d2287 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1b2715c0581ec725968131b2ca8d2238df2d2287 commit 1b2715c0581ec725968131b2ca8d2238df2d2287 Author: Zhenlei Huang AuthorDate: 2025-02-27 15:58:20 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-07 04:02:40 +0000 netinet: Make in_localaddr() return bool It is used as a boolean function everywhere. No functional change intended. MFC after: 1 week (cherry picked from commit 69beb162848b15c967d3b45ac56501dbd8b94e91) --- sys/netinet/in.c | 8 ++++---- sys/netinet/in.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index de6224ad9ebc..664dffb4e6cc 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -129,10 +129,10 @@ static struct sx in_control_sx; SX_SYSINIT(in_control_sx, &in_control_sx, "in_control"); /* - * Return 1 if an internet address is for a ``local'' host + * Return true if an internet address is for a ``local'' host * (one to which we have a connection). */ -int +bool in_localaddr(struct in_addr in) { u_long i = ntohl(in.s_addr); @@ -142,10 +142,10 @@ in_localaddr(struct in_addr in) CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if ((i & ia->ia_subnetmask) == ia->ia_subnet) - return (1); + return (true); } - return (0); + return (false); } /* diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 80c872367f93..db36962aadb1 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -677,7 +677,7 @@ struct in_ifaddr; int in_broadcast(struct in_addr, struct ifnet *); int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); -int in_localaddr(struct in_addr); +bool in_localaddr(struct in_addr); bool in_localip(struct in_addr); bool in_localip_fib(struct in_addr, uint16_t); int in_ifhasaddr(struct ifnet *, struct in_addr); From nobody Fri Mar 7 04:03:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8CLw684Fz5qb1G; Fri, 07 Mar 2025 04:03: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 4Z8CLw3b56z3xnD; Fri, 07 Mar 2025 04:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiDRygSyiup/w2+z8kgCBpEERN209b5rmdmO9F8C/EA=; b=D4baBkehHaxaQgxRfaXyGfAt0HJn1v5qXLe3Pzl46G4ywcDR290e8RSqFoovPMNPq1sM1h ptx5rllrmoeJ1kYF1wWZdYN8IB8zaxXFYLLaEBBskyAia1gzaYIgN3WiUeVjvXpjOeQCbw lj7i2jouktjCAa6ZTwFcDUF/GyDd8OBZ2kjgXk0OVNz/yYwLaVScG/c3bmiX66nbQThu6L y1WM6yGd4KU3vJfolSIIpLOX6WlTKdvIhqrnJ+dE5KgkTudYt8xoTRh4H72S3sc4+uF26p pwpQZv9utb2ZaREb6q5MRw8+fk9RySvsSMEGFf+ZpIk6zza63hNmw7oneqf1hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741320200; a=rsa-sha256; cv=none; b=NjnvQxeit8tXJRoWC2fvN5iRyguErxwEfRmkYjRb524a2QEs4JihpbBnHVjTvClB1rveYj /wMEZ9wJ4dEv21KIfKdQOOvhGvozPdwnR0N1JX6xLOJUU/cOEMlr3fD/yUvkoGBWxR1Emz OATQVSElAbmTm1s6KSHicvx3uLGxc6+QXtU4+iHUlaBZFLwbCa4bdzTKu8P+TbeDZhLtO+ FBjS42yJEBE7rSVjzMlej2L0RIXjYNYInZ3xwMOJK7wgpQpu6cJQBnl7ikTuy5aW/aHg4G 3dkzjP5YJLKYdjhKqCEh1F56hgwBz2WKi/PixFIh1aC6i6HElcxhOGIuGL5gig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiDRygSyiup/w2+z8kgCBpEERN209b5rmdmO9F8C/EA=; b=uWcdNZvF1+CYZmrp/7Gjp5DfoB3QBsYbk4jxZb7fukXhO+HnW6sQ1EK05cm+QMYU9EaYem Bz2xts47yPiqVlYPYCqXj99j3dvx6MTcNSmDBVhnJ7WFXaDrFOTalFoEHApJaE5rFbZ2UE yQJxJX19spddrqeITuumSQAGc8dJyUOSM8RHxPS2iawwB4gSLxtKAJmAPabIRYTC+fGFBZ baEYLecFV2e9gHYRFpv0sb8ibiBkFYo9KA6i5eN6Zmcl055yNdmQQFESk1QZtCUFj653o5 JyRCVbuvtWk6W8vZVxawyQpA3RyKw6kolzOCxlcsLigLKCOByNl0/4vliDCojw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8CLw37LTz50B; Fri, 07 Mar 2025 04:03: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 52743KBu030307; Fri, 7 Mar 2025 04:03:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52743KoF030304; Fri, 7 Mar 2025 04:03:20 GMT (envelope-from git) Date: Fri, 7 Mar 2025 04:03:20 GMT Message-Id: <202503070403.52743KoF030304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 841c38b5a028 - stable/14 - netinet: Make in_ifhasaddr() return bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 841c38b5a028cd812a056092a410c0028d010761 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=841c38b5a028cd812a056092a410c0028d010761 commit 841c38b5a028cd812a056092a410c0028d010761 Author: Zhenlei Huang AuthorDate: 2025-02-27 15:58:20 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-07 04:02:40 +0000 netinet: Make in_ifhasaddr() return bool No functional change intended. MFC after: 1 week (cherry picked from commit 97309cec6f31f1f4f7a76f9ec5c7dd359c56de02) --- sys/netinet/in.c | 8 ++++---- sys/netinet/in.h | 2 +- sys/netinet/udp_usrreq.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 664dffb4e6cc..e30f63e5bec9 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -187,9 +187,9 @@ in_localip_fib(struct in_addr in, uint16_t fib) } /* - * Return 1 if an internet address is configured on an interface. + * Return true if an internet address is configured on an interface. */ -int +bool in_ifhasaddr(struct ifnet *ifp, struct in_addr in) { struct ifaddr *ifa; @@ -202,10 +202,10 @@ in_ifhasaddr(struct ifnet *ifp, struct in_addr in) continue; ia = (struct in_ifaddr *)ifa; if (ia->ia_addr.sin_addr.s_addr == in.s_addr) - return (1); + return (true); } - return (0); + return (false); } /* diff --git a/sys/netinet/in.h b/sys/netinet/in.h index db36962aadb1..8e7e3548c6ad 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -680,7 +680,7 @@ int in_canforward(struct in_addr); bool in_localaddr(struct in_addr); bool in_localip(struct in_addr); bool in_localip_fib(struct in_addr, uint16_t); -int in_ifhasaddr(struct ifnet *, struct in_addr); +bool in_ifhasaddr(struct ifnet *, struct in_addr); struct in_ifaddr *in_findlocal(uint32_t, bool); int inet_aton(const char *, struct in_addr *); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 9a3d9a810481..0ea065f15ce4 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1048,7 +1048,7 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct sockaddr_in * src, ifp = NULL; if (ifp != NULL && !IN6_IS_ADDR_UNSPECIFIED(&pktinfo->ipi6_addr)) { ia.s_addr = pktinfo->ipi6_addr.s6_addr32[3]; - if (in_ifhasaddr(ifp, ia) == 0) + if (!in_ifhasaddr(ifp, ia)) return (EADDRNOTAVAIL); } From nobody Fri Mar 7 04:03:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8CLx6R2hz5qbHD; Fri, 07 Mar 2025 04:03: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 4Z8CLx55Qsz3xg0; Fri, 07 Mar 2025 04:03:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1p4dOAJkaCuFZ9lP7lbJcMpehXmcfH8MX3WR48G+HwU=; b=V6RIfL1wpk4jL/7FH4Ex0RpyXQq+TWYEWT7wMHvrh9d7GJO8R5x4DFABeFLNOD9OXV09t/ KYbwJb0BEZ7jJ51Hnl5WR2+Ttx1WJQytyYcxw/x5rNR1FLgPNfH1fE5tnlTLdxxm/Y+3J5 rr+qOuLc1/68umv5Uwf++GpHiYn+Ho4k/7AQUmSEHciO6uoeweYcrHdYZKjQlQXvQAzfPP WXBkmbL32Z1pOZbOtmEPSkrX31mZEECkd5z92wkt9m73LQeIvogchTMk8pq/ZPg/aIqm8g N0csWulB6BHZmMT9qC21bUfegWQ0OwxUg2X4G8toaBvzvhqGs7CIwRZO1ajTJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741320201; a=rsa-sha256; cv=none; b=BUMIJSUHRTm4JZ6BZspr/69/9VUDaorpA6LttYbGV+Dk0MnipplAIhelIlgIYMkQgEjx57 TcPatjoMF9AkKwTHN3nWHkqfISnxl4ArkkA80m/6Go+0ymfo94a5x6VRS6WMbzHz5mj6sR jEkZYCPOEzWSZLX1jFDWvKTx+ZxTPTykQQXbwKpiJ1IQdza1NwCsTBP/3sTAdGK87HsHNN yK1fzDsf+Pa7kpuUPOtjlu0NEPyjfEBlE6ei12qzAhFP1mSnyoZVTkMjPySpXe6g5xAYdE r8P/IFAxNYLvSW5ong6+rsA6XRQQiyOREGShjqxpzN+eNOvMaGDnPWq9gAbtfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1p4dOAJkaCuFZ9lP7lbJcMpehXmcfH8MX3WR48G+HwU=; b=WLuiqk4W1vz+ss4cJ4ZVFLTxfqDroYeO4DTwIFv6j6jBjEVvvgbjpMgMdFUW6RX7AveyXf nkQFK0LODnZP5L+BMWfakzJ2lW0eItRAlLqPBqVBo0iRuu0X7Hhy/xtDqz2goeKz/P9nuE owzCSk5lp4hTCWafWbZfDFWHPqhRbhObnAZq9IZ1BrKl67u5nFGcfXWeHUpmQAGwYbqsWI /6Tdjdq9gppOWmbyQRaXJLUZBDT8a3VZUEjrsQXY1oX3kRRmlgf9r21APJuvkKR4Yu74ZJ 3ohqbp4xd4XsOp6WlEWtZh6wevhDwNITi6bmjwk9fVVVEUAwYE04QMwRtwRm9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8CLx44Yrz5g8; Fri, 07 Mar 2025 04:03: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 52743Lxu030340; Fri, 7 Mar 2025 04:03:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52743LDS030337; Fri, 7 Mar 2025 04:03:21 GMT (envelope-from git) Date: Fri, 7 Mar 2025 04:03:21 GMT Message-Id: <202503070403.52743LDS030337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 9406d7e32da7 - stable/14 - netinet: Do not forward or ICMP response to INADDR_ANY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9406d7e32da718dce31e36190be308c61f87604e Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9406d7e32da718dce31e36190be308c61f87604e commit 9406d7e32da718dce31e36190be308c61f87604e Author: Zhenlei Huang AuthorDate: 2025-03-02 15:00:42 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-07 04:02:41 +0000 netinet: Do not forward or ICMP response to INADDR_ANY The section 4 in the draft proposal [1] explicitly states that 0.0.0.0, aka INADDR_ANY, retains its existing special meanings. [1] https://datatracker.ietf.org/doc/draft-schoen-intarea-unicast-0 Reviewed by: glebius Fixes: efe58855f3ea IPv4: experimental changes to allow net 0/8, 240/4, part of 127/8 MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D49157 (cherry picked from commit f7174eb2b4c45573bb9e836edad2b179a445a88f) --- sys/netinet/in.c | 3 ++- sys/netinet/ip_icmp.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index e30f63e5bec9..bb36ef18d3e2 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -278,7 +278,8 @@ in_canforward(struct in_addr in) { u_long i = ntohl(in.s_addr); - if (IN_MULTICAST(i) || IN_LINKLOCAL(i) || IN_LOOPBACK(i)) + if (IN_MULTICAST(i) || IN_LINKLOCAL(i) || IN_LOOPBACK(i) || + in_nullhost(in)) return (0); if (IN_EXPERIMENTAL(i) && !V_ip_allow_net240) return (0); diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 26ee6e5c1245..122293a36a15 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -790,10 +790,11 @@ icmp_reflect(struct mbuf *m) if (IN_MULTICAST(ntohl(ip->ip_src.s_addr)) || (IN_EXPERIMENTAL(ntohl(ip->ip_src.s_addr)) && !V_ip_allow_net240) || - (IN_ZERONET(ntohl(ip->ip_src.s_addr)) && !V_ip_allow_net0) ) { + (IN_ZERONET(ntohl(ip->ip_src.s_addr)) && !V_ip_allow_net0) || + in_nullhost(ip->ip_src) ) { m_freem(m); /* Bad return address */ ICMPSTAT_INC(icps_badaddr); - goto done; /* Ip_output() will check for broadcast */ + goto done; /* ip_output() will check for broadcast */ } t = ip->ip_dst; From nobody Fri Mar 7 04:03:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8CLz15yPz5qb1K; Fri, 07 Mar 2025 04:03: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 4Z8CLy5d7bz3xqj; Fri, 07 Mar 2025 04:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JSlET4/JT+En+BeMSx04HyomGx0b3LLc7A0LVbgKHW0=; b=QNaXBIz/q4CCLUHWjb4TFISbCSPwSv4//omGBrKsULkac+62oy9LVSptJi9SkvbU5rUARj srwtVNpX4Pl86y38VQDbpV94/LWxPt50SjcgFyl9m9Gjf77zFD/wFS+eqI3ZQIPK/+b/Qr 2iBSipKLQqc3TXdU32VblLf7CpsYa6mdGUOrxrsSjlh0xhvutSKNsbnyhpEBBUB3Wx8d/G Wj8uW8A9taW876HOEu3HTvayIkAAvbZUgFuon9qJMQ9DMIjaW4WbDLEJteQpa5rVVi270E oqBhJzNRnsytAocGoHl/ZQXxWK2Hc3UR9GjfVJBC8okOrT5bnBHfldYLz3n3aA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741320202; a=rsa-sha256; cv=none; b=Yi3IyBW6cTXnnck2CC5c5ezCqj1qSVTKgOcIKLPgu0G/mCFQCzkf3XLJ7DMegdTFBg9vSo qjAogNqrbgBuYBi5Q8YlZEwwoaD2Dt4sR8tb7TR3729qvCX6u5edWaPFv5EHsZ+LUsJ96Y 3HFK8g2GQXnfev9I8dNjrRA4yTnuBW2fEhbihPVgU6tpsHCcSkBPT/XZKz+5BJ7EglVCiU AHnVTB1HilEExjJRou22sjAPToL+ajxQ0e35oUlzqHnWMRyu3Sa9Y3e+xc8aufFOrkTzX/ 9ULlaiWOBwExuvEO0vrzkoODdYztLoSobrdnpvYYYkQ6svmkbKYnfmEARiLNhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JSlET4/JT+En+BeMSx04HyomGx0b3LLc7A0LVbgKHW0=; b=dsm2TZfYmT7Re+oyg0VbiTvWfXbJpka97hpviv+ZTfoTp20rLNm53SZxAnvp9IJ+sJVoka WTxJqiL03ed3hHkCTqdJmFeOaDbmFFq4ob4GywxySlH9evn/3XeYhdYjavGJYfZ+w14+EA lr0ROBCI5u0O9fJnNEt/AhTpiHVJBko1+FwJX8ax2MhLKY7feq0iqp3Bx1FBCo6j7T4PBo ewfe3UcmS5jW3VNn0W6sjpG5av/ekS2A4kCToJ5qEPWSsEVsPNOUS2zVmx14jDrnXSkKck 8IUTpSgJRcB3Ep73fIYOxzJRJRstdGZTn8T2x9ZVVRNHRnQrNJzgy43ArULUDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8CLy5B8Nz52q; Fri, 07 Mar 2025 04:03: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 52743MCn030381; Fri, 7 Mar 2025 04:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52743MsU030377; Fri, 7 Mar 2025 04:03:22 GMT (envelope-from git) Date: Fri, 7 Mar 2025 04:03:22 GMT Message-Id: <202503070403.52743MsU030377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 70831490663b - stable/14 - netinet: Make in_canforward() return bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 70831490663b7509203ff3f87beff1c8eda806a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=70831490663b7509203ff3f87beff1c8eda806a9 commit 70831490663b7509203ff3f87beff1c8eda806a9 Author: Zhenlei Huang AuthorDate: 2025-03-02 15:00:42 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-07 04:02:41 +0000 netinet: Make in_canforward() return bool No functional change intended. MFC after: 5 days (cherry picked from commit 3ae7c763540afc0bc5320eb45f2661d315370eb8) --- sys/netinet/in.c | 10 +++++----- sys/netinet/in.h | 2 +- sys/netinet/ip_input.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index bb36ef18d3e2..bafd1b549848 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -273,19 +273,19 @@ in_findlocal(uint32_t fibnum, bool loopback_ok) * that may not be forwarded, or whether datagrams to that destination * may be forwarded. */ -int +bool in_canforward(struct in_addr in) { u_long i = ntohl(in.s_addr); if (IN_MULTICAST(i) || IN_LINKLOCAL(i) || IN_LOOPBACK(i) || in_nullhost(in)) - return (0); + return (false); if (IN_EXPERIMENTAL(i) && !V_ip_allow_net240) - return (0); + return (false); if (IN_ZERONET(i) && !V_ip_allow_net0) - return (0); - return (1); + return (false); + return (true); } /* diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 8e7e3548c6ad..5c781d39d33e 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -676,7 +676,7 @@ struct in_ifaddr; int in_broadcast(struct in_addr, struct ifnet *); int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); -int in_canforward(struct in_addr); +bool in_canforward(struct in_addr); bool in_localaddr(struct in_addr); bool in_localip(struct in_addr); bool in_localip_fib(struct in_addr, uint16_t); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 6d8165003950..7c01c4959841 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -932,7 +932,7 @@ ip_forward(struct mbuf *m, int srcrt) NET_EPOCH_ASSERT(); - if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) { + if (m->m_flags & (M_BCAST|M_MCAST) || !in_canforward(ip->ip_dst)) { IPSTAT_INC(ips_cantforward); m_freem(m); return; From nobody Fri Mar 7 04:15:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ccd33Rqz5qbdy; Fri, 07 Mar 2025 04:15: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 4Z8Ccc6zsmz466y; Fri, 07 Mar 2025 04:15:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0O3XSQtSRwUcHCdzNJeo8ea7r0eGxUTvrum0J1I8fo=; b=pgzVbL8pBfwNLY6UJ5HXuEyEv+9dKu9JnU2U64RHH0ycT6/bZKXVoKUwtOKvDti41Wl/jq eBagWbI7biIWDQ4nxHC2JvPnhcHQbOJy4Q80UK/O+/qq1Ij7TFkvOo8vZ816JCQSQdUgQ4 EvKAnUrDexui0LKlhqsFma7Q6XXBv8vgRLqFJcZhHAtzCdsi5ZnvTp1pHRAV9ebxkQBiQR Vyk7VbreqdDpQH4569baEbQjjuuW322mYUvNDZdjTgh6D4w24GaH2LH/C/rgpFkCBYny6R dlOSZTL1QAls5kNGX6CXf4nMbzv+kMhtTZkWOnM6F73BKO5PgJMGveMCxPfGkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741320913; a=rsa-sha256; cv=none; b=BTigCveHq9t8HKjtdNyiDvr8yZH2zZdI94y36bNmrDiyKrgUJnpJkdriZ1xYjJLrXuODk8 mzIKgOTkFxo6phKhztTMOBhF8P5cu9btholxT+GE1Mwyz1HAdHe3gcG3T4b1iUDfKoMO8A 9d4JaXXP5WGK/8FZ0fXOxqfZ69B+sCl5n/fkm2LuaE1FJeq6Uyk+LyqxEf5sDa4Te6t2w/ NZXx+mP4quIn8T6f3ccy6NMVLVsIvGHZE/vDZ/xSebokakAwwOhPuoOkxYoSudc8ERN35K yMwE32kr20bLS+AtufpnSNgqMf07H9ju1lfUNqiiyf8gfTGcHJqJfv3U8uOK1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0O3XSQtSRwUcHCdzNJeo8ea7r0eGxUTvrum0J1I8fo=; b=NCI7RQ1KgZdtaxtXJFKmJxPbt+enNDVN+doLFsIpdDkmK8KTiCaODEqndeqlgS5WLvfhqi +YuUVBZi87IDlWGKqLiH/5CpowjmFKQZVHHmieyUxyntel6klfxKknl09JNew23AW71oZQ jcF5s8BZvF5n4UTp5mVedIlo0HPQKmSyx7rrSxqEM+9vMXDPoZI/TJ5gvHY6LNuUkhaBHc 6NLnglbDjEEhob/qRVEN+ZX9SK1xg25fxW1mYPFBJdsgamf2jDGnulKoh5/shzFMe+WjR1 9kHdXcboswNEAqlM/qLvHNgvy1g6Lbz4PZ4zMM8bsNO567hFi6/VN6PJSEYDrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ccc6Q14z62k; Fri, 07 Mar 2025 04:15: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 5274FC2n049679; Fri, 7 Mar 2025 04:15:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5274FCmg049676; Fri, 7 Mar 2025 04:15:12 GMT (envelope-from git) Date: Fri, 7 Mar 2025 04:15:12 GMT Message-Id: <202503070415.5274FCmg049676@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: 0e096bb3fcaa - main - netlink: Fix getting route scope of interface's IPv4 addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e096bb3fcaaf663df372aa4abb986e8d63c6e68 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0e096bb3fcaaf663df372aa4abb986e8d63c6e68 commit 0e096bb3fcaaf663df372aa4abb986e8d63c6e68 Author: Zhenlei Huang AuthorDate: 2025-03-07 04:14:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-07 04:14:44 +0000 netlink: Fix getting route scope of interface's IPv4 addresses sin_addr of a `struct sockaddr_in` is stored in network byte order, but IN_LOOPBACK() and IN_LINKLOCAL() want the host order. Reviewed by: melifaro, #network Fixes: 7e5bf68495cc netlink: add netlink support MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49226 --- sys/netlink/route/iface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 93465e55e6aa..8b871576d0b2 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -818,9 +818,9 @@ ifa_get_scope(const struct ifaddr *ifa) { struct in_addr addr; addr = ((const struct sockaddr_in *)sa)->sin_addr; - if (IN_LOOPBACK(addr.s_addr)) + if (IN_LOOPBACK(ntohl(addr.s_addr))) addr_scope = RT_SCOPE_HOST; - else if (IN_LINKLOCAL(addr.s_addr)) + else if (IN_LINKLOCAL(ntohl(addr.s_addr))) addr_scope = RT_SCOPE_LINK; break; } From nobody Fri Mar 7 04:15:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ccc1QL9z5qbsv; Fri, 07 Mar 2025 04:15: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 4Z8Ccb5snxz466t; Fri, 07 Mar 2025 04:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BRK0tbxaDBVxqyaDNKPpCf5vv+W0qi6yGe93nPYh/2A=; b=QN1BAIwTnuFckmc1/yn7IYS/trCy6S7DxWg4jar5V/0S6svCWkwW4msbnQJq5XrU8OqQxt h27zexohXB6diS2AiErNZgcu6ff9LadHKDuqMq7uS735Vo/N/c6KVuQ1i1Bgw1ecsgi1CY YO1Wsii8GWYV8YlOu4D3+nKgFRqqAXKjCSX4WP7+qMmFiIywvMT/DK7pSvdkm68CVg90hs UR3xlpHTQJMBfVoZDu8dsXsP/VbEoqkIh5mJS/Ly8nNmYFwddkyWAfHLKkwjh07sSkGXse K1exc42wJhDH3XyoaKZsgyRiQ5ifqwMatC6dHh12CsCMVB0PqNP67OYNu18zyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741320911; a=rsa-sha256; cv=none; b=jZ1EXgfFMO6EYOhGZu8Qg+sDqRhzOvae+93DYMx0gJ+E11UmWEOj4VrTqdZoZwARjskMw0 SFCqoDqfxv1zbsGR32L1Rnb9v+N8MHGlqG6DE+J5RgQdsAfol5NlFqB0lYN9RKldPONOvs 4d8RTVebBrihaXyZpTZQsEF72ZA6yID8OBfc4g5NbkwcSu5A62E/+StIt3hiWEj9qY/aeR c4knS1fv2bePqPRp4loDabeCWsdWXCZNxHUlmfVuULc/6iPFv3xGTgo0VmHr/ZQeXhFkqE coXcRm91JHqe59C+TjYJqNvcUkhYknpDRkCBQPuu6HoNlfDezGEEUeZoHW1lnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741320911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BRK0tbxaDBVxqyaDNKPpCf5vv+W0qi6yGe93nPYh/2A=; b=G3tVumQeF/vOJ3kTTPEle86jD24ZjV7HGTMRtEYtcY5pU5nR4+kdhnjBtgTXin26xFlLc8 B4v0sb1Ri0iC2FYFB2sIniEbKcT9lteIRWuqa9KNKcttCCtMt/eaw9FIPWaTyk5e6qQsUQ Bm5AzrX1S4e2gnF32y0rZ11c5PwTMQ9nScBD2PaJ6PoCYy1EfB2D/c1YfaaGwZeg8tzEH3 D83XwK2JVbcDuuPSZsXFpRKHy8r4vGxuTWkLdZrXGzz80OzrZNpYXJ8zpmG9k5DL4Ls4j0 HGhIguthEhnoDCLLzjV1FDC5lbhrFt+ITDee22m8aNEb2IziY77+sT3xKQpA2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ccb5T7Xz62j; Fri, 07 Mar 2025 04:15: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 5274FBg9049647; Fri, 7 Mar 2025 04:15:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5274FBdl049644; Fri, 7 Mar 2025 04:15:11 GMT (envelope-from git) Date: Fri, 7 Mar 2025 04:15:11 GMT Message-Id: <202503070415.5274FBdl049644@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: 5d8b48487acc - main - tests/netlink: Assert the route scope of interface's addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d8b48487acc8375675f2b7c4507c98ac5d0bf75 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5d8b48487acc8375675f2b7c4507c98ac5d0bf75 commit 5d8b48487acc8375675f2b7c4507c98ac5d0bf75 Author: Zhenlei Huang AuthorDate: 2025-03-07 04:14:44 +0000 Commit: Zhenlei Huang CommitDate: 2025-03-07 04:14:44 +0000 tests/netlink: Assert the route scope of interface's addresses While here, add one additional IPv4 link-local address to test_46_nofilter to cover the IPv4 RT_SCOPE_LINK case. Reviewed by: melifaro, #network MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49226 --- tests/sys/netlink/test_rtnl_ifaddr.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/sys/netlink/test_rtnl_ifaddr.py b/tests/sys/netlink/test_rtnl_ifaddr.py index 48e53502df54..768bf38153ff 100644 --- a/tests/sys/netlink/test_rtnl_ifaddr.py +++ b/tests/sys/netlink/test_rtnl_ifaddr.py @@ -33,7 +33,10 @@ class TestRtNlIfaddrList(NetlinkTestTemplate, SingleVnetTestTemplate): def setup_method(self, method): method_name = method.__name__ if "4" in method_name: - self.IPV4_PREFIXES = ["192.0.2.1/24"] + if "nofilter" in method_name: + self.IPV4_PREFIXES = ["192.0.2.1/24", "169.254.169.254/16"] + else: + self.IPV4_PREFIXES = ["192.0.2.1/24"] if "6" in method_name: self.IPV6_PREFIXES = ["2001:db8::1/64"] super().setup_method(method) @@ -49,14 +52,21 @@ class TestRtNlIfaddrList(NetlinkTestTemplate, SingleVnetTestTemplate): for rx_msg in self.read_msg_list(msg.nl_hdr.nlmsg_seq, NlRtMsgType.RTM_NEWADDR): ifname = socket.if_indextoname(rx_msg.base_hdr.ifa_index) family = rx_msg.base_hdr.ifa_family - ret.append((ifname, family, rx_msg)) + scope = rx_msg.base_hdr.ifa_scope + ret.append((ifname, family, scope)) ifname = "lo0" - assert len([r for r in ret if r[0] == ifname]) > 0 + assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET and r[2] == RtScope.RT_SCOPE_HOST.value]) == 1 + assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_HOST.value]) == 1 + assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_LINK.value]) == 1 + assert len([r for r in ret if r[0] == ifname]) == 3 ifname = self.vnet.iface_alias_map["if1"].name - assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET]) == 1 - assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6]) == 2 + assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET and r[2] == RtScope.RT_SCOPE_LINK.value]) == 1 + assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET and r[2] == RtScope.RT_SCOPE_UNIVERSE.value]) == 1 + assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_LINK.value]) == 1 + assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_UNIVERSE.value]) == 1 + assert len([r for r in ret if r[0] == ifname]) == 4 def test_46_filter_iface(self): """Tests that listing outputs both IPv4/IPv6 for the specific interface""" From nobody Fri Mar 7 05:24:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8F8F19QbzsyXP; Fri, 07 Mar 2025 05:24: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 4Z8F8D4Y73z3lyM; Fri, 07 Mar 2025 05:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741325052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q8QyexcbUGjfO+fK5M6O6xyGv2dgAmkZBzjttk240no=; b=PSIJSojUEP0hXrPfjibt8V+P6KOKCvJnglHg+4xxxfnyc1x3NTnJVO/bPom8w87m+1/pqM rFFtyoR/dO8mww8M64TErVjoB0xxZliTVnxjE/+PHCNjVocwhpl9GwEkrBpht6oW37dNYW +M5mRyPHpLXB/cTurS4sEttXcJJ1f1AUDMwfLWm/bjEo+gxjiu1ZbQBTw02al4d99QPWxS eI6MJZeIyv+MnT1rdK61rrcXvyOmjbsd3Mb1zGaO17aj8n/cHoLcj2I+wJaCndbJtlwE3I HMFHWrhrYbGeMjJE4qdz7GjZnPtEAmFFb0vC2qnF1zCBkpMhIIiyMkCZYIePIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741325052; a=rsa-sha256; cv=none; b=Vqy1Ee9p58aM+LvLQj8B9ZI1dw7xufAuVCRdSfQLIP0pAemBv6PX7/qeqezlPg3mtb3tNT M+8RsGbaqvXOYRTdbROhXTnasB637vywXGOPGaTU0bFYozi0jvyFwxli/mfmdlDG8juoSJ ReaQM8TTplWy30TSeSAhU/T8mEGsSdwNraQSmfrUeYG39wlIKGo4i6RqDRw3EPknEv86DE sRXTBOBoPZKuKFW3mO1Lft4Qkes3tFzSfdR8XLScBGzZlc6blJ5Az6iAiMrGnCrvEIwUIT WeUNvfvWTWGJh8Du4I/lbGy7Cu4hpReI1EtLvb5ay+l+ak0R3FKL/tenb7UKrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741325052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q8QyexcbUGjfO+fK5M6O6xyGv2dgAmkZBzjttk240no=; b=NduZ7S+uNb+ulRGjnnQ5CBJ+untqE4u+wNpFEWvS4f/PWSpFjlxwi4cGuqv7cjOufU8N5/ vuiPO7wykOhl0G8HCTBRVV2zwsRaxzt246sDmW2jwR+ygFcB+iy2pEGxGUS4IJ+6lxO2z4 vLOw7XVeFqiVF/oMCRVGKMS/Ulp4WUdo69vaDjPdadSOD8YcZPkVMumy9pGlTtKSt5CyX7 ZWyfd1pPjHJmb6bkMul8Klu7XnOWmzSxU29mizlrqjGGtYAw1FcWBjTazV33ROo5NVvkWU ZtwiYazx7ICWGEA/TnUQ6foqu94i5b0WJyy0P4Ryw2HKoWhi5MvyJ3Mgi++eXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8F8D474wz7vq; Fri, 07 Mar 2025 05:24: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 5275OCGD079851; Fri, 7 Mar 2025 05:24:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5275OC4R079848; Fri, 7 Mar 2025 05:24:12 GMT (envelope-from git) Date: Fri, 7 Mar 2025 05:24:12 GMT Message-Id: <202503070524.5275OC4R079848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3416ed9d077f - stable/14 - open.2: add separate paragraph for O_CREAT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3416ed9d077f75b314eb98a2cb1d6fd8273cce13 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3416ed9d077f75b314eb98a2cb1d6fd8273cce13 commit 3416ed9d077f75b314eb98a2cb1d6fd8273cce13 Author: artembunichev AuthorDate: 2025-02-27 14:21:20 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-07 05:23:08 +0000 open.2: add separate paragraph for O_CREAT PR: 284353 (cherry picked from commit 8cebb0630046a8eb10c551a856397ed230e73833) --- lib/libc/sys/open.2 | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index ea4bc9160da1..e29abbb70342 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -231,16 +231,36 @@ is specified and the file exists, the file is truncated to zero length. .Pp If -.Dv O_EXCL -is set with .Dv O_CREAT -and the file already -exists, +is set, but file already exists, +this flag has no effect except when +.Dv O_EXCL +is set too, in this case .Fn open fails with .Er EEXIST . This may be used to implement a simple exclusive access locking mechanism. +In all other cases, the file is created +and the access permission bits (see +.Xr chmod 2) +of the file mode +are set to the value of the third argument taken as +.Fa "mode_t mode" +and passed through the +.Xr umask 2 . +This argument does not affect whether the file is opened +for reading, writing, or for both. +The open' request for a lock on the file, created with +.Dv O_CREAT , +will never fail +(provided that the underlying file system supports locking; +see also +.Dv O_SHLOCK +and +.Dv O_EXLOCK +below). +.Pp If .Dv O_EXCL is set and the last component of the pathname is @@ -289,10 +309,6 @@ semantics can be obtained by setting for a shared lock, or .Dv O_EXLOCK for an exclusive lock. -If creating a file with -.Dv O_CREAT , -the request for the lock will never fail -(provided that the underlying file system supports locking). .Pp .Dv O_DIRECT may be used to minimize or eliminate the cache effects of reading and writing. From nobody Fri Mar 7 05:24:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8F8G07ggzsyZj; Fri, 07 Mar 2025 05:24: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 4Z8F8F4xjQz3lnK; Fri, 07 Mar 2025 05:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741325053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jJDJ+zb9oHh3z9c2XwhUHQGWSRI5QHSmgsAXcGoXcTs=; b=BP/22xZe9Is/nIcy1rjuz9pk2RRElngWJyJIFLOSciOBpEID3JjPJb0Mfhifa57tQqlJA4 4ovzK8edA6G5mxG7yKKh0+U3gvLVCwCF5D/YtxpE1clT84paYEC0gSBpN3zIGgdUecpKKN Xe/5WEnhp05ndGxWDoCXixthMxhv4DURGFZCH4uy7UhZfVWKEKyhZiqddUi4tIRw1W000Q ivG6xxSdA8YsSMToFHc1mZ/mWBx2qur85Hi1nbzxokYZq9J9m1kjjpuBZNIgid/JQdnwsT eo0ZSngI+PeOMDRinxBSkPZrsuqirmOUiP9HX9DEwwQF2h2q+t2CcP1mnaOs3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741325053; a=rsa-sha256; cv=none; b=tVgjYe30BcJHlqtWxpsbELzW5Hu9VZLmmnxVzL/H1eGyUDMBiBuO+NGTxGLJFGYgEmHQNc VmCC7V035hwFcUuTqriIhNWZrZvDhwG1QOwoM46aJX+H8ojfsyLbRZ3Wd/zUMOFmYVMem1 UNoLJhqaeXn4bw6RfCqRXERaZuDcBu2UvbYUrXpdDB0dYuHcDJfM2V1qVQEZLyYX4ux+F5 Dy0oF/XaAogzIPRxvDZDTVajqMOZUHWUg9ApXy8ozyerpmO/ydh9R36hf/pPpOBWv30kfY TU3z61RUZ7i+12HYBCXCyD8u7QdQ5pVUaHQSR7g17Z+sXj3qvREhF5GFgQ50dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741325053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jJDJ+zb9oHh3z9c2XwhUHQGWSRI5QHSmgsAXcGoXcTs=; b=EZ/4jfnl+Yi4XIdF+RJHdeKP6PHlVQ5WtH2cHJ1qzMIdBNiUpijiJ+D0JZikyHExJAg7gR M5DV/XprIWzPBU+i8u+Sv2GHSTDBtpVZ3jSH6QJjy3qwypcLAu1agP0kJiT7HXXJipPMiM Fs0s7yFIgI9YiMsMq/OLjxOrOI1YRAr72iyzQRtBflYgR66ryl0niwAW1v03MM1u8WZFuT vUxOWHda8gCrZnqk1Mvp+jgeuPMykDt16eo6ZLyyEmh3ATihoeq3cKBzWfIYZ74IHlbDZj gb2Si3ei7DkYd2TnfRbai/niBmHP9wP/NJvOqGPOxvmMLrYAAGtdVJSI0zbf8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8F8F4XfPz7g4; Fri, 07 Mar 2025 05:24: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 5275ODK6079883; Fri, 7 Mar 2025 05:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5275ODvK079880; Fri, 7 Mar 2025 05:24:13 GMT (envelope-from git) Date: Fri, 7 Mar 2025 05:24:13 GMT Message-Id: <202503070524.5275ODvK079880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0f78d6433410 - stable/14 - open.2: minor editing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f78d64334105f74b9a7feb71f017edd3f898169 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0f78d64334105f74b9a7feb71f017edd3f898169 commit 0f78d64334105f74b9a7feb71f017edd3f898169 Author: Konstantin Belousov AuthorDate: 2025-02-28 23:40:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-07 05:23:08 +0000 open.2: minor editing (cherry picked from commit e2dd73cf45a6a8d97131bdbe512ab1ff63121d85) --- lib/libc/sys/open.2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index e29abbb70342..7a760df7cf2f 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 3, 2025 +.Dd February 28, 2025 .Dt OPEN 2 .Os .Sh NAME @@ -254,12 +254,12 @@ for reading, writing, or for both. The open' request for a lock on the file, created with .Dv O_CREAT , will never fail -(provided that the underlying file system supports locking; +provided that the underlying file system supports locking; see also .Dv O_SHLOCK and .Dv O_EXLOCK -below). +below. .Pp If .Dv O_EXCL From nobody Fri Mar 7 06:28:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8GYt2h9Gzt3xh; Fri, 07 Mar 2025 06:28: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 4Z8GYt24PTz3MpV; Fri, 07 Mar 2025 06:28:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741328882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vyg6w2e5JFSxLr1tI7vPtWI4/I2OVPCKbgjqyj8sgPs=; b=bLKw77mrt6cmGuTtVtxi/VgRezXHg694u0AKPoAtlTsNNBDuQANW7jxFf66eCkVih+np4r mHQ8wLOn4Jp/u2Y1ZZJG0y13hyuawCW/t0LDnfgOJBapoEnmG8qcypauD7BRspwOwp6TSC 1m/MYhsSo+o5DjplpsTzkVqePKEVZurBxpJaWV7PncPwcVNx9pKxbva6fGSCh3uzpy18ny ymCo01Es8FZ7g5HXe4Bqu9n81yxHWf4XJ/mJg8fpxbTPspDZZR7gO7LYy6shoYKv0TuLWO C7LDSP7cnShwLUqDxCM/Q26KOCloB87pQe8JZzOxMsqf7sTw6ajtsdv32g3xMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741328882; a=rsa-sha256; cv=none; b=SBePn7diNUhPtPba1q+tAZVgkLtPWqkxJ8C77maXTxP34fHn0fkbPJ9+xO7fdfxhbKX0iC z5wAKhZQgBOPLSbZnPNpeYhvC/u5PDT6CelJZxBHM2KC2YNNYs9I2+fOEeTXV+ZoeDWUeT N3KwlHLcRWuvZZ0/qGL5nFJyAQLEv27moJsAjR1b/tgbjzm52mAuXgmG3gbnVm2RaDQ4lV ES7ImrgfshlKZj4YjHtl8tf4Xg47lj6tur7ezSknmht6DQPnIrF7yc9XBMXcvjjoLLf2iC s6fP0jnCoHDCWn85ptUYsc9xlTNQHnyf17QKCuaXu8JM2OIvajurnoKOWmMocA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741328882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vyg6w2e5JFSxLr1tI7vPtWI4/I2OVPCKbgjqyj8sgPs=; b=Nn2+ULT/sZvn0cvt0Mkl9g4Xcop3Ao12MH4f0OUFCjtjzN8z1qlXU6YQvoGPKIysL9zMwe HDS5LI3zl5l2Eb7S5TpDNFv3835iUamcj44C8bQPlN4ExtGl5r1IwnbAHnWkp6uBTS58tn K1RvHF/8rHAmEwA5RnPaj6ksedw4D5Tv/0t2+n7aUn6OIQcThLulgOlpPmY2mhMEpA4kiT DRoV8mp0ARXI8HHQydSOiB99dpFCw3ulqcLTzmmf0WeG6synxkF8u6na7TQwGal1Y72d+/ HMcxAuSFD6WkC1YqsFgA4LXkNP7mzaZP9i32oZHsQt2rlXgt4brzn8rZXZB6mA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8GYt1bzrz9Qg; Fri, 07 Mar 2025 06:28: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 5276S24o092975; Fri, 7 Mar 2025 06:28:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5276S2mX092972; Fri, 7 Mar 2025 06:28:02 GMT (envelope-from git) Date: Fri, 7 Mar 2025 06:28:02 GMT Message-Id: <202503070628.5276S2mX092972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: c7225a3ede3c - main - ig4_iic: Allow sleeping if called from iichid interrupt handler. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7225a3ede3cf99c538158962f4d65dee435bbcd Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c7225a3ede3cf99c538158962f4d65dee435bbcd commit c7225a3ede3cf99c538158962f4d65dee435bbcd Author: Vladimir Kondratyev AuthorDate: 2025-03-07 06:26:51 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 06:26:51 +0000 ig4_iic: Allow sleeping if called from iichid interrupt handler. This replaces 50 ms busy loop with mtx_sleep for the same duration thus saving CPU time when iichid is driven with interrupts. Sponsored by: Future Crew, LLC MFC after: 2 month Differential Revision: https://reviews.freebsd.org/D48956 --- sys/dev/ichiic/ig4_iic.c | 5 +---- sys/dev/ichiic/ig4_var.h | 1 - sys/dev/iicbus/iichid.c | 3 +++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c index c9346ff12350..cd88b28a2d52 100644 --- a/sys/dev/ichiic/ig4_iic.c +++ b/sys/dev/ichiic/ig4_iic.c @@ -72,7 +72,7 @@ #include #include -#define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED() || sc->poll) +#define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED()) /* * tLOW, tHIGH periods of the SCL clock and maximal falling time of both @@ -720,14 +720,11 @@ ig4iic_callback(device_t dev, int index, caddr_t data) if ((how & IIC_WAIT) == 0) { if (sx_try_xlock(&sc->call_lock) == 0) error = IIC_EBUSBSY; - else - sc->poll = true; } else sx_xlock(&sc->call_lock); break; case IIC_RELEASE_BUS: - sc->poll = false; sx_unlock(&sc->call_lock); break; diff --git a/sys/dev/ichiic/ig4_var.h b/sys/dev/ichiic/ig4_var.h index 989cf23779a2..0d000ab34c1d 100644 --- a/sys/dev/ichiic/ig4_var.h +++ b/sys/dev/ichiic/ig4_var.h @@ -93,7 +93,6 @@ struct ig4iic_softc { bool platform_attached : 1; bool use_10bit : 1; bool slave_valid : 1; - bool poll: 1; /* * Locking semantics: diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 346d432a74b5..fb6e8606adae 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -602,7 +603,9 @@ iichid_intr(void *context) * acknowledge interrupts we fetch only length header and discard it. */ maxlen = sc->power_on ? sc->intr_bufsize : 0; + THREAD_SLEEPING_OK(); error = iichid_cmd_read(sc, sc->intr_buf, maxlen, &actual); + THREAD_NO_SLEEPING(); if (error == 0) { if (sc->power_on) { if (actual != 0) From nobody Fri Mar 7 06:28:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8GYv6mp0zt43F; Fri, 07 Mar 2025 06:28: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 4Z8GYv2fnfz3MYX; Fri, 07 Mar 2025 06:28:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741328883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8OSFu+Fr01qplbW2cEiVyDLFoRm+Sj/M6B1ZbFjMwxw=; b=VU1PYwU9aBQShizTcIL1sRd0eXlJ0ctA9z2HQFNWpiCDQT4lRSM8C72knxl/UV8dBuaa8O PanDDKGlXE7UKVmrlVGkWniGRuw1p35gVHN0NL5kd37iYgqNowiTbjW5IvEBqOZd2DmS/f KWcYbs1SL5MLFgk6G2Ydbs8Et5pei/1iuEuPEFbEYu7chJ0FOKiJTyKL6umD5tYUM0Jw36 iPwJov8Q4P42WjntXrd+B4g81bsgZyRc+ZFFzoD/9C6U6mzdIW2Hl5uvC3xcTlIKyvMfci HL3xWonuBPuRKNJNPiQs2rGtI5Cwbj4nxIWS8FT6YZTHWTT8kpzB0hzYfI4sqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741328883; a=rsa-sha256; cv=none; b=MqeDbZmf6DNPutyjHS06YmK4ExCngWp3wVz7wQ/mQJJz0QUlmShSFT09MS6vud6E5ZVvlh RHMaQkLWkCcffqaajEPyzFo84KBf0KT/3eLqBQzAJt+DpbsZrtk9RbWvGvi6iH9uVZgbj+ AOfoNMuzVDnEV6Dcjhmk0UZnOvAI0sDvIotdTVspuHYHZkGlwZehMMA/uxEKIZuINuumzi 3/vgih4Rk9NJ8Y4Iy1ouWpBfaW01qWjBigQKQmFGlai7U6qxwD/SDE2ernDe2cg7DiQ9BY cRs+ZlTpzKktRJigKMWIme7aar706ElDP2/xU5vTQsPY/b52uP57Nx7RwqkJeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741328883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8OSFu+Fr01qplbW2cEiVyDLFoRm+Sj/M6B1ZbFjMwxw=; b=UkOq8PSbpYYUHuNWl8zutgJxZ5gHt3KssquIDqAxRZ6FrfJ4SJtWBTZnNHKbkYay9uZRAH fcLJfxoiIBpkLvT4XRDBcAn3xpOppmQv7yC2viP3LwnnOtUyuYcai8TPBvQZDEnZOUtGQc ovw6SaDV0ihnvir4POMHx+pcxVcazmFgER6pDbRojWrNlIELCXMOjesZnnAsOWLtHDZB1E AUcOOCJWnmdCaa2bhFjKsUbl22zmONTJqwhED444qLzw8fbSRBeDp6v0PnyLcbNcUHDJB3 rU8UAkXnXCXeKOwWqgnal2/e5iKImDyY24CWVhUg9lgSKZz51WpDowoe6e/pow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8GYv2GZZz8cj; Fri, 07 Mar 2025 06:28: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 5276S3sY093018; Fri, 7 Mar 2025 06:28:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5276S3mH093015; Fri, 7 Mar 2025 06:28:03 GMT (envelope-from git) Date: Fri, 7 Mar 2025 06:28:03 GMT Message-Id: <202503070628.5276S3mH093015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 548d3aa856a9 - main - iichid(4): Read wMaxInputLength bytes over I2C even if we discards data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 548d3aa856a97f4483554beceeb57fa9ba0ff913 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=548d3aa856a97f4483554beceeb57fa9ba0ff913 commit 548d3aa856a97f4483554beceeb57fa9ba0ff913 Author: Vladimir Kondratyev AuthorDate: 2025-03-07 06:26:51 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 06:26:51 +0000 iichid(4): Read wMaxInputLength bytes over I2C even if we discards data For some devices e.g. ITE5570 it is not enough to read HID-over-I2C input length header of RESET command response to acknowledge interrupt. Do a full-size read to avoid interrupt storm. Sponsored by: Future Crew LLC MFC after: 2 month Differential Revision: https://reviews.freebsd.org/D48957 --- sys/dev/iicbus/iichid.c | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index fb6e8606adae..1a08bd1d824a 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -284,11 +284,25 @@ iichid_cmd_read(struct iichid_softc* sc, void *buf, iichid_size_t maxlen, return (error); actlen = actbuf[0] | actbuf[1] << 8; - if (actlen <= 2 || actlen == 0xFFFF || maxlen == 0) { +#ifdef IICHID_SAMPLING + if ((actlen == 0 && sc->sampling_rate_slow < 0) || + (maxlen == 0 && sc->sampling_rate_slow >= 0)) { +#else + if (actlen == 0) { +#endif + /* Read and discard reset command response. */ + msgs[0] = (struct iic_msg) + { sc->addr, IIC_M_RD | IIC_M_NOSTART, + le16toh(sc->desc.wMaxInputLength) - 2, sc->intr_buf }; + actlen = 0; +#ifdef IICHID_SAMPLING + } else if ((actlen <= 2 || actlen == 0xFFFF) && + sc->sampling_rate_slow >= 0) { /* Read and discard 1 byte to send I2C STOP condition. */ msgs[0] = (struct iic_msg) { sc->addr, IIC_M_RD | IIC_M_NOSTART, 1, actbuf }; actlen = 0; +#endif } else { actlen -= 2; if (actlen > maxlen) { @@ -580,7 +594,7 @@ iichid_intr(void *context) { struct iichid_softc *sc; device_t parent; - iichid_size_t maxlen, actual; + iichid_size_t actual; int error; sc = context; @@ -602,9 +616,8 @@ iichid_intr(void *context) * (to ON) before any other command. As some hardware requires reads to * acknowledge interrupts we fetch only length header and discard it. */ - maxlen = sc->power_on ? sc->intr_bufsize : 0; THREAD_SLEEPING_OK(); - error = iichid_cmd_read(sc, sc->intr_buf, maxlen, &actual); + error = iichid_cmd_read(sc, sc->intr_buf, sc->intr_bufsize, &actual); THREAD_NO_SLEEPING(); if (error == 0) { if (sc->power_on) { @@ -812,6 +825,7 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, void *context, struct hid_rdesc_info *rdesc) { struct iichid_softc *sc; + device_t parent; if (intr == NULL) return; @@ -821,33 +835,38 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, * Do not rely on wMaxInputLength, as some devices may set it to * a wrong length. Find the longest input report in report descriptor. */ - rdesc->rdsize = rdesc->isize; + rdesc->rdsize = + MAX(rdesc->isize, le16toh(sc->desc.wMaxInputLength) - 2); /* Write and get/set_report sizes are limited by I2C-HID protocol. */ rdesc->grsize = rdesc->srsize = IICHID_SIZE_MAX; rdesc->wrsize = IICHID_SIZE_MAX; + parent = device_get_parent(sc->dev); + iicbus_request_bus(parent, sc->dev, IIC_WAIT); + sc->intr_handler = intr; sc->intr_ctx = context; - sc->intr_buf = malloc(rdesc->rdsize, M_DEVBUF, M_WAITOK | M_ZERO); sc->intr_bufsize = rdesc->rdsize; + sc->intr_buf = realloc(sc->intr_buf, sc->intr_bufsize, + M_DEVBUF, M_WAITOK | M_ZERO); #ifdef IICHID_SAMPLING - sc->dup_buf = malloc(rdesc->rdsize, M_DEVBUF, M_WAITOK | M_ZERO); + sc->dup_buf = realloc(sc->dup_buf, sc->intr_bufsize, + M_DEVBUF, M_WAITOK | M_ZERO); taskqueue_start_threads(&sc->taskqueue, 1, PI_TTY, "%s taskq", device_get_nameunit(sc->dev)); #endif + iicbus_release_bus(parent, sc->dev); } static void iichid_intr_unsetup(device_t dev, device_t child __unused) { +#ifdef IICHID_SAMPLING struct iichid_softc *sc; sc = device_get_softc(dev); -#ifdef IICHID_SAMPLING taskqueue_drain_all(sc->taskqueue); - free(sc->dup_buf, M_DEVBUF); #endif - free(sc->intr_buf, M_DEVBUF); } static int @@ -1132,6 +1151,8 @@ iichid_attach(device_t dev) sc->power_on = true; + sc->intr_bufsize = le16toh(sc->desc.wMaxInputLength) - 2; + sc->intr_buf = malloc(sc->intr_bufsize, M_DEVBUF, M_WAITOK | M_ZERO); TASK_INIT(&sc->suspend_task, 0, iichid_suspend_task, sc); #ifdef IICHID_SAMPLING sc->taskqueue = taskqueue_create_fast("iichid_tq", M_WAITOK | M_ZERO, @@ -1142,6 +1163,7 @@ iichid_attach(device_t dev) sc->sampling_rate_slow = -1; sc->sampling_rate_fast = IICHID_SAMPLING_RATE_FAST; sc->sampling_hysteresis = IICHID_SAMPLING_HYSTERESIS; + sc->dup_buf = malloc(sc->intr_bufsize, M_DEVBUF, M_WAITOK | M_ZERO); #endif sc->irq_rid = 0; @@ -1164,6 +1186,7 @@ iichid_attach(device_t dev) if (sc->irq_res != NULL) bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq_res); + iichid_detach(dev); error = ENXIO; goto done; #endif @@ -1189,7 +1212,7 @@ iichid_attach(device_t dev) if (sc->sampling_rate_slow >= 0) { pause("iichid", (hz + 999) / 1000); - (void)iichid_cmd_read(sc, NULL, 0, NULL); + (void)iichid_cmd_read(sc, sc->intr_buf, 0, NULL); } #endif /* IICHID_SAMPLING */ @@ -1232,7 +1255,9 @@ iichid_detach(device_t dev) if (sc->taskqueue != NULL) taskqueue_free(sc->taskqueue); sc->taskqueue = NULL; + free(sc->dup_buf, M_DEVBUF); #endif + free(sc->intr_buf, M_DEVBUF); return (0); } From nobody Fri Mar 7 06:28:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8GYw5rf4zt3rZ; Fri, 07 Mar 2025 06:28: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 4Z8GYw3g8lz3Ms2; Fri, 07 Mar 2025 06:28:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741328884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbjDr1HcPoC3p5rrQbllFeLrkaYK8J0stwl6s7oI0+k=; b=j6QhuOq4q8dlH9zsN5gY4Ox1ML4V+YBOVdjZeBdwzCBRnyp2hA8vylM0CCzEZRDURu1VSh qW3V9XIxwmPUu1jiv1L0KKbTU7JI4L7W+EAgf1CG64IBvoeQl7NNSf1T+6W54PCTWoSJ4A hBQtPP0VZxxKIe8FTc7/l9jiGMGjp5R8PG6vL9rkS09t4Cek6mcWLcH3jLDCAeaJYId+KC UAZ6FrSeYn0mfJpwdXEDuqPdcZftbxB39TTyVMXg6LS04fZ1DDRmQsErG6PFgYe4gDAY6C q8JIhVoNsK6qp7Hl1/zNpzR987GehHxnCUfhvKK++HcjHPuEKZcY4eyEfOQEPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741328884; a=rsa-sha256; cv=none; b=u4TtqTpfueaTWt7uFkpP2H5D3/m1JUKMsk3Y9ESY4u2S7qFInyjUZKkAUatxB3EZNvTPNV 3Rep1LJIftc+d3O9Zy+nllr8lNrm2fldMyBOOtNmamQXQcBLSuqk36s4D30DSJsxrwIopT zCBd1xARMda7XjfWqV63anm1HzvXFpZSnMem7Vzd67rcc60I2GPiREUiLDY+EVEoefC6AB Dd/4pQAuSpi1or+r7dgPviEcpqSkEXIF/e08Uhouy3jKFItJLrvmH+eY9FJ4V7nS2xP/v9 hGe6Rk4UXr2YOA+Wyj/RuFuosmp4GP5xu0wVUWZ95/UzyrMso4OyDgXXtUcZhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741328884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbjDr1HcPoC3p5rrQbllFeLrkaYK8J0stwl6s7oI0+k=; b=wmEV+qUT8PJgSLm1CcBYzhVT+4eTrH5jIzwQzcGwKodDGAMcUVPkhSR4VGI5zwL9JSmqMf Luw3zEkR8IYuJJgVJo0hyO8AcMqfk0vVJsEBCvD4je06ZSi90R+LM0O5z9VV7pAS4fsIc2 V+JiQlPSsqOGsUEKLlgZd2q235i7rT8f4Wla9RKn1q6hD3cl1QB9fq8Rcj6QbRXqMwyZhb XPfgeNKVu/o0/IlD8cRjXNezcqbwWf3ldUlUmHTE1XJLjYMeSTPELoExgplu+FXMTMWT4M /VS4HGqnxxWDRmEwj1iYNw52OjfTIyBkuB+F1m2GYJQS3DNdi4fJKIlODvUGug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8GYw34pWz8vv; Fri, 07 Mar 2025 06:28: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 5276S4tP093059; Fri, 7 Mar 2025 06:28:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5276S46x093056; Fri, 7 Mar 2025 06:28:04 GMT (envelope-from git) Date: Fri, 7 Mar 2025 06:28:04 GMT Message-Id: <202503070628.5276S46x093056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: daa098cc37b9 - main - iichid(4): Wait for RESET command response while attaching List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: daa098cc37b9db36281623c00558976aea4fa90e Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=daa098cc37b9db36281623c00558976aea4fa90e commit daa098cc37b9db36281623c00558976aea4fa90e Author: Vladimir Kondratyev AuthorDate: 2025-03-07 06:26:51 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 06:26:51 +0000 iichid(4): Wait for RESET command response while attaching before starting of children initialization to ensure that parent device is fully functional. Sponsored by: Future Crew LLC MFC after: 2 month Differential Revision: https://reviews.freebsd.org/D48958 --- sys/dev/iicbus/iichid.c | 55 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 1a08bd1d824a..b86858791a4d 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -98,6 +98,8 @@ enum { #define I2C_HID_POWER_ON 0x0 #define I2C_HID_POWER_OFF 0x1 +#define IICHID_RESET_TIMEOUT 5 /* seconds */ + /* * Since interrupt resource acquisition is not always possible (in case of GPIO * interrupts) iichid now supports a sampling_mode. @@ -156,6 +158,7 @@ enum iichid_powerstate_how { */ struct iichid_softc { device_t dev; + struct mtx mtx; bool probe_done; int probe_result; @@ -190,6 +193,7 @@ struct iichid_softc { bool open; /* iicbus lock */ bool suspend; /* iicbus lock */ bool power_on; /* iicbus lock */ + bool reset_acked; /* iichid mtx */ }; static device_probe_t iichid_probe; @@ -295,6 +299,12 @@ iichid_cmd_read(struct iichid_softc* sc, void *buf, iichid_size_t maxlen, { sc->addr, IIC_M_RD | IIC_M_NOSTART, le16toh(sc->desc.wMaxInputLength) - 2, sc->intr_buf }; actlen = 0; + if (!sc->reset_acked) { + mtx_lock(&sc->mtx); + sc->reset_acked = true; + wakeup(&sc->reset_acked); + mtx_unlock(&sc->mtx); + } #ifdef IICHID_SAMPLING } else if ((actlen <= 2 || actlen == 0xFFFF) && sc->sampling_rate_slow >= 0) { @@ -1136,21 +1146,9 @@ iichid_attach(device_t dev) device_printf(dev, "failed to power on: %d\n", error); return (ENXIO); } - /* - * Windows driver sleeps for 1ms between the SET_POWER and RESET - * commands. So we too as some devices may depend on this. - */ - pause("iichid", (hz + 999) / 1000); - - error = iichid_reset(sc); - if (error) { - device_printf(dev, "failed to reset hardware: %d\n", error); - error = ENXIO; - goto done; - } - sc->power_on = true; + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); sc->intr_bufsize = le16toh(sc->desc.wMaxInputLength) - 2; sc->intr_buf = malloc(sc->intr_bufsize, M_DEVBUF, M_WAITOK | M_ZERO); TASK_INIT(&sc->suspend_task, 0, iichid_suspend_task, sc); @@ -1209,12 +1207,40 @@ iichid_attach(device_t dev) &sc->sampling_hysteresis, 0, "number of missing samples before enabling of slow mode"); hid_add_dynamic_quirk(&sc->hw, HQ_IICHID_SAMPLING); +#endif /* IICHID_SAMPLING */ + + /* + * Windows driver sleeps for 1ms between the SET_POWER and RESET + * commands. So we too as some devices may depend on this. + */ + pause("iichid", (hz + 999) / 1000); + + error = iichid_reset(sc); + if (error) { + device_printf(dev, "failed to reset hardware: %d\n", error); + iichid_detach(dev); + error = ENXIO; + goto done; + } + /* Wait for RESET response */ +#ifdef IICHID_SAMPLING if (sc->sampling_rate_slow >= 0) { pause("iichid", (hz + 999) / 1000); (void)iichid_cmd_read(sc, sc->intr_buf, 0, NULL); - } + } else #endif /* IICHID_SAMPLING */ + { + mtx_lock(&sc->mtx); + if (!sc->reset_acked && !cold) { + error = mtx_sleep(&sc->reset_acked, &sc->mtx, 0, + "iichid_reset", hz * IICHID_RESET_TIMEOUT); + if (error != 0) + device_printf(sc->dev, + "Reset timeout expired\n"); + } + mtx_unlock(&sc->mtx); + } child = device_add_child(dev, "hidbus", DEVICE_UNIT_ANY); if (child == NULL) { @@ -1258,6 +1284,7 @@ iichid_detach(device_t dev) free(sc->dup_buf, M_DEVBUF); #endif free(sc->intr_buf, M_DEVBUF); + mtx_destroy(&sc->mtx); return (0); } From nobody Fri Mar 7 07:00:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8HHl4Myrzt5Np; Fri, 07 Mar 2025 07:00: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 4Z8HHk5DChz3gVy; Fri, 07 Mar 2025 07:00:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LktReU4WbwhxAHiQjCNj0FPzmDUkV1m4XTWijyOC4+I=; b=ahmkZ73dXRj5bELrfZveAcgdFhOLVPNkaHV9DAcpicKYjrDe8AO+0pAu/1/VqXkIdOAWPp VG04Xqvd1dQZwdraWAvlCtn7vLV1ZPNSwod77ZkVb+nLKls5Q4D/z5QQ1x3EPaPbIb9q5z Mqf1mYurRdXO3ugfmhF8bVcQLDlOB4ERicBBe3yE/ZzSTFxFdXBigfxjA+LPv/VePgXkC2 3qdPHe6du7IhrZ75q0EgV/2gBRnq+6ombsFdbw/NNjXRTmr3Bb+iZv30szR4FXViVvW/5a dNY4LYnu8iWOEbtLriJ8Q7MZtK2DxukrJ6IiUqlYISe8kb22itkGYVFfj8w0iA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741330850; a=rsa-sha256; cv=none; b=n7NLEXimrFlHF8TRIVRKF8lryuME/N3XNCE7Wr/QQyERiTODzxLtxdjbpLUUtWZecTtbi4 +FlFskLXMBURlPy6kULYnZNH8LyeHavVES1mmdf/GdgJGzusbFYr9h6OeFfKTv1dfVOI9l Bkg7b1vmFzaqxu97ADLK+ICXGzQS+YLPd/2XxWuupjUmx0gt1M8g9z7rkyzl88HwTdE4l4 P0v7vV5D7euilRToFGg06AaK6jZDH3rWoAUDJ/P/w5RP6A9wvfD/ZrW5y31nJ9UkGLJ0fP 4xMWtHvvZSmdUHo10Dx/cZvUe2je2pKsrS7E9pIDHdyjzeaLFM1mEGUQp5/f3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LktReU4WbwhxAHiQjCNj0FPzmDUkV1m4XTWijyOC4+I=; b=mOVXcgayfxIs3mNnI2jWsP51KXAKYC0HY/nqB+ywFP6oWZzivfuEafLBeQgk/mPvCBYPm5 kpuuxiivu7NwL5LfGoX86JrXSnjbMxI/bAmE+sZGbQDP8uqEFVINORrawhC6Dhveh5bDum Gy4ZTRB2uDLbAb097kZoPnZ12RDix/Yx5F4kD6EeDqBfXWVJWljyO3s7yN03etfKzulKdy TlXIhnavia8tbJX/e6UVwWMwxF5P6L1dznXKAbpKR7T63FB/D6FsFQRy8gY7j8V9ZoMcwg qJxqifdaM3GYD3O/f9cFF0OJxlV8E5dCju3Bw6SI5y5USdcFpGNT0TH3W4+ZHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8HHk4l2fzB7q; Fri, 07 Mar 2025 07:00: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 52770o49060646; Fri, 7 Mar 2025 07:00:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52770oH1060643; Fri, 7 Mar 2025 07:00:50 GMT (envelope-from git) Date: Fri, 7 Mar 2025 07:00:50 GMT Message-Id: <202503070700.52770oH1060643@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: e92a78ad7a77 - main - tcp: return EOPNOTSUPP on attempt to connect(2) a listening socket List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: e92a78ad7a778feb60f634ceda245f8b761a76ff Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=e92a78ad7a778feb60f634ceda245f8b761a76ff commit e92a78ad7a778feb60f634ceda245f8b761a76ff Author: Gleb Smirnoff AuthorDate: 2025-03-07 06:57:11 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-07 06:57:11 +0000 tcp: return EOPNOTSUPP on attempt to connect(2) a listening socket This is the error code specified by SUS. Only the TCP over IPv6 required this fix. Fixes: bd4a39cc93d9faf8b5c000855d5aa90df592dd49 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49275 --- sys/netinet/tcp_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 0b4a93390f1b..03687c1d3515 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -594,7 +594,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) goto out; } if (SOLISTENING(so)) { - error = EINVAL; + error = EOPNOTSUPP; goto out; } #ifdef INET From nobody Fri Mar 7 07:00:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8HHm3CXczt5h3; Fri, 07 Mar 2025 07:00: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 4Z8HHl5p4rz3gmh; Fri, 07 Mar 2025 07:00:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8BR5UkdKthS1J4dtyefUposRjqrMvtomPU0E4eoCr8=; b=Q0h1JvjB6rO5J303B/KxE96uiCQhQzoSLpghvzakMcatrhqaTdaSPPb17238uFREZFKEKt EeIpCLrFYq38nF4uIoNTmj41U+3cLM42Plw+4HO99LLzojOvDZl2qDLg/SPfgr6l4bqps2 g27eRqhWBS3UykHjDEn0zVeFgvO1iEMduED7H5lD8hQUh0xO5++PS1fKiJBWwhHCo86nQg BnF8ag3PSSZdRQoWaVaSl09xRdU3RcPv9ROkVguOZbDxNcsJYevwPcyhRFFlpdNC9UaSr1 Dcla6GoZlfEVcZw78JgVnUep1i+dFgod68KG5K0tp/64IYeoGpyF+iENXC4C7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741330851; a=rsa-sha256; cv=none; b=yNmKbza5cByca4HO4aa5P6mZui5vsuR3JpFXDnLy5lRYQJrv0WTuJUrFoSS7JM/n503k5z BSPrAQYPSV5JdLfiwkIJqLgxFNBoyDN2cs5reUaQteuRD+yllgIgY7kFaQ7HLkjqOy1pBG rvGe+rTx03bafQuIUYvPKshg/qjFPPM2aAV8DOWVpAHgnEzjcvUnCV2sdTKe5Gp3m1wF0A dcss32LYNkDb1uNXh+O+mHCP42Amo3pjXIg60RaBWAvbFmwSQCGeVcJxlAU6e1cOcX6HVL r4OuTM/3M7174kSleN2X3NspuwlJiVYeozQr9/lSiONoGI7+2fb/B7wl1nGAlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8BR5UkdKthS1J4dtyefUposRjqrMvtomPU0E4eoCr8=; b=yaGImN6s9Qgzlkni6He52mb3eLJfzjdJU/o7YHvycgQMBwaBrisyYd7Y5YjQSkyqX+kWZj cobBzwGTsj8UjLyVk1hGoQ0E3Vs5Kbaa485zLa0HwBmH6+lWS/eaIEZOcWChPESgAqWe/I A/GUAoAtMWvZbtU6TDsGYCrK+VxJM2fk3rlqYPhw3ZERkFmruYAJGhcW9KuLS2AiUEY10m yXZEo1fJwRVmaoo1KJy3deFoOHl8uw8ZZfeI4t8Gsyn4pqoVOKfWavw8nDOaTeVDAVC90K NGuaTq8evWfHUArnt+PIFjpTSRo1Ht3EPUYJ7oqiwzR5EHrKKiWSPLDadg8+BA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8HHl5P5TzB0D; Fri, 07 Mar 2025 07:00: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 52770pFD060685; Fri, 7 Mar 2025 07:00:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52770p49060682; Fri, 7 Mar 2025 07:00:51 GMT (envelope-from git) Date: Fri, 7 Mar 2025 07:00:51 GMT Message-Id: <202503070700.52770p49060682@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: 2af953b132ee - main - inpcb: inline in_pcbconnect_setup() into in_pcbconnect() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 2af953b132ee8d2eb4d8d7bb15fc38bf04dde348 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2af953b132ee8d2eb4d8d7bb15fc38bf04dde348 commit 2af953b132ee8d2eb4d8d7bb15fc38bf04dde348 Author: Gleb Smirnoff AuthorDate: 2025-03-07 06:57:29 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-07 06:57:29 +0000 inpcb: inline in_pcbconnect_setup() into in_pcbconnect() The separation had been done back in 5200e00e7266 for the purposes of removing a true temporary connect of an unconnected UDP socket that does sendto(2) in 90162a4e87f0. Now, with 69c05f428714 in place, the separation is no longer needed. There should be no functional change. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49142 --- sys/netinet/in_pcb.c | 229 +++++++++++++++++++++------------------------------ sys/netinet/in_pcb.h | 2 - 2 files changed, 94 insertions(+), 137 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 1d9cc1866e15..fa2c60b93cfa 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1088,30 +1088,109 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr_in *sin, in_addr_t *laddrp, int in_pcbconnect(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) { - u_short lport, fport; - in_addr_t laddr, faddr; - int anonport, error; + struct in_addr laddr, faddr; + u_short lport; + int error; + bool anonport; INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo); KASSERT(in_nullhost(inp->inp_faddr), ("%s: inp is already connected", __func__)); + KASSERT(sin->sin_family == AF_INET, + ("%s: invalid address family for %p", __func__, sin)); + KASSERT(sin->sin_len == sizeof(*sin), + ("%s: invalid address length for %p", __func__, sin)); - lport = inp->inp_lport; - laddr = inp->inp_laddr.s_addr; - anonport = (lport == 0); - error = in_pcbconnect_setup(inp, sin, &laddr, &lport, &faddr, &fport, - cred); - if (error) - return (error); + if (sin->sin_port == 0) + return (EADDRNOTAVAIL); + + anonport = (inp->inp_lport == 0); + + if (__predict_false(in_broadcast(sin->sin_addr))) { + if (!V_connect_inaddr_wild || CK_STAILQ_EMPTY(&V_in_ifaddrhead)) + return (ENETUNREACH); + /* + * If the destination address is INADDR_ANY, use the primary + * local address. If the supplied address is INADDR_BROADCAST, + * and the primary interface supports broadcast, choose the + * broadcast address for that interface. + */ + if (in_nullhost(sin->sin_addr)) { + faddr = + IA_SIN(CK_STAILQ_FIRST(&V_in_ifaddrhead))->sin_addr; + if ((error = prison_get_ip4(cred, &faddr)) != 0) + return (error); + } else if (sin->sin_addr.s_addr == INADDR_BROADCAST) { + if (CK_STAILQ_FIRST(&V_in_ifaddrhead)->ia_ifp->if_flags + & IFF_BROADCAST) + faddr = satosin(&CK_STAILQ_FIRST( + &V_in_ifaddrhead)->ia_broadaddr)->sin_addr; + else + faddr = sin->sin_addr; + } + } else + faddr = sin->sin_addr; + + if (in_nullhost(inp->inp_laddr)) { + error = in_pcbladdr(inp, &faddr, &laddr, cred); + /* + * If the destination address is multicast and an outgoing + * interface has been set as a multicast option, prefer the + * address of that interface as our source address. + */ + if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) && + inp->inp_moptions != NULL && + inp->inp_moptions->imo_multicast_ifp != NULL) { + struct ifnet *ifp = + inp->inp_moptions->imo_multicast_ifp; + struct in_ifaddr *ia; + + CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { + if (ia->ia_ifp == ifp && + prison_check_ip4(cred, + &ia->ia_addr.sin_addr) == 0) + break; + } + if (ia == NULL) + return (EADDRNOTAVAIL); + laddr = ia->ia_addr.sin_addr; + error = 0; + } + if (error) + return (error); + } else + laddr = inp->inp_laddr; + + if (anonport) { + struct sockaddr_in lsin = { + .sin_family = AF_INET, + .sin_addr = laddr, + }; + struct sockaddr_in fsin = { + .sin_family = AF_INET, + .sin_addr = faddr, + }; + + error = in_pcb_lport_dest(inp, (struct sockaddr *)&lsin, + &lport, (struct sockaddr *)&fsin, sin->sin_port, cred, + INPLOOKUP_WILDCARD); + if (error) + return (error); + } else if (in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, + sin->sin_port, laddr, inp->inp_lport, 0, M_NODOM, RT_ALL_FIBS) != + NULL) + return (EADDRINUSE); + else + lport = inp->inp_lport; - inp->inp_faddr.s_addr = faddr; - inp->inp_fport = fport; + inp->inp_faddr = faddr; + inp->inp_fport = sin->sin_port; /* Do the initial binding of the local address if required. */ if (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) { inp->inp_lport = lport; - inp->inp_laddr.s_addr = laddr; + inp->inp_laddr = laddr; if (in_pcbinshash(inp) != 0) { inp->inp_laddr.s_addr = inp->inp_faddr.s_addr = INADDR_ANY; @@ -1120,7 +1199,7 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) } } else { inp->inp_lport = lport; - inp->inp_laddr.s_addr = laddr; + inp->inp_laddr = laddr; if ((inp->inp_flags & INP_INHASHLIST) != 0) in_pcbrehash(inp); else @@ -1131,7 +1210,7 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) uint32_t hash_val, hash_type; hash_val = fib4_calc_software_hash(inp->inp_laddr, - inp->inp_faddr, 0, fport, + inp->inp_faddr, 0, sin->sin_port, inp->inp_socket->so_proto->pr_protocol, &hash_type); inp->inp_flowid = hash_val; @@ -1354,126 +1433,6 @@ done: return (error); } -/* - * Set up for a connect from a socket to the specified address. - * On entry, *laddrp and *lportp should contain the current local - * address and port for the PCB; these are updated to the values - * that should be placed in inp_laddr and inp_lport to complete - * the connect. - * - * On success, *faddrp and *fportp will be set to the remote address - * and port. These are not updated in the error case. - */ -int -in_pcbconnect_setup(const struct inpcb *inp, struct sockaddr_in *sin, - in_addr_t *laddrp, u_short *lportp, in_addr_t *faddrp, u_short *fportp, - struct ucred *cred) -{ - struct in_ifaddr *ia; - struct in_addr laddr, faddr; - u_short lport, fport; - int error; - - KASSERT(sin->sin_family == AF_INET, - ("%s: invalid address family for %p", __func__, sin)); - KASSERT(sin->sin_len == sizeof(*sin), - ("%s: invalid address length for %p", __func__, sin)); - - /* - * Because a global state change doesn't actually occur here, a read - * lock is sufficient. - */ - NET_EPOCH_ASSERT(); - INP_LOCK_ASSERT(inp); - INP_HASH_LOCK_ASSERT(inp->inp_pcbinfo); - - if (sin->sin_port == 0) - return (EADDRNOTAVAIL); - laddr.s_addr = *laddrp; - lport = *lportp; - faddr = sin->sin_addr; - fport = sin->sin_port; - if (V_connect_inaddr_wild && !CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { - /* - * If the destination address is INADDR_ANY, - * use the primary local address. - * If the supplied address is INADDR_BROADCAST, - * and the primary interface supports broadcast, - * choose the broadcast address for that interface. - */ - if (faddr.s_addr == INADDR_ANY) { - faddr = - IA_SIN(CK_STAILQ_FIRST(&V_in_ifaddrhead))->sin_addr; - if ((error = prison_get_ip4(cred, &faddr)) != 0) - return (error); - } else if (faddr.s_addr == (u_long)INADDR_BROADCAST) { - if (CK_STAILQ_FIRST(&V_in_ifaddrhead)->ia_ifp->if_flags & - IFF_BROADCAST) - faddr = satosin(&CK_STAILQ_FIRST( - &V_in_ifaddrhead)->ia_broadaddr)->sin_addr; - } - } else if (faddr.s_addr == INADDR_ANY) { - return (ENETUNREACH); - } - if (laddr.s_addr == INADDR_ANY) { - error = in_pcbladdr(inp, &faddr, &laddr, cred); - /* - * If the destination address is multicast and an outgoing - * interface has been set as a multicast option, prefer the - * address of that interface as our source address. - */ - if (IN_MULTICAST(ntohl(faddr.s_addr)) && - inp->inp_moptions != NULL) { - struct ip_moptions *imo; - struct ifnet *ifp; - - imo = inp->inp_moptions; - if (imo->imo_multicast_ifp != NULL) { - ifp = imo->imo_multicast_ifp; - CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { - if (ia->ia_ifp == ifp && - prison_check_ip4(cred, - &ia->ia_addr.sin_addr) == 0) - break; - } - if (ia == NULL) - error = EADDRNOTAVAIL; - else { - laddr = ia->ia_addr.sin_addr; - error = 0; - } - } - } - if (error) - return (error); - } - - if (lport != 0) { - if (in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, - fport, laddr, lport, 0, M_NODOM, RT_ALL_FIBS) != NULL) - return (EADDRINUSE); - } else { - struct sockaddr_in lsin, fsin; - - bzero(&lsin, sizeof(lsin)); - bzero(&fsin, sizeof(fsin)); - lsin.sin_family = AF_INET; - lsin.sin_addr = laddr; - fsin.sin_family = AF_INET; - fsin.sin_addr = faddr; - error = in_pcb_lport_dest(inp, (struct sockaddr *) &lsin, - &lport, (struct sockaddr *)& fsin, fport, cred, - INPLOOKUP_WILDCARD); - if (error) - return (error); - } - *laddrp = laddr.s_addr; - *lportp = lport; - *faddrp = faddr.s_addr; - *fportp = fport; - return (0); -} - void in_pcbdisconnect(struct inpcb *inp) { diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index b0c64cfbd7ea..b56dedc25d63 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -645,8 +645,6 @@ int in_pcbbind(struct inpcb *, struct sockaddr_in *, int, struct ucred *); int in_pcbbind_setup(struct inpcb *, struct sockaddr_in *, in_addr_t *, u_short *, int, struct ucred *); int in_pcbconnect(struct inpcb *, struct sockaddr_in *, struct ucred *); -int in_pcbconnect_setup(const struct inpcb *, struct sockaddr_in *, - in_addr_t *, u_short *, in_addr_t *, u_short *, struct ucred *); void in_pcbdisconnect(struct inpcb *); void in_pcbdrop(struct inpcb *); void in_pcbfree(struct inpcb *); From nobody Fri Mar 7 07:00:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8HHn2JSLzt5kL; Fri, 07 Mar 2025 07:00: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 4Z8HHn045hz3gmm; Fri, 07 Mar 2025 07:00:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvNVPK4VqFWWNTabFBBa5w+hiSym3DwYizvv2a/qn1Q=; b=HKRMjPHzqZTb4d9KgZQv+82ywnlcfJb05McJxQzb/uA7LcUuYv9N+EmHVzlV1kA7twO0ui yf73GwW52EGVjmKAR4asjTEnTYKgNoh/RrOOmjxp8hhbZVUN6CKoSVFlcTqYYyEeFOvgy2 TxWWIUcgh5bPoYwqZX6Dk341LudMPQkMK/h2X/PTTe4mocVL+3jWfoo6dDtXEW1b1LQMCN 0yFmJ3nDcFiKWf6V6TdBgKRP+0BgzaIRSyc0G9eQW6g3gFYVXRRniKp1FC4acG27ruNxdk yh+B0xHaejIHqZ0BA77pBZMBOzgOkFHUOHpJrr/ucZTtxQeNa1xtXB2XzecYFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741330853; a=rsa-sha256; cv=none; b=PYhuAwXmrUxldy7G8ogyV4QZcnay/4+eMOwa8FynPOBYrltKA5ijoMaQ+z+ukqSGXIaYyb wFp0Vi/isMWM3a3K8fQd8ntpEQPjRxDxWKLdKLianOviAqiqsz/elv2iGqqEahXAbrQuzv +ycDu5kADmIi1Euv24oevblz7RYVYdmQvIB8+azu8p05W/59yMjD39QME2G267d077U0pi jUbrlnA41xg8LSBYIUiSUW3waPy41+7Qxsvme8gIjcd9NM11fIFuDYFrQ+OO+mk9Cmk7S1 8bATeiZGPeAgaW4R2D5G9A0KTlqwViCMcvmG0fQNgSFNQ8h7/JryxERkfl2A1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvNVPK4VqFWWNTabFBBa5w+hiSym3DwYizvv2a/qn1Q=; b=wNHpmuue+5ObWbBR10dP1dK9xZESeBjEzNRj0W3u1UBaZFrp7abKcHpkcCChTL4Dag7Rcn Q2HdtFUCRguHk+74NXDag8Z1QA889VsBoCxztu3Pu05WaThxpy0v33kGqcBR2MJadkD4BY FwEWnbjAyROwtS5nPRhL3yW/L2EIYcKsxZuZATD+9kYyFKdHZDKB/vF62nKbtX8wczjE0x NnwoBamK4hlVfH8LR4MQ443FV49z5p5OT4wODyEPP8CUFHRFxWeWUpWrr7jSFQxhTiMYNY vkKQ7nRJQqLDiqPRXiPogfan9YGyfcR4IDv2vG0gDs3KzQhfNWTp6vkdCo6/Qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8HHm6cDZz9hh; Fri, 07 Mar 2025 07:00: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 52770qvJ060720; Fri, 7 Mar 2025 07:00:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52770qIu060717; Fri, 7 Mar 2025 07:00:52 GMT (envelope-from git) Date: Fri, 7 Mar 2025 07:00:52 GMT Message-Id: <202503070700.52770qIu060717@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: c7f803c71dae - main - inpcb: fix a panic with SO_REUSEPORT_LB + connect(2) misuse List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: c7f803c71dae9ca64abccc0b17e9014fe66e6d21 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c7f803c71dae9ca64abccc0b17e9014fe66e6d21 commit c7f803c71dae9ca64abccc0b17e9014fe66e6d21 Author: Gleb Smirnoff AuthorDate: 2025-03-07 06:57:44 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-07 06:57:44 +0000 inpcb: fix a panic with SO_REUSEPORT_LB + connect(2) misuse This combination doesn't make any sense. This socket option makes sense only on a socket that is going to be a listening one. There are two options here: refuse connect(2) on a socket that has the option set previously, or ignore (and clear) the option. After some discussion on phabricator, we have chosen the former, for safety and consistency reasons. Any programmer that runs this sequence is doing something wrong and should be informed of that with appropriate error code. Since connect(2) is a SUS API that has a defined set of error codes, none of which corresponds to "a socket has non-standard incompatible socket option set", we decided to return the same error that an already listening socket would return. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49150 --- sys/netinet/tcp_usrreq.c | 4 +- tests/sys/netinet/so_reuseport_lb_test.c | 65 ++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 03687c1d3515..13e66f758d45 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -526,7 +526,7 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) } if ((error = prison_remote_ip4(td->td_ucred, &sinp->sin_addr)) != 0) goto out; - if (SOLISTENING(so)) { + if (SOLISTENING(so) || so->so_options & SO_REUSEPORT_LB) { error = EOPNOTSUPP; goto out; } @@ -593,7 +593,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) error = EAFNOSUPPORT; goto out; } - if (SOLISTENING(so)) { + if (SOLISTENING(so) || so->so_options & SO_REUSEPORT_LB) { error = EOPNOTSUPP; goto out; } diff --git a/tests/sys/netinet/so_reuseport_lb_test.c b/tests/sys/netinet/so_reuseport_lb_test.c index aaadaead5e23..a1b5a3f94f61 100644 --- a/tests/sys/netinet/so_reuseport_lb_test.c +++ b/tests/sys/netinet/so_reuseport_lb_test.c @@ -478,6 +478,69 @@ ATF_TC_BODY(bind_without_listen, tc) ATF_REQUIRE_MSG(error == 0, "close() failed: %s", strerror(errno)); } +/* + * Check that SO_REUSEPORT_LB doesn't mess with connect(2). + * Two sockets: + * 1) auxiliary peer socket 'p', where we connect to + * 2) test socket 's', that sets SO_REUSEPORT_LB and then connect(2)s to 'p' + */ +ATF_TC_WITHOUT_HEAD(connect_not_bound); +ATF_TC_BODY(connect_not_bound, tc) +{ + struct sockaddr_in sin = { + .sin_family = AF_INET, + .sin_len = sizeof(sin), + .sin_addr = { htonl(INADDR_LOOPBACK) }, + }; + socklen_t slen = sizeof(struct sockaddr_in); + int p, s, rv; + + ATF_REQUIRE((p = socket(PF_INET, SOCK_STREAM, 0)) > 0); + ATF_REQUIRE(bind(p, (struct sockaddr *)&sin, sizeof(sin)) == 0); + ATF_REQUIRE(listen(p, 1) == 0); + ATF_REQUIRE(getsockname(p, (struct sockaddr *)&sin, &slen) == 0); + + s = lb_listen_socket(PF_INET, 0); + rv = connect(s, (struct sockaddr *)&sin, sizeof(sin)); + ATF_REQUIRE_MSG(rv == -1 && errno == EOPNOTSUPP, + "Expected EOPNOTSUPP on connect(2) not met. Got %d, errno %d", + rv, errno); + + close(p); + close(s); +} + +/* + * Same as above, but we also bind(2) between setsockopt(2) of SO_REUSEPORT_LB + * and the connect(2). + */ +ATF_TC_WITHOUT_HEAD(connect_bound); +ATF_TC_BODY(connect_bound, tc) +{ + struct sockaddr_in sin = { + .sin_family = AF_INET, + .sin_len = sizeof(sin), + .sin_addr = { htonl(INADDR_LOOPBACK) }, + }; + socklen_t slen = sizeof(struct sockaddr_in); + int p, s, rv; + + ATF_REQUIRE((p = socket(PF_INET, SOCK_STREAM, 0)) > 0); + ATF_REQUIRE(bind(p, (struct sockaddr *)&sin, sizeof(sin)) == 0); + ATF_REQUIRE(listen(p, 1) == 0); + + s = lb_listen_socket(PF_INET, 0); + ATF_REQUIRE(bind(s, (struct sockaddr *)&sin, sizeof(sin)) == 0); + ATF_REQUIRE(getsockname(p, (struct sockaddr *)&sin, &slen) == 0); + rv = connect(s, (struct sockaddr *)&sin, sizeof(sin)); + ATF_REQUIRE_MSG(rv == -1 && errno == EOPNOTSUPP, + "Expected EOPNOTSUPP on connect(2) not met. Got %d, errno %d", + rv, errno); + + close(p); + close(s); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, basic_ipv4); @@ -486,6 +549,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, double_listen_ipv4); ATF_TP_ADD_TC(tp, double_listen_ipv6); ATF_TP_ADD_TC(tp, bind_without_listen); + ATF_TP_ADD_TC(tp, connect_not_bound); + ATF_TP_ADD_TC(tp, connect_bound); return (atf_no_error()); } From nobody Fri Mar 7 07:00:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8HHp2yNZzt5kM; Fri, 07 Mar 2025 07:00: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 4Z8HHp14Bqz3h3j; Fri, 07 Mar 2025 07:00:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xV0xCLpQ5ReIfmrCMUTBbOPBrcQcIh/O6dauQ+r9TMY=; b=wbXfQxZSTJ9fIIfFx9eAjUP7uKQrZaL7VI54h7kSEIVaJYNU/23IMgc+YW61nLy+fj//q0 1dMR/qDD2VhVE1z4hxOTDejz3FMIXgoepuHktXfDIrZyZN2tE1SMtQjJGPftmpFA85gSvn rKLvFZ/YpaHdvH8bHB0BcKhv999Z7kiP/4hf7+kmPREZaSCsvMzBc0ZRDBVWdj3WY7lBC0 tdxyER3dMaevdL37iEgdWNquUGIiMXaAvhVxNLwQR64/q8uel52PChdaEgfsSVwRpEXXEX MziRfVtLS0D+YardVhKXwA/MUoppwYT8PqG+gCvUDYp3BinH4Z511EmAUJk9pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741330854; a=rsa-sha256; cv=none; b=Mlmspy6dSvI6Nc+L1xona9hqPYF7ZqaCYcULV1WoitjIsQ6lO5H/5KTWmiKNvbFXHCTiym GrUMZMxK83SSO7TMiexhlJKxhNqCWzaLNCUFRFadfvG2e2aE/YLBIUDtEUjwAaxk37GXGL WOJBAm/vd0sL7/9LAIbIO/fEi4Jw84vuJj1YvMC+vEDnSpVQJ+Sih/IUL7pNU3h/p2Z7HP yPg9yKvt8baOa6rpQNzcipWgz4WnfzJ2g33Qd0fqkJ1mV4lKxWLeUUXDaOWuTHBAazJCq9 gAzkhj5F04AgSkjWihsQqKs+p0emtLaTrHDXO48AGdD/yEEbdv6fwCU02Bk7SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xV0xCLpQ5ReIfmrCMUTBbOPBrcQcIh/O6dauQ+r9TMY=; b=YeClsbgBBd9Ku5BJ1R2BKEfQVMuVMsUKImJjHsbxcEN9c5otv350MtJdVu3j7eVqxbd028 gXNsDr8f1/EZZCnhbRK1ZQHfbtIGbnLLas/hGeNP0NEpaz+RjKIGS/ul2QLzrZErso07wF 1U0iD78QfTt3vCrRfQLQL8TjnzYWP3ZRswBmIT+2i8RWIVisfpd/S/AWN29e+lg3VT23DM GlTtOAoYlKridUCoSsj/Mt4E88TUE948xlQuMnX9qTtf7nvHU59C9xMeJHaxxbn22MdtVs XK7i9hKwJkjFHhWomVZFLFXonJU91tEZ+u8RM7QLe13mQeu0LciYKVv3jcl7hA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8HHp082Cz9Wq; Fri, 07 Mar 2025 07:00: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 52770rwV060755; Fri, 7 Mar 2025 07:00:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52770rIw060752; Fri, 7 Mar 2025 07:00:53 GMT (envelope-from git) Date: Fri, 7 Mar 2025 07:00:53 GMT Message-Id: <202503070700.52770rIw060752@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: 79fb0d247403 - main - inpcb: make inpcb hash insertion/removal functions private List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 79fb0d247403e205b038f27a3bec90495f500acb Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=79fb0d247403e205b038f27a3bec90495f500acb commit 79fb0d247403e205b038f27a3bec90495f500acb Author: Gleb Smirnoff AuthorDate: 2025-03-07 06:58:29 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-07 06:58:29 +0000 inpcb: make inpcb hash insertion/removal functions private --- sys/netinet/in_pcb.h | 3 --- sys/netinet/in_pcb_var.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index b56dedc25d63..c2b90de2ef54 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -648,7 +648,6 @@ int in_pcbconnect(struct inpcb *, struct sockaddr_in *, struct ucred *); void in_pcbdisconnect(struct inpcb *); void in_pcbdrop(struct inpcb *); void in_pcbfree(struct inpcb *); -int in_pcbinshash(struct inpcb *); int in_pcbladdr(const struct inpcb *, struct in_addr *, struct in_addr *, struct ucred *); int in_pcblbgroup_numa(struct inpcb *, int arg); @@ -660,8 +659,6 @@ struct inpcb * in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *, struct mbuf *); void in_pcbref(struct inpcb *); -void in_pcbrehash(struct inpcb *); -void in_pcbremhash_locked(struct inpcb *); bool in_pcbrele(struct inpcb *, inp_lookup_t); bool in_pcbrele_rlocked(struct inpcb *); bool in_pcbrele_wlocked(struct inpcb *); diff --git a/sys/netinet/in_pcb_var.h b/sys/netinet/in_pcb_var.h index 32fdbced175c..fb88dfec889e 100644 --- a/sys/netinet/in_pcb_var.h +++ b/sys/netinet/in_pcb_var.h @@ -55,6 +55,9 @@ int in_pcb_lport_dest(const struct inpcb *inp, struct sockaddr *lsa, struct ucred *cred, int lookupflags); struct inpcb *in_pcblookup_local(struct inpcbinfo *, struct in_addr, u_short, int, int, struct ucred *); +int in_pcbinshash(struct inpcb *); +void in_pcbrehash(struct inpcb *); +void in_pcbremhash_locked(struct inpcb *); struct inpcbport { struct inpcbhead phd_pcblist; From nobody Fri Mar 7 07:00:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8HHq3b7kzt5dl; Fri, 07 Mar 2025 07:00: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 4Z8HHq2Cwsz3gmw; Fri, 07 Mar 2025 07:00:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c4nQRAQH7mlRO4EUcih5OOlGQaO5XQR1VuzG4gF71Mc=; b=pB8eyccBAJucvPQw+H8i8GGMBuPH5T6S+adjR+/EkRLR6eUNtPs3bHaY5qLGTdfgn2ezeg V4iBraS3lqGxsfhdvphhtEReDB4Tx9kEEN9IGjj+P4K3yWYL1vSdtvzbowSjFKdTjla+dq +cYH/erChLecVttZyX9sKzSAQndqouiIpuTsChR8CoO9ElZTu8Ca2YbcxxbESkyX6lt5CX 5Ta/Uluav4WI9TCS7ncMKbAtw1wRTq5PXUbFwJx/1CyX0SGBRJ7a8r20sef+FnGH2IKjeV MrsNnyyeSevWtlLBT9lOf3ZF/94YbRzC2BLQf8kapPFlBepnOTW3l+S8GcuZxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741330855; a=rsa-sha256; cv=none; b=LKIKHXrBFAnHJNDV6g3vDJOo0hAtEm+Ijo8YlfLNcsRdDp+vAujSF3eV7UC8N31FsKtgx9 +Z7ecuHlRJ79cJsA+uyCmXDCyqnWBft7dP6dCQgjUSjdosYf852uI+mMbeKwKXNW8qzcC4 kBwYKbRuJ1SLs2IdFKYoy1Rrc/IUyU4/1i4FAri/FLf2b6Yw1vWolQ06uJi+afvrZzhmLD xgMiZVc9GowJYJXV9pzBQihFPPQ41xrt9f3lUk9IlMDggOuaV3Hygsfs6USfuub/uqGg5J cUXw1TOfpaUZqSFboldnfpmSGwaSHRp6kcR/GeonBDgUkVlPtcQZiKGAh43YlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c4nQRAQH7mlRO4EUcih5OOlGQaO5XQR1VuzG4gF71Mc=; b=DT4+nKt9jNoknT/w/ed/wlACd85oD9k24K0wW51T2t7wLomokvIRStBvJsuavAdreBKK08 CFz9iTmAR5VzO9dIBgAmcBYW3rYkRjHdg4sWmi2iJdEKxUDza3CGWwNgUPCdNs2aat0bAu PstO774hpU9ZykiJ/QPqd61XlQHHfHqokHyHTKoBbCARE1Xfpi20gIrllkBD4eemrU8S7c yf5adLveRZlu37ZbJsi+3XnCkaU6LtdicCVRCi6nlS/ShVxzuxqjHRY/4XeuQch7AlFhuE P2IV2oSq5I5yNwbZfMfd1O7b2hooXdE8o8A3b0Tm4EI91hxiNOuP+hEwi373Sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8HHq1SGZzB7s; Fri, 07 Mar 2025 07:00: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 52770tcq060818; Fri, 7 Mar 2025 07:00:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52770t7D060807; Fri, 7 Mar 2025 07:00:55 GMT (envelope-from git) Date: Fri, 7 Mar 2025 07:00:55 GMT Message-Id: <202503070700.52770t7D060807@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: 5f539170784c - main - inpcb: retire two-level port hash database List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 5f539170784cf8aed6989e055ff3ac190d0de80b Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=5f539170784cf8aed6989e055ff3ac190d0de80b commit 5f539170784cf8aed6989e055ff3ac190d0de80b Author: Gleb Smirnoff AuthorDate: 2025-03-07 06:58:35 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-07 06:58:35 +0000 inpcb: retire two-level port hash database This structure originates from the pre-FreeBSD times when system RAM was measured in single digits of MB and Internet speeds were measured in Kb. At first level the database hashes the port value only to calculate index into array of pointers to lazily allocated headers that hold lists of inpcbs with the same local port. This design apparently was made to preserve kernel memory. In the modern kernel size of the first level of the hash is derived from maxsockets, which is derived from maxfiles, which in its turn is derived from amount of physical memory. Then the size of the hash is capped by IPPORT_MAX, cause it doesn't make any sense to have hash table larger then the set of possible values. In practice this cap works even on my laptop. I haven't done precise calculation or experiments, but my guess is that any system with > 8 Gb of RAM will be autotuned to IPPORT_MAX sized hash. Apparently, this hash is a degenerate one: it never has more than one entries in any slot. You can check this with kgdb: set $i = 0 while ($i <= tcbinfo->ipi_porthashmask) set $p = tcbinfo->ipi_porthashbase[$i].clh_first set $c = 0 while ($p != 0) set $c = $c + 1 set $p = $p->phd_hash.cle_next end if ($c > 1) printf "Slot %u count %u", $i, $c end set $i = $i + 1 end Retiring the two level hash we remove a lot of complexity at the cost of only one comparison 'inp->inp_lport != lport' in the lookup cycle, which is going to be always false on most machines anyway. This comparison definitely shall be cheaper than extra pointer traversal. Another positive change to be singled out is that now we no longer need to allocate memory in non-sleepable context in in_pcbinshash(), so a potential ENOMEM on connect(2) is removed. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49151 --- sys/netinet/in_pcb.c | 143 +++++++++++++++-------------------------------- sys/netinet/in_pcb.h | 7 +-- sys/netinet/in_pcb_var.h | 6 -- sys/netinet6/in6_pcb.c | 75 +++++++++++-------------- 4 files changed, 79 insertions(+), 152 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index fa2c60b93cfa..08097ea8c1b9 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -576,7 +576,6 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, struct inpcbstorage *pcbstor, pcbinfo->ipi_lbgrouphashbase = hashinit(porthash_nelements, M_PCB, &pcbinfo->ipi_lbgrouphashmask); pcbinfo->ipi_zone = pcbstor->ips_zone; - pcbinfo->ipi_portzone = pcbstor->ips_portzone; pcbinfo->ipi_smr = uma_zone_get_smr(pcbinfo->ipi_zone); } @@ -612,10 +611,6 @@ in_pcbstorage_init(void *arg) pcbstor->ips_zone = uma_zcreate(pcbstor->ips_zone_name, pcbstor->ips_size, NULL, NULL, pcbstor->ips_pcbinit, inpcb_fini, UMA_ALIGN_CACHE, UMA_ZONE_SMR); - pcbstor->ips_portzone = uma_zcreate(pcbstor->ips_portzone_name, - sizeof(struct inpcbport), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - uma_zone_set_smr(pcbstor->ips_portzone, - uma_zone_get_smr(pcbstor->ips_zone)); } /* @@ -627,7 +622,6 @@ in_pcbstorage_destroy(void *arg) struct inpcbstorage *pcbstor = arg; uma_zdestroy(pcbstor->ips_zone); - uma_zdestroy(pcbstor->ips_portzone); } /* @@ -2028,71 +2022,58 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, */ return (NULL); } else { - struct inpcbporthead *porthash; - struct inpcbport *phd; + struct inpcbhead *porthash; struct inpcb *match = NULL; + /* - * Best fit PCB lookup. - * - * First see if this local port is in use by looking on the - * port hash list. + * Port is in use by one or more PCBs. Look for best + * fit. */ porthash = &pcbinfo->ipi_porthashbase[INP_PCBPORTHASH(lport, pcbinfo->ipi_porthashmask)]; - CK_LIST_FOREACH(phd, porthash, phd_hash) { - if (phd->phd_port == lport) - break; - } - if (phd != NULL) { + CK_LIST_FOREACH(inp, porthash, inp_portlist) { + if (inp->inp_lport != lport) + continue; + if (!prison_equal_ip4(inp->inp_cred->cr_prison, + cred->cr_prison)) + continue; + if (fib != RT_ALL_FIBS && + inp->inp_inc.inc_fibnum != fib) + continue; + wildcard = 0; +#ifdef INET6 + /* XXX inp locking */ + if ((inp->inp_vflag & INP_IPV4) == 0) + continue; /* - * Port is in use by one or more PCBs. Look for best - * fit. + * We never select the PCB that has INP_IPV6 flag and + * is bound to :: if we have another PCB which is bound + * to 0.0.0.0. If a PCB has the INP_IPV6 flag, then we + * set its cost higher than IPv4 only PCBs. + * + * Note that the case only happens when a socket is + * bound to ::, under the condition that the use of the + * mapped address is allowed. */ - CK_LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) { - wildcard = 0; - if (!prison_equal_ip4(inp->inp_cred->cr_prison, - cred->cr_prison)) - continue; - if (fib != RT_ALL_FIBS && - inp->inp_inc.inc_fibnum != fib) - continue; -#ifdef INET6 - /* XXX inp locking */ - if ((inp->inp_vflag & INP_IPV4) == 0) - continue; - /* - * We never select the PCB that has - * INP_IPV6 flag and is bound to :: if - * we have another PCB which is bound - * to 0.0.0.0. If a PCB has the - * INP_IPV6 flag, then we set its cost - * higher than IPv4 only PCBs. - * - * Note that the case only happens - * when a socket is bound to ::, under - * the condition that the use of the - * mapped address is allowed. - */ - if ((inp->inp_vflag & INP_IPV6) != 0) - wildcard += INP_LOOKUP_MAPPED_PCB_COST; + if ((inp->inp_vflag & INP_IPV6) != 0) + wildcard += INP_LOOKUP_MAPPED_PCB_COST; #endif - if (inp->inp_faddr.s_addr != INADDR_ANY) + if (inp->inp_faddr.s_addr != INADDR_ANY) + wildcard++; + if (inp->inp_laddr.s_addr != INADDR_ANY) { + if (laddr.s_addr == INADDR_ANY) + wildcard++; + else if (inp->inp_laddr.s_addr != laddr.s_addr) + continue; + } else { + if (laddr.s_addr != INADDR_ANY) wildcard++; - if (inp->inp_laddr.s_addr != INADDR_ANY) { - if (laddr.s_addr == INADDR_ANY) - wildcard++; - else if (inp->inp_laddr.s_addr != laddr.s_addr) - continue; - } else { - if (laddr.s_addr != INADDR_ANY) - wildcard++; - } - if (wildcard < matchwild) { - match = inp; - matchwild = wildcard; - if (matchwild == 0) - break; - } + } + if (wildcard < matchwild) { + match = inp; + matchwild = wildcard; + if (matchwild == 0) + break; } } return (match); @@ -2642,10 +2623,8 @@ _in6_pcbinshash_wild(struct inpcbhead *pcbhash, struct inpcb *inp) int in_pcbinshash(struct inpcb *inp) { - struct inpcbhead *pcbhash; - struct inpcbporthead *pcbporthash; + struct inpcbhead *pcbhash, *pcbporthash; struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; - struct inpcbport *phd; uint32_t hash; bool connected; @@ -2685,31 +2664,6 @@ in_pcbinshash(struct inpcb *inp) return (error); } - /* - * Go through port list and look for a head for this lport. - */ - CK_LIST_FOREACH(phd, pcbporthash, phd_hash) { - if (phd->phd_port == inp->inp_lport) - break; - } - - /* - * If none exists, malloc one and tack it on. - */ - if (phd == NULL) { - phd = uma_zalloc_smr(pcbinfo->ipi_portzone, M_NOWAIT); - if (phd == NULL) { - if ((inp->inp_flags & INP_INLBGROUP) != 0) - in_pcbremlbgrouphash(inp); - return (ENOMEM); - } - phd->phd_port = inp->inp_lport; - CK_LIST_INIT(&phd->phd_pcblist); - CK_LIST_INSERT_HEAD(pcbporthash, phd, phd_hash); - } - inp->inp_phd = phd; - CK_LIST_INSERT_HEAD(&phd->phd_pcblist, inp, inp_portlist); - /* * The PCB may have been disconnected in the past. Before we can safely * make it visible in the hash table, we must wait for all readers which @@ -2730,6 +2684,7 @@ in_pcbinshash(struct inpcb *inp) #endif _in_pcbinshash_wild(pcbhash, inp); } + CK_LIST_INSERT_HEAD(pcbporthash, inp, inp_portlist); inp->inp_flags |= INP_INHASHLIST; return (0); @@ -2738,7 +2693,6 @@ in_pcbinshash(struct inpcb *inp) void in_pcbremhash_locked(struct inpcb *inp) { - struct inpcbport *phd = inp->inp_phd; INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo); @@ -2761,10 +2715,6 @@ in_pcbremhash_locked(struct inpcb *inp) CK_LIST_REMOVE(inp, inp_hash_exact); } CK_LIST_REMOVE(inp, inp_portlist); - if (CK_LIST_FIRST(&phd->phd_pcblist) == NULL) { - CK_LIST_REMOVE(phd, phd_hash); - uma_zfree_smr(inp->inp_pcbinfo->ipi_portzone, phd); - } inp->inp_flags &= ~INP_INHASHLIST; } @@ -3275,8 +3225,7 @@ db_print_inpcb(struct inpcb *inp, const char *name, int indent) } db_print_indent(indent); - db_printf("inp_phd: %p inp_gencnt: %ju\n", inp->inp_phd, - (uintmax_t)inp->inp_gencnt); + db_printf("inp_gencnt: %ju\n", (uintmax_t)inp->inp_gencnt); } DB_SHOW_COMMAND(inpcb, db_show_inpcb) diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index c2b90de2ef54..5fe12c4f1e76 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -64,7 +64,6 @@ * protocol-specific control block) are stored here. */ CK_LIST_HEAD(inpcbhead, inpcb); -CK_LIST_HEAD(inpcbporthead, inpcbport); CK_LIST_HEAD(inpcblbgrouphead, inpcblbgroup); typedef uint64_t inp_gen_t; @@ -221,7 +220,6 @@ struct inpcb { short in6p_hops; }; CK_LIST_ENTRY(inpcb) inp_portlist; /* (r:e/w:h) port list */ - struct inpcbport *inp_phd; /* (r:e/w:h) head of this list */ inp_gen_t inp_gencnt; /* (c) generation count */ void *spare_ptr; /* Spare pointer. */ rt_gen_t inp_rt_cookie; /* generation for route entry */ @@ -370,7 +368,7 @@ struct inpcbinfo { /* * Global hash of inpcbs, hashed by only local port number. */ - struct inpcbporthead *ipi_porthashbase; /* (h) */ + struct inpcbhead *ipi_porthashbase; /* (h) */ u_long ipi_porthashmask; /* (h) */ /* @@ -392,11 +390,9 @@ struct inpcbinfo { */ struct inpcbstorage { uma_zone_t ips_zone; - uma_zone_t ips_portzone; uma_init ips_pcbinit; size_t ips_size; const char * ips_zone_name; - const char * ips_portzone_name; const char * ips_infolock_name; const char * ips_hashlock_name; }; @@ -414,7 +410,6 @@ static struct inpcbstorage prot = { \ .ips_size = sizeof(struct ppcb), \ .ips_pcbinit = prot##_inpcb_init, \ .ips_zone_name = zname, \ - .ips_portzone_name = zname " ports", \ .ips_infolock_name = iname, \ .ips_hashlock_name = hname, \ }; \ diff --git a/sys/netinet/in_pcb_var.h b/sys/netinet/in_pcb_var.h index fb88dfec889e..7e8a1626ab40 100644 --- a/sys/netinet/in_pcb_var.h +++ b/sys/netinet/in_pcb_var.h @@ -59,12 +59,6 @@ int in_pcbinshash(struct inpcb *); void in_pcbrehash(struct inpcb *); void in_pcbremhash_locked(struct inpcb *); -struct inpcbport { - struct inpcbhead phd_pcblist; - CK_LIST_ENTRY(inpcbport) phd_hash; - u_short phd_port; -}; - /* * Load balance groups used for the SO_REUSEPORT_LB socket option. Each group * (or unique address:port combination) can be re-used at most diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 64c886ca2ed5..e77a1e9d3e87 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -767,56 +767,45 @@ in6_pcblookup_local(struct inpcbinfo *pcbinfo, const struct in6_addr *laddr, */ return (NULL); } else { - struct inpcbporthead *porthash; - struct inpcbport *phd; + struct inpcbhead *porthash; struct inpcb *match = NULL; + /* - * Best fit PCB lookup. - * - * First see if this local port is in use by looking on the - * port hash list. + * Port is in use by one or more PCBs. Look for best + * fit. */ porthash = &pcbinfo->ipi_porthashbase[INP_PCBPORTHASH(lport, pcbinfo->ipi_porthashmask)]; - CK_LIST_FOREACH(phd, porthash, phd_hash) { - if (phd->phd_port == lport) - break; - } - if (phd != NULL) { - /* - * Port is in use by one or more PCBs. Look for best - * fit. - */ - CK_LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) { - wildcard = 0; - if (!prison_equal_ip6(cred->cr_prison, - inp->inp_cred->cr_prison)) - continue; - /* XXX inp locking */ - if ((inp->inp_vflag & INP_IPV6) == 0) - continue; - if (fib != RT_ALL_FIBS && - inp->inp_inc.inc_fibnum != fib) + CK_LIST_FOREACH(inp, porthash, inp_portlist) { + if (inp->inp_lport != lport) + continue; + if (!prison_equal_ip6(cred->cr_prison, + inp->inp_cred->cr_prison)) + continue; + /* XXX inp locking */ + if ((inp->inp_vflag & INP_IPV6) == 0) + continue; + if (fib != RT_ALL_FIBS && + inp->inp_inc.inc_fibnum != fib) + continue; + wildcard = 0; + if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) + wildcard++; + if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) { + if (IN6_IS_ADDR_UNSPECIFIED(laddr)) + wildcard++; + else if (!IN6_ARE_ADDR_EQUAL( + &inp->in6p_laddr, laddr)) continue; - if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) + } else { + if (!IN6_IS_ADDR_UNSPECIFIED(laddr)) wildcard++; - if (!IN6_IS_ADDR_UNSPECIFIED( - &inp->in6p_laddr)) { - if (IN6_IS_ADDR_UNSPECIFIED(laddr)) - wildcard++; - else if (!IN6_ARE_ADDR_EQUAL( - &inp->in6p_laddr, laddr)) - continue; - } else { - if (!IN6_IS_ADDR_UNSPECIFIED(laddr)) - wildcard++; - } - if (wildcard < matchwild) { - match = inp; - matchwild = wildcard; - if (matchwild == 0) - break; - } + } + if (wildcard < matchwild) { + match = inp; + matchwild = wildcard; + if (matchwild == 0) + break; } } return (match); From nobody Fri Mar 7 07:00:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8HHs62Nrzt5hB; Fri, 07 Mar 2025 07:00: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 4Z8HHr6cwvz3hFp; Fri, 07 Mar 2025 07:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0NOpNUPNGwOP09Eclxysy/DgGwgM07zD2EX1hufPNA=; b=dKH6BKEMUVSpE802YCyPQsXyliobXt/pSX7WGRes7CVC9rvvC1s0AgBbPherrYYF+gFaJT BT9KvIIWGKxFJCQqAjtXHzMXqFLEG1YLyiUu1fE3mSv5nU3HjVeduOoweVZBbWFuCKVXV/ PDQtdZ4NbASHm4KbDCXJGKoC/IuVCN+oWR2r/MxHUssoTA7qFQO25BffRNaoTuZWm6j6A4 cyGdP9Boe68jbk3kaASSadRy5mqqLU/1bskwXKKWAIKaN4z7a3j/0wh+wepCQHAgdpeo+h wf3pCOlX2FxyEZIQ0EyQU88nOBDYjzpz1jsyEkbPhrKE6bKoRczzJTrY+WP7og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741330857; a=rsa-sha256; cv=none; b=DMRywymJNkbZBwsiDNjWGk7H/fazEADDCUrT+op15EohRIqzwJqsiIyIlFaE4Pr8VWQmIT LPdOh1rdvbVAaMcL5veVICf+wJ3QpKsJhm+3rm3s15ZGHRTlfZCkzacd8rVi2U3mEGWSKt em6/zMIy6E36ewbPVxGmLWgeBz3HPbccP+agvkCWm5Tx27MBofUpD1hxbqtsKG0HfTbDz6 lOOgx69WhPq9sMnJC9oQgXmk7QLKIrayLMZmn5Yi69s1bTyXE1xg4e1y4N9Y/iw63e4Fma O5S1s2i12Ztr3YPBPfmkfmSqskQI44an1EWnq7mVqS9L73Hrr3UApdLTeU5mHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0NOpNUPNGwOP09Eclxysy/DgGwgM07zD2EX1hufPNA=; b=ErqadsyEPMXrrF4FUPi4blgiEG8fM5L6JFT02p3etnoSZImgfkLuuSeESPA/5Pnnv7dVSh 7allokYwHhWEgjYTXuyKZAi/H/VSwXz6tOOWlM8KGde6I0Z5rILQme/9iRRaCabp5lhkIR PLXG9OiH581qYKiTHPx7apYF/7ByYk4VgjFvKD5z/ilIpagu9KRbeBB9+Awrq7UldSCQwG xcOZsLXp9bXng0NKMBYb1PkDHTFhTqHnDpnFXRq/ItJXxcI1ImQLk5Hq55UtnrXhNHMdBW sDi4Y5hWlt2+CukRM0QYclMxXQ8wXsxX0BMkmeRiLihzilwkGf3ocChmsL7mlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8HHr1zzVzB4H; Fri, 07 Mar 2025 07:00: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 52770uhb062271; Fri, 7 Mar 2025 07:00:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52770uY6062258; Fri, 7 Mar 2025 07:00:56 GMT (envelope-from git) Date: Fri, 7 Mar 2025 07:00:56 GMT Message-Id: <202503070700.52770uY6062258@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: 452187b61147 - main - inpcb: in_pcbinshash() now can't fail on connect(2) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 452187b611470a827215e9cd103a5616b8610662 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=452187b611470a827215e9cd103a5616b8610662 commit 452187b611470a827215e9cd103a5616b8610662 Author: Gleb Smirnoff AuthorDate: 2025-03-07 06:59:40 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-07 06:59:40 +0000 inpcb: in_pcbinshash() now can't fail on connect(2) Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49152 --- sys/netinet/in_pcb.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 08097ea8c1b9..8a99297f3818 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1178,27 +1178,19 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) else lport = inp->inp_lport; + MPASS(!in_nullhost(inp->inp_laddr) || inp->inp_lport != 0 || + !(inp->inp_flags & INP_INHASHLIST)); + inp->inp_faddr = faddr; inp->inp_fport = sin->sin_port; + inp->inp_laddr = laddr; + inp->inp_lport = lport; - /* Do the initial binding of the local address if required. */ - if (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) { - inp->inp_lport = lport; - inp->inp_laddr = laddr; - if (in_pcbinshash(inp) != 0) { - inp->inp_laddr.s_addr = inp->inp_faddr.s_addr = - INADDR_ANY; - inp->inp_lport = inp->inp_fport = 0; - return (EAGAIN); - } - } else { - inp->inp_lport = lport; - inp->inp_laddr = laddr; - if ((inp->inp_flags & INP_INHASHLIST) != 0) - in_pcbrehash(inp); - else - in_pcbinshash(inp); - } + if ((inp->inp_flags & INP_INHASHLIST) == 0) { + error = in_pcbinshash(inp); + MPASS(error == 0); + } else + in_pcbrehash(inp); #ifdef ROUTE_MPATH if (CALC_FLOWID_OUTBOUND) { uint32_t hash_val, hash_type; From nobody Fri Mar 7 07:00:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8HHt1C1Rzt5Ht; Fri, 07 Mar 2025 07:00: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 4Z8HHs3sp1z3h94; Fri, 07 Mar 2025 07:00:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8SnTKqvSeTLIXhFa02Lrh/F7Ht6kedfuT4kyToZBSQ=; b=x0xioRrLsLsquioopcJ4NYC3/2RK/kXCBKKaPuUDmvlG6tTucQXSB7JVbNGlCHI8F9Ro25 sqfVU3QleeCjZxvYKJm6n7Gtg83uZeV1i6KM+E54nzeqb/JAs1ZSnm6iIMb8A/Oew89l/3 RG9LjBvE63taePYyx9pSpCMbXO6kvexLQu7XU2Mz0xpgtCr36y2Kfa27mNA9GpAig6VlNj qTdR5iQq+qPyqDUsoAE0dOuC+xarmJNMsOlclZgcxHR9GjVnhenyPIs8I5Zj9KQtHPrxyt OYZadUDFl7k6I3WJT9jWBv+xkUMVRKnxlh5preE+J9xc3L7oz2wGHuyECxI2iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741330857; a=rsa-sha256; cv=none; b=iUrHd8Qx7itmyyhbeFOeIHf5E6D07mbYl4pyMLNpHytTv0JenqGFpKLqyU8GTZAeOatUHZ D/aMmAoYs83uR1H+rZpS3UuQEWt8Ow9tcDOxzQH1Fi92lI6fAc/iKiFRL1Nx1FSzQStBUL R1NXopdgmlfBlfof0BbmjQOdP2+1xD0gG8lEGfeC8LQmY9NL9evmmkh2je5XtnXYA2+h3+ K8JxqTE8AaV1P2qeetPWuUlPLyAf+8gjkmxcNcjEfWn3ZNS06P+JYNKmy27xr4Jkiptuak +bJncMZxnGeZaCQnYfv616Nb4VPu/+3Hb74D+cBjMTAUs65YpQI+EmUf1p4vwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741330857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8SnTKqvSeTLIXhFa02Lrh/F7Ht6kedfuT4kyToZBSQ=; b=jFARA0yaTMVrkQ181nSD4h4Dlw40UtXIoZ+xESQKbYnoPoYHzsW/lLv1+L/2SryQTrrmx/ OxS4qI08VK/cSJE0bpx7SFJbWCDKPQMWPTbb1HXOkwl/N23DrJ7460nL09Z1da5FSAFim8 cQPKkQUD0PFEcOopYxlcDm1ekFySRTDwhbb+PaPLFZiUewlEUxZGOEa4epa+4IIzaFES06 T3swrWefZsyqKecr7m4N7kBowX67xFcH8YZA9hokoz7lJ9CQpkFDgwUDCzklGOCVvkydYL O2Z3bmbIMT2HKdwPY1QJIvkWYALhEWK4QXLqadHDJ2A7+qpGfV+75+EP3bwtsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8HHs2wmbzBBZ; Fri, 07 Mar 2025 07:00: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 52770vcF063471; Fri, 7 Mar 2025 07:00:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52770vnb063468; Fri, 7 Mar 2025 07:00:57 GMT (envelope-from git) Date: Fri, 7 Mar 2025 07:00:57 GMT Message-Id: <202503070700.52770vnb063468@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: 136c5e17b61a - main - inpcb: return ENOMEM if bind(2) fails to allocate lbgroup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 136c5e17b61a16482c696d4ba417e02563a7e465 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=136c5e17b61a16482c696d4ba417e02563a7e465 commit 136c5e17b61a16482c696d4ba417e02563a7e465 Author: Gleb Smirnoff AuthorDate: 2025-03-07 06:59:46 +0000 Commit: Gleb Smirnoff CommitDate: 2025-03-07 06:59:46 +0000 inpcb: return ENOMEM if bind(2) fails to allocate lbgroup The SO_REUSEPORT_LB isn't a standard option, neither ENOMEM is a specified return code from bind(2), but it definitely is more appropriate than EAGAIN or the masked ENOBUFS. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49153 --- sys/netinet/in_pcb.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 8a99297f3818..47852a8cda4b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -435,7 +435,7 @@ in_pcbinslbgrouphash(struct inpcb *inp, uint8_t numa_domain) inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, INPCBLBGROUP_SIZMIN, numa_domain, fib); if (grp == NULL) - return (ENOBUFS); + return (ENOMEM); in_pcblbgroup_insert(grp, inp); CK_LIST_INSERT_HEAD(hdr, grp, il_list); } else if (grp->il_inpcnt + grp->il_pendcnt == grp->il_inpsiz) { @@ -449,7 +449,7 @@ in_pcbinslbgrouphash(struct inpcb *inp, uint8_t numa_domain) /* Expand this local group. */ grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); if (grp == NULL) - return (ENOBUFS); + return (ENOMEM); in_pcblbgroup_insert(grp, inp); } else { in_pcblbgroup_insert(grp, inp); @@ -732,11 +732,12 @@ in_pcbbind(struct inpcb *inp, struct sockaddr_in *sin, int flags, &inp->inp_lport, flags, cred); if (error) return (error); - if (in_pcbinshash(inp) != 0) { + if (__predict_false((error = in_pcbinshash(inp)) != 0)) { + MPASS(inp->inp_socket->so_options & SO_REUSEPORT_LB); inp->inp_laddr.s_addr = INADDR_ANY; inp->inp_lport = 0; inp->inp_flags &= ~INP_BOUNDFIB; - return (EAGAIN); + return (error); } if (anonport) inp->inp_flags |= INP_ANONPORT; @@ -2611,6 +2612,10 @@ _in6_pcbinshash_wild(struct inpcbhead *pcbhash, struct inpcb *inp) /* * Insert PCB onto various hash lists. + * + * With normal sockets this function shall not fail, so it could return void. + * But for SO_REUSEPORT_LB it may need to allocate memory with locks held, + * that's the only condition when it can fail. */ int in_pcbinshash(struct inpcb *inp) From nobody Fri Mar 7 09:55:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8M971QmFz2tr2p; Fri, 07 Mar 2025 09:55: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 4Z8M962qJrz3wmD; Fri, 07 Mar 2025 09:55:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741341322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QawxurF9A25bUS2iirk46V1OXMs/mnUMsWp7UPWNn2c=; b=a3I28RKkKcSaE25sxLOKzPHd0AhjpWOGjKwABJmleGf8c4444fFZaJbXEQl6mraZnLqwl2 BT0h4D1H1djFhjR4/TPoBBQwbH3JqgcA+nfbeUdra/TF2813DagtDVoat++oDnruOklM3M iHo6P1Q8DZ/rwlctSVzVu2dY7GDCjMYyo9Eu93yykIm5EOL6+9vvylrxrNJiW28JEpcIuT NurGU+hXj78e2sI7dL/a+HbUHDZMo+ofvFmQjjk9BXeBPho7EGO3fczMOmG/wP6FbAO5qG Fhh2F+Ivlbc6jXoy/BZWBjDLoiCk2r4V6eDJ9lhiC7VzHyTUTf2tmmQHy5fajw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741341322; a=rsa-sha256; cv=none; b=gSUCBE9O/56yHJCjFYGm9XeASduaW4n8VZHGWPYaVozCRtdi4CJKQIsvki5+w6JQ+RCtjC QoMs9dkKwWLoY7ZZJ/VLNUQgZHz+MJKZFQ/xDe5PRT5gFV/UNBVYR8wo2yjQ+3eseHJ5WJ tMpMKSKDIegcsQCK8bckpjPTXnQtpfsfcEnYpzYMPLV9q3UWV63MZRbUk3NIkcsAFfdvHe 3I7ukqJ7LH2JElG4Y4ZH482DJ9pOHrUplhS1MMO3qTVZVj95ViUQxuaqkBGeLrDp/eNlql 1BUrTVcdkYvvmUVjGvbzgYELqJtamXF7bjS99M36rPat2/vGEUZ2F16uMYxFog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741341322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QawxurF9A25bUS2iirk46V1OXMs/mnUMsWp7UPWNn2c=; b=IdMJcosUwosc+lXaTd4j3ZukhjT2NIEO9hdec8TenO1s3Pcp4IrUqc6aP65lMqxQ8yv26+ GePpGBfEMLiWk14lvp6rbl7O3Ae2ng9Kiy2fDVS8rW2LB+rsOg4iKRrR0/AWqojB5pr0jz DFDYLMnhtgOdTfReR5VgBchA3iXa1sSr5ptKxoe8a9FDf1Q8WUtECP1V09Ghs2OKLjnXQ7 jL5ObuCq89Fh/3BDqTk2qIDKch8tFItFiewEFA2+FkaCkiD10cRLtrDPg6subSfKc0QzTg /88RZvh/OK1ETbl/0xEzsluBbxZXWZjlxZceYM4HXoW+piD2mbeK5xfbmNMFmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8M962JlKzXYR; Fri, 07 Mar 2025 09:55: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 5279tMO7084763; Fri, 7 Mar 2025 09:55:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5279tMkX084760; Fri, 7 Mar 2025 09:55:22 GMT (envelope-from git) Date: Fri, 7 Mar 2025 09:55:22 GMT Message-Id: <202503070955.5279tMkX084760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 836c8dad4544 - stable/14 - routing: set net.route.multipath=0 when kernel doesn't have ROUTE_MPATH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 836c8dad4544da568d50918a575ec309315300e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=836c8dad4544da568d50918a575ec309315300e7 commit 836c8dad4544da568d50918a575ec309315300e7 Author: Andrey V. Elsukov AuthorDate: 2025-02-28 14:05:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-03-07 09:54:05 +0000 routing: set net.route.multipath=0 when kernel doesn't have ROUTE_MPATH (cherry picked from commit f2644d64b40f611fd4d4f66069ad8d6cf33f69df) --- sys/net/route/route_ctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index d7756f2a0eb6..e5ddd7782e1e 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -109,10 +109,11 @@ SYSCTL_DECL(_net_route); #define V_rib_route_multipath VNET(rib_route_multipath) #ifdef ROUTE_MPATH #define _MP_FLAGS CTLFLAG_RW +VNET_DEFINE(u_int, rib_route_multipath) = 1; #else #define _MP_FLAGS CTLFLAG_RD +VNET_DEFINE(u_int, rib_route_multipath) = 0; #endif -VNET_DEFINE(u_int, rib_route_multipath) = 1; SYSCTL_UINT(_net_route, OID_AUTO, multipath, _MP_FLAGS | CTLFLAG_VNET, &VNET_NAME(rib_route_multipath), 0, "Enable route multipath"); #undef _MP_FLAGS From nobody Fri Mar 7 09:56:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8MBm0TfJz2trdC; Fri, 07 Mar 2025 09:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8MBl6sskz3xSJ; Fri, 07 Mar 2025 09:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741341408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yt0S2fRBDWaduaNB3prmfJwzbDvPyCV22vdytC6jJhk=; b=A0lw/Ne/H+Rl/XFODkJY7/lf0OQRQnDdJAKSQKPOJB7Lem73S+n0OeLDz5R6PtEzblYrfN grhz6XWCy7NTBtCDLDxDWBN93Cirul/Dgh1cdqD9SNOQ8BmjWplPHRKbAGahZ4DkBjL4Mb FWo20Y5qLbc6U7dGl/6xYAFj20VFKTlY1/pbrXWFz2/Jn0/BZRiW9DL2vRyVcPvuibzOJI skOaXKI9obdAlq32KMioF20oEVW/s0KLmhpR8iuhch/HoBuod/HJN0lf7Yt2+ZKAPz0l4A dadJ0mGWNUsXqaPFteVZeegPykoHEVTfaqVyokn1QYVLJ57/HRwG2o12naMIKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741341408; a=rsa-sha256; cv=none; b=BylAgEFjWlItfZZnMidydYsqLTUWHb8EZ/WfFGeIaBJAhWqnpGfrsPpUEEi0yQqZmSwtnO uU4k/hwlpQvNxT5iw+4G557XC2IdbKno8RZVhAmXd1sDKbzUJsw1YZdtzqCUtuMWnSmjUd SuxHGDh3/p5ZaqE9wECoTyXOdoFV8XjJwUHm46UI7vyDanvzk4Te8Toavy4tf5j5Di6qv6 GyUS6qUjmCpXcXuCMmVt8XIrdaKViV6ps8iyLAQWgBuve/69960aJlXNRn+6qp3J/g3sYr sHE8qJ3Badt6Uz94D2x4hfmhJYJgZ6lKQ3s+m/hXwv2Cwzs1ul6/Am+LQ0s+0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741341408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yt0S2fRBDWaduaNB3prmfJwzbDvPyCV22vdytC6jJhk=; b=eQHAIfBr4TobrFnes9Z2LUNc9BGFCW6ydm2bJ4SxNV/HugmiusdCBGGCpNnqA0t84lMYFr Js57ocSuM6/KRd0cILfwbUGw3eetmGpNPg3jN7tnDL7Jh/fK3aV3EVebfqJ9HLGkK2LKZS YWtQrvnk3CH8G2UBi20yR81lHQIRILr/1shBWRvir5oA8BXSPwEVvWX7inZsvyQCsOJixP LnokOA9umTZwAQ+hgqFhpsQ8PtQAmituIPtzkZN4HHpA53daYfuolsFwLFrwwlsa8gJl6x XGckaH7g7n1fee1Rt6lbEHe6nHVHOl1RhAx1blkhJPk+4N1DwdNCLQeNxiItZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8MBl6Td5zY6P; Fri, 07 Mar 2025 09:56: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 5279ulxY085279; Fri, 7 Mar 2025 09:56:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5279ulrq085276; Fri, 7 Mar 2025 09:56:47 GMT (envelope-from git) Date: Fri, 7 Mar 2025 09:56:47 GMT Message-Id: <202503070956.5279ulrq085276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 699ed29c4fd8 - stable/13 - routing: set net.route.multipath=0 when kernel doesn't have ROUTE_MPATH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 699ed29c4fd8eec3bbf4883bbca7a6e6f4a0fe12 Auto-Submitted: auto-generated The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=699ed29c4fd8eec3bbf4883bbca7a6e6f4a0fe12 commit 699ed29c4fd8eec3bbf4883bbca7a6e6f4a0fe12 Author: Andrey V. Elsukov AuthorDate: 2025-02-28 14:05:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-03-07 09:56:14 +0000 routing: set net.route.multipath=0 when kernel doesn't have ROUTE_MPATH (cherry picked from commit f2644d64b40f611fd4d4f66069ad8d6cf33f69df) --- sys/net/route/route_ctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index fd09998d4a01..712e912189a5 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -106,10 +106,11 @@ SYSCTL_DECL(_net_route); #define V_rib_route_multipath VNET(rib_route_multipath) #ifdef ROUTE_MPATH #define _MP_FLAGS CTLFLAG_RW +VNET_DEFINE(u_int, rib_route_multipath) = 1; #else #define _MP_FLAGS CTLFLAG_RD +VNET_DEFINE(u_int, rib_route_multipath) = 0; #endif -VNET_DEFINE(u_int, rib_route_multipath) = 1; SYSCTL_UINT(_net_route, OID_AUTO, multipath, _MP_FLAGS | CTLFLAG_VNET, &VNET_NAME(rib_route_multipath), 0, "Enable route multipath"); #undef _MP_FLAGS From nobody Fri Mar 7 11:46:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Pd129Kjz5pC37; Fri, 07 Mar 2025 11:46: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 4Z8Pd11gmKz3jBy; Fri, 07 Mar 2025 11:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741347973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IsadnqVmnRhrx5oq3rleTFRzvJY92qpiw/IZGTVvRvw=; b=cP6eXJJSnV2y5V+saV6A7x3a0h02Ud0Ae98LRmABJ0cyCw4UIQJfruP/fXACTR2Ysp6rRj cjU30gilQ9fZDzlaFQElDBCXRqsUvZP7PXS92b5UN40qgHSa7FkyqbEjly7EgJGAX2CUx1 xC4IvHTWQJF1TXieVhftSwz7a167KkhW4jwlPfWKtOYjXWk4g7knYj3jruTGzzEHlHMT7A NkiMf96c+pXn9LoypiRcQeOUHlxtRhGdT5FxeWp8pKEd+3GGNwiBblnlAzM5GlP62jc8+v hNRB0xX1jO+j54/Hy7ORyHF1W2EoK3RIvc0eDaC6Ll8CT2lXC9oDBrhoQnxztg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741347973; a=rsa-sha256; cv=none; b=iSodAKJUW01Mkk8vNpyw78xqMSi4pQc2CqRCqmjrwag8pj1Gf+UmqJufLOFnTYL0p6pHjg akIpn11g5RQvorHMxRg8qJ8pJCmdIEGxTw5YW3N0wsdgOUTMnWpgWGrO7W/lhBYHmrMJJD y/hJVat0cFlBuADYMd5f6aKRu8d8iClAlPa6STIAx71Rzk2YHAurGNMA2L+3grQJgZD9So 3zwSbeCSFfx6FN/TOxGdhFdxsWP8a1q0sJz1SomT8KjLI/uXQxQsLa1ZpI7l1cAvymBn/q 81IUSjZdmNSWCXypim5M3IKBOGt52XOulAPCoDR9EtSwAyv1o5vpBpWpBCpR6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741347973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IsadnqVmnRhrx5oq3rleTFRzvJY92qpiw/IZGTVvRvw=; b=j0+yQWcE8YR9tZhc030MFx+dVyPmsoWsduo1zSNCFoWsatBNNAD3oaqEOunODltRnKIUrX VYRgaB0WAwX36CiWZSQkADEoGdA9HA7AFncRb2RociWhQ3C94YDacC1l2CbmXSqHkHFyMC gu18rrqTGRbZcucIIvvDz9k94hw8hAH8sCctTgGQYGkhUP0Rh8L2Tpaq8/bXfAg/3Sc20y w5iAB1rwlXDGfCSPAi+llMWKJjqgZA2hwQJb4/DM51L1Nt0EMmY7jS4WW+/4kaZz4UhOIL CGNLC/NNgdsShAD2p+/Os7sBE16U4RuGvZddEaYxh+lu7Qy8W8v97IdkmvjpVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Pd10z1WzcDP; Fri, 07 Mar 2025 11:46: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 527BkCxV091308; Fri, 7 Mar 2025 11:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527BkCHX091305; Fri, 7 Mar 2025 11:46:12 GMT (envelope-from git) Date: Fri, 7 Mar 2025 11:46:12 GMT Message-Id: <202503071146.527BkCHX091305@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: cbba69fb5793 - main - release: Use unprivileged mode for bootonly and mini-memstick List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbba69fb5793c238cfd31697667bdff6ce1920b6 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cbba69fb5793c238cfd31697667bdff6ce1920b6 commit cbba69fb5793c238cfd31697667bdff6ce1920b6 Author: Ed Maste AuthorDate: 2025-03-07 11:46:01 +0000 Commit: Ed Maste CommitDate: 2025-03-07 11:46:01 +0000 release: Use unprivileged mode for bootonly and mini-memstick This in effect always builds these targets in NO_ROOT mode, removing one more instance where release artifact builds require a privileged user (root). These artifacts are now always built the same way. Reviewed by: brooks, Pat Maddox Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48121 --- release/Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/release/Makefile b/release/Makefile index 44cd6e4bb8d5..44344c9ff20a 100644 --- a/release/Makefile +++ b/release/Makefile @@ -225,14 +225,12 @@ bootonly: packagesystem MK_TOOLCHAIN=no \ MK_RESCUE=no MK_DICT=no \ MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \ - -DDB_FROM_SRC ) + -DDB_FROM_SRC -DNO_ROOT) # Copy manifest only (no distfiles) to get checksums mkdir -p ${.TARGET}/usr/freebsd-dist cp MANIFEST ${.TARGET}/usr/freebsd-dist -.if defined(NO_ROOT) echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG echo "./usr/freebsd-dist/MANIFEST type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG -.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf @@ -242,13 +240,11 @@ bootonly: packagesystem echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc -.if defined(NO_ROOT) echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG -.endif dvd: packagesystem # Install system @@ -307,7 +303,7 @@ dvd1.iso: dvd pkg-stage cd dvd && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR} bootonly.iso: bootonly-bootonly - cd bootonly-bootonly && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR} + cd bootonly-bootonly && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ../${.TARGET} ./METALOG ${XTRADIR} memstick: memstick.img memstick.img: disc1-memstick @@ -315,7 +311,7 @@ memstick.img: disc1-memstick mini-memstick: mini-memstick.img mini-memstick.img: bootonly-memstick - cd bootonly-memstick && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET} + cd bootonly-memstick && sh ${.CURDIR}/${TARGET}/make-memstick.sh ./METALOG ../${.TARGET} packagesystem: ${DISTRIBUTIONS} sh ${.CURDIR}/scripts/make-manifest.sh $$(ls *.txz | grep -v container) > MANIFEST From nobody Fri Mar 7 15:25:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8VTh4fFWz5pTxd; Fri, 07 Mar 2025 15:25: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 4Z8VTh1BmSz3KND; Fri, 07 Mar 2025 15:25:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741361112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j6beplug1NJ/xO32ieCqIONRHkmUp7+g1svnTZisDHU=; b=j6dYUCljv+TP4riittCd91HPPHnn+FONsyZRG2HXbrfd12xY+217oV3IBF7/sGe1Sw9ttS ow56duMgnKZyDfNJ7AnoDAk5mgU1/7a/MbYyO6TKvRRrVdYxM4hEXjN7+4XcxtbDsQF8CW kANHUXslZGJVffLY8TthGinwvy/4qjGTS6Eil3CyH6v7tT6zRQJvCXuXK2suqXuXzC73VQ qE7vD46J/hJIaAIAJanXsJVXPBR/8vOlEqRwWXjnERFpupJqVK/DzuHxe7EAdS0Gar2Vj6 9VzI6VLwY2JzIlq0XuOjBLUWxwYuNrN1u2XLGyy6j7zmmvbaU4EKXYcCGlFSiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741361112; a=rsa-sha256; cv=none; b=ksHlrer1BSqxjSW6kqT3q7m0A8/lGdrgjIT24DBysiL59CAQb6WcB+YrTij9MfZmOAQ+IF JNKSpPnyouhIkgmuhp+It/nCRnReW2G8I48lLmTr5xUW50WXrx4Hn2f1QuE7n3tzMVYTn7 9u1Wru6nTSanmbC90C2q9cjjXQ4nDSPYy2EuctGN8sQhAlvYXAqcaFRjSPZuEUP/n3PKUx GsjD+B+0KYs3+V2Tx90vqNh/qyftyqVSapJ5c/LvL8+Pry4iREuTJUavAzqxgaWhE20D+q XpaLwBzi2EavXOy9OjLPS3Nrc6H73Y+MIyFMfLvIJGJ0hWsfW9z1g9WjmBnlBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741361112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j6beplug1NJ/xO32ieCqIONRHkmUp7+g1svnTZisDHU=; b=pNrqgTlFrxzr/LUdR1f1BolPNZ6rInIHJLwKNckDGBxfLRG8n8hG160pD4qNFhY1gPbmB7 gfCwBz0ZALLiSMoq4jU2nB4yPxVN0ykliE/6iqFPgBesBOHLA38kaWQn0oRTXllVwKGsG7 Clcui1HRzSdcvhiTraLdsTxQnyTso2Ru2UeL0CwWEBqBHuRdFHQoTIU2HrmEbMm9jBVs1I LWuStFSFiMvTjdkbzeGzRy63OOEmsY4bZHiyuGz57jj0l5Ss3Y/WQHJoxcLVkdpF7ivTXf 2j+No3wy1CUuxJyeN8QYLezt3qMI9p3qyQtHnDFl+oCb2A0UKlNNB4oAKi0NfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8VTh0Dhbzjth; Fri, 07 Mar 2025 15:25: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 527FPBTe003044; Fri, 7 Mar 2025 15:25:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527FPBoj003041; Fri, 7 Mar 2025 15:25:11 GMT (envelope-from git) Date: Fri, 7 Mar 2025 15:25:11 GMT Message-Id: <202503071525.527FPBoj003041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d2e7a078ba6e - stable/14 - ssh: Remove reference to now-upstreamed patch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2e7a078ba6ef5ccb0c2f6149d77a0eaec5421ea Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d2e7a078ba6ef5ccb0c2f6149d77a0eaec5421ea commit d2e7a078ba6ef5ccb0c2f6149d77a0eaec5421ea Author: Ed Maste AuthorDate: 2025-02-20 23:40:52 +0000 Commit: Ed Maste CommitDate: 2025-03-07 15:24:59 +0000 ssh: Remove reference to now-upstreamed patch Our class-based login restrictions patch was merged upstream in commit c276672fc0e9 ("Class-imposed login restrictions"). Sponsored by: The FreeBSD Foundation (cherry picked from commit 79979aa44d1b7fd5d04fd574ba8702f76c81c80c) --- crypto/openssh/FREEBSD-upgrade | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index 2950731c7401..efea4cda77b4 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -154,29 +154,22 @@ counting; the agent will automatically exit when the last client disconnects. -7) Class-based login restrictions (27ceebbc2402) - - We've added code to auth.c to enforce the host.allow, host.deny, - times.allow and times.deny login class capabilities, based on an - upstream submission from - https://github.com/openssh/openssh-portable/pull/262. - -8) Blocklist integration +7) Blocklist integration We include blocklist (https://github.com/zoulasc/blocklist) in FreeBSD, and ssh is patched to report login failures to it. -9) Paths +8) Paths A number of paths are changed to match FreeBSD's configuration (e.g., using /usr/local/ instead of /uxr/X11R6/). -10) Retired patches +9) Retired patches We no longer have client-side VersionAddendum, but we recognize and ignore the configuration options to avoid breaking existing configurations. -11) PrintLastLog bugfix +10) PrintLastLog bugfix Upstream's autoconf sets DISABLE_LASTLOG if the system does not have lastlog.ll_line, but uses it to disable the PrintLastLog configuration From nobody Fri Mar 7 16:01:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8WH24bkwz5pWyG; Fri, 07 Mar 2025 16:01: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 4Z8WH229Tqz3f57; Fri, 07 Mar 2025 16:01:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741363262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8pIhpnukW/pELqXXUc2ewzfI0JMI2Ny6H6ZKT2X+0k=; b=f8a/ry9Btc8GqW1xr8LIl/FOjqzST8Pjj+5i7cmDlpPdEuhPbAgYjfO5gwZb+VvVML5U7v 0LK/gqz9IW9gRJr8Q6ZKfDnPd40c1t484QtYxqWrQRyOjgCoAH8tju9Pk1yZQPdP2n5nik PNu3dphM7Q7HcxMn9bL6y3NDEmdzCHrZ/kWst+BssFTO/3MTOjJX/+Pw/m/HPLZOIe209d P8S4QB0YbhEhSL/dY+mD+DHfu91n7iofpqyah4loXgLDjUJ1uLbgCVJr8RJbqjK1tjC2hM 48M7IFM1FLHDQPjZM9zAu8+xGWDrkxi6gmsdo9GzwrnosWl+yZYn1Bt+yoJehw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741363262; a=rsa-sha256; cv=none; b=o4bXCMTRTirL4al7Deh5of1c7MIaypz3mW00wkMz9VYrQu3xY203JIUn+8i122galNLhiX 0MSdiwP7VQV8MmKSoP/p7JwRRLxpciQeB9COPxE8pvutIwcin8YSaANQ9069g5VqHJxKSA Ax1+VzSh/Cv3daijP24ac3y/85q5ZmyDVGeS1E0McBaps4QiWrSon85x02AuSq6NTwdity m2aBjwYdxRa3QuqVPJHt7o87dYUQ16ZmsPW+6eCf1GZNBc5XJOw2pyh5nBxMacnOsug7Vp q1Af0xUZuw3WRogFlXLiFCGqrs03cT1HthbLicCgZUWfOMTCgpCUeT5vFmqeFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741363262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8pIhpnukW/pELqXXUc2ewzfI0JMI2Ny6H6ZKT2X+0k=; b=q18vQowyE8WmOTCX9deK4VGPgRjvZ40PoAKrEtBgrqaQWIcLXw1d0sh5EdlZ1oX1emuxbl FzDLHRXYvlrz6lLN0iBetGhVOfJ2rkcFYb2v0jfFujdnuCTUXSPfcF9UuSc3RHn9aU96xf ZHNfZ2n9SPFvbaKyVZkEB4X9LJk269/KGx0W4+3AhCqZ/Z89jnW3qlmoNVYfZygme4p8GA 3W4wYEP6IqPKkTVSJs/beNQ4rIa5sU1yhuIwdS3NSD+UINL+zDthFF/e9h5fgpRSGfoiOh 11kBtMTyYSmV9QF96NjsdMwiUKHVQqkSAjzBTq02PRXpiQGxA4jdKA+lYQMJ+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8WH21n8Dzk3R; Fri, 07 Mar 2025 16:01: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 527G124n070703; Fri, 7 Mar 2025 16:01:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527G12u8070700; Fri, 7 Mar 2025 16:01:02 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:01:02 GMT Message-Id: <202503071601.527G12u8070700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 6aab381a498f - main - acpi_gpiobus: assume GPIO_PIN_INPUT for interrupt pins List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6aab381a498f1a43ba372f4ae9f57ef88b4767b5 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6aab381a498f1a43ba372f4ae9f57ef88b4767b5 commit 6aab381a498f1a43ba372f4ae9f57ef88b4767b5 Author: Ahmad Khalifa AuthorDate: 2025-03-07 15:59:11 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 15:59:11 +0000 acpi_gpiobus: assume GPIO_PIN_INPUT for interrupt pins Different drivers respond differently to having neither GPIO_PIN_INPUT or GPIO_PIN_OUTPUT set, this stops the unpredictable results. --- sys/dev/gpio/acpi_gpiobus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index be3889f6a89b..15c6b627e748 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -77,6 +77,7 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) break; } + flags |= GPIO_PIN_INPUT; #ifdef NOT_YET /* This is not currently implemented. */ if (gpio_res->Shareable == ACPI_SHARED) From nobody Fri Mar 7 16:01:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8WH40g2Tz5pWsT; Fri, 07 Mar 2025 16:01: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 4Z8WH338Vrz3fC5; Fri, 07 Mar 2025 16:01:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741363263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=36PFfkLPakNStPxDENd4fcacZjBv41TDTdYicLJABpo=; b=ElHrR6b2EBsxKDO0PWeCPw4AFTt7aqjLlnUe3DSwU8oEJt8bUPraN6TWiWIFs0AdDiZnHs gS9Kn+ug4wfj0RkEbnkBwVjMYTinnvddItIhNmbbJ2P/0g7kW0Mk/Xcl33QOgoZowQCYe/ XBsZioE7x1ZfIyViZU01NjesKkWXZu5UdtcpHoNKkrlzgEpXqHSXTkT7RCk1+T9MJdqGNP tJs42JU6EJykojaRjbxXiDk6jFDr4Y40kSFiuyGWs4+40xkTn5VUBH3EgkxO2wzpF54424 eEzixBYR/NkKOw3rcEFwpp5cAsfEHfBVbaKu3mI0UlQu7wEG1gdHTx0PTG0kXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741363263; a=rsa-sha256; cv=none; b=gV4p5lojyCDkSflQqq+pAKlrYxZYzVoMV7gPkMb752B36v5BL7+XENgkzhFfDaPw8k8tgk zK1fcHvafuGuyC45hbp6sJ+mC+Q466++sPqRrFadOV4Jia/OSVChdqxDyHvqYhnsdcQC4p 1/LiHbX/ETFzmZoUYtffmg+mi0k+FsPfCW9+Eci2zFdbsiuY+AfliZYTXh/z9qxzTbEy9F JcEy3u6HoPOc7ZgOMcnur2IBjJOcv2uKx4bxh4SjzimkWY9lc529Qy/B4cReajTpxf+/nv X1C+O4udDUdcHy7p+xZEhWyy6nqoJuPv47Fh21uWlc/8Ez8CWf+Z7qeDVMEzXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741363263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=36PFfkLPakNStPxDENd4fcacZjBv41TDTdYicLJABpo=; b=Yg61TNllc69jHHcUTdgKRK10nTSql5WCZbOSdl6WBCaBYnWr/fFb9JlYFnZ5SYKuAbKr74 fmM9FPzOXUljvSxHxwid3+NJrN00fariF3SJXkCjfYLKvVyu1LHYtRbZb0+xpNvQ/wywex 6wIeTzHumcm5ODsSMFa+WDcyMUTtNdXC3suHZZZig7r4Kpg1bnSuknWL+jr9YFIxnmJmP1 2olI5IJqShCkjjGncTeGKOThl2ookSB5bjHvmKQJ+2Tm4PCkPtNj7YlAetkHmTH+o/aA1S NSgCZVzfHWydHDxMAAE3WTrubHTdih6f21NP5WJRxMYlWNl/lfoxUQY64P0jXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8WH32mF1zkjG; Fri, 07 Mar 2025 16:01: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 527G13Lg070737; Fri, 7 Mar 2025 16:01:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527G13of070734; Fri, 7 Mar 2025 16:01:03 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:01:03 GMT Message-Id: <202503071601.527G13of070734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: adc2c156acb5 - main - gpioaei: Add support for ACPI _EVT method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adc2c156acb50bac6e8ec66b72cadc8910ce4975 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=adc2c156acb50bac6e8ec66b72cadc8910ce4975 commit adc2c156acb50bac6e8ec66b72cadc8910ce4975 Author: Vladimir Kondratyev AuthorDate: 2025-03-07 15:59:12 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 15:59:12 +0000 gpioaei: Add support for ACPI _EVT method This method is often used to process GPIO "Power on" button press on modern x86 laptops with S0ix sleep mode. Tested with patch from https://reviews.freebsd.org/D26407 Sponsored by: Future Crew LLC MFC after: 2 month --- sys/dev/gpio/gpioaei.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/sys/dev/gpio/gpioaei.c b/sys/dev/gpio/gpioaei.c index 050f259a2127..f43674b53c7d 100644 --- a/sys/dev/gpio/gpioaei.c +++ b/sys/dev/gpio/gpioaei.c @@ -39,9 +39,16 @@ #include #include +enum gpio_aei_type { + ACPI_AEI_TYPE_UNKNOWN, + ACPI_AEI_TYPE_ELX, + ACPI_AEI_TYPE_EVT +}; + struct gpio_aei_softc { ACPI_HANDLE handle; - char objname[5]; /* "_EXX" or "_LXX" */ + enum gpio_aei_type type; + int pin; struct resource * intr_res; int intr_rid; void * intr_cookie; @@ -60,8 +67,11 @@ gpio_aei_intr(void * arg) { struct gpio_aei_softc * sc = arg; - /* Ask ACPI to run the appropriate _Exx or _Lxx method. */ - AcpiEvaluateObject(sc->handle, sc->objname, NULL, NULL); + /* Ask ACPI to run the appropriate _EVT, _Exx or _Lxx method. */ + if (sc->type == ACPI_AEI_TYPE_EVT) + acpi_SetInteger(sc->handle, NULL, sc->pin); + else + AcpiEvaluateObject(sc->handle, NULL, NULL, NULL); } static int @@ -69,23 +79,35 @@ gpio_aei_attach(device_t dev) { struct gpio_aei_softc * sc = device_get_softc(dev); gpio_pin_t pin; + ACPI_HANDLE handle; int err; /* This is us. */ device_set_desc(dev, "ACPI Event Information Device"); /* Store parameters needed by gpio_aei_intr. */ - sc->handle = acpi_gpiobus_get_handle(dev); + handle = acpi_gpiobus_get_handle(dev); if (gpio_pin_get_by_acpi_index(dev, 0, &pin) != 0) { device_printf(dev, "Unable to get the input pin\n"); return (ENXIO); } - sprintf(sc->objname, "_%c%02X", - (pin->flags & GPIO_INTR_EDGE_MASK) ? 'E' : 'L', pin->pin); - /* Support for GPIO pins > 255 is not implemented. */ - if (pin->pin > 255) { - device_printf(dev, "ACPI Event Information Device does not support pins > 255"); + sc->type = ACPI_AEI_TYPE_UNKNOWN; + sc->pin = pin->pin; + if (pin->pin <= 255) { + char objname[5]; /* "_EXX" or "_LXX" */ + sprintf(objname, "_%c%02X", + (pin->flags & GPIO_INTR_EDGE_MASK) ? 'E' : 'L', pin->pin); + if (ACPI_SUCCESS(AcpiGetHandle(handle, objname, &sc->handle))) + sc->type = ACPI_AEI_TYPE_ELX; + } + if (sc->type == ACPI_AEI_TYPE_UNKNOWN) { + if (ACPI_SUCCESS(AcpiGetHandle(handle, "_EVT", &sc->handle))) + sc->type = ACPI_AEI_TYPE_EVT; + } + + if (sc->type == ACPI_AEI_TYPE_UNKNOWN) { + device_printf(dev, "ACPI Event Information Device type is unknown"); return (ENOTSUP); } From nobody Fri Mar 7 16:44:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFH6Dpyz5pZJM; Fri, 07 Mar 2025 16:44: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 4Z8XFH5VVrz444d; Fri, 07 Mar 2025 16:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wxEfDBk6BIU34fFACMSaoRalz3hDPuFGPFYKojByvbg=; b=La7QwfOzfGoExzpaslKdu8JdjJy203QLsMHYnXVFQjnVgb97dMEr+unueCTJjSjDwx6qqN VPtwWoPqApACBDVr/cDNACuqBsi2zbm+Zzi8GCccKOmBDTOuV33/hvMZfnQt2XYW5GHb2M 5COPfIhAPGLZuC2ctM8OHZLbMG/sErykqYjprBamqu8VpB2V2OVdZWbRiMf8S1hfR9xgnR ntP+QK7JDJxn5nMmfJRGvtLUfrfkZ4TN0WZwWpY0QmKqYqiG1x8i3x21rKwr6dq7Qq+zha HL35H46YSl+nBPEuPKNwxc4kGz3r04RWR1xcdcWm31KnyTo/tlAeXByt51/3vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365875; a=rsa-sha256; cv=none; b=HMqaEDy4vz347NLAKufVlk5KcFYAUdbwlhPDKf4fwcMLdldinR0ddHS55Kp2rE6OGVRxFa Q+X3qMEwq9+pUPyq4dbatR+DiqbB0iijhlJt6zWjTXIEAkMM8QoPrFFPvF+a9ifgl9XAkv GHAAd3F8awuFT7KK4IC/cxk/VMTxodUW4gOaGs3yah98hzcpTQVg8t/JEc5ANEaqcj6pLO 5ZsknI04FHWoN9pQ6XPFEY9ud7dwS5F5z5fN61nLtp9o1fbX4R/5Wj5M899z/MgAO6gCrp 0+xh7Kzznml67639ugvBZMUIquM1Oxd+oh65o/sK3HzBQcxuKWrnj3lM3sLRdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wxEfDBk6BIU34fFACMSaoRalz3hDPuFGPFYKojByvbg=; b=Naxu4A1mG8CjPAr3/+uAwsaRCEQ5qjX/qKGqrq/UkR0T8Ai+QNwhtQjM0+fvzLKsuNV5Az 4A/ZgfF0sg8fqzFVzOCZ/pL0eppohywhM9SwHcm7Dc4mpBu1ZKc+AssNHasD/mxOMInZLD tjvFandAC0oKY40bHBwOu9Q35Wp2He2Kc9BwTUL8blkMtumdLAisMy7Mc5l3zy/qlFxwuU P0qOPXAqxG5O/BVRv0F30Ku7Iy9YXt895KViRFVgJCBKqiu8U1kAIR08xjrvVxb5MOUk6M rJ53Lx6VmXO3NYrXDJdP8bvhyXb/0HdVUNEJlaGBHJ2jgU1bDSNPzawC8HJzyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFH4w1fzlWk; Fri, 07 Mar 2025 16:44: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 527GiZ3G051923; Fri, 7 Mar 2025 16:44:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527GiZH7051919; Fri, 7 Mar 2025 16:44:35 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:35 GMT Message-Id: <202503071644.527GiZH7051919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 69cf9e9a451d - main - smbios: style(9): sizeof(): No space before the parenthesis List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69cf9e9a451df3b0bff92f879365f604811e394b Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=69cf9e9a451df3b0bff92f879365f604811e394b commit 69cf9e9a451df3b0bff92f879365f604811e394b Author: Olivier Certner AuthorDate: 2025-03-03 10:27:00 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:40 +0000 smbios: style(9): sizeof(): No space before the parenthesis No functional change. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/dev/smbios/smbios.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index dbf766b86422..bbfe80a6a8a6 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -85,7 +85,7 @@ smbios_identify (driver_t *driver, device_t parent) void *ptr; device_t child; vm_paddr_t addr = 0; - size_t map_size = sizeof (*eps); + size_t map_size = sizeof(*eps); int length; if (!device_is_alive(parent)) @@ -94,7 +94,7 @@ smbios_identify (driver_t *driver, device_t parent) #ifdef ARCH_MAY_USE_EFI if (!efi_get_table(&efi_smbios3, &addr_efi)) { addr = (vm_paddr_t)addr_efi; - map_size = sizeof (*eps3); + map_size = sizeof(*eps3); } else if (!efi_get_table(&efi_smbios, &addr_efi)) { addr = (vm_paddr_t)addr_efi; } @@ -111,7 +111,7 @@ smbios_identify (driver_t *driver, device_t parent) ptr = pmap_mapbios(addr, map_size); if (ptr == NULL) return; - if (map_size == sizeof (*eps3)) { + if (map_size == sizeof(*eps3)) { eps3 = ptr; length = eps3->length; if (memcmp(eps3->anchor_string, From nobody Fri Mar 7 16:44:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFK1kYNz5pZLS; Fri, 07 Mar 2025 16:44: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 4Z8XFJ6HKSz43tX; Fri, 07 Mar 2025 16:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=epuJ59BxJoo5jmi3ARhHTE/0CFxalFTH7qTfvQvUJbQ=; b=ke6VlGlVOdq8Aws7U7+SHq11Tsw3KjF/IoNTZVAdRn56KIo4SblB3RHzIU4VedxdDq+CFu IaZYzOlEfV61MAA1HeSBYT3Mp7upqdTnqUA/4QQ7piAuLGq5TvhyRItieVNI+FtMwdytpT PWx9Ug57prsF1Ufuo2bA1rZ+do5fBhfNNyR9f7g9zHLPKRz7lIBQDVinTHWBGLrtaMM3j2 jYm6RbkpUYGYVGtVrMnLsHoCZ8PHl/tEBcNUMJvFLxk5FrHfKKHDVaVcGcYfAAJ2u9Nieh /SO3MZV7s3JEFne4p+tAYePx2xrFvdIgTvqCQDq2pU3w8CLGIS++huLrB7ttgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365876; a=rsa-sha256; cv=none; b=fAfF299qdI1lDAKPt94b2Vv0twEthuZgMkhKI+QWw3Hv+kGxOT885xjtzgjJqWUENvbW37 Riu00hBE7FfZzjYYlyX92Mo73F5KKFZByDw69Xkmlfdklo9XnepuOor5OgImzIwiMtLhXj nx9A9WTMWYjoHrAHQN8rKmysbKzBQuLrMuMhigXwVEv5JqrpfhQjOcEYO5rbjfbF+1v54p wtbgSE9VcLtMJfMpJJBMpnD7yEKgOe8yKwPQpfuQieXJ0Kj3hq0T7FNx9wlHZqPdwVC2M2 wfrVfOrH6ohBNu4eZE1SzacynaYy5Wi/GvZpVVPvsHw54xqPdwGREUSJ5axf8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=epuJ59BxJoo5jmi3ARhHTE/0CFxalFTH7qTfvQvUJbQ=; b=jUD/Gb1WLCc+V8Sfw8ivvCrYzmfJVPLExQ4oVl/96DOEl7M6STJu5iSjH7YSjpevIO5bDV whHzgu3PfL24jj/uNOOpJbsR2IEMAilFsbd9eAalzbVVK0DAjtaysnSFA2gmwlqJ7vB2YE mL5sqKhMuCD+WnNcqmrrtUChZQkMKHIw0qnn5Cue1cU8TJyH1emHfLJMDnKfh6Bcqq97H+ NLomOGswUwdP3AK5neuuUzLrPM/PrAA9aZWD4uUdVu8MUP60FVXEwe8YPk2N72phmDNtUj sqqg7uE/hGWZE7+SMmG9CsIQCbypc3qL7kUF76X2BIUUKSGzhJHjRBUiZdDr+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 4Z8XFJ5rwzzlWl; Fri, 07 Mar 2025 16:44: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 527GiaWM051957; Fri, 7 Mar 2025 16:44:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527GiatQ051954; Fri, 7 Mar 2025 16:44:36 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:36 GMT Message-Id: <202503071644.527GiatQ051954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: bc7f6508363c - main - smbios: Search for v3 (64-bit) entry point first on BIOS boot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc7f6508363c5cf4544044e00bbaf71de8f0168d Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bc7f6508363c5cf4544044e00bbaf71de8f0168d commit bc7f6508363c5cf4544044e00bbaf71de8f0168d Author: Olivier Certner AuthorDate: 2025-02-28 16:54:42 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:45 +0000 smbios: Search for v3 (64-bit) entry point first on BIOS boot When booted from BIOS (i.e., not EFI), also search for a 64-bit version of the SMBIOS Entry Point. This allows us to detect and report the proper SMBIOS version with BIOSes that only provide the v3 table, as happens on Hetzner virtual machines. For machines that provide both, leverage the v3 table in priority consistently with the EFI case. PR: 284460 Reviewed by: markj, imp (both older version) MFC after: 2 weeks Relnotes: yes Event: February src bug-busting session Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49179 --- sys/dev/smbios/smbios.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index bbfe80a6a8a6..f4a6453fd043 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -102,9 +102,15 @@ smbios_identify (driver_t *driver, device_t parent) #endif #if defined(__amd64__) || defined(__i386__) - if (addr == 0) - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, + if (addr == 0) { + addr = bios_sigsearch(SMBIOS_START, SMBIOS3_SIG, SMBIOS3_LEN, SMBIOS_STEP, SMBIOS_OFF); + if (addr != 0) + map_size = sizeof(*eps3); + else + addr = bios_sigsearch(SMBIOS_START, + SMBIOS_SIG, SMBIOS_LEN, SMBIOS_STEP, SMBIOS_OFF); + } #endif if (addr != 0) { From nobody Fri Mar 7 16:44:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFL1pY8z5pZhP; Fri, 07 Mar 2025 16:44: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 4Z8XFL0CXQz43tZ; Fri, 07 Mar 2025 16:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lGg2W67/5qMhk1g+7rohzy7N861eOHULVPZ9sjb75Ts=; b=s5YOkiWPhGrxkSDeGkJc7D7B8iWodkRDVupd6DJkbx180B/lFHOQj1Ol1Cv+llWz3e+35H CsGVnAm5wN21T4H3fSiF60YOPxzfLrEO01PqMU6O143cny+PH7tzuNj1dO2kvxCYG9Jz26 m0wRAr8m3gO0fWeNAS+cBIgv4irP/DlsF2D73uNEfzhojxCm8IOUnh5YZkA4Kto1q+T+OE KOoNBRZ9OTjN7X2ba0iP3YMyD5hZmowM7hObFRGXB1sNtTD2jzzxXOrSFAz6cZPrVKA+I8 z5LPcATsAbebeM/8m4KOl3Z0uKggoqSROEJZ6YQV0o+g0z4KibJx3ZWjR8ToXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365878; a=rsa-sha256; cv=none; b=EsqdhYiZKePC5J+Y8hYmECAaZYdZwFDICdsnPzXvwlTgSvcUPtaKvVRP1UTZNnbZsq9Igg Ew6RmcaVRAhSssv48nivEDeFp7Pe5IZsjsLEW4+R0OFKCP/C4lA/TOsOiezysnR2aubYlO kqVzfE5RUvX3I1PWom00HVwyQbQ84N1ZHeiR8m+XFVd49n9MRtd3RkMz7A2GnvTPgMp10S FEt2lChswYoO9uxMzGIu8ow2LlJk+APLWoeWVFtkz0q/oIC5yTepyX3YXpF4vS/SduiVFq DWrFni9BH5RVxBnEC6RtK8P7Nqomp+96/rxesAEwdB6qx3E5txKWnhjqApkf9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lGg2W67/5qMhk1g+7rohzy7N861eOHULVPZ9sjb75Ts=; b=rjmXmwvl6oyMbPIWPzcAvU4++VlZfkj69u525gclRObNqREKP+BurKnR5eD38owq3nETOA 5ia8G20t22CzojTABtM3WuorISiZpMV1Rec6Mzk8DT/kOh3UQGuQQGij4V4sFIt3Bv62Vr 8RbCbj40xlNw/WF6VGZcN+ZUcJpmIJeS5cQDI2e+fX3yixWbN7JorGtIil5ybe8nYjvd2B o7J+8wfWaDd7zsN4zFsA3f1onCBpss1NbGWt0V//CcnbTw9jznvgXFQi5qEXSW4tc/u6Jj /C0uR0UqyMEddUOPbrTaNaN/uY400/0XF2w1RfADT0QeAC4g2tuA3NJwNcFP5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFK6pZ1zlmw; Fri, 07 Mar 2025 16:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 527GibHj051991; Fri, 7 Mar 2025 16:44:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527Gibp2051988; Fri, 7 Mar 2025 16:44:37 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:37 GMT Message-Id: <202503071644.527Gibp2051988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: e421a6615dc2 - main - smbios: On attach, print the entry point version and revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e421a6615dc257b71ac5255336dddf5c99cd12aa Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=e421a6615dc257b71ac5255336dddf5c99cd12aa commit e421a6615dc257b71ac5255336dddf5c99cd12aa Author: Olivier Certner AuthorDate: 2025-03-04 21:10:23 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:45 +0000 smbios: On attach, print the entry point version and revision Additionally, on verbose boot, print the entry point revision as a diagnostic/debugging help. PR: 284460 Reviewed by: markj, imp (both older version) MFC after: 2 weeks Event: February src bug-busting session Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49179 --- sys/dev/smbios/smbios.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index f4a6453fd043..e960cb951f5a 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -211,18 +211,26 @@ smbios_attach (device_t dev) if (sc->is_eps3) { sc->eps3 = va; - device_printf(dev, "Version: %u.%u", + device_printf(dev, "Entry point: v3 (64-bit), Version: %u.%u\n", sc->eps3->major_version, sc->eps3->minor_version); + if (bootverbose) + device_printf(dev, + "Docrev: %u, Entry Point Revision: %u\n", + sc->eps3->docrev, sc->eps3->entry_point_revision); } else { sc->eps = va; - device_printf(dev, "Version: %u.%u", + device_printf(dev, "Entry point: v2.1 (32-bit), Version: %u.%u", sc->eps->major_version, sc->eps->minor_version); if (bcd2bin(sc->eps->BCD_revision)) - printf(", BCD Revision: %u.%u", + printf(", BCD Revision: %u.%u\n", bcd2bin(sc->eps->BCD_revision >> 4), bcd2bin(sc->eps->BCD_revision & 0x0f)); + else + printf("\n"); + if (bootverbose) + device_printf(dev, "Entry Point Revision: %u\n", + sc->eps->entry_point_revision); } - printf("\n"); return (0); } From nobody Fri Mar 7 16:44:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFM3fbhz5pZdT; Fri, 07 Mar 2025 16:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8XFM1Cq2z444q; Fri, 07 Mar 2025 16:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kShOcqKCUoNF7Fd1Tc9BsJksOd1zFaD2TEYOmNepOus=; b=fI66dZbu3dsZnPni2P+KQUcJG6SzcQg349VOA1O9yNKB50DrUQhKFFUk06pE3e8vlLEWQQ VspsoRIJW6yqChH2IHOPIf/YA/kojq3jkmTOlvcXbD3osrsN2ZsvV2Mc4yGCSLJPbnSPRZ JVec2rtWzxjMaNDcMQVj/T8sIdhfy+3vopRGXQqkGsuv9KxqhZu4x5hGITPme+h/GZYKoB tVX2wmQlp1BYt73+fU1hHeLssQ6Is4xvUf7ft5X69RZJ5BEgIFqWxy9ImN7tc5pZyCfceQ 6msl/C6yOwx4Yemlc2yAXcHw5vv0YVOzHXo6QK9vxf7sB6EnGemYmBJbcRN+og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365879; a=rsa-sha256; cv=none; b=QYxBTw4/X1+8V9gdxCZLBGyh6pJZIJeUYB+qER1qN5xvcjPgOv29V4WIugvMvjb22oxDqO 07NBXukpoHzyBh0FpTIniTf3ZisR1J8QKSN+Aq9yQ74TG9C14aExuoNqMzmcktDc/clUbo b6fEqvXw/RA6Ab0lGjkaXrZ7qZ/Z8NdJ02qqrnZ57bb+lN7XNqghc6l35td7HBc6zozxBi gG6VYlCDUtCHNIbAZvyXKQlUHo/J/alDe3dtlyXr3StCPmSjH1nhguS1e7xtV9/37zid7k z3AgWOjEt2Cw+popDDdoIMi9FduutNaHGAF2P6lWyxETVSKz2raL3MtaQJYZDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kShOcqKCUoNF7Fd1Tc9BsJksOd1zFaD2TEYOmNepOus=; b=SbgeZlmFKz2nbKQ0l07Bxivqp74tm8Yeb7zVl5ZN7QQy7LvAJvT8VjLvSvTJhtjr0uoZn8 LNQwKIav7pgIHF/aTffZAKK6sSaKaEy8GaP6ycTK6DIr5J9frNlR6w8FiR1RmV/3dCLp6g 0UvSsm8pEYjawYO6mYbfiWHN315hVg7oQxm7mk7+mCJrndlqblcRyRM7uA+9UaItoaz5sf M7sScAX8NZjFU0I3gDzDp8DiO6crmWYeLq03gyI+E+TiMJZh3/YxHnVCXhvLZZH8XUlmYj rNqI7Rwk0qubzGq7YEuo8leNPVYZ8RFu71jnKBt+Cah5VAps20CDWPGqmQtWKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFM0gRTzlpQ; Fri, 07 Mar 2025 16:44: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 527GicoJ052025; Fri, 7 Mar 2025 16:44:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527Gic06052022; Fri, 7 Mar 2025 16:44:38 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:38 GMT Message-Id: <202503071644.527Gic06052022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 67d510f0c07a - main - smbios: Unmap memory on error on identify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67d510f0c07afd89e51e337e5abec47f4483ecd9 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=67d510f0c07afd89e51e337e5abec47f4483ecd9 commit 67d510f0c07afd89e51e337e5abec47f4483ecd9 Author: Olivier Certner AuthorDate: 2025-02-28 17:19:37 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:45 +0000 smbios: Unmap memory on error on identify While here, de-indent most of the code by simply bailing out if 'addr' is still 0 after the various detection methods have been tried. Reviewed by: emaste, imp MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49180 --- sys/dev/smbios/smbios.c | 82 ++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index e960cb951f5a..561196a3d4b6 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -113,53 +113,53 @@ smbios_identify (driver_t *driver, device_t parent) } #endif - if (addr != 0) { - ptr = pmap_mapbios(addr, map_size); - if (ptr == NULL) - return; - if (map_size == sizeof(*eps3)) { - eps3 = ptr; - length = eps3->length; - if (memcmp(eps3->anchor_string, - SMBIOS3_SIG, SMBIOS3_LEN) != 0) { - printf("smbios3: corrupt sig %s found\n", - eps3->anchor_string); - return; - } - } else { - eps = ptr; - length = eps->length; - if (memcmp(eps->anchor_string, - SMBIOS_SIG, SMBIOS_LEN) != 0) { - printf("smbios: corrupt sig %s found\n", - eps->anchor_string); - return; - } + if (addr == 0) + return; + + ptr = pmap_mapbios(addr, map_size); + if (ptr == NULL) + return; + if (map_size == sizeof(*eps3)) { + eps3 = ptr; + length = eps3->length; + if (memcmp(eps3->anchor_string, + SMBIOS3_SIG, SMBIOS3_LEN) != 0) { + printf("smbios3: corrupt sig %s found\n", + eps3->anchor_string); + goto unmap_return; } - if (length != map_size) { - u_int8_t major, minor; - - major = eps->major_version; - minor = eps->minor_version; - - /* SMBIOS v2.1 implementation might use 0x1e. */ - if (length == 0x1e && major == 2 && minor == 1) { - length = 0x1f; - } else { - pmap_unmapbios(eps, map_size); - return; - } + } else { + eps = ptr; + length = eps->length; + if (memcmp(eps->anchor_string, + SMBIOS_SIG, SMBIOS_LEN) != 0) { + printf("smbios: corrupt sig %s found\n", + eps->anchor_string); + goto unmap_return; } + } + if (length != map_size) { + u_int8_t major, minor; - child = BUS_ADD_CHILD(parent, 5, "smbios", DEVICE_UNIT_ANY); - device_set_driver(child, driver); + major = eps->major_version; + minor = eps->minor_version; - /* smuggle the phys addr into probe and attach */ - bus_set_resource(child, SYS_RES_MEMORY, 0, addr, length); - device_set_desc(child, "System Management BIOS"); - pmap_unmapbios(ptr, map_size); + /* SMBIOS v2.1 implementation might use 0x1e. */ + if (length == 0x1e && major == 2 && minor == 1) + length = 0x1f; + else + goto unmap_return; } + child = BUS_ADD_CHILD(parent, 5, "smbios", DEVICE_UNIT_ANY); + device_set_driver(child, driver); + + /* smuggle the phys addr into probe and attach */ + bus_set_resource(child, SYS_RES_MEMORY, 0, addr, length); + device_set_desc(child, "System Management BIOS"); + +unmap_return: + pmap_unmapbios(ptr, map_size); return; } From nobody Fri Mar 7 16:44:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFP4zx9z5pZLc; Fri, 07 Mar 2025 16:44: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 4Z8XFP2zjgz44GG; Fri, 07 Mar 2025 16:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=toDrAKpJ8h8w2eP6wJ8n7OW6KRHSTCPptj5U2hvVSZ8=; b=pYiUOb5CmRM8u1DSaJw9o3QU0gBROXZ8KGuRmLHcoovuYTUaji4kqn9n30IzXeyh7EFUpD 9pwziCQ7CPhbNGjWwlSxljSdwasDxBOfFCXhGmnSnD2jvoK0khZi8Zg5p2LM78tEwl3w4M 4B5WV1w0bSHp+H9x8ay2mu8cABqJjqQFbEqj+ps3SDJH03XM0SNiT4XyLMXljtngaBD8yD jvHGjwuxysmgbQ4dFdxOljk+c/2Cm5upfu9qTIAfw1e9tg1SmlcoF66RXeqdqxAqZyqxFs ZqptP642jXYT/seUDhFeBV9PFde1t1yXmRod4z1l4NfrqNtYptIL9WgQD34G0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365881; a=rsa-sha256; cv=none; b=xk3k0YmcPL8qhPx1IQ2EuiOIm4NPsI+yRl9nJOnwTKh/QfPhU8v9tymvVrh9V3V492Auuq uIhsww28jqo72kQJ4kFTtF/WiPw9Pvj/n7+50lOrSIU+//AWgLgj3nzysEcJ1IQI3M2vsv sv2RfsVbACN5gsZD9j/eth2snoNHqjBrW3B8lpDYZnM3H2pDxnQqbOQ2Qm+D21MvIKrkk0 J17wGLIqTZ4Y6N8DR5D397WDUJXuQGTJylDfE5YrzVEUq5BCBdUq/Gyub7uiAEbhpaTxx0 ZxIPrnwMwap1GvB598p2PL1rT3gGXh50PVItqoIJNjHtspB4veyDaGbAIMeGaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=toDrAKpJ8h8w2eP6wJ8n7OW6KRHSTCPptj5U2hvVSZ8=; b=Yj/tO5HhJyPQHJsnHk+Y0hVg1s22rxC1BmxnMAmjHRltKYZdtAM40aIwL8UmYmLW0Byx90 iVdUmnbjEAf38wn34PuLI3148KN97SdbZQ1Yi+P7/brg6UwM9foTBxYhe90bsjJ+ynAmYX G0OIBjNoXgytZPIw3Etfa18TAytNUckHtJY1ESw3Q3HC+7rrwQpnRJMuvD7hHQERz+fd4S SrQw9Bvswi6lpVITtstzfZHsyzTP152YuKagetQJLf/xmvixYeyBjbj4WU26uM/vY8+Ggd BuU/1fQAcXw4xVU/pqNaaBmff2DTiUwImjBcuB+nkY7lDu25WtVZ4zkjWK9V/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 4Z8XFP2QQQzm34; Fri, 07 Mar 2025 16:44: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 527GifQC052100; Fri, 7 Mar 2025 16:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527GifVq052097; Fri, 7 Mar 2025 16:44:41 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:41 GMT Message-Id: <202503071644.527GifVq052097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: f6cbd6b6d2cc - main - smbios: Apply the v2.1's length fixup only on a 32-bit entry point List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6cbd6b6d2ccd672e4807128ce0d07db333d4335 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f6cbd6b6d2ccd672e4807128ce0d07db333d4335 commit f6cbd6b6d2ccd672e4807128ce0d07db333d4335 Author: Olivier Certner AuthorDate: 2025-03-03 09:16:14 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:46 +0000 smbios: Apply the v2.1's length fixup only on a 32-bit entry point Only allow the length tolerance (0x1e instead of 0x1f) for a 32-bit entry point, as there was no 64-bit entry point in the erroneous SMBIOS v2.1 standard and assigning the length with 0x1f does not make sense in this case. While here, fix accessing the major/minor versions via 'eps' even in the 64-bit entry point case (not causing any practical problem thus far as the entry point length is greater than any SMBIOS revisions in existence, so the comparison guarding the fixup would not pass). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/dev/smbios/smbios.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 9e942335e985..733384b3614e 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -141,14 +141,13 @@ smbios_identify (driver_t *driver, device_t parent) } } if (length != map_size) { - u_int8_t major, minor; - - major = eps->major_version; - minor = eps->minor_version; - - /* SMBIOS v2.1 implementation might use 0x1e. */ - if (length == 0x1e && major == 2 && minor == 1) - length = 0x1f; + /* + * SMBIOS v2.1 implementations might use 0x1e because the + * standard was then erroneous. + */ + if (length == 0x1e && map_size == sizeof(*eps) && + eps->major_version == 2 && eps->minor_version == 1) + length = map_size; else goto unmap_return; } From nobody Fri Mar 7 16:44:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFP1Gy4z5pZLY; Fri, 07 Mar 2025 16:44: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 4Z8XFN38Qxz44J2; Fri, 07 Mar 2025 16:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06a5B9qTEU4SYE0qGtuTm2sK88mBgmEVDb28lU4zZZE=; b=v0NPT5gCyjlKXqzSgkz05ZutAOMMjywdUbRM11LeqIN74h83tPOL9siVQ8SOXe63UrpLem 1Wh1qeCBRiOabcf9p3sHVYBIz5x5Z3MppkvcUi4ngLEU8/aiKtVelCwPxrVZ0dlanA/F9O kKmjjnq6js5w584efr6ZN6RkRMs/lRblMW9SrGLQ0dGBEG5vAQQtDI5Fdd0WBj38wWVFm/ I5IVrVr7NFe1GbVTUh8+8DN9ZeXKoftueJrlcaeQGoBrA9j/YYjC03ozxv8StmP4q3DrrK ra00yNZd/JR4fRLCAG7G9C7lRi5b3W5jiXv+upgoZEqvTRUUvP2IQ6id8moH/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365880; a=rsa-sha256; cv=none; b=DAnvI7BVzOeic6N+B4siuqthEZXn90Ho7UdTdTXz4wts4kjy4NQphb9tty2jLzaaHUKRnW VL7cjW27sAL5E7TlkvXP0HGwwGyiW5FQoOXmGEyvw4O62udSvoLZz+8XtUWbxHbqyTGAVX FuJcBgE/lA5UZAwL8+b9gnjP6vlQQJAKKhZKaThDuo3jrtD38kTijZhwEc2NWI9uUYqAWB NJqkQd0bGQqnL/OKdc63JEPJTrer97i/AT+0icICsIGJqE4U4sbyaZBUdjaea1tfV4o7Ko 2R2WEtV9x/nemhf9x6xikd2k4ZTLCQXI9tIDg2PkpvOhIyiwno7o9T1LqeHrcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06a5B9qTEU4SYE0qGtuTm2sK88mBgmEVDb28lU4zZZE=; b=TiYczDHTa8sTh/He7wbkwg30LIc83X8U17ZZoNazKbt1H7zWmAB8fN4nnSCNzrlqc1fzOv qkCoDV5sUySR7sy3AeggRD4HELTKRa5zlyhznSaMVohgG7YnDmszHnyDoRCQ4nIdgbjhLJ IeOLTnl+ssqQ1LDo/4UlHI4GnwL4kMV976hDhsamKvR9x2DPo0fu+eS2SoyJmzyXtsZ4pC dZ6/FC52HTMGOdTbt6foH0aUShKA9W+of2g//BKFEqDOTo23XkJnrtGqJ23Tp8ZD2M/Blb wzizjOWhgQO8ANrO/So5PPCh5qf+mlmBS5ygjnBZ6FL9cjJ3GRF5dRWbYV65dA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFN1cg4zlWm; Fri, 07 Mar 2025 16:44: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 527Gie90052066; Fri, 7 Mar 2025 16:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527GieL7052062; Fri, 7 Mar 2025 16:44:40 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:40 GMT Message-Id: <202503071644.527GieL7052062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 3907feff7ab7 - main - smbios: Print an error on memory map failure on identify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3907feff7ab732b918ba3f5993e7a6718fffea14 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3907feff7ab732b918ba3f5993e7a6718fffea14 commit 3907feff7ab732b918ba3f5993e7a6718fffea14 Author: Olivier Certner AuthorDate: 2025-03-03 08:50:49 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:46 +0000 smbios: Print an error on memory map failure on identify Consistently with what the probe and attach methods are doing. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/dev/smbios/smbios.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 561196a3d4b6..9e942335e985 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -117,8 +117,10 @@ smbios_identify (driver_t *driver, device_t parent) return; ptr = pmap_mapbios(addr, map_size); - if (ptr == NULL) + if (ptr == NULL) { + printf("smbios: Unable to map memory.\n"); return; + } if (map_size == sizeof(*eps3)) { eps3 = ptr; length = eps3->length; From nobody Fri Mar 7 16:44:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFR2WCnz5pZJZ; Fri, 07 Mar 2025 16:44: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 4Z8XFQ3PV4z44JZ; Fri, 07 Mar 2025 16:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RpLkw2z78qJVuAKS1Gt1l9Y9kcr2zMbLhMxN4QHTgEc=; b=nJP7XzHUK9BfZSG3M4yRslLQVl/IiQakIeD3/alPO6ksQ3Ic31H49Ulaz2UyBFnBL2v3a7 ZLioM2NQRI/763aq64ZesGNN4Sb15MAEPjnVuepeFJ9JQ8ZRExIgJMFYuCLS8+hp6uCplJ a+/GLaLx66t7OBAVd+xCklC/qQxfLuWfOZjrFYcFajk4KOCGIgSXcw3F+mgMZaUIK8WBg2 mVg+kXmSdzUgHwmuV8OnRptejbCqiYi8D3wR5OVMnJYudC8l9YX8ccDr+CdGjmGTUw8YWf VsQ09kR9YKnvEBzUGUdP4qXmKcAmfV0M/4NYqnTWwUTgib6MN824cEffxPQGcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365882; a=rsa-sha256; cv=none; b=AQAqPgkSo1nTXb+FrStytmjCm2ujlypsAk2lXIwWjN7yLgK3KbhmAWbnGRMoAIsTE4Oqwr Mnv69/ZbjiTBZdyYTBR01HQEn4t3xtoNv3gzkGhUd754jnd0IHMtOuz/bOokrIE9vUaTFa aQrWyyszOvJqdPOF3BAuH884mvdoscD17kkStCay6eyvir8WsFAzKl0CJbuJm2bf05CwEe iZOHgDbYbSCRLdPGvkM/clJNCpe6icFOXaqyj1QzvjcA62TpnMBTlsukbuuU3D3E7pK94B NfhGfwMRCuOziPnDOCv7vMEUdd7tvRWzl5xObyPRx12iVjxeL2qyZ9KoOyTMJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RpLkw2z78qJVuAKS1Gt1l9Y9kcr2zMbLhMxN4QHTgEc=; b=XpDQQNRf93dDNjIrj7+FAkkNUZM0p2+BlO+kKnnun21N0VO31kynfwyoXDnT4gg3+HekFq gghjU7gDBLBFOz0y0TIKr6HjZ+Ue6qRIaJUwM8yt9d4XtdYEPwsbrjdWq7mJjZCblgvBOt L6e93/4bXFM58io1tO+mxV4OoQV27hRsCXFS4HuiHteTZXM7+vAkKo2b6VYDV10V+c1Cyz QnMadmJCj9PK5Yge7V7JupJsCfn4O/yGjUkRYHHkgLY/2vuTjAu6cj1EfpaUmNgtorcqiM fDY26BmsURgZHF5SxzGfKaRw25dFTjs8d65u9gDXhB/f+rkTUVnrTRYrBwtpvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFQ2tLQzlWn; Fri, 07 Mar 2025 16:44: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 527Gig87052134; Fri, 7 Mar 2025 16:44:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527Gig1E052131; Fri, 7 Mar 2025 16:44:42 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:42 GMT Message-Id: <202503071644.527Gig1E052131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: fdf08ac1e9f9 - main - smbios: Print an error on unexpected entry point length on identify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fdf08ac1e9f9baac4fcf4af8f3bf7a34d3ea0009 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fdf08ac1e9f9baac4fcf4af8f3bf7a34d3ea0009 commit fdf08ac1e9f9baac4fcf4af8f3bf7a34d3ea0009 Author: Olivier Certner AuthorDate: 2025-03-03 10:12:33 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:46 +0000 smbios: Print an error on unexpected entry point length on identify This helps figuring out quickly why no SMBIOS device appears in this case. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/dev/smbios/smbios.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 733384b3614e..67443d75c8fa 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -86,7 +86,7 @@ smbios_identify (driver_t *driver, device_t parent) device_t child; vm_paddr_t addr = 0; size_t map_size = sizeof(*eps); - int length; + uint8_t length; if (!device_is_alive(parent)) return; @@ -148,8 +148,13 @@ smbios_identify (driver_t *driver, device_t parent) if (length == 0x1e && map_size == sizeof(*eps) && eps->major_version == 2 && eps->minor_version == 1) length = map_size; - else + else { + printf("smbios: %s-bit Entry Point: Invalid length: " + "Got %hhu, expected %zu\n", + map_size == sizeof(*eps3) ? "64" : "32", + length, map_size); goto unmap_return; + } } child = BUS_ADD_CHILD(parent, 5, "smbios", DEVICE_UNIT_ANY); From nobody Fri Mar 7 16:44:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFS55fzz5pZ8j; Fri, 07 Mar 2025 16:44: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 4Z8XFR4q99z44Dp; Fri, 07 Mar 2025 16:44:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiB0mAi79iRstxNezUTW2pEEsyfZIuRQBG0d3TxoBEQ=; b=L5he6nXc00/JaguIXOcYMinvHRosc4mWBCMcb4w1Ysh7uFu5bJzKCMIq+VVREsg0aCUka6 mSvPX4OiUqH0WTDcqNnxmTKPwCxe507Cd4wSmgN6lShCnvPKj77fxg8VPD8yJ1GDRzsNSx F1LByaA3H81C3VtI5SJm/JLNQGT/+6aFh+G9oDUnL/CbxPu1Ei1b84JDeIKXC9C+LSmjKH ssT/qc5G33vAobDSBJwOX4k2yMpc68gP2f2wqN4xk9N/Pe+jleYgenajrrmi1p9gwvoG1L hO93kehevye2wHduuDiLyST94Kt6xCRAgG0OlxHOrIr/DV51hLg+Yc5I5BfaBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365883; a=rsa-sha256; cv=none; b=MeCsfpplkZUNBboLPYb9GjRf+Jfx7v3gXR3M+n4p+2GjOhkqBdDK/xvsQheJLxdH0DF7EU 0K0DXzxBJHNQs7CsltoKdTpaEO6EItJFlJXJ9a/dCmjyAGiyEuN06xc47m9mernw+Yh2qa xVR3vaUIBAmWOQZWPbS80vhUrrD/KxtoqB+VUbMfGW1czn1UEx3eBD1631ECybN7oWXaqS g8baSSF6siI/cdy1m7nOMr+PdtijjpGlNox6iGcSblbRr4wdw+3/NNgYv6JF3vKs7eNOas lMzf1Ni+CNFMt8OsV2MyBT0x0PZT83f1dSfVnfqd4E1mLrVguC9hKIv5m5pF8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiB0mAi79iRstxNezUTW2pEEsyfZIuRQBG0d3TxoBEQ=; b=okcD7eSWCaYSC1WIALF+R+nKtOLW2NEoA7CFE4DRAUyFiD9w4DZ4N6lswnHj/KeHsRebb4 pM0qdtpPGpdE8vq8IbRk84Qb6CHlnTNkbP9ESXYiPEFMhS24KNMQPXhXl94z5fyFZ5+/iA m9DfVzMrGMjEL8x8QGn6jUlCwxbW1BisYJAnev6djXnLRwLUhI0pT6Tin9H48Io0FEXY84 Ll6CKPBJVpv+08/UGLx/PJdiXtCe8Tl+ASLYmLPWwhtvOj6xidOUNMphT063HJUJItUiiz HCg0EhQrRC4JGeMxyT1wCRwUhLF9NIL8T7Qay+cmW29TfoX/zXQBBYFXcIk+Pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFR45nGzlWp; Fri, 07 Mar 2025 16:44: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 527GihXR052167; Fri, 7 Mar 2025 16:44:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527Gih7X052164; Fri, 7 Mar 2025 16:44:43 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:43 GMT Message-Id: <202503071644.527Gih7X052164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: bb04712e3772 - main - smbios: Carefully print wrong entry point signature on identify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb04712e37723d112b2fad28af4b035ef35a25be Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bb04712e37723d112b2fad28af4b035ef35a25be commit bb04712e37723d112b2fad28af4b035ef35a25be Author: Olivier Certner AuthorDate: 2025-03-03 09:30:00 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:46 +0000 smbios: Carefully print wrong entry point signature on identify Using printf() with '%s' can lead to arbitrary long printing (although, usually, a NUL byte should appear quite quickly) and trying to print unprintable characters. Instead, print in hexadecimal the exact bytes that are compared to the expected signature. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/dev/smbios/smbios.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 67443d75c8fa..2cc8e3ff21c4 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -124,21 +124,13 @@ smbios_identify (driver_t *driver, device_t parent) if (map_size == sizeof(*eps3)) { eps3 = ptr; length = eps3->length; - if (memcmp(eps3->anchor_string, - SMBIOS3_SIG, SMBIOS3_LEN) != 0) { - printf("smbios3: corrupt sig %s found\n", - eps3->anchor_string); - goto unmap_return; - } + if (memcmp(eps3->anchor_string, SMBIOS3_SIG, SMBIOS3_LEN) != 0) + goto corrupt_sig; } else { eps = ptr; length = eps->length; - if (memcmp(eps->anchor_string, - SMBIOS_SIG, SMBIOS_LEN) != 0) { - printf("smbios: corrupt sig %s found\n", - eps->anchor_string); - goto unmap_return; - } + if (memcmp(eps->anchor_string, SMBIOS_SIG, SMBIOS_LEN) != 0) + goto corrupt_sig; } if (length != map_size) { /* @@ -167,6 +159,31 @@ smbios_identify (driver_t *driver, device_t parent) unmap_return: pmap_unmapbios(ptr, map_size); return; + +corrupt_sig: + { + const char *sig; + const char *table_ver_str; + size_t i, end; + + if (map_size == sizeof(*eps3)) { + sig = eps3->anchor_string; + table_ver_str = "64"; + end = SMBIOS3_LEN; + } else { + sig = eps->anchor_string; + table_ver_str = "32"; + end = SMBIOS_LEN; + } + + /* Space after ':' printed by the loop. */ + printf("smbios: %s-bit Entry Point: Corrupt signature (hex):", + table_ver_str); + for (i = 0; i < end; ++i) + printf(" %02hhx", sig[i]); + printf("\n"); + } + goto unmap_return; } static int From nobody Fri Mar 7 16:44:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFT1WNwz5pZjb; Fri, 07 Mar 2025 16:44:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8XFS5pYBz44KH; Fri, 07 Mar 2025 16:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yeWe0F4EB/7CNKsxHAcJ2dEvZpapJaQkoJmG5KPwCFc=; b=VlZLG4g7HRDxAIoUPzQJcTrKgc2Lj7GEA8l3cIXBWeD3OtcFpW/5kAWf5Je3CPU3ftFnR6 3YhyS0mCk69YNo4nKNL5Fis3OJW4m6pEF9IAINbntMrWn3iCnxSQ6cj+PIvEytQBdNC2iH aI2+l6m4weKwSRylfOsWhm4JK7QnxdVqHHW/W9TgErwa40cGdd5/UWDv6KEcVr7hn5k8R3 RAnbMz4QSh4lXqzvGaxfW30CzPzS2eBWS1USjtBtTXnSwDcsb4r1enpYfz5kiPd75/W7+b y1KL4c2W5CASZJrqSpVYmN69Ee/7soq22NmVVWsKZ102IlnVw7/bepmMMqdKtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365884; a=rsa-sha256; cv=none; b=H2EDNvhjasnKLdKkIQk3ZHYFIL6dPpXbrh9ySeLseuj0YogiuTRbnBXV5rioA2xm7XlrkS Y6NKTUrjEweSIrSbSOC3JLCBn5PEsT17vXStxd7f5Yxq5VcMXP5BeuAKVYZnjiYtiHqV+x /FtyzP6c8yww7TEDwejbFwTF7oOPGbUc1+6AjSHiMXnD0hdEhJ1O6M37Ptnl6J7TQ0z/21 TxniizuYKMRor+MqxejqnZ9MCnk4o2Ed8YjeizgO44JW+NA+Bs83UAwBvk4Np5YToUIHjU t0hCtPWqvVGaE5BEj7v1iJ76vop+8jQznlwYZo4as+DK3ZSBCrINIr5lY/UpRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yeWe0F4EB/7CNKsxHAcJ2dEvZpapJaQkoJmG5KPwCFc=; b=BMYKXI5MyGvKA9dsJPHYGw2n1WPJMvaDmse9XK7/AhBNAXvQ+CekQ1Cr0mofmkqPmoOsn9 XfI/8zUcGgNm71KM1cQrzZqKz83e3bBC2mzbJLxi+lq9T9QRJTfQfGEejGj0kBsR9g7gQR N7YsI0RYa+2twO0jnCpVIbVZSd+k4SB5Ba8b0QYtaKbq8ToSVdejBMaWk3rSW6116zYQC7 Ai6g2VzUL8toBZ8iiRj9wFDBf7JLxb+GE+Vf2dCyv+DkDvKqswSgwv33Frlc+XM68hB8jb CPWAyQw5OW1zT0gkmPVfZN/a5kCZSAr3zEs3qEVhH/tOZkElpnAx6kA+jhm5QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFS555TzlZb; Fri, 07 Mar 2025 16:44: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 527GiiWa052200; Fri, 7 Mar 2025 16:44:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527Gii7m052197; Fri, 7 Mar 2025 16:44:44 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:44 GMT Message-Id: <202503071644.527Gii7m052197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 516e24e57987 - main - smbios: Harden decoding of the BCD revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 516e24e57987d184cce70e7f31443653aa1a5e63 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=516e24e57987d184cce70e7f31443653aa1a5e63 commit 516e24e57987d184cce70e7f31443653aa1a5e63 Author: Olivier Certner AuthorDate: 2025-03-03 14:25:23 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:46 +0000 smbios: Harden decoding of the BCD revision bcd2bin() must not be called with a value greater or equal to LIBKERN_LEN_BCD2BIN. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/dev/smbios/smbios.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 2cc8e3ff21c4..ca329c0f65f6 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -241,18 +241,20 @@ smbios_attach (device_t dev) "Docrev: %u, Entry Point Revision: %u\n", sc->eps3->docrev, sc->eps3->entry_point_revision); } else { + const struct smbios_eps *const eps = va; + const uint8_t bcd = eps->BCD_revision; + sc->eps = va; device_printf(dev, "Entry point: v2.1 (32-bit), Version: %u.%u", - sc->eps->major_version, sc->eps->minor_version); - if (bcd2bin(sc->eps->BCD_revision)) + eps->major_version, eps->minor_version); + if (bcd < LIBKERN_LEN_BCD2BIN && bcd2bin(bcd) != 0) printf(", BCD Revision: %u.%u\n", - bcd2bin(sc->eps->BCD_revision >> 4), - bcd2bin(sc->eps->BCD_revision & 0x0f)); + bcd2bin(bcd >> 4), bcd2bin(bcd & 0x0f)); else printf("\n"); if (bootverbose) device_printf(dev, "Entry Point Revision: %u\n", - sc->eps->entry_point_revision); + eps->entry_point_revision); } return (0); } From nobody Fri Mar 7 16:44:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XFV47KVz5pZTg; Fri, 07 Mar 2025 16:44: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 4Z8XFT6YwGz44FS; Fri, 07 Mar 2025 16:44:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lT4S0uJLNKxvEuT6TzP2UrH85wVukBGKxrKd98vTI5Q=; b=gN6KOL6KmZdu4R1ZbBs1XMXaFSkFr5D980RYBa0n+jTPcjjhbVJojPAaPXzjbhFaqe05Vs s8pHceMMtyeHgLaFQ7C1xp+/g9CHfDUvH7k3+P36WTIcy4WGgR0bbuHENQ8HTb5FbavHp3 ReiTVTVHAH0/ceJnwUf9NHh7h63+z07xMTK2r1vCy5rzqigv3EV6RM6EwqeZXCZuWp6UXk qxs6us56i+AK5n2/vHvhoc8qFiHzBL8Ro4MploWUBqCIhc02+dDOvAXS4p8nAErjN14dwf 3x+vjKfkCOm1Y+f13EhZhMnVmpnj6L+KCvDsAC02RrlmmuIt2SkqWhhMzzY5Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741365885; a=rsa-sha256; cv=none; b=L5R5l68LMKmARgtpMgPB7IFns+4pMdkY97GGdRX+g48gWdsqD/Vt+yvN+w9WTk1EzCeaQ6 ndbG+dXHJVyC0mmp2zFKVNafjhjxkRwNzMXOJMQXaf4cRLuGAD6aKr+WGzlh+8tCXxOoJA YfP4v1sCyTUI6mj0AoxIolcAiMuZz0udCdWoWpdrjdcobEfbuYWoO7ihalUQD7Y22U+awJ hz/K3ggJ5scAlcJ3PtQ/qwkqB7qeRsPOf4waEFLJa6NYaBT2kJMXQdGBzWRpNgbY8bqBUI oYM3jrlpXfHEssf1inIXTVLR8DLWrxj1HDA+bcdRhpjGCFJ/fsurXbpapnmgWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741365885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lT4S0uJLNKxvEuT6TzP2UrH85wVukBGKxrKd98vTI5Q=; b=Q9n0uq1R/xqwqQ2Wenq7JAgW2bdgeTkUy1EjBNAKkrKMWGJC12ucx+G/cjavSUTew+TZvp 9RBLhrQv0ubcj0RWnkWve6/t/XFZmJ2KCO2LgUW8JugCWOwClrkNVX4G71agb3e2aNC3qX QcYS6WI14UhfUIksFjLr96SbXwKqvBU7O+p2ANd0BNmqbIV6MqF7o0JLvqS8U1r0tOiilU g1uvgdqZE4fWwra4farg0OH4CkDUPQZxc1Bc0KpNALH+F8jHfCjHGiCAaYX4W5Gf2ugj1L DgRBQyC03SvbqIpkz4GoQ7SaKL4s+7GaLUlhWxUsSZfHdQtcQ7v6sjgOn4gn0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8XFT61MZzlmx; Fri, 07 Mar 2025 16:44: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 527Gijbl052237; Fri, 7 Mar 2025 16:44:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527GijUe052234; Fri, 7 Mar 2025 16:44:45 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:44:45 GMT Message-Id: <202503071644.527GijUe052234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: ef446a8065ac - main - smbios: style(9): smbios_cksum() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef446a8065ac0228a5da15f233cd2f964e4d7433 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ef446a8065ac0228a5da15f233cd2f964e4d7433 commit ef446a8065ac0228a5da15f233cd2f964e4d7433 Author: Olivier Certner AuthorDate: 2025-03-04 16:29:22 +0000 Commit: Olivier Certner CommitDate: 2025-03-07 16:42:47 +0000 smbios: style(9): smbios_cksum() Reduce some variables' lifecycle. Remove useless casts. Remove superfluous braces. Add some consts. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/dev/smbios/smbios.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index ca329c0f65f6..469e5ab649b6 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -338,25 +338,24 @@ smbios_eps3 (void *v) static int smbios_cksum (void *v) { - struct smbios3_eps *eps3; - struct smbios_eps *eps; - u_int8_t *ptr; + const u_int8_t *ptr; u_int8_t cksum; u_int8_t length; int i; if (smbios_eps3(v)) { - eps3 = (struct smbios3_eps *)v; + const struct smbios3_eps *eps3 = v; + length = eps3->length; } else { - eps = (struct smbios_eps *)v; + const struct smbios_eps *eps = v; + length = eps->length; } - ptr = (u_int8_t *)v; + ptr = v; cksum = 0; - for (i = 0; i < length; i++) { + for (i = 0; i < length; i++) cksum += ptr[i]; - } return (cksum); } From nobody Fri Mar 7 16:58:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8XXr04yGz5pb9s; Fri, 07 Mar 2025 16:58: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 4Z8XXq63dnz4JV9; Fri, 07 Mar 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741366683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kq0PDI64t7/yDLLAhruHCAItcwToD1BB3hWRFZ9Gt4s=; b=Qq31cWdUxJQsAzFo8yARpmm8f4kQibvbyJcW7btHYw+s9CmvG09tKstkdIMQa9JiC1TDiq Fw3GA31Ga/kif8eDxKyLDyThEEN7s6iLHDzDH+uhbiGajLexBkKesds0aMMiAk593NlpG2 buF4aL2jUCq1u+GwyxXOoAgC2+Ys8EwDYRyGgiuLSOUuIy9LQZXJ9hG31TtIRwBlmPN9Fo l896Uqr+cbkJwXzCWYXwdZifUydxld7mRH9LhB3yy3givQkjYJR2f4mx92g9ydM2hlBu3V tlqOkBlFt9sxOjPHoOZSZ0n7kIgWRJtE4QOqOtsXNVbREKJdgLmJiemVz5A4YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741366683; a=rsa-sha256; cv=none; b=nehykuEULofk9NQnvXAqwNTJ/jmnPtMSOXIEejOyyLP2VNk/QOdHXrtbMA3w2OT5ugc3Ng qPwjN4HRctNXlNvsrilqHzKijcD8DeFs9QSpFaR0Fug4MHCMt2b1ZPQbEjIPbmge2WhSIw LcHbXdLggU4c/C+FUmxvsFtSUsKJD8Arajog6TR0s3SvO8sUwXGPvxL73EJrHz884tHv9x Gpjka/MvrGz/uq5VQZ/ovGGRA0nl2VmzlpE0LNY/wdLaPUpoNrXbkBAgs90hNmxIFHeqRw RERjRkcgJ4fms2V72RHszGUJjq8JU+0eeB3j7GwhZaokjxLH3s3vRriZujnh0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741366683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kq0PDI64t7/yDLLAhruHCAItcwToD1BB3hWRFZ9Gt4s=; b=hiXKCpDCpSdwh9ty8P6ajmALI6wXVwbTcQ/9b5DsLMJc52ORpG0y4XE7+YGjKaWe9zWBwu B2DdjH2AXIF6jlu/Ekn7Afkn0EuZg2giMeRnJ8gAo8J/OPqg5sBDdgQYRXTN4sk60DHw1Z fuHgtrnsZAZfmJQDCMoAAeMy/FES6rV3cSQmgdtwWlu1y5v/R0Q+whIutuYcFaPkORg7ns bki0IifK6RG4ID4q+FNOHDSikNAMvYQ1Ry6F7TmY1iszIKxlkFm54ovFHqLJJdi5E2K1em f5EgfGg2FDUqFh6Zv0DhZZft06KsKqUvYha3+nw4QbXuW5RFUarKIjMet/vT/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 4Z8XXq5bZszm1q; Fri, 07 Mar 2025 16:58: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 527Gw323071898; Fri, 7 Mar 2025 16:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527Gw3si071895; Fri, 7 Mar 2025 16:58:03 GMT (envelope-from git) Date: Fri, 7 Mar 2025 16:58:03 GMT Message-Id: <202503071658.527Gw3si071895@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: 7d529b1c8fb5 - main - Makefile.inc1: Correct comment for an .endif List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d529b1c8fb53156e3bfa97698cb1baa29b26099 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7d529b1c8fb53156e3bfa97698cb1baa29b26099 commit 7d529b1c8fb53156e3bfa97698cb1baa29b26099 Author: John Baldwin AuthorDate: 2025-03-07 16:45:25 +0000 Commit: John Baldwin CommitDate: 2025-03-07 16:57:40 +0000 Makefile.inc1: Correct comment for an .endif Fixes: 0026fec57dfd ("Differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases.") --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 75fcbc0bf968..0b4167790133 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -594,7 +594,7 @@ EXTRA_REVISION= p${_BRANCH:C/.*-p([0-9]+$)/\1/} .if !defined(PKG_VERSION) PKG_VERSION:= ${_PKG_REVISION}${EXTRA_REVISION:C/[[:space:]]//g} .endif -.endif # !defined(PKG_VERSION) +.endif # !defined(_MKSHOWCONFIG) .if !defined(PKG_TIMESTAMP) .if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) From nobody Fri Mar 7 17:55:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ypt1Hzbz5pvBQ; Fri, 07 Mar 2025 17:55: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 4Z8Ypt0mD0z3YQ0; Fri, 07 Mar 2025 17:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MxZs2TLzarmSQ9Ndk1HTjEYmjcoDO2OFOOJrWlHPibQ=; b=g6KJegyvwwROmYK2KrbCwQDC1RA6awnmVYpq4/yocvHqFd6zWceqBPo+OCuj1qhfGBt5PL W2dnoHs6nWDYCVsH96vNW7PNmAlYgD7s7nhuSPmDRRJWFsEbGVarAZweINWKSDu14dY3Wj u4+vfjTdvX+GBnSRqcGF8asx3NbWqCXHIQdAuLrzgT+esaZW1Dx+6o2bdij40pXvU5mHKb QPoacFWAou2AIgDE/9gr1gy5YaTssjXeukaQKWGI4L978kbMQjAvTHzvMbrbJCkjh+nUzP nD22ZACGpHhOByo/yMjbzoR+a/nyUK5X4blivezTIW0Gmt7PTYYZfzUhsCY0yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370118; a=rsa-sha256; cv=none; b=aOm6+bQC0W6SGM4MwgySFB9aAytOod4GcF5FqkhCD9Rl/+DsjvQocx7ppmIquMICuc48S8 4x0/iMsMJg8FNmMiuyHXYOa+e5i1LYrI0BZoh26UCwSH/mpel4hH/o8ONDIhdXdb0YU44h J3w2RwmzoZtO7or4vnpvhFut6RLx552wrilzVSJiFeTtnSlmm1uS7JPaXNiRWHA6fTjNE9 HfC+jD4piTy9Nt4+B/6IbTY4dRMRYtDAx2/2fvIKxNP2uXsCfSq0w8BFVQb4EuV6paPZgw zbOgJRJniC3klgdQerkYfXT1aEcoJrvwMe+J3MqR0pTZiajj2QAlcNbd8hdVQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MxZs2TLzarmSQ9Ndk1HTjEYmjcoDO2OFOOJrWlHPibQ=; b=J4ZZ4ERlHrpn7dI9U7qEl77zEGnudoJtNlBDQwlVTnJ4z8YNTJI3TUpmNtEL5H8NT9DaVU p0TNOhD+u1cGdbcizXIjm2T5WEZkSnvQaBDt2rqnFmdpC6G7oU5IBVe32UiR2pqXgrNF9E F9dsBeigS8CIaEo2f2RQylb9gs5MuuwoGzijCUsl/N2tF9M1rGii3Wa3PSbBMABCj80VHy C5hdpcnEpDLlOHhLUdPjSckdSRX23qdJ8gK2X6bAfTDmFXADJ2xGCkcqoPKnq7iWYiGQvH C0wUYjrd053gaelRj9Kzc65WbU5Wbh9yVElqM831gnBjg7nyJ6tBU4Z3d7P88Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Yps6ybCznV2; Fri, 07 Mar 2025 17:55: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 527HtHQF083446; Fri, 7 Mar 2025 17:55:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtHur083443; Fri, 7 Mar 2025 17:55:17 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:17 GMT Message-Id: <202503071755.527HtHur083443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8ceca72751bf - main - wsp: Raise the default scr_hor_threshold sysctl. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ceca72751bf21752a19c450a3b4a9cd98b94d85 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8ceca72751bf21752a19c450a3b4a9cd98b94d85 commit 8ceca72751bf21752a19c450a3b4a9cd98b94d85 Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:34 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:34 +0000 wsp: Raise the default scr_hor_threshold sysctl. The previous value caused nearly every horizontal movement to be classed as a left/right-keyboard button-click. Signed-off-by: Joshua Rogers --- sys/dev/usb/input/wsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index 4c41dcdbba8f..f9b85f926221 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -110,7 +110,7 @@ static struct wsp_tuning { .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, - .scr_hor_threshold = 20, + .scr_hor_threshold = 50, .max_finger_area = 1900, .max_double_tap_distance = 2500, .enable_single_tap_clicks = 1, From nobody Fri Mar 7 17:55:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ypv2pzqz5pvR2; Fri, 07 Mar 2025 17:55: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 4Z8Ypv0sBNz3YKL; Fri, 07 Mar 2025 17:55:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CabH8Mgk6jalQ+bk5uy65oRvPpaxwCfgeAxoY77Si6o=; b=TY4lmw+c0qzf8wKQg3fky3zRwnB9xvLJaJnxVpfQO+0PYUENAvzbZgvcMhhXM4RH1gKzNr TzF4O1IqQHmyxwZNGlr4Q3RHatIkTTVzev5a78vn2jkp5UL3t7O9uxfIzB+kpUYjcEPJii kGTlomYW422EhzaGHy0Z9uCpV/joPcGDuDFzvbw6VKqm/ZLt1ukgiwpnsrNiuqc5wxPRv/ Syy54cmanOu3Sle+Fj1qibillPzxFooBXbL9ni5LBEjqjUh+9VhCH2KK2Xwsg7pJERQffW +x+oU8AQVMVBlKM/qAugU/Xe13mRqNgo0wJEMAYfOIm+Srjhx3uuMsApe7E0jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370119; a=rsa-sha256; cv=none; b=Cr7cMthKGYMaLW6nS6iCyYfFgbxEMNZKXmAQylxRninGfbWB6x2FTotThxvlzEOcSlJ6gK BpAmYcR8yo/Xxs7EukmRfH57DY/Ad1vK7xvkmxiK3iJ67dmuWObjw8L3YKmKrloYg1zZ2a od/A92sbeXrKjL48SoHg3kg/duiEOYglSzq5RH450c9qKD8E4+oS6iBCdP43F5NfH2qAJ4 iC77UBgx/Fs6m2mhUqj2GaFPLJckYX4OI6d5mvRWrlUPenEZ+6YTtBcbaIOcbk3O/JJrco hV0T5Ru4q8CmPEhPL+IQKUTd4iPSOzP7SW2hRj4Di9mAggMLxr3hdFEf/GQ1JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CabH8Mgk6jalQ+bk5uy65oRvPpaxwCfgeAxoY77Si6o=; b=Uwj78oPGA45aHZgjlnV9tIbkYtL3j74bEyxvp/I5o4Jt2Jwubb7zaeXhZ3H3/4agRAeLWh iLKOoW8guF6V/cMpShntMosY9e0pD97efSpbwbv8uyViJOLjhwBI7lF1TP8e4sXwD/2dMf kcR6rc8kCA6lNJNH4orRWOI/3HRQOgo6CKmTkZ9oUT9n794G7cCOChylA1l+EK+HC7oB8U ZZVn/olnY5Dhub1e10qKYeCDVrKiu/19tYYiMd02NDX8A65mrK/355/oCv4AIm23tWOh/v 3TBiwf3t6cFIXufsPUyt+5eViGzhUPSKGaulSGeSMl8H48muccegndtsDVdJJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ypv0BxdznV3; Fri, 07 Mar 2025 17:55: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 527HtIhp083484; Fri, 7 Mar 2025 17:55:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtI3c083481; Fri, 7 Mar 2025 17:55:18 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:18 GMT Message-Id: <202503071755.527HtI3c083481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: d452a029953e - main - wsp: Add hw.usb.wsp.max_scroll_finger_distance for two-finger scrolling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d452a029953e6e3879c4e73fb023ad9b7ac281a3 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d452a029953e6e3879c4e73fb023ad9b7ac281a3 commit d452a029953e6e3879c4e73fb023ad9b7ac281a3 Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:34 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:34 +0000 wsp: Add hw.usb.wsp.max_scroll_finger_distance for two-finger scrolling The hw.usb.wsp.max_scroll_finger_distance sysctl may be used to specify the maximum distance between two fingers which are registered as a z-axis (vertical scroll with mousepad) movement. Previously, this was shared with the tunable hw.usb.wsp.max_double_tap_distance which is used to specify the maximum distance between two fingers which register as a right-click. This patch also cleans up and add new information to the manpage for wsp(4). Signed-off-by: Joshua Rogers --- share/man/man4/wsp.4 | 21 ++++++++++++++++++--- sys/dev/usb/input/wsp.c | 9 +++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index 83a4421fa2ff..b77d5ac99a7b 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -63,24 +63,39 @@ through nodes under Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.scale_factor . Tap to left-click can be controlled using the sysctl tunable -.Nm hw.usb.wsp.enable_single_tap_clicks , -set to 0 to disable single tap clicks or 1 to enable them (default). +.Nm hw.usb.wsp.enable_single_tap_clicks +with 0 disabling single tap clicks and 1 enabling them (default). Movement on the trackpad following a partially-released click can be controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_movement , -set to 0 to disable the movement on the trackpad until a full release +with 0 to disable the movement on the trackpad until a full release or 1 to allow the continued movement (default). .Nm hw.usb.wsp.max_finger_area defines the maximum area on the trackpad which is registered as a finger (lower for greater palm detection). +.Nm max_scroll_finger_distance +defines the maximum distance between two fingers where z-axis +movements are registered. .Nm hw.usb.wsp.max_double_tap_distance defines the maximum distance between two finger clicks or taps which may register as a double-click. +.Nm hw.usb.wsp.scr_hor_threshold +defines the minimum required horizontal movement to register as a forward +/back button click. Z-Axis sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.z_factor . Z-Axis inversion can be controlled using the sysctl tunable .Nm hw.usb.wsp.z_invert , set to 0 to disable (default) or 1 to enable inversion. +.Pp +.Nm +may use evdev data (if enabled during kernel compilation) for gesture support +using the +.Xr sysctl 8 +value +.Nm kern.evdev.rcpt_mask . +On most MacBooks, setting this value to 3 enables gestures, while 12 +disables them. .Sh FILES .Nm creates a blocking pseudo-device file, diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index f9b85f926221..d74ba1da32b1 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -98,6 +98,7 @@ static struct wsp_tuning { int pressure_tap_threshold; int scr_hor_threshold; int max_finger_area; + int max_scroll_finger_distance; int max_double_tap_distance; int enable_single_tap_clicks; int enable_single_tap_movement; @@ -112,6 +113,7 @@ static struct wsp_tuning { .pressure_tap_threshold = 120, .scr_hor_threshold = 50, .max_finger_area = 1900, + .max_scroll_finger_distance = MAX_FINGER_ORIENTATION/2, .max_double_tap_distance = 2500, .enable_single_tap_clicks = 1, .enable_single_tap_movement = 1, @@ -127,7 +129,8 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); WSP_CLAMP(ptun->max_finger_area, 1, 2400); - WSP_CLAMP(ptun->max_double_tap_distance, 1, 16384); + WSP_CLAMP(ptun->max_scroll_finger_distance, 1, MAX_FINGER_ORIENTATION); + WSP_CLAMP(ptun->max_double_tap_distance, 1, MAX_FINGER_ORIENTATION); WSP_CLAMP(ptun->scr_hor_threshold, 1, 255); WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1); WSP_CLAMP(ptun->enable_single_tap_movement, 0, 1); @@ -147,6 +150,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_tap_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_tap_threshold, 0, "tap pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_finger_area, CTLFLAG_RWTUN, &wsp_tuning.max_finger_area, 0, "maximum finger area"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_scroll_finger_distance, CTLFLAG_RWTUN, + &wsp_tuning.max_scroll_finger_distance, 0, "maximum scroll finger distance"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_double_tap_distance, CTLFLAG_RWTUN, &wsp_tuning.max_double_tap_distance, 0, "maximum double-finger click distance"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, @@ -1262,7 +1267,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (sc->dz_count == 0) dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); - if (sc->scr_mode == WSP_SCR_HOR || sc->distance > tun.max_double_tap_distance) + if (sc->scr_mode == WSP_SCR_HOR || sc->distance > tun.max_scroll_finger_distance) dz = 0; } if (ntouch == 3) From nobody Fri Mar 7 17:55:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ypw42Rfz5pvFh; Fri, 07 Mar 2025 17:55: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 4Z8Ypw1S5Xz3YQ6; Fri, 07 Mar 2025 17:55:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qMQtfY4+PxYYb/CBSaKrEBHLZlHTn2lRc6Pm0D4Mb04=; b=qpTBRGI9Ovz4cCniB8Hxo7dj9iKRSPgDxUUU8Ziot3qu7iRFGjrIma58mDNE94yYEQNwsX 7TFham+lIfEKRhGOA4f0PXq+bBOyLyJ4V9F5eSnk7kh4okrHo8PACgYHHUR1CIK5yiYBDz OD/koeBhPRutkYHXwt+sHzrhxTmCZBxST3MskhfOHsyt/wliGiJXZSGpq5/xejNC+qsi7c W6YN6rH0CHckDR40PVFKXlI2X0795DampPae4nxoiGjqaeskU3AX9fgrt7isosNqfM/EAB vDYg2obXC0MWr2RvIb5UxTeqY95E5j2VPrVNqkPsApBgbuQImYE0dU/NruxkbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370120; a=rsa-sha256; cv=none; b=Gyfm1gQpYgFJMV5OyK8YIjfVCg1TYxAU3zQvXmUjpmfoxQwMij4GBfzT89Ot8+ZuqaXGbC PSWpdeX6snfttn1NdVI2xy8jkvY6zJ9Hk+A2gKTwKH28J0KC2BF6a4HarWqkC0l1q8WZGC vLNFMMkW0YAUH5Dry11PT0nA3Kb+X0KqcrJ9J7uODNzqztTPuKpfrrHptO4h7+jRUp7evR +DekCOotJFV/CqJOu4FxL8N/queUHE1PuvT7rdwhfoCX5VVKx+YhHqu/r6uhhq9a9O6Cst RRde9Ouc29n79R2ETMKUz5WOeNaVvMfrWwMnNakoJYfFrTr5KDbYizjm117SRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qMQtfY4+PxYYb/CBSaKrEBHLZlHTn2lRc6Pm0D4Mb04=; b=J7pDEQjKjafaIhuRDYR4i4RULndSyxVM9l4LN0eScF2nhJLA4yKGzKJ7knv/H1ZbySQBcV UeHIOIUl+cMA9dHzScyLh53E5nFzzECvJMkpbvMe9u6WDVNpekxtdZRqL4u8Mc92HZoTPX trLc8kQuUNuf52CpkrQmJ/sJRJpjvbKpgnvw5AshB+8pzFni6LMLFusOMbMff91iKy1F1c wkDEHz6RynYyGQGM+Z8iOU+Ig2orSSnslLDzi8g1CAfz84EOhqmFapEe2NLR2tkij9xE/3 AQTP6gdznd25xaN90W5YeHHFFXp4GpNrAdRkMAWWDpcrNeC2aFJAza9RpYpxFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ypw12YfznPm; Fri, 07 Mar 2025 17:55: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 527HtKhu083517; Fri, 7 Mar 2025 17:55:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtKfC083514; Fri, 7 Mar 2025 17:55:20 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:20 GMT Message-Id: <202503071755.527HtKfC083514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 02fb6b1162d9 - main - wsp: Fix typo in function name. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02fb6b1162d94962acde5815aa7c315191c3ec03 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=02fb6b1162d94962acde5815aa7c315191c3ec03 commit 02fb6b1162d94962acde5815aa7c315191c3ec03 Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:34 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:34 +0000 wsp: Fix typo in function name. Signed-off-by: Joshua Rogers --- sys/dev/usb/input/wsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index d74ba1da32b1..55b9aadfce86 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -120,7 +120,7 @@ static struct wsp_tuning { }; static void -wsp_runing_rangecheck(struct wsp_tuning *ptun) +wsp_running_rangecheck(struct wsp_tuning *ptun) { WSP_CLAMP(ptun->scale_factor, 1, 63); WSP_CLAMP(ptun->z_factor, 1, 63); @@ -958,7 +958,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) int slot = 0; #endif - wsp_runing_rangecheck(&tun); + wsp_running_rangecheck(&tun); if (sc->dz_count == 0) sc->dz_count = WSP_DZ_MAX_COUNT; From nobody Fri Mar 7 17:55:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ypx4H3sz5pvCS; Fri, 07 Mar 2025 17:55: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 4Z8Ypx2Ktrz3Y3X; Fri, 07 Mar 2025 17:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fMTAJpSV6wmabkYiP8T2QflFpuJI+DNHkoVfqS5DDNM=; b=dS29N/6OZTD3pKXAcckBJJY1j1pFdk2yqtZNrQ86e5jM6c9C69AxPZ7GfWuMsoROCbfaY7 17KdxO3xL35XFIxDRPZg7UxzKQmG9eET5DqSvCDjd6/wOxODtTZTZyQsvtC2iYFyOuaPVi YXlwZA4dvO8Yvbc788J0Cp4Bknd1+OsiJMI/3F4nuJj43zHOQbJ68GjkDdpyZevzLkreYL /KSEkKhRzbCkWWG7UzaAZ102XZ1p6AQ8/pZK0JUSCnKeylJ44gsERV1LmBf4nWKvg76Azt DtYgpOqdCywKxvft8Pt0Ww4qrXz4kwzKOXDkYTBGZQA3B+b+DDlvh/2zIjZslg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370121; a=rsa-sha256; cv=none; b=jOeHpu0gHfnmbiyqxzwaFVDo04trBpsV7SKAh3gZXPSWU4WfFfAj5bU1AJOnghkt/HuoEs Cz6wrHrc/ig2sMtl8DGrtPrfu+GvEFg1+9QWMRVLZgWgoGZY2dEIqF5akJJeofQP98VNvV BaQjsmhFTwHl1AS6S8S1HfVqv7Odpel/liDnp692vNOzpBYFcUzarLAbdkPVwAUj3qmoXQ OO2tFFFkTJGvS7hRfHdeHrh0FzfTI6H+seAI76QLBHefa64soTiPVN76qWVdk10Ib2EAN9 4oXQcWv/YV8CLguvC6Z8GdXfQI/cJSMe+YQrKohKwmrXp2772zgL/yqThb0p+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fMTAJpSV6wmabkYiP8T2QflFpuJI+DNHkoVfqS5DDNM=; b=DSHZWfkE23ukReC3Ni3JLQeGrTyisqaKhM6juQqRJ0ecBLmYpqF1ITp0arS5M3+e3FkLPS FXvT32s1z64Gd9Lz8jd25GYD/aDM2Cn96EC0++xL1mawEMgD6VSGT87B8UDJzaPQoWEe/S na9vVbMbXo5Gz73eHZq+h9JqqpIpZZzhKwDQ003YyN+8Qr8EuwnRk+X7G8xpQB8vactml+ cfXoSoghxrZDUJo9LO6Q0/pccNbecs6GBUPVW1JdDglyfaxdvkCn8506qhU6oYuyrfIoD2 DchYNMIzE1MoDVZ8W4aZscrNMU9PtqgfVhHs12+3vgSEkU9gBi9YTGhLmtdOAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ypx1lZszmKw; Fri, 07 Mar 2025 17:55: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 527HtLLd083551; Fri, 7 Mar 2025 17:55:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtLdT083548; Fri, 7 Mar 2025 17:55:21 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:21 GMT Message-Id: <202503071755.527HtLdT083548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8b04f07eda12 - main - sysmouse(4): Add wsp(4)-style T-Axis reporting. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b04f07eda12badee0617508c37a0d9506acad24 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8b04f07eda12badee0617508c37a0d9506acad24 commit 8b04f07eda12badee0617508c37a0d9506acad24 Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:35 +0000 sysmouse(4): Add wsp(4)-style T-Axis reporting. Neither the ums(4) nor psm(4) reporting can be used by the wsp(4) driver, as they rely on static-length movements, while wsp(4) may need to scroll in large amounts per evdev event push. This style uses a false button-5 press as an indicator that the z-axis movement is a horizontal scroll, otherwise a vertical scroll. Signed-off-by: Joshua Rogers --- sys/dev/evdev/evdev.c | 2 +- sys/dev/evdev/evdev.h | 2 ++ sys/dev/syscons/sysmouse.c | 14 +++++++++++--- sys/dev/vt/vt_sysmouse.c | 14 +++++++++++--- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/sys/dev/evdev/evdev.c b/sys/dev/evdev/evdev.c index 87cdaeb91e49..e71f4f389d5c 100644 --- a/sys/dev/evdev/evdev.c +++ b/sys/dev/evdev/evdev.c @@ -82,7 +82,7 @@ SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RWTUN, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " "bit2 - mouse hardware, bit3 - keyboard hardware"); SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RWTUN, - &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); + &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm, 3-wsp"); #endif SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Evdev input devices"); diff --git a/sys/dev/evdev/evdev.h b/sys/dev/evdev/evdev.h index 2f00d49c485d..2ee374f184cc 100644 --- a/sys/dev/evdev/evdev.h +++ b/sys/dev/evdev/evdev.h @@ -62,12 +62,14 @@ extern int evdev_rcpt_mask; * 0 - do not extract horizontal wheel movement (default). * 1 - ums(4) horizontal wheel encoding. T-axis is mapped to buttons 6 and 7 * 2 - psm(4) wheels encoding: z = 1,-1 - vert. wheel, z = 2,-2 - horiz. wheel + * 3 - wsp(4) horizontal and vertical encoding. T-axis is mapped to button 5. */ enum { EVDEV_SYSMOUSE_T_AXIS_NONE = 0, EVDEV_SYSMOUSE_T_AXIS_UMS = 1, EVDEV_SYSMOUSE_T_AXIS_PSM = 2, + EVDEV_SYSMOUSE_T_AXIS_WSP = 3, }; extern int evdev_sysmouse_t_axis; diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c index 0e38070d613c..05008c50b950 100644 --- a/sys/dev/syscons/sysmouse.c +++ b/sys/dev/syscons/sysmouse.c @@ -94,7 +94,15 @@ smdev_evdev_write(int x, int y, int z, int buttons) evdev_push_event(sysmouse_evdev, EV_REL, REL_X, x); evdev_push_event(sysmouse_evdev, EV_REL, REL_Y, y); switch (evdev_sysmouse_t_axis) { - case EVDEV_SYSMOUSE_T_AXIS_PSM: + case EVDEV_SYSMOUSE_T_AXIS_WSP: /* 3 */ + if (buttons & (1 << 5)) { + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, z); + buttons &= ~(1 << 5); + } else { + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + } + break; + case EVDEV_SYSMOUSE_T_AXIS_PSM: /* 2 */ switch (z) { case 1: case -1: @@ -106,14 +114,14 @@ smdev_evdev_write(int x, int y, int z, int buttons) break; } break; - case EVDEV_SYSMOUSE_T_AXIS_UMS: + case EVDEV_SYSMOUSE_T_AXIS_UMS: /* 1 */ if (buttons & (1 << 6)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1); else if (buttons & (1 << 5)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1); buttons &= ~((1 << 5)|(1 << 6)); /* PASSTHROUGH */ - case EVDEV_SYSMOUSE_T_AXIS_NONE: + case EVDEV_SYSMOUSE_T_AXIS_NONE: /* 0 */ default: evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); } diff --git a/sys/dev/vt/vt_sysmouse.c b/sys/dev/vt/vt_sysmouse.c index 5147865fc20f..f2f5a0fa5c3a 100644 --- a/sys/dev/vt/vt_sysmouse.c +++ b/sys/dev/vt/vt_sysmouse.c @@ -128,7 +128,15 @@ sysmouse_evdev_store(int x, int y, int z, int buttons) evdev_push_event(sysmouse_evdev, EV_REL, REL_X, x); evdev_push_event(sysmouse_evdev, EV_REL, REL_Y, y); switch (evdev_sysmouse_t_axis) { - case EVDEV_SYSMOUSE_T_AXIS_PSM: + case EVDEV_SYSMOUSE_T_AXIS_WSP: /* 3 */ + if (buttons & (1 << 5)) { + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, z); + buttons &= ~(1 << 5); + } else { + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + } + break; + case EVDEV_SYSMOUSE_T_AXIS_PSM: /* 2 */ switch (z) { case 1: case -1: @@ -140,14 +148,14 @@ sysmouse_evdev_store(int x, int y, int z, int buttons) break; } break; - case EVDEV_SYSMOUSE_T_AXIS_UMS: + case EVDEV_SYSMOUSE_T_AXIS_UMS: /* 1 */ if (buttons & (1 << 6)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1); else if (buttons & (1 << 5)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1); buttons &= ~((1 << 5)|(1 << 6)); /* PASSTHROUGH */ - case EVDEV_SYSMOUSE_T_AXIS_NONE: + case EVDEV_SYSMOUSE_T_AXIS_NONE: /* 0 */ default: evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); } From nobody Fri Mar 7 17:55:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ypz0q1sz5pvJ1; Fri, 07 Mar 2025 17:55: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 4Z8Ypy2cG8z3YKZ; Fri, 07 Mar 2025 17:55:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RkWk/tPQcaEqWEczIF9NZ9dJeH0Id5XYdOfAbbjQOkc=; b=gI8IJ3k4Pqg9W2C+mtuVfUSvpNe10r4xrR36iZcqJlC0euy4jsQ6fYT7o6YCIM3rcFsBoD 4oUARZWiUlIsc3ZFvmp9OCTRI7YLmtGqTJKEigc9RpzdgReEIzFLS1ecSuLdRvKsmf1kwP smzmI4EQP/PFviTnG2BOtooURQHgFp3EsNeWVLNP+0daEvFOiREkOhcZpKpptwuplZ7VWw 2WWMMPp73YPVlSMzMTTlXiXcVxy4z4Aaj29wxYk3vNytqVys20LfP5+dcmcWJahdk34nTV xY1PoQMRrezqj1DB7Au/VJOMLnC7KtWE8JTOlZyOoRtpCq2eziw59UfibhG+zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370122; a=rsa-sha256; cv=none; b=wIv1n0IMy/NjSJgv/SyNMc450GnO9d47KiB1DVtsKtuc37I0pPs+HHmwYaZDVqCpbXDmTw gf9lTmmnuxYTbzbpbEvyQOSGNiB7QmQlNngJwuWsVaqSkQtK8GA9Q4r2w5uh0DUMn2gVIc XuzQFqWp7PNEu4esqsYfIRLmjwNc2Hikmb69gMP3XOPLZO5QJBHnHUv9xeUcrT/zguX2kB wAuhyi9aF2d1nZHEOxa/HdkinqFbYg7/XYO44imo3PBGOitHeV0noVb5/LCb4a8dVZCEsL /2fmffd24pxk4cynNyotJLJ2SYy35Vr/ZBT4dcd/KwWInHF7yX5sTNseYFbNkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RkWk/tPQcaEqWEczIF9NZ9dJeH0Id5XYdOfAbbjQOkc=; b=ZcUHGkAxJ1lt7+TgKSn3zt8KVG+uxQTbGxmwm4GYb0vcbbXej8GsuPqMrN6M/7EhFqPCFu fl4b/kGqYcXqxn0CkLPVqIEgT06qIxRPrDGC/uI8QpnyiCXv9zVe1lT4COTPEyQjwKKrwF dMw6464MDETGdjZ6Qqu/ARay9Bg2ajhQktKitIsD4UwIOzKhiv3IdAeH+YD9Iy0MQmkt4D wzzvME2FDc1rt8GhKhy7qaZ0RVvhWqosUxfBzDX7wyIMhgSgSlCPNK5jffKEvJiNqhm9i0 xbWgo551chCoARSW96Tc6b+gTonjTt1UXDsnneDQIyR+Kyzhr7detpsTUlAMqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ypy203XznbB; Fri, 07 Mar 2025 17:55: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 527HtMiV083587; Fri, 7 Mar 2025 17:55:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtM11083584; Fri, 7 Mar 2025 17:55:22 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:22 GMT Message-Id: <202503071755.527HtM11083584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: a79397d13228 - main - wsp: Handle horizontal scrolling and create tunable for swipe/scroll. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a79397d13228b1e2cc00e4f18158966b3d8cac83 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a79397d13228b1e2cc00e4f18158966b3d8cac83 commit a79397d13228b1e2cc00e4f18158966b3d8cac83 Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:35 +0000 wsp: Handle horizontal scrolling and create tunable for swipe/scroll. Previously, a two-finger horizontal scroll would result in a forwards/backwards keyboard event being performed. This patch changes that functionality to be specified via two new sysctls: horizontal_swipe_finger_count and scroll_finger_count. The former specifies how many fingers are used to perform the aforementioned forwards/backwards keyboard event, while the latter specifies how many fingers are used to perform horizontal scrolling. 0 disables each of them. The threshold for scrolling has been coupled into a single tunable: scr_threshold. This tunable is used for both scrolling and the horizontal swipe. t_factor and t_invert tunables have been created in the same manner as their z-axis counterparts. Horizontal scrolling is disabled by default, as it requires the sysctl hw.usb.wsp.t_factor to 3 (wsp mode). Horizontal swiping is enabled by default with a three-finger tap. Also rewrite much of, and improve, documentation. Signed-off-by: Joshua Rogers --- share/man/man4/wsp.4 | 158 ++++++++++++++++++++++++++++++++++++------------ sys/dev/usb/input/wsp.c | 113 ++++++++++++++++++++++++---------- 2 files changed, 200 insertions(+), 71 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index b77d5ac99a7b..de2c121784d4 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -49,53 +49,131 @@ The driver provides support for the Apple Internal Trackpad device found in many Apple laptops. .Pp -The driver simulates a three-button mouse using multi-finger tap +The driver simulates a three-button mouse using multi-finger press/tap detection. A single-finger press generates a left button click. -A two-finger tap maps to the right button; whereas a three-finger tap -gets treated as a middle button click. +A two-finger press maps to the right button; whereas a three-finger +press gets treated as a middle button click. .Pp +The trackpad functions with presses and taps. A press is a full-forced +press which causes a physical lowering of the trackpad. A tap is a +touch of the trackpad which does not depress the physical trackpad. +.Pp +The .Nm -supports dynamic reconfiguration using +driver supports receiving evdev input device data if enabled. This data +is used for extended usage of the touchpad like multi-finger support, +pressure detection, tap support, and gestures. At least the second bit +of the .Xr sysctl 8 -through nodes under -.Nm hw.usb.wsp . -Pointer sensitivity can be controlled using the sysctl tunable -.Nm hw.usb.wsp.scale_factor . -Tap to left-click can be controlled using the sysctl tunable -.Nm hw.usb.wsp.enable_single_tap_clicks -with 0 disabling single tap clicks and 1 enabling them (default). -Movement on the trackpad following a partially-released click can be -controlled using the sysctl tunable -.Nm hw.usb.wsp.enable_single_tap_movement , -with 0 to disable the movement on the trackpad until a full release -or 1 to allow the continued movement (default). -.Nm hw.usb.wsp.max_finger_area -defines the maximum area on the trackpad which is registered as a -finger (lower for greater palm detection). -.Nm max_scroll_finger_distance -defines the maximum distance between two fingers where z-axis -movements are registered. -.Nm hw.usb.wsp.max_double_tap_distance -defines the maximum distance between two finger clicks or taps which may -register as a double-click. -.Nm hw.usb.wsp.scr_hor_threshold -defines the minimum required horizontal movement to register as a forward -/back button click. -Z-Axis sensitivity can be controlled using the sysctl tunable -.Nm hw.usb.wsp.z_factor . -Z-Axis inversion can be controlled using the sysctl tunable -.Nm hw.usb.wsp.z_invert , -set to 0 to disable (default) or 1 to enable inversion. +tunable +.Nm kern.evdev.rcpt_mask +must be set. This can be enabled with +.Nm kern.evdev.rcpt_mask=3 . .Pp -.Nm -may use evdev data (if enabled during kernel compilation) for gesture support -using the +Vertical scrolling (z-axis) is enabled by default with a two-finger +tap and the movement of a finger up and down. +Horizontal scrolling (t-axis) is not natively supported by the sysmouse +protocol, therefore must be enabled with evdev data. This can be enabled +with the +.Xr sysctl 8 +tunable +.Nm kern.evdev.sysmouse_t_axis=3. +Horizontal scrolling can be used with a two-finger tap and the movement +of a finger from side to side. The .Xr sysctl 8 -value -.Nm kern.evdev.rcpt_mask . -On most MacBooks, setting this value to 3 enables gestures, while 12 -disables them. +tunable +.Nm hw.usb.wsp.t_factor +must be greater than 0 for horizontal scrolling to be enabled, too. +.Pp +Horizontal swiping with a three-finger tap is registered as mouse buttons +8 and 9, depending on the direction. These buttons default to backwards +and forwards keyboard events. +.Sh SYSCTL VARIABLES +The following variables are available as +.Xr sysctl 8 +tunables: +.Bl -tag -width indent +.It Va hw.usb.wsp.scale_factor +Controls the pointer sensitivity. Default is 12. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.enable_single_tap_clicks +Enables single-tap to register as a left-click. Default is 1 (enabled). +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.enable_single_tap_movement +Enables movement on the trackpad follow a partially-released left-click. +Default is 1 (enabled). +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.max_finger_area +Specifies the maximum area on the trackpad which is registered as a +finger (a lower value is used for palm detection). Default is 1900. +.El +.Bl -tag -width indent +.It Va max_scroll_finger_distance +Specifies the maximum distance between two fingers where z-axis +and t-axis movements are registered. Z-axis and T-axis movements +are vertical and horizontal movements with more than one finger +tapped (not clicked), respectively. Default is 8192. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.max_double_tap_distance +Specifies the maximum distance between two fingers that a two-finger +click will be registered as a right-click. Default is 2500. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.scr_threshold +Specifies the minimum horizontal or vertical distance required to +register as a scrolling gesture. Default is 20. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.z_factor +Z-axis sensitivity. Default is 5. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.z_invert +Z-axis inversion. Default is 0 (disabled). +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.t_factor +T-axis sensitivity. Default is 0 (disabled). +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.t_invert +T-axis inversion. Default is 0 (disabled). +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.scroll_finger_count +Specifies the number of tapped fingers which registers as a scrolling +movement. Default is 2. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.horizontal_swipe_finger_count +Speifies the number of tapped fingers which registers as a swipe +gesture. Default is 3. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.pressure_touch_threshold +Specifies the threshold for a finger to be registered as a click. +Default is 50. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.pressure_untouch_threshold +Specifies the threshold for a finger to be registered as an unclick. +Default is 10. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.pressure_tap_threshold +Specifies the threadhold for a finger to be registered as a tap. +Default is 120. +.El +.Bl -tag -width indent +.It Va hw.usb.wsp.debug +Specifies the +.Nm +driver debugging level (0-3). Default is 1. .Sh FILES .Nm creates a blocking pseudo-device file, diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index 55b9aadfce86..55289aa40b17 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -86,17 +86,21 @@ enum wsp_log_level { static int wsp_debug = WSP_LLEVEL_ERROR;/* the default is to only log errors */ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, debug, CTLFLAG_RWTUN, - &wsp_debug, WSP_LLEVEL_ERROR, "WSP debug level"); + &wsp_debug, WSP_LLEVEL_ERROR, "WSP debug level (0-3)"); #endif /* USB_DEBUG */ static struct wsp_tuning { int scale_factor; + int scroll_finger_count; + int horizontal_swipe_finger_count; int z_factor; int z_invert; + int t_factor; + int t_invert; int pressure_touch_threshold; int pressure_untouch_threshold; int pressure_tap_threshold; - int scr_hor_threshold; + int scr_threshold; int max_finger_area; int max_scroll_finger_distance; int max_double_tap_distance; @@ -106,12 +110,16 @@ static struct wsp_tuning { wsp_tuning = { .scale_factor = 12, + .scroll_finger_count = 2, + .horizontal_swipe_finger_count = 3, .z_factor = 5, .z_invert = 0, + .t_factor = 0, + .t_invert = 0, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, - .scr_hor_threshold = 50, + .scr_threshold = 20, .max_finger_area = 1900, .max_scroll_finger_distance = MAX_FINGER_ORIENTATION/2, .max_double_tap_distance = 2500, @@ -123,25 +131,37 @@ static void wsp_running_rangecheck(struct wsp_tuning *ptun) { WSP_CLAMP(ptun->scale_factor, 1, 63); - WSP_CLAMP(ptun->z_factor, 1, 63); + WSP_CLAMP(ptun->scroll_finger_count, 0, 3); + WSP_CLAMP(ptun->horizontal_swipe_finger_count, 0, 3); + WSP_CLAMP(ptun->z_factor, 0, 63); WSP_CLAMP(ptun->z_invert, 0, 1); + WSP_CLAMP(ptun->t_factor, 0, 63); + WSP_CLAMP(ptun->t_invert, 0, 1); WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); WSP_CLAMP(ptun->max_finger_area, 1, 2400); WSP_CLAMP(ptun->max_scroll_finger_distance, 1, MAX_FINGER_ORIENTATION); WSP_CLAMP(ptun->max_double_tap_distance, 1, MAX_FINGER_ORIENTATION); - WSP_CLAMP(ptun->scr_hor_threshold, 1, 255); + WSP_CLAMP(ptun->scr_threshold, 1, 255); WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1); WSP_CLAMP(ptun->enable_single_tap_movement, 0, 1); } SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN, &wsp_tuning.scale_factor, 0, "movement scale factor"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scroll_finger_count, CTLFLAG_RWTUN, + &wsp_tuning.scroll_finger_count, 0, "amount of fingers to use scrolling gesture"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, horizontal_swipe_finger_count, CTLFLAG_RWTUN, + &wsp_tuning.horizontal_swipe_finger_count, 0, "amount of fingers to use horizontal swipe gesture"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_factor, CTLFLAG_RWTUN, - &wsp_tuning.z_factor, 0, "Z-axis scale factor"); + &wsp_tuning.z_factor, 0, "Z-axis (vertical) scale factor"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_invert, CTLFLAG_RWTUN, - &wsp_tuning.z_invert, 0, "enable Z-axis inversion"); + &wsp_tuning.z_invert, 0, "enable (vertical) Z-axis inversion"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, t_factor, CTLFLAG_RWTUN, + &wsp_tuning.t_factor, 0, "T-axis (horizontal) scale factor"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, t_invert, CTLFLAG_RWTUN, + &wsp_tuning.t_invert, 0, "enable T-axis (horizontal) inversion"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_touch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_touch_threshold, 0, "touch pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, @@ -154,8 +174,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_scroll_finger_distance, CTLFLAG_RWTUN, &wsp_tuning.max_scroll_finger_distance, 0, "maximum scroll finger distance"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_double_tap_distance, CTLFLAG_RWTUN, &wsp_tuning.max_double_tap_distance, 0, "maximum double-finger click distance"); -SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, - &wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_threshold, CTLFLAG_RWTUN, + &wsp_tuning.scr_threshold, 0, "scrolling threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_clicks, CTLFLAG_RWTUN, &wsp_tuning.enable_single_tap_clicks, 0, "enable single tap clicks"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_movement, CTLFLAG_RWTUN, @@ -1144,11 +1164,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) } wsp_add_to_queue(sc, 0, 0, 0, 0); /* button release */ } - if ((sc->dt_sum / tun.scr_hor_threshold) != 0 && - sc->ntaps == 2 && sc->scr_mode == WSP_SCR_HOR) { + + if (sc->scr_mode == WSP_SCR_HOR && sc->ntaps == tun.horizontal_swipe_finger_count + && tun.horizontal_swipe_finger_count > 0 && (sc->dt_sum / tun.scr_threshold) != 0) { /* - * translate T-axis into button presses - * until further + * translate T-axis swipe into button + * presses 3 and 4 (forward/back) */ if (sc->dt_sum > 0) wsp_add_to_queue(sc, 0, 0, 0, 1UL << 3); @@ -1234,11 +1255,18 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx, dy, sc->finger); } if (sc->dz_count--) { - rdz = (dy + sc->rdz) % tun.scale_factor; - sc->dz_sum -= (dy + sc->rdz) / tun.scale_factor; + if (sc->scr_mode == WSP_SCR_HOR) { + rdz = (dx + sc->rdz) % tun.scale_factor; + sc->dz_sum -= (dx + sc->rdz) / tun.scale_factor; + } else if (sc->scr_mode == WSP_SCR_VER) { + rdz = (dy + sc->rdz) % tun.scale_factor; + sc->dz_sum -= (dy + sc->rdz) / tun.scale_factor; + } sc->rdz = rdz; } - if ((sc->dz_sum / tun.z_factor) != 0) + if (sc->scr_mode == WSP_SCR_VER && (tun.z_factor == 0 || (sc->dz_sum / tun.z_factor) != 0)) + sc->dz_count = 0; + else if (sc->scr_mode == WSP_SCR_HOR && (tun.t_factor == 0 || (sc->dz_sum / tun.t_factor) != 0)) sc->dz_count = 0; } rdx = (dx + sc->rdx) % tun.scale_factor; @@ -1252,26 +1280,49 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) sc->dx_sum += dx; sc->dy_sum += dy; - if (ntouch == 2 && sc->sc_status.button == 0) { - if (sc->scr_mode == WSP_SCR_NONE && - abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_hor_threshold) - sc->scr_mode = abs(sc->dx_sum) > - abs(sc->dy_sum) * 2 ? WSP_SCR_HOR : WSP_SCR_VER; - DPRINTFN(WSP_LLEVEL_INFO, "scr_mode=%5d, count=%d, dx_sum=%d, dy_sum=%d\n", - sc->scr_mode, sc->intr_count, sc->dx_sum, sc->dy_sum); - if (sc->scr_mode == WSP_SCR_HOR) - sc->dt_sum += dx; - else - sc->dt_sum = 0; + if (sc->sc_status.button == 0 && ntouch > 0) { + if (ntouch == tun.scroll_finger_count || ntouch == tun.horizontal_swipe_finger_count) { + if (sc->scr_mode == WSP_SCR_NONE && abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_threshold) + sc->scr_mode = abs(sc->dx_sum) > abs(sc->dy_sum) * 2 ? WSP_SCR_HOR : WSP_SCR_VER; - dx = dy = 0; - if (sc->dz_count == 0) - dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); - if (sc->scr_mode == WSP_SCR_HOR || sc->distance > tun.max_scroll_finger_distance) + DPRINTFN(WSP_LLEVEL_INFO, "scr_mode=%5d, count=%d, dx_sum=%d, dy_sum=%d\n", sc->scr_mode, sc->intr_count, sc->dx_sum, sc->dy_sum); + } + + if (ntouch == tun.scroll_finger_count) { /* preference scrolling over swipe if tun.scroll_finger_count == tun.horizontal_swipe_finger_count */ + if (sc->scr_mode == WSP_SCR_HOR) { + sc->sc_status.button = 1 << 5; + } + dx = dy = dz = 0; dz = 0; + sc->dt_sum = 0; + if (sc->distance <= tun.max_scroll_finger_distance && sc->dz_count == 0) { + if (sc->scr_mode == WSP_SCR_VER) { + if (tun.z_factor > 0) + dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); + } else if (sc->scr_mode == WSP_SCR_HOR) { + if (tun.t_factor > 0) + dz = (sc->dz_sum / tun.t_factor) * (tun.t_invert ? -1 : 1); + } + } + } else if (ntouch == tun.horizontal_swipe_finger_count) { + if (sc->scr_mode == WSP_SCR_HOR) { + sc->dt_sum += dx * (tun.t_invert ? -1 : 1); + } else { + sc->dt_sum = 0; + } + dx = dy = dz = 0; + } } + if (ntouch == 3) dx = dy = dz = 0; + + if (ntouch != tun.horizontal_swipe_finger_count) + sc->dt_sum = 0; + + if (ntouch == 0) + sc->scr_mode = WSP_SCR_NONE; + if (sc->intr_count < WSP_TAP_MAX_COUNT && abs(dx) < 3 && abs(dy) < 3 && abs(dz) < 3) dx = dy = dz = 0; From nobody Fri Mar 7 17:55:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Yq01Py2z5pvR5; Fri, 07 Mar 2025 17:55:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8Ypz3dB8z3YQb; Fri, 07 Mar 2025 17:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gL+4Jnqu9ZGJ1vm9IMX0493wuzXWauzNfUdAnqr9q4I=; b=vAWuflyByRoRlgfsvk+XAVC28wXfcp949IKgrPKPVV2cLM3Hfa9N6j/LfHAdfsThiSKD8h s86yP4aNEw9bxjka4cd4s6LUKhfq7oBpPFeD9qfpJTU7cYmB+goidWYJfar+PcmFY96uuj 1W7mb79lWq5Rl3Z5zmSsCFUTvJJDbok2cMffVNPx0Z8Q/JEk6PxGx0y+M1aXvDMD6H+l7P ipNYOFEjtB6vAI00ln1r1nvaGEOeVtQFz6wqyur+4SBbVuRwOnZ1NE8GnPUKu8c0IHbFxa 0kscj8+sFvyeZuePhcklrxpuup+ck6ztQhZzv+3r7Tt7ZGGf/rO0rQw5XuVCIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370123; a=rsa-sha256; cv=none; b=N/tRMdFM6IHU7xUliwO2UlQVl8p55lWdN6LZAbZXbubk9DcCMPP/HwBJ+4TDDNWALN4ECp +hz5PzTdUrWKZv1QaairvWFDLHCmHS/J7HAqREUo98Cg8a0O5ok9QlVHcIiHtwlnloWq2o 73y3Ahl/8xGR+ny335M9V2vxU/GeUzsiAOQUHnivSLl0Qo+Pi16NpJXnOH8H6HaYVgmYgL ym+AQgMDxs7CiSEg7d5OUNgosfrPOnjcMUmdhIKBIBJhpdZQY3/LeyxTeBsHURY0XCBn7e LBab2CBv1WxqipYL9DUIRDgP73aKgUCHUVDDMlPKeWH7svo1w9Qs5jHwHg78rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gL+4Jnqu9ZGJ1vm9IMX0493wuzXWauzNfUdAnqr9q4I=; b=ajxfvAUe7yJdllur0GWKwClCyMyjQHrdLcoNrXsKz1CsqawV/U7n3IvvaYk0FDF30av0Ko YwoA1kkUioCI3htTT1VNgGnYzHF0DpZGI8sirC2FBAMstG7hmZM/Z8QRMOr82kxVC0xSSD V18ZVwOuZtLVSl0nMnujEtrYf1PjngpocuzTAiexKwXza/A2LIOoaKuIHDb7xly45EgxcO vosfWxr3+9aTQtZGP3Pdzp+k6lM9smCWY/OyrygiA0Dk5uGErDuY2ZgxPMJmpGIADtMAlY VXDk5Duo+jr4PHKKIZYL4oG53S4xkZAVQaNLI7IjDT+NcgkAhuvm9K2RneTB8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ypz33kBzngL; Fri, 07 Mar 2025 17:55: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 527HtNPC083620; Fri, 7 Mar 2025 17:55:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtN0g083617; Fri, 7 Mar 2025 17:55:23 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:23 GMT Message-Id: <202503071755.527HtN0g083617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: e381dabcc580 - main - wsp: Rename max_finger_area sysctl to max_finger_diameter List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e381dabcc58095d9be135b1027613cbf77a1ba7f Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e381dabcc58095d9be135b1027613cbf77a1ba7f commit e381dabcc58095d9be135b1027613cbf77a1ba7f Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:35 +0000 wsp: Rename max_finger_area sysctl to max_finger_diameter The value of this sysctl is not an area, but a maximum diameter. Signed-off-by: Joshua Rogers --- share/man/man4/wsp.4 | 4 ++-- sys/dev/usb/input/wsp.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index de2c121784d4..9fcec5133830 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -107,8 +107,8 @@ Enables movement on the trackpad follow a partially-released left-click. Default is 1 (enabled). .El .Bl -tag -width indent -.It Va hw.usb.wsp.max_finger_area -Specifies the maximum area on the trackpad which is registered as a +.It Va hw.usb.wsp.max_finger_diameter +Specifies the maximum finger diameter on the trackpad that is registered as a finger (a lower value is used for palm detection). Default is 1900. .El .Bl -tag -width indent diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index 55289aa40b17..b9311ffd6c2d 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -101,7 +101,7 @@ static struct wsp_tuning { int pressure_untouch_threshold; int pressure_tap_threshold; int scr_threshold; - int max_finger_area; + int max_finger_diameter; int max_scroll_finger_distance; int max_double_tap_distance; int enable_single_tap_clicks; @@ -120,7 +120,7 @@ static struct wsp_tuning { .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, .scr_threshold = 20, - .max_finger_area = 1900, + .max_finger_diameter = 1900, .max_scroll_finger_distance = MAX_FINGER_ORIENTATION/2, .max_double_tap_distance = 2500, .enable_single_tap_clicks = 1, @@ -140,7 +140,7 @@ wsp_running_rangecheck(struct wsp_tuning *ptun) WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); - WSP_CLAMP(ptun->max_finger_area, 1, 2400); + WSP_CLAMP(ptun->max_finger_diameter, 1, 2400); WSP_CLAMP(ptun->max_scroll_finger_distance, 1, MAX_FINGER_ORIENTATION); WSP_CLAMP(ptun->max_double_tap_distance, 1, MAX_FINGER_ORIENTATION); WSP_CLAMP(ptun->scr_threshold, 1, 255); @@ -168,8 +168,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_untouch_threshold, 0, "untouch pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_tap_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_tap_threshold, 0, "tap pressure threshold"); -SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_finger_area, CTLFLAG_RWTUN, - &wsp_tuning.max_finger_area, 0, "maximum finger area"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_finger_diameter, CTLFLAG_RWTUN, + &wsp_tuning.max_finger_diameter, 0, "maximum finger diameter"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_scroll_finger_distance, CTLFLAG_RWTUN, &wsp_tuning.max_scroll_finger_distance, 0, "maximum scroll finger distance"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_double_tap_distance, CTLFLAG_RWTUN, @@ -897,10 +897,10 @@ wsp_attach(device_t dev) WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_POSITION_Y, sc->sc_params->y); /* finger pressure */ WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_PRESSURE, sc->sc_params->p); - /* finger touch area */ + /* finger major/minor axis */ WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_TOUCH_MAJOR, sc->sc_params->w); WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_TOUCH_MINOR, sc->sc_params->w); - /* finger approach area */ + /* finger major/minor approach */ WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_WIDTH_MAJOR, sc->sc_params->w); WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_WIDTH_MINOR, sc->sc_params->w); /* finger orientation */ @@ -1110,7 +1110,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) switch (ntouch) { case 1: if (sc->index[0]->touch_major > tun.pressure_tap_threshold && - sc->index[0]->tool_major <= tun.max_finger_area) + sc->index[0]->tool_major <= tun.max_finger_diameter) sc->ntaps = 1; break; case 2: @@ -1216,7 +1216,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; /* Ignore unexpected movement when typing (palm detection) */ - if (ntouch == 1 && sc->index[0]->tool_major > tun.max_finger_area) + if (ntouch == 1 && sc->index[0]->tool_major > tun.max_finger_diameter) dx = dy = 0; if (sc->ibtn != 0 && ntouch == 1 && From nobody Fri Mar 7 17:55:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Yq114Qnz5pv70; Fri, 07 Mar 2025 17:55: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 4Z8Yq04Pzjz3YBx; Fri, 07 Mar 2025 17:55:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oNQfKoiMFF4AMdZgyhitgca5wT0Ce+2BCGGGTPRNnTY=; b=B0/LFBNrE5241I64Z6DxgI4LQ+qhPqULNWmusWQIE/2YM1T69Y6tCjyY8R6cIaUtoXeYIb gHQ8ds2aGFtFZvn1VSsWI2BbUbhokHQSkNJWuXKADJa7kPm4h4srId+BSkB0qoWMz/SMtZ y8tiwoqV4SQl5PNe4KG17yo/rxZY20eYk1P+1MoFWjXpySgrEoNf8rMxiUbgDVljBV7FxA Z1St91taPziRhbDyIYGRFUfi9Zj59x+MP0FVUduBAwxtAYC+gPScHnUd8PIDcoWRigT/xk kFfyjbA+Dx5tqItv2Kj0EF/Vn+KuXQAP6vhT1Y5ugtyhmNaPz9J+Y6xSZ9f6ZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370124; a=rsa-sha256; cv=none; b=qnX+r4f8vqmgxNMrbGnthtYVHlhcvS1/85a7OFfoXPuRI4+SGvFYiswROdXSlG+5zAeDe+ QExyk736HMUgsC2I5DRueNdSyfzMT0kx656/pAOuEpHBkgA++wNM+x0mrMPAVhQLM81B77 A0G8eJ5y9I/tEJO1baMbJxhnRDQOdtB9Fjd3mGnG/vsovY9MQJkhSNRlAgcY4A2mrcnREb qm3egt94PKtT6u00PJ/gADja3gfO1QtqlO3oJteHCdT1TkeeAUxpBanmN6k5pLkC01tdL2 Eb+teLfj0hX262oAvPcb+dKhqDmvRNbBDqF7R1tDmaPXXMPcwO6RVeUSty6RGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oNQfKoiMFF4AMdZgyhitgca5wT0Ce+2BCGGGTPRNnTY=; b=awJshlaixwfvFqngiSIofCSGqN2kLniXR8AePNmhFIZGMNz5WgOWBsP29ALvtLfdEYc98y 9L8Zhk1WTDgJxJqAk7XG0LXHQjNu3llqxTu9txKU8TsL1JjKyCa1scLlr/INIUfhzl1DzX phvY5b1fntWQLfVq97B3UYq5BiEsEgqNgq23HYxPrMznU1T5DenQWiWiC0RaRb11Jb3p4z PiaP+HMBahy+1VWujY/rSiogMSouTa5v3sX7YTxEBJIN2YvMNIoatXjoQ2T/MgnrX/mdbc tB+8DZZlcXLtOgS85JYyPDk2VvO9b+kFMjl/kwpO6Vc6DQeobrlvSr5d7Iqzsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Yq03wfvzngM; Fri, 07 Mar 2025 17:55: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 527HtOR8083653; Fri, 7 Mar 2025 17:55:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtOB2083650; Fri, 7 Mar 2025 17:55:24 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:24 GMT Message-Id: <202503071755.527HtOB2083650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: b7269d89e5c3 - main - wsp: Fix whitespaces List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7269d89e5c3f63c1ab290938bde92481291f28c Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b7269d89e5c3f63c1ab290938bde92481291f28c commit b7269d89e5c3f63c1ab290938bde92481291f28c Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:35 +0000 wsp: Fix whitespaces Signed-off-by: Joshua Rogers --- sys/dev/usb/input/wsp.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index b9311ffd6c2d..f78d64f69c08 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -73,7 +73,7 @@ } while (0) /* Tunables */ -static SYSCTL_NODE(_hw_usb, OID_AUTO, wsp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, +static SYSCTL_NODE(_hw_usb, OID_AUTO, wsp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "USB wsp"); #ifdef USB_DEBUG @@ -121,7 +121,7 @@ static struct wsp_tuning { .pressure_tap_threshold = 120, .scr_threshold = 20, .max_finger_diameter = 1900, - .max_scroll_finger_distance = MAX_FINGER_ORIENTATION/2, + .max_scroll_finger_distance = 8192, .max_double_tap_distance = 2500, .enable_single_tap_clicks = 1, .enable_single_tap_movement = 1, @@ -141,8 +141,8 @@ wsp_running_rangecheck(struct wsp_tuning *ptun) WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); WSP_CLAMP(ptun->max_finger_diameter, 1, 2400); - WSP_CLAMP(ptun->max_scroll_finger_distance, 1, MAX_FINGER_ORIENTATION); - WSP_CLAMP(ptun->max_double_tap_distance, 1, MAX_FINGER_ORIENTATION); + WSP_CLAMP(ptun->max_scroll_finger_distance, 1, 16384); + WSP_CLAMP(ptun->max_double_tap_distance, 1, 16384); WSP_CLAMP(ptun->scr_threshold, 1, 255); WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1); WSP_CLAMP(ptun->enable_single_tap_movement, 0, 1); @@ -329,7 +329,7 @@ struct tp_finger { int16_t unused[2]; /* zeros */ int16_t pressure; /* pressure on forcetouch touchpad */ int16_t multi; /* one finger: varies, more fingers: - * constant */ + * constant */ } __packed; /* trackpad finger data size, empirically at least ten fingers */ @@ -1033,7 +1033,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) f->pressure = le16toh((uint16_t)f->pressure); f->multi = le16toh((uint16_t)f->multi); } - DPRINTFN(WSP_LLEVEL_INFO, + DPRINTFN(WSP_LLEVEL_INFO, "[%d]ibt=%d, taps=%d, o=%4d, ax=%5d, ay=%5d, " "rx=%5d, ry=%5d, tlmaj=%4d, tlmin=%4d, ot=%4x, " "tchmaj=%4d, tchmin=%4d, presure=%4d, m=%4x\n", @@ -1176,6 +1176,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) else if (sc->dt_sum < 0) wsp_add_to_queue(sc, 0, 0, 0, 1UL << 4); } + sc->dz_count = WSP_DZ_MAX_COUNT; sc->dz_sum = 0; sc->intr_count = 0; @@ -1219,15 +1220,15 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (ntouch == 1 && sc->index[0]->tool_major > tun.max_finger_diameter) dx = dy = 0; - if (sc->ibtn != 0 && ntouch == 1 && - sc->intr_count < WSP_TAP_MAX_COUNT && + if (sc->ibtn != 0 && ntouch == 1 && + sc->intr_count < WSP_TAP_MAX_COUNT && abs(sc->dx_sum) < 1 && abs(sc->dy_sum) < 1 ) dx = dy = 0; if (ntouch == 2 && sc->sc_status.button != 0) { dx = sc->pos_x[sc->finger] - sc->pre_pos_x[sc->finger]; dy = sc->pos_y[sc->finger] - sc->pre_pos_y[sc->finger]; - + /* * Ignore movement of switch finger or * movement from ibt=0 to ibt=1 @@ -1407,6 +1408,7 @@ wsp_add_to_queue(struct wsp_softc *sc, int dx, int dy, int dz, buf[6] = dz - (dz >> 1);/* dz - (dz / 2) */ buf[7] = (((~buttons_in) >> 3) & MOUSE_SYS_EXTBUTTONS); } + usb_fifo_put_data_linear(sc->sc_fifo.fp[USB_FIFO_RX], buf, sc->sc_mode.packetsize, 1); } From nobody Fri Mar 7 17:55:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Yq21xnMz5pv71; Fri, 07 Mar 2025 17:55:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8Yq156Fkz3YCB; Fri, 07 Mar 2025 17:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3TOtHdkevCkiUp7LzLUqmA/a0fEChQOGSlDOa+zbfU=; b=tJbnu4wspuk+uOTVhiEO4tcNP4jVwQb7y3VZe9DJz/k7m4jRIbm5tAx/OaIO9T5HR1QXcY wSJ4h9XtOB6B5ptpeXzqHuVxlGz4RoiEVPPMpDhv6d/AAfQWcdXseCCHi6jmCZbcGEPb+o sh/nzPpBNGabZ7xwOqdA7WfeRveP3gJm04g6YsAZkemwl4+3yfDK7Euys+6EHIpe1LL/iI RM95E5VM59/ofeJnhYPqmJSOKtFqxwb2mgS91CZp/68Cxd4/FT0fPGYWiQjukE+opQATb0 XnWWMnpInN3Mk20QJ501caAyAtB94y2rCWqQj8eH7YSHAM/7wDdlfoMe5/cpqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370125; a=rsa-sha256; cv=none; b=opPQyJAJHFJPZVX2lwUG5VuN7N8/uiZfDJxNKRIuCjZn25mBR/ynr8BhyHaUCV3okNZF8v kcLGB8zfxklIxMJ0jidOk9O0l5vZM3S+w2LyLF20vIdBmIOWpKulVYlIeQXOylTZjgni7O YlIv6of1jtHnfXD9fqWfN+rDzFTkZ4GI0o9g3WtXkn+smROdn/73w0FvrKDtoheadq4xz7 4CbmXPmVtzcXCer1HILSL4BPJs9SAcbinBptsP6wDLR8jQkuS6emwXmrQJBy07vl554U6z r98ZnFqpwxvgzaJpjww6NJtu5SVBF3HjGDnIgbkdAeGKaCTecgOXc5iroZSIMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3TOtHdkevCkiUp7LzLUqmA/a0fEChQOGSlDOa+zbfU=; b=utSTnjAPz2aXH+yFD/WyOXm2gRWxc/cUsEnanSqqQXeTwI2Vx6L51yypLt5Z+jGWW61azM Z/OvnqO61N4KyE9hktfUGn7gXmkFLMkAf52sM9rXoqm6hL1sv+FQTTTyYbyJi1rBy4xmbW Le8s1TAUEWABnNej9DFfx7FEi6/WMxc/c5jj2aNmqgCM0C6+SjjSqUj5RKRS2+0WUHancx JroXbNJdnZyypqPkwma8qZhzqyXkTlQV7OKhMyVvbweSCBvqyD9BlkAFqhgBxEulrG7uYW oDb8mB0iLCJxkWlYUDD03oj2MuIo/Pw93hg/cciotHxXq8ulr0F7G4Bf2pJTKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Yq14jNgznbC; Fri, 07 Mar 2025 17:55: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 527HtPXd083686; Fri, 7 Mar 2025 17:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtPIw083683; Fri, 7 Mar 2025 17:55:25 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:25 GMT Message-Id: <202503071755.527HtPIw083683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 25cefe826504 - main - wsp: Change Nm to Va in manpage. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25cefe826504190feefa762356badcf1ce1c0fd3 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=25cefe826504190feefa762356badcf1ce1c0fd3 commit 25cefe826504190feefa762356badcf1ce1c0fd3 Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:35 +0000 wsp: Change Nm to Va in manpage. Signed-off-by: Joshua Rogers --- share/man/man4/wsp.4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index 9fcec5133830..b08449f9e71f 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -67,9 +67,9 @@ pressure detection, tap support, and gestures. At least the second bit of the .Xr sysctl 8 tunable -.Nm kern.evdev.rcpt_mask +.Va kern.evdev.rcpt_mask must be set. This can be enabled with -.Nm kern.evdev.rcpt_mask=3 . +.Va kern.evdev.rcpt_mask=3 . .Pp Vertical scrolling (z-axis) is enabled by default with a two-finger tap and the movement of a finger up and down. @@ -78,12 +78,12 @@ protocol, therefore must be enabled with evdev data. This can be enabled with the .Xr sysctl 8 tunable -.Nm kern.evdev.sysmouse_t_axis=3. +.Va kern.evdev.sysmouse_t_axis=3. Horizontal scrolling can be used with a two-finger tap and the movement of a finger from side to side. The .Xr sysctl 8 tunable -.Nm hw.usb.wsp.t_factor +.Va hw.usb.wsp.t_factor must be greater than 0 for horizontal scrolling to be enabled, too. .Pp Horizontal swiping with a three-finger tap is registered as mouse buttons From nobody Fri Mar 7 20:16:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8cy66jBrz5q5lk; Fri, 07 Mar 2025 20:16: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 4Z8cy65sg7z47CX; Fri, 07 Mar 2025 20:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741378606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JzwT/m7PxA3gBQpXY7Nf5R9JCJN0NYeOicEceXwriSs=; b=cSGpOiE2cU9OXd4GAxVwo6Kxt1gcGWheKAMyBOrJ+Qzye4RWB2qNFA8+i+//l/H8IOdGhv X4pA7OTcbpOmGvuasfD7E5hCoVjXQKiqyBhLMcdkp0TMs7osZq+dYGqnepjNdE+O1BFo9r HKwKW4XXsinKKoyNR7QtMM/o60Mf/GsamHuByyeOvbJXZjApF0xrCwfYwXk4AguAlpSpFj 3ovnqwSA7ZDmJfBUFzut0fN/QTnCc3FMJ+9sZFHi+iLaecs6Cv98Jrrma4Ui2WmN0+pQj5 QUEUmM0d6ZR2qtus6NpuCCvP89zuLkHclW4WmPm4koYDnMcw2XmTACc3b6BMHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741378606; a=rsa-sha256; cv=none; b=J1k+x24QRLCMeXDlPGFyRoLfwDAg4WRZJ58QS5Z28xFkQ2X7uq6LMBmKAZRDJ40x29gQ6m QtPMtUeef1aP4QkFJrL8cCQV671/MuKe4LtQ7MJkMZbqDm0xYRkbvkBkCbyeTxVeC31GGJ EIHZMWDIRyQM4MlNkLEtskhm4N/mYmMdSnWnbkoj9BAszeykcGkuhVOVQ55zbF7Lx/dmIA pEwdt8uqk3GjTlmrgAFcgBBdozTHADLTV4g5OFYBmmTyd5E8Y6Gsuw2F8qNKYuHshUtGFZ afI6yAs2+6Ua9f/QR+QFI7/ncv+6JCt0tsXIpwc2xt0cz+5wExAMOq6otFivZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741378606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JzwT/m7PxA3gBQpXY7Nf5R9JCJN0NYeOicEceXwriSs=; b=SzUDwrpoN4WLXdt0WmJiJ9tBcYcO0Tb8HTxnfkw1tSvv77RdKX0SRXiBd/V3IiXjxbQbbw mMHaUqYdjykWpVlXIQ+/HSvX6L7x3GvlTCtzFwcW8yfaV6pvF8CMXqZn3kMgp3VM2mskkL fz158YUJ9slfhj0By+Ujccdb09NlbBiitzpZPamRlbvfUC1ter4I5CLfywjaYizR29kZ+e Cly4l4gn0zmCDe90Rl+JtYPZe+3+JKjievp2CPDXx7o4ndfYqnXIYPFea8n4bXYMvd45LE 7fsMek8SFwDWx/RuGjP/bn1y2pvPmWPVBsPLv3AlQ88vnhXaaBVyVjEfp0JuxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8cy65Sm0zrqK; Fri, 07 Mar 2025 20:16: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 527KGk1G047822; Fri, 7 Mar 2025 20: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 527KGkJi047819; Fri, 7 Mar 2025 20:16:46 GMT (envelope-from git) Date: Fri, 7 Mar 2025 20:16:46 GMT Message-Id: <202503072016.527KGkJi047819@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: 780a4667bbde - main - wg.4: Document kernel config option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 780a4667bbde0daa90db900bb0f93f6337d6208b Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=780a4667bbde0daa90db900bb0f93f6337d6208b commit 780a4667bbde0daa90db900bb0f93f6337d6208b Author: Lexi Winter AuthorDate: 2025-02-12 12:18:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-07 20:15:40 +0000 wg.4: Document kernel config option wg(4) can be compiled into the kernel (device wg), but the wg.4 manpage does not document this. Adjust it to mention this like other drivers do. MFC after: 3 days Reviewed by: carlavilla, kevans, ziaee Approved by: carlavilla (mentor) Pull Request: https://github.com/freebsd/freebsd-src/pull/1597 --- share/man/man4/wg.4 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 index 2f758c2a8e11..8e2fcfe6b863 100644 --- a/share/man/man4/wg.4 +++ b/share/man/man4/wg.4 @@ -23,14 +23,21 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 12, 2023 +.Dd February 12, 2025 .Dt WG 4 .Os .Sh NAME .Nm wg .Nd "WireGuard protocol driver" .Sh SYNOPSIS -To load the driver as a module at boot time, place the following line in +To compile this driver into the kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device wg" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_wg_load="YES" From nobody Fri Mar 7 20:19:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8d1T4Q7Xz5q6BJ; Fri, 07 Mar 2025 20:19:41 +0000 (UTC) (envelope-from bz@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 4Z8d1T3VRTz47hj; Fri, 07 Mar 2025 20:19:41 +0000 (UTC) (envelope-from bz@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741378781; 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=XZ1veZjraIY8cuof0G5SSMqLX9fwtKvFB2a7+QpoTAA=; b=ouxUnOJqRRcVdHt5T4sKQr8Gi/wXj82C39GtPVta3syqtE5GxhAhDHFYSFFdWmFugQYuUE aexcNe8e1xlcF01dFKYPT8f3Dc0imYURlWs5aKLj0/P5tkGxWpM+n8FK7e06lwlU12UDQs sUl0EONAqHzorvWELiWHYGVMLONWBgcYOJOCXcivwzAfPIULAHDUw9eedimHPhfoWOv7se 4+QVaUtiYGvfHXt0UwhZhOmdhhbPSceOaHwkmjDj8kxhf3wxHF515gMyb8PDeVRMNHBdHV 86D14lcbhAGbrQpB5XtN44qqPsJqUJEMvX0bn4VJQYqiZjavwV7jzuSJT1/zQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741378781; a=rsa-sha256; cv=none; b=UuyRMEkWLFdhGog43hrc/Pce7ydYsVT1vowEGG7pJbeceT7tbdja0gGsyzJuDeLetTwOhx ofudwTtBHwzxeWDONvDuBjjIL2ANFCBBnfy1XQgQqagzWtCC526bQARn2PlZw7KQBbYeTz yWS35gTRDc0ZCuNtjuduC7EJsh/7KRfg7grD+ZkfOfrOSigctNFAuz+ogIoliRJ7VPUz3M 0G8c3siU3qEXhxuJjLwXKyvCGwVISCQkONbdlZgZbBfVeSgInvdsHKO9XgaMpDaCogi+YH mYLxGO4zv3JjEOgPs6jhrsaae1wirqeIGmIQevTy47kaHqyPyUN9Jbw/jxDwvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741378781; 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=XZ1veZjraIY8cuof0G5SSMqLX9fwtKvFB2a7+QpoTAA=; b=rOBQnVg/AkolYIMQ/NqfOHCnsiMMpOF2r7mgqdBHqRIq4kZn5OFqEU4Dfgr22KekXgdts6 Mct6URNevf8ImHTY0RsAXScqo8jOtV5rjRi1VvZHCNJtQOi1ZroQzG/mZKJ6W+IU6BsuNm ZOi3h+5Bh2kgFRiXHdtKfel/jDtZLkGKHZxUqLDhZEUVIzcvW4hzpc/sny5hFl6vofydld bt1opjerDoF5Qn8TS1F3nSgxaXlZcb0iOCqaQ511Thgyw3bQcg3Wwc6hXBG/laSpLhgtxO Ng7qsS/8t6Ho3TuSD/MBZbEaQHIlpuRrAvQmeGOdQDmEUnRJ5luLpHSYAryMvw== 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)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z8d1T0hVBzLgK; Fri, 07 Mar 2025 20:19:41 +0000 (UTC) (envelope-from bz@freebsd.org) 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 20325A64805; Fri, 07 Mar 2025 20:19:36 +0000 (UTC) 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 AA6802D029E0; Fri, 7 Mar 2025 20:19:38 +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 bSxYNEkTzy8E; Fri, 7 Mar 2025 20:19:37 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:da44:89ff:fedd:d5ab]) (using 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 D6FAF2D029D8; Fri, 7 Mar 2025 20:19:36 +0000 (UTC) Date: Fri, 7 Mar 2025 20:19:36 +0000 (UTC) From: "Bjoern A. Zeeb" To: Alexander Ziaee cc: Warner Losh , John Baldwin , "Herbert J. Skuhra" , src-committers , dev-commits-src-all , dev-commits-src-main , Christos Margiolis Subject: Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency In-Reply-To: Message-ID: <317ns91s-q982-7o54-r0sq-n805p6sqo297@serrofq.bet> References: X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1098556516-1832358758-1741378777=:4001" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1098556516-1832358758-1741378777=:4001 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 6 Mar 2025, Alexander Ziaee wrote: > On 2025-03-04 12:07 -05:00 EST, "Warner Losh" wrote: >> On Tue, Mar 4, 2025 at 8:23 AM John Baldwin wrote: >> >>> On 3/4/25 09:25, Bjoern A. Zeeb wrote: >>>> On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: >>>> >>>>> On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: >>>>>> >>>>>> The branch main has been updated by ziaee: >>>>>> >>>>>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 >>>>>> >>>>>> commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 >>>>>> Author: Alexander Ziaee >>>>>> AuthorDate: 2025-02-19 15:54:27 +0000 >>>>>> Commit: Alexander Ziaee >>>>>> CommitDate: 2025-02-27 22:20:22 +0000 >>>>>> >>>>>> wifi manuals: Mlink + document description consistency >>>>>> >>>>>> Interfaces all have an mlink to if_$foo. Add these for the >>> missing ones >>>>>> and remove an incorrect one from rtwn_pci. Wireless network >>> drivers are >>>>>> all accessible via `apropos -s4 "wireless network driver", except >>> two >>>>>> which are "wireless network device". I actually prefer the >>> latter, but >>>>>> make them all consistent upon the more common parlance. Tag SPDX >>> on one >>>>>> of the files I touched, while here. >>>>>> >>>>>> MFC after: 3 days >>>>>> Reviewed by: bz, carlavilla, mhorne >>>>>> Approved by: carlavilla, mhorne (mentors) >>>>>> Differential Revision: https://reviews.freebsd.org/D49063 >>>>>> --- >>>>>> share/man/man4/Makefile | 4 +++- >>>>>> share/man/man4/uath.4 | 4 +++- >>>>>> share/man/man4/upgt.4 | 2 +- >>>>>> 3 files changed, 7 insertions(+), 3 deletions(-) >>>>>> >>>>>> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile >>>>>> index 13afc9b8d399..8e0af19eec3d 100644 >>>>>> --- a/share/man/man4/Makefile >>>>>> +++ b/share/man/man4/Makefile >>>>>> @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 >>>>>> MLINKS+=ral.4 if_ral.4 >>>>>> MLINKS+=re.4 if_re.4 >>>>>> MLINKS+=rl.4 if_rl.4 >>>>>> -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 >>>>>> +MLINKS+=rtw88.4 if_rtw89.4 >>>>>> +MLINKS+=rtw89.4 if_rtw89.4 >>>>>> +MLINKS+=rtwn.4 if_rtwn.4 >>>>> ^^^^^^^^^ >>>>> $ grep if_rtwn.4 ObsoleteFiles.inc >>>>> OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz >>>> >>>> In fact that is probably correct but things are confusing. >>>> >>>> The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those >>>> should have the man page and links (so contrary to what was done). >>>> rtwn.ko is just the common code if I am not mistaken (Adrian should know >>>> better). >>>> >>>> But everyone is just referring to the driver as rtwn and I fear if there >>>> is no man page to be found as man rtwn / man if_rtwn people will be >>>> confused. >>>> >>>> I wanted to do the same with rtw88 but was told to keep it all together >>>> as one so rtwn is an excemption. >>>> >>>> That all said, yes, it needs a further cleanup. >>> >>> The manpages should just be rtwn/if_rtwn. The bus attachment doesn't >>> matter. >>> We don't have separate manpages when a storage adapter has been supported >>> on both PCI and ISA in the past, you just had the ahc(4) driver (for >>> example). >>> USB vs PCI is the same. It should just be a single manpage for the driver >>> regardless of the attachment. If the driver has separate modules that can >>> be documented in the one manpage, but the list of supported chipsets, etc. >>> is presumably shared hence the shared driver name and common code. In >>> particular, the thing a user sees in dmesg is 'rtwn0', not 'rtwn_pci0' so >>> the manpage needs to be tied to what a user sees as a device name in dmesg. >>> >> >> Yea, the man page should mention the detail that we have separate .ko's, but >> otherwise I agree with John here. > > IIUC, all interfaces should be documented as $foo with an mlink (but no additional > name macro) to if_$foo. I've also been pushing for sound to become represented > the same way for consistency, which christos said (paraphrased) no objection. So someone should comment out/remove the old entry in ObsoleteFiles.inc so that the new man page is not deleted again? -- Bjoern A. Zeeb r15:7 --1098556516-1832358758-1741378777=:4001-- From nobody Sat Mar 8 08:13:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsT3cszz5qcnL; Sat, 08 Mar 2025 08:13: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 4Z8wsT32SPz3klC; Sat, 08 Mar 2025 08:13:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=36N68G69tM8qrwBC2flmZXY2CnI7faulXbpmntrAnsg=; b=lxdlcuso3eBqxupKSFuEXaB2d7DZfY9DLrFkSXeeOyIJ7QVXPmZMTkEy/cCFs/YM9dGfiI lOndgeKdEu2gofkAkHagLYk+QSik9FJDuM/t8A+mLxZqe30zjigW/kJEw+oZHwliON3RoS OYPiBZfRT6YqtjwRF0wxvrIhtULFnK47HzxmEaN85/L2q0lQLixvEzUghyxojySRY5MR+d eDq/TxR0kZz2umn/4X10T/PjOOpFCqdZgahfrZ03+QzXf+YS589FKxljmGi+PMafkXyCU3 lWouFfvZUWivq52oHYKMMOiElY4CrTGp+ZTiqIBj6CClmrMQspV+gpcrnjXSTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421629; a=rsa-sha256; cv=none; b=fqIyRU3G2mNrh6gRLVmerphHHbku9PMYmsY7wFwD4GqzrPONKW2p7ylaKChPiUjY1DiKDx wUIvZ1Bw3KKccm97S3uNMKQooFrbTtTUdotqDJNFdzzc0Gj2dktTNF4wprSXp+uLPIif6s F2isHPnj0GGB1m8OMYNIL3Ra9x7WMY6QPG0fgZm6YL10rBNOHpoY9tExDciOkDQVktb9N1 D6Jd7Txm7EJ+0hWE68oHQPrEfN3tBzLtRXpFqI24GjcZyvInwbOTTU2jLFtwWrT8IzWWfT /yUYu3L+llyNbLSP4TNFlxbm289zOS9Z+7lUdSiNYDPg9fmen42jo3lZSbwzog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=36N68G69tM8qrwBC2flmZXY2CnI7faulXbpmntrAnsg=; b=DKH+VrfE65i2jqVEWTIh+ngMf+7Xz5HQwib7jpfR4Z7yeHLFFMpyzRugIhhB4XxU5NFwne ErlZofBHPDHMab7si34Usc85l0c/o+U6kIfmwmzfX2MjuafDnE5xriXMgbQFs1pfS/Zr8s j1PKSulMHp2AYXaZfDJFX1f0VF6kznD+ejSiO7oDR/BwWCdcDJ8vMNmBjMdorjdGHseoTC JP8NOUPVCyqQ8eSxNYfxWjbCYfcbsNWTHkvnEBC21tCgxuou3k2YmFXmxmgrBrKeRj0+xl vBj0zimVBaS3mChjGsjphhYGb4iaWz9XCdgXVdl2DHh87JK8+CLFJzH9SaLa/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsT2bQ5zd9; Sat, 08 Mar 2025 08:13: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 5288Dnce097390; Sat, 8 Mar 2025 08:13:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288DnPJ097387; Sat, 8 Mar 2025 08:13:49 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:49 GMT Message-Id: <202503080813.5288DnPJ097387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9d4823824d40 - stable/14 - gve: Disallow MTUs within a problematic range List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d4823824d4073313f758dd67ba9212bfcb39306 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9d4823824d4073313f758dd67ba9212bfcb39306 commit 9d4823824d4073313f758dd67ba9212bfcb39306 Author: Jasper Tran O'Leary AuthorDate: 2025-02-14 14:57:06 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 gve: Disallow MTUs within a problematic range If hardware LRO is enabled with GVE, then setting the driver's MTU to a range of values around 8000 will cause dropped packets and drastically degraded performance. While this issue is being investigated, we need to prohibit the driver's MTU being set to a value within this range. Signed-off-by: Jasper Tran O'Leary Reviewed by: delphij, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48971 (cherry picked from commit 909e2d7b691f7418a78b1289a51d3b6c46860a9b) --- sys/dev/gve/gve_main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index 0e40656ca928..c726177c199c 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -196,6 +196,8 @@ static int gve_set_mtu(if_t ifp, uint32_t new_mtu) { struct gve_priv *priv = if_getsoftc(ifp); + const uint32_t max_problem_range = 8227; + const uint32_t min_problem_range = 7822; int err; if ((new_mtu > priv->max_mtu) || (new_mtu < ETHERMIN)) { @@ -204,6 +206,19 @@ gve_set_mtu(if_t ifp, uint32_t new_mtu) return (EINVAL); } + /* + * When hardware LRO is enabled in DQ mode, MTUs within the range + * [7822, 8227] trigger hardware issues which cause a drastic drop + * in throughput. + */ + if (!gve_is_gqi(priv) && !gve_disable_hw_lro && + new_mtu >= min_problem_range && new_mtu <= max_problem_range) { + device_printf(priv->dev, + "Cannot set to MTU to %d within the range [%d, %d] while hardware LRO is enabled\n", + new_mtu, min_problem_range, max_problem_range); + return (EINVAL); + } + err = gve_adminq_set_mtu(priv, new_mtu); if (err == 0) { if (bootverbose) From nobody Sat Mar 8 08:13:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsW00Jcz5qd1h; Sat, 08 Mar 2025 08:13: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 4Z8wsV41zRz3kXX; Sat, 08 Mar 2025 08:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fxPOBOxnD3NR+F45MElZyyL+5tPFKPDdUgUk9jDQxio=; b=Bo2XIan9Yo8MAajKjxOUDbjy1lW5JmpknLUc/PJWBWba6v7WWCxc8kobbclnqLkvWX1q9V 6pMyJCMtL1cj8XebnBwXTaOjCTRloGj/6NY/jC4T0/88Hy6SjoIYnBD4Ta2k86cqg/5Odg irSXhv3knx2a25lqy5zrVn5SOQXYCNrZGABrm49S5dzmZG9E69bXOfTvA6qRU/9IrsUESe awipYhseYkDEYNNxX37/GaERTDoePWbGghu0SVvGt5oTq8fF9YVWqoaksXMEegQwMEXTZT EhjJDzjtu3TfYLpcAddS2uopslTq5BgLFsxD7ufV6e4z9XtpRn84nJ76+y0zAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421630; a=rsa-sha256; cv=none; b=Mnl0sobmfuoKSrJV8Q5ZKBidh4TWCJ7VoMq6dOb589L5YEk22cU0KcFWywSF9GdwduXhhR 8hBC0iQspRPMtb3m4B8zI2ZR8/QkJwXZija1xESAkuVfsQ8SWCqe/soFQZNwtH1GgNGaYc s0opM/A5owwCltm6jQbP5TXCK/NLN6PgIBYdXD/2zNUjemwmRM4JiCrSjrvpyqX4Pi/Duq nMSJuo06EstQvQqmMaLpfxRE5f3727Kut51zUb6QRPEJgV/UOuLHwZU3wc0XZmKvnzJx29 fv2isKRu+RO6QkoFhBLRF5cpgkThRvj1EZ1OOKZaLpgyMupRYh69YdexFlJtLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fxPOBOxnD3NR+F45MElZyyL+5tPFKPDdUgUk9jDQxio=; b=NhUsyBWwc8Gzvzbc41bkfCT1rwMCwaJh5Hjw2GG7UwnflT1cJG0XmEk2p0+Ctr4euCkyeW UdVJ1B2uW19CIy9lbpYkWTxgkaVhnro2ilGyQ+4Bxh3wDLiTCqiuv8TipxcC7A3YXCB99b lSEqTneKtEMYlti2k5wl6XOWoK//YT2sW9fltf6TtuLG5yvChhMvMqFGbS6ZtCFVy92MO7 WKCyjbQVIc5FSS6ggx+x7gXToy7ZSGDJJ73ZvU5zeqA9PaWDlgub1OpNEgFwMc+C39KZ2x E7RbytRLPiHRdmCHVFXhe+pt/Zk770saiZKJt/o2T3JiwGv1gDY6EpdyJJ+mGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsV3ZGXzjC; Sat, 08 Mar 2025 08:13: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 5288Doxb097428; Sat, 8 Mar 2025 08:13:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288Dojq097424; Sat, 8 Mar 2025 08:13:50 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:50 GMT Message-Id: <202503080813.5288Dojq097424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 65f5027e38eb - stable/14 - gve: Fix memory leak during reset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 65f5027e38eb706558df634acaf54a94c0ff697f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=65f5027e38eb706558df634acaf54a94c0ff697f commit 65f5027e38eb706558df634acaf54a94c0ff697f Author: Jasper Tran O'Leary AuthorDate: 2025-02-14 15:02:41 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 gve: Fix memory leak during reset Before this change, during reset we were allocating new memory for priv->ptype_lut_dqo, irq_db_array and the counter_array over the old memory. This change ensures we do not allocate new memory during reset and avoid memory leaks. Signed-off-by: Vee Agarwal Signed-off-by: Jasper Tran O'Leary Reviewed by: delphij, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48970 (cherry picked from commit 62b2d0c3f4add3bb87081a96412056e17eed31ea) --- sys/dev/gve/gve_main.c | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index c726177c199c..aa0866c5984b 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -517,7 +517,7 @@ abort: } static void -gve_deconfigure_resources(struct gve_priv *priv) +gve_deconfigure_and_free_device_resources(struct gve_priv *priv) { int err; @@ -543,7 +543,7 @@ gve_deconfigure_resources(struct gve_priv *priv) } static int -gve_configure_resources(struct gve_priv *priv) +gve_alloc_and_configure_device_resources(struct gve_priv *priv) { int err; @@ -584,7 +584,7 @@ gve_configure_resources(struct gve_priv *priv) return (0); abort: - gve_deconfigure_resources(priv); + gve_deconfigure_and_free_device_resources(priv); return (err); } @@ -649,7 +649,7 @@ static void gve_destroy(struct gve_priv *priv) { gve_down(priv); - gve_deconfigure_resources(priv); + gve_deconfigure_and_free_device_resources(priv); gve_release_adminq(priv); } @@ -662,9 +662,21 @@ gve_restore(struct gve_priv *priv) if (err != 0) goto abort; - err = gve_configure_resources(priv); - if (err != 0) + err = gve_adminq_configure_device_resources(priv); + if (err != 0) { + device_printf(priv->dev, "Failed to configure device resources: err=%d\n", + err); + err = (ENXIO); goto abort; + } + if (!gve_is_gqi(priv)) { + err = gve_adminq_get_ptype_map_dqo(priv, priv->ptype_lut_dqo); + if (err != 0) { + device_printf(priv->dev, "Failed to configure ptype lut: err=%d\n", + err); + goto abort; + } + } err = gve_up(priv); if (err != 0) @@ -677,6 +689,25 @@ abort: return; } +static void +gve_clear_device_resources(struct gve_priv *priv) +{ + int i; + + for (i = 0; i < priv->num_event_counters; i++) + priv->counters[i] = 0; + bus_dmamap_sync(priv->counter_array_mem.tag, priv->counter_array_mem.map, + BUS_DMASYNC_PREWRITE); + + for (i = 0; i < priv->num_queues; i++) + priv->irq_db_indices[i] = (struct gve_irq_db){}; + bus_dmamap_sync(priv->irqs_db_mem.tag, priv->irqs_db_mem.map, + BUS_DMASYNC_PREWRITE); + + if (priv->ptype_lut_dqo) + *priv->ptype_lut_dqo = (struct gve_ptype_lut){0}; +} + static void gve_handle_reset(struct gve_priv *priv) { @@ -708,6 +739,8 @@ gve_handle_reset(struct gve_priv *priv) gve_clear_state_flag(priv, GVE_STATE_FLAG_TX_RINGS_OK); gve_down(priv); + gve_clear_device_resources(priv); + gve_restore(priv); GVE_IFACE_LOCK_UNLOCK(priv->gve_iface_lock); @@ -835,7 +868,7 @@ gve_attach(device_t dev) if (err != 0) goto abort; - err = gve_configure_resources(priv); + err = gve_alloc_and_configure_device_resources(priv); if (err != 0) goto abort; @@ -864,7 +897,7 @@ gve_attach(device_t dev) abort: gve_free_rings(priv); - gve_deconfigure_resources(priv); + gve_deconfigure_and_free_device_resources(priv); gve_release_adminq(priv); gve_free_sys_res_mem(priv); GVE_IFACE_LOCK_DESTROY(priv->gve_iface_lock); From nobody Sat Mar 8 08:13:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsY2yx2z5qd6H; Sat, 08 Mar 2025 08:13: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 4Z8wsW4XKLz3kmh; Sat, 08 Mar 2025 08:13:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kSH7MMWWKNd7ZnZAy3DQQWkwggAuzYJ0AtdSP11M6jQ=; b=RS9d8KlfNdt7VAy6ES6S4cZCInCxg586BjDZbveXkNr+w8W2vvQSjurWt1QHrSX6dsdBkY YpjpixtxJlGmW+zseXp5o6Linrsc2Ux37fKjJqQJECGKCEp9A4NFZmlthCA838HPFGH8r+ 0+pvaV1RFGbN2ycH3UDSyJAvhlp2KFvKE5JMDrv76T9/OM6O9uMiJJbCKsMFugineU71JD x7HDTkvfnb59GO42yYc7PlzhrnlBJV1RntKPMjH+JhmpZcuJqNRC3S8hAi9SjqUW/bbEFp nobwkxWD1NzLi1/oX8OQdNdv5QqFsM0yoy9SW9F9b2ZXiV6T4GgC+gtNs0nMmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421631; a=rsa-sha256; cv=none; b=c2iOr22qgWCixB30yFpFN87nu2GuHANKvfhC/lsFCeK0n/pHMPcOqqX+k2rg9qtyXfhluK /sIk7WFr0YdlWRSgFa48aixb56LObf/GCHKJyOA58a9hYiop8v54Yl0MU9RHLdLFCVKfvR HfjSz3FTSKP9mpT7d85FzbRXEwuUvXhz4PlnaH1HRvYePFlGsqI//IuN4+pfeOXoSH/jcP yK0DTnfAU2jB8YpWhUyWgwwnYf2uO159DKcmik/9Zqs5KeQFfWOIVWAji5IveEC6FJYYas uzwqV8N1QiyA3iEdCE8lw1lfYIJ+HbrX65UdHBISoVxOmmXt92GKREhO+nHueA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kSH7MMWWKNd7ZnZAy3DQQWkwggAuzYJ0AtdSP11M6jQ=; b=TnV9S+rLukbMK3H7e1UB6GmZKgSXyLeZ8nqLL4H6hC+BrZ/suida706QVzl/P1/37nu0zW VaXepnrg5+dsAchz+iG35bjsopUPIbJ9hHSLgdUC5/ocxRRdNdV1DbwJs8BxOv7p802+pY u2SyCtI9xDUsJ22eU0Zm8CvuR2GNBEs933RslTsU8txtvFOF1tOtdW30Y5Rbj/DJ3BTUib pd24gXWukZMf+mXk4v7GmIYCYN6TRCmab63GLF+4nL6ZsdoGI4/rf0kBrGFYNuvTlib8tH KSmaNUMtcf3B46hkr82F1sm5N8CjoVOGFwXDJ2+Ui1f4Iqbw8WSFtxTKG6WMzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsW44fFzRn; Sat, 08 Mar 2025 08:13: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 5288Dp19097463; Sat, 8 Mar 2025 08:13:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288DpRR097460; Sat, 8 Mar 2025 08:13:51 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:51 GMT Message-Id: <202503080813.5288DpRR097460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 28ba212a95f2 - stable/14 - gve: Do minor cleanup and bump version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 28ba212a95f271746a8a22b891dd76ae6e3459e1 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=28ba212a95f271746a8a22b891dd76ae6e3459e1 commit 28ba212a95f271746a8a22b891dd76ae6e3459e1 Author: Jasper Tran O'Leary AuthorDate: 2025-02-14 15:04:16 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 gve: Do minor cleanup and bump version This commit fixes several minor issues: - Removes an unnecessary function pointer parameter on gve_start_tx_ring - Adds a presubmit check against style(9) - Replaces mb() and rmb() macros with native atomic_thread_fence_seq_cst() and atomic_thread_fence_acq() respectively - Fixes various typos throughout - Increments the version number to 1.3.2 Co-authored-by: Vee Agarwal Signed-off-by: Vee Agarwal Signed-off-by: Jasper Tran O'Leary Reviewed by: delphij, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48969 (cherry picked from commit 031800c786823a9ad4c4d2f79f217d42dad3f5d1) --- sys/dev/gve/gve.h | 6 +++--- sys/dev/gve/gve_desc.h | 4 ++-- sys/dev/gve/gve_main.c | 6 +++--- sys/dev/gve/gve_rx.c | 2 +- sys/dev/gve/gve_rx_dqo.c | 2 +- sys/dev/gve/gve_sysctl.c | 4 ++-- sys/dev/gve/gve_tx.c | 16 +++++++--------- sys/dev/gve/gve_tx_dqo.c | 2 +- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index 92ab6838d5bb..39965c8669cf 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -303,7 +303,7 @@ struct gve_rx_ring { SLIST_HEAD(, gve_rx_buf_dqo) free_bufs; /* - * Only used in QPL mode. Pages refered to by if_input-ed mbufs + * Only used in QPL mode. Pages referred to by if_input-ed mbufs * stay parked here till their wire count comes back to 1. * Pages are moved here after there aren't any pending completions. */ @@ -450,7 +450,7 @@ struct gve_tx_ring { /* * The completion taskqueue moves pending-packet objects to this * list after freeing the mbuf. The "_prd" denotes that this is - * a producer list. The trasnmit taskqueue steals this list once + * a producer list. The transmit taskqueue steals this list once * its consumer list, with the "_csm" suffix, is depleted. */ int32_t free_pending_pkts_prd; @@ -458,7 +458,7 @@ struct gve_tx_ring { /* * The completion taskqueue moves the QPL pages corresponding to a * completed packet into this list. It is only used in QPL mode. - * The "_prd" denotes that this is a producer list. The trasnmit + * The "_prd" denotes that this is a producer list. The transmit * taskqueue steals this list once its consumer list, with the "_csm" * suffix, is depleted. * diff --git a/sys/dev/gve/gve_desc.h b/sys/dev/gve/gve_desc.h index 5f09cc8b77b8..48c4ac27596b 100644 --- a/sys/dev/gve/gve_desc.h +++ b/sys/dev/gve/gve_desc.h @@ -130,10 +130,10 @@ union gve_rx_data_slot { __be64 addr; }; -/* GVE Recive Packet Descriptor Seq No */ +/* GVE Receive Packet Descriptor Seq No */ #define GVE_SEQNO(x) (be16toh(x) & 0x7) -/* GVE Recive Packet Descriptor Flags */ +/* GVE Receive Packet Descriptor Flags */ #define GVE_RXFLG(x) htobe16(1 << (3 + (x))) #define GVE_RXF_FRAG GVE_RXFLG(3) /* IP Fragment */ #define GVE_RXF_IPV4 GVE_RXFLG(4) /* IPv4 */ diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index aa0866c5984b..8e764f9660d7 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -32,10 +32,10 @@ #include "gve_adminq.h" #include "gve_dqo.h" -#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.1\n" +#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.2\n" #define GVE_VERSION_MAJOR 1 #define GVE_VERSION_MINOR 3 -#define GVE_VERSION_SUB 1 +#define GVE_VERSION_SUB 2 #define GVE_DEFAULT_RX_COPYBREAK 256 @@ -391,7 +391,7 @@ gve_setup_ifnet(device_t dev, struct gve_priv *priv) /* * Set TSO limits, must match the arguments to bus_dma_tag_create * when creating tx->dqo.buf_dmatag. Only applies to the RDA mode - * because in QPL we copy the entire pakcet into the bounce buffer + * because in QPL we copy the entire packet into the bounce buffer * and thus it does not matter how fragmented the mbuf is. */ if (!gve_is_gqi(priv) && !gve_is_qpl(priv)) { diff --git a/sys/dev/gve/gve_rx.c b/sys/dev/gve/gve_rx.c index 35f22f2308f0..e540ad6f4c11 100644 --- a/sys/dev/gve/gve_rx.c +++ b/sys/dev/gve/gve_rx.c @@ -706,7 +706,7 @@ gve_rx_cleanup_tq(void *arg, int pending) * interrupt but they will still be handled by the enqueue below. * Fragments received after the barrier WILL trigger an interrupt. */ - mb(); + atomic_thread_fence_seq_cst(); if (gve_rx_work_pending(rx)) { gve_db_bar_write_4(priv, rx->com.irq_db_offset, GVE_IRQ_MASK); diff --git a/sys/dev/gve/gve_rx_dqo.c b/sys/dev/gve/gve_rx_dqo.c index 6c5d656aaa04..6ce9ddd887d0 100644 --- a/sys/dev/gve/gve_rx_dqo.c +++ b/sys/dev/gve/gve_rx_dqo.c @@ -972,7 +972,7 @@ gve_rx_cleanup_dqo(struct gve_priv *priv, struct gve_rx_ring *rx, int budget) * Prevent generation bit from being read after the rest of the * descriptor. */ - rmb(); + atomic_thread_fence_acq(); rx->cnt++; rx->dqo.tail = (rx->dqo.tail + 1) & rx->dqo.mask; diff --git a/sys/dev/gve/gve_sysctl.c b/sys/dev/gve/gve_sysctl.c index 7a091d9caa43..c96d082837a4 100644 --- a/sys/dev/gve/gve_sysctl.c +++ b/sys/dev/gve/gve_sysctl.c @@ -94,7 +94,7 @@ gve_setup_rxq_sysctl(struct sysctl_ctx_list *ctx, SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, "rx_mbuf_dmamap_err", CTLFLAG_RD, &stats->rx_mbuf_dmamap_err, - "Number of rx mbufs which couldnt be dma mapped"); + "Number of rx mbufs which could not be dma mapped"); SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, "rx_mbuf_mclget_null", CTLFLAG_RD, &stats->rx_mbuf_mclget_null, @@ -170,7 +170,7 @@ gve_setup_txq_sysctl(struct sysctl_ctx_list *ctx, SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "tx_mbuf_collpase", CTLFLAG_RD, &stats->tx_mbuf_collapse, - "tx mbufs that had to be collpased"); + "tx mbufs that had to be collapsed"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "tx_mbuf_defrag", CTLFLAG_RD, &stats->tx_mbuf_defrag, diff --git a/sys/dev/gve/gve_tx.c b/sys/dev/gve/gve_tx.c index e7e10e526cb9..04dde4f1a79b 100644 --- a/sys/dev/gve/gve_tx.c +++ b/sys/dev/gve/gve_tx.c @@ -240,15 +240,16 @@ gve_clear_tx_ring(struct gve_priv *priv, int i) } static void -gve_start_tx_ring(struct gve_priv *priv, int i, - void (cleanup) (void *arg, int pending)) +gve_start_tx_ring(struct gve_priv *priv, int i) { struct gve_tx_ring *tx = &priv->tx[i]; struct gve_ring_com *com = &tx->com; atomic_store_bool(&tx->stopped, false); - - NET_TASK_INIT(&com->cleanup_task, 0, cleanup, tx); + if (gve_is_gqi(priv)) + NET_TASK_INIT(&com->cleanup_task, 0, gve_tx_cleanup_tq, tx); + else + NET_TASK_INIT(&com->cleanup_task, 0, gve_tx_cleanup_tq_dqo, tx); com->cleanup_tq = taskqueue_create_fast("gve tx", M_WAITOK, taskqueue_thread_enqueue, &com->cleanup_tq); taskqueue_start_threads(&com->cleanup_tq, 1, PI_NET, "%s txq %d", @@ -297,10 +298,7 @@ gve_create_tx_rings(struct gve_priv *priv) com->db_offset = 4 * be32toh(com->q_resources->db_index); com->counter_idx = be32toh(com->q_resources->counter_index); - if (gve_is_gqi(priv)) - gve_start_tx_ring(priv, i, gve_tx_cleanup_tq); - else - gve_start_tx_ring(priv, i, gve_tx_cleanup_tq_dqo); + gve_start_tx_ring(priv, i); } gve_set_state_flag(priv, GVE_STATE_FLAG_TX_RINGS_OK); @@ -421,7 +419,7 @@ gve_tx_cleanup_tq(void *arg, int pending) * interrupt but they will still be handled by the enqueue below. * Completions born after the barrier WILL trigger an interrupt. */ - mb(); + atomic_thread_fence_seq_cst(); nic_done = gve_tx_load_event_counter(priv, tx); todo = nic_done - tx->done; diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c index fab2d6d0f613..b4bcb1fd01c5 100644 --- a/sys/dev/gve/gve_tx_dqo.c +++ b/sys/dev/gve/gve_tx_dqo.c @@ -1031,7 +1031,7 @@ gve_tx_cleanup_dqo(struct gve_priv *priv, struct gve_tx_ring *tx, int budget) * Prevent generation bit from being read after the rest of the * descriptor. */ - rmb(); + atomic_thread_fence_acq(); type = compl_desc->type; if (type == GVE_COMPL_TYPE_DQO_DESC) { From nobody Sat Mar 8 08:13:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsb1rnYz5qcfH; Sat, 08 Mar 2025 08:13: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 4Z8wsb0D3Hz3kyP; Sat, 08 Mar 2025 08:13:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6oLuYczwagcrsFCU7XrQVAXRlXAgAwjlt5YRLxkHUlw=; b=n6VC9zKrHYBq8mDlbiTboSuKZeBVD6jyFCtAE6UF2UtJ4QSO9JSXNZ0kC+IsZ1sS+d5tu/ VsWnm5d0KGjB3wKHfHcKnI8gZZDJjJ7AqzAfq6o4GoCN43i/y5vZa7LtlP16dyMV4JkHkz Fm0QSGDrMb0SYxg+yqTkHDlYgw+QXQds5jgTK7ZIYzeEuDE6IXqowjTZZWQnAfSLTgOMvB Lqhktc/Yn58/Beock7wMdZVW6//XEIrgrmTRMEIHAzx/QEP196/P3gTnS5FiQ6RFOqeyzQ HJO1gd5WHleZ3y+NHInZaqQPI4A81Dl+EoqYp1vkhYraNGEHHBNyLCMs+SpBCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421635; a=rsa-sha256; cv=none; b=EAMOB3Va52Q1KprsnjBW+3/xY9aDKzoK7KNh/3Y49Qa+LgHodgnP5g3Y7jUXuYo2+tELFE RLzXNve4cjlSOT/Re7eH13cUS0gIzjnyl4zBb8JRJvJo8g3bogKcEc5P7ci1zYJhjvVk14 1TFasRA8T2oJFB5GN9Ko1X/Ps4ARqe5rQxC7xaF3lmdeZH4bz7zOHyVao+o4zq0gWDtKwg 1QYQ5FIt81Wndj4VDJ+C/QiyBP3ogfp+vgb8P8Zoemn0X7/TifMFa90PaftK73aX8Gp150 g8ZHJhl50XLVfvWa0YZmpJu53HX3KURWH9EozLbYO7Nt3MUgQ8I3+9kVLswK5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6oLuYczwagcrsFCU7XrQVAXRlXAgAwjlt5YRLxkHUlw=; b=e59EeZlV0ZYlSNuNqNxIpIuW7nLlDyHn5FG9BTvl4q/+FqIM21TFo2tvCOger84qSG+K/+ w1hcyp9WVjbU9g55OMt8eByxeW74zBWwJVS4nyBdHOpQZDtmb7MlwLC6uDCbpYOapMvomz BVz2DqYiJQ3puX4BiCgFEcNmz6ku0TPwg04Ev2MR6MeVVqhUOYBLY6LGLrxulVZ5X5vgLe UQZnQj3Pyf4YyOyxf83Hgd9yKtMTjSF5wH5oxufUwcyaF7WUzgATfwcuR5uKygRq9KW73T oIn8C27oKRmVaO436+e44OYktD/0EttV1LE3Wxj5NZ9fQvrA6g0vaMCL7Ok2vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsZ6Vtvzjp; Sat, 08 Mar 2025 08:13: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 5288DskS097574; Sat, 8 Mar 2025 08:13:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288Dsk4097571; Sat, 8 Mar 2025 08:13:54 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:54 GMT Message-Id: <202503080813.5288Dsk4097571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0599d2a1c599 - stable/14 - limits tests: Try to fix spurious cputime test failures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0599d2a1c5996cef4d79a3fbe753d863cdd2359b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0599d2a1c5996cef4d79a3fbe753d863cdd2359b commit 0599d2a1c5996cef4d79a3fbe753d863cdd2359b Author: Mark Johnston AuthorDate: 2025-02-14 16:26:19 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 limits tests: Try to fix spurious cputime test failures I very occasionally see test failures caused by the total CPU time being several milliseconds under 3s. The test runs "limits -t 3 time " and verifies that the reported time elapsed is at least 3s (and not too much more). In particular, any time spent executing time(1) itself is counted against the limit but not recorded in the output. I think it makes more sense to reverse the order, so that the CPU time limit is not applied to time(1) itself. This also resolves the test failures I was seeing, which were reproducible only under load (i.e., running many tests in parallel). MFC after: 2 weeks Sponsored by: Klara, Inc. (cherry picked from commit 0f63c4af5e4761680550b0aa08cc96f52076c08c) --- usr.bin/limits/tests/limits_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/limits/tests/limits_test.sh b/usr.bin/limits/tests/limits_test.sh index 701886066ff1..fd7b50b0945a 100755 --- a/usr.bin/limits/tests/limits_test.sh +++ b/usr.bin/limits/tests/limits_test.sh @@ -57,7 +57,7 @@ cputime_hard_flag_body() atf_check -o match:'cputime[[:space:]]+3 secs' \ limits -H -t 3 limits -S atf_check -e save:time_output -s signal:sigkill \ - limits -H -t 3 $TIME -p sh -c 'while : ; do : ; done' + $TIME -p limits -H -t 3 sh -c 'while : ; do : ; done' validate_time_output time_output } cputime_hard_flag_cleanup() @@ -76,7 +76,7 @@ cputime_soft_flag_body() atf_check -o match:'cputime-cur[[:space:]]+3 secs' \ limits -S -t 3 limits -S atf_check -e save:time_output -s signal:$SIGXCPU \ - limits -S -t 3 $TIME -p sh -c 'while : ; do : ; done' + $TIME -p limits -S -t 3 sh -c 'while : ; do : ; done' validate_time_output time_output } cputime_soft_flag_cleanup() From nobody Sat Mar 8 08:13:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsY74Dlz5qcnN; Sat, 08 Mar 2025 08:13: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 4Z8wsX6TqBz3l1j; Sat, 08 Mar 2025 08:13:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YNni6ILoAf7XwbDEkMLPXE1dS+baBxTn7RfDkn+6BSI=; b=HwiaLcSEkdub/v+t8+MV/8zqEmkI+D80HKUH5UBugZ+piKw5oCP5LRRC/g1QKVoDhr+CjJ JxdXAtDnHY4UaJFcSku0MRrsucRvmJOg4KjzSn1U2eoBndupS4oJRy6vZ0sezDSGH3KO0C Fbu5kNv37CmUAah3MBOSxdAW+VuPWQtSQHuYRLbraCNIuEfEb5IhSDlAIyTmQPGY7/BSR5 y2/w+IvInJ6b9N1nOTloR/UNCkSW3ff3G6B403doSXqFk4bX/HYccgyxOGfmGhCi3Yt4i1 ZYNiVJ6GM4cOLkuDFj4zMdpWvPiEToduwUXdXKVLHliU2l8jT0URDKEr25MB7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421632; a=rsa-sha256; cv=none; b=colR6FQ7gWXJU+nm+VExz8eG5vuAw2er9/0wNcOJ2rHSx9vbgjgKKOQB6Sv2SULbdqQHKB erZ62gQMF7a956oin4MywZ7Gd7Z3uqA+/HrwUFQhyGUEe5Rc7jCdiFTHVGQe6G2D+5BIpL ZDlWUw/+hAiuu4aPKEgVFFmVqpygQgTjn3Z0ndXx6Kcm9z1YQSvT1taZmZ66qZiPh8UH/d nK72EEmF3pB0rl+rB62MYg2ZTc4Xrc7JrwLa7aXW5PRns2DL/yRxoMmTjjDQ7l4GXubPls ljFz/O6sl5bfENYVa+ih9ylPkjLtck6ofqZtaBqF6dyCS4qBR/09M6zAo4rpQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YNni6ILoAf7XwbDEkMLPXE1dS+baBxTn7RfDkn+6BSI=; b=kTAS6M6Vap5ZOwKkWHNsCj3hEmt2kpbpVYXa61lL68u9f9wqA5JIrmt1RAgF3GE2IYo+sn R9riioUShWdnfaQt2oAxpd4a1o9ZTaAHjCZ2mW2EdHF4UPueZUnsng6jfEuGtIKZbkPoXd 4bBgs1NVUlGO8hhPbw/2/ScoBBqRT2Ach+GhTe+HAwkE6EdCtlqh4zMSHNpvag5188MG3/ u2bvj7fLvdm2h7EiPsHLisGHTI//d2XGhpwFNvqWAzA0amma9pTGeGIKKPCnT9VTAyet5r v2IlS0JAl7ENxVunGONX6HAfb68wHjLeI6w4mM85zTgIjJbZ2qefosohxqWfXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsX4lXFzsv; Sat, 08 Mar 2025 08:13: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 5288Dqc6097498; Sat, 8 Mar 2025 08:13:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288DqpI097495; Sat, 8 Mar 2025 08:13:52 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:52 GMT Message-Id: <202503080813.5288DqpI097495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 875ec35c0661 - stable/14 - gve: Fix qpl_buf_head being initialized improperly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 875ec35c0661ac2dfd07c64b4ccf5860b1c08fc8 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=875ec35c0661ac2dfd07c64b4ccf5860b1c08fc8 commit 875ec35c0661ac2dfd07c64b4ccf5860b1c08fc8 Author: Jasper Tran O'Leary AuthorDate: 2025-02-14 15:05:46 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 gve: Fix qpl_buf_head being initialized improperly Currently, for DQO QPL our MPASS assertion on qpl_buf_head for available pending_pkts (i.e. not holding a packet) fails due to incorrect initialization. The MPASS fails on the first run of packets through the ring when INVARIANTS is on, and when INVARIANTS is off, things work without a bug. The MPASS guards against improper reaping of "pending_pkt" objects, and thus was failing for the first run through the ring. By correctly initializing the objects in this patch we make the MPASS not fail on the first run too. Signed-off-by: Vee Agarwal Signed-off-by: Jasper Tran O'Leary Reviewed by: delphij, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48968 (cherry picked from commit 73c3fe4db3ebc2bd6cb732aae77ea017fd376d22) --- sys/dev/gve/gve_tx_dqo.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c index b4bcb1fd01c5..bf314ef95173 100644 --- a/sys/dev/gve/gve_tx_dqo.c +++ b/sys/dev/gve/gve_tx_dqo.c @@ -43,6 +43,13 @@ gve_unmap_packet(struct gve_tx_ring *tx, bus_dmamap_unload(tx->dqo.buf_dmatag, pending_pkt->dmamap); } +static void +gve_clear_qpl_pending_pkt(struct gve_tx_pending_pkt_dqo *pending_pkt) +{ + pending_pkt->qpl_buf_head = -1; + pending_pkt->num_qpl_bufs = 0; +} + static void gve_free_tx_mbufs_dqo(struct gve_tx_ring *tx) { @@ -54,10 +61,9 @@ gve_free_tx_mbufs_dqo(struct gve_tx_ring *tx) if (!pending_pkt->mbuf) continue; - if (gve_is_qpl(tx->com.priv)) { - pending_pkt->qpl_buf_head = -1; - pending_pkt->num_qpl_bufs = 0; - } else + if (gve_is_qpl(tx->com.priv)) + gve_clear_qpl_pending_pkt(pending_pkt); + else gve_unmap_packet(tx, pending_pkt); m_freem(pending_pkt->mbuf); @@ -880,8 +886,7 @@ gve_reap_qpl_bufs_dqo(struct gve_tx_ring *tx, */ atomic_add_rel_32(&tx->dqo.qpl_bufs_produced, pkt->num_qpl_bufs); - pkt->qpl_buf_head = -1; - pkt->num_qpl_bufs = 0; + gve_clear_qpl_pending_pkt(pkt); } static uint64_t @@ -981,11 +986,13 @@ gve_clear_tx_ring_dqo(struct gve_priv *priv, int i) gve_free_tx_mbufs_dqo(tx); - for (j = 0; j < tx->dqo.num_pending_pkts - 1; j++) { - tx->dqo.pending_pkts[j].next = j + 1; + for (j = 0; j < tx->dqo.num_pending_pkts; j++) { + if (gve_is_qpl(tx->com.priv)) + gve_clear_qpl_pending_pkt(&tx->dqo.pending_pkts[j]); + tx->dqo.pending_pkts[j].next = + (j == tx->dqo.num_pending_pkts - 1) ? -1 : j + 1; tx->dqo.pending_pkts[j].state = GVE_PACKET_STATE_FREE; } - tx->dqo.pending_pkts[tx->dqo.num_pending_pkts - 1].next = -1; tx->dqo.free_pending_pkts_csm = 0; atomic_store_rel_32(&tx->dqo.free_pending_pkts_prd, -1); From nobody Sat Mar 8 08:13:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsZ6M47z5qcnP; Sat, 08 Mar 2025 08:13: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 4Z8wsY66Jdz3klb; Sat, 08 Mar 2025 08:13:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e70a3kWaTYQQXk9THXbI0oLPvkV+/f6ZVmhrVXXMOnM=; b=Z5Bczxu9qs8eQzegHLsfFX+r6rlG5mCictayeGnGBMNhHTNT6y50qPI7nUuharq0ylD/cA Oq5VdZYCamflVuSP+S617arQpd74i82c/jcxzcqvVIWQgO/8xr5zv6/Kp6Q2UaXYm4qiGM pR/DcoXpvPZLA066OL0xPDpsIoW5RD63y2Mu1U5U98wSC5570ybXEKgKjMz8qa5k4HG2VA 2E7Dhuorb2FUwWfJloH4EFsAKKCgbHLQlwC7eIy9A/RH5hzV8QNlY4A/F8vExXNVev6H8Z As0p0yU50BVP/+hL0odKlVprwa2aD3nyuq/BJu9aiOtff3tu2RVVS6ybJrUAJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421633; a=rsa-sha256; cv=none; b=cDugtxhV7fs4AHCF0y/KaMjI2W7CBGbguYh9guH5Jy1dkMBrINFKSg70uc0/n8cihTvl5x 530iLbYeASPQ7qPM7L0sneN9lhUJ1yPqEqxISjckvLq1KoE07MYD5j9AbZNZQvWan9mbZl PJy0GspugOHk+vKZhn1xoIG6YCwynlgLFlIEcT+nfnFuMsQv8MAHrryuMySQV0f0Sy0I4w YIWKgRfhj+NBNNok2zgmIZkughWIm/hDTX/tDypA5lEP9NQ7cqEsq4cmV2EqRT92a/3hiv b9Gttj9w9HJ2yZBeA5L+lbPEx86ONwOppPA41dNEHz2wDQjjFRdcG4VtE/vhsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e70a3kWaTYQQXk9THXbI0oLPvkV+/f6ZVmhrVXXMOnM=; b=Y5OaPXLuY08qXSditV0YqL9efd4H7FH6CQ9fV+10wijKH0Z5Abh9t+XO0METs6svZcKEXh eYnBtoloEANpwq2ivCOOlmOiSvY2bzowbXkBxE1rENLIb9vG6XNeTbT6yuq8W9wNeWR1u/ mF636ov3Fn9fp2WDZ+vqaK086Lyb/R6cI9i7IDEDSPmudgGK46TNxAs9gM3ryja2Wj3bKZ L6i4mCetW+ALywzuciF4z8u2pM/AZU4lkG3+qsvWjm2H154Keqeji2kKTXWNr49MFkdFhp KIz14u28gtCewi9v4qDggD6pAWgih+d2sGcbyspiO7mr8BkHbyFMs9YuFc6rMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsY5jX6zsw; Sat, 08 Mar 2025 08:13: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 5288Drmq097539; Sat, 8 Mar 2025 08:13:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288Drq7097536; Sat, 8 Mar 2025 08:13:53 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:53 GMT Message-Id: <202503080813.5288Drq7097536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 14d4c1845d1b - stable/14 - queue: Add atomic variants for *_EMPTY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14d4c1845d1b03e29aa29eaccba1e9677aa13eb1 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=14d4c1845d1b03e29aa29eaccba1e9677aa13eb1 commit 14d4c1845d1b03e29aa29eaccba1e9677aa13eb1 Author: Mark Johnston AuthorDate: 2025-02-14 15:45:11 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 queue: Add atomic variants for *_EMPTY In some places, these macros are used without a lock, under the assumption that they are naturally atomic. After commit 34740937f7a4 ("queue: New debug macros for STAILQ"), this assumption is false. Provide *_EMPTY_ATOMIC for such cases. This lets us include extra debug checks for the non-atomic case, and gives us a way to explicitly annotate unlocked checks, which generally deserve extra scrutiny and might otherwise raise reports from KCSAN. Reviewed by: kib, olce (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48899 (cherry picked from commit d2870b8666f2438af400269c0f6a1a48031bb71e) --- share/man/man3/queue.3 | 26 +++++++++++++++++++++++++- sys/sys/queue.h | 12 ++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/share/man/man3/queue.3 b/share/man/man3/queue.3 index ea395d7ffe7f..9fc57a59cf11 100644 --- a/share/man/man3/queue.3 +++ b/share/man/man3/queue.3 @@ -27,7 +27,7 @@ .\" .\" @(#)queue.3 8.2 (Berkeley) 1/24/94 .\" -.Dd April 8, 2024 +.Dd February 10, 2025 .Dt QUEUE 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm SLIST_CLASS_HEAD , .Nm SLIST_CONCAT , .Nm SLIST_EMPTY , +.Nm SLIST_EMPTY_ATOMIC , .Nm SLIST_ENTRY , .Nm SLIST_FIRST , .Nm SLIST_FOREACH , @@ -55,6 +56,7 @@ .Nm STAILQ_CLASS_HEAD , .Nm STAILQ_CONCAT , .Nm STAILQ_EMPTY , +.Nm STAILQ_EMPTY_ATOMIC , .Nm STAILQ_ENTRY , .Nm STAILQ_FIRST , .Nm STAILQ_FOREACH , @@ -77,6 +79,7 @@ .Nm LIST_CLASS_HEAD , .Nm LIST_CONCAT , .Nm LIST_EMPTY , +.Nm LIST_EMPTY_ATOMIC , .Nm LIST_ENTRY , .Nm LIST_FIRST , .Nm LIST_FOREACH , @@ -98,6 +101,7 @@ .Nm TAILQ_CLASS_HEAD , .Nm TAILQ_CONCAT , .Nm TAILQ_EMPTY , +.Nm TAILQ_EMPTY_ATOMIC , .Nm TAILQ_ENTRY , .Nm TAILQ_FIRST , .Nm TAILQ_FOREACH , @@ -130,6 +134,7 @@ lists and tail queues .Fn SLIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn SLIST_CONCAT "SLIST_HEAD *head1" "SLIST_HEAD *head2" "TYPE" "SLIST_ENTRY NAME" .Fn SLIST_EMPTY "SLIST_HEAD *head" +.Fn SLIST_EMPTY_ATOMIC "SLIST_HEAD *head" .Fn SLIST_ENTRY "TYPE" .Fn SLIST_FIRST "SLIST_HEAD *head" .Fn SLIST_FOREACH "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" @@ -151,6 +156,7 @@ lists and tail queues .Fn STAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn STAILQ_CONCAT "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" .Fn STAILQ_EMPTY "STAILQ_HEAD *head" +.Fn STAILQ_EMPTY_ATOMIC "STAILQ_HEAD *head" .Fn STAILQ_ENTRY "TYPE" .Fn STAILQ_FIRST "STAILQ_HEAD *head" .Fn STAILQ_FOREACH "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" @@ -174,6 +180,7 @@ lists and tail queues .Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn LIST_CONCAT "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME" .Fn LIST_EMPTY "LIST_HEAD *head" +.Fn LIST_EMPTY_ATOMIC "LIST_HEAD *head" .Fn LIST_ENTRY "TYPE" .Fn LIST_FIRST "LIST_HEAD *head" .Fn LIST_FOREACH "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" @@ -196,6 +203,7 @@ lists and tail queues .Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn TAILQ_CONCAT "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TAILQ_ENTRY NAME" .Fn TAILQ_EMPTY "TAILQ_HEAD *head" +.Fn TAILQ_EMPTY_ATOMIC "TAILQ_HEAD *head" .Fn TAILQ_ENTRY "TYPE" .Fn TAILQ_FIRST "TAILQ_HEAD *head" .Fn TAILQ_FOREACH "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" @@ -427,6 +435,10 @@ high-usage code paths or to operate on long lists. The macro .Nm SLIST_EMPTY evaluates to true if there are no elements in the list. +The +.Nm SLIST_EMPTY_ATOMIC +variant has the same behavior, but can be safely used in contexts where it is +possible that a different thread is concurrently updating the list. .Pp The macro .Nm SLIST_ENTRY @@ -635,6 +647,10 @@ removing all entries from the former. The macro .Nm STAILQ_EMPTY evaluates to true if there are no items on the tail queue. +The +.Nm STAILQ_EMPTY_ATOMIC +variant has the same behavior, but can be safely used in contexts where it is +possible that a different thread is concurrently updating the queue. .Pp The macro .Nm STAILQ_ENTRY @@ -868,6 +884,10 @@ high-usage code paths or to operate on long lists. The macro .Nm LIST_EMPTY evaluates to true if there are no elements in the list. +The +.Nm LIST_EMPTY_ATOMIC +variant has the same behavior, but can be safely used in contexts where it is +possible that a different thread is concurrently updating the list. .Pp The macro .Nm LIST_ENTRY @@ -1086,6 +1106,10 @@ removing all entries from the former. The macro .Nm TAILQ_EMPTY evaluates to true if there are no items on the tail queue. +The +.Nm TAILQ_EMPTY_ATOMIC +variant has the same behavior, but can be safely used in contexts where it is +possible that a different thread is concurrently updating the queue. .Pp The macro .Nm TAILQ_ENTRY diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 38c319704cc4..dd3956d7c111 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -228,6 +228,9 @@ struct { \ #define SLIST_EMPTY(head) ((head)->slh_first == NULL) +#define SLIST_EMPTY_ATOMIC(head) \ + (atomic_load_ptr(&(head)->slh_first) == NULL) + #define SLIST_FIRST(head) ((head)->slh_first) #define SLIST_FOREACH(var, head, field) \ @@ -389,6 +392,9 @@ struct { \ STAILQ_FIRST(head) == NULL; \ }) +#define STAILQ_EMPTY_ATOMIC(head) \ + (atomic_load_ptr(&(head)->stqh_first) == NULL) + #define STAILQ_FIRST(head) ((head)->stqh_first) #define STAILQ_FOREACH(var, head, field) \ @@ -577,6 +583,9 @@ struct { \ #define LIST_EMPTY(head) ((head)->lh_first == NULL) +#define LIST_EMPTY_ATOMIC(head) \ + (atomic_load_ptr(&(head)->lh_first) == NULL) + #define LIST_FIRST(head) ((head)->lh_first) #define LIST_FOREACH(var, head, field) \ @@ -781,6 +790,9 @@ struct { \ #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) +#define TAILQ_EMPTY_ATOMIC(head) \ + (atomic_load_ptr(&(head)->tqh_first) == NULL) + #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_FOREACH(var, head, field) \ From nobody Sat Mar 8 08:13:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsd0XCkz5qcyQ; Sat, 08 Mar 2025 08:13: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 4Z8wsc0p47z3kwt; Sat, 08 Mar 2025 08:13:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ao9TxHY4KObzEG4skGeM0ZX7PUwZWlS+A49aOnEaD4M=; b=ljYndE4WWU7Ml5KbRrwt9ge3ZhGCcp30x3T2cfcefvYTSwlXrWme0qllh4biv8UiMw5pmI yHIYEPr8zf5jLaSss1UGDM7/5L3KJYbP5aFRALJrlW0pFKiSfOlTU+ekdmPBl7N/t5bL2q BokNmZhV4Dcl2QKisJ2G3Aw5CZq7OEkNIWNsoAVxs9Xbfq4A2yA0lVhlsIhrwtkzpnlo4H An9r8zkFPMyc2D25Nj30qtwMQFkMNsjJR7tYSjJ8sNCMyxKOTzlvgtRnBVC0+SGsv2UMf7 eK29sss29A0i1rViAiw7TJ3qjNSRE5e3QwVDZ84e1ZSHG7nApnmvJKd3hR24fQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421636; a=rsa-sha256; cv=none; b=irT7bZytvZFEfvO4maY/ysxEJRGwS5wWq8XOyIoyXUcD0z7+LWMdkr6jGnNNMH78QZSFbd bJIvnjUJDfgmkeA2YKIzxUWUKZGYob4SO95t9jprxN7+bkV26ImODcL5XE2yQsJbv4t4w1 HgcAN6U6pef6TikyydRHiBno+qukkSo4MTNv7S2NJNqhYsUeaw8UufD3oY6SjB7V1zE6Ej JVceEsKBwkgbz35PF/JBirEkm75AKeTwqXwEjXUp8C8VvHv1rLFu2n8zN0JBOZLSyF3LXC 0JBEwgIlpMhiGNKOhiFJpEVw1YZvcuk8bAZD/OywyshS0qKkT8fWZ1he0Mzizw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ao9TxHY4KObzEG4skGeM0ZX7PUwZWlS+A49aOnEaD4M=; b=aOpqATLTybVovAb194bfeml3fLw5xNBDsxKNT+GwVzWdKpJT8GsXdYu9C9y3RGc7afSJne DvDgkkECbhl+R2AQSfd12jfG6CJvLubA0MqNE7Spdatvaj6I9Egb2JR17gu4zN12ND9edL DtI9vAXe/9Zi0isNcYDlTGv3RFQMHn68dXO/TA28w55guvuYvpID0oSI4tMz+vgT/qWQbR sUEOn89A3ufQLy0Hf4qxUG6NgktQN8L48/eqUMjyUmf7C+Xw4X3sKpVwoNZyWFnYVkrrG/ qRPa0DM8UwzkbSC7PoWWEyadeVItpt5EWcz5EwvePm9DKodb/4UW0zCEzU6QDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsc0MfHzjD; Sat, 08 Mar 2025 08:13: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 5288DtEk097611; Sat, 8 Mar 2025 08:13:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288DtbP097608; Sat, 8 Mar 2025 08:13:55 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:55 GMT Message-Id: <202503080813.5288DtbP097608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ffb4d077710a - stable/14 - ktr: Use STAILQ_EMPTY_ATOMIC when checking for records in ktr_drain() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ffb4d077710ae1a61dabc362b0963fc62642f0c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ffb4d077710ae1a61dabc362b0963fc62642f0c9 commit ffb4d077710ae1a61dabc362b0963fc62642f0c9 Author: Mark Johnston AuthorDate: 2025-02-14 15:49:27 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 ktr: Use STAILQ_EMPTY_ATOMIC when checking for records in ktr_drain() This is an unlocked check, and after commit 34740937f7a4 the debug checks in STAILQ_EMPTY may spuriously fail here. In particular, the per process queue is updated under the global ktrace mutex, not held in ktr_drain(). If a record is enqueued concurrently, the recording thread will schedule an AST to drain the queue again, so it should not be possible for a race to leave records in the queue indefinitely. Reviewed by: kib, olce Reported by: syzbot+d67eddd8c4923ee28bb7@syzkaller.appspotmail.com MFC after: 2 weeks Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") Differential Revision: https://reviews.freebsd.org/D48899 (cherry picked from commit 36631977d8c9264b7a54f039289918adea4d2a03) --- sys/kern/kern_ktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 2b311f2d36dc..3d3cbbd29c6f 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -396,7 +396,7 @@ ktr_drain(struct thread *td) STAILQ_INIT(&local_queue); - if (!STAILQ_EMPTY(&td->td_proc->p_ktr)) { + if (!STAILQ_EMPTY_ATOMIC(&td->td_proc->p_ktr)) { mtx_lock(&ktrace_mtx); STAILQ_CONCAT(&local_queue, &td->td_proc->p_ktr); mtx_unlock(&ktrace_mtx); From nobody Sat Mar 8 08:13:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsd4QtYz5qcyR; Sat, 08 Mar 2025 08:13: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 4Z8wsd1lpxz3kx7; Sat, 08 Mar 2025 08:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y1vefb5O9NBmhr9OnCBUzcS1KzwZwL1Cnz11wW/My8s=; b=fRK/A+Nr49ygn4Xrul3rOyj9GfBaG04jfp5X33FQpuqyKHICJswCFEVkW0EW1zHFHIdZFT +nzhlG/ddrirpA8F0rQxNVTrYuJvCI73ll0vZwbBeP0S5/mETh0CmUqldwhJB+R9bf0UFx 5vnQCgUnHPSFtMx055FJlw74WcEpsxQt2jXIc2q/+4/V/ZWMasknykXBYO9sQc3FwJLlIK 9ezvJqymXjXjgCOPp/nc7Bm8NyZCLIo0Hy/LgRxZpgPYpQRS3dgRqZcD0ZV/J0m58i4096 vSO9hrcagAAPA+T8gr+qRMOZbpEpBc+Y0VjjKtSM0a71NX9Lcx8nx+NxGy5n0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421637; a=rsa-sha256; cv=none; b=izVoPMxsyBAwENBO9mXWh7V/se2+J609VoFICzn2vzGpGs3mDW7LM/La6leSrPwOLoa7rh ets9w1t47FcxrYARZETZIxDScK1wNiKWnN0jgx/ga3T30AYAo1mBBbBsKxKgV6CrO6ldL2 o2/iwfmYOsoKWOcq/H/dcHCZ94QiAs0kuCHcl/A1jOCyrBKlTTZpZz5exJWfIpWRjbf9wg ByKDjonviaXVP9buwX58qIkmCbXsAlJX5+2LfAXyzSy76VnMUhjt3iDojdU49ed9VIjG8s Dn8SuNxJmCCS8EZNt7AZiZSqCeFpZup/8TwW/2uS5gPEgPTCbLGU5eHb2j12TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y1vefb5O9NBmhr9OnCBUzcS1KzwZwL1Cnz11wW/My8s=; b=bjz8uzKuwpK8s31kN9FK7qOCxa1XmfNaH0r6hKyod+Tnyeem3VgZHBlKmkciNqSNOOp0sO CUmOBrBQ6blYPXBK5w9Hb9+oLRBRUm1EqCa23KtsnX69BmSWy+ydr9DfZXYOfhzH/34LdN poHCiyCpBVQdviUyTW1wjgF2j869GjGMH7gkqiv/6TwR8EaPFMC2Lo3rkPFVTupPeBQBGH S/MP+6HHgCORvuoj6DX8aqBerRnJkBrpIvGzrlyO5HYRHVoTN8KFmr/cHbIRWOiELR+FLB 4oeBHBWceyryN/qANhzG3tlskKWBfNpByPl+YOZLGcb1z1OM2X7k/5kaGCMaaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsd15w3zPl; Sat, 08 Mar 2025 08:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5288DvEC097648; Sat, 8 Mar 2025 08:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288Dvh4097645; Sat, 8 Mar 2025 08:13:57 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:57 GMT Message-Id: <202503080813.5288Dvh4097645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c813157a1541 - stable/14 - umtx: Add a helper for unlocked umtxq_busy() calls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c813157a154148d5488d841aa28aed50b3e13049 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c813157a154148d5488d841aa28aed50b3e13049 commit c813157a154148d5488d841aa28aed50b3e13049 Author: Mark Johnston AuthorDate: 2025-02-24 20:36:48 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:48 +0000 umtx: Add a helper for unlocked umtxq_busy() calls This seems like a natural complement to umtxq_unbusy_unlocked(). No functional change intended. Reviewed by: olce, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49124 (cherry picked from commit b01495caac2eca73463f4a889936a19e4c1c5909) --- sys/compat/linux/linux_futex.c | 12 +++--------- sys/kern/kern_umtx.c | 34 +++++++++++++++------------------- sys/sys/umtxvar.h | 1 + 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index ab2760859e16..37d0142bae8b 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -501,9 +501,7 @@ linux_futex_lock_pi(struct thread *td, bool try, struct linux_futex_args *args) if (error != 0) break; - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * Set the contested bit so that a release in user space knows @@ -642,9 +640,7 @@ linux_futex_wakeop(struct thread *td, struct linux_futex_args *args) umtx_key_release(&key); return (error); } - umtxq_lock(&key); - umtxq_busy(&key); - umtxq_unlock(&key); + umtxq_busy_unlocked(&key); error = futex_atomic_op(td, args->val3, args->uaddr2, &op_ret); umtxq_lock(&key); umtxq_unbusy(&key); @@ -701,9 +697,7 @@ linux_futex_requeue(struct thread *td, struct linux_futex_args *args) umtx_key_release(&key); return (error); } - umtxq_lock(&key); - umtxq_busy(&key); - umtxq_unlock(&key); + umtxq_busy_unlocked(&key); error = fueword32(args->uaddr, &uval); if (error != 0) error = EFAULT; diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 7cfe68730e7d..f326b9aa691a 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -440,9 +440,16 @@ umtxq_unbusy(struct umtx_key *key) } void -umtxq_unbusy_unlocked(struct umtx_key *key) +umtxq_busy_unlocked(struct umtx_key *key) { + umtxq_lock(key); + umtxq_busy(key); + umtxq_unlock(key); +} +void +umtxq_unbusy_unlocked(struct umtx_key *key) +{ umtxq_lock(key); umtxq_unbusy(key); umtxq_unlock(key); @@ -2371,9 +2378,7 @@ do_lock_pi(struct thread *td, struct umutex *m, uint32_t flags, if (error != 0) break; - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * Set the contested bit so that a release in user space @@ -2539,9 +2544,7 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, su = (priv_check(td, PRIV_SCHED_RTPRIO) == 0); for (;;) { old_inherited_pri = uq->uq_inherited_pri; - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); rv = fueword32(&m->m_ceilings[0], &ceiling); if (rv == -1) { @@ -2722,9 +2725,8 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb) TYPE_PP_ROBUST_UMUTEX : TYPE_PP_UMUTEX, GET_SHARE(flags), &key)) != 0) return (error); - umtxq_lock(&key); - umtxq_busy(&key); - umtxq_unlock(&key); + umtxq_busy_unlocked(&key); + /* * For priority protected mutex, always set unlocked state * to UMUTEX_CONTESTED, so that userland always enters kernel @@ -2787,9 +2789,7 @@ do_set_ceiling(struct thread *td, struct umutex *m, uint32_t ceiling, &uq->uq_key)) != 0) return (error); for (;;) { - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); rv = fueword32(&m->m_ceilings[0], &save_ceiling); if (rv == -1) { @@ -3139,9 +3139,7 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, break; /* grab monitor lock */ - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * re-read the state, in case it changed between the try-lock above @@ -3332,9 +3330,7 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock, struct _umtx_time *timeo } /* grab monitor lock */ - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_busy_unlocked(&uq->uq_key); /* * Re-read the state, in case it changed between the diff --git a/sys/sys/umtxvar.h b/sys/sys/umtxvar.h index 647ee2a4650c..6165d37d9195 100644 --- a/sys/sys/umtxvar.h +++ b/sys/sys/umtxvar.h @@ -206,6 +206,7 @@ int umtx_key_get(const void *, int, int, struct umtx_key *); void umtx_key_release(struct umtx_key *); struct umtx_q *umtxq_alloc(void); void umtxq_busy(struct umtx_key *); +void umtxq_busy_unlocked(struct umtx_key *); int umtxq_count(struct umtx_key *); void umtxq_free(struct umtx_q *); struct umtxq_chain *umtxq_getchain(struct umtx_key *); From nobody Sat Mar 8 08:13:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsh0trqz5qcfQ; Sat, 08 Mar 2025 08:14: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 4Z8wsg3hkHz3l8s; Sat, 08 Mar 2025 08:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSxBy5P8jxGSI/dksEYr8/TYAiCb3k6xeCYpkrNKXb0=; b=Ri9rOVNS7u4ktG6w+WbVDZCig4necV/WD/pSHmenzrLN6MlU0EjVeLzSI485sBLLh9F1LW +Ipsm5kof07Tc9Ga9Mhxjktc2HLeRau54edxtvbqFY3J3gOUsJtqv3wEncx8KNEa6gRibI qxlyENfwj5TRDxuG1bKz/n5S462DEiNicHQJ+E7SBpF6lDrig1NmLHIT5o2R26NNJy98xM RETqOcF+Qzrhz5NjK13FeJBrpMX56mElT9P0O0zIjW59uzdqowabSCP1pl+zEBdh01Tu3Q XQtE0J2i3uuptWVOdlTjoW/4/AJAWXNyIaALmDylLyVj2ekiy3gU/KlESpmsig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421639; a=rsa-sha256; cv=none; b=LY8M2ZAf4cU2MXzee/LZCUY7XVlzDw1Dd0Nlys9Kv5N4369xKnDh2EzggBRBDqUOCs7fjD GgFi0OE6zfi4z/43JdTtnPT/opCo6306dPdf79wGgi6Lyd0A+NQ9isQ/HmIYADxlOiHrKG JcTU3Xe7R6y/vVf1I6aM4HZrw2l7ZSlpnFUGc5w3hSvgJzTgRgUS9dom8JRyincSZY2d6+ uV+8zccdevMOz1GPgMSE6Y825AbqPQWN4m9qZS+cR0ANVYq80UCUvVsNt+jHedwlQADPtp JuDcuOTHKqfnDVj4eKjwoynw6VzjBYQKsK0XO/wS7ZVFH6b1slMWH7HPz0eXTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSxBy5P8jxGSI/dksEYr8/TYAiCb3k6xeCYpkrNKXb0=; b=c7spYhq/QZlTe7qMy2Fb35YUiQTypBt4P/qaOHqaInFSB7kHufRDDJecX0f9VN5U4aYlnq OJ8j/1ViORkcWi6z4iIZ9992a377QUE0Z3l1daaPDQjgRUeVdEtJFNQiZ267vOlvX7eC+v /T5uhz88mVXNvu9FABKSdQPIeBXsgokjJob6BB4Ubjq52Zw3sn+T+PxpDStTFGv7pKi+XQ 2S2rUfGs/CoNfwBfztmNOEiXgAb3VGNX/Bv83o7V18cD32ODfmsoHv0O2JG0sYdKiQu4WA QZdUB9ZCnSMRN1ssKIikT8FQK829HOhoq7/YVZ1fwcOi9oz0y/09gCbvkpyQIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsg32KXzdB; Sat, 08 Mar 2025 08:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5288DxGk097725; Sat, 8 Mar 2025 08:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288Dxpl097722; Sat, 8 Mar 2025 08:13:59 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:59 GMT Message-Id: <202503080813.5288Dxpl097722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bec64e75a5a8 - stable/14 - bhyve: Avoid holding /dev/pci open unnecessarily List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bec64e75a5a8f0c1fa27f5d6081f52266516f393 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bec64e75a5a8f0c1fa27f5d6081f52266516f393 commit bec64e75a5a8f0c1fa27f5d6081f52266516f393 Author: Mark Johnston AuthorDate: 2025-02-14 15:25:08 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:49 +0000 bhyve: Avoid holding /dev/pci open unnecessarily Some device models, LPC in particular, will call pci_host_read_config() when probing for devices. Currently this results in pcifd_init() opening /dev/pci, and thus bhyve holds the fd open even when it's not needed. Modify pci_host_{read,write}_config() to open /dev/pci independent of the global pcifd. This means that these routines can only be used during VM initialization, as capsicum will prevent further opens afterward. Introduce internal wrappers which use the global pcifd, intended for the passthru code. Reviewed by: jhb MFC after: 3 weeks Fixes: 563fd2240e13 ("bhyve: export funcs for read/write pci config") Differential Revision: https://reviews.freebsd.org/D48908 (cherry picked from commit 649a910e34b0314647d16a94f8af6de0f4cfd4b5) --- usr.sbin/bhyve/pci_passthru.c | 119 +++++++++++++++++++++++++++++------------- 1 file changed, 83 insertions(+), 36 deletions(-) diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c index 345971641f8a..8506cab24a1b 100644 --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -121,13 +121,24 @@ msi_caplen(int msgctrl) } static int -pcifd_init(void) +pcifd_open(void) { - pcifd = open(_PATH_DEVPCI, O_RDWR, 0); - if (pcifd < 0) { + int fd; + + fd = open(_PATH_DEVPCI, O_RDWR, 0); + if (fd < 0) { warn("failed to open %s", _PATH_DEVPCI); - return (1); + return (-1); } + return (fd); +} + +static int +pcifd_init(void) +{ + pcifd = pcifd_open(); + if (pcifd < 0) + return (1); #ifndef WITHOUT_CAPSICUM cap_rights_t pcifd_rights; @@ -144,43 +155,75 @@ pcifd_init(void) return (0); } -uint32_t -pci_host_read_config(const struct pcisel *sel, long reg, int width) +static uint32_t +host_read_config(int fd, const struct pcisel *sel, long reg, int width) { struct pci_io pi; - if (pcifd < 0 && pcifd_init()) { - return (0); - } - bzero(&pi, sizeof(pi)); pi.pi_sel = *sel; pi.pi_reg = reg; pi.pi_width = width; - if (ioctl(pcifd, PCIOCREAD, &pi) < 0) - return (0); /* XXX */ + if (ioctl(fd, PCIOCREAD, &pi) < 0) + return (0); /* XXX */ else return (pi.pi_data); } -void -pci_host_write_config(const struct pcisel *sel, long reg, int width, +static uint32_t +passthru_read_config(const struct pcisel *sel, long reg, int width) +{ + return (host_read_config(pcifd, sel, reg, width)); +} + +uint32_t +pci_host_read_config(const struct pcisel *sel, long reg, int width) +{ + uint32_t ret; + int fd; + + fd = pcifd_open(); + if (fd < 0) + return (0); + ret = host_read_config(fd, sel, reg, width); + (void)close(fd); + return (ret); +} + +static void +host_write_config(int fd, const struct pcisel *sel, long reg, int width, uint32_t data) { struct pci_io pi; - if (pcifd < 0 && pcifd_init()) { - return; - } - bzero(&pi, sizeof(pi)); pi.pi_sel = *sel; pi.pi_reg = reg; pi.pi_width = width; pi.pi_data = data; - (void)ioctl(pcifd, PCIOCWRITE, &pi); /* XXX */ + (void)ioctl(fd, PCIOCWRITE, &pi); /* XXX */ +} + +static void +passthru_write_config(const struct pcisel *sel, long reg, int width, + uint32_t data) +{ + host_write_config(pcifd, sel, reg, width, data); +} + +void +pci_host_write_config(const struct pcisel *sel, long reg, int width, + uint32_t data) +{ + int fd; + + fd = pcifd_open(); + if (fd < 0) + return; + host_write_config(fd, sel, reg, width, data); + (void)close(fd); } #ifdef LEGACY_SUPPORT @@ -225,24 +268,24 @@ cfginitmsi(struct passthru_softc *sc) * Parse the capabilities and cache the location of the MSI * and MSI-X capabilities. */ - sts = pci_host_read_config(&sel, PCIR_STATUS, 2); + sts = passthru_read_config(&sel, PCIR_STATUS, 2); if (sts & PCIM_STATUS_CAPPRESENT) { - ptr = pci_host_read_config(&sel, PCIR_CAP_PTR, 1); + ptr = passthru_read_config(&sel, PCIR_CAP_PTR, 1); while (ptr != 0 && ptr != 0xff) { - cap = pci_host_read_config(&sel, ptr + PCICAP_ID, 1); + cap = passthru_read_config(&sel, ptr + PCICAP_ID, 1); if (cap == PCIY_MSI) { /* * Copy the MSI capability into the config * space of the emulated pci device */ sc->psc_msi.capoff = ptr; - sc->psc_msi.msgctrl = pci_host_read_config(&sel, - ptr + 2, 2); + sc->psc_msi.msgctrl = + passthru_read_config(&sel, ptr + 2, 2); sc->psc_msi.emulated = 0; caplen = msi_caplen(sc->psc_msi.msgctrl); capptr = ptr; while (caplen > 0) { - u32 = pci_host_read_config(&sel, capptr, + u32 = passthru_read_config(&sel, capptr, 4); pci_set_cfgdata32(pi, capptr, u32); caplen -= 4; @@ -257,7 +300,7 @@ cfginitmsi(struct passthru_softc *sc) msixcap_ptr = (char *)&msixcap; capptr = ptr; while (caplen > 0) { - u32 = pci_host_read_config(&sel, capptr, + u32 = passthru_read_config(&sel, capptr, 4); memcpy(msixcap_ptr, &u32, 4); pci_set_cfgdata32(pi, capptr, u32); @@ -266,7 +309,7 @@ cfginitmsi(struct passthru_softc *sc) msixcap_ptr += 4; } } - ptr = pci_host_read_config(&sel, ptr + PCICAP_NEXTPTR, + ptr = passthru_read_config(&sel, ptr + PCICAP_NEXTPTR, 1); } } @@ -302,7 +345,7 @@ cfginitmsi(struct passthru_softc *sc) */ if ((sts & PCIM_STATUS_CAPPRESENT) != 0 && sc->psc_msi.capoff == 0) { int origptr, msiptr; - origptr = pci_host_read_config(&sel, PCIR_CAP_PTR, 1); + origptr = passthru_read_config(&sel, PCIR_CAP_PTR, 1); msiptr = passthru_add_msicap(pi, 1, origptr); sc->psc_msi.capoff = msiptr; sc->psc_msi.msgctrl = pci_get_cfgdata16(pi, msiptr + 2); @@ -536,6 +579,8 @@ cfginitbar(struct passthru_softc *sc) * Initialize BAR registers */ for (i = 0; i <= PCI_BARMAX; i++) { + uint8_t lobits; + bzero(&bar, sizeof(bar)); bar.pbi_sel = sc->psc_sel; bar.pbi_reg = PCIR_BAR(i); @@ -581,8 +626,8 @@ cfginitbar(struct passthru_softc *sc) return (-1); /* Use same lobits as physical bar */ - uint8_t lobits = pci_host_read_config(&sc->psc_sel, PCIR_BAR(i), - 0x01); + lobits = (uint8_t)passthru_read_config(&sc->psc_sel, + PCIR_BAR(i), 0x01); if (bartype == PCIBAR_MEM32 || bartype == PCIBAR_MEM64) { lobits &= ~PCIM_BAR_MEM_BASE; } else { @@ -629,7 +674,7 @@ cfginit(struct pci_devinst *pi, int bus, int slot, int func) intpin = pci_get_cfgdata8(pi, PCIR_INTPIN); for (int i = 0; i <= PCIR_MAXLAT; i += 4) { pci_set_cfgdata32(pi, i, - pci_host_read_config(&sc->psc_sel, i, 4)); + passthru_read_config(&sc->psc_sel, i, 4)); } pci_set_cfgdata16(pi, PCIR_COMMAND, cmd); pci_set_cfgdata8(pi, PCIR_INTLINE, intline); @@ -988,15 +1033,17 @@ passthru_cfgread_default(struct passthru_softc *sc, * device's config space. */ if (coff == PCIR_COMMAND) { + uint32_t st; + if (bytes <= 2) return (-1); - *rv = pci_host_read_config(&sc->psc_sel, PCIR_STATUS, 2) << 16 | - pci_get_cfgdata16(pi, PCIR_COMMAND); + st = passthru_read_config(&sc->psc_sel, PCIR_STATUS, 2); + *rv = (st << 16) | pci_get_cfgdata16(pi, PCIR_COMMAND); return (0); } /* Everything else just read from the device's config space */ - *rv = pci_host_read_config(&sc->psc_sel, coff, bytes); + *rv = passthru_read_config(&sc->psc_sel, coff, bytes); return (0); } @@ -1079,7 +1126,7 @@ passthru_cfgwrite_default(struct passthru_softc *sc, struct pci_devinst *pi, return (-1); /* Update the physical status register. */ - pci_host_write_config(&sc->psc_sel, PCIR_STATUS, val >> 16, 2); + passthru_write_config(&sc->psc_sel, PCIR_STATUS, val >> 16, 2); /* Update the virtual command register. */ cmd_old = pci_get_cfgdata16(pi, PCIR_COMMAND); @@ -1088,7 +1135,7 @@ passthru_cfgwrite_default(struct passthru_softc *sc, struct pci_devinst *pi, return (0); } - pci_host_write_config(&sc->psc_sel, coff, bytes, val); + passthru_write_config(&sc->psc_sel, coff, bytes, val); return (0); } From nobody Sat Mar 8 08:13:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsg2MCMz5qd3n; Sat, 08 Mar 2025 08:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8wsf2YQdz3l07; Sat, 08 Mar 2025 08:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sk/RpNVcHHGN4ynVrLeGHibpFyVnJR1HzkiDC16AguQ=; b=LMVLpJtW2nwzrZtYQ7VzvkPlQiO9csg5Ra5n/6ohXS5qsDpycBroazKECpBESMrU5HdzZf phKPVElym5cMfQBw9kGHBrD0EkLqIJ397Cl8mCDNS82I4vHfyS5lpL/FzXG+UI/wyfEQEG U5l3M0mE5DadX030Xv5jkRnUhFoTUaVvdQ0jKbkA/GVASILZindVM94Puh7N1OhpuIRGhs 1Pj88V4uSWIGoZxCjxiCl0sYtdKoC+zXQ8HzIclwu185c5pQMNs9lZ5B5SzxzVZi22tbKp 86bZTLwY4ipdfVJrMKIZrwGC80b8txKwFWCK0MvQDYdwYc8UpI7BahmnL4FgfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421638; a=rsa-sha256; cv=none; b=g7fK9GatnMdYcFeOFzIW9XB+Ps9ZoE7Y/MBKWxDCY2dNFRljTAcnHaPCAWPHlceit8FBlV CnsLzxqw1cRvNEugkKYog4HNFCBzaE+bbtedj/SvgN0WIm9XDBK0l20mpEa2/dXsR0t1FY 9mfuqUjRozBtMgeKeqnOde7zaYIVVGNmF/y2dRxCgBesC9OSUkTT69Wnekr+NKwmT+OPZZ RWtBBoNlXtXdsd9w7CXh1BVVsNt54MPnpkkLKCdGXwKkTKQAciYJRcKgqePiwvvL1L1QxR zabiDn6+GZEVf9XA0qA2OdHO5fD5hmvbC4tVKZEGj/o3PuO6LJ/3QRCkQxLL4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sk/RpNVcHHGN4ynVrLeGHibpFyVnJR1HzkiDC16AguQ=; b=Z3/TATI8JNvWvf9ORhwdfE9lBdIRvPyKuI4rTFFWoBEp3Ns7lDUGUkkVuzGP7O4GxHn1jx qSVY/jG5vAwiqe4XoPYu1YZHhi06d2uZMkVqftpJSnd++srUq5UAV2iUMsw3ivJoljYGLL xMqfmPX6l76B0hHkDB06Na/PGjDeSHucRRuVuinQqhgYgNk5rlNhZw5bAyrvEXbDC6a4dL Vgzn0EzyO5gJFcKzMHOLTtdUHOLPvWqL2WUqGOUECYgDscERb8gKKcg4ZqsZ/Ah17edfSd hBYygXLkj8Dhh/m4pvwqL9YeWw3hrcOtbSKySZCGmDqvOsdNRyKBUVVxb1xQiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsf1nFVzjq; Sat, 08 Mar 2025 08:13: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 5288DwhW097686; Sat, 8 Mar 2025 08:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288DwrO097683; Sat, 8 Mar 2025 08:13:58 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:13:58 GMT Message-Id: <202503080813.5288DwrO097683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7309434b1508 - stable/14 - dtrace: fix signature mismatch for taskqueue callbacks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7309434b15081c99c860bb9e76c38f76f4292e0f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7309434b15081c99c860bb9e76c38f76f4292e0f commit 7309434b15081c99c860bb9e76c38f76f4292e0f Author: SHENGYI HONG AuthorDate: 2025-02-23 17:42:41 +0000 Commit: Mark Johnston CommitDate: 2025-03-07 22:51:49 +0000 dtrace: fix signature mismatch for taskqueue callbacks Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49112 (cherry picked from commit a1452eec4768272056aa070db94ea7184ce1117c) --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 608bff1d23ae..cfd403ac1a01 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -594,7 +594,8 @@ static dtrace_probe_t *dtrace_probe_lookup_id(dtrace_id_t id); static void dtrace_enabling_provide(dtrace_provider_t *); static int dtrace_enabling_match(dtrace_enabling_t *, int *); static void dtrace_enabling_matchall(void); -static void dtrace_enabling_reap(void); +static void dtrace_enabling_matchall_task(void *); +static void dtrace_enabling_reap(void *); static dtrace_state_t *dtrace_anon_grab(void); static uint64_t dtrace_helper(int, dtrace_mstate_t *, dtrace_state_t *, uint64_t, uint64_t); @@ -12991,6 +12992,12 @@ dtrace_enabling_match(dtrace_enabling_t *enab, int *nmatched) return (0); } +static void +dtrace_enabling_matchall_task(void *args __unused) +{ + dtrace_enabling_matchall(); +} + static void dtrace_enabling_matchall(void) { @@ -13118,7 +13125,7 @@ retry: * Called to reap ECBs that are attached to probes from defunct providers. */ static void -dtrace_enabling_reap(void) +dtrace_enabling_reap(void *args __unused) { dtrace_provider_t *prov; dtrace_probe_t *probe; @@ -16719,8 +16726,8 @@ dtrace_module_loaded(modctl_t *ctl) return; } - (void) taskq_dispatch(dtrace_taskq, - (task_func_t *)dtrace_enabling_matchall, NULL, TQ_SLEEP); + (void)taskq_dispatch(dtrace_taskq, + (task_func_t *)dtrace_enabling_matchall_task, NULL, TQ_SLEEP); mutex_exit(&dtrace_lock); From nobody Sat Mar 8 08:14:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8wsh6xCRz5qcyZ; Sat, 08 Mar 2025 08:14: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 4Z8wsh4Zdqz3ktl; Sat, 08 Mar 2025 08:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLk1Xk4bRGT0vOp6hId8RhK0M8Kmz/8tR0Uy7G2URZ0=; b=wqkY10buXQQlKvw6bXt+1sOeYN5azHGfmvg9uugwMDCxsCVZrYKZHEK0Or6D8MoBODAPK3 E20eX91e8Rqzv/Xv9wcg5EYdp8fZoJc7snFkL204Ifkunl2oHF5JhcIK+j7Igj2b7YCoYD SviN5O2UdiGwsLxxKpA0ma0UQGYSZdI6nYOJ3fY0XOslUqa/sdrUyFjOFb9ALpJvv4OfdF 6l/TsJWZXjQL8eUu4jYMr7wWKqLn26O3C8m7dXI0jpVNyukaUaUMdzQWo97NarXoiUZP8Q YUJJHRTxwrUI9XJhzGfSkPVlwDshWVl46I/hR51XHYre0n3f7qI/0V6oMS52FA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741421640; a=rsa-sha256; cv=none; b=cNCeOzz1VO7XlxlvMp3tYqAVgl1gpOLynwxoI3JEXGh0czw9u3FG7i0vC1ZJL2Vv+KIraG rL2f79yAA/SVFjrtwSk5bCn/lMdULlABdDb19HS9XG70Uzfqlge/21QlP67MhebceiwdcB 0Oc5eW2yWNnJ7k63hW0CA2fJAfJxaQ42UGroE5V9QdBbVXAOQF6j7ltpUfSe1E2+i3VYfS vppKr5U2YPD5WvWNaD5eRpamiETsU154EWoelONc+DvIb8R8vc5OD1klx5lwpvUDDU98LX r5YVisNP01W384qfwVXB9AU5IS7xQncErexAEdALD7RyTl28AblRbIQf8/9n5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741421640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLk1Xk4bRGT0vOp6hId8RhK0M8Kmz/8tR0Uy7G2URZ0=; b=Zz+OJahjw4o8OtHzeap74nOsL8vuYoT6AG1cMUFd6Qmb3NIfPGIBT1Oh7lcJDLfxErojKY 76RjormeVUolPwLJIVKK1t5BpV4rqnKMQC4u6XJwYt1KMI7Ep5a8M94DKr0XO3ltB+N12m 3RePg1xdjEaRt8qyOKPhtT2SX8KB+KCKkDEx6ytQpNrB/iCKN7AICsj5es+35dC74fxsxw YUAp/OFQ6y0I8tVMtgZPrzMF9vUcmyxMGbAn0ICQp5C2XvnG2AJ2Zbk4v9rvB5VpYAweXV 9uPV+mwD6je69EeOoSYs/dRvoMr09Pyd76jGQzmLizDfESJ/lwj+p68XFw2QGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8wsh41Ymz1CvS; Sat, 08 Mar 2025 08:14: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 5288E0wc097769; Sat, 8 Mar 2025 08:14:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5288E0Wq097766; Sat, 8 Mar 2025 08:14:00 GMT (envelope-from git) Date: Sat, 8 Mar 2025 08:14:00 GMT Message-Id: <202503080814.5288E0Wq097766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0ce82e9346a4 - stable/14 - umtx: Fix a bug in do_lock_pp() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0ce82e9346a4d5ad1d82fac73131afa3a4fc03ac Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0ce82e9346a4d5ad1d82fac73131afa3a4fc03ac commit 0ce82e9346a4d5ad1d82fac73131afa3a4fc03ac Author: Mark Johnston AuthorDate: 2025-02-22 01:23:31 +0000 Commit: Mark Johnston CommitDate: 2025-03-08 00:37:37 +0000 umtx: Fix a bug in do_lock_pp() If the lock is unowned (i.e., owner == UMUTEX_CONTESTED), we might get a spurious failure, and in that case we need to retry the loop. Otherwise, the calling thread can end up sleeping forever. The same problem exists in do_set_ceiling(), which open-codes do_lock_pp(), so fix it there too. Reviewed by: olce Reported by: Daniel King MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D49031 (cherry picked from commit 4b79443927ec2c53514e73b06eb2a9d241882585) --- sys/kern/kern_umtx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index f326b9aa691a..7c01586b4dd7 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2618,6 +2618,10 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, } } else if (owner == UMUTEX_RB_NOTRECOV) { error = ENOTRECOVERABLE; + } else if (owner == UMUTEX_CONTESTED) { + /* Spurious failure, retry. */ + umtxq_unbusy_unlocked(&uq->uq_key); + continue; } if (try != 0) @@ -2824,6 +2828,10 @@ do_set_ceiling(struct thread *td, struct umutex *m, uint32_t ceiling, } else if (owner == UMUTEX_RB_NOTRECOV) { error = ENOTRECOVERABLE; break; + } else if (owner == UMUTEX_CONTESTED) { + /* Spurious failure, retry. */ + umtxq_unbusy_unlocked(&uq->uq_key); + continue; } /* From nobody Sat Mar 8 15:34:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z96dP1Ym2z5pM4r; Sat, 08 Mar 2025 15:34: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 4Z96dP05Qwz3MkN; Sat, 08 Mar 2025 15:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741448041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWffmzFSBv7BcZqACUIFBRA8rlrRWg3h/IRDtQeTBcc=; b=NjS+RZOcmoO2qFEqOn51sduNGbeM8s9sMF7NTqZtkq0sdFUc3mkz8lHP4svfxTdOujtuDv iZ38Qq+VU3jc0v6kxGSxZrHPnCjceOYDDcsQl2/DXBvmO4lGmS6F2NLOFKAI7Zotr8iYzy 2UitU3604OrAMSSzmp3GWQd97XbOF7XqyNBS3X1O4BdLmsTcDIooi+zPAjOJAR+58Uw1oO 9ZT7ynicONUrnmPaoZMzKfqECh3CPEhpRbRHKTBBW1ASY97zBnOab8+jJZGt4vCgSLv73Q LwM5owPD5+Y6MtBkveaY7Qzg267mKwNxojpBWClX24hKwxXizkIAEz5Ow4ikog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741448041; a=rsa-sha256; cv=none; b=UW4XnSA8dr9cVp2X1J28PztK0wFVX7EWcCgv1KdeenD5jPGwP8r9EHojrcbnPunWVbPFJc OxNq9o8PG/nJflhnOQqr5KQB4p3MFp4kN0JH/+7iCV5NrZyUB4whl1vRvvZdFIjVQP5YnX TcyHwKn9SE6ew+3kZOo7vk0a2FS0BLah/3Mt1/z4+Y848DQWXHxiwXP4qy2l1PoLdLswdt zPBnF5WWKDLrEMA4vUtQQyf0WdgGriajL6n0hscKZ2sbsN91YAbsoSdEUTEXRlxGJeyb/e jmR5HcEY1RS8i4WiYKAYRe3BPtQdHinUVJ0od/npomS8UfOJJ1wO6AB/T0z4Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741448041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWffmzFSBv7BcZqACUIFBRA8rlrRWg3h/IRDtQeTBcc=; b=fz6D23b0cPCMLlXz5SScMhcZV36SOfJ+xybCBFNbl9GGJMw1LuhRlW0r8jvKJHC0+6tsuC eLbS5CbkYA60gYsMsrtr7mnpoiOzQkra9BKnDpAMLo3rch2nFajnkGpd8veCBws0RxaVh2 Ii73Af3VETH62jtaose5N5VbhdotZuxwQdTFNdmsjI3lksHzdcVrCxOabo+pkGZrAsj2Q1 guBw0U9U3CudGCqr9Nr0cBD57SGNytlLh4mkd7FJCI5h2deVMtPxLtqy6Y8UrpIG9K9Vtu DRR3WoU42/qnsZ6Iil/EKHMccrA5iHCn2n+Zq80XtKPSI+I2cdCYmgY15yqvtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z96dN652lzD29; Sat, 08 Mar 2025 15:34: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 528FY07W021946; Sat, 8 Mar 2025 15:34:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 528FY0MZ021943; Sat, 8 Mar 2025 15:34:00 GMT (envelope-from git) Date: Sat, 8 Mar 2025 15:34:00 GMT Message-Id: <202503081534.528FY0MZ021943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Osipov Subject: git: 457c03b397c8 - main - caroot: Ignore soft distrust of server CA certificates after 398 days List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 457c03b397c80d44da92684d417a58b3ca1fed02 Auto-Submitted: auto-generated The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=457c03b397c80d44da92684d417a58b3ca1fed02 commit 457c03b397c80d44da92684d417a58b3ca1fed02 Author: Michael Osipov AuthorDate: 2025-02-20 09:48:48 +0000 Commit: Michael Osipov CommitDate: 2025-03-08 15:33:44 +0000 caroot: Ignore soft distrust of server CA certificates after 398 days Mozilla introduced the field CKA_NSS_SERVER_DISTRUST_AFTER which indicates that a CA certificate will be distrusted in the future before its NotAfter time. This means that the CA stops issuing new certificates, but previous ones are still valid, but at most for 398 days after the distrust date. See also: * https://bugzilla.mozilla.org/show_bug.cgi?id=1465613 * https://github.com/Lukasa/mkcert/issues/19 * https://gitlab.alpinelinux.org/alpine/ca-certificates/-/merge_requests/16 * https://github.com/curl/curl/commit/448df98d9280b3290ecf63e5fc9452d487f41a7c Tested by: michaelo Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49075 --- secure/caroot/MAca-bundle.pl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/secure/caroot/MAca-bundle.pl b/secure/caroot/MAca-bundle.pl index 4feced90d782..58cfe1cbf6fa 100755 --- a/secure/caroot/MAca-bundle.pl +++ b/secure/caroot/MAca-bundle.pl @@ -37,6 +37,8 @@ use strict; use Carp; use MIME::Base64; use Getopt::Long; +use Time::Local qw( timegm_posix ); +use POSIX qw( strftime ); my $generated = '@' . 'generated'; my $inputfh = *STDIN; @@ -101,13 +103,6 @@ EOH } } -# returns a string like YYMMDDhhmmssZ of current time in GMT zone -sub timenow() -{ - my ($sec,$min,$hour,$mday,$mon,$year,undef,undef,undef) = gmtime(time); - return sprintf "%02d%02d%02d%02d%02d%02dZ", $year-100, $mon+1, $mday, $hour, $min, $sec; -} - sub printcert($$$) { my ($fh, $label, $certdata) = @_; @@ -162,10 +157,15 @@ sub grabcert($) if (/^CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL/) { my $distrust_after = graboct($ifh); - my $time_now = timenow(); - if ($time_now >= $distrust_after) { $distrust = 1; } + my ($year, $mon, $mday, $hour, $min, $sec) = unpack "A2A2A2A2A2A2", $distrust_after; + $distrust_after = timegm_posix( $sec, $min, $hour, $mday, $mon - 1, $year + 100); + my $time_now = time; + # When a CA is distrusted before its NotAfter date, issued certificates + # are valid for a maximum of 398 days after that date. + if ($time_now >= $distrust_after + 398 * 24 * 60 * 60) { $distrust = 1; } if ($debug) { - printf STDERR "line $.: $cka_label ser #%d: distrust after %s, now: %s -> distrust $distrust\n", $serial, $distrust_after, timenow(); + printf STDERR "line $.: $cka_label ser #%d: distrust 398 days after %s, now: %s -> distrust $distrust\n", $serial, + strftime("%FT%TZ", gmtime($distrust_after)), strftime("%FT%TZ", gmtime($time_now)); } if ($distrust) { return undef; From nobody Sat Mar 8 16:08:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z97PV5qX6z5pPWv; Sat, 08 Mar 2025 16:08:46 +0000 (UTC) (envelope-from scf@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 4Z97PV4kbCz3Z6V; Sat, 08 Mar 2025 16:08:46 +0000 (UTC) (envelope-from scf@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741450126; 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=x8SAhEvgad730COPwVyBsHxX8AXPiR+/S0guX+Oeq40=; b=xqfQL/Jc1Y+IqcYCbTvzhGgm6jsiys3rfT25zO471Y7AFS8imPZGb5ZELWRey4eK/yaeVq /uS9ibi8A05L+RowDNpjVBJUUBspnDsMnl3xeFqMf6HVbdfjfa6T77iftHAZm0SApw9drk gPD5hE/60gruPTEaqorGabPJJ3lg2scNZi7k0wY/QzkGSFoRkgL3jo2Zhrjr0yYa3o4j0f LTcLpANF9Ow5z5UqrE4C31VIF3ESbXDj3Iy1JHaf/tnPD3ay0S2l5mfwjDwZiU3+RQ/E0n YHLBtL8ewrEAfWwxJLTtwRk0SCbs96o018LlWSrI1LPnXKFzgmy18WdavOQ99A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741450126; a=rsa-sha256; cv=none; b=R84o3tnBxGC5rQqI5UwPpTJq+2kguMikdOj8S4uZOJH10wyvi3nY96IsaW8fZjI/fwMmgA L9deSr/GYL0Kq3mqk7ufTb/jHmMnJviRFjkE+vJBqZmGCddnJiJ7lICS5DMjoSb1g5IEkX XHplDceO3o+I8e1rGs/buvfPlJnMu5iOI588XlzQjek1tV2EoSx6i6FrwSpxniyAgALnPi Tsi5/hmVptmIC+5QmdqAx7gBP+DtGmjStTk9CtDPSyRUV2tIVvmfgXWmZpFSBzq4ZOk/OJ XMg2HEQOFlfYshnKsFwqjoS06pydT0/1FFstapUOgz32w1mLZxJMQhNSPq/I8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741450126; 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=x8SAhEvgad730COPwVyBsHxX8AXPiR+/S0guX+Oeq40=; b=ilvhLWbJapbIlbEFpegcl6SbRDIjEGM8IvOpj9d5D2yt6BUYRCtfqiUqXDO4XevDaoN/K2 EtLXGEJKzRzCXlTaxzE02Lxr5LLwuBFqcEFxIY+GNU/sJyk3M5qbnp1+UtcZv299Ri+96g AlSWkFFnl9IXprpD73RvwmVypJX3QsMpDOFS7dDkfmdM3xjrkM7W5m5eaQb5I3ZUv2tU8f kGJA6Ef3Dro+n3kAyuYfC5UnCOHjH4LgSzsYGlwe6mTQu6p+pCsVt0C/vxNLtHiTyZNg4K G5uSgmO4JRvc3I6cGpOZ+3wcPrSD4r6lEIA25HU/0gg82+0VUe+teFY8MlmJpQ== Received: from farley.org (farley.org [104.129.130.189]) (using TLSv1.3 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 "mail.farley.org", Issuer "Farley.org Intermediate CA" (not verified)) (Authenticated sender: scf/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z97PV31J4z14jX; Sat, 08 Mar 2025 16:08:46 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (thor.farley.org [192.168.1.5]) by farley.org (8.18.1/8.18.1) with ESMTPS id 528G8i7Z015056 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 8 Mar 2025 11:08:44 -0500 (EST) (envelope-from scf@FreeBSD.org) Date: Sat, 8 Mar 2025 11:08:44 -0500 (EST) From: "Sean C. Farley" To: Jose Luis Duran cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 49a4838a0d94 - main - vmm: Emulate testb imm8,r/m8 In-Reply-To: <202503041353.524DrqPO041652@gitrepo.freebsd.org> Message-ID: References: <202503041353.524DrqPO041652@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on mail.farley.org On Tue, 4 Mar 2025, Jose Luis Duran wrote: > The branch main has been updated by jlduran: > > URL: https://cgit.FreeBSD.org/src/commit/?id=49a4838a0d94e145a826abf02aa03ff444e614e3 > > commit 49a4838a0d94e145a826abf02aa03ff444e614e3 > Author: Jose Luis Duran > AuthorDate: 2025-03-04 13:51:47 +0000 > Commit: Jose Luis Duran > CommitDate: 2025-03-04 13:51:47 +0000 > > vmm: Emulate testb imm8,r/m8 > > Add support for "testb imm8,r/m8" emulation. > > PR: 261940 > PR: 282852 > Reviewed by: markj, emaste > Approved by: emaste (mentor) > Obtained from: Illumos (https://www.illumos.org/issues/14483) > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D49208 Thank you! Sean -- scf@FreeBSD.org From nobody Sat Mar 8 16:13:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z97W94036z5pQ1l; Sat, 08 Mar 2025 16:13: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 4Z97W93Hfsz3bHL; Sat, 08 Mar 2025 16:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741450421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PZYfD2ZNhCgstJH+MkYww5TX3PhSTk4JIUTlawdug4k=; b=fLOm5LVqGdG0QXp+tgP0zZEaMs1c4AQzAJe53Hi/ZV/aq8XM53LIOloXax9fG1RcF3uAaR VmHbDFZRjUDUmglLt1DmaMLv6NtGta/MldQrf+tsmS9BnnhRc1ntq2Ob/SfX9GmZgLfASO uNDQ9zaz4ic4a8xgTv5TGVLSWuMRq/1rz+c90xoMjqxXSlg+NtxfVwMy9T2gq7BNO6zNjU U8hhPcEIylkTXbwwTogsTw47iEJJ/l6srWiDUC9F4rlZ+0ZiEd1CRRJuD2YN5VUTLD6NE5 j/wz6Zm2tAgaeR0uUBQUDiluD+llVeEQgFnGpNntrBc0sI0GD1jr8M6I4SoakQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741450421; a=rsa-sha256; cv=none; b=ZAxYjdKNPsou28XOLUZoDoNzlAaths3APzKRScJVgitz2Uahbk6lfMNIZ+IF3n2e1oVvVd C4P0bxlwmtW9RR8eVV1TggYhEEfEuqjTEL3rce5f/0MbEuTPmIIaGul45iYt3y2tXMbT44 YjwOGdRuBTEaLAES6TZkgpVS9esdoJp9qehrwGVq9pwm1FDskkOwspX1uxH9XEbjUo886z 3s3VcEG821aEZp0E2CsLy02J2tryoJ2payjPS1bqr1t90AE5+XYeji7s/U44nt1UKgKbaC CczbF4Ok7QaHAVll+iVsEfjWhmKKKQ94g4Z0jeKkOUOoJVI0Idtyz7V2oT9EFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741450421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PZYfD2ZNhCgstJH+MkYww5TX3PhSTk4JIUTlawdug4k=; b=Z2dqlagCdynSMfvkuN5ab0TjgM702LZLugZw27USgJ0TIRP+9YbW9vt+k4RnljlHJtWdtT DvlYTn/hdUA9KFbBqSYcGPdojB8sjEmsn8GKy1lq9Mb2aKT87INbYIwJfY392ITVQdWVm/ j5tDYfd29Xob0CtFqRBt/Ec4/gHaXomzfykTXc0eIrRlNaq75t9HRGM7zGVdsI61E7m9nU JwJKQGuLxDxSyOP0YLuYGcymoVRc5YNDPGgKs5hR/bVU9BbkeSG29A5SCUu9c+UNQ8pXiE 5rKXSJAQxZfYpQzlq/WxPZcAVS9RNcq6ZIADtwrGSo7xEbUIZLSDsPboPcEpTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z97W92t5XzVfL; Sat, 08 Mar 2025 16:13: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 528GDfYX096824; Sat, 8 Mar 2025 16:13:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 528GDffo096820; Sat, 8 Mar 2025 16:13:41 GMT (envelope-from git) Date: Sat, 8 Mar 2025 16:13:41 GMT Message-Id: <202503081613.528GDffo096820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Osipov Subject: git: 7bd8da72c581 - main - sh(1): Replace recommendation of use of -e with a note List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bd8da72c5814b486ae7f492286fe3ac0a5bf03d Auto-Submitted: auto-generated The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=7bd8da72c5814b486ae7f492286fe3ac0a5bf03d commit 7bd8da72c5814b486ae7f492286fe3ac0a5bf03d Author: Michael Osipov AuthorDate: 2024-05-03 07:57:06 +0000 Commit: Michael Osipov CommitDate: 2025-03-08 16:13:25 +0000 sh(1): Replace recommendation of use of -e with a note This partially reverts b14cfdf665bb8b7b2898a4ee5b073ab87f8ea3d0 and has been discussed in D42719. Reviewed by: jrm (mentor), otis (mentor), mandree, ziaee (manpages) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45073 --- bin/sh/sh.1 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 768193905c49..5458f5f6f37c 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 27, 2025 +.Dd March 8, 2025 .Dt SH 1 .Os .Sh NAME @@ -238,11 +238,9 @@ If a shell function is executed and its exit status is explicitly tested, all commands of the function are considered to be tested as well. .Pp -It is recommended to check for failures explicitly -instead of relying on -.Fl e -because it tends to behave in unexpected ways, -particularly in larger scripts. +Note that many commands return non-zero values to convey information other +than errors, which can cause unexpected program termination with +.Fl e . .It Fl f Li noglob Disable pathname expansion. .It Fl h Li trackall From nobody Sat Mar 8 17:05:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z98gM0Zntz5pT2t; Sat, 08 Mar 2025 17:05:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z98gK6FC0z3wrc; Sat, 08 Mar 2025 17:05:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741453549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BZ3gWjpqZdJYi6wCBylpNkobE3PgGwLv6UTQFRA0Hb8=; b=tudnIpQarDgl150HOkx3FyauSkfekOVQadFdp2FsGJKgjweAAJbynNotGvuK38H4n+nntk 0bdUXCR7IYMpTK6YXqOS0VzQwezfiRwynmIy2XOv5wYUWas25UhW+WI5SxFU/T+r6+2awV i89Oa6sZKgPIeLI/MgE/pAaRFZFjEPJQVCoF7+OJH1MaHlYSJDIkkNmFlszWrgyeApq8o5 IxuOxP6FWjINQAg18RlX8LkiW+LljQ5F9o/c5qSBQlp+qunodNDov/AX6x2LyLkI3vINe1 VNFK6UmBhidt191ApC/tu5pCK+JS6t4I+x2EkgQlPkPexWqYaVb1WJ+iIRRrfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741453549; a=rsa-sha256; cv=none; b=tvrwwW8daxTzM2ssFyw3gKBlyyUo5g+ZqFEwiQPvkMoMeGAauSqS+mc6iM30CUE0h5nYHo fq7iJylya3psLMh9Gfx0TlSj1DMcvsM9uLQnMV6Hp1R7UJkiYczY2cEcCaWXp47+TJROV1 ///wwnYbk+IxX01v/1WA+0YARNpw4j09zGopOoRv8tDg/az1dqpjvfsuQWhhtAW3QRvhnV GwF5RzvNl2Iz7yHRiNbFAIJu9JdHHVVTbU4rP3uyy6jJBkKOv9IauFa3TB8hiM+bnIyGJq rTUbFJVluJ/3UX5eWZfOdU9iRmrUuOuyDA2DPxUsBButj1Emcz8wxKIGXOZ6JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741453549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BZ3gWjpqZdJYi6wCBylpNkobE3PgGwLv6UTQFRA0Hb8=; b=nIpnISiEe0hzQSUbnSC7VwuKOFbWPqBJO5B0MSESTy4djHi1/7WHxLlYD9/lTw1T7w4qo7 oxZOpsS6pQiEEwiHom9YsrMFUwU4otVud11X5XszqcLL77ccKHVqbLAHXGJdGDjNamqRcO ++t5DT60RTZTHDjFpF9/y5NCXpbNlWM8USU3CwvZWKUyFYnKAlcTA44Nws2zVlmT9PpjHO DZQ1Qqd2/bVbX1seWAp3SUAehiJH58zCpwIAQvEKXPPhrYOtvOtLyNgRdGs07TgeyoC1wz qKE04sYTYqpqyvuXItT2lyEro2d0dAIiaz3dHACB0vxekz+70zUkPT9ntbhm9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z98gK5qwSzYCQ; Sat, 08 Mar 2025 17:05: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 528H5nU9090639; Sat, 8 Mar 2025 17:05:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 528H5nic090636; Sat, 8 Mar 2025 17:05:49 GMT (envelope-from git) Date: Sat, 8 Mar 2025 17:05:49 GMT Message-Id: <202503081705.528H5nic090636@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: 9dc4bcb1a63a - main - build(7): Document KERNBUILDDIR List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9dc4bcb1a63acbbe32b4e80b690a843dd37315e7 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9dc4bcb1a63acbbe32b4e80b690a843dd37315e7 commit 9dc4bcb1a63acbbe32b4e80b690a843dd37315e7 Author: Warner Losh AuthorDate: 2025-03-08 01:32:58 +0000 Commit: Warner Losh CommitDate: 2025-03-08 16:59:03 +0000 build(7): Document KERNBUILDDIR KERNBUILDDIR is used by kmod.mk to find the opt_*.h when matching a kernel to the module. Usually one doesn't need this nob (since most modules are option invariant or default to the default options everyone uses), but there are times this generalization doesn't hold. Sponsored by: Netflix --- share/man/man7/build.7 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 1df9b084726f..2195d1147820 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 3, 2025 +.Dd March 8, 2025 .Dt BUILD 7 .Os .Sh NAME @@ -554,6 +554,13 @@ Overrides which kernel to build and install for the various kernel make targets. It defaults to .Cm GENERIC . +.It Va KERNBUILDDIR +Overrides the default directory to get all the opt_*.h files for +building a kernel module. +Useful for stand-alone modules that depend on +.Xr config 8 +options. +Automatically set for modules built with a kernel. .It Va KERNCONFDIR Overrides the directory in which .Va KERNCONF From nobody Sat Mar 8 18:35:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9BfJ59Nwz5pZcK; Sat, 08 Mar 2025 18:35: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 4Z9BfJ4V3xz3b3G; Sat, 08 Mar 2025 18:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741458904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9csCkMeq7nylboaScGbWVpjS5SWvTCYZ89tIodoj5I0=; b=R82Jfe0ZxBgFXa1P397397nnwhdm3WPuS9XumsAiuHSjdUKUwI1eQU/hkxw7Bphc7+qSxF CbMh2zsQsQq08TV6XQqDJDUldf22e9Ig+nlTkGG4ONsPzrSODQ+3FusNBc1WkftbSFxhTP tOd9dYW9/m1XnuhmJ88X049ofr/L25i0eU0hTjhjpLH4I0LyitaemPWamIJ0WYon1XrQNv WLgOZASjYYPLnXKhPgXp+RigeFwHQwQ8fspjvPWer3jttd/AoH6v7wUt03K+m8Rg/HqUU8 joXv3jG/P8guENazreyQej8jG6rIOkOc0Pdrb4bQrkvhdBuXAOMOCAoENBtAxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741458904; a=rsa-sha256; cv=none; b=PsR5aizLfWMg/6e9qbJSxYAiOE7eGWjZeWv14rg7L2xtGifxwMKvdFBp67DvIf2+w49/lK dr2t5nAJlDNSDSyIpQly+niTDuMGB5xyn832F69/Qdn8kH/GGrlnEOHOwpGR/RTa+ruF/c K6lerVEkHCxva5IoMSn/tC2dexWLa1q6Hbl7fhisW084tuwKUM8s4Oh34q2xyOcm8T++/S GuB86e2ekmdyC9cJ5JvAzA/PIdb4RcVhb8O/+SkAVZZIiityD1UXfHrNN7ALz7+FQ3ylxh maqXaspV87ud+B4lF+cNFGoDYIja9JbiDENBxrteejKMDmdS2+bJRMNjDulvTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741458904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9csCkMeq7nylboaScGbWVpjS5SWvTCYZ89tIodoj5I0=; b=j12z/Xe5vwzTgiHTfAgBdvTH7hAMPdyhdwskvpJQTLcu0nCFN9DPXv3/lZbz0LJ8iJ60qt /ovEx76Mn9Wyvpw6XWuoJP1Cw3n33yrcqkteDy7baraWcLmfepnpzp0jcsSfdyEv3wxiGp QS1fAZV7foTxwLUXQFbQu2BnHmALnW6HLvKI12YTM+MsnOvn01qxtiHsq3rUAJY+6lVT0L VsTzScnC/OYwyreQ4EPa9mojX408nZ1cmqFInJHHXVHsRvVOxsltHv8XcPCOWfOybI+5k2 zpFf4I1yrcr0JyUqMm2FdAdoR+aalVQPOyGRs9wzzkKoU2iZm51y2yJm8W+X4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9BfJ45FZzbYC; Sat, 08 Mar 2025 18:35: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 528IZ4D1058262; Sat, 8 Mar 2025 18:35:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 528IZ4aE058259; Sat, 8 Mar 2025 18:35:04 GMT (envelope-from git) Date: Sat, 8 Mar 2025 18:35:04 GMT Message-Id: <202503081835.528IZ4aE058259@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: 1016b3c34435 - main - cam: Update scsi_all.h to reflect 30 years of evolution List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1016b3c344350fa5968f16852e5e4e388c51d817 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1016b3c344350fa5968f16852e5e4e388c51d817 commit 1016b3c344350fa5968f16852e5e4e388c51d817 Author: Warner Losh AuthorDate: 2025-03-08 18:28:50 +0000 Commit: Warner Losh CommitDate: 2025-03-08 18:28:50 +0000 cam: Update scsi_all.h to reflect 30 years of evolution scsi_all.h started out life as a work by Julian Elischer to add SCSI support to CMU Mach 2.5. It was 373 lines. Julian ported this to 386BSD, included in the 386BSD patch kit and incorported into FreeBSD at its creation. Justin used this file when writing CAM, and imported it with the initial CAM import, but only 30% (100 lines) of the original remained. Justin moved from bitfields to bytes in structures, dropped the complex unions, and renamed many structures to have their length appended. Only about 30 structure names and about 40 #defines remained from the original. The define names were taken directly from the SCSI standard with spaces replaced by '_', so had no creativity. Apart from the license comment, there were no comments retained (all the comments in the CAM import were written by Justin and Ken). Even at that time, Justin and Ken could have put their copyrights and names and moved to an acknowledgement of Julian. In the almost 30 years since that original import, this file has grown to 4500 lines. Kenneth Merry, Alexander Motin and Justin Gibbs write 85% of the file's lines, if mechanical commits are omitted. Other contributors contributed less than %5 each of the file. Replace the original license (which lacked a copyright even and has been criticized as ambiguous) with FreeBSD's standard 2-clause license. Add copyrights for Justin, Ken and Alexander, with the date ranges they contributed to the file. Add a note about the origin of the file to acknowledge Julian's original work upon which all this was built, though it's become a ship of Theseus in the mean time, built and rebuild many times. On an absolute scale, there's less than 1% of the current file with lines from the original, and those are named after the names in the SCSI standards and likely wouldn't qualify for copyright protection. Sponsored by: Netflix Reviewed by: mav, ken Differential Revision: https://reviews.freebsd.org/D49016 --- sys/cam/scsi/scsi_all.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index 7456998a4f88..4feaee081e55 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -1,18 +1,12 @@ -/*- - * Largely written by Julian Elischer (julian@tfs.com) - * for TRW Financial Systems. - * - * TRW Financial Systems, in accordance with their agreement with Carnegie - * Mellon University, makes this software available to CMU to distribute - * or use in any manner that they see fit as long as this message is kept with - * the software. For this reason TFS also grants any other persons or - * organisations permission to use or modify this software. +/* + * Copyright (c) 1997-2017 Kenneth D. Merry + * Copyright (c) 2012-2020 Alexander Motin + * Copyright (c) 1997-2011 Justin T. Gibbs * - * TFS supplies this software to be publicly redistributed - * on the understanding that TFS is not responsible for the correct - * functioning of this software in any circumstances. + * SPDX-License-Identifier: BSD-2-Clause * - * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * Original scsi_all.h from 386BSD was by Julian Elischer at TRW Financial + * Services has been transformed into a new work by subsequent contribtuors. */ /* From nobody Sun Mar 9 00:23:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9LMq1Qt8z5qDcr; Sun, 09 Mar 2025 00:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z9LMq0y4Rz49hK; Sun, 09 Mar 2025 00:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741479783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IW7/7pjiRpUCYXj9mNbAYMvCimxpF6rkZBy/CdjfdGE=; b=qqPgPYIRJva5VYg0H0K5KX2zCfFSmUFZj/gBmPh/8l2F6/cE4Sif/9pcYM7gbkCVJ1Dbq3 d41f5ReoyaeHTyxIDlhd8xGZ7ldM7QDNGA/VKWXoX1OWKoovj4UuxRietmwz+LQYDJ3LCq y11FZMBVGqllwJkufEgGaw35HkE3B005nfIBjjepk05InyBXDsDqcrXmrRKPu2Gy/nM28O xJV2Ef6OnFf9yrtpKF4ygz1WdGLskNE4owu5GFeztQjK/pWYbOsWc3HIP5hzsPMuJXtY96 jb4iXPdBNn581LFGEW5kQrOq4Av6Kg5laXD+wmSwrxYUWdIAXbuwxE9m9mh6QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741479783; a=rsa-sha256; cv=none; b=xkFzSqn1Ii8US9yZPhPHLrQwaYrmhXiPoVsTLa9rXyDwIk1EJhOcXAW9PQFE/yiZrl1tyB P8gb7koU/s2F/0XkR36FXIiH2muE6wVNf29bjA9v2ZSVvNVHJN44xYjZxdbi5ADo3gFMGl HjUyT8vTIPQYVh3aKFuILUd1eaErB+CMh3ik5VmyY34gLp87ph8+YB1JvQmeRFGa9TYKVM JbJw9D2J4vJMez5ekzDB1YYA+QrB3jVP+yHmLbSoGRDS6GL3aTQBOwG5t0Zm8bB7WliJCq H4pW0AsIE7dI3ToHy1qXwiFiiWhWk/dt42MSjTtTWwgd+qMIUpyepgVUE700zQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741479783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IW7/7pjiRpUCYXj9mNbAYMvCimxpF6rkZBy/CdjfdGE=; b=Ue7kqAHxcQW/NJz/BK9jIn8cuMKcQbbfJeejG8n4RkvRVnWk5J/0l2Y8gQnHRG+IhFDs5V xAoSXrCQGulXZuFzMScnrNsQ37vivS3BLeAvaspZm7s6vOh323VHcVhqzs5OnWfHRz09eV uxUALTDz2/4XWpBCzxS+1ku4YcVR+3iNfwucGl50WZp+XWKA+aAf6Dk2XXdjnIk7ZpUE9C lVcnpy4FxtusrqRhbe9RhlCq3MrReJryx3BanyfcxZEkOQ+DJWo3ZvPdBS/pwKUe/hfNlb BXXRQf1pmt7HFUcBNSzVf0Dtz/geNOsARoUGEkk16vKN7EJQcHaJonBRNM8+3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9LMp6zmszmmp; Sun, 09 Mar 2025 00:23: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 5290N2H7009687; Sun, 9 Mar 2025 00:23:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5290N2G7009684; Sun, 9 Mar 2025 00:23:02 GMT (envelope-from git) Date: Sun, 9 Mar 2025 00:23:02 GMT Message-Id: <202503090023.5290N2G7009684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 21c2ba96815c - stable/14 - amdiommu: add register definitions from IOMMU spec 48882 rev. 3.10 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 21c2ba96815cb01d6aaa8f47e267b547bbf46dbf Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21c2ba96815cb01d6aaa8f47e267b547bbf46dbf commit 21c2ba96815cb01d6aaa8f47e267b547bbf46dbf Author: Konstantin Belousov AuthorDate: 2025-03-02 01:23:41 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-09 00:22:41 +0000 amdiommu: add register definitions from IOMMU spec 48882 rev. 3.10 (cherry picked from commit 43fa7b907e9cc5ce365afd05775349d199fc2eb4) --- sys/x86/iommu/amd_reg.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/x86/iommu/amd_reg.h b/sys/x86/iommu/amd_reg.h index 37375b3fa7b5..53b8b0cb42fc 100644 --- a/sys/x86/iommu/amd_reg.h +++ b/sys/x86/iommu/amd_reg.h @@ -186,6 +186,9 @@ #define AMDIOMMU_CTRL_MARC_EN 0x0000010000000000ull /* Memory Addr Routing En */ #define AMDIOMMU_CTRL_BLKSTOPMRK_EN 0x0000020000000000ull /* Block StopMark En */ #define AMDIOMMU_CTRL_PPRAUTORESPA_EN 0x0000040000000000ull /* PPR Auto Resp Always En */ +#define AMDIOMMU_CTRL_NUMINTRREMAP_MASK 0x0000180000000000ull /* Remapping MSI mode */ +#define AMDIOMMU_CTRL_NUMINTRREMAP_512 0x0000000000000000ull /* 512 max */ +#define AMDIOMMU_CTRL_NUMINTRREMAP_2048 0x0000080000000000ull /* 2048 max */ #define AMDIOMMU_CTRL_EPH_EN 0x0000200000000000ull /* Enh PPR Handling En */ #define AMDIOMMU_CTRL_HADUP_MASK 0x0000c00000000000ull /* Access and Dirty in host PT */ #define AMDIOMMU_CTRL_GDUP_DIS 0x0001000000000000ull /* Dis Dirty in guest PT */ @@ -256,6 +259,21 @@ #define AMDIOMMU_CMDEVS_PPROVRFLWEB 0x00020000 #define AMDIOMMU_CMDEVS_PPROVRFLWE 0x00040000 +/* + * IOMMU Extended Feature2 register fields. + * All currently defined bits are RO. + */ +#define AMDIOMMU_EFR2_TMPMSUP 0x0000000000000004ull /* Tired Mem Migration */ +#define AMDIOMMU_EFR2_GCR3TRPM 0x0000000000000008ull /* GPA based GCR3 pointer in DTE */ +#define AMDIOMMU_EFR2_GAPPID 0x0000000000000010ull /* masking of GAPIC PPI */ +#define AMDIOMMU_EFR2_SNPAVIC_MASK 0x00000000000000e0ull /* SNP-enabled Adv intr features */ +#define AMDIOMMU_EFR2_SNPAVIC_NO 0x0000000000000000ull /* No features supported */ +#define AMDIOMMU_EFR2_SNPAVIC_REMAPV 0x0000000000000020ull /* Intr remapping with GVAPIC */ +#define AMDIOMMU_EFR2_NUMINTRREMAP_MASK 0x0000000000000300ull /* Number of remapped intr per dev */ +#define AMDIOMMU_EFR2_NUMINTRREMAP_512 0x0000000000000000ull /* 512 */ +#define AMDIOMMU_EFR2_NUMINTRREMAP_2048 0x0000000000000100ull /* 2048 */ +#define AMDIOMMU_EFR2_HTRANGEIGN 0x0000000000000800ull /* HT range is regular GPA */ + /* * Device Table Entry (DTE) */ From nobody Sun Mar 9 00:23:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9LMr435pz5qDNT; Sun, 09 Mar 2025 00:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z9LMr1Mqfz49Vb; Sun, 09 Mar 2025 00:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741479784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T5MQJjQd01qZ0TXIbGzMZZa1NUFxOiIxETBQylga7uk=; b=oBOJIBo4wTsOp4qVdIw3YiETK46LWqAPtz/bwHXGrKzJHHu1pkLoVsVNPCyYDGrhnWM8R9 n0H14d8Ik6rUqHZPRc0MP4gKZCtNLLm+IDdB83J+vxwS8jQ+6esTsnI69vCWUqcGZCu9R0 tzvuIFSrRNt/fBSSYcAPCkuiAFrV/mOetcuKw06+fb4ARjZmCRDWUK5dmEwjxyZ3D2euxA iVZwvBnLsUprHSC48fA6QD1mZxDKg8PZKTHgF0ZIEgNR96Qqnr+m5sv8PKaJSgdOEzBBw1 oWYz38cn/DqWHXoKalNdVTOeyqu4nIztwVwqF/ONo9cHUdcHGlt5l+LJH9Hb3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741479784; a=rsa-sha256; cv=none; b=evcle2/DIBTQSyADT6u7REXAxyXJtPwL5QOU6NnO9SVZZtJxlFjB8bnVqCPCPpVRoqCJRP aUwWFazF5lyqhVior6O/KcJmyFW6c/StpWG/WNKob0rnJzvS704SY8vjR7mz9cxQh1SU7V +sxNpMq6ecQXyeNXadj5zK8vju2wK/SErIe1kTWBwIxzI/RX06t+6PT1EtAFR/Od1bsY9Z SZZUX2aWGeJlpUUtojlDiZnSwdsjid3WFrKkhqEDyhBs2PyJ/6vMPNVKFU96uELu3HX7zy veBsuoVC6sewqBX8ngiHL5LE5+188ewh2GBQTy98KLu0jty+6jd97kRCxQsvrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741479784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T5MQJjQd01qZ0TXIbGzMZZa1NUFxOiIxETBQylga7uk=; b=nsp9HERQQktgaFUvVTgEm9G4LsjBaLJEMGl6wVWluQSKOjODhQo7mbYu6qAwdsGpV46scf Bgv9nyxphZdeysuzlP/duG3I6JovXeHyPAQ1V+6bMveQcsdQN4JnVCm9ReeQzrEJLK1Nx9 Y1cR26sZ9oTOL1F1I8qB8+DFbTldJuEaJQtdKJasyCc3RhpKz2mazyNPMlLOdwrPd0s7eo ZXIheQ6DfzhI2SOHUSVo6+wHrcHcFEluyorg7TAiuFGJMgATIv5Yms1uWDCvvuUmaQWhPO LTYlj9yJF9QsljCOORNVc8pFUSoRswUiiLFwoKQU8ew6XVcTGhCxIii1Lp/UmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9LMr0r0JzmRw; Sun, 09 Mar 2025 00:23: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 5290N42h009722; Sun, 9 Mar 2025 00:23:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5290N4wl009719; Sun, 9 Mar 2025 00:23:04 GMT (envelope-from git) Date: Sun, 9 Mar 2025 00:23:04 GMT Message-Id: <202503090023.5290N4wl009719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 43dc3a820993 - stable/14 - amdiommu: fix typo in the bit description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 43dc3a820993c41809521ae40f865f8b9c2c2e50 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43dc3a820993c41809521ae40f865f8b9c2c2e50 commit 43dc3a820993c41809521ae40f865f8b9c2c2e50 Author: Konstantin Belousov AuthorDate: 2025-03-03 00:06:30 +0000 Commit: Konstantin Belousov CommitDate: 2025-03-09 00:22:41 +0000 amdiommu: fix typo in the bit description (cherry picked from commit bb9c3f5121b42eeda2972d282a54d4eff800297c) --- sys/x86/iommu/amd_reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/iommu/amd_reg.h b/sys/x86/iommu/amd_reg.h index 53b8b0cb42fc..fab6d03ea64a 100644 --- a/sys/x86/iommu/amd_reg.h +++ b/sys/x86/iommu/amd_reg.h @@ -263,7 +263,7 @@ * IOMMU Extended Feature2 register fields. * All currently defined bits are RO. */ -#define AMDIOMMU_EFR2_TMPMSUP 0x0000000000000004ull /* Tired Mem Migration */ +#define AMDIOMMU_EFR2_TMPMSUP 0x0000000000000004ull /* Tiered Mem Migration */ #define AMDIOMMU_EFR2_GCR3TRPM 0x0000000000000008ull /* GPA based GCR3 pointer in DTE */ #define AMDIOMMU_EFR2_GAPPID 0x0000000000000010ull /* masking of GAPIC PPI */ #define AMDIOMMU_EFR2_SNPAVIC_MASK 0x00000000000000e0ull /* SNP-enabled Adv intr features */ From nobody Sun Mar 9 03:44:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9QrD2SY4z5qQsd; Sun, 09 Mar 2025 03:44: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 4Z9QrD0BdFz3nwv; Sun, 09 Mar 2025 03:44:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741491868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLpvENffPUVEUbzD1Ocq2oHL9Lyl/KsWEkEehqOuT68=; b=SO+jT2mwnJnKQCEcSloV+63eQRRUpNwavmJtRIBk7k+TT6KeG8ubdgQsVnWSE6kF3day0u g0peObUEMOy00guFm1qzrfvOqYzxbrDWOezyHjsZbHZA2PJSlZeUoITuLdhTtxwsGhY9vH 8fLdYOQguqBIIRMqaoTmFLcO/oTPjGUzYEa88Xw3slx1wawCizXPhOKX6ggFzj8G3V8k0/ BKcNxrWGg5fzQ5HOMp2+AQgNtF9U5PeJNoM4UvAb2aLjrG7AUgkEAeVwObsHgtEaVRY/NY inFP54JjRLVjDJ6Trvq3eKHvS20lOngFgJ7te7t7FYR2IOuoPdVVhS7hoX8+NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741491868; a=rsa-sha256; cv=none; b=Io3RAmMYvfYwhC7vihIMox+dGGXZA77GTUzvhhHGsNutkX9BpLrb5+D1EJiQQZujbbOU+0 qXtSrrYsYPohCaVkUUZpimfgzhdo5vfTMKOOxHLvacvexdRSu6c1LZXR44ooJWKcToMycm fBO5Hv8h/qs2fAyNizdqw3waB7uI2RwkTNNE/i1P6o4W7mp4D8nTd/HesJGaSTj5zZZhe1 FQku3F7mhhiq21rmDchvew2Zv1NomPwOBsAmyZrYIf209d46yO7/v7tw8unLphnRsqW0mB T9QI6jyBxCWgSa+RLpkLR3D3RQfz+yhO3ZjtYvxNoVstjo9swxxuedD4pi+iTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741491868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLpvENffPUVEUbzD1Ocq2oHL9Lyl/KsWEkEehqOuT68=; b=UvyunyEj2fuMrT5hmVJfnc5jMMe/MBzFiCCcUhMKyFnq6zt5x37Ry2amyTDb+8N1V38lvx J0Jv/DsCU7GES6dxOOkv+jhrrYdaY9Pg2KG1XkI0Pgm9LX+sE7oAdsodzWLLS3iAKRTeeB jOC42hOpaGT2KFdUplx2JC5b9bx8kL9q2hbPruK6i2FbRXf1H7D//6NDcI6otNHNDxBcJn 6THHDhsfRDhHZOwjm9+ZELIC0tvqR7hJLZX12UReTVubTjr/ifskt4ssUEK3WfuQLJT6Ro /CbNoLBWaDJf3Si0n9SCWHXQzUwT2PUc2oQO3T1tkr5SRzvVtIg5adV5v3pOkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9QrC6NYxzsZ8; Sun, 09 Mar 2025 03:44: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 5293iRpb084793; Sun, 9 Mar 2025 03:44:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5293iR8E084790; Sun, 9 Mar 2025 03:44:27 GMT (envelope-from git) Date: Sun, 9 Mar 2025 03:44:27 GMT Message-Id: <202503090344.5293iR8E084790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 0d6ed98ef318 - stable/14 - MFC jail: add jexec -d, to specify a working directory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0d6ed98ef318eb6b31857387a708f9da6e2fcb1d Auto-Submitted: auto-generated The branch stable/14 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=0d6ed98ef318eb6b31857387a708f9da6e2fcb1d commit 0d6ed98ef318eb6b31857387a708f9da6e2fcb1d Author: Jamie Gritton AuthorDate: 2025-03-05 10:14:47 +0000 Commit: Jamie Gritton CommitDate: 2025-03-09 03:43:51 +0000 MFC jail: add jexec -d, to specify a working directory PR: 283170 Submitted by: DtxdF at disroot.org (cherry picked from commit d56f3b051f6135b4a675fd75ccfcef0310368781) --- usr.sbin/jexec/jexec.8 | 10 ++++++++-- usr.sbin/jexec/jexec.c | 21 ++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/usr.sbin/jexec/jexec.8 b/usr.sbin/jexec/jexec.8 index 431978c4d0ae..afcc1839ef75 100644 --- a/usr.sbin/jexec/jexec.8 +++ b/usr.sbin/jexec/jexec.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 12, 2024 +.Dd March 5, 2025 .Dt JEXEC 8 .Os .Sh NAME @@ -32,6 +32,7 @@ .Sh SYNOPSIS .Nm .Op Fl l +.Op Fl d Ar working-directory .Op Fl u Ar username | Fl U Ar username .Ar jail Op Ar command ... .Sh DESCRIPTION @@ -48,6 +49,9 @@ is not specified then the user's shell is used. .Pp The following options are available: .Bl -tag -width indent +.It Fl d Ar working-directory +The working directory for running commands inside the jail. +The default is the jail root directory. .It Fl l Execute in a clean environment. The environment is discarded except for @@ -59,7 +63,9 @@ If a user is specified (via .Fl u or .Fl U ) , -commands are run from that (possibly jailed) user's directory. +and absent the +.Fl d +option, commands are run from that (possibly jailed) user's directory. .It Fl u Ar username The user name from host environment as whom the .Ar command diff --git a/usr.sbin/jexec/jexec.c b/usr.sbin/jexec/jexec.c index 35fd9c8d20e4..a1e443c5ba04 100644 --- a/usr.sbin/jexec/jexec.c +++ b/usr.sbin/jexec/jexec.c @@ -58,16 +58,22 @@ main(int argc, char *argv[]) { int jid; login_cap_t *lcap = NULL; - int ch, clean, uflag, Uflag; + int ch, clean, dflag, uflag, Uflag; char *cleanenv; const struct passwd *pwd = NULL; const char *username, *shell, *term; + const char *workdir; - ch = clean = uflag = Uflag = 0; + ch = clean = dflag = uflag = Uflag = 0; username = NULL; + workdir = "/"; - while ((ch = getopt(argc, argv, "lnu:U:")) != -1) { + while ((ch = getopt(argc, argv, "d:lnu:U:")) != -1) { switch (ch) { + case 'd': + workdir = optarg; + dflag = 1; + break; case 'l': clean = 1; break; @@ -102,8 +108,8 @@ main(int argc, char *argv[]) errx(1, "%s", jail_errmsg); if (jail_attach(jid) == -1) err(1, "jail_attach(%d)", jid); - if (chdir("/") == -1) - err(1, "chdir(): /"); + if (chdir(workdir) == -1) + err(1, "chdir(): %s", workdir); /* Set up user environment */ if (clean || username != NULL) { @@ -129,7 +135,7 @@ main(int argc, char *argv[]) setenv("HOME", pwd->pw_dir, 1); setenv("SHELL", *pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1); - if (clean && username && chdir(pwd->pw_dir) < 0) + if (clean && username && !dflag && chdir(pwd->pw_dir) < 0) err(1, "chdir: %s", pwd->pw_dir); endpwent(); } @@ -186,6 +192,7 @@ usage(void) { fprintf(stderr, "%s\n", - "usage: jexec [-l] [-u username | -U username] jail [command ...]"); + "usage: jexec [-l] [-d working-directory] [-u username | -U username] jail\n" + " [command ...]"); exit(1); } From nobody Sun Mar 9 09:23:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9ZMf36lDz5pXbT for ; Sun, 09 Mar 2025 09:23: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 4Z9ZMd4YK2z4445; Sun, 09 Mar 2025 09:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741512221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zIyK52KowJhXaBKi6kg/wZLNZ9P3C5mHzYAGZ2wLz3o=; b=peGSeh1J9ONEG4HCNV2hRHxWEgCNDKRqcxIhRs+y3sEdXI7AIiJMVo0Am5Y5lL8jbvmyZR c0TCLvl6dX4RLGECmuW4TuE1NGFdj+tIEucZkCThLql4O058t8NQCYt7uzWMz7uBRWM9s7 TRoyUSVQMg2PoggSjXMURSM+0vVSUj+6I+6ZhW6Q71JbiC6QfRA6dkQd0OAo45Nin2mbxc 5Il/eOCyM4J/IBvtl9su7ktVAThPCD6zyx16kRIrTE615QYbDFOjbWe4caqY4i6CmUSewJ FAYlfhrlMcctlZZ5OAuokfiOcGLQjsWFUkj3BX11zjFTAhZFwqD3JVTuBDeJDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741512221; a=rsa-sha256; cv=none; b=cKfdaqpL1dWeWrRPG9dhujDdXzPjmaRzvwTk6q0X+JPCHdeR5NHsDTci+DWBzt+qKR7e6R Nmhb55CK2WVF2gkfOzdNpuwa/IoRpPdou5dq4lqhly45hTpJKdhY0BpUMzC7l4TV8eFqkp WirAwdpbJjQyrryHofrTMn3eXF1Rq7AuNQe9Lqk8Omm207XFpf4DZZ4m3/+oHdG7+Gfp1R Vxrqc5Hj/ZtRpcr3kRua/Ug9YjUIcPHMkM7kMsoPZpjJZW8eZgdmYXH/v/rXPJ8jVHRanM ofysgrKYRxcpsVgANImtgCaXFhxNOVzTQIM8ehRnUQ5l1NpssDctD9xTzlBc7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741512221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zIyK52KowJhXaBKi6kg/wZLNZ9P3C5mHzYAGZ2wLz3o=; b=AlvztTxtxYXo8KkgpNBHRwc77ouSnbBafFtYRupVx80VqR54fBN3W05jdLZZO95W9YMQCx GIc+1cjezJHJnTf39+QMNXXJIZgABT0n/zX79BqjUyyJ/y36nCqmGa18jrTbazfVIdzQ7i vVm8FYldeJW3tV0pGUhOcSRnb5K2jWaAb3Cb1UrHArgCqfhNW0WQCxEs9wlsSqH6H7cHxT i2DOeCx+ayXJdSLIcvAyHnvIjYuc1ZE+i2/PKHN6BCQ//ylL9ICEcWItPst/ONeZygixp7 cGIsiP6GnxI9+9H9AX1MtvATGXx9w4vrpgN3tKG1A7mGdiFTwRBSBuCFCqYmVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9ZMd2hZbz130l; Sun, 09 Mar 2025 09:23: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 5299Nfs4019515; Sun, 9 Mar 2025 09:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5299NfBx019514; Sun, 9 Mar 2025 09:23:41 GMT (envelope-from git) Date: Sun, 9 Mar 2025 09:23:41 GMT Message-Id: <202503090923.5299NfBx019514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 6a2f7b38442b..fe674998bb2d - vendor/openzfs/master - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: fe674998bb2d0912660d8aa3f2904b70f57497b0 X-Git-Oldrev: 6a2f7b38442b42f4bc9a848f8de10fc792ce8d76 X-Git-Newrev: fe674998bb2d0912660d8aa3f2904b70f57497b0 Auto-Submitted: auto-generated The branch vendor/openzfs/master has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=6a2f7b38442b..fe674998bb2d c43df8bbbfdd vdev_file: unify FreeBSD and Linux implementations (#17046) 682c5f6a0a43 Fix wrong free function in arc_hdr_decrypt ee8803adc238 vdev_file: make FLUSH and TRIM asynchronous ecc44c45cb01 include: move zio_priority_t into zfs.h 523e3adac9c0 suspend_resume_single: clear pool errors on fail d7d2744711a1 Better fill empty metaslabs a5fb5c55be94 spa: fix signature mismatch for spa_boot_init as eventhandler required 701093c44fdf Don't try to get mg of hole vdev in removal ab3db6d15d16 arc: avoid possible deadlock in arc_read ece35e0e669d zpool: allow relative vdev paths 88b0594f93a7 ZTS: ICP encryption tests 7f05fface3a0 gcm_avx_init: zero the ghash state after hashing the IV f65fc98a8c7f Linux 6.13 compat: META (#17098) 4afec534cc91 ZTS: replace all uses of /var/tmp with TEST_BASE_DIR cc9180d338c7 ZTS: zfs-tests: use configured FILEDIR for all temp paths 4581c4fcbe31 ZTS: runfiles: remove explicit outputdir 2c897e06668b ZTS: test-runner: always apply timestamp to outputdir before updating 60031906b48a ZTS: zfs-tests: set TMPDIR to FILEDIR 72c0fde6092d ZTS: make uses of mktemp consistent a44f423b0013 ZTS: replace uses of TMPDIR with mktemp fc460bfbaf5b Add more DDT tests 57f192fcaa4c Add 'zfs-qemu-packages' workflow for RPM building fe674998bb2d Check portable objset MAC even if local is zeroed From nobody Sun Mar 9 11:53:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9dhc4mHXz5qC7c; Sun, 09 Mar 2025 11:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z9dhc4Ql6z3pJM; Sun, 09 Mar 2025 11:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741521216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vG4pabWGcP7LkPfB8ONLCJmRD2YE/cCDFOFZ4yFI2Uc=; b=yovvnIvD1BkRI/qyxHtVJs0UduZZ49pUDg2ebJPtm3pHDAidbsU6h3eYtIlQ7AkEVJWzK6 1WV1DJNjfYf5LTJXrs8kYbjbUK/0SiRTJPDUOl7WueeUNNWkxGmj2090SneyRozjqHTui6 DlHD0giZ55c6o/SFi+ZP1boCARFumzII3YCW/uPMikVMFOFG13ZYBqkJbpmLyjHmoeoTqa uHlUo1d8J1jPFjsB1RQxvG33VTCQx1+XqzMMktMuaA9tsPq/0308V/9Gb0mMHUO0jfbsZL Sm8T4xZ0VrBO7RvZlUMtBvnJLKFD6zEH7W39QodcgG2fsiMJGHSVyt0H6xz9Uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741521216; a=rsa-sha256; cv=none; b=ls/jum/CzADUImqwJTnQdluYScqjU1l0QQ9uWDti5HBof1Y3i7ywd6phHOzFOf4aRxjLhk 3JMjhX+mX5SmxlrqWgdlfH1NVQ/9wis0gRcCPP4vGwrhJ6F2UcdIRaD1K7FFP2Z3fmhbUT CeUSR/TRLKKc35vxj7svmcIQvM//j1H4+eTn9PkFjKsNgwYHWzm4zSq18jeEc5kURCu+oZ M/pYtu9EB1o2yAVFAoaJYRxRE9guduYksEq5kJfj4FLaUFKSch32coEUPjmBiLNPllXLYZ DyQAP15GjzPQNi8eUFx5x3+eaL4BqmWiH5bIDo5PhEsZwyIo7++igXGOht9mEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741521216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vG4pabWGcP7LkPfB8ONLCJmRD2YE/cCDFOFZ4yFI2Uc=; b=EiHBfSK64CDvCdFNqhMusQ2dl77hVazbKT8PAunWkvdOXZPGPyXVGCPtKeXmZ3v+TZT9t+ 6oRhSlHDOGpcZfouvW13UXxP1TIXA0mJQYHNrIGfOdo8bN607DbNyMSJnIMRN2zHX3xUmB 9XiCvRVSfnU8IxqO6xNXJCSlkQctswVbt/LONW5LgnmwYQPBao/guVvqpGBBX2uFgR/L1q pZzKdtKtl9fSCELAVbgjxkP1OlFmCuY8n+niGonevSfLsadn7Xve0IdqMl3H8G/i5VdL1a 9xRHyC+2EqEgNs1r6jpOyKTSZ1CC/MEHlgIkVY71K0VZEkuJ61AjY3vPPrhxxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9dhc41j0z17Ch; Sun, 09 Mar 2025 11:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 529Brabn097378; Sun, 9 Mar 2025 11:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 529BrZm2097371; Sun, 9 Mar 2025 11:53:35 GMT (envelope-from git) Date: Sun, 9 Mar 2025 11:53:35 GMT Message-Id: <202503091153.529BrZm2097371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: d2a8fad35797 - main - zfs: merge openzfs/zfs@fe674998b List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2a8fad3579763bd288260c8c465ab9eb448d465 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=d2a8fad3579763bd288260c8c465ab9eb448d465 commit d2a8fad3579763bd288260c8c465ab9eb448d465 Merge: 1016b3c34435 fe674998bb2d Author: Martin Matuska AuthorDate: 2025-03-09 09:24:49 +0000 Commit: Martin Matuska CommitDate: 2025-03-09 11:52:57 +0000 zfs: merge openzfs/zfs@fe674998b Notable upstream pull request merges: #17042 ece35e0e6 zpool: allow relative vdev paths #17046 c43df8bbb vdev_file: unify FreeBSD and Linux implementations #17064 ee8803adc vdev_file: make FLUSH and TRIM asynchronous #17066 ecc44c45c include: move zio_priority_t into zfs.h #17071 ab3db6d15 arc: avoid possible deadlock in arc_read #17079 682c5f6a0 Fix wrong free function in arc_hdr_decrypt #17080 701093c44 Don't try to get mg of hole vdev in removal #17081 d7d274471 Better fill empty metaslabs #17088 a5fb5c55b spa: fix signature mismatch for spa_boot_init as eventhandler required #17089 7f05fface gcm_avx_init: zero the ghash state after hashing the IV #17122 fe674998b Check portable objset MAC even if local is zeroed Obtained from: OpenZFS OpenZFS commit: fe674998bb2d0912660d8aa3f2904b70f57497b0 sys/conf/files | 2 +- .../openzfs/.github/workflows/checkstyle.yaml | 2 +- .../.github/workflows/scripts/qemu-2-start.sh | 9 + .../.github/workflows/scripts/qemu-3-deps-vm.sh | 232 + .../.github/workflows/scripts/qemu-3-deps.sh | 238 +- .../.github/workflows/scripts/qemu-4-build-vm.sh | 370 + .../.github/workflows/scripts/qemu-4-build.sh | 150 +- .../.github/workflows/scripts/qemu-5-setup.sh | 4 +- .../.github/workflows/scripts/qemu-7-prepare.sh | 5 +- .../workflows/scripts/qemu-prepare-for-build.sh | 8 + .../.github/workflows/scripts/qemu-test-repo-vm.sh | 90 + .../.github/workflows/scripts/qemu-wait-for-vm.sh | 10 + .../scripts/replace-dupes-with-symlinks.sh | 32 + .../.github/workflows/zfs-qemu-packages.yml | 140 + sys/contrib/openzfs/.github/workflows/zfs-qemu.yml | 31 +- sys/contrib/openzfs/.github/workflows/zloop.yml | 2 +- sys/contrib/openzfs/META | 2 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 6 +- sys/contrib/openzfs/include/Makefile.am | 1 - sys/contrib/openzfs/include/sys/dmu.h | 1 - sys/contrib/openzfs/include/sys/fs/zfs.h | 23 +- sys/contrib/openzfs/include/sys/spa.h | 2 +- sys/contrib/openzfs/include/sys/zio.h | 4 +- sys/contrib/openzfs/include/sys/zio_priority.h | 47 - sys/contrib/openzfs/lib/libzpool/Makefile.am | 2 +- .../openzfs/lib/libzutil/zutil_device_path.c | 15 + sys/contrib/openzfs/module/Kbuild.in | 2 +- sys/contrib/openzfs/module/Makefile.bsd | 2 +- sys/contrib/openzfs/module/icp/algs/modes/gcm.c | 3 +- .../openzfs/module/os/freebsd/zfs/vdev_file.c | 342 - sys/contrib/openzfs/module/zfs/arc.c | 28 +- sys/contrib/openzfs/module/zfs/dsl_crypt.c | 7 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 2 +- sys/contrib/openzfs/module/zfs/metaslab.c | 9 + sys/contrib/openzfs/module/zfs/spa.c | 2 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 3 +- .../openzfs/module/{os/linux => }/zfs/vdev_file.c | 99 +- sys/contrib/openzfs/module/zfs/vdev_removal.c | 4 +- sys/contrib/openzfs/module/zfs/zio.c | 19 +- sys/contrib/openzfs/scripts/convert_wycheproof.pl | 235 + sys/contrib/openzfs/scripts/zfs-tests.sh | 16 +- sys/contrib/openzfs/tests/runfiles/bclone.run | 1 - sys/contrib/openzfs/tests/runfiles/common.run | 12 +- sys/contrib/openzfs/tests/runfiles/freebsd.run | 1 - sys/contrib/openzfs/tests/runfiles/linux.run | 1 - sys/contrib/openzfs/tests/runfiles/longevity.run | 1 - .../openzfs/tests/runfiles/perf-regression.run | 1 - sys/contrib/openzfs/tests/runfiles/sanity.run | 1 - sys/contrib/openzfs/tests/runfiles/sunos.run | 1 - .../tests/test-runner/bin/test-runner.py.in | 27 +- sys/contrib/openzfs/tests/zfs-tests/cmd/.gitignore | 1 + .../openzfs/tests/zfs-tests/cmd/Makefile.am | 5 + .../openzfs/tests/zfs-tests/cmd/crypto_test.c | 1246 +++ .../openzfs/tests/zfs-tests/include/commands.cfg | 1 + .../openzfs/tests/zfs-tests/include/default.cfg.in | 2 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 8 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 12 +- .../tests/functional/acl/off/posixmode.ksh | 2 +- .../tests/functional/arc/dbufstats_001_pos.ksh | 4 +- .../tests/functional/arc/dbufstats_002_pos.ksh | 2 +- .../functional/block_cloning/block_cloning.kshlib | 10 +- .../cli_root/zfs_mount/zfs_mount_test_race.ksh | 12 +- .../cli_root/zfs_send/zfs_send_007_pos.ksh | 4 +- .../zpool_import/zpool_import_rename_001_pos.ksh | 2 +- .../zpool_iostat/zpool_iostat_-c_homedir.ksh | 4 +- .../zpool_status/zpool_status_-c_homedir.ksh | 4 +- .../tests/zfs-tests/tests/functional/crypto/README | 7 + .../tests/functional/crypto/aes_ccm_test.json | 8602 ++++++++++++++++++++ .../tests/functional/crypto/aes_ccm_test.txt | 6074 ++++++++++++++ .../tests/functional/crypto/aes_gcm_test.json | 4839 +++++++++++ .../tests/functional/crypto/aes_gcm_test.txt | 3478 ++++++++ .../tests/functional/crypto/icp_aes_ccm.ksh | 27 + .../tests/functional/crypto/icp_aes_gcm.ksh | 27 + .../tests/functional/dedup/dedup_prune.ksh | 96 + .../tests/functional/dedup/dedup_zap_shrink.ksh | 82 + .../functional/fault/suspend_resume_single.ksh | 5 +- .../functional/redacted_send/redacted_panic.ksh | 2 +- .../functional/removal/removal_check_space.ksh | 14 +- .../removal/removal_multiple_indirection.ksh | 24 +- .../functional/removal/removal_reservation.ksh | 12 +- .../tests/functional/removal/removal_with_add.ksh | 14 +- .../functional/removal/removal_with_errors.ksh | 16 +- .../functional/removal/removal_with_faulted.ksh | 12 +- .../tests/functional/removal/removal_with_hole.ksh | 34 + .../functional/removal/removal_with_indirect.ksh | 13 +- .../tests/functional/removal/removal_with_zdb.ksh | 2 +- .../functional/removal/remove_attach_mirror.ksh | 9 +- .../tests/functional/removal/remove_expanded.ksh | 10 +- .../tests/functional/removal/remove_mirror.ksh | 11 +- .../tests/functional/removal/remove_raidz.ksh | 18 +- .../tests/functional/snapshot/snapshot_002_pos.ksh | 2 +- .../tests/functional/snapshot/snapshot_006_pos.ksh | 2 +- .../user_namespace/user_namespace_004.ksh | 2 +- .../functional/zvol/zvol_misc/zvol_misc_fua.ksh | 4 +- .../functional/zvol/zvol_misc/zvol_misc_trim.ksh | 4 +- .../functional/zvol/zvol_stress/zvol_stress.ksh | 2 +- .../zvol/zvol_swap/zvol_swap_001_pos.ksh | 6 +- .../zvol/zvol_swap/zvol_swap_002_pos.ksh | 6 +- sys/modules/zfs/Makefile | 2 +- sys/modules/zfs/zfs_config.h | 5 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 101 files changed, 26003 insertions(+), 1028 deletions(-) diff --cc sys/conf/files index e6987c8f1fc9,000000000000..157cda2c4b60 mode 100644,000000..100644 --- a/sys/conf/files +++ b/sys/conf/files @@@ -1,5285 -1,0 +1,5285 @@@ +# +# The long compile-with and dependency lines are required because of +# limitations in config: backslash-newline doesn't work in strings, and +# dependency lines other than the first are silently ignored. +# +acpi_quirks.h optional acpi \ + dependency "$S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \ + compile-with "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \ + no-obj no-implicit-rule before-depend \ + clean "acpi_quirks.h" +bhnd_nvram_map.h optional bhnd \ + dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -h" \ + no-obj no-implicit-rule before-depend \ + clean "bhnd_nvram_map.h" +bhnd_nvram_map_data.h optional bhnd \ + dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \ + no-obj no-implicit-rule before-depend \ + clean "bhnd_nvram_map_data.h" +fdt_static_dtb.h optional fdt fdt_dtb_static \ + compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.OBJDIR}'" \ + dependency "${FDT_DTS_FILE:T:R}.dtb" \ + no-obj no-implicit-rule before-depend \ + clean "fdt_static_dtb.h" +feeder_eq_gen.h optional sound \ + dependency "$S/tools/sound/feeder_eq_mkfilter.awk" \ + compile-with "${AWK} -f $S/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \ + no-obj no-implicit-rule before-depend \ + clean "feeder_eq_gen.h" +feeder_rate_gen.h optional sound \ + dependency "$S/tools/sound/feeder_rate_mkfilter.awk" \ + compile-with "${AWK} -f $S/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > feeder_rate_gen.h" \ + no-obj no-implicit-rule before-depend \ + clean "feeder_rate_gen.h" +font.h optional sc_dflt_font \ + compile-with "uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < ${SRCTOP}/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ + no-obj no-implicit-rule before-depend \ + clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" +snd_fxdiv_gen.h optional sound \ + dependency "$S/tools/sound/snd_fxdiv_gen.awk" \ + compile-with "${AWK} -f $S/tools/sound/snd_fxdiv_gen.awk -- > snd_fxdiv_gen.h" \ + no-obj no-implicit-rule before-depend \ + clean "snd_fxdiv_gen.h" +miidevs.h optional miibus | mii \ + dependency "$S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ + compile-with "${AWK} -f $S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ + no-obj no-implicit-rule before-depend \ + clean "miidevs.h" +kbdmuxmap.h optional kbdmux_dflt_keymap \ + compile-with "${KEYMAP} -L ${KBDMUX_DFLT_KEYMAP} | ${KEYMAP_FIX} > ${.TARGET}" \ + no-obj no-implicit-rule before-depend \ + clean "kbdmuxmap.h" +teken_state.h optional sc | vt \ + dependency "$S/teken/gensequences $S/teken/sequences" \ + compile-with "${AWK} -f $S/teken/gensequences $S/teken/sequences > teken_state.h" \ + no-obj no-implicit-rule before-depend \ + clean "teken_state.h" +ukbdmap.h optional ukbd_dflt_keymap \ + compile-with "${KEYMAP} -L ${UKBD_DFLT_KEYMAP} | ${KEYMAP_FIX} > ${.TARGET}" \ + no-obj no-implicit-rule before-depend \ + clean "ukbdmap.h" +usbdevs.h optional usb | hid \ + dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ + compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -h" \ + no-obj no-implicit-rule before-depend \ + clean "usbdevs.h" +usbdevs_data.h optional usb \ + dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ + compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -d" \ + no-obj no-implicit-rule before-depend \ + clean "usbdevs_data.h" +sdiodevs.h optional mmccam \ + dependency "$S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs" \ + compile-with "${AWK} -f $S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs -h" \ + no-obj no-implicit-rule before-depend \ + clean "sdiodevs.h" +sdiodevs_data.h optional mmccam \ + dependency "$S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs" \ + compile-with "${AWK} -f $S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs -d" \ + no-obj no-implicit-rule before-depend \ + clean "sdiodevs_data.h" +cam/cam.c optional scbus +cam/cam_compat.c optional scbus +cam/cam_iosched.c optional scbus +cam/cam_periph.c optional scbus +cam/cam_queue.c optional scbus +cam/cam_sim.c optional scbus +cam/cam_xpt.c optional scbus +cam/ata/ata_all.c optional scbus +cam/ata/ata_xpt.c optional scbus +cam/ata/ata_pmp.c optional scbus +cam/nvme/nvme_all.c optional scbus +cam/nvme/nvme_da.c optional nda | da +cam/nvme/nvme_xpt.c optional scbus +cam/scsi/scsi_xpt.c optional scbus +cam/scsi/scsi_all.c optional scbus +cam/scsi/scsi_cd.c optional cd +cam/scsi/scsi_ch.c optional ch +cam/ata/ata_da.c optional ada | da +cam/ctl/ctl.c optional ctl +cam/ctl/ctl_backend.c optional ctl +cam/ctl/ctl_backend_block.c optional ctl +cam/ctl/ctl_backend_ramdisk.c optional ctl +cam/ctl/ctl_cmd_table.c optional ctl +cam/ctl/ctl_frontend.c optional ctl +cam/ctl/ctl_frontend_cam_sim.c optional ctl +cam/ctl/ctl_frontend_ioctl.c optional ctl +cam/ctl/ctl_frontend_iscsi.c optional ctl cfiscsi +cam/ctl/ctl_ha.c optional ctl +cam/ctl/ctl_nvme_all.c optional ctl +cam/ctl/ctl_nvme_cmd_table.c optional ctl +cam/ctl/ctl_scsi_all.c optional ctl +cam/ctl/ctl_tpc.c optional ctl +cam/ctl/ctl_tpc_local.c optional ctl +cam/ctl/ctl_error.c optional ctl +cam/ctl/ctl_util.c optional ctl +cam/ctl/scsi_ctl.c optional ctl +cam/mmc/mmc_xpt.c optional scbus mmccam +cam/mmc/mmc_sim.c optional scbus mmccam +cam/mmc/mmc_sim_if.m optional scbus mmccam +cam/mmc/mmc_da.c optional scbus mmccam da +cam/scsi/scsi_da.c optional da +cam/scsi/scsi_pass.c optional pass +cam/scsi/scsi_pt.c optional pt +cam/scsi/scsi_sa.c optional sa +cam/scsi/scsi_enc.c optional ses +cam/scsi/scsi_enc_ses.c optional ses +cam/scsi/scsi_enc_safte.c optional ses +cam/scsi/scsi_sg.c optional sg +cam/scsi/scsi_targ_bh.c optional targbh +cam/scsi/scsi_target.c optional targ +cam/scsi/smp_all.c optional scbus + +# shared between zfs and dtrace +cddl/compat/opensolaris/kern/opensolaris.c optional dtrace compile-with "${CDDL_C}" +cddl/compat/opensolaris/kern/opensolaris_proc.c optional zfs | dtrace compile-with "${CDDL_C}" +contrib/openzfs/module/os/freebsd/spl/spl_misc.c optional zfs | dtrace compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_cmn_err.c optional zfs | dtrace compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_taskq.c optional zfs | dtrace compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_kmem.c optional zfs | dtrace compile-with "${ZFS_C}" + +#zfs solaris portability layer +contrib/openzfs/module/os/freebsd/spl/acl_common.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/callb.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/list.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_acl.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_dtrace.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_kstat.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_policy.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_string.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_sunddi.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_sysevent.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_uio.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_vfs.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_vm.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_zlib.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/spl/spl_zone.c optional zfs compile-with "${ZFS_C}" + + + +# zfs specific + +#zfs avl +contrib/openzfs/module/avl/avl.c optional zfs compile-with "${ZFS_C}" + +# zfs lua support +contrib/openzfs/module/lua/lapi.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lauxlib.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lbaselib.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lcode.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lcompat.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lcorolib.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lctype.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/ldebug.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C} ${NO_WINFINITE_RECURSION}" +contrib/openzfs/module/lua/lfunc.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lgc.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/llex.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lmem.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lobject.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lopcodes.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lparser.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lstate.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lstring.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lstrlib.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/ltable.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/ltablib.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/ltm.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lvm.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/lzio.c optional zfs compile-with "${ZFS_C}" + +# zfs nvpair support +contrib/openzfs/module/nvpair/fnvpair.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/nvpair/nvpair.c optional zfs compile-with "${ZFS_RPC_C} ${NO_WSTRINGOP_OVERREAD}" +contrib/openzfs/module/nvpair/nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/nvpair/nvpair_alloc_spl.c optional zfs compile-with "${ZFS_C}" + +#zfs platform compatibility code +contrib/openzfs/module/os/freebsd/zfs/abd_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/arc_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/crypto_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/dmu_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/event_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/hkdf.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/kmod_core.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/spa_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c optional zfs compile-with "${ZFS_C} -include $S/modules/zfs/zfs_config.h" - contrib/openzfs/module/os/freebsd/zfs/vdev_file.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/vdev_label_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_debug.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_dir.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_znode_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zvol_os.c optional zfs compile-with "${ZFS_C}" + +#zfs unicode support +contrib/openzfs/module/unicode/u8_textprep.c optional zfs compile-with "${ZFS_C}" + +#zfs checksums / zcommon +contrib/openzfs/module/zcommon/cityhash.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfeature_common.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_comutil.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_deleg.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_fletcher.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_fletcher_superscalar.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_fletcher_superscalar4.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_namecheck.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_prop.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zfs_valstr.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zpool_prop.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zcommon/zprop_common.c optional zfs compile-with "${ZFS_C}" + +# zfs edon-r hash support +contrib/openzfs/module/icp/algs/edonr/edonr.c optional zfs compile-with "${ZFS_C}" + +# zfs blake3 hash support +contrib/openzfs/module/icp/algs/blake3/blake3.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/icp/algs/blake3/blake3_generic.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/icp/algs/blake3/blake3_impl.c optional zfs compile-with "${ZFS_C}" + +# zfs sha2 hash support +contrib/openzfs/module/icp/algs/sha2/sha2_generic.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/icp/algs/sha2/sha256_impl.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/icp/algs/sha2/sha512_impl.c optional zfs compile-with "${ZFS_C}" + +#zfs core common code +contrib/openzfs/module/zfs/abd.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/aggsum.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/arc.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/blake3_zfs.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/blkptr.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/bplist.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/bpobj.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/bptree.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/brt.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/btree.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/bqueue.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dbuf.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dbuf_stats.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dataset_kstats.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/ddt.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/ddt_log.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/ddt_stats.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/ddt_zap.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_direct.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_diff.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_object.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_objset.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_recv.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_redact.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_send.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_traverse.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_tx.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dmu_zfetch.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dnode.c optional zfs compile-with "${ZFS_C} ${NO_WUNUSED_BUT_SET_VARIABLE}" \ + warning "kernel contains CDDL licensed ZFS filesystem" +contrib/openzfs/module/zfs/dnode_sync.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_bookmark.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_crypt.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_dataset.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_deadlist.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_deleg.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_destroy.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_dir.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_pool.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_prop.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_scan.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_synctask.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/dsl_userhold.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/edonr_zfs.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/fm.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/gzip.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/lzjb.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/lz4.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/lz4_zfs.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/metaslab.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/mmp.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/multilist.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/objlist.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/pathname.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/range_tree.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/refcount.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/rrwlock.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/sa.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/sha2_zfs.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/skein_zfs.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa_checkpoint.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa_config.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa_errlog.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa_history.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa_log_spacemap.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa_misc.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/spa_stats.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/space_map.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/space_reftree.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/txg.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/uberblock.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/unique.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_draid.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_draid_rand.c optional zfs compile-with "${ZFS_C}" ++contrib/openzfs/module/zfs/vdev_file.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_indirect.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_indirect_births.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_indirect_mapping.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_initialize.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_label.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_mirror.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_missing.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_queue.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_raidz.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_raidz_math.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_raidz_math_scalar.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_rebuild.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_removal.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_root.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/vdev_trim.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zap.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zap_leaf.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zap_micro.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zcp.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zcp_get.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zcp_global.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zcp_iter.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zcp_set.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zcp_synctask.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfeature.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_byteswap.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_chksum.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_fm.c optional zfs compile-with "${ZFS_C} ${NO_WUNUSED_BUT_SET_VARIABLE}" +contrib/openzfs/module/zfs/zfs_fuid.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_impl.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_ioctl.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_log.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_onexit.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_quota.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_ratelimit.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_replay.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_rlock.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_sa.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_vnops.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zstd/zfs_zstd.c optional zfs zstdio compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zil.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zio.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zio_checksum.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zio_compress.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zio_inject.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zle.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zrlock.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zthr.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/zfs/zvol.c optional zfs compile-with "${ZFS_C}" + +# dtrace specific +cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c optional dtrace compile-with "${DTRACE_C}" \ + warning "kernel contains CDDL licensed DTRACE" +cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c optional dtrace compile-with "${DTRACE_C}" +cddl/dev/dtmalloc/dtmalloc.c optional dtmalloc | dtraceall compile-with "${CDDL_C}" +cddl/dev/profile/profile.c optional dtrace_profile | dtraceall compile-with "${CDDL_C}" +cddl/dev/sdt/sdt.c optional dtrace_sdt | dtraceall compile-with "${CDDL_C}" +cddl/dev/fbt/fbt.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" +cddl/dev/systrace/systrace.c optional dtrace_systrace | dtraceall compile-with "${CDDL_C}" +cddl/dev/prototype.c optional dtrace_prototype | dtraceall compile-with "${CDDL_C}" +fs/nfsclient/nfs_clkdtrace.c optional dtnfscl nfscl | dtraceall nfscl compile-with "${CDDL_C}" +compat/freebsd32/freebsd32_abort2.c optional compat_freebsd32 +compat/freebsd32/freebsd32_capability.c optional compat_freebsd32 +compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32 +compat/freebsd32/freebsd32_misc.c optional compat_freebsd32 +compat/freebsd32/freebsd32_syscalls.c optional compat_freebsd32 +compat/freebsd32/freebsd32_sysent.c optional compat_freebsd32 +contrib/ck/src/ck_array.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_centralized.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_combining.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_dissemination.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_mcs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_tournament.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_epoch.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_hp.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_hs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_ht.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_rhs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/dev/acpica/common/ahids.c optional acpi acpi_debug +contrib/dev/acpica/common/ahuuids.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbconvert.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbexec.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbhistry.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbobject.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmcstyle.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrc.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrcl.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrcl2.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrcs.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmutils.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmwalk.c optional acpi acpi_debug +contrib/dev/acpica/components/dispatcher/dsargs.c optional acpi +contrib/dev/acpica/components/dispatcher/dscontrol.c optional acpi +contrib/dev/acpica/components/dispatcher/dsdebug.c optional acpi +contrib/dev/acpica/components/dispatcher/dsfield.c optional acpi +contrib/dev/acpica/components/dispatcher/dsinit.c optional acpi +contrib/dev/acpica/components/dispatcher/dsmethod.c optional acpi +contrib/dev/acpica/components/dispatcher/dsmthdat.c optional acpi +contrib/dev/acpica/components/dispatcher/dsobject.c optional acpi +contrib/dev/acpica/components/dispatcher/dsopcode.c optional acpi +contrib/dev/acpica/components/dispatcher/dspkginit.c optional acpi +contrib/dev/acpica/components/dispatcher/dsutils.c optional acpi +contrib/dev/acpica/components/dispatcher/dswexec.c optional acpi +contrib/dev/acpica/components/dispatcher/dswload.c optional acpi +contrib/dev/acpica/components/dispatcher/dswload2.c optional acpi +contrib/dev/acpica/components/dispatcher/dswscope.c optional acpi +contrib/dev/acpica/components/dispatcher/dswstate.c optional acpi +contrib/dev/acpica/components/events/evevent.c optional acpi +contrib/dev/acpica/components/events/evglock.c optional acpi +contrib/dev/acpica/components/events/evgpe.c optional acpi +contrib/dev/acpica/components/events/evgpeblk.c optional acpi +contrib/dev/acpica/components/events/evgpeinit.c optional acpi +contrib/dev/acpica/components/events/evgpeutil.c optional acpi +contrib/dev/acpica/components/events/evhandler.c optional acpi +contrib/dev/acpica/components/events/evmisc.c optional acpi +contrib/dev/acpica/components/events/evregion.c optional acpi +contrib/dev/acpica/components/events/evrgnini.c optional acpi +contrib/dev/acpica/components/events/evsci.c optional acpi +contrib/dev/acpica/components/events/evxface.c optional acpi +contrib/dev/acpica/components/events/evxfevnt.c optional acpi +contrib/dev/acpica/components/events/evxfgpe.c optional acpi +contrib/dev/acpica/components/events/evxfregn.c optional acpi +contrib/dev/acpica/components/executer/exconcat.c optional acpi +contrib/dev/acpica/components/executer/exconfig.c optional acpi +contrib/dev/acpica/components/executer/exconvrt.c optional acpi +contrib/dev/acpica/components/executer/excreate.c optional acpi +contrib/dev/acpica/components/executer/exdebug.c optional acpi +contrib/dev/acpica/components/executer/exdump.c optional acpi +contrib/dev/acpica/components/executer/exfield.c optional acpi +contrib/dev/acpica/components/executer/exfldio.c optional acpi +contrib/dev/acpica/components/executer/exmisc.c optional acpi +contrib/dev/acpica/components/executer/exmutex.c optional acpi +contrib/dev/acpica/components/executer/exnames.c optional acpi +contrib/dev/acpica/components/executer/exoparg1.c optional acpi +contrib/dev/acpica/components/executer/exoparg2.c optional acpi +contrib/dev/acpica/components/executer/exoparg3.c optional acpi +contrib/dev/acpica/components/executer/exoparg6.c optional acpi +contrib/dev/acpica/components/executer/exprep.c optional acpi +contrib/dev/acpica/components/executer/exregion.c optional acpi +contrib/dev/acpica/components/executer/exresnte.c optional acpi +contrib/dev/acpica/components/executer/exresolv.c optional acpi +contrib/dev/acpica/components/executer/exresop.c optional acpi +contrib/dev/acpica/components/executer/exserial.c optional acpi +contrib/dev/acpica/components/executer/exstore.c optional acpi +contrib/dev/acpica/components/executer/exstoren.c optional acpi +contrib/dev/acpica/components/executer/exstorob.c optional acpi +contrib/dev/acpica/components/executer/exsystem.c optional acpi +contrib/dev/acpica/components/executer/extrace.c optional acpi +contrib/dev/acpica/components/executer/exutils.c optional acpi +contrib/dev/acpica/components/hardware/hwacpi.c optional acpi +contrib/dev/acpica/components/hardware/hwesleep.c optional acpi +contrib/dev/acpica/components/hardware/hwgpe.c optional acpi +contrib/dev/acpica/components/hardware/hwpci.c optional acpi +contrib/dev/acpica/components/hardware/hwregs.c optional acpi +contrib/dev/acpica/components/hardware/hwsleep.c optional acpi +contrib/dev/acpica/components/hardware/hwtimer.c optional acpi +contrib/dev/acpica/components/hardware/hwvalid.c optional acpi +contrib/dev/acpica/components/hardware/hwxface.c optional acpi +contrib/dev/acpica/components/hardware/hwxfsleep.c optional acpi +contrib/dev/acpica/components/namespace/nsaccess.c optional acpi \ + compile-with "${NORMAL_C} ${NO_WUNUSED_BUT_SET_VARIABLE}" +contrib/dev/acpica/components/namespace/nsalloc.c optional acpi +contrib/dev/acpica/components/namespace/nsarguments.c optional acpi +contrib/dev/acpica/components/namespace/nsconvert.c optional acpi +contrib/dev/acpica/components/namespace/nsdump.c optional acpi +contrib/dev/acpica/components/namespace/nseval.c optional acpi +contrib/dev/acpica/components/namespace/nsinit.c optional acpi +contrib/dev/acpica/components/namespace/nsload.c optional acpi +contrib/dev/acpica/components/namespace/nsnames.c optional acpi +contrib/dev/acpica/components/namespace/nsobject.c optional acpi +contrib/dev/acpica/components/namespace/nsparse.c optional acpi +contrib/dev/acpica/components/namespace/nspredef.c optional acpi +contrib/dev/acpica/components/namespace/nsprepkg.c optional acpi +contrib/dev/acpica/components/namespace/nsrepair.c optional acpi +contrib/dev/acpica/components/namespace/nsrepair2.c optional acpi +contrib/dev/acpica/components/namespace/nssearch.c optional acpi +contrib/dev/acpica/components/namespace/nsutils.c optional acpi +contrib/dev/acpica/components/namespace/nswalk.c optional acpi +contrib/dev/acpica/components/namespace/nsxfeval.c optional acpi +contrib/dev/acpica/components/namespace/nsxfname.c optional acpi +contrib/dev/acpica/components/namespace/nsxfobj.c optional acpi +contrib/dev/acpica/components/parser/psargs.c optional acpi +contrib/dev/acpica/components/parser/psloop.c optional acpi +contrib/dev/acpica/components/parser/psobject.c optional acpi +contrib/dev/acpica/components/parser/psopcode.c optional acpi +contrib/dev/acpica/components/parser/psopinfo.c optional acpi +contrib/dev/acpica/components/parser/psparse.c optional acpi +contrib/dev/acpica/components/parser/psscope.c optional acpi +contrib/dev/acpica/components/parser/pstree.c optional acpi +contrib/dev/acpica/components/parser/psutils.c optional acpi +contrib/dev/acpica/components/parser/pswalk.c optional acpi +contrib/dev/acpica/components/parser/psxface.c optional acpi +contrib/dev/acpica/components/resources/rsaddr.c optional acpi +contrib/dev/acpica/components/resources/rscalc.c optional acpi +contrib/dev/acpica/components/resources/rscreate.c optional acpi +contrib/dev/acpica/components/resources/rsdump.c optional acpi acpi_debug +contrib/dev/acpica/components/resources/rsdumpinfo.c optional acpi +contrib/dev/acpica/components/resources/rsinfo.c optional acpi +contrib/dev/acpica/components/resources/rsio.c optional acpi +contrib/dev/acpica/components/resources/rsirq.c optional acpi +contrib/dev/acpica/components/resources/rslist.c optional acpi +contrib/dev/acpica/components/resources/rsmemory.c optional acpi +contrib/dev/acpica/components/resources/rsmisc.c optional acpi +contrib/dev/acpica/components/resources/rsserial.c optional acpi +contrib/dev/acpica/components/resources/rsutils.c optional acpi +contrib/dev/acpica/components/resources/rsxface.c optional acpi +contrib/dev/acpica/components/tables/tbdata.c optional acpi +contrib/dev/acpica/components/tables/tbfadt.c optional acpi +contrib/dev/acpica/components/tables/tbfind.c optional acpi +contrib/dev/acpica/components/tables/tbinstal.c optional acpi +contrib/dev/acpica/components/tables/tbprint.c optional acpi +contrib/dev/acpica/components/tables/tbutils.c optional acpi +contrib/dev/acpica/components/tables/tbxface.c optional acpi +contrib/dev/acpica/components/tables/tbxfload.c optional acpi +contrib/dev/acpica/components/tables/tbxfroot.c optional acpi +contrib/dev/acpica/components/utilities/utaddress.c optional acpi +contrib/dev/acpica/components/utilities/utalloc.c optional acpi +contrib/dev/acpica/components/utilities/utascii.c optional acpi +contrib/dev/acpica/components/utilities/utbuffer.c optional acpi +contrib/dev/acpica/components/utilities/utcache.c optional acpi +contrib/dev/acpica/components/utilities/utcksum.c optional acpi +contrib/dev/acpica/components/utilities/utcopy.c optional acpi +contrib/dev/acpica/components/utilities/utdebug.c optional acpi +contrib/dev/acpica/components/utilities/utdecode.c optional acpi +contrib/dev/acpica/components/utilities/utdelete.c optional acpi +contrib/dev/acpica/components/utilities/uterror.c optional acpi +contrib/dev/acpica/components/utilities/uteval.c optional acpi +contrib/dev/acpica/components/utilities/utexcep.c optional acpi +contrib/dev/acpica/components/utilities/utglobal.c optional acpi +contrib/dev/acpica/components/utilities/uthex.c optional acpi +contrib/dev/acpica/components/utilities/utids.c optional acpi +contrib/dev/acpica/components/utilities/utinit.c optional acpi +contrib/dev/acpica/components/utilities/utlock.c optional acpi +contrib/dev/acpica/components/utilities/utmath.c optional acpi +contrib/dev/acpica/components/utilities/utmisc.c optional acpi +contrib/dev/acpica/components/utilities/utmutex.c optional acpi +contrib/dev/acpica/components/utilities/utnonansi.c optional acpi +contrib/dev/acpica/components/utilities/utobject.c optional acpi +contrib/dev/acpica/components/utilities/utosi.c optional acpi +contrib/dev/acpica/components/utilities/utownerid.c optional acpi +contrib/dev/acpica/components/utilities/utpredef.c optional acpi +contrib/dev/acpica/components/utilities/utresdecode.c optional acpi acpi_debug +contrib/dev/acpica/components/utilities/utresrc.c optional acpi +contrib/dev/acpica/components/utilities/utstate.c optional acpi +contrib/dev/acpica/components/utilities/utstring.c optional acpi +contrib/dev/acpica/components/utilities/utstrsuppt.c optional acpi +contrib/dev/acpica/components/utilities/utstrtoul64.c optional acpi +contrib/dev/acpica/components/utilities/utuuid.c optional acpi acpi_debug +contrib/dev/acpica/components/utilities/utxface.c optional acpi +contrib/dev/acpica/components/utilities/utxferror.c optional acpi +contrib/dev/acpica/components/utilities/utxfinit.c optional acpi +contrib/dev/acpica/os_specific/service_layers/osgendbg.c optional acpi acpi_debug +netpfil/ipfilter/netinet/fil.c optional ipfilter inet \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet \ + compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" +netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ + compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet \ + compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \ + compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet \ + compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +contrib/libfdt/fdt.c optional fdt +contrib/libfdt/fdt_ro.c optional fdt +contrib/libfdt/fdt_rw.c optional fdt +contrib/libfdt/fdt_strerror.c optional fdt +contrib/libfdt/fdt_sw.c optional fdt +contrib/libfdt/fdt_wip.c optional fdt +contrib/libnv/cnvlist.c standard +contrib/libnv/dnvlist.c standard +contrib/libnv/nvlist.c standard +contrib/libnv/bsd_nvpair.c standard +# xz +dev/xz/xz_mod.c optional xz \ + compile-with "${NORMAL_C} -DXZ_USE_CRC64 -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_crc32.c optional xz \ + compile-with "${NORMAL_C} -DXZ_USE_CRC64 -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_crc64.c optional xz \ + compile-with "${NORMAL_C} -DXZ_USE_CRC64 -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c optional xz \ + compile-with "${NORMAL_C} -DXZ_USE_CRC64 -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c optional xz \ + compile-with "${NORMAL_C} -DXZ_USE_CRC64 -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c optional xz \ + compile-with "${NORMAL_C} -DXZ_USE_CRC64 -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +# Zstd +contrib/zstd/lib/freebsd/zstd_kmalloc.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/zstd_common.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/fse_decompress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/entropy_common.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/error_private.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/common/xxhash.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress_literals.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress_sequences.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress_superblock.c optional zstdio compile-with "${ZSTD_C} ${NO_WUNUSED_BUT_SET_VARIABLE}" +contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/hist.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_double_fast.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_fast.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_lazy.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_ldm.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_opt.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/zstd_ddict.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/zstd_decompress.c optional zstdio compile-with ${ZSTD_C} +# See comment in sys/conf/kern.pre.mk +contrib/zstd/lib/decompress/zstd_decompress_block.c optional zstdio \ + compile-with "${ZSTD_C} ${ZSTD_DECOMPRESS_BLOCK_FLAGS}" +contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with "${ZSTD_C} ${NO_WBITWISE_INSTEAD_OF_LOGICAL}" +# Blake 2 +contrib/libb2/blake2b-ref.c optional crypto | !random_loadable random_fenestrasx \ + compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" +contrib/libb2/blake2s-ref.c optional crypto \ + compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" +crypto/blake2/blake2-sw.c optional crypto \ + compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual" +crypto/camellia/camellia.c optional crypto +crypto/camellia/camellia-api.c optional crypto +crypto/chacha20/chacha.c standard +crypto/chacha20/chacha-sw.c optional crypto +crypto/chacha20_poly1305.c optional crypto +crypto/curve25519.c optional crypto \ + compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium" +crypto/des/des_ecb.c optional netsmb +crypto/des/des_setkey.c optional netsmb +crypto/openssl/ossl.c optional ossl +crypto/openssl/ossl_aes.c optional ossl +crypto/openssl/ossl_chacha20.c optional ossl +crypto/openssl/ossl_poly1305.c optional ossl +crypto/openssl/ossl_sha1.c optional ossl +crypto/openssl/ossl_sha256.c optional ossl +crypto/openssl/ossl_sha512.c optional ossl +crypto/rc4/rc4.c optional netgraph_mppc_encryption +crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | \ + !random_loadable | wlan_ccmp +crypto/rijndael/rijndael-api-fst.c optional ekcd | !random_loadable +crypto/rijndael/rijndael-api.c optional crypto | wlan_ccmp +crypto/sha1.c optional carp | crypto | ether | \ + netgraph_mppc_encryption | sctp +crypto/sha2/sha256c.c optional crypto | ekcd | \ + !random_loadable | sctp | zfs +crypto/sha2/sha512c.c optional crypto | zfs +crypto/skein/skein.c optional crypto | zfs +crypto/skein/skein_block.c optional crypto | zfs +crypto/siphash/siphash.c optional inet | inet6 | wg +crypto/siphash/siphash_test.c optional inet | inet6 | wg +ddb/db_access.c optional ddb +ddb/db_break.c optional ddb +ddb/db_capture.c optional ddb +ddb/db_command.c optional ddb +ddb/db_ctf.c optional ddb +ddb/db_examine.c optional ddb +ddb/db_expr.c optional ddb +ddb/db_input.c optional ddb +ddb/db_lex.c optional ddb +ddb/db_main.c optional ddb +ddb/db_output.c optional ddb +ddb/db_pprint.c optional ddb +ddb/db_print.c optional ddb +ddb/db_ps.c optional ddb +ddb/db_run.c optional ddb +ddb/db_script.c optional ddb +ddb/db_sym.c optional ddb +ddb/db_thread.c optional ddb +ddb/db_textdump.c optional ddb +ddb/db_variables.c optional ddb +ddb/db_watch.c optional ddb +ddb/db_write_cmd.c optional ddb +dev/aac/aac.c optional aac +dev/aac/aac_cam.c optional aacp aac +dev/aac/aac_debug.c optional aac +dev/aac/aac_disk.c optional aac +dev/aac/aac_pci.c optional aac pci +dev/aacraid/aacraid.c optional aacraid +dev/aacraid/aacraid_cam.c optional aacraid scbus +dev/aacraid/aacraid_debug.c optional aacraid +dev/aacraid/aacraid_pci.c optional aacraid pci +dev/acpi_support/acpi_wmi.c optional acpi_wmi acpi +dev/acpi_support/acpi_asus.c optional acpi_asus acpi +dev/acpi_support/acpi_asus_wmi.c optional acpi_asus_wmi acpi +dev/acpi_support/acpi_fujitsu.c optional acpi_fujitsu acpi +dev/acpi_support/acpi_hp.c optional acpi_hp acpi +dev/acpi_support/acpi_ibm.c optional acpi_ibm acpi +dev/acpi_support/acpi_panasonic.c optional acpi_panasonic acpi +dev/acpi_support/acpi_sbl_wmi.c optional acpi_sbl_wmi acpi +dev/acpi_support/acpi_sony.c optional acpi_sony acpi +dev/acpi_support/acpi_toshiba.c optional acpi_toshiba acpi +dev/acpi_support/atk0110.c optional aibs acpi +dev/acpica/Osd/OsdDebug.c optional acpi +dev/acpica/Osd/OsdHardware.c optional acpi +dev/acpica/Osd/OsdInterrupt.c optional acpi +dev/acpica/Osd/OsdMemory.c optional acpi +dev/acpica/Osd/OsdSchedule.c optional acpi +dev/acpica/Osd/OsdStream.c optional acpi +dev/acpica/Osd/OsdSynch.c optional acpi +dev/acpica/Osd/OsdTable.c optional acpi +dev/acpica/acpi.c optional acpi +dev/acpica/acpi_acad.c optional acpi +dev/acpica/acpi_apei.c optional acpi +dev/acpica/acpi_battery.c optional acpi +dev/acpica/acpi_button.c optional acpi +dev/acpica/acpi_cmbat.c optional acpi +dev/acpica/acpi_cpu.c optional acpi +dev/acpica/acpi_ec.c optional acpi +dev/acpica/acpi_ged.c optional acpi_ged acpi +dev/acpica/acpi_isab.c optional acpi isa +dev/acpica/acpi_lid.c optional acpi +dev/acpica/acpi_package.c optional acpi +dev/acpica/acpi_perf.c optional acpi +dev/acpica/acpi_powerres.c optional acpi +dev/acpica/acpi_quirk.c optional acpi +dev/acpica/acpi_resource.c optional acpi +dev/acpica/acpi_container.c optional acpi +dev/acpica/acpi_smbat.c optional acpi +dev/acpica/acpi_thermal.c optional acpi +dev/acpica/acpi_throttle.c optional acpi +dev/acpica/acpi_video.c optional acpi_video acpi +dev/acpica/acpi_dock.c optional acpi_dock acpi +dev/adlink/adlink.c optional adlink +dev/ae/if_ae.c optional ae pci +dev/age/if_age.c optional age pci +dev/agp/agp.c optional agp pci +dev/agp/agp_if.m optional agp pci +dev/ahci/ahci.c optional ahci +dev/ahci/ahciem.c optional ahci +dev/ahci/ahci_pci.c optional ahci pci +dev/aic7xxx/ahc_isa.c optional ahc isa +dev/aic7xxx/ahc_pci.c optional ahc pci \ + compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" +dev/aic7xxx/ahd_pci.c optional ahd pci \ + compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" +dev/aic7xxx/aic7770.c optional ahc +dev/aic7xxx/aic79xx.c optional ahd pci +dev/aic7xxx/aic79xx_osm.c optional ahd pci +dev/aic7xxx/aic79xx_pci.c optional ahd pci +dev/aic7xxx/aic79xx_reg_print.c optional ahd pci ahd_reg_pretty_print +dev/aic7xxx/aic7xxx.c optional ahc +dev/aic7xxx/aic7xxx_93cx6.c optional ahc +dev/aic7xxx/aic7xxx_osm.c optional ahc +dev/aic7xxx/aic7xxx_pci.c optional ahc pci +dev/aic7xxx/aic7xxx_reg_print.c optional ahc ahc_reg_pretty_print +dev/al_eth/al_eth.c optional al_eth fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +dev/al_eth/al_init_eth_lm.c optional al_eth fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +dev/al_eth/al_init_eth_kr.c optional al_eth fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_hal_iofic.c optional al_iofic \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_hal_serdes_25g.c optional al_serdes \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_hal_serdes_hssp.c optional al_serdes \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_config.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_debug.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_iofic.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_hal_udma_main.c optional al_udma \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${.IMPSRC}" +contrib/alpine-hal/al_serdes.c optional al_serdes \ *** 5921 LINES SKIPPED *** From nobody Sun Mar 9 20:45:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9sTm2h60z5qlP6; Sun, 09 Mar 2025 20:45: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 4Z9sTm17ghz3Vtr; Sun, 09 Mar 2025 20:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741553100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7I9yEzMibsq2kMUd0uRB+xTVyhQ3kzoPry6eEA+VMEk=; b=BaC8h8Fsasa48hQE+wKGo0nnUAr1R+BfJBLZShPYEtKamLry5Yl3xEOz3pGI28yLJen/un lGqVBlJjcA4eKpb2KfAatvF6IHZ6Cvqmd0R4XBGUEv/MJLWIA0fbKsyqVhEfTAPBO6jLaO YGH1kGViMz9EbXGr/SLhEnBC1W0+d/9Khr+8mZ6uomJMLRnqHSsIuU4GJLoXAf4b6bMHCj CQszfQ5WYGraRWh+pwbu3yCsPQTrKbbfGcx7ql4QLI3EqT/34XmEkOCKqAwE9LMzAUd6ba KnBosreTCzhg4cv21oiIKXtYU9uITZJv9GZwALuA36HpNPL3tsTTeJ7078IKnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741553100; a=rsa-sha256; cv=none; b=rh/7bQrht5jqUivI/FCyjlNJHJXVn36cPRQG1slQhEwzQ/2bNEW/asaCxCmoI4oSR8pLPp PhZSvjsDokoAHOxO3MnS0d3RDKswT8Q1mMpIE/qI2VF4q+4KdTs41m0MSNUuiAjv5ChD3v FYjJP2vgdk8Lc7W9V6swjvlDV5NOZjx7nPexAmZMaYFZmSxePFdhkuF6+71uE04+sOIRQ+ CH7D3JLvh70958K/D/HTDNn5C7VHT+nf5OjlKmmeBa6JGGAEqt+pENU3HWl0fXdX7BHOZD 1Ca4LjM4+DzA7gR2VPcEMc33QeEW1xni8HWEYLwE6p8a2q6A5jGfqPa8x9w9cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741553100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7I9yEzMibsq2kMUd0uRB+xTVyhQ3kzoPry6eEA+VMEk=; b=R5L+d6/+mhOPzrgLGwKaKvWgu2yts/STxqfOcs1MwEBzKJxFj16pxQpma+WJe78ByFjdtR K0JbaCGk92aZEnHQxV0UIlD1BssWggLp2EPOPr2zPXK0NN/uZFmhfsIbMgR1Xtg5zN5HVG 86mVaKbxaQBbdqJLPByvI2s6lgql/AgPwsc/uVKzPJxa4CKI1TcMZOIq/Agt6O2fYBb/47 wcpf9LN3BCTk/+AleK27koACa4p2CzCOLXvm1zquB60G3OUfcpOyNg7q3nSV6dSKpe3u9W CSTK6nIqQsakIhfAtjf/Hs6hGQwkoswhoE+xvMT7q8i8bzyajkzmlSQk/ulxLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9sTm0lKbz1NVS; Sun, 09 Mar 2025 20:45: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 529Kj0ZA089473; Sun, 9 Mar 2025 20:45:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 529Kj0oR089466; Sun, 9 Mar 2025 20:45:00 GMT (envelope-from git) Date: Sun, 9 Mar 2025 20:45:00 GMT Message-Id: <202503092045.529Kj0oR089466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: f05f6d93732e - stable/14 - acpi_gpiobus: assume GPIO_PIN_INPUT for interrupt pins List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f05f6d93732e7d58464352e97e2dcafbab94adc4 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f05f6d93732e7d58464352e97e2dcafbab94adc4 commit f05f6d93732e7d58464352e97e2dcafbab94adc4 Author: Ahmad Khalifa AuthorDate: 2025-03-07 15:59:11 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-09 20:42:13 +0000 acpi_gpiobus: assume GPIO_PIN_INPUT for interrupt pins Different drivers respond differently to having neither GPIO_PIN_INPUT or GPIO_PIN_OUTPUT set, this stops the unpredictable results. (cherry picked from commit 6aab381a498f1a43ba372f4ae9f57ef88b4767b5) --- sys/dev/gpio/acpi_gpiobus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 254bb951177d..833b6984ae05 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -77,6 +77,7 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) break; } + flags |= GPIO_PIN_INPUT; #ifdef NOT_YET /* This is not currently implemented. */ if (gpio_res->Shareable == ACPI_SHARED) From nobody Sun Mar 9 20:45:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z9sTn5htZz5ql4M; Sun, 09 Mar 2025 20:45: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 4Z9sTn1nfcz3VZq; Sun, 09 Mar 2025 20:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741553101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kbvt8qHUanHWuOAf+6Z7ApHg39aa2pMNpdxWpWxqs74=; b=k1KYuHO+cIDO+fZhoELo4h998119U3QYbvyb7x1SlvBX3+ywyX1VPZCwrlCWnpTUX87lmG GFnrbwqmLUPpZFYf63E95x7Wjz0Sohawzt/5EeYzovtIb1hWP45xGwBHttDgCIJhOeF7gL mtOXKQGUgHjnLwFr2ulO3OQzupZ86GbBS+I1ba3AJ5KwGfCpGWEVj01tRS5Vp/23eKHHM9 vc3tWGPmJ5cvUvJjpyjbC859PEdWkwWiuGgqcUstkGRchi8vsVm96ODwD51ndcebKHdMcy v3x/iry2BaWBmgpCwpxRTUVnZ1wOknipCMCcyFY8881BOubcd69wROfkTD6PnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741553101; a=rsa-sha256; cv=none; b=x5DytCFDt4ZWKEsBz9EPkHlKU6EWXSNnkp/Ot/+cXQB8MMvlyHUoWnUXkzi26LA14lN/ng 3RUWiNJ32FeuOzjEOZBpYOjyOO7MbDyIltgvL8HNndbaWrrxsWYiRjZGZkHXd+POtUOa86 7+LwItyLYkU9wE02zC97ff/fcHnDh2rpyLkMAP3fqfI0S4gwpmE5kbYABkEotGnx3xgNfJ 7AWMhLhlWwVY//TUCMShy9Ikl3X53jnd2bQ+hv4KF8K3G2KkPcA40p5P2bm8Ow141dW5uq btNOXBvA1B+R1OcvVFV+cdwK186YOj72YwKHX6RF3+CuAr9oi9N+MhGoMGKLoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741553101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kbvt8qHUanHWuOAf+6Z7ApHg39aa2pMNpdxWpWxqs74=; b=M2zcFHR0iPBJqE9Wf/sZF7pSv4OXvNAuMMVYoSXuLUMT9dy4YZ3IzMdBSkWxoKpizra8yD R6fPdK+NyvBFuzVLumWCaNM1T33dcOrrxACRI1ODoUPMKbSTLWcfKEvx3XgY4Qtpug5xsa NBJF1es/ZP9p+09kQjiJY5zodN2/nNfyK5TliJex6bUtzkHIa2dmSyfWCpLzTeM9qvq8jJ 8y9Un2TzYvxxlTLGXXayBwA5dssDlrXB50BCWk/LftAIPku5BaWQz/KMFugcR9WLfAf6hl KdOhAqIC2QUUhxwaRenUbr8eBnIqURqXpFarxTzdchnTWQLWxGs8D9acotmVAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z9sTn1LSXz1NGx; Sun, 09 Mar 2025 20:45: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 529Kj14u089519; Sun, 9 Mar 2025 20:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 529Kj1KT089516; Sun, 9 Mar 2025 20:45:01 GMT (envelope-from git) Date: Sun, 9 Mar 2025 20:45:01 GMT Message-Id: <202503092045.529Kj1KT089516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: e7d1f208fde8 - stable/14 - gpioaei: Add support for ACPI _EVT method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7d1f208fde82c85b061ce792f20a4aa178ec82f Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d1f208fde82c85b061ce792f20a4aa178ec82f commit e7d1f208fde82c85b061ce792f20a4aa178ec82f Author: Vladimir Kondratyev AuthorDate: 2025-03-07 15:59:12 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-09 20:42:35 +0000 gpioaei: Add support for ACPI _EVT method This method is often used to process GPIO "Power on" button press on modern x86 laptops with S0ix sleep mode. Tested with patch from https://reviews.freebsd.org/D26407 Sponsored by: Future Crew LLC MFC after: 2 month (cherry picked from commit adc2c156acb50bac6e8ec66b72cadc8910ce4975) --- sys/dev/gpio/gpioaei.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/sys/dev/gpio/gpioaei.c b/sys/dev/gpio/gpioaei.c index 050f259a2127..f43674b53c7d 100644 --- a/sys/dev/gpio/gpioaei.c +++ b/sys/dev/gpio/gpioaei.c @@ -39,9 +39,16 @@ #include #include +enum gpio_aei_type { + ACPI_AEI_TYPE_UNKNOWN, + ACPI_AEI_TYPE_ELX, + ACPI_AEI_TYPE_EVT +}; + struct gpio_aei_softc { ACPI_HANDLE handle; - char objname[5]; /* "_EXX" or "_LXX" */ + enum gpio_aei_type type; + int pin; struct resource * intr_res; int intr_rid; void * intr_cookie; @@ -60,8 +67,11 @@ gpio_aei_intr(void * arg) { struct gpio_aei_softc * sc = arg; - /* Ask ACPI to run the appropriate _Exx or _Lxx method. */ - AcpiEvaluateObject(sc->handle, sc->objname, NULL, NULL); + /* Ask ACPI to run the appropriate _EVT, _Exx or _Lxx method. */ + if (sc->type == ACPI_AEI_TYPE_EVT) + acpi_SetInteger(sc->handle, NULL, sc->pin); + else + AcpiEvaluateObject(sc->handle, NULL, NULL, NULL); } static int @@ -69,23 +79,35 @@ gpio_aei_attach(device_t dev) { struct gpio_aei_softc * sc = device_get_softc(dev); gpio_pin_t pin; + ACPI_HANDLE handle; int err; /* This is us. */ device_set_desc(dev, "ACPI Event Information Device"); /* Store parameters needed by gpio_aei_intr. */ - sc->handle = acpi_gpiobus_get_handle(dev); + handle = acpi_gpiobus_get_handle(dev); if (gpio_pin_get_by_acpi_index(dev, 0, &pin) != 0) { device_printf(dev, "Unable to get the input pin\n"); return (ENXIO); } - sprintf(sc->objname, "_%c%02X", - (pin->flags & GPIO_INTR_EDGE_MASK) ? 'E' : 'L', pin->pin); - /* Support for GPIO pins > 255 is not implemented. */ - if (pin->pin > 255) { - device_printf(dev, "ACPI Event Information Device does not support pins > 255"); + sc->type = ACPI_AEI_TYPE_UNKNOWN; + sc->pin = pin->pin; + if (pin->pin <= 255) { + char objname[5]; /* "_EXX" or "_LXX" */ + sprintf(objname, "_%c%02X", + (pin->flags & GPIO_INTR_EDGE_MASK) ? 'E' : 'L', pin->pin); + if (ACPI_SUCCESS(AcpiGetHandle(handle, objname, &sc->handle))) + sc->type = ACPI_AEI_TYPE_ELX; + } + if (sc->type == ACPI_AEI_TYPE_UNKNOWN) { + if (ACPI_SUCCESS(AcpiGetHandle(handle, "_EVT", &sc->handle))) + sc->type = ACPI_AEI_TYPE_EVT; + } + + if (sc->type == ACPI_AEI_TYPE_UNKNOWN) { + device_printf(dev, "ACPI Event Information Device type is unknown"); return (ENOTSUP); }