From nobody Mon Jun 30 04:37:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bVtgL69NTz5ywg9; Mon, 30 Jun 2025 04:37: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 4bVtgL5KSkz3Wfv; Mon, 30 Jun 2025 04:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751258254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmU+gqwOPKJtOmUOnDgiXGbeKvVm9utFyC5oI3lNyBA=; b=JIi6WETj+oy0YcfFcM0Sa6mmirMxrN6IDw/S0OEa3j/SOrO7zXA1E0dsVC+mFg2Fe8F5Ew E3tSL3quOjNfuDyz0LhpBdTJguXrHKQJUJgXB1BR5hFlokp5ztnJo5+a1A2JoowF0Gno+O SSQ93BfJYi4PRwk6b9QJ81+NQNfvHcUORdjqWMUIpVZdKoRn8UhzWgNAUSJUQvk9CS/18/ 9Qr+QZHlpIclIRwBvrxQxYUkMGJkPN2THuDWgBhcJc41HY9aiAHmKbpIMkBy8oIrId8gRk odKXs2yN9bCY7XuB4a+7g8+a9s4lPGXZUuzcdF81PpJFDqDHiRbrRWP6R6ESxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751258254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmU+gqwOPKJtOmUOnDgiXGbeKvVm9utFyC5oI3lNyBA=; b=iPI2R+5bbQTusGvdNvaYyahowMahUvc2hmDQON74VQeE4ecrpMGL7zsS0RDeqNqq1+tyWU RVLsZHzrpWR82w6x4HdI2VBHL57IKu43J1OEtJ2r7BeovkjVMGLO+P3QPSAm70hkQ2+GiH RihBsww8dvwOIilCP21bGBd7U7t6XyHT2lelqDF4fmuOOIZsxRKvmrnKXAUBJ1GIE9CdOi boLVQ6tpdr46BCKVA6DQIWr6EWTvmU/lMtmmGBZKCh+0VT1Onqg9jA+Ao6ec3fgjz6h4lo oH337t2W8Q4T0eHUVzJB8JnLTvX1KjXcEafc7zYj472drbbWISHnP74iKXgyxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751258254; a=rsa-sha256; cv=none; b=QLj7aRtAc7TyO/LyXuY99AcmX/euN+pNaIvLmdNnH6EGCsmnp6y3GeBLvkdHGam34Adnzc kxHBv9seXHGJy3j/r/TDGy4zXR7wPLBh4VLdmSxs7TyYOBSI37rgGNteO/TTnp8n78xkc1 E3o47YnsRPY4B/GrARwQyu6UolF1DKBHGd60pZ6t+8JW1jYRko8mKOimoAgmmMPXnjI+Zc 3iowZXFkqElD2y/TiVMpECpcngg8UYeaQSzf82gtfQgolM4L3DoyVYL8kZLyvBPtYW+zFq pedhSyNMiLuoRP9tL+JlmZZwZVccXq9DCEuQg5LedYeWanDkcm/pAXlFcqSShA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bVtgL4Q9yzpdq; Mon, 30 Jun 2025 04:37: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 55U4bYRN063747; Mon, 30 Jun 2025 04:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55U4bY0U063744; Mon, 30 Jun 2025 04:37:34 GMT (envelope-from git) Date: Mon, 30 Jun 2025 04:37:34 GMT Message-Id: <202506300437.55U4bY0U063744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 9a26b661ac5b - stable/14 - mididumpl.1: update link to Standard MIDI-File Format Spec. 1.1, updated List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a26b661ac5bed21364d89bb58e2836099ccce93 Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=9a26b661ac5bed21364d89bb58e2836099ccce93 commit 9a26b661ac5bed21364d89bb58e2836099ccce93 Author: Wolfram Schneider AuthorDate: 2025-06-23 05:36:51 +0000 Commit: Wolfram Schneider CommitDate: 2025-06-30 04:36:45 +0000 mididumpl.1: update link to Standard MIDI-File Format Spec. 1.1, updated PR: 287588 MFC after: 1 week (cherry picked from commit 27aec148ea4bfa2ccd2170ed1ccc6665aa819607) --- usr.bin/mididump/mididump.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/mididump/mididump.1 b/usr.bin/mididump/mididump.1 index 7b2bc649eb24..2f7f75d41e2d 100644 --- a/usr.bin/mididump/mididump.1 +++ b/usr.bin/mididump/mididump.1 @@ -64,7 +64,7 @@ argument corresponds to the MIDI device (e.g. .Re .Rs .%T Standard MIDI-File Format Spec. 1.1, updated -.%U https://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html +.%U https://midimusic.github.io/tech/midispec.html .Re .Rs .%T MIDI CC List for Continuous Controllers From nobody Mon Jun 30 14:21:24 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d03Fhtz60XP1; Mon, 30 Jun 2025 14:21: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 4bW7d02S33z482F; Mon, 30 Jun 2025 14:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IMXjFedC5hsMtHvPZCXlMuI722/a2KLSDQFDIuaRBk8=; b=mLCA8xLx5dfKnG+wQTpA+Be74Z3NwclACJsZ3gqLc4ctSSNMZ4oHxOyn/RL5lVeTLMUjw5 2FWc5ueNDqVRlsH1zaLW529Eh/zz8Ukl0YMzneDvEj+P6S7GYw1GtDFdUaMERe6GUQtRmf cvO/c3cdPavyD9OWEiBIiNiLwzK17ZKSn5v6wTyxTqYQyK+fXXKA7Kfele7mBVMJZpI3FK 4vXu8J6S16PWJRq0n7za4p6/3cklWsJknt8rwBx4tPB7fl2Mijw8P1EdCx1+zs529veoCy kEu3iUm6muuLztoE5I2YGepjT+tjMTLMyjUFCiPdHFf5KOrv555R5Y6YixRx3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IMXjFedC5hsMtHvPZCXlMuI722/a2KLSDQFDIuaRBk8=; b=m87XNWE4cG5m8nVL7qssMqhSEouIeLIUkat0brUsXBLngULd7sQItCknrdhhJdBxCwj7TB 7vcTFVEjMR9T/ja4tfXoS96PUxS7qMxXuEykd+2Tffo8d5Rs8OFJRu3boVSOdiVJGsBvKN a5WTbs7sJ4w1GNaJaGnWAyUVnh8cLDLRwdsKqg6VXfsvTXNCJWx0GylepDMNyKkWjYiJox yN0Pfr5X3T0Tno6cKXxe3HoAqsWyDzOVst7NZ1Vf9aMEEnAMA26PYrKqjZRKFFHQI3ZgKo PisSzGH4IVxkINomcVWNP0xTh2gb36nSS2U7uLANi/AE48srctWepXRrjqH26g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293284; a=rsa-sha256; cv=none; b=R7gwVbfGdi7ac0ISxz1DvkWZfoy92TD1leGdZaV4ngacdPWfmmi5KV/yvjs0aomUvUMdzL WwLL3PtleK5LI2s217DJrGvWP/Tkh7GVW/t50++Bi3ZAIuHtksb+x9Nq5H7/JeaJ3NFKr9 a4j74aDQ2oQI7vd1R7T7qiUSsb+1UyOC/wdaDGlltFu2UA+7P6a/kmhvytC5Oax1e3IaES I/QkFN9L4nfrBpQ/47iyROuGnpdlpLOxRU1SHYqu33pgAWcd/8MtHWnhFrbCBWpFLHptmS Hbn/u7ntUHXsndLvTfhQ3sHDkH0uvF0hUMlrVaS6J0lUG7rO+UlIb4f0CIl1yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d01sbdz178H; Mon, 30 Jun 2025 14:21: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 55UELOoW074995; Mon, 30 Jun 2025 14:21:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELOH2074992; Mon, 30 Jun 2025 14:21:24 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:24 GMT Message-Id: <202506301421.55UELOH2074992@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: 3feafab4a34c - stable/14 - namei: Make stackable filesystems check harder for jail roots List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3feafab4a34c95209cd4fc3e6224c324efc056f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3feafab4a34c95209cd4fc3e6224c324efc056f3 commit 3feafab4a34c95209cd4fc3e6224c324efc056f3 Author: Mark Johnston AuthorDate: 2025-05-23 12:52:24 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 namei: Make stackable filesystems check harder for jail roots Suppose a process has its cwd pointing to a nullfs directory, where the lower directory is also visible in the jail's filesystem namespace. Suppose that the lower directory vnode is moved out from under the nullfs mount. The nullfs vnode still shadows the lower vnode, and dotdot lookups relative to that directory will instantiate new nullfs vnodes outside of the nullfs mountpoint, effectively shadowing the lower filesystem. This phenomenon can be abused to escape a chroot, since the nullfs vnodes instantiated by these dotdot lookups defeat the root vnode check in vfs_lookup(), which uses vnode pointer equality to test for the process root. Fix this by extending nullfs and unionfs to perform the same check, exploiting the fact that the passed componentname is embedded in a nameidata structure to avoid changing the VOP_LOOKUP interface. That is, add a flag to indicate that containerof can be used to get the full nameidata structure, and perform the root vnode check on the lower vnode when performing a dotdot lookup. PR: 262180 Reviewed by: olce, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50418 (cherry picked from commit 7587f6d4840f8d363e457cddc14c184cf1fe7cc1) --- sys/fs/nullfs/null_vnops.c | 28 ++++++++++++++++++---------- sys/fs/unionfs/union_vnops.c | 21 +++++++++++++++++++++ sys/kern/vfs_cache.c | 11 +---------- sys/kern/vfs_lookup.c | 41 ++++++++++++++++++++++++++++++----------- sys/sys/namei.h | 5 ++++- 5 files changed, 74 insertions(+), 32 deletions(-) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index f2c426d41f61..41915da7f13c 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -407,17 +407,25 @@ null_lookup(struct vop_lookup_args *ap) /* * Renames in the lower mounts might create an inconsistent - * configuration where lower vnode is moved out of the - * directory tree remounted by our null mount. Do not try to - * handle it fancy, just avoid VOP_LOOKUP() with DOTDOT name - * which cannot be handled by VOP, at least passing over lower - * root. + * configuration where lower vnode is moved out of the directory tree + * remounted by our null mount. + * + * Do not try to handle it fancy, just avoid VOP_LOOKUP() with DOTDOT + * name which cannot be handled by the VOP. */ - if ((ldvp->v_vflag & VV_ROOT) != 0 && (flags & ISDOTDOT) != 0) { - KASSERT((dvp->v_vflag & VV_ROOT) == 0, - ("ldvp %p fl %#x dvp %p fl %#x flags %#jx", - ldvp, ldvp->v_vflag, dvp, dvp->v_vflag, (uintmax_t)flags)); - return (ENOENT); + if ((flags & ISDOTDOT) != 0) { + struct nameidata *ndp; + + if ((ldvp->v_vflag & VV_ROOT) != 0) { + KASSERT((dvp->v_vflag & VV_ROOT) == 0, + ("ldvp %p fl %#x dvp %p fl %#x flags %#jx", + ldvp, ldvp->v_vflag, dvp, dvp->v_vflag, + (uintmax_t)flags)); + return (ENOENT); + } + ndp = vfs_lookup_nameidata(cnp); + if (ndp != NULL && vfs_lookup_isroot(ndp, ldvp)) + return (ENOENT); } /* diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 7618e2575819..01378b06ba55 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -78,6 +78,21 @@ VNASSERT(((vp)->v_op == &unionfs_vnodeops), vp, \ ("%s: non-unionfs vnode", __func__)) +static bool +unionfs_lookup_isroot(struct componentname *cnp, struct vnode *dvp) +{ + struct nameidata *ndp; + + if (dvp == NULL) + return (false); + if ((dvp->v_vflag & VV_ROOT) != 0) + return (true); + ndp = vfs_lookup_nameidata(cnp); + if (ndp == NULL) + return (false); + return (vfs_lookup_isroot(ndp, dvp)); +} + static int unionfs_lookup(struct vop_cachedlookup_args *ap) { @@ -128,6 +143,12 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) if (LOOKUP != nameiop && udvp == NULLVP) return (EROFS); + if (unionfs_lookup_isroot(cnp, udvp) || + unionfs_lookup_isroot(cnp, ldvp)) { + error = ENOENT; + goto unionfs_lookup_return; + } + if (udvp != NULLVP) { dtmpvp = udvp; if (ldvp != NULLVP) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index e25efe2986b2..2c2e18640a76 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5185,7 +5185,6 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) struct componentname *cnp; struct namecache *ncp; struct vnode *dvp; - struct prison *pr; u_char nc_flag; ndp = fpl->ndp; @@ -5197,15 +5196,7 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) /* * XXX this is racy the same way regular lookup is */ - for (pr = cnp->cn_cred->cr_prison; pr != NULL; - pr = pr->pr_parent) - if (dvp == pr->pr_root) - break; - - if (dvp == ndp->ni_rootdir || - dvp == ndp->ni_topdir || - dvp == rootvnode || - pr != NULL) { + if (vfs_lookup_isroot(ndp, dvp)) { fpl->tvp = dvp; fpl->tvp_seqc = vn_seqc_read_any(dvp); if (seqc_in_modify(fpl->tvp_seqc)) { diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b7f751a364ce..1d303fecf493 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -612,12 +612,12 @@ namei(struct nameidata *ndp) } #endif ndp->ni_cnd.cn_cred = td->td_ucred; - KASSERT(ndp->ni_resflags == 0, ("%s: garbage in ni_resflags: %x\n", + KASSERT(ndp->ni_resflags == 0, ("%s: garbage in ni_resflags: %x", __func__, ndp->ni_resflags)); KASSERT(cnp->cn_cred && td->td_proc, ("namei: bad cred/proc")); KASSERT((cnp->cn_flags & NAMEI_INTERNAL_FLAGS) == 0, - ("namei: unexpected flags: %" PRIx64 "\n", - cnp->cn_flags & NAMEI_INTERNAL_FLAGS)); + ("namei: unexpected flags: %#jx", + (uintmax_t)(cnp->cn_flags & NAMEI_INTERNAL_FLAGS))); if (cnp->cn_flags & NOCACHE) KASSERT(cnp->cn_nameiop != LOOKUP, ("%s: NOCACHE passed with LOOKUP", __func__)); @@ -863,6 +863,30 @@ bad: return (error); } +struct nameidata * +vfs_lookup_nameidata(struct componentname *cnp) +{ + if ((cnp->cn_flags & NAMEILOOKUP) == 0) + return (NULL); + return (__containerof(cnp, struct nameidata, ni_cnd)); +} + +/* + * Would a dotdot lookup relative to dvp cause this lookup to cross a jail or + * chroot boundary? + */ +bool +vfs_lookup_isroot(struct nameidata *ndp, struct vnode *dvp) +{ + for (struct prison *pr = ndp->ni_cnd.cn_cred->cr_prison; pr != NULL; + pr = pr->pr_parent) { + if (dvp == pr->pr_root) + return (true); + } + return (dvp == ndp->ni_rootdir || dvp == ndp->ni_topdir || + dvp == rootvnode); +} + /* * FAILIFEXISTS handling. * @@ -1021,7 +1045,6 @@ vfs_lookup(struct nameidata *ndp) char *lastchar; /* location of the last character */ struct vnode *dp = NULL; /* the directory we are searching */ struct vnode *tdp; /* saved dp */ - struct prison *pr; size_t prev_ni_pathlen; /* saved ndp->ni_pathlen */ int docache; /* == 0 do not cache last component */ int wantparent; /* 1 => wantparent or lockparent flag */ @@ -1207,13 +1230,9 @@ dirloop: goto bad; } for (;;) { - for (pr = cnp->cn_cred->cr_prison; pr != NULL; - pr = pr->pr_parent) - if (dp == pr->pr_root) - break; - bool isroot = dp == ndp->ni_rootdir || - dp == ndp->ni_topdir || dp == rootvnode || - pr != NULL; + bool isroot; + + isroot = vfs_lookup_isroot(ndp, dp); if (__predict_false(isroot && (ndp->ni_lcf & (NI_LCF_STRICTREL | NI_LCF_STRICTREL_KTR)) != 0)) { if ((ndp->ni_lcf & NI_LCF_STRICTREL_KTR) != 0) diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 3db7b8e13749..5e9a5bf4a699 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -152,6 +152,7 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, #define LOCKSHARED 0x0100 /* Shared lock leaf */ #define NOFOLLOW 0x0000 /* do not follow symbolic links (pseudo) */ #define RBENEATH 0x100000000ULL /* No escape, even tmp, from start dir */ +#define NAMEILOOKUP 0x200000000ULL /* cnp is embedded in nameidata */ #define MODMASK 0xf000001ffULL /* mask of operational modifiers */ /* @@ -248,7 +249,7 @@ do { \ NDINIT_PREFILL(_ndp); \ NDINIT_DBG(_ndp); \ _ndp->ni_cnd.cn_nameiop = op; \ - _ndp->ni_cnd.cn_flags = flags; \ + _ndp->ni_cnd.cn_flags = (flags) | NAMEILOOKUP; \ _ndp->ni_segflg = segflg; \ _ndp->ni_dirp = namep; \ _ndp->ni_dirfd = dirfd; \ @@ -285,6 +286,8 @@ do { \ int namei(struct nameidata *ndp); int vfs_lookup(struct nameidata *ndp); +bool vfs_lookup_isroot(struct nameidata *ndp, struct vnode *dvp); +struct nameidata *vfs_lookup_nameidata(struct componentname *cnp); int vfs_relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, bool refstart); From nobody Mon Jun 30 14:21:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d172khz60XBr; Mon, 30 Jun 2025 14:21: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 4bW7d1347sz48Jq; Mon, 30 Jun 2025 14:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMrftG6Fwggx0Ptl30a6QW88W66iGXBPRSNUZRSvFEI=; b=bRYNCD7gZFuYhQpuE1MP1eNdEkDsgfl9IrGDaZYQTZ76RnQc4CMb7xcNmK+BuX0AEE4U4y AYDK8mtgZ7oan6ZF4S5h6l289d+5CeLLrzdoXNCKCa+nZ7SIARKZfMkbAxdQZ4oMb60OmX K0f6XEc/rGDFJyj0vyf6GXpxc7d/GLzKm09SO6ZWRpy69jAB+rtI3xyxEO24F7pbgiWiws UoggScoPkJw8U4ONQIu6P2IHnN1tiCL9xL0Zlh1E0wl1leYvHhcw4dSk7+SV1AzVyoznJK mHf6H0PJ53W5lhOU8Hv1cOAjSAJNTKk4Byi8JKaUP26q0BonmX41TCxJp/b/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMrftG6Fwggx0Ptl30a6QW88W66iGXBPRSNUZRSvFEI=; b=e2FbhUgXCE+1ADJrJBa52B/qnNpVFUgBwO2B70B4RCxBxs2EH7xTNh9KMBW1EY3s8Cs8rt 0lPcYrdM9cfO++rg7mwJhwEQ+DQUEPoezX4avhoaqnWP5jfvB0MYscOJtWflZXc65pAU/i 2XG1N049EkYt+maajPIVEOqUZqICxjzmSiNaSazSLWg3btevmnKbn3w1n8Efvrvnxh2nYF 2kviclWdqBJr6cEezLbgcAbJ34oTVcwx1xjyTHpbZBtlrGIQHg/hucUqAya8WOLlnnv8BZ XEqt0QkroFu8kUXTkVIVmg9V8kPYLnP+vOdmiey89ArXZFokL5fUcnCc/fOVEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293285; a=rsa-sha256; cv=none; b=cC3mpVEtV5qBrUw6nz34JcUIxyfn1tlntRBY+DW1IEKw/JmUMmUwYmcDmHSgp2N60gRDng GKw5k8KpkQ81DccssVddgQanLd8DSqhl4Q58Aaw33vVQuvnlNcNcz6/1Wp5Wp+X5pOmpG1 P2XIV+2ILMu/9DbKcdOLm8GXCWSUvKNfo41dgEBttyfGhQvY8pbTfapY0pxc8IuNmmqDuC tO6nu1bFe0ViY3agdQ6JYUUp06zmLf0759hVqeagidCSHVgHhAUbt4TkCx4CkEgz9gjtee giNV4mNSUvQvpn92acCojqONzCozvVVJo1q/8HPVYMZCIaybrUtH/ucfT+/+uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d12Sc9z175h; Mon, 30 Jun 2025 14:21: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 55UELPDi075705; Mon, 30 Jun 2025 14:21:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELP6R075690; Mon, 30 Jun 2025 14:21:25 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:25 GMT Message-Id: <202506301421.55UELP6R075690@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: 3f4efe392b70 - stable/14 - namei: Remove a now-unused variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f4efe392b7039686057838d723a2d43ae144be5 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3f4efe392b7039686057838d723a2d43ae144be5 commit 3f4efe392b7039686057838d723a2d43ae144be5 Author: Mark Johnston AuthorDate: 2025-05-23 15:35:05 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 namei: Remove a now-unused variable Reported by: bapt Fixes: 7587f6d4840f ("namei: Make stackable filesystems check harder for jail roots") (cherry picked from commit 14ec281a09d7818def2083ef0c3e28f8101f4268) --- sys/kern/vfs_cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 2c2e18640a76..47f0893dab27 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5182,16 +5182,14 @@ static int __noinline cache_fplookup_dotdot(struct cache_fpl *fpl) { struct nameidata *ndp; - struct componentname *cnp; struct namecache *ncp; struct vnode *dvp; u_char nc_flag; ndp = fpl->ndp; - cnp = fpl->cnp; dvp = fpl->dvp; - MPASS(cache_fpl_isdotdot(cnp)); + MPASS(cache_fpl_isdotdot(fpl->cnp)); /* * XXX this is racy the same way regular lookup is From nobody Mon Jun 30 14:21:26 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d25td5z60X7K; Mon, 30 Jun 2025 14:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bW7d23ptfz4869; Mon, 30 Jun 2025 14:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fDyRnRGOKD1lkDLcQXJLkhj4qRyS7ZUbL7NtFchL5f0=; b=ikh4WP8zS3cpZUvt5EBUYCRW2TiSqfo7N6PYbv6OwJl5JMwyZXSOQefQu6TUstWnKUC+SQ 9I1FhXcZwISQz2GLnxxbbGLB4upVyLlSQadbd+7Q6xIDvEba0pAIzbN4Uflt0Rq2WWTLWj KZyemDObSbq15hifs/ruqlOHUkWh5nXgwbr+w0akrTxM428vO/UhLxAhP4Y4OlFWb8PKJb WZFlrfVM+CVeisEqoSa92Opp8zr/2Dkbs3M7I5Am/yP6EoW3cqwst1msv9ggVOE2jJT6VX KBfiyhrQHRJS9+ZXSujlLsPt0fTZm4pIvXKDoVa4C1Rmm0GNuDaU6lig3YnvvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fDyRnRGOKD1lkDLcQXJLkhj4qRyS7ZUbL7NtFchL5f0=; b=gh/EYEyL3t7uTjAoYtKh4VnCred//JDdmlXIqK7BfkXmpOscE4gGjqMucYTelvp5rKWv39 HaWTdnBeOC2xRNrOOBkYXTRW+IZnrMd5dEDUwuXLbA0AbmCF6SroL30Q2fA2uCXDc4ne/k Wcc/7DOQnHf/H7h1tOQ2Z38xcXDyH/B7cPpZdG2ajk3OFOUmSQ/vSRcedwC6/LGLgzq+65 AORpdHJ7wH7LyriYQ7CYQIggxrYUW4yei2BdbG5dcUJXHGiv/rm1dBmu3/dfNRQ+8jocLS TN2M2SDADeiDId5Uf+7dpII/2FWaU7espQVcsxeQ8ZTKpQMw8q9OxKQtSfB5YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293286; a=rsa-sha256; cv=none; b=Xdlz4AibLocVUebdihwvBK8EuUGG1WSxxyskUjODPeXGV+joHpYwv0r6niKBt4dDxPpOmk rdh22iX8lH2hQqN1BLWRYP/M25FyjlvfFDi6ukC0+e7urkc4541HZAd/O+4NNfcnJPzzsM uEP5ed37Wj5v7bo9PPyInPpRgrPQxzVzMWLR497CS3pGhXANScmejudUB6NmzDVrgHB6+6 GDZ3a4cRcFIEjaNrkmN0OLsC3MwSoYy3cclvqvRIH0waU91nlPt7UWP+jMUCJgMazkNuzC PFMnndJxsd/Q0CaNEl2e9YXuznAKTHoCukfTnksRAE0n6ETFdDQncePSlxZ4aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d23Nv9z178J; Mon, 30 Jun 2025 14:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55UELQWw076111; Mon, 30 Jun 2025 14:21:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELQYa076108; Mon, 30 Jun 2025 14:21:26 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:26 GMT Message-Id: <202506301421.55UELQYa076108@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: 031cd548775c - stable/14 - vfs cache: Add NAMEILOOKUP to the whitelist of fastpath lookup flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 031cd548775c26314e6ae9cad35b01c5ab1aea6c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=031cd548775c26314e6ae9cad35b01c5ab1aea6c commit 031cd548775c26314e6ae9cad35b01c5ab1aea6c Author: Mark Johnston AuthorDate: 2025-05-27 13:27:49 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 vfs cache: Add NAMEILOOKUP to the whitelist of fastpath lookup flags Otherwise the lockless name lookup path is inadvertently disabled since NAMEILOOKUP isn't recognized. Reviewed by: olce, kib Fixes: 7587f6d4840f ("namei: Make stackable filesystems check harder for jail roots") Differential Revision: https://reviews.freebsd.org/D50532 (cherry picked from commit f4158953007f557061d91f99d2374d48d8376cc6) --- sys/kern/vfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 47f0893dab27..3942371c0962 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4369,7 +4369,7 @@ cache_fpl_terminated(struct cache_fpl *fpl) (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ FAILIFEXISTS | FOLLOW | EMPTYPATH | LOCKSHARED | ISRESTARTED | WILLBEDIR | \ ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK | OPENREAD | \ - OPENWRITE | WANTIOCTLCAPS) + OPENWRITE | WANTIOCTLCAPS | NAMEILOOKUP) #define CACHE_FPL_INTERNAL_CN_FLAGS \ (ISDOTDOT | MAKEENTRY | ISLASTCN) From nobody Mon Jun 30 14:21:27 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d35QVkz60X7L; Mon, 30 Jun 2025 14:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bW7d34NPgz48Kh; Mon, 30 Jun 2025 14:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rtYkXFCN1i2+gbWbgkU+SGqOvDJZ2/fCpD7cNXxLapU=; b=lIEBezHcbKasps/3E6U31HBFzTA1/jrm/al9sfctaAOPZl19sDFzci83fcWGvFI7PNnGcH O+Kr6m6JSVyn9+HqCDdF3p+vzZh7OYA0otlDhUpyT7vA2aoDUuWjpKWkJdHBYPoMYrvLKk 8N8fvSeEexiqjTWNNkN1UqaMePz8qn8kKuOt1qGIR4VDQGoi/o0N76pYL2PvXp2pj8/7C5 r5Nr/IUI8QZyMkeT02GimInR3MNX+X76PvJ0s0iVrqLJYYZ1sNXp1cZN13+RvuayCBJWgI 1Lq5Uvlj7ulufOXFbPXvwmhaAD65lXtBiPId+MPtoWww0vpqxIwVaAVNvSTyPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rtYkXFCN1i2+gbWbgkU+SGqOvDJZ2/fCpD7cNXxLapU=; b=u2bXdHSPFtkM+MWTF0st0bn4mScIIECohrm3IWQJ1UZ3vOkBOMd0eEGr2+2LZK9rqdka1I EuGBBojUF7rB8Y7RsHHbUEuTntLsQjmIMA+YGKs6bQeFhqr4qkcWPJFBVxaMz3dnRffBFa iYygMqqAnFtA5APYyg0wv+RqqfhzRL61gROdEJzSRsVDjx5ZHjgw8WTvdWLfR1DW9OyKKu PnNpo/bXVsYhxFxtNSbvf6epHYP8njsd4D3kHJ9IGWc/IvmeQll8gU0isJdtG51u2ku29v FY5dS4Fg0frmZyDAF8kSS9b+HWCUGs4OYbcsbZNJ9RkXOn80og+RsHfJVm3v3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293287; a=rsa-sha256; cv=none; b=gkIna0xS/szJsNkiVFg8qQvhSpsWmmKxUPOlzB9xElKomXnWAW6ahI2sHVCEyEdAx1j0Sx zUwaW4ydsadwQjj8uarAND+ues3W68imzsFCcrYAojlavL+yKXPVDCsGmHfpzfgUImWppJ yGBRy8IZz9Sdmxv2qcZ4NVYefNgkXCACav94tumP9z/ND4ppdjtN1An5WUcT8SOOc2SzP4 CI1vjKpGW4puu/57cNvwuPmj+aZN9VzbtwalGWXrtj9HGsuifVHPWFgm0L1ygZ0On2Kv5l Xe1WTL0RIPUjW72RVucjebFz7Xh7fCw7uOr3jfm8pI9LVCrH+JIFxQvvah3X5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d33vvRz179C; Mon, 30 Jun 2025 14:21: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 55UELR3h076144; Mon, 30 Jun 2025 14:21:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELRpd076141; Mon, 30 Jun 2025 14:21:27 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:27 GMT Message-Id: <202506301421.55UELRpd076141@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: a66767844690 - stable/14 - vfs: Don't clobber namei flags in vn_open_cred() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a66767844690dfd82e14df2d22bd9bc40e46546b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a66767844690dfd82e14df2d22bd9bc40e46546b commit a66767844690dfd82e14df2d22bd9bc40e46546b Author: Mark Johnston AuthorDate: 2025-05-28 13:35:24 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 vfs: Don't clobber namei flags in vn_open_cred() Otherwise NAMEILOOKUP is cleared. More generally it seems quite surprising that the flags set by vn_open_cred() callers are not automatically preserved. Modify open2nameif() such that it takes already-set namei flags into account. Reviewed by: olce, kib Fixes: 7587f6d4840f ("namei: Make stackable filesystems check harder for jail roots") Differential Revision: https://reviews.freebsd.org/D50531 (cherry picked from commit e05e33041c252dc236939683c01ca4b7b083562c) --- sys/kern/vfs_vnops.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index c447ceea1634..c3666ca99c26 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -197,11 +197,11 @@ vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp) } static uint64_t -open2nameif(int fmode, u_int vn_open_flags) +open2nameif(int fmode, u_int vn_open_flags, uint64_t cn_flags) { uint64_t res; - res = ISOPEN | LOCKLEAF; + res = ISOPEN | LOCKLEAF | cn_flags; if ((fmode & O_RESOLVE_BENEATH) != 0) res |= RBENEATH; if ((fmode & O_EMPTY_PATH) != 0) @@ -210,12 +210,17 @@ open2nameif(int fmode, u_int vn_open_flags) res |= OPENREAD; if ((fmode & FWRITE) != 0) res |= OPENWRITE; + if ((fmode & O_NOFOLLOW) != 0) + res &= ~FOLLOW; if ((vn_open_flags & VN_OPEN_NOAUDIT) == 0) res |= AUDITVNODE1; + else + res &= ~AUDITVNODE1; if ((vn_open_flags & VN_OPEN_NOCAPCHECK) != 0) res |= NOCAPCHECK; if ((vn_open_flags & VN_OPEN_WANTIOCTLCAPS) != 0) res |= WANTIOCTLCAPS; + return (res); } @@ -247,7 +252,9 @@ restart: return (EINVAL); else if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT) { ndp->ni_cnd.cn_nameiop = CREATE; - ndp->ni_cnd.cn_flags = open2nameif(fmode, vn_open_flags); + ndp->ni_cnd.cn_flags = open2nameif(fmode, vn_open_flags, + ndp->ni_cnd.cn_flags); + /* * Set NOCACHE to avoid flushing the cache when * rolling in many files at once. @@ -256,8 +263,8 @@ restart: * exist despite NOCACHE. */ ndp->ni_cnd.cn_flags |= LOCKPARENT | NOCACHE | NC_KEEPPOSENTRY; - if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0) - ndp->ni_cnd.cn_flags |= FOLLOW; + if ((fmode & O_EXCL) != 0) + ndp->ni_cnd.cn_flags &= ~FOLLOW; if ((vn_open_flags & VN_OPEN_INVFS) == 0) bwillwrite(); if ((error = namei(ndp)) != 0) @@ -325,9 +332,8 @@ restart: } } else { ndp->ni_cnd.cn_nameiop = LOOKUP; - ndp->ni_cnd.cn_flags = open2nameif(fmode, vn_open_flags); - ndp->ni_cnd.cn_flags |= (fmode & O_NOFOLLOW) != 0 ? NOFOLLOW : - FOLLOW; + ndp->ni_cnd.cn_flags = open2nameif(fmode, vn_open_flags, + ndp->ni_cnd.cn_flags); if ((fmode & FWRITE) == 0) ndp->ni_cnd.cn_flags |= LOCKSHARED; if ((error = namei(ndp)) != 0) From nobody Mon Jun 30 14:21:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d46Tfmz60XTg; Mon, 30 Jun 2025 14:21: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 4bW7d45DRsz4805; Mon, 30 Jun 2025 14:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ei2F4rPJR/WByS3+1PVisg/o9nJFFfgh1VxFPrywxHY=; b=OPkiN3ZZIoK4bT7onKgqGaXT3KK1/d5kVBqVvSW8hBYoLGtsEwKx5pCyXn8BJPZp/uBvUZ 4fI33KbclhmGon6R4Z7RWNnrSBZ2hvTd68TUbE8UuEavgPaxc9HriXLz83zD1qKfLaj/w3 SZX5H0QQn6RslA83Xf3aArM38HklyUJoL+hY2ROtG1zxYabknpbNI9bF4pIT6uKAW4RDUg hwmtOhMclEFnyKj8A8OuoeUFcvw/rRxlTVy7wgqhvBPtuEMmhcyWavdYgTHRF2+ajqgn/c kvhOOKOLyX89/9al/J4/1ZgxzuJ8WU9WshIhlaWyG0EHc5KTY4k/QStCbgkIww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ei2F4rPJR/WByS3+1PVisg/o9nJFFfgh1VxFPrywxHY=; b=XHyBUyNGqvzygZ33LgTxFjlU8fcwvJcUK59IS8V9gi6hVRnKvdtP98VqK8X4JuAzC8duf4 hfeemR8qCE36nlgDX1VKYDx/LgedRkt+k9jEpYfW9wfdHF2+UR57ngE33rjgGQqVp9ILFk rOc1ZqJDGU1MN+o5iPJYO4+1dp+GTsKKLvmSnMqAI2Tx7DWXBUIsCn2KpjCu4cW7ibP0IM +lUyK09NwCPY6HXtwQMaKLYYDSwz9nukJWPcgckdACE7lOuWe+bKCOEkqg25H3dBJJ7jBr wLkJ+7S01AXsIXD03VpMZE51RfSie4GQI+IQ6MSpyVep+GdA1lQgUzbPsjKVAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293288; a=rsa-sha256; cv=none; b=Bh6VCj9M/ukLic93wDbaGGIWp7RhFBEuUMlwx9AhrDla2iRAKAobHZpQ/8pqal4v3dGKL8 8TVhIdLrJw+MMkE2cVFyXDPBqt510yIF0M3O859ev8/X1fGMgML9vorhSC8wBzAsqCgQqz T5uqRMKrrW3AgGZ8B51QRknRhIiV9v7nlzxvWrBVlHm0tewY+LWvl/Y7bYs//uTXtrv5AP Q0H6nLxf7cTtF8NmK5g+6lQ5MkaIr/dL6KfMbtu1CO8ppN6F1J4vKlbdmA5/qEcSr0udXd mF6fQC5DA7OhsbVI34TN8qEOKh0OwNqGeq93eyQWc0uU/u0nR5yOxlMGcpa6qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d44rXlz16qM; Mon, 30 Jun 2025 14:21: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 55UELS5m076184; Mon, 30 Jun 2025 14:21:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELSx8076181; Mon, 30 Jun 2025 14:21:28 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:28 GMT Message-Id: <202506301421.55UELSx8076181@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: 53963866f708 - stable/14 - namei: clear internal flags in NDREINIT() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 53963866f7088dd96f6d56169e6b4fb899277306 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=53963866f7088dd96f6d56169e6b4fb899277306 commit 53963866f7088dd96f6d56169e6b4fb899277306 Author: Konstantin Belousov AuthorDate: 2025-05-28 21:51:42 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 namei: clear internal flags in NDREINIT() same as it is done for NDRESTART() Fixes: e05e33041c252 Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation (cherry picked from commit 58b2bd33aff71c0268d99d63e9c83f6544d3beb3) --- sys/sys/namei.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 5e9a5bf4a699..7033e5469240 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -265,6 +265,7 @@ do { \ filecaps_free(&_ndp->ni_filecaps); \ _ndp->ni_resflags = 0; \ _ndp->ni_startdir = NULL; \ + _ndp->ni_cnd.cn_flags &= ~NAMEI_INTERNAL_FLAGS; \ } while (0) #define NDPREINIT(ndp) do { \ From nobody Mon Jun 30 14:21:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d62y9pz60X2b; Mon, 30 Jun 2025 14:21: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 4bW7d56T4xz48Rl; Mon, 30 Jun 2025 14:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U0/HzoZMhXPphqZNiWnbAs+XoQQ3pEyQPE7If7VFGAw=; b=pxpuWDVK+wCOK3w18YNngw0WRopHejkOGyWYjilMBRVp6vnqHJTCKM5rto3Vj1uEpuKH8Y LqL/c58kW2bUMLdd7Y5R9H037dwmLjXaRkdBi8r945WO01G2Td4UvdVEF6G62mvGB9/8So 7YR173HNatPbeOkJ//Z55OCPNhQ0SRafK0tN9B0kuYZiW6tlrngGBbLzzPbEQ+cBWyWImI ixJ0ZhLDnLo2UaRL6upW0EMJOSO7a94bZpObrlQuhXRsJPNg9yBCqoozczn4OfIBul/Ymq iGzw1ByUEFd/0vFsKLGVfredWMB07CRCg9fvrp/+TCTCcoUmK7LofctpvhdTFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U0/HzoZMhXPphqZNiWnbAs+XoQQ3pEyQPE7If7VFGAw=; b=rVTfFPiWY+YdnsMY3RrLva7knTU0xGMZYcarS/VsumuWT4jdhKIofZADqHfp6aMwqgVcuk yf1Ft9Y3NHaB4sNXh/+NpSCPwuM6toZlam8LLgfoFZ3FwyocvFUIaqtz/JHvXa+bIq3du0 4We5LfVLg4R+YdsVWFTBz/N/1b6/VSI8amxDdSQDT3bLc7A8XvmqPkF0r6XGmEuTLBIqiI SuVMC0fFIN6BwkVjTFOnCjaQyzgd0rybWRqU0AIBRXJ72ApFylgQ6LH/KxMaAsYVU9PziW NPTY7nCIQiVH9RSwKliZz4/VArFIKCIBbXtUr+I0743gngz9iOTX1gKFNCoHDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293290; a=rsa-sha256; cv=none; b=FLz7ha7ZUwaTT6u/RIcOhGLDLOQXJ1vrtX3UG6x9v5la3KoVQFxd7cpjeDqzifeb85xTdT F4yezO6e3EXp5MjNaMKgpljJDgDv6STL2W5556nbxSR2NHk1Nal6xOvHQIiQ/CFZruYfp4 1YCI3TKi1zF4oWBXx4atsV+SaaYyaoS7uEttN29jqGXzKThQmRfSpVaxMZiiPf6dl/Ex7V QT8ZpuxqazjCTqXWc7auRmIHg46Xjol7jWOJ6MrYfs/0V+YabdfuHMn515JBL7OxMxjAHZ CojGvLzHDU1DDvvNvOEZ9ner1OhdxncZTQQOHAnLyk3D4D1UwcChUwAUsWXgEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d55Tmhz175j; Mon, 30 Jun 2025 14:21: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 55UELTS4076220; Mon, 30 Jun 2025 14:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELTF3076217; Mon, 30 Jun 2025 14:21:29 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:29 GMT Message-Id: <202506301421.55UELTF3076217@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: f56b66f1260a - stable/14 - tests: Add a regression test for commit 7587f6d4840f8 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f56b66f1260a33e49c65bbc05213ec8267978a93 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f56b66f1260a33e49c65bbc05213ec8267978a93 commit f56b66f1260a33e49c65bbc05213ec8267978a93 Author: Mark Johnston AuthorDate: 2025-05-28 15:28:36 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 tests: Add a regression test for commit 7587f6d4840f8 Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50533 (cherry picked from commit a5dac34f6e98c47bd7cb1946e39cc45432e167a8) --- tests/sys/kern/Makefile | 2 + tests/sys/kern/jail_lookup_root.c | 171 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 46977bedef98..89c993a39dc7 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -19,6 +19,7 @@ ATF_TESTS_C+= kern_descrip_test # One test modifies the maxfiles limit, which can cause spurious test failures. TEST_METADATA.kern_descrip_test+= is_exclusive="true" ATF_TESTS_C+= fdgrowtable_test +ATF_TESTS_C+= jail_lookup_root ATF_TESTS_C+= kill_zombie .if ${MK_OPENSSL} != "no" ATF_TESTS_C+= ktls_test @@ -71,6 +72,7 @@ PROGS+= coredump_phnum_helper PROGS+= pdeathsig_helper PROGS+= sendfile_helper +LIBADD.jail_lookup_root+= jail util CFLAGS.sys_getrandom+= -I${SRCTOP}/sys/contrib/zstd/lib LIBADD.sys_getrandom+= zstd LIBADD.sys_getrandom+= c diff --git a/tests/sys/kern/jail_lookup_root.c b/tests/sys/kern/jail_lookup_root.c new file mode 100644 index 000000000000..609f86ac4c66 --- /dev/null +++ b/tests/sys/kern/jail_lookup_root.c @@ -0,0 +1,171 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Mark Johnston + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +static void +build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, + size_t len) +{ + int i; + + if (*iovlen < 0) + return; + i = *iovlen; + *iov = realloc(*iov, sizeof **iov * (i + 2)); + if (*iov == NULL) { + *iovlen = -1; + return; + } + (*iov)[i].iov_base = strdup(name); + (*iov)[i].iov_len = strlen(name) + 1; + i++; + (*iov)[i].iov_base = val; + if (len == (size_t)-1) { + if (val != NULL) + len = strlen(val) + 1; + else + len = 0; + } + (*iov)[i].iov_len = (int)len; + *iovlen = ++i; +} + +static void +free_iovec(struct iovec **iov, int *iovlen) +{ + int i; + + for (i = 0; i < *iovlen; i += 2) + free((*iov)[i].iov_base); + free(*iov); +} + +static void +mkdir_checked(const char *dir, mode_t mode) +{ + int error; + + error = mkdir(dir, mode); + ATF_REQUIRE_MSG(error == 0 || errno == EEXIST, + "mkdir %s: %s", dir, strerror(errno)); +} + +static void __unused +mount_nullfs(const char *dir, const char *target) +{ + struct iovec *iov; + char errmsg[1024]; + int error, iovlen; + + iov = NULL; + iovlen = 0; + + build_iovec(&iov, &iovlen, __DECONST(char *, "fstype"), + __DECONST(char *, "nullfs"), (size_t)-1); + build_iovec(&iov, &iovlen, __DECONST(char *, "fspath"), + __DECONST(char *, target), (size_t)-1); + build_iovec(&iov, &iovlen, __DECONST(char *, "from"), + __DECONST(char *, dir), (size_t)-1); + build_iovec(&iov, &iovlen, __DECONST(char *, "errmsg"), + errmsg, sizeof(errmsg)); + + errmsg[0] = '\0'; + error = nmount(iov, iovlen, 0); + ATF_REQUIRE_MSG(error == 0, "nmount: %s", + errmsg[0] != '\0' ? errmsg : strerror(errno)); + + free_iovec(&iov, &iovlen); +} + +ATF_TC_WITH_CLEANUP(jail_root); +ATF_TC_HEAD(jail_root, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(jail_root, tc) +{ + int error, fd, jid; + + mkdir_checked("./root", 0755); + mkdir_checked("./root/a", 0755); + mkdir_checked("./root/b", 0755); + mkdir_checked("./root/a/c", 0755); + + jid = jail_setv(JAIL_CREATE | JAIL_ATTACH, + "name", "nullfs_jail_root_test", + "allow.mount", "true", + "allow.mount.nullfs", "true", + "enforce_statfs", "1", + "path", "./root", + "persist", NULL, + NULL); + ATF_REQUIRE_MSG(jid >= 0, "jail_setv: %s", jail_errmsg); + + mount_nullfs("/a", "/b"); + + error = chdir("/b/c"); + ATF_REQUIRE(error == 0); + + error = rename("/a/c", "/c"); + ATF_REQUIRE(error == 0); + + /* Descending to the jail root should be ok. */ + error = chdir(".."); + ATF_REQUIRE(error == 0); + + /* Going beyond the root will trigger an error. */ + error = chdir(".."); + ATF_REQUIRE_ERRNO(ENOENT, error != 0); + fd = open("..", O_RDONLY | O_DIRECTORY); + ATF_REQUIRE_ERRNO(ENOENT, fd < 0); +} +ATF_TC_CLEANUP(jail_root, tc) +{ + struct statfs fs; + fsid_t fsid; + int error, jid; + + error = statfs("./root/b", &fs); + if (error != 0) + err(1, "statfs ./b"); + fsid = fs.f_fsid; + error = statfs("./root", &fs); + if (error != 0) + err(1, "statfs ./root"); + if (fsid.val[0] != fs.f_fsid.val[0] || + fsid.val[1] != fs.f_fsid.val[1]) { + error = unmount("./root/b", 0); + if (error != 0) + err(1, "unmount ./root/b"); + } + + jid = jail_getid("nullfs_jail_root_test"); + if (jid >= 0) { + error = jail_remove(jid); + if (error != 0) + err(1, "jail_remove"); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, jail_root); + return (atf_no_error()); +} From nobody Mon Jun 30 14:21:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d75451z60XCS; Mon, 30 Jun 2025 14:21:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bW7d672K4z48WS; Mon, 30 Jun 2025 14:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yu/IsirxCx3hudaSaa/yJLTW29yQo7YuNwgQgMfapkA=; b=yH/dn7xy/d6dQBTIPXeGfkiuUVUMF7L6ciblLg3wK48G2w42VYlLU09sgiXXXvxaISippK tQ0am1p2rKiQQnLY/K72mF16VPdYQtQZQ/wnV1igS7a/5ZSrSb+eAOeulRTblcvQ+FmHXZ aVHvdbQJSMU2tIvmxZZmV5HTSvwJJYueD5RtnXYeVuygK7CsEmvaiwBEfcMbpDVq6brStJ Lw5Xe5/sMX/XwBnRO0BNg090n5f9SrBCtGfXscCHyGXaw+h4KaAM6gWEIog2JipMAKHjr/ OacTXsnFNFiEiSpKjHpERmm4y7qHGODDCyMeBbczdd4KPogUCUn25ipaOhQzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yu/IsirxCx3hudaSaa/yJLTW29yQo7YuNwgQgMfapkA=; b=WxJaTmrhh4peGY/75b1id+8CP0z5DkJT0oRq92I75S/xg18f2ryjv9V60ZItcJo8g1eTlA rWDcZq1zV0r/c5fFL/c8+wygkxrn+f+xvPBCN5i6q0vr4j1fbxgnh5WtRWzS1+PdIvBcmu H3OJpyi4vhgMRbgOIz60pUJjMeOBdOoqGvkl0Du/u0U+vbbpRaWdXRqTmll2q7c2+X/q8l 9uutxASvbuOrfL6cbx9KKPPhHbg09olvmU42cP1uQdP/f2BQ3HT8lEw4gczlCF6BG+bfeI PhZMQ/GepvbbZQj36LWPHW9jD7UvPy+E74p8xqJCRk6xXK4wxVLwOkSlMBmjrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293291; a=rsa-sha256; cv=none; b=ZCPoPi5uiNmT8OWWh1sDc+Pn4n4mlqPVtjwTkeCyF/kBzvD11R3dGKc7Nki0fO2MkvAorQ AXhy+sGUk+4eQFZuhk5/3nqnf6K1CnVyOTslEo6lJ+hYEXNgV1ly4MPGnZWLTlPZ+AA0Nq Kz1+e1wcNKjFU1H+UWJ3Uy7M06FdU7YHO+h7Z3eNvlZ0OiaHxV4dCuW4vbC7Xszk2MHXs0 tYzo3AmuwmPnuQcBCsxEAtYZFS2bXfnFjloUz6OAMlGtbjDAVDCMOYgrTN4+/Iu4W2gu5x gn3IG8x2B9VV9j1aqdCGqUlwh1yxwPw8pdpugQ7mkAbdKOiOaAHWc8uQj5U0RQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d66Q04z178L; Mon, 30 Jun 2025 14:21: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 55UELUJK076254; Mon, 30 Jun 2025 14:21:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELU0s076251; Mon, 30 Jun 2025 14:21:30 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:30 GMT Message-Id: <202506301421.55UELU0s076251@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: 336fec57a6cc - stable/14 - linux: Fix usage of ptrace(PT_GET_SC_ARGS) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 336fec57a6cc0a4ee58ed9a094905ad4ad7030fe Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=336fec57a6cc0a4ee58ed9a094905ad4ad7030fe commit 336fec57a6cc0a4ee58ed9a094905ad4ad7030fe Author: Mark Johnston AuthorDate: 2025-06-13 19:03:03 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 linux: Fix usage of ptrace(PT_GET_SC_ARGS) The native handler expects the argument to be a pointer to an array of 8 syscall arguments, whereas the emulation provided an array that holds up to 6. Handle this by adding a new range of Linuxulator-specific ptrace commands. In particular, introduce PTLINUX_GET_SC_ARGS, which always copies exactly six arguments. This fixes the problem and removes the hack of checking the target thread ABI to decide whether to apply a Linux-specific quirk to PT_GET_SC_ARGS. Reviewed by: kib MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50758 (cherry picked from commit 48a656c588f9fb995b9c524b57dd5febd9f69168) --- sys/compat/freebsd32/freebsd32_misc.c | 3 +++ sys/compat/linux/linux_ptrace.c | 18 ++++-------------- sys/kern/sys_process.c | 27 +++++++++++++++++++++------ sys/sys/ptrace.h | 8 ++++++++ 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index a8331897316d..951d9c28b7f1 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1177,6 +1177,9 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) pscr_args[i] = pscr_args32[i]; r.sr.pscr_args = pscr_args; break; + case PTLINUX_FIRST ... PTLINUX_LAST: + error = EINVAL; + break; default: addr = uap->addr; break; diff --git a/sys/compat/linux/linux_ptrace.c b/sys/compat/linux/linux_ptrace.c index 421760eab2a9..0dbfd2177122 100644 --- a/sys/compat/linux/linux_ptrace.c +++ b/sys/compat/linux/linux_ptrace.c @@ -386,21 +386,11 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, if (lwpinfo.pl_flags & PL_FLAG_SCE) { si.op = LINUX_PTRACE_SYSCALL_INFO_ENTRY; si.entry.nr = lwpinfo.pl_syscall_code; - /* - * The use of PT_GET_SC_ARGS there is special, - * implementation of PT_GET_SC_ARGS for Linux-ABI - * callers emulates Linux bug which strace(1) depends - * on: at initialization it tests whether ptrace works - * by calling close(2), or some other single-argument - * syscall, _with six arguments_, and then verifies - * whether it can fetch them all using this API; - * otherwise it bails out. - */ - error = kern_ptrace(td, PT_GET_SC_ARGS, pid, - &si.entry.args, sizeof(si.entry.args)); + error = kern_ptrace(td, PTLINUX_GET_SC_ARGS, pid, + si.entry.args, sizeof(si.entry.args)); if (error != 0) { - linux_msg(td, "PT_GET_SC_ARGS failed with error %d", - error); + linux_msg(td, + "PT_LINUX_GET_SC_ARGS failed with error %d", error); return (error); } } else if (lwpinfo.pl_flags & PL_FLAG_SCX) { diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 4d1d0ef21a15..f81013ffb842 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -696,6 +696,9 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) break; r.sr.pscr_args = pscr_args; break; + case PTLINUX_FIRST ... PTLINUX_LAST: + error = EINVAL; + break; default: addr = uap->addr; break; @@ -1172,7 +1175,9 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) break; case PT_GET_SC_ARGS: - CTR1(KTR_PTRACE, "PT_GET_SC_ARGS: pid %d", p->p_pid); + case PTLINUX_GET_SC_ARGS: + CTR2(KTR_PTRACE, "%s: pid %d", req == PT_GET_SC_ARGS ? + "PT_GET_SC_ARGS" : "PT_LINUX_GET_SC_ARGS", p->p_pid); if (((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 && td2->td_sa.code == 0) #ifdef COMPAT_FREEBSD32 @@ -1182,11 +1187,21 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) error = EINVAL; break; } - bzero(addr, sizeof(td2->td_sa.args)); - /* See the explanation in linux_ptrace_get_syscall_info(). */ - bcopy(td2->td_sa.args, addr, SV_PROC_ABI(td->td_proc) == - SV_ABI_LINUX ? sizeof(td2->td_sa.args) : - td2->td_sa.callp->sy_narg * sizeof(syscallarg_t)); + if (req == PT_GET_SC_ARGS) { + bzero(addr, sizeof(td2->td_sa.args)); + bcopy(td2->td_sa.args, addr, td2->td_sa.callp->sy_narg * + sizeof(syscallarg_t)); + } else { + /* + * Emulate a Linux bug which which strace(1) depends on: + * at initialization it tests whether ptrace works by + * calling close(2), or some other single-argument + * syscall, _with six arguments_, and then verifies + * whether it can fetch them all using this API; + * otherwise it bails out. + */ + bcopy(td2->td_sa.args, addr, 6 * sizeof(syscallarg_t)); + } break; case PT_GET_SC_RET: diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 3cce2c088f0b..85c6b2d5366a 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -89,8 +89,16 @@ #define PT_SC_REMOTE 44 /* Execute a syscall */ #define PT_FIRSTMACH 64 /* for machine-specific requests */ +#define PT_LASTMACH 127 #include /* machine-specific requests, if any */ +#ifdef _KERNEL +/* Space for Linux ptrace emulation. */ +#define PTLINUX_FIRST 128 +#define PTLINUX_LAST 191 +#define PTLINUX_GET_SC_ARGS (PTLINUX_FIRST + 0) +#endif + /* Events used with PT_GET_EVENT_MASK and PT_SET_EVENT_MASK */ #define PTRACE_EXEC 0x0001 #define PTRACE_SCE 0x0002 From nobody Mon Jun 30 14:21:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d84NqDz60X2f; Mon, 30 Jun 2025 14:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bW7d80zctz4874; Mon, 30 Jun 2025 14:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5UJh35miaTTS63BrYPz2VpW/B10/bUlO8NslMDTkBko=; b=s2wjkFSfLcpkiXlWivKD7B1Gsuiu9DtKnWb92RfbHBuLZvHuL8+pwS18yL5UtBTeMfs5qQ 2nKqVciNXFOHHPHGagnN3PPcm6yw16UI0ITGUFagCtn2AaR25OMr63WM+iOEksO02fhElf BP7W9L+kquDD2gNkLZY0mpSfyuZI7VdXh9/7/7Frgu3Tl9EmzR545n2NFKTDHxJnJtT4y1 Tnyulbr2aGQR8uO9+W2mf7Mzu4/g9vVJUun2x/3x6RjYn27dk8OE64nSl1/1gIWjKL5GUJ HjKDRVHNMOVAhSkispNvICYAeaVR2uag/w0NINGwiRhPs9EfLqGMT/sRUWqTMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5UJh35miaTTS63BrYPz2VpW/B10/bUlO8NslMDTkBko=; b=b8T6c9FXnN8GqxWZKCg5/ig7kPGdhdTIe4fn4pBqZbw3ZrlH/hPiHbkBqgSJE8BX4UfPmX cipmb4PuCfaWF/ax7fBumTD9918RwGcabPJPTLD2qHT2F7ZJz1Cu1vy3erLGYIu//FK+rE oMerMyFPEr/r5ZXuj4N931zXZCJD54fqX0sYsNUmx4bA6AQEX/hlMY49fZ2tA3mgc/bEmW D2tQqt8poXVNM6ZtJpb8jn5ZHCyxIqyfRkHY4O9/pBmgyXklRJnSw5DRgonxKIxglVzAL+ 6lZvLjvjqOjVs40deT/i93gw/7flBJpLBUZ76WZ0zRHFvuUGICP9O8MD+F/Gyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293292; a=rsa-sha256; cv=none; b=PYn5aM57QDK0wtkVD1GXDWG9/xPFoDr6nzSQPPI30vdqC+Tk3gfgTvTVjOfhyfGk/7HKJq sbN4ePyh/S6O6suqDJJOcyD1t4aGtJSbGyLSi7Npqb7Rp39W1Tn1iMlG8QwGjP78zK52Dw X922aozSkjjOfVvbF4JSm0+NMTfP9VLToegSxqKfgVlsp7PC3t31oQUZgWbVX+H4pRrGLY 1TBn6sO1eugqehCcLYGPQxslLrtR9Sdyt61B6Dl4aw1bx486BfWK48BY2oQfbreIGnxxlK SDSv4/BDsmJMu/jFgYugfq7AgaPRlQ8dULHMdrF2+Fd9RK+3k01fTrFwFEEtDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d80Fsqz175k; Mon, 30 Jun 2025 14:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55UELVrX076288; Mon, 30 Jun 2025 14:21:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELVqE076285; Mon, 30 Jun 2025 14:21:31 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:31 GMT Message-Id: <202506301421.55UELVqE076285@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: 3230a622ac08 - stable/14 - ptrace: Rename the internal command range constants List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3230a622ac083b5d2a24184c7c0495963a735a41 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3230a622ac083b5d2a24184c7c0495963a735a41 commit 3230a622ac083b5d2a24184c7c0495963a735a41 Author: Mark Johnston AuthorDate: 2025-06-16 01:53:57 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:30 +0000 ptrace: Rename the internal command range constants No functional change intended. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50866 (cherry picked from commit ee609560ad2a5fa7cacf06a3879987e118588625) --- sys/compat/freebsd32/freebsd32_misc.c | 2 +- sys/kern/sys_process.c | 2 +- sys/sys/ptrace.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 951d9c28b7f1..c147c9cf1dd1 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1177,7 +1177,7 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) pscr_args[i] = pscr_args32[i]; r.sr.pscr_args = pscr_args; break; - case PTLINUX_FIRST ... PTLINUX_LAST: + case PTINTERNAL_FIRST ... PTINTERNAL_LAST: error = EINVAL; break; default: diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index f81013ffb842..a33e3fa4b73c 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -696,7 +696,7 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) break; r.sr.pscr_args = pscr_args; break; - case PTLINUX_FIRST ... PTLINUX_LAST: + case PTINTERNAL_FIRST ... PTINTERNAL_LAST: error = EINVAL; break; default: diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 85c6b2d5366a..bb492f60a8ed 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -93,10 +93,10 @@ #include /* machine-specific requests, if any */ #ifdef _KERNEL -/* Space for Linux ptrace emulation. */ -#define PTLINUX_FIRST 128 -#define PTLINUX_LAST 191 -#define PTLINUX_GET_SC_ARGS (PTLINUX_FIRST + 0) +/* Space for ptrace commands not exposed directly to userspace. */ +#define PTINTERNAL_FIRST 128 +#define PTINTERNAL_LAST 191 +#define PTLINUX_GET_SC_ARGS (PTINTERNAL_FIRST + 0) #endif /* Events used with PT_GET_EVENT_MASK and PT_SET_EVENT_MASK */ From nobody Mon Jun 30 14:21:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7d95C85z60X7d; Mon, 30 Jun 2025 14:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bW7d922Wpz48Yx; Mon, 30 Jun 2025 14:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BWo5s/dk/JmOpnw05zWlm1cFfKQEXc9DyNUk4Cq+frg=; b=PjdYPcHkzyzfWPE/IgrEb9sL8jNV17A7Ou+jCnpqpZz4wgwHcHhmouEL8AYAVJ8Ex/w/5z J3UvvrdPmStEht8b2IeHmeAIHHr1TDBl4H+imXwP1HfUG8Q9WhnPgRsht/lHhQPCIgklJB gN948XXM4s18jA/VS+nuayH1a0BcUAEyMg95xBvJpMwJ+1RaqMfwplYBRzJpQSMSbNy063 usgbEulQpqb5V5dZHBl4qq7n1U5CwYx+5Ox9WYPHMWhKUDBFaJJBGL2yqDoIK74WoD2JSW /sOD7Sbpqp9q9O299JErzEiH5UvBUR6K6veYCWu0yDOua51e2Alj/+gQxg5JHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BWo5s/dk/JmOpnw05zWlm1cFfKQEXc9DyNUk4Cq+frg=; b=HkScyXoGbshpbFAF8Mo1Di0UJMJudiFX1qReElvf/zzeo962azaBdOumeZRJAc6/ylrEQI t+il3t4t45kcHKE8TGiKFfoXyPnPg4WyYnqqx8bUyjf+6brB6phhh1+xf6ViVQo61+hGVy FaRDhTB8Ubbxx+jwmSC+9M/QrUIcA03bmTG+8QIB+90uxw/n4oDIT1IrusA1zLVQMKIlue zyRQl8pPRVV4+swikzDziQi0mn8CAa1IL24imxjfXTilKofHTwG10oowLg2eWSpJlirXBd medBk8NgdGF/+5wPh170oUzsP7P8YCncIyW1CBbCDZo+KPqTkgoyv+3GgmcIXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293293; a=rsa-sha256; cv=none; b=IcibOcBzj7dIB2CHIQVnUQiUmkJLrPRrZKGjLq7gQU36b3kPRaaXQupnfLwg5J/9nPquxo /P6L19tGTn8l+VJ3hvAA0DpEzGbuhkaokYeTSJA51YQAlDHKzvWVTOHIombBBhiCczZdDq /oZLhH4y13abP+h/kaK+dp7Iu3y6dFNGF9Hw8hTrr/iYz+22ai2VmbYEN2DH9OctYxX8Ki wYKyhiCK+8tLqu8UEYgI9ie08kH1sIq4kwyzeRYYLG4T0hPLGS5shNEaBgoq1RWMkhl+NR D8zpMQZYZWwpdsZXJDB9q2Lo9bxgpW66Iai5d8Bo/YWviLlVi5UTdRSAWEbLCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7d90wKfz178N; Mon, 30 Jun 2025 14:21: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 55UELX7Z076324; Mon, 30 Jun 2025 14:21:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELXuU076321; Mon, 30 Jun 2025 14:21:33 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:33 GMT Message-Id: <202506301421.55UELXuU076321@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: fc03742b2512 - stable/14 - gve: Add support for 4k RX Buffers when using DQO queue formats List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fc03742b2512127a403b7624b49ce4a94fd26244 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fc03742b2512127a403b7624b49ce4a94fd26244 commit fc03742b2512127a403b7624b49ce4a94fd26244 Author: Vee Agarwal AuthorDate: 2025-06-13 17:52:25 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:31 +0000 gve: Add support for 4k RX Buffers when using DQO queue formats This change adds support for using 4K RX Buffers when using DQO queue formats when a boot-time tunable flag is set to true by the user. When this flag is enabled, the driver will use 4K RX Buffer size either when HW LRO is enabled or mtu > 2048. Signed-off-by: Vee Agarwal Reviewed by: markj, ziaee MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50786 (cherry picked from commit 71702df6126226b31dc3ec66459388e32b993be1) --- share/man/man4/gve.4 | 8 ++++++++ sys/dev/gve/gve.h | 20 ++++++++++++++++++++ sys/dev/gve/gve_adminq.c | 5 ++++- sys/dev/gve/gve_dqo.h | 8 ++++++-- sys/dev/gve/gve_main.c | 30 +++++++++++++++++++++++++++--- sys/dev/gve/gve_rx_dqo.c | 26 +++++++++++++++----------- sys/dev/gve/gve_sysctl.c | 4 ++++ 7 files changed, 84 insertions(+), 17 deletions(-) diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index a94951415d61..67f834badd9d 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -230,6 +230,14 @@ The default value is 0, which means hardware LRO is enabled by default. The software LRO stack in the kernel is always used. This sysctl variable needs to be set before loading the driver, using .Xr loader.conf 5 . +.It Va hw.gve.allow_4k_rx_buffers +Setting this boot-time tunable to 1 enables support for 4K RX Buffers. +The default value is 0, which means 2K RX Buffers will be used. +4K RX Buffers are only supported on DQO_RDA and DQO_QPL queue formats. +When enabled, 4K RX Buffers will be used either when HW LRO is enabled +or mtu is greated than 2048. +This sysctl variable needs to be set before loading the driver, using +.Xr loader.conf 5 . .It Va dev.gve.X.num_rx_queues and dev.gve.X.num_tx_queues Run-time tunables that represent the number of currently used RX/TX queues. The default value is the max number of RX/TX queues the device can support. diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index 48e9a371df21..dd432dc0eb45 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -65,6 +65,7 @@ #define ADMINQ_SIZE PAGE_SIZE #define GVE_DEFAULT_RX_BUFFER_SIZE 2048 +#define GVE_4K_RX_BUFFER_SIZE_DQO 4096 /* Each RX bounce buffer page can fit two packet buffers. */ #define GVE_DEFAULT_RX_BUFFER_OFFSET (PAGE_SIZE / 2) @@ -84,6 +85,11 @@ static MALLOC_DEFINE(M_GVE, "gve", "gve allocations"); +_Static_assert(MCLBYTES == GVE_DEFAULT_RX_BUFFER_SIZE, + "gve: bad MCLBYTES length"); +_Static_assert(MJUMPAGESIZE >= GVE_4K_RX_BUFFER_SIZE_DQO, + "gve: bad MJUMPAGESIZE length"); + struct gve_dma_handle { bus_addr_t bus_addr; void *cpu_addr; @@ -633,6 +639,7 @@ struct gve_priv { /* The index of tx queue that the timer service will check on its next invocation */ uint16_t check_tx_queue_idx; + uint16_t rx_buf_size_dqo; }; static inline bool @@ -666,6 +673,18 @@ gve_is_qpl(struct gve_priv *priv) priv->queue_format == GVE_DQO_QPL_FORMAT); } +static inline bool +gve_is_4k_rx_buf(struct gve_priv *priv) +{ + return (priv->rx_buf_size_dqo == GVE_4K_RX_BUFFER_SIZE_DQO); +} + +static inline bus_size_t +gve_rx_dqo_mbuf_segment_size(struct gve_priv *priv) +{ + return (gve_is_4k_rx_buf(priv) ? MJUMPAGESIZE : MCLBYTES); +} + /* Defined in gve_main.c */ void gve_schedule_reset(struct gve_priv *priv); int gve_adjust_tx_queues(struct gve_priv *priv, uint16_t new_queue_cnt); @@ -746,6 +765,7 @@ bool gve_timestamp_valid(int64_t *timestamp_sec); /* Systcl functions defined in gve_sysctl.c */ extern bool gve_disable_hw_lro; +extern bool gve_allow_4k_rx_buffers; extern char gve_queue_format[8]; extern char gve_version[8]; void gve_setup_sysctl(struct gve_priv *priv); diff --git a/sys/dev/gve/gve_adminq.c b/sys/dev/gve/gve_adminq.c index 3415d2fa4b60..9b59570a2af4 100644 --- a/sys/dev/gve/gve_adminq.c +++ b/sys/dev/gve/gve_adminq.c @@ -296,7 +296,6 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) .ntfy_id = htobe32(rx->com.ntfy_id), .queue_resources_addr = htobe64(qres_dma->bus_addr), .rx_ring_size = htobe16(priv->rx_desc_cnt), - .packet_buffer_size = htobe16(GVE_DEFAULT_RX_BUFFER_SIZE), }; if (gve_is_gqi(priv)) { @@ -308,6 +307,8 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) htobe32(queue_index); cmd.create_rx_queue.queue_page_list_id = htobe32((rx->com.qpl)->id); + cmd.create_rx_queue.packet_buffer_size = + htobe16(GVE_DEFAULT_RX_BUFFER_SIZE); } else { cmd.create_rx_queue.queue_page_list_id = htobe32(GVE_RAW_ADDRESSING_QPL_ID); @@ -320,6 +321,8 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) cmd.create_rx_queue.enable_rsc = !!((if_getcapenable(priv->ifp) & IFCAP_LRO) && !gve_disable_hw_lro); + cmd.create_rx_queue.packet_buffer_size = + htobe16(priv->rx_buf_size_dqo); } return (gve_adminq_execute_cmd(priv, &cmd)); diff --git a/sys/dev/gve/gve_dqo.h b/sys/dev/gve/gve_dqo.h index 212bfa1a6ad3..542f8ff7d888 100644 --- a/sys/dev/gve/gve_dqo.h +++ b/sys/dev/gve/gve_dqo.h @@ -59,8 +59,6 @@ */ #define GVE_RX_DQO_MIN_PENDING_BUFS 128 -#define GVE_DQ_NUM_FRAGS_IN_PAGE (PAGE_SIZE / GVE_DEFAULT_RX_BUFFER_SIZE) - /* * gve_rx_qpl_buf_id_dqo's 11 bit wide buf_id field limits the total * number of pages per QPL to 2048. @@ -330,4 +328,10 @@ struct gve_rx_compl_desc_dqo { _Static_assert(sizeof(struct gve_rx_compl_desc_dqo) == 32, "gve: bad dqo desc struct length"); + +static inline uint8_t +gve_get_dq_num_frags_in_page(struct gve_priv *priv) +{ + return (PAGE_SIZE / priv->rx_buf_size_dqo); +} #endif /* _GVE_DESC_DQO_H_ */ diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index 2abd9d1aa698..10197a8e15f8 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -35,7 +35,7 @@ #define GVE_DRIVER_VERSION "GVE-FBSD-1.3.4\n" #define GVE_VERSION_MAJOR 1 #define GVE_VERSION_MINOR 3 -#define GVE_VERSION_SUB 4 +#define GVE_VERSION_SUB 5 #define GVE_DEFAULT_RX_COPYBREAK 256 @@ -382,12 +382,27 @@ gve_adjust_ring_sizes(struct gve_priv *priv, uint16_t new_desc_cnt, bool is_rx) return (0); } +static int +gve_get_dqo_rx_buf_size(struct gve_priv *priv, uint16_t mtu) +{ + /* + * Use 4k buffers only if mode is DQ, 4k buffers flag is on, + * and either hw LRO is enabled or mtu is greater than 2048 + */ + if (!gve_is_gqi(priv) && gve_allow_4k_rx_buffers && + (!gve_disable_hw_lro || mtu > GVE_DEFAULT_RX_BUFFER_SIZE)) + return (GVE_4K_RX_BUFFER_SIZE_DQO); + + return (GVE_DEFAULT_RX_BUFFER_SIZE); +} + 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; + uint16_t new_rx_buf_size = gve_get_dqo_rx_buf_size(priv, new_mtu); int err; if ((new_mtu > priv->max_mtu) || (new_mtu < ETHERMIN)) { @@ -402,9 +417,10 @@ gve_set_mtu(if_t ifp, uint32_t new_mtu) * in throughput. */ if (!gve_is_gqi(priv) && !gve_disable_hw_lro && - new_mtu >= min_problem_range && new_mtu <= max_problem_range) { + new_mtu >= min_problem_range && new_mtu <= max_problem_range && + new_rx_buf_size != GVE_4K_RX_BUFFER_SIZE_DQO) { device_printf(priv->dev, - "Cannot set to MTU to %d within the range [%d, %d] while hardware LRO is enabled\n", + "Cannot set to MTU to %d within the range [%d, %d] while HW LRO is enabled and not using 4k RX Buffers\n", new_mtu, min_problem_range, max_problem_range); return (EINVAL); } @@ -414,6 +430,13 @@ gve_set_mtu(if_t ifp, uint32_t new_mtu) if (bootverbose) device_printf(priv->dev, "MTU set to %d\n", new_mtu); if_setmtu(ifp, new_mtu); + /* Need to re-alloc RX queues if RX buffer size changed */ + if (!gve_is_gqi(priv) && + new_rx_buf_size != priv->rx_buf_size_dqo) { + gve_free_rx_rings(priv, 0, priv->rx_cfg.num_queues); + priv->rx_buf_size_dqo = new_rx_buf_size; + gve_alloc_rx_rings(priv, 0, priv->rx_cfg.num_queues); + } } else { device_printf(priv->dev, "Failed to set MTU to %d\n", new_mtu); } @@ -1064,6 +1087,7 @@ gve_attach(device_t dev) if (err != 0) goto abort; + priv->rx_buf_size_dqo = gve_get_dqo_rx_buf_size(priv, priv->max_mtu); err = gve_alloc_rings(priv); if (err != 0) goto abort; diff --git a/sys/dev/gve/gve_rx_dqo.c b/sys/dev/gve/gve_rx_dqo.c index 11b2c7ea0c55..cf914913da09 100644 --- a/sys/dev/gve/gve_rx_dqo.c +++ b/sys/dev/gve/gve_rx_dqo.c @@ -140,15 +140,17 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i) return (0); } + bus_size_t max_seg_size = gve_rx_dqo_mbuf_segment_size(priv); + err = bus_dma_tag_create( bus_get_dma_tag(priv->dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MCLBYTES, /* maxsize */ + max_seg_size, /* maxsize */ 1, /* nsegments */ - MCLBYTES, /* maxsegsize */ + max_seg_size, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ @@ -317,7 +319,8 @@ gve_rx_post_new_mbuf_dqo(struct gve_rx_ring *rx, int how) } SLIST_REMOVE_HEAD(&rx->dqo.free_bufs, slist_entry); - buf->mbuf = m_getcl(how, MT_DATA, M_PKTHDR); + bus_size_t segment_size = gve_rx_dqo_mbuf_segment_size(rx->com.priv); + buf->mbuf = m_getjcl(how, MT_DATA, M_PKTHDR, segment_size); if (__predict_false(!buf->mbuf)) { err = ENOMEM; counter_enter(); @@ -325,7 +328,7 @@ gve_rx_post_new_mbuf_dqo(struct gve_rx_ring *rx, int how) counter_exit(); goto abort_with_buf; } - buf->mbuf->m_len = MCLBYTES; + buf->mbuf->m_len = segment_size; err = bus_dmamap_load_mbuf_sg(rx->dqo.buf_dmatag, buf->dmamap, buf->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); @@ -371,7 +374,7 @@ gve_rx_post_qpl_buf_dqo(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf, bus_dmamap_sync(page_dma_handle->tag, page_dma_handle->map, BUS_DMASYNC_PREREAD); desc->buf_addr = htole64(page_dma_handle->bus_addr + - frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + frag_num * rx->com.priv->rx_buf_size_dqo); buf->num_nic_frags++; gve_rx_advance_head_dqo(rx); @@ -430,7 +433,7 @@ gve_rx_post_new_dqo_qpl_buf(struct gve_rx_ring *rx) } gve_rx_post_qpl_buf_dqo(rx, buf, buf->next_idx); - if (buf->next_idx == GVE_DQ_NUM_FRAGS_IN_PAGE - 1) + if (buf->next_idx == gve_get_dq_num_frags_in_page(rx->com.priv) - 1) buf->next_idx = 0; else buf->next_idx++; @@ -742,7 +745,7 @@ gve_get_cpu_addr_for_qpl_buf(struct gve_rx_ring *rx, int page_idx = buf - rx->dqo.bufs; void *va = rx->com.qpl->dmas[page_idx].cpu_addr; - va = (char *)va + (buf_frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + va = (char *)va + (buf_frag_num * rx->com.priv->rx_buf_size_dqo); return (va); } @@ -753,15 +756,16 @@ gve_rx_add_clmbuf_to_ctx(struct gve_rx_ring *rx, { void *va = gve_get_cpu_addr_for_qpl_buf(rx, buf, buf_frag_num); struct mbuf *mbuf; + bus_size_t segment_size = gve_rx_dqo_mbuf_segment_size(rx->com.priv); if (ctx->mbuf_tail == NULL) { - mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, segment_size); if (mbuf == NULL) return (ENOMEM); ctx->mbuf_head = mbuf; ctx->mbuf_tail = mbuf; } else { - mbuf = m_getcl(M_NOWAIT, MT_DATA, 0); + mbuf = m_getjcl(M_NOWAIT, MT_DATA, 0, segment_size); if (mbuf == NULL) return (ENOMEM); ctx->mbuf_tail->m_next = mbuf; @@ -809,7 +813,7 @@ gve_rx_add_extmbuf_to_ctx(struct gve_rx_ring *rx, page_idx = buf - rx->dqo.bufs; page = rx->com.qpl->pages[page_idx]; page_addr = rx->com.qpl->dmas[page_idx].cpu_addr; - va = (char *)page_addr + (buf_frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + va = (char *)page_addr + (buf_frag_num * rx->com.priv->rx_buf_size_dqo); /* * Grab an extra ref to the page so that gve_mextadd_free @@ -855,7 +859,7 @@ gve_rx_dqo_qpl(struct gve_priv *priv, struct gve_rx_ring *rx, } buf = &rx->dqo.bufs[buf_id]; if (__predict_false(buf->num_nic_frags == 0 || - buf_frag_num > GVE_DQ_NUM_FRAGS_IN_PAGE - 1)) { + buf_frag_num > gve_get_dq_num_frags_in_page(priv) - 1)) { device_printf(priv->dev, "Spurious compl for buf id %d on rxq %d " "with buf_frag_num %d and num_nic_frags %d, issuing reset\n", buf_id, rx->com.id, buf_frag_num, buf->num_nic_frags); diff --git a/sys/dev/gve/gve_sysctl.c b/sys/dev/gve/gve_sysctl.c index 661f61918853..a3874cc921ee 100644 --- a/sys/dev/gve/gve_sysctl.c +++ b/sys/dev/gve/gve_sysctl.c @@ -37,6 +37,10 @@ bool gve_disable_hw_lro = false; SYSCTL_BOOL(_hw_gve, OID_AUTO, disable_hw_lro, CTLFLAG_RDTUN, &gve_disable_hw_lro, 0, "Controls if hardware LRO is used"); +bool gve_allow_4k_rx_buffers = false; +SYSCTL_BOOL(_hw_gve, OID_AUTO, allow_4k_rx_buffers, CTLFLAG_RDTUN, + &gve_allow_4k_rx_buffers, 0, "Controls if 4K RX Buffers are allowed"); + char gve_queue_format[8]; SYSCTL_STRING(_hw_gve, OID_AUTO, queue_format, CTLFLAG_RD, &gve_queue_format, 0, "Queue format being used by the iface"); From nobody Mon Jun 30 14:21:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bW7dB6lWjz60X2g; Mon, 30 Jun 2025 14:21: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 4bW7dB2F68z48jX; Mon, 30 Jun 2025 14:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivLLIaMCh2RSXl2cOGePKrwjtiV0QW2DU6Krm1zJGEI=; b=DbTUxLVUOGC9DX5h584x+6OtTDENowds1dl1h/j+nPrDUTFOw9hLo334MCMVxPb1ZnfhZv EiTYatn7tw8SPjrauOi9QimvS3XY14lAznE/lIGJy6aCw1rsuQV6whObstIPL7SSAsY42D 3ecwHjVbez9P8tagJZC2oN7opp5UIkQTQeU9UTarksMd+wcoBLq/CRb0rIGl1UVMFsQs4b lbzmsQNlPZCFweBh7giv1TASQsNbPjxoxMOSk7DRF6QmRQyF2VVZvh8DsZf/UoKUwucK3C 1a1Krfzh+QHoHITgHm3QHFuyiodE2YKoC/7KghZyeaS58sZsz1BMXpBsGhAzuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751293294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivLLIaMCh2RSXl2cOGePKrwjtiV0QW2DU6Krm1zJGEI=; b=OzOClGkvaosZtliEggxQtXRRUnheYCQdc94IetyOGUj8KfRIMf20dtbbbs3N4nfmhNBVO5 wCZ7dyIFtAfqeN7XjcUA/lsDrE2I+xF4Kq6VBqjwGoD0gQd073CEkwBwcuyzi1HVzt42+C aOAjjUz6Gp81tSUAoHRszDZoAwWjZZxDaZXnndgRXjOtXqvHFF0+MbbzQiqawwdWuXhdPJ mK7QvOYbVL1edw9zUlgrDi3HSLN5n65nPBAH+mM3ZFOQK0crBO1cIOYFVH2Qc7sMwk9tBZ VYVhE5aTTkx1anCQKHZhnoScLck9ksEV/QvQwMPtwGv4T1J75darcPJhC3akIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751293294; a=rsa-sha256; cv=none; b=NcgCD4lorwCn9By07u9u7/cjKcoXIVqYpv5VJ2hSU+jSbpqgQAxBG0nLd2lceveP1eEbFv N0OACZOunZlk3akaItoU6gjQFxqwTVg8qKBXc2Vqt7XgEi11lT5euH6x3SUmo7SLEoVyrS ab17qZ2gu9Z59D2T4D4kfgiJpxCc82tod4mtZvuy2cKabqFReZysr+aA0Ho1Vo/SgKZHSD LoVJIBQqjJTVEcQZvIkWk32VgGaiMxh2//qGJaTJuRPCIQvxyBUQI+ZwH7LA8qSqhfap3I I1DbJN0G0OXLReVYvD4uxnbMJ9mBdZjaGs+qcbMOsHfwHkfS/HuqJwCp3PLBCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bW7dB1f7bz16dg; Mon, 30 Jun 2025 14:21: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 55UELYeu076364; Mon, 30 Jun 2025 14:21:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UELYqo076361; Mon, 30 Jun 2025 14:21:34 GMT (envelope-from git) Date: Mon, 30 Jun 2025 14:21:34 GMT Message-Id: <202506301421.55UELYqo076361@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: c6e0defd489f - stable/14 - gve: Relax a static assertion List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c6e0defd489fb139e753435ccb7ecb722e9ae499 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c6e0defd489fb139e753435ccb7ecb722e9ae499 commit c6e0defd489fb139e753435ccb7ecb722e9ae499 Author: Mark Johnston AuthorDate: 2025-06-14 12:17:49 +0000 Commit: Mark Johnston CommitDate: 2025-06-30 14:19:31 +0000 gve: Relax a static assertion It's okay if MCLBYTES is larger than the default receive buffer size. Fixes: 71702df61262 ("gve: Add support for 4k RX Buffers when using DQO queue formats") (cherry picked from commit 3b4bc5d70e1c2066fcb6e8535941258c88999fa2) --- sys/dev/gve/gve.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index dd432dc0eb45..64c2a0481817 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -85,7 +85,7 @@ static MALLOC_DEFINE(M_GVE, "gve", "gve allocations"); -_Static_assert(MCLBYTES == GVE_DEFAULT_RX_BUFFER_SIZE, +_Static_assert(MCLBYTES >= GVE_DEFAULT_RX_BUFFER_SIZE, "gve: bad MCLBYTES length"); _Static_assert(MJUMPAGESIZE >= GVE_4K_RX_BUFFER_SIZE_DQO, "gve: bad MJUMPAGESIZE length"); From nobody Mon Jun 30 23:21:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bWMcD3sXkz605Ll; Mon, 30 Jun 2025 23:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bWMcD3M4pz3lDB; Mon, 30 Jun 2025 23:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751325692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CQkrRXY4djWFT6vlYxcvv3er+5Bh9aO+Ye/AqrTKqgY=; b=sfZypQL9wpcvRYerLrpWR5WyM+Ne1ApqMwISACrdILFzXSZXjK2F6rs+KcHRP5vJ6CKi6I YzAps1VKSyynzFIUQrhhcR6aErmRMXa8LCUyzEeT7jn5s985MzoCfaf/xuZKcXN/v8A9Hq NKHsSKFNI9fHguoTQsmm3zsZ+a9IS3nHKDumIkZS20NaogmqEsZ33CAghHrHsQQi1Nc2go NS4dYaQ5a0W1vpQwIA50GjKAQlw4EXd5jQa3qh5LJzsBTB2A6BHeAy7EdulrsXlxxcE1Ob 0uCh3VdLjfSfL52tHidDbKu1dds+cPADF/Z7Z4cJCnc0UzAanDt1BTZ4fiEHuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751325692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CQkrRXY4djWFT6vlYxcvv3er+5Bh9aO+Ye/AqrTKqgY=; b=f0G0707iLb/BWref4KLzsaSfzJNaNOugargS0eR0kArDZuuLt4vdP6RmR6gVp1lXG72aR0 MGSfCIQPOkyNgX+TT25ZNkCxKcJcTz4Xc9bl1LmL+I8dfO6i2DXSF7sw4XfSsy2NvMAQrA MeQ8/Cdg7ZHe7Fd8m1t+pNXd2YCde54FXbzhUDsO1DBF8h3uKoKONAy7BKbck3MUG+qsi7 fJbyX2tPJtvN216oNLpc9kn3sOPLbUmGxotrXgf/rbtLmo0L/5flIdataEanecSDmV91EK 1n1HVgfHdxNufnHGfpGUWg4a+ofdrTB884hs2wfr76ggcgbh0hxCEOO+MNml9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751325692; a=rsa-sha256; cv=none; b=Ke5CNN0qqr1IH80lPu2yExRcjiwU+4rmN8a95tqlWMlKL1sLRcgVw6a7ADvDGPl0w1A1UR 9eDIwZiOWWlTHQ17RXcbRPJY3oBOAFkV4SE2o3LdudxXhpv3yQAWMx6MMD5lQ5mAxVlQEo B0UXI+a5O4nn40V//b7/JPSqjjexe0mVNtE+UdWg8FC20fZkOjHr+86qaftcy/S0feX3Mo t11b8/zLbHlJVvtFXUijEk3g69QNudMoBaWpg201sT+KscVc5lf9ixmYrv/ZTbIUocp7VN 9FeF/ZoaJOv2vUUxSwHXPQV26oTtyFXoDr3YvLvyi2woMxDFYfg073dz1rve1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bWMcD2xGVz1Nmr; Mon, 30 Jun 2025 23:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55UNLWDG098495; Mon, 30 Jun 2025 23:21:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55UNLWme098491; Mon, 30 Jun 2025 23:21:32 GMT (envelope-from git) Date: Mon, 30 Jun 2025 23:21:32 GMT Message-Id: <202506302321.55UNLWme098491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: fbaab1373280 - stable/13 - contrib/llvm-project: fix clang crash compiling modules List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fbaab13732809e02dc30e9aef15fac230aed4464 Auto-Submitted: auto-generated The branch stable/13 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=fbaab13732809e02dc30e9aef15fac230aed4464 commit fbaab13732809e02dc30e9aef15fac230aed4464 Author: Lexi Winter AuthorDate: 2025-06-25 17:12:02 +0000 Commit: Lexi Winter CommitDate: 2025-06-30 22:27:40 +0000 contrib/llvm-project: fix clang crash compiling modules clang++ may crash when compiling certain C++20 modules. Backport the fix from LLVM upstream. This fixes LLVM bug 102684: https://github.com/llvm/llvm-project/issues/102684. PR: 287803 MFC after: 3 days Obtained from: https://github.com/llvm/llvm-project/pull/102855 Reviewed by: kevans, dim Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D51041 (cherry picked from commit 55dfaeae8e9aa95f0b724d90ad2423ca1b623142) --- .../include/clang/Frontend/MultiplexConsumer.h | 1 + .../Serialization/ASTDeserializationListener.h | 2 + .../clang/include/clang/Serialization/ASTReader.h | 3 + .../clang/include/clang/Serialization/ASTWriter.h | 1 + .../clang/lib/Frontend/MultiplexConsumer.cpp | 5 ++ .../clang/lib/Serialization/ASTReader.cpp | 91 +++++++++++++++++----- .../clang/lib/Serialization/ASTWriter.cpp | 6 ++ 7 files changed, 91 insertions(+), 18 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h b/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h index e49e3392d1f3..3a7670d7a51a 100644 --- a/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h +++ b/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h @@ -36,6 +36,7 @@ public: void MacroRead(serialization::MacroID ID, MacroInfo *MI) override; void TypeRead(serialization::TypeIdx Idx, QualType T) override; void DeclRead(GlobalDeclID ID, const Decl *D) override; + void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) override; void SelectorRead(serialization::SelectorID iD, Selector Sel) override; void MacroDefinitionRead(serialization::PreprocessedEntityID, MacroDefinitionRecord *MD) override; diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h index 1d81a9ae3fe2..ea96faa07c19 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h @@ -45,6 +45,8 @@ public: virtual void TypeRead(serialization::TypeIdx Idx, QualType T) { } /// A decl was deserialized from the AST file. virtual void DeclRead(GlobalDeclID ID, const Decl *D) {} + /// A predefined decl was built during the serialization. + virtual void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) {} /// A selector was read from the AST file. virtual void SelectorRead(serialization::SelectorID iD, Selector Sel) {} /// A macro definition was read from the AST file. diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h index 671520a3602b..82f32e843d63 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h @@ -1541,6 +1541,9 @@ private: std::pair translateTypeIDToIndex(serialization::TypeID ID) const; + /// Get a predefined Decl from ASTContext. + Decl *getPredefinedDecl(PredefinedDeclIDs ID); + public: /// Load the AST file and validate its contents against the given /// Preprocessor. diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h index 700f0ad00111..10a50b711043 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h @@ -869,6 +869,7 @@ private: void IdentifierRead(serialization::IdentifierID ID, IdentifierInfo *II) override; void MacroRead(serialization::MacroID ID, MacroInfo *MI) override; void TypeRead(serialization::TypeIdx Idx, QualType T) override; + void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) override; void SelectorRead(serialization::SelectorID ID, Selector Sel) override; void MacroDefinitionRead(serialization::PreprocessedEntityID ID, MacroDefinitionRecord *MD) override; diff --git a/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp b/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp index 651c55aeed54..2158d176d189 100644 --- a/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp @@ -58,6 +58,11 @@ void MultiplexASTDeserializationListener::DeclRead(GlobalDeclID ID, Listeners[i]->DeclRead(ID, D); } +void MultiplexASTDeserializationListener::PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) { + for (size_t i = 0, e = Listeners.size(); i != e; ++i) + Listeners[i]->PredefinedDeclBuilt(ID, D); +} + void MultiplexASTDeserializationListener::SelectorRead( serialization::SelectorID ID, Selector Sel) { for (size_t i = 0, e = Listeners.size(); i != e; ++i) diff --git a/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp b/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp index 29aec144aec1..2d8f5a801f0e 100644 --- a/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp +++ b/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp @@ -7741,7 +7741,10 @@ SourceLocation ASTReader::getSourceLocationForDeclID(GlobalDeclID ID) { return Loc; } -static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) { +Decl *ASTReader::getPredefinedDecl(PredefinedDeclIDs ID) { + assert(ContextObj && "reading predefined decl without AST context"); + ASTContext &Context = *ContextObj; + Decl *NewLoaded = nullptr; switch (ID) { case PREDEF_DECL_NULL_ID: return nullptr; @@ -7750,54 +7753,106 @@ static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) { return Context.getTranslationUnitDecl(); case PREDEF_DECL_OBJC_ID_ID: - return Context.getObjCIdDecl(); + if (Context.ObjCIdDecl) + return Context.ObjCIdDecl; + NewLoaded = Context.getObjCIdDecl(); + break; case PREDEF_DECL_OBJC_SEL_ID: - return Context.getObjCSelDecl(); + if (Context.ObjCSelDecl) + return Context.ObjCSelDecl; + NewLoaded = Context.getObjCSelDecl(); + break; case PREDEF_DECL_OBJC_CLASS_ID: - return Context.getObjCClassDecl(); + if (Context.ObjCClassDecl) + return Context.ObjCClassDecl; + NewLoaded = Context.getObjCClassDecl(); + break; case PREDEF_DECL_OBJC_PROTOCOL_ID: - return Context.getObjCProtocolDecl(); + if (Context.ObjCProtocolClassDecl) + return Context.ObjCProtocolClassDecl; + NewLoaded = Context.getObjCProtocolDecl(); + break; case PREDEF_DECL_INT_128_ID: - return Context.getInt128Decl(); + if (Context.Int128Decl) + return Context.Int128Decl; + NewLoaded = Context.getInt128Decl(); + break; case PREDEF_DECL_UNSIGNED_INT_128_ID: - return Context.getUInt128Decl(); + if (Context.UInt128Decl) + return Context.UInt128Decl; + NewLoaded = Context.getUInt128Decl(); + break; case PREDEF_DECL_OBJC_INSTANCETYPE_ID: - return Context.getObjCInstanceTypeDecl(); + if (Context.ObjCInstanceTypeDecl) + return Context.ObjCInstanceTypeDecl; + NewLoaded = Context.getObjCInstanceTypeDecl(); + break; case PREDEF_DECL_BUILTIN_VA_LIST_ID: - return Context.getBuiltinVaListDecl(); + if (Context.BuiltinVaListDecl) + return Context.BuiltinVaListDecl; + NewLoaded = Context.getBuiltinVaListDecl(); + break; case PREDEF_DECL_VA_LIST_TAG: - return Context.getVaListTagDecl(); + if (Context.VaListTagDecl) + return Context.VaListTagDecl; + NewLoaded = Context.getVaListTagDecl(); + break; case PREDEF_DECL_BUILTIN_MS_VA_LIST_ID: - return Context.getBuiltinMSVaListDecl(); + if (Context.BuiltinMSVaListDecl) + return Context.BuiltinMSVaListDecl; + NewLoaded = Context.getBuiltinMSVaListDecl(); + break; case PREDEF_DECL_BUILTIN_MS_GUID_ID: + // ASTContext::getMSGuidTagDecl won't create MSGuidTagDecl conditionally. return Context.getMSGuidTagDecl(); case PREDEF_DECL_EXTERN_C_CONTEXT_ID: - return Context.getExternCContextDecl(); + if (Context.ExternCContext) + return Context.ExternCContext; + NewLoaded = Context.getExternCContextDecl(); + break; case PREDEF_DECL_MAKE_INTEGER_SEQ_ID: - return Context.getMakeIntegerSeqDecl(); + if (Context.MakeIntegerSeqDecl) + return Context.MakeIntegerSeqDecl; + NewLoaded = Context.getMakeIntegerSeqDecl(); + break; case PREDEF_DECL_CF_CONSTANT_STRING_ID: - return Context.getCFConstantStringDecl(); + if (Context.CFConstantStringTypeDecl) + return Context.CFConstantStringTypeDecl; + NewLoaded = Context.getCFConstantStringDecl(); + break; case PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID: - return Context.getCFConstantStringTagDecl(); + if (Context.CFConstantStringTagDecl) + return Context.CFConstantStringTagDecl; + NewLoaded = Context.getCFConstantStringTagDecl(); + break; case PREDEF_DECL_TYPE_PACK_ELEMENT_ID: - return Context.getTypePackElementDecl(); + if (Context.TypePackElementDecl) + return Context.TypePackElementDecl; + NewLoaded = Context.getTypePackElementDecl(); + break; } - llvm_unreachable("PredefinedDeclIDs unknown enum value"); + + assert(NewLoaded && "Failed to load predefined decl?"); + + if (DeserializationListener) + DeserializationListener->PredefinedDeclBuilt(ID, NewLoaded); + + return NewLoaded; } unsigned ASTReader::translateGlobalDeclIDToIndex(GlobalDeclID GlobalID) const { @@ -7814,7 +7869,7 @@ Decl *ASTReader::GetExistingDecl(GlobalDeclID ID) { assert(ContextObj && "reading decl with no AST context"); if (ID < NUM_PREDEF_DECL_IDS) { - Decl *D = getPredefinedDecl(*ContextObj, (PredefinedDeclIDs)ID); + Decl *D = getPredefinedDecl((PredefinedDeclIDs)ID); if (D) { // Track that we have merged the declaration with ID \p ID into the // pre-existing predefined declaration \p D. diff --git a/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp b/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp index cb63dec92e33..e907ddb88949 100644 --- a/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp +++ b/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp @@ -6757,6 +6757,12 @@ void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { StoredIdx = Idx; } +void ASTWriter::PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) { + assert(D->isCanonicalDecl() && "predefined decl is not canonical"); + DeclIDs[D] = LocalDeclID(ID); + PredefinedDecls.insert(D); +} + void ASTWriter::SelectorRead(SelectorID ID, Selector S) { // Always keep the highest ID. See \p TypeRead() for more information. SelectorID &StoredID = SelectorIDs[S]; From nobody Wed Jul 2 18:09:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXSZr4F0pz60lGs; Wed, 02 Jul 2025 18:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bXSZr3w0sz3DyC; Wed, 02 Jul 2025 18:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751479748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ScF/lsmId1ZN/e60UtvjXacyHwrcS8L5b9ogZ9M/vKs=; b=NNE8VHY7hDc73l0GVdPb66ExAd14cvBImg4cldynm07ZNCTnOQwdSzlC9BniBr9pi8Gehw gtRxunD2dvQxniKGLOhwZHf6SflWLzO12Upk6aVhENZZlFHTFCmeF8VBb4WxZd9CCcd1oP KDJgFjmhom6gBCEDcNRJeq65+j1wlYR3leukpPUWE1V1V1idc6DZwTqH9FR5E8IV+4aYbS Vk6LAE7ROiY/iAJOE9bsshJdfH5wCAho43rmBTOWxZLizjOqxtbDWyOw/O/VbgpruhFMa4 ttHwPNad3il6inS3RwUu2VXXjlD8CZyPHpTWgN3P4BS2Mv3X/h58FYgt8uZcMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751479748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ScF/lsmId1ZN/e60UtvjXacyHwrcS8L5b9ogZ9M/vKs=; b=SfsQZzCRYX9YFT8JmR0D3ukZDcTe1TXdA+UKsePy1AdcNYj7ykqXoRLDSqUdsOvhMahLI2 RCKbiTcxclUTvsdcYtS9Dn1D+sVyrJ5CufLYxvHZtjspA22cSbPd/dViH6E0dUD3Xg4L5F MXvCdxcc/XOJAQXOE2sOnnE3DavNrC/duUTAwMeHpkzxllQmQ79WXeXCKKDPnYtony5Fhx 7lhTH4GqnNWhL9AgP+3WL4szgDwJBr8GhpGgPZeWkpJa6Np+KW+6dA++aU2hK8NfTnxFz4 7VYAZY8JzY9cG3YU2qFKdn8m5lxeuCH7onfMlg3/sRmwaRepHaPcZyzNa8lPFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751479748; a=rsa-sha256; cv=none; b=AMKEaKrebQrVzErlxflRAH9VbJ9Bl2Q20XaSEcgPOyimcLwC+K3uUGEPuNZdOiTEEudXzU jF8WpnPrrvBeZsomS6463y9YcEJ2RFi4H40qhzyOJXHqE/PcpHrm7rd5wc9ubgcSHKD/l4 NoJRwShu/W2uEmFIw2mWvjd/vShrqnfK5+aj98+CkmJZwVZM4Yu6OoKulrnMA4IKFLJHVJ ag90xn/fe1TOD4oDqZauR+1CO1CTXtkAYCXst+o4t9dEdiAN4JMFt2JcxLO1jExNrHcoZ9 N3hBRZEn3f5YSZXzloUqdszvjjZCALp7jHFEdqh2s3uuIFhs060fmGEJ3s0MtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXSZr2wjfzVVF; Wed, 02 Jul 2025 18:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 562I98WQ020631; Wed, 2 Jul 2025 18:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562I98r0020627; Wed, 2 Jul 2025 18:09:08 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:09:08 GMT Message-Id: <202507021809.562I98r0020627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 257b9d0755b2 - stable/14 - contrib/llvm-project: re-add clang/tools/clang-scan-deps List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 257b9d0755b29fc06d00900efb47f5f90f7fbd61 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=257b9d0755b29fc06d00900efb47f5f90f7fbd61 commit 257b9d0755b29fc06d00900efb47f5f90f7fbd61 Author: Dimitry Andric AuthorDate: 2025-06-25 17:19:51 +0000 Commit: Dimitry Andric CommitDate: 2025-07-02 18:08:46 +0000 contrib/llvm-project: re-add clang/tools/clang-scan-deps This is in preparation for adding it as an optional tool in base. MFC after: 1 week (cherry picked from commit 7ed1628066eaf55b86f35af86efe804508201cc8) --- contrib/llvm-project/FREEBSD-Xlist | 3 +- .../clang/tools/clang-scan-deps/ClangScanDeps.cpp | 1055 ++++++++++++++++++++ .../clang/tools/clang-scan-deps/Opts.td | 42 + 3 files changed, 1098 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/FREEBSD-Xlist b/contrib/llvm-project/FREEBSD-Xlist index 45cd2c1d6f46..43fa40070f5d 100644 --- a/contrib/llvm-project/FREEBSD-Xlist +++ b/contrib/llvm-project/FREEBSD-Xlist @@ -129,7 +129,7 @@ clang/tools/clang-offload-packager/ clang/tools/clang-refactor/ clang/tools/clang-rename/ clang/tools/clang-repl/ -clang/tools/clang-scan-deps/ +clang/tools/clang-scan-deps/CMakeLists.txt clang/tools/clang-shlib/ clang/tools/diag-build/ clang/tools/diagtool/ @@ -805,7 +805,6 @@ llvm/tools/llvm-bcanalyzer/CMakeLists.txt llvm/tools/llvm-c-test/ llvm/tools/llvm-cat/ llvm/tools/llvm-cfi-verify/ -llvm/tools/llvm-cgdata/ llvm/tools/llvm-config/ llvm/tools/llvm-cov/CMakeLists.txt llvm/tools/llvm-cvtres/ diff --git a/contrib/llvm-project/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/contrib/llvm-project/clang/tools/clang-scan-deps/ClangScanDeps.cpp new file mode 100644 index 000000000000..867df19c863f --- /dev/null +++ b/contrib/llvm-project/clang/tools/clang-scan-deps/ClangScanDeps.cpp @@ -0,0 +1,1055 @@ +//===- ClangScanDeps.cpp - Implementation of clang-scan-deps --------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "clang/Driver/Compilation.h" +#include "clang/Driver/Driver.h" +#include "clang/Frontend/CompilerInstance.h" +#include "clang/Frontend/TextDiagnosticPrinter.h" +#include "clang/Tooling/CommonOptionsParser.h" +#include "clang/Tooling/DependencyScanning/DependencyScanningService.h" +#include "clang/Tooling/DependencyScanning/DependencyScanningTool.h" +#include "clang/Tooling/DependencyScanning/DependencyScanningWorker.h" +#include "clang/Tooling/JSONCompilationDatabase.h" +#include "clang/Tooling/Tooling.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/FileUtilities.h" +#include "llvm/Support/Format.h" +#include "llvm/Support/JSON.h" +#include "llvm/Support/LLVMDriver.h" +#include "llvm/Support/Program.h" +#include "llvm/Support/Signals.h" +#include "llvm/Support/TargetSelect.h" +#include "llvm/Support/ThreadPool.h" +#include "llvm/Support/Threading.h" +#include "llvm/Support/Timer.h" +#include "llvm/TargetParser/Host.h" +#include +#include +#include + +#include "Opts.inc" + +using namespace clang; +using namespace tooling::dependencies; + +namespace { + +using namespace llvm::opt; +enum ID { + OPT_INVALID = 0, // This is not an option ID. +#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__), +#include "Opts.inc" +#undef OPTION +}; + +#define PREFIX(NAME, VALUE) \ + constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ + constexpr llvm::ArrayRef NAME( \ + NAME##_init, std::size(NAME##_init) - 1); +#include "Opts.inc" +#undef PREFIX + +const llvm::opt::OptTable::Info InfoTable[] = { +#define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), +#include "Opts.inc" +#undef OPTION +}; + +class ScanDepsOptTable : public llvm::opt::GenericOptTable { +public: + ScanDepsOptTable() : GenericOptTable(InfoTable) { + setGroupedShortOptions(true); + } +}; + +enum ResourceDirRecipeKind { + RDRK_ModifyCompilerPath, + RDRK_InvokeCompiler, +}; + +static std::string OutputFileName = "-"; +static ScanningMode ScanMode = ScanningMode::DependencyDirectivesScan; +static ScanningOutputFormat Format = ScanningOutputFormat::Make; +static ScanningOptimizations OptimizeArgs; +static std::string ModuleFilesDir; +static bool EagerLoadModules; +static unsigned NumThreads = 0; +static std::string CompilationDB; +static std::string ModuleName; +static std::vector ModuleDepTargets; +static bool DeprecatedDriverCommand; +static ResourceDirRecipeKind ResourceDirRecipe; +static bool Verbose; +static bool PrintTiming; +static llvm::BumpPtrAllocator Alloc; +static llvm::StringSaver Saver{Alloc}; +static std::vector CommandLine; + +#ifndef NDEBUG +static constexpr bool DoRoundTripDefault = true; +#else +static constexpr bool DoRoundTripDefault = false; +#endif + +static bool RoundTripArgs = DoRoundTripDefault; + +static void ParseArgs(int argc, char **argv) { + ScanDepsOptTable Tbl; + llvm::StringRef ToolName = argv[0]; + llvm::opt::InputArgList Args = + Tbl.parseArgs(argc, argv, OPT_UNKNOWN, Saver, [&](StringRef Msg) { + llvm::errs() << Msg << '\n'; + std::exit(1); + }); + + if (Args.hasArg(OPT_help)) { + Tbl.printHelp(llvm::outs(), "clang-scan-deps [options]", "clang-scan-deps"); + std::exit(0); + } + if (Args.hasArg(OPT_version)) { + llvm::outs() << ToolName << '\n'; + llvm::cl::PrintVersionMessage(); + std::exit(0); + } + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_mode_EQ)) { + auto ModeType = + llvm::StringSwitch>(A->getValue()) + .Case("preprocess-dependency-directives", + ScanningMode::DependencyDirectivesScan) + .Case("preprocess", ScanningMode::CanonicalPreprocessing) + .Default(std::nullopt); + if (!ModeType) { + llvm::errs() << ToolName + << ": for the --mode option: Cannot find option named '" + << A->getValue() << "'\n"; + std::exit(1); + } + ScanMode = *ModeType; + } + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_format_EQ)) { + auto FormatType = + llvm::StringSwitch>(A->getValue()) + .Case("make", ScanningOutputFormat::Make) + .Case("p1689", ScanningOutputFormat::P1689) + .Case("experimental-full", ScanningOutputFormat::Full) + .Default(std::nullopt); + if (!FormatType) { + llvm::errs() << ToolName + << ": for the --format option: Cannot find option named '" + << A->getValue() << "'\n"; + std::exit(1); + } + Format = *FormatType; + } + + std::vector OptimizationFlags = + Args.getAllArgValues(OPT_optimize_args_EQ); + OptimizeArgs = ScanningOptimizations::None; + for (const auto &Arg : OptimizationFlags) { + auto Optimization = + llvm::StringSwitch>(Arg) + .Case("none", ScanningOptimizations::None) + .Case("header-search", ScanningOptimizations::HeaderSearch) + .Case("system-warnings", ScanningOptimizations::SystemWarnings) + .Case("vfs", ScanningOptimizations::VFS) + .Case("canonicalize-macros", ScanningOptimizations::Macros) + .Case("all", ScanningOptimizations::All) + .Default(std::nullopt); + if (!Optimization) { + llvm::errs() + << ToolName + << ": for the --optimize-args option: Cannot find option named '" + << Arg << "'\n"; + std::exit(1); + } + OptimizeArgs |= *Optimization; + } + if (OptimizationFlags.empty()) + OptimizeArgs = ScanningOptimizations::Default; + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_module_files_dir_EQ)) + ModuleFilesDir = A->getValue(); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_o)) + OutputFileName = A->getValue(); + + EagerLoadModules = Args.hasArg(OPT_eager_load_pcm); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_j)) { + StringRef S{A->getValue()}; + if (!llvm::to_integer(S, NumThreads, 0)) { + llvm::errs() << ToolName << ": for the -j option: '" << S + << "' value invalid for uint argument!\n"; + std::exit(1); + } + } + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_compilation_database_EQ)) + CompilationDB = A->getValue(); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_module_name_EQ)) + ModuleName = A->getValue(); + + for (const llvm::opt::Arg *A : Args.filtered(OPT_dependency_target_EQ)) + ModuleDepTargets.emplace_back(A->getValue()); + + DeprecatedDriverCommand = Args.hasArg(OPT_deprecated_driver_command); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_resource_dir_recipe_EQ)) { + auto Kind = + llvm::StringSwitch>(A->getValue()) + .Case("modify-compiler-path", RDRK_ModifyCompilerPath) + .Case("invoke-compiler", RDRK_InvokeCompiler) + .Default(std::nullopt); + if (!Kind) { + llvm::errs() << ToolName + << ": for the --resource-dir-recipe option: Cannot find " + "option named '" + << A->getValue() << "'\n"; + std::exit(1); + } + ResourceDirRecipe = *Kind; + } + + PrintTiming = Args.hasArg(OPT_print_timing); + + Verbose = Args.hasArg(OPT_verbose); + + RoundTripArgs = Args.hasArg(OPT_round_trip_args); + + if (const llvm::opt::Arg *A = Args.getLastArgNoClaim(OPT_DASH_DASH)) + CommandLine.assign(A->getValues().begin(), A->getValues().end()); +} + +class SharedStream { +public: + SharedStream(raw_ostream &OS) : OS(OS) {} + void applyLocked(llvm::function_ref Fn) { + std::unique_lock LockGuard(Lock); + Fn(OS); + OS.flush(); + } + +private: + std::mutex Lock; + raw_ostream &OS; +}; + +class ResourceDirectoryCache { +public: + /// findResourceDir finds the resource directory relative to the clang + /// compiler being used in Args, by running it with "-print-resource-dir" + /// option and cache the results for reuse. \returns resource directory path + /// associated with the given invocation command or empty string if the + /// compiler path is NOT an absolute path. + StringRef findResourceDir(const tooling::CommandLineArguments &Args, + bool ClangCLMode) { + if (Args.size() < 1) + return ""; + + const std::string &ClangBinaryPath = Args[0]; + if (!llvm::sys::path::is_absolute(ClangBinaryPath)) + return ""; + + const std::string &ClangBinaryName = + std::string(llvm::sys::path::filename(ClangBinaryPath)); + + std::unique_lock LockGuard(CacheLock); + const auto &CachedResourceDir = Cache.find(ClangBinaryPath); + if (CachedResourceDir != Cache.end()) + return CachedResourceDir->second; + + std::vector PrintResourceDirArgs{ClangBinaryName}; + if (ClangCLMode) + PrintResourceDirArgs.push_back("/clang:-print-resource-dir"); + else + PrintResourceDirArgs.push_back("-print-resource-dir"); + + llvm::SmallString<64> OutputFile, ErrorFile; + llvm::sys::fs::createTemporaryFile("print-resource-dir-output", + "" /*no-suffix*/, OutputFile); + llvm::sys::fs::createTemporaryFile("print-resource-dir-error", + "" /*no-suffix*/, ErrorFile); + llvm::FileRemover OutputRemover(OutputFile.c_str()); + llvm::FileRemover ErrorRemover(ErrorFile.c_str()); + std::optional Redirects[] = { + {""}, // Stdin + OutputFile.str(), + ErrorFile.str(), + }; + if (llvm::sys::ExecuteAndWait(ClangBinaryPath, PrintResourceDirArgs, {}, + Redirects)) { + auto ErrorBuf = llvm::MemoryBuffer::getFile(ErrorFile.c_str()); + llvm::errs() << ErrorBuf.get()->getBuffer(); + return ""; + } + + auto OutputBuf = llvm::MemoryBuffer::getFile(OutputFile.c_str()); + if (!OutputBuf) + return ""; + StringRef Output = OutputBuf.get()->getBuffer().rtrim('\n'); + + Cache[ClangBinaryPath] = Output.str(); + return Cache[ClangBinaryPath]; + } + +private: + std::map Cache; + std::mutex CacheLock; +}; + +} // end anonymous namespace + +/// Takes the result of a dependency scan and prints error / dependency files +/// based on the result. +/// +/// \returns True on error. +static bool +handleMakeDependencyToolResult(const std::string &Input, + llvm::Expected &MaybeFile, + SharedStream &OS, SharedStream &Errs) { + if (!MaybeFile) { + llvm::handleAllErrors( + MaybeFile.takeError(), [&Input, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " << Input << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + OS.applyLocked([&](raw_ostream &OS) { OS << *MaybeFile; }); + return false; +} + +static llvm::json::Array toJSONSorted(const llvm::StringSet<> &Set) { + std::vector Strings; + for (auto &&I : Set) + Strings.push_back(I.getKey()); + llvm::sort(Strings); + return llvm::json::Array(Strings); +} + +// Technically, we don't need to sort the dependency list to get determinism. +// Leaving these be will simply preserve the import order. +static llvm::json::Array toJSONSorted(std::vector V) { + llvm::sort(V); + + llvm::json::Array Ret; + for (const ModuleID &MID : V) + Ret.push_back(llvm::json::Object( + {{"module-name", MID.ModuleName}, {"context-hash", MID.ContextHash}})); + return Ret; +} + +static llvm::json::Array +toJSONSorted(llvm::SmallVector &LinkLibs) { + llvm::sort(LinkLibs, [](const Module::LinkLibrary &lhs, + const Module::LinkLibrary &rhs) { + return lhs.Library < rhs.Library; + }); + + llvm::json::Array Ret; + for (const Module::LinkLibrary &LL : LinkLibs) + Ret.push_back(llvm::json::Object( + {{"link-name", LL.Library}, {"isFramework", LL.IsFramework}})); + return Ret; +} + +// Thread safe. +class FullDeps { +public: + FullDeps(size_t NumInputs) : Inputs(NumInputs) {} + + void mergeDeps(StringRef Input, TranslationUnitDeps TUDeps, + size_t InputIndex) { + mergeDeps(std::move(TUDeps.ModuleGraph), InputIndex); + + InputDeps ID; + ID.FileName = std::string(Input); + ID.ContextHash = std::move(TUDeps.ID.ContextHash); + ID.FileDeps = std::move(TUDeps.FileDeps); + ID.ModuleDeps = std::move(TUDeps.ClangModuleDeps); + ID.DriverCommandLine = std::move(TUDeps.DriverCommandLine); + ID.Commands = std::move(TUDeps.Commands); + + assert(InputIndex < Inputs.size() && "Input index out of bounds"); + assert(Inputs[InputIndex].FileName.empty() && "Result already populated"); + Inputs[InputIndex] = std::move(ID); + } + + void mergeDeps(ModuleDepsGraph Graph, size_t InputIndex) { + std::vector NewMDs; + { + std::unique_lock ul(Lock); + for (const ModuleDeps &MD : Graph) { + auto I = Modules.find({MD.ID, 0}); + if (I != Modules.end()) { + I->first.InputIndex = std::min(I->first.InputIndex, InputIndex); + continue; + } + auto Res = Modules.insert(I, {{MD.ID, InputIndex}, std::move(MD)}); + NewMDs.push_back(&Res->second); + } + // First call to \c getBuildArguments is somewhat expensive. Let's call it + // on the current thread (instead of the main one), and outside the + // critical section. + for (ModuleDeps *MD : NewMDs) + (void)MD->getBuildArguments(); + } + } + + bool roundTripCommand(ArrayRef ArgStrs, + DiagnosticsEngine &Diags) { + if (ArgStrs.empty() || ArgStrs[0] != "-cc1") + return false; + SmallVector Args; + for (const std::string &Arg : ArgStrs) + Args.push_back(Arg.c_str()); + return !CompilerInvocation::checkCC1RoundTrip(Args, Diags); + } + + // Returns \c true if any command lines fail to round-trip. We expect + // commands already be canonical when output by the scanner. + bool roundTripCommands(raw_ostream &ErrOS) { + IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions{}; + TextDiagnosticPrinter DiagConsumer(ErrOS, &*DiagOpts); + IntrusiveRefCntPtr Diags = + CompilerInstance::createDiagnostics(&*DiagOpts, &DiagConsumer, + /*ShouldOwnClient=*/false); + + for (auto &&M : Modules) + if (roundTripCommand(M.second.getBuildArguments(), *Diags)) + return true; + + for (auto &&I : Inputs) + for (const auto &Cmd : I.Commands) + if (roundTripCommand(Cmd.Arguments, *Diags)) + return true; + + return false; + } + + void printFullOutput(raw_ostream &OS) { + // Skip sorting modules and constructing the JSON object if the output + // cannot be observed anyway. This makes timings less noisy. + if (&OS == &llvm::nulls()) + return; + + // Sort the modules by name to get a deterministic order. + std::vector ModuleIDs; + for (auto &&M : Modules) + ModuleIDs.push_back(M.first); + llvm::sort(ModuleIDs); + + using namespace llvm::json; + + Array OutModules; + for (auto &&ModID : ModuleIDs) { + auto &MD = Modules[ModID]; + Object O{{"name", MD.ID.ModuleName}, + {"context-hash", MD.ID.ContextHash}, + {"file-deps", toJSONSorted(MD.FileDeps)}, + {"clang-module-deps", toJSONSorted(MD.ClangModuleDeps)}, + {"clang-modulemap-file", MD.ClangModuleMapFile}, + {"command-line", MD.getBuildArguments()}, + {"link-libraries", toJSONSorted(MD.LinkLibraries)}}; + OutModules.push_back(std::move(O)); + } + + Array TUs; + for (auto &&I : Inputs) { + Array Commands; + if (I.DriverCommandLine.empty()) { + for (const auto &Cmd : I.Commands) { + Object O{ + {"input-file", I.FileName}, + {"clang-context-hash", I.ContextHash}, + {"file-deps", I.FileDeps}, + {"clang-module-deps", toJSONSorted(I.ModuleDeps)}, + {"executable", Cmd.Executable}, + {"command-line", Cmd.Arguments}, + }; + Commands.push_back(std::move(O)); + } + } else { + Object O{ + {"input-file", I.FileName}, + {"clang-context-hash", I.ContextHash}, + {"file-deps", I.FileDeps}, + {"clang-module-deps", toJSONSorted(I.ModuleDeps)}, + {"executable", "clang"}, + {"command-line", I.DriverCommandLine}, + }; + Commands.push_back(std::move(O)); + } + TUs.push_back(Object{ + {"commands", std::move(Commands)}, + }); + } + + Object Output{ + {"modules", std::move(OutModules)}, + {"translation-units", std::move(TUs)}, + }; + + OS << llvm::formatv("{0:2}\n", Value(std::move(Output))); + } + +private: + struct IndexedModuleID { + ModuleID ID; + + // FIXME: This is mutable so that it can still be updated after insertion + // into an unordered associative container. This is "fine", since this + // field doesn't contribute to the hash, but it's a brittle hack. + mutable size_t InputIndex; + + bool operator==(const IndexedModuleID &Other) const { + return ID == Other.ID; + } + + bool operator<(const IndexedModuleID &Other) const { + /// We need the output of clang-scan-deps to be deterministic. However, + /// the dependency graph may contain two modules with the same name. How + /// do we decide which one to print first? If we made that decision based + /// on the context hash, the ordering would be deterministic, but + /// different across machines. This can happen for example when the inputs + /// or the SDKs (which both contribute to the "context" hash) live in + /// different absolute locations. We solve that by tracking the index of + /// the first input TU that (transitively) imports the dependency, which + /// is always the same for the same input, resulting in deterministic + /// sorting that's also reproducible across machines. + return std::tie(ID.ModuleName, InputIndex) < + std::tie(Other.ID.ModuleName, Other.InputIndex); + } + + struct Hasher { + std::size_t operator()(const IndexedModuleID &IMID) const { + return llvm::hash_value(IMID.ID); + } + }; + }; + + struct InputDeps { + std::string FileName; + std::string ContextHash; + std::vector FileDeps; + std::vector ModuleDeps; + std::vector DriverCommandLine; + std::vector Commands; + }; + + std::mutex Lock; + std::unordered_map + Modules; + std::vector Inputs; +}; + +static bool handleTranslationUnitResult( + StringRef Input, llvm::Expected &MaybeTUDeps, + FullDeps &FD, size_t InputIndex, SharedStream &OS, SharedStream &Errs) { + if (!MaybeTUDeps) { + llvm::handleAllErrors( + MaybeTUDeps.takeError(), [&Input, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " << Input << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + FD.mergeDeps(Input, std::move(*MaybeTUDeps), InputIndex); + return false; +} + +static bool handleModuleResult( + StringRef ModuleName, llvm::Expected &MaybeModuleGraph, + FullDeps &FD, size_t InputIndex, SharedStream &OS, SharedStream &Errs) { + if (!MaybeModuleGraph) { + llvm::handleAllErrors(MaybeModuleGraph.takeError(), + [&ModuleName, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " + << ModuleName << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + FD.mergeDeps(std::move(*MaybeModuleGraph), InputIndex); + return false; +} + +class P1689Deps { +public: + void printDependencies(raw_ostream &OS) { + addSourcePathsToRequires(); + // Sort the modules by name to get a deterministic order. + llvm::sort(Rules, [](const P1689Rule &A, const P1689Rule &B) { + return A.PrimaryOutput < B.PrimaryOutput; + }); + + using namespace llvm::json; + Array OutputRules; + for (const P1689Rule &R : Rules) { + Object O{{"primary-output", R.PrimaryOutput}}; + + if (R.Provides) { + Array Provides; + Object Provided{{"logical-name", R.Provides->ModuleName}, + {"source-path", R.Provides->SourcePath}, + {"is-interface", R.Provides->IsStdCXXModuleInterface}}; + Provides.push_back(std::move(Provided)); + O.insert({"provides", std::move(Provides)}); + } + + Array Requires; + for (const P1689ModuleInfo &Info : R.Requires) { + Object RequiredInfo{{"logical-name", Info.ModuleName}}; + if (!Info.SourcePath.empty()) + RequiredInfo.insert({"source-path", Info.SourcePath}); + Requires.push_back(std::move(RequiredInfo)); + } + + if (!Requires.empty()) + O.insert({"requires", std::move(Requires)}); + + OutputRules.push_back(std::move(O)); + } + + Object Output{ + {"version", 1}, {"revision", 0}, {"rules", std::move(OutputRules)}}; + + OS << llvm::formatv("{0:2}\n", Value(std::move(Output))); + } + + void addRules(P1689Rule &Rule) { + std::unique_lock LockGuard(Lock); + Rules.push_back(Rule); + } + +private: + void addSourcePathsToRequires() { + llvm::DenseMap ModuleSourceMapper; + for (const P1689Rule &R : Rules) + if (R.Provides && !R.Provides->SourcePath.empty()) + ModuleSourceMapper[R.Provides->ModuleName] = R.Provides->SourcePath; + + for (P1689Rule &R : Rules) { + for (P1689ModuleInfo &Info : R.Requires) { + auto Iter = ModuleSourceMapper.find(Info.ModuleName); + if (Iter != ModuleSourceMapper.end()) + Info.SourcePath = Iter->second; + } + } + } + + std::mutex Lock; + std::vector Rules; +}; + +static bool +handleP1689DependencyToolResult(const std::string &Input, + llvm::Expected &MaybeRule, + P1689Deps &PD, SharedStream &Errs) { + if (!MaybeRule) { + llvm::handleAllErrors( + MaybeRule.takeError(), [&Input, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " << Input << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + PD.addRules(*MaybeRule); + return false; +} + +/// Construct a path for the explicitly built PCM. +static std::string constructPCMPath(ModuleID MID, StringRef OutputDir) { + SmallString<256> ExplicitPCMPath(OutputDir); + llvm::sys::path::append(ExplicitPCMPath, MID.ContextHash, + MID.ModuleName + "-" + MID.ContextHash + ".pcm"); + return std::string(ExplicitPCMPath); +} + +static std::string lookupModuleOutput(const ModuleID &MID, ModuleOutputKind MOK, + StringRef OutputDir) { + std::string PCMPath = constructPCMPath(MID, OutputDir); + switch (MOK) { + case ModuleOutputKind::ModuleFile: + return PCMPath; + case ModuleOutputKind::DependencyFile: + return PCMPath + ".d"; + case ModuleOutputKind::DependencyTargets: + // Null-separate the list of targets. + return join(ModuleDepTargets, StringRef("\0", 1)); + case ModuleOutputKind::DiagnosticSerializationFile: + return PCMPath + ".diag"; + } + llvm_unreachable("Fully covered switch above!"); +} + +static std::string getModuleCachePath(ArrayRef Args) { + for (StringRef Arg : llvm::reverse(Args)) { + Arg.consume_front("/clang:"); + if (Arg.consume_front("-fmodules-cache-path=")) + return std::string(Arg); + } + SmallString<128> Path; + driver::Driver::getDefaultModuleCachePath(Path); + return std::string(Path); +} + +/// Attempts to construct the compilation database from '-compilation-database' +/// or from the arguments following the positional '--'. +static std::unique_ptr +getCompilationDatabase(int argc, char **argv, std::string &ErrorMessage) { + ParseArgs(argc, argv); + + if (!(CommandLine.empty() ^ CompilationDB.empty())) { + llvm::errs() << "The compilation command line must be provided either via " + "'-compilation-database' or after '--'."; + return nullptr; + } + + if (!CompilationDB.empty()) + return tooling::JSONCompilationDatabase::loadFromFile( + CompilationDB, ErrorMessage, + tooling::JSONCommandLineSyntax::AutoDetect); + + llvm::IntrusiveRefCntPtr Diags = + CompilerInstance::createDiagnostics(new DiagnosticOptions); + driver::Driver TheDriver(CommandLine[0], llvm::sys::getDefaultTargetTriple(), + *Diags); + TheDriver.setCheckInputsExist(false); + std::unique_ptr C( + TheDriver.BuildCompilation(CommandLine)); + if (!C || C->getJobs().empty()) + return nullptr; + + auto Cmd = C->getJobs().begin(); + auto CI = std::make_unique(); + CompilerInvocation::CreateFromArgs(*CI, Cmd->getArguments(), *Diags, + CommandLine[0]); + if (!CI) + return nullptr; + + FrontendOptions &FEOpts = CI->getFrontendOpts(); + if (FEOpts.Inputs.size() != 1) { + llvm::errs() + << "Exactly one input file is required in the per-file mode ('--').\n"; + return nullptr; + } + + // There might be multiple jobs for a compilation. Extract the specified + // output filename from the last job. + auto LastCmd = C->getJobs().end(); + LastCmd--; + if (LastCmd->getOutputFilenames().size() != 1) { + llvm::errs() + << "Exactly one output file is required in the per-file mode ('--').\n"; + return nullptr; + } + StringRef OutputFile = LastCmd->getOutputFilenames().front(); + + class InplaceCompilationDatabase : public tooling::CompilationDatabase { + public: + InplaceCompilationDatabase(StringRef InputFile, StringRef OutputFile, + ArrayRef CommandLine) + : Command(".", InputFile, {}, OutputFile) { + for (auto *C : CommandLine) + Command.CommandLine.push_back(C); + } + + std::vector + getCompileCommands(StringRef FilePath) const override { + if (FilePath != Command.Filename) + return {}; + return {Command}; + } + + std::vector getAllFiles() const override { + return {Command.Filename}; + } + + std::vector + getAllCompileCommands() const override { + return {Command}; + } + + private: + tooling::CompileCommand Command; + }; + + return std::make_unique( + FEOpts.Inputs[0].getFile(), OutputFile, CommandLine); +} + +int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { + llvm::InitializeAllTargetInfos(); + std::string ErrorMessage; + std::unique_ptr Compilations = + getCompilationDatabase(argc, argv, ErrorMessage); + if (!Compilations) { + llvm::errs() << ErrorMessage << "\n"; + return 1; + } + + llvm::cl::PrintOptionValues(); + + // Expand response files in advance, so that we can "see" all the arguments + // when adjusting below. + Compilations = expandResponseFiles(std::move(Compilations), + llvm::vfs::getRealFileSystem()); + + Compilations = inferTargetAndDriverMode(std::move(Compilations)); + + Compilations = inferToolLocation(std::move(Compilations)); + + // The command options are rewritten to run Clang in preprocessor only mode. + auto AdjustingCompilations = + std::make_unique( + std::move(Compilations)); + ResourceDirectoryCache ResourceDirCache; + + AdjustingCompilations->appendArgumentsAdjuster( + [&ResourceDirCache](const tooling::CommandLineArguments &Args, + StringRef FileName) { + std::string LastO; + bool HasResourceDir = false; + bool ClangCLMode = false; + auto FlagsEnd = llvm::find(Args, "--"); + if (FlagsEnd != Args.begin()) { + ClangCLMode = + llvm::sys::path::stem(Args[0]).contains_insensitive("clang-cl") || + llvm::is_contained(Args, "--driver-mode=cl"); + + // Reverse scan, starting at the end or at the element before "--". + auto R = std::make_reverse_iterator(FlagsEnd); + auto E = Args.rend(); + // Don't include Args[0] in the iteration; that's the executable, not + // an option. + if (E != R) + E--; + for (auto I = R; I != E; ++I) { + StringRef Arg = *I; + if (ClangCLMode) { + // Ignore arguments that are preceded by "-Xclang". + if ((I + 1) != E && I[1] == "-Xclang") + continue; + if (LastO.empty()) { + // With clang-cl, the output obj file can be specified with + // "/opath", "/o path", "/Fopath", and the dash counterparts. + // Also, clang-cl adds ".obj" extension if none is found. + if ((Arg == "-o" || Arg == "/o") && I != R) + LastO = I[-1]; // Next argument (reverse iterator) + else if (Arg.starts_with("/Fo") || Arg.starts_with("-Fo")) + LastO = Arg.drop_front(3).str(); + else if (Arg.starts_with("/o") || Arg.starts_with("-o")) + LastO = Arg.drop_front(2).str(); + + if (!LastO.empty() && !llvm::sys::path::has_extension(LastO)) + LastO.append(".obj"); + } + } + if (Arg == "-resource-dir") + HasResourceDir = true; + } + } + tooling::CommandLineArguments AdjustedArgs(Args.begin(), FlagsEnd); + // The clang-cl driver passes "-o -" to the frontend. Inject the real + // file here to ensure "-MT" can be deduced if need be. + if (ClangCLMode && !LastO.empty()) { + AdjustedArgs.push_back("/clang:-o"); + AdjustedArgs.push_back("/clang:" + LastO); + } + + if (!HasResourceDir && ResourceDirRecipe == RDRK_InvokeCompiler) { + StringRef ResourceDir = + ResourceDirCache.findResourceDir(Args, ClangCLMode); + if (!ResourceDir.empty()) { + AdjustedArgs.push_back("-resource-dir"); + AdjustedArgs.push_back(std::string(ResourceDir)); + } + } + AdjustedArgs.insert(AdjustedArgs.end(), FlagsEnd, Args.end()); + return AdjustedArgs; + }); + + SharedStream Errs(llvm::errs()); + + std::optional FileOS; + llvm::raw_ostream &ThreadUnsafeDependencyOS = [&]() -> llvm::raw_ostream & { + if (OutputFileName == "-") + return llvm::outs(); + + if (OutputFileName == "/dev/null") + return llvm::nulls(); + + std::error_code EC; + FileOS.emplace(OutputFileName, EC); + if (EC) { + llvm::errs() << "Failed to open output file '" << OutputFileName + << "': " << llvm::errorCodeToError(EC) << '\n'; + std::exit(1); + } + return *FileOS; + }(); + SharedStream DependencyOS(ThreadUnsafeDependencyOS); + + std::vector Inputs = + AdjustingCompilations->getAllCompileCommands(); + + std::atomic HadErrors(false); + std::optional FD; + P1689Deps PD; + + std::mutex Lock; + size_t Index = 0; + auto GetNextInputIndex = [&]() -> std::optional { + std::unique_lock LockGuard(Lock); + if (Index < Inputs.size()) + return Index++; + return {}; + }; + + if (Format == ScanningOutputFormat::Full) + FD.emplace(ModuleName.empty() ? Inputs.size() : 0); + + auto ScanningTask = [&](DependencyScanningService &Service) { + DependencyScanningTool WorkerTool(Service); + + llvm::DenseSet AlreadySeenModules; + while (auto MaybeInputIndex = GetNextInputIndex()) { + size_t LocalIndex = *MaybeInputIndex; + const tooling::CompileCommand *Input = &Inputs[LocalIndex]; *** 167 LINES SKIPPED *** From nobody Wed Jul 2 18:21:18 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXSrv3L0Jz60lhj; Wed, 02 Jul 2025 18:21: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 4bXSrv0XHQz3FbB; Wed, 02 Jul 2025 18:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRIgg8GLJV1+fezRc3DyeucnGwLReeLsWreROzWXW28=; b=RI9qf16z2wnH9/byhS/e//e3WcMXHDjjmNwcVReWUNjxNyzc1RKKal3k+XXfajE6phRVox 2jEKlvOw21HPlOSySGRPTb16hLx8xjqQBuJtAVcRS5CZI0qyf+eF0H40EHfnGsgwoWSH5P 8tm8r4y78gT0nTH49z1AAU630pmRoXSj/3T3quEV4M+6T6s17hJBHe7mIQeJA6xZ7YiyC6 Q6VzIvsXWqk3TUmU2UjKShI/boamuw4g3hfLsf0a3V8xFNixzfkjZ2Hi90A6B639UxEGK3 g6wcziKnReCrQ4LRPFydeQcFyG1dxvkS9GN90EL5Flh1UsOZB5AWv/olfqbJ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRIgg8GLJV1+fezRc3DyeucnGwLReeLsWreROzWXW28=; b=Mfl2GBSTCGG8GMsXEhyvJd+8QfJRkJKK6KGyC6wP7nWWm3Tuooz8LQo6rLIAUbmsRqlqyb msnkcwfocGEIqmgT8N3vVZpA0HaYHLBcBZhFiqU091sqJ/oTUApU4htFV1Wh1W34FG1dPo Eq9aZzOlOBW4fHqSMkbj+aJEe7kEtaWAiWP2c4WM/QDK+uBcc8BS22+9o3L/N6GdXAyEL0 bu6Mk9qV/f6SYSBfPkEzBgLQIMasvMDWXhXamwH4atTBnVE3qpILyREdvhSvomSFn42ERM EiXXtoZsfeKsMqNgtuvnyLDnsZyIzbhZL70hrg95D9AdTl4eG/DAhVRBL2zGKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480479; a=rsa-sha256; cv=none; b=GvLd5ewqp0PNiQwuYfAhaZURWBBJS9mk7C9AY3IAcnQCNHPDPe5/7LAidEOChk6r3HUwem efgF7pJNCO/nnSYrXIeDYo7trV3nSfQaEihVpQKX/5LeEWioQmPVk1tPNNLWc3rVnQ4rAc eNeGtjJ+HjN7sE+64ImnWi1fAzeaNJROXohYf9epAkqTmyE6DeKrqr4PM5tNzXRbFptr4Z mXQLUL/8lfEyfYjuCsCF87oszNtkHYlwmg1LNcVBWNroqzk8j/PNzgvhEKqndqmOcjZsj1 OwyLT+cEK2US4NayoWxr4ueoAilDM1Ucynp88SUBmX9OdxzSz2uwsacQqBhfzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXSrt6hJnzVbh; Wed, 02 Jul 2025 18:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 562ILIsE049151; Wed, 2 Jul 2025 18:21:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ILII6049148; Wed, 2 Jul 2025 18:21:18 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:21:18 GMT Message-Id: <202507021821.562ILII6049148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: f82159545a3c - stable/13 - contrib/llvm-project: re-add clang/tools/clang-scan-deps List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f82159545a3c38e507542002290036a0cf4920ac Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f82159545a3c38e507542002290036a0cf4920ac commit f82159545a3c38e507542002290036a0cf4920ac Author: Dimitry Andric AuthorDate: 2025-06-25 17:19:51 +0000 Commit: Dimitry Andric CommitDate: 2025-07-02 18:08:51 +0000 contrib/llvm-project: re-add clang/tools/clang-scan-deps This is in preparation for adding it as an optional tool in base. MFC after: 1 week (cherry picked from commit 7ed1628066eaf55b86f35af86efe804508201cc8) --- contrib/llvm-project/FREEBSD-Xlist | 3 +- .../clang/tools/clang-scan-deps/ClangScanDeps.cpp | 1055 ++++++++++++++++++++ .../clang/tools/clang-scan-deps/Opts.td | 42 + 3 files changed, 1098 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/FREEBSD-Xlist b/contrib/llvm-project/FREEBSD-Xlist index 45cd2c1d6f46..43fa40070f5d 100644 --- a/contrib/llvm-project/FREEBSD-Xlist +++ b/contrib/llvm-project/FREEBSD-Xlist @@ -129,7 +129,7 @@ clang/tools/clang-offload-packager/ clang/tools/clang-refactor/ clang/tools/clang-rename/ clang/tools/clang-repl/ -clang/tools/clang-scan-deps/ +clang/tools/clang-scan-deps/CMakeLists.txt clang/tools/clang-shlib/ clang/tools/diag-build/ clang/tools/diagtool/ @@ -805,7 +805,6 @@ llvm/tools/llvm-bcanalyzer/CMakeLists.txt llvm/tools/llvm-c-test/ llvm/tools/llvm-cat/ llvm/tools/llvm-cfi-verify/ -llvm/tools/llvm-cgdata/ llvm/tools/llvm-config/ llvm/tools/llvm-cov/CMakeLists.txt llvm/tools/llvm-cvtres/ diff --git a/contrib/llvm-project/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/contrib/llvm-project/clang/tools/clang-scan-deps/ClangScanDeps.cpp new file mode 100644 index 000000000000..867df19c863f --- /dev/null +++ b/contrib/llvm-project/clang/tools/clang-scan-deps/ClangScanDeps.cpp @@ -0,0 +1,1055 @@ +//===- ClangScanDeps.cpp - Implementation of clang-scan-deps --------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "clang/Driver/Compilation.h" +#include "clang/Driver/Driver.h" +#include "clang/Frontend/CompilerInstance.h" +#include "clang/Frontend/TextDiagnosticPrinter.h" +#include "clang/Tooling/CommonOptionsParser.h" +#include "clang/Tooling/DependencyScanning/DependencyScanningService.h" +#include "clang/Tooling/DependencyScanning/DependencyScanningTool.h" +#include "clang/Tooling/DependencyScanning/DependencyScanningWorker.h" +#include "clang/Tooling/JSONCompilationDatabase.h" +#include "clang/Tooling/Tooling.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/FileUtilities.h" +#include "llvm/Support/Format.h" +#include "llvm/Support/JSON.h" +#include "llvm/Support/LLVMDriver.h" +#include "llvm/Support/Program.h" +#include "llvm/Support/Signals.h" +#include "llvm/Support/TargetSelect.h" +#include "llvm/Support/ThreadPool.h" +#include "llvm/Support/Threading.h" +#include "llvm/Support/Timer.h" +#include "llvm/TargetParser/Host.h" +#include +#include +#include + +#include "Opts.inc" + +using namespace clang; +using namespace tooling::dependencies; + +namespace { + +using namespace llvm::opt; +enum ID { + OPT_INVALID = 0, // This is not an option ID. +#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__), +#include "Opts.inc" +#undef OPTION +}; + +#define PREFIX(NAME, VALUE) \ + constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ + constexpr llvm::ArrayRef NAME( \ + NAME##_init, std::size(NAME##_init) - 1); +#include "Opts.inc" +#undef PREFIX + +const llvm::opt::OptTable::Info InfoTable[] = { +#define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), +#include "Opts.inc" +#undef OPTION +}; + +class ScanDepsOptTable : public llvm::opt::GenericOptTable { +public: + ScanDepsOptTable() : GenericOptTable(InfoTable) { + setGroupedShortOptions(true); + } +}; + +enum ResourceDirRecipeKind { + RDRK_ModifyCompilerPath, + RDRK_InvokeCompiler, +}; + +static std::string OutputFileName = "-"; +static ScanningMode ScanMode = ScanningMode::DependencyDirectivesScan; +static ScanningOutputFormat Format = ScanningOutputFormat::Make; +static ScanningOptimizations OptimizeArgs; +static std::string ModuleFilesDir; +static bool EagerLoadModules; +static unsigned NumThreads = 0; +static std::string CompilationDB; +static std::string ModuleName; +static std::vector ModuleDepTargets; +static bool DeprecatedDriverCommand; +static ResourceDirRecipeKind ResourceDirRecipe; +static bool Verbose; +static bool PrintTiming; +static llvm::BumpPtrAllocator Alloc; +static llvm::StringSaver Saver{Alloc}; +static std::vector CommandLine; + +#ifndef NDEBUG +static constexpr bool DoRoundTripDefault = true; +#else +static constexpr bool DoRoundTripDefault = false; +#endif + +static bool RoundTripArgs = DoRoundTripDefault; + +static void ParseArgs(int argc, char **argv) { + ScanDepsOptTable Tbl; + llvm::StringRef ToolName = argv[0]; + llvm::opt::InputArgList Args = + Tbl.parseArgs(argc, argv, OPT_UNKNOWN, Saver, [&](StringRef Msg) { + llvm::errs() << Msg << '\n'; + std::exit(1); + }); + + if (Args.hasArg(OPT_help)) { + Tbl.printHelp(llvm::outs(), "clang-scan-deps [options]", "clang-scan-deps"); + std::exit(0); + } + if (Args.hasArg(OPT_version)) { + llvm::outs() << ToolName << '\n'; + llvm::cl::PrintVersionMessage(); + std::exit(0); + } + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_mode_EQ)) { + auto ModeType = + llvm::StringSwitch>(A->getValue()) + .Case("preprocess-dependency-directives", + ScanningMode::DependencyDirectivesScan) + .Case("preprocess", ScanningMode::CanonicalPreprocessing) + .Default(std::nullopt); + if (!ModeType) { + llvm::errs() << ToolName + << ": for the --mode option: Cannot find option named '" + << A->getValue() << "'\n"; + std::exit(1); + } + ScanMode = *ModeType; + } + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_format_EQ)) { + auto FormatType = + llvm::StringSwitch>(A->getValue()) + .Case("make", ScanningOutputFormat::Make) + .Case("p1689", ScanningOutputFormat::P1689) + .Case("experimental-full", ScanningOutputFormat::Full) + .Default(std::nullopt); + if (!FormatType) { + llvm::errs() << ToolName + << ": for the --format option: Cannot find option named '" + << A->getValue() << "'\n"; + std::exit(1); + } + Format = *FormatType; + } + + std::vector OptimizationFlags = + Args.getAllArgValues(OPT_optimize_args_EQ); + OptimizeArgs = ScanningOptimizations::None; + for (const auto &Arg : OptimizationFlags) { + auto Optimization = + llvm::StringSwitch>(Arg) + .Case("none", ScanningOptimizations::None) + .Case("header-search", ScanningOptimizations::HeaderSearch) + .Case("system-warnings", ScanningOptimizations::SystemWarnings) + .Case("vfs", ScanningOptimizations::VFS) + .Case("canonicalize-macros", ScanningOptimizations::Macros) + .Case("all", ScanningOptimizations::All) + .Default(std::nullopt); + if (!Optimization) { + llvm::errs() + << ToolName + << ": for the --optimize-args option: Cannot find option named '" + << Arg << "'\n"; + std::exit(1); + } + OptimizeArgs |= *Optimization; + } + if (OptimizationFlags.empty()) + OptimizeArgs = ScanningOptimizations::Default; + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_module_files_dir_EQ)) + ModuleFilesDir = A->getValue(); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_o)) + OutputFileName = A->getValue(); + + EagerLoadModules = Args.hasArg(OPT_eager_load_pcm); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_j)) { + StringRef S{A->getValue()}; + if (!llvm::to_integer(S, NumThreads, 0)) { + llvm::errs() << ToolName << ": for the -j option: '" << S + << "' value invalid for uint argument!\n"; + std::exit(1); + } + } + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_compilation_database_EQ)) + CompilationDB = A->getValue(); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_module_name_EQ)) + ModuleName = A->getValue(); + + for (const llvm::opt::Arg *A : Args.filtered(OPT_dependency_target_EQ)) + ModuleDepTargets.emplace_back(A->getValue()); + + DeprecatedDriverCommand = Args.hasArg(OPT_deprecated_driver_command); + + if (const llvm::opt::Arg *A = Args.getLastArg(OPT_resource_dir_recipe_EQ)) { + auto Kind = + llvm::StringSwitch>(A->getValue()) + .Case("modify-compiler-path", RDRK_ModifyCompilerPath) + .Case("invoke-compiler", RDRK_InvokeCompiler) + .Default(std::nullopt); + if (!Kind) { + llvm::errs() << ToolName + << ": for the --resource-dir-recipe option: Cannot find " + "option named '" + << A->getValue() << "'\n"; + std::exit(1); + } + ResourceDirRecipe = *Kind; + } + + PrintTiming = Args.hasArg(OPT_print_timing); + + Verbose = Args.hasArg(OPT_verbose); + + RoundTripArgs = Args.hasArg(OPT_round_trip_args); + + if (const llvm::opt::Arg *A = Args.getLastArgNoClaim(OPT_DASH_DASH)) + CommandLine.assign(A->getValues().begin(), A->getValues().end()); +} + +class SharedStream { +public: + SharedStream(raw_ostream &OS) : OS(OS) {} + void applyLocked(llvm::function_ref Fn) { + std::unique_lock LockGuard(Lock); + Fn(OS); + OS.flush(); + } + +private: + std::mutex Lock; + raw_ostream &OS; +}; + +class ResourceDirectoryCache { +public: + /// findResourceDir finds the resource directory relative to the clang + /// compiler being used in Args, by running it with "-print-resource-dir" + /// option and cache the results for reuse. \returns resource directory path + /// associated with the given invocation command or empty string if the + /// compiler path is NOT an absolute path. + StringRef findResourceDir(const tooling::CommandLineArguments &Args, + bool ClangCLMode) { + if (Args.size() < 1) + return ""; + + const std::string &ClangBinaryPath = Args[0]; + if (!llvm::sys::path::is_absolute(ClangBinaryPath)) + return ""; + + const std::string &ClangBinaryName = + std::string(llvm::sys::path::filename(ClangBinaryPath)); + + std::unique_lock LockGuard(CacheLock); + const auto &CachedResourceDir = Cache.find(ClangBinaryPath); + if (CachedResourceDir != Cache.end()) + return CachedResourceDir->second; + + std::vector PrintResourceDirArgs{ClangBinaryName}; + if (ClangCLMode) + PrintResourceDirArgs.push_back("/clang:-print-resource-dir"); + else + PrintResourceDirArgs.push_back("-print-resource-dir"); + + llvm::SmallString<64> OutputFile, ErrorFile; + llvm::sys::fs::createTemporaryFile("print-resource-dir-output", + "" /*no-suffix*/, OutputFile); + llvm::sys::fs::createTemporaryFile("print-resource-dir-error", + "" /*no-suffix*/, ErrorFile); + llvm::FileRemover OutputRemover(OutputFile.c_str()); + llvm::FileRemover ErrorRemover(ErrorFile.c_str()); + std::optional Redirects[] = { + {""}, // Stdin + OutputFile.str(), + ErrorFile.str(), + }; + if (llvm::sys::ExecuteAndWait(ClangBinaryPath, PrintResourceDirArgs, {}, + Redirects)) { + auto ErrorBuf = llvm::MemoryBuffer::getFile(ErrorFile.c_str()); + llvm::errs() << ErrorBuf.get()->getBuffer(); + return ""; + } + + auto OutputBuf = llvm::MemoryBuffer::getFile(OutputFile.c_str()); + if (!OutputBuf) + return ""; + StringRef Output = OutputBuf.get()->getBuffer().rtrim('\n'); + + Cache[ClangBinaryPath] = Output.str(); + return Cache[ClangBinaryPath]; + } + +private: + std::map Cache; + std::mutex CacheLock; +}; + +} // end anonymous namespace + +/// Takes the result of a dependency scan and prints error / dependency files +/// based on the result. +/// +/// \returns True on error. +static bool +handleMakeDependencyToolResult(const std::string &Input, + llvm::Expected &MaybeFile, + SharedStream &OS, SharedStream &Errs) { + if (!MaybeFile) { + llvm::handleAllErrors( + MaybeFile.takeError(), [&Input, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " << Input << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + OS.applyLocked([&](raw_ostream &OS) { OS << *MaybeFile; }); + return false; +} + +static llvm::json::Array toJSONSorted(const llvm::StringSet<> &Set) { + std::vector Strings; + for (auto &&I : Set) + Strings.push_back(I.getKey()); + llvm::sort(Strings); + return llvm::json::Array(Strings); +} + +// Technically, we don't need to sort the dependency list to get determinism. +// Leaving these be will simply preserve the import order. +static llvm::json::Array toJSONSorted(std::vector V) { + llvm::sort(V); + + llvm::json::Array Ret; + for (const ModuleID &MID : V) + Ret.push_back(llvm::json::Object( + {{"module-name", MID.ModuleName}, {"context-hash", MID.ContextHash}})); + return Ret; +} + +static llvm::json::Array +toJSONSorted(llvm::SmallVector &LinkLibs) { + llvm::sort(LinkLibs, [](const Module::LinkLibrary &lhs, + const Module::LinkLibrary &rhs) { + return lhs.Library < rhs.Library; + }); + + llvm::json::Array Ret; + for (const Module::LinkLibrary &LL : LinkLibs) + Ret.push_back(llvm::json::Object( + {{"link-name", LL.Library}, {"isFramework", LL.IsFramework}})); + return Ret; +} + +// Thread safe. +class FullDeps { +public: + FullDeps(size_t NumInputs) : Inputs(NumInputs) {} + + void mergeDeps(StringRef Input, TranslationUnitDeps TUDeps, + size_t InputIndex) { + mergeDeps(std::move(TUDeps.ModuleGraph), InputIndex); + + InputDeps ID; + ID.FileName = std::string(Input); + ID.ContextHash = std::move(TUDeps.ID.ContextHash); + ID.FileDeps = std::move(TUDeps.FileDeps); + ID.ModuleDeps = std::move(TUDeps.ClangModuleDeps); + ID.DriverCommandLine = std::move(TUDeps.DriverCommandLine); + ID.Commands = std::move(TUDeps.Commands); + + assert(InputIndex < Inputs.size() && "Input index out of bounds"); + assert(Inputs[InputIndex].FileName.empty() && "Result already populated"); + Inputs[InputIndex] = std::move(ID); + } + + void mergeDeps(ModuleDepsGraph Graph, size_t InputIndex) { + std::vector NewMDs; + { + std::unique_lock ul(Lock); + for (const ModuleDeps &MD : Graph) { + auto I = Modules.find({MD.ID, 0}); + if (I != Modules.end()) { + I->first.InputIndex = std::min(I->first.InputIndex, InputIndex); + continue; + } + auto Res = Modules.insert(I, {{MD.ID, InputIndex}, std::move(MD)}); + NewMDs.push_back(&Res->second); + } + // First call to \c getBuildArguments is somewhat expensive. Let's call it + // on the current thread (instead of the main one), and outside the + // critical section. + for (ModuleDeps *MD : NewMDs) + (void)MD->getBuildArguments(); + } + } + + bool roundTripCommand(ArrayRef ArgStrs, + DiagnosticsEngine &Diags) { + if (ArgStrs.empty() || ArgStrs[0] != "-cc1") + return false; + SmallVector Args; + for (const std::string &Arg : ArgStrs) + Args.push_back(Arg.c_str()); + return !CompilerInvocation::checkCC1RoundTrip(Args, Diags); + } + + // Returns \c true if any command lines fail to round-trip. We expect + // commands already be canonical when output by the scanner. + bool roundTripCommands(raw_ostream &ErrOS) { + IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions{}; + TextDiagnosticPrinter DiagConsumer(ErrOS, &*DiagOpts); + IntrusiveRefCntPtr Diags = + CompilerInstance::createDiagnostics(&*DiagOpts, &DiagConsumer, + /*ShouldOwnClient=*/false); + + for (auto &&M : Modules) + if (roundTripCommand(M.second.getBuildArguments(), *Diags)) + return true; + + for (auto &&I : Inputs) + for (const auto &Cmd : I.Commands) + if (roundTripCommand(Cmd.Arguments, *Diags)) + return true; + + return false; + } + + void printFullOutput(raw_ostream &OS) { + // Skip sorting modules and constructing the JSON object if the output + // cannot be observed anyway. This makes timings less noisy. + if (&OS == &llvm::nulls()) + return; + + // Sort the modules by name to get a deterministic order. + std::vector ModuleIDs; + for (auto &&M : Modules) + ModuleIDs.push_back(M.first); + llvm::sort(ModuleIDs); + + using namespace llvm::json; + + Array OutModules; + for (auto &&ModID : ModuleIDs) { + auto &MD = Modules[ModID]; + Object O{{"name", MD.ID.ModuleName}, + {"context-hash", MD.ID.ContextHash}, + {"file-deps", toJSONSorted(MD.FileDeps)}, + {"clang-module-deps", toJSONSorted(MD.ClangModuleDeps)}, + {"clang-modulemap-file", MD.ClangModuleMapFile}, + {"command-line", MD.getBuildArguments()}, + {"link-libraries", toJSONSorted(MD.LinkLibraries)}}; + OutModules.push_back(std::move(O)); + } + + Array TUs; + for (auto &&I : Inputs) { + Array Commands; + if (I.DriverCommandLine.empty()) { + for (const auto &Cmd : I.Commands) { + Object O{ + {"input-file", I.FileName}, + {"clang-context-hash", I.ContextHash}, + {"file-deps", I.FileDeps}, + {"clang-module-deps", toJSONSorted(I.ModuleDeps)}, + {"executable", Cmd.Executable}, + {"command-line", Cmd.Arguments}, + }; + Commands.push_back(std::move(O)); + } + } else { + Object O{ + {"input-file", I.FileName}, + {"clang-context-hash", I.ContextHash}, + {"file-deps", I.FileDeps}, + {"clang-module-deps", toJSONSorted(I.ModuleDeps)}, + {"executable", "clang"}, + {"command-line", I.DriverCommandLine}, + }; + Commands.push_back(std::move(O)); + } + TUs.push_back(Object{ + {"commands", std::move(Commands)}, + }); + } + + Object Output{ + {"modules", std::move(OutModules)}, + {"translation-units", std::move(TUs)}, + }; + + OS << llvm::formatv("{0:2}\n", Value(std::move(Output))); + } + +private: + struct IndexedModuleID { + ModuleID ID; + + // FIXME: This is mutable so that it can still be updated after insertion + // into an unordered associative container. This is "fine", since this + // field doesn't contribute to the hash, but it's a brittle hack. + mutable size_t InputIndex; + + bool operator==(const IndexedModuleID &Other) const { + return ID == Other.ID; + } + + bool operator<(const IndexedModuleID &Other) const { + /// We need the output of clang-scan-deps to be deterministic. However, + /// the dependency graph may contain two modules with the same name. How + /// do we decide which one to print first? If we made that decision based + /// on the context hash, the ordering would be deterministic, but + /// different across machines. This can happen for example when the inputs + /// or the SDKs (which both contribute to the "context" hash) live in + /// different absolute locations. We solve that by tracking the index of + /// the first input TU that (transitively) imports the dependency, which + /// is always the same for the same input, resulting in deterministic + /// sorting that's also reproducible across machines. + return std::tie(ID.ModuleName, InputIndex) < + std::tie(Other.ID.ModuleName, Other.InputIndex); + } + + struct Hasher { + std::size_t operator()(const IndexedModuleID &IMID) const { + return llvm::hash_value(IMID.ID); + } + }; + }; + + struct InputDeps { + std::string FileName; + std::string ContextHash; + std::vector FileDeps; + std::vector ModuleDeps; + std::vector DriverCommandLine; + std::vector Commands; + }; + + std::mutex Lock; + std::unordered_map + Modules; + std::vector Inputs; +}; + +static bool handleTranslationUnitResult( + StringRef Input, llvm::Expected &MaybeTUDeps, + FullDeps &FD, size_t InputIndex, SharedStream &OS, SharedStream &Errs) { + if (!MaybeTUDeps) { + llvm::handleAllErrors( + MaybeTUDeps.takeError(), [&Input, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " << Input << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + FD.mergeDeps(Input, std::move(*MaybeTUDeps), InputIndex); + return false; +} + +static bool handleModuleResult( + StringRef ModuleName, llvm::Expected &MaybeModuleGraph, + FullDeps &FD, size_t InputIndex, SharedStream &OS, SharedStream &Errs) { + if (!MaybeModuleGraph) { + llvm::handleAllErrors(MaybeModuleGraph.takeError(), + [&ModuleName, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " + << ModuleName << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + FD.mergeDeps(std::move(*MaybeModuleGraph), InputIndex); + return false; +} + +class P1689Deps { +public: + void printDependencies(raw_ostream &OS) { + addSourcePathsToRequires(); + // Sort the modules by name to get a deterministic order. + llvm::sort(Rules, [](const P1689Rule &A, const P1689Rule &B) { + return A.PrimaryOutput < B.PrimaryOutput; + }); + + using namespace llvm::json; + Array OutputRules; + for (const P1689Rule &R : Rules) { + Object O{{"primary-output", R.PrimaryOutput}}; + + if (R.Provides) { + Array Provides; + Object Provided{{"logical-name", R.Provides->ModuleName}, + {"source-path", R.Provides->SourcePath}, + {"is-interface", R.Provides->IsStdCXXModuleInterface}}; + Provides.push_back(std::move(Provided)); + O.insert({"provides", std::move(Provides)}); + } + + Array Requires; + for (const P1689ModuleInfo &Info : R.Requires) { + Object RequiredInfo{{"logical-name", Info.ModuleName}}; + if (!Info.SourcePath.empty()) + RequiredInfo.insert({"source-path", Info.SourcePath}); + Requires.push_back(std::move(RequiredInfo)); + } + + if (!Requires.empty()) + O.insert({"requires", std::move(Requires)}); + + OutputRules.push_back(std::move(O)); + } + + Object Output{ + {"version", 1}, {"revision", 0}, {"rules", std::move(OutputRules)}}; + + OS << llvm::formatv("{0:2}\n", Value(std::move(Output))); + } + + void addRules(P1689Rule &Rule) { + std::unique_lock LockGuard(Lock); + Rules.push_back(Rule); + } + +private: + void addSourcePathsToRequires() { + llvm::DenseMap ModuleSourceMapper; + for (const P1689Rule &R : Rules) + if (R.Provides && !R.Provides->SourcePath.empty()) + ModuleSourceMapper[R.Provides->ModuleName] = R.Provides->SourcePath; + + for (P1689Rule &R : Rules) { + for (P1689ModuleInfo &Info : R.Requires) { + auto Iter = ModuleSourceMapper.find(Info.ModuleName); + if (Iter != ModuleSourceMapper.end()) + Info.SourcePath = Iter->second; + } + } + } + + std::mutex Lock; + std::vector Rules; +}; + +static bool +handleP1689DependencyToolResult(const std::string &Input, + llvm::Expected &MaybeRule, + P1689Deps &PD, SharedStream &Errs) { + if (!MaybeRule) { + llvm::handleAllErrors( + MaybeRule.takeError(), [&Input, &Errs](llvm::StringError &Err) { + Errs.applyLocked([&](raw_ostream &OS) { + OS << "Error while scanning dependencies for " << Input << ":\n"; + OS << Err.getMessage(); + }); + }); + return true; + } + PD.addRules(*MaybeRule); + return false; +} + +/// Construct a path for the explicitly built PCM. +static std::string constructPCMPath(ModuleID MID, StringRef OutputDir) { + SmallString<256> ExplicitPCMPath(OutputDir); + llvm::sys::path::append(ExplicitPCMPath, MID.ContextHash, + MID.ModuleName + "-" + MID.ContextHash + ".pcm"); + return std::string(ExplicitPCMPath); +} + +static std::string lookupModuleOutput(const ModuleID &MID, ModuleOutputKind MOK, + StringRef OutputDir) { + std::string PCMPath = constructPCMPath(MID, OutputDir); + switch (MOK) { + case ModuleOutputKind::ModuleFile: + return PCMPath; + case ModuleOutputKind::DependencyFile: + return PCMPath + ".d"; + case ModuleOutputKind::DependencyTargets: + // Null-separate the list of targets. + return join(ModuleDepTargets, StringRef("\0", 1)); + case ModuleOutputKind::DiagnosticSerializationFile: + return PCMPath + ".diag"; + } + llvm_unreachable("Fully covered switch above!"); +} + +static std::string getModuleCachePath(ArrayRef Args) { + for (StringRef Arg : llvm::reverse(Args)) { + Arg.consume_front("/clang:"); + if (Arg.consume_front("-fmodules-cache-path=")) + return std::string(Arg); + } + SmallString<128> Path; + driver::Driver::getDefaultModuleCachePath(Path); + return std::string(Path); +} + +/// Attempts to construct the compilation database from '-compilation-database' +/// or from the arguments following the positional '--'. +static std::unique_ptr +getCompilationDatabase(int argc, char **argv, std::string &ErrorMessage) { + ParseArgs(argc, argv); + + if (!(CommandLine.empty() ^ CompilationDB.empty())) { + llvm::errs() << "The compilation command line must be provided either via " + "'-compilation-database' or after '--'."; + return nullptr; + } + + if (!CompilationDB.empty()) + return tooling::JSONCompilationDatabase::loadFromFile( + CompilationDB, ErrorMessage, + tooling::JSONCommandLineSyntax::AutoDetect); + + llvm::IntrusiveRefCntPtr Diags = + CompilerInstance::createDiagnostics(new DiagnosticOptions); + driver::Driver TheDriver(CommandLine[0], llvm::sys::getDefaultTargetTriple(), + *Diags); + TheDriver.setCheckInputsExist(false); + std::unique_ptr C( + TheDriver.BuildCompilation(CommandLine)); + if (!C || C->getJobs().empty()) + return nullptr; + + auto Cmd = C->getJobs().begin(); + auto CI = std::make_unique(); + CompilerInvocation::CreateFromArgs(*CI, Cmd->getArguments(), *Diags, + CommandLine[0]); + if (!CI) + return nullptr; + + FrontendOptions &FEOpts = CI->getFrontendOpts(); + if (FEOpts.Inputs.size() != 1) { + llvm::errs() + << "Exactly one input file is required in the per-file mode ('--').\n"; + return nullptr; + } + + // There might be multiple jobs for a compilation. Extract the specified + // output filename from the last job. + auto LastCmd = C->getJobs().end(); + LastCmd--; + if (LastCmd->getOutputFilenames().size() != 1) { + llvm::errs() + << "Exactly one output file is required in the per-file mode ('--').\n"; + return nullptr; + } + StringRef OutputFile = LastCmd->getOutputFilenames().front(); + + class InplaceCompilationDatabase : public tooling::CompilationDatabase { + public: + InplaceCompilationDatabase(StringRef InputFile, StringRef OutputFile, + ArrayRef CommandLine) + : Command(".", InputFile, {}, OutputFile) { + for (auto *C : CommandLine) + Command.CommandLine.push_back(C); + } + + std::vector + getCompileCommands(StringRef FilePath) const override { + if (FilePath != Command.Filename) + return {}; + return {Command}; + } + + std::vector getAllFiles() const override { + return {Command.Filename}; + } + + std::vector + getAllCompileCommands() const override { + return {Command}; + } + + private: + tooling::CompileCommand Command; + }; + + return std::make_unique( + FEOpts.Inputs[0].getFile(), OutputFile, CommandLine); +} + +int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { + llvm::InitializeAllTargetInfos(); + std::string ErrorMessage; + std::unique_ptr Compilations = + getCompilationDatabase(argc, argv, ErrorMessage); + if (!Compilations) { + llvm::errs() << ErrorMessage << "\n"; + return 1; + } + + llvm::cl::PrintOptionValues(); + + // Expand response files in advance, so that we can "see" all the arguments + // when adjusting below. + Compilations = expandResponseFiles(std::move(Compilations), + llvm::vfs::getRealFileSystem()); + + Compilations = inferTargetAndDriverMode(std::move(Compilations)); + + Compilations = inferToolLocation(std::move(Compilations)); + + // The command options are rewritten to run Clang in preprocessor only mode. + auto AdjustingCompilations = + std::make_unique( + std::move(Compilations)); + ResourceDirectoryCache ResourceDirCache; + + AdjustingCompilations->appendArgumentsAdjuster( + [&ResourceDirCache](const tooling::CommandLineArguments &Args, + StringRef FileName) { + std::string LastO; + bool HasResourceDir = false; + bool ClangCLMode = false; + auto FlagsEnd = llvm::find(Args, "--"); + if (FlagsEnd != Args.begin()) { + ClangCLMode = + llvm::sys::path::stem(Args[0]).contains_insensitive("clang-cl") || + llvm::is_contained(Args, "--driver-mode=cl"); + + // Reverse scan, starting at the end or at the element before "--". + auto R = std::make_reverse_iterator(FlagsEnd); + auto E = Args.rend(); + // Don't include Args[0] in the iteration; that's the executable, not + // an option. + if (E != R) + E--; + for (auto I = R; I != E; ++I) { + StringRef Arg = *I; + if (ClangCLMode) { + // Ignore arguments that are preceded by "-Xclang". + if ((I + 1) != E && I[1] == "-Xclang") + continue; + if (LastO.empty()) { + // With clang-cl, the output obj file can be specified with + // "/opath", "/o path", "/Fopath", and the dash counterparts. + // Also, clang-cl adds ".obj" extension if none is found. + if ((Arg == "-o" || Arg == "/o") && I != R) + LastO = I[-1]; // Next argument (reverse iterator) + else if (Arg.starts_with("/Fo") || Arg.starts_with("-Fo")) + LastO = Arg.drop_front(3).str(); + else if (Arg.starts_with("/o") || Arg.starts_with("-o")) + LastO = Arg.drop_front(2).str(); + + if (!LastO.empty() && !llvm::sys::path::has_extension(LastO)) + LastO.append(".obj"); + } + } + if (Arg == "-resource-dir") + HasResourceDir = true; + } + } + tooling::CommandLineArguments AdjustedArgs(Args.begin(), FlagsEnd); + // The clang-cl driver passes "-o -" to the frontend. Inject the real + // file here to ensure "-MT" can be deduced if need be. + if (ClangCLMode && !LastO.empty()) { + AdjustedArgs.push_back("/clang:-o"); + AdjustedArgs.push_back("/clang:" + LastO); + } + + if (!HasResourceDir && ResourceDirRecipe == RDRK_InvokeCompiler) { + StringRef ResourceDir = + ResourceDirCache.findResourceDir(Args, ClangCLMode); + if (!ResourceDir.empty()) { + AdjustedArgs.push_back("-resource-dir"); + AdjustedArgs.push_back(std::string(ResourceDir)); + } + } + AdjustedArgs.insert(AdjustedArgs.end(), FlagsEnd, Args.end()); + return AdjustedArgs; + }); + + SharedStream Errs(llvm::errs()); + + std::optional FileOS; + llvm::raw_ostream &ThreadUnsafeDependencyOS = [&]() -> llvm::raw_ostream & { + if (OutputFileName == "-") + return llvm::outs(); + + if (OutputFileName == "/dev/null") + return llvm::nulls(); + + std::error_code EC; + FileOS.emplace(OutputFileName, EC); + if (EC) { + llvm::errs() << "Failed to open output file '" << OutputFileName + << "': " << llvm::errorCodeToError(EC) << '\n'; + std::exit(1); + } + return *FileOS; + }(); + SharedStream DependencyOS(ThreadUnsafeDependencyOS); + + std::vector Inputs = + AdjustingCompilations->getAllCompileCommands(); + + std::atomic HadErrors(false); + std::optional FD; + P1689Deps PD; + + std::mutex Lock; + size_t Index = 0; + auto GetNextInputIndex = [&]() -> std::optional { + std::unique_lock LockGuard(Lock); + if (Index < Inputs.size()) + return Index++; + return {}; + }; + + if (Format == ScanningOutputFormat::Full) + FD.emplace(ModuleName.empty() ? Inputs.size() : 0); + + auto ScanningTask = [&](DependencyScanningService &Service) { + DependencyScanningTool WorkerTool(Service); + + llvm::DenseSet AlreadySeenModules; + while (auto MaybeInputIndex = GetNextInputIndex()) { + size_t LocalIndex = *MaybeInputIndex; + const tooling::CompileCommand *Input = &Inputs[LocalIndex]; *** 167 LINES SKIPPED *** From nobody Wed Jul 2 18:27:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0J5MNbz60m7n; Wed, 02 Jul 2025 18:27: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 4bXT0J4rGxz3H0J; Wed, 02 Jul 2025 18:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i4refpiXSW4kGmM9j9xXhCjWgzom0tIJDUVtJz28U90=; b=xcy1k65dMKVDq0qhkLlhvBDhbEzZhLMkgAzPVKLZhIOF7dn2gsHZBOHWlxXyt9z2vYg8lv 2ol+sCgAowGJpDW51vsfboSixPDuvl/vbw59BR0jYztJaxTgabovXgWRpExlhal6keKBYj XFrJYlf5CViEBXL0LulrYrJhqDYPfsIUFvoRJw4zbILx5UCej/SPB/iluebbGHAtl7cgP3 Lq+9R0e1MGbZhfhhJeIX3SGiqDTDbNitYmoAA9FdkqFk4QuyjH/2LK8vPhp7PaijSeOv/g 9+T8EP4opV24hVWVVI3FUAb1BazFZxr+g4FphKnWgOfBN18y0nrfCTK+zp9dRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i4refpiXSW4kGmM9j9xXhCjWgzom0tIJDUVtJz28U90=; b=bxv6PYX+uzFc8wUmktfaJKdtOGbWc/X/0OCtGw4EyH3xaWJx1kJVE45PKTRDzWdxwMRedi YU+WDqDRtNuSdLEZ2eaIQ1CLj7QxyOyZQ5mHVNqbfw/5r+Td6oVjed61ogg9lkOMmMrGbK mTyoeAaJBy+8Txx/KRWQscFiPdduclPvzNFx+9GdYZdTlcT7inzyvy3DSeMUc1exLCZKeO jraRXODqqn9WTT/+8cjFHRu8IFyl6B7Y9FxL5saM/fWY6Dr2ApJWMoiUpmeO5jJVD1g+bb 0DZK7F/rIhTBpcF32zWkfjiOm+KAAmdZHadi5lAKwY//ckU6KQ5xSobB6R1yBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480864; a=rsa-sha256; cv=none; b=Xz711H1fz+VGez5Du4sib+gWelQaz91jyqsaf1HQI8soHUAfaVI3wTQ0LKu1vXGjsTn9GM V/UugIGOAeYzhpRYH8+3sFEI6jLe+fM+aV+4E5EBTYxLwkIA9b3mJpfyMLeMMPhGJ7d45P oIhlH7Jzt+oXwtEkk1mQOLDMiQKlLZ92AmK/NnN16s6I2I8azrXxmQWiwvaKzOo/IsStHn WAyAvpNsjcw5/uFVV4bM1qdQjEGV4G/jZV7SsrInGFK+Cyy6tN6BFVVOh7MRzf77wosTXz Pnt7kq1czVjp4waYvxRsg3T/0oKWFpV73wKYgJhsIh+xErQH3ecKJtFcpKdWjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT0J3nNkzW9T; Wed, 02 Jul 2025 18:27: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 562IRiBJ056990; Wed, 2 Jul 2025 18:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562IRiCE056987; Wed, 2 Jul 2025 18:27:44 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:27:44 GMT Message-Id: <202507021827.562IRiCE056987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: cb24a62cd75b - releng/14.3 - Fix corruption in ZFS replication streams from encrypted datasets. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: cb24a62cd75b582c53f5bd600650bddd09a0ee89 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=cb24a62cd75b582c53f5bd600650bddd09a0ee89 commit cb24a62cd75b582c53f5bd600650bddd09a0ee89 Author: Gordon Tetlow AuthorDate: 2025-07-02 05:51:38 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:51:38 +0000 Fix corruption in ZFS replication streams from encrypted datasets. From the upstream pull request merges: #17340 b144b160b Fix 2 bugs in non-raw send with encryption Obtained from: OpenZFS Approved by: so Security: FreeBSD-EN-25:10.zfs --- sys/contrib/openzfs/module/zfs/dmu_send.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/dmu_send.c b/sys/contrib/openzfs/module/zfs/dmu_send.c index 30d2ca5d6aa2..716b1b1f778c 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_send.c +++ b/sys/contrib/openzfs/module/zfs/dmu_send.c @@ -2669,8 +2669,8 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, } if (fromsnap != 0) { - err = dsl_dataset_hold_obj_flags(dspp.dp, fromsnap, dsflags, - FTAG, &fromds); + err = dsl_dataset_hold_obj(dspp.dp, fromsnap, FTAG, &fromds); + if (err != 0) { dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); dsl_pool_rele(dspp.dp, FTAG); @@ -2722,7 +2722,7 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, kmem_free(dspp.fromredactsnaps, dspp.numfromredactsnaps * sizeof (uint64_t)); - dsl_dataset_rele(dspp.to_ds, FTAG); + dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); return (err); } From nobody Wed Jul 2 18:27:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0K6SgRz60m9j; Wed, 02 Jul 2025 18:27: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 4bXT0K3yfRz3HBl; Wed, 02 Jul 2025 18:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Au7KYU3IJRqh2eUsgKphjANPJ2BVE2xHes+S9/xKTsQ=; b=loWLloOWUg8XXH+qh/3HU0ikeChxrEuU5j4e4K4LJbqVFX9JScLQgu2vgCHtWj4bcjAonF qbDC7AcFQfxWV7vkBMZ1gT5IFJcKGyzaP+I1nGp9UDI1pxigBLeBb0SjytOcxjCUIAJb7l 3fSjyeQ5OAJDKCpORie8UkESOGCRJRBiFEwVIQjFTCOlKDO1jk5tgqpekjWDornQ8s/ltT 6lbXFnBJdx0rAqfyhcY1eScg0cPRpOYw/vRNVZzbg38Z/G15THCwkIh9msLpbWpdvZt/SD 8Fo0r9qzEIvWADtTmzHNsNP3lW6dP4c7Ru+rWis5RhJ5fd26Pi6Qc5KzmOvm/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Au7KYU3IJRqh2eUsgKphjANPJ2BVE2xHes+S9/xKTsQ=; b=YiSKK8mdEAKvZkFpMuUREdtmOXvTkL2uSB7kJ01JN1JU4KBvoXOtOVYzyL2ASghhSFNW9m JgYUMMI9khL/+pN16P6CsLP7Gno1OS3rxRGc57a63BckjlCNyVnRWoeFOPtyG5ff3DKbiZ FfOJIWH/Rur/6XPWowuBobndC1UApw+tTcgV4/bKk+brtgMy/JmCMkqq8am74x5MP3ktC9 IgYnyMcsImMTdu9Iw9I83Gbdwjiey2RpeQJ8LNcvRXCqRjGkhawnoVs2J0DQWODXNwRW0f hPoKZGB0tCxMkRS/jPcOgkRrSjH/3CHTbPMjogmdMqVjKg68lFS+QjJHSnnNgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480865; a=rsa-sha256; cv=none; b=BsKDiCDeNhxZvsmXKVAeL/KKnyyOVtpNoYOifQ0I4LCSQlVaEWHaES1m3NMfMJVACGReap oZTsr9hX6797gdZzyqoKK7BWPYAKIoMNj4m06+oeoE+Nd5sh0rFLxcMdY9m0I37vy0xl/K KMJBxh+ZqTGfRt40BG18kGWKromGmO4yB6gaJklX7LlkvxGwDaKw3jfobBjHwPm1ZZmXqd wF664NRqK3ivPWQO4YGEAIjVk5uWJx0EdPIpx5r4cspVL1Hqmvn1YJrLfnU+N9rzkAknRD eZ2yz8YyKZz9yUaNSvUnNSfgctsqf2RBA69QD7ds3AfIEKP4T//FS0Um2pS18Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT0K2mKKzWTZ; Wed, 02 Jul 2025 18:27: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 562IRjvL057029; Wed, 2 Jul 2025 18:27:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562IRjv5057026; Wed, 2 Jul 2025 18:27:45 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:27:45 GMT Message-Id: <202507021827.562IRjv5057026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 2ea99b8ed142 - releng/14.3 - Add UPDATING entries and bump version. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 2ea99b8ed14208286ec3c8d6ccc997537c13d195 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=2ea99b8ed14208286ec3c8d6ccc997537c13d195 commit 2ea99b8ed14208286ec3c8d6ccc997537c13d195 Author: Gordon Tetlow AuthorDate: 2025-07-02 06:04:23 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 06:04:23 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 75c40967a1ae..5a2bcdd07615 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250702: + 14.3-RELEASE-p1 EN-25:10.zfs + + Fix corruption in ZFS replication streams from encrypted datasets [EN-25:10.zfs] + 20250610: 14.3-RELEASE. diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index f3815c0d9b16..b27ca22487d2 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.3" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Jul 2 18:28:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0m758Jz60m80; Wed, 02 Jul 2025 18:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bXT0m6Q8Pz3HhS; Wed, 02 Jul 2025 18:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KAJSX3sZwGEBiH0L1LjZmWmtsVWOsB4Eus8RZORQE/s=; b=YjFPmZ8gGpGZust96Pg2ggMHhoEWCZBo1qU1g5xBaJT1GlRHKDHZfbTrwgrqCFb+xUfrqU 6PatbZNlQKb3isTs0O3wVjPlLyVBuWDOSqfxK7bYwHMAf0cwP7WfEGcQ14PKQudyVOAyx4 NntW4AP1o+BY1UQSBGcl4m2aW8UkqDeRf7729POWZWTpWBJPpFbBrAHesA6jI6y/D4Bxky 9iJLi/mKp8faU/KJTqyhah9JHQEI3Nqpjo6Xc++uj09grtTERusqGpiZfr1sZ+6F3j/OKa tZ0jiNAUnWpnrovFAXNQWpkPatIZtsS6gynU+cGdqR/WvJ36v0OaeQkyiDXaIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KAJSX3sZwGEBiH0L1LjZmWmtsVWOsB4Eus8RZORQE/s=; b=wnYRnKt9DvYoJkTg8yd1r30gPdHuWKyTuVUuvuTT1dcNsGm4kG4MWvkX4naMRaGw2YEBVl RxWrdlm2f+hNasLQiSQwWaWpfojKvw4bEVrwKl14bwCaVkvzS2G3wczafJlpEq20/V3MHz feaNcmSnlVVUHuV+GqcuZN5cbnDjM1/0b+v19wwWfrvqiKSCfqm4iF/vz0vxQqurIQEFvO sYy6smWhf+uxBS4S85hPD5nqehCfhJTaujPhD6LUj6j+x6H+9h5j3KxpUssqcHXfhNmNoD CWZyKsOUe5IYwgOKwwb5D+Z23p7rwZgX+M5TMxuoSa3lj5k4rWqopzvuIPHdVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480888; a=rsa-sha256; cv=none; b=B08OORDfxowgIcef3a8fgAkvPlb+N6W7B6tz2/tQfM/B/MCY+ZweV8225pS55M/sbxCAkg 0hSCVy/dlHKfk1w0ZK2oy1wszjxtXeHzCogy2XQ34kQAWfo6UBo1v9tZfXNM+Th722xt3X eRmA457RrhpWH74/vF/ON48+8Tj60H5ZET2wbROgnM7k8chwyPgAm5eB56iz8WoZSoGUA5 AUjwP1YCdV92m+j0NCRKuWQxKfA3kQpxUKYsS/4pSSLvacxilITEeG6pbYgf+uNPRb0P0x BC0RGqhd3PwxnV5uFXSlSYGSkVBEmRGo6bWyf8RxqlBtCghQ7L46xadIQr+C1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT0m5nxjzVsH; Wed, 02 Jul 2025 18:28: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 562IS8Pv057324; Wed, 2 Jul 2025 18:28:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562IS8FI057321; Wed, 2 Jul 2025 18:28:08 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:08 GMT Message-Id: <202507021828.562IS8FI057321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 89a2823e17e5 - releng/14.2 - libc: allow __cxa_atexit handlers to be added during __cxa_finalize List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 89a2823e17e5e86b03516b89bfde88f2077c6da0 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=89a2823e17e5e86b03516b89bfde88f2077c6da0 commit 89a2823e17e5e86b03516b89bfde88f2077c6da0 Author: Aurélien Croc de Suray AuthorDate: 2025-04-05 00:47:53 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:46:14 +0000 libc: allow __cxa_atexit handlers to be added during __cxa_finalize science/dlib-cpp reveals an interesting scenario that works fine on other platforms but not on FreeBSD; notably, it ends up creating a new global object from some destructor which is called during __cxa_finalize. This breaks when libdlib is dlopen()ed and then subsequently dlclose()ed, as we never end up invoking the created object's dtor until program exit when the shlib is already unmapped. Fix it by noting when we're in the middle of __cxa_finalize for a dso, and then restarting the search if __cxa_atexit() was called in the middle somewhere. We wait until we've processed the initial set before starting over and processing the newly added handlers as if it were a complete set of handlers added during runtime. The alternative is calling them as they're added to maintain a LIFO in terms of total ordering, but in theory a constructor could add another global object that also needs to be destroyed, and that object needs to be destroyed after the one that constructed it to avoid creating unexpected lifetime issues. This manifests in the pdlib PHP extension for dlib crashing, see [0]. [0] https://github.com/goodspb/pdlib/issues/39 PR: 285870 Reviewed by: kevans (also supplied commit message) Approved by: so Security: FreeBSD-EN-25:09.libc (cherry picked from commit 23427c8e1fedb9fc68ad0bd27a59c7ffd2b3008c) (cherry picked from commit c43ae65b4b89be422cdcd399a7abc44f6db4b298) --- lib/libc/stdlib/atexit.c | 61 ++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c index b2c10ca4cca5..6468b9ff0a62 100644 --- a/lib/libc/stdlib/atexit.c +++ b/lib/libc/stdlib/atexit.c @@ -38,6 +38,7 @@ static char sccsid[] = "@(#)atexit.c 8.2 (Berkeley) 7/3/94"; #include "namespace.h" #include #include +#include #include #include #include @@ -59,6 +60,8 @@ _Block_copy(void*); #define ATEXIT_FN_CXA 2 static pthread_mutex_t atexit_mutex = PTHREAD_MUTEX_INITIALIZER; +static void *current_finalize_dso = NULL; +static bool call_finalize_again = false; #define _MUTEX_LOCK(x) if (__isthreaded) _pthread_mutex_lock(x) #define _MUTEX_UNLOCK(x) if (__isthreaded) _pthread_mutex_unlock(x) @@ -118,6 +121,9 @@ atexit_register(struct atexit_fn *fptr) __atexit = p; } p->fns[p->ind++] = *fptr; + if (current_finalize_dso != NULL && + current_finalize_dso == fptr->fn_dso) + call_finalize_again = true; _MUTEX_UNLOCK(&atexit_mutex); return 0; } @@ -211,33 +217,38 @@ __cxa_finalize(void *dso) } _MUTEX_LOCK(&atexit_mutex); - for (p = __atexit; p; p = p->next) { - for (n = p->ind; --n >= 0;) { - if (p->fns[n].fn_type == ATEXIT_FN_EMPTY) - continue; /* already been called */ - fn = p->fns[n]; - if (dso != NULL && dso != fn.fn_dso) { - /* wrong DSO ? */ - if (!has_phdr || global_exit || - !__elf_phdr_match_addr(&phdr_info, - fn.fn_ptr.cxa_func)) - continue; + current_finalize_dso = dso; + do { + call_finalize_again = false; + for (p = __atexit; p; p = p->next) { + for (n = p->ind; --n >= 0;) { + if (p->fns[n].fn_type == ATEXIT_FN_EMPTY) + continue; /* already been called */ + fn = p->fns[n]; + if (dso != NULL && dso != fn.fn_dso) { + /* wrong DSO ? */ + if (!has_phdr || global_exit || + !__elf_phdr_match_addr(&phdr_info, + fn.fn_ptr.cxa_func)) + continue; + } + /* + Mark entry to indicate that this particular + handler has already been called. + */ + p->fns[n].fn_type = ATEXIT_FN_EMPTY; + _MUTEX_UNLOCK(&atexit_mutex); + + /* Call the function of correct type. */ + if (fn.fn_type == ATEXIT_FN_CXA) + fn.fn_ptr.cxa_func(fn.fn_arg); + else if (fn.fn_type == ATEXIT_FN_STD) + fn.fn_ptr.std_func(); + _MUTEX_LOCK(&atexit_mutex); } - /* - Mark entry to indicate that this particular handler - has already been called. - */ - p->fns[n].fn_type = ATEXIT_FN_EMPTY; - _MUTEX_UNLOCK(&atexit_mutex); - - /* Call the function of correct type. */ - if (fn.fn_type == ATEXIT_FN_CXA) - fn.fn_ptr.cxa_func(fn.fn_arg); - else if (fn.fn_type == ATEXIT_FN_STD) - fn.fn_ptr.std_func(); - _MUTEX_LOCK(&atexit_mutex); } - } + } while (call_finalize_again); + current_finalize_dso = NULL; _MUTEX_UNLOCK(&atexit_mutex); if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); From nobody Wed Jul 2 18:28:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0p34myz60mLc; Wed, 02 Jul 2025 18:28: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 4bXT0p0lmlz3HhT; Wed, 02 Jul 2025 18:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoGc6qhIwkefrRmp1pVXsHPyVtDIPbqTM97OcAvLi8U=; b=tBVFQj8/3kzT+v4qIVStkn5pddkFdZrf4JbZE7t2nxTF/uwB1dgf6GQvspqypmP12TxyaT fxgCGxt0RxGaRKq04GT7jCWxRSpkhWpFaspgGULlScMp8yUYLWYqfxXlr2ntrOyfSb0Xyu U08vZwmfFCAzNrjgZVlDGk4fLkaXKo5c0kixoJ0mK4eLlolbIqClQ2xBoDadjj9Gi7XGcH yd2SlOofe2LF908G2KGqdBy6xaTPxIIG7I3Kn3nKSuyS8i/NCbD/A6jbgRPZ2vXEtEiEkE JlmdlRbKqPscWbrBk8+6YkooA+kfxqjtGagNivGghZfn7kXfePOXronJXaVl7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoGc6qhIwkefrRmp1pVXsHPyVtDIPbqTM97OcAvLi8U=; b=mHIUGeqR0e4NZ9Qd6SMhI09p1Ctlqlsq+NruTqw83v9drK2YBCi+AhfpwI5JHYLuRt8dQA 03otzvM6N0dEvE4TpXhBD0kJS5TS6+LDDjMukuR8avUsa8VR19C2wgDU4EL4ZDM4r7aH83 Cc/bgIAa4e1AbrLomAbeEQQSHAakFXza/77G7VaEPIVnIM4b4ZC/acX25gLd76zMZq0ga4 nlovROj4Jx7Y0CGHxnrDXhG7NKCeS2uJKGW22sZQOTY+w9Xr2EiuflwLlSB+RVhx1pvT5r PfHJuIGx60CO09ul52uCY9dmQOge2iDO61iY4W/kr46P0qd+mZ72KhAJ3hJLpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480890; a=rsa-sha256; cv=none; b=e3t/fyrF52zBdT5Deo9CnzaqajR8VFZzpW/yQMnq5xFHv89svja+cxCi2fkwyCzPCUk8KT Dc2QDUtOx5zcfbAiUbWjBU1iMoh586Ddb6n7OTA4ZuH4UJIj6jDKcy8CqXASqAOqzytj51 PvfOHrr3i8yWc7XXV1VKq/wCmu1YkqPtT7OMWB9zcQ0jReXfHDHyac2n4x3DfYMfTbUMoO 9K70haJoiATnbQrRMCVHZSWmb4xIQm/ASaJCh6VD535PrAIueaNiP2vF/OOo7uufOVBonB PMxllxkBC2faO1ieEj24RJ8mWurTDCq0ju7nnPKFpazvWXBSGvro5uo23oKhlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT0p00C4zWGl; Wed, 02 Jul 2025 18:28: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 562IS9sh057358; Wed, 2 Jul 2025 18:28:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562IS9CW057355; Wed, 2 Jul 2025 18:28:09 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:09 GMT Message-Id: <202507021828.562IS9CW057355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: c5feebf38389 - releng/14.2 - Fix corruption in ZFS replication streams from encrypted datasets. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: c5feebf38389901b4b22ac94244ce33e9e6234ca Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c5feebf38389901b4b22ac94244ce33e9e6234ca commit c5feebf38389901b4b22ac94244ce33e9e6234ca Author: Gordon Tetlow AuthorDate: 2025-07-02 05:51:04 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:51:04 +0000 Fix corruption in ZFS replication streams from encrypted datasets. From the upstream pull request merges: #17340 b144b160b Fix 2 bugs in non-raw send with encryption Obtained from: OpenZFS Approved by: so Security: FreeBSD-EN-25:10.zfs --- sys/contrib/openzfs/module/zfs/dmu_send.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/dmu_send.c b/sys/contrib/openzfs/module/zfs/dmu_send.c index 37c68528bf95..23ab482941e7 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_send.c +++ b/sys/contrib/openzfs/module/zfs/dmu_send.c @@ -2669,8 +2669,8 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, } if (fromsnap != 0) { - err = dsl_dataset_hold_obj_flags(dspp.dp, fromsnap, dsflags, - FTAG, &fromds); + err = dsl_dataset_hold_obj(dspp.dp, fromsnap, FTAG, &fromds); + if (err != 0) { dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); dsl_pool_rele(dspp.dp, FTAG); @@ -2722,7 +2722,7 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, kmem_free(dspp.fromredactsnaps, dspp.numfromredactsnaps * sizeof (uint64_t)); - dsl_dataset_rele(dspp.to_ds, FTAG); + dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); return (err); } From nobody Wed Jul 2 18:28:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0q3qLwz60lyq; Wed, 02 Jul 2025 18:28: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 4bXT0q1Xwqz3HXp; Wed, 02 Jul 2025 18:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qUoIu0bVSf/+Va/qbnLGGAYYAlfU5Nt2oBvID60+7E0=; b=uN0InLvgBj2pvSnky2iFaTCH9hgD/yjAqN3gpke7Azqcct9A9qBovzTLM3F2MRywZb+OlJ RgRoqWrLKtWoM36Sn7F18a5KlYvMSO7OqHE+97LivHlBIvGRLNU7KlPdNMrerf3KiS28uB mn2ZmYZHTYak004zUe7myKXjDME+ijfKMbKUq0lLF3Hv0qggv0caGDDhJywM7CpcLQ3T2j YLHlTXo15yg4Bx6ZrJfEuZsC0frCXHAiG2qFLhpX86JCGKjZkyBURc6NGAUmw7wNry/1bV uGUnr0ygn2tYgy1qTrWMdmgUMTxbAG8E4zyhwE2eP+pCRUUdBpIHIyrjr2kS1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qUoIu0bVSf/+Va/qbnLGGAYYAlfU5Nt2oBvID60+7E0=; b=n4IoSDCshekzEROt70wxofR+YO5K8okWVWhAh/duY2ieax3F5z9Hpi4w2uwijAbO0qAa2M /nzq3Sl1PXOy8Qz/nl/y8TldhI6PsbfVeSHYWLnXdica/68z2xp4CqeoMfjuypemNzy+bI DuxtV0MaFPPadgU9RAygwgtUC1WqG7IJ29E9MT5zEtsGD/27SnfmcqLeOXDQ42O8ESH8aO CG6cWOjr7ccYtz3uihjsLzQ13fzjINimVF/e8IeHIYVUBL4eypjA1t+umMfbvt5vw71884 zDc9N+lDWNpCR0LHyo+m0iemt3acDbNikDwoRsd/B95kRCrTTGTJ1Mac1bYtew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480891; a=rsa-sha256; cv=none; b=E/91XesFg5lczaQgRSvSeD2RQmQPrafwFo1teHvxFo1q/92L5ozu2ya1lsWreDDwr+fVTH nb6HMYim650eAT0TClQpac1otvOZHGNXdANmtFz/XSkVKdd8lJNq5xw6sAkdWaQmzd+iLV Tb2njnizyllZu4K7YHpWMczMZ1wkfOWOLBaASCG8wofaLwKbg1jPHtMB+xTTi3CKe45JXl 8jKnBNoJVOOkbS+aJOHQlQ/D2qBQJCWDuwEnFqfU7C1c0o+VMRTfXS1l3pJLPXb3zZ4V0R FNVCaDgCPUhsKrRbjMUHKU56v0XDLU2cLS7shzN8K3wkJbtJre8ihlSGiK1Aqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT0q0fcSzWGQ; Wed, 02 Jul 2025 18:28: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 562ISAlg057391; Wed, 2 Jul 2025 18:28:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISAPY057388; Wed, 2 Jul 2025 18:28:10 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:10 GMT Message-Id: <202507021828.562ISAPY057388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 89104be0ddae - releng/14.2 - ena: Fix misconfiguration when requesting regular LLQ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 89104be0ddae36c250d2a4d923f7e042e69748ff Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=89104be0ddae36c250d2a4d923f7e042e69748ff commit 89104be0ddae36c250d2a4d923f7e042e69748ff Author: David Arinzon AuthorDate: 2025-04-22 10:54:18 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:54:18 +0000 ena: Fix misconfiguration when requesting regular LLQ Patch 0a33c047a443 introduced new values to hw.ena.force_large_llq_header. The default value of 2 means no preference, while 0 and 1 act as the previous false and true respectively, which allowed forcefully setting regular or large LLQ. There are 2 ways to force the driver to select regular LLQ: 1. Setting hw.ena.force_large_llq_header = 0 via sysctl. 2. Turning on ena express, which makes the recommendation by the FW to be regular LLQ. When the device supports large LLQ but the driver is forced to regular LLQ, llq_config->llq_ring_entry_size_value is never initialized and since it is a variable allocated on the stack, it stays garbage. Since this variable is involved in calculating max_entries_in_tx_burst, it could cause the maximum burst size to be zero. This causes the driver to ignore the real maximum burst size of the device, leading to driver resets in devices that have a maximum burst size (Nitro v4 and on. see [1] for more information). In case the garbage value is 0, the calculation of max_entries_in_tx_burst divides by 0 and causes kernel panic. The patch modifies the logic to take into account all use-cases and ensure that the relevant fields are properly initialized. [1]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html Fixes: 0a33c047a443 ("ena: Support LLQ entry size recommendation from device") Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D50040 Approved by: so Security: FreeBSD-EN-25:11.ena (cherry picked from commit 56c45700f2ae15755358f2da8266247613c564df) (cherry picked from commit 3f4a674a8ee430dec7c72c45ffe759eabefa7a1f) --- sys/dev/ena/ena.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index e9d4530e9085..67f669343808 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2759,22 +2759,41 @@ static inline void ena_set_llq_configurations(struct ena_llq_configurations *llq_config, struct ena_admin_feature_llq_desc *llq, struct ena_adapter *adapter) { + bool use_large_llq; + llq_config->llq_header_location = ENA_ADMIN_INLINE_HEADER; llq_config->llq_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; llq_config->llq_num_decs_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; - if ((llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B) != 0) { - if ((ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_LARGE) || - (ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT && - llq->entry_size_recommended == ENA_ADMIN_LIST_ENTRY_SIZE_256B)) { - llq_config->llq_ring_entry_size = - ENA_ADMIN_LIST_ENTRY_SIZE_256B; - llq_config->llq_ring_entry_size_value = 256; - adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_256B; - } + + switch (ena_force_large_llq_header) + { + case ENA_LLQ_HEADER_SIZE_POLICY_REGULAR: + use_large_llq = false; + break; + case ENA_LLQ_HEADER_SIZE_POLICY_LARGE: + use_large_llq = true; + break; + case ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT: + use_large_llq = + (llq->entry_size_recommended == ENA_ADMIN_LIST_ENTRY_SIZE_256B); + break; + default: + use_large_llq = false; + ena_log(adapter->pdev, WARN, + "force_large_llq_header should have values [0-2]\n"); + break; + } + + if (!(llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B)) + use_large_llq = false; + + if (use_large_llq) { + llq_config->llq_ring_entry_size = ENA_ADMIN_LIST_ENTRY_SIZE_256B; + llq_config->llq_ring_entry_size_value = 256; + adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_256B; } else { - llq_config->llq_ring_entry_size = - ENA_ADMIN_LIST_ENTRY_SIZE_128B; + llq_config->llq_ring_entry_size = ENA_ADMIN_LIST_ENTRY_SIZE_128B; llq_config->llq_ring_entry_size_value = 128; adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_128B; } From nobody Wed Jul 2 18:28:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0r5Jtdz60mJK; Wed, 02 Jul 2025 18:28: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 4bXT0r2KCQz3Hbp; Wed, 02 Jul 2025 18:28:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5f6mRTVD/fqwtlJaLgjZWYDISCVvx5m2ckuo+7HWJQA=; b=QDNjqz4wNmFULRCZYWOZHCN4GxTuaQaB51S28yiaN+0P+5LtoAtPFv3lxF3jfOogEJ24YL +3Ao9AJCXX5gfYddP2ctqhMfZdNDTN1KwWAkGHVwyKZu/JRWa/BmaWl270y9zhApphJ+mU ZBKr3TTWCzVQEkYuijG/gcjsDHde1frpnplP49hmwzlFzzeKEnDPpOVxqnfczfxMiIOa9C yKi+J3o1fOP1MiPvedVpI+VGovdwwt8GyPyO5/cYxMZYiUObyXupF5J13QiCNqJ2Oa37Te QixpKWjzivLWXMO3JkGBUvPdtCPoz+aR4pcz3IxAKLVJ+tH2A/s9B4u2K8F9MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5f6mRTVD/fqwtlJaLgjZWYDISCVvx5m2ckuo+7HWJQA=; b=R4wqO8WD5EgY03xFMvh9GqkXCxbcCoWNcK1OxD23WVA3S3MM4U5VTqDSYo4p+8Txgpk2ON T+M53MycM6jJPo3+T1Cr24WbmVBik8h9U1xbDdfFbIxNByC5k2LHXwaxGHW4j83+KRA37L FwCrzS2iCz3l9lXUajduaf4lr/tIW0kH4CA5UeL+8iumJb4WYBO0WqBEsxceplw/MzbxmS NxgOlkgPCCYRZgQOARNCBxOASiveR/Wz8VjETHdf3hWVjH0GW9iMY5ROO7ktkYvuw1ucsM gvlib43+BvP0Gr/bupXoAdnhKZJu4M4UAfztpHhEUTsyGXNDqMbnCydQNBhO6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480892; a=rsa-sha256; cv=none; b=xYGxjQ54ODW4xKcbTkVsBM8WruRKkeVlgFezAQQVaCkFZt6lTXXnNmyC742XvqwboJ4+ZO zBSeQboaWvwk+pZIcfnkWGqCkt1yOHB8d/ohdMOfp2AHYCXVsB1pLEt4GxZ/6i9KRxHghc MhVTQ0jTDa2SvaQpnWOa562/u1/qLVuPSocOgt6iym9NRht2xvwtDHkt5uRVu1VQljKyin x41GGyxYiZhlbHyub+rNYpkXp6VZFPZFj+bVzm6tandBV14hFz4NvIwKHmloc6nProso3n T08fwQ2B1eXJdQq1B5RdHJqjtqYk/nj4RHS0Ly1o+j1soYxty9U1faydiAlT+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 4bXT0r1ZkXzWTd; Wed, 02 Jul 2025 18:28: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 562ISCgB057423; Wed, 2 Jul 2025 18:28:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISCRX057420; Wed, 2 Jul 2025 18:28:12 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:12 GMT Message-Id: <202507021828.562ISCRX057420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: ca1f7650a80d - releng/14.2 - ena: Bump driver version to v2.8.1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: ca1f7650a80da2e84f7ba0393d3a1a20872b7e6a Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=ca1f7650a80da2e84f7ba0393d3a1a20872b7e6a commit ca1f7650a80da2e84f7ba0393d3a1a20872b7e6a Author: Arthur Kiyanovski AuthorDate: 2025-04-25 17:19:32 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:54:35 +0000 ena: Bump driver version to v2.8.1 Approved by: so Security: FreeBSD-EN-25:11.ena (cherry picked from commit 59b30c1a864ee8a22c2e9912301cb88674f714c9) (cherry picked from commit a1685d25601ee7abfaf6d6a993932ae3318e070e) --- sys/dev/ena/ena.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 06bdfad97ed4..3b01605b4ba7 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -39,7 +39,7 @@ #define ENA_DRV_MODULE_VER_MAJOR 2 #define ENA_DRV_MODULE_VER_MINOR 8 -#define ENA_DRV_MODULE_VER_SUBMINOR 0 +#define ENA_DRV_MODULE_VER_SUBMINOR 1 #define ENA_DRV_MODULE_NAME "ena" From nobody Wed Jul 2 18:28:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0s4vh3z60mHS; Wed, 02 Jul 2025 18:28: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 4bXT0s3HRXz3Hhx; Wed, 02 Jul 2025 18:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHBaHR64nuXKbZzp7G/IrmYqMjuftqttobecWJmxXOU=; b=N7XN8yG8wOv5stVR+bViUdaf7ZvrbPE88QL8VQAAso9nfMhjaJKRihVAYbY91bOFr3GFlg BshdFlmG00PGihsv7qF7NPTK7ZJbnAfNYIYzNzRJLPRGDF4bghJp1SB37/0rFmg9KWciFo 0Ce/gI91EfnISCq7YSSun9GppgTp522+oyXMHKkkBX6LT4WOb6/9erfrQHHYZir49alJN/ qZ00SATetpe7IXHJU+O3TljVtXsrFcLGqboPIt5sh3PHETwBkulIKy5tZerTUSqHRByl5u k1X1HZNM3B9aQT59oxEo9S679rcI5Lu73YUw2xt6OXAVmKZgCB+odrZ1ZtfaBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHBaHR64nuXKbZzp7G/IrmYqMjuftqttobecWJmxXOU=; b=phs2MmaiDaA0OjcPEU8AXENqHE4rvAbEfkUvSVI6elPuXAbtu5ifeEBg3K0WAdg/cK44g5 FuAK3H7pIfWooW14tI2GBEGeKnUEub+e0iHCnCC8aHcz6INHqZR70E96w/R0QvcuqKsi9g c5JdprFCcx1vvpvy6nqzPBOhZMFpAXW5Scm05Zs3tfsJBj/tq9GTDt7Em6sDfjf7LM3CrH JhDkAaJnVwEHoUQku6MZCmjm9gyIl2UTSZ46VohbV70yJPAvkBLO4tJKfMCjxXw5y/bGks 4+QZoD6Mvbz0BM0FLMPa9Y1DxoZYHtkzrWkQetmJ66eDo1/AlgN2O89xCTMYpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480893; a=rsa-sha256; cv=none; b=uYVX4LZvwf9OaxbT7YIQk168eShtt/7CCetx12YrMrQ6laUW5FUdX6zOdRPaptaNZGudxr IJnAiYXBDKo3MgPQZnDpD9SlYx7CoX+sm0RBAazoqp4TCRy1ZYOVujHFH4kaalts8pwxI6 uK0TkrNkiW7usq0whZfpoodY3bWYXTqotBftdx5154UVJRZtIdAflj0IwAUgKOfgZsMaKD qI4p6Pw3/fvaKa+LokuACv9zD3jDUe6pXhNTKflcj20zmkE4h3qSTbnLtihYeiCjPoKwV2 dUjg5r7boK9tE41P5L2N+JKCbCCupdaHULsnhYoCDv3xtDa6WrALzSojuyLS3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT0s2HKBzWTf; Wed, 02 Jul 2025 18:28: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 562ISDgc057455; Wed, 2 Jul 2025 18:28:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISDUs057452; Wed, 2 Jul 2025 18:28:13 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:13 GMT Message-Id: <202507021828.562ISDUs057452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 49b07b94662b - releng/14.2 - Fix Use-after-free in multi-threaded xz decoder. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 49b07b94662b92edb6d8de1e997fa805ac8d2b7c Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=49b07b94662b92edb6d8de1e997fa805ac8d2b7c commit 49b07b94662b92edb6d8de1e997fa805ac8d2b7c Author: Gordon Tetlow AuthorDate: 2025-07-02 05:56:35 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:56:35 +0000 Fix Use-after-free in multi-threaded xz decoder. Approved by: so Security: FreeBSD-SA-25:06.xz Security: CVE-2025-31115 --- contrib/xz/src/liblzma/common/stream_decoder_mt.c | 104 +++++++++++----------- 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/contrib/xz/src/liblzma/common/stream_decoder_mt.c b/contrib/xz/src/liblzma/common/stream_decoder_mt.c index 76212b46da32..6bbbe53b5e32 100644 --- a/contrib/xz/src/liblzma/common/stream_decoder_mt.c +++ b/contrib/xz/src/liblzma/common/stream_decoder_mt.c @@ -24,15 +24,10 @@ typedef enum { THR_IDLE, /// Decoding is in progress. - /// Main thread may change this to THR_STOP or THR_EXIT. + /// Main thread may change this to THR_IDLE or THR_EXIT. /// The worker thread may change this to THR_IDLE. THR_RUN, - /// The main thread wants the thread to stop whatever it was doing - /// but not exit. Main thread may change this to THR_EXIT. - /// The worker thread may change this to THR_IDLE. - THR_STOP, - /// The main thread wants the thread to exit. THR_EXIT, @@ -347,27 +342,6 @@ worker_enable_partial_update(void *thr_ptr) } -/// Things do to at THR_STOP or when finishing a Block. -/// This is called with thr->mutex locked. -static void -worker_stop(struct worker_thread *thr) -{ - // Update memory usage counters. - thr->coder->mem_in_use -= thr->in_size; - thr->in_size = 0; // thr->in was freed above. - - thr->coder->mem_in_use -= thr->mem_filters; - thr->coder->mem_cached += thr->mem_filters; - - // Put this thread to the stack of free threads. - thr->next = thr->coder->threads_free; - thr->coder->threads_free = thr; - - mythread_cond_signal(&thr->coder->cond); - return; -} - - static MYTHREAD_RET_TYPE worker_decoder(void *thr_ptr) { @@ -398,17 +372,6 @@ next_loop_unlocked: return MYTHREAD_RET_VALUE; } - if (thr->state == THR_STOP) { - thr->state = THR_IDLE; - mythread_mutex_unlock(&thr->mutex); - - mythread_sync(thr->coder->mutex) { - worker_stop(thr); - } - - goto next_loop_lock; - } - assert(thr->state == THR_RUN); // Update progress info for get_progress(). @@ -473,8 +436,7 @@ next_loop_unlocked: } // Either we finished successfully (LZMA_STREAM_END) or an error - // occurred. Both cases are handled almost identically. The error - // case requires updating thr->coder->thread_error. + // occurred. // // The sizes are in the Block Header and the Block decoder // checks that they match, thus we know these: @@ -482,16 +444,30 @@ next_loop_unlocked: assert(ret != LZMA_STREAM_END || thr->out_pos == thr->block_options.uncompressed_size); - // Free the input buffer. Don't update in_size as we need - // it later to update thr->coder->mem_in_use. - lzma_free(thr->in, thr->allocator); - thr->in = NULL; - mythread_sync(thr->mutex) { + // Block decoder ensures this, but do a sanity check anyway + // because thr->in_filled < thr->in_size means that the main + // thread is still writing to thr->in. + if (ret == LZMA_STREAM_END && thr->in_filled != thr->in_size) { + assert(0); + ret = LZMA_PROG_ERROR; + } + if (thr->state != THR_EXIT) thr->state = THR_IDLE; } + // Free the input buffer. Don't update in_size as we need + // it later to update thr->coder->mem_in_use. + // + // This step is skipped if an error occurred because the main thread + // might still be writing to thr->in. The memory will be freed after + // threads_end() sets thr->state = THR_EXIT. + if (ret == LZMA_STREAM_END) { + lzma_free(thr->in, thr->allocator); + thr->in = NULL; + } + mythread_sync(thr->coder->mutex) { // Move our progress info to the main thread. thr->coder->progress_in += thr->in_pos; @@ -511,7 +487,20 @@ next_loop_unlocked: && thr->coder->thread_error == LZMA_OK) thr->coder->thread_error = ret; - worker_stop(thr); + // Return the worker thread to the stack of available + // threads only if no errors occurred. + if (ret == LZMA_STREAM_END) { + // Update memory usage counters. + thr->coder->mem_in_use -= thr->in_size; + thr->coder->mem_in_use -= thr->mem_filters; + thr->coder->mem_cached += thr->mem_filters; + + // Put this thread to the stack of free threads. + thr->next = thr->coder->threads_free; + thr->coder->threads_free = thr; + } + + mythread_cond_signal(&thr->coder->cond); } goto next_loop_lock; @@ -545,17 +534,22 @@ threads_end(struct lzma_stream_coder *coder, const lzma_allocator *allocator) } +/// Tell worker threads to stop without doing any cleaning up. +/// The clean up will be done when threads_exit() is called; +/// it's not possible to reuse the threads after threads_stop(). +/// +/// This is called before returning an unrecoverable error code +/// to the application. It would be waste of processor time +/// to keep the threads running in such a situation. static void threads_stop(struct lzma_stream_coder *coder) { for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + // The threads that are in the THR_RUN state will stop + // when they check the state the next time. There's no + // need to signal coder->threads[i].cond. mythread_sync(coder->threads[i].mutex) { - // The state must be changed conditionally because - // THR_IDLE -> THR_STOP is not a valid state change. - if (coder->threads[i].state != THR_IDLE) { - coder->threads[i].state = THR_STOP; - mythread_cond_signal(&coder->threads[i].cond); - } + coder->threads[i].state = THR_IDLE; } } @@ -1562,6 +1556,10 @@ stream_decode_mt(void *coder_ptr, const lzma_allocator *allocator, } // Return if the input didn't contain the whole Block. + // + // NOTE: When we updated coder->thr->in_filled a few lines + // above, the worker thread might by now have finished its + // work and returned itself back to the stack of free threads. if (coder->thr->in_filled < coder->thr->in_size) { assert(*in_pos == in_size); return LZMA_OK; @@ -1949,7 +1947,7 @@ stream_decoder_mt_init(lzma_next_coder *next, const lzma_allocator *allocator, // accounting from scratch, too. Changes in filter and block sizes may // affect number of threads. // - // FIXME? Reusing should be easy but unlike the single-threaded + // Reusing threads doesn't seem worth it. Unlike the single-threaded // decoder, with some types of input file combinations reusing // could leave quite a lot of memory allocated but unused (first // file could allocate a lot, the next files could use fewer From nobody Wed Jul 2 18:28:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT0v1fLbz60m87; Wed, 02 Jul 2025 18: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 4bXT0t5S8fz3Hl2; Wed, 02 Jul 2025 18:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9Un2YN98ugRw0Nt5Tn74LRzFFY9EIQEVcGX/oIFUxk=; b=RideYJmGatRL4ZoIU9ugd9C+gqMUjFe63fGAEGIv+BrwGD4qKKFdwYpsQ8CG1ul/mkr3b8 D9Fq26WiCnLc5f9YZ7bxYSffFRFeaqCtJbB+OMT9RGNE3sAJI0by8vFpW2vLqgmR8UbWeC KBPyrfuoDrixnCUHy3vn58GrKBidLp0+diDFYuRHZslgOHuuy0sp2xbxUtS/JT13qNL1sJ X120bA7TmIjyAspkVqCxfrPoPoHoYxRjzFki3XtpTqPMib5Tl6yvopZTG/33ukDa8YOZPL TZQJcf1JQTtDQbTs84AqKFwR8WyxzFJ6LyFE9WTT5Q2mTjVTmhDeQ9IvabVjEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9Un2YN98ugRw0Nt5Tn74LRzFFY9EIQEVcGX/oIFUxk=; b=nSQxM+PWBsOSZIzCswBr3NFDLtsudrl6CX4Pj/xXUZizvhdfRA0QT0Igf27HP6c3lL89Yx xapT9xmnHStt3dPe6sFNdvDAPlajWbVyBkVOOlSNKwGYOJO6SVjPWbTsYZs+caYRrbu2/u cuCqG8e89l7nlzw5s++V/LxVBCFD11ngyNqMhMichse67Ne6Zpu57cRCBZPJv+aEUs5Jf4 Ss0KvRMsmVX5094WwL5xZF+qlg0/oBK3aTybnQHL5POuwPuvWFpsaXCxZVkLnzbqjFsr/p DTw2KyZDvbBLSCaN8XFA4rf8WvLZ4nnVWQ6Gh96xFt7pDNQWlb9l558h92gyvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480894; a=rsa-sha256; cv=none; b=dXSS/ppYkT4yf62cfDjOrnwjQhkhrjGBaq/Ito0WFt6a+pG0fFRJmKEuLiseZuOcA2JKEN EpCOrXLkQOqknk6jZiosM46WFDHfThu27Ek86Pc/vxXQNVHfSFmeUiJvGW0wKEbtOlOLUO M3r8rsICLSOPGZy9KOrIw/Jc4nlhytrQ2WTkndakzfRDOy0siluucwUJvkta8zREAHoKr1 e0wDQNCGpE1d1/kt2R14YovCygf5vyDXaMMZZDMvM4V4ft1EO0uN2ijMv2UZiRAIWNL2Cw LeLGVciZDPOAYUVD81gQKTG6No0s+q/h4aaRtSEUfN6NvUygIY/l4suaAhTMCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT0t3DvGzVpJ; Wed, 02 Jul 2025 18:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 562ISEOF057494; Wed, 2 Jul 2025 18:28:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISEOD057491; Wed, 2 Jul 2025 18:28:14 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:14 GMT Message-Id: <202507021828.562ISEOD057491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: d9352700f935 - releng/14.2 - Add UPDATING entries and bump version. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: d9352700f9357aa170c1e4dc144537998ec66025 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=d9352700f9357aa170c1e4dc144537998ec66025 commit d9352700f9357aa170c1e4dc144537998ec66025 Author: Gordon Tetlow AuthorDate: 2025-07-02 06:03:15 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 06:03:15 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 14 ++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index ea92e6a45454..f48519c38c75 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,20 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250702: + 14.2-RELEASE-p4 EN-25:09.libc + EN-25:10.zfs + EN-25:11.ena + SA-25:06.xz + + Fix dynamically-loaded C++ libraries crashing at exit [EN-25:09.libc] + + Fix corruption in ZFS replication streams from encrypted datasets [EN-25:10.zfs] + + Fix ena resets and kernel panic on Nitro v4 or newer instances [EN-25:11.ena] + + Fix use-after-free in multi-threaded xz decoder [SA-25:06.xz] + 20250410: 14.2-RELEASE-p3 EN-25:04.tzdata EN-25:05.expat diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 71869e91f186..5feaa7fab80b 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.2" -BRANCH="RELEASE-p3" +BRANCH="RELEASE-p4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Jul 2 18:28:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT183hKcz60m5h; Wed, 02 Jul 2025 18:28: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 4bXT182SNQz3JB2; Wed, 02 Jul 2025 18:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Q76oUPL2p+DJzTWDJegEx3wkhZHjzQKoG+8DS2h6Jw=; b=HxWF7S9Or+9A5QP/Y3cG+7Zr4OJtLZGWx1+yFAIQSpsFoinev6oDjs6zbNqkBDk2qqesiL ANLQU3MkBfjm/HhUJuDcEPpxT16me0wQ3e/MfNvJya+GWaPf6//AfEwOCP7XHJiXdwx23m UnBFcB4vKDht0CzqCgAQQOMy4V8G9hXGiM3JwnHSzLGcb3kbQfhUW5WUfhdnMJ6XMyEpX8 FBWKb4GF7N/B+q9dZ+jRBKsSEivnBzZOHJdWKyYMz+3lXBzVZz06WW9sV5LNK3BPSghwqw 79Cg7Lx7KXUIJkvKp9p5Bc5tXE+7WX2uD8zQi70fDs2gG7tjzHfyW+pbXiqBmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Q76oUPL2p+DJzTWDJegEx3wkhZHjzQKoG+8DS2h6Jw=; b=AFcq6wgzHERuugbs+KchaUhi6eVI2E7CBiEcOLFeYZ/QFZPV5mcLSbvXc7clDLJGJX75dP linSdE0xCJBKuJkK3w51e81cSTG7wYgCGLogNM0eNIAyiv+sN3JMxuToJMZaGdsMnGLN24 NenObFV84oRbUj+m/uMxGEW8ehpmzkzlP3aHLWp8YJd5MzzHfWR6NJt9mcXnnawTqF1NnY GLNJ+vzPFLCED3Dt/GKNLLYhxhn+HDy+64be4HQpfZyWlet0Oud/+dLd8Qpfrk61mgHVoB clhhw0ERSGOzCqmIHGZyrgVohidiVs0xaZCs2SQveCSUXILPHawNGSwguAEKBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480908; a=rsa-sha256; cv=none; b=WMG23X60KWVFr8J/AM7tYsTMg58vTSyhzdNC/U4kpHENo/3LJ7fU2FXmlEUxmbd8dvYwRe xGtsd9UAz1tKYw/lCFvxyChWbHHmunQy1GFq0a2l67kT5FPfu7ACNK+W+dW80aaOljfIfw BnsMcmphWE47SrjgqVaId0vF2me0lEwHZds8kqRacL9nscypq1NAP8CRR0VwSBTRxmifQE Yj5q2B3tVLcSCxs+4w518NAmGLC1c+Faaszaou3Apfp6GMNmR979Z+1w9Oy/G6XZOqF5CG 2NDsQD39AL96wMB/FhqWoUXEAq17GHJpxuanRFrUqRk2UXeu/PwLQzOOO0N6xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT181g9fzVpN; Wed, 02 Jul 2025 18:28: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 562ISSWt057716; Wed, 2 Jul 2025 18:28:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISSgA057713; Wed, 2 Jul 2025 18:28:28 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:28 GMT Message-Id: <202507021828.562ISSgA057713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: f936833911d7 - releng/13.5 - libc: allow __cxa_atexit handlers to be added during __cxa_finalize List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: f936833911d765c1dc9640913b73acfa1d751742 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=f936833911d765c1dc9640913b73acfa1d751742 commit f936833911d765c1dc9640913b73acfa1d751742 Author: Aurélien Croc de Suray AuthorDate: 2025-04-05 00:47:53 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:42:46 +0000 libc: allow __cxa_atexit handlers to be added during __cxa_finalize science/dlib-cpp reveals an interesting scenario that works fine on other platforms but not on FreeBSD; notably, it ends up creating a new global object from some destructor which is called during __cxa_finalize. This breaks when libdlib is dlopen()ed and then subsequently dlclose()ed, as we never end up invoking the created object's dtor until program exit when the shlib is already unmapped. Fix it by noting when we're in the middle of __cxa_finalize for a dso, and then restarting the search if __cxa_atexit() was called in the middle somewhere. We wait until we've processed the initial set before starting over and processing the newly added handlers as if it were a complete set of handlers added during runtime. The alternative is calling them as they're added to maintain a LIFO in terms of total ordering, but in theory a constructor could add another global object that also needs to be destroyed, and that object needs to be destroyed after the one that constructed it to avoid creating unexpected lifetime issues. This manifests in the pdlib PHP extension for dlib crashing, see [0]. [0] https://github.com/goodspb/pdlib/issues/39 PR: 285870 Reviewed by: kevans (also supplied commit message) Approved by: so Security: FreeBSD-EN-25:09.libc (cherry picked from commit 23427c8e1fedb9fc68ad0bd27a59c7ffd2b3008c) (cherry picked from commit 04f7496f89e28057079f3f0b1a02d7d9d874487f) --- lib/libc/stdlib/atexit.c | 61 ++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c index 6b63d9e728c4..5b39552821ed 100644 --- a/lib/libc/stdlib/atexit.c +++ b/lib/libc/stdlib/atexit.c @@ -39,6 +39,7 @@ static char sccsid[] = "@(#)atexit.c 8.2 (Berkeley) 7/3/94"; #include "namespace.h" #include #include +#include #include #include #include @@ -60,6 +61,8 @@ _Block_copy(void*); #define ATEXIT_FN_CXA 2 static pthread_mutex_t atexit_mutex = PTHREAD_MUTEX_INITIALIZER; +static void *current_finalize_dso = NULL; +static bool call_finalize_again = false; #define _MUTEX_LOCK(x) if (__isthreaded) _pthread_mutex_lock(x) #define _MUTEX_UNLOCK(x) if (__isthreaded) _pthread_mutex_unlock(x) @@ -119,6 +122,9 @@ atexit_register(struct atexit_fn *fptr) __atexit = p; } p->fns[p->ind++] = *fptr; + if (current_finalize_dso != NULL && + current_finalize_dso == fptr->fn_dso) + call_finalize_again = true; _MUTEX_UNLOCK(&atexit_mutex); return 0; } @@ -212,33 +218,38 @@ __cxa_finalize(void *dso) } _MUTEX_LOCK(&atexit_mutex); - for (p = __atexit; p; p = p->next) { - for (n = p->ind; --n >= 0;) { - if (p->fns[n].fn_type == ATEXIT_FN_EMPTY) - continue; /* already been called */ - fn = p->fns[n]; - if (dso != NULL && dso != fn.fn_dso) { - /* wrong DSO ? */ - if (!has_phdr || global_exit || - !__elf_phdr_match_addr(&phdr_info, - fn.fn_ptr.cxa_func)) - continue; + current_finalize_dso = dso; + do { + call_finalize_again = false; + for (p = __atexit; p; p = p->next) { + for (n = p->ind; --n >= 0;) { + if (p->fns[n].fn_type == ATEXIT_FN_EMPTY) + continue; /* already been called */ + fn = p->fns[n]; + if (dso != NULL && dso != fn.fn_dso) { + /* wrong DSO ? */ + if (!has_phdr || global_exit || + !__elf_phdr_match_addr(&phdr_info, + fn.fn_ptr.cxa_func)) + continue; + } + /* + Mark entry to indicate that this particular + handler has already been called. + */ + p->fns[n].fn_type = ATEXIT_FN_EMPTY; + _MUTEX_UNLOCK(&atexit_mutex); + + /* Call the function of correct type. */ + if (fn.fn_type == ATEXIT_FN_CXA) + fn.fn_ptr.cxa_func(fn.fn_arg); + else if (fn.fn_type == ATEXIT_FN_STD) + fn.fn_ptr.std_func(); + _MUTEX_LOCK(&atexit_mutex); } - /* - Mark entry to indicate that this particular handler - has already been called. - */ - p->fns[n].fn_type = ATEXIT_FN_EMPTY; - _MUTEX_UNLOCK(&atexit_mutex); - - /* Call the function of correct type. */ - if (fn.fn_type == ATEXIT_FN_CXA) - fn.fn_ptr.cxa_func(fn.fn_arg); - else if (fn.fn_type == ATEXIT_FN_STD) - fn.fn_ptr.std_func(); - _MUTEX_LOCK(&atexit_mutex); } - } + } while (call_finalize_again); + current_finalize_dso = NULL; _MUTEX_UNLOCK(&atexit_mutex); if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); From nobody Wed Jul 2 18:28:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT1954Mtz60mBK; Wed, 02 Jul 2025 18:28: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 4bXT1931mqz3HyJ; Wed, 02 Jul 2025 18:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g7PwIp2HkUQmiTEPWKvfwx4G9C4tenA9AOD7w3XeoPU=; b=SaXUJ6cfS4fCqRwBzRSP1G3nvwuyeaH7VegfBA8e+gauK8R50afezxyUJhVgW9WpWH7BQz 8vEGCxUm9oI2q52U/3Wtrz8RGKz+h86MhBiGN+tdymZRBY44fIHjJqIRM794np+2SuFcbs s15MCWzT6yu16uOtEX0eSQr1k3UIEjn0Ollwvnwfka1SblPlUG4jAKxfI4/CxGwhRTnBzY V70Z127r+B5qaWEMF/fGtjmn8MloL2Hj9btHvV3sDCVBh+fcTLlY76QWLMHmx/dFWuyRTv msIsyTYITqWLNssrwDW9+RdwaUXvgUB7yQ7D7R44qo1gVqkul6TTuQRsHk4iTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g7PwIp2HkUQmiTEPWKvfwx4G9C4tenA9AOD7w3XeoPU=; b=cQFmsSG9D9zwJxLiLaoZ0BN4V7uBz3sKP8w/UblXvlArmsDceeK3SDA/Oz2MiBNIBhw7Ls QfP9GrsV5bRRIp7phU0ON5FG5G2mY88BnyIrGkez192HbMze5IpZDHGEOshL1y38c0zphm Gv62JiMsf6O/u5zuYiUJtUNe50AGkzdrS5fIrLrENcI5bBLQip3fND7DAYcqWMIqLQKIap 7pu1+3rs9FWC1FcuOwGKoBVQYMUcYW5NOD4NQxsGTvqdg3fegKLNdmpo1gvLIHc4VFGfOh BYt5KhBPOZdU1P1EW/lxOz87Qog9MQtsTkpZVXWvrlWDA+4SPnzurnUh6YfEsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480909; a=rsa-sha256; cv=none; b=epYK49VHgZpBawxsgNHGR8FrIG284sTc7gDfOsmFRc1GFGECmhwZUw9OlV4tW+OmsDs7h8 2Ddmh8izw0LYZP+5WcQ1LiQmXuZWwALgEtHR8JRwlfhp6mCPZjYwmYyCK8FbaCFSzfdIPX zZfI+Ng/ARh+J8qzwYgLNef49aMF2oXRmEUYoN9sDP+BrATa+a0jqTGWIgrWBAy/fx64CH JZe3zb42uQkpdh8TE0UOVBRcVNEYMBk+XNQcEQwjSksfE/fGLUMVqcio0j58WTP0HBFrk7 vLAi0t7w5c+HYawnRrG+a0PcMfYeL1wq2xlGq+chNmAwR8QXFpF33Ol3V1ZhIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT192crHzW9X; Wed, 02 Jul 2025 18:28: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 562ISTCB057749; Wed, 2 Jul 2025 18:28:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISTLP057746; Wed, 2 Jul 2025 18:28:29 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:29 GMT Message-Id: <202507021828.562ISTLP057746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 4d9c4ecf6a48 - releng/13.5 - Fix corruption in ZFS replication streams from encrypted datasets. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 4d9c4ecf6a48a17f9b79a93ec80e09858f80a524 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=4d9c4ecf6a48a17f9b79a93ec80e09858f80a524 commit 4d9c4ecf6a48a17f9b79a93ec80e09858f80a524 Author: Gordon Tetlow AuthorDate: 2025-07-02 05:47:29 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:47:29 +0000 Fix corruption in ZFS replication streams from encrypted datasets. From the upstream pull request merges: #17340 b144b160b Fix 2 bugs in non-raw send with encryption Obtained from: OpenZFS Approved by: so Security: FreeBSD-EN-25:10.zfs --- sys/contrib/openzfs/module/zfs/dmu_send.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/dmu_send.c b/sys/contrib/openzfs/module/zfs/dmu_send.c index 0dd1ec210a1d..e4891e2fe4aa 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_send.c +++ b/sys/contrib/openzfs/module/zfs/dmu_send.c @@ -2676,8 +2676,8 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, } if (fromsnap != 0) { - err = dsl_dataset_hold_obj_flags(dspp.dp, fromsnap, dsflags, - FTAG, &fromds); + err = dsl_dataset_hold_obj(dspp.dp, fromsnap, FTAG, &fromds); + if (err != 0) { dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); dsl_pool_rele(dspp.dp, FTAG); @@ -2729,7 +2729,7 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, kmem_free(dspp.fromredactsnaps, dspp.numfromredactsnaps * sizeof (uint64_t)); - dsl_dataset_rele(dspp.to_ds, FTAG); + dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); return (err); } From nobody Wed Jul 2 18:28:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT1C0q8Sz60m06; Wed, 02 Jul 2025 18:28: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 4bXT1B4JkVz3JDR; Wed, 02 Jul 2025 18:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRvLuzmGXojFOBkT2oWLvSfCAWAy8zML2iyCELUyQn8=; b=CD2fya7ANFLoLUh664FMWhReksNRTS08uzSTx+Ew2TgGvtmfuLMUrdyK8IKL1zkTcCDWoz FGz4U2RzZQX5hf38dDxPPqyILO7wgQN1BIJA4meRY5jShACN1mrxgbz4aVzKXcA65ghU3e eJMSn+y388BqNLbywxTYD7Zn13gQyqgNszpH4NlC7Sh9bSrpbbysN64pCUZP5nDlmRzPzg yH43Opu8zrRWOwCtI9Xvyvp43plsKHkFTnXpq37YpkGWGajd1IfVwhlc7mFNZPdL45bnOp FCazF3F1XrX3P0MgFwgupqbFgAUsFAQADOIDUZhFV7YNzFYbmnsUmSIytamGcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRvLuzmGXojFOBkT2oWLvSfCAWAy8zML2iyCELUyQn8=; b=EXEFsOqj5h6TV3S7ElXPvrRmevF64+N/MtHzDGpaA3UhtfKhsHoy99+2xSgTZwjGOKgd3A qNXJC25sv9Z/87c/cn02GjK8cID2IGXKtcwtx2VLfngljOWulX2bkJkeOxCwT3QvjP0eaX N76ZmR0faFhvtrRxkEfC4yp+rHdYzyfgLXTtz/t3p43CgOvt4KzySlsto674yi+/oFyzsT ubRQiuvUyMV7xsaPB2iDyzWfsroESMRLWFohYCKaYPcYn+qYzdVnYNIsECojK0gTGbd6u0 5w4oPxH1X2Cj2oQ2q4LTAPUl5Cx+Cq1y1ZKqzfE4485Cfl+y1FjzQYH4ZVMBBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480910; a=rsa-sha256; cv=none; b=G6nc7+OqIysH8h7ZSTXGNZh4OWPdWqX97VvqO2X6HHf8BAfZRgb5Hir6YIj0HA3XT7ftOE Sk6CxTC/97YciYw5lrzfAeTFymo9vB2t0PnPnS7kSqlCRlU/aK8QJrHptKuhlRGzLtZwHR u0jlsdGaMn7Pm5nZp3Nrg18d0VM5zvjRantlYwdl4DiTnz7awAA54BstOiOGLy8x30KPKP s4Ky3/RN57rGmUXD1GmU3IsmAGSTMWhwUJ7egAeNF0tisC4qOoWHox0qjCdGrtQlrjXgCO LPNNpsgeCx7UQDTc5vNlllyriDhbiQg6xLctlLIDRkCitl+EmEiZyDo6kYlTqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT1B3JGvzWGg; Wed, 02 Jul 2025 18:28: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 562ISUaR057782; Wed, 2 Jul 2025 18:28:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISUVk057779; Wed, 2 Jul 2025 18:28:30 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:30 GMT Message-Id: <202507021828.562ISUVk057779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 35c2729211d9 - releng/13.5 - ena: Fix misconfiguration when requesting regular LLQ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 35c2729211d9d4062020fd5eabecc7afd67fb0b9 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=35c2729211d9d4062020fd5eabecc7afd67fb0b9 commit 35c2729211d9d4062020fd5eabecc7afd67fb0b9 Author: David Arinzon AuthorDate: 2025-04-22 10:54:18 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:52:31 +0000 ena: Fix misconfiguration when requesting regular LLQ Patch 0a33c047a443 introduced new values to hw.ena.force_large_llq_header. The default value of 2 means no preference, while 0 and 1 act as the previous false and true respectively, which allowed forcefully setting regular or large LLQ. There are 2 ways to force the driver to select regular LLQ: 1. Setting hw.ena.force_large_llq_header = 0 via sysctl. 2. Turning on ena express, which makes the recommendation by the FW to be regular LLQ. When the device supports large LLQ but the driver is forced to regular LLQ, llq_config->llq_ring_entry_size_value is never initialized and since it is a variable allocated on the stack, it stays garbage. Since this variable is involved in calculating max_entries_in_tx_burst, it could cause the maximum burst size to be zero. This causes the driver to ignore the real maximum burst size of the device, leading to driver resets in devices that have a maximum burst size (Nitro v4 and on. see [1] for more information). In case the garbage value is 0, the calculation of max_entries_in_tx_burst divides by 0 and causes kernel panic. The patch modifies the logic to take into account all use-cases and ensure that the relevant fields are properly initialized. [1]: https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html Fixes: 0a33c047a443 ("ena: Support LLQ entry size recommendation from device") Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D50040 Approved by: so Security: FreeBSD-EN-25:11.ena (cherry picked from commit 56c45700f2ae15755358f2da8266247613c564df) (cherry picked from commit 162b5bbb4048d0ba99d759616c127ba04c9289c3) --- sys/dev/ena/ena.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index a0d3cf28861e..f9342ad91ae2 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2760,22 +2760,41 @@ static inline void ena_set_llq_configurations(struct ena_llq_configurations *llq_config, struct ena_admin_feature_llq_desc *llq, struct ena_adapter *adapter) { + bool use_large_llq; + llq_config->llq_header_location = ENA_ADMIN_INLINE_HEADER; llq_config->llq_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; llq_config->llq_num_decs_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; - if ((llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B) != 0) { - if ((ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_LARGE) || - (ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT && - llq->entry_size_recommended == ENA_ADMIN_LIST_ENTRY_SIZE_256B)) { - llq_config->llq_ring_entry_size = - ENA_ADMIN_LIST_ENTRY_SIZE_256B; - llq_config->llq_ring_entry_size_value = 256; - adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_256B; - } + + switch (ena_force_large_llq_header) + { + case ENA_LLQ_HEADER_SIZE_POLICY_REGULAR: + use_large_llq = false; + break; + case ENA_LLQ_HEADER_SIZE_POLICY_LARGE: + use_large_llq = true; + break; + case ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT: + use_large_llq = + (llq->entry_size_recommended == ENA_ADMIN_LIST_ENTRY_SIZE_256B); + break; + default: + use_large_llq = false; + ena_log(adapter->pdev, WARN, + "force_large_llq_header should have values [0-2]\n"); + break; + } + + if (!(llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B)) + use_large_llq = false; + + if (use_large_llq) { + llq_config->llq_ring_entry_size = ENA_ADMIN_LIST_ENTRY_SIZE_256B; + llq_config->llq_ring_entry_size_value = 256; + adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_256B; } else { - llq_config->llq_ring_entry_size = - ENA_ADMIN_LIST_ENTRY_SIZE_128B; + llq_config->llq_ring_entry_size = ENA_ADMIN_LIST_ENTRY_SIZE_128B; llq_config->llq_ring_entry_size_value = 128; adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_128B; } From nobody Wed Jul 2 18:28:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT1D1GdWz60mDY; Wed, 02 Jul 2025 18:28: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 4bXT1C4HNKz3J1Z; Wed, 02 Jul 2025 18:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r6EAThzx1w990T+aA9RrlKxtPpi9IRkw6fKdYdZO/Ao=; b=jmxRm7DPwLyFZBqUG4VLX3snaPAWc51h63T6vGYHfG2mME9JegaUrNDiIJDpJ/1p1RxOGU au62U5qQz5KK3zhUOJIcTKFq5oSjvmgcf3H2AjNxEbvWSRuDmjc35dRl5zU2ht0RQdqc0x m7dGuJAnc1cTs0iZlWLBo0j74Eqq+TyolIme2xu7TqJ1rxCHMVauKGd2xTvvOnnpebjts3 dLhuZSUl5KofsZ3jwlyrvTWu2VpPAbx1P8k+dUU2CXw6+yZyMysWAGeTGM4jKv6a0p0jco 8/CUCq1C9wX3Do67fsCrN35AdOev/Hm7RwhdHHAhFdJ5Z+vMiN70WxZGcKoyQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r6EAThzx1w990T+aA9RrlKxtPpi9IRkw6fKdYdZO/Ao=; b=S2h0Er0CEB8MgI3j5BpZm9W6Y+2mwBlHhPKXby6yXtjdkXr6tUaq8VI8b+114PI2lVzWw+ 4mKwMGc2idyLGIcQ9dbP9rO+pczUNtFPR05fqWGYPHBkdv8ms9KFQN3FmLQEwxWqLU+ERO TB78zEV+UOyWJisletABp9L/q+iSBgGrh3+aPPARt2ITVKbASnCRXsvVy/oP3wgX3+rv5U AeLNxyt/Sq/YchFOhCgLOd5Cjq1hyH0cPiyVsh63WaVrBwAvSq/15BmVXnS6OCfGQOT4W3 BLYOOhbiLxgSPCcTIVj9FD8Fry7HzUzAAquWvKIs3ybE/uY36oGzykNnxH0Kww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480911; a=rsa-sha256; cv=none; b=WEyvFaLolB7GMkwwLbhHR6efy1tnc+P9nIqK9fP017G4r9ENLb94yU0bIcaallhw3OZCcw F8XMfZjZVKVpXtv4VckcfHsxjs7/j1C4FvK8sseVaqQnMgBl/rIsRA8AFbDmvrNcT7Ran3 Phvg7ClgqjtOXz36VoWDsYPDZj8Ig9zRrDMNvLTMsm3ebwVZ2n0NPpaSSgf8r/qxCEEjaG X2BGLUJiDyR/VRcvB0KF8WOyJTRIEeuTNL+iSyiAUxWooanJctarXC+cWEAlKTSubCGOnD SOVaLrHzWW1vYwymics92XJ64sunisIe56TQGS3zVccb5ARNlzZjaLWGml0blQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT1C3tldzWGh; Wed, 02 Jul 2025 18:28: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 562ISVwZ057821; Wed, 2 Jul 2025 18:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISVAW057818; Wed, 2 Jul 2025 18:28:31 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:31 GMT Message-Id: <202507021828.562ISVAW057818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 575644144d5c - releng/13.5 - ena: Bump driver version to v2.8.1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 575644144d5cf4eef18ca3afd12266d6d3c33fdb Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=575644144d5cf4eef18ca3afd12266d6d3c33fdb commit 575644144d5cf4eef18ca3afd12266d6d3c33fdb Author: Arthur Kiyanovski AuthorDate: 2025-04-25 17:19:32 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:53:06 +0000 ena: Bump driver version to v2.8.1 Approved by: so Security: FreeBSD-EN-25:11.ena (cherry picked from commit 59b30c1a864ee8a22c2e9912301cb88674f714c9) (cherry picked from commit 7ea71ba86a57e10a313c7633a894f8c53afcd6c6) --- sys/dev/ena/ena.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 06bdfad97ed4..3b01605b4ba7 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -39,7 +39,7 @@ #define ENA_DRV_MODULE_VER_MAJOR 2 #define ENA_DRV_MODULE_VER_MINOR 8 -#define ENA_DRV_MODULE_VER_SUBMINOR 0 +#define ENA_DRV_MODULE_VER_SUBMINOR 1 #define ENA_DRV_MODULE_NAME "ena" From nobody Wed Jul 2 18:28:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT1F4gncz60mLr; Wed, 02 Jul 2025 18:28:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bXT1D6fq5z3J1t; Wed, 02 Jul 2025 18:28:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RnbHJqC+oQ3uQStbQ8abnU8qd6Q6simTUVi8jYnENW4=; b=G5BhOzqXbqtPa5z8b/VojHtCTJl5piAuB6nYPu+VU+8zzD8FOO/3jUM+gvZfFeJ+Y+lS4F 2atXC0GDmO/mi3PSnTwjBynIeuy3yog0MTW3XZEdZoR8qsSgGHBqKZlLhq6R63Pias9GUg 1tkFQAPeuKZePSTBlrLBn9snVOcq8rhUPJE10na0wNsN0cy33pCajkb5nuBH+ldjlnRWGN ir7OkVhwBHxW+CY33D1E6KMz+fn9Y+0TqyPf3+gs+VDf0r+WnyLaYqKUjeQU2J38yK9UCG vtTQRwJeEON0JJ9EGBo4hQc4yVD7AomNBZ6FfblyBjumJnlHiZKmsilnlSj+7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RnbHJqC+oQ3uQStbQ8abnU8qd6Q6simTUVi8jYnENW4=; b=nCXEfUTbJHXluGVrheKgjtZ20Ena8MnQ7gHaIPOfwLVDh0zhfvlMssBqv0smJD0ZXKD3MY UqWMWUwpRSTAq3hcH0Qy2AFi7ELQEsobXHYLHozIfMdvAvKqtG989BXGVXBpSlkHaw5MNs NJMVG8P0nRBHVCuLiF7ckzKxIInCO5tl6NK3ifiPTjL9hwOo+bnctZ5m/IdJ+L+P/FFL6O 7maRHHvEywRWJIxBe80yFVeI6BZPumkLyRCUYTURhVTblB5/Jm50/j88GPI6TjVtcX3bUD 1Ng6ZJgBy0l+upBpLOlnnrvs/ix6UEaAKc/HZkS3bSNuFNio3Le1xLD0YJYjRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480912; a=rsa-sha256; cv=none; b=BlcT8/aaHnJWn7WUSF3Pr5TfSs3G1xUhLOb+xgqCdcQcfeJqU2rNz0rRY6nIPdtcG3o/ZG tMi1BzOu2IbD4GeHMmJ7DnJ9KJpi9TdjBgeynEJPZ7aQ37S4WqCmazfdVT4bvlOqVUzzo6 Xa10SPHlzmBKbaPrvew2MHN7bbh1BHSIIX/lcJDvlnhtrsGFrBBXGcSun+ENO0Y5iRVQ1R NjN0YBKnCHIMbNHamSryLZIGV3edp0WsoZfLvx5GtuRjqtxl2+o9t3RqS3CRKytnseQW4Q YXd/ofoRg9nBNHe2rXRn21ZEgSgpaxmdbwNybz2Sp1t6g5cJiAKh/Z+s6wOyUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT1D58bNzW9Y; Wed, 02 Jul 2025 18:28: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 562ISW8A057856; Wed, 2 Jul 2025 18:28:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISWgW057853; Wed, 2 Jul 2025 18:28:32 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:32 GMT Message-Id: <202507021828.562ISWgW057853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 95e9c54b3961 - releng/13.5 - Fix Use-after-free in multi-threaded xz decoder. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 95e9c54b3961af6de4fccf1f801f7eb15fcc5263 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=95e9c54b3961af6de4fccf1f801f7eb15fcc5263 commit 95e9c54b3961af6de4fccf1f801f7eb15fcc5263 Author: Gordon Tetlow AuthorDate: 2025-07-02 05:55:41 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 05:55:41 +0000 Fix Use-after-free in multi-threaded xz decoder. Approved by: so Security: FreeBSD-SA-25:06.xz Security: CVE-2025-31115 --- contrib/xz/src/liblzma/common/stream_decoder_mt.c | 104 +++++++++++----------- 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/contrib/xz/src/liblzma/common/stream_decoder_mt.c b/contrib/xz/src/liblzma/common/stream_decoder_mt.c index 244624a47900..0cdb47d3bc04 100644 --- a/contrib/xz/src/liblzma/common/stream_decoder_mt.c +++ b/contrib/xz/src/liblzma/common/stream_decoder_mt.c @@ -23,15 +23,10 @@ typedef enum { THR_IDLE, /// Decoding is in progress. - /// Main thread may change this to THR_STOP or THR_EXIT. + /// Main thread may change this to THR_IDLE or THR_EXIT. /// The worker thread may change this to THR_IDLE. THR_RUN, - /// The main thread wants the thread to stop whatever it was doing - /// but not exit. Main thread may change this to THR_EXIT. - /// The worker thread may change this to THR_IDLE. - THR_STOP, - /// The main thread wants the thread to exit. THR_EXIT, @@ -346,27 +341,6 @@ worker_enable_partial_update(void *thr_ptr) } -/// Things do to at THR_STOP or when finishing a Block. -/// This is called with thr->mutex locked. -static void -worker_stop(struct worker_thread *thr) -{ - // Update memory usage counters. - thr->coder->mem_in_use -= thr->in_size; - thr->in_size = 0; // thr->in was freed above. - - thr->coder->mem_in_use -= thr->mem_filters; - thr->coder->mem_cached += thr->mem_filters; - - // Put this thread to the stack of free threads. - thr->next = thr->coder->threads_free; - thr->coder->threads_free = thr; - - mythread_cond_signal(&thr->coder->cond); - return; -} - - static MYTHREAD_RET_TYPE worker_decoder(void *thr_ptr) { @@ -397,17 +371,6 @@ next_loop_unlocked: return MYTHREAD_RET_VALUE; } - if (thr->state == THR_STOP) { - thr->state = THR_IDLE; - mythread_mutex_unlock(&thr->mutex); - - mythread_sync(thr->coder->mutex) { - worker_stop(thr); - } - - goto next_loop_lock; - } - assert(thr->state == THR_RUN); // Update progress info for get_progress(). @@ -472,8 +435,7 @@ next_loop_unlocked: } // Either we finished successfully (LZMA_STREAM_END) or an error - // occurred. Both cases are handled almost identically. The error - // case requires updating thr->coder->thread_error. + // occurred. // // The sizes are in the Block Header and the Block decoder // checks that they match, thus we know these: @@ -481,16 +443,30 @@ next_loop_unlocked: assert(ret != LZMA_STREAM_END || thr->out_pos == thr->block_options.uncompressed_size); - // Free the input buffer. Don't update in_size as we need - // it later to update thr->coder->mem_in_use. - lzma_free(thr->in, thr->allocator); - thr->in = NULL; - mythread_sync(thr->mutex) { + // Block decoder ensures this, but do a sanity check anyway + // because thr->in_filled < thr->in_size means that the main + // thread is still writing to thr->in. + if (ret == LZMA_STREAM_END && thr->in_filled != thr->in_size) { + assert(0); + ret = LZMA_PROG_ERROR; + } + if (thr->state != THR_EXIT) thr->state = THR_IDLE; } + // Free the input buffer. Don't update in_size as we need + // it later to update thr->coder->mem_in_use. + // + // This step is skipped if an error occurred because the main thread + // might still be writing to thr->in. The memory will be freed after + // threads_end() sets thr->state = THR_EXIT. + if (ret == LZMA_STREAM_END) { + lzma_free(thr->in, thr->allocator); + thr->in = NULL; + } + mythread_sync(thr->coder->mutex) { // Move our progress info to the main thread. thr->coder->progress_in += thr->in_pos; @@ -510,7 +486,20 @@ next_loop_unlocked: && thr->coder->thread_error == LZMA_OK) thr->coder->thread_error = ret; - worker_stop(thr); + // Return the worker thread to the stack of available + // threads only if no errors occurred. + if (ret == LZMA_STREAM_END) { + // Update memory usage counters. + thr->coder->mem_in_use -= thr->in_size; + thr->coder->mem_in_use -= thr->mem_filters; + thr->coder->mem_cached += thr->mem_filters; + + // Put this thread to the stack of free threads. + thr->next = thr->coder->threads_free; + thr->coder->threads_free = thr; + } + + mythread_cond_signal(&thr->coder->cond); } goto next_loop_lock; @@ -544,17 +533,22 @@ threads_end(struct lzma_stream_coder *coder, const lzma_allocator *allocator) } +/// Tell worker threads to stop without doing any cleaning up. +/// The clean up will be done when threads_exit() is called; +/// it's not possible to reuse the threads after threads_stop(). +/// +/// This is called before returning an unrecoverable error code +/// to the application. It would be waste of processor time +/// to keep the threads running in such a situation. static void threads_stop(struct lzma_stream_coder *coder) { for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + // The threads that are in the THR_RUN state will stop + // when they check the state the next time. There's no + // need to signal coder->threads[i].cond. mythread_sync(coder->threads[i].mutex) { - // The state must be changed conditionally because - // THR_IDLE -> THR_STOP is not a valid state change. - if (coder->threads[i].state != THR_IDLE) { - coder->threads[i].state = THR_STOP; - mythread_cond_signal(&coder->threads[i].cond); - } + coder->threads[i].state = THR_IDLE; } } @@ -1561,6 +1555,10 @@ stream_decode_mt(void *coder_ptr, const lzma_allocator *allocator, } // Return if the input didn't contain the whole Block. + // + // NOTE: When we updated coder->thr->in_filled a few lines + // above, the worker thread might by now have finished its + // work and returned itself back to the stack of free threads. if (coder->thr->in_filled < coder->thr->in_size) { assert(*in_pos == in_size); return LZMA_OK; @@ -1948,7 +1946,7 @@ stream_decoder_mt_init(lzma_next_coder *next, const lzma_allocator *allocator, // accounting from scratch, too. Changes in filter and block sizes may // affect number of threads. // - // FIXME? Reusing should be easy but unlike the single-threaded + // Reusing threads doesn't seem worth it. Unlike the single-threaded // decoder, with some types of input file combinations reusing // could leave quite a lot of memory allocated but unused (first // file could allocate a lot, the next files could use fewer From nobody Wed Jul 2 18:28:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXT1G38gkz60m0B; Wed, 02 Jul 2025 18:28: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 4bXT1G0hCGz3JHK; Wed, 02 Jul 2025 18:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhTzFMLjAO5o2415vgKsAYCekIJ1j3yl1bSgRCajboA=; b=lK2q6tkuqrqhLDwUuBDAAUu2DbYyk1rTz3HrTnfadBQXJ14/U6eLa8ickX63TpPJSg0dHq W8tgbSNhhx/BwQDObo46cF+t3sCnGfcSf7tLKWCB1hVpoYTMIgv0dIRxzM1bs9cWsyOgfo WYmdVdzl0hGk9Axqg7eIu5MP3n8fUqcWb/YNEuoJ6VhvVYEw3l9vnrEG98IOtgardspeXf BpGVI7cfm9czquK1LxolnF01AHpfQdjv5GUncthizN+mzpEDCPIF2nzf+ashMo0FQT0JQv RBrdAo07GszVlWZW5EsGmtzm6NP1NsQJ/ZTvVwsk7jBim9eR+fetZ0ijJqnn3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751480914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhTzFMLjAO5o2415vgKsAYCekIJ1j3yl1bSgRCajboA=; b=LbZ5YWLAmuKbgDdgyaYkNAFGjrXth045v1h8XbW8NWMfltc3uyZvu5aSUEYwXe8DK3NW2C pMNRLasfa93U5p5yslkawcr/N+eGQwjUfn7cQryVRYrvmonD7lAshjkq5THZtmkMfCdM7N zpfaymdq4jLzfDJSBEZgzEPqkDePOWRyYfIZ40mNOoN4lYNMxTS2dRex3pZTII6uJhHfTP d1m1hTKufCUPiWaWNglEKpaaHKqCPmmIiIUzyo5uiypuzUbBFR7sl1V5BZSRfdn0A5OAr4 /cBdhBL1y80lhvKTMEkx1Y/FnsMb8t18YFGiLaRPOdAJDthniRFKLEo6h24XAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751480914; a=rsa-sha256; cv=none; b=oDKDTSt8XqNJ6jn7D9NHACG+Ri913ca0o0ndgqs8eT0NSf8oUqBQAGulx7fY3f+vPDvcd8 l6SxfAvuFp1KMb3b9iGk+MB4ukUkf7HZcy/FSbvqpo6O9uZ51SqXk5D/cNeNzAOEAguURl VnKLe0yqMHEKQQGxL3Py9CDDofeYP9t3QmL0Uje3tfRVUMxHYA+3ubs4oVsG4yV/4w2iaJ Ces/DZ7dSjCRVyjsxYQAtMh/Y1xm0jOlrv3W4Q7ogs4ZCIepSTClOhYcA649PHNPnrnP6/ woYNjE1hnnNtiqmsnmmrLCtYeuDyXnP3feoW0IHhj3UD2rwmkyuRWmRX3otb9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXT1F66WRzVpQ; Wed, 02 Jul 2025 18:28: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 562ISX0N057890; Wed, 2 Jul 2025 18:28:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562ISXOA057887; Wed, 2 Jul 2025 18:28:33 GMT (envelope-from git) Date: Wed, 2 Jul 2025 18:28:33 GMT Message-Id: <202507021828.562ISXOA057887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 341d92aef027 - releng/13.5 - Add UPDATING entries and bump version. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 341d92aef027d903b37412363a111840afa290fc Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=341d92aef027d903b37412363a111840afa290fc commit 341d92aef027d903b37412363a111840afa290fc Author: Gordon Tetlow AuthorDate: 2025-07-02 06:01:59 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 06:01:59 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 14 ++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index b66ebfd5d8e8..b3f3eb5ef41d 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,20 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250702: + 13.5-RELEASE-p2 EN-25:09.libc + EN-25:10.zfs + EN-25:11.ena + SA-25:06.xz + + Fix dynamically-loaded C++ libraries crashing at exit [EN-25:09.libc] + + Fix corruption in ZFS replication streams from encrypted datasets [EN-25:10.zfs] + + Fix ena resets and kernel panic on Nitro v4 or newer instances [EN-25:11.ena] + + Fix use-after-free in multi-threaded xz decoder [SA-25:06.xz] + 20250410: 13.5-RELEASE-p1 EN-25:04.tzdata EN-25:05.expat diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 6c8ddd529845..5259f59649ff 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Jul 2 20:35:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXWqK0sCNz60sxd; Wed, 02 Jul 2025 20:35: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 4bXWqK0B5pz3GnD; Wed, 02 Jul 2025 20:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751488509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7r6RTaH96SHjDNHii8Wo433laJN7KHDsDZ5FHOA3nJA=; b=bz89ZYnCTjlLvqgN8BkjsJ/QFZOCrNUyQnyG88kSCDxujKZbfMW72jQaUJjs/jqGXmamb6 vGevIAeI8DNOW/UVXQrGnGlAIfieEaVm4NdZZURx0WTN9OpX+ng1U5dhXYUs12TztaQRFJ xBy0ow+af9SjDaenfs77xSLO58+ByRCWLaoOsv5TeB4FaawZLiTrBxg6oma3XsOmdPjJ5D ENyqDcIWo8pcxAY1ZpzK98iuE0FejWBMp40jaXQpGM2SuFib4k6CErL2VPN8QBt2FIXWOm b2910K9U7wl2dnAiRLM14r1Fs0Q0zVYr+IiRpaonzxWZr63Y8lPddg91eaJF/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751488509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7r6RTaH96SHjDNHii8Wo433laJN7KHDsDZ5FHOA3nJA=; b=CLbJlG/ywMBalFcbz3RwIRqZWeVKK5VHTUO43jp2PaVzVWmofeF3UXtP2kgLzAA3qmKfqG 0Z+Hm2duv35kFkPzw2eIUgXk8n+yqMYgdiIgEU74wXG73rrA2oFB82ODmLSsm9dOw0KSX8 nnCHXdFFbe7rGqeCSYlag/FuwY49wjybuXXKtGTMQGY1IG1SNeM4Fq5JP4h2Rcj+TMNiuL uQ1rfYez8eh9E0UobHhUsUYAL/MHxvxBHB5vU2d1JWLs1OuWl+oC68BMygVI2EJKsDO2SR 0MYcOLPtr/IiIzeOlPhiVwQPdJvkzWEr+q+tmFJbUh83ZXh7YdO9dyh4QiC3jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751488509; a=rsa-sha256; cv=none; b=U1OrSq4DUen8mtDO5NkaTCfitCMoFxDiWmysXntGzbeNE6P30bcDHCPQMHtjqwXgnettb0 oOoHrW2YOww+7JgVwoDJfLA84p0/7nUoRwKmyAFOQxALv7NH9k25awLa/BTVAnBqAgESSS FrUKeFc8toFafgRB6bCANgKqjQWhtrSqKbpM0pu0IaDXlrAl/C8ZgrgepQ+oLneifQDiFd iCtV6S0JNxEtTzRJOX/VnnCwmSW94+6YUioSgLgBNMgv1vWSE0Shw+VkCeqQX2VrhLxJEs xsGDN1bTfpUSYHNunC1O4omDZq+V31F8aRvPp6r09qB+YcE1DwTXkeZOah3wmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXWqJ6sB1zbmL; Wed, 02 Jul 2025 20:35: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 562KZ8R9002953; Wed, 2 Jul 2025 20:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 562KZ8F0002950; Wed, 2 Jul 2025 20:35:08 GMT (envelope-from git) Date: Wed, 2 Jul 2025 20:35:08 GMT Message-Id: <202507022035.562KZ8F0002950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 8d93877c013f - stable/14 - Add sys/stdarg.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8d93877c013fa3bc00b8b9841e545a941e80b2ca Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=8d93877c013fa3bc00b8b9841e545a941e80b2ca commit 8d93877c013fa3bc00b8b9841e545a941e80b2ca Author: Brooks Davis AuthorDate: 2025-07-02 20:24:45 +0000 Commit: Brooks Davis CommitDate: 2025-07-02 20:34:44 +0000 Add sys/stdarg.h While the type of va_list and implementation of va_*() psuedo functions varies (sometimes greatly) by architecture, they will always be defined by the compiler in a consistant way that does not require machine dependent handling. MFC after: 1 week Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 (cherry picked from commit 2d92a5abefc9cf6aa81fb7d23f8fcca4f1d6026d) --- include/Makefile | 4 ++-- sys/sys/stdarg.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/Makefile b/include/Makefile index f5985ebf091a..0ecf72177427 100644 --- a/include/Makefile +++ b/include/Makefile @@ -40,9 +40,9 @@ INCS= a.out.h ar.h assert.h bitstring.h byteswap.h \ .PATH: ${SRCTOP}/contrib/libc-vis INCS+= vis.h -MHDRS= float.h floatingpoint.h stdarg.h +MHDRS= float.h floatingpoint.h -PHDRS= _semaphore.h +PHDRS= _semaphore.h stdarg.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ syslog.h ucontext.h diff --git a/sys/sys/stdarg.h b/sys/sys/stdarg.h new file mode 100644 index 000000000000..d9266d12c7e1 --- /dev/null +++ b/sys/sys/stdarg.h @@ -0,0 +1,6 @@ +#ifndef __SYS_STDARG_H__ +#define __SYS_STDARG_H__ + +#include + +#endif /* __SYS_STDARG_H__ */ From nobody Thu Jul 3 01:27:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXfK55jTcz60xpy; Thu, 03 Jul 2025 01:27: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 4bXfK54ntyz41pk; Thu, 03 Jul 2025 01:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751506073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GpGStNOaM0ZyJMczKlj9c5hP+cZn8RMBBd/vt7X3ZOQ=; b=LbalOi758EdXAiGmlNkgXBDI4F6o1bWe48RqCeNBbjH85ltc7Z8wXkyN3Fhf/A9umNHH2q A785xr2NeunDuAzW+vm742OUDzcl/9RlFTOaxh14N9S3e/y+rJRvuTnj0A1zhJwjmDTTf9 /q8NJoJ3v/1i3PjiCSVb4IgVZVE4d74m+5HOZACuyg075PyP8xwZmtIVDM+XjF4ymWcpUl K/293m7hx/R4FOx1jXnFiz4jvGzmybY+9z2G6IBrrIJkZAiA02rmnaME0b1ltFg9rnbEiz q6vPn9xQwoWtSFIvwK/6Pei6T/ReH93uq8ZRlNDqUdOclnSj5UpOiJQz3XVf3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751506073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GpGStNOaM0ZyJMczKlj9c5hP+cZn8RMBBd/vt7X3ZOQ=; b=WLHfIp+/hnqu6/uaLdZoLZCUJBviz5T36UAXR7jr8KvC6/CEphIzPXZQt7BRgwsui5hGiN CiA4Yn93cIjHNcMuAglP0VjjZyUfooeFDy8xbrnv+EDPo1qFC8rx0R4kwbHUxR1gwT1FqN D8+noD+zlVr8UjOYQlbgVLyba6wC2eY3KXmzcb8415SzpaiWrDIvOVrb/dX4x22UyJkLMe Y0DwXcn5RW3hH36bGx160YSBmxoE5r6Vl/Xa+phslCWJFnPN62NqnXzS4DrYVrwrGQ2x53 c8FfvntBtm0I/oT48rYJkCrri5wjKgpaYsi1NDZDuMsgTMGML+d3KdWxKdjLBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751506073; a=rsa-sha256; cv=none; b=evSYrb50ZWY/bNMSkUgB/AV4OHnmuZrpD+tcwSy4QQrnmFp24rpTer0W2b+akRIVIixHZn aByTx8+PZ5Ybltst6odGkUm2MMDNLLY1Q8DNBGH2eBZVQv7nvYVr1nrDxPk327rdghoWjI F9vm3MtA2y5Ok7EHZ7KvN32moKNWWLQvXCFo2oRyV7aTeY03wY5643dk7EIX7l5Sl8xPnI J7pSbftthaCZ1WIlfWeYDgLupJrUADYYHwifLRwKezfrTuUF5+jpLvu5g0Pfq7KRoLGAB1 pwfNBcSNWgUY37mD2cV7bV9X8jI0UURC1Yax/VzEgNa61jXGnlGf4EFuMFmlkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXfK53m6CzkGY; Thu, 03 Jul 2025 01:27: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 5631RrGS049196; Thu, 3 Jul 2025 01:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5631RrGc049193; Thu, 3 Jul 2025 01:27:53 GMT (envelope-from git) Date: Thu, 3 Jul 2025 01:27:53 GMT Message-Id: <202507030127.5631RrGc049193@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: 0cc03e473ed7 - stable/14 - uchcom: add support for CH9102 and CH343 uarts List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0cc03e473ed74fb495c4ebe21d3ba2d92c5c4968 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=0cc03e473ed74fb495c4ebe21d3ba2d92c5c4968 commit 0cc03e473ed74fb495c4ebe21d3ba2d92c5c4968 Author: Kevin Lo AuthorDate: 2025-06-25 01:33:35 +0000 Commit: Kevin Lo CommitDate: 2025-07-03 01:26:06 +0000 uchcom: add support for CH9102 and CH343 uarts The CH343 devices support any baud rate up to 6 Mbps. PR: 272803 Reviewed by: imp Tested by: joerg, Tomasz "CeDeROM" CEDRO Differential Revision: https://reviews.freebsd.org/D46290 (cherry picked from commit 1395712cab8e95808064ba68c5a792b7cd0fe35f) --- share/man/man4/uchcom.4 | 27 +--- sys/dev/usb/serial/uchcom.c | 353 +++++++++++++++++++++++++------------------- sys/dev/usb/usbdevs | 4 +- 3 files changed, 208 insertions(+), 176 deletions(-) diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 index d5efe83286ba..4d395573589f 100644 --- a/share/man/man4/uchcom.4 +++ b/share/man/man4/uchcom.4 @@ -27,12 +27,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2017 +.Dd August 19, 2024 .Dt UCHCOM 4 .Os .Sh NAME .Nm uchcom -.Nd WinChipHead CH341/CH340 serial adapter driver +.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,22 +52,12 @@ uchcom_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the WinChipHead CH341/CH340 USB-to-RS-232 -Bridge chip. +driver provides support for the WinChipHead CH9102/CH343/CH341/CH340 +USB-to-RS-232 Bridge chip. .Pp -The device is accessed through the -.Xr ucom 4 -driver which makes it behave like a -.Xr tty 4 . -.Sh HARDWARE -The -.Nm -driver supports the following adapters: -.Pp -.Bl -bullet -compact -.It -HL USB-RS232 -.El +The datasheets for the CH340/CH341 list the maximum +supported baud rate as 2,000,000. +CH9102/CH343 devices support any baud rate up to 6 Mbps. .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* @@ -95,6 +85,3 @@ The first .Fx release to include it was .Fx 8.0 . -.Sh BUGS -Actually, this chip seems unable to drive other than 8 data bits and -1 stop bit line. diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c index a886b25c89d7..fdc5515fa722 100644 --- a/sys/dev/usb/serial/uchcom.c +++ b/sys/dev/usb/serial/uchcom.c @@ -58,8 +58,7 @@ */ /* - * Driver for WinChipHead CH341/340, the worst USB-serial chip in the - * world. + * Driver for WinChipHead CH9102/343/341/340. */ #include @@ -101,17 +100,19 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, &uchcom_debug, 0, "uchcom debug level"); #endif -#define UCHCOM_IFACE_INDEX 0 -#define UCHCOM_CONFIG_INDEX 0 +#define UCHCOM_IFACE_INDEX 0 +#define UCHCOM_CONFIG_INDEX 0 +#define UCHCOM_SECOND_IFACE_INDEX 1 #define UCHCOM_REV_CH340 0x0250 #define UCHCOM_INPUT_BUF_SIZE 8 -#define UCHCOM_REQ_GET_VERSION 0x5F -#define UCHCOM_REQ_READ_REG 0x95 -#define UCHCOM_REQ_WRITE_REG 0x9A -#define UCHCOM_REQ_RESET 0xA1 -#define UCHCOM_REQ_SET_DTRRTS 0xA4 +#define UCHCOM_REQ_GET_VERSION 0x5F +#define UCHCOM_REQ_READ_REG 0x95 +#define UCHCOM_REQ_WRITE_REG 0x9A +#define UCHCOM_REQ_RESET 0xA1 +#define UCHCOM_REQ_SET_DTRRTS 0xA4 +#define UCHCOM_REQ_CH343_WRITE_REG 0xA8 #define UCHCOM_REG_STAT1 0x06 #define UCHCOM_REG_STAT2 0x07 @@ -134,13 +135,21 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define UCHCOM_RTS_MASK 0x40 #define UCHCOM_BRK_MASK 0x01 +#define UCHCOM_ABRK_MASK 0x10 +#define UCHCOM_CH343_BRK_MASK 0x80 #define UCHCOM_LCR1_MASK 0xAF #define UCHCOM_LCR2_MASK 0x07 #define UCHCOM_LCR1_RX 0x80 #define UCHCOM_LCR1_TX 0x40 #define UCHCOM_LCR1_PARENB 0x08 +#define UCHCOM_LCR1_CS5 0x00 +#define UCHCOM_LCR1_CS6 0x01 +#define UCHCOM_LCR1_CS7 0x02 #define UCHCOM_LCR1_CS8 0x03 +#define UCHCOM_LCR1_STOPB 0x04 +#define UCHCOM_LCR1_PARODD 0x00 +#define UCHCOM_LCR1_PAREVEN 0x10 #define UCHCOM_LCR2_PAREVEN 0x07 #define UCHCOM_LCR2_PARODD 0x06 #define UCHCOM_LCR2_PARMARK 0x05 @@ -150,12 +159,18 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define UCHCOM_INTR_STAT2 0x03 #define UCHCOM_INTR_LEAST 4 -#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ +#define UCHCOM_T 0x08 +#define UCHCOM_CL 0x04 +#define UCHCOM_CH343_CT 0x80 +#define UCHCOM_CT 0x90 + +#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ + +#define TYPE_CH343 1 enum { UCHCOM_BULK_DT_WR, UCHCOM_BULK_DT_RD, - UCHCOM_INTR_DT_RD, UCHCOM_N_TRANSFER, }; @@ -164,6 +179,7 @@ struct uchcom_softc { struct ucom_softc sc_ucom; struct usb_xfer *sc_xfer[UCHCOM_N_TRANSFER]; + struct usb_xfer *sc_intr_xfer; /* Interrupt endpoint */ struct usb_device *sc_udev; struct mtx sc_mtx; @@ -171,39 +187,19 @@ struct uchcom_softc { uint8_t sc_rts; /* local copy */ uint8_t sc_version; uint8_t sc_msr; - uint8_t sc_lsr; /* local status register */ -}; - -struct uchcom_divider { - uint8_t dv_prescaler; - uint8_t dv_div; - uint8_t dv_mod; -}; - -struct uchcom_divider_record { - uint32_t dvr_high; - uint32_t dvr_low; - uint32_t dvr_base_clock; - struct uchcom_divider dvr_divider; -}; - -static const struct uchcom_divider_record dividers[] = -{ - {307200, 307200, UCHCOM_BASE_UNKNOWN, {7, 0xD9, 0}}, - {921600, 921600, UCHCOM_BASE_UNKNOWN, {7, 0xF3, 0}}, - {2999999, 23530, 6000000, {3, 0, 0}}, - {23529, 2942, 750000, {2, 0, 0}}, - {2941, 368, 93750, {1, 0, 0}}, - {367, 1, 11719, {0, 0, 0}}, + uint8_t sc_lsr; /* local status register */ + uint8_t sc_chiptype; /* type of chip */ + uint8_t sc_ctrl_iface_no; + uint8_t sc_iface_index; }; -#define NUM_DIVIDERS nitems(dividers) - static const STRUCT_USB_HOST_ID uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_3, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH343SER, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH9102SER, 0)}, }; /* protypes */ @@ -225,8 +221,9 @@ static void uchcom_update_version(struct uchcom_softc *); static void uchcom_convert_status(struct uchcom_softc *, uint8_t); static void uchcom_update_status(struct uchcom_softc *); static void uchcom_set_dtr_rts(struct uchcom_softc *); -static int uchcom_calc_divider_settings(struct uchcom_divider *, uint32_t); -static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t); +static void uchcom_calc_baudrate(struct uchcom_softc *, uint32_t, uint8_t *, + uint8_t *); +static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t, uint16_t); static void uchcom_poll(struct ucom_softc *ucom); static device_probe_t uchcom_probe; @@ -244,7 +241,7 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UCHCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = {.pipe_bof = 1,}, .callback = &uchcom_write_callback, }, @@ -256,8 +253,10 @@ static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = &uchcom_read_callback, }, +}; - [UCHCOM_INTR_DT_RD] = { +static const struct usb_config uchcom_intr_config_data[1] = { + [0] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -311,8 +310,9 @@ uchcom_attach(device_t dev) { struct uchcom_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); + struct usb_interface *iface; + struct usb_interface_descriptor *id; int error; - uint8_t iface_index; DPRINTFN(11, "\n"); @@ -330,20 +330,49 @@ uchcom_attach(device_t dev) case USB_PRODUCT_WCH2_CH341SER_3: device_printf(dev, "CH341 detected\n"); break; + case USB_PRODUCT_WCH2_CH343SER: + device_printf(dev, "CH343 detected\n"); + break; + case USB_PRODUCT_WCH2_CH9102SER: + device_printf(dev, "CH9102 detected\n"); + break; default: - device_printf(dev, "New CH340/CH341 product 0x%04x detected\n", - uaa->info.idProduct); + device_printf(dev, "New CH340/CH341/CH343/CH9102 product " + "0x%04x detected\n", uaa->info.idProduct); break; } - iface_index = UCHCOM_IFACE_INDEX; - error = usbd_transfer_setup(uaa->device, - &iface_index, sc->sc_xfer, uchcom_config_data, - UCHCOM_N_TRANSFER, sc, &sc->sc_mtx); + /* CH343/CH9102 has two interfaces. */ + sc->sc_ctrl_iface_no = uaa->info.bIfaceNum; + iface = usbd_get_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX); + if (iface) { + id = usbd_get_interface_descriptor(iface); + if (id == NULL) { + device_printf(dev, "no interface descriptor\n"); + goto detach; + } + sc->sc_iface_index = UCHCOM_SECOND_IFACE_INDEX; + usbd_set_parent_iface(uaa->device, UCHCOM_SECOND_IFACE_INDEX, + uaa->info.bIfaceIndex); + sc->sc_chiptype = TYPE_CH343; + } else { + sc->sc_iface_index = UCHCOM_IFACE_INDEX; + } + + /* Setup all transfers. */ + error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index, + sc->sc_xfer, uchcom_config_data, UCHCOM_N_TRANSFER, sc, + &sc->sc_mtx); + if (error) { + device_printf(dev, "could not allocate all pipes\n"); + goto detach; + } + error = usbd_transfer_setup(uaa->device, &sc->sc_ctrl_iface_no, + &sc->sc_intr_xfer, uchcom_intr_config_data, 1, sc, &sc->sc_mtx); if (error) { - DPRINTF("one or more missing USB endpoints, " - "error=%s\n", usbd_errstr(error)); + device_printf(dev, "allocating USB transfers failed for " + "interrupt\n"); goto detach; } @@ -449,7 +478,9 @@ uchcom_write_reg(struct uchcom_softc *sc, (unsigned)reg1, (unsigned)val1, (unsigned)reg2, (unsigned)val2); uchcom_ctrl_write( - sc, UCHCOM_REQ_WRITE_REG, + sc, + (sc->sc_chiptype != TYPE_CH343) ? + UCHCOM_REQ_WRITE_REG : UCHCOM_REQ_CH343_WRITE_REG, reg1 | ((uint16_t)reg2 << 8), val1 | ((uint16_t)val2 << 8)); } @@ -516,9 +547,6 @@ uchcom_update_version(struct uchcom_softc *sc) static void uchcom_convert_status(struct uchcom_softc *sc, uint8_t cur) { - sc->sc_dtr = !(cur & UCHCOM_DTR_MASK); - sc->sc_rts = !(cur & UCHCOM_RTS_MASK); - cur = ~cur & 0x0F; sc->sc_msr = (cur << 4) | ((sc->sc_msr >> 4) ^ cur); } @@ -555,78 +583,69 @@ uchcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff) uint8_t brk1; uint8_t brk2; - uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, &brk2); - if (onoff) { - /* on - clear bits */ - brk1 &= ~UCHCOM_BRK_MASK; - brk2 &= ~UCHCOM_LCR1_TX; + if (sc->sc_chiptype == TYPE_CH343) { + brk1 = UCHCOM_CH343_BRK_MASK; + if (!onoff) + brk1 |= UCHCOM_ABRK_MASK; + uchcom_write_reg(sc, brk1, 0, 0, 0); } else { - /* off - set bits */ - brk1 |= UCHCOM_BRK_MASK; - brk2 |= UCHCOM_LCR1_TX; + uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, + &brk2); + if (onoff) { + /* on - clear bits */ + brk1 &= ~UCHCOM_BRK_MASK; + brk2 &= ~UCHCOM_LCR1_TX; + } else { + /* off - set bits */ + brk1 |= UCHCOM_BRK_MASK; + brk2 |= UCHCOM_LCR1_TX; + } + uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, + brk2); } - uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, brk2); } -static int -uchcom_calc_divider_settings(struct uchcom_divider *dp, uint32_t rate) -{ - const struct uchcom_divider_record *rp; - uint32_t div; - uint32_t rem; - uint32_t mod; - uint8_t i; - - /* find record */ - for (i = 0; i != NUM_DIVIDERS; i++) { - if (dividers[i].dvr_high >= rate && - dividers[i].dvr_low <= rate) { - rp = ÷rs[i]; - goto found; - } - } - return (-1); - -found: - dp->dv_prescaler = rp->dvr_divider.dv_prescaler; - if (rp->dvr_base_clock == UCHCOM_BASE_UNKNOWN) - dp->dv_div = rp->dvr_divider.dv_div; - else { - div = rp->dvr_base_clock / rate; - rem = rp->dvr_base_clock % rate; - if (div == 0 || div >= 0xFF) - return (-1); - if ((rem << 1) >= rate) - div += 1; - dp->dv_div = (uint8_t)-div; +static void +uchcom_calc_baudrate(struct uchcom_softc *sc, uint32_t rate, uint8_t *divisor, + uint8_t *factor) +{ + uint32_t clk = 12000000; + + if (rate >= 256000 && sc->sc_chiptype == TYPE_CH343) + *divisor = 7; + else if (rate > 23529) { + clk /= 2; + *divisor = 3; + } else if (rate > 2941) { + clk /= 16; + *divisor = 2; + } else if (rate > 367) { + clk /= 128; + *divisor = 1; + } else { + clk = 11719; + *divisor = 0; } - mod = (UCHCOM_BPS_MOD_BASE / rate) + UCHCOM_BPS_MOD_BASE_OFS; - mod = mod + (mod / 2); + *factor = 256 - clk / rate; - dp->dv_mod = (mod + 0xFF) / 0x100; - - return (0); + if (rate == 921600 && sc->sc_chiptype != TYPE_CH343) { + *divisor = 7; + *factor = 243; + } } static void -uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate) +uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate, uint16_t lcr) { - struct uchcom_divider dv; + uint16_t idx; + uint8_t factor, div; - if (uchcom_calc_divider_settings(&dv, rate)) - return; + uchcom_calc_baudrate(sc, rate, &div, &factor); + div |= (sc->sc_chiptype != TYPE_CH343) ? 0x80 : 0x00; + idx = (factor << 8) | div; - /* - * According to linux code we need to set bit 7 of UCHCOM_REG_BPS_PRE, - * otherwise the chip will buffer data. - */ - uchcom_write_reg(sc, - UCHCOM_REG_BPS_PRE, dv.dv_prescaler | 0x80, - UCHCOM_REG_BPS_DIV, dv.dv_div); - uchcom_write_reg(sc, - UCHCOM_REG_BPS_MOD, dv.dv_mod, - UCHCOM_REG_BPS_PAD, 0); + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, lcr, idx); } /* ---------------------------------------------------------------------- @@ -673,6 +692,14 @@ uchcom_cfg_open(struct ucom_softc *ucom) DPRINTF("\n"); + if (sc->sc_chiptype != TYPE_CH343) { + /* Set default configuration. */ + uchcom_get_version(sc, NULL); + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); + uchcom_write_reg(sc, UCHCOM_REG_BPS_PRE, 0x82, + UCHCOM_REG_BPS_DIV, 0xd9); + uchcom_write_reg(sc, 0x2c, 0x07, UCHCOM_REG_BPS_PAD, 0); + } uchcom_update_version(sc); uchcom_update_status(sc); } @@ -680,53 +707,69 @@ uchcom_cfg_open(struct ucom_softc *ucom) static int uchcom_pre_param(struct ucom_softc *ucom, struct termios *t) { - struct uchcom_divider dv; + struct uchcom_softc *sc = ucom->sc_parent; - switch (t->c_cflag & CSIZE) { - case CS8: + /* + * Check requested baud rate. + * The CH340/CH341 can set any baud rate up to 2Mb. + * The CH9102/CH343 can set any baud rate up to 6Mb. + */ + switch (sc->sc_chiptype) { + case TYPE_CH343: + if (t->c_ospeed <= 6000000) + return (0); break; default: - return (EIO); + if (t->c_ospeed <= 2000000) + return (0); + break; } - if ((t->c_cflag & CSTOPB) != 0) - return (EIO); - if ((t->c_cflag & PARENB) != 0) - return (EIO); - if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) { - return (EIO); - } - return (0); /* success */ + return (EIO); } static void uchcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { struct uchcom_softc *sc = ucom->sc_parent; + uint8_t lcr; - uchcom_get_version(sc, NULL); - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); - uchcom_set_baudrate(sc, t->c_ospeed); - if (sc->sc_version < UCHCOM_VER_30) { - uchcom_read_reg(sc, UCHCOM_REG_LCR1, NULL, - UCHCOM_REG_LCR2, NULL); - uchcom_write_reg(sc, UCHCOM_REG_LCR1, 0x50, - UCHCOM_REG_LCR2, 0x00); - } else { - /* - * Set up line control: - * - enable transmit and receive - * - set 8n1 mode - * To do: support other sizes, parity, stop bits. - */ - uchcom_write_reg(sc, - UCHCOM_REG_LCR1, - UCHCOM_LCR1_RX | UCHCOM_LCR1_TX | UCHCOM_LCR1_CS8, - UCHCOM_REG_LCR2, 0x00); + lcr = UCHCOM_LCR1_RX | UCHCOM_LCR1_TX; + + if (t->c_cflag & CSTOPB) + lcr |= UCHCOM_LCR1_STOPB; + + if (t->c_cflag & PARENB) { + lcr |= UCHCOM_LCR1_PARENB; + if (t->c_cflag & PARODD) + lcr |= UCHCOM_LCR1_PARODD; + else + lcr |= UCHCOM_LCR1_PAREVEN; } - uchcom_update_status(sc); - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a); - uchcom_set_baudrate(sc, t->c_ospeed); + + switch (t->c_cflag & CSIZE) { + case CS5: + lcr |= UCHCOM_LCR1_CS5; + break; + case CS6: + lcr |= UCHCOM_LCR1_CS6; + break; + case CS7: + lcr |= UCHCOM_LCR1_CS7; + break; + case CS8: + default: + lcr |= UCHCOM_LCR1_CS8; + break; + } + + if (sc->sc_chiptype == TYPE_CH343) + uchcom_set_baudrate(sc, t->c_ospeed, + UCHCOM_T | UCHCOM_CL | UCHCOM_CH343_CT | lcr << 8); + else + uchcom_set_baudrate(sc, t->c_ospeed, + UCHCOM_T | UCHCOM_CL | UCHCOM_CT | lcr << 8); + uchcom_set_dtr_rts(sc); uchcom_update_status(sc); } @@ -737,7 +780,7 @@ uchcom_start_read(struct ucom_softc *ucom) struct uchcom_softc *sc = ucom->sc_parent; /* start interrupt endpoint */ - usbd_transfer_start(sc->sc_xfer[UCHCOM_INTR_DT_RD]); + usbd_transfer_start(sc->sc_intr_xfer); /* start read endpoint */ usbd_transfer_start(sc->sc_xfer[UCHCOM_BULK_DT_RD]); @@ -749,7 +792,7 @@ uchcom_stop_read(struct ucom_softc *ucom) struct uchcom_softc *sc = ucom->sc_parent; /* stop interrupt endpoint */ - usbd_transfer_stop(sc->sc_xfer[UCHCOM_INTR_DT_RD]); + usbd_transfer_stop(sc->sc_intr_xfer); /* stop read endpoint */ usbd_transfer_stop(sc->sc_xfer[UCHCOM_BULK_DT_RD]); @@ -779,7 +822,8 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) { struct uchcom_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint8_t buf[UCHCOM_INTR_LEAST]; + uint32_t intrstat; + uint8_t buf[16]; int actlen; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -791,13 +835,12 @@ uchcom_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (actlen >= UCHCOM_INTR_LEAST) { pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_out(pc, 0, buf, UCHCOM_INTR_LEAST); + usbd_copy_out(pc, 0, buf, sizeof(buf)); - DPRINTF("data = 0x%02X 0x%02X 0x%02X 0x%02X\n", - (unsigned)buf[0], (unsigned)buf[1], - (unsigned)buf[2], (unsigned)buf[3]); + intrstat = (sc->sc_chiptype == TYPE_CH343) ? + actlen - 1 : UCHCOM_INTR_STAT1; - uchcom_convert_status(sc, buf[UCHCOM_INTR_STAT1]); + uchcom_convert_status(sc, buf[intrstat]); ucom_status_change(&sc->sc_ucom); } case USB_ST_SETUP: diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 856ff526fa45..a7519c1e7fe5 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4976,9 +4976,11 @@ product WAVESENSE JAZZ 0xaaaa Jazz blood glucose meter product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge product WCH2 DUMMY 0x0000 Dummy product product WCH2 CH341SER_2 0x5523 CH341/CH340 USB-Serial Bridge +product WCH2 CH343SER 0x55d3 CH343 USB Serial +product WCH2 CH9102SER 0x55d4 CH9102 USB Serial product WCH2 CH341SER_3 0x7522 CH341/CH340 USB-Serial Bridge product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge -product WCH2 U2M 0X752d CH345 USB2.0-MIDI +product WCH2 U2M 0x752d CH345 USB2.0-MIDI /* West Mountain Radio products */ product WESTMOUNTAIN RIGBLASTER_ADVANTAGE 0x0003 RIGblaster Advantage From nobody Fri Jul 4 04:57:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYLwh088Lz60jJf; Fri, 04 Jul 2025 04:57: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 4bYLwg6mgxz3rWS; Fri, 04 Jul 2025 04:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqxKAf5PWn5ZWfD18xKJ7vL5gRjB4eRuDEC4bCXqQ4Q=; b=FxV34GdAXRDZANf1f9IhZyG5iZi+te2F2yYngF1LGJX114+uBjAaXHNjPQsxEA04ytCsht n8xJk5BpI7BsU+GEZdSvpDHK+HY843GigQWFY+o/bf/ZWzcOnR9RXa+jZ6QchvxFRZ/HYX O1IVLUzjFTPBhlhU460P/plgfgefkEiFtdaLjiFxpcx+NyIfpElTQVny/ZuBdZpKvDRjEe QHyTPOpKyrNziXNeYgIEfCdwKbqVT+P4ZO1U1ex39xHWDPZ8BQ4Jy3xvy7qBQg4XNez9Eo EKUZrGkpMLFiorWB/vTPEUhHFDVr/Hg2mtSHjGS3Ke6Nfl4fgYmdG0QFjficgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqxKAf5PWn5ZWfD18xKJ7vL5gRjB4eRuDEC4bCXqQ4Q=; b=nrbBpyswNhuvTPzeE7NKtIcaxH7D5Ic4kuqPkOgZdLiOaGZf4EPfpEnSNmyn2zIuLkG82K 1Ioebkw4GWP1ApQoNQb/IM7PlugxWdwfS/WmJZLPnSeeVxUg6gGKSGtx85S0FIimZ7cg3G lfDmA/EiKTlPp42O4jToghsCi4W/P4l3yO+VrEA06rq0hVAw4+IRW2MjtndaaCOxiI4zuY drcJq2jZiVHXu/F6g+KfFKTsYsRF17qaWYJPQNjaMxM2fHMrf7ojRchcIBKKwqrYJpFnMO TjVimmfQ0rzvCrtvFsAGRJW5XtV5jWMUUrWM1SkAggsUtHAye+k9E5zCcWs/Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751605059; a=rsa-sha256; cv=none; b=LkwU6bch7XpCBgNhyeVYxPOW0gq7y5ZkDdornuj1qET6OlMWLeWjT8tHgIbA9g2oabk3vd JYlIZydweIsWH9OHUyYXE0g8hbHhu8vjm63MI4JaM/l2vsts0qmOMcWSZvRY1WZVhu27zC 1GMG9iu4lDCIydKmU6rpA5Y5L7OmBgsD0u8rcjz09aPhAmNFFVw9QRhx7cgQOzZA625LLc lzhITsaklDoPTSxG9abnItakATbjo3VwJDjGDY/boxmFlsutA6qNR8Gy2HdN2HsE3559Ju F1TjVbtCpTAm13LTtX0q9y7jp7l2lHSfToddvFFquIvhjqNOd5VmUlaTfJgAUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYLwg69bJzc3m; Fri, 04 Jul 2025 04:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5644vd4X050100; Fri, 4 Jul 2025 04:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5644vdb0050097; Fri, 4 Jul 2025 04:57:39 GMT (envelope-from git) Date: Fri, 4 Jul 2025 04:57:39 GMT Message-Id: <202507040457.5644vdb0050097@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: b6fb125330dd - stable/14 - amd64: express KV4ADDR() using KV5ADDR() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b6fb125330dd4c079ebb734e97e7378e30fc2c89 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b6fb125330dd4c079ebb734e97e7378e30fc2c89 commit b6fb125330dd4c079ebb734e97e7378e30fc2c89 Author: Konstantin Belousov AuthorDate: 2025-06-15 21:12:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-04 04:57:00 +0000 amd64: express KV4ADDR() using KV5ADDR() (cherry picked from commit 2b09d177bd058ae1d8e03e1d65cf82ab351ae011) --- sys/amd64/include/pmap.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 7ef826c19fe7..76cc122d6b8a 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -113,12 +113,7 @@ * Pte related macros. This is complicated by having to deal with * the sign extension of the 48th bit. */ -#define KV4ADDR(l4, l3, l2, l1) ( \ - ((unsigned long)-1 << 47) | \ - ((unsigned long)(l4) << PML4SHIFT) | \ - ((unsigned long)(l3) << PDPSHIFT) | \ - ((unsigned long)(l2) << PDRSHIFT) | \ - ((unsigned long)(l1) << PAGE_SHIFT)) +#define KV4ADDR(l4, l3, l2, l1) KV5ADDR(-1, l4, l3, l2, l1) #define KV5ADDR(l5, l4, l3, l2, l1) ( \ ((unsigned long)-1 << 56) | \ ((unsigned long)(l5) << PML5SHIFT) | \ From nobody Fri Jul 4 04:57:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYLwj0kH8z60hnk; Fri, 04 Jul 2025 04:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYLwh6ntQz3rG6; Fri, 04 Jul 2025 04:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aJoFGauCBeNklQf2wuQkDop/PmP7SFzVWHi+8mAKJ9Q=; b=TU4mH9KjpILqWFfjtUQh9kZz+pOhaFCs9/WXgW2PGXtgLp3uPRh+HJ1zrcE/lUSkRcn3xs NWfuEYg0d7A9ZzwkzHNnnZCv1tb4P44hiue/ALWu2NDkXqnxgOMcxNgiTkktVHXnlOw0m2 hhaJ5bocfn4XHg/T69nWO2ohaOP+4BfX38b3gSmFVRdDuAXYmg8CLucsqUZl/tZ3tpgO+z EDkfvczwdQZAsnsQflU2kAm4/CLpc5wvdXO7ZelKz3JM5sMwbbNHLq052AI0/JQUvLQCVL +Mwf+t+uPozpkTnEnSxFx9H+bm9SKlHKSgDLNiY7/P8HjUi9UhHumo+RDrFJwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aJoFGauCBeNklQf2wuQkDop/PmP7SFzVWHi+8mAKJ9Q=; b=XtDpOhMkhFgqHM6P0vdDiGb/V3ewQ++xluPQujOiHNCM6CpiuootAdukp42Z0ZizzgzUl4 vS8wP351xs8axc6I3k3oAFdtanuH/ya/udkMQ1dN3IfoiFa/Iz8Qrb04t5rNAfcq1q9/KC 4vRLAh0FGcC4M8lda5UMfA5xeUTSEVnc/v20xUzosRYBAuz0h2FiPGmqT8ftuIXGzqn4WP 5TfMHTq6TyBVz5zotodHqGyWwC6Z4I+PIKOAgE1g+xOLIueRN13lWN7V3vxj+4+kZ2VD7l vPeyHUtR6xakoy1UPxIh65pboA3Y6cFOHEg9fNs4VEOCpgvvAJh73FUuNYU4kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751605060; a=rsa-sha256; cv=none; b=b+gXPDdPGytmU6rHySYNqE3r6qSmHIqiOuhVP4rZ2DIsa1SM/VXJWOW51LuRITS04W8CMe 6O194EOzJ2OQqJpQ0mZ3x5WojHqg5y51cdsdf4vxqAmyzXW1iPzKGsNq0+BV4L/h9o3Mkp JMN+odtITOz0pl26chVzLR9WqdAYdK3Fb79ZwmEhumgb46s7THJmjIf297ogv3CX1TLNXw keePWE85l+daq+p7XTj1rWfjLcmr1kAIhZR5BVqAc1pXOchiW/0BMaVcKCnF6VA4AFm/// Wpk0Z9Az/WVkaCEgqf/1Q6fZG1jd4PJuagVsPCPXpiaO4gTtOeghPtyl0XUAUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYLwh6JmXzcdd; Fri, 04 Jul 2025 04:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5644vep3050136; Fri, 4 Jul 2025 04:57:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5644veUm050133; Fri, 4 Jul 2025 04:57:40 GMT (envelope-from git) Date: Fri, 4 Jul 2025 04:57:40 GMT Message-Id: <202507040457.5644veUm050133@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: 9f685f4f2f93 - stable/14 - amd64: remove dmapbase, dmapend symbols List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f685f4f2f930316f04ab180843e342897034dc4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9f685f4f2f930316f04ab180843e342897034dc4 commit 9f685f4f2f930316f04ab180843e342897034dc4 Author: Konstantin Belousov AuthorDate: 2025-06-19 21:03:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-04 04:57:01 +0000 amd64: remove dmapbase, dmapend symbols (cherry picked from commit 96f6283cc7af8342fd7965f3791d22352a028022) --- sys/amd64/amd64/locore.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 4d10879d9f30..29fbf38cea33 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -40,11 +40,9 @@ /* * Compiled KERNBASE location */ - .globl kernbase, kernload, dmapbase, dmapend + .globl kernbase, kernload .set kernbase,KERNBASE .set kernload,KERNLOAD - .set dmapbase,DMAP_MIN_ADDRESS - .set dmapend,DMAP_MAX_ADDRESS #define BOOTSTACK_SIZE (PAGE_SIZE * KSTACK_PAGES) From nobody Fri Jul 4 04:57:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYLwk3Ztfz60hnn; Fri, 04 Jul 2025 04:57: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 4bYLwk0MySz3rNN; Fri, 04 Jul 2025 04:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9z6SGkKj2MpcoZByk3Vm2Lf+uVFEaZoWXZHA8xw0J6o=; b=tnu8PclZlUNM6XrIwzyUw6RBQhdqiXZJRSfFC+TeezCS9VAFp01NOhorekOx1zVJNLfQbt LaPFrm1qtAIA8J5NzAjmRGwZFgjmmfkSmP3moIVWOGTuE64kgVek4JBjuHKMAUKHitT761 IXsIC2hjuIPo+2Q5FS0wclpKLL7BVdHEJ9vQ1EIlQDZOMRLiJ3/1cH3Nr5pgeJYGTo64pM zrbYkEC3D6APgKH2MRcaRn6jCWyd4PlU0BVQZor8lH1m4ZVCObHfW6oQt0wbY9ZHDdpLcq W1FUKwa58tEcxigplDhEddc3Uzti8stUGxyHfJtsbN4yExh5+7twdI6v9BkJ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9z6SGkKj2MpcoZByk3Vm2Lf+uVFEaZoWXZHA8xw0J6o=; b=D5kZvOHMdLPmhxUAlYafv1ueWGkbsNvIfh1DtvTvsb+IFJHT/OQ/LOXlKHV8pJtNpJqzBV lAtT25vfyzs+3zg/1hVHxEr4+ya8CvmUfnTUAIoXbeK7TyYYAVMcQSyliLvhI4segaHwx/ 70Mx2QgzwSW/D9C/NxbEDujmDK8kqL0Ziq8HJb2dQ79C5B2lxMLlBr4o+9bYCcCzcWQtCB VGtsaKPQd0CUIGFKiHzw/CMXgphYFk6spcEY/wnkTrjOPRjODBqTIfy78jO1MowueqNOid OsSvr3YVkdN2CWcYKuYwDeKgg596YoxsYVBE6weubOB1LenhaYnf+3yvc7cZdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751605062; a=rsa-sha256; cv=none; b=iNi8+A6QokHpOeklZ5QSAQWGlZFyURbtKp47jiIyPaE6zmHjSHPRuwWivITO+NxL2/IrIB fveoZFm3Q9HSvAZ6kr/Ibg66755dSG7wStef3k8+8qhnZUw/QyJexdnbFSydTDn4G2ECr3 00BgFjp/701vV0fIdaHLjp0dZGaKzGlPR3Tc97CaXaEKjPT9rSciWudKOiEruRT/jhlCE9 b4Ic+WTgAYWXK0L/x0KXlOupSS9Gq/Cen+ihPlw88N5PES/e1y6k4iL3Ps4U3AUrhmEBuZ AxzdYIZXKYtla0BHUxlQ+DI3bsN1KjQubWeBMhADJYgUvP5PO4W6vSh6dHx7Nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYLwj70J7zcNm; Fri, 04 Jul 2025 04:57: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 5644vf4B050170; Fri, 4 Jul 2025 04:57:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5644vfvk050167; Fri, 4 Jul 2025 04:57:41 GMT (envelope-from git) Date: Fri, 4 Jul 2025 04:57:41 GMT Message-Id: <202507040457.5644vfvk050167@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: 0e33dd60f617 - stable/14 - amd64: eliminate asm symbols DMAP_MIN/MAX_ADDRESS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e33dd60f617bd2386f7600dd60283d29e6e9d28 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0e33dd60f617bd2386f7600dd60283d29e6e9d28 commit 0e33dd60f617bd2386f7600dd60283d29e6e9d28 Author: Konstantin Belousov AuthorDate: 2025-06-19 21:17:38 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-04 04:57:02 +0000 amd64: eliminate asm symbols DMAP_MIN/MAX_ADDRESS (cherry picked from commit 3d1b33d9233936efbdd819c55d75569db1dd8690) --- sys/amd64/amd64/genassym.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c index 214ad494639c..a0cf9649e423 100644 --- a/sys/amd64/amd64/genassym.c +++ b/sys/amd64/amd64/genassym.c @@ -112,8 +112,6 @@ ASSYM(val_PML4PML4I, PML4PML4I); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(KERNBASE, KERNBASE); ASSYM(KERNLOAD, KERNLOAD); -ASSYM(DMAP_MIN_ADDRESS, DMAP_MIN_ADDRESS); -ASSYM(DMAP_MAX_ADDRESS, DMAP_MAX_ADDRESS); ASSYM(KSTACK_PAGES, KSTACK_PAGES); ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15)); From nobody Fri Jul 4 04:57:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYLwm22Hrz60jP4; Fri, 04 Jul 2025 04:57: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 4bYLwl2wzfz3rKx; Fri, 04 Jul 2025 04:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2xueEsRfWqTxJECZPdSFh8gFIMhFQ9zG/csgTP8Sw0=; b=K6/cxJDAWfM1f+nLFp3gTDY/ukQdStRGg0l4qh9zZW1/iSmBl3u/45nLd+rOI86YFjJEM6 adGl5kdfsDZF81gE16nYrnAeNL+QQm0o6aUQJ6MTDuzQlVpbMoYCVq0bjsjeFo8J94syAg y6yIHlcGbxETH+bCsn9U+dTaiXZaRGNppOfvBtP2tChZki3Bq0gvmOz0alHGS7q4Xhr2I2 oKLovKkjV8R2VlS88pLVy4JZ1iz5D2AfQLTLtLymjtoZ+aarpHZv8EDfmVS61YU6Fgtcvf s6tpdbUJd3cAW4o8R7iDBv7KBx9PkHsVeEQYrV1HmV7EZgRlD6ZnUFNFALpfFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2xueEsRfWqTxJECZPdSFh8gFIMhFQ9zG/csgTP8Sw0=; b=cE9hJP+322CwDEnkgywiSxvlDan+sRhNym2J9RZb1DHkFKkTFrKqi2CyNAPu2Xo9BrvZxE l0CgoWyO753kDJcgd9c6+pnzBCoh3wghUxc/qBdRZMCg3Kqy7DGyQoYCrDs5aeE4o47tRH MePwFKJWb+jVsqOKrtBJabF0lJugTiopM1iEjqXQzhhCAmMVpY/Tg7OWsvDYSn724M35Ym NdNGlbTuzSnr/Mgzci2vrOB2yhQnw+YO5GhzbieU0KgTl5bCiRn6sYtUt20riRjW3IUytK DRW3mzN9x1mpnoC3t2Be4uhBwlgE3kVTWp0MkZdWLrjWmVpifug+A5LMEgqkIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751605063; a=rsa-sha256; cv=none; b=xHkfleJoPs8ULMOOZaZdATKGqzGB23hoiACWuVExsE3tgLKnIkYYp33EtTHnCCL4Pcmb4/ LJUUOCnrESjFRd6ARI4DlrZeKNkM1NLQyt02JnyreBk5SmcAErwHNnHPkn5GSYpe1c/CL8 HDPDrV9QRy8o1b/ZxTAxlSKhH6a0Kilbq13lTiFFtLHjV60UokiN21bWV+a+E3wKCDXJJC nh686OO6rYUvY7wM6H+VvN2kW6XXOfBGuOzTG8KPaIqkCkQgDwwTBf3hE3F5AO8miw4Qqx jWW436L8GhuWA98os8psoLjbiGsrern0Wg3wSSalYnotBUPsn6g2kxpJK5dGPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYLwl1Bb6zc3n; Fri, 04 Jul 2025 04:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5644vhx9050207; Fri, 4 Jul 2025 04:57:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5644vhsD050204; Fri, 4 Jul 2025 04:57:43 GMT (envelope-from git) Date: Fri, 4 Jul 2025 04:57:43 GMT Message-Id: <202507040457.5644vhsD050204@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: 0f62297dd1f2 - stable/14 - amd64: switch to la57 mode before creating kernel page tables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f62297dd1f2084af942924265b7c46b60525699 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0f62297dd1f2084af942924265b7c46b60525699 commit 0f62297dd1f2084af942924265b7c46b60525699 Author: Konstantin Belousov AuthorDate: 2025-06-23 23:20:56 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-04 04:57:02 +0000 amd64: switch to la57 mode before creating kernel page tables (cherry picked from commit 4e1d69b9fbff280962e5ae5258624b60d5ab4618) --- sys/amd64/amd64/locore.S | 2 + sys/amd64/amd64/pmap.c | 207 ++++++++++++++++------------------------------- 2 files changed, 72 insertions(+), 137 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 29fbf38cea33..2be555b25160 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -119,6 +119,8 @@ ENTRY(la57_trampoline) leaq la57_trampoline_end(%rip),%rsp /* priv stack */ movq %cr0,%rbp + leaq la57_trampoline_gdt(%rip),%rax + movq %rax,la57_trampoline_gdt_desc+2(%rip) lgdtq la57_trampoline_gdt_desc(%rip) pushq $(2<<3) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8e2c2109e7ad..97e59123df97 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1686,12 +1686,43 @@ bootaddr_rwx(vm_paddr_t pa) return (pg_nx); } +extern const char la57_trampoline[]; + +static void +pmap_bootstrap_la57(vm_paddr_t *firstaddr) +{ + void (*la57_tramp)(uint64_t pml5); + pml5_entry_t *pt; + + if ((cpu_stdext_feature2 & CPUID_STDEXT2_LA57) == 0) + return; + TUNABLE_INT_FETCH("vm.pmap.la57", &la57); + if (!la57) + return; + + KPML5phys = allocpages(firstaddr, 1); + KPML4phys = rcr3() & 0xfffff000; /* pml4 from loader must be < 4G */ + + pt = (pml5_entry_t *)KPML5phys; + pt[0] = KPML4phys | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; + pt[NPML4EPG - 1] = KPML4phys | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + + la57_tramp = (void (*)(uint64_t))((uintptr_t)la57_trampoline - + KERNSTART + amd64_loadaddr()); + printf("Calling la57 trampoline at %p, KPML5phys %#lx ...", + la57_tramp, KPML5phys); + la57_tramp(KPML5phys); + printf(" alive in la57 mode\n"); +} + static void create_pagetables(vm_paddr_t *firstaddr) { pd_entry_t *pd_p; pdp_entry_t *pdp_p; pml4_entry_t *p4_p; + pml5_entry_t *p5_p; uint64_t DMPDkernphys; vm_paddr_t pax; #ifdef KASAN @@ -1919,6 +1950,27 @@ create_pagetables(vm_paddr_t *firstaddr) } kernel_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); + + if (la57) { + /* XXXKIB bootstrap KPML5phys page is lost */ + KPML5phys = allocpages(firstaddr, 1); + for (i = 0, p5_p = (pml5_entry_t *)KPML5phys; i < NPML5EPG; + i++) { + if (i == PML5PML5I) { + /* + * Recursively map PML5 to itself in + * order to get PTmap and PDmap. + */ + p5_p[i] = KPML5phys | X86_PG_RW | X86_PG_A | + X86_PG_M | X86_PG_V | pg_nx; + } else if (i == pmap_pml5e_index(UPT_MAX_ADDRESS)) { + p5_p[i] = KPML4phys | X86_PG_RW | X86_PG_A | + X86_PG_M | X86_PG_V; + } else { + p5_p[i] = 0; + } + } + } TSEXIT(); } @@ -1952,6 +2004,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* * Create an initial set of page tables to run the kernel in. */ + pmap_bootstrap_la57(firstaddr); create_pagetables(firstaddr); pcpu0_phys = allocpages(firstaddr, 1); @@ -1981,7 +2034,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) cr4 = rcr4(); cr4 |= CR4_PGE; load_cr4(cr4); - load_cr3(KPML4phys); + load_cr3(la57 ? KPML5phys : KPML4phys); if (cpu_stdext_feature & CPUID_STDEXT_SMEP) cr4 |= CR4_SMEP; if (cpu_stdext_feature & CPUID_STDEXT_SMAP) @@ -1994,8 +2047,20 @@ pmap_bootstrap(vm_paddr_t *firstaddr) * later unmapped (using pmap_remove()) and freed. */ PMAP_LOCK_INIT(kernel_pmap); - kernel_pmap->pm_pmltop = kernel_pml4; - kernel_pmap->pm_cr3 = KPML4phys; + if (la57) { + vtoptem = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; + PTmap = (vm_offset_t)P5Tmap; + vtopdem = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; + PDmap = (vm_offset_t)P5Dmap; + kernel_pmap->pm_pmltop = (void *)PHYS_TO_DMAP(KPML5phys); + kernel_pmap->pm_cr3 = KPML5phys; + pmap_pt_page_count_adj(kernel_pmap, 1); /* top-level page */ + } else { + kernel_pmap->pm_pmltop = kernel_pml4; + kernel_pmap->pm_cr3 = KPML4phys; + } kernel_pmap->pm_ucr3 = PMAP_NO_CR3; TAILQ_INIT(&kernel_pmap->pm_pvchunk); kernel_pmap->pm_stats.resident_count = res; @@ -2050,6 +2115,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* * Re-initialize PCPU area for BSP after switching. * Make hardware use gdt and common_tss from the new PCPU. + * Also clears the usage of temporary gdt during switch to + * LA57 paging. */ STAILQ_INIT(&cpuhead); wrmsr(MSR_GSBASE, (uint64_t)&__pcpu[0]); @@ -2179,140 +2246,6 @@ pmap_page_alloc_below_4g(bool zeroed) 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT)); } -extern const char la57_trampoline[], la57_trampoline_gdt_desc[], - la57_trampoline_gdt[], la57_trampoline_end[]; - -static void -pmap_bootstrap_la57(void *arg __unused) -{ - char *v_code; - pml5_entry_t *v_pml5; - pml4_entry_t *v_pml4; - pdp_entry_t *v_pdp; - pd_entry_t *v_pd; - pt_entry_t *v_pt; - vm_page_t m_code, m_pml4, m_pdp, m_pd, m_pt, m_pml5; - void (*la57_tramp)(uint64_t pml5); - struct region_descriptor r_gdt; - - if ((cpu_stdext_feature2 & CPUID_STDEXT2_LA57) == 0) - return; - TUNABLE_INT_FETCH("vm.pmap.la57", &la57); - if (!la57) - return; - - r_gdt.rd_limit = NGDT * sizeof(struct user_segment_descriptor) - 1; - r_gdt.rd_base = (long)__pcpu[0].pc_gdt; - - m_code = pmap_page_alloc_below_4g(true); - v_code = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_code)); - m_pml5 = pmap_page_alloc_below_4g(true); - KPML5phys = VM_PAGE_TO_PHYS(m_pml5); - v_pml5 = (pml5_entry_t *)PHYS_TO_DMAP(KPML5phys); - m_pml4 = pmap_page_alloc_below_4g(true); - v_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pml4)); - m_pdp = pmap_page_alloc_below_4g(true); - v_pdp = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pdp)); - m_pd = pmap_page_alloc_below_4g(true); - v_pd = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pd)); - m_pt = pmap_page_alloc_below_4g(true); - v_pt = (pt_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pt)); - - /* - * Map m_code 1:1, it appears below 4G in KVA due to physical - * address being below 4G. Since kernel KVA is in upper half, - * the pml4e should be zero and free for temporary use. - */ - kernel_pmap->pm_pmltop[pmap_pml4e_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pdp) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pdp[pmap_pdpe_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pd) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pd[pmap_pde_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pt) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pt[pmap_pte_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_code) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - - /* - * Add pml5 entry at top of KVA pointing to existing pml4 table, - * entering all existing kernel mappings into level 5 table. - */ - v_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | - X86_PG_RW | X86_PG_A | X86_PG_M; - - /* - * Add pml5 entry for 1:1 trampoline mapping after LA57 is turned on. - */ - v_pml5[pmap_pml5e_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pml4) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - v_pml4[pmap_pml4e_index(VM_PAGE_TO_PHYS(m_code))] = - VM_PAGE_TO_PHYS(m_pdp) | X86_PG_V | X86_PG_RW | X86_PG_A | - X86_PG_M; - - /* - * Copy and call the 48->57 trampoline, hope we return there, alive. - */ - bcopy(la57_trampoline, v_code, la57_trampoline_end - la57_trampoline); - *(u_long *)(v_code + 2 + (la57_trampoline_gdt_desc - la57_trampoline)) = - la57_trampoline_gdt - la57_trampoline + VM_PAGE_TO_PHYS(m_code); - la57_tramp = (void (*)(uint64_t))VM_PAGE_TO_PHYS(m_code); - pmap_invalidate_all(kernel_pmap); - if (bootverbose) { - printf("entering LA57 trampoline at %#lx\n", - (vm_offset_t)la57_tramp); - } - la57_tramp(KPML5phys); - - /* - * gdt was necessary reset, switch back to our gdt. - */ - lgdt(&r_gdt); - wrmsr(MSR_GSBASE, (uint64_t)&__pcpu[0]); - load_ds(_udatasel); - load_es(_udatasel); - load_fs(_ufssel); - ssdtosyssd(&gdt_segs[GPROC0_SEL], - (struct system_segment_descriptor *)&__pcpu[0].pc_gdt[GPROC0_SEL]); - ltr(GSEL(GPROC0_SEL, SEL_KPL)); - lidt(&r_idt); - - if (bootverbose) - printf("LA57 trampoline returned, CR4 %#lx\n", rcr4()); - - /* - * Now unmap the trampoline, and free the pages. - * Clear pml5 entry used for 1:1 trampoline mapping. - */ - pte_clear(&v_pml5[pmap_pml5e_index(VM_PAGE_TO_PHYS(m_code))]); - invlpg((vm_offset_t)v_code); - vm_page_free(m_code); - vm_page_free(m_pdp); - vm_page_free(m_pd); - vm_page_free(m_pt); - - /* - * Recursively map PML5 to itself in order to get PTmap and - * PDmap. - */ - v_pml5[PML5PML5I] = KPML5phys | X86_PG_RW | X86_PG_V | pg_nx; - - vtoptem = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + - NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; - PTmap = (vm_offset_t)P5Tmap; - vtopdem = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + - NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1) << 3; - PDmap = (vm_offset_t)P5Dmap; - - kernel_pmap->pm_cr3 = KPML5phys; - kernel_pmap->pm_pmltop = v_pml5; - pmap_pt_page_count_adj(kernel_pmap, 1); -} -SYSINIT(la57, SI_SUB_KMEM, SI_ORDER_ANY, pmap_bootstrap_la57, NULL); - /* * Initialize a vm_page's machine-dependent fields. */ From nobody Fri Jul 4 04:57:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYLwn4Bcpz60jXT; Fri, 04 Jul 2025 04:57: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 4bYLwm39G7z3rNZ; Fri, 04 Jul 2025 04:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v53jkI9m3T/QgXz1CKV1oRjayMWfJIODo1ZqvANeex4=; b=egp2NfZlxLCZJzW6v7kEVdqW5U2XvI4az2+GX+b8ABcnvfTxh8Sj5Ht3qqxgbj3ilxzIkg /cWzH49FJTXEhk5hi4ia+x3Mw4BzSW6JtigLUn2ICEVEUrHVYkxl87y4NM00O/rd8RnK3q BlfXjJfeRrWL8A46esCeP5vLLCWrPpQnoIQoZhijRj4IQ8VGWRBO3I0Kmw0MYeMYSLKfNO 0WVqqZEJ/30XgV/EL6ND+9G6e1GHJo9uYjlizfS5d6VI4R+kZmHmMLiH8MA8pOQdI/Fj+3 h50G/4uQaMF9ZID+QcxaQ7mPdn1UKciz5tmYTBRZWyPC1eUiKgZUGE6SSbBBIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751605064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v53jkI9m3T/QgXz1CKV1oRjayMWfJIODo1ZqvANeex4=; b=Dz5idKxe/jX0RNZdAENZViGZU3GPMKj7J0n4zB869jKsyiDsPHGIRGjg0GJ52wvm8YAcru ynfckPrqyqJBD6qlrIb9+tpPbJ1Epkzv5cbnfq4AE02XR7aqPLnRonN6BaeEjTEUfCFWbi SFqh2q+E3NVUXaa5b5aHWiLMonHMsUMYpA0pEgu7O9aJQtTtQqTGfowWqjDThYAKrAeGRK w3MwcE36e4SoyO/F2WdWvxbtP9YZQe0Y61PRvCSuqndDGTk8XsxmdLMMrOaHeUO3+Ldj/s tnamgII/HFN8kWjCNWr2O0cI9FL0N2Y797QZaDuzhAMl4tA3Q7M1wHLt4zErEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751605064; a=rsa-sha256; cv=none; b=auf/u/3czOyi7/XdI2ITcDDMx6CsHPDd6sukIDrqHDt9Em9Iw4b/gb9gaN3qiHhzHr1doI /S9fDcQMoTSSyGnDB1IcJEtjy6V8Mw+qw/j7Az31fVWspP9/PW9tM1n0Vug8BlwA1ADbU7 BVDIQqJdpDLSvN9R+xsWfv6IE00mv1TuUfxJ21p6CVBiloSZiOdRla9rS8W8n1NsUNVJXv VaT9VhvvpD8rVFd1vYNwVHFRpqFDRXd4QlKafDR3p7d2TAFl8xmrmUt/kRvz7HxOcnFuE0 pj5lLG0uJs0Tyi38ZkovtLfhiKrBQRGQBHhBTrmkZ8hSKgx4pCglv+GrehanOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYLwm1sFZzc0y; Fri, 04 Jul 2025 04:57: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 5644viXJ050242; Fri, 4 Jul 2025 04:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5644viHZ050239; Fri, 4 Jul 2025 04:57:44 GMT (envelope-from git) Date: Fri, 4 Jul 2025 04:57:44 GMT Message-Id: <202507040457.5644viHZ050239@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: 3a2e1feea91e - stable/14 - amd64 ddb 'show pte': print both pte VA in recursive map and pte content List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a2e1feea91ea1c9f6ebb9a0450a7158f6871d57 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3a2e1feea91ea1c9f6ebb9a0450a7158f6871d57 commit 3a2e1feea91ea1c9f6ebb9a0450a7158f6871d57 Author: Konstantin Belousov AuthorDate: 2025-06-27 04:06:39 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-04 04:57:03 +0000 amd64 ddb 'show pte': print both pte VA in recursive map and pte content (cherry picked from commit 289a7a790cf74c679123a543ae95ac1be7659fad) --- sys/amd64/amd64/pmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 97e59123df97..84cab304af6d 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -12138,7 +12138,7 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) if (pmap_is_la57(pmap)) { pml5 = pmap_pml5e(pmap, va); - db_printf(" pml5e 0x%016lx", *pml5); + db_printf(" pml5e@0x%016lx 0x%016lx", (uint64_t)pml5, *pml5); if ((*pml5 & PG_V) == 0) { db_printf("\n"); return; @@ -12147,25 +12147,25 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) } else { pml4 = pmap_pml4e(pmap, va); } - db_printf(" pml4e 0x%016lx", *pml4); + db_printf(" pml4e@0x%016lx 0x%016lx", (uint64_t)pml4, *pml4); if ((*pml4 & PG_V) == 0) { db_printf("\n"); return; } pdp = pmap_pml4e_to_pdpe(pml4, va); - db_printf(" pdpe 0x%016lx", *pdp); + db_printf(" pdpe@0x%016lx 0x%016lx", (uint64_t)pdp, *pdp); if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { db_printf("\n"); return; } pde = pmap_pdpe_to_pde(pdp, va); - db_printf(" pde 0x%016lx", *pde); + db_printf(" pde@0x%016lx 0x%016lx", (uint64_t)pde, *pde); if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { db_printf("\n"); return; } pte = pmap_pde_to_pte(pde, va); - db_printf(" pte 0x%016lx\n", *pte); + db_printf(" pte@0x%016lx 0x%016lx\n", (uint64_t)pte, *pte); } DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) From nobody Fri Jul 4 13:28:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGL5rdNz615FF; Fri, 04 Jul 2025 13:28: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 4bYZGL5XHhz3M3W; Fri, 04 Jul 2025 13:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymmpjvLNF9lpIpIMenX5fug0nn+6pCBIA0WmCZbI2O8=; b=PRoccFSn6SjuGTdeud1uFAVjj9LVcG4ctfMaglguUtXK9pNCMY6sZY+7T3Z7aEQpl5GzF+ oR72QIe38bpvuaGMHSLmS7LkaGJsy/ynZEZsqEqBno06lY70s1gvNjxSEnvngn//YbwxYv 0gSf3/j+FvXaNY9ou4LhkUKKrzkDIUOvOOe+rTeM+MtgsMbypiy3mCfNuEXX2WIRPrsNOQ 1tPJBUlsv2+l9/RBNpFzx4i7wemKmVFo8+UHFsPgtJYrQILXbSaiuDNcS1xFes+UDBMD6Y W5CUS+I3DWEOZZEJwVun/vFR9S/2ZiHtsS5TkK/AH+/534xN5QSXi/Lxt4x1WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymmpjvLNF9lpIpIMenX5fug0nn+6pCBIA0WmCZbI2O8=; b=nNuo1kSCKTPZrkkQ83AlyFhpS1/3mKSJDa9k2lNPmsX/gOzUdZKSULlUuF591RyNtpKqlj Cbb0gxezkg+jiCp7Cs2XGGe1+PlVUhYLRz8MeIffe6Nux5NwkqtfFCEWeNC4I603/ShtKY nxchAaV5db3Ed1yZ7zpFntfvyLSs44TvGA7fddLCZ4Sy8yeKjRBz6oU2rDS26rXUjzT7JY Zxkuwyp8Mjfc7vo78Ay0Qkblvm9Q9flBlmb3dEzTbhDKz5fn1Hl+kokpTeE8i5TRArGZeb PPSffLFWmlQDSbDUMQ+YNFKW+w5kznTQdv41G716tuwAZ9lqQ+D8aZUMLP6iHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635722; a=rsa-sha256; cv=none; b=iQVd2u0r1LrqaDHaLQsc21t6Dtd3JCIn/Q24Dp7AB1Zq2vrXBz7aUnxGCL5DlUtZfQNYJd VRzu9UY4NC4FBpTu+J9O6DanArRGk3VfxX9QDSbXdsIkwIH4vd+n0E3DgPDzdBrZsFL3T+ oFk4B8KbuAFrlCznhsXnmw+I+MnG5/jB7H1jpPlEA4u+UEZf8KnqCtl8vTL9dBIqv8Qfm2 C+ffBEAKFZjNVIFrzfxOoapXTkDfwRq2G1CtYyORHqOpAdfA1BlynK6Quy7k2FxqX0Mfws lO8x57pa6aDWy+x2XTSosjteutIyzpZg/7qbH7UC/giUxUkdhz0qME04sKc3AA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGL56nszsSD; Fri, 04 Jul 2025 13:28: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 564DSg93005743; Fri, 4 Jul 2025 13:28:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSgpc005740; Fri, 4 Jul 2025 13:28:42 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:42 GMT Message-Id: <202507041328.564DSgpc005740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 615fba7c6b39 - stable/14 - Add an implementation of the 9P filesystem List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 615fba7c6b39ac40239beb5624025d0d0576fdc0 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=615fba7c6b39ac40239beb5624025d0d0576fdc0 commit 615fba7c6b39ac40239beb5624025d0d0576fdc0 Author: Doug Rabson AuthorDate: 2022-12-06 13:07:46 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:05 +0000 Add an implementation of the 9P filesystem This is derived from swills@ fork of the Juniper virtfs with many changes by me including bug fixes, style improvements, clearer layering and more consistent logging. The filesystem is renamed to p9fs to better reflect its function and to prevent possible future confusion with virtio-fs. Several updates and fixes from Juniper have been integrated into this version by Val Packett and these contributions along with the original Juniper authors are credited below. To use this with bhyve, add 'virtio_p9fs_load=YES' to loader.conf. The bhyve virtio-9p device allows access from the guest to files on the host by mapping a 'sharename' to a host path. It is possible to use p9fs as a root filesystem by adding this to /boot/loader.conf: vfs.root.mountfrom="p9fs:sharename" for non-root filesystems add something like this to /etc/fstab: sharename /mnt p9fs rw 0 0 In both examples, substitute the share name used on the bhyve command line. The 9P filesystem protocol relies on stateful file opens which map protocol-level FIDs to host file descriptors. The FreeBSD vnode interface doesn't really support this and we use heuristics to guess the right FID to use for file operations. This can be confused by privilege lowering and does not guarantee that the FID created for a given file open is always used for file operations, even if the calling process is using the file descriptor from the original open call. Improving this would involve changes to the vnode interface which is out-of-scope for this import. Differential Revision: https://reviews.freebsd.org/D41844 Reviewed by: kib, emaste, dch MFC after: 3 months Co-authored-by: Val Packett Co-authored-by: Ka Ho Ng Co-authored-by: joyu Co-authored-by: Kumara Babu Narayanaswamy (cherry picked from commit e97ad33a89a78f55280b0485b3249ee9b907a718) --- share/man/man5/Makefile | 1 + share/man/man5/p9fs.5 | 127 +++ sys/conf/files | 7 + sys/conf/options | 1 + sys/dev/virtio/p9fs/virtio_p9fs.c | 511 +++++++++ sys/dev/virtio/p9fs/virtio_p9fs.h | 39 + sys/fs/p9fs/p9_client.c | 1311 ++++++++++++++++++++++ sys/fs/p9fs/p9_client.h | 168 +++ sys/fs/p9fs/p9_debug.h | 45 + sys/fs/p9fs/p9_protocol.c | 632 +++++++++++ sys/fs/p9fs/p9_protocol.h | 280 +++++ sys/fs/p9fs/p9_transport.c | 70 ++ sys/fs/p9fs/p9_transport.h | 53 + sys/fs/p9fs/p9fs.h | 203 ++++ sys/fs/p9fs/p9fs_proto.h | 42 + sys/fs/p9fs/p9fs_subr.c | 411 +++++++ sys/fs/p9fs/p9fs_vfsops.c | 602 +++++++++++ sys/fs/p9fs/p9fs_vnops.c | 2148 +++++++++++++++++++++++++++++++++++++ sys/kern/vfs_mountroot.c | 1 + sys/modules/Makefile | 1 + sys/modules/p9fs/Makefile | 8 + sys/modules/virtio/Makefile | 2 +- sys/modules/virtio/p9fs/Makefile | 32 + 23 files changed, 6694 insertions(+), 1 deletion(-) diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index 84d8d9011503..34a8a43d9c7a 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -47,6 +47,7 @@ MAN= acct.5 \ nsswitch.conf.5 \ nullfs.5 \ os-release.5 \ + p9fs.5 \ passwd.5 \ pbm.5 \ periodic.conf.5 \ diff --git a/share/man/man5/p9fs.5 b/share/man/man5/p9fs.5 new file mode 100644 index 000000000000..5c110e3dc963 --- /dev/null +++ b/share/man/man5/p9fs.5 @@ -0,0 +1,127 @@ +.\" +.\" Copyright (c) 2022-present Doug Rabson +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd December 7, 2022 +.Dt P9FS 5 +.Os +.Sh NAME +.Nm p9fs +.Nd "9P file system" +.Sh SYNOPSIS +To use this filesystem, +either add the following to the kernel config: +.Bd -ragged -offset indent +.Cd "options P9FS" +.Cd "device virtio_p9fs" +.Ed +.Pp +Alternatively, load the driver as a kernel module, +either at boot time by adding the following to +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_p9fs_load="YES" +.Ed +.Pp +or on system startup using the command: +.Pp +.Dl "# sysrc kld_list+=virtio_p9fs" +.Sh DESCRIPTION +The +.Nm +filesystem uses the 9P protocol to mount a host file system directory +into a +.Xr bhyve 8 +guest. +Multiple host directories can be accessed using the +.Xr bhyve 8 +virtio-9p virtual PCI device. +Each device is configured with a share name and a host directory path. +The share name can be used with +.Xr mount 8 +to mount the host directory in the guest: +.Pp +.Dl "# mount -t p9fs mysharename /mnt" +.Pp +Host directories can be mounted on system startup using +.Xr fstab 5 +like this: +.Pp +.Bd -literal -offset indent +mysharename /mnt p9fs rw 0 0 +.Ed +.Pp +Using +.Nm +as a root file system is supported by adding the following to +.Xr loader.conf 5 : +.Bd -literal -offset indent +vfs.root.mountfrom="p9fs:mysharename" +.Ed +.Sh LIMITATIONS +The 9P protocol relies on stateful file opens +which map protocol-level FIDs to host file descriptors. +The FreeBSD vnode interface doesn't support this and +.Nm +uses heuristics to guess the right FID to use for file operations. +.Pp +This can be confused by privilege lowering and +does not guarantee that the FID created for a +given file open is always used, +even if the calling process is using the file descriptor from +the original open call. +.Pp +In particular, accessing unlinked files using open file descriptor +may not work correctly. +If +.Nm +is the root filesystem, +it is recommented to use with +.Xr tmpfs 5 +to ensure that temporary files created in +.Pa /tmp +or +.Pa /var/tmp +have the expected semantics. +.Sh SEE ALSO +.Xr fstab 5 +.Sh HISTORY +The 9P protocol first appeared in the Plan 9 operating system. +More recently, the protocol has been widely used with virtual machines +to allow the use of host file resources inside a guest VM. +.Sh AUTHORS +This is derived from software released by Juniper Networks, Inc. +with many improvements and fixes from +.An Steve Wills . +.Pp +This manual page was written by +.An -nosplit +.An Doug Rabson Aq Mt dfr@FreeBSD.org . +.Sh BUGS +A better name for this filesystem would be +.Ar 9pfs +but for technical reasons, +the names of filesystems must be valid C identifiers. +As a compromise, +the filesystem is named +.Nm . diff --git a/sys/conf/files b/sys/conf/files index 6412e84d9f70..d0e6ee1eb477 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3421,6 +3421,7 @@ dev/virtio/balloon/virtio_balloon.c optional virtio_balloon dev/virtio/block/virtio_blk.c optional virtio_blk dev/virtio/console/virtio_console.c optional virtio_console dev/virtio/gpu/virtio_gpu.c optional virtio_gpu +dev/virtio/p9fs/virtio_p9fs.c optional virtio_p9fs dev/virtio/random/virtio_random.c optional virtio_random dev/virtio/scsi/virtio_scsi.c optional virtio_scsi dev/vkbd/vkbd.c optional vkbd @@ -3569,6 +3570,12 @@ fs/nfsserver/nfs_nfsdcache.c optional nfsd inet fs/nullfs/null_subr.c optional nullfs fs/nullfs/null_vfsops.c optional nullfs fs/nullfs/null_vnops.c optional nullfs +fs/p9fs/p9_client.c optional p9fs +fs/p9fs/p9_protocol.c optional p9fs +fs/p9fs/p9_transport.c optional p9fs +fs/p9fs/p9fs_subr.c optional p9fs +fs/p9fs/p9fs_vfsops.c optional p9fs +fs/p9fs/p9fs_vnops.c optional p9fs fs/procfs/procfs.c optional procfs fs/procfs/procfs_dbregs.c optional procfs fs/procfs/procfs_fpregs.c optional procfs diff --git a/sys/conf/options b/sys/conf/options index b05e146b7428..2becb1aaa7a3 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -279,6 +279,7 @@ TMPFS opt_dontuse.h UDF opt_dontuse.h UNIONFS opt_dontuse.h ZFS opt_dontuse.h +P9FS opt_dontuse.h # Pseudofs debugging PSEUDOFS_TRACE opt_pseudofs.h diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c new file mode 100644 index 000000000000..77f5b1334e77 --- /dev/null +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -0,0 +1,511 @@ +/*- + * Copyright (c) 2017 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/* + * The Virtio 9P transport driver. This file contains all functions related to + * the virtqueue infrastructure which include creating the virtqueue, host + * interactions, interrupts etc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#define VT9P_MTX(_sc) (&(_sc)->vt9p_mtx) +#define VT9P_LOCK(_sc) mtx_lock(VT9P_MTX(_sc)) +#define VT9P_UNLOCK(_sc) mtx_unlock(VT9P_MTX(_sc)) +#define VT9P_LOCK_INIT(_sc) mtx_init(VT9P_MTX(_sc), \ + "VIRTIO 9P CHAN lock", NULL, MTX_DEF) +#define VT9P_LOCK_DESTROY(_sc) mtx_destroy(VT9P_MTX(_sc)) +#define MAX_SUPPORTED_SGS 20 +static MALLOC_DEFINE(M_P9FS_MNTTAG, "p9fs_mount_tag", "P9fs Mounttag"); + +struct vt9p_softc { + device_t vt9p_dev; + struct mtx vt9p_mtx; + struct sglist *vt9p_sglist; + struct cv submit_cv; + bool busy; + struct virtqueue *vt9p_vq; + int max_nsegs; + uint16_t mount_tag_len; + char *mount_tag; + STAILQ_ENTRY(vt9p_softc) chan_next; +}; + +/* Global channel list, Each channel will correspond to a mount point */ +static STAILQ_HEAD( ,vt9p_softc) global_chan_list; +struct mtx global_chan_list_mtx; + +static struct virtio_feature_desc virtio_9p_feature_desc[] = { + { VIRTIO_9PNET_F_MOUNT_TAG, "9PMountTag" }, + { 0, NULL } +}; + +static void +global_chan_list_init(void) +{ + + mtx_init(&global_chan_list_mtx, "9pglobal", + NULL, MTX_DEF); + STAILQ_INIT(&global_chan_list); +} +SYSINIT(global_chan_list_init, SI_SUB_KLD, SI_ORDER_FIRST, + global_chan_list_init, NULL); + +/* We don't currently allow canceling of virtio requests */ +static int +vt9p_cancel(void *handle, struct p9_req_t *req) +{ + + return (1); +} + +SYSCTL_NODE(_vfs, OID_AUTO, 9p, CTLFLAG_RW, 0, "9P File System Protocol"); + +/* + * Maximum number of seconds vt9p_request thread sleep waiting for an + * ack from the host, before exiting + */ +static unsigned int vt9p_ackmaxidle = 120; + +SYSCTL_UINT(_vfs_9p, OID_AUTO, ackmaxidle, CTLFLAG_RW, &vt9p_ackmaxidle, 0, + "Maximum time request thread waits for ack from host"); + +/* + * Wait for completion of a p9 request. + * + * This routine will sleep and release the chan mtx during the period. + * chan mtx will be acquired again upon return. + */ +static int +vt9p_req_wait(struct vt9p_softc *chan, struct p9_req_t *req) +{ + if (req->tc->tag != req->rc->tag) { + if (msleep(req, VT9P_MTX(chan), 0, "chan lock", + vt9p_ackmaxidle * hz)) { + /* + * Waited for 120s. No response from host. + * Can't wait for ever.. + */ + P9_DEBUG(ERROR, "Timeout after waiting %u seconds" + "for an ack from host\n", vt9p_ackmaxidle); + return (EIO); + } + KASSERT(req->tc->tag == req->rc->tag, + ("Spurious event on p9 req")); + } + return (0); +} + +/* + * Request handler. This is called for every request submitted to the host + * It basically maps the tc/rc buffers to sg lists and submits the requests + * into the virtqueue. Since we have implemented a synchronous version, the + * submission thread sleeps until the ack in the interrupt wakes it up. Once + * it wakes up, it returns back to the P9fs layer. The rc buffer is then + * processed and completed to its upper layers. + */ +static int +vt9p_request(void *handle, struct p9_req_t *req) +{ + int error; + struct vt9p_softc *chan; + int readable, writable; + struct sglist *sg; + struct virtqueue *vq; + + chan = handle; + sg = chan->vt9p_sglist; + vq = chan->vt9p_vq; + + P9_DEBUG(TRANS, "%s: req=%p\n", __func__, req); + + /* Grab the channel lock*/ + VT9P_LOCK(chan); + sglist_reset(sg); + /* Handle out VirtIO ring buffers */ + error = sglist_append(sg, req->tc->sdata, req->tc->size); + if (error != 0) { + P9_DEBUG(ERROR, "%s: sglist append failed\n", __func__); + VT9P_UNLOCK(chan); + return (error); + } + readable = sg->sg_nseg; + + error = sglist_append(sg, req->rc->sdata, req->rc->capacity); + if (error != 0) { + P9_DEBUG(ERROR, "%s: sglist append failed\n", __func__); + VT9P_UNLOCK(chan); + return (error); + } + writable = sg->sg_nseg - readable; + +req_retry: + error = virtqueue_enqueue(vq, req, sg, readable, writable); + + if (error != 0) { + if (error == ENOSPC) { + /* + * Condvar for the submit queue. Unlock the chan + * since wakeup needs one. + */ + cv_wait(&chan->submit_cv, VT9P_MTX(chan)); + P9_DEBUG(TRANS, "%s: retry virtio request\n", __func__); + goto req_retry; + } else { + P9_DEBUG(ERROR, "%s: virtio enuqueue failed \n", __func__); + VT9P_UNLOCK(chan); + return (EIO); + } + } + + /* We have to notify */ + virtqueue_notify(vq); + + error = vt9p_req_wait(chan, req); + if (error != 0) { + VT9P_UNLOCK(chan); + return (error); + } + + VT9P_UNLOCK(chan); + + P9_DEBUG(TRANS, "%s: virtio request kicked\n", __func__); + + return (0); +} + +/* + * Completion of the request from the virtqueue. This interrupt handler is + * setup at initialization and is called for every completing request. It + * just wakes up the sleeping submission requests. + */ +static void +vt9p_intr_complete(void *xsc) +{ + struct vt9p_softc *chan; + struct virtqueue *vq; + struct p9_req_t *curreq; + + chan = (struct vt9p_softc *)xsc; + vq = chan->vt9p_vq; + + P9_DEBUG(TRANS, "%s: completing\n", __func__); + + VT9P_LOCK(chan); + while ((curreq = virtqueue_dequeue(vq, NULL)) != NULL) { + curreq->rc->tag = curreq->tc->tag; + wakeup_one(curreq); + } + virtqueue_enable_intr(vq); + cv_signal(&chan->submit_cv); + VT9P_UNLOCK(chan); +} + +/* + * Allocation of the virtqueue with interrupt complete routines. + */ +static int +vt9p_alloc_virtqueue(struct vt9p_softc *sc) +{ + struct vq_alloc_info vq_info; + device_t dev; + + dev = sc->vt9p_dev; + + VQ_ALLOC_INFO_INIT(&vq_info, sc->max_nsegs, + vt9p_intr_complete, sc, &sc->vt9p_vq, + "%s request", device_get_nameunit(dev)); + + return (virtio_alloc_virtqueues(dev, 0, 1, &vq_info)); +} + +/* Probe for existence of 9P virtio channels */ +static int +vt9p_probe(device_t dev) +{ + + /* If the virtio device type is a 9P device, then we claim and attach it */ + if (virtio_get_device_type(dev) != VIRTIO_ID_9P) + return (ENXIO); + device_set_desc(dev, "VirtIO 9P Transport"); + + return (BUS_PROBE_DEFAULT); +} + +static void +vt9p_stop(struct vt9p_softc *sc) +{ + + /* Device specific stops .*/ + virtqueue_disable_intr(sc->vt9p_vq); + virtio_stop(sc->vt9p_dev); +} + +/* Detach the 9P virtio PCI device */ +static int +vt9p_detach(device_t dev) +{ + struct vt9p_softc *sc; + + sc = device_get_softc(dev); + VT9P_LOCK(sc); + vt9p_stop(sc); + VT9P_UNLOCK(sc); + + if (sc->vt9p_sglist) { + sglist_free(sc->vt9p_sglist); + sc->vt9p_sglist = NULL; + } + if (sc->mount_tag) { + free(sc->mount_tag, M_P9FS_MNTTAG); + sc->mount_tag = NULL; + } + mtx_lock(&global_chan_list_mtx); + STAILQ_REMOVE(&global_chan_list, sc, vt9p_softc, chan_next); + mtx_unlock(&global_chan_list_mtx); + + VT9P_LOCK_DESTROY(sc); + cv_destroy(&sc->submit_cv); + + return (0); +} + +/* Attach the 9P virtio PCI device */ +static int +vt9p_attach(device_t dev) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct vt9p_softc *chan; + char *mount_tag; + int error; + uint16_t mount_tag_len; + + chan = device_get_softc(dev); + chan->vt9p_dev = dev; + + /* Init the channel lock. */ + VT9P_LOCK_INIT(chan); + /* Initialize the condition variable */ + cv_init(&chan->submit_cv, "Conditional variable for submit queue" ); + chan->max_nsegs = MAX_SUPPORTED_SGS; + chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_NOWAIT); + + /* Negotiate the features from the host */ + virtio_set_feature_desc(dev, virtio_9p_feature_desc); + virtio_negotiate_features(dev, VIRTIO_9PNET_F_MOUNT_TAG); + + /* + * If mount tag feature is supported read the mount tag + * from device config + */ + if (virtio_with_feature(dev, VIRTIO_9PNET_F_MOUNT_TAG)) + mount_tag_len = virtio_read_dev_config_2(dev, + offsetof(struct virtio_9pnet_config, mount_tag_len)); + else { + error = EINVAL; + P9_DEBUG(ERROR, "%s: Mount tag feature not supported by host\n", __func__); + goto out; + } + mount_tag = malloc(mount_tag_len + 1, M_P9FS_MNTTAG, + M_WAITOK | M_ZERO); + + virtio_read_device_config(dev, + offsetof(struct virtio_9pnet_config, mount_tag), + mount_tag, mount_tag_len); + + device_printf(dev, "Mount tag: %s\n", mount_tag); + + mount_tag_len++; + chan->mount_tag_len = mount_tag_len; + chan->mount_tag = mount_tag; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "p9fs_mount_tag", + CTLFLAG_RD, chan->mount_tag, 0, "Mount tag"); + + if (chan->vt9p_sglist == NULL) { + error = ENOMEM; + P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__); + goto out; + } + + /* We expect one virtqueue, for requests. */ + error = vt9p_alloc_virtqueue(chan); + + if (error != 0) { + P9_DEBUG(ERROR, "%s: Allocating the virtqueue failed \n", __func__); + goto out; + } + + error = virtio_setup_intr(dev, INTR_TYPE_MISC|INTR_MPSAFE); + + if (error != 0) { + P9_DEBUG(ERROR, "%s: Cannot setup virtqueue interrupt\n", __func__); + goto out; + } + error = virtqueue_enable_intr(chan->vt9p_vq); + + if (error != 0) { + P9_DEBUG(ERROR, "%s: Cannot enable virtqueue interrupt\n", __func__); + goto out; + } + + mtx_lock(&global_chan_list_mtx); + /* Insert the channel in global channel list */ + STAILQ_INSERT_HEAD(&global_chan_list, chan, chan_next); + mtx_unlock(&global_chan_list_mtx); + + return (0); +out: + /* Something went wrong, detach the device */ + vt9p_detach(dev); + return (error); +} + +/* + * Allocate a new virtio channel. This sets up a transport channel + * for 9P communication + */ +static int +vt9p_create(const char *mount_tag, void **handlep) +{ + struct vt9p_softc *sc, *chan; + + chan = NULL; + + /* + * Find out the corresponding channel for a client from global list + * of channels based on mount tag and attach it to client + */ + mtx_lock(&global_chan_list_mtx); + STAILQ_FOREACH(sc, &global_chan_list, chan_next) { + if (!strcmp(sc->mount_tag, mount_tag)) { + chan = sc; + break; + } + } + mtx_unlock(&global_chan_list_mtx); + + /* + * If chan is already attached to a client then it cannot be used for + * another client. + */ + if (chan && chan->busy) { + //p9_debug(TRANS, "Channel busy: used by clnt=%p\n", chan->client); + return (EBUSY); + } + + /* If we dont have one, for now bail out.*/ + if (chan) { + *handlep = (void *)chan; + chan->busy = TRUE; + } else { + P9_DEBUG(TRANS, "%s: No Global channel with mount_tag=%s\n", + __func__, mount_tag); + return (EINVAL); + } + + return (0); +} + +static void +vt9p_close(void *handle) +{ + struct vt9p_softc *chan = handle; + chan->busy = FALSE; +} + +static struct p9_trans_module vt9p_trans = { + .name = "virtio", + .create = vt9p_create, + .close = vt9p_close, + .request = vt9p_request, + .cancel = vt9p_cancel, +}; + +static device_method_t vt9p_mthds[] = { + /* Device methods. */ + DEVMETHOD(device_probe, vt9p_probe), + DEVMETHOD(device_attach, vt9p_attach), + DEVMETHOD(device_detach, vt9p_detach), + DEVMETHOD_END +}; + +static driver_t vt9p_drv = { + "virtio_p9fs", + vt9p_mthds, + sizeof(struct vt9p_softc) +}; + +static int +vt9p_modevent(module_t mod, int type, void *unused) +{ + int error; + + error = 0; + + switch (type) { + case MOD_LOAD: + p9_init_zones(); + p9_register_trans(&vt9p_trans); + break; + case MOD_UNLOAD: + p9_destroy_zones(); + break; + case MOD_SHUTDOWN: + break; + default: + error = EOPNOTSUPP; + break; + } + return (error); +} + +DRIVER_MODULE(virtio_p9fs, virtio_pci, vt9p_drv, vt9p_modevent, 0); +MODULE_VERSION(virtio_p9fs, 1); +MODULE_DEPEND(virtio_p9fs, virtio, 1, 1, 1); +MODULE_DEPEND(virtio_p9fs, p9fs, 1, 1, 1); diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.h b/sys/dev/virtio/p9fs/virtio_p9fs.h new file mode 100644 index 000000000000..924b413d29a5 --- /dev/null +++ b/sys/dev/virtio/p9fs/virtio_p9fs.h @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2017 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __VIRTIO_9P_CONFIG__ +#define __VIRTIO_9P_CONFIG__ + +/* Mount point feature specified in config variable */ +#define VIRTIO_9PNET_F_MOUNT_TAG 1 + +struct virtio_9pnet_config { + /* Mount tag length */ + uint16_t mount_tag_len; + /* non NULL terminated tag name */ + uint8_t mount_tag[0]; +}; +#endif /* __VIRTIO_9P_CONFIG__ */ diff --git a/sys/fs/p9fs/p9_client.c b/sys/fs/p9fs/p9_client.c new file mode 100644 index 000000000000..8f36cc4e775a --- /dev/null +++ b/sys/fs/p9fs/p9_client.c @@ -0,0 +1,1311 @@ +/*- + * Copyright (c) 2017 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* + * This file contains 9P client functions which prepares message to be sent to + * the server. Every fileop typically has a function defined here to interact + * with the host. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define QEMU_HEADER 7 +#define P9FS_MAX_FID_CNT (1024 * 1024 * 1024) +#define P9FS_ROOT_FID_NO 2 +#define P9FS_MIN_TAG 1 +#define P9FS_MAX_TAG 65535 +#define WSTAT_SIZE 47 +#define WSTAT_EXTENSION_SIZE 14 + +static MALLOC_DEFINE(M_P9CLNT, "p9_client", "p9fs client structure"); +static uma_zone_t p9fs_fid_zone; +static uma_zone_t p9fs_req_zone; +static uma_zone_t p9fs_buf_zone; + +SYSCTL_DECL(_vfs_p9fs); +int p9_debug_level = 0; +SYSCTL_INT(_vfs_p9fs, OID_AUTO, debug_level, CTLFLAG_RW, + &p9_debug_level, 0, "p9fs debug logging"); + +static struct p9_req_t *p9_get_request(struct p9_client *c, int *error); +static struct p9_req_t *p9_client_request( + struct p9_client *c, int8_t type, int *error, const char *fmt, ...); + +inline int +p9_is_proto_dotl(struct p9_client *clnt) +{ + + return (clnt->proto_version == p9_proto_2000L); +} + +inline int +p9_is_proto_dotu(struct p9_client *clnt) +{ + + return (clnt->proto_version == p9_proto_2000u); +} + +/* Parse mount options into client structure */ +static int +p9_parse_opts(struct mount *mp, struct p9_client *clnt) +{ + int error, len; + char *trans; + + /* + * Default to virtio since thats the only transport we have for now. + */ + error = vfs_getopt(mp->mnt_optnew, "trans", (void **)&trans, &len); + if (error == ENOENT) + trans = "virtio"; + + /* These are defaults for now */ + clnt->proto_version = p9_proto_2000L; + clnt->msize = 8192; + + /* Get the default trans callback */ + clnt->ops = p9_get_trans_by_name(trans); + + return (0); +} + +/* Allocate buffer for sending request and getting responses */ +static struct p9_buffer * +p9_buffer_alloc(int alloc_msize) +{ + struct p9_buffer *fc; + + fc = uma_zalloc(p9fs_buf_zone, M_WAITOK | M_ZERO); + fc->capacity = alloc_msize; + fc->offset = 0; + fc->size = 0; + fc->sdata = (char *)fc + sizeof(struct p9_buffer); + + return (fc); +} + +/* Free memory used by request and response buffers */ +static void +p9_buffer_free(struct p9_buffer **buf) +{ + + /* Free the sdata buffers first, then the whole structure*/ + uma_zfree(p9fs_buf_zone, *buf); + *buf = NULL; +} + +/* Free the request */ +static void +p9_free_req(struct p9_client *clnt, struct p9_req_t *req) +{ + + if (req->tc != NULL) { + if (req->tc->tag != P9_NOTAG) + p9_tag_destroy(clnt, req->tc->tag); + p9_buffer_free(&req->tc); + } + + if (req->rc != NULL) + p9_buffer_free(&req->rc); + + uma_zfree(p9fs_req_zone, req); +} + +/* Allocate a request by tag */ +static struct p9_req_t * +p9_get_request(struct p9_client *clnt, int *error) +{ + struct p9_req_t *req; + int alloc_msize; + uint16_t tag; + *** 5964 LINES SKIPPED *** From nobody Fri Jul 4 13:28:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGN0m7tz615CC; Fri, 04 Jul 2025 13:28:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYZGM6j4yz3Lvm; Fri, 04 Jul 2025 13:28:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHvd7/5eHEIe5vkib1te3zJdR60B0pohbkvSwbucAGI=; b=LOoflivbqoPbJQSq4kvBcrV+opzRwAwD4McVdCw1wnA+TRZofHNbrvSENXlKTVKoQnrw8C 4vM7c/5+jowf3Q/c5GJVUBcvS5hKAN5RjCLER4kTQRaZu+hytTAQnt/gIB/KkuGxPCRY/C IdI6jdf9HuBytEjlvmg1EKeSpNiFnSDtGNqmxwN/KFQIKkLuI+vlbL9DTb4ILoTLj+4kzk 7SekwjWzhyiP/h3orqlco5pQDaNR5INYTtjJTFUPbMcXbgS2CsQptAYwt7rGODhRCQRnbt E/l5ACgnxpPKwLJJyYOrh4O3wObBhg3EKFWUA2NsX1WtQ7ZK2L7OpASU7KBVDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHvd7/5eHEIe5vkib1te3zJdR60B0pohbkvSwbucAGI=; b=EZJXjOxVOvx3V0iIfAzl/CXO7m0qvnwyDoxB4IkyZU8MkVNMAp2AFMzQGnQgL0NlXLlKzx aWZZp+yyLZYR955CCq2NeVqjDC4jstFfFNQDgnddQY5jWfpj6P0epuMgfkeQH2jU3I0Xby AF1+2DpRKnhMBo0pm2kGc+JwseBa5EYhMRiYtEAyUs3kRqd+aOl9SfyNoub+4reGtHuunW xCn+zmswZUAymEB4O0GUuNJK8gQJjeewPv/hEJ6n5gN32W5XmODNkPpcJSbAvCgOs4tjoE g+5KDyfsoO5bb/RQ/U97AAD1xouytaRt9NmUywzHtFQ5Qt3OxHRip6Po7u1MZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635724; a=rsa-sha256; cv=none; b=xGBcWYiZhr/glZDky6FY3zNfQHb9I+f7i0f0HDQXoeUmn/NniG9EgpFomC2UMQwL+tzHTl MZwgi/RoinwUOEtrsxt1eKpJzV4cU623O9b7/TZ/jCXsdT6flb/d6eS8nzLQ6N0oo3Grce 3DQja61G7VzDo3k+8kRfxJ7K/YbmsXpiVVOBoeT4EWM2d7xq1YyYtSeTJbWvQbX7CVZuse CaRKGEl9+EigSx7bMVKxH/u+e9C4jVsM7U71AZf3R+3hLV+SqA8zDsXjxtJhxdlA3thuhZ 30QZAFTr9FPZNknAALVP5qP1+ZVvqwIC0SGkxZjoaRVkc6YijVv79M5fsQ9OmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGM6JWLzsD3; Fri, 04 Jul 2025 13:28: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 564DSh4D005779; Fri, 4 Jul 2025 13:28:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DShi4005776; Fri, 4 Jul 2025 13:28:43 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:43 GMT Message-Id: <202507041328.564DShi4005776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: ab63bdaf1d1f - stable/14 - p9fs: Fix the build for 32-bit kernels List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ab63bdaf1d1f96a3a682886dccd13936a8cb0a5d Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=ab63bdaf1d1f96a3a682886dccd13936a8cb0a5d commit ab63bdaf1d1f96a3a682886dccd13936a8cb0a5d Author: Doug Rabson AuthorDate: 2024-06-19 14:15:34 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:05 +0000 p9fs: Fix the build for 32-bit kernels MFC after: 3 months (cherry picked from commit b2ebcd19f467f518aa969b84527018c03fb0286e) --- sys/fs/p9fs/p9fs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index c1bea18d5eef..d17d7624aef1 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -1762,7 +1762,7 @@ p9fs_readdir(struct vop_readdir_args *ap) count = 0; clnt = np->p9fs_ses->clnt; - P9_DEBUG(VOPS, "%s: vp %p, offset %ld, resid %zd\n", __func__, vp, uio->uio_offset, uio->uio_resid); + P9_DEBUG(VOPS, "%s: vp %p, offset %jd, resid %zd\n", __func__, vp, (intmax_t) uio->uio_offset, uio->uio_resid); if (ap->a_uio->uio_iov->iov_len <= 0) return (EINVAL); From nobody Fri Jul 4 13:28:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGQ53spz614wh; Fri, 04 Jul 2025 13:28: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 4bYZGQ1WMrz3Lsf; Fri, 04 Jul 2025 13:28:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MM601fNw1R0RUcvSzc067vqldrNlgeoW4Ftsxmj+vwI=; b=C/o1Xkic+CEPK2Hoe7NTf5kS13zHFKYbrroV8Cp3LyueVX3QG4hXMpsHspqzItvCpUSZzl pBkMwOVo1RbcVeFwKvAlt/jVixFwkUF/4oaEUClfVz7Z2gQQQStWzRqjA/Rt6rWw3+HDY9 XVmvBnLM9WVAsu4G6pDAiDK9Ynba6srN28IuI5o6BrioMwLEUiHeduqGR4kbpfJATHczy7 MzFPLvbJ9ZU20xMJLxBf6KkUFJutoJIz4mE/XWpGfX2dTRM+ENtZdYysjOGVxXZcXg9pzz 19aMoV0wC/ba53ou5hhr/TGX6KIoQwGaH1b1te9e8IBSSyJnAjUStZSBjhIITw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MM601fNw1R0RUcvSzc067vqldrNlgeoW4Ftsxmj+vwI=; b=NrwJXfWYBHJeyz+lerg04+rMge4GDmwEOesh4sFBFwsrymX4DckmdkvK0jhXKSV4S7meVe E3Z4Ei6rmSjURE+XAU113pBu5gqcx8rEaSOiqK/YhEJgE7kR5o3I6Ke2aI0juSz003sEK0 57z0uRBMFddMy6Ujb0oXv8lc1m2oMyYQLe+KCiYbVRkgjjkoCE+qtTOrcw9wly4jEH7uTD 1N316JfTMH3vw79e8bUC9txLpjnWxAYeoCjgJkLtUqLZJoHbW7ZnBi9bYVMMVMkhvdhIdP gA1P11lB2pYXvkOTJ4HxOXcm5jRXJPz4oLDPdrru8yyZenBCrWeuMloBM8hzMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635726; a=rsa-sha256; cv=none; b=UisWMaJqtC7YLM8gBHngU+kyW1195EnXE2zr3kscnBGUd1yRfHmfUGzWH9FL3CU6eu9gMs dhusjYGEPYIEOyXi1J9a2yOQgITSIC8dRzDRzrsPeqIHbLmQP5RT01CM7VjNMxDtjuJSSN YNQuJvjTUXmlT09bfg6dyxW9ecZcDZxpb43MVogzaJkzAniJoGO23081IfCYH5G8tGbXuC tUx4Fwjk+w0Am5Fq+WAvss+abDeyamE8CjKnpkwwuFSvFUAXlTwyKaKWbf1lWjLzTXjT6A yE3/TfwYvVyc5mKuPVCGoabuxvia1M6A0WergwCJTlBZKo70w4DOf+SVpgES3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGQ0LV8zsGY; Fri, 04 Jul 2025 13:28: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 564DSjdO005852; Fri, 4 Jul 2025 13:28:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSjnB005849; Fri, 4 Jul 2025 13:28:45 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:45 GMT Message-Id: <202507041328.564DSjnB005849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 99f8e26e29a6 - stable/14 - p9fs: implement working putpages (fix mmap write) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 99f8e26e29a62714061998ace211f26e3f724af3 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=99f8e26e29a62714061998ace211f26e3f724af3 commit 99f8e26e29a62714061998ace211f26e3f724af3 Author: Val Packett AuthorDate: 2024-06-24 13:37:58 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:05 +0000 p9fs: implement working putpages (fix mmap write) Mostly copied from smbfs. This driver in its current state has the exact same issue that prevents the generic putpages implementation from working. Sponsored by: https://www.patreon.com/valpackett Reviewed by: dfr Differential Revision: https://reviews.freebsd.org/D45639 MFC after: 3 months (cherry picked from commit daa2c99c89f224200911aa6c8cdee07bc354947a) --- sys/fs/p9fs/p9fs_vfsops.c | 6 ++++ sys/fs/p9fs/p9fs_vnops.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/sys/fs/p9fs/p9fs_vfsops.c b/sys/fs/p9fs/p9fs_vfsops.c index 6cc65aca35d3..f674c866ce9d 100644 --- a/sys/fs/p9fs/p9fs_vfsops.c +++ b/sys/fs/p9fs/p9fs_vfsops.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,7 @@ static uma_zone_t p9fs_node_zone; uma_zone_t p9fs_io_buffer_zone; uma_zone_t p9fs_getattr_zone; uma_zone_t p9fs_setattr_zone; +uma_zone_t p9fs_pbuf_zone; extern struct vop_vector p9fs_vnops; /* option parsing */ @@ -106,6 +108,9 @@ p9fs_init(struct vfsconf *vfsp) p9fs_setattr_zone = uma_zcreate("p9fs setattr zone", sizeof(struct p9_iattr_dotl), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + /* Create the putpages zone */ + p9fs_pbuf_zone = pbuf_zsecond_create("p9fs pbuf zone", nswbuf / 2); + /* * Create the io_buffer zone pool to keep things simpler in case of * multiple threads. Each thread works with its own so there is no @@ -126,6 +131,7 @@ p9fs_uninit(struct vfsconf *vfsp) uma_zdestroy(p9fs_io_buffer_zone); uma_zdestroy(p9fs_getattr_zone); uma_zdestroy(p9fs_setattr_zone); + uma_zdestroy(p9fs_pbuf_zone); return (0); } diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 77162c0a4aff..5556e60f4bae 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -39,10 +39,14 @@ #include #include #include +#include +#include #include #include #include +#include +#include #include #include @@ -62,6 +66,7 @@ static MALLOC_DEFINE(M_P9UIOV, "uio", "UIOV structures for strategy in p9fs"); extern uma_zone_t p9fs_io_buffer_zone; extern uma_zone_t p9fs_getattr_zone; extern uma_zone_t p9fs_setattr_zone; +extern uma_zone_t p9fs_pbuf_zone; /* For the root vnode's vnops. */ struct vop_vector p9fs_vnops; @@ -2126,6 +2131,79 @@ out: return (error); } +/* + * Put VM pages, synchronously. + * XXX: like smbfs, cannot use vop_stdputpages due to mapping requirement + */ +static int +p9fs_putpages(struct vop_putpages_args *ap) +{ + struct uio uio; + struct iovec iov; + int i, error, npages, count; + off_t offset; + int *rtvals; + struct vnode *vp; + struct thread *td; + struct ucred *cred; + struct p9fs_node *np; + vm_page_t *pages; + vm_offset_t kva; + struct buf *bp; + + vp = ap->a_vp; + np = P9FS_VTON(vp); + td = curthread; + cred = curthread->td_ucred; + pages = ap->a_m; + count = ap->a_count; + rtvals = ap->a_rtvals; + npages = btoc(count); + offset = IDX_TO_OFF(pages[0]->pindex); + + /* + * When putting pages, do not extend file past EOF. + */ + if (offset + count > np->inode.i_size) { + count = np->inode.i_size - offset; + if (count < 0) + count = 0; + } + + for (i = 0; i < npages; i++) + rtvals[i] = VM_PAGER_ERROR; + + bp = uma_zalloc(p9fs_pbuf_zone, M_WAITOK); + kva = (vm_offset_t) bp->b_data; + pmap_qenter(kva, pages, npages); + + VM_CNT_INC(v_vnodeout); + VM_CNT_ADD(v_vnodepgsout, count); + + iov.iov_base = (caddr_t) kva; + iov.iov_len = count; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = offset; + uio.uio_resid = count; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_WRITE; + uio.uio_td = td; + + P9_DEBUG(VOPS, "of=%jd,resid=%zd\n", (intmax_t)uio.uio_offset, uio.uio_resid); + + error = VOP_WRITE(vp, &uio, vnode_pager_putpages_ioflags(ap->a_sync), + cred); + + pmap_qremove(kva, npages); + uma_zfree(p9fs_pbuf_zone, bp); + + if (error == 0) + vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid, + np->inode.i_size - offset, npages * PAGE_SIZE); + + return (rtvals[0]); +} struct vop_vector p9fs_vnops = { .vop_default = &default_vnodeops, @@ -2150,5 +2228,6 @@ struct vop_vector p9fs_vnops = { .vop_rename = p9fs_rename, .vop_link = p9fs_link, .vop_readlink = p9fs_readlink, + .vop_putpages = p9fs_putpages, }; VFS_VOP_VECTOR_REGISTER(p9fs_vnops); From nobody Fri Jul 4 13:28:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGP3F7sz6156j; Fri, 04 Jul 2025 13:28: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 4bYZGP0Nltz3Lxv; Fri, 04 Jul 2025 13:28:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7+EixfyEcDYxdhLAR+qMBh7B9gXpg4ZHfg9Wqq8MB0=; b=fRpI63WnNPh3zt7pGR2cpLc5WwB09srTsyB5L1+BWk5313UKQ5V3E4dLAs8wwOkHgPOM/F YU9RW//N7uFR4Y6fMvUtxGp9fjktA1xQRtatpz1GOcjChjYFj8ad+2WNWsvTotUJtoK82q lT/PzcewzCzBigPzMSGeEcwC1bQV5JUS+rmUhChiTfYiWAe3pSJYCsiuYBMc8oCohdmpKC gpcJqMAn6ETZAmXzV8oWWtCfkd85FUbvIicFo3ZrLW6CjQsX4BuMOZeoziGGESXZT7UBri 9wlaPeGg7EJc/X+BTIMoAfOFHS2caqWaQrQKYB1+5GJUe/AF3sjMnKIYbxsWPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7+EixfyEcDYxdhLAR+qMBh7B9gXpg4ZHfg9Wqq8MB0=; b=dOpjpf6Mej978iuw5yce8Z8tCg4bkjHtcRkMs4TTcFwuH7g08TgW5t377NMx42dxItGR99 y4ezYNstavdFOpC/ckkVGdvzuPqfOiQ1KpIkyY/HCgdouIxunAQu8bBI9GEcC9vnR5toit zShV4aLMcFRSlSZuFiZ6DeEyI0ui8Qyx8sO+yhWe43QSkw97cYFx7HnjZL0TG33qHqi+g6 +nnN7kXrUurzRPKT7yflhu+vL3FbXkT67u6sgxEbPjAH7EifuRfK5Kp3I/IMmJr9kCoqkX K0BlSaFv2j6AefdyDqIW81eWKAmCnIUk57ti7WaMkDcp4aSPfqAcoGSJ5j/zPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635725; a=rsa-sha256; cv=none; b=S8VrstzU2jBW7DjIxXEzUOdFeyC6WmqIOhvqdpfZKtnWtYY40XnOq/6a/Y5KXU9LR57JM+ F6USv72wAqCbrCzjrYUv3KWGcz0o8vJzBkjChWn4Zxtemi2IQyuraD8ITHWStUutPDzsUI aug1vr7sDA82tOUyQN5ND7l1CzOd1lqD3EFxPfp2aNj8G1tUnXMIwyPYVuBsMzO5n66fms u0wcb+bL6xKdthR7dVvb6DhOX/7+Ti0+Vz9rD/x3xLXnve+W1MdNakYqSR7z6P+VGWFr2r cXDOeZYueg1aslWE3Ahtb2IotdpttJp8b0M/5AmCrfLtBwZk6paRv3ryqK632A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGN75brzs0y; Fri, 04 Jul 2025 13:28:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 564DSi71005818; Fri, 4 Jul 2025 13:28:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSiwm005815; Fri, 4 Jul 2025 13:28:44 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:44 GMT Message-Id: <202507041328.564DSiwm005815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 03f840f9cc8b - stable/14 - p9fs: fix lookup of "." for lib9p-based 9P servers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 03f840f9cc8b5d02e776f59b033fe6165fc2cf4a Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=03f840f9cc8b5d02e776f59b033fe6165fc2cf4a commit 03f840f9cc8b5d02e776f59b033fe6165fc2cf4a Author: Doug Rabson AuthorDate: 2024-06-24 11:22:57 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:05 +0000 p9fs: fix lookup of "." for lib9p-based 9P servers The lib9p implementation takes a strict interpretation of the Twalk RPC call and returns an error for attempts to lookup ".". The workaround is to fake the lookup locally. Reviewed by: Val Packett MFC after: 3 months (cherry picked from commit 56e4622588ed2eec0197ac47c3059d3db439f5c0) --- sys/fs/p9fs/p9fs_vnops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index d17d7624aef1..77162c0a4aff 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -243,6 +243,12 @@ p9fs_lookup(struct vop_lookup_args *ap) if (dnp == NULL) return (ENOENT); + if (cnp->cn_nameptr[0] == '.' && strlen(cnp->cn_nameptr) == 1) { + vref(dvp); + *vpp = dvp; + return (0); + } + vses = dnp->p9fs_ses; mp = vses->p9fs_mount; From nobody Fri Jul 4 13:28:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGS0G5Hz6155D; Fri, 04 Jul 2025 13:28: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 4bYZGR3wPcz3MBk; Fri, 04 Jul 2025 13:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NdDYSMeF6CGL3E08YEBS7UG95OVVEgUx9REEbH9kCv4=; b=g6blnGOJACfolCXoPPYEH+jVYuwkIdI7MTRRDQYlYAvg0VUXwW9Q6bzjVUcmhsnOdO65WT DWg3yHIwoeXodXf0LV7QRnkIBDKfhhLURvxluUxvI1osdO8FRwogfTqDgH7TJm+vVhnQ31 q8cFuhEFqU5WN11++WT343uzXviLfJ8USha3vm6zay7+ovnisualije9/ARSKnWWHCJqY/ h1GirBnIFjHEcoRYAxzFv5zCeRxlUFmCdnAVh1IeSs++AVhQbsMNPavSWUJaboZ224/XA0 RIAwH0Ikmd4vcsb+QcdDIWRjHUFclWCENVXdxjpDBeddr4EoWUFsbWJA/K7UcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NdDYSMeF6CGL3E08YEBS7UG95OVVEgUx9REEbH9kCv4=; b=RxRkSllXHXL75h0WWvDtRgnlK+spgP4ANFM1Yq1qQZPzI+vzC1FWU6/tZgTZrc6ei87Mqd 7dejaPzKftoIUocLMk9sMKGZqTgP0Ug/o5xEPOqwsfJn73/CDxpheKtpck12+mEwQUWsjy SIMyJHP0zgjCVQV0ljZfAUitrzjMce6pmyt0+ewwc+IYPBMhU2Y7Ieizfq7MqHwUiXIw4X a2hGkqovMOhmriU93J3WTQjQJqWMldodpStd6N7e1I2hCnkqJkTiqkMBce6En5VWWkJvPY 1cBUU6r+V6ehcdW/nVnBBVpKgwa4bdzRoHQyuNTx6gtZ/Nto7SKVorx/nUel4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635727; a=rsa-sha256; cv=none; b=XfwEQHFTBCSy825EywdI5rWA0RA+TKylc+UW00L/+qCzz148Gf3ulW+DNAoQvpMZSTECay FAQ++KrNUJl25uUdSpUqUoqaGbGINmp7KQI75V2ywUGHGFOdDdncEgWqraXdH6SDXyCbsu 96Y48oV79cAMy2jQZwuJJ1u7C2nsxb9EvnI4hIbp3eQWuZ+Kkn70SFfvxttZSIV3XxCGJf NLZF5Rq0IuS3oE974HSPZakrFnj/OokId4BMESH6+7V+4iClnjsmofHWAX5uiycU0yMBhD QH6YlQzIp45Y2ttsZX6Wjn/NwzC/75kAWFCWXER/pJumtceafypEbk6sqK4PPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGR1WqKzsD4; Fri, 04 Jul 2025 13:28: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 564DSlaT005885; Fri, 4 Jul 2025 13:28:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSl6m005882; Fri, 4 Jul 2025 13:28:47 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:47 GMT Message-Id: <202507041328.564DSl6m005882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 0d1dd7c4863a - stable/14 - p9fs: move NULL check immediately after allocation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0d1dd7c4863ab0856c93becf103d59acb917623d Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=0d1dd7c4863ab0856c93becf103d59acb917623d commit 0d1dd7c4863ab0856c93becf103d59acb917623d Author: Ed Maste AuthorDate: 2024-06-24 16:21:19 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:05 +0000 p9fs: move NULL check immediately after allocation Reported by: Shawn Webb (HardenedBSD) Reviewed by: dfr Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45719 (cherry picked from commit 1efd69f933b6ad4177ecda78cf4891aa9a1e8f6b) --- sys/dev/virtio/p9fs/virtio_p9fs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index 77f5b1334e77..1c076e353bbc 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -332,6 +332,11 @@ vt9p_attach(device_t dev) cv_init(&chan->submit_cv, "Conditional variable for submit queue" ); chan->max_nsegs = MAX_SUPPORTED_SGS; chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_NOWAIT); + if (chan->vt9p_sglist == NULL) { + error = ENOMEM; + P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__); + goto out; + } /* Negotiate the features from the host */ virtio_set_feature_desc(dev, virtio_9p_feature_desc); @@ -367,12 +372,6 @@ vt9p_attach(device_t dev) SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "p9fs_mount_tag", CTLFLAG_RD, chan->mount_tag, 0, "Mount tag"); - if (chan->vt9p_sglist == NULL) { - error = ENOMEM; - P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__); - goto out; - } - /* We expect one virtqueue, for requests. */ error = vt9p_alloc_virtqueue(chan); From nobody Fri Jul 4 13:28:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGS4SQDz614wl; Fri, 04 Jul 2025 13:28: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 4bYZGS36knz3MBp; Fri, 04 Jul 2025 13:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NXEnTnxlEs86RER/o/Z20z4YAGG8g7lRqGNcikw8NNE=; b=n+UapfKoK/zvw3Kptin21yCw1hyDs1Ewbj8zwFXWqiuA7zaPmcBwzqVHg5FSeX2JVoK9aD ipbzNioDdfDKcKTU5njNC8spER0DkFhqNks2typQu6JSD179+6HQFoit9Tx4GuJ+04YlA8 hIpIVPm1M8t8axCEdq3FaV8KrRTd17IR1CI8RG9OPVt3fpIU82QV2Q83WPjleow0CNoxJc eWU6FV/1TwpKXOfvROs/WRuA2O7xViplimXKqHxHyoPRxsCZNNQDTfkgF9oShCwK2nnoI1 RSDqLSa1VWLLRTCGHOMZS9egOqSOzJOVX4t4+oPMQvlg2Su0edKhhTDRzJhEgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NXEnTnxlEs86RER/o/Z20z4YAGG8g7lRqGNcikw8NNE=; b=Fp9GWzDd6dwjwj+J+C7UMZVjY+edFMmO5kA6B3/lSG910KUPtlEqIyTDTn/m3wtsuANCBl VdfqNBUPqenHwYkBU/QPGD9xLo3M8/Papqty3NfW7Q6I8vR4YiagziSZteOZflqu0SpRfv DA1Dobt/2KFTwhuKnWeg7AVR7vxIXJx5+pwSt05ShOlHHLTN+jKTnUaaoi2tcpB77jn9Zv 77c8D7tgE197QEm3sM566JwttTYw8xe+VGoF+6gE4XuISr7wUR6eBbkBxHphY7DdRJTgXX seXSPmYfcUtqq+2UtN3UlWZ2X4LDaRrQs+Zr6swelGVT/sjn5/F37Z5zec6Uvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635728; a=rsa-sha256; cv=none; b=aCvovdfdyRsPhyKYxe/i2ez/3dvmpYC+rAbe3zpgXfC3f5M5sumTOvc8ZG+mYKOq1fB5ND pUimpBPPTRO3XkiVONzG+AxmBGsKtEdMxCHm5nCzXElPMYPhuhzlZiSxhjOfYv6FnnzHK+ gKABzbsXkI4i8m1LWN9RpIZ9sdjYw2xCgo+a3wI0fN/6763Jyo2q4plgqptATCn4tsPg2A xk8KU0COKX5RIdNqmhjsQVvHcIqwWUbqeVPnJSDTEzvu01Ikm7WzS6QrkZEEz+pZtVQcaX WPHK6p2tm82PK1rLr9ZK92W8rMpkGH3RhXqJAP/wmSxntOKq8Dd8sft4cnteBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGS2Vwxzs10; Fri, 04 Jul 2025 13:28: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 564DSmD4005918; Fri, 4 Jul 2025 13:28:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSmd2005915; Fri, 4 Jul 2025 13:28:48 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:48 GMT Message-Id: <202507041328.564DSmd2005915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 201d2e45f51f - stable/14 - p9fs: use M_WAITOK where appropriate List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 201d2e45f51fee2b1438bcc0a53a51bd6416ea73 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=201d2e45f51fee2b1438bcc0a53a51bd6416ea73 commit 201d2e45f51fee2b1438bcc0a53a51bd6416ea73 Author: Ed Maste AuthorDate: 2024-06-24 20:10:00 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 p9fs: use M_WAITOK where appropriate device_attach routines are allowed to sleep, and this routine already has other M_WAITOK allocations. Reported by: markj Reviewed by: markj Fixes: 1efd69f933b6 ("p9fs: move NULL check immediately after alloc...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45721 (cherry picked from commit e6b88237c6c33fe2f66cad9836858b877900871a) --- sys/dev/virtio/p9fs/virtio_p9fs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index 1c076e353bbc..e87659da2732 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -331,12 +331,7 @@ vt9p_attach(device_t dev) /* Initialize the condition variable */ cv_init(&chan->submit_cv, "Conditional variable for submit queue" ); chan->max_nsegs = MAX_SUPPORTED_SGS; - chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_NOWAIT); - if (chan->vt9p_sglist == NULL) { - error = ENOMEM; - P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__); - goto out; - } + chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_WAITOK); /* Negotiate the features from the host */ virtio_set_feature_desc(dev, virtio_9p_feature_desc); From nobody Fri Jul 4 13:28:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGV4BB5z6156r; Fri, 04 Jul 2025 13:28: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 4bYZGT47XPz3M4N; Fri, 04 Jul 2025 13:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wKfbflxrYoh5+zX1cgKXEeRnwqzYVOMqS+yBrYl9ee0=; b=qTBvg7u/aucmsWraVWwpV5Yb46bKKD8gJQu96ujDwte6WcN8Cy6F40grW55ckz8V0KInla GJcciUHivTKIdZ8QwH/R0X75a/9CzY4MsC+OuV64rYcD7BBSScwFCY70AanOSaB8FRBV03 uBxdzmhNgJG5atHFdFkVtH/SdmEe/akUnJsEm42AsvL15xC9n4nL93K+HygZTaoujUtzOk +EtYs9W+6zVUJTYghnLrwt3EXtwJhEkwPB4dUV49vI3aQC/2vu0xahnh4EQx/w5IZePc2T a+slQbng6SPztNQhwEV12aonLSQyRldrRas5gv/LrNY3dHNdq6rN5/EKvDNIzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wKfbflxrYoh5+zX1cgKXEeRnwqzYVOMqS+yBrYl9ee0=; b=qCAf0hZ5X9iM+59GXImbkrjxCaNAVReCyWfENs3IufHXpXGRVug+xbjcELEEgHl4lu60gk o2Gylbe5/mHNW6+y2KdlQhZ0k14gUPcEFbgYhe9EuVsiaVtt4/b7LNypayfubo5Xz7arRZ EYrYMSczl2JxGnI2+5p1eL17spQ9XV4KWjkAfU2Iio+Hl0M7iOKV6QSwPxxdYYhHKUSyO6 d4FFJemR37XiIFu1bSGGIgalMXELY5OY0n6RPjj0bjrVrkVzyAyui6pk6fLJp916ELd4o8 Vrb0sxNoA3gHMUn0piZ/vq7GRj1lPMmt+SHq3Gg8f/lWe/+0UjiRHO5nsydLRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635729; a=rsa-sha256; cv=none; b=p+/O9ZNbbDcLHxUuPcxmGZB7TwZif/LHXC/+HejHK/l5ASvAeZ/xR9hYbJL/Do0ztFkra2 rrfM5vHM8PwMEENnKJTdpaF6iTUqTkkdpTeKvS1SPYT0AcOHW+eZUOjoUCXGQ6LIhkcIro Y2cPPFucuy/rhgZwR4nuHVX5gNI159VjK3/rir8vhafTI9EO5FKOOhN06RCK6vQwi/b8/m +mNzQv5vLPquxL9gITiY1vwYTc9nnZnAmUolvqXKP4pLwGzqGnQaQK/sMjpbfXT4wHYJ6/ ryt/VSRxEtqSrc0k5H7hHOST3yhZK/nJnE4UYnOVqq54UyarXr0pqojVvVaqdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGT3NHDzs11; Fri, 04 Jul 2025 13:28: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 564DSnHU005952; Fri, 4 Jul 2025 13:28:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSn5U005949; Fri, 4 Jul 2025 13:28:49 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:49 GMT Message-Id: <202507041328.564DSn5U005949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: f5cc62e54a7f - stable/14 - virtio_p9fs: fix panic on qemu/kvm List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f5cc62e54a7f8ae9b8bb1484e0ebb22352c95d36 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=f5cc62e54a7f8ae9b8bb1484e0ebb22352c95d36 commit f5cc62e54a7f8ae9b8bb1484e0ebb22352c95d36 Author: Danilo Egea Gondolfo AuthorDate: 2024-07-06 16:51:51 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 virtio_p9fs: fix panic on qemu/kvm When the module is loaded on a system running on qemu/kvm the "modern" virtio infrastructure is used and virtio_read_device_config() will end up calling vtpci_modern_read_dev_config(). This function cannot read values of arbitrary sizes and will panic if the p9fs mount tag size is not supported by it. Use virtio_read_device_config_array() instead. It was tested on both bhyve and qemu/kvm. PR: 280098 Co-authored-by: Mark Peek Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1320 (cherry picked from commit 814bf1fddd27aea69740f9e7426302354285cad4) --- sys/dev/virtio/p9fs/virtio_p9fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index e87659da2732..f7bc3f00fe6a 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -352,9 +352,9 @@ vt9p_attach(device_t dev) mount_tag = malloc(mount_tag_len + 1, M_P9FS_MNTTAG, M_WAITOK | M_ZERO); - virtio_read_device_config(dev, + virtio_read_device_config_array(dev, offsetof(struct virtio_9pnet_config, mount_tag), - mount_tag, mount_tag_len); + mount_tag, 1, mount_tag_len); device_printf(dev, "Mount tag: %s\n", mount_tag); From nobody Fri Jul 4 13:28:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGV6cS5z615CJ; Fri, 04 Jul 2025 13:28: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 4bYZGV5B6Nz3M4W; Fri, 04 Jul 2025 13:28:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLUlqaXlpT1I/WJw1byot1bmBovCTj43g8ZRCMMmF3E=; b=RYAGarNZn/WYFmYZHFZBBbxoP/xonVTOqElpHXkss9nLXnad/mfoXziWaSxkupK9OnbR1D +b1vrw+icDF4Raqg9rqB4joobWkyy0KpPherZE+aAaTt2E2OKCcNfQJenNdChyoEgiCN/L YOhD47xY4uTEzHUxsYhXnWv12t4KiVRjKUXXGHt4dfcRZ1JE6rHhaSXTHa3MQ/T+l+jqJu BRVJr34yQKHfArm7usxwV71kq9+/4rWhx4Apm0lXq90wngDSiiIuTLfI/ZawTRpoGYrVcf Qyl2U8LYb1igka1dA/l0GeoMDuVrhSmiHntGdzJXQ8ppSE37LlMKVhuV1E0R6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLUlqaXlpT1I/WJw1byot1bmBovCTj43g8ZRCMMmF3E=; b=K+1CNuvV72l7vPWET0gUHwOq2mWBxwM3I9wnWkS0MyoAIvlHoIBvehjY623X2eL6E0lH6Z I75HvnWwm5NLOXV3Mi6oxLZolFma+qqt4FxPzFqxUxZdz4s34gagKMr0mv3/gVindO6mjd e4264DGnT0WzBWa96QqlwYjvuQQkwGTCuLadf5tg2F7P4GhAGAGNNFs4I0yDTOwdAQ4AVE y2MJAPQHqjF15zV8Zrg8zVi49eWkZKm5fdBNATTOt3vzFCnUW60BJDI+kk10gBEeNbJUPD 0NKSQEIJs3bSD01Ig8cEu/lYNvYEaYdkf52R+iZ0lI7o8TnG8SjwErv1kXJAOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635730; a=rsa-sha256; cv=none; b=j4POl1wOiBs0au7bPvNjeprX88olQex7yCFwibSMwg0f7/yEJ6INudBYN22Q7WlCZCDcII dL4HHJ/Bt9cjw+FnJ909LgYf7HKT/KZx0fwVOmhVCDZ5ChvlsfmYSjl2i/OIJeJQVwX5xN 5H0YjhpYMa2eISD98PpKWCr5dsknvMqED85aLrjFrHKUDd7z5owXjbWn3TJgptAcQSIaBu VKr4v7ixulZEYbiaPhi3OMbJlye0pA25H2i7IYS64X2VM3oMxlYxwlVfKKkv5Yv8DoAe0l A3uu+y1jxGEdlLpRfGz7yT6/DIXk7IoPtpUyMOe8A2fwq5vfiifnOz2Ym0lPhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGV49hZzsGZ; Fri, 04 Jul 2025 13:28: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 564DSoKo005986; Fri, 4 Jul 2025 13:28:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSoZi005983; Fri, 4 Jul 2025 13:28:50 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:50 GMT Message-Id: <202507041328.564DSoZi005983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: ec70e1177b20 - stable/14 - p9fs: remove duplicated code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ec70e1177b2004a5990222dbe3bd6130d9566822 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=ec70e1177b2004a5990222dbe3bd6130d9566822 commit ec70e1177b2004a5990222dbe3bd6130d9566822 Author: Danilo Egea Gondolfo AuthorDate: 2024-07-09 19:07:18 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 p9fs: remove duplicated code This code is using the vnode after it has been released and causing a panic when a p9fs shared volume is unmounted. In fact, it seems like it's just duplicated code left behind from a bad merge. PR: 279887 Reported by: Michael Dexter Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1323 (cherry picked from commit a6ca6dfd60b66eec563bd473d96b31f0be1de80a) --- sys/fs/p9fs/p9fs_vnops.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 5556e60f4bae..6ac0a7c008cc 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -125,16 +125,6 @@ p9fs_cleanup(struct p9fs_node *np) /* Destroy the vm object and flush associated pages. */ vnode_destroy_vobject(vp); - /* Remove the vnode from hash list if vnode is not already deleted */ - if ((np->flags & P9FS_NODE_DELETED) == 0) - vfs_hash_remove(vp); - - /* Invalidate all entries to a particular vnode. */ - cache_purge(vp); - - /* Destroy the vm object and flush associated pages. */ - vnode_destroy_vobject(vp); - /* Remove all the FID */ p9fs_fid_remove_all(np, FALSE); From nobody Fri Jul 4 13:28:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGY3gJRz6152K; Fri, 04 Jul 2025 13:28: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 4bYZGX6MFSz3MCY; Fri, 04 Jul 2025 13:28:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gjE52xxR5jTp2e+h0sDSGcVUrf478eLf1V+KveNC4AI=; b=EXOhxti26+CmhDkAXrqjYRbRuwBVP3hRghwTyLCUkc3db0Odt5dubwDn2GqmdLBPuw2a6X 4hk0FeEodZMtDv/Lir0BVGEb3U8OdceOsOK5OkhkrCFrT7X0mvrcFnPAdRHSdiR2KeeHdX 9SMOL/eo/9VjC8n4LWDq4FLu34QEcgzbMQO5pkyj6XjgmBJ6kujO+ssnz2NnhOdJAVdwT7 rPjUjRvox2i4r8gfunpp6ziJIbyIvYCwHAo+fiFABrlQjRbvuWfcSxGA5x32xZm6NV3mya S3gajWSk6tY8fshW1DUO3c2ny7+4VeeGxKnf+gJC3mLtIYwjEzwj80lKXpNVig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gjE52xxR5jTp2e+h0sDSGcVUrf478eLf1V+KveNC4AI=; b=Q91tztvAAa+Re4/1DSOeuli4dnVgwP2+A6JDvD6KB7YXX02NAQbnl5tm9W2pkfo2dfjMjh KvNm8EbxPyaTgHPH7hOc/V3x/4B1GJOv3W5LHT6HQd6pSSfQI+1nJqUe07DhQgiDXNifd4 vyx5ozWrgpOISRPRyHXELTfoqJsjKpbi2aMS3iUuvQP5OK8peBVV0sEBz9rQQdsW6+2X9H z0uTB3iinDnQhcQJHvAq27Glhx3CKXGsRgLkP0TmPEOOsWROPlml5Gnr0JaWQG/07BotQP qJD1FUYd6c8divDcY7OGgcbd/1jSqEEMf6YKQYYv/Uv6QPZMmga0Tfj2Bv0DRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635733; a=rsa-sha256; cv=none; b=HoWC8PNmvnDs420LnZDT0dLvlN25/NAmJww/QXF54T2TByJ3gB+4a8/jZxynSPeCmzLIsO 9Fvkao+jYY/7p8+f8YQxZUuH61hXBnN8KgHdGcYYVGAb3nUIYF6ciesLt1dYHsIMAY2gO/ rZ5Mn3akgt2tS1fGHppkUZcRkCvL380P2hN5IwdJa944Ost4Hzf2DzKHkreifRwcxFZ3// Hy0ZgUkArjeZ5Y183cqQ5T8q/wbo7F75QcsEqvEXOt7gulxKudAEF1KkSoBBf4MHXW14T4 q/DhiZurmufzC/PXlH7vul40HeF+9zbVqSMose/CZLehcGG35NSVvzV928cWnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGX5whSzsQf; Fri, 04 Jul 2025 13:28: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 564DSqbh006060; Fri, 4 Jul 2025 13:28:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSqxg006055; Fri, 4 Jul 2025 13:28:52 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:52 GMT Message-Id: <202507041328.564DSqxg006055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: a23bc2ddb540 - stable/14 - p9fs: Fix whitespace in request tag handling functions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a23bc2ddb5409bfb3c1186d8062438b504ea41c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=a23bc2ddb5409bfb3c1186d8062438b504ea41c7 commit a23bc2ddb5409bfb3c1186d8062438b504ea41c7 Author: Mark Johnston AuthorDate: 2024-10-25 17:50:37 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 p9fs: Fix whitespace in request tag handling functions No functional change intended. Sponsored by: Klara, Inc. (cherry picked from commit f86e328d324d4d67ab4db4a89ef6239c8978bb87) --- sys/fs/p9fs/p9_client.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/fs/p9fs/p9_client.c b/sys/fs/p9fs/p9_client.c index 8f36cc4e775a..45d24870306c 100644 --- a/sys/fs/p9fs/p9_client.c +++ b/sys/fs/p9fs/p9_client.c @@ -380,16 +380,16 @@ out: uint16_t p9_tag_create(struct p9_client *clnt) { - int tag; + int tag; - tag = alloc_unr(&clnt->tagpool); - P9_DEBUG(LPROTO, "%s: clnt %p: tag %d\n", __func__, clnt, tag); + tag = alloc_unr(&clnt->tagpool); + P9_DEBUG(LPROTO, "%s: clnt %p: tag %d\n", __func__, clnt, tag); - /* Alloc_unr returning -1 is an error for no units left */ - if (tag == -1) { - return (P9_NOTAG); - } - return (tag); + /* Alloc_unr returning -1 is an error for no units left */ + if (tag == -1) { + return (P9_NOTAG); + } + return (tag); } /* Clean up tag structures */ @@ -397,10 +397,10 @@ void p9_tag_destroy(struct p9_client *clnt, uint16_t tag) { - P9_DEBUG(LPROTO, "%s: clnt %p: tag %d\n", __func__, clnt, tag); + P9_DEBUG(LPROTO, "%s: clnt %p: tag %d\n", __func__, clnt, tag); - /* Release to the pool */ - free_unr(&clnt->tagpool, tag); + /* Release to the pool */ + free_unr(&clnt->tagpool, tag); } /* Allocate a new fid from the fidpool */ From nobody Fri Jul 4 13:28:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGX1d2Dz615CK; Fri, 04 Jul 2025 13:28: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 4bYZGW5cl2z3M8b; Fri, 04 Jul 2025 13:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7a5BVhUPmdeqxYy+h+6CN+NO/N96f6lylBD6EzLJUvw=; b=dMA6vQh7IVbShErjWMbWfJByUllgPAA42vIdnDfRjBYv6pF7aDDCNVlv0uEGSizvvfKw5j u21L8MV4Y613irVFMh5rBxgsS/Bp9w/d3ySA6lxNj1rxJwxFbnZsEPRaoR5wJgRwVsxCuc NaDWhlKaDyjNRc2Hce1QTmAeojDGIJhj9I1QgVo91GFJbrm8aULaC4TpwSIcrQb7nRuuf7 +vFUU6p2frJUBTRIA7ngIbw0PrF3qbpIOV+AgINkKYx/bUC11kfS+aRN7rX8e7r7YnrJRG +G5TY7iXRtu7qwun3cT5g0soxUFEu9beJXxkhcxV4RRy9Ym/Rrm8VRVgBy7FHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7a5BVhUPmdeqxYy+h+6CN+NO/N96f6lylBD6EzLJUvw=; b=mbuqnSdmcZumknNmkgl00Qg87TGLGm3FwvqqQuNmon51rIQJL8ikZaEAYW4a/TjJ8cwuiO bzt01MyZ4GEZ7xSg1vapYhXtrksz+shOfgqLq5ULQwp4Z6Vikvxyl9Cd4+KR/7fdO68HGd gR/7iPTPJv8BqCrffeM9LwjCl0vrV4R4h2mhyPNQuHePRy2T0s/FpdzYuErUGOK5lGCaWM GVr0VvSyEtMVNTnnD0NJOEQ6N29M4bbrjRvGh7Lx06D1oPBmZBT/w0pP7vhJGSPzbMA2UK Gc4QLdJPwdNFGAO2cxZ0vJYaJBELGGT9S0c6k2dtc9n9k0ani4SObJRZdipzHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635731; a=rsa-sha256; cv=none; b=BHH51+h9gAiLqN7qBMS24+dugG7VxCv9xNVWLBOyYeQtW11TqqMWx2WkwSIZ8cIYw2pXjk L4kbASAe1IxN8eRZdbvk2DOIj17WEa++rN5pGBxQ+TFzDa8m59K1XMAqVKOFzjac0HMRWq 0Z8sT58BSW/EwQXCgwO7ynmxtZE765ed+IOG9tnciqkx2qKfw7FY1EAfql4BESB5F/Mda2 6sCNyYVQxZC61BLdtlLFMKEMinHiZ+S1FXdz16W4RYshL5lqgu/Il88dJhlzj6vb/OdFUr 8TJ5i45bh5n9jMkGEjwbLSEAGpedxd7zPvPNbc0NIKkuMQCyv3Tc/A/Wqlee7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGW58F2zs12; Fri, 04 Jul 2025 13:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 564DSpYH006023; Fri, 4 Jul 2025 13:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSpus006018; Fri, 4 Jul 2025 13:28:51 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:51 GMT Message-Id: <202507041328.564DSpus006018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 2e7e267e7fcb - stable/14 - p9fs: Properly handle paths containing "." List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2e7e267e7fcbcd0dfb9957fb9809308232276f15 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=2e7e267e7fcbcd0dfb9957fb9809308232276f15 commit 2e7e267e7fcbcd0dfb9957fb9809308232276f15 Author: Bakul Shah AuthorDate: 2024-08-04 18:19:52 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 p9fs: Properly handle paths containing "." Fixes: 56e4622588ed ("p9fs: fix lookup of "." for lib9p-based 9P servers") Pull Request: https://github.com/freebsd/freebsd-src/pull/1361 (cherry picked from commit 62bb18abed25a831a29e1e5b6e6f7fdddbba6403) --- sys/fs/p9fs/p9fs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 6ac0a7c008cc..14951e96b59d 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -238,7 +238,7 @@ p9fs_lookup(struct vop_lookup_args *ap) if (dnp == NULL) return (ENOENT); - if (cnp->cn_nameptr[0] == '.' && strlen(cnp->cn_nameptr) == 1) { + if (cnp->cn_nameptr[0] == '.' && cnp->cn_namelen == 1) { vref(dvp); *vpp = dvp; return (0); From nobody Fri Jul 4 13:28:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGZ3Zz5z614ws; Fri, 04 Jul 2025 13:28: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 4bYZGZ04Snz3M8q; Fri, 04 Jul 2025 13:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xi/hjeVrn8IEP1dywqkPIP20tDfszmXVsktJUEquUTU=; b=ua0nJzPH2QYwWJXjwq4RHPfPgashqgVP3ITUMTZJVZVTp3tNymcF4oCj4PP6a+CCpb9gHr dR/pbtzsEF56p+9imgb1y4mu6U8nRTRfPQKfN1gls9GsgQLSi/ZXafj7tvLIRXB4l2fqDp iFh8TBP2uEVePYFSVV3Z+r8ObZLVXQg4YfpkEG7rcqyS4lm3UL6JVScPMRgImu1/6J5wdq Q/Win2w6di/ojGZMcPMg5nJA3caOW7pxZ/8VbaOPc4RrHsxgInTcIJVA7WqaVBtZ3UflDa GsL0/4INIUZhKPbatz8BXo7Z+3Qqx/CbyE9V8TYeI4D1Bf0nbND6un9rgL6kFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xi/hjeVrn8IEP1dywqkPIP20tDfszmXVsktJUEquUTU=; b=npoWVRmf4n08cvPktHW/3jZcUuWGOWp7Z46RPvRFwfTtzF+zC2zTgTNdE6mA71SebtJ0gg bCLbxi5WlPfmscU3E9O83UZkgcN39jXe3zAkA8eP8TLksGsgZsy2zMIB9Vz1MQ3RoqtDG7 tbBxuD9qLDFRo7rgIhvVVDDu5vXdbqqafzfnDr25GjYWvV3JcK/Eqg/Nk8bhDrpubGY4Lr iZYVEdz417Tc4lImakDdB7pI5wgr2oqLx/bCfisP3QJC4LUp2nLNXG6Xi6Tam2OZvO4pmg ZGJWltRY9oY4aiHUmejw+0N10y+r+eXUudHtqmwNWfwouhNwUeCN6d3nlcontw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635734; a=rsa-sha256; cv=none; b=c57QjcMG2Ai8ySoj7Ja+PQl1emh8fS6cfVZDqqpG8JVeo2KXtpnLaijECGgQ5Xd67VPTXr Kj0bv9FH/VYI6/Q86K5WDoDomG9ip66VDtQMCo1gah5O/uDkrPP9YZD9t6VeVVf2HuIKwj ArOvG19eT6JzGmAjmCkTAHogZu1Jr07ISfniSxAo/C95OI0t/Wz1ZBg3X4NdoxOiCnxFAT KbXM9nY5lQt5VcIN7JX/NgWY7bHJowTD41d1/FtlQGBwZ58NlwV8EIe5JDGiwPRBBQ5a3A /rXYtRkuEkNE1OknDjtQIalrwlLgVQOMRnysWmx/WbznP7fYqG5ScajGLFueUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGY6jyBzsQg; Fri, 04 Jul 2025 13:28: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 564DSrAk006095; Fri, 4 Jul 2025 13:28:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSrTT006091; Fri, 4 Jul 2025 13:28:53 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:53 GMT Message-Id: <202507041328.564DSrTT006091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: f3289f252854 - stable/14 - virtio_p9fs: Fix some style issues List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3289f2528549160afa09fca09b141cbb7f36c32 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=f3289f2528549160afa09fca09b141cbb7f36c32 commit f3289f2528549160afa09fca09b141cbb7f36c32 Author: Mark Johnston AuthorDate: 2024-10-25 17:50:43 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 virtio_p9fs: Fix some style issues - Remove superfluous newlines. - Use bool literals. - Replace an unneeded SYSINIT with static initialization. No functional change intended. Sponsored by: Klara, Inc. (cherry picked from commit b9500cbd38967686a801b1ed3ab1dd5b5b5571fb) --- sys/dev/virtio/p9fs/virtio_p9fs.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index f7bc3f00fe6a..43d5c0d9d6ba 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -74,30 +74,20 @@ struct vt9p_softc { }; /* Global channel list, Each channel will correspond to a mount point */ -static STAILQ_HEAD( ,vt9p_softc) global_chan_list; +static STAILQ_HEAD( ,vt9p_softc) global_chan_list = + STAILQ_HEAD_INITIALIZER(global_chan_list); struct mtx global_chan_list_mtx; +MTX_SYSINIT(global_chan_list_mtx, &global_chan_list_mtx, "9pglobal", MTX_DEF); static struct virtio_feature_desc virtio_9p_feature_desc[] = { { VIRTIO_9PNET_F_MOUNT_TAG, "9PMountTag" }, { 0, NULL } }; -static void -global_chan_list_init(void) -{ - - mtx_init(&global_chan_list_mtx, "9pglobal", - NULL, MTX_DEF); - STAILQ_INIT(&global_chan_list); -} -SYSINIT(global_chan_list_init, SI_SUB_KLD, SI_ORDER_FIRST, - global_chan_list_init, NULL); - /* We don't currently allow canceling of virtio requests */ static int vt9p_cancel(void *handle, struct p9_req_t *req) { - return (1); } @@ -108,7 +98,6 @@ SYSCTL_NODE(_vfs, OID_AUTO, 9p, CTLFLAG_RW, 0, "9P File System Protocol"); * ack from the host, before exiting */ static unsigned int vt9p_ackmaxidle = 120; - SYSCTL_UINT(_vfs_9p, OID_AUTO, ackmaxidle, CTLFLAG_RW, &vt9p_ackmaxidle, 0, "Maximum time request thread waits for ack from host"); @@ -369,20 +358,16 @@ vt9p_attach(device_t dev) /* We expect one virtqueue, for requests. */ error = vt9p_alloc_virtqueue(chan); - if (error != 0) { P9_DEBUG(ERROR, "%s: Allocating the virtqueue failed \n", __func__); goto out; } - error = virtio_setup_intr(dev, INTR_TYPE_MISC|INTR_MPSAFE); - if (error != 0) { P9_DEBUG(ERROR, "%s: Cannot setup virtqueue interrupt\n", __func__); goto out; } error = virtqueue_enable_intr(chan->vt9p_vq); - if (error != 0) { P9_DEBUG(ERROR, "%s: Cannot enable virtqueue interrupt\n", __func__); goto out; @@ -436,7 +421,7 @@ vt9p_create(const char *mount_tag, void **handlep) /* If we dont have one, for now bail out.*/ if (chan) { *handlep = (void *)chan; - chan->busy = TRUE; + chan->busy = true; } else { P9_DEBUG(TRANS, "%s: No Global channel with mount_tag=%s\n", __func__, mount_tag); @@ -450,7 +435,8 @@ static void vt9p_close(void *handle) { struct vt9p_softc *chan = handle; - chan->busy = FALSE; + + chan->busy = false; } static struct p9_trans_module vt9p_trans = { From nobody Fri Jul 4 13:28:54 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGb5K94z6155Q; Fri, 04 Jul 2025 13:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYZGb0ny6z3MNM; Fri, 04 Jul 2025 13:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gFE1gz2c4P21fePDBmz8SiiORNnj82JZ2+nxA3z0RsA=; b=WHAAiiJz3AW44mNo7juj66v80w3qhusIjUUy9Ly+WSiPhSXzc7oMV5n6YjRfLSoPLJLOGo 2Q9RV0UTQ4jNko47Vb0nlef0eMApDvhwRPS9sDbVBTTnc1BHFLpSTmbcpARCRTiL0PNDSb T7sAwvoILrKriC3Apus94rgiNAv4ze0ZIeH0r8DLgE6wEeeLuBGEdcSR7NaClar5ku8Q+p 8scL5bgncbzgDtHwYmK/5E3QfSEcp4yOeahbLWVpxyeuBxVt28tj9EBbRZ/N7xtWODPsyi tQufvFdbsCWqmXKuDZWdRvw7AhwZjlDpBX4oFLTl1bR2/3NMfmcnzOYHyxtC0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gFE1gz2c4P21fePDBmz8SiiORNnj82JZ2+nxA3z0RsA=; b=hfe5QyOj1fO5k2VE1jvcc/UCYic2pdl9DTHNjJEl9GpHynzOYIzUN1i0n0ATN7FlKdkqWy 4G66NO1Ns5T8CvU65YQx+t0eBbsn+aa8LJU9vb7aK8rNDmh/WoAmt0cPycTiGkvS0B1wO2 4Jw68FYQguNsQ71mErVmgbv4wKM8+SdQWUMP59HMpMj+pP9eymIFmCDEBVD1rsB8PUkDbv zbIKoCy8y3M/s5hRhEv4oPoDMGsOp5DVQ3rackkvRjUvv+VqNoFmAGextfgHPRYnpvP9eU w0ij68fMAWDQ3wZelh01H8OklToYudI2OKyR5f4HaimTUNzbtMRuJm7HAjLxmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635735; a=rsa-sha256; cv=none; b=qNrse6+dcJvkZFpJGbuW+z7ciG/wQwz1M9MH7LOKwKH/TleKZ0Q9b3t5gYhyEE8aSX5g+u H5cDbmGPwFbNq2flxT35h2uFRIeG+OA2bq4HfM9Rc1H4VXMYqNzPoQUSKsTqez81p94b4H alGhKHKfaaVOBAtmh0LHgf9gph8TkuVk1bI3Q3J6h2Wby2JymWUDE5UyonZk29pjJIq5MK EJXk/TpasKjFVswRaZMEjr18TxW+QW03jvNHOJbv+0VxG2pSNNDpQdkmFp2OA88RUWSq7g 6/mbQHJpQ9pp3RA0n/e/8EdyTKKMou7lZLSElP2CoyY8uHmqAuTCWB3S6PjS3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGb0N8TzsD5; Fri, 04 Jul 2025 13:28: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 564DSsne006129; Fri, 4 Jul 2025 13:28:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSsH7006126; Fri, 4 Jul 2025 13:28:54 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:54 GMT Message-Id: <202507041328.564DSsH7006126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: f3478cfc7817 - stable/14 - virtio_p9fs: Fix handling of a full request queue List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3478cfc7817afcd47e8c9caee143fb807220ffc Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=f3478cfc7817afcd47e8c9caee143fb807220ffc commit f3478cfc7817afcd47e8c9caee143fb807220ffc Author: Mark Johnston AuthorDate: 2024-10-25 17:51:16 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 virtio_p9fs: Fix handling of a full request queue If, when submitting a request, the virtqueue is full, we sleep until an interrupt has fired, then restart the request. However, while sleeping the channel lock is dropped, and in the meantime another thread may have reset the per-channel SG list, so upon retrying we'd (re)submit whatever happened to be left over in the previous request. Fix the problem by rebuilding the SG list after sleeping. Sponsored by: Klara, Inc. (cherry picked from commit fff518117b40cbc3bca49073eed85dc725ebae4c) --- sys/dev/virtio/p9fs/virtio_p9fs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index 43d5c0d9d6ba..d359fbbf1a3d 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -152,6 +152,7 @@ vt9p_request(void *handle, struct p9_req_t *req) /* Grab the channel lock*/ VT9P_LOCK(chan); +req_retry: sglist_reset(sg); /* Handle out VirtIO ring buffers */ error = sglist_append(sg, req->tc->sdata, req->tc->size); @@ -170,9 +171,7 @@ vt9p_request(void *handle, struct p9_req_t *req) } writable = sg->sg_nseg - readable; -req_retry: error = virtqueue_enqueue(vq, req, sg, readable, writable); - if (error != 0) { if (error == ENOSPC) { /* From nobody Fri Jul 4 13:28:56 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGc4Vdhz615FW; Fri, 04 Jul 2025 13:28: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 4bYZGc1Z4zz3M97; Fri, 04 Jul 2025 13:28:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DB/RCy/qCxJ6+N1k4ZYmbL7KiUq77VbAOQA7lau5b/w=; b=p+Aca+974V5EFPP8OYrV0MRYykpp//TNWs2XAndoHp/EbBMqK7AR5j4PJD+A5q+TYMOZsR 43LIi6b+4JuQD6GII4HDMEViA+qqycJeZLUC5IQHsQVNh/B1Ds043ReoJTMF9nX12s2jTs uVJEv8Ym8FlW4gEcFfx6Ngeoi5bGFcCiqh57oeulUIYBLNFOctOqqg381Sqxz7kXljnCfU qm9kyCA6j/OzfQc/KP98fQYv8gm+mglACqOS6GQ6MbbV1pirfxn8Vo6tkzImwEYxORx6Tf 8HA+WKZ1j5ybLt7i0HbS7LHQsM74nVjdUdTBVKj/419wW6iHDivcV7ZkuUjfCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DB/RCy/qCxJ6+N1k4ZYmbL7KiUq77VbAOQA7lau5b/w=; b=a8N1HjS9M261y0i5CNrAwJKqmw0PQ+yYan1DfiaJdzsmNo/ADtsEX9Y8OteXkBVtCqd8Cm Y3bItruzRxiCES0Ofa6rX/v+2mCXtjWN2wSoW5yQQYPaLzfeUQvd0CZyTdinrpPzb2gl8H UovbWwkRiZ5nD4epXC0RdwRZbjHPvrhbGYttYzm9qKw5Z5fztk4QLN2BwqOoiz/N5F7x3s yMWd77Fu9XTSeQ+wHRLSBei/+SE1WoQ5DdhRS19NQOnJXJY33I7HL/HvbvWrBw7wssmald 8qeitTzocUHoBLlQR+n3NS1YGpeSJPMV6jirbYlF/ZOfAukrazVjNzHh5gRung== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635736; a=rsa-sha256; cv=none; b=LgE95v3MNhqnG8FBKOmqHdGtHb1g09alHzAvv9wNaKcN+6qqGZ4kjG/JsHRgplVw4dWi9U UZzLeu8nPX83YPXG/Xr+PdXcCKPu/Z64dXWMCVtD7/JfWw5Hi03jPe1B+ZJNeDWJqCRXTv JnzhSPvS/UL84n4oYLYusa5TVtqxQU6WYJw9wMQ0NG1fCGmFMS4/0g/Xn4RMoPNaWAa8Rd 9hC3fcMICpChZQNK4PQAOXKC729f+5I0SsWzBVGw4d1Pfp5Dlk3SenvKe9OFMOXonvYh66 iPwKYtqlk7XEVD0Z6bWi7hV0J0dYQI+2uUBIRwdZT7qUtS3wJbl3k2dAKnO9bA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGc0tv9zsD6; Fri, 04 Jul 2025 13:28: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 564DSuYL006165; Fri, 4 Jul 2025 13:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSutn006160; Fri, 4 Jul 2025 13:28:56 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:56 GMT Message-Id: <202507041328.564DSutn006160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: d888c75dd49e - stable/14 - p9fs: Use UNLINKAT instead of REMOVE to implement removals List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d888c75dd49e0f07f3bce297c87850f7c06f3938 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=d888c75dd49e0f07f3bce297c87850f7c06f3938 commit d888c75dd49e0f07f3bce297c87850f7c06f3938 Author: Mark Johnston AuthorDate: 2024-11-07 18:23:32 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 p9fs: Use UNLINKAT instead of REMOVE to implement removals REMOVE doesn't work properly in the face of hard links. Use UNLINKAT instead, which is implemented by qemu and bhyve and lets the client specify the name being removed. PR: 282432 Reviewed by: dfr Differential Revision: https://reviews.freebsd.org/D47438 (cherry picked from commit 1d99e8d9a37e1ba528628186df57b79fe74e196c) --- sys/fs/p9fs/p9_client.c | 21 +++++++++++++++++++++ sys/fs/p9fs/p9_client.h | 1 + sys/fs/p9fs/p9_protocol.h | 2 ++ sys/fs/p9fs/p9fs_vnops.c | 21 ++++++++++++++------- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/sys/fs/p9fs/p9_client.c b/sys/fs/p9fs/p9_client.c index 45d24870306c..547de98c4c03 100644 --- a/sys/fs/p9fs/p9_client.c +++ b/sys/fs/p9fs/p9_client.c @@ -669,6 +669,27 @@ p9_client_remove(struct p9_fid *fid) return (error); } +int +p9_client_unlink(struct p9_fid *dfid, const char *name, int32_t flags) +{ + int error; + struct p9_client *clnt; + struct p9_req_t *req; + + error = 0; + clnt = dfid->clnt; + + req = p9_client_request(clnt, P9PROTO_TUNLINKAT, &error, "dsd", + dfid->fid, name, flags); + if (error != 0) { + P9_DEBUG(PROTO, "RUNLINKAT fid %d\n", dfid->fid); + return (error); + } + + p9_free_req(clnt, req); + return (error); +} + /* Inform the file server that the current file represented by fid is no longer * needed by the client. Any allocated fid on the server needs a clunk to be * destroyed. diff --git a/sys/fs/p9fs/p9_client.h b/sys/fs/p9fs/p9_client.h index 8597c0732ba3..79d402c174e8 100644 --- a/sys/fs/p9fs/p9_client.h +++ b/sys/fs/p9fs/p9_client.h @@ -140,6 +140,7 @@ int p9_client_write(struct p9_fid *fid, uint64_t offset, uint32_t count, char *d int p9_client_file_create(struct p9_fid *fid, char *name, uint32_t perm, int mode, char *extension); int p9_client_remove(struct p9_fid *fid); +int p9_client_unlink(struct p9_fid *dfid, const char *name, int32_t flags); int p9_dirent_read(struct p9_client *clnt, char *buf, int start, int len, struct p9_dirent *dirent); int p9_client_statfs(struct p9_fid *fid, struct p9_statfs *stat); diff --git a/sys/fs/p9fs/p9_protocol.h b/sys/fs/p9fs/p9_protocol.h index ddd8571adc8d..7ffd7dd67bcf 100644 --- a/sys/fs/p9fs/p9_protocol.h +++ b/sys/fs/p9fs/p9_protocol.h @@ -267,6 +267,8 @@ struct p9_iattr_dotl { #define P9PROTO_TGETATTR_BLK 512 +#define P9PROTO_UNLINKAT_REMOVEDIR 0x200 + /* PDU buffer used for SG lists. */ struct p9_buffer { uint32_t size; diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 14951e96b59d..cfb50c704019 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -1497,7 +1497,8 @@ out: * After that, does a node metadata cleanup on client side. */ static int -remove_common(struct p9fs_node *np, struct ucred *cred) +remove_common(struct p9fs_node *dnp, struct p9fs_node *np, const char *name, + struct ucred *cred) { int error; struct p9fs_session *vses; @@ -1508,21 +1509,23 @@ remove_common(struct p9fs_node *np, struct ucred *cred) vses = np->p9fs_ses; vp = P9FS_NTOV(np); - vfid = p9fs_get_fid(vses->clnt, np, cred, VFID, -1, &error); + vfid = p9fs_get_fid(vses->clnt, dnp, cred, VFID, -1, &error); if (error != 0) return (error); - error = p9_client_remove(vfid); + error = p9_client_unlink(vfid, name, + np->v_node->v_type == VDIR ? P9PROTO_UNLINKAT_REMOVEDIR : 0); if (error != 0) return (error); /* Remove all non-open fids associated with the vp */ - p9fs_fid_remove_all(np, TRUE); + if (np->inode.i_links_count == 1) + p9fs_fid_remove_all(np, TRUE); /* Invalidate all entries of vnode from name cache and hash list. */ cache_purge(vp); - vfs_hash_remove(vp); + np->flags |= P9FS_NODE_DELETED; return (error); @@ -1537,8 +1540,10 @@ p9fs_remove(struct vop_remove_args *ap) struct vnode *dvp; struct p9fs_node *dnp; struct p9fs_inode *dinode; + struct componentname *cnp; int error; + cnp = ap->a_cnp; vp = ap->a_vp; np = P9FS_VTON(vp); dvp = ap->a_dvp; @@ -1550,7 +1555,7 @@ p9fs_remove(struct vop_remove_args *ap) if (vp->v_type == VDIR) return (EISDIR); - error = remove_common(np, ap->a_cnp->cn_cred); + error = remove_common(dnp, np, cnp->cn_nameptr, cnp->cn_cred); if (error == 0) P9FS_DECR_LINKS(dinode); @@ -1566,8 +1571,10 @@ p9fs_rmdir(struct vop_rmdir_args *ap) struct vnode *dvp; struct p9fs_node *dnp; struct p9fs_inode *dinode; + struct componentname *cnp; int error; + cnp = ap->a_cnp; vp = ap->a_vp; np = P9FS_VTON(vp); dvp = ap->a_dvp; @@ -1576,7 +1583,7 @@ p9fs_rmdir(struct vop_rmdir_args *ap) P9_DEBUG(VOPS, "%s: vp %p node %p \n", __func__, vp, np); - error = remove_common(np, ap->a_cnp->cn_cred); + error = remove_common(dnp, np, cnp->cn_nameptr, cnp->cn_cred); if (error == 0) P9FS_DECR_LINKS(dinode); From nobody Fri Jul 4 13:28:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGf0yk0z614wt; Fri, 04 Jul 2025 13:28: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 4bYZGd2qf5z3MHr; Fri, 04 Jul 2025 13:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=unD/Ruk6BnQtx2gyGZ/1x28pKwYhD8BtN8XfJr2wZBE=; b=heLM3YxvXFp+tdnXxhUGe8rjyFfAMguFvQCfVVDtpksurUd+Y3zgbmcaKh173wNLdLs++m UMHxE6TS6hjKoUfbKTsCKpvrfsZHVwkhzM0joQcVSPZOuE1nyeaaEOWB7cSyqm1GCTC9TP xn4FEfANeW9y6uHi1I0NmS6eKRc8beUCVgCUYUk/XFWl/2jMr4Yh3o7wbhHkRNIMT2K1qd lmskhW5Tg3UG0ttJiuT0oj9+r8fcrqwDwBC6lnwwBmMBXJ3QvGSw9UiKkIGzjK3e/61OsY IZh48WoRR062/YB8Xz7NthxwvoR0AckgC2iDMmIo0B1dGCM1Elx5D5iLHVmN2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=unD/Ruk6BnQtx2gyGZ/1x28pKwYhD8BtN8XfJr2wZBE=; b=ak4TO+Xqucp7VxOAAF+aBGLNM0qLJpxBo6R9y5tStcp0A2riE/cva5rMkgwBMt9q/B6vmw KkJQZf4xy67DQT6ks7N1y2YB6SZkpfA8OGhUUX+lJ9DiQoRcps+6y5EW8djjJjcIxGo2fa w4l1Jj2OpVPr1gg4eNaZBZFmH/b0+sh1vkLfAtznXqSh+uNwo9GtojppTcl0PHZ/rKf55c Rj8Qx+qrAmKwQ1kxgPdZIAxoRRSwHVHW4U9q4LlP3Hw5DowEAhEQO0mT9bANiO/F/1LNao 0ne4hZOptt39h2+nsk2JBVIoyx/lxQB12s5fQHmjkNZ3ZmIX+vuZ8OCLip/98Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635737; a=rsa-sha256; cv=none; b=TqnBAYpiw61BlpLnaMZqj0XVQG6mcMM7XOBkdhItX5oyAhf+9vcr6ChMYOvcvm7W/PPrSw KfPEFIikcmXgiv7iqohvZ2dZ08SlBAa652+ZbgctdfD0a1uJeaCoeYzYqLqVNitebmm0Sy R7TNeFyur+OuU+igdUTKvtS4HfHx5HbRsSaESbRnLINUlUBHrPuDwOMGJ6VISi/5I4CHAJ ehS0K+ltRREY+bnArGWzp26fowCxUOy8uEj02XOgZNYmxHEfx8aXM8cRJaDrQ+9pczRTTt TIEEjcAT0cQbSMEe1Ih169855m8f10k09ksEBAzQ2KwMhT5naKZLAFlFwZWqdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGd1YX1zsQh; Fri, 04 Jul 2025 13:28: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 564DSvwn006203; Fri, 4 Jul 2025 13:28:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSvWg006200; Fri, 4 Jul 2025 13:28:57 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:57 GMT Message-Id: <202507041328.564DSvWg006200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: fc393006c0ec - stable/14 - p9fs.5: rename to p9fs.4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fc393006c0ec18c5519cc9309e7ac77d1bad6abf Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=fc393006c0ec18c5519cc9309e7ac77d1bad6abf commit fc393006c0ec18c5519cc9309e7ac77d1bad6abf Author: Lexi Winter AuthorDate: 2024-11-07 20:25:10 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:06 +0000 p9fs.5: rename to p9fs.4 This is a filesystem (driver), not a file format, so it should be in section 4. Pull Request: https://github.com/freebsd/freebsd-src/pull/1520 (cherry picked from commit 5b62dc782d4891845b47f2c0dfbb7717cbfe3897) --- ObsoleteFiles.inc | 3 +++ share/man/man4/Makefile | 1 + share/man/{man5/p9fs.5 => man4/p9fs.4} | 4 ++-- share/man/man5/Makefile | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d8a177732c77..5195dba6d58e 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -560,6 +560,9 @@ OLD_FILES+=usr/include/c++/v1/__type_traits/is_trivially_move_constructible.h OLD_FILES+=usr/include/c++/v1/__type_traits/operation_traits.h OLD_FILES+=usr/include/c++/v1/experimental/__memory +# 20241112: move p9fs from section 5 to section 4 +OLD_FILES+=usr/share/man/man5/p9fs.5.gz + # 20240827: retire fips.so OLD_LIBS+=usr/lib/ossl-modules/fips.so diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 12048cf5fe06..48fead7c6287 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -428,6 +428,7 @@ MAN= aac.4 \ owc.4 \ ovpn.4 \ ${_padlock.4} \ + p9fs.4 \ pass.4 \ pca954x.4 \ pccard.4 \ diff --git a/share/man/man5/p9fs.5 b/share/man/man4/p9fs.4 similarity index 99% rename from share/man/man5/p9fs.5 rename to share/man/man4/p9fs.4 index 5c110e3dc963..04f27abd2545 100644 --- a/share/man/man5/p9fs.5 +++ b/share/man/man4/p9fs.4 @@ -22,8 +22,8 @@ .\" (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 December 7, 2022 -.Dt P9FS 5 +.Dd November 7, 2024 +.Dt P9FS 4 .Os .Sh NAME .Nm p9fs diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index 34a8a43d9c7a..84d8d9011503 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -47,7 +47,6 @@ MAN= acct.5 \ nsswitch.conf.5 \ nullfs.5 \ os-release.5 \ - p9fs.5 \ passwd.5 \ pbm.5 \ periodic.conf.5 \ From nobody Fri Jul 4 13:28:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGf6Mllz615Fb; Fri, 04 Jul 2025 13:28: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 4bYZGf2B55z3M9L; Fri, 04 Jul 2025 13:28:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cakRu9qiR51nn6/lJ7fPzAE55jc5NVHhY+hKvCFcFXU=; b=rRRSdFDJ3/vcXZaFdAeHBJmnEeh+MXcDwIVIouSCyZ/mUuS8qCWGQX1b9Zq2gdTNH7HBG4 Di10vBJreQpZ2pd5ZGZE1unECPOxgoGU4j/k7eyjmeBJc3c8K0zCACl1l9KxohGI2RKh4u JZxZ+YyhGW0qZp6O7Rf9FmT5FJByAZElpbDKRSW/49YhF5JRaH/JGZ1svTvLVnYIk3GSXE mvxtH2CQxI+pv4Y9N7D1YxaYBzIAxszO9sjtBEMp8ZzkUwJx2J2SFvU5ww35x0/HnNKn87 BsugR7kM+tfwBDzEAPCHLhIf8Q3LkbZpM07zyu5MWk4fswJH0+Phm2Pela3psQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cakRu9qiR51nn6/lJ7fPzAE55jc5NVHhY+hKvCFcFXU=; b=PVj+iWyqAu2rnItCFSHLFQgMBJ+i4Vqw5+gpDj8phzHV1+fm3FW0JAK8I6QBnAxYEh78lT MzCPoRpvvYDmRRPSOItZWWcikNTyHBQAr8dWsmuyTcab78jUiTEXzMsAY8EwjoUQ66a0wk PVQe4JwLVchYFRUIAxF7pX4/dIzxq0ASSjckdXu7grJZUo21uyeWD4E67/Ek6jt6TVeh/P 9JgMA6azh9Bt33JNh7YJ6+M0P2m3fhgul+bxJW2RLaIPi9Y4KWlYt/zGRwnzQpYfbyFZ3s Gl5eHWJNTI147W+o2xQnCHzNQw45RTHSMzoVg0Gr/6UBPk8sMrYha1A/OAl+bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635738; a=rsa-sha256; cv=none; b=DDlnt55qyI9pyJNODLvGZ3Vb6xzUGKvzN9XuDo6wgWZdUQ6v43tjZrPxVZKqTZpsXO/JNh 4T9vtfugUFpwtFJboLe47o+nFpVKF5qtM4KowXXK9N6aXomHdUCWiFpzCj4StioAdGT40F VlPBdijwDxT3L+Veb82NvoawEb/EANxY2tzwdIvw/egaTpZzHktoyfWURmUXZuyswj0R9q Au0h3nwLpcaKkSLwnyfpeUi5NfNpo6KvjbJITqrmqyw7AH+jnfU52aWec6rLFlzxNWbLhV kOnHHyvDYpzYAI8xIxUcLjqmSqzKRxH3NeVP79mQ7IPQ/tmYIUCWxC7bXtLfGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGf1nj7zrc0; Fri, 04 Jul 2025 13:28: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 564DSwmu006237; Fri, 4 Jul 2025 13:28:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSwn2006234; Fri, 4 Jul 2025 13:28:58 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:58 GMT Message-Id: <202507041328.564DSwn2006234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: b7ef7f8b0b65 - stable/14 - virtio_p9fs: Support attaching to pci and mmio List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b7ef7f8b0b65e67da6ab11441b365684f231250f Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=b7ef7f8b0b65e67da6ab11441b365684f231250f commit b7ef7f8b0b65e67da6ab11441b365684f231250f Author: Andrew Turner AuthorDate: 2025-04-08 10:27:20 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:07 +0000 virtio_p9fs: Support attaching to pci and mmio Some implementations of the virtio 9p transport are implemented on virtio_mmio, e.g. the Arm FVP. Use the correct macro so the driver attaches when this is the case. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D49600 (cherry picked from commit fd9f67e689e83f20e29edf63cc6488402de5901c) --- sys/dev/virtio/p9fs/virtio_p9fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index d359fbbf1a3d..67426a88bceb 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -484,7 +484,7 @@ vt9p_modevent(module_t mod, int type, void *unused) return (error); } -DRIVER_MODULE(virtio_p9fs, virtio_pci, vt9p_drv, vt9p_modevent, 0); +VIRTIO_DRIVER_MODULE(virtio_p9fs, vt9p_drv, vt9p_modevent, NULL); MODULE_VERSION(virtio_p9fs, 1); MODULE_DEPEND(virtio_p9fs, virtio, 1, 1, 1); MODULE_DEPEND(virtio_p9fs, p9fs, 1, 1, 1); From nobody Fri Jul 4 13:28:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGh0fXgz6157C; Fri, 04 Jul 2025 13:29: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 4bYZGg35Cjz3MGM; Fri, 04 Jul 2025 13:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jjo6ayu7+Qlide4b2WNsQq+tofGF8UZjlTi/+30t1qM=; b=hjwEpc/nBwbis/k2mpoZnUtKdvYqNK5yl7Mz9RV3p6IDLzYKGF+QBsLKnmDQ+G/W1u5B0g SadQY4phn8ObUrZYoCkYfmJHw6fGwg7cMYBVLnZmEetIBAG76TEBSMgLZ+5OOVoqhxfVcu JutXlV376Y10aKffD6Z9vl/MuUITF8RgGOifevs3iF42s4zjvEGmg4dUe3BnMjYKWZOhr2 1XoHGCLxCQdFTu/qxAzEcH+weMAR+kKMejAQIiKMu3CO48Vw342Ge022uYM5OKefQLhpqz 3Y4Quvm/RNgI2orShyUnAu1HljvcYPnezlVYTTp5timxaPKTHHeVpVfYxGMMOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jjo6ayu7+Qlide4b2WNsQq+tofGF8UZjlTi/+30t1qM=; b=ZF+E2aM3fBcOqgTJ269psMZ2UotgY/cra6Rje5Rq7A/ln9ZqR7J5n8e1MoNDei/tbf2Ubk fOUwhGNvQYPRZ7fojj03liP+3PP7c2cqFJFVJJ0tyxltCPdJWRifKVgzBDHOJeDOl5DRJb v00dMrMDV9rrkS22SwhdVm6sj0Twig6kp2oauekUHIygK0UDEPcnh8IP1FbIE6hhNTFmPk IK9QO2CPZSq5/kpPEHUAn+J6fARhX76A6WjA/xaupShA41i9UAHYU6FeFZihnGXPBOjBXd t+aMt8rpYQTqxuj1N8vFBfy7oRPGd2tiN7Ax+syB7ccm7Ir5oPNeZYLX2EXFXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635739; a=rsa-sha256; cv=none; b=we2RTFB191s41wXzNgQghN4u1K8i+MciV3ZqImM5ayJXz8do75dE0aGdMVrMf7JtsuKVun +tyLgfjXhLftDwlRlsrd7Lm94H19hXZGz+VRZTHirDdcDrPPaxLryywSnJdYMOzK4O4fRs 9IfH2D+oxiasA3y5FqFYj9xrUFeCXRafLSN4tqh3AbJ6oUwnuTQOBPcjC0vdY2Eq5ofhao FxPwNrJYlPx6fPTm9qCXYoYf6Z7xiEJ284NWIyugQm5QKOwRXLUkb9O77UjAqHTcucFqsV du8jc0XaqSb60QDNH9xVRe2d4PCznMXDeb1WosCUsc3967UFjsjAiGdJM/lB1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGg2jCKzs3t; Fri, 04 Jul 2025 13:28: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 564DSxDA006272; Fri, 4 Jul 2025 13:28:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DSxNk006269; Fri, 4 Jul 2025 13:28:59 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:28:59 GMT Message-Id: <202507041328.564DSxNk006269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 256be6bf6c5d - stable/14 - namei: Fix cn_flags width in 9pfs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 256be6bf6c5d62c60cf4b95ac84b3b6ac7db2e5a Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=256be6bf6c5d62c60cf4b95ac84b3b6ac7db2e5a commit 256be6bf6c5d62c60cf4b95ac84b3b6ac7db2e5a Author: Mark Johnston AuthorDate: 2025-05-27 13:29:14 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:07 +0000 namei: Fix cn_flags width in 9pfs This truncation is mostly harmless today, but fix it anyway to avoid pain later down the road. Reviewed by: olce, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50417 (partially cherry picked from commit 0d224af399a66f00a5b33e5512fc018062cabf1d) --- sys/fs/p9fs/p9fs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index cfb50c704019..56bf766ef801 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -222,9 +222,9 @@ p9fs_lookup(struct vop_lookup_args *ap) struct p9fs_session *vses; struct mount *mp; /* Get the mount point */ struct p9_fid *dvfid, *newfid; + uint64_t flags; int error; struct vattr vattr; - int flags; char tmpchr; dvp = ap->a_dvp; From nobody Fri Jul 4 13:29:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYZGj0GS7z614wy; Fri, 04 Jul 2025 13:29: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 4bYZGh4b3Xz3MWX; Fri, 04 Jul 2025 13:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VqVX0PnXeU9UtB8XDqkpr9EF2Y7Sy9LLwywuOWzOce4=; b=GuOsa+tFiGNKtCNjOEr466pKry4iXA4Jflcl7p9qad7B3VP9F/714+qiDzWSoyzag5RNi8 qVNlDEu1Fp7Zcn/hsonx077rTWgRXBiRdFXlceA3q2erTNqE+2kVxYN4RVDHZDW6O48xHz SX8ELrh5JPSJrOH/6T0eNhHMqpEP3XQmt2q7YEbO3BF7xDj7GVr8z+AuGM/AMVJ8mjC6aF d1++vLLGr4w1v+jENRz5xrfZcWHDZpnva1iM6t5V5L8y6upw75bxGfgKHqoJMuFhgqNe9Y m/DlWbtjQz9vWornwLdbN72lhUcl7iDSZsAhJS5rXq+vGdKYUuKQXw56lYFLUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751635740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VqVX0PnXeU9UtB8XDqkpr9EF2Y7Sy9LLwywuOWzOce4=; b=UazRQWHepUK1DOu5OiOhQZMPhTTZvv/pLDcaTZegVkVs0k6yrGjFoS9R174La5z8Dwx1yz GJnrlgbxrQ9xrVTb9FzXodCWbLWT0S/OM3SeaKaFxiJUmetslLCuAiUxgBhKL+0Ew4uOHf EvhcoAQ5yuiA5k8yot2M/6o41+lQrLWpLHL+CXTiV8F53Vi4LNfk90s08oyliv/loFKsCd TDHyz5WZDVwYepq4DwgMSvwM1x3KNCbebZJIcocCNgxsA3mj4a0OHGcG2criboNVnoChE4 AKJheQkHFRsxfsKA4WwujnObOsFrdWu/JPl55ZwBqOCiVkZjBOt0BRnqJ5ESqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751635740; a=rsa-sha256; cv=none; b=DIxQJ4mAdViVIpYSa+wGNeGuh5f2uhDNdDfaXxK9l5wrV+DVm8I3BvpxyglltqOXXIshi0 f7bpTvMz9eMSml2k4NAE1oCRRZ7qGF5yqfJfopegw4k8YK54oJ2VIE6jlO8c+VwbpAsLTd FzsTd33ZR9cQgXJUmxVb+77byvxyL56jus0iwJw8pr8ZHXpwmIl3czo0p7Y6/1FalZszR6 fvElAvOBIp+qNFECefWhUMm2aaNnTcswauS6SCOYvSrwqTzCDoi7gi+/8E5Gx/oePmNtZc G4LsNZTXEPaNhYUz3dDcog6yEjlicMJFQx7EjyCjkNwi3sbzFy5HDFHwYlIDOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYZGh3xjHzsSF; Fri, 04 Jul 2025 13:29: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 564DT0t3006313; Fri, 4 Jul 2025 13:29:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564DT0ap006310; Fri, 4 Jul 2025 13:29:00 GMT (envelope-from git) Date: Fri, 4 Jul 2025 13:29:00 GMT Message-Id: <202507041329.564DT0ap006310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: f2e6f2444098 - stable/14 - p9fs: Call VN_LOCK_ASHARE on new vnodes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2e6f24440984dce314a8eb3f9009cef3aae62b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=f2e6f24440984dce314a8eb3f9009cef3aae62b8 commit f2e6f24440984dce314a8eb3f9009cef3aae62b8 Author: Mark Johnston AuthorDate: 2025-06-13 19:08:09 +0000 Commit: Gleb Popov CommitDate: 2025-07-04 13:28:07 +0000 p9fs: Call VN_LOCK_ASHARE on new vnodes We set MNTK_LOOKUP_SHARED on p9fs mounts, but disable shared locking of vnodes (i.e., LK_SHARED requests are automatically translated to LK_EXCLUSIVE. Reviewed by: kib Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50759 (cherry picked from commit 5defdd5342c392880e3917ba0873fb49ddafc4c6) --- sys/fs/p9fs/p9fs_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/p9fs/p9fs_vfsops.c b/sys/fs/p9fs/p9fs_vfsops.c index f674c866ce9d..3451bc052187 100644 --- a/sys/fs/p9fs/p9fs_vfsops.c +++ b/sys/fs/p9fs/p9fs_vfsops.c @@ -345,6 +345,8 @@ p9fs_vget_common(struct mount *mp, struct p9fs_node *np, int flags, P9FS_SET_LINKS(inode); lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); error = insmntque(vp, mp); if (error != 0) { /* From nobody Fri Jul 4 18:22:54 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhnq0zyHz61jKQ; Fri, 04 Jul 2025 18:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYhnq0Ny8z3n57; Fri, 04 Jul 2025 18:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cD+6cai6Is1k76Tf8YgKI0f1zU8/lktZD6lDHf76eBk=; b=gJgybJmp5p61dzjqbykrwLKUnblHhUnTiaioxBm4idQWpo7Rhoa3lciFywuiRVOPR2G4vx U4W2MN/WRxFIskB00b7AYJ6tPy5lhzkurwK9zZyWjE2lkRyO8+ty+xtGiOPw52zVrVL6nO HW/D/zWJqZTH9MZgB0c5/tUMNHyT0dQCA9Dnbb3nAKVyOMiAYvsAiYiXtpPj5ZjS5vtwbT Hr1RTOqrpRPA+p5LFyoTNbpfCuta6yvlaQ9hizgaJPuzw7T0HMKn9Z0vD/YLEBzB3FzSBo 2NXfCbZR70L1CMGHbIIFO06Y8+uNGYuB1vuIYu0AS/9aw8AvTWZs2S/+3/o7lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cD+6cai6Is1k76Tf8YgKI0f1zU8/lktZD6lDHf76eBk=; b=qzJDGrIUfa0yiMdOB88SahRkQfl/U1MJwS1zs56advNRbAtXBE10U/ch4UFeOZIMd9U4NC 2l7kljGbfSMLDC9kQBG40oa41i+MQ5gWMKMsBsv2Z5t7exiX92z85EQXKF8Q1WQ9Zyck3E kwgXBnoW5XBUBswGLx4HAW3HyC9r5gZGYpcqqxgqSEN8fN591mnXO2YuAEntdQgO+wZdNm CWwvb4ItnRV3AvW67t2kt0GUXeZiMHkQ2PCZkGDfl+G+hsF60sRHzGxd0HbKuj6wSBa4jH Pf6HFGxSHzOjOv8oetVUMxkEyPdpr4kIRKAZ9J+Jr0natJrckfe0knzttRLmaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653375; a=rsa-sha256; cv=none; b=iZxbV3PXUyo+p1H1+uYM2UpQ1d5RYR5ZSZg6FTpM1yrpTLv80yHI6knH+r/OPFArM8hZfW U9gbiH0mKXXEEABXAf4++dE8SeKiWqaWPLSr9RkY6OcQnowqsnBJEOK0/O9/TxKRSqjUpX 5cy1SxT0GxKk0q9k9IpFkZShrLSoc+PtMiM7kRD2vhk5NfsmGltOMjqCkaDFV3olLmZltb RohavDan+R7jxOsIQAmMb8jwXQRoNZsrsZ7HptBWNbcfyp5858M1pvFV8MIwvUo4cJcslV H+zx0cq0IXR6qv0EqEUrQEuBTYjjPWvdQ3hE3BJBPNRR8clX6zECHRYD9KaVRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhnp75GBz126R; Fri, 04 Jul 2025 18:22: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 564IMspA069322; Fri, 4 Jul 2025 18:22:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IMsm8069319; Fri, 4 Jul 2025 18:22:54 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:22:54 GMT Message-Id: <202507041822.564IMsm8069319@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: b59d777bc7af - stable/14 - bhyvectl.8: Polish List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b59d777bc7af2ac815d78a4408120e96e7ec8319 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b59d777bc7af2ac815d78a4408120e96e7ec8319 commit b59d777bc7af2ac815d78a4408120e96e7ec8319 Author: Alexander Ziaee AuthorDate: 2025-05-21 16:29:39 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:02 +0000 bhyvectl.8: Polish + Add how to find open VMs in the example, linking `apropos Pa=/dev/vmm` + Move note about additional bhyve options after options for flow + Reclaim some space by shortening to + Align options list width, tested at MANWIDTH 59 and 80 + Remove unnecessary roff quoting and tag SPDX MFC after: 3 days Reviewed by: carlavilla, markj, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48401 (cherry picked from commit 22348fb999385edaef38ce5e4308f44135f0326c) --- usr.sbin/bhyvectl/bhyvectl.8 | 46 ++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.8 b/usr.sbin/bhyvectl/bhyvectl.8 index c5282a98a767..550c4f10d8e6 100644 --- a/usr.sbin/bhyvectl/bhyvectl.8 +++ b/usr.sbin/bhyvectl/bhyvectl.8 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2015 Christian Brueffer .\" All rights reserved. .\" @@ -22,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 4, 2020 +.Dd May 8, 2025 .Dt BHYVECTL 8 .Os .Sh NAME .Nm bhyvectl -.Nd "control utility for bhyve instances" +.Nd control utility for bhyve instances .Sh SYNOPSIS .Nm .Fl -vm= Ns Ar @@ -37,8 +40,8 @@ .Op Fl -inject-nmi .Op Fl -force-reset .Op Fl -force-poweroff -.Op Fl -checkpoint= Ns Ar -.Op Fl -suspend= Ns Ar +.Op Fl -checkpoint= Ns Ar +.Op Fl -suspend= Ns Ar .Sh DESCRIPTION The .Nm @@ -46,17 +49,8 @@ command is a control utility for active .Xr bhyve 8 virtual machine instances. .Pp -.Em Note : -Most -.Nm -flags are intended for querying and setting the state of an active instance. -These commands are intended for development purposes, and are not documented here. -A complete list can be obtained by executing -.Nm -without any arguments. -.Pp The user-facing options are as follows: -.Bl -tag -width ".Fl d Ar argument" +.Bl -tag -width "--checkpoint=" .It Fl -vm= Ns Ar Operate on the virtual machine .Ar . @@ -72,24 +66,38 @@ Inject a non-maskable interrupt (NMI) into the VM. Force the VM to reset. .It Fl -force-poweroff Force the VM to power off. -.It Fl -checkpoint= Ns Ar +.It Fl -checkpoint= Ns Ar Save a snapshot of a virtual machine. The guest memory contents are saved in the file given in -.Ar . +.Ar . The guest device and vCPU state are saved in the file -.Ar .kern . -.It Fl -suspend= Ns Ar +.Ar .kern . +.It Fl -suspend= Ns Ar Save a snapshot of a virtual machine similar to .Fl -checkpoint . The virtual machine will terminate after the snapshot has been saved. .El +.Pp +.Em Note : +Most +.Nm +flags are intended for querying and setting +the state of an active instance. +These commands are intended for development purposes, +and are not documented here. +A complete list can be obtained by executing +.Nm +without any arguments. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Destroy the VM called fbsd10: .Pp -.Dl "bhyvectl --vm=fbsd10 --destroy" +.Dl bhyvectl --vm=fbsd10 --destroy +.Pp +Running VMs will be visible in +.Pa /dev/vmm/ . .Sh COMPATIBILITY The snapshot file format is not yet stable and is subject to future changes. Backwards compatibility support for the current snapshot file format is not From nobody Fri Jul 4 18:22:56 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhnr44lWz61jSF; Fri, 04 Jul 2025 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYhnr1rQfz3mxF; Fri, 04 Jul 2025 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Li8AcV2RDeNUxYFSp2QpNE1LH+MclFF0wWCT6vtVr/M=; b=QWs75LxFkDLh6lJ2zAjOpeEBWRG+CqEtDyNLNUuWkhq9YpuOLEGImliiF9T5qeshIWUeTr JJHHGpl8kNjDh52ZR7uxYn0uKMVFOXyijGKIfa8H2aYUBfSPWVTnNC5jNBzX12El7ONFRD Z0m0TPrEx4ISPkHNWPnfnfhcrarv3epZg8ZicrqteKf5uL9zO4Kl7vfSWVtpZByy/C+sN+ WG8ch/CbSiV0gW6olYC9JAeGKZ3/+8YOLszbJyOTSgl6EyHyGnT5tqoOVGePBlMBw5PwEt 9fVZKYeGeX0SVW4qYygaWOZqVloy8ExKLZ/CF+xFrVpLCkU+aGVRIkYmqTEQxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Li8AcV2RDeNUxYFSp2QpNE1LH+MclFF0wWCT6vtVr/M=; b=Eig3XDH7+rggNDNQWR/A0DjBlI+l1Yl5rQ9/zK6dIaOHmif+xKkyt+QYxA8V5GiG744sIY 2UjdPdzQcmem0SUuWUqPSZ2nhgB6ONoNT5JZkK9tzluieQ53ulvMqr3SWuX7kwokxXZdti HRwNCOZrGFHNWV4SrjjVNyc3G/Twsy43Ul4afK0BH9UwZSkZnjXZ/oTWG/ngVEVt+g6Zw/ xEG615RmFSDMcC8z5Jd+xWxxzZpfio9CZgcrsGeie/yscrYSonEzOQN0bvumwbiTm/w+LL zN3cGisasVBr51gFhvqx9n/Oq0c3Ppt6IRvJ5fYvI7Gwq9e8SE3c4EmTxD6A+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653376; a=rsa-sha256; cv=none; b=L3M0mm0s3drE1dn6NgJNnwvpxuED0nBzTcB+4XBHxXK0ja9+0YdThVf+cAa9FojJqwJpgS NaxKPumuo4cjlKFY5IAv77StJhD93cZkIHmwp7pOIj6xkfM7Px9VEx24m8IZbrQ6T8XUjV I1wNtg0zJlUOb/7Ujt+Q0oiHADJrX4u9gxSMxv9qsl2xV2ss0kLFX/QORlHJgQKeB0fPHq 45Yh/JpPqniSmEd71EXXV7naiEuPc6Ipr9bYq+ncOgNJlPdtpSZwKI0bQqBS6kO1mz2UnY Xc+P2mFyeYbykGlaNSmPBm3oLP1gc+pTuPXJp1Khr3rPQZUaWsXJEBGadFdxSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhnr0dvBz11wt; Fri, 04 Jul 2025 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 564IMunG069357; Fri, 4 Jul 2025 18:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IMu4u069354; Fri, 4 Jul 2025 18:22:56 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:22:56 GMT Message-Id: <202507041822.564IMu4u069354@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: 9c3d1064e17e - stable/14 - SPDX: Tag BSD-4.3TAHOE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9c3d1064e17e533094d6838209b3b3c8fe2b6e50 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=9c3d1064e17e533094d6838209b3b3c8fe2b6e50 commit 9c3d1064e17e533094d6838209b3b3c8fe2b6e50 Author: Alexander Ziaee AuthorDate: 2025-05-15 13:53:21 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:02 +0000 SPDX: Tag BSD-4.3TAHOE TIL traceroute.8 has one of the oldest liceses, predating BSD-4-Clause! The SPDX tag was not even on Wikipedia. These are all the files I could find in the tree with git grep that look like the license reported on the SPDX website, including one that was misfiled. Ref: https://spdx.org/licenses/BSD-4.3TAHOE.html MFC after: 3 days Reported by: brooks Reviewed by: brooks, carlavilla, imp, ivy Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D50362 (cherry picked from commit 7098712bbfd60df9db324decbc1a5dd8f751356f) --- lib/libc/stdtime/strftime.c | 2 ++ usr.sbin/cron/cron/popen.c | 2 ++ usr.sbin/ppp/arp.c | 2 +- usr.sbin/traceroute/traceroute.8 | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c index d19a70c42eb4..5f22b240cdf1 100644 --- a/lib/libc/stdtime/strftime.c +++ b/lib/libc/stdtime/strftime.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4.3TAHOE + * * Copyright (c) 1989 The Regents of the University of California. * All rights reserved. * diff --git a/usr.sbin/cron/cron/popen.c b/usr.sbin/cron/cron/popen.c index dfa90252fe22..09313d594d7d 100644 --- a/usr.sbin/cron/cron/popen.c +++ b/usr.sbin/cron/cron/popen.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4.3TAHOE + * * Copyright (c) 1988 The Regents of the University of California. * All rights reserved. * diff --git a/usr.sbin/ppp/arp.c b/usr.sbin/ppp/arp.c index fa45502f488a..3502d714a561 100644 --- a/usr.sbin/ppp/arp.c +++ b/usr.sbin/ppp/arp.c @@ -2,7 +2,7 @@ * sys-bsd.c - System-dependent procedures for setting up * PPP interfaces on bsd-4.4-ish systems (including 386BSD, NetBSD, etc.) * - * SPDX-License-Identifier: BSD-1-Clause + * SPDX-License-Identifier: BSD-4.3TAHOE * * Copyright (c) 1989 Carnegie Mellon University. * All rights reserved. diff --git a/usr.sbin/traceroute/traceroute.8 b/usr.sbin/traceroute/traceroute.8 index 6b46ec05a1c9..2ed3149152e3 100644 --- a/usr.sbin/traceroute/traceroute.8 +++ b/usr.sbin/traceroute/traceroute.8 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-4.3TAHOE +.\" .\" Copyright (c) 1989, 1995, 1996, 1997, 1999, 2000 .\" The Regents of the University of California. All rights reserved. .\" From nobody Fri Jul 4 18:22:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhns4XCvz61jH0; Fri, 04 Jul 2025 18:22: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 4bYhns2824z3mxJ; Fri, 04 Jul 2025 18:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ganKI8ChrEmYbIAeblhGVU3HmpKykoqu24Y9x/nazTM=; b=hn9OoG3/OlidycFEkiNTHWoe5r6LPxi0J1XAgWKSS0Q62eHHi19Q6O4XfvnCCaFR0NVT2/ B+/Ka/saXO05ULQJ+B7yVtv+lxk8eQretbZTIACMQ8s7az5sU0TBsPDNM83LKKXQVeRRZf i9fjrpyYHLdSsiaUVqmXrCf2jQXnEQbxLtCsoGa2O+wlVmQGjaL01LTbgnu1lbsKhQfpWl kI06EOiQXbeM7plMHiOCvHNjWd4c4tFF3uIxXh3qGNrZjuA5RPvTySc76cmnknWa+fJP8P xpLLcNwcqTPdOSet4vUs+tFv9HJfsneZ1RqAy5R0TQ81FHImF2W9F1XKUWNXoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ganKI8ChrEmYbIAeblhGVU3HmpKykoqu24Y9x/nazTM=; b=c2f+ljisjF35KzwGHCnl7bFx9M3H/pC5RZqC0hxhRH0f9hYKEoGptLio844ihqI4OeMUo0 XJ0e3xz9tksV0Dv0pCwv17J613FmkN68ge4CMZ5F+kEQlT1tQojPsWAmR3DLtjdTrPa7Mz dehK0YDiHt8ivQih3daXasxVlsu29a6B+v1pt7KUbeA55BtfQHf2F8oBjhNRzTq3JYM+P8 YtDqhvAm4omAEQOLExDns/FOW1rXsOCpPqTvM3NWKJ8/64lpJ/K6/b+8LlNURphoVuNOaV 8ymoW2egWIRRJN8iq1/EDOvSwmuLCKC5ANBqSKVOFbpiJd9N2/Ga12nJN/MxNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653377; a=rsa-sha256; cv=none; b=Xd3Ma6w9XV0oubASpGYpQd7zN966RrPe06lHGZoYYaD9TYllRWbH+W/EBnFTMq7PQw5pxk v18BS0Rrxi8gIhwYzNmPNXR/eKlXzpaL4WTjkgJPXLIvhhRjIXRHyQU2NxiW7UIefhIICd PqfjJbXcACMpN0wCSNwkB5m5eXLHPnEAdf8PyWgAiaDtWbYi+t3ligZXvBSsG9CBCHInJg 9ihoUddaWP9etaElUVSUhC/zbzWgIDbqBDnJpwcHhhTiHZ5ks9DDxLfuuNi41I6tLmT8gv rPbpstpPbWcC4R1S9Yt89KltRrVpwFF8VATdbpeaWHRM+hed563BIYSdVAx/Ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhns1Y9mz11ZT; Fri, 04 Jul 2025 18:22: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 564IMvnA069393; Fri, 4 Jul 2025 18:22:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IMvEW069390; Fri, 4 Jul 2025 18:22:57 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:22:57 GMT Message-Id: <202507041822.564IMvEW069390@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: 5f35cb47c684 - stable/14 - build.7: PORTS_MODULES incompatible with pkgbase List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5f35cb47c684493369100539c8ca35970bee4ffe Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=5f35cb47c684493369100539c8ca35970bee4ffe commit 5f35cb47c684493369100539c8ca35970bee4ffe Author: Alexander Ziaee AuthorDate: 2025-05-21 16:40:29 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:03 +0000 build.7: PORTS_MODULES incompatible with pkgbase Add a note until we can fix this. Reviewed by: carlavilla, emaste, ivy Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D50355 (cherry picked from commit 1a060e4f1ba9b9f9363e291aba2134b37b938fae) --- share/man/man7/build.7 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 9a90a6dffafb..f180dc501f41 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -654,6 +654,10 @@ as part of the and .Cm installkernel process. +This is currently incompatible with building +.Pa src +into +.Cm packages . .Bd -literal -offset indent make PORTS_MODULES=emulators/virtualbox-ose-kmod kernel .Ed From nobody Fri Jul 4 18:22:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhnv1zJzz61jm2; Fri, 04 Jul 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 4bYhnt3Q7Dz3n2v; Fri, 04 Jul 2025 18:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x1+3IM4F9yM5tFuA2g78+VdFZLNmjxG3F1wUsqgfoqs=; b=TIL0bmY0tZXb8ssAl9v0W5/BRJH0TIFKRwcrWCa1xgZiRq396HcCqpxk9Azbr1rxcs66mC 9HzgL9AoWRrJFfa8l5oKaeP5LqfNwuB+M1iUOrxhCGk3MgHSXxUilGpF2DLNl0QNKBjqLw LXNUI4lUeffHD4DyvJKZG6hB+CS/aobeYwut5WME9ndNM7gHIUtTX9m8hFDvr3mCbkdU65 wmUWi/R4xbaBES9NyUsAZl5CQ9BQGZad3g1pcXSocxZSXXFhOPqyMov0iL0v7MPsKFxF4R I6Oen+JlGHgwS5g8f0l3Wb8YcSqovhoJ6orODNR6oYUXY3TwUxHUBpLOrl438g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x1+3IM4F9yM5tFuA2g78+VdFZLNmjxG3F1wUsqgfoqs=; b=cM76XbOv0jV7SgKFIlnXVMYI5aieSIkkS3GQEUwAsFqQkR31wAOBwmiIQSjtn20gWw8lbq FI8u6hHLO37iROVyC6+ElUaBs483EKqZ1tIlSSkgxR/TEgNA+irqz2G1FELcqNrLzj43VC yO0vIurPvGZftyHk74neQ8XphCATFjhm3Wg74NjTlKByHPGvTaC04c21KWj6uLZKLW9RIW yD+LG/P2R/C+Wc60srORESib5EhFBC08SxtOv0wZ3AX8Hy68tpfnKdB/b1jH/lLt6oQ9Cs zCc3H6xU5d+GhFEIKhH0cZfbMVEcfEk1QsLArtmEs/FR/dBSE/tCoZibFT3xXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653378; a=rsa-sha256; cv=none; b=MYM292ZGYngOj+OjgNPEgwjud+b7IP36JPwmeoD6Uj786ep4d66QK/TT1oXFxB+GxFY+7P 6yw7r1B1FrVz+ZVc4RC3BvI9i4jzD4prDFemBAYGEhbBwqBzTPCDOmoQT/b6Gl1EXxag5P 5LXdqD/aR9CySBquKRNpFb8PfP+r5a9nYDwqXw75HnJj1LyU6S4QIziw4F4IWUUSAYrfqf rlMy6Y5az8BWI+7mYQNu4QXaLgH71BYyj/hY8sOworFpSQ110nNxCeiuq8f1Zeyu6/q69N IABrwlB9dLCnQqJIBspKUXjzwWxAdpbH2GzAcGCmx4vAJn5RaMWGRsvy5wTbMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhnt2pCSz120T; Fri, 04 Jul 2025 18:22: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 564IMwQd069430; Fri, 4 Jul 2025 18:22:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IMwtU069426; Fri, 4 Jul 2025 18:22:58 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:22:58 GMT Message-Id: <202507041822.564IMwtU069426@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: 621a175adf56 - stable/14 - make.conf.5: add CPUTYPE?= note from UPDATING List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 621a175adf566b9da8abdbbd1f839112f9432fab Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=621a175adf566b9da8abdbbd1f839112f9432fab commit 621a175adf566b9da8abdbbd1f839112f9432fab Author: Alexander Ziaee AuthorDate: 2025-05-21 16:43:37 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:03 +0000 make.conf.5: add CPUTYPE?= note from UPDATING Cross-compilation needs CPUTYPE to be set with ?= to be overideable via make targets. This has historically been mentioned in the FOOTNOTES of UPDATING. Note that in the CPUTYPE documentation in make.conf(5) for discoverability. Leave it in UPDATING for now to create no regression in the doc there. MFC after: 3 days Reviewed by: carlavilla, ivy Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D50277 (cherry picked from commit bbc0b39ef7df3007c78eec8822213fe77aae4d41) --- share/man/man5/make.conf.5 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index ebf1b8a119f7..46bfa91d36ba 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -158,6 +158,15 @@ and .Va COPTFLAGS to contain the appropriate optimization directive to .Xr cc 1 . +To set the +.Va CPUTYPE +value, use +.Dq Li ?= +instead of +.Dq Li = +so that it can be overridden by +.Xr make 1 +targets. The automatic setting of .Va CFLAGS may be overridden using the From nobody Fri Jul 4 18:23:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhnx26WMz61jmF; Fri, 04 Jul 2025 18:23: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 4bYhnw6Dd2z3nBX; Fri, 04 Jul 2025 18:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UUV2jecN+9XxkbodW8ayiB5tYcqLQuowo1ixQ1AL7vU=; b=Trl9GUIM/xjamZ0DQnLKn1E2PB9wU/BMRQfgI4/BnKxoVNiOzaZmrg5pFZXD1F7hnebXjL GERJLrWRsRpryVxVBFU2mq8MLBv5AgP6B1ekErs3/dlxsLa7JiX1kWJ7NjDFgDvrWL1gLY FElOjSY1GhfvR9ILi0opc2tbIn7sJNRtEKp6mzIAw6mNq6DOl2QSmFHLsBKhuVPXXfB+ck p+WL2ugUeM4Ro+fgzY4z+IVpCk8cbcLDdgGec7GgJOqIszUuDPnytqw3tHBfBP4eekGMAV dq1SGyVgvFO7RICmEmVmkAUtl15+AF9cNh8PAayPLNMWzUdexwM6zNKo7P05lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UUV2jecN+9XxkbodW8ayiB5tYcqLQuowo1ixQ1AL7vU=; b=GG+wYLkcQbjgGs0uPFA26b7sgWJm8crZ4JWwWeaBgy2yETD6xCqwGDfkvrgCH9y9bFGr4c GTIhFB0I+FRvkxigbfYVTpNdZzgxrXyjAnaONdT77WBbezLEGD+UN8X09yc3CkS0krAtOf sdAnFZiXgaQMPtUTVeOn/Mdh6sE9xScvDDbkaiSjx3/kjCB0EdLsqzlR4ASqj1Ow9+dU6W kCwSCfQQjY/o293cdvHD7ZxnmQtNw7MszTCZppRdoA6gV/zOrGrFvI0DpGTTT43FCst3Kn 1InPq/DtknmZ0TBX4vO+BIeMVxbCljmIwkbSIlrmSx/BCUbOZnxg5YgYHLcSEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653380; a=rsa-sha256; cv=none; b=o7RIzozO8jXZlfgoNex/gqa45VxnhxQQo2ZDdRYpR+KXt7/jCzUGneRWvIBFFdc2cONyHq JKENkUT0NMgEgAjBJJacY+ncvazN/Stvc4KsAWWCuEsSLXtimV3TUViIYpVBqhySLB1MDe ABqULfH7kOwsYMqTU6YGdpp2OiQbArOuf2wDUy/1Ut+R9UjgeYZZ1Ty9Teqhcw5hiwjUBs xXHn/qCT/lr3LfBhu+rIcXcz0ZBp/NTAwEGoxl1TtEcDo0OlvV/d0tUZE6kvXOZWfEomW+ ERDAW4aD2A3L+98TD2jHc910YXiiJx9MSGVZ3Wff5sAxEwF92cfq/nGQYya0VA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhnw4Jxfz126S; Fri, 04 Jul 2025 18:23: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 564IN0rg069513; Fri, 4 Jul 2025 18:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IN0Bd069510; Fri, 4 Jul 2025 18:23:00 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:00 GMT Message-Id: <202507041823.564IN0Bd069510@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: 0961446b2382 - stable/14 - pam_xdg.8: Improve usage and standards List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0961446b2382ab9aad9fe2a94029ee39d3ea5082 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=0961446b2382ab9aad9fe2a94029ee39d3ea5082 commit 0961446b2382ab9aad9fe2a94029ee39d3ea5082 Author: Alexander Ziaee AuthorDate: 2025-05-28 20:43:03 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:03 +0000 pam_xdg.8: Improve usage and standards Explain the directory created by this module, its usage, and a bit more about the standard. MFC after: 3 days Reviewed by: mhorne, manu Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50440 (cherry picked from commit 616bb0b230835e8b88d032e2026854ad031afea2) --- lib/libpam/modules/pam_xdg/pam_xdg.8 | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.8 b/lib/libpam/modules/pam_xdg/pam_xdg.8 index 9b97d3626531..9b335751a9fb 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.8 +++ b/lib/libpam/modules/pam_xdg/pam_xdg.8 @@ -22,7 +22,7 @@ .\" * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" * SUCH DAMAGE. -.Dd August 22, 2024 +.Dd May 20, 2025 .Dt PAM_XDG 8 .Os .Sh NAME @@ -35,17 +35,26 @@ .Pa pam_xdg .Op Ar arguments .Sh DESCRIPTION -The xdg service module for PAM sets up the runtime directory according -to the XDG specifications. +The xdg service module for PAM creates the runtime files base directory +according to the Cross Desktop Group Base Directory Specification. .Pp By default the directory is created under -.Pa /var/run/xdg/ . +.Pa /var/run/xdg/ Ns $ Ns Ev USER . .Pp The following option may be passed to the authentication module: -.Bl -tag -width ".Cm runtime_dir_prefix" +.Bl -tag -width "runtime_dir_prefix=directory" .It Cm runtime_dir_prefix Ns = Ns Ar directory Use an alternate base directory .El +.Sh ENVIRONMENT +.Bl -tag -width indent +.It Ev XDG_RUNTIME_DIR +The location of the runtime files base directory created by this module. +Note that the module does not set this environment variable. +.El +.Sh STANDARDS +The directory created by this module conforms to the +.Lk https://specifications.freedesktop.org/basedir-spec XDG Base Directory Specification . .Sh SEE ALSO .Xr pam 3 , .Xr pam.conf 5 From nobody Fri Jul 4 18:22:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhnx0jyRz61jSJ; Fri, 04 Jul 2025 18:23: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 4bYhnw0PDLz3ms5; Fri, 04 Jul 2025 18:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iIQQuig4zZfVrkEqsujFFRYeokKAIoDKKpNtIYl0Jhs=; b=hrhnuQL/gZSa+6+mHMqNztndOagXVCxoD0uUmW5FMQ8WY1DRSZLo7c0vpsWc/Kpjr+VzJl fp37BrD4hvzxueL75RE8RbPY2c5021FNdVvZ3rlFLV4GlcE7dcZ/Iw3unPQLPrl+SKsK/Z JSDo1vn2pgVmJddpvaTM22r2xmO8cwqG6kfYV1L2QsFYTvF+vDbnPPvQez0ShkLdPyc53V IIY0fQetXW/U82YDJBYqZGnVSrK+A2ZKf6AsAPIJnzk+OiLAAzRLD+2dL909pMdPg+WE8d gjXT3x2i1oD+l5HZAzm7xaqbvdRxgm5yPyLzCS4ACtXNXiPS9/PPGukRNCSJKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iIQQuig4zZfVrkEqsujFFRYeokKAIoDKKpNtIYl0Jhs=; b=yip2AbXT63tax95JqjAYDOiX7fLziiX2Lta1eGo/G3P5TVBl3WnoHLr6azAxjYfP12eZnH hih4+rStNmbkZ6MDdOAilzO7ClPl22LwiMn+UXJ45Dv6QAf07pyZ/c/Rad6ToetWIgqm4P wgNarBGQizXnvq5zLmV7ic5+JFgClrz1lTbvDiAe47eeWbbB/vuPyMkygE1Rwz1ttox67d qefMuZA2GRHdgDPEJlsdOh61ad6lTiT7UZvP/xVV5EveFqs70MegHMkAoOwIlB+A17bfSA mWHkerKJzO3Uhp9AyAcEPIrFUkDo0oWBgVf43RnBs3SYgw/qE5gXB0s6byfbEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653380; a=rsa-sha256; cv=none; b=RxjVXij9k95mKhOJeA3H5TebmUseRhQj+UUdYHm3FAcHw7YIz0HMdbPGuvdcMzi8bHbh5l J/MKfd4Y7zEymiVstwV4TJ26NGP7mcfo3jAYuparI7U5KMV018wYaYX5nBk651ABcnCHGC hq3Ff2unghZXjG7TcaVX5oSQlmzMrasBDqFzbQthrfXsYNcFdPyVkLNjDVh0EH8bo4r5h/ AmUIWzXP7MhfTes/1/8i717Fq/ki3HkCpajqnJ2duyCl2PVVU97hnJ9OnSdhozPKrzi+G4 4KDMC+VDoq4mNtXfdpcIzlpHQ/3hCWjuOel2r3iHNHyPeltRkpLHw6YqgAwBNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhnv3lShz11ZV; Fri, 04 Jul 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 564IMxa3069467; Fri, 4 Jul 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 564IMxJN069464; Fri, 4 Jul 2025 18:22:59 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:22:59 GMT Message-Id: <202507041822.564IMxJN069464@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: 132a75025ef9 - stable/14 - scc.4: Improve acronyms + tag SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 132a75025ef91920f46202a95589d7fb30558acd Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=132a75025ef91920f46202a95589d7fb30558acd commit 132a75025ef91920f46202a95589d7fb30558acd Author: Alexander Ziaee AuthorDate: 2025-05-26 06:43:17 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:03 +0000 scc.4: Improve acronyms + tag SPDX + tag spdx + remove duplicated acronym in manual title, reword for consistency + expand acronym in HARDWARE for HW Relnotes MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50528 (cherry picked from commit 1c7f8214e92e40907bf8faf8d43c9db0f98294a6) --- share/man/man4/scc.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/scc.4 b/share/man/man4/scc.4 index 05e9890a0bcc..db0c6deaf6bd 100644 --- a/share/man/man4/scc.4 +++ b/share/man/man4/scc.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2006 Marcel Moolenaar .\" All rights reserved. .\" @@ -23,13 +25,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 December 26, 2020 +.Dd May 26, 2025 .Dt SCC 4 .Os .\" .Sh NAME .Nm scc -.Nd driver for Serial Communications Controllers (SCC) devices +.Nd Serial Communications Controller driver .\" .Sh SYNOPSIS .Cd "device scc" @@ -48,7 +50,7 @@ take care of the details of the communication itself. .Sh HARDWARE The .Nm -driver supports the following classes of SCCs: +driver supports the following classes of Serial Communications Controllers: .Pp .Bl -bullet -compact .It From nobody Fri Jul 4 18:23:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhny2q2qz61jY9; Fri, 04 Jul 2025 18:23: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 4bYhnx5b43z3n1V; Fri, 04 Jul 2025 18:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cs/9NtbSq3NACasg4xutfjbcjsQd1K8eXtwwQND4Qak=; b=TgXxjSTnjSfim8DyUpWRjDIyVWx5fXVGRzNmYzxy6Y5iyY2IsQxq2HulEX1NAwuwejKnA8 HdAIYOJo0OnHqdTD7qTr8+g9SKSdUIuJXxOTSJXHNbOI7YUii4Go5wOnCttb/TDbljeID/ yrWmczPPDYmFGTXbDzlf4xaHBYBQ0vZ7V1TfRHFhcNbKory+c/zPRDe9XxNuH3fkEOZ64+ p09inzSBz3a0cbfjUF5nA6CuHCuFDOBTvCRXZuSsLLzHbwiPugYSBCGXMgq598bjBrWLoU f1ZosJvpb0IBAUPpjwitZE6nEbKhsZFck34Va8sam27zgk9PXYX0wb3G063UKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cs/9NtbSq3NACasg4xutfjbcjsQd1K8eXtwwQND4Qak=; b=hK8vSYOeBn4QiMl9680sYQZRIIDNIHau+iPe2nDCKMoWdXLSPdGSmqLnO/tZbJWJE9XRXx 6nY9zp9tq9Wu9X5Yuym6vIsDS67lL6HEeHan3AOqpvWp3V7BXEKFf4aCtKWkofHiXon8ZL teQrCX/fAKUQOKPf25y1Nzt2dKCY7TJr5BoTo8WdXkp9gF3O9y2ZoTkzgsomELN1FXD6AT 1eJvNlC3ZpResNnlyj+LwZkyBHf5KgbY7WEolPSc2VKYD9SUSAUMWBmoMtWlVLkxLWVQnq cTnyoeCaWzFLK5nUanRlFstxBJHNry8MFDhY9HxSvBYDpDd8g2ADnNznhR4dFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653381; a=rsa-sha256; cv=none; b=R42X0NXPZxZ4EuBV1JVQe0n0usRFUVqft7YTJnTNZpQ9RiziTA2tvT5i4tQxibTnX8j0O+ wiPRhlzsdTkz3Bf8UXTopaTijuZOif6UrTj6ll/eCtXwuuOm4evSJYAgAyB8vu/ct5jEhk R4oBCrgbaMzCtpLYm548D92ot9YBhhkz9GbU0PYPVJ+uRUsArTCYnOOGS2plp+W2jnBWdA 24iaaQlUemutmmxgRWyU9iO4Elec2kx8TNlKRyxjokduPCpXY8V2kPZYkoVcmMtyMWEfqG 9zpxUa4DCy8y1tC2VbbN8srAlXSxopt3yERr6+gGnV29LHpbdWrIkjRPl2vILQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhnx5BkDz11NL; Fri, 04 Jul 2025 18:23: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 564IN1Cd069549; Fri, 4 Jul 2025 18:23:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IN1s0069546; Fri, 4 Jul 2025 18:23:01 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:01 GMT Message-Id: <202507041823.564IN1s0069546@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: 864874b5a2b7 - stable/14 - axge.4: Create a HARDWARE section List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 864874b5a2b72b453f62c753e398187d9bfdc6b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=864874b5a2b72b453f62c753e398187d9bfdc6b2 commit 864874b5a2b72b453f62c753e398187d9bfdc6b2 Author: Alexander Ziaee AuthorDate: 2025-05-28 20:45:39 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:04 +0000 axge.4: Create a HARDWARE section For inclusion in the HW Relnotes. MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50523 (cherry picked from commit e3eae3b1e587ad3e99a064400b57111966a55005) --- share/man/man4/axge.4 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/share/man/man4/axge.4 b/share/man/man4/axge.4 index 9ca268d6ff83..7133ee3253eb 100644 --- a/share/man/man4/axge.4 +++ b/share/man/man4/axge.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-4-Clause +.\" .\" Copyright (c) 1997, 1998, 1999, 2000-2003 .\" Bill Paul . All rights reserved. .\" @@ -28,7 +31,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 4, 2023 +.Dd May 25, 2025 .Dt AXGE 4 .Os .Sh NAME @@ -121,6 +124,19 @@ Force half duplex operation. .Pp For more information on configuring this device, see .Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports the following USB Gigabit Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +ASIX Electronics AX88179A +.It +ASIX Electronics AX88179 +.It +ASIX Electronics AX88178A +.El .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , From nobody Fri Jul 4 18:23:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhnz2hCWz61jKX; Fri, 04 Jul 2025 18: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 4bYhny6bqlz3nGl; Fri, 04 Jul 2025 18:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rskPRGnzSqgBIaRwkNHEHJN41hLSK/PVOyoSk1AKkNY=; b=WxjlaxHbXMCvN+fXaC9A7aQn5VjfJHxOZAnYqRhwGQMJ+YEo14U+FaEtKKYThOvAQnfjJy +3XtM1ifU1fUH8+LlVi/f5+T2LbF/Ky5j+cSEhMUMJJOQCNfpue+0qDBvsCmEsvvTmod+3 dHCCu4SE5pJiI0p6Maz/RHQIHdYNQHRF41Y+oeRHT/VNU1w/L1regl9HkWNEywwQJY5XNn Cl/S1UjkLHKNJOKMIx/8CdZyCR/uvvFlPN6xoq22NiIGw4XKb8mrqSSKgvypLKT1IhQEXT Nh82VzKLQKl8ujX5PRkfjP7A8kCGqDPllkBJlNfDVb96qkoOcmyqDbgSSkSYuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rskPRGnzSqgBIaRwkNHEHJN41hLSK/PVOyoSk1AKkNY=; b=Zuq8++5+WdvQGGarzkom+els0VoPRdB+lOCAc5Rrnvgz7bsZXI5gcmkPuEHIjsWKW+P5de t86DfzKYR0KYhOknWfw/vTvzJpIDKz53j4eziLHyRmwZBBFWt0sHX6bVvvMNrmRLNnwkC6 5h8T0XRe/izQKmwV+4BJSMkf60CqeDmAJP9HwhlBc1SwfHq3xfwYk/e0VUPl3lf5z/u1Ns hBq4DwHhFcPAP2Aw82uWFbF8Uxl8AC5S7g9sQWoUu7xaHZChpWRFegolsWSlVZiKBAIIqb 6n48UVys0brlY24mMu5R5ZtcXT8dxeHP5uz3/a/E12V6nGBORVya/smQ3erwIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653382; a=rsa-sha256; cv=none; b=l4BrWFDW2fdhUOJHRxa13bIXhGqirM5FgDNUXf6+opezG5yxfwnLok87lIcUo7SfhZU03c KVG6hHRA717KE5ZT7UfAzCxz9SebgaoD5SEFgkSi0u5O6lZAUD/jHl8EWO8eCYi3R0r9Sh kZY8QpXWCLO5Za08pr9arREdKunVF+gObbwmHahM5te8Xoz1tZgDpBPm1/qZsrmw+VDXcf 7cFpVg9pDPsdGHPwshbQuixxfouUq1ZxcA+XVlauSaZAz9R0VS/bCICm3klmZXopr1Bc5E QNwouBTOxxQjPQZbiJ25CFanX6nF1L98Df0HG2oj0uQzWkr7nSN/Nv4o/hsQNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhny67jGz11NN; Fri, 04 Jul 2025 18: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 564IN2Du069586; Fri, 4 Jul 2025 18: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 564IN2xJ069583; Fri, 4 Jul 2025 18:23:02 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:02 GMT Message-Id: <202507041823.564IN2xJ069583@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: ce2d22ee11d8 - stable/14 - rtsx.4: Improve hardware, add history and spdx List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ce2d22ee11d81785cbb427f22818df530642a26c Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=ce2d22ee11d81785cbb427f22818df530642a26c commit ce2d22ee11d81785cbb427f22818df530642a26c Author: Alexander Ziaee AuthorDate: 2025-05-28 20:50:26 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:04 +0000 rtsx.4: Improve hardware, add history and spdx + tag spdx + massage hardware for inclusion in hardware release notes + note first appeared in 13.0R MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50529 (cherry picked from commit 7390e96107c81212b75b50e4b5c6cbcf14e34c84) --- share/man/man4/rtsx.4 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/share/man/man4/rtsx.4 b/share/man/man4/rtsx.4 index c9be7a6f21f4..69de84c6d707 100644 --- a/share/man/man4/rtsx.4 +++ b/share/man/man4/rtsx.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2020 Henri Hennebert .\" All rights reserved. .\" @@ -22,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 26, 2022 +.Dd May 26, 2025 .Dt RTSX 4 .Os .Sh NAME @@ -53,8 +55,7 @@ Driver attaches mmc bus on card insertion and detaches it on card removing. .Sh HARDWARE The .Nm -driver supports different specification compatible chips. -The following chips have been verified to work: +driver supports the following Realtek SD card readers: .Pp .Bl -bullet -compact .It @@ -71,17 +72,12 @@ RTS525A RTS5260 .It RTL8411B -.El -.Pp -It should also work for: -.Pp -.Bl -bullet -compact .It -RTS5249 +RTS5249 (unverified) .It -RTL8402 +RTL8402 (unverified) .It -RTL8411 +RTL8411 (unverified) .El .Sh SEE ALSO .Xr mmc 4 , @@ -93,7 +89,9 @@ RTL8411 .Sh HISTORY The .Nm -driver was ported from +driver appeared in +.Fx 13.0 +and was ported from .Ox with modifications found in Linux and .Nx . From nobody Fri Jul 4 18:23:03 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp047Cvz61jmK; Fri, 04 Jul 2025 18: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 4bYhp00n34z3n3r; Fri, 04 Jul 2025 18: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=1751653384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDpkHpY/wo8rZaYLiYGeTGo53ZOeRq4T4bd45om8cJ0=; b=KVKqyn24FD0dZkAFDUQK4lh/nxDqxH8TtSLrWOVdOEY4AcUrUqgKYdi8Ry/1LhRDP+nraL o9syMS3eoLJ0GyDDFHRK+fMt/aUPvWHGIneV6pkObsAYv6Pr4wRBaqm8ntcnPwhOWLBfJf dmpbYur+FA69r+7iPLWbEL4WFdBZSMmUyWmnJH8EaAKjurbuZpYpxaSCN6B3oOw/+vxkKU 9G94o9NZh21KGBy/Wfvvik2ZLKuEM7QbfVVqjREjaA2LEcpBh4NB+RDVWrOi6L+0tX6ITQ Wj2nUdczx7t5aOSswXSY7qf1L3rPEVBI3pFlVINkKaAt0110QWiULavR5leZ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDpkHpY/wo8rZaYLiYGeTGo53ZOeRq4T4bd45om8cJ0=; b=mHVH7tElo5vHf02HHZvfmi9cWBQ5trDOuaUxCYPl4vo4glhNVqENfSQMSIFn873NaJGNWd Ra2Gx0i5lAtWKLTF5FAnZfZk55NG9DY/orLs8CViLbnsiTGYBcek5OtVma0ykSF6te1zhI FiXxu34gEF4i/WyaDYqbqy4YGPgpGem5z/pxAZiBbOC9vYoDRx3SjTnGlBCbvWRfQ7fra6 DVMDgq2wNIF7OjsOAqpy9sv+CvC2TQNmpnKLJCV/PEWYc6wA00Dg/QMse687QkxJxMiTty pw2jM1vjJgpXWUKeVp/oHoQFQ4+Br3dMWXoJWUAc0UIHvGLFamj/QZSz0VnfTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653384; a=rsa-sha256; cv=none; b=YmLetIi+2uRQX5IsD8mOrCp9PLoBjYnRn3V9O0AM7XMOD9d8ifO21wY5iZyLa1tz21vLkb TK0ihFlPBHPwfPod6smqlbDrSpwm2JA27QaNPwc9DQ2EpeVb0XiPDbDDNles1CfLE6TMnq fxpqcEsYSUqTrrmEXMZM32gdkfHdI5dfrcMwNU0noiZ84dWtpicZ2TeTKHffdzrfirp4w9 fFMMlzQKhfZzr9X5o75qDtmGiEUc/ZdtHtfVZOMgoo7n5535Jc1MxAmFhZJ8Gn8RIsjbKJ gIYL5vFYK/H+a1M8FWLEQe8X+pCMzyA1cfD8HvuX6M7ygxIAWSutp73rSvrMWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhnz71Xyz11NP; Fri, 04 Jul 2025 18:23: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 564IN3ms069621; Fri, 4 Jul 2025 18:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IN30E069618; Fri, 4 Jul 2025 18:23:03 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:03 GMT Message-Id: <202507041823.564IN30E069618@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: 62d26d696bf0 - stable/14 - aue.4: Improve HARDWARE, specificity, and tag spdx List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 62d26d696bf0b91daea25ad6b474555485b1333e Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=62d26d696bf0b91daea25ad6b474555485b1333e commit 62d26d696bf0b91daea25ad6b474555485b1333e Author: Alexander Ziaee AuthorDate: 2025-05-28 20:53:31 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:04 +0000 aue.4: Improve HARDWARE, specificity, and tag spdx + Improve HARDWARE introductory sentence for hardware release notes. + Mention "Fast" ethernet in title for apropos. + tag SPDX MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50540 (cherry picked from commit 420e58595d20b6fd0dfdf2f486462fbb572f3351) --- share/man/man4/aue.4 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/share/man/man4/aue.4 b/share/man/man4/aue.4 index e451315672e9..9b82fdc4ba55 100644 --- a/share/man/man4/aue.4 +++ b/share/man/man4/aue.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-4-Clause +.\" .\" Copyright (c) 1997, 1998, 1999 .\" Bill Paul . All rights reserved. .\" @@ -28,12 +31,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 24, 2015 +.Dd May 26, 2025 .Dt AUE 4 .Os .Sh NAME .Nm aue -.Nd ADMtek AN986 Pegasus USB Ethernet driver +.Nd ADMtek AN986 Pegasus USB Fast Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,8 +59,8 @@ if_aue_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for USB Ethernet adapters based on the ADMtek -AN986 Pegasus chipset. +driver provides support for USB Fast Ethernet adapters based on the +ADMtek AN986 Pegasus chipset. .Pp The LinkSys USB10T adapters that contain the AN986 Pegasus chipset will operate at 100Base-TX and full-duplex. @@ -125,9 +128,10 @@ half duplex mode if this media option is not specified. For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE -Adapters supported by the +The .Nm -driver include: +driver supports the following USB Fast Ethernet adapters based on the +ADMtek AN986 Pegasus chipset: .Pp .Bl -bullet -compact .It From nobody Fri Jul 4 18:23:06 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp238hsz61jM9; Fri, 04 Jul 2025 18:23: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 4bYhp21ws9z3nMm; Fri, 04 Jul 2025 18:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iJJ/KQ6QEIEAWXYRESD6twT0aJ8D9/c5i1UzSXNWt/c=; b=cmlsYZyz7XjTMlZK1fF8jCBr3uDa4F3Y4sVKP8TEItHVlp2f/nx4/yzd8PowyjmxC7+TWx /JVVCfzg1vBBfr4qcFJEZWmVmi0kXSk10VtdBEhlmfoQdc/0Cc2BPp/qp/95RwUDkGfX6E ySnzAT4dLlyfg8+Io4DLBO0HW9Vi7Waev31Ek+5pZlXNoZvRNXny44B10SoTLT47b/CdOD sD3yILCG42hmc+Ecv+uYS3TimvV8hOFwwrQmyFeLfDXkq9IVnYeHvJpyrH1wnf8ffFAMup uCEou11lbED2mGZz10iR8EGPg9N36rDqcPfkXc63zvpI+TmdU8vslsyJYncdnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iJJ/KQ6QEIEAWXYRESD6twT0aJ8D9/c5i1UzSXNWt/c=; b=FeheBZks5gn9VCrJJZhxyDcM7/CR6+7b5LhNop0LRO/i8e+2r5woqusheJ02FdAs8UbW1j 3h+zj+aNN1fLSWRIxALEtEmjnIjGHJablaCza2ZwWTPYMkHdBWf0DuD7nYlUV+FULeZlmf cI0jER6yn+d2ZEHnFGyNhcPCyIISlfMZL2A6/a/FDLxkrAhwzPpvlHMjR6R03bKVNUCB3h uqIv8tsYCQfGqhh727Un89EZm2qFuEIZy9znai+olkhrQ5uM4Ha18j79X7YqCCLD3bSW45 GL8jw4RGnws3wZ+J0rz3gWg89PUt8KTd0awRjp+OjU5R06xAhv6oiiQOFWg3xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653386; a=rsa-sha256; cv=none; b=X0rgSO3Sh5PBXJebSpt67mNwhsU4tNCRmrZ/EoVZYe/+/gVYZstZ/VIKGn1S5Vv49hWCFZ qrp5rX2CZKZXctMC0XZY4n+NRcvAk+TSd6fNfiEEy285nSrlmJvQCsEl8CFD8o8gP5xMEs XsVvuOPqvsnf2ffep7bEWKCXL+FyNu4DOc6qagg9/glb0NjyXxHLajHVRXio5F46P/IoaD wKUYHgIKqAIDcWw0k6PRePk0LoglBoqW85gyTD5BWARLtOluRZZGPdd+J8Cr2KlkduKJDm qfnXhtWDm7OYW80h0syPlIfmPU0JcVA8gnnGca7sVN+2RFGkfPucgV6OWXeafQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp21WWpz126T; Fri, 04 Jul 2025 18:23: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 564IN6do069689; Fri, 4 Jul 2025 18:23:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IN6pA069686; Fri, 4 Jul 2025 18:23:06 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:06 GMT Message-Id: <202507041823.564IN6pA069686@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: db0f3a3c3f16 - stable/14 - usb/if_mos.c: Fix incorrect SPDX ID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: db0f3a3c3f16f414e32fba5a0f7ea01302739bb7 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=db0f3a3c3f16f414e32fba5a0f7ea01302739bb7 commit db0f3a3c3f16f414e32fba5a0f7ea01302739bb7 Author: Alexander Ziaee AuthorDate: 2025-05-16 01:53:28 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:05 +0000 usb/if_mos.c: Fix incorrect SPDX ID Fixes: 718cf2ccb995 (further adoption of SPDX) MFC after: 3 days Reviewed by: carlavilla, imp, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D50374 (cherry picked from commit ca47411ea5e8a38ac1a9a29df25bc32ffcaa2904) --- sys/dev/usb/net/if_mos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/net/if_mos.c b/sys/dev/usb/net/if_mos.c index 442bfb27d83f..41881fb778a5 100644 --- a/sys/dev/usb/net/if_mos.c +++ b/sys/dev/usb/net/if_mos.c @@ -1,6 +1,6 @@ +/* SPDX-License-Identifier: ISC AND BSD-4-Clause */ + /*- - * SPDX-License-Identifier: (BSD-1-Clause AND BSD-4-Clause) - * * Copyright (c) 2011 Rick van der Zwet * * Permission to use, copy, modify, and distribute this software for any From nobody Fri Jul 4 18:23:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp13V9fz61jmL; Fri, 04 Jul 2025 18:23: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 4bYhp1169Cz3n8p; Fri, 04 Jul 2025 18:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8NqnwNwdT3cFKq11otN25RSo0R9WZ1zZsRf7x9wAADE=; b=fWh8XvlkBeO2hTS5nxdWlcndXL8TrKAkZ2o5vrnGp7ZH1pziU/xLop7nBAZ2xRFsByt6rl HY4R4+SD5gFygeagFISudOyjVjgqIDsj571IXyUX+5LdMPMpDfvE9xDBqreF50ItRP9oO3 k5MEbf/VIYnUtZWEoJqnkUQBUuRQH9WesdgcROeMpTU2aCx6yk3xaXvWxzRvggR78/cUTT KSq7dmiNZDVfDqq5l3WCzOrCM1zxCw1uoxcZbZ6U/NoD649VyjyFWZhJaXDFxO6qY5LPTT EbxOYfXWq8lEcAW6tLN1CbeU8SQhKJ8EgG97jApmOcDTQW8o0IAgd9YB5zEVkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8NqnwNwdT3cFKq11otN25RSo0R9WZ1zZsRf7x9wAADE=; b=j0l4F8w/Y70e4nZEAEabfrB6w9ljObyKFBOrPh60o+MXD1JmAlvLPRthN6fq//eUz8A8cA VPFBoykVkrbL8HdGkmUs7bfHgJKqXdpr53PfwAY+QNGLDTIE7A6FVnaUePhaLJv2xIsB8W vO9qseJIvPz9ieIkVhSxmwGGAqtK4Zpb3u++qVxXl8HzCHkhNNPY68ecXxfxjyyMRiKU26 osJL8fWiWupOXgT3XQRspYAnJNTIgkFf9PvrzVHXDuc2ge1pJqA12o5rnl4B3FrucTPN8y t6G1FslWH2arcfLYFzOIP1WUz1oYp++DXl3J2ShUH7AXVTzF1LV7VGzlJVzevw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653385; a=rsa-sha256; cv=none; b=bekK385onOAdMXK1VsierU27GAVUWnuh/aHS4uyPufCgwL5IKh1FYuGGyqQ6Q+qqOd05KN zp7ZVkZ0R2ft978tbc/4lv7Wlgepwm/Dvo3tKHouPboQPynihk+uW3RekpG2jeCK7H3bXI qNWMT+ZyL5nVUiddXBDDwR3R2kNtpXIpbDFaRgVkeWbXhwOfiVNtLLD1nXwTTAX+VmoFGr QRdZh1LG46lPzGQvkW9c1yo/56hYkjlYDhRYIVHZlo+IXkn25XPs6dZtKy/Tcnlv9nycJj qWui997yYugfep9g3dDOkYjto+jrDUALhVhEX4ajyXda6D9uSEJp2le2HByv0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp10cFxz11wv; Fri, 04 Jul 2025 18:23: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 564IN4kG069655; Fri, 4 Jul 2025 18: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 564IN4TL069652; Fri, 4 Jul 2025 18:23:04 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:04 GMT Message-Id: <202507041823.564IN4TL069652@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: 5e712379ae68 - stable/14 - cdce.4: Improve HARDWARE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5e712379ae68ea1895817b8472b73598bafbc75b Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=5e712379ae68ea1895817b8472b73598bafbc75b commit 5e712379ae68ea1895817b8472b73598bafbc75b Author: Alexander Ziaee AuthorDate: 2025-05-28 20:55:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:04 +0000 cdce.4: Improve HARDWARE The cdce driver is the main USB tethering driver now that both Android and iPhone tethering are using USB NCM. I would like to test a recent 5G hotspot to see what those are doing. Improve the HARDWARE section to reflect this. MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50541 (cherry picked from commit e8260f2cea3c447b0a16f1075ff580dc4ef06efc) --- share/man/man4/cdce.4 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/share/man/man4/cdce.4 b/share/man/man4/cdce.4 index 87a6f5da4b08..8c5dbb36d197 100644 --- a/share/man/man4/cdce.4 +++ b/share/man/man4/cdce.4 @@ -27,7 +27,7 @@ .\" .\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ .\" -.Dd May 3, 2024 +.Dd May 26, 2025 .Dt CDCE 4 .Os .Sh NAME @@ -95,12 +95,18 @@ where .Dq internet is your providers apn name. .Sh HARDWARE -The following devices are supported by the +The .Nm -driver: +driver supports USB Ethernet interfaces implementing the +USB Communication Device Class Ethernet Control Model (CDC ECM) or +Network Control Model (CDC NCM) protocol, such as: .Pp .Bl -bullet -compact .It +Android USB tethering +.It +iPhone USB tethering +.It Prolific PL-2501 Host-to-Host Bridge Controller .It Sharp Zaurus PDA From nobody Fri Jul 4 18:23:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp53GCHz61jZy; Fri, 04 Jul 2025 18:23: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 4bYhp43r4Fz3nND; Fri, 04 Jul 2025 18:23:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=80C+Usu696mKd8zob1o/1nElOX5VSEkwY0jXiNrv1I8=; b=ZdU2ClmOMur1db+Fd/IKjTGxy7C8wfM/UochcZ0iBpwdR8e9pHaaNiFT6C0jzE8p0Rlzi7 m5sfclMAITmWQwwjJjHQH2euVLO4hpuSDi+Cqh248gr6HnSUNQkW2JRdBxTOxT27b49ANf QlBgYK+hExDZI1SYxRmzV+1LLe3DYyxgv87PBu5c+o+inB/XNSNLZHEexdGXUsCKSATvrc 1MoPG72lX7JZTkDR+vENv1Z1LNKWsJrhYwaBfJHyG/FP5RO7SBYZoIrXV5yegAzT438kVf BufC3+SAR3m2+mL8Emv6lJEU1yoK/1WazKPit2LtUrvl82IoMKutykGwZxCB3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=80C+Usu696mKd8zob1o/1nElOX5VSEkwY0jXiNrv1I8=; b=jZTeDpUSuAOSz7BLMz/iUiZTn2U1V6HxsSAcoY5dBiEAfxTDloabWp8BjsoqnZ0f00L5Va UopOcrJ0Pf39TxTHQUX8aLPu+ki+j2c1VUFmHmtk7qJjo5zIcBfulfOVprGgfaT/0gHAsE toa9jA/pUflokuwpuUfgtVSwmyBXchmC8s+r/7hwj4WImZcBI03tghEbEgL3/ks7N6mjgW KWU6RAZeU881boxRtdxLh98yH78mJ/yiVWMsYNmiJ/vgG39Vv+YewVq6gebJp7pdY5+BFD S/rGrAiDb/qNswVCfYKaDVnq5xxs3ovNw1ROq5LQ2Ng8R3gvZhQKwGRMMVYWzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653388; a=rsa-sha256; cv=none; b=FZDOQ3fRv908WaH6gSDLOnu7V6nfOgpO9IyIQF2Rul6Hcr3V6YwXQD56sB4GWo6DhIU1Ef LEUvlWJOXGKReJFi+SzUrByuzHOcqILNoYBx2r4dCfTLfcIvPNAa/+Yg5/Bjg7YVRbW+7+ AWqbQyFwXi/00fpb0pyn5GQRzPJxInYSiY9AqcCPEBS6ga83nh10RjTFEWLCvw/yp0ABla 7gEbRSIcxFZErwCtOQ5jgNS+zjhqxMzCSK5huooEOOPSSQnfutpIKgjb0IbJMKJV1+i4zg 0uQnD6Dzq/9JY/cPYBEUcGnX4bBsVjvqXa6ZTIzf1eJNsz0T+R82YEZOTdK+fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp42vNsz127t; Fri, 04 Jul 2025 18:23: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 564IN89s069755; Fri, 4 Jul 2025 18:23:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IN8qL069752; Fri, 4 Jul 2025 18:23:08 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:08 GMT Message-Id: <202507041823.564IN8qL069752@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: f7776016fee8 - stable/14 - bectl: Use SPDX only license List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f7776016fee89ba73d9054b37bcf32c82c9b6363 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=f7776016fee89ba73d9054b37bcf32c82c9b6363 commit f7776016fee89ba73d9054b37bcf32c82c9b6363 Author: Alexander Ziaee AuthorDate: 2025-02-19 19:44:57 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:33 +0000 bectl: Use SPDX only license bectl.8 had a truncated license without the required disclaimer. Correct it consistently by converting all bectl licenses to SPDX form. Approved by: kevans Approved by: Kyle Kneitinger Approved by: Wes Maag Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D49066 (cherry picked from commit 54d2737e7fe48226c908dcccfbda2ca1c08e07fc) --- lib/libbe/be.c | 25 ++----------------------- lib/libbe/be.h | 25 ++----------------------- lib/libbe/be_access.c | 25 ++----------------------- lib/libbe/be_error.c | 25 ++----------------------- lib/libbe/be_impl.h | 25 ++----------------------- lib/libbe/be_info.c | 25 ++----------------------- sbin/bectl/bectl.8 | 12 +----------- sbin/bectl/bectl.c | 25 ++----------------------- sbin/bectl/bectl.h | 25 ++----------------------- sbin/bectl/bectl_jail.c | 25 ++----------------------- sbin/bectl/bectl_list.c | 25 ++----------------------- sbin/bectl/tests/bectl_test.sh | 23 +---------------------- 12 files changed, 22 insertions(+), 263 deletions(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index a9838f2200bf..de98f3b5e69e 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/lib/libbe/be.h b/lib/libbe/be.h index 0e4486fbb6d2..01ee94fd03ca 100644 --- a/lib/libbe/be.h +++ b/lib/libbe/be.h @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * SPDX-License-Identifier: BSD-2-Clause */ #ifndef _LIBBE_H diff --git a/lib/libbe/be_access.c b/lib/libbe/be_access.c index 44e7eb1e651c..a7eb6b703cda 100644 --- a/lib/libbe/be_access.c +++ b/lib/libbe/be_access.c @@ -1,30 +1,9 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans * Copyright (c) 2019 Wes Maag * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/lib/libbe/be_error.c b/lib/libbe/be_error.c index f515fe136f12..bb1e1ed88c5d 100644 --- a/lib/libbe/be_error.c +++ b/lib/libbe/be_error.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/lib/libbe/be_impl.h b/lib/libbe/be_impl.h index d5fd26c4f072..88dd1c4333f3 100644 --- a/lib/libbe/be_impl.h +++ b/lib/libbe/be_impl.h @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * SPDX-License-Identifier: BSD-2-Clause */ #ifndef _LIBBE_IMPL_H diff --git a/lib/libbe/be_info.c b/lib/libbe/be_info.c index 88a9b17bf421..cc62c609840b 100644 --- a/lib/libbe/be_info.c +++ b/lib/libbe/be_info.c @@ -1,29 +1,8 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index b511d5a637b6..a77039c94d26 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -1,17 +1,7 @@ .\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\" .\" Copyright (c) 2017 Kyle J. Kneitinger .\" -.\" 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. -.\" +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" @(#)be.1 .\" diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index 63c3bb369b56..be95ca5cd36a 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/bectl.h b/sbin/bectl/bectl.h index b8b824b18010..355110bcd6d3 100644 --- a/sbin/bectl/bectl.h +++ b/sbin/bectl/bectl.h @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2018 Kyle Evans * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ int usage(bool explicit); diff --git a/sbin/bectl/bectl_jail.c b/sbin/bectl/bectl_jail.c index ae48202163de..9feb1e23628a 100644 --- a/sbin/bectl/bectl_jail.c +++ b/sbin/bectl/bectl_jail.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2018 Kyle Evans * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/bectl_list.c b/sbin/bectl/bectl_list.c index 0fcb5deb37f3..3e4c658f60e7 100644 --- a/sbin/bectl/bectl_list.c +++ b/sbin/bectl/bectl_list.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2018 Kyle Evans * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 0f167829cf46..45e9714e9adc 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -1,28 +1,7 @@ # -# SPDX-License-Identifier: BSD-2-Clause -# # Copyright (c) 2018 Kyle Evans # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. +# SPDX-License-Identifier: BSD-2-Clause # ZPOOL_NAME_FILE=zpool_name From nobody Fri Jul 4 18:23:07 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp40rkpz61jMD; Fri, 04 Jul 2025 18:23: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 4bYhp33WSqz3n6h; Fri, 04 Jul 2025 18:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rT/cTBXFyR48ZouR7Cnjr98ms7b2h2c030NTXN2zZKU=; b=Bd2H7bSzHyhxUUCMZmOEfiINtSOorRvqBnTC30SxFMbB5KWr+fnBVUROI5ZDujeotv7ko9 Qd8W715/KukOMDG4PN+GDd/qwjRZBbEslpSPAdtWO9eKAvqlo+IjxDEx1iAYSYruq4Ux3U qDGLgKPhfuJ700dZHL9rWmz2jpfUMQRNndC6M1abz80oJ0wMoAOjz/8tCa6ZKGWN5RQ+ej +/vkx4ZwoVg/Ag4DD+F6gFykHlPdbU0I5HAzaW+piLubTxitWp5ZWt26HHh20+kcb1niSA +jEQ6Pt9NyMrCJYgvfyJWB+7n1nyrDh+vrvhlE3CslCVc4Ca3Vtb7nhXsekXDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rT/cTBXFyR48ZouR7Cnjr98ms7b2h2c030NTXN2zZKU=; b=bldtofMxW+C54P0yYQAdshJBPy4OhXOmAV6DqhpC3kFPFq5PTiTISiCtHC7Shbbw0GKbCx 0Nhos6WJFYcC2DwCuGLk2VqXCs97L7ceuHev46q7XOkYRJv9cYNI/xNV7K+X4j6HAtWTfd X5+3c9fFnTwbrU6AJEOmAb28IbeY5Uu71PDco/Yfjk8OyCOfIOcKxZXm4rZ5hnJnI5hX/o I7229l2YuEPK9ZePSbcku+WB9DtrZeJ8wkrk051dRNH+1BuCziKbs+u2Wiv8dB+xl2fsZT NfV1G6zr/KNtewFIFGUPqOc0BhqaftaUwtfcFy+obq/mgGlQ60qWdKlJ3a4+kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653387; a=rsa-sha256; cv=none; b=IX1+J/xKM1QgNzIFpDSzdVfw1XALphEDpT74FufkUL9kWaJJLjEVd00ZbKuN3zFlaj7eRW M1Lb5whSnnb3V7VB1zHrTzRWiiKUy7edeXjAA2dPq161N952rGV47JlYyC5AJ+sezYlwRG 8x05/biLJKlI4tbjlld17iriZwA3zD5tEl+d7B31IibQLH9Z6RFQJ/CBoLprBIR4uIH+7P NtuxPBICiYmLq4Hjf8x7jLPS+oEuQNDhNX0495Q6oXd5P9T/4srrtHS1APzJdYZ07ZGSAW jT212O9H/4+XWn2mIw9vwSKm+w8IGUCutkqSXRCy9bNbJSbfhdq4u0OIu19iDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp32WFHz11ww; Fri, 04 Jul 2025 18:23: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 564IN7Gc069722; Fri, 4 Jul 2025 18:23:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IN7Xm069719; Fri, 4 Jul 2025 18:23:07 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:07 GMT Message-Id: <202507041823.564IN7Xm069719@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: cf647f23c4b7 - stable/14 - mlx.4: Improve specificity for apropos + hw notes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf647f23c4b774e81144ebe2a4df958bc74580d7 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=cf647f23c4b774e81144ebe2a4df958bc74580d7 commit cf647f23c4b774e81144ebe2a4df958bc74580d7 Author: Alexander Ziaee AuthorDate: 2025-06-02 20:31:14 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:30 +0000 mlx.4: Improve specificity for apropos + hw notes + There are decades of SCSIs, these are Ultra-SCSI + Remove generalizations from the end of HARDWARE + Tag SPDX MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D50545 (cherry picked from commit e3307d05311e8c042e7e7ea2157fc51f50297369) --- share/man/man4/mlx.4 | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 index f7a0d64e9e73..f6eb33d7c7d0 100644 --- a/share/man/man4/mlx.4 +++ b/share/man/man4/mlx.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2003 David O'Brien .\" Copyright (c) 2000 Jeroen Ruigrok van der Werven .\" Copyright (c) 2000 Michael Smith @@ -23,12 +25,12 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 15, 2017 +.Dd May 27, 2025 .Dt MLX 4 .Os .Sh NAME .Nm mlx -.Nd Mylex DAC-family RAID driver +.Nd Mylex DAC-family Ultra-SCSI RAID driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,9 +52,9 @@ The driver provides support for Mylex DAC-family PCI to SCSI RAID controllers, including versions relabeled by Digital/Compaq. .Sh HARDWARE -Controllers supported by the +The .Nm -driver include: +driver supports the following Ultra-SCSI RAID controllers: .Pp .Bl -bullet -compact .It @@ -79,13 +81,6 @@ Mylex eXtremeRAID 1100 (DAC1164P) RAIDarray 230 controllers, aka the Ultra-SCSI DEC KZPAC-AA (1-ch, 4MB cache), KZPAC-CA (3-ch, 4MB), KZPAC-CB (3-ch, 8MB cache) .El -.Pp -All major firmware revisions (2.x, 3.x, 4.x and 5.x) are supported, however -it is always advisable to upgrade to the most recent firmware -available for the controller. -.Pp -Compatible Mylex controllers not listed should work, but have not been -verified. .Sh DIAGNOSTICS .Ss Controller initialisation phase .Bl -diag From nobody Fri Jul 4 18:23:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp56pdvz61jmR; Fri, 04 Jul 2025 18:23: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 4bYhp54zppz3nG6; Fri, 04 Jul 2025 18:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RU5i9Pgya5bgJNYpcWMmdi6Er6T4whAuBZln2+t77m0=; b=alVCZSkptU244EibYsQxiTttDYL2+iyWapoBrzfp//nYdkr4IXRiBU5pcR/o1a2DoNanoX fbaFJPmvN4FY7iW/iSLgZDAz52uyo8/11GMbK87g4Rrt0Q3wGH8v7aA/48aqA/Jdqo69f1 zmOexIYBfrv/HCZjSGUpMA0CUxJbDjO+Fa59jCyY1RMtYwTDK86uZzSoRHwT6truUY00YP pNEpf76a3i79Qi8AE79h+4/aHbvAOPv+Kqsbh3rwB9atcvyPAeGCnEa93eIM7/i7dUQRsf cL6DKvvLxjiY4KCuFeYPComfYwVVvNhOZnHllMaHhll4ObPeNgAy4bKQFWiY+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RU5i9Pgya5bgJNYpcWMmdi6Er6T4whAuBZln2+t77m0=; b=HjEGpOEl1ks+oD5fnw5M1fXCHAqPZJfwmig+/RCuuf6Tm7z59DjM6HMLLhStu+T+EhA6Gd OmPupPjcOMDc1MxFejMsHMpv0e6pQfObIrV3G1lcmq4S56gfhnKcsgA0YuvGX/3yG9uBH3 NQmqIKrjF+lvnFyekgqkigE9XHxtlABic7Ed8YyZrjq3wl4Fmn1Jgd3I0hlwJE68YLx3QE tIjMEWQlKkx2TNXjwMPdnvhZT7RgeFsr/oGgxWuIFUKq7tZScy/W52Pk9RS6AEnRNoLgPM czliVin9VitmV9sAS9g9SYty1Kij8uUnBWedk2O2w6RjXuXUiaFuDetDgNXQPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653389; a=rsa-sha256; cv=none; b=LHUTeDm6xSfqgMx+BZlk/EDogmp++000o9qlSP0wRYMZJHeopaMbRz/WAWGibnq5lJiq8Z VyZoQ3a/gH03mF0cA4mii8pUGCqJCZ+jMQnLPLPQDjcxmSq+2SgZd4WkNuBxBOrGULtUyY TqVNVvZBJHbysYnhCdD1zlW7UEv0p+Z6dqd9F/9qKQshXXju9MMieZZh3dDsMU3FUyATog XgnzPWMHbuc1wEPLn2NYhOqbuoJ28dpTxaPDa0UwcKyOn+EPC/YpfKrK7XDbDSr5NBGsaC +UNeK7YYDJDq9tGcGKT2O/RoOeQVtROVHJLalZVg95Qpo1aGmAZXWoSCEZOVkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp545vkz11wx; Fri, 04 Jul 2025 18:23: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 564IN9wt069787; Fri, 4 Jul 2025 18:23:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564IN9Vx069784; Fri, 4 Jul 2025 18:23:09 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:09 GMT Message-Id: <202507041823.564IN9Vx069784@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: 9acbcf1f0c13 - stable/14 - snd_hda.4: Improve HARDWARE for HW Relnotes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9acbcf1f0c13fee659b647e9d63acea4d6afafd7 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=9acbcf1f0c13fee659b647e9d63acea4d6afafd7 commit 9acbcf1f0c13fee659b647e9d63acea4d6afafd7 Author: Alexander Ziaee AuthorDate: 2025-01-17 14:31:04 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:33 +0000 snd_hda.4: Improve HARDWARE for HW Relnotes Rewrite the HARDWARE section to improve the hardware release notes. Move the section to achieve the structure in mdoc(7). Tag SPDX. MFC after: 3 days Discussed with: mav Reviewed by: christos Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D48503 (cherry picked from commit 7b34c48e036e209321174100ab9d7fef19b4932a) --- share/man/man4/snd_hda.4 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/share/man/man4/snd_hda.4 b/share/man/man4/snd_hda.4 index 45ad2ee132ca..93bac0e5b3b9 100644 --- a/share/man/man4/snd_hda.4 +++ b/share/man/man4/snd_hda.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2006-2008 Joel Dahl .\" Copyright (c) 2008 Alexander Motin .\" All rights reserved. @@ -23,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 16, 2019 +.Dd January 20, 2025 .Dt SND_HDA 4 .Os .Sh NAME @@ -384,6 +387,15 @@ Run-time equivalent of the .Va hint.pcm.%d.rec.autosrc tunable. .El +.Sh HARDWARE +The +.Nm +driver supports PCI class 04h +.Pq multimedia , +subclass 03h +.Pq HDA +audio controllers and codecs compatible with the +Intel High Definition Audio 1.0 specification. .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. This system has two audio connectors on a front side, three audio connectors @@ -583,17 +595,6 @@ other random inputs Controls have different precision. Some could be just an on/off triggers. Most of controls use logarithmic scale. -.Sh HARDWARE -The -.Nm -driver supports controllers having PCI class 4 (multimedia) and -subclass 3 (HDA), compatible with Intel HDA specification. -.Pp -The -.Nm -driver supports more than two hundred different controllers and CODECs. -There is no sense to list all of them here, as in most cases specific CODEC -configuration and wiring are more important then type of the CODEC itself. .Sh SEE ALSO .Xr snd_ich 4 , .Xr sound 4 , From nobody Fri Jul 4 18:23:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp73LgPz61jmW; Fri, 04 Jul 2025 18:23: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 4bYhp65mHhz3nNd; Fri, 04 Jul 2025 18:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i21TUAMJCmOWl0yw/lWObONvaw2RnpDlim0ZS4PH8kA=; b=gumjk8ivvDBUw58WFxOAAX7jkdgayNHUaJb1vd3URIXoytLS10PH5Zi0eEqa47kap6JM9E 2yE+CI5cY+4eqGBg5ams2tEVjwiLQdf1nm7Id41W4TNoG2dcZbimNAkU/mKSiFmmREDgQR jbzN63yejLmdcnKwgzpe01YedG6/Cu/Mcri9YFCgGpCzJ8E6esDOgTub1kqfMPm2rR93zE 81wKvYWUEu6GHtGl+SRDQceKo0pGA5NPj8qi4AugwFj2YDejdTIa4UeGuoE64Sxl13DYlZ LfIkazmSRdnt7U+vLwzHihnx7ctzBm2LQI2mvJOqbsQCzSf4om3MFRHP2kdUgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i21TUAMJCmOWl0yw/lWObONvaw2RnpDlim0ZS4PH8kA=; b=wBSLmiLOF54tbCjIrBZrA68f7l7sLHTK5LLlFEXOenxBJ4KUu+FTztue/zTWbo3C/hAKxz Z2cXEbXXys632ihhyYfa/t1OkUkpWoWMSRtomhhqek11b2Ek0hpYlokMgJwEAUA7OFVXrN 9gX/v3ZwFjRljYULW4CU23wzLPfQU+alrA/W/S33lApkPpEIG4HvfDuxSQ04Ex7p6NdDFE KH82+pl+ohRGYl0Y0mUC4fE+tuUdD6U5LQjUn62SAErztp9Aqh1FEzdxZNc8yo4+1u1xVc hqclt6OvRsNC94v+yEYBa9CywtKNJjzfp25urxLavSrB3qiXRUp6rHV8gDRaOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653390; a=rsa-sha256; cv=none; b=tet1ZFczwjgIspbnXxyHRv09tXWIqaz6ObaH5jen/TGsGLbhVEN5xcb4mRwAzXf5SnEIy4 rMpozuyxZdNStUzpWO8rzzdrV8Rm/Wr2w8cT0k3my/jXVJp7K+fN928d2T9CmTz9DVyC4P rCHpPhOI5jXr9PNPpOkU1+St7Y0/GIdERDPntKbvc42c4XJjfmsBn2tmXxIi0Ljaw4AF7k gXPCi8QeqK2QQCn0JQHl0tZv49EbG1uaeb5rI0p3v9Fi5xSZCmOUuowznpsM2yVnS2sXGv tpwrQKaXYRYiTmf4M9Rh56TvX6k2YMY2XmStb3rNMqRFWpqH/JWfkFwrVIaMIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp65448z11cJ; Fri, 04 Jul 2025 18:23: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 564INAPv069822; Fri, 4 Jul 2025 18:23:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564INAMY069818; Fri, 4 Jul 2025 18:23:10 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:10 GMT Message-Id: <202507041823.564INAMY069818@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: 992be3acfe68 - stable/14 - ctfconvert.1: Minor cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 992be3acfe68d315e081ba27f7087e8261dc4ecf Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=992be3acfe68d315e081ba27f7087e8261dc4ecf commit 992be3acfe68d315e081ba27f7087e8261dc4ecf Author: Alexander Ziaee AuthorDate: 2025-04-18 00:41:29 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:33 +0000 ctfconvert.1: Minor cleanup Alphabetize option table to improve first glance access. Markup semantics to differentiate them and add them to apropos. MFC after: 3 days Reviewed by: Pau Amma Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D49883 (cherry picked from commit 3fd42db26c3dd0882cf69c54850a59e79b027e33) --- cddl/usr.bin/ctfconvert/ctfconvert.1 | 40 +++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/cddl/usr.bin/ctfconvert/ctfconvert.1 b/cddl/usr.bin/ctfconvert/ctfconvert.1 index 7697513d0740..8baf9895b0e1 100644 --- a/cddl/usr.bin/ctfconvert/ctfconvert.1 +++ b/cddl/usr.bin/ctfconvert/ctfconvert.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" @@ -31,44 +33,48 @@ .Os .Sh NAME .Nm ctfconvert -.Nd convert debug data to CTF data +.Nd convert debug data to Compact C Type Format data .Sh SYNOPSIS .Nm .Op Fl gis -.Fl l Ar label .Fl L Ar labelenv +.Fl l Ar label .Op Fl o Ar outfile object_file .Sh DESCRIPTION The .Nm -utility converts debug information from a binary file to CTF (Compact C Type -Format) data and replaces the debug section of that file with a CTF section +utility converts debug information from a binary file to CTF +.Pq Compact C Type Format +data and replaces the debug section of that file with a CTF section called SUNW_ctf. -This new section is added to the input file, unless the -o +This new section is added to the input file, unless the +.Fl o option is present. You can also opt to keep the original debugging section with the --g option. +.Fl g +option. .Pp The following options are available: -.Bl -tag -width indent -.It Fl l Ar label -Sets the label as -.Ar label . -.It Fl L Ar labelenv -Instructs -.Nm -to read the label from the environment variable -.Ar labelenv . +.Bl -tag -width "-L labelenv" .It Fl g Don't delete the original debugging section. .It Fl i Ignore object files built from other languages than C. -.It Fl s -Use the .dynsym ELF section instead of the .symtab ELF section. +.It Fl L Ar labelenv +Instructs +.Nm +to read the label from the +.Ev labelenv +environment variable. +.It Fl l Ar label +Sets the label as +.Ar label . .It Fl o Ar outfile Write the output to file in .Ar outfile . +.It Fl s +Use the .dynsym ELF section instead of the .symtab ELF section. .El .Sh EXIT STATUS .Ex -std From nobody Fri Jul 4 18:23:11 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhp82SWXz61jmX; Fri, 04 Jul 2025 18:23: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 4bYhp76PL6z3nJ2; Fri, 04 Jul 2025 18:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HxnxJsSIB8Y0u3NNJWJB0h1IcArQVBLVqxoo+/lkAMA=; b=T7Kt4wIThtgLwq1NgE+trXpiTLQ513gAr3kJrZF6IMvq3rIWEUoDzVcDpcbYyM4OOyRspt +8hUQ4upjFmsoO/8/KPRxSQyJMgR1Y7R5iTOFNu8iRVqWwqWIQJnR14weQnv/n8dThELJh 9w+OkpOzy4fLkaCIlJT+wFlGZEoOkYB5fQJaBKQFgN9UYsyaKxqlFnfocOkO/ZZ1AyOH1Z Q1fIR2Pxx+6VCVAch4lzhV0c3yRFIRlKTdrynla0+ixX0nmhYIp3cHvmz29RWXSsrQpzpq kzZdlWsVXQ0pcH9PXNu5pANNzSPyNquTO73XFuUFAWS66tf1haqXVBBsP+MBsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HxnxJsSIB8Y0u3NNJWJB0h1IcArQVBLVqxoo+/lkAMA=; b=KqHlXy3lHN5p09AEaypkugEUcKFlO34HhwPTtpwc7g8q2H6kl6pR49NiqB3ICkN8gtT+N5 dHdpMfOp9yYGNGyYZhT5mu6zJxOyHh6vRJ5BTkqiFBtucGaFoTZEC0teS/kTPCLPCmSs2N sXW1xYmQEPWi5fZISy0Fkbz0KTnTqrjvVOX4uggMLVf4VScX5waJDDvZR4V0kpOratVMpz OJbK3cAB3TROuuUZiAxKBQJ88LaWPOn+TLi2edYgDZ4dV/A5zMZg1lh2evKviXviX72gDu 7J3Hm3Lbhl0+uMXSaFENQF+6sxR2rVabe1UEj6a3Oq+h3KdHgjJcF1Dr2Qd4kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653391; a=rsa-sha256; cv=none; b=M/iQbvzz73sx8QkyIGkukVoFFZXpIb1+h1jV8cAL2APAKg85BEB02ydhSlfuKFQbJlYsee DJVZ/x/lBMTziLFzYk3d/R/utIRniEC44J2VswNsPB3JKYb8YKYFrCqfwZvPnFanaAj5mH EVp4h0yADw8LnpST9CWkjzJaJ5Hvv7B3NcqG1v/FyFmPJDwvL/j+XAu7y1YOTC9kwRS8uv ot+QxO7gQi1nzH0O8ny0G0cWyp3IsE03KDAd5hJNUyx7JcPstJEUJsl3v2MmoYxg1cR/1U jSP137qaD+4pEaGAxwWfIfsLBCXQxJEtqhRiJsb37x0wtYM1vEsYEHU7PsEmlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp75znMz120V; Fri, 04 Jul 2025 18:23: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 564INBhR069855; Fri, 4 Jul 2025 18:23:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564INBi1069852; Fri, 4 Jul 2025 18:23:11 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:11 GMT Message-Id: <202507041823.564INBi1069852@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: 89acc594cef7 - stable/14 - mlx.4: Improve HARDWARE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 89acc594cef77db141ede18038fe3c8ed1916264 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=89acc594cef77db141ede18038fe3c8ed1916264 commit 89acc594cef77db141ede18038fe3c8ed1916264 Author: Alexander Ziaee AuthorDate: 2025-06-14 20:54:59 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:33 +0000 mlx.4: Improve HARDWARE These are paralel scsi adapters, list what kind the hardware supports. MFC after: 3 days Fixes: e3307d05311e8c (mlx.4: Improve specificity) Reported by: kbowling Reviewed by: kbowling Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D50654 (cherry picked from commit 63e98e05fcdbcf3a34113a2e6acab2f8cc23bba9) --- share/man/man4/mlx.4 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 index f6eb33d7c7d0..24683054e662 100644 --- a/share/man/man4/mlx.4 +++ b/share/man/man4/mlx.4 @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm mlx -.Nd Mylex DAC-family Ultra-SCSI RAID driver +.Nd Mylex DAC-family Parallel SCSI RAID driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -54,29 +54,29 @@ including versions relabeled by Digital/Compaq. .Sh HARDWARE The .Nm -driver supports the following Ultra-SCSI RAID controllers: +driver supports the following Parallel SCSI RAID controllers: .Pp .Bl -bullet -compact .It -Mylex DAC960P +Mylex DAC960P (Wide Fast SCSI-2) .It -Mylex DAC960PD / DEC KZPSC (Fast Wide) +Mylex DAC960PD / DEC KZPSC (Wide Fast SCSI-2) .It -Mylex DAC960PDU +Mylex DAC960PDU (Ultra SCSI-3) .It -Mylex DAC960PL +Mylex DAC960PL (Wide Fast SCSI-2) .It -Mylex DAC960PJ +Mylex DAC960PJ (Wide Ultra SCSI-3) .It -Mylex DAC960PG +Mylex DAC960PG (Wide Ultra SCSI-3) .It -Mylex DAC960PU / DEC PZPAC (Ultra Wide) +Mylex DAC960PU / DEC PZPAC (Wide Ultra SCSI-3) .It -Mylex AcceleRAID 150 (DAC960PRL) +Mylex AcceleRAID 150 (DAC960PRL) (Wide Ultra2 SCSI) .It -Mylex AcceleRAID 250 (DAC960PTL1) +Mylex AcceleRAID 250 (DAC960PTL1) (Wide Ultra2 SCSI) .It -Mylex eXtremeRAID 1100 (DAC1164P) +Mylex eXtremeRAID 1100 (DAC1164P) (Wide Ultra2 SCSI) .It RAIDarray 230 controllers, aka the Ultra-SCSI DEC KZPAC-AA (1-ch, 4MB cache), KZPAC-CA (3-ch, 4MB), KZPAC-CB (3-ch, 8MB cache) From nobody Fri Jul 4 18:23:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhpB00T9z61jQ3; Fri, 04 Jul 2025 18:23: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 4bYhp91ZLrz3nV2; Fri, 04 Jul 2025 18:23:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aU7/RQHAGVoZaDvwGmUClilUoKySo1FHXqSRk2Xssek=; b=u7hVm8cpQG2s8mR/ZuAaoJp4Hwm82GaKGV5OFvZlicO0lm/iVonaU/3VCuGoWFst+rYyfF bs3HPCs0MTNoov3XkE60b4nJZnc/Hp1FzkZUxYlKUMWRgwvOQOqDoYM53Pbd2NQxrUhbln E1f8teImWqTiRdH07XBFs7jGrQRWHus+57fJzHm+749ryH0OBaIPZ4GGMtQSqNG0nLPM+v gsd7O5P5mfRKn2xYgP2TGIJEGS8fWr7G3yH/EdT4yhmpaxLNwoDvDz13ulAJd0AORp0/L8 4WSOP0PLHdzcl865xJ654W0LWK/rklRnTOYxTLFCgsT8XzqmwoMbNZe0ghfu+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aU7/RQHAGVoZaDvwGmUClilUoKySo1FHXqSRk2Xssek=; b=CcwWfY/VCO53cP5pJiWTKtOpt9zEczdJOjUDBL/rVHkfNSck1ivyM7jonsmbU5K4sZnZVH Jp7LcGTYQOcYiPCeoytTMz49OzKSgm33+xeiDu9UlvjNCyzxzJsVENQNNuM2gpIvxtWdyQ klAYFf5vTEgML4nJZQMnb+WmjEl4Riy0w7GxK75Gbz3n+L7pHiOT2F8Xxw6iKdqJ6r2w7Q JBktI5rnruPE4ApRazZzNBNAQBeFY+9MzPDsd+UKrD+u69Qpbow3XxOwYdLLNupQCofjO6 L51I1dGuX5l9kSK3LGzTT+z1e6TCWxhGuc64O0LVTgFe+JrbOTsS6leWzT3Vvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653393; a=rsa-sha256; cv=none; b=qdeK0MHlhP17pKfTck1OyiDd8D57xUc1ZeZgLrU4V/bV1KNormuF6ecv8NMitxiizLyUei xbyRqUyqIPTd/7exi+83R/SdFXjVl5T24q0vuLNBDjYOMle443Lvdbaq0KPs+AXJvRe0Ol pOYbQLCUYbFBHRxYGe+AkqTMwxr0R8TysLVPeMZ08axmqW0S3K8chlUJZO4hiwrapJWTtB /RT+TiV6jE6RIVuoNTplPSKNcly8ElkFOetbIGf5mPXiibZB4VzhQ8tig+DgEb4D8H18I2 Y0KVJWgmnwFfTBRJpP0wn25DRrqTmcRNENnhqMMrESFQ0V9njqTdGLmA0SFT7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhp871VWz11rm; Fri, 04 Jul 2025 18:23: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 564INCpG069887; Fri, 4 Jul 2025 18:23:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564INC2p069884; Fri, 4 Jul 2025 18:23:12 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:12 GMT Message-Id: <202507041823.564INC2p069884@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: 3e235a37e550 - stable/14 - ng_patch.4: Clarify relative_offset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e235a37e550233e9a04ccb8ca63708da97f5868 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3e235a37e550233e9a04ccb8ca63708da97f5868 commit 3e235a37e550233e9a04ccb8ca63708da97f5868 Author: Felix Johnson AuthorDate: 2025-06-25 04:49:51 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:34 +0000 ng_patch.4: Clarify relative_offset While here, fix an extra space typo. PR: 251833 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51033 (cherry picked from commit eab94b59a7743113c7f101846f498e539b2d094d) --- share/man/man4/ng_patch.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_patch.4 b/share/man/man4/ng_patch.4 index 7a8543fd7dd8..9c0d7a8ee512 100644 --- a/share/man/man4/ng_patch.4 +++ b/share/man/man4/ng_patch.4 @@ -80,7 +80,7 @@ Sets the data link type on the .Va in hook (to help calculate relative offset). Currently, supported types are .Cm DLT_RAW -(raw IP datagrams , no offset applied, the default) and +(raw IP datagrams, no offset applied, the default) and .Cm DLT_EN10MB (Ethernet). DLT_ definitions can be found in .In net/bpf.h . @@ -135,6 +135,17 @@ corresponding checksum before transmitting packet on output interface. The .Nm node does not do any checksum correction by itself. +.Pp +The +.Va offset +value for the +.Vt ng_patch_op +structure is calculated from zero by default (the first byte of +packet headers). +If +.Va relative_offset +is enabled (set to 1) during configuration, the operation will have an +additional amount added to the offset based on the data link type. .It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig This control message returns the current set of modify operations, in the form of a From nobody Fri Jul 4 18:23:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhpB2Jkdz61jQ5; Fri, 04 Jul 2025 18:23: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 4bYhpB16brz3nJP; Fri, 04 Jul 2025 18:23:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIRxe9P9ANwXIOWuZ68PQM64pBzN2nvjPF4T0Lt5CLI=; b=BCJJ3n6egn09GxN/EG2RAxjsvINnG7tKhEanyFOdXGUPd6hXb8+AehDBSqifcQMmBrNjCp XvgXwTXnkd/4DpXZflWYgoohpW0ZBl1hRTIcIqzlQsnc3gG3YBOL4iWdpJboQQp2j8vTWE 5pQe7DIDELJWrzGwvCnYlj4cO57iRw7g9hql1/NGtPOp9ayA4ZYuD97C2zt2ATy01lhGz4 bl2rJW2umC/nmCetU3z3KH+o3XFni6jRu/VXIS342bn1hnqA1lIK1riYrWeQxTzbzRmbzb 9UjfvzFWPletnQIJFxf58ZCG7qqk+oe0KPLjJkH22kknTdkPIC2+W8CsRid/wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIRxe9P9ANwXIOWuZ68PQM64pBzN2nvjPF4T0Lt5CLI=; b=mkpS2J0REoNRBmPB9A6XW8xQkN/aaZ+Oxmv8bpcUOSD+TnsIWWwI82TX61cyQjPalWEvqr 1vZwXzcqViQzHgMeqvXcakTyK56v6eMO59KyGy9jgriKIrh5kQHemQaT67ImDKzg36RI0T p7Q23xkDyi5KN6kQZhSgNXDLtG/zfJ0KUdPqJyV0Roe3It/IUH5jQnoXRzPIT6E38XEmhE /RHQxgGpjWXJ83ItqeKCV3DLvA8mtk62djrMEO5V/qiPCddHznj0n3u5cA6MxYd1Zo8/A7 OC3x+/Z1sLkn+wkwZK0sBisG9CMOOf7FkSKN83G1/DAy5CkzqlGt47Qg3sp62A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653394; a=rsa-sha256; cv=none; b=Yh9yiHRGHkvDl6CFf+/MDQNB0oiZCJkS1mT6bf6XTFDfA8D3k0s/d7vLoQjtZu95oJxspd /aa3mlgWvlNVhS3ZhpP4Vwz3MrVyQmhP2Phl16M1yzUIzwdH+g4agYmy4c/JzeLLocgcIU 7r21cMHYgTPv4sZ7tpWif2xtFK7eyN+CqTHgI9UUm2XxdL7o9Mgp16zWBUJUkrolV8RYWB JwPOFpIHUCBWmA3CE9p/BtGJfSq2vtdET+JJ5uXNbX5bakItAnvh5s1mJGB9ZXmOyUbj85 wkrU0c2xhDyiBzJy0RFAAiMp62V996srl4sCHQWnrIj+Z+sgr77+Kloh1TH7cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhpB0X2tz11ZW; Fri, 04 Jul 2025 18:23:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 564INDk7069919; Fri, 4 Jul 2025 18:23:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564INDcX069916; Fri, 4 Jul 2025 18:23:13 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:13 GMT Message-Id: <202507041823.564INDcX069916@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: f74d99809359 - stable/14 - uftdi.4: Makeover! List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f74d998093596c09d6216c91b6435a590dcc14a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=f74d998093596c09d6216c91b6435a590dcc14a0 commit f74d998093596c09d6216c91b6435a590dcc14a0 Author: Alexander Ziaee AuthorDate: 2025-05-30 01:54:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:34 +0000 uftdi.4: Makeover! + tag SPDX + rewrite document description to one line in contemporary style + rewrite synopsis in vt/iwx/mtw/uart's style, adding all sysctls for brevity, in the future I will call this "possibilities style" + move ioctls into an ioctl section (we should use these more) + add a sysctl section listing all sysctls and their defaults + remove list of specific 20 year old usb serial adapters from hardware + move list of supported controllers to the hardware section + explain how the driver is loaded in description, and give usage hints MFC after: 3 days Thanks: cperciva (devd calls devmatch at runtime) Thanks: linimon (you dont need to be able to read *) Thanks: adrian (here, you can find things in the code) Reviewed by: adrian, ivy, mhorne (previous version) Differential Revision: https://reviews.freebsd.org/D50608 (cherry picked from commit 7176e1e3b5474a209f54cfd5d567a523bce3b9f6) --- share/man/man4/uftdi.4 | 119 +++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 54 deletions(-) diff --git a/share/man/man4/uftdi.4 b/share/man/man4/uftdi.4 index 9bd3d4a4a293..b526143eaa25 100644 --- a/share/man/man4/uftdi.4 +++ b/share/man/man4/uftdi.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" $NetBSD: uftdi.4,v 1.5 2002/02/07 03:15:08 ross Exp $ .\" .\" Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -27,61 +30,90 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2017 +.Dd June 25, 2025 .Dt UFTDI 4 .Os .Sh NAME .Nm uftdi -.Nd USB support for serial adapters based on the FTDI family of USB -serial adapter chips. +.Nd Future Technology Devices International USB to serial UART driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device usb" .Cd "device ucom" .Cd "device uftdi" -.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 -uftdi_load="YES" -.Ed +In +.Xr rc.conf 5 : +.Cd kld_list="uftdi" +.Pp +In +.Xr sysctl.conf 5 : +.Cd hw.usb.uftdi.debug=1 +.Cd hw.usb.uftdi.skip_jtag_interfaces=0 .Sh DESCRIPTION The .Nm -driver provides support for various serial adapters based on the -following FTDI chips: +driver supports FTDI USB to serial UART devices. +If the appropriate hardware is detected, +the driver will be loaded automatically by +.Xr devmatch 8 . +To load the driver manually, add it to the +.Ic kld_list +in +.Xr rc.conf 5 , +or use +.Xr kldload 8 +at runtime. +The device is accessed through the +.Xr ucom 4 +driver which makes it behave like a +.Xr tty 4 . +.Pp +Call out through this interface with applications like +.Xr cu 1 +or +.Xr tip 1 . +.Sh HARDWARE +The +.Nm +driver supports the following USB to serial UART controllers: .Pp .Bl -bullet -compact .It -FT8U100AX +FTDI FT4232H .It -FT8U232AM +FTDI FT232R .It -FT8U232BM +FTDI FT230X .It -FT232R +FTDI FT2232H .It -FT2232C +FTDI FT2232D .It -FT2232D +FTDI FT2232C .It -FT2232H +FTDI FT8U232BM .It -FT4232H +FTDI FT8U232AM .It -FT230X +FTDI FT8U100AX .El -.Pp -The device is accessed through the -.Xr ucom 4 -driver which makes it behave like a -.Xr tty 4 . -.Pp +.Sh SYSCTL VARIABLES +These settings can be entered in the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width "hw.usb.uftdi.skip_jtag_interfaces" +.It Va hw.usb.uftdi.debug +Enable debugging messages, default +.Ql 0 +.It Va hw.usb.uftdi.skip_jtag_interfaces +Ignore JTAG interfaces, default +.Ql 1 +.El +.Sh IOCTLS Many of the supported chips provide additional functionality such as bitbang mode and the MPSSE engine for serial bus emulation. The @@ -219,27 +251,6 @@ ioctl, you must pass the special value .Dv UFTDI_CONFIRM_ERASE as the argument to this ioctl. .El -.Sh HARDWARE -The -.Nm -driver supports the following adapters: -.Pp -.Bl -bullet -compact -.It -B&B Electronics USB->RS422/485 adapter -.It -Elexol USB MOD1 and USB MOD3 -.It -HP USB-Serial adapter shipped with some HP laptops -.It -Inland UAS111 -.It -QVS USC-1000 -.It -Buffalo PC-OP-RS / Kurouto-shikou KURO-RS universal remote -.It -Prologix GPIB-USB Controller -.El .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* @@ -255,14 +266,14 @@ for callout ports corresponding callout initial-state and lock-state devices .El .Sh SEE ALSO +.Xr cu 1 , .Xr tty 4 , .Xr ucom 4 , .Xr usb 4 .Sh HISTORY The .Nm -driver -appeared in +driver appeared in .Fx 4.8 from .Nx 1.5 . From nobody Fri Jul 4 18:23:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYhpC4swcz61jMS; Fri, 04 Jul 2025 18:23: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 4bYhpC1shxz3nS9; Fri, 04 Jul 2025 18:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OjlCKh6tHJNTwJseCnyOhwAGH3ZSt8p57NkHHMrczeI=; b=X715utP/28bsDdIo005cQ1mwgHFuj+nK29xhZjCKROD6w94BRR9Sln9yr6SYcyq6mKZkl6 7h3ovgXWKHCxYpHZQHq/SGDthnmOzKQshycVHsXiNghJWUTmzRRFkzidN7MPrZ1OtWjlFc cnp8moLl/QtctEpoisIs1rIHsmxu9b2J2/Iis4GlmjPDpyVllkxS4ApXVUSVrbs3pyE4OQ eWGDrEulCt5cB3TwX6Pu1b6AEPcCB4IH2VtsNInnI2dYhEN43FPlj1eq5C0XISOB/Hd4by rp7H3yGqn5B5sFrGtKg2jI6KFBtrx84G2d20QrsCCcHGnkfVrKj1RpNcdR7rYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751653395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OjlCKh6tHJNTwJseCnyOhwAGH3ZSt8p57NkHHMrczeI=; b=Nw2t5U8Lugr3OP+JzqEwLw84M0b3DtpRVlXx0pmQnsizl6XoaXRIGnHSdXw5TkZNbzMAD8 S7tUmk+XvVovIS5R4l0jPvDZ6IKic0Ae0H5jp6b3DSVkk06mrmyilKcKPHbROGynMNiUEY RuG0OriAsj6ZjylnTxHeG00njx6WcPIo+wbXGk0MGmWg0EhqDoeig2L01d8naCnK7vR1r9 hh9pKFqzjo54Op/h5ONW4DCcDw6G5B7g//hNZzySl7lykRQc7cDy1v3bdvrARZsfpSb3Am yXzTD/4AzmSZJd4XadgpJZaIUFusxPUnIL9wWgK4TBsK+b8KrNA4Me9xwNt4mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751653395; a=rsa-sha256; cv=none; b=Oycfx3+XNEr6A+UsFPamBO1SBI+yG4f5EQhU2z5WvU0DGiEYIbapmD0Kcdrggwrnxzbcq/ RFK8Jfb43fySIVUtDUY9axP1bbdw0NO1ni9iYp+X9PNtjyWA7X8bhwqu5y+/GB5gMRJjra P/oqZ49AXzglChrgxAc8pzML4SBUVO5C40iKznhtbhbgL0jShNScPHykAV4fSxgDFdw7DC Gq3LeBqpRa0xkvcrldwKsj6+X2sAV89O/JDJod377FYZxZP0dZ4zZZXZ15GY0ZjmFzLM6l bSQDu5i3H8MdZDAXndpuMcwR7nYWsanyxAXQXYq2yr4ELA+oKvXCWj6nozZfow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYhpC1Tffz120W; Fri, 04 Jul 2025 18:23: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 564INFAO069951; Fri, 4 Jul 2025 18:23:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564INFAA069948; Fri, 4 Jul 2025 18:23:15 GMT (envelope-from git) Date: Fri, 4 Jul 2025 18:23:15 GMT Message-Id: <202507041823.564INFAA069948@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: 293e4c54b536 - stable/14 - pf.4/pfsync.4: Separate sysctl/tunables >> SYNOPSIS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 293e4c54b5363394b5c70db4e5e32aca8e9b5094 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=293e4c54b5363394b5c70db4e5e32aca8e9b5094 commit 293e4c54b5363394b5c70db4e5e32aca8e9b5094 Author: Alexander Ziaee AuthorDate: 2025-06-25 23:19:14 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-04 18:20:56 +0000 pf.4/pfsync.4: Separate sysctl/tunables >> SYNOPSIS MFC after: 3 days Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D50856 (cherry picked from commit dca2ab32e831dd5cedab182da8c5c51aaa828967) --- share/man/man4/pf.4 | 37 ++++++++++++++++++++++++++++++++++--- share/man/man4/pfsync.4 | 30 ++++++++++++++++++++++++------ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index cd87b98ea45d..e0526552507c 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -35,6 +35,19 @@ .Sh SYNOPSIS .Cd "device pf" .Cd "options PF_DEFAULT_TO_DROP" +.Pp +In +.Xr loader.conf 5 : +.Cd net.pf.states_hashsize +.Cd net.pf.source_nodes_hashsize +.Cd net.pf.rule_tag_hashsize +.Cd net.pf.udpendpoint_hashsize +.Cd net.pf.default_to_drop +.Pp +In +.Xr sysctl.conf 5 : +.Cd net.pf.request_maxcount +.Cd net.pf.filter_local .Sh DESCRIPTION Packet filtering takes place in the kernel. A pseudo-device, @@ -74,10 +87,28 @@ separated by characters, similar to how file system hierarchies are laid out. The final component of the anchor path is the anchor under which operations will be performed. -.Sh SYSCTL VARIABLES AND LOADER TUNABLES -The following +.Sh SYSCTL VARIABLES +The following variables can be entered at the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va net.pf.filter_local +This tells +.Nm +to also filter on the loopback output hook. +This is typically used to allow redirect rules to adjust the source address. +.It Va net.pf.request_maxcount +The maximum number of items in a single ioctl call. +.El +.Sh LOADER TUNABLES +The following tunables can be entered at the .Xr loader 8 -tunables are available. +prompt, or set in +.Xr loader.conf 5 : .Bl -tag -width indent .It Va net.pf.states_hashsize Size of hash tables that store states. diff --git a/share/man/man4/pfsync.4 b/share/man/man4/pfsync.4 index b4b96ee133bf..46d239d421c0 100644 --- a/share/man/man4/pfsync.4 +++ b/share/man/man4/pfsync.4 @@ -32,6 +32,14 @@ .Nd packet filter state table sychronisation interface .Sh SYNOPSIS .Cd "device pfsync" +.Pp +In +.Xr loader.conf 5 : +.Cd net.pfsync.pfsync_buckets +.Pp +In +.Xr sysctl.conf 5 : +.Cd net.pfsync.carp_demotion_factor .Sh DESCRIPTION The .Nm @@ -155,12 +163,14 @@ Compatibility with FreeBSD 13.1 has been verified. .It Cm 1400 FreeBSD release 14.0. .El -.Pp -.Nm -has the following -.Xr sysctl 8 -tunables: -.Bl -tag -width ".Va net.pfsync" +.Sh SYSCTL VARIABLES +The following variables can be entered at the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width indent .It Va net.pfsync.carp_demotion_factor Value added to .Va net.inet.carp.demotion @@ -171,6 +181,14 @@ See .Xr carp 4 for more information. Default value is 240. +.El +.Sh LOADER TUNABLES +The following tunable may be set in +.Xr loader.conf 5 +or at the +.Xr loader 8 +prompt: +.Bl -tag -width indent .It Va net.pfsync.pfsync_buckets The number of .Nm