From nobody Mon Oct 11 01:49:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 451571807468; Mon, 11 Oct 2021 01:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSMCv1QfGz3sLY; Mon, 11 Oct 2021 01:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AB331861F; Mon, 11 Oct 2021 01:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19B1nETl010779; Mon, 11 Oct 2021 01:49:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19B1nEJJ010778; Mon, 11 Oct 2021 01:49:14 GMT (envelope-from git) Date: Mon, 11 Oct 2021 01:49:14 GMT Message-Id: <202110110149.19B1nEJJ010778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: dfe887b7d226 - main - nfsd: Disable the NFSv4.2 Allocate operation by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfe887b7d2265a5c6e0132cc03e006eb68223177 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=dfe887b7d2265a5c6e0132cc03e006eb68223177 commit dfe887b7d2265a5c6e0132cc03e006eb68223177 Author: Rick Macklem AuthorDate: 2021-10-11 01:46:02 +0000 Commit: Rick Macklem CommitDate: 2021-10-11 01:46:02 +0000 nfsd: Disable the NFSv4.2 Allocate operation by default Some exported file systems, such as ZFS ones, cannot do VOP_ALLOCATE(). Since an NFSv4.2 server must either support the Allocate operation for all file systems or not support it at all, define a sysctl called vfs.nfsd.enable_v42allocate to enable the Allocate operation. This sysctl is false by default and can only be set true if all exported file systems (or all DSs for a pNFS server) can perform VOP_ALLOCATE(). Unfortunately, there is no way to know if a ZFS file system will be exported once the nfsd is operational, even if there are none exported when the nfsd is started up, so enabling Allocate must be done manually for a server configuration. This problem was detected during a recent NFSv4 interoperability testing event held by the IETF working group. MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdserv.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 3b2e6c82276d..fca1df3a716a 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -91,6 +91,14 @@ SYSCTL_STRING(_vfs_nfsd, OID_AUTO, owner_major, CTLFLAG_RWTUN, static uint64_t nfsrv_owner_minor; SYSCTL_U64(_vfs_nfsd, OID_AUTO, owner_minor, CTLFLAG_RWTUN, &nfsrv_owner_minor, 0, "Server owner minor"); +/* + * Only enable this if all your exported file systems + * (or pNFS DSs for the pNFS case) support VOP_ALLOCATE. + */ +static bool nfsrv_doallocate = false; +SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, enable_v42allocate, CTLFLAG_RW, + &nfsrv_doallocate, 0, + "Enable NFSv4.2 Allocate operation"); /* * This list defines the GSS mechanisms supported. @@ -5324,6 +5332,16 @@ nfsrvd_allocate(struct nfsrv_descript *nd, __unused int isdgram, nfsquad_t clientid; nfsattrbit_t attrbits; + if (!nfsrv_doallocate) { + /* + * If any exported file system, such as a ZFS one, cannot + * do VOP_ALLOCATE(), this operation cannot be supported + * for NFSv4.2. This cannot be done 'per filesystem', but + * must be for the entire nfsd NFSv4.2 service. + */ + nd->nd_repstat = NFSERR_NOTSUPP; + goto nfsmout; + } gotproxystateid = 0; NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID + 2 * NFSX_HYPER); stp->ls_flags = (NFSLCK_CHECK | NFSLCK_WRITEACCESS); @@ -5390,9 +5408,13 @@ nfsrvd_allocate(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = nfsrv_lockctrl(vp, &stp, &lop, NULL, clientid, &stateid, exp, nd, curthread); + NFSD_DEBUG(4, "nfsrvd_allocate: off=%jd len=%jd stat=%d\n", + (intmax_t)off, (intmax_t)len, nd->nd_repstat); if (nd->nd_repstat == 0) nd->nd_repstat = nfsvno_allocate(vp, off, len, nd->nd_cred, curthread); + NFSD_DEBUG(4, "nfsrvd_allocate: aft nfsvno_allocate=%d\n", + nd->nd_repstat); vput(vp); NFSEXITCODE2(0, nd); return (0); From nobody Mon Oct 11 10:44:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 114DD1804A3F; Mon, 11 Oct 2021 10:44:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSb5S01K9z3rWc; Mon, 11 Oct 2021 10:44:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA6131FB88; Mon, 11 Oct 2021 10:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BAiR1u028692; Mon, 11 Oct 2021 10:44:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BAiRui028691; Mon, 11 Oct 2021 10:44:27 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:44:27 GMT Message-Id: <202110111044.19BAiRui028691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a85ce4ad7272 - main - Add pmap_change_prot on arm64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a85ce4ad7272ffa4b4649b0ed463341b743e815f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a85ce4ad7272ffa4b4649b0ed463341b743e815f commit a85ce4ad7272ffa4b4649b0ed463341b743e815f Author: Andrew Turner AuthorDate: 2021-09-20 16:49:18 +0000 Commit: Andrew Turner CommitDate: 2021-10-11 09:26:45 +0000 Add pmap_change_prot on arm64 Support changing the protection of preloaded kernel modules by implementing pmap_change_prot on arm64 and calling it from preload_protect. Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32026 --- sys/arm64/arm64/pmap.c | 94 +++++++++++++++++++++++++++++++++++++++++------- sys/arm64/include/pmap.h | 1 + sys/kern/link_elf.c | 2 +- 3 files changed, 83 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 95cb848df14d..259e0a0c2e62 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -382,7 +382,8 @@ static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, static void pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t mpte); static bool pmap_activate_int(pmap_t pmap); static void pmap_alloc_asid(pmap_t pmap); -static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); +static int pmap_change_props_locked(vm_offset_t va, vm_size_t size, + vm_prot_t prot, int mode); static pt_entry_t *pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va); static pt_entry_t *pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, struct rwlock **lockp); @@ -5949,17 +5950,41 @@ pmap_change_attr(vm_offset_t va, vm_size_t size, int mode) int error; PMAP_LOCK(kernel_pmap); - error = pmap_change_attr_locked(va, size, mode); + error = pmap_change_props_locked(va, size, PROT_NONE, mode); + PMAP_UNLOCK(kernel_pmap); + return (error); +} + +/* + * Changes the specified virtual address range's protections to those + * specified by "prot". Like pmap_change_attr(), protections for aliases + * in the direct map are updated as well. Protections on aliasing mappings may + * be a subset of the requested protections; for example, mappings in the direct + * map are never executable. + */ +int +pmap_change_prot(vm_offset_t va, vm_size_t size, vm_prot_t prot) +{ + int error; + + /* Only supported within the kernel map. */ + if (va < VM_MIN_KERNEL_ADDRESS) + return (EINVAL); + + PMAP_LOCK(kernel_pmap); + error = pmap_change_props_locked(va, size, prot, -1); PMAP_UNLOCK(kernel_pmap); return (error); } static int -pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) +pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, + int mode) { vm_offset_t base, offset, tmpva; pt_entry_t l3, *pte, *newpte; - int lvl; + pt_entry_t bits, mask; + int lvl, rv; PMAP_LOCK_ASSERT(kernel_pmap, MA_OWNED); base = trunc_page(va); @@ -5970,12 +5995,44 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) !(base >= VM_MIN_KERNEL_ADDRESS && base < VM_MAX_KERNEL_ADDRESS)) return (EINVAL); + bits = 0; + mask = 0; + if (mode != -1) { + bits = ATTR_S1_IDX(mode); + mask = ATTR_S1_IDX_MASK; + if (mode == VM_MEMATTR_DEVICE) { + mask |= ATTR_S1_XN; + bits |= ATTR_S1_XN; + } + } + if (prot != VM_PROT_NONE) { + /* Don't mark the DMAP as executable. It never is on arm64. */ + if (VIRT_IN_DMAP(base)) { + prot &= ~VM_PROT_EXECUTE; + /* + * XXX Mark the DMAP as writable for now. We rely + * on this in ddb & dtrace to insert breakpoint + * instructions. + */ + prot |= VM_PROT_WRITE; + } + + if ((prot & VM_PROT_WRITE) == 0) { + bits |= ATTR_S1_AP(ATTR_S1_AP_RO); + } + if ((prot & VM_PROT_EXECUTE) == 0) { + bits |= ATTR_S1_PXN; + } + bits |= ATTR_S1_UXN; + mask |= ATTR_S1_AP_MASK | ATTR_S1_XN; + } + for (tmpva = base; tmpva < base + size; ) { pte = pmap_pte(kernel_pmap, tmpva, &lvl); if (pte == NULL) return (EINVAL); - if ((pmap_load(pte) & ATTR_S1_IDX_MASK) == ATTR_S1_IDX(mode)) { + if ((pmap_load(pte) & mask) == bits) { /* * We already have the correct attribute, * ignore this entry. @@ -6016,14 +6073,23 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) case 3: /* Update the entry */ l3 = pmap_load(pte); - l3 &= ~ATTR_S1_IDX_MASK; - l3 |= ATTR_S1_IDX(mode); - if (mode == VM_MEMATTR_DEVICE) - l3 |= ATTR_S1_XN; + l3 &= ~mask; + l3 |= bits; pmap_update_entry(kernel_pmap, pte, l3, tmpva, PAGE_SIZE); + if (!VIRT_IN_DMAP(tmpva)) { + /* + * Keep the DMAP memory in sync. + */ + rv = pmap_change_props_locked( + PHYS_TO_DMAP(l3 & ~ATTR_MASK), + L3_SIZE, prot, mode); + if (rv != 0) + return (rv); + } + /* * If moving to a non-cacheable entry flush * the cache. @@ -6185,12 +6251,14 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, /* * If the page table page is missing and the mapping * is for a kernel address, the mapping must belong to - * the direct map. Page table pages are preallocated - * for every other part of the kernel address space, - * so the direct map region is the only part of the + * either the direct map or the early kernel memory. + * Page table pages are preallocated for every other + * part of the kernel address space, so the direct map + * region and early kernel memory are the only parts of the * kernel address space that must be handled here. */ - KASSERT(!ADDR_IS_KERNEL(va) || VIRT_IN_DMAP(va), + KASSERT(!ADDR_IS_KERNEL(va) || VIRT_IN_DMAP(va) || + (va >= VM_MIN_KERNEL_ADDRESS && va < kernel_vm_end), ("pmap_demote_l2: No saved mpte for va %#lx", va)); /* diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index 3b71e79f45ad..1421d19aabda 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -167,6 +167,7 @@ extern vm_offset_t virtual_end; void pmap_activate_vm(pmap_t); void pmap_bootstrap(vm_offset_t, vm_offset_t, vm_paddr_t, vm_size_t); int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); +int pmap_change_prot(vm_offset_t va, vm_size_t size, vm_prot_t prot); void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode); void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); bool pmap_klookup(vm_offset_t va, vm_paddr_t *pa); diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index ea21bf447a55..2faaa003380a 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -769,7 +769,7 @@ parse_vnet(elf_file_t ef) static int preload_protect(elf_file_t ef, vm_prot_t prot) { -#ifdef __amd64__ +#if defined(__aarch64__) || defined(__amd64__) Elf_Ehdr *hdr; Elf_Phdr *phdr, *phlimit; vm_prot_t nprot; From nobody Mon Oct 11 10:44:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4C08D1804941; Mon, 11 Oct 2021 10:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSb5T13NJz3rNG; Mon, 11 Oct 2021 10:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 024B41FA47; Mon, 11 Oct 2021 10:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BAiSMg028716; Mon, 11 Oct 2021 10:44:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BAiS9G028715; Mon, 11 Oct 2021 10:44:28 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:44:28 GMT Message-Id: <202110111044.19BAiS9G028715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 806a88e74200 - main - Only demote when needed in the arm64 pmap_change_props_locked List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 806a88e742002b0e82a4ea06f8e147f627947c2c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=806a88e742002b0e82a4ea06f8e147f627947c2c commit 806a88e742002b0e82a4ea06f8e147f627947c2c Author: Andrew Turner AuthorDate: 2021-10-06 16:38:22 +0000 Commit: Andrew Turner CommitDate: 2021-10-11 09:29:44 +0000 Only demote when needed in the arm64 pmap_change_props_locked When changing page table properties there is no need to demote a level 1 or level 2 block if we are changing the entire memory range the block is mapping. In this case just change the block directly. Reported by: alc, kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32339 --- sys/arm64/arm64/pmap.c | 76 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 259e0a0c2e62..9fbd473abe3a 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -5982,7 +5982,8 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, int mode) { vm_offset_t base, offset, tmpva; - pt_entry_t l3, *pte, *newpte; + vm_size_t pte_size; + pt_entry_t pte, *ptep, *newpte; pt_entry_t bits, mask; int lvl, rv; @@ -6028,11 +6029,11 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, } for (tmpva = base; tmpva < base + size; ) { - pte = pmap_pte(kernel_pmap, tmpva, &lvl); - if (pte == NULL) + ptep = pmap_pte(kernel_pmap, tmpva, &lvl); + if (ptep == NULL) return (EINVAL); - if ((pmap_load(pte) & mask) == bits) { + if ((pmap_load(ptep) & mask) == bits) { /* * We already have the correct attribute, * ignore this entry. @@ -6059,47 +6060,60 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, default: panic("Invalid DMAP table level: %d\n", lvl); case 1: - newpte = pmap_demote_l1(kernel_pmap, pte, + if ((tmpva & L1_OFFSET) == 0 && + (base + size - tmpva) >= L1_SIZE) { + pte_size = L1_SIZE; + break; + } + newpte = pmap_demote_l1(kernel_pmap, ptep, tmpva & ~L1_OFFSET); if (newpte == NULL) return (EINVAL); - pte = pmap_l1_to_l2(pte, tmpva); + ptep = pmap_l1_to_l2(ptep, tmpva); + /* FALLTHROUGH */ case 2: - newpte = pmap_demote_l2(kernel_pmap, pte, + if ((tmpva & L2_OFFSET) == 0 && + (base + size - tmpva) >= L2_SIZE) { + pte_size = L2_SIZE; + break; + } + newpte = pmap_demote_l2(kernel_pmap, ptep, tmpva); if (newpte == NULL) return (EINVAL); - pte = pmap_l2_to_l3(pte, tmpva); + ptep = pmap_l2_to_l3(ptep, tmpva); + /* FALLTHROUGH */ case 3: - /* Update the entry */ - l3 = pmap_load(pte); - l3 &= ~mask; - l3 |= bits; + pte_size = PAGE_SIZE; + break; + } - pmap_update_entry(kernel_pmap, pte, l3, tmpva, - PAGE_SIZE); + /* Update the entry */ + pte = pmap_load(ptep); + pte &= ~mask; + pte |= bits; - if (!VIRT_IN_DMAP(tmpva)) { - /* - * Keep the DMAP memory in sync. - */ - rv = pmap_change_props_locked( - PHYS_TO_DMAP(l3 & ~ATTR_MASK), - L3_SIZE, prot, mode); - if (rv != 0) - return (rv); - } + pmap_update_entry(kernel_pmap, ptep, pte, tmpva, + pte_size); + if (!VIRT_IN_DMAP(tmpva)) { /* - * If moving to a non-cacheable entry flush - * the cache. + * Keep the DMAP memory in sync. */ - if (mode == VM_MEMATTR_UNCACHEABLE) - cpu_dcache_wbinv_range(tmpva, L3_SIZE); - - break; + rv = pmap_change_props_locked( + PHYS_TO_DMAP(pte & ~ATTR_MASK), pte_size, + prot, mode); + if (rv != 0) + return (rv); } - tmpva += PAGE_SIZE; + + /* + * If moving to a non-cacheable entry flush + * the cache. + */ + if (mode == VM_MEMATTR_UNCACHEABLE) + cpu_dcache_wbinv_range(tmpva, pte_size); + tmpva += pte_size; } } From nobody Mon Oct 11 10:44:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4589B1804B30; Mon, 11 Oct 2021 10:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSb5V4VKNz3rNY; Mon, 11 Oct 2021 10:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 270D91FC06; Mon, 11 Oct 2021 10:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BAiUL8028740; Mon, 11 Oct 2021 10:44:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BAiUv7028739; Mon, 11 Oct 2021 10:44:30 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:44:30 GMT Message-Id: <202110111044.19BAiUv7028739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a90ebeb5feea - main - Allocate arm64 per-CPU data in the correct domain List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a90ebeb5feea63c9d8377cbc74e0442156a0ed15 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a90ebeb5feea63c9d8377cbc74e0442156a0ed15 commit a90ebeb5feea63c9d8377cbc74e0442156a0ed15 Author: Andrew Turner AuthorDate: 2021-10-06 15:08:04 +0000 Commit: Andrew Turner CommitDate: 2021-10-11 09:36:50 +0000 Allocate arm64 per-CPU data in the correct domain To minimise NUMA traffic allocate the pcpu, dpcpu, and boot stacks in the correct domain when possible. Submitted by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32338 --- sys/arm64/arm64/machdep.c | 14 +++++++++++--- sys/arm64/arm64/mp_machdep.c | 39 ++++++++++++++++++++++++++------------- sys/arm64/include/counter.h | 2 +- sys/arm64/include/pcpu_aux.h | 2 +- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index bca5a9e045cd..59a634f4d30c 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -102,7 +102,12 @@ __FBSDID("$FreeBSD$"); enum arm64_bus arm64_bus_method = ARM64_BUS_NONE; -struct pcpu __pcpu[MAXCPU]; +/* + * XXX: The .bss is assumed to be in the boot CPU NUMA domain. If not we + * could relocate this, but will need to keep the same virtual address as + * it's reverenced by the EARLY_COUNTER macro. + */ +struct pcpu pcpu0; static struct trapframe proc0_tf; @@ -334,7 +339,10 @@ makectx(struct trapframe *tf, struct pcb *pcb) static void init_proc0(vm_offset_t kstack) { - struct pcpu *pcpup = &__pcpu[0]; + struct pcpu *pcpup; + + pcpup = cpuid_to_pcpu[0]; + MPASS(pcpup != NULL); proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; @@ -762,7 +770,7 @@ initarm(struct arm64_bootparams *abp) EXFLAG_NOALLOC); /* Set the pcpu data, this is needed by pmap_bootstrap */ - pcpup = &__pcpu[0]; + pcpup = &pcpu0; pcpu_init(pcpup, 0, sizeof(struct pcpu)); /* diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index c5dd3312fdba..82f47a6f9918 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,7 +152,7 @@ static bool is_boot_cpu(uint64_t target_cpu) { - return (__pcpu[0].pc_mpidr == (target_cpu & CPU_AFF_MASK)); + return (cpuid_to_pcpu[0]->pc_mpidr == (target_cpu & CPU_AFF_MASK)); } static void @@ -213,15 +214,17 @@ init_secondary(uint64_t cpu) * they can pass random value in it. */ mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK; - if (cpu >= MAXCPU || __pcpu[cpu].pc_mpidr != mpidr) { + if (cpu >= MAXCPU || cpuid_to_pcpu[cpu] == NULL || + cpuid_to_pcpu[cpu]->pc_mpidr != mpidr) { for (cpu = 0; cpu < mp_maxid; cpu++) - if (__pcpu[cpu].pc_mpidr == mpidr) + if (cpuid_to_pcpu[cpu] != NULL && + cpuid_to_pcpu[cpu]->pc_mpidr == mpidr) break; if ( cpu >= MAXCPU) panic("MPIDR for this CPU is not in pcpu table"); } - pcpup = &__pcpu[cpu]; + pcpup = cpuid_to_pcpu[cpu]; /* * Set the pcpu pointer with a backup in tpidr_el1 to be * loaded when entering the kernel from userland. @@ -482,7 +485,7 @@ cpu_mp_probe(void) * do nothing. Returns true if the CPU is present and running. */ static bool -start_cpu(u_int cpuid, uint64_t target_cpu) +start_cpu(u_int cpuid, uint64_t target_cpu, int domain) { struct pcpu *pcpup; vm_paddr_t pa; @@ -498,14 +501,17 @@ start_cpu(u_int cpuid, uint64_t target_cpu) KASSERT(cpuid < MAXCPU, ("Too many CPUs")); - pcpup = &__pcpu[cpuid]; + pcpup = (void *)kmem_malloc_domainset(DOMAINSET_PREF(domain), + sizeof(*pcpup), M_WAITOK | M_ZERO); pcpu_init(pcpup, cpuid, sizeof(struct pcpu)); pcpup->pc_mpidr = target_cpu & CPU_AFF_MASK; - dpcpu[cpuid - 1] = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | M_ZERO); + dpcpu[cpuid - 1] = (void *)kmem_malloc_domainset( + DOMAINSET_PREF(domain), DPCPU_SIZE, M_WAITOK | M_ZERO); dpcpu_init(dpcpu[cpuid - 1], cpuid); - bootstacks[cpuid] = (void *)kmem_malloc(PAGE_SIZE, M_WAITOK | M_ZERO); + bootstacks[cpuid] = (void *)kmem_malloc_domainset( + DOMAINSET_PREF(domain), PAGE_SIZE, M_WAITOK | M_ZERO); naps = atomic_load_int(&aps_started); bootstack = (char *)bootstacks[cpuid] + PAGE_SIZE; @@ -548,6 +554,7 @@ madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) ACPI_MADT_GENERIC_INTERRUPT *intr; u_int *cpuid; u_int id; + int domain; switch(entry->Type) { case ACPI_MADT_TYPE_GENERIC_INTERRUPT: @@ -559,8 +566,14 @@ madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) else id = *cpuid; - if (start_cpu(id, intr->ArmMpidr)) { - __pcpu[id].pc_acpi_id = intr->Uid; +#ifdef NUMA + domain = acpi_pxm_get_cpu_locality(*cpuid); +#else + domain = 0; +#endif + if (start_cpu(id, intr->ArmMpidr, domain)) { + MPASS(cpuid_to_pcpu[id] != NULL); + cpuid_to_pcpu[id]->pc_acpi_id = intr->Uid; /* * Don't increment for the boot CPU, its CPU ID is * reserved. @@ -623,7 +636,7 @@ start_cpu_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) else cpuid = fdt_cpuid; - if (!start_cpu(cpuid, target_cpu)) + if (!start_cpu(cpuid, target_cpu, 0)) return (FALSE); /* @@ -636,7 +649,7 @@ start_cpu_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) if (vm_ndomains == 1 || OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) <= 0) domain = 0; - __pcpu[cpuid].pc_domain = domain; + cpuid_to_pcpu[cpuid]->pc_domain = domain; if (domain < MAXMEMDOM) CPU_SET(cpuid, &cpuset_domain[domain]); return (TRUE); @@ -667,7 +680,7 @@ cpu_mp_start(void) /* CPU 0 is always boot CPU. */ CPU_SET(0, &all_cpus); - __pcpu[0].pc_mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK; + cpuid_to_pcpu[0]->pc_mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK; switch(arm64_bus_method) { #ifdef DEV_ACPI diff --git a/sys/arm64/include/counter.h b/sys/arm64/include/counter.h index 333015cc7139..7f747b525d9c 100644 --- a/sys/arm64/include/counter.h +++ b/sys/arm64/include/counter.h @@ -32,7 +32,7 @@ #include #include -#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter +#define EARLY_COUNTER &pcpu0.pc_early_dummy_counter #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) diff --git a/sys/arm64/include/pcpu_aux.h b/sys/arm64/include/pcpu_aux.h index 3d4c70c491d6..382811dfa1fb 100644 --- a/sys/arm64/include/pcpu_aux.h +++ b/sys/arm64/include/pcpu_aux.h @@ -47,6 +47,6 @@ */ _Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); -extern struct pcpu __pcpu[]; +extern struct pcpu pcpu0; #endif /* _MACHINE_PCPU_AUX_H_ */ From nobody Mon Oct 11 10:44:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7ED7018048E9; Mon, 11 Oct 2021 10:44:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSb5X1334z3r7D; Mon, 11 Oct 2021 10:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C8351FB12; Mon, 11 Oct 2021 10:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BAiVAf028764; Mon, 11 Oct 2021 10:44:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BAiVRR028763; Mon, 11 Oct 2021 10:44:31 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:44:31 GMT Message-Id: <202110111044.19BAiVRR028763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: aacbf3fb8482 - main - Teach the readelf about arm64 gnu properties List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aacbf3fb8482226fcdf6a19af1011f9d65c20f2a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=aacbf3fb8482226fcdf6a19af1011f9d65c20f2a commit aacbf3fb8482226fcdf6a19af1011f9d65c20f2a Author: Andrew Turner AuthorDate: 2021-09-17 15:54:31 +0000 Commit: Andrew Turner CommitDate: 2021-10-11 09:39:49 +0000 Teach the readelf about arm64 gnu properties On arm64 binaries can be tagged as using BTI or PAC. Add support to decode these to the elftoolchain readelf. To simplify the code use a table based method to find the flag description table. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32315 --- contrib/elftoolchain/readelf/readelf.c | 69 +++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index d5f9205e354d..f33519112eb4 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -229,6 +229,12 @@ struct flag_desc { const char *desc; }; +struct flag_desc_list { + uint32_t type; + const char *desc_str; + struct flag_desc *desc; +}; + struct mips_option { uint64_t flag; const char *desc; @@ -3539,15 +3545,50 @@ dump_gnu_hash(struct readelf *re, struct section *s) free(bl); } +static struct flag_desc gnu_property_aarch64_feature_1_and_bits[] = { + { GNU_PROPERTY_AARCH64_FEATURE_1_BTI, "BTI" }, + { GNU_PROPERTY_AARCH64_FEATURE_1_PAC, "PAC" }, + { 0, NULL } +}; + +static struct flag_desc_list gnu_property_aarch64[] = { + { + GNU_PROPERTY_AARCH64_FEATURE_1_AND, + "AArch64 features", + gnu_property_aarch64_feature_1_and_bits + }, + { 0, NULL, NULL } +}; + static struct flag_desc gnu_property_x86_feature_1_and_bits[] = { { GNU_PROPERTY_X86_FEATURE_1_IBT, "IBT" }, { GNU_PROPERTY_X86_FEATURE_1_SHSTK, "SHSTK" }, { 0, NULL } }; +static struct flag_desc_list gnu_property_x86[] = { + { + GNU_PROPERTY_X86_FEATURE_1_AND, + "x64 features", + gnu_property_x86_feature_1_and_bits + }, + { 0, NULL, NULL } +}; + +static struct { + unsigned int emachine; + struct flag_desc_list *flag_list; +} gnu_property_archs[] = { + { EM_AARCH64, gnu_property_aarch64 }, + { EM_X86_64, gnu_property_x86 }, + { 0, NULL } +}; + static void dump_gnu_property_type_0(struct readelf *re, const char *buf, size_t sz) { + struct flag_desc_list *desc_list; + struct flag_desc *desc; size_t i; uint32_t type, prop_sz; @@ -3566,19 +3607,35 @@ dump_gnu_property_type_0(struct readelf *re, const char *buf, size_t sz) if (type >= GNU_PROPERTY_LOPROC && type <= GNU_PROPERTY_HIPROC) { - if (re->ehdr.e_machine != EM_X86_64) { + desc_list = NULL; + for (i = 0; gnu_property_archs[i].flag_list != NULL; + i++) { + if (gnu_property_archs[i].emachine == + re->ehdr.e_machine) { + desc_list = + gnu_property_archs[i].flag_list; + break; + } + } + if (desc_list == NULL) { printf("machine type %x unknown\n", re->ehdr.e_machine); goto unknown; } - switch (type) { - case GNU_PROPERTY_X86_FEATURE_1_AND: - printf("x86 features:"); + + desc = NULL; + for (i = 0; desc_list[i].desc != NULL; i++) { + if (desc_list[i].type == type) { + desc = desc_list[i].desc; + break; + } + } + if (desc != NULL) { + printf("%s:", desc_list[i].desc_str); if (prop_sz != 4) goto bad; - dump_flags(gnu_property_x86_feature_1_and_bits, + dump_flags(desc, *(const uint32_t *)(const void *)buf); - break; } } From nobody Mon Oct 11 10:53:38 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B672C180659C; Mon, 11 Oct 2021 10:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSbJ24ZhBz3tKT; Mon, 11 Oct 2021 10:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D40C1FB50; Mon, 11 Oct 2021 10:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BArcux041791; Mon, 11 Oct 2021 10:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BArchw041790; Mon, 11 Oct 2021 10:53:38 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:53:38 GMT Message-Id: <202110111053.19BArchw041790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 88c027338f18 - main - Update OptionalObsoleteFiles.inc after 021385aba562 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88c027338f182e2af56d0dbabd4a94fbca6f091a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=88c027338f182e2af56d0dbabd4a94fbca6f091a commit 88c027338f182e2af56d0dbabd4a94fbca6f091a Author: Alex Richardson AuthorDate: 2021-10-11 10:46:30 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 10:46:31 +0000 Update OptionalObsoleteFiles.inc after 021385aba562 I forgot to update this file so make delete-old would incorrectly remove the newly-installed LLVM binutils. While touching the file also update for 8e1c989abbd1 since ObsoleteFiles.inc now inludes the tablegen binaries. Reported by: Herbert J. Skuhra Reviewed By: emaste, imp Differential Revision: https://reviews.freebsd.org/D32022 --- ObsoleteFiles.inc | 1 + tools/build/mk/OptionalObsoleteFiles.inc | 36 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index cea96addd379..7c5e534d21d4 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -57,6 +57,7 @@ OLD_FILES+=usr/share/man/man4/cloudabi.4.gz OLD_FILES+=usr/bin/llvm-tblgen OLD_FILES+=usr/bin/clang-tblgen OLD_FILES+=usr/bin/lldb-tblgen +OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz # 20210810: remove Pentium-related man pages and references OLD_FILES+=usr/share/man/man3/pmc.p4.3.gz diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index cacfe28069e3..b6a32c18a12d 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1219,18 +1219,30 @@ OLD_FILES+=usr/share/man/man8/zfsloader.8.gz OLD_FILES+=usr/share/man/man8/zpool.8.gz .endif -.if ${MK_CLANG} == no -OLD_FILES+=usr/bin/clang -OLD_FILES+=usr/bin/clang++ -OLD_FILES+=usr/bin/clang-cpp -OLD_FILES+=usr/bin/clang-tblgen +.if ${MK_CLANG} == no && ${MK_LLVM_BINUTILS} == no OLD_FILES+=usr/bin/llvm-addr2line OLD_FILES+=usr/bin/llvm-ar OLD_FILES+=usr/bin/llvm-nm +OLD_FILES+=usr/bin/llvm-objcopy OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-ranlib +OLD_FILES+=usr/bin/llvm-size +OLD_FILES+=usr/bin/llvm-strings OLD_FILES+=usr/bin/llvm-symbolizer -OLD_FILES+=usr/bin/llvm-tblgen +OLD_FILES+=usr/share/man/man1/llvm-addr2line.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz +OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz +OLD_FILES+=usr/share/man/man1/llvm-objcopy.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz +OLD_FILES+=usr/share/man/man1/llvm-size.1.gz +OLD_FILES+=usr/share/man/man1/llvm-strings.1.gz +OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz +.endif + +.if ${MK_CLANG} == no +OLD_FILES+=usr/bin/clang +OLD_FILES+=usr/bin/clang++ +OLD_FILES+=usr/bin/clang-cpp OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/algorithm OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/complex OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/new @@ -1529,12 +1541,6 @@ OLD_DIRS+=usr/share/doc/llvm OLD_FILES+=usr/share/man/man1/clang.1.gz OLD_FILES+=usr/share/man/man1/clang++.1.gz OLD_FILES+=usr/share/man/man1/clang-cpp.1.gz -OLD_FILES+=usr/share/man/man1/llvm-addr2line.1.gz -OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz -OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz -OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz -OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz -OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz .endif .if ${MK_CLANG_EXTRAS} == no @@ -1555,11 +1561,8 @@ OLD_FILES+=usr/bin/llvm-lto2 OLD_FILES+=usr/bin/llvm-mc OLD_FILES+=usr/bin/llvm-mca OLD_FILES+=usr/bin/llvm-modextract -OLD_FILES+=usr/bin/llvm-objcopy OLD_FILES+=usr/bin/llvm-pdbutil OLD_FILES+=usr/bin/llvm-rtdyld -OLD_FILES+=usr/bin/llvm-size -OLD_FILES+=usr/bin/llvm-strings OLD_FILES+=usr/bin/llvm-xray OLD_FILES+=usr/bin/opt OLD_FILES+=usr/share/man/man1/bugpoint.1.gz @@ -1572,10 +1575,7 @@ OLD_FILES+=usr/share/man/man1/llvm-dis.1.gz OLD_FILES+=usr/share/man/man1/llvm-dwarfdump.1 OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz OLD_FILES+=usr/share/man/man1/llvm-link.1.gz -OLD_FILES+=usr/share/man/man1/llvm-objcopy.1.gz OLD_FILES+=usr/share/man/man1/llvm-pdbutil.1.gz -OLD_FILES+=usr/share/man/man1/llvm-size.1.gz -OLD_FILES+=usr/share/man/man1/llvm-strings.1.gz OLD_FILES+=usr/share/man/man1/opt.1.gz .endif From nobody Mon Oct 11 10:53:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E9B2E18062DE; Mon, 11 Oct 2021 10:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSbJ35X5pz3tH2; Mon, 11 Oct 2021 10:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F81E1FB51; Mon, 11 Oct 2021 10:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BArdGG041821; Mon, 11 Oct 2021 10:53:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BArdBu041820; Mon, 11 Oct 2021 10:53:39 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:53:39 GMT Message-Id: <202110111053.19BArdBu041820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 2686b10db41c - main - linuxkpi: Add sg_init_one List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2686b10db41c79dd1a0a0c33a7e0c0b67e0701cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2686b10db41c79dd1a0a0c33a7e0c0b67e0701cc commit 2686b10db41c79dd1a0a0c33a7e0c0b67e0701cc Author: Alex Richardson AuthorDate: 2021-10-08 08:32:46 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 10:51:43 +0000 linuxkpi: Add sg_init_one Needed for the virtio-gpu driver. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366 --- sys/compat/linuxkpi/common/include/linux/scatterlist.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 13ee34cf9448..295ca2ba3cfd 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -182,6 +182,13 @@ sg_init_table(struct scatterlist *sg, unsigned int nents) sg_mark_end(&sg[nents - 1]); } +static inline void +sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen) +{ + sg_init_table(sg, 1); + sg_set_buf(sg, buf, buflen); +} + static struct scatterlist * sg_kmalloc(unsigned int nents, gfp_t gfp_mask) { From nobody Mon Oct 11 10:53:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B11221806710; Mon, 11 Oct 2021 10:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSbJ52wX1z3tHB; Mon, 11 Oct 2021 10:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA7A21FC3C; Mon, 11 Oct 2021 10:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BArecM041846; Mon, 11 Oct 2021 10:53:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BAreS2041845; Mon, 11 Oct 2021 10:53:40 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:53:40 GMT Message-Id: <202110111053.19BAreS2041845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: ff479cc6c9ee - main - linuxkpi: add PAGE_ALIGNED macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff479cc6c9eeab2fd6f0f98310c65c0906299d82 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=ff479cc6c9eeab2fd6f0f98310c65c0906299d82 commit ff479cc6c9eeab2fd6f0f98310c65c0906299d82 Author: Alex Richardson AuthorDate: 2021-10-08 08:33:21 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 10:51:43 +0000 linuxkpi: add PAGE_ALIGNED macro Needed for the virtio-gpu driver. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366 --- sys/compat/linuxkpi/common/include/linux/mm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index ec88f39ac410..00583937318b 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -294,4 +294,6 @@ void si_meminfo(struct sysinfo *si); void lkpi_unmap_mapping_range(void *obj, loff_t const holebegin __unused, loff_t const holelen, int even_cows __unused); +#define PAGE_ALIGNED(p) __is_aligned(p, PAGE_SIZE) + #endif /* _LINUX_MM_H_ */ From nobody Mon Oct 11 10:53:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 59025180671E; Mon, 11 Oct 2021 10:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSbJ61SHJz3tY6; Mon, 11 Oct 2021 10:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAA881F83C; Mon, 11 Oct 2021 10:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BArffb041870; Mon, 11 Oct 2021 10:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BArf3c041869; Mon, 11 Oct 2021 10:53:41 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:53:41 GMT Message-Id: <202110111053.19BArf3c041869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 6d15ccde4d95 - main - linuxkpi: Allow BUILD_BUG_ON in if statements without braces List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d15ccde4d9579ad2a77f93630695804a7efcbc4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6d15ccde4d9579ad2a77f93630695804a7efcbc4 commit 6d15ccde4d9579ad2a77f93630695804a7efcbc4 Author: Alex Richardson AuthorDate: 2021-10-08 08:35:31 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 10:51:44 +0000 linuxkpi: Allow BUILD_BUG_ON in if statements without braces I got a compilation failure in virtio-gpu without this change. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index aba5896111f7..852603f75f8b 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -105,7 +105,7 @@ } #define BUILD_BUG() do { CTASSERT(0); } while (0) -#define BUILD_BUG_ON(x) _O_CTASSERT(!(x)) +#define BUILD_BUG_ON(x) do { _O_CTASSERT(!(x)) } while (0) #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) #define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } From nobody Mon Oct 11 10:53:42 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BCF001806797; Mon, 11 Oct 2021 10:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSbJ72DQ8z3tdl; Mon, 11 Oct 2021 10:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EDBE1FE06; Mon, 11 Oct 2021 10:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BArglD041894; Mon, 11 Oct 2021 10:53:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BArgpn041893; Mon, 11 Oct 2021 10:53:42 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:53:42 GMT Message-Id: <202110111053.19BArgpn041893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: d98f2712c7f5 - main - linuxkpi: implement ida_alloc() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d98f2712c7f5e4636afa65c8c3875bbb5ff981cf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d98f2712c7f5e4636afa65c8c3875bbb5ff981cf commit d98f2712c7f5e4636afa65c8c3875bbb5ff981cf Author: Alex Richardson AuthorDate: 2021-10-08 08:36:30 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 10:51:44 +0000 linuxkpi: implement ida_alloc() Needed for the virtio-gpu driver. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366 --- sys/compat/linuxkpi/common/include/linux/idr.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/idr.h b/sys/compat/linuxkpi/common/include/linux/idr.h index 7387032fd989..cba3f96c88ae 100644 --- a/sys/compat/linuxkpi/common/include/linux/idr.h +++ b/sys/compat/linuxkpi/common/include/linux/idr.h @@ -140,6 +140,11 @@ ida_alloc_max(struct ida *ida, unsigned int max, gfp_t gfp) return (ida_simple_get(ida, 0, max, gfp)); } +static inline int ida_alloc(struct ida *ida, gfp_t gfp) +{ + return (ida_alloc_max(ida, ~0u, gfp)); +} + static inline bool ida_is_empty(struct ida *ida) { From nobody Mon Oct 11 10:53:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 90DD71806730; Mon, 11 Oct 2021 10:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSbJ8446yz3tMw; Mon, 11 Oct 2021 10:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F3EB1FAD2; Mon, 11 Oct 2021 10:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BAriHN041918; Mon, 11 Oct 2021 10:53:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BAri0d041917; Mon, 11 Oct 2021 10:53:44 GMT (envelope-from git) Date: Mon, 11 Oct 2021 10:53:44 GMT Message-Id: <202110111053.19BAri0d041917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 6c4f95161d6e - main - virtio: make the write_config buffer argument const List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c4f95161d6e38ba3fd50ca1cceee3110cbfa02e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6c4f95161d6e38ba3fd50ca1cceee3110cbfa02e commit 6c4f95161d6e38ba3fd50ca1cceee3110cbfa02e Author: Alex Richardson AuthorDate: 2021-10-11 10:52:17 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 10:52:18 +0000 virtio: make the write_config buffer argument const No functional change intended, but noticed that we could add const here while adding linuxkpi support for virtio. Reviewed By: bryanv, imp Differential Revision: https://reviews.freebsd.org/D32370 --- sys/dev/virtio/mmio/virtio_mmio.c | 14 +++++++------- sys/dev/virtio/pci/virtio_pci_legacy.c | 6 +++--- sys/dev/virtio/pci/virtio_pci_modern.c | 12 ++++++------ sys/dev/virtio/virtio.c | 2 +- sys/dev/virtio/virtio.h | 2 +- sys/dev/virtio/virtio_bus_if.m | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c index ca89bac5ff7c..cc89947c4d00 100644 --- a/sys/dev/virtio/mmio/virtio_mmio.c +++ b/sys/dev/virtio/mmio/virtio_mmio.c @@ -88,7 +88,7 @@ static void vtmmio_notify_virtqueue(device_t, uint16_t, bus_size_t); static uint8_t vtmmio_get_status(device_t); static void vtmmio_set_status(device_t, uint8_t); static void vtmmio_read_dev_config(device_t, bus_size_t, void *, int); -static void vtmmio_write_dev_config(device_t, bus_size_t, void *, int); +static void vtmmio_write_dev_config(device_t, bus_size_t, const void *, int); static void vtmmio_describe_features(struct vtmmio_softc *, const char *, uint64_t); static void vtmmio_probe_and_attach_child(struct vtmmio_softc *); @@ -737,7 +737,7 @@ vtmmio_read_dev_config(device_t dev, bus_size_t offset, static void vtmmio_write_dev_config(device_t dev, bus_size_t offset, - void *src, int length) + const void *src, int length) { struct vtmmio_softc *sc; bus_size_t off; @@ -755,21 +755,21 @@ vtmmio_write_dev_config(device_t dev, bus_size_t offset, if (sc->vtmmio_version > 1) { switch (length) { case 1: - vtmmio_write_config_1(sc, off, *(uint8_t *)src); + vtmmio_write_config_1(sc, off, *(const uint8_t *)src); break; case 2: vtmmio_write_config_2(sc, off, - htole16(*(uint16_t *)src)); + htole16(*(const uint16_t *)src)); break; case 4: vtmmio_write_config_4(sc, off, - htole32(*(uint32_t *)src)); + htole32(*(const uint32_t *)src)); break; case 8: vtmmio_write_config_4(sc, off, - htole32(*(uint64_t *)src)); + htole32(*(const uint64_t *)src)); vtmmio_write_config_4(sc, off + 4, - htole32((*(uint64_t *)src) >> 32)); + htole32((*(const uint64_t *)src) >> 32)); break; default: panic("%s: invalid length %d\n", __func__, length); diff --git a/sys/dev/virtio/pci/virtio_pci_legacy.c b/sys/dev/virtio/pci/virtio_pci_legacy.c index a0d962058a84..8de23f052893 100644 --- a/sys/dev/virtio/pci/virtio_pci_legacy.c +++ b/sys/dev/virtio/pci/virtio_pci_legacy.c @@ -97,7 +97,7 @@ static int vtpci_legacy_reinit(device_t, uint64_t); static void vtpci_legacy_reinit_complete(device_t); static void vtpci_legacy_notify_vq(device_t, uint16_t, bus_size_t); static void vtpci_legacy_read_dev_config(device_t, bus_size_t, void *, int); -static void vtpci_legacy_write_dev_config(device_t, bus_size_t, void *, int); +static void vtpci_legacy_write_dev_config(device_t, bus_size_t, const void *, int); static bool vtpci_legacy_setup_msix(struct vtpci_legacy_softc *sc); static void vtpci_legacy_teardown_msix(struct vtpci_legacy_softc *sc); @@ -519,11 +519,11 @@ vtpci_legacy_read_dev_config(device_t dev, bus_size_t offset, static void vtpci_legacy_write_dev_config(device_t dev, bus_size_t offset, - void *src, int length) + const void *src, int length) { struct vtpci_legacy_softc *sc; bus_size_t off; - uint8_t *s; + const uint8_t *s; int i; sc = device_get_softc(dev); diff --git a/sys/dev/virtio/pci/virtio_pci_modern.c b/sys/dev/virtio/pci/virtio_pci_modern.c index 201d2b79f7ca..ef5298467f77 100644 --- a/sys/dev/virtio/pci/virtio_pci_modern.c +++ b/sys/dev/virtio/pci/virtio_pci_modern.c @@ -123,7 +123,7 @@ static void vtpci_modern_reinit_complete(device_t); static void vtpci_modern_notify_vq(device_t, uint16_t, bus_size_t); static int vtpci_modern_config_generation(device_t); static void vtpci_modern_read_dev_config(device_t, bus_size_t, void *, int); -static void vtpci_modern_write_dev_config(device_t, bus_size_t, void *, int); +static void vtpci_modern_write_dev_config(device_t, bus_size_t, const void *, int); static int vtpci_modern_probe_configs(device_t); static int vtpci_modern_find_cap(device_t, uint8_t, int *); @@ -686,7 +686,7 @@ vtpci_modern_read_dev_config(device_t dev, bus_size_t offset, void *dst, } static void -vtpci_modern_write_dev_config(device_t dev, bus_size_t offset, void *src, +vtpci_modern_write_dev_config(device_t dev, bus_size_t offset, const void *src, int length) { struct vtpci_modern_softc *sc; @@ -700,20 +700,20 @@ vtpci_modern_write_dev_config(device_t dev, bus_size_t offset, void *src, switch (length) { case 1: - vtpci_modern_write_device_1(sc, offset, *(uint8_t *) src); + vtpci_modern_write_device_1(sc, offset, *(const uint8_t *) src); break; case 2: { - uint16_t val = virtio_gtoh16(true, *(uint16_t *) src); + uint16_t val = virtio_gtoh16(true, *(const uint16_t *) src); vtpci_modern_write_device_2(sc, offset, val); break; } case 4: { - uint32_t val = virtio_gtoh32(true, *(uint32_t *) src); + uint32_t val = virtio_gtoh32(true, *(const uint32_t *) src); vtpci_modern_write_device_4(sc, offset, val); break; } case 8: { - uint64_t val = virtio_gtoh64(true, *(uint64_t *) src); + uint64_t val = virtio_gtoh64(true, *(const uint64_t *) src); vtpci_modern_write_device_8(sc, offset, val); break; } diff --git a/sys/dev/virtio/virtio.c b/sys/dev/virtio/virtio.c index 673deee576f7..e6a68682660a 100644 --- a/sys/dev/virtio/virtio.c +++ b/sys/dev/virtio/virtio.c @@ -321,7 +321,7 @@ virtio_read_device_config(device_t dev, bus_size_t offset, void *dst, int len) } void -virtio_write_device_config(device_t dev, bus_size_t offset, void *dst, int len) +virtio_write_device_config(device_t dev, bus_size_t offset, const void *dst, int len) { VIRTIO_BUS_WRITE_DEVICE_CONFIG(device_get_parent(dev), diff --git a/sys/dev/virtio/virtio.h b/sys/dev/virtio/virtio.h index 3b2105de7175..a9ed8b75fbf6 100644 --- a/sys/dev/virtio/virtio.h +++ b/sys/dev/virtio/virtio.h @@ -123,7 +123,7 @@ int virtio_child_pnpinfo(device_t busdev, device_t child, struct sbuf *sb); void virtio_read_device_config(device_t dev, bus_size_t offset, void *dst, int length); void virtio_write_device_config(device_t dev, bus_size_t offset, - void *src, int length); + const void *src, int length); /* Inlined device specific read/write functions for common lengths. */ #define VIRTIO_RDWR_DEVICE_CONFIG(size, type) \ diff --git a/sys/dev/virtio/virtio_bus_if.m b/sys/dev/virtio/virtio_bus_if.m index 2c3424204842..80a99f2afedd 100644 --- a/sys/dev/virtio/virtio_bus_if.m +++ b/sys/dev/virtio/virtio_bus_if.m @@ -107,7 +107,7 @@ METHOD void read_device_config { METHOD void write_device_config { device_t dev; bus_size_t offset; - void *src; + const void *src; int len; }; From nobody Mon Oct 11 11:19:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 22A68180A448; Mon, 11 Oct 2021 11:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSbtM0SBkz4SXs; Mon, 11 Oct 2021 11:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6AB61FE6D; Mon, 11 Oct 2021 11:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BBJs7w069696; Mon, 11 Oct 2021 11:19:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BBJs09069695; Mon, 11 Oct 2021 11:19:54 GMT (envelope-from git) Date: Mon, 11 Oct 2021 11:19:54 GMT Message-Id: <202110111119.19BBJs09069695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: a89410ef9179 - main - cross-build: fix some redeclaration warnings during bootstrap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a89410ef91798859f3fd7a5f675184b4d711ade4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=a89410ef91798859f3fd7a5f675184b4d711ade4 commit a89410ef91798859f3fd7a5f675184b4d711ade4 Author: Alex Richardson AuthorDate: 2021-09-13 09:11:47 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 10:57:54 +0000 cross-build: fix some redeclaration warnings during bootstrap MFC after: 3 days --- tools/build/cross-build/include/linux/stdio.h | 8 ++++++-- tools/build/cross-build/include/linux/stdlib.h | 2 -- tools/build/cross-build/include/linux/sys/param.h | 3 --- tools/build/cross-build/include/linux/unistd.h | 4 ---- tools/build/cross-build/include/mac/stdlib.h | 2 -- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tools/build/cross-build/include/linux/stdio.h b/tools/build/cross-build/include/linux/stdio.h index 340977c15d93..c5aa893b320c 100644 --- a/tools/build/cross-build/include/linux/stdio.h +++ b/tools/build/cross-build/include/linux/stdio.h @@ -37,13 +37,17 @@ */ /* No #pragam once since glibc can include this multiple times */ -#include - #include_next +#ifndef _BOOTSTRAP_LINUX_STDIO_H +#define _BOOTSTRAP_LINUX_STDIO_H +#include + __BEGIN_DECLS char *fgetln(FILE *, __SIZE_TYPE__ *); #if defined(_WCHAR_H) __WCHAR_TYPE__ *fgetwln(FILE *__restrict, __SIZE_TYPE__ *__restrict); #endif __END_DECLS + +#endif diff --git a/tools/build/cross-build/include/linux/stdlib.h b/tools/build/cross-build/include/linux/stdlib.h index 9e0c1de02ccb..1e559ce1158c 100644 --- a/tools/build/cross-build/include/linux/stdlib.h +++ b/tools/build/cross-build/include/linux/stdlib.h @@ -60,8 +60,6 @@ int cgetustr(char *, const char *, char **); const char *getprogname(void); void setprogname(const char *progname); -void *reallocarray(void *, size_t, size_t) __result_use_check - __alloc_size2(2, 3); void *reallocf(void *, size_t) __result_use_check __alloc_size(2); unsigned arc4random(void); diff --git a/tools/build/cross-build/include/linux/sys/param.h b/tools/build/cross-build/include/linux/sys/param.h index c918998e06a3..305d2767ae7e 100644 --- a/tools/build/cross-build/include/linux/sys/param.h +++ b/tools/build/cross-build/include/linux/sys/param.h @@ -47,6 +47,3 @@ * let's use 32 since that will work across all systems */ #define MAXLOGNAME 33 /* max login name length (incl. NUL) */ - -/* For elftoolchain (seems like on ubuntu it's in errno.h) */ -extern char *program_invocation_short_name; diff --git a/tools/build/cross-build/include/linux/unistd.h b/tools/build/cross-build/include/linux/unistd.h index ea131f1ab732..f518df2ac9ae 100644 --- a/tools/build/cross-build/include/linux/unistd.h +++ b/tools/build/cross-build/include/linux/unistd.h @@ -85,10 +85,6 @@ getentropy(void *buf, size_t buflen) } #endif -/* Used by elftoolchain: */ -extern char *program_invocation_name; -extern char *program_invocation_short_name; - void *setmode(const char *); mode_t getmode(const void *, mode_t); diff --git a/tools/build/cross-build/include/mac/stdlib.h b/tools/build/cross-build/include/mac/stdlib.h index fd9ba7fe6660..314ae0d1dca6 100644 --- a/tools/build/cross-build/include/mac/stdlib.h +++ b/tools/build/cross-build/include/mac/stdlib.h @@ -45,6 +45,4 @@ int rpmatch(const char *response); long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp); -void *reallocarray(void *optr, size_t nmemb, size_t size); - __END_DECLS From nobody Mon Oct 11 12:21:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5288C13420D1; Mon, 11 Oct 2021 12:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSdF61x5xz4bdX; Mon, 11 Oct 2021 12:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2383B20E4B; Mon, 11 Oct 2021 12:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BCLESC060120; Mon, 11 Oct 2021 12:21:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BCLEqw060119; Mon, 11 Oct 2021 12:21:14 GMT (envelope-from git) Date: Mon, 11 Oct 2021 12:21:14 GMT Message-Id: <202110111221.19BCLEqw060119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 9017870541da - main - Add missing const after 6c4f95161d6e List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9017870541daf46358c6cbaa3d4a40e1bffaaaa1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9017870541daf46358c6cbaa3d4a40e1bffaaaa1 commit 9017870541daf46358c6cbaa3d4a40e1bffaaaa1 Author: Alex Richardson AuthorDate: 2021-10-11 12:20:36 +0000 Commit: Alex Richardson CommitDate: 2021-10-11 12:20:56 +0000 Add missing const after 6c4f95161d6e I accidentally didn't include hunk in the committed patch. Fixes: 6c4f95161d6e ("virtio: make the write_config buffer argument const") --- sys/dev/virtio/mmio/virtio_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c index cc89947c4d00..5e17cf59a84a 100644 --- a/sys/dev/virtio/mmio/virtio_mmio.c +++ b/sys/dev/virtio/mmio/virtio_mmio.c @@ -741,7 +741,7 @@ vtmmio_write_dev_config(device_t dev, bus_size_t offset, { struct vtmmio_softc *sc; bus_size_t off; - uint8_t *s; + const uint8_t *s; int size; sc = device_get_softc(dev); From nobody Mon Oct 11 13:22:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CBF8A17E0AD0; Mon, 11 Oct 2021 13:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSfc65J3jz4kJ2; Mon, 11 Oct 2021 13:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C7C21AE6; Mon, 11 Oct 2021 13:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BDMkBp042227; Mon, 11 Oct 2021 13:22:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BDMkTr042226; Mon, 11 Oct 2021 13:22:46 GMT (envelope-from git) Date: Mon, 11 Oct 2021 13:22:46 GMT Message-Id: <202110111322.19BDMkTr042226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: b4a58fbf6404 - main - vfs: remove cn_thread List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4a58fbf640409a1e507d9f7b411c83a3f83a2f3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a58fbf640409a1e507d9f7b411c83a3f83a2f3 commit b4a58fbf640409a1e507d9f7b411c83a3f83a2f3 Author: Mateusz Guzik AuthorDate: 2021-10-01 21:16:54 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-11 13:21:47 +0000 vfs: remove cn_thread It is always curthread. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D32453 --- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 3 +- sys/fs/autofs/autofs_vnops.c | 2 +- sys/fs/devfs/devfs_vnops.c | 2 +- sys/fs/ext2fs/ext2_lookup.c | 8 +-- sys/fs/ext2fs/ext2_vnops.c | 10 ++-- sys/fs/fdescfs/fdesc_vnops.c | 2 +- sys/fs/fuse/fuse_internal.c | 9 ++- sys/fs/fuse/fuse_node.c | 2 +- sys/fs/fuse/fuse_vnops.c | 6 +- sys/fs/msdosfs/msdosfs_lookup.c | 6 +- sys/fs/msdosfs/msdosfs_vnops.c | 2 +- sys/fs/nfsclient/nfs_clvnops.c | 68 +++++++++++----------- sys/fs/nfsserver/nfs_nfsdport.c | 6 -- sys/fs/smbfs/smbfs_vnops.c | 12 ++-- sys/fs/tmpfs/tmpfs_vnops.c | 8 +-- sys/fs/unionfs/union_subr.c | 3 - sys/kern/uipc_mqueue.c | 4 +- sys/kern/vfs_cache.c | 3 +- sys/kern/vfs_lookup.c | 10 ++-- sys/kern/vfs_subr.c | 2 +- sys/kern/vfs_vnops.c | 5 +- sys/sys/namei.h | 2 - sys/ufs/ffs/ffs_softdep.c | 1 - sys/ufs/ufs/ufs_extattr.c | 1 - sys/ufs/ufs/ufs_lookup.c | 18 +++--- sys/ufs/ufs/ufs_vnops.c | 12 ++-- 26 files changed, 94 insertions(+), 113 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 2b45f7ae3b30..c0d68ea0532f 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -1324,7 +1324,6 @@ zfs_lookup_internal(znode_t *dzp, const char *name, vnode_t **vpp, cnp->cn_flags = ISLASTCN | SAVENAME; cnp->cn_lkflags = LK_EXCLUSIVE | LK_RETRY; cnp->cn_cred = kcred; - cnp->cn_thread = curthread; if (zfsvfs->z_use_namecache && !zfsvfs->z_replay) { struct vop_lookup_args a; @@ -4579,7 +4578,7 @@ zfs_freebsd_lookup(struct vop_lookup_args *ap, boolean_t cached) strlcpy(nm, cnp->cn_nameptr, MIN(cnp->cn_namelen + 1, sizeof (nm))); return (zfs_lookup(ap->a_dvp, nm, ap->a_vpp, cnp, cnp->cn_nameiop, - cnp->cn_cred, cnp->cn_thread, 0, cached)); + cnp->cn_cred, curthread, 0, cached)); } static int diff --git a/sys/fs/autofs/autofs_vnops.c b/sys/fs/autofs/autofs_vnops.c index 13daa950d75b..c06d6a24b9b8 100644 --- a/sys/fs/autofs/autofs_vnops.c +++ b/sys/fs/autofs/autofs_vnops.c @@ -250,7 +250,7 @@ autofs_lookup(struct vop_lookup_args *ap) } if (autofs_cached(anp, cnp->cn_nameptr, cnp->cn_namelen) == false && - autofs_ignore_thread(cnp->cn_thread) == false) { + autofs_ignore_thread(curthread) == false) { error = autofs_trigger_vn(dvp, cnp->cn_nameptr, cnp->cn_namelen, &newvp); if (error != 0) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 40b80596523d..9a327c02ee96 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1044,11 +1044,11 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlock) int error, flags, nameiop, dvplocked; char specname[SPECNAMELEN + 1], *pname; + td = curthread; cnp = ap->a_cnp; vpp = ap->a_vpp; dvp = ap->a_dvp; pname = cnp->cn_nameptr; - td = cnp->cn_thread; flags = cnp->cn_flags; nameiop = cnp->cn_nameiop; mp = dvp->v_mount; diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c index 68482e38feb8..3b435bf96a8a 100644 --- a/sys/fs/ext2fs/ext2_lookup.c +++ b/sys/fs/ext2fs/ext2_lookup.c @@ -492,7 +492,7 @@ notfound: * Access for write is interpreted as allowing * creation of files in the directory. */ - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, curthread)) != 0) return (error); /* * Return an indication of where the new directory @@ -571,7 +571,7 @@ found: /* * Write access to directory required to delete files. */ - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, curthread)) != 0) return (error); /* * Return pointer to current entry in dp->i_offset, @@ -623,7 +623,7 @@ found: * regular file, or empty directory. */ if (nameiop == RENAME && (flags & ISLASTCN)) { - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, curthread)) != 0) return (error); /* * Careful about locking second inode. @@ -992,7 +992,7 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp) error = ext2_add_entry(dvp, &newdir); if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC, - cnp->cn_cred, cnp->cn_thread); + cnp->cn_cred, curthread); return (error); } diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index e9e8c07090da..f577241a457e 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -906,7 +906,7 @@ abortit: * to namei, as the parent directory is unlocked by the * call to checkpath(). */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread); + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); VOP_UNLOCK(fvp); if (oldparent != dp->i_number) newparent = dp->i_number; @@ -1031,7 +1031,7 @@ abortit: if (xp->i_nlink > 2) panic("ext2_rename: linked directory"); error = ext2_truncate(tvp, (off_t)0, IO_SYNC, - tcnp->cn_cred, tcnp->cn_thread); + tcnp->cn_cred, curthread); xp->i_nlink = 0; } xp->i_flag |= IN_CHANGE; @@ -1424,7 +1424,7 @@ ext2_mkdir(struct vop_mkdir_args *ap) #ifdef UFS_ACL if (dvp->v_mount->mnt_flag & MNT_ACLS) { error = ext2_do_posix1e_acl_inheritance_dir(dvp, tvp, dmode, - cnp->cn_cred, cnp->cn_thread); + cnp->cn_cred, curthread); if (error) goto bad; } @@ -1504,7 +1504,7 @@ ext2_rmdir(struct vop_rmdir_args *ap) */ ip->i_nlink = 0; error = ext2_truncate(vp, (off_t)0, IO_SYNC, cnp->cn_cred, - cnp->cn_thread); + curthread); cache_purge(ITOV(ip)); if (vn_lock(dvp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { VOP_UNLOCK(vp); @@ -2004,7 +2004,7 @@ ext2_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, #ifdef UFS_ACL if (dvp->v_mount->mnt_flag & MNT_ACLS) { error = ext2_do_posix1e_acl_inheritance_file(dvp, tvp, mode, - cnp->cn_cred, cnp->cn_thread); + cnp->cn_cred, curthread); if (error) goto bad; } diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index c5a7b86f1de5..209e3b3df4f3 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -293,7 +293,7 @@ fdesc_lookup(struct vop_lookup_args *ap) struct vnode *dvp = ap->a_dvp; struct componentname *cnp = ap->a_cnp; char *pname = cnp->cn_nameptr; - struct thread *td = cnp->cn_thread; + struct thread *td = curthread; struct file *fp; struct fdesc_get_ino_args arg; int nlen = cnp->cn_namelen; diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index ffa4a40095b2..cf11daaed68f 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -477,7 +477,6 @@ fuse_internal_invalidate_entry(struct mount *mp, struct uio *uio) cn.cn_nameiop = LOOKUP; cn.cn_flags = 0; /* !MAKEENTRY means free cached entry */ - cn.cn_thread = curthread; cn.cn_cred = curthread->td_ucred; cn.cn_lkflags = LK_SHARED; cn.cn_pnbuf = NULL; @@ -729,7 +728,7 @@ fuse_internal_remove(struct vnode *dvp, int err = 0; fdisp_init(&fdi, cnp->cn_namelen + 1); - fdisp_make_vp(&fdi, op, dvp, cnp->cn_thread, cnp->cn_cred); + fdisp_make_vp(&fdi, op, dvp, curthread, cnp->cn_cred); memcpy(fdi.indata, cnp->cn_nameptr, cnp->cn_namelen); ((char *)fdi.indata)[cnp->cn_namelen] = '\0'; @@ -781,7 +780,7 @@ fuse_internal_rename(struct vnode *fdvp, int err = 0; fdisp_init(&fdi, sizeof(*fri) + fcnp->cn_namelen + tcnp->cn_namelen + 2); - fdisp_make_vp(&fdi, FUSE_RENAME, fdvp, tcnp->cn_thread, tcnp->cn_cred); + fdisp_make_vp(&fdi, FUSE_RENAME, fdvp, curthread, tcnp->cn_cred); fri = fdi.indata; fri->newdir = VTOI(tdvp); @@ -813,7 +812,7 @@ fuse_internal_newentry_makerequest(struct mount *mp, { fdip->iosize = bufsize + cnp->cn_namelen + 1; - fdisp_make(fdip, op, mp, dnid, cnp->cn_thread, cnp->cn_cred); + fdisp_make(fdip, op, mp, dnid, curthread, cnp->cn_cred); memcpy(fdip->indata, buf, bufsize); memcpy((char *)fdip->indata + bufsize, cnp->cn_nameptr, cnp->cn_namelen); ((char *)fdip->indata)[bufsize + cnp->cn_namelen] = '\0'; @@ -840,7 +839,7 @@ fuse_internal_newentry_core(struct vnode *dvp, } err = fuse_vnode_get(mp, feo, feo->nodeid, dvp, vpp, cnp, vtyp); if (err) { - fuse_internal_forget_send(mp, cnp->cn_thread, cnp->cn_cred, + fuse_internal_forget_send(mp, curthread, cnp->cn_cred, feo->nodeid, 1); return err; } diff --git a/sys/fs/fuse/fuse_node.c b/sys/fs/fuse/fuse_node.c index c296a3b3c330..937f80ffc9ce 100644 --- a/sys/fs/fuse/fuse_node.c +++ b/sys/fs/fuse/fuse_node.c @@ -286,7 +286,7 @@ fuse_vnode_get(struct mount *mp, struct componentname *cnp, enum vtype vtyp) { - struct thread *td = (cnp != NULL ? cnp->cn_thread : curthread); + struct thread *td = curthread; /* * feo should only be NULL for the root directory, which (when libfuse * is used) always has generation 0 diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 9aafbad990c5..e1c04f1583ba 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -788,7 +788,7 @@ fuse_vnop_create(struct vop_create_args *ap) struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; struct vattr *vap = ap->a_vap; - struct thread *td = cnp->cn_thread; + struct thread *td = curthread; struct ucred *cred = cnp->cn_cred; struct fuse_data *data; @@ -1203,7 +1203,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; - struct thread *td = cnp->cn_thread; + struct thread *td = curthread; struct ucred *cred = cnp->cn_cred; int nameiop = cnp->cn_nameiop; @@ -1849,7 +1849,7 @@ fuse_vnop_rename(struct vop_rename_args *ap) data = fuse_get_mpdata(vnode_mount(tdvp)); if (data->dataflags & FSESS_DEFAULT_PERMISSIONS && isdir && newparent) { err = fuse_internal_access(fvp, VWRITE, - tcnp->cn_thread, tcnp->cn_cred); + curthread, tcnp->cn_cred); if (err) goto out; } diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 9940800a72c2..d9b52539e602 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -381,7 +381,7 @@ notfound: * Access for write is interpreted as allowing * creation of files in the directory. */ - error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_thread); + error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, curthread); if (error) return (error); /* @@ -485,7 +485,7 @@ foundroot: /* * Write access to directory required to delete files. */ - error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_thread); + error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, curthread); if (error) return (error); @@ -515,7 +515,7 @@ foundroot: if (blkoff == MSDOSFSROOT_OFS) return (EBUSY); - error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_thread); + error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, curthread); if (error) return (error); diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 5f778724786d..44026c270f1c 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1109,7 +1109,7 @@ relock: * to namei, as the parent directory is unlocked by the * call to doscheckpath(). */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread); + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); if (fdip->de_StartCluster != tdip->de_StartCluster) newparent = true; if (doingdirectory && newparent) { diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 3e444780eb24..4a1ab9552a15 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1165,7 +1165,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct nfsmount *nmp; struct nfsnode *np, *newnp; int error = 0, attrflag, dattrflag, ltype, ncticks; - struct thread *td = cnp->cn_thread; + struct thread *td = curthread; struct nfsfh *nfhp; struct nfsvattr dnfsva, nfsva; struct vattr vattr; @@ -1596,17 +1596,17 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) return (error); error = nfsrpc_mknod(dvp, cnp->cn_nameptr, cnp->cn_namelen, vap, - rdev, vap->va_type, cnp->cn_cred, cnp->cn_thread, &dnfsva, + rdev, vap->va_type, cnp->cn_cred, curthread, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL); if (!error) { if (!nfhp) (void) nfsrpc_lookup(dvp, cnp->cn_nameptr, - cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, + cnp->cn_namelen, cnp->cn_cred, curthread, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL, 0); if (nfhp) error = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, - cnp->cn_thread, &np, NULL, LK_EXCLUSIVE); + curthread, &np, NULL, LK_EXCLUSIVE); } if (dattrflag) (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); @@ -1622,7 +1622,7 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, if (!error) { *vpp = newvp; } else if (NFS_ISV4(dvp)) { - error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, + error = nfscl_maperr(curthread, error, vap->va_uid, vap->va_gid); } dnp = VTONFS(dvp); @@ -1712,17 +1712,17 @@ again: cverf = nfs_get_cverf(); error = nfsrpc_create(dvp, cnp->cn_nameptr, cnp->cn_namelen, - vap, cverf, fmode, cnp->cn_cred, cnp->cn_thread, &dnfsva, &nfsva, + vap, cverf, fmode, cnp->cn_cred, curthread, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL); if (!error) { if (nfhp == NULL) (void) nfsrpc_lookup(dvp, cnp->cn_nameptr, - cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, + cnp->cn_namelen, cnp->cn_cred, curthread, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL, 0); if (nfhp != NULL) error = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, - cnp->cn_thread, &np, NULL, LK_EXCLUSIVE); + curthread, &np, NULL, LK_EXCLUSIVE); } if (dattrflag) (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); @@ -1730,7 +1730,7 @@ again: newvp = NFSTOV(np); if (attrflag == 0) error = nfsrpc_getattr(newvp, cnp->cn_cred, - cnp->cn_thread, &nfsva, NULL); + curthread, &nfsva, NULL); if (error == 0) error = nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL, 0, 1); @@ -1748,14 +1748,14 @@ again: } else if (NFS_ISV34(dvp) && (fmode & O_EXCL)) { if (nfscl_checksattr(vap, &nfsva)) { error = nfsrpc_setattr(newvp, vap, NULL, cnp->cn_cred, - cnp->cn_thread, &nfsva, &attrflag, NULL); + curthread, &nfsva, &attrflag, NULL); if (error && (vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL)) { /* try again without setting uid/gid */ vap->va_uid = (uid_t)VNOVAL; vap->va_gid = (uid_t)VNOVAL; error = nfsrpc_setattr(newvp, vap, NULL, - cnp->cn_cred, cnp->cn_thread, &nfsva, + cnp->cn_cred, curthread, &nfsva, &attrflag, NULL); } if (attrflag) @@ -1776,7 +1776,7 @@ again: } *ap->a_vpp = newvp; } else if (NFS_ISV4(dvp)) { - error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, + error = nfscl_maperr(curthread, error, vap->va_uid, vap->va_gid); } NFSLOCKNODE(dnp); @@ -1829,11 +1829,11 @@ nfs_remove(struct vop_remove_args *ap) * throw away biocache buffers, mainly to avoid * unnecessary delayed writes later. */ - error = ncl_vinvalbuf(vp, 0, cnp->cn_thread, 1); + error = ncl_vinvalbuf(vp, 0, curthread, 1); if (error != EINTR && error != EIO) /* Do the rpc */ error = nfs_removerpc(dvp, vp, cnp->cn_nameptr, - cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread); + cnp->cn_namelen, cnp->cn_cred, curthread); /* * Kludge City: If the first reply to the remove rpc is lost.. * the reply to the retransmitted request will be ENOENT @@ -1953,10 +1953,10 @@ nfs_rename(struct vop_rename_args *ap) * that was written back to our cache earlier. Not checking for * this condition can result in potential (silent) data loss. */ - error = VOP_FSYNC(fvp, MNT_WAIT, fcnp->cn_thread); + error = VOP_FSYNC(fvp, MNT_WAIT, curthread); NFSVOPUNLOCK(fvp); if (!error && tvp) - error = VOP_FSYNC(tvp, MNT_WAIT, tcnp->cn_thread); + error = VOP_FSYNC(tvp, MNT_WAIT, curthread); if (error) goto out; @@ -1973,7 +1973,7 @@ nfs_rename(struct vop_rename_args *ap) error = nfs_renamerpc(fdvp, fvp, fcnp->cn_nameptr, fcnp->cn_namelen, tdvp, tvp, tcnp->cn_nameptr, tcnp->cn_namelen, tcnp->cn_cred, - tcnp->cn_thread); + curthread); if (error == 0 && NFS_ISV4(tdvp)) { /* @@ -2050,7 +2050,7 @@ nfs_renameit(struct vnode *sdvp, struct vnode *svp, struct componentname *scnp, return (nfs_renamerpc(sdvp, svp, scnp->cn_nameptr, scnp->cn_namelen, sdvp, NULL, sp->s_name, sp->s_namlen, scnp->cn_cred, - scnp->cn_thread)); + curthread)); } /* @@ -2112,10 +2112,10 @@ nfs_link(struct vop_link_args *ap) * doesn't get "out of sync" with the server. * XXX There should be a better way! */ - VOP_FSYNC(vp, MNT_WAIT, cnp->cn_thread); + VOP_FSYNC(vp, MNT_WAIT, curthread); error = nfsrpc_link(tdvp, vp, cnp->cn_nameptr, cnp->cn_namelen, - cnp->cn_cred, cnp->cn_thread, &dnfsva, &nfsva, &attrflag, + cnp->cn_cred, curthread, &dnfsva, &nfsva, &attrflag, &dattrflag, NULL); tdnp = VTONFS(tdvp); NFSLOCKNODE(tdnp); @@ -2152,7 +2152,7 @@ nfs_link(struct vop_link_args *ap) "the directory as the new link\n"); } if (error && NFS_ISV4(vp)) - error = nfscl_maperr(cnp->cn_thread, error, (uid_t)0, + error = nfscl_maperr(curthread, error, (uid_t)0, (gid_t)0); return (error); } @@ -2174,10 +2174,10 @@ nfs_symlink(struct vop_symlink_args *ap) vap->va_type = VLNK; error = nfsrpc_symlink(dvp, cnp->cn_nameptr, cnp->cn_namelen, - ap->a_target, vap, cnp->cn_cred, cnp->cn_thread, &dnfsva, + ap->a_target, vap, cnp->cn_cred, curthread, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL); if (nfhp) { - ret = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, cnp->cn_thread, + ret = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, curthread, &np, NULL, LK_EXCLUSIVE); if (!ret) newvp = NFSTOV(np); @@ -2195,7 +2195,7 @@ nfs_symlink(struct vop_symlink_args *ap) * have to do a lookup in order to obtain a newvp to return. */ error = nfs_lookitup(dvp, cnp->cn_nameptr, cnp->cn_namelen, - cnp->cn_cred, cnp->cn_thread, &np); + cnp->cn_cred, curthread, &np); if (!error) newvp = NFSTOV(np); } @@ -2203,7 +2203,7 @@ nfs_symlink(struct vop_symlink_args *ap) if (newvp) vput(newvp); if (NFS_ISV4(dvp)) - error = nfscl_maperr(cnp->cn_thread, error, + error = nfscl_maperr(curthread, error, vap->va_uid, vap->va_gid); } else { *ap->a_vpp = newvp; @@ -2258,7 +2258,7 @@ nfs_mkdir(struct vop_mkdir_args *ap) return (error); vap->va_type = VDIR; error = nfsrpc_mkdir(dvp, cnp->cn_nameptr, cnp->cn_namelen, - vap, cnp->cn_cred, cnp->cn_thread, &dnfsva, &nfsva, &nfhp, + vap, cnp->cn_cred, curthread, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL); dnp = VTONFS(dvp); NFSLOCKNODE(dnp); @@ -2272,7 +2272,7 @@ nfs_mkdir(struct vop_mkdir_args *ap) KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } if (nfhp) { - ret = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, cnp->cn_thread, + ret = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, curthread, &np, NULL, LK_EXCLUSIVE); if (!ret) { newvp = NFSTOV(np); @@ -2284,7 +2284,7 @@ nfs_mkdir(struct vop_mkdir_args *ap) } if (!error && newvp == NULL) { error = nfs_lookitup(dvp, cnp->cn_nameptr, cnp->cn_namelen, - cnp->cn_cred, cnp->cn_thread, &np); + cnp->cn_cred, curthread, &np); if (!error) { newvp = NFSTOV(np); if (newvp->v_type != VDIR) @@ -2295,7 +2295,7 @@ nfs_mkdir(struct vop_mkdir_args *ap) if (newvp) vput(newvp); if (NFS_ISV4(dvp)) - error = nfscl_maperr(cnp->cn_thread, error, + error = nfscl_maperr(curthread, error, vap->va_uid, vap->va_gid); } else { /* @@ -2336,7 +2336,7 @@ nfs_rmdir(struct vop_rmdir_args *ap) if (dvp == vp) return (EINVAL); error = nfsrpc_rmdir(dvp, cnp->cn_nameptr, cnp->cn_namelen, - cnp->cn_cred, cnp->cn_thread, &dnfsva, &dattrflag, NULL); + cnp->cn_cred, curthread, &dnfsva, &dattrflag, NULL); dnp = VTONFS(dvp); NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; @@ -2352,7 +2352,7 @@ nfs_rmdir(struct vop_rmdir_args *ap) cache_purge(dvp); cache_purge(vp); if (error && NFS_ISV4(dvp)) - error = nfscl_maperr(cnp->cn_thread, error, (uid_t)0, + error = nfscl_maperr(curthread, error, (uid_t)0, (gid_t)0); /* * Kludge: Map ENOENT => 0 assuming that you have a reply to a retry. @@ -2591,14 +2591,14 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) * The name is now changed to .nfs...4, where ticks is * CPU ticks since boot. */ - pid = cnp->cn_thread->td_proc->p_pid; + pid = curthread->td_proc->p_pid; lticks = (unsigned int)ticks; for ( ; ; ) { sp->s_namlen = sprintf(sp->s_name, ".nfs.%08x.%04x4.4", lticks, pid); if (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred, - cnp->cn_thread, NULL)) + curthread, NULL)) break; lticks++; } @@ -2606,7 +2606,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) if (error) goto bad; error = nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred, - cnp->cn_thread, &np); + curthread, &np); np->n_sillyrename = sp; return (0); bad: diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 0f678cd5640e..5fa6853446ae 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -661,7 +661,6 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp, * because lookup() will dereference ni_startdir. */ - cnp->cn_thread = curthread; ndp->ni_startdir = dp; ndp->ni_rootdir = rootvnode; ndp->ni_topdir = NULL; @@ -2526,7 +2525,6 @@ again: cn.cn_nameiop = LOOKUP; cn.cn_lkflags = LK_SHARED | LK_RETRY; cn.cn_cred = nd->nd_cred; - cn.cn_thread = p; } else if (r == 0) vput(nvp); } @@ -2626,7 +2624,6 @@ again: LK_RETRY; cn.cn_cred = nd->nd_cred; - cn.cn_thread = p; } cn.cn_nameptr = dp->d_name; cn.cn_namelen = nlen; @@ -4183,7 +4180,6 @@ nfsrv_dscreate(struct vnode *dvp, struct vattr *vap, struct vattr *nvap, LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); named.ni_cnd.cn_lkflags = LK_EXCLUSIVE; - named.ni_cnd.cn_thread = p; named.ni_cnd.cn_nameptr = bufp; if (fnamep != NULL) { strlcpy(bufp, fnamep, PNFS_FILENAME_LEN + 1); @@ -4567,7 +4563,6 @@ nfsrv_dsremove(struct vnode *dvp, char *fname, struct ucred *tcred, named.ni_cnd.cn_nameiop = DELETE; named.ni_cnd.cn_lkflags = LK_EXCLUSIVE | LK_RETRY; named.ni_cnd.cn_cred = tcred; - named.ni_cnd.cn_thread = p; named.ni_cnd.cn_flags = ISLASTCN | LOCKPARENT | LOCKLEAF | SAVENAME; nfsvno_setpathbuf(&named, &bufp, &hashp); named.ni_cnd.cn_nameptr = bufp; @@ -6341,7 +6336,6 @@ nfsrv_pnfslookupds(struct vnode *vp, struct vnode *dvp, struct pnfsdsfile *pf, named.ni_cnd.cn_nameiop = LOOKUP; named.ni_cnd.cn_lkflags = LK_SHARED | LK_RETRY; named.ni_cnd.cn_cred = tcred; - named.ni_cnd.cn_thread = p; named.ni_cnd.cn_flags = ISLASTCN | LOCKPARENT | LOCKLEAF | SAVENAME; nfsvno_setpathbuf(&named, &bufp, &hashp); named.ni_cnd.cn_nameptr = bufp; diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index ad04bb93962a..ac32f13977db 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -560,7 +560,7 @@ smbfs_create(ap) if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) return error; scred = smbfs_malloc_scred(); - smb_makescred(scred, cnp->cn_thread, cnp->cn_cred); + smb_makescred(scred, curthread, cnp->cn_cred); error = smbfs_smb_create(dnp, name, nmlen, scred); if (error) @@ -598,7 +598,7 @@ smbfs_remove(ap) if (vp->v_type == VDIR || (np->n_flag & NOPEN) != 0 || vrefcnt(vp) != 1) return EPERM; scred = smbfs_malloc_scred(); - smb_makescred(scred, cnp->cn_thread, cnp->cn_cred); + smb_makescred(scred, curthread, cnp->cn_cred); error = smbfs_smb_delete(np, scred); if (error == 0) np->n_flag |= NGONE; @@ -652,7 +652,7 @@ smbfs_rename(ap) return EINVAL; } scred = smbfs_malloc_scred(); - smb_makescred(scred, tcnp->cn_thread, tcnp->cn_cred); + smb_makescred(scred, curthread, tcnp->cn_cred); /* * It seems that Samba doesn't implement SMB_COM_MOVE call... */ @@ -769,7 +769,7 @@ smbfs_mkdir(ap) if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) return EEXIST; scred = smbfs_malloc_scred(); - smb_makescred(scred, cnp->cn_thread, cnp->cn_cred); + smb_makescred(scred, curthread, cnp->cn_cred); error = smbfs_smb_mkdir(dnp, name, len, scred); if (error) goto out; @@ -809,7 +809,7 @@ smbfs_rmdir(ap) return EINVAL; scred = smbfs_malloc_scred(); - smb_makescred(scred, cnp->cn_thread, cnp->cn_cred); + smb_makescred(scred, curthread, cnp->cn_cred); error = smbfs_smb_rmdir(np, scred); if (error == 0) np->n_flag |= NGONE; @@ -1170,7 +1170,7 @@ smbfs_lookup(ap) } */ *ap; { struct componentname *cnp = ap->a_cnp; - struct thread *td = cnp->cn_thread; + struct thread *td = curthread; struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; struct vnode *vp; diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index d8c74cecdfe4..3b498bf27a79 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -136,7 +136,7 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) cnp->cn_flags & DOWHITEOUT && cnp->cn_flags & ISWHITEOUT))) { error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, - cnp->cn_thread); + curthread); if (error != 0) goto out; @@ -180,7 +180,7 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) { error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, - cnp->cn_thread); + curthread); if (error != 0) goto out; @@ -192,8 +192,8 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) if ((dnode->tn_mode & S_ISTXT) && VOP_ACCESS(dvp, VADMIN, cnp->cn_cred, - cnp->cn_thread) && VOP_ACCESS(*vpp, VADMIN, - cnp->cn_cred, cnp->cn_thread)) { + curthread) && VOP_ACCESS(*vpp, VADMIN, + cnp->cn_cred, curthread)) { error = EPERM; vput(*vpp); *vpp = NULL; diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index dcdb41e55258..eb7681df645b 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -630,7 +630,6 @@ unionfs_relookup(struct vnode *dvp, struct vnode **vpp, cn->cn_nameiop = nameiop; cn->cn_flags = (LOCKPARENT | LOCKLEAF | HASBUF | SAVENAME | ISLASTCN); cn->cn_lkflags = LK_EXCLUSIVE; - cn->cn_thread = td; cn->cn_cred = cnp->cn_cred; cn->cn_nameptr = cn->cn_pnbuf; @@ -975,7 +974,6 @@ unionfs_vn_create_on_upper(struct vnode **vpp, struct vnode *udvp, nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | HASBUF | SAVENAME | ISLASTCN; nd.ni_cnd.cn_lkflags = LK_EXCLUSIVE; - nd.ni_cnd.cn_thread = td; nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameptr = nd.ni_cnd.cn_pnbuf; NDPREINIT(&nd); @@ -1250,7 +1248,6 @@ unionfs_check_rmdir(struct vnode *vp, struct ucred *cred, struct thread *td) cn.cn_flags = LOCKPARENT | LOCKLEAF | SAVENAME | RDONLY | ISLASTCN; cn.cn_lkflags = LK_EXCLUSIVE; - cn.cn_thread = td; cn.cn_cred = cred; /* diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 5c1775a261fc..a9fb40848fbd 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -853,12 +853,12 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap) char *pname; struct thread *td; + td = curthread; cnp = ap->a_cnp; vpp = ap->a_vpp; dvp = ap->a_dvp; pname = cnp->cn_nameptr; namelen = cnp->cn_namelen; - td = cnp->cn_thread; flags = cnp->cn_flags; nameiop = cnp->cn_nameiop; pd = VTON(dvp); @@ -869,7 +869,7 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap) if (dvp->v_type != VDIR) return (ENOTDIR); - error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, cnp->cn_thread); + error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td); if (error) return (error); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 3c79395f5d92..ae26dc70bd05 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4219,7 +4219,7 @@ cache_can_fplookup(struct cache_fpl *fpl) ndp = fpl->ndp; cnp = fpl->cnp; - td = cnp->cn_thread; + td = curthread; if (!atomic_load_char(&cache_fast_lookup_enabled)) { cache_fpl_aborted_early(fpl); @@ -5984,7 +5984,6 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, fpl.ndp = ndp; fpl.cnp = cnp = &ndp->ni_cnd; MPASS(ndp->ni_lcf == 0); - MPASS(curthread == cnp->cn_thread); KASSERT ((cnp->cn_flags & CACHE_FPL_INTERNAL_CN_FLAGS) == 0, ("%s: internal flags found in cn_flags %" PRIx64, __func__, cnp->cn_flags)); diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index e262ebde6ae2..c1cefae543da 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -294,7 +294,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) bool startdir_used; cnp = &ndp->ni_cnd; - td = cnp->cn_thread; + td = curthread; startdir_used = false; *pwdp = NULL; @@ -552,10 +552,8 @@ namei(struct nameidata *ndp) enum cache_fpl_status status; cnp = &ndp->ni_cnd; - td = cnp->cn_thread; + td = curthread; #ifdef INVARIANTS - KASSERT(cnp->cn_thread == curthread, - ("namei not using curthread")); KASSERT((ndp->ni_debugflags & NAMEI_DBG_CALLED) == 0, ("%s: repeated call to namei without NDREINIT", __func__)); KASSERT(ndp->ni_debugflags == NAMEI_DBG_INITED, @@ -581,7 +579,7 @@ namei(struct nameidata *ndp) */ cnp->cn_origflags = cnp->cn_flags; #endif - ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; + ndp->ni_cnd.cn_cred = td->td_ucred; KASSERT(ndp->ni_resflags == 0, ("%s: garbage in ni_resflags: %x\n", __func__, ndp->ni_resflags)); KASSERT(cnp->cn_cred && td->td_proc, ("namei: bad cred/proc")); @@ -1096,7 +1094,7 @@ dirloop: */ unionlookup: #ifdef MAC - error = mac_vnode_check_lookup(cnp->cn_thread->td_ucred, dp, cnp); + error = mac_vnode_check_lookup(cnp->cn_cred, dp, cnp); if (error) goto bad; #endif diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 33a556fbfa2b..69ac73bd3954 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6821,7 +6821,7 @@ vn_dir_check_exec(struct vnode *vp, struct componentname *cnp) return (0); } - return (VOP_ACCESS(vp, VEXEC, cnp->cn_cred, cnp->cn_thread)); + return (VOP_ACCESS(vp, VEXEC, cnp->cn_cred, curthread)); } /* diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index aeeeee3e3a1d..2c25a25da6c6 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -190,7 +190,7 @@ static int vn_io_fault1(struct vnode *vp, struct uio *uio, int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp) { - struct thread *td = ndp->ni_cnd.cn_thread; + struct thread *td = curthread; return (vn_open_cred(ndp, flagp, cmode, 0, td->td_ucred, fp)); } @@ -230,7 +230,6 @@ vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, { struct vnode *vp; struct mount *mp; - struct thread *td = ndp->ni_cnd.cn_thread; struct vattr vat; struct vattr *vap = &vat; int fmode, error; @@ -332,7 +331,7 @@ restart: return (error); vp = ndp->ni_vp; } - error = vn_open_vnode(vp, fmode, cred, td, fp); + error = vn_open_vnode(vp, fmode, cred, curthread, fp); if (first_open) { VI_LOCK(vp); vp->v_iflag &= ~VI_FOPENING; diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 3f6e59289f0a..a467c6e1ebf3 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -49,7 +49,6 @@ struct componentname { */ u_int64_t cn_origflags; /* flags to namei */ u_int64_t cn_flags; /* flags to namei */ - struct thread *cn_thread;/* thread requesting lookup */ struct ucred *cn_cred; /* credentials */ enum nameiop cn_nameiop; /* namei operation */ int cn_lkflags; /* Lock flags LK_EXCLUSIVE or LK_SHARED */ @@ -262,7 +261,6 @@ do { \ _ndp->ni_startdir = startdir; \ _ndp->ni_resflags = 0; \ filecaps_init(&_ndp->ni_filecaps); \ - _ndp->ni_cnd.cn_thread = td; \ _ndp->ni_rightsneeded = _rightsp; \ } while (0) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 6f1de407135e..ff55a918ade5 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2975,7 +2975,6 @@ softdep_journal_lookup(mp, vpp) bzero(&cnp, sizeof(cnp)); cnp.cn_nameiop = LOOKUP; cnp.cn_flags = ISLASTCN; - cnp.cn_thread = curthread; cnp.cn_cred = curthread->td_ucred; cnp.cn_pnbuf = SUJ_FILE; cnp.cn_nameptr = SUJ_FILE; diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index 140406d538dc..e9f0fb3ea762 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -263,7 +263,6 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname, if (lockparent == UE_GETDIR_LOCKPARENT) cnp.cn_flags |= LOCKPARENT; cnp.cn_lkflags = LK_EXCLUSIVE; - cnp.cn_thread = td; cnp.cn_cred = td->td_ucred; cnp.cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK); cnp.cn_nameptr = cnp.cn_pnbuf; diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index fc78c017e2c6..3d24ad23f6e2 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -230,7 +230,7 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, * in VFS_VGET but we could end up creating objects * that are never used. */ - vnode_create_vobject(vdp, DIP(dp, i_size), cnp->cn_thread); + vnode_create_vobject(vdp, DIP(dp, i_size), curthread); bmask = VFSTOUFS(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; @@ -486,9 +486,9 @@ notfound: * XXX: Fix the comment above. */ if (flags & WILLBEDIR) - error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, cnp->cn_thread); + error = VOP_ACCESSX(vdp, VWRITE | VAPPEND, cred, curthread); else - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); + error = VOP_ACCESS(vdp, VWRITE, cred, curthread); if (error) return (error); /* @@ -601,7 +601,7 @@ found: if ((error = VFS_VGET(vdp->v_mount, ino, *** 92 LINES SKIPPED *** From nobody Mon Oct 11 13:22:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6E34E17E08FB; Mon, 11 Oct 2021 13:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSfc81vDwz4kSc; Mon, 11 Oct 2021 13:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD63921D17; Mon, 11 Oct 2021 13:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BDMl1Q042256; Mon, 11 Oct 2021 13:22:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BDMlX1042254; Mon, 11 Oct 2021 13:22:47 GMT (envelope-from git) Date: Mon, 11 Oct 2021 13:22:47 GMT Message-Id: <202110111322.19BDMlX1042254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 2b68eb8e1dbb - main - vfs: remove thread argument from VOP_STAT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3 commit 2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3 Author: Mateusz Guzik AuthorDate: 2021-10-01 22:25:39 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-11 13:22:32 +0000 vfs: remove thread argument from VOP_STAT and fo_stat. --- share/man/man9/VOP_ATTRIB.9 | 6 ++---- sys/compat/linux/linux_event.c | 3 +-- sys/compat/linuxkpi/common/src/linux_compat.c | 5 ++--- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c | 2 +- sys/fs/devfs/devfs_vnops.c | 4 ++-- sys/kern/kern_descrip.c | 5 ++--- sys/kern/kern_event.c | 3 +-- sys/kern/sys_eventfd.c | 3 +-- sys/kern/sys_pipe.c | 5 ++--- sys/kern/sys_procdesc.c | 3 +-- sys/kern/sys_socket.c | 3 +-- sys/kern/tty_pts.c | 3 +-- sys/kern/uipc_mqueue.c | 3 +-- sys/kern/uipc_sem.c | 3 +-- sys/kern/uipc_shm.c | 3 +-- sys/kern/vfs_syscalls.c | 6 +++--- sys/kern/vfs_vnops.c | 5 ++--- sys/kern/vnode_if.src | 1 - sys/sys/file.h | 7 +++---- sys/sys/param.h | 2 +- sys/sys/vnode.h | 2 +- 21 files changed, 30 insertions(+), 47 deletions(-) diff --git a/share/man/man9/VOP_ATTRIB.9 b/share/man/man9/VOP_ATTRIB.9 index 45f1e2f1652a..ddfee1f5d1f9 100644 --- a/share/man/man9/VOP_ATTRIB.9 +++ b/share/man/man9/VOP_ATTRIB.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 8, 2020 +.Dd October 2, 2021 .Dt VOP_ATTRIB 9 .Os .Sh NAME @@ -44,7 +44,7 @@ .Fn VOP_SETATTR "struct vnode *vp" "struct vattr *vap" "struct ucred *cred" .Ft int .Fn VOP_STAT "struct vnode *vp" "struct stat *sb" "struct ucred *active_cred" \ -"struct ucred *file_cred" "struct thread *td" +"struct ucred *file_cred" .Sh DESCRIPTION These entry points manipulate various attributes of a file or directory, including file permissions, owner, group, size, @@ -83,8 +83,6 @@ The attributes of the file. The user credentials of the calling thread. .It Fa file_cred The credentials installed on the file description pointing to the vnode or NOCRED. -.It Fa td -The calling thread. .El .Pp Attributes which are not being modified by diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 331732eb4234..2539b406618f 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -801,8 +801,7 @@ timerfd_ioctl(struct file *fp, u_long cmd, void *data, } static int -timerfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, - struct thread *td) +timerfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred) { return (ENXIO); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 279f7131fc57..7a062ca36eba 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1698,8 +1698,7 @@ out: } static int -linux_file_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +linux_file_stat(struct file *fp, struct stat *sb, struct ucred *active_cred) { struct linux_file *filp; struct vnode *vp; @@ -1712,7 +1711,7 @@ linux_file_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, vp = filp->f_vnode; vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_STAT(vp, sb, td->td_ucred, NOCRED, td); + error = VOP_STAT(vp, sb, curthread->td_ucred, NOCRED); VOP_UNLOCK(vp); return (error); diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c index a3d67aaa11ba..6ff0ffaf1c43 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c @@ -207,7 +207,7 @@ zfs_file_getattr(zfs_file_t *fp, zfs_file_attr_t *zfattr) td = curthread; - rc = fo_stat(fp, &sb, td->td_ucred, td); + rc = fo_stat(fp, &sb, td->td_ucred); if (rc) return (SET_ERROR(rc)); zfattr->zfa_size = sb.st_size; diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 9a327c02ee96..964d288324b4 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1838,10 +1838,10 @@ devfs_setlabel(struct vop_setlabel_args *ap) #endif static int -devfs_stat_f(struct file *fp, struct stat *sb, struct ucred *cred, struct thread *td) +devfs_stat_f(struct file *fp, struct stat *sb, struct ucred *cred) { - return (vnops.fo_stat(fp, sb, cred, td)); + return (vnops.fo_stat(fp, sb, cred)); } static int diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index b10dcc2f9469..55c2a36955a5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1527,7 +1527,7 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp) AUDIT_ARG_FILE(td->td_proc, fp); - error = fo_stat(fp, sbp, td->td_ucred, td); + error = fo_stat(fp, sbp, td->td_ucred); fdrop(fp, td); #ifdef __STAT_TIME_T_EXT sbp->st_atim_ext = 0; @@ -4871,8 +4871,7 @@ badfo_kqfilter(struct file *fp, struct knote *kn) } static int -badfo_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +badfo_stat(struct file *fp, struct stat *sb, struct ucred *active_cred) { return (EBADF); diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index c9b50912a22d..ade71a848868 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -2187,8 +2187,7 @@ kqueue_poll(struct file *fp, int events, struct ucred *active_cred, /*ARGSUSED*/ static int -kqueue_stat(struct file *fp, struct stat *st, struct ucred *active_cred, - struct thread *td) +kqueue_stat(struct file *fp, struct stat *st, struct ucred *active_cred) { bzero((void *)st, sizeof *st); diff --git a/sys/kern/sys_eventfd.c b/sys/kern/sys_eventfd.c index 91c045e85faf..8ee8421296e5 100644 --- a/sys/kern/sys_eventfd.c +++ b/sys/kern/sys_eventfd.c @@ -325,8 +325,7 @@ eventfd_ioctl(struct file *fp, u_long cmd, void *data, } static int -eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, - struct thread *td) +eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred) { bzero((void *)st, sizeof *st); st->st_mode = S_IFIFO; diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index ee6ccbbad322..7bd7fea28e76 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1515,8 +1515,7 @@ locked_error: * be a natural race. */ static int -pipe_stat(struct file *fp, struct stat *ub, struct ucred *active_cred, - struct thread *td) +pipe_stat(struct file *fp, struct stat *ub, struct ucred *active_cred) { struct pipe *pipe; #ifdef MAC @@ -1537,7 +1536,7 @@ pipe_stat(struct file *fp, struct stat *ub, struct ucred *active_cred, /* For named pipes ask the underlying filesystem. */ if (pipe->pipe_type & PIPE_TYPE_NAMED) { - return (vnops.fo_stat(fp, ub, active_cred, td)); + return (vnops.fo_stat(fp, ub, active_cred)); } bzero(ub, sizeof(*ub)); diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c index 95a389c582b0..ff1a1502aa71 100644 --- a/sys/kern/sys_procdesc.c +++ b/sys/kern/sys_procdesc.c @@ -508,8 +508,7 @@ procdesc_kqfilter(struct file *fp, struct knote *kn) } static int -procdesc_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +procdesc_stat(struct file *fp, struct stat *sb, struct ucred *active_cred) { struct procdesc *pd; struct timeval pstart, boottime; diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 8cf703ab8ebd..d4200e5618d2 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -301,8 +301,7 @@ soo_poll(struct file *fp, int events, struct ucred *active_cred, } static int -soo_stat(struct file *fp, struct stat *ub, struct ucred *active_cred, - struct thread *td) +soo_stat(struct file *fp, struct stat *ub, struct ucred *active_cred) { struct socket *so = fp->f_data; int error; diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index dbbf35cf1a12..a912634393f6 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -535,8 +535,7 @@ ptsdev_kqfilter(struct file *fp, struct knote *kn) } static int -ptsdev_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +ptsdev_stat(struct file *fp, struct stat *sb, struct ucred *active_cred) { struct tty *tp = fp->f_data; #ifdef PTS_EXTERNAL diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index a9fb40848fbd..24ed1be6bf65 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -2537,8 +2537,7 @@ mqf_close(struct file *fp, struct thread *td) } static int -mqf_stat(struct file *fp, struct stat *st, struct ucred *active_cred, - struct thread *td) +mqf_stat(struct file *fp, struct stat *st, struct ucred *active_cred) { struct mqfs_node *pn = fp->f_data; diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index db1d84696df0..e7c7a04f5c54 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -161,8 +161,7 @@ static struct fileops ksem_ops = { FEATURE(posix_sem, "POSIX semaphores"); static int -ksem_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +ksem_stat(struct file *fp, struct stat *sb, struct ucred *active_cred) { struct ksem *ks; #ifdef MAC diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 63c4250f640f..14d808bfc166 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -538,8 +538,7 @@ shm_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, } static int -shm_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +shm_stat(struct file *fp, struct stat *sb, struct ucred *active_cred) { struct shmfd *shmfd; #ifdef MAC diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 82a8125ece95..29a6b34d083a 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1924,7 +1924,7 @@ restart: if (vp->v_type == VDIR && oldinum == 0) { error = EPERM; /* POSIX */ } else if (oldinum != 0 && - ((error = VOP_STAT(vp, &sb, td->td_ucred, NOCRED, td)) == 0) && + ((error = VOP_STAT(vp, &sb, td->td_ucred, NOCRED)) == 0) && sb.st_ino != oldinum) { error = EIDRM; /* Identifier removed */ } else if (fp != NULL && fp->f_vnode != vp) { @@ -2444,7 +2444,7 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, error = kern_fstat(td, fd, sbp); return (error); } - error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED, td); + error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED); if (error == 0) { if (__predict_false(hook != NULL)) hook(nd.ni_vp, sbp); @@ -4663,7 +4663,7 @@ kern_fhstat(struct thread *td, struct fhandle fh, struct stat *sb) vfs_unbusy(mp); if (error != 0) return (error); - error = VOP_STAT(vp, sb, td->td_ucred, NOCRED, td); + error = VOP_STAT(vp, sb, td->td_ucred, NOCRED); vput(vp); return (error); } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 2c25a25da6c6..d6c472995489 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1670,14 +1670,13 @@ vn_truncate_locked(struct vnode *vp, off_t length, bool sync, * File table vnode stat routine. */ int -vn_statfile(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +vn_statfile(struct file *fp, struct stat *sb, struct ucred *active_cred) { struct vnode *vp = fp->f_vnode; int error; vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_STAT(vp, sb, active_cred, fp->f_cred, td); + error = VOP_STAT(vp, sb, active_cred, fp->f_cred); VOP_UNLOCK(vp); return (error); diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index ff57d1c9a28e..d10758019b87 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -193,7 +193,6 @@ vop_stat { OUT struct stat *sb; IN struct ucred *active_cred; IN struct ucred *file_cred; - IN struct thread *td; }; diff --git a/sys/sys/file.h b/sys/sys/file.h index 8a790a25fc6b..5a6f0b1d2071 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -108,7 +108,7 @@ typedef int fo_poll_t(struct file *fp, int events, struct ucred *active_cred, struct thread *td); typedef int fo_kqfilter_t(struct file *fp, struct knote *kn); typedef int fo_stat_t(struct file *fp, struct stat *sb, - struct ucred *active_cred, struct thread *td); + struct ucred *active_cred); typedef int fo_close_t(struct file *fp, struct thread *td); typedef int fo_chmod_t(struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td); @@ -369,11 +369,10 @@ fo_poll(struct file *fp, int events, struct ucred *active_cred, } static __inline int -fo_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) +fo_stat(struct file *fp, struct stat *sb, struct ucred *active_cred) { - return ((*fp->f_ops->fo_stat)(fp, sb, active_cred, td)); + return ((*fp->f_ops->fo_stat)(fp, sb, active_cred)); } static __inline int diff --git a/sys/sys/param.h b/sys/sys/param.h index 9a016e35323e..50d861a61985 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400036 +#define __FreeBSD_version 1400037 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 81f3f3d5489c..a9b57dd4c25d 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -962,7 +962,7 @@ void vop_rename_fail(struct vop_rename_args *ap); #define vop_stat_helper_post(ap, error) ({ \ int _error = (error); \ - if (priv_check_cred_vfs_generation(ap->a_td->td_ucred)) \ + if (priv_check_cred_vfs_generation(ap->a_active_cred)) \ ap->a_sb->st_gen = 0; \ _error; \ }) From nobody Mon Oct 11 16:10:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C941417FE4C1; Mon, 11 Oct 2021 16:10:18 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSkKQ4xX8z3jCN; Mon, 11 Oct 2021 16:10:18 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ua1-x934.google.com with SMTP id f4so8017233uad.4; Mon, 11 Oct 2021 09:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JJ+dGtY8+JF9ArSBJuEmYDIEpEkma8qXmEp/28NMBqg=; b=nYSoesI2dKQeNR9oFKnomcL5rKu/goEijVcyfJG83q1P9HF7tKUUWFD0JKNO+OGKAF PDI3mCNWYQ9C9BFwbU8XRCGkKCbkeY9CUIbkU69IyZTE4rWLJm87UfkD3A4hQbwQt9G6 jOPFzcr7CAc6R2xsFfXvE1ohiwFfirH3/dbywMpyA2uA7dGrgdKwSEr5700tky4KJGf+ NQ7pBROYBOBkvlH9QaHShGOJjc918gGu1w3idxoVENw18TKYvEPlPWta4XdlBpn0ZU2x 8KwXqKt5xkD22S5pxWkWdMj91400lRztZPGRJC5YlIw0zCd8LLNM31h0f6qIG4Ss69JV rIww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JJ+dGtY8+JF9ArSBJuEmYDIEpEkma8qXmEp/28NMBqg=; b=3scBd4ojHq+GMO70kZXN9Qx+Q95eoPCByk2l6gC1PtVTQsRWMf36pb4qFmRojTQejj be3LvF89ieoAQhVGVdIuEXevPvSba478NBwwuxHCCr0qzqU5A5R1oBRA3z7XvaDub39h igvL8CDkEcNewHa+WC0qtZUVfF1Hlce0+1QYnp4yx84c3u0NlB5x46VR4qe6mKl79fi3 IGT0g14kPDdQBknVepwgMP3pPuTfuSKb1DdMRf6bZT/+qXJKCpczNCXit09Vjy7X8R8t wrhHLlZw0JVm02iuYykyY0652vx3yV11LeNXBlbIcR9M/cEd/Loe3RIkD5mJSGgXbf6/ v0Hw== X-Gm-Message-State: AOAM530LsqwWlYL4PYen3G92z8VCPfRvPmPrgsVRpmsC/5lH54LelmUq 88G9l2ayyVSv2CGDec4xlGkC3d0chJ+M6Fs7LsybreHg0WE= X-Google-Smtp-Source: ABdhPJwD4tqN9tUYJBFkNtz5mmABNoJ7mhOsut54ImRbbjdDBryS8l4ZZaHrUWNXwBPVIFzIiSHkhxunQ/vcmbz7bw0= X-Received: by 2002:a67:d907:: with SMTP id t7mr24293519vsj.58.1633968618006; Mon, 11 Oct 2021 09:10:18 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110111322.19BDMlX1042254@gitrepo.freebsd.org> In-Reply-To: <202110111322.19BDMlX1042254@gitrepo.freebsd.org> From: Benjamin Kaduk Date: Mon, 11 Oct 2021 09:10:07 -0700 Message-ID: Subject: Re: git: 2b68eb8e1dbb - main - vfs: remove thread argument from VOP_STAT To: Mateusz Guzik Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000000cea2f05ce15f781" X-Rspamd-Queue-Id: 4HSkKQ4xX8z3jCN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N --0000000000000cea2f05ce15f781 Content-Type: text/plain; charset="UTF-8" On Mon, Oct 11, 2021 at 6:22 AM Mateusz Guzik wrote: > The branch main has been updated by mjg: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3 > > commit 2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3 > Author: Mateusz Guzik > AuthorDate: 2021-10-01 22:25:39 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-10-11 13:22:32 +0000 > > vfs: remove thread argument from VOP_STAT > > > Any plans for __FreeBSD_version bump? -Ben --0000000000000cea2f05ce15f781-- From nobody Mon Oct 11 17:04:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BC0B818143EE; Mon, 11 Oct 2021 17:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSlXL4tP4z4VBl; Mon, 11 Oct 2021 17:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8439624BE4; Mon, 11 Oct 2021 17:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BH4o7L036624; Mon, 11 Oct 2021 17:04:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BH4ogt036623; Mon, 11 Oct 2021 17:04:50 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:04:50 GMT Message-Id: <202110111704.19BH4ogt036623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 4f556830dec1 - main - nanosleep.2: use appropriate macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f556830dec19ec8821b2ff939ab181192ea4dfc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=4f556830dec19ec8821b2ff939ab181192ea4dfc commit 4f556830dec19ec8821b2ff939ab181192ea4dfc Author: Piotr Pawel Stefaniak AuthorDate: 2021-10-09 16:00:01 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-10-11 16:57:58 +0000 nanosleep.2: use appropriate macros Reported by: kib Fixes: bf8f6ffcb66a --- lib/libc/sys/nanosleep.2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/nanosleep.2 b/lib/libc/sys/nanosleep.2 index 12758a974f7f..eb75c4b1043b 100644 --- a/lib/libc/sys/nanosleep.2 +++ b/lib/libc/sys/nanosleep.2 @@ -94,7 +94,10 @@ returns immediately and the calling thread is not suspended. The suspension time may be longer than requested due to the scheduling of other activity by the system. It is also subject to the allowed time interval deviation -specified by the sysctl kern.timecounter.alloweddeviation. +specified by the +.Va kern.timecounter.alloweddeviation +.Xr sysctl 8 +variable. An unmasked signal will terminate the sleep early, regardless of the .Dv SA_RESTART value on the interrupting signal. From nobody Mon Oct 11 17:04:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 69343181455E; Mon, 11 Oct 2021 17:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSlXM5SkFz4VBp; Mon, 11 Oct 2021 17:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9623524C22; Mon, 11 Oct 2021 17:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BH4pfU036651; Mon, 11 Oct 2021 17:04:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BH4p75036649; Mon, 11 Oct 2021 17:04:51 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:04:51 GMT Message-Id: <202110111704.19BH4p75036649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 902cde5d0a62 - main - Revert "last(1): unbreak for 8-bit locales" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 902cde5d0a620a502468a95f7eecf1098e96bdcc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=902cde5d0a620a502468a95f7eecf1098e96bdcc commit 902cde5d0a620a502468a95f7eecf1098e96bdcc Author: Piotr Pawel Stefaniak AuthorDate: 2021-10-10 06:37:36 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-10-11 17:01:57 +0000 Revert "last(1): unbreak for 8-bit locales" This reverts commits 8e67c427b5 (unbreak for 8-bit locales), 0ca58ca151 (correction after r351413), and f424ec1b80 (fix style after r351459). A simpler fix can be done by using the h modifier for strings that are encoded with the current locale. Reviewed by: eugen, philip Differential Revision: https://reviews.freebsd.org/D32437 --- usr.bin/last/last.c | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index d197afe7eb0b..188f393ae3fc 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -92,7 +92,6 @@ static const char *crmsg; /* cause of last reboot */ static time_t currentout; /* current logout value */ static long maxrec; /* records to display */ static const char *file = NULL; /* utx.log file */ -static int noctfix = 0; /* locale is C or UTF-8 */ static int sflag = 0; /* show delta in seconds */ static int width = 5; /* show seconds in delta */ static int yflag; /* show year */ @@ -104,7 +103,6 @@ static time_t snaptime; /* if != 0, we will only */ static void addarg(int, char *); -static const char *ctf(const char *); static time_t dateconv(char *); static void doentry(struct utmpx *); static void hostconv(char *); @@ -114,31 +112,6 @@ static int want(struct utmpx *); static void usage(void); static void wtmp(void); -static const char* -ctf(const char *fmt) { - static char buf[31]; - const char *src, *end; - char *dst; - - if (noctfix) - return (fmt); - - end = buf + sizeof(buf); - for (src = fmt, dst = buf; dst < end; *dst++ = *src++) { - if (*src == '\0') { - *dst = '\0'; - break; - } else if (*src == '%' && *(src+1) == 's') { - *dst++ = '%'; - *dst++ = 'h'; - *dst++ = 's'; - strlcpy(dst, src+2, end - dst); - return (buf); - } - } - return (buf); -} - static void usage(void) { @@ -157,11 +130,6 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); - (void) setlocale(LC_CTYPE, ""); - p = nl_langinfo(CODESET); - if (strcmp(p, "UTF-8") == 0 || strcmp(p, "US-ASCII") == 0) - noctfix = 1; - argc = xo_parse_args(argc, argv); if (argc < 0) exit(1); @@ -294,7 +262,7 @@ wtmp(void) (void) strftime(ct, sizeof(ct), "%+", tm); xo_emit("\n{:utxdb/%s}", (file == NULL) ? "utx.log" : file); xo_attr("seconds", "%lu", (unsigned long) t); - xo_emit(ctf(" begins {:begins/%s}\n"), ct); + xo_emit(" begins {:begins/%s}\n", ct); xo_close_container("last-information"); } @@ -411,7 +379,7 @@ printentry(struct utmpx *bp, struct idtab *tt) break; } xo_attr("seconds", "%lu", (unsigned long)t); - xo_emit(ctf(" {:login-time/%s%c/%s}"), ct, tt == NULL ? '\n' : ' '); + xo_emit(" {:login-time/%s%c/%s}", ct, tt == NULL ? '\n' : ' '); if (tt == NULL) goto end; if (!tt->logout) { @@ -425,7 +393,7 @@ printentry(struct utmpx *bp, struct idtab *tt) tm = localtime(&tt->logout); (void) strftime(ct, sizeof(ct), "%R", tm); xo_attr("seconds", "%lu", (unsigned long)tt->logout); - xo_emit(ctf("- {:logout-time/%s}"), ct); + xo_emit("- {:logout-time/%s}", ct); } delta = tt->logout - bp->ut_tv.tv_sec; xo_attr("seconds", "%ld", (long)delta); @@ -435,9 +403,9 @@ printentry(struct utmpx *bp, struct idtab *tt) tm = gmtime(&delta); (void) strftime(ct, sizeof(ct), width >= 8 ? "%T" : "%R", tm); if (delta < 86400) - xo_emit(ctf(" ({:session-length/%s})\n"), ct); + xo_emit(" ({:session-length/%s})\n", ct); else - xo_emit(ctf(" ({:session-length/%ld+%s})\n"), + xo_emit(" ({:session-length/%ld+%s})\n", (long)delta / 86400, ct); } From nobody Mon Oct 11 17:04:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8CD7C18145CF; Mon, 11 Oct 2021 17:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSlXP1Tsrz4VKR; Mon, 11 Oct 2021 17:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4D6C24C23; Mon, 11 Oct 2021 17:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BH4qtr036679; Mon, 11 Oct 2021 17:04:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BH4q5D036678; Mon, 11 Oct 2021 17:04:52 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:04:52 GMT Message-Id: <202110111704.19BH4q5D036678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 8da27052535b - main - last: improve non-UTF8 locale output after libxo support was added List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8da27052535b816096dd28debe5bbbad3dcf4ea4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=8da27052535b816096dd28debe5bbbad3dcf4ea4 commit 8da27052535b816096dd28debe5bbbad3dcf4ea4 Author: Piotr Pawel Stefaniak AuthorDate: 2021-10-10 07:16:59 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-10-11 17:02:12 +0000 last: improve non-UTF8 locale output after libxo support was added Some strftime(3) conversion specifications will generate strings encoded with the current locale, not necessarily UTF8. As per xo_format.5, use the h string modifier so that libxo interprets it appropriately. Reviewed by: eugen, philip Differential Revision: https://reviews.freebsd.org/D32437 --- usr.bin/last/last.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 188f393ae3fc..4b6ac33b8df4 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -262,7 +262,7 @@ wtmp(void) (void) strftime(ct, sizeof(ct), "%+", tm); xo_emit("\n{:utxdb/%s}", (file == NULL) ? "utx.log" : file); xo_attr("seconds", "%lu", (unsigned long) t); - xo_emit(" begins {:begins/%s}\n", ct); + xo_emit(" begins {:begins/%hs}\n", ct); xo_close_container("last-information"); } @@ -379,7 +379,7 @@ printentry(struct utmpx *bp, struct idtab *tt) break; } xo_attr("seconds", "%lu", (unsigned long)t); - xo_emit(" {:login-time/%s%c/%s}", ct, tt == NULL ? '\n' : ' '); + xo_emit(" {:login-time/%hs%c/%s}", ct, tt == NULL ? '\n' : ' '); if (tt == NULL) goto end; if (!tt->logout) { From nobody Mon Oct 11 17:10:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 793BA17E01AE; Mon, 11 Oct 2021 17:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSlfk1KJLz4Z8p; Mon, 11 Oct 2021 17:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD63B24A56; Mon, 11 Oct 2021 17:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BHALhC045382; Mon, 11 Oct 2021 17:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BHALMP045380; Mon, 11 Oct 2021 17:10:21 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:10:21 GMT Message-Id: <202110111710.19BHALMP045380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 98dae405de7f - main - O_PATH: allow vfs_extattr syscalls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98dae405de7f8b3506dd94dcd3e9f51d3fb15962 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=98dae405de7f8b3506dd94dcd3e9f51d3fb15962 commit 98dae405de7f8b3506dd94dcd3e9f51d3fb15962 Author: Greg V AuthorDate: 2021-10-10 12:45:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-11 17:09:49 +0000 O_PATH: allow vfs_extattr syscalls These calls do operate on vnodes only, not file contents. This is useful for e.g. the xdg-document-portal fuse filesystem. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32438 --- lib/libc/sys/extattr_get_file.2 | 7 ++++++- sys/kern/vfs_extattr.c | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/extattr_get_file.2 b/lib/libc/sys/extattr_get_file.2 index 5134c8d8ac0f..c38b27e17423 100644 --- a/lib/libc/sys/extattr_get_file.2 +++ b/lib/libc/sys/extattr_get_file.2 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2020 +.Dd October 11, 2021 .Dt EXTATTR 2 .Os .Sh NAME @@ -149,6 +149,11 @@ functions take a file descriptor, while the functions take a path. Both arguments describe a file associated with the extended attribute that should be manipulated. +The +.Qq Li _fd +functions can be used with file descriptors opened with the +.Dv O_PATH +flag. .Pp The following arguments are common to all the system calls described here: .Bl -tag -width attrnamespace diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index adb882288f6c..43b000c78110 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -242,7 +242,7 @@ sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap) return (error); AUDIT_ARG_TEXT(attrname); - error = getvnode(td, uap->fd, + error = getvnode_path(td, uap->fd, cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); if (error) return (error); @@ -409,7 +409,7 @@ sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap) return (error); AUDIT_ARG_TEXT(attrname); - error = getvnode(td, uap->fd, + error = getvnode_path(td, uap->fd, cap_rights_init_one(&rights, CAP_EXTATTR_GET), &fp); if (error) return (error); @@ -544,7 +544,7 @@ sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap) return (error); AUDIT_ARG_TEXT(attrname); - error = getvnode(td, uap->fd, + error = getvnode_path(td, uap->fd, cap_rights_init_one(&rights, CAP_EXTATTR_DELETE), &fp); if (error) return (error); @@ -690,7 +690,7 @@ sys_extattr_list_fd(struct thread *td, struct extattr_list_fd_args *uap) AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = getvnode(td, uap->fd, + error = getvnode_path(td, uap->fd, cap_rights_init_one(&rights, CAP_EXTATTR_LIST), &fp); if (error) return (error); From nobody Mon Oct 11 17:24:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 338C517E7AFC; Mon, 11 Oct 2021 17:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSlym0prDz4fdh; Mon, 11 Oct 2021 17:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F057924F2F; Mon, 11 Oct 2021 17:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BHOFDA063433; Mon, 11 Oct 2021 17:24:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BHOFFE063432; Mon, 11 Oct 2021 17:24:15 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:24:15 GMT Message-Id: <202110111724.19BHOFFE063432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e8f26e5dc859 - main - bootstrap: No need to disable shared libraries for bootstrap tools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8f26e5dc859a8fbc663e108421f657325ca3054 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e8f26e5dc859a8fbc663e108421f657325ca3054 commit e8f26e5dc859a8fbc663e108421f657325ca3054 Author: Warner Losh AuthorDate: 2021-10-11 17:13:39 +0000 Commit: Warner Losh CommitDate: 2021-10-11 17:20:07 +0000 bootstrap: No need to disable shared libraries for bootstrap tools There's no need to disable shared libraries when building the bootstrap tools. This was added on 2000 (commit ad879ce9552c) when the perl bootstrap was added (libperl and miniperl) and saved a fair amount of time (perl took a long time to build on 2000-era hardware). For many years now, however, we rarely build any libraries when bootstrapping. Even when we do, the optimization saves at most a few seconds when upgrading since the libraries built have been small. Shared libraries are more robust accross versions that static libraries due to creaping dependencies (we aren't crossing versions of share libraries, though, just using what's on the host). In addition, linux and macos have been building like this for some time because static binaries on those systems are difficult to impossible. Sponsored by: Netflix Reviewed by: arichardson, bapt Differential Revision: https://reviews.freebsd.org/D32443 --- Makefile.inc1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 9b81d4029608..fb640eefdb82 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -720,7 +720,6 @@ BSARGS= DESTDIR= \ -DNO_CPU_CFLAGS \ -DNO_LINT \ -DNO_PIC \ - -DNO_SHARED \ MK_ASAN=no \ MK_CTF=no \ MK_CLANG_EXTRAS=no \ From nobody Mon Oct 11 17:24:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6F1CE17E7E2D; Mon, 11 Oct 2021 17:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSlyn2KjTz4fmV; Mon, 11 Oct 2021 17:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29D8224B51; Mon, 11 Oct 2021 17:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BHOHuV063457; Mon, 11 Oct 2021 17:24:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BHOHkF063456; Mon, 11 Oct 2021 17:24:17 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:24:17 GMT Message-Id: <202110111724.19BHOHkF063456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 56ee5c551f89 - main - sysctl: make sys/sysctl.h self contained List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 56ee5c551f89e767e931c55e063a20abd0c55346 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=56ee5c551f89e767e931c55e063a20abd0c55346 commit 56ee5c551f89e767e931c55e063a20abd0c55346 Author: Warner Losh AuthorDate: 2021-10-11 17:14:51 +0000 Commit: Warner Losh CommitDate: 2021-10-11 17:20:07 +0000 sysctl: make sys/sysctl.h self contained sys/sysctl.h only needs u_int and size_t from sys/types.h. When the sysctl interface was designed, having one more more prerequisites (especially sys/types.h) was the norm. Times have changed, and to make things more portable, make sys/types.h optional. We do this by including sys/_types.h, defining size_t if needed, and changing u_int to 'unsigned int' in a prototype for userland builds. For kernel builds, sys/types.h is still required. Sponsored by: Netflix Reviewed by: kib, jhb Differential Revision: https://reviews.freebsd.org/D31827 --- sys/sys/sysctl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 9e9bd723f4bd..8178c7208f9b 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1180,9 +1180,14 @@ struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int, struct sysctl_req *); #else /* !_KERNEL */ #include +#include +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif __BEGIN_DECLS -int sysctl(const int *, u_int, void *, size_t *, const void *, size_t); +int sysctl(const int *, unsigned int, void *, size_t *, const void *, size_t); int sysctlbyname(const char *, void *, size_t *, const void *, size_t); int sysctlnametomib(const char *, int *, size_t *); __END_DECLS From nobody Mon Oct 11 17:24:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D49E017E7C3B; Mon, 11 Oct 2021 17:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSlyp3F5Cz4fmf; Mon, 11 Oct 2021 17:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E42724C7D; Mon, 11 Oct 2021 17:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BHOIok063489; Mon, 11 Oct 2021 17:24:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BHOIRh063488; Mon, 11 Oct 2021 17:24:18 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:24:18 GMT Message-Id: <202110111724.19BHOIRh063488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 99eefc727eba - main - sysctl.h: Less namespace pollution List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99eefc727eba667892bb9216410f3588345fe25f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=99eefc727eba667892bb9216410f3588345fe25f commit 99eefc727eba667892bb9216410f3588345fe25f Author: Warner Losh AuthorDate: 2021-10-11 17:15:08 +0000 Commit: Warner Losh CommitDate: 2021-10-11 17:20:07 +0000 sysctl.h: Less namespace pollution Remove unused struct ctlname. It is unused. Move struct thread to inside #if _KERNEL. Sponsored by: Netflix Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D32457 --- sys/sys/sysctl.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 8178c7208f9b..71a34652ff44 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -42,7 +42,6 @@ #include #endif -struct thread; /* * Definitions for sysctl call. The sysctl call uses a hierarchical name * for objects that can be examined or modified. The name is expressed as @@ -50,22 +49,16 @@ struct thread; * component depends on its place in the hierarchy. The top-level and kern * identifiers are defined here, and other identifiers are defined in the * respective subsystem header files. + * + * Each subsystem defined by sysctl defines a list of variables for that + * subsystem. Each name is either a node with further levels defined below it, + * or it is a leaf of some particular type given below. Each sysctl level + * defines a set of name/type pairs to be used by sysctl(8) in manipulating the + * subsystem. */ #define CTL_MAXNAME 24 /* largest number of components supported */ -/* - * Each subsystem defined by sysctl defines a list of variables - * for that subsystem. Each name is either a node with further - * levels defined below it, or it is a leaf of some particular - * type given below. Each sysctl level defines a set of name/type - * pairs to be used by sysctl(8) in manipulating the subsystem. - */ -struct ctlname { - char *ctl_name; /* subsystem name */ - int ctl_type; /* type of name */ -}; - #define CTLTYPE 0xf /* mask for the type */ #define CTLTYPE_NODE 1 /* name is a node */ #define CTLTYPE_INT 2 /* name describes an integer */ @@ -164,6 +157,7 @@ struct ctlname { * This describes the access space for a sysctl request. This is needed * so that we can use the interface from the kernel or from user-space. */ +struct thread; struct sysctl_req { struct thread *td; /* used for access checking */ int lock; /* wiring state */ From nobody Mon Oct 11 17:26:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C959F17F0DCF; Mon, 11 Oct 2021 17:26:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSm1l5BKcz4h5h; Mon, 11 Oct 2021 17:26:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x22e.google.com with SMTP id z126so11306831oiz.12; Mon, 11 Oct 2021 10:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WAY6MeUma+OjpfKTNkooyHCKgiHyEaef7j70SnHSPHw=; b=L9nMOWQOe6AfHEQET2Mkts/B4u4lDSLFuI61M/7CApLTSuUXHNQFf4mwa00zS81hKa N6KQefJ22qbvGHaYrr05chjFQ3Ei2LYnouK+nkbal8msR83TG2MC5bSNxMdL8oSDgZ5c eJ3FHBq4N9cbY9ko8GjKiU+xxzHC7nVKOEk3LnPFjg+X9BWrWXQSdCetdb+3uHubbmFr dE3Q7Uz3i+DL9XpKq9qCjhZU1dijNlQJzcnQCQXt/9FRZ9Q6vVPbyruQ6H9Q0KDZMSnr 66QQT6UW+KN9ZTlDLBfMjVJSY2VA4gnOIIbhS2Ny86mAzUoLZ0xzzPxfZTagjnAOhu4A jV7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WAY6MeUma+OjpfKTNkooyHCKgiHyEaef7j70SnHSPHw=; b=hTPSgSMHKlxFHndiqO7eF+Mh5t7mtBLNcIXkI9u7EbKWSp9dAztnkv1gzeC7WgkeRJ 6kxTykFZfg+T0naLQBW04wsoji2vXMpZf373p4x48GY/jAkYXzNrRWT3i5jYQGR9kWQA NPUk04TzKiok6i3tFH6vKYMPP1iCBpt1iBFYh22hSY/4VObubEP3Mhipc36uHNi2QY/1 RoHbNGYd0fLCeFAM/3Odd4auUT3B+Bwk30JBt3fMKSxhqxeQsJ7tkscu8+yo5U/VYVU8 FWWikK63Ej4iwVdq2V4kqbUmK68U6Mc03EYtomPaV+q81JMFOuOevb8qW4WHeEBAs6hW rexQ== X-Gm-Message-State: AOAM532cqCBjFlRVxaAYYJfbHJuGPsQD0OgtGdM77Eo8SChH9ttlDkJO uHPGJlnw7Y2Dcgt8QBjP7hrcHMxBFVfwS27HkwxQUXxm X-Google-Smtp-Source: ABdhPJzXEPy+AyZp8OztSDVC9oDxapKXsls79d+SeWEAVFpZDELI95QHsRfUqqr8UOHQEJNf1V0o++DxEPmNldaIGkU= X-Received: by 2002:aca:ac82:: with SMTP id v124mr214123oie.0.1633973204802; Mon, 11 Oct 2021 10:26:44 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:126d:0:b0:3b4:5824:6a18 with HTTP; Mon, 11 Oct 2021 10:26:44 -0700 (PDT) In-Reply-To: References: <202110111322.19BDMlX1042254@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 11 Oct 2021 19:26:44 +0200 Message-ID: Subject: Re: git: 2b68eb8e1dbb - main - vfs: remove thread argument from VOP_STAT To: Benjamin Kaduk Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HSm1l5BKcz4h5h X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N The commit contains a bump to 1400037 On 10/11/21, Benjamin Kaduk wrote: > On Mon, Oct 11, 2021 at 6:22 AM Mateusz Guzik wrote: > >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3 >> >> commit 2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3 >> Author: Mateusz Guzik >> AuthorDate: 2021-10-01 22:25:39 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2021-10-11 13:22:32 +0000 >> >> vfs: remove thread argument from VOP_STAT >> >> >> > > Any plans for __FreeBSD_version bump? > > -Ben > -- Mateusz Guzik From nobody Mon Oct 11 17:54:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 31D0217FE6A3; Mon, 11 Oct 2021 17:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSmdY0wHSz4slG; Mon, 11 Oct 2021 17:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFBA02559A; Mon, 11 Oct 2021 17:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BHsOIC003351; Mon, 11 Oct 2021 17:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BHsOls003350; Mon, 11 Oct 2021 17:54:24 GMT (envelope-from git) Date: Mon, 11 Oct 2021 17:54:24 GMT Message-Id: <202110111754.19BHsOls003350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c05b382edb17 - main - Revert "bootstrap: No need to disable shared libraries for bootstrap tools" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c05b382edb173d199ddef86976d594fbbb7bbf24 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c05b382edb173d199ddef86976d594fbbb7bbf24 commit c05b382edb173d199ddef86976d594fbbb7bbf24 Author: Warner Losh AuthorDate: 2021-10-11 17:49:48 +0000 Commit: Warner Losh CommitDate: 2021-10-11 17:49:48 +0000 Revert "bootstrap: No need to disable shared libraries for bootstrap tools" This reverts commit e8f26e5dc859a8fbc663e108421f657325ca3054. Although the change worked locally, it's breaking something in the CI build for the riscv64 build (which makes no sense it would only break that since we're building host tools to bootstrap at that point). Sponsored by: Netflix --- Makefile.inc1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index fb640eefdb82..9b81d4029608 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -720,6 +720,7 @@ BSARGS= DESTDIR= \ -DNO_CPU_CFLAGS \ -DNO_LINT \ -DNO_PIC \ + -DNO_SHARED \ MK_ASAN=no \ MK_CTF=no \ MK_CLANG_EXTRAS=no \ From nobody Mon Oct 11 18:01:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0446E180169F; Mon, 11 Oct 2021 18:01:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSmnT6SV9z4vkN; Mon, 11 Oct 2021 18:01:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x82e.google.com with SMTP id b12so9127363qtq.3; Mon, 11 Oct 2021 11:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=GZrfd6LECEc549IRwphhuOVM5MoTiMUqBCy86+5AsvM=; b=QSW3qzM2jP9kArNFU83cNF9SpyAqaW7YYjihRUeR2zQ1Xg25OHeqsax82N+djYRTXT Qb77BO2dC+5mZTy7x8kQNGYz9OZmwYSdnLnRvKc+nQ3DSAcDzJy0vq07aS3d4f0NL7BW xQNFuiBGL896eWjopAsPby6SwKbsqtxXk53Oe4ZyJPCrTA1D2fEOi1O1oAM22J5NFcGA tTzawapel95ku9AmgF5ApnS/8fqBJE5oV1mjOFIfZUoHgoFsdkCtQ2TzXZ1hzTG9oGih TSCmk0Q0i1zb4cDT4mShOHfzeDkjl0FQ1KCxo/Hs70nYVEQMZctjxomMrhb/Wd4wghA2 wwOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=GZrfd6LECEc549IRwphhuOVM5MoTiMUqBCy86+5AsvM=; b=fX4w5EY6wlE8CsUnMw/h2c5biJq20COA3Kykpl7OWKXX6LHS831tUwddW6QxUHl0lM OrrCI6Zabxoo8h4j6nR3aFQF6YDL0HdoLRp4siMtJSTK3n6LCUeC8S4i92FgIjigoaVi m0m9lBvbgSRJ4LatXhIvB/Jyas/r43/kWwDkgSkZlhVL3CSzv+4UD8PevqWoEtPadgJC peSD9fi4rxjMMKMBJASNpiwVAsljdQEtNTYH3sW7N++kEQe9YB6qgnNjjBd040/wJybn 56GmkCnmgtKka7ICLbP4RqQhx//8w88txx1kdF6b+pZdjEtsTux0QXxDfrQM9PlS8DRO zw6w== X-Gm-Message-State: AOAM533tEImWOJrQk+afqWT3TkIwH/4lTmgTOIXCXlZkE9BoVUBer0nP JBAJXzj2Uqbdl8nVtEDTvI9Q/euMrxE= X-Google-Smtp-Source: ABdhPJx/OC6LEMPAERERRXI55DNB3p89Sr2MW0t3vw8V0GdTIkZA/HxIC4gSfEsp6MG8vKfZ1VG7sQ== X-Received: by 2002:ac8:5c44:: with SMTP id j4mr16022755qtj.164.1633975277264; Mon, 11 Oct 2021 11:01:17 -0700 (PDT) Received: from nuc ([142.126.186.191]) by smtp.gmail.com with ESMTPSA id l20sm5177545qtk.19.2021.10.11.11.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 11:01:16 -0700 (PDT) Sender: Mark Johnston Date: Mon, 11 Oct 2021 14:01:11 -0400 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c05b382edb17 - main - Revert "bootstrap: No need to disable shared libraries for bootstrap tools" Message-ID: References: <202110111754.19BHsOls003350@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110111754.19BHsOls003350@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HSmnT6SV9z4vkN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Oct 11, 2021 at 05:54:24PM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c05b382edb173d199ddef86976d594fbbb7bbf24 > > commit c05b382edb173d199ddef86976d594fbbb7bbf24 > Author: Warner Losh > AuthorDate: 2021-10-11 17:49:48 +0000 > Commit: Warner Losh > CommitDate: 2021-10-11 17:49:48 +0000 > > Revert "bootstrap: No need to disable shared libraries for bootstrap tools" > > This reverts commit e8f26e5dc859a8fbc663e108421f657325ca3054. > > Although the change worked locally, it's breaking something in the CI > build for the riscv64 build (which makes no sense it would only break > that since we're building host tools to bootstrap at that point). This also seems to have broken syzbot's FreeBSD CI builds, which run "make kernel-toolchain -DNO_CLEAN" before building a kernel: https://syzkaller.appspot.com/text?tag=CrashLog&x=10b4cb98b00000 I wasn't sure if the reverted commit might be tripped up by -DNO_CLEAN, so I was about to submit a syzkaller change to automatically try a clean build after a failing -DNO_CLEAN build. The build host is also quite old, running some stable/12 revision from a couple of years ago. > Sponsored by: Netflix > --- > Makefile.inc1 | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/Makefile.inc1 b/Makefile.inc1 > index fb640eefdb82..9b81d4029608 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -720,6 +720,7 @@ BSARGS= DESTDIR= \ > -DNO_CPU_CFLAGS \ > -DNO_LINT \ > -DNO_PIC \ > + -DNO_SHARED \ > MK_ASAN=no \ > MK_CTF=no \ > MK_CLANG_EXTRAS=no \ From nobody Mon Oct 11 18:12:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C531118077FC; Mon, 11 Oct 2021 18:12:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSn2R2pYKz3H2b; Mon, 11 Oct 2021 18:12:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19BICT0K030743 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 11 Oct 2021 11:12:29 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19BICTV2030742; Mon, 11 Oct 2021 11:12:29 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 11 Oct 2021 11:12:29 -0700 From: Gleb Smirnoff To: Mark Johnston Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c05b382edb17 - main - Revert "bootstrap: No need to disable shared libraries for bootstrap tools" Message-ID: References: <202110111754.19BHsOls003350@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4HSn2R2pYKz3H2b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Oct 11, 2021 at 02:01:11PM -0400, Mark Johnston wrote: M> > commit c05b382edb173d199ddef86976d594fbbb7bbf24 M> > Author: Warner Losh M> > AuthorDate: 2021-10-11 17:49:48 +0000 M> > Commit: Warner Losh M> > CommitDate: 2021-10-11 17:49:48 +0000 M> > M> > Revert "bootstrap: No need to disable shared libraries for bootstrap tools" M> > M> > This reverts commit e8f26e5dc859a8fbc663e108421f657325ca3054. M> > M> > Although the change worked locally, it's breaking something in the CI M> > build for the riscv64 build (which makes no sense it would only break M> > that since we're building host tools to bootstrap at that point). M> M> This also seems to have broken syzbot's FreeBSD CI builds, which run M> "make kernel-toolchain -DNO_CLEAN" before building a kernel: M> https://syzkaller.appspot.com/text?tag=CrashLog&x=10b4cb98b00000 I have exactly same failure on absolutely clean amd64 build. Thanks for reverting, I wonder how did it work locally. -- Gleb Smirnoff From nobody Mon Oct 11 18:34:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 64A3F17F211E for ; Mon, 11 Oct 2021 18:34:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSnWd28G6z3PGw for ; Mon, 11 Oct 2021 18:34:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x936.google.com with SMTP id q13so14552848uaq.2 for ; Mon, 11 Oct 2021 11:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OpMIs0Qdz73qFyz1GPNvE23HA86lzMy3R/nW42PdgNs=; b=4MUaiL9IGlzx7STc8JAw0YzVVrmP/lmR1HIKjisKcXVoZOrYLXBt7pRDLAqHlYK0VE mCc9CMmldGaIErHIkRM290n4009wqw42m8J7GZy9XsHzrICPnvtyzIkGTSlEKmFK+IeX 22aK2+jmmpip46NVT9wS+yOGM5WRgf5iZyga5RTw3DUGH6kr/7ZRxdfZ/DuurcRT2Qv8 5ldr3HOWadzjynfB8X7SYMyypyUIZ6KyMA8XKEi6jVpHCCpLzZv6AC0OE8lKpxBRiFYw 7fdnJLNcBHlUjhBmKxQZV30dWkkKgUICCcau6wojcJyMEHhkz8rSZQ1Wxu5c3c0g14Qe XXsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OpMIs0Qdz73qFyz1GPNvE23HA86lzMy3R/nW42PdgNs=; b=lahWRU8Ewb9APBlusWYtbJY448xlRv+8DYS9+5Lb2fHH7gaDSjUY1C5/vYqT6llKx+ R8uR9hAJhwXPZI7PUTfKRwtdBD672LyaojgqoE6yIMtyX9Z6HaHbcYnLpZf+GBz7PuaC YgSCisQBzGXtJO8G2SNxCk4k782MsFTrZUijTOS17uNosv+bvGpIwMtjSXVEwH9/+e4c Y0b5qjEMSZpxtbE1BBtKr40JoRT3mbUsf57KVkFG/7vXX9tdhRghKSnsin0PwG1yR+GL deUZjIqvUjUIGa+rkn2XDsX6mxQStN5xA2BO91TpZcg97iSw0NJjp1F/f+hEaJ1ixu/C TIgA== X-Gm-Message-State: AOAM533ks90tK6GtuA0+NAkJzgvI9Jiw3okqwmneJGmSZoDpeSh7S41X XOnuqAFtIJNwOY+GkxLRTwJuNnhiJVXkmaIlTzUEvg== X-Google-Smtp-Source: ABdhPJyrdTrRyP9JCKPs9Qw/rYapDc9vD7Wti5xedjqGBIRV1oz+DhzAKU0IKGZpg+qpyiIo2P/8iFTTuaSck+cce7o= X-Received: by 2002:a05:6102:6ce:: with SMTP id m14mr25121982vsg.42.1633977255485; Mon, 11 Oct 2021 11:34:15 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110111754.19BHsOls003350@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 11 Oct 2021 12:34:04 -0600 Message-ID: Subject: Re: git: c05b382edb17 - main - Revert "bootstrap: No need to disable shared libraries for bootstrap tools" To: Gleb Smirnoff Cc: Mark Johnston , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000e27a5105ce17f9e0" X-Rspamd-Queue-Id: 4HSnWd28G6z3PGw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000e27a5105ce17f9e0 Content-Type: text/plain; charset="UTF-8" On Mon, Oct 11, 2021 at 12:12 PM Gleb Smirnoff wrote: > On Mon, Oct 11, 2021 at 02:01:11PM -0400, Mark Johnston wrote: > M> > commit c05b382edb173d199ddef86976d594fbbb7bbf24 > M> > Author: Warner Losh > M> > AuthorDate: 2021-10-11 17:49:48 +0000 > M> > Commit: Warner Losh > M> > CommitDate: 2021-10-11 17:49:48 +0000 > M> > > M> > Revert "bootstrap: No need to disable shared libraries for > bootstrap tools" > M> > > M> > This reverts commit e8f26e5dc859a8fbc663e108421f657325ca3054. > M> > > M> > Although the change worked locally, it's breaking something in > the CI > M> > build for the riscv64 build (which makes no sense it would only > break > M> > that since we're building host tools to bootstrap at that point). > M> > M> This also seems to have broken syzbot's FreeBSD CI builds, which run > M> "make kernel-toolchain -DNO_CLEAN" before building a kernel: > M> https://syzkaller.appspot.com/text?tag=CrashLog&x=10b4cb98b00000 > > I have exactly same failure on absolutely clean amd64 build. Thanks for > reverting, > I wonder how did it work locally. > I did a clean build. Warner --000000000000e27a5105ce17f9e0-- From nobody Mon Oct 11 19:02:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C8D0C17FF322; Mon, 11 Oct 2021 19:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSp7h5LXdz3q8L; Mon, 11 Oct 2021 19:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 978592668C; Mon, 11 Oct 2021 19:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BJ28Am097166; Mon, 11 Oct 2021 19:02:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BJ28Tb097165; Mon, 11 Oct 2021 19:02:08 GMT (envelope-from git) Date: Mon, 11 Oct 2021 19:02:08 GMT Message-Id: <202110111902.19BJ28Tb097165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: cdccd11b366d - main - forward declare struct thread List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cdccd11b366d3c64331176c4ffe591969c86b0e3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cdccd11b366d3c64331176c4ffe591969c86b0e3 commit cdccd11b366d3c64331176c4ffe591969c86b0e3 Author: Warner Losh AuthorDate: 2021-10-11 18:59:39 +0000 Commit: Warner Losh CommitDate: 2021-10-11 18:59:39 +0000 forward declare struct thread sys/sysctl.h moved struct thread forward declaration under #ifdef _KERNEL and so this header fails when included from userland. Add a forward declaration here. Fixes: 99eefc727eba Sponsored by: Netflix --- sys/vm/swap_pager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 20b9bc95b1b2..395fbc9957c4 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -44,6 +44,7 @@ struct buf; struct swdevt; +struct thread; typedef void sw_strategy_t(struct buf *, struct swdevt *); typedef void sw_close_t(struct thread *, struct swdevt *); From nobody Mon Oct 11 20:37:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 497071810791; Mon, 11 Oct 2021 20:37:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSrFd1NbMz4qqV; Mon, 11 Oct 2021 20:37:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 627822C58; Mon, 11 Oct 2021 20:37:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110101934.19AJYuIJ019276@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: e81e77c5a055 - main - Enable PPS_SYNC on amd64, arm64 and armv7 Message-ID: Date: Mon, 11 Oct 2021 13:37:21 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: <202110101934.19AJYuIJ019276@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 10/10/21 12:34 PM, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f > > commit e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f > Author: Konstantin Belousov > AuthorDate: 2021-10-10 12:20:45 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-10-10 19:34:40 +0000 > > Enable PPS_SYNC on amd64, arm64 and armv7 > > Remove the option from NOTES/LINT, and add to NOTES for powerpc and > riscv. > > PR: 259036 > Requested by: John Hay > Discussed with: ian, imp > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Hmm, if the option is MI, why move it out of the MI NOTES? We don't generally remove items from NOTES just because they are enabled by default in GENERIC. That would break the functionality of NOTES where it documents options (and sometimes provides more detail than the 1-liner comments we use in GENERIC). In this case I would have left NOTES as-is and instead added PPS_SYNC to the relevant GENERIC files with a one-line comment leaving the more detailed comment in NOTES. -- John Baldwin From nobody Mon Oct 11 20:46:59 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DD2E718154E0; Mon, 11 Oct 2021 20:47:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSrSx3mZXz4tY7; Mon, 11 Oct 2021 20:47:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 19BKl089062379 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 11 Oct 2021 23:47:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 19BKl089062379 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 19BKkxhU062376; Mon, 11 Oct 2021 23:46:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 11 Oct 2021 23:46:59 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e81e77c5a055 - main - Enable PPS_SYNC on amd64, arm64 and armv7 Message-ID: References: <202110101934.19AJYuIJ019276@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HSrSx3mZXz4tY7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Oct 11, 2021 at 01:37:21PM -0700, John Baldwin wrote: > On 10/10/21 12:34 PM, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f > > > > commit e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f > > Author: Konstantin Belousov > > AuthorDate: 2021-10-10 12:20:45 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2021-10-10 19:34:40 +0000 > > > > Enable PPS_SYNC on amd64, arm64 and armv7 > > Remove the option from NOTES/LINT, and add to NOTES for powerpc and > > riscv. > > PR: 259036 > > Requested by: John Hay > > Discussed with: ian, imp > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Hmm, if the option is MI, why move it out of the MI NOTES? We don't > generally remove items from NOTES just because they are enabled by default > in GENERIC. That would break the functionality of NOTES where it documents > options (and sometimes provides more detail than the 1-liner comments we > use in GENERIC). > > In this case I would have left NOTES as-is and instead added PPS_SYNC to > the relevant GENERIC files with a one-line comment leaving the more > detailed comment in NOTES. To have both PPS_SYNC and !PPS_SYNC covered during tinderbox. If an option is present in both NOTES and GENERIC, there is a chance that its absence is not compiled. Bruce' opinion was that LINT should be mostly complementary to GENERIC. From nobody Mon Oct 11 21:09:58 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EBED917F5364; Mon, 11 Oct 2021 21:09:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSrzC69KVz3G7y; Mon, 11 Oct 2021 21:09:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3F2733482; Mon, 11 Oct 2021 21:09:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110101934.19AJYuIJ019276@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: e81e77c5a055 - main - Enable PPS_SYNC on amd64, arm64 and armv7 Message-ID: <9f4710f1-4639-92ec-2040-51ea0bf9290c@FreeBSD.org> Date: Mon, 11 Oct 2021 14:09:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 10/11/21 1:46 PM, Konstantin Belousov wrote: > On Mon, Oct 11, 2021 at 01:37:21PM -0700, John Baldwin wrote: >> On 10/10/21 12:34 PM, Konstantin Belousov wrote: >>> The branch main has been updated by kib: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f >>> >>> commit e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f >>> Author: Konstantin Belousov >>> AuthorDate: 2021-10-10 12:20:45 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2021-10-10 19:34:40 +0000 >>> >>> Enable PPS_SYNC on amd64, arm64 and armv7 >>> Remove the option from NOTES/LINT, and add to NOTES for powerpc and >>> riscv. >>> PR: 259036 >>> Requested by: John Hay >>> Discussed with: ian, imp >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 1 week >> >> Hmm, if the option is MI, why move it out of the MI NOTES? We don't >> generally remove items from NOTES just because they are enabled by default >> in GENERIC. That would break the functionality of NOTES where it documents >> options (and sometimes provides more detail than the 1-liner comments we >> use in GENERIC). >> >> In this case I would have left NOTES as-is and instead added PPS_SYNC to >> the relevant GENERIC files with a one-line comment leaving the more >> detailed comment in NOTES. > > To have both PPS_SYNC and !PPS_SYNC covered during tinderbox. > If an option is present in both NOTES and GENERIC, there is a chance > that its absence is not compiled.> > Bruce' opinion was that LINT should be mostly complementary to GENERIC. That doesn't match what we actually do. For example, INET and INET6 are in both, SMP, SOFTUPDATES, etc. I think you can go through amd64 GENERIC and every option in it is in NOTES except now for PPS_SYNC. I ran this before your commit: % awk '/^(device|options)/ { print $2 }' GENERIC | sort > one % awk '/^(device|options)/ { print $2 }' ../../conf/NOTES ../../x86/conf/NOTES NOTES | sort > two Items only in GENERIC (I would say most of these are probably bugs in the form of missing entries in NOTES, ULE is 4BSD in NOTES instead, and VERBOSE_SYSINIT has the default value of 1 in NOTES): % > comm -23 one two AH_AR5416_INTERRUPT_MITIGATION ATH_ENABLE_11N BUF_TRACKING DDB_CTF FIB_ALGO FULL_BUF_TRACKING IOMMU KDTRACE_FRAME PRINTF_BUFR_SIZE=128 RACCT_DEFAULT_TO_DISABLED SCHED_ULE VERBOSE_SYSINIT=0 ath_pci ocs_fc pvscsi tws vge The number of options duplicated in both NOTES and GENERIC: % comm -12 one two | wc -l 259 -- John Baldwin From nobody Mon Oct 11 21:43:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B84B41802711; Mon, 11 Oct 2021 21:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSsjh4ZQ1z3PvB; Mon, 11 Oct 2021 21:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D33046F; Mon, 11 Oct 2021 21:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19BLhK5I010857; Mon, 11 Oct 2021 21:43:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19BLhK1x010856; Mon, 11 Oct 2021 21:43:20 GMT (envelope-from git) Date: Mon, 11 Oct 2021 21:43:20 GMT Message-Id: <202110112143.19BLhK1x010856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 2d827c065a1c - main - Skip sys.net.if_lagg_test.status_stress in CI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d827c065a1c6ed12d48fc71ab41443e2de0936f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=2d827c065a1c6ed12d48fc71ab41443e2de0936f commit 2d827c065a1c6ed12d48fc71ab41443e2de0936f Author: Li-Wen Hsu AuthorDate: 2021-10-11 21:40:24 +0000 Commit: Li-Wen Hsu CommitDate: 2021-10-11 21:40:24 +0000 Skip sys.net.if_lagg_test.status_stress in CI This case panics the machine fairly often and we should run stress tests separately. Sponsored by: The FreeBSD Foundation --- tests/sys/net/if_lagg_test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/net/if_lagg_test.sh b/tests/sys/net/if_lagg_test.sh index 1c9cc5551ae3..cf1dcd4359ca 100755 --- a/tests/sys/net/if_lagg_test.sh +++ b/tests/sys/net/if_lagg_test.sh @@ -84,6 +84,10 @@ status_stress_body() { local TAP0 TAP1 LAGG MAC + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "Skipping this test because it panics the machine fairly often" + fi + # Configure the lagg interface to use an RFC5737 nonrouteable addresses ADDR="192.0.2.2" MASK="24" From nobody Mon Oct 11 22:05:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ACDC1180C6BD; Mon, 11 Oct 2021 22:05:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HStCZ2yrYz3mLb; Mon, 11 Oct 2021 22:05:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 19BM5bL2082269 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 12 Oct 2021 01:05:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 19BM5bL2082269 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 19BM5b7o082268; Tue, 12 Oct 2021 01:05:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 Oct 2021 01:05:37 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e81e77c5a055 - main - Enable PPS_SYNC on amd64, arm64 and armv7 Message-ID: References: <202110101934.19AJYuIJ019276@gitrepo.freebsd.org> <9f4710f1-4639-92ec-2040-51ea0bf9290c@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f4710f1-4639-92ec-2040-51ea0bf9290c@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HStCZ2yrYz3mLb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Oct 11, 2021 at 02:09:58PM -0700, John Baldwin wrote: > On 10/11/21 1:46 PM, Konstantin Belousov wrote: > > On Mon, Oct 11, 2021 at 01:37:21PM -0700, John Baldwin wrote: > > > On 10/10/21 12:34 PM, Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f > > > > > > > > commit e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f > > > > Author: Konstantin Belousov > > > > AuthorDate: 2021-10-10 12:20:45 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2021-10-10 19:34:40 +0000 > > > > > > > > Enable PPS_SYNC on amd64, arm64 and armv7 > > > > Remove the option from NOTES/LINT, and add to NOTES for powerpc and > > > > riscv. > > > > PR: 259036 > > > > Requested by: John Hay > > > > Discussed with: ian, imp > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > > > Hmm, if the option is MI, why move it out of the MI NOTES? We don't > > > generally remove items from NOTES just because they are enabled by default > > > in GENERIC. That would break the functionality of NOTES where it documents > > > options (and sometimes provides more detail than the 1-liner comments we > > > use in GENERIC). > > > > > > In this case I would have left NOTES as-is and instead added PPS_SYNC to > > > the relevant GENERIC files with a one-line comment leaving the more > > > detailed comment in NOTES. > > > > To have both PPS_SYNC and !PPS_SYNC covered during tinderbox. > > If an option is present in both NOTES and GENERIC, there is a chance > > that its absence is not compiled.> Bruce' opinion was that LINT should > > be mostly complementary to GENERIC. > > That doesn't match what we actually do. For example, INET and INET6 are in > both, SMP, SOFTUPDATES, etc. I think you can go through amd64 GENERIC and > every option in it is in NOTES except now for PPS_SYNC. > > I ran this before your commit: > > % awk '/^(device|options)/ { print $2 }' GENERIC | sort > one > % awk '/^(device|options)/ { print $2 }' ../../conf/NOTES ../../x86/conf/NOTES NOTES | sort > two > > Items only in GENERIC (I would say most of these are probably bugs in the form of > missing entries in NOTES, ULE is 4BSD in NOTES instead, and VERBOSE_SYSINIT > has the default value of 1 in NOTES): > > % > comm -23 one two > AH_AR5416_INTERRUPT_MITIGATION > ATH_ENABLE_11N > BUF_TRACKING > DDB_CTF > FIB_ALGO > FULL_BUF_TRACKING > IOMMU > KDTRACE_FRAME > PRINTF_BUFR_SIZE=128 > RACCT_DEFAULT_TO_DISABLED > SCHED_ULE > VERBOSE_SYSINIT=0 > ath_pci > ocs_fc > pvscsi > tws > vge > > The number of options duplicated in both NOTES and GENERIC: > > % comm -12 one two | wc -l > 259 Ok, are you fine with the following? commit 902360bb75ed2bc5a9c33b790eded627cac57483 Author: Konstantin Belousov Date: Tue Oct 12 01:02:35 2021 +0300 Restore PPS_SYNC in NOTES This partially reverts e81e77c5a055, leaving the option both in GENERICs on amd64/arm64/arm, and in global NOTES file. Apparently this better matches existing practice, where we do not try to hard to make LINT and GENERIC complimentary. Requested by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week diff --git a/sys/conf/NOTES b/sys/conf/NOTES index e41b00edf2f6..39446fba06b3 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1245,6 +1245,12 @@ options CAPABILITY_MODE # sandboxes with no global namespace access options HZ=100 +# Enable support for the kernel PLL to use an external PPS signal, +# under supervision of [x]ntpd(8) +# More info in ntpd documentation: http://www.eecis.udel.edu/~ntp + +options PPS_SYNC + # Enable support for generic feed-forward clocks in the kernel. # The feed-forward clock support is an alternative to the feedback oriented # ntpd/system clock approach, and is to be used with a feed-forward diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES index 1a0c70fb08f9..78d990331ead 100644 --- a/sys/powerpc/conf/NOTES +++ b/sys/powerpc/conf/NOTES @@ -46,8 +46,6 @@ options PSIM #GDB PSIM ppc simulator options MAMBO #IBM Mambo Full System Simulator options QEMU #QEMU processor emulator -options PPS_SYNC - # The cpufreq(4) driver provides support for CPU frequency control device cpufreq diff --git a/sys/riscv/conf/NOTES b/sys/riscv/conf/NOTES index 60e842ab2709..7dda89bfe1a8 100644 --- a/sys/riscv/conf/NOTES +++ b/sys/riscv/conf/NOTES @@ -20,8 +20,6 @@ options FPE # Floating-point extension support options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options INTRNG # Include INTRNG framework -options PPS_SYNC - # RISC-V SBI console device rcons From nobody Tue Oct 12 05:01:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8220F17C5FB3; Tue, 12 Oct 2021 05:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HT3Rn2zhwz3PRg; Tue, 12 Oct 2021 05:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46F3D63D9; Tue, 12 Oct 2021 05:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19C51vDF093926; Tue, 12 Oct 2021 05:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19C51vgg093925; Tue, 12 Oct 2021 05:01:57 GMT (envelope-from git) Date: Tue, 12 Oct 2021 05:01:57 GMT Message-Id: <202110120501.19C51vgg093925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 120b20bdf496 - main - nfscl: Fix a deadlock related to the NFSv4 clientID lock List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 120b20bdf49630cf2a7dbc5f93b9e985e1f4f198 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=120b20bdf49630cf2a7dbc5f93b9e985e1f4f198 commit 120b20bdf49630cf2a7dbc5f93b9e985e1f4f198 Author: Rick Macklem AuthorDate: 2021-10-12 04:58:24 +0000 Commit: Rick Macklem CommitDate: 2021-10-12 04:58:24 +0000 nfscl: Fix a deadlock related to the NFSv4 clientID lock Without this patch, it is possible for a process doing an NFSv4 Open/create of a file to block to allow another process to acquire the exclusive lock on the clientID when holding a shared lock on the clientID. As such, both processes deadlock, with one wanting the exclusive lock, while the other holds the shared lock. This deadlock is unlikely to occur unless delegations are in use on the NFSv4 mount. This patch fixes the problem by not deferring to the process waiting for the exclusive lock when a shared lock (reference cnt) is already held by the process. This problem was detected during a recent NFSv4 interoperability testing event held by the IETF working group. MFC after: 1 week --- sys/fs/nfs/nfs_var.h | 4 ++-- sys/fs/nfsclient/nfs_clrpcops.c | 14 +++++++------- sys/fs/nfsclient/nfs_clstate.c | 29 ++++++++++++++++------------- sys/fs/nfsclient/nfs_clvfsops.c | 2 +- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index ebb23d28420b..459860078c30 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -573,12 +573,12 @@ void nfsrpc_bindconnsess(CLIENT *, void *, struct ucred *); /* nfs_clstate.c */ int nfscl_open(vnode_t, u_int8_t *, int, u_int32_t, int, struct ucred *, NFSPROC_T *, struct nfsclowner **, struct nfsclopen **, - int *, int *, int); + int *, int *, int, bool); int nfscl_getstateid(vnode_t, u_int8_t *, int, u_int32_t, int, struct ucred *, NFSPROC_T *, nfsv4stateid_t *, void **); void nfscl_ownerrelease(struct nfsmount *, struct nfsclowner *, int, int, int); void nfscl_openrelease(struct nfsmount *, struct nfsclopen *, int, int); -int nfscl_getcl(struct mount *, struct ucred *, NFSPROC_T *, bool, +int nfscl_getcl(struct mount *, struct ucred *, NFSPROC_T *, bool, bool, struct nfsclclient **); struct nfsclclient *nfscl_findcl(struct nfsmount *); void nfscl_clientrelease(struct nfsclclient *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 0a3826ed8dc1..66e093505ca3 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -392,7 +392,7 @@ else printf(" fhl=0\n"); do { dp = NULL; error = nfscl_open(vp, nfhp->nfh_fh, nfhp->nfh_len, mode, 1, - cred, p, NULL, &op, &newone, &ret, 1); + cred, p, NULL, &op, &newone, &ret, 1, true); if (error) { return (error); } @@ -1579,7 +1579,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, goto nfsmout; } ret = nfscl_open(dvp, (*nfhpp)->nfh_fh, (*nfhpp)->nfh_len, - openmode, 0, cred, p, NULL, &op, &newone, &retop, 1); + openmode, 0, cred, p, NULL, &op, &newone, &retop, 1, true); if (ret != 0) goto nfsmout; if (newone != 0) { @@ -2307,7 +2307,7 @@ nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, dp = NULL; error = nfscl_open(dvp, NULL, 0, (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), 0, cred, p, &owp, NULL, &newone, - NULL, 1); + NULL, 1, true); if (error) return (error); if (nmp->nm_clp != NULL) @@ -2593,7 +2593,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, */ error = nfscl_open(dvp, nfhp->nfh_fh, nfhp->nfh_len, (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), 0, - cred, p, NULL, &op, &newone, NULL, 0); + cred, p, NULL, &op, &newone, NULL, 0, false); if (error) goto nfsmout; op->nfso_stateid = stateid; @@ -4214,7 +4214,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, do { nd->nd_repstat = 0; if (op == F_GETLK) { - error = nfscl_getcl(vp->v_mount, cred, p, false, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, false, true, &clp); if (error) return (error); error = nfscl_lockt(vp, clp, off, len, fl, p, id, flags); @@ -4231,7 +4231,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, * We must loop around for all lockowner cases. */ callcnt = 0; - error = nfscl_getcl(vp->v_mount, cred, p, false, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, false, true, &clp); if (error) return (error); do { @@ -8177,7 +8177,7 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, */ error = nfscl_open(dvp, nfhp->nfh_fh, nfhp->nfh_len, (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), 0, - cred, p, NULL, &op, &newone, NULL, 0); + cred, p, NULL, &op, &newone, NULL, 0, false); if (error != 0) goto nfsmout; op->nfso_stateid = stateid; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index ddbfa40300d8..6be06b556de8 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -216,7 +216,7 @@ static short *nfscl_cberrmap[] = { int nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, struct ucred *cred, NFSPROC_T *p, struct nfsclowner **owpp, - struct nfsclopen **opp, int *newonep, int *retp, int lockit) + struct nfsclopen **opp, int *newonep, int *retp, int lockit, bool firstref) { struct nfsclclient *clp; struct nfsclowner *owp, *nowp; @@ -244,7 +244,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, fhlen - 1, M_NFSCLOPEN, M_WAITOK); nop->nfso_hash.le_prev = NULL; } - ret = nfscl_getcl(vp->v_mount, cred, p, false, &clp); + ret = nfscl_getcl(vp->v_mount, cred, p, false, firstref, &clp); if (ret != 0) { free(nowp, M_NFSCLOWNER); if (nop != NULL) @@ -863,7 +863,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, */ int nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, - bool tryminvers, struct nfsclclient **clpp) + bool tryminvers, bool firstref, struct nfsclclient **clpp) { struct nfsclclient *clp; struct nfsclclient *newclp = NULL; @@ -932,14 +932,16 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, NFSCLSTATEMUTEXPTR, mp); if (igotlock == 0) { /* - * Call nfsv4_lock() with "iwantlock == 0" so that it will - * wait for a pending exclusive lock request. This gives the - * exclusive lock request priority over this shared lock - * request. + * Call nfsv4_lock() with "iwantlock == 0" on the firstref so + * that it will wait for a pending exclusive lock request. + * This gives the exclusive lock request priority over this + * shared lock request. * An exclusive lock on nfsc_lock is used mainly for server - * crash recoveries. + * crash recoveries and delegation recalls. */ - nfsv4_lock(&clp->nfsc_lock, 0, NULL, NFSCLSTATEMUTEXPTR, mp); + if (firstref) + nfsv4_lock(&clp->nfsc_lock, 0, NULL, NFSCLSTATEMUTEXPTR, + mp); nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, mp); } if (igotlock == 0 && NFSCL_FORCEDISM(mp)) { @@ -1121,7 +1123,8 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, if (recovery) clp = rclp; else - error = nfscl_getcl(vp->v_mount, cred, p, false, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, false, true, + &clp); } if (error) { free(nlp, M_NFSCLLOCKOWNER); @@ -1452,7 +1455,7 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, end = NFS64BITSSET; } - error = nfscl_getcl(vp->v_mount, cred, p, false, &clp); + error = nfscl_getcl(vp->v_mount, cred, p, false, true, &clp); if (error) return (1); nfscl_filllockowner(id, own, flags); @@ -3245,7 +3248,7 @@ nfscl_getclose(vnode_t vp, struct nfsclclient **clpp) struct nfsfh *nfhp; int error, notdecr; - error = nfscl_getcl(vp->v_mount, NULL, NULL, false, &clp); + error = nfscl_getcl(vp->v_mount, NULL, NULL, false, true, &clp); if (error) return (error); *clpp = clp; @@ -3319,7 +3322,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) struct nfsclrecalllayout *recallp; int error; - error = nfscl_getcl(vp->v_mount, NULL, NULL, false, &clp); + error = nfscl_getcl(vp->v_mount, NULL, NULL, false, true, &clp); if (error) return (error); *clpp = clp; diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 6323451adf54..d5d9bb395c79 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1613,7 +1613,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, /* For NFSv4, get the clientid now. */ if ((argp->flags & NFSMNT_NFSV4) != 0) { NFSCL_DEBUG(3, "at getcl\n"); - error = nfscl_getcl(mp, cred, td, tryminvers, &clp); + error = nfscl_getcl(mp, cred, td, tryminvers, true, &clp); NFSCL_DEBUG(3, "aft getcl=%d\n", error); if (error != 0) goto bad; From nobody Tue Oct 12 06:45:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AAFE117F5369; Tue, 12 Oct 2021 06:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HT5lb31LRz4mgS; Tue, 12 Oct 2021 06:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25A527CC3; Tue, 12 Oct 2021 06:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19C6jl9b028926; Tue, 12 Oct 2021 06:45:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19C6jlBs028925; Tue, 12 Oct 2021 06:45:47 GMT (envelope-from git) Date: Tue, 12 Oct 2021 06:45:47 GMT Message-Id: <202110120645.19C6jlBs028925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: fc22fe5c7405 - main - stress2: Use two memory disks for this test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc22fe5c74055802ac41090f345c8a45eab396b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=fc22fe5c74055802ac41090f345c8a45eab396b6 commit fc22fe5c74055802ac41090f345c8a45eab396b6 Author: Peter Holm AuthorDate: 2021-10-12 06:45:19 +0000 Commit: Peter Holm CommitDate: 2021-10-12 06:45:19 +0000 stress2: Use two memory disks for this test --- tools/test/stress2/misc/unionfs.sh | 72 ++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/tools/test/stress2/misc/unionfs.sh b/tools/test/stress2/misc/unionfs.sh index 6e04e809b501..16572de6b3b5 100755 --- a/tools/test/stress2/misc/unionfs.sh +++ b/tools/test/stress2/misc/unionfs.sh @@ -26,29 +26,65 @@ # SUCH DAMAGE. # +# unionfs test using two memory disks + [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg -# "insmntque: non-locked vp: 0xd2462e10 is not exclusive locked ..." seen. +# unionfs usage example from the man page: +# mount -t cd9660 -o ro /dev/cd0 /usr/src +# mount -t unionfs -o noatime /var/obj /usr/src -. ../default.cfg +md1=$mdstart +md2=$((md1 + 1)) +mp1=/mnt$md1 +mp2=/mnt$md2 +mkdir -p $mp1 $mp2 +set -e +for i in $mp1 $mp2; do + mount | grep -q "on $i " && umount -f $i +done +for i in $md1 $md2; do + mdconfig -l | grep -q md$i && mdconfig -d -u $i +done -truncate -s 256M $diskimage +mdconfig -a -t swap -s 2g -u $md1 +mdconfig -a -t swap -s 2g -u $md2 +newfs $newfs_flags -n md$md1 > /dev/null +newfs $newfs_flags -n md$md2 > /dev/null +mount /dev/md$md1 $mp1 +mount /dev/md$md2 $mp2 -mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint -mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mount -t unionfs -o noatime $mp1 $mp2 +mount | grep -E "$mp1|$mp2" +set +e + +export RUNDIR=$mp2/stressX +export CTRLDIR=$mp2/stressX.control +export runRUNTIME=2m + +# SU work around for "disk full" +set `df -ik $mp2 | tail -1 | awk '{print $4,$7}'` +export KBLOCKS=$(($1 / 2)) +export INODES=$(($2 / 2)) -mdconfig -a -t vnode -f $diskimage -u $mdstart -bsdlabel -w md$mdstart auto -newfs $newfs_flags md${mdstart}$part > /dev/null -mount /dev/md${mdstart}$part $mntpoint -mount -t unionfs -o noatime $mntpoint /tmp -export RUNDIR=/tmp/stressX -export runRUNTIME=10m # Run tests for 10 minutes (cd ..; ./run.sh disk.cfg) -umount /tmp -while mount | grep $mntpoint | grep -q /dev/md; do - umount $mntpoint || sleep 1 + +find $RUNDIR -ls +for i in `jot 5`; do + mount | grep -q unionfs || break + umount $mp2 || sleep 2 # The unionfs mount +done +mount | grep unionfs && exit 1 + +for i in `jot 5`; do + umount $mp2 && break + sleep 2 done -mdconfig -d -u $mdstart -rm -f $diskimage -exit 0 +mount | grep -q "on $mp2 " && exit 1 +n=`find $mp1/stressX | wc -l` +[ $n -eq 1 ] && s=0 || s=1 +umount $mp1 +mdconfig -d -u $md2 +mdconfig -d -u $md1 +exit $s From nobody Tue Oct 12 07:44:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BA1D3180E897; Tue, 12 Oct 2021 07:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HT73G0p0Hz54yL; Tue, 12 Oct 2021 07:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8EB010E80; Tue, 12 Oct 2021 07:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19C7iPB9009455; Tue, 12 Oct 2021 07:44:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19C7iPe1009454; Tue, 12 Oct 2021 07:44:25 GMT (envelope-from git) Date: Tue, 12 Oct 2021 07:44:25 GMT Message-Id: <202110120744.19C7iPe1009454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 7259ca31048e - main - fifos: delegate unhandled kqueue filters to underlying filesystem List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7259ca31048e5ced8e7f90657a3d7084aeafdf51 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7259ca31048e5ced8e7f90657a3d7084aeafdf51 commit 7259ca31048e5ced8e7f90657a3d7084aeafdf51 Author: Kyle Evans AuthorDate: 2021-10-02 05:23:03 +0000 Commit: Kyle Evans CommitDate: 2021-10-12 07:43:07 +0000 fifos: delegate unhandled kqueue filters to underlying filesystem This gives the vfs layer a chance to provide handling for EVFILT_VNODE, for instance. Change pipe_specops to use the default vop_kqfilter to accommodate fifoops that don't specify the method (i.e. all in-tree). Based on a patch by Jan Kokemüller. PR: 225934 Reviewed by: kib, markj (both pre-KASSERT) Differential Revision: https://reviews.freebsd.org/D32271 --- sys/fs/fifofs/fifo_vnops.c | 1 - sys/kern/sys_pipe.c | 4 +++ sys/kern/vfs_subr.c | 3 ++ tests/sys/kqueue/libkqueue/common.h | 2 ++ tests/sys/kqueue/libkqueue/vnode.c | 59 +++++++++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 1 deletion(-) diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 1b941620b080..d9dc8eee8e60 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -83,7 +83,6 @@ struct vop_vector fifo_specops = { .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, .vop_ioctl = VOP_PANIC, - .vop_kqfilter = VOP_PANIC, .vop_link = VOP_PANIC, .vop_mkdir = VOP_PANIC, .vop_mknod = VOP_PANIC, diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 7bd7fea28e76..1d5d7329692e 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1751,6 +1751,10 @@ pipe_kqfilter(struct file *fp, struct knote *kn) cpipe = PIPE_PEER(cpipe); break; default: + if ((cpipe->pipe_type & PIPE_TYPE_NAMED) != 0) { + PIPE_UNLOCK(cpipe); + return (vnops.fo_kqfilter(fp, kn)); + } PIPE_UNLOCK(cpipe); return (EINVAL); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 69ac73bd3954..d4b7ac71eb97 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6172,6 +6172,9 @@ vfs_kqfilter(struct vop_kqfilter_args *ap) struct knote *kn = ap->a_kn; struct knlist *knl; + KASSERT(vp->v_type != VFIFO || (kn->kn_filter != EVFILT_READ && + kn->kn_filter != EVFILT_WRITE), + ("READ/WRITE filter on a FIFO leaked through")); switch (kn->kn_filter) { case EVFILT_READ: kn->kn_fop = &vfsread_filtops; diff --git a/tests/sys/kqueue/libkqueue/common.h b/tests/sys/kqueue/libkqueue/common.h index d621a8bf1e00..a92e544910ba 100644 --- a/tests/sys/kqueue/libkqueue/common.h +++ b/tests/sys/kqueue/libkqueue/common.h @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include #include diff --git a/tests/sys/kqueue/libkqueue/vnode.c b/tests/sys/kqueue/libkqueue/vnode.c index 8f4311e90745..b6c0915b2654 100644 --- a/tests/sys/kqueue/libkqueue/vnode.c +++ b/tests/sys/kqueue/libkqueue/vnode.c @@ -64,6 +64,64 @@ test_kevent_vnode_note_delete(void) success(); } +static void +test_kevent_vnode_note_delete_fifo(void) +{ + const char *test_id = "kevent(EVFILT_VNODE, NOTE_DELETE, FIFO)"; + const char *fifo_path = "./kqueue-fifo.tmp"; + struct kevent kev; + int fd; + pid_t pid; + + test_begin(test_id); + + if (mkfifo(fifo_path, 0600) != 0) + err(1, "mkfifo"); + + pid = fork(); + if (pid == -1) + err(1, "fork"); + + if (pid == 0) { + char buf[4]; + + fd = open(fifo_path, O_RDONLY); + if (fd == -1) + _exit(1); + + while (read(fd, buf, sizeof(buf)) != 0) { + } + + _exit(0); + } + + sleep(1); + if (waitpid(pid, NULL, WNOHANG) == pid) { + unlink(fifo_path); + err(1, "open"); + } + + fd = open(fifo_path, O_WRONLY); + if (fd < 0) { + unlink(fifo_path); + err(1, "open"); + } + + EV_SET(&kev, fd, EVFILT_VNODE, EV_ADD | EV_ONESHOT, NOTE_DELETE, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) { + unlink(fifo_path); + err(1, "%s", test_id); + } + + if (unlink(fifo_path) < 0) + err(1, "unlink"); + + kevent_cmp(&kev, kevent_get(kqfd)); + close(fd); + + success(); +} + static void test_kevent_vnode_note_write(void) { @@ -261,5 +319,6 @@ test_evfilt_vnode(void) test_kevent_vnode_note_attrib(); test_kevent_vnode_note_rename(); test_kevent_vnode_note_delete(); + test_kevent_vnode_note_delete_fifo(); close(kqfd); } From nobody Tue Oct 12 07:44:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 10F81180E644; Tue, 12 Oct 2021 07:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HT73G70gvz54yS; Tue, 12 Oct 2021 07:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1BAD10D9A; Tue, 12 Oct 2021 07:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19C7iQNu009479; Tue, 12 Oct 2021 07:44:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19C7iQsm009478; Tue, 12 Oct 2021 07:44:26 GMT (envelope-from git) Date: Tue, 12 Oct 2021 07:44:26 GMT Message-Id: <202110120744.19C7iQsm009478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 08580603b5c4 - main - kqueue(9): correct spelling of kn_fop List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08580603b5c438762a531aaadd435541ea14d2f2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=08580603b5c438762a531aaadd435541ea14d2f2 commit 08580603b5c438762a531aaadd435541ea14d2f2 Author: Kyle Evans AuthorDate: 2021-10-03 15:59:52 +0000 Commit: Kyle Evans CommitDate: 2021-10-12 07:44:09 +0000 kqueue(9): correct spelling of kn_fop --- share/man/man9/kqueue.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/kqueue.9 b/share/man/man9/kqueue.9 index ee56358b9e86..53f55b8efe03 100644 --- a/share/man/man9/kqueue.9 +++ b/share/man/man9/kqueue.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 26, 2012 +.Dd October 12, 2021 .Dt KQUEUE 9 .Os .Sh NAME @@ -145,7 +145,7 @@ such as when the object is being destroyed, or does not exist. During .Va f_attach , it is valid to change the -.Va kn_fops +.Va kn_fop pointer to a different pointer. This will change the .Va f_event From nobody Tue Oct 12 12:21:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D375B18073AC; Tue, 12 Oct 2021 12:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTFCD5TVfz3kd7; Tue, 12 Oct 2021 12:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D0AC143C0; Tue, 12 Oct 2021 12:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CCLiZ7081778; Tue, 12 Oct 2021 12:21:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CCLinV081777; Tue, 12 Oct 2021 12:21:44 GMT (envelope-from git) Date: Tue, 12 Oct 2021 12:21:44 GMT Message-Id: <202110121221.19CCLinV081777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0906563718d3 - main - Stop reading the arm64 domain when it's known List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0906563718d35643789fc2b3c4cf1fc6884755e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0906563718d35643789fc2b3c4cf1fc6884755e5 commit 0906563718d35643789fc2b3c4cf1fc6884755e5 Author: Andrew Turner AuthorDate: 2021-10-12 11:39:14 +0000 Commit: Andrew Turner CommitDate: 2021-10-12 12:16:00 +0000 Stop reading the arm64 domain when it's known There is no need to read the domain on arm64 when there is only one in the ACPI tables. This can also happen when the table is missing as it is unneeded. Reported by: dch Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/mp_machdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 82f47a6f9918..5f88900f4074 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -566,10 +566,10 @@ madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) else id = *cpuid; -#ifdef NUMA - domain = acpi_pxm_get_cpu_locality(*cpuid); -#else domain = 0; +#ifdef NUMA + if (vm_ndomains > 1) + domain = acpi_pxm_get_cpu_locality(*cpuid); #endif if (start_cpu(id, intr->ArmMpidr, domain)) { MPASS(cpuid_to_pcpu[id] != NULL); From nobody Tue Oct 12 14:09:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9686B17F19B3; Tue, 12 Oct 2021 14:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTHbs3rZSz4mmW; Tue, 12 Oct 2021 14:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6422215EBB; Tue, 12 Oct 2021 14:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CE9j3F016575; Tue, 12 Oct 2021 14:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CE9j8L016574; Tue, 12 Oct 2021 14:09:45 GMT (envelope-from git) Date: Tue, 12 Oct 2021 14:09:45 GMT Message-Id: <202110121409.19CE9j8L016574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 775f6f459595 - main - bhyve.8: Fix markup of the -G flag List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 775f6f459595c5373ab389a43bdf1a8467233f1a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=775f6f459595c5373ab389a43bdf1a8467233f1a commit 775f6f459595c5373ab389a43bdf1a8467233f1a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-12 14:06:52 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-12 14:09:28 +0000 bhyve.8: Fix markup of the -G flag --- usr.sbin/bhyve/bhyve.8 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 09bba05a4f7a..17d58d29b780 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -45,10 +45,11 @@ .Op Cm ,threads= Ar n .Oc .Sm on -.Oo Fl G +.Oo .Sm off +.Fl G\~ .Oo Ar w Oc -.Oo Ar bind_address: Oc +.Oo Ar bind_address Cm \&: Oc .Ar port .Sm on .Oc @@ -58,8 +59,8 @@ .Ar lpcdev Op Cm \&, Ar conf .Sm on .Oc -.Oo Fl m .Sm off +.Oo Fl m\~ .Ar memsize .Oo .Cm K | Cm k | Cm M | Cm m | Cm G | Cm g | Cm T | Cm t @@ -146,7 +147,7 @@ This is intended for debug purposes. .It Fl G Xo .Sm off .Oo Ar w Oc -.Oo Ar bind_address: Oc +.Oo Ar bind_address Cm \&: Oc .Ar port .Sm on .Xc From nobody Tue Oct 12 19:37:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3AD3517F50CD; Tue, 12 Oct 2021 19:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTQsg4x4rz4gm7; Tue, 12 Oct 2021 19:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 682471A3FC; Tue, 12 Oct 2021 19:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CJbBlj059726; Tue, 12 Oct 2021 19:37:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CJbBYp059725; Tue, 12 Oct 2021 19:37:11 GMT (envelope-from git) Date: Tue, 12 Oct 2021 19:37:11 GMT Message-Id: <202110121937.19CJbBYp059725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: aeb76076c698 - main - Prevent repeated deallocation of a resource. Also deactivate resource if needed. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aeb76076c6985c3accaffa322ce9df47d686e3d1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=aeb76076c6985c3accaffa322ce9df47d686e3d1 commit aeb76076c6985c3accaffa322ce9df47d686e3d1 Author: Ruslan Bukin AuthorDate: 2021-10-12 19:13:44 +0000 Commit: Ruslan Bukin CommitDate: 2021-10-12 19:13:44 +0000 Prevent repeated deallocation of a resource. Also deactivate resource if needed. Discussed with: jrtc27 Differential Revision: https://reviews.freebsd.org/D32458 --- sys/dev/pci/pci_host_generic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 03e8baa1b5cf..4d7d9f314dce 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -307,6 +307,7 @@ pci_host_generic_core_release_resource(device_t dev, device_t child, int type, { struct generic_pcie_core_softc *sc; struct rman *rm; + int error; sc = device_get_softc(dev); @@ -319,7 +320,12 @@ pci_host_generic_core_release_resource(device_t dev, device_t child, int type, rm = generic_pcie_rman(sc, type, rman_get_flags(res)); if (rm != NULL) { KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); - rman_release_resource(res); + if (rman_get_flags(res) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, rid, res); + if (error) + return (error); + } + return (rman_release_resource(res)); } return (bus_generic_release_resource(dev, child, type, rid, res)); From nobody Tue Oct 12 19:58:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DCAD717FE529; Tue, 12 Oct 2021 19:58:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTRLf4G9nz4p2y; Tue, 12 Oct 2021 19:58:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id AA207EB7B; Tue, 12 Oct 2021 19:58:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: e81e77c5a055 - main - Enable PPS_SYNC on amd64, arm64 and armv7 To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110101934.19AJYuIJ019276@gitrepo.freebsd.org> <9f4710f1-4639-92ec-2040-51ea0bf9290c@FreeBSD.org> From: John Baldwin Message-ID: Date: Tue, 12 Oct 2021 12:58:48 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/11/21 3:05 PM, Konstantin Belousov wrote: > On Mon, Oct 11, 2021 at 02:09:58PM -0700, John Baldwin wrote: >> On 10/11/21 1:46 PM, Konstantin Belousov wrote: >>> On Mon, Oct 11, 2021 at 01:37:21PM -0700, John Baldwin wrote: >>>> On 10/10/21 12:34 PM, Konstantin Belousov wrote: >>>>> The branch main has been updated by kib: >>>>> >>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f >>>>> >>>>> commit e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f >>>>> Author: Konstantin Belousov >>>>> AuthorDate: 2021-10-10 12:20:45 +0000 >>>>> Commit: Konstantin Belousov >>>>> CommitDate: 2021-10-10 19:34:40 +0000 >>>>> >>>>> Enable PPS_SYNC on amd64, arm64 and armv7 >>>>> Remove the option from NOTES/LINT, and add to NOTES for powerpc and >>>>> riscv. >>>>> PR: 259036 >>>>> Requested by: John Hay >>>>> Discussed with: ian, imp >>>>> Sponsored by: The FreeBSD Foundation >>>>> MFC after: 1 week >>>> >>>> Hmm, if the option is MI, why move it out of the MI NOTES? We don't >>>> generally remove items from NOTES just because they are enabled by default >>>> in GENERIC. That would break the functionality of NOTES where it documents >>>> options (and sometimes provides more detail than the 1-liner comments we >>>> use in GENERIC). >>>> >>>> In this case I would have left NOTES as-is and instead added PPS_SYNC to >>>> the relevant GENERIC files with a one-line comment leaving the more >>>> detailed comment in NOTES. >>> >>> To have both PPS_SYNC and !PPS_SYNC covered during tinderbox. >>> If an option is present in both NOTES and GENERIC, there is a chance >>> that its absence is not compiled.> Bruce' opinion was that LINT should >>> be mostly complementary to GENERIC. >> >> That doesn't match what we actually do. For example, INET and INET6 are in >> both, SMP, SOFTUPDATES, etc. I think you can go through amd64 GENERIC and >> every option in it is in NOTES except now for PPS_SYNC. >> >> I ran this before your commit: >> >> % awk '/^(device|options)/ { print $2 }' GENERIC | sort > one >> % awk '/^(device|options)/ { print $2 }' ../../conf/NOTES ../../x86/conf/NOTES NOTES | sort > two >> >> Items only in GENERIC (I would say most of these are probably bugs in the form of >> missing entries in NOTES, ULE is 4BSD in NOTES instead, and VERBOSE_SYSINIT >> has the default value of 1 in NOTES): >> >> % > comm -23 one two >> AH_AR5416_INTERRUPT_MITIGATION >> ATH_ENABLE_11N >> BUF_TRACKING >> DDB_CTF >> FIB_ALGO >> FULL_BUF_TRACKING >> IOMMU >> KDTRACE_FRAME >> PRINTF_BUFR_SIZE=128 >> RACCT_DEFAULT_TO_DISABLED >> SCHED_ULE >> VERBOSE_SYSINIT=0 >> ath_pci >> ocs_fc >> pvscsi >> tws >> vge >> >> The number of options duplicated in both NOTES and GENERIC: >> >> % comm -12 one two | wc -l >> 259 > > Ok, are you fine with the following? > > commit 902360bb75ed2bc5a9c33b790eded627cac57483 > Author: Konstantin Belousov > Date: Tue Oct 12 01:02:35 2021 +0300 > > Restore PPS_SYNC in NOTES > > This partially reverts e81e77c5a055, leaving the option both in > GENERICs on amd64/arm64/arm, and in global NOTES file. Apparently > this better matches existing practice, where we do not try to hard > to make LINT and GENERIC complimentary. > > Requested by: jhb > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Yes, thanks. -- John Baldwin From nobody Tue Oct 12 20:10:55 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0121317F3869; Tue, 12 Oct 2021 20:10:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTRcb6gcQz4sQc; Tue, 12 Oct 2021 20:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C53C61AC09; Tue, 12 Oct 2021 20:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CKAtNR008794; Tue, 12 Oct 2021 20:10:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CKAtGd008793; Tue, 12 Oct 2021 20:10:55 GMT (envelope-from git) Date: Tue, 12 Oct 2021 20:10:55 GMT Message-Id: <202110122010.19CKAtGd008793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4cc167a35217 - main - Restore PPS_SYNC in NOTES List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4cc167a35217f9cee81a2f366e451fae42fd4a6c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4cc167a35217f9cee81a2f366e451fae42fd4a6c commit 4cc167a35217f9cee81a2f366e451fae42fd4a6c Author: Konstantin Belousov AuthorDate: 2021-10-11 22:02:35 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-12 20:10:35 +0000 Restore PPS_SYNC in NOTES This partially reverts e81e77c5a055, leaving the option both in GENERICs on amd64/arm64/arm, and in global NOTES file. Apparently this better matches existing practice, where we do not try to hard to make LINT and GENERIC complimentary. Requested and reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/conf/NOTES | 6 ++++++ sys/powerpc/conf/NOTES | 2 -- sys/riscv/conf/NOTES | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index e41b00edf2f6..39446fba06b3 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1245,6 +1245,12 @@ options CAPABILITY_MODE # sandboxes with no global namespace access options HZ=100 +# Enable support for the kernel PLL to use an external PPS signal, +# under supervision of [x]ntpd(8) +# More info in ntpd documentation: http://www.eecis.udel.edu/~ntp + +options PPS_SYNC + # Enable support for generic feed-forward clocks in the kernel. # The feed-forward clock support is an alternative to the feedback oriented # ntpd/system clock approach, and is to be used with a feed-forward diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES index 1a0c70fb08f9..78d990331ead 100644 --- a/sys/powerpc/conf/NOTES +++ b/sys/powerpc/conf/NOTES @@ -46,8 +46,6 @@ options PSIM #GDB PSIM ppc simulator options MAMBO #IBM Mambo Full System Simulator options QEMU #QEMU processor emulator -options PPS_SYNC - # The cpufreq(4) driver provides support for CPU frequency control device cpufreq diff --git a/sys/riscv/conf/NOTES b/sys/riscv/conf/NOTES index 60e842ab2709..7dda89bfe1a8 100644 --- a/sys/riscv/conf/NOTES +++ b/sys/riscv/conf/NOTES @@ -20,8 +20,6 @@ options FPE # Floating-point extension support options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options INTRNG # Include INTRNG framework -options PPS_SYNC - # RISC-V SBI console device rcons From nobody Tue Oct 12 20:21:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 159E617F9563; Tue, 12 Oct 2021 20:21:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTRrW6tlZz3CKJ; Tue, 12 Oct 2021 20:21:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB7B81AF10; Tue, 12 Oct 2021 20:21:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CKLFfB023426; Tue, 12 Oct 2021 20:21:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CKLFoP023425; Tue, 12 Oct 2021 20:21:15 GMT (envelope-from git) Date: Tue, 12 Oct 2021 20:21:15 GMT Message-Id: <202110122021.19CKLFoP023425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: df7d76384965 - main - pthread_np.3: Add a manpage summarizing all of the pthread extensions. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df7d763849655f4038428f97804bf7324d801684 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df7d763849655f4038428f97804bf7324d801684 commit df7d763849655f4038428f97804bf7324d801684 Author: Felix Johnson AuthorDate: 2021-10-07 17:45:21 +0000 Commit: John Baldwin CommitDate: 2021-10-12 20:20:36 +0000 pthread_np.3: Add a manpage summarizing all of the pthread extensions. PR: 197299 MFC after: 1 week --- share/man/man3/Makefile | 1 + share/man/man3/pthread.3 | 8 +- share/man/man3/pthread_affinity_np.3 | 5 +- share/man/man3/pthread_attr_affinity_np.3 | 3 +- share/man/man3/pthread_attr_get_np.3 | 5 +- share/man/man3/pthread_attr_setcreatesuspend_np.3 | 3 +- share/man/man3/pthread_getthreadid_np.3 | 3 +- share/man/man3/pthread_join.3 | 6 +- share/man/man3/pthread_main_np.3 | 3 +- share/man/man3/pthread_multi_np.3 | 3 +- share/man/man3/pthread_mutexattr_getkind_np.3 | 5 +- share/man/man3/pthread_np.3 | 230 ++++++++++++++++++++++ share/man/man3/pthread_resume_all_np.3 | 3 +- share/man/man3/pthread_resume_np.3 | 3 +- share/man/man3/pthread_set_name_np.3 | 3 +- share/man/man3/pthread_suspend_all_np.3 | 3 +- share/man/man3/pthread_suspend_np.3 | 3 +- share/man/man3/pthread_switch_add_np.3 | 5 +- 18 files changed, 273 insertions(+), 22 deletions(-) diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 7312870a17dc..0f371ef427bd 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -413,6 +413,7 @@ PTHREAD_MAN= pthread.3 \ pthread_mutex_timedlock.3 \ pthread_mutex_trylock.3 \ pthread_mutex_unlock.3 \ + pthread_np.3 \ pthread_once.3 \ pthread_resume_all_np.3 \ pthread_resume_np.3 \ diff --git a/share/man/man3/pthread.3 b/share/man/man3/pthread.3 index 8a437b1cedb4..6b7b82eb27f5 100644 --- a/share/man/man3/pthread.3 +++ b/share/man/man3/pthread.3 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd October 12, 2021 .Dt PTHREAD 3 .Os .Sh NAME @@ -67,6 +67,10 @@ Per-Thread Context Routines .It Cleanup Routines .El +.Pp +.Fx +extensions to the POSIX thread functions are summarized in +.Xr pthread_np 3 . .Ss Thread Routines .Bl -tag -width indent .It Xo @@ -478,7 +482,6 @@ functions and the thread functions. Threaded applications are linked with this library. .Sh SEE ALSO .Xr libthr 3 , -.Xr pthread_affinity_np 3 , .Xr pthread_atfork 3 , .Xr pthread_attr 3 , .Xr pthread_cancel 3 , @@ -513,6 +516,7 @@ Threaded applications are linked with this library. .Xr pthread_mutexattr_setprioceiling 3 , .Xr pthread_mutexattr_setprotocol 3 , .Xr pthread_mutexattr_settype 3 , +.Xr pthread_np 3 , .Xr pthread_once 3 , .Xr pthread_rwlock_destroy 3 , .Xr pthread_rwlock_init 3 , diff --git a/share/man/man3/pthread_affinity_np.3 b/share/man/man3/pthread_affinity_np.3 index 24fef03ab4ed..0a52add2ee3c 100644 --- a/share/man/man3/pthread_affinity_np.3 +++ b/share/man/man3/pthread_affinity_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2010 +.Dd October 12, 2021 .Dt PTHREAD_AFFINITY_NP 3 .Os .Sh NAME @@ -124,7 +124,8 @@ operation. .Xr cpuset_setid 2 , .Xr pthread 3 , .Xr pthread_attr_getaffinity_np 3 , -.Xr pthread_attr_setaffinity_np 3 +.Xr pthread_attr_setaffinity_np 3 , +.Xr pthread_np 3 .Sh STANDARDS The .Nm pthread_getaffinity_np diff --git a/share/man/man3/pthread_attr_affinity_np.3 b/share/man/man3/pthread_attr_affinity_np.3 index 4c400b9a17e7..7b1cd3dea0d9 100644 --- a/share/man/man3/pthread_attr_affinity_np.3 +++ b/share/man/man3/pthread_attr_affinity_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2016 +.Dd October 12, 2021 .Dt PTHREAD_ATTR_AFFINITY_NP 3 .Os .Sh NAME @@ -132,6 +132,7 @@ Insufficient memory exists to store the cpuset mask. .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , .Xr pthread_getaffinity_np 3 , +.Xr pthread_np 3 , .Xr pthread_setaffinity_np 3 .Sh STANDARDS The diff --git a/share/man/man3/pthread_attr_get_np.3 b/share/man/man3/pthread_attr_get_np.3 index a23cac6997c9..336c3626a27c 100644 --- a/share/man/man3/pthread_attr_get_np.3 +++ b/share/man/man3/pthread_attr_get_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2003 +.Dd October 12, 2021 .Dt PTHREAD_ATTR_GET_NP 3 .Os .Sh NAME @@ -107,7 +107,8 @@ thread ID. .Xr pthread_attr_getstack 3 , .Xr pthread_attr_getstackaddr 3 , .Xr pthread_attr_getstacksize 3 , -.Xr pthread_attr_init 3 +.Xr pthread_attr_init 3 , +.Xr pthread_np 3 .Sh AUTHORS The .Fn pthread_attr_get_np diff --git a/share/man/man3/pthread_attr_setcreatesuspend_np.3 b/share/man/man3/pthread_attr_setcreatesuspend_np.3 index 75408ccefc62..d2c6a6f74694 100644 --- a/share/man/man3/pthread_attr_setcreatesuspend_np.3 +++ b/share/man/man3/pthread_attr_setcreatesuspend_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_ATTR_SETCREATESUSPEND_NP 3 .Os .Sh NAME @@ -65,6 +65,7 @@ is invalid. .Xr pthread_attr_destroy 3 , .Xr pthread_attr_init 3 , .Xr pthread_create 3 , +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 .Sh AUTHORS diff --git a/share/man/man3/pthread_getthreadid_np.3 b/share/man/man3/pthread_getthreadid_np.3 index a912e7d42efa..562f6a7ae91a 100644 --- a/share/man/man3/pthread_getthreadid_np.3 +++ b/share/man/man3/pthread_getthreadid_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd October 12, 2021 .Dt PTHREAD_GETTHREADID_NP 3 .Os .Sh NAME @@ -50,6 +50,7 @@ function returns the thread integral ID of the calling thread. .Sh ERRORS None. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_self 3 .Sh AUTHORS This manual page was written by diff --git a/share/man/man3/pthread_join.3 b/share/man/man3/pthread_join.3 index 799f6409fbfa..4cd04eade0aa 100644 --- a/share/man/man3/pthread_join.3 +++ b/share/man/man3/pthread_join.3 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2019 +.Dd October 12, 2021 .Dt PTHREAD_JOIN 3 .Os .Sh NAME @@ -156,7 +156,9 @@ The specified thread has not yet exited. .El .Sh SEE ALSO .Xr wait 2 , -.Xr pthread_create 3 +.Xr pthread 3 , +.Xr pthread_create 3 , +.Xr pthread_np 3 .Sh STANDARDS The .Fn pthread_join diff --git a/share/man/man3/pthread_main_np.3 b/share/man/man3/pthread_main_np.3 index 81669b786094..c386cb224a9b 100644 --- a/share/man/man3/pthread_main_np.3 +++ b/share/man/man3/pthread_main_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_MAIN_NP 3 .Os .Sh NAME @@ -54,6 +54,7 @@ and \-1 if the thread's initialization has not yet completed. .Sh SEE ALSO .Xr pthread_create 3 , .Xr pthread_equal 3 , +.Xr pthread_np 3 , .Xr pthread_self 3 .Sh AUTHORS This manual page was written by diff --git a/share/man/man3/pthread_multi_np.3 b/share/man/man3/pthread_multi_np.3 index c790d358ca3c..065b53c49b1f 100644 --- a/share/man/man3/pthread_multi_np.3 +++ b/share/man/man3/pthread_multi_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_MULTI_NP 3 .Os .Sh NAME @@ -59,6 +59,7 @@ and .Nm pthread_single_np functions always return 0. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_suspend_all_np 3 .Sh AUTHORS diff --git a/share/man/man3/pthread_mutexattr_getkind_np.3 b/share/man/man3/pthread_mutexattr_getkind_np.3 index fe5435f90c30..cc3cc3df20ae 100644 --- a/share/man/man3/pthread_mutexattr_getkind_np.3 +++ b/share/man/man3/pthread_mutexattr_getkind_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_MUTEXATTR_GETKIND_NP 3 .Os .Sh NAME @@ -78,4 +78,5 @@ is invalid. .Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_init 3 , .Xr pthread_mutexattr_gettype 3 , -.Xr pthread_mutexattr_settype 3 +.Xr pthread_mutexattr_settype 3 , +.Xr pthread_np 3 diff --git a/share/man/man3/pthread_np.3 b/share/man/man3/pthread_np.3 new file mode 100644 index 000000000000..caab8cc13209 --- /dev/null +++ b/share/man/man3/pthread_np.3 @@ -0,0 +1,230 @@ +.\" Copyright (c) 2021 Felix Johnson +.\" +.\" 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 COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +.\" PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd October 12, 2021 +.Dt PTHREAD_NP 3 +.Os +.Sh NAME +.Nm pthread_np +.Nd FreeBSD extensions to POSIX thread functions +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread_np.h +.Sh DESCRIPTION +This manual page documents extensions to the POSIX thread functions. +These extensions may or may not be portable to other operating systems. +.Pp +The POSIX thread functions are summarized in this section in the following +groups: +.Pp +.Bl -bullet -offset indent -compact +.It +Thread Routines +.It +Attribute Object Routines +.It +Mutex Routines +.El +.\" .It +.\" Condition Variable Routines +.\" .It +.\" Read/Write Lock Routines +.\" .It +.\" Per-Thread Context Routines +.\" .It +.\" Cleanup Routines +.Ss Thread Routines +.Bl -tag -width indent +.It Xo +.Ft int +.Fo pthread_getaffinity_np +.Fa "pthread_t td" "size_t cpusetsize" "cpuset_t *cpusetp" +.Fc +.Xc +Get the CPU affinity of a specified thread. +.It Xo +.Ft int +.Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len" +.Xc +Get the name of a specified thread. +.It Xo +.Ft int +.Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len" +.Xc +Get the name of a specified thread. +.It Xo +.Ft int +.Fn pthread_getthreadid_np void +.Xc +Get the calling thread's integral ID. +.It Xo +.Ft int +.Fn pthread_main_np void +.Xc +Identify the initial thread. +.It Xo +.Ft int +.Fn pthread_multi_np void +.Xc +Sets the thread's scheduling mode to multi-threaded. +.It Xo +.Ft int +.Fn pthread_peekjoin_np "pthread_t thread" "void **value_ptr" +.Xc +Peek into the exit status of a specified thread. +.It Xo +.Ft int +.Fn pthread_resume_all_np void +.Xc +Resume all suspended threads. +.It Xo +.Ft int +.Fo pthread_setaffinity_np +.Fa "pthread_t td" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Fc +.Xc +Set the CPU affinity of a specified thread. +.It Xo +.Ft int +.Fn pthread_set_name_np "pthread_t thread" "char *name" +.Xc +Sets the specified thread's name. +.It Xo +.Ft int +.Fn pthread_setname_np "pthread_t thread" "char *name" +.Xc +Sets the specified thread's name. +.It Xo +.Ft int +.Fn pthread_single_np void +.Xc +Sets the thread's scheduling mode to single-threaded. +.It Xo +.Ft int +.Fn pthread_suspend_np "pthread_t tid" +.Xc +Suspend the specified thread. +.It Xo +.Ft int +.Fn pthread_suspend_all_np void +.Xc +Suspend all active threads. +.It Xo +.Ft int +.Fn pthread_switch_add_np "pthread_switch_routine_t routine" +.Xc +Install a routine that is called every time a thread context switches. +.It Xo +.Ft int +.Fn pthread_switch_delete_np "pthread_switch_routine_t routine" +.Xc +Remove a routine that is called every time a thread context switches. +.It Xo +.Ft int +.Fo pthread_timedjoin_np +.Fa "pthread_t thread" "void **value_ptr" "const struct timespec *abstime" +.Fc +.Xc +A variant of +.Fn pthread_join +with a timeout. +.El +.Ss Attribute Object Routines +.Bl -tag -width indent +.It Xo +.Ft int +.Fo pthread_attr_get_np +.Fa "pthread_t pid" "pthread_attr_t *dst" +.Fc +.Xc +Get the attributes of an existent thread. +.It Xo +.Ft int +.Fo pthread_attr_getaffinity_np +.Fa "const pthread_attr_t *pattr" "size_t cpusetsize" "cpuset_t *cpusetp" +.Fc +.Xc +Get the CPU affinity mask from the thread attribute object. +.It Xo +.Ft int +.Fo pthread_attr_setaffinity_np +.Fa "pthread_attr_t *pattr" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Fc +.Xc +Set the CPU affinity mask for the thread attribute object. +.It Xo +.Ft int +.Fn pthread_attr_setcreatesuspend_np "pthread_attr_t *attr" +.Xc +Permit creation of suspended threads. +.El +.Ss Mutex Routines +.Bl -tag -width indent +.It Xo +.Ft int +.Fn pthread_mutexattr_getkind_np "pthread_mutexattr_t attr" +.Xc +Deprecated, use +.Xr pthread_mutexattr_gettype 3 +instead. +.It Xo +.Ft int +.Fn pthread_mutexattr_setkind_np "pthread_mutexattr_t *attr" +.Xc +Deprecated, use +.Xr pthread_mutexattr_settype 3 +instead. +.El +.\" .Ss Condition Variable Routines +.\" .Bl -tag -width indent +.\" .El +.\" .Ss Read/Write Lock Routines +.\" .Bl -tag -width indent +.\" .El +.\" .Ss Per-Thread Context Routines +.\" .Bl -tag -width indent +.\" .El +.\" .Ss Cleanup Routines +.\" .Bl -tag -width indent +.\" .El +.Sh SEE ALSO +.Xr libthr 3 , +.Xr pthread 3 , +.Xr pthread_affinity_np 3 , +.Xr pthread_attr_affinity_np 3 , +.Xr pthread_attr_get_np 3 , +.Xr pthread_attr_setcreatesuspend_np 3 , +.Xr pthread_getthreadid_np 3 , +.Xr pthread_join 3 , +.Xr pthread_main_np 3 , +.Xr pthread_multi_np 3 , +.Xr pthread_mutexattr_getkind_np 3 , +.Xr pthread_resume_all_np 3 , +.Xr pthread_resume_np 3 , +.Xr pthread_set_name_np 3 , +.Xr pthread_suspend_all_np 3 , +.Xr pthread_suspend_np 3 , +.Xr pthread_switch_add_np 3 +.Sh STANDARDS +All of these functions are non-portable extensions to POSIX threads. diff --git a/share/man/man3/pthread_resume_all_np.3 b/share/man/man3/pthread_resume_all_np.3 index 0ac6736a9b74..40df03a07af1 100644 --- a/share/man/man3/pthread_resume_all_np.3 +++ b/share/man/man3/pthread_resume_all_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_RESUME_ALL_NP 3 .Os .Sh NAME @@ -43,6 +43,7 @@ function causes all active threads to be scanned and resumes those which were previously suspended. .Sh SEE ALSO .Xr pthread_attr_setcreatesuspend_np 3 , +.Xr pthread_np 3 , .Xr pthread_resume_np 3 , .Xr pthread_suspend_all_np 3 , .Xr pthread_suspend_np 3 diff --git a/share/man/man3/pthread_resume_np.3 b/share/man/man3/pthread_resume_np.3 index 898dbf9c0d11..16833872c010 100644 --- a/share/man/man3/pthread_resume_np.3 +++ b/share/man/man3/pthread_resume_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_RESUME_NP 3 .Os .Sh NAME @@ -64,6 +64,7 @@ argument. .El .Sh SEE ALSO .Xr pthread_attr_setcreatesuspend_np 3 , +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_suspend_all_np 3 , .Xr pthread_suspend_np 3 diff --git a/share/man/man3/pthread_set_name_np.3 b/share/man/man3/pthread_set_name_np.3 index af668165d91a..5fb627a5a182 100644 --- a/share/man/man3/pthread_set_name_np.3 +++ b/share/man/man3/pthread_set_name_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2020 +.Dd October 12, 2021 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME @@ -90,6 +90,7 @@ and functions, all errors that may appear inside are silently ignored. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr thr_set_name 2 .Sh STANDARDS .Fn pthread_set_name_np diff --git a/share/man/man3/pthread_suspend_all_np.3 b/share/man/man3/pthread_suspend_all_np.3 index ecedca3ee24d..2821c7360786 100644 --- a/share/man/man3/pthread_suspend_all_np.3 +++ b/share/man/man3/pthread_suspend_all_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd October 12, 2021 .Dt PTHREAD_SUSPEND_ALL_NP 3 .Os .Sh NAME @@ -52,6 +52,7 @@ function to use any non-async signal safe functions, besides until threads are resumed, unless measures are taken to ensure that all threads are suspended at safe points. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 , .Xr pthread_suspend_np 3 diff --git a/share/man/man3/pthread_suspend_np.3 b/share/man/man3/pthread_suspend_np.3 index ca8c72a38c52..58bcf56964b6 100644 --- a/share/man/man3/pthread_suspend_np.3 +++ b/share/man/man3/pthread_suspend_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd October 12, 2021 .Dt PTHREAD_SUSPEND_NP 3 .Os .Sh NAME @@ -69,6 +69,7 @@ No thread could be found corresponding to the thread ID specified by the argument. .El .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 , .Xr pthread_suspend_all_np 3 diff --git a/share/man/man3/pthread_switch_add_np.3 b/share/man/man3/pthread_switch_add_np.3 index e3400e790335..ddfa630ffd9a 100644 --- a/share/man/man3/pthread_switch_add_np.3 +++ b/share/man/man3/pthread_switch_add_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_SWITCH_ADD_NP 3 .Os .Sh NAME @@ -81,7 +81,8 @@ argument is different from the argument previously passed to the function. .El .Sh SEE ALSO -.Xr pthread_create 3 +.Xr pthread_create 3 , +.Xr pthread_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . From nobody Tue Oct 12 20:27:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C947817FC559; Tue, 12 Oct 2021 20:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTS085KfTz3FZn; Tue, 12 Oct 2021 20:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96AAB1ADEF; Tue, 12 Oct 2021 20:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CKRqL1027319; Tue, 12 Oct 2021 20:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CKRqRh027318; Tue, 12 Oct 2021 20:27:52 GMT (envelope-from git) Date: Tue, 12 Oct 2021 20:27:52 GMT Message-Id: <202110122027.19CKRqRh027318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 18dc12bfd2e2 - main - nvme: Restore hotplug warning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18dc12bfd2e23ad2ea97db54cb8ee499f6f014da Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=18dc12bfd2e23ad2ea97db54cb8ee499f6f014da commit 18dc12bfd2e23ad2ea97db54cb8ee499f6f014da Author: Warner Losh AuthorDate: 2021-10-12 20:25:16 +0000 Commit: Warner Losh CommitDate: 2021-10-12 20:26:54 +0000 nvme: Restore hotplug warning Restore hotplug warning in recovery state machine. No functional change other than what message gets printed. Sponsored by: Netflix --- sys/dev/nvme/nvme_qpair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 8041731099df..6669eeee6613 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1010,7 +1010,8 @@ again: * controller. */ nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n", - cfs ? " and fatal error status" : ""); + (csts == 0xffffffff) ? " and possible hot unplug" : + (cfs ? " and fatal error status" : "")); nvme_printf(ctrlr, "RECOVERY_WAITING\n"); qpair->recovery_state = RECOVERY_WAITING; nvme_ctrlr_reset(ctrlr); From nobody Tue Oct 12 21:03:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AEBCB1809944; Tue, 12 Oct 2021 21:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTSnH4VCFz3P9K; Tue, 12 Oct 2021 21:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B0F61B675; Tue, 12 Oct 2021 21:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CL3Vwl080553; Tue, 12 Oct 2021 21:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CL3VPk080552; Tue, 12 Oct 2021 21:03:31 GMT (envelope-from git) Date: Tue, 12 Oct 2021 21:03:31 GMT Message-Id: <202110122103.19CL3VPk080552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d1b6fef0751b - main - Stop creating socket aio kprocs during boot. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1b6fef0751b70819e632d7d4722efbc8f94b80b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d1b6fef0751b70819e632d7d4722efbc8f94b80b commit d1b6fef0751b70819e632d7d4722efbc8f94b80b Author: John Baldwin AuthorDate: 2021-10-12 21:03:07 +0000 Commit: John Baldwin CommitDate: 2021-10-12 21:03:07 +0000 Stop creating socket aio kprocs during boot. Create the initial pool of kprocs on demand when the first socket AIO request is submitted instead. The pool of kprocs used for other AIO requests is similarly created on first use. Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32468 --- sys/kern/sys_socket.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index d4200e5618d2..910da911b189 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -583,8 +583,6 @@ soaio_init(void) mtx_init(&soaio_jobs_lock, "soaio jobs", NULL, MTX_DEF); soaio_kproc_unr = new_unrhdr(1, INT_MAX, NULL); TASK_INIT(&soaio_kproc_task, 0, soaio_kproc_create, NULL); - if (soaio_target_procs > 0) - taskqueue_enqueue(taskqueue_thread, &soaio_kproc_task); } SYSINIT(soaio, SI_SUB_VFS, SI_ORDER_ANY, soaio_init, NULL); From nobody Tue Oct 12 21:27:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B5AC512D3989; Tue, 12 Oct 2021 21:27:48 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTTKH3TPgz3llv; Tue, 12 Oct 2021 21:27:47 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 19CLRSIM003836 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 12 Oct 2021 23:27:29 +0200 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 19CLRSRp000786; Tue, 12 Oct 2021 23:27:28 +0200 Date: Tue, 12 Oct 2021 23:27:28 +0200 From: Lutz Donnerhacke To: Gleb Smirnoff Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 25392fac9488 - main - libalias: Fix splay comparsion bug Message-ID: <20211012212728.GA390@belenus.iks-jena.de> References: <202107022232.162MWUIY049889@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4HTTKH3TPgz3llv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lutz@iks-jena.de designates 2001:4bd8::19 as permitted sender) smtp.mailfrom=lutz@iks-jena.de X-Spamd-Result: default: False [-1.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:4bd8::/48]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[donnerhacke.de]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_SHORT(0.60)[0.598]; FORGED_SENDER(0.30)[lutz@donnerhacke.de,lutz@iks-jena.de]; RCVD_IN_DNSWL_LOW(-0.10)[2001:4bd8:0:666:248:54ff:fe12:ee3f:received]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15725, ipnet:2001:4bd8::/29, country:DE]; FROM_NEQ_ENVFROM(0.00)[lutz@donnerhacke.de,lutz@iks-jena.de]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On Fri, Aug 06, 2021 at 08:00:39AM -0700, Gleb Smirnoff wrote: > Wouldn't declaring 'i' to u_short fix the root of the problem? Oh, I missed this mail. No, switching to a different "zero" in the ring of modular operations, does not fix the inherent problem of the space needed for all possible results. The arithmetic of subtraction may generate results from -x to +x, if x is the largest possible value (according to some "zero") in the source distribution using n bits. Hence you need at least more than one bit in the result type (a single bit is not sufficient, you have to deal with 2^n+1 values). Because the type, we are operation on, is 32bit, the result type needs to be at least 34bit. This needs to propagate down into the algorithm. You have to avoid any implicit integer type conversion at any cost. Otherwise the modular arithmetic error will kick in again. In order to simplify the operation for the reader, and to avoid to repeat the mistakes, I already made, I choosed to make the comparsions explicit. > > On Fri, Jul 02, 2021 at 10:32:30PM +0000, Lutz Donnerhacke wrote: > L> The branch main has been updated by donner: > L> > L> URL: https://cgit.FreeBSD.org/src/commit/?id=25392fac9488bcae5c451500df2e2945430484a6 > L> > L> commit 25392fac9488bcae5c451500df2e2945430484a6 > L> Author: Lutz Donnerhacke > L> AuthorDate: 2021-07-02 21:41:25 +0000 > L> Commit: Lutz Donnerhacke > L> CommitDate: 2021-07-02 22:31:53 +0000 > L> > L> libalias: Fix splay comparsion bug > L> > L> Comparing elements in a tree requires transitiviy. If a < b and b < c > L> then a must be smaller than c. This way the tree elements are always > L> pairwise comparable. > L> > L> Tristate comparsion functions returning values lower, equal, or > L> greater than zero, are usually implemented by a simple subtraction of > L> the operands. If the size of the operands are equal to the size of > L> the result, integer modular arithmetics kick in and violates the > L> transitivity. > L> > L> Example: > L> Working on byte with 0, 120, and 240. Now computing the differences: > L> 120 - 0 = 120 > L> 240 - 120 = 120 > L> 240 - 0 = -16 > L> > L> MFC after: 3 days > L> sys/netinet/libalias/alias_db.h | 13 +++++++------ > L> 1 file changed, 7 insertions(+), 6 deletions(-) > L> > L> diff --git a/sys/netinet/libalias/alias_db.h b/sys/netinet/libalias/alias_db.h > L> index ec0b69c01f82..971ca305c1a6 100644 > L> --- a/sys/netinet/libalias/alias_db.h > L> +++ b/sys/netinet/libalias/alias_db.h > L> @@ -351,10 +351,10 @@ static inline int > L> cmp_out(struct alias_link *a, struct alias_link *b) { > L> int i = a->src_port - b->src_port; > L> if (i != 0) return (i); > L> - i = a->src_addr.s_addr - b->src_addr.s_addr; > L> - if (i != 0) return (i); > L> - i = a->dst_addr.s_addr - b->dst_addr.s_addr; > L> - if (i != 0) return (i); > L> + if (a->src_addr.s_addr > b->src_addr.s_addr) return (1); > L> + if (a->src_addr.s_addr < b->src_addr.s_addr) return (-1); > L> + if (a->dst_addr.s_addr > b->dst_addr.s_addr) return (1); > L> + if (a->dst_addr.s_addr < b->dst_addr.s_addr) return (-1); > L> i = a->dst_port - b->dst_port; > L> if (i != 0) return (i); > L> i = a->link_type - b->link_type; > L> @@ -368,8 +368,9 @@ cmp_in(struct group_in *a, struct group_in *b) { > L> if (i != 0) return (i); > L> i = a->link_type - b->link_type; > L> if (i != 0) return (i); > L> - i = a->alias_addr.s_addr - b->alias_addr.s_addr; > L> - return (i); > L> + if (a->alias_addr.s_addr > b->alias_addr.s_addr) return (1); > L> + if (a->alias_addr.s_addr < b->alias_addr.s_addr) return (-1); > L> + return (0); > L> } > L> SPLAY_PROTOTYPE(splay_in, group_in, in, cmp_in); > L> > > -- > Gleb Smirnoff From nobody Tue Oct 12 23:45:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6DCB81803099; Tue, 12 Oct 2021 23:45:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTXNQ1NfJz4s0D; Tue, 12 Oct 2021 23:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E7821D7A3; Tue, 12 Oct 2021 23:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CNjfX5093121; Tue, 12 Oct 2021 23:45:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CNjfYo093120; Tue, 12 Oct 2021 23:45:41 GMT (envelope-from git) Date: Tue, 12 Oct 2021 23:45:41 GMT Message-Id: <202110122345.19CNjfYo093120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 19e008e7f79c - main - crt_malloc: Be more persistent when handling mmap() failure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19e008e7f79ce55182d227be8513b3fa520471d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=19e008e7f79ce55182d227be8513b3fa520471d8 commit 19e008e7f79ce55182d227be8513b3fa520471d8 Author: Konstantin Belousov AuthorDate: 2021-10-11 16:13:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-12 23:37:09 +0000 crt_malloc: Be more persistent when handling mmap() failure In the situation with limited address space, together with fragmentation, it is possible for mmap() request in morecore() to fail when asking for required size + NPOOLPAGES, but succeed without the addend. Retry allocation there. PR: 259076 Reported by: Denis Koreshkov Reviewed by: arichardson Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32474 --- libexec/rtld-elf/rtld_malloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index f22c3c727c73..64218b5bb786 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -184,7 +184,9 @@ morecore(int bucket) nblks = 1; } if (amt > pagepool_end - pagepool_start) - if (morepages(amt/pagesz + NPOOLPAGES) == 0) + if (morepages(amt / pagesz + NPOOLPAGES) == 0 && + /* Retry with min required size */ + morepages(amt / pagesz) == 0) return; op = (union overhead *)pagepool_start; pagepool_start += amt; @@ -269,6 +271,8 @@ morepages(int n) } } + if (pagepool_start == MAP_FAILED) + pagepool_start = 0; offset = (uintptr_t)pagepool_start - rounddown2( (uintptr_t)pagepool_start, pagesz); From nobody Tue Oct 12 23:45:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6DDB11802DB8; Tue, 12 Oct 2021 23:45:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTXNQ13Xcz4sFR; Tue, 12 Oct 2021 23:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58E6B1D7A2; Tue, 12 Oct 2021 23:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CNjeKk093097; Tue, 12 Oct 2021 23:45:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CNjd7Y093096; Tue, 12 Oct 2021 23:45:39 GMT (envelope-from git) Date: Tue, 12 Oct 2021 23:45:39 GMT Message-Id: <202110122345.19CNjd7Y093096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0b72d2965d68 - main - crt_malloc: use uintptr_t instead of long for arithmetic on addresses List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b72d2965d68113bce16f6cccea77257283ef0a7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b72d2965d68113bce16f6cccea77257283ef0a7 commit 0b72d2965d68113bce16f6cccea77257283ef0a7 Author: Konstantin Belousov AuthorDate: 2021-10-12 21:39:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-12 23:37:09 +0000 crt_malloc: use uintptr_t instead of long for arithmetic on addresses and avoid unneeded casts Reviewed by: arichardson (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32474 --- libexec/rtld-elf/rtld_malloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index 6604aa7201f8..f22c3c727c73 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -259,7 +259,7 @@ morepages(int n) int offset; if (pagepool_end - pagepool_start > pagesz) { - addr = (caddr_t)roundup2((long)pagepool_start, pagesz); + addr = roundup2(pagepool_start, pagesz); if (munmap(addr, pagepool_end - addr) != 0) { #ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": " @@ -269,8 +269,8 @@ morepages(int n) } } - offset = (long)pagepool_start - rounddown2((long)pagepool_start, - pagesz); + offset = (uintptr_t)pagepool_start - rounddown2( + (uintptr_t)pagepool_start, pagesz); pagepool_start = mmap(0, n * pagesz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); From nobody Wed Oct 13 00:24:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 379A9180F3C5; Wed, 13 Oct 2021 00:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTYFB11sLz3KGD; Wed, 13 Oct 2021 00:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045891E024; Wed, 13 Oct 2021 00:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19D0OTTZ046602; Wed, 13 Oct 2021 00:24:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19D0OTod046601; Wed, 13 Oct 2021 00:24:29 GMT (envelope-from git) Date: Wed, 13 Oct 2021 00:24:29 GMT Message-Id: <202110130024.19D0OTod046601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: b82168e657d3 - main - nfscl: Fix another deadlock related to the NFSv4 clientID lock List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b82168e657d378ff86ea18c4f03b98aac9ee9bb3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b82168e657d378ff86ea18c4f03b98aac9ee9bb3 commit b82168e657d378ff86ea18c4f03b98aac9ee9bb3 Author: Rick Macklem AuthorDate: 2021-10-13 00:21:01 +0000 Commit: Rick Macklem CommitDate: 2021-10-13 00:21:01 +0000 nfscl: Fix another deadlock related to the NFSv4 clientID lock Without this patch, it is possible to hang the NFSv4 client, when a rename/remove is being done on a file where the client holds a delegation, if pNFS is being used. For a delegation to be returned, dirty data blocks must be flushed to the NFSv4 server. When pNFS is in use, a shared lock on the clientID must be acquired while doing a write to the DS(s). However, if rename/remove is doing the delegation return an exclusive lock will be acquired on the clientID, preventing the write to the DS(s) from acquiring a shared lock on the clientID. This patch stops rename/remove from doing a delegation return if pNFS is enabled. Since doing delegation return in the same compound as rename/remove is only an optimization, not doing so should not cause problems. This problem was detected during a recent NFSv4 interoperability testing event held by the IETF working group. MFC after: 1 week --- sys/fs/nfsclient/nfs_clstate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 6be06b556de8..9a7a879fffd3 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -4607,6 +4607,8 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; nmp = VFSTONFS(vp->v_mount); + if (NFSHASPNFS(nmp)) + return (retcnt); NFSLOCKMNT(nmp); if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { NFSUNLOCKMNT(nmp); @@ -4712,6 +4714,8 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, nmp = VFSTONFS(fvp->v_mount); *gotfdp = 0; *gottdp = 0; + if (NFSHASPNFS(nmp)) + return (retcnt); NFSLOCKCLSTATE(); /* * Loop around waiting for: From nobody Wed Oct 13 00:42:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C1EBE17EFFED; Wed, 13 Oct 2021 00:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTYdX3nhLz3QNW; Wed, 13 Oct 2021 00:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 582AC1E517; Wed, 13 Oct 2021 00:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19D0g8VJ073177; Wed, 13 Oct 2021 00:42:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19D0g8mK073176; Wed, 13 Oct 2021 00:42:08 GMT (envelope-from git) Date: Wed, 13 Oct 2021 00:42:08 GMT Message-Id: <202110130042.19D0g8mK073176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ba7f9c1b6132 - main - rtld direct exec: add -d option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba7f9c1b61329630af25e75cdaca261b389318c7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ba7f9c1b61329630af25e75cdaca261b389318c7 commit ba7f9c1b61329630af25e75cdaca261b389318c7 Author: Konstantin Belousov AuthorDate: 2021-10-11 22:26:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-13 00:41:48 +0000 rtld direct exec: add -d option to ignore lack of execute permission on the binary. The check is a bad security theatre anyway. Reviewed by: arichardson, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32464 --- libexec/rtld-elf/rtld.1 | 6 ++++++ libexec/rtld-elf/rtld.c | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 8bc4cfade070..187dc105667a 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -330,6 +330,7 @@ The syntax of the direct invocation is .Bd -ragged -offset indent .Pa /libexec/ld-elf.so.1 .Op Fl b Ar exe +.Op Fl d .Op Fl f Ar fd .Op Fl p .Op Fl u @@ -352,6 +353,8 @@ If this option is specified, is only used to provide the .Va argv[0] value to the program. +.It Fl d +Turn off the emulation of the binary execute permission. .It Fl f Ar fd File descriptor .Ar fd @@ -403,6 +406,9 @@ ignores and is naturally prone to race conditions. Environments which rely on such restrictions are weak and breakable on their own. +It can be turned off with the +.Fl d +option. .Sh VERSIONING Newer .Nm diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1a89a7b2c1de..6c304f98253a 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -140,7 +140,7 @@ static void objlist_remove(Objlist *, Obj_Entry *); static int open_binary_fd(const char *argv0, bool search_in_path, const char **binpath_res); static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, - const char **argv0); + const char **argv0, bool *dir_ignore); static int parse_integer(const char *); static void *path_enumerate(const char *, path_enum_proc, const char *, void *); static void print_usage(const char *argv0); @@ -503,7 +503,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) #ifdef __powerpc__ int old_auxv_format = 1; #endif - bool dir_enable, direct_exec, explicit_fd, search_in_path; + bool dir_enable, dir_ignore, direct_exec, explicit_fd, search_in_path; /* * On entry, the dynamic linker itself has not been relocated yet. @@ -589,7 +589,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) dbg("opening main program in direct exec mode"); if (argc >= 2) { - rtld_argc = parse_args(argv, argc, &search_in_path, &fd, &argv0); + rtld_argc = parse_args(argv, argc, &search_in_path, &fd, + &argv0, &dir_ignore); explicit_fd = (fd != -1); binpath = NULL; if (!explicit_fd) @@ -621,7 +622,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) } else if ((st.st_mode & S_IXOTH) != 0) { dir_enable = true; } - if (!dir_enable) { + if (!dir_enable && !dir_ignore) { _rtld_error("No execute permission for binary %s", argv0); rtld_die(); @@ -5842,7 +5843,7 @@ open_binary_fd(const char *argv0, bool search_in_path, */ static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, - const char **argv0) + const char **argv0, bool *dir_ignore) { const char *arg; char machine[64]; @@ -5854,6 +5855,7 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, dbg("Parsing command-line arguments"); *use_pathp = false; *fdp = -1; + *dir_ignore = false; seen_b = seen_f = false; for (i = 1; i < argc; i++ ) { @@ -5890,6 +5892,9 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, *argv0 = argv[i]; seen_b = true; break; + } else if (opt == 'd') { + *dir_ignore = true; + break; } else if (opt == 'f') { if (seen_b) { _rtld_error("Both -b and -f specified"); @@ -5988,11 +5993,12 @@ print_usage(const char *argv0) { rtld_printf( - "Usage: %s [-h] [-b ] [-f ] [-p] [--] []\n" + "Usage: %s [-h] [-b ] [-d] [-f ] [-p] [--] []\n" "\n" "Options:\n" " -h Display this help message\n" " -b Execute instead of , arg0 is \n" + " -d Ignore lack of exec permissions for the binary\n" " -f Execute instead of searching for \n" " -p Search in PATH for named binary\n" " -u Ignore LD_ environment variables\n" From nobody Wed Oct 13 00:47:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9037D17F3655; Wed, 13 Oct 2021 00:47:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTYlk2jpXz3jG6; Wed, 13 Oct 2021 00:47:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 308DF1E260; Wed, 13 Oct 2021 00:47:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19D0lUqh073719; Wed, 13 Oct 2021 00:47:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19D0lUS0073718; Wed, 13 Oct 2021 00:47:30 GMT (envelope-from git) Date: Wed, 13 Oct 2021 00:47:30 GMT Message-Id: <202110130047.19D0lUS0073718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: 6882064d0ced - main - acpi(4): Correct outdated sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6882064d0ced456c89d161da4bc43c5d97bab60b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6882064d0ced456c89d161da4bc43c5d97bab60b commit 6882064d0ced456c89d161da4bc43c5d97bab60b Author: Felix Johnson AuthorDate: 2021-10-13 00:42:14 +0000 Commit: Guangyuan Yang CommitDate: 2021-10-13 00:47:03 +0000 acpi(4): Correct outdated sysctl This changes the location of cx_supported sysctl to dev.cpu.N. PR: 214370 MFC after: 3 days --- share/man/man4/acpi.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index 60d77843b340..e7265654839a 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2021 +.Dd October 12, 2021 .Dt ACPI 4 .Os .Sh NAME @@ -86,7 +86,7 @@ should be set to .Li acpi if it is listed in .Va machdep.idle_available . -.It Va hw.acpi.cpu.cx_supported +.It Va dev.cpu.N.cx_supported List of supported CPU idle states and their transition latency in microseconds. Each state has a type (e.g., From nobody Wed Oct 13 06:40:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7B38217FE397; Wed, 13 Oct 2021 06:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTjZm2vPWz3N2l; Wed, 13 Oct 2021 06:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42A9C22F21; Wed, 13 Oct 2021 06:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19D6eGiV048848; Wed, 13 Oct 2021 06:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19D6eGT3048843; Wed, 13 Oct 2021 06:40:16 GMT (envelope-from git) Date: Wed, 13 Oct 2021 06:40:16 GMT Message-Id: <202110130640.19D6eGT3048843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: f656df586ad1 - main - bhyve: Update usage and synopsis for the -k flag List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f656df586ad1aa86a2b9f076a224f746d5308613 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f656df586ad1aa86a2b9f076a224f746d5308613 commit f656df586ad1aa86a2b9f076a224f746d5308613 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-12 19:49:43 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-13 06:39:57 +0000 bhyve: Update usage and synopsis for the -k flag Let's make it clear to users that -k is for configuration files. Also, point to bhyve_config(5) in the paragraph describing the flag. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32467 --- usr.sbin/bhyve/bhyve.8 | 9 ++++++--- usr.sbin/bhyve/bhyverun.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 17d58d29b780..3b7bf6b65467 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2021 +.Dd October 13, 2021 .Dt BHYVE 8 .Os .Sh NAME @@ -53,7 +53,7 @@ .Ar port .Sm on .Oc -.Op Fl k Ar file +.Op Fl k Ar config_file .Oo Fl l .Sm off .Ar lpcdev Op Cm \&, Ar conf @@ -168,7 +168,7 @@ Yield the virtual CPU thread when a HLT instruction is detected. If this option is not specified, virtual CPUs will use 100% of a host CPU. .It Fl h Print help message and exit. -.It Fl k Ar file +.It Fl k Ar config_file Set configuration variables from a simple, key-value config file. Each line of the config file is expected to consist of a config variable name, an equals sign @@ -179,6 +179,9 @@ value. Blank lines and lines starting with .Sq # are ignored. +See +.Xr bhyve_config 5 +for more details. .It Fl l Cm help Print a list of supported LPC devices. .It Fl l Ar lpcdev Ns Op Cm \&, Ns Ar conf diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index a5645f645289..c38a4ee84056 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -224,7 +224,7 @@ usage(int code) fprintf(stderr, "Usage: %s [-AaCDeHhPSuWwxY]\n" " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" - " %*s [-G port] [-k file] [-l lpc] [-m mem] [-o var=value]\n" + " %*s [-G port] [-k config_file] [-l lpc] [-m mem] [-o var=value]\n" " %*s [-p vcpu:hostcpu] [-r file] [-s pci] [-U uuid] vmname\n" " -A: create ACPI tables\n" " -a: local apic is in xAPIC mode (deprecated)\n" From nobody Wed Oct 13 07:54:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5242517FD368; Wed, 13 Oct 2021 07:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTlDq19wcz4S6Z; Wed, 13 Oct 2021 07:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE10223BF1; Wed, 13 Oct 2021 07:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19D7soiR049457; Wed, 13 Oct 2021 07:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19D7so0V049456; Wed, 13 Oct 2021 07:54:50 GMT (envelope-from git) Date: Wed, 13 Oct 2021 07:54:50 GMT Message-Id: <202110130754.19D7so0V049456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hartmut Brandt Subject: git: ded77e0237a8 - main - Allow the BPF to be select for write. This is needed for boost:asio which otherwise fails to handle BPFs. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D31967 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: harti X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ded77e0237a8534230746031f373d8a8ae80cdaa Auto-Submitted: auto-generated X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by harti: URL: https://cgit.FreeBSD.org/src/commit/?id=ded77e0237a8534230746031f373d8a8ae80cdaa commit ded77e0237a8534230746031f373d8a8ae80cdaa Author: Hartmut Brandt AuthorDate: 2021-10-10 15:03:51 +0000 Commit: Hartmut Brandt CommitDate: 2021-10-10 15:03:51 +0000 Allow the BPF to be select for write. This is needed for boost:asio which otherwise fails to handle BPFs. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D31967 --- lib/libc/sys/kqueue.2 | 9 +++++++-- sys/net/bpf.c | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index f80c89f75d78..68929e973dc0 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2021 +.Dd October 12, 2021 .Dt KQUEUE 2 .Os .Sh NAME @@ -378,7 +378,7 @@ The filter will set .Dv EV_EOF when the reader disconnects, and for the fifo case, this will be cleared when a new reader connects. -Note that this filter is not supported for vnodes or BPF devices. +Note that this filter is not supported for vnodes. .Pp For sockets, the low water mark and socket error handling is identical to the @@ -389,6 +389,11 @@ For eventfds, .Va data will contain the maximum value that can be added to the counter without blocking. +.Pp +For BPF devices, the filter always indicates that it is possible to +write and +.Va data +will contain the MTU size of the underlying interface. .It Dv EVFILT_EMPTY Takes a descriptor as the identifier, and returns whenever there is no remaining data in the write buffer. diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 77c85cc91aae..ce7aba5a9bcd 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -213,6 +213,7 @@ static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *); static int bpf_setdlt(struct bpf_d *, u_int); static void filt_bpfdetach(struct knote *); static int filt_bpfread(struct knote *, long); +static int filt_bpfwrite(struct knote *, long); static void bpf_drvinit(void *); static int bpf_stats_sysctl(SYSCTL_HANDLER_ARGS); @@ -257,6 +258,12 @@ static struct filterops bpfread_filtops = { .f_event = filt_bpfread, }; +static struct filterops bpfwrite_filtops = { + .f_isfd = 1, + .f_detach = filt_bpfdetach, + .f_event = filt_bpfwrite, +}; + /* * LOCKING MODEL USED BY BPF * @@ -2158,16 +2165,27 @@ bpfkqfilter(struct cdev *dev, struct knote *kn) { struct bpf_d *d; - if (devfs_get_cdevpriv((void **)&d) != 0 || - kn->kn_filter != EVFILT_READ) + if (devfs_get_cdevpriv((void **)&d) != 0) return (1); + switch (kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &bpfread_filtops; + break; + + case EVFILT_WRITE: + kn->kn_fop = &bpfwrite_filtops; + break; + + default: + return (1); + } + /* * Refresh PID associated with this descriptor. */ BPFD_LOCK(d); BPF_PID_REFRESH_CUR(d); - kn->kn_fop = &bpfread_filtops; kn->kn_hook = d; knlist_add(&d->bd_sel.si_note, kn, 1); BPFD_UNLOCK(d); @@ -2207,6 +2225,17 @@ filt_bpfread(struct knote *kn, long hint) return (ready); } +static int +filt_bpfwrite(struct knote *kn, long hint) +{ + struct bpf_d *d = (struct bpf_d *)kn->kn_hook; + BPFD_LOCK_ASSERT(d); + + kn->kn_data = d->bd_bif->bif_ifp->if_mtu; + + return (1); +} + #define BPF_TSTAMP_NONE 0 #define BPF_TSTAMP_FAST 1 #define BPF_TSTAMP_NORMAL 2 From nobody Wed Oct 13 09:41:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CD24F180D070; Wed, 13 Oct 2021 09:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTncD5PFBz55hZ; Wed, 13 Oct 2021 09:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 998B925545; Wed, 13 Oct 2021 09:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19D9fmfo096523; Wed, 13 Oct 2021 09:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19D9fmfG096522; Wed, 13 Oct 2021 09:41:48 GMT (envelope-from git) Date: Wed, 13 Oct 2021 09:41:48 GMT Message-Id: <202110130941.19D9fmfG096522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: e2e2c622c35f - main - native-xtools: avoid libllvm while populating the sysroot List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2e2c622c35f3e54dbae88e3de3e48c51dbb4ebd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e2e2c622c35f3e54dbae88e3de3e48c51dbb4ebd commit e2e2c622c35f3e54dbae88e3de3e48c51dbb4ebd Author: Kyle Evans AuthorDate: 2021-10-13 09:21:28 +0000 Commit: Kyle Evans CommitDate: 2021-10-13 09:41:17 +0000 native-xtools: avoid libllvm while populating the sysroot Prior to 021385aba562, MK_CLANG=no was sufficient to avoid descending into lib/clang, but the referenced change added a couple of other enabling knobs. Turn those off, too, to continue avoiding libllvm. With this change, we no longer end up with a libllvm using the wrong default target triple; `poudriere jail -cx` works once again. Reported by: bhughes, imp, probably others Fixes: 021385aba562 ("Add WITH_LLVM_BINUTILS to install LLVM ...") --- Makefile.inc1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 9b81d4029608..86d2fe58a0d8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2796,6 +2796,10 @@ NXBMAKEARGS+= \ NXBMAKEENV+= \ MAKEOBJDIRPREFIX= +# This should match all of the knobs in lib/Makefile that it takes to avoid +# descending into lib/clang! +NXBTNOTOOLS= MK_CLANG=no MK_LLD=no MK_LLDB=no MK_LLVM_BINUTILS=no + .if make(native-xtools*) && \ (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) .error Missing NXB_TARGET / NXB_TARGET_ARCH @@ -2835,11 +2839,11 @@ native-xtools: .PHONY # Populate includes/libraries sysroot that produce native binaries. # This is split out from 'toolchain' above mostly so that target LLVM # libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without - # polluting the cross-compiler build. The LLVM/GCC libs are skipped + # polluting the cross-compiler build. The LLVM libs are skipped # here to avoid the problem but are kept in 'toolchain' so that # needed build tools are built. - ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no - ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no + ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes ${NXBTNOTOOLS} + ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries ${NXBTNOTOOLS} .if !defined(NO_OBJWALK) ${_+_}cd ${.CURDIR}; ${NXBMAKE} _obj .endif From nobody Wed Oct 13 10:05:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 333BD17F78C8; Wed, 13 Oct 2021 10:05:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTp850jVmz3Dmq; Wed, 13 Oct 2021 10:05:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD47D25E85; Wed, 13 Oct 2021 10:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DA5ugi023770; Wed, 13 Oct 2021 10:05:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DA5udg023769; Wed, 13 Oct 2021 10:05:56 GMT (envelope-from git) Date: Wed, 13 Oct 2021 10:05:56 GMT Message-Id: <202110131005.19DA5udg023769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 776df104fa54 - main - pf: Introduce pf_nvbool() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 776df104fa54bb581e1fb88ac44af4fa7fd4052b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=776df104fa54bb581e1fb88ac44af4fa7fd4052b commit 776df104fa54bb581e1fb88ac44af4fa7fd4052b Author: Kristof Provost AuthorDate: 2021-10-13 09:00:46 +0000 Commit: Kristof Provost CommitDate: 2021-10-13 10:01:09 +0000 pf: Introduce pf_nvbool() Similar to the existing functions for strings and ints, this lets us simplify some of the nvlist conversion code. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_nv.c | 14 ++++++++++++-- sys/netpfil/pf/pf_nv.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 73f0c55a7a21..933603066e21 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -99,6 +99,17 @@ __FBSDID("$FreeBSD$"); } \ } +int +pf_nvbool(const nvlist_t *nvl, const char *name, bool *val) +{ + if (! nvlist_exists_bool(nvl, name)) + return (EINVAL); + + *val = nvlist_get_bool(nvl, name); + + return (0); +} + int pf_nvbinary(const nvlist_t *nvl, const char *name, void *data, size_t expected_size) @@ -844,8 +855,7 @@ pf_nvstate_kill_to_kstate_kill(const nvlist_t *nvl, sizeof(kill->psk_ifname))); PFNV_CHK(pf_nvstring(nvl, "label", kill->psk_label, sizeof(kill->psk_label))); - if (nvlist_exists_bool(nvl, "kill_match")) - kill->psk_kill_match = nvlist_get_bool(nvl, "kill_match"); + PFNV_CHK(pf_nvbool(nvl, "kill_match", &kill->psk_kill_match)); errout: return (error); diff --git a/sys/netpfil/pf/pf_nv.h b/sys/netpfil/pf/pf_nv.h index 8a46aae326a6..cb6e75cb7008 100644 --- a/sys/netpfil/pf/pf_nv.h +++ b/sys/netpfil/pf/pf_nv.h @@ -69,6 +69,7 @@ PF_NV_DEF_UINT(uint16, uint16_t, UINT16_MAX); PF_NV_DEF_UINT(uint32, uint32_t, UINT32_MAX); PF_NV_DEF_UINT(uint64, uint64_t, UINT64_MAX); +int pf_nvbool(const nvlist_t *, const char *, bool *); int pf_nvbinary(const nvlist_t *, const char *, void *, size_t); int pf_nvint(const nvlist_t *, const char *, int *); int pf_nvstring(const nvlist_t *, const char *, char *, size_t); From nobody Wed Oct 13 12:42:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EB0E1180E957; Wed, 13 Oct 2021 12:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTscz6JQrz4gQ5; Wed, 13 Oct 2021 12:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B85C227B67; Wed, 13 Oct 2021 12:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DCghPN036912; Wed, 13 Oct 2021 12:42:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DCghdV036911; Wed, 13 Oct 2021 12:42:43 GMT (envelope-from git) Date: Wed, 13 Oct 2021 12:42:43 GMT Message-Id: <202110131242.19DCghdV036911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: d0f0e0bd741a - main - rtld: Do not install libmap.conf when installing the COMPAT32 version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0f0e0bd741af867582ceede8ac1b0aec90eae2d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d0f0e0bd741af867582ceede8ac1b0aec90eae2d commit d0f0e0bd741af867582ceede8ac1b0aec90eae2d Author: Emmanuel Vadot AuthorDate: 2021-10-13 12:40:26 +0000 Commit: Emmanuel Vadot CommitDate: 2021-10-13 12:42:08 +0000 rtld: Do not install libmap.conf when installing the COMPAT32 version This has the effect of installing the same file twice at the same location and confuse pkgbase as we add this file twice in the package config part. MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG --- libexec/rtld-elf/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index db1bf70ca59e..1f3df176992a 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -14,7 +14,9 @@ MK_ASAN= no MK_SSP= no MK_UBSAN= no +.if !defined(NEED_COMPAT) CONFS= libmap.conf +.endif PROG?= ld-elf.so.1 .if (${PROG:M*ld-elf32*} != "") TAGS+= lib32 From nobody Wed Oct 13 13:37:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8260518076A9; Wed, 13 Oct 2021 13:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTtrM35Dfz3Dxr; Wed, 13 Oct 2021 13:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BC78284F4; Wed, 13 Oct 2021 13:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DDbd2C005234; Wed, 13 Oct 2021 13:37:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DDbd92005233; Wed, 13 Oct 2021 13:37:39 GMT (envelope-from git) Date: Wed, 13 Oct 2021 13:37:39 GMT Message-Id: <202110131337.19DDbd92005233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 03d5820f738d - main - mount: Check for !VDIR mount points before handling -o emptydir List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03d5820f738de130b2feb66833f18741b7f92a14 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=03d5820f738de130b2feb66833f18741b7f92a14 commit 03d5820f738de130b2feb66833f18741b7f92a14 Author: Mark Johnston AuthorDate: 2021-10-13 00:11:02 +0000 Commit: Mark Johnston CommitDate: 2021-10-13 13:33:35 +0000 mount: Check for !VDIR mount points before handling -o emptydir To implement -o emptydir, vfs_emptydir() checks that the passed directory is empty. This should be done after checking whether the vnode is of type VDIR, though, or vfs_emptydir() may end up calling VOP_READDIR on a non-directory. Reported by: syzbot+4006732c69fb0f792b2c@syzkaller.appspotmail.com Reviewed by: kib, imp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32475 --- sys/kern/vfs_mount.c | 10 ++-------- sys/kern/vfs_subr.c | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 55c62b7fe491..2fc98d3cc6c8 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1095,14 +1095,6 @@ vfs_domount_first( ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here")); - if ((fsflags & MNT_EMPTYDIR) != 0) { - error = vfs_emptydir(vp); - if (error != 0) { - vput(vp); - return (error); - } - } - /* * If the jail of the calling thread lacks permission for this type of * file system, or is trying to cover its own root, deny immediately. @@ -1124,6 +1116,8 @@ vfs_domount_first( error = vinvalbuf(vp, V_SAVE, 0, 0); if (error == 0 && vp->v_type != VDIR) error = ENOTDIR; + if (error == 0 && (fsflags & MNT_EMPTYDIR) != 0) + error = vfs_emptydir(vp); if (error == 0) { VI_LOCK(vp); if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index d4b7ac71eb97..181d0004e940 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6300,6 +6300,7 @@ vfs_emptydir(struct vnode *vp) eof = 0; ASSERT_VOP_LOCKED(vp, "vfs_emptydir"); + VNASSERT(vp->v_type == VDIR, vp, ("vp is not a directory")); dirent = malloc(sizeof(struct dirent), M_TEMP, M_WAITOK); iov.iov_base = dirent; From nobody Wed Oct 13 16:07:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 12A5A17FEAF9; Wed, 13 Oct 2021 16:07:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTy8x4lpMz4njm; Wed, 13 Oct 2021 16:07:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 19DG70T4012708 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 13 Oct 2021 19:07:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 19DG70T4012708 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 19DG70kM012707; Wed, 13 Oct 2021 19:07:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 13 Oct 2021 19:07:00 +0300 From: Konstantin Belousov To: Emmanuel Vadot Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d0f0e0bd741a - main - rtld: Do not install libmap.conf when installing the COMPAT32 version Message-ID: References: <202110131242.19DCghdV036911@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110131242.19DCghdV036911@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HTy8x4lpMz4njm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 13, 2021 at 12:42:43PM +0000, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d0f0e0bd741af867582ceede8ac1b0aec90eae2d > > commit d0f0e0bd741af867582ceede8ac1b0aec90eae2d > Author: Emmanuel Vadot > AuthorDate: 2021-10-13 12:40:26 +0000 > Commit: Emmanuel Vadot > CommitDate: 2021-10-13 12:42:08 +0000 > > rtld: Do not install libmap.conf when installing the COMPAT32 version > > This has the effect of installing the same file twice at the same location > and confuse pkgbase as we add this file twice in the package config part. > > MFC after: 1 week > Sponsored by: Beckhoff Automation GmbH & Co. KG > --- > libexec/rtld-elf/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile > index db1bf70ca59e..1f3df176992a 100644 > --- a/libexec/rtld-elf/Makefile > +++ b/libexec/rtld-elf/Makefile > @@ -14,7 +14,9 @@ MK_ASAN= no > MK_SSP= no > MK_UBSAN= no > > +.if !defined(NEED_COMPAT) > CONFS= libmap.conf > +.endif > PROG?= ld-elf.so.1 > .if (${PROG:M*ld-elf32*} != "") > TAGS+= lib32 ld-elf32.so.1 tries to read /etc/libmap32.conf AFAIR. I think the Makefile should install the file under that name, for compat. From nobody Wed Oct 13 16:18:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F084C1803A35; Wed, 13 Oct 2021 16:18:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTyQ32nwwz4rnP; Wed, 13 Oct 2021 16:18:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1634141908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/ImjhhFoIgXbbUdAhRdq3B3N/OVRYMni3UkDiElzPqY=; b=opwVU1VXksOjVTKiG7h1FNEq40LX/APIzEmuHR+KUjjqJg5swKlofscO2+rpBk53ryekHW WxGsGFNkzlZeERaHHxD7ZwKnWv3/fE33xx0FWelvpxG8rcMWSKNVOHMzHC7nkCS188Eoij Mf4NatDVt5s7r0nDV2oEs+6DkEMCy/I= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id f32b7d0b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 13 Oct 2021 16:18:28 +0000 (UTC) Date: Wed, 13 Oct 2021 18:18:28 +0200 From: Emmanuel Vadot To: Konstantin Belousov Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d0f0e0bd741a - main - rtld: Do not install libmap.conf when installing the COMPAT32 version Message-Id: <20211013181828.36426fe37f41cebbd3a381d5@bidouilliste.com> In-Reply-To: References: <202110131242.19DCghdV036911@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HTyQ32nwwz4rnP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, 13 Oct 2021 19:07:00 +0300 Konstantin Belousov wrote: > On Wed, Oct 13, 2021 at 12:42:43PM +0000, Emmanuel Vadot wrote: > > The branch main has been updated by manu: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=d0f0e0bd741af867582ceede8ac1b0aec90eae2d > > > > commit d0f0e0bd741af867582ceede8ac1b0aec90eae2d > > Author: Emmanuel Vadot > > AuthorDate: 2021-10-13 12:40:26 +0000 > > Commit: Emmanuel Vadot > > CommitDate: 2021-10-13 12:42:08 +0000 > > > > rtld: Do not install libmap.conf when installing the COMPAT32 version > > > > This has the effect of installing the same file twice at the same location > > and confuse pkgbase as we add this file twice in the package config part. > > > > MFC after: 1 week > > Sponsored by: Beckhoff Automation GmbH & Co. KG > > --- > > libexec/rtld-elf/Makefile | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile > > index db1bf70ca59e..1f3df176992a 100644 > > --- a/libexec/rtld-elf/Makefile > > +++ b/libexec/rtld-elf/Makefile > > @@ -14,7 +14,9 @@ MK_ASAN= no > > MK_SSP= no > > MK_UBSAN= no > > > > +.if !defined(NEED_COMPAT) > > CONFS= libmap.conf > > +.endif > > PROG?= ld-elf.so.1 > > .if (${PROG:M*ld-elf32*} != "") > > TAGS+= lib32 > > ld-elf32.so.1 tries to read /etc/libmap32.conf AFAIR. > I think the Makefile should install the file under that name, for compat. Indeed it does, but since this file just include the ones in /usr/local/etc/libmap.d regardless of the arch that could cause problems to have the same content no ? -- Emmanuel Vadot From nobody Wed Oct 13 16:22:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B033E1806452; Wed, 13 Oct 2021 16:22:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTyVk34vBz4tsm; Wed, 13 Oct 2021 16:22:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 19DGMTeb016549 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 13 Oct 2021 19:22:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 19DGMTeb016549 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 19DGMTR3016548; Wed, 13 Oct 2021 19:22:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 13 Oct 2021 19:22:29 +0300 From: Konstantin Belousov To: Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d0f0e0bd741a - main - rtld: Do not install libmap.conf when installing the COMPAT32 version Message-ID: References: <202110131242.19DCghdV036911@gitrepo.freebsd.org> <20211013181828.36426fe37f41cebbd3a381d5@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013181828.36426fe37f41cebbd3a381d5@bidouilliste.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HTyVk34vBz4tsm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 13, 2021 at 06:18:28PM +0200, Emmanuel Vadot wrote: > On Wed, 13 Oct 2021 19:07:00 +0300 > Konstantin Belousov wrote: > > > On Wed, Oct 13, 2021 at 12:42:43PM +0000, Emmanuel Vadot wrote: > > > The branch main has been updated by manu: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=d0f0e0bd741af867582ceede8ac1b0aec90eae2d > > > > > > commit d0f0e0bd741af867582ceede8ac1b0aec90eae2d > > > Author: Emmanuel Vadot > > > AuthorDate: 2021-10-13 12:40:26 +0000 > > > Commit: Emmanuel Vadot > > > CommitDate: 2021-10-13 12:42:08 +0000 > > > > > > rtld: Do not install libmap.conf when installing the COMPAT32 version > > > > > > This has the effect of installing the same file twice at the same location > > > and confuse pkgbase as we add this file twice in the package config part. > > > > > > MFC after: 1 week > > > Sponsored by: Beckhoff Automation GmbH & Co. KG > > > --- > > > libexec/rtld-elf/Makefile | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile > > > index db1bf70ca59e..1f3df176992a 100644 > > > --- a/libexec/rtld-elf/Makefile > > > +++ b/libexec/rtld-elf/Makefile > > > @@ -14,7 +14,9 @@ MK_ASAN= no > > > MK_SSP= no > > > MK_UBSAN= no > > > > > > +.if !defined(NEED_COMPAT) > > > CONFS= libmap.conf > > > +.endif > > > PROG?= ld-elf.so.1 > > > .if (${PROG:M*ld-elf32*} != "") > > > TAGS+= lib32 > > > > ld-elf32.so.1 tries to read /etc/libmap32.conf AFAIR. > > I think the Makefile should install the file under that name, for compat. > > Indeed it does, but since this file just include the ones > in /usr/local/etc/libmap.d regardless of the arch that could cause > problems to have the same content no ? Perhaps arrange libmap32.conf to include libmap32.d? It is fine to have libmap32.conf in rtld-elf if needed. From nobody Wed Oct 13 17:10:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D736F17FA165; Wed, 13 Oct 2021 17:10:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTzYb5jdBz3Pyj; Wed, 13 Oct 2021 17:10:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A39DF2B998; Wed, 13 Oct 2021 17:10:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DHABvw092103; Wed, 13 Oct 2021 17:10:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DHABY0092091; Wed, 13 Oct 2021 17:10:11 GMT (envelope-from git) Date: Wed, 13 Oct 2021 17:10:11 GMT Message-Id: <202110131710.19DHABY0092091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2144431c1152 - main - Remove in_ifaddr_lock acquisiton to access in_ifaddrhead. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2144431c11529d1107f4440a5fe57559fb20002c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2144431c11529d1107f4440a5fe57559fb20002c commit 2144431c11529d1107f4440a5fe57559fb20002c Author: Gleb Smirnoff AuthorDate: 2021-10-08 19:56:24 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-13 17:04:46 +0000 Remove in_ifaddr_lock acquisiton to access in_ifaddrhead. An IPv4 address is embedded into an ifaddr which is freed via epoch. And the in_ifaddrhead is already a CK list. Use the network epoch to protect against use after free. Next step would be to CK-ify the in_addr hash and get rid of the... Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D32434 --- sys/net/if_stf.c | 4 ---- sys/netinet/if_ether.c | 6 +----- sys/netinet/igmp.c | 10 +++------- sys/netinet/in.c | 27 +++++++++++---------------- sys/netinet/in_mcast.c | 6 ++---- sys/netinet/in_pcb.c | 8 -------- sys/netinet/in_var.h | 7 ++----- sys/netinet/ip_output.c | 4 +--- sys/netinet/raw_ip.c | 14 +++----------- 9 files changed, 23 insertions(+), 63 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 40f8a6f3a30a..f7d6758d052c 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -530,7 +530,6 @@ isrfc1918addr(struct in_addr *in) static int stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) { - struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia4; /* @@ -554,16 +553,13 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) /* * reject packets with broadcast */ - IN_IFADDR_RLOCK(&in_ifa_tracker); CK_STAILQ_FOREACH(ia4, &V_in_ifaddrhead, ia_link) { if ((ia4->ia_ifa.ifa_ifp->if_flags & IFF_BROADCAST) == 0) continue; if (in->s_addr == ia4->ia_broadaddr.sin_addr.s_addr) { - IN_IFADDR_RUNLOCK(&in_ifa_tracker); return -1; } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * perform ingress filter diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 5400f35d953f..45ce04117948 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -906,13 +906,9 @@ in_arpinput(struct mbuf *m) /* * If bridging, fall back to using any inet address. */ - IN_IFADDR_RLOCK(&in_ifa_tracker); - if (!bridged || (ia = CK_STAILQ_FIRST(&V_in_ifaddrhead)) == NULL) { - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + if (!bridged || (ia = CK_STAILQ_FIRST(&V_in_ifaddrhead)) == NULL) goto drop; - } ifa_ref(&ia->ia_ifa); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); match: if (!enaddr) enaddr = (u_int8_t *)IF_LLADDR(ifp); diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index ef0da5e5cb46..e7636330d267 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1259,7 +1258,6 @@ static int igmp_input_v1_report(struct ifnet *ifp, /*const*/ struct ip *ip, /*const*/ struct igmp *igmp) { - struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia; struct in_multi *inm; @@ -1282,7 +1280,7 @@ igmp_input_v1_report(struct ifnet *ifp, /*const*/ struct ip *ip, * Replace 0.0.0.0 with the subnet address if told to do so. */ if (V_igmp_recvifkludge && in_nullhost(ip->ip_src)) { - IFP_TO_IA(ifp, ia, &in_ifa_tracker); + IFP_TO_IA(ifp, ia); if (ia != NULL) ip->ip_src.s_addr = htonl(ia->ia_subnet); } @@ -1368,7 +1366,6 @@ static int igmp_input_v2_report(struct ifnet *ifp, /*const*/ struct ip *ip, /*const*/ struct igmp *igmp) { - struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia; struct in_multi *inm; @@ -1377,7 +1374,7 @@ igmp_input_v2_report(struct ifnet *ifp, /*const*/ struct ip *ip, * leave requires knowing that we are the only member of a * group. */ - IFP_TO_IA(ifp, ia, &in_ifa_tracker); + IFP_TO_IA(ifp, ia); if (ia != NULL && in_hosteq(ip->ip_src, IA_SIN(ia)->sin_addr)) { return (0); } @@ -3535,7 +3532,6 @@ out: static struct mbuf * igmp_v3_encap_report(struct ifnet *ifp, struct mbuf *m) { - struct rm_priotracker in_ifa_tracker; struct igmp_report *igmp; struct ip *ip; int hdrlen, igmpreclen; @@ -3584,7 +3580,7 @@ igmp_v3_encap_report(struct ifnet *ifp, struct mbuf *m) if (m->m_flags & M_IGMP_LOOP) { struct in_ifaddr *ia; - IFP_TO_IA(ifp, ia, &in_ifa_tracker); + IFP_TO_IA(ifp, ia); if (ia != NULL) ip->ip_src = ia->ia_addr.sin_addr; } diff --git a/sys/netinet/in.c b/sys/netinet/in.c index b51f1111b88a..aa87546be2d4 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -107,18 +107,16 @@ SX_SYSINIT(in_control_sx, &in_control_sx, "in_control"); int in_localaddr(struct in_addr in) { - struct rm_priotracker in_ifa_tracker; u_long i = ntohl(in.s_addr); struct in_ifaddr *ia; - IN_IFADDR_RLOCK(&in_ifa_tracker); + NET_EPOCH_ASSERT(); + CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { - if ((i & ia->ia_subnetmask) == ia->ia_subnet) { - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + if ((i & ia->ia_subnetmask) == ia->ia_subnet) return (1); - } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + return (0); } @@ -204,12 +202,10 @@ in_localip_more(struct in_ifaddr *original_ia) struct in_ifaddr * in_findlocal(uint32_t fibnum, bool loopback_ok) { - struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia = NULL, *ia_lo = NULL; NET_EPOCH_ASSERT(); - IN_IFADDR_RLOCK(&in_ifa_tracker); CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { uint32_t ia_fib = ia->ia_ifa.ifa_ifp->if_fib; if (!V_rt_add_addr_allfibs && (fibnum != ia_fib)) @@ -220,7 +216,6 @@ in_findlocal(uint32_t fibnum, bool loopback_ok) if (loopback_ok) ia_lo = ia; } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ia == NULL) ia = ia_lo; @@ -938,15 +933,15 @@ in_handle_ifaddr_route(int cmd, struct in_ifaddr *ia) static bool in_hasrtprefix(struct in_ifaddr *target) { - struct rm_priotracker in_ifa_tracker; + struct epoch_tracker et; struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; bool result = false; ia_getrtprefix(target, &prefix, &mask); - IN_IFADDR_RLOCK(&in_ifa_tracker); /* Look for an existing address with the same prefix, mask, and fib */ + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { ia_getrtprefix(ia, &p, &m); @@ -966,7 +961,7 @@ in_hasrtprefix(struct in_ifaddr *target) break; } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + NET_EPOCH_EXIT(et); return (result); } @@ -1042,7 +1037,7 @@ in_scrubprefixlle(struct in_ifaddr *ia, int all, u_int flags) int in_scrubprefix(struct in_ifaddr *target, u_int flags) { - struct rm_priotracker in_ifa_tracker; + struct epoch_tracker et; struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; int error = 0; @@ -1080,7 +1075,7 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags) return (0); } - IN_IFADDR_RLOCK(&in_ifa_tracker); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { ia_getrtprefix(ia, &p, &m); @@ -1098,7 +1093,7 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags) */ if ((ia->ia_flags & IFA_ROUTE) == 0) { ifa_ref(&ia->ia_ifa); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + NET_EPOCH_EXIT(et); error = in_handle_ifaddr_route(RTM_DELETE, target); if (error == 0) target->ia_flags &= ~IFA_ROUTE; @@ -1118,7 +1113,7 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags) return (error); } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + NET_EPOCH_EXIT(et); /* * remove all L2 entries on the given prefix diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index f0827fcf3451..ad2d7af799a5 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1752,7 +1752,6 @@ inp_get_source_filters(struct inpcb *inp, struct sockopt *sopt) int inp_getmoptions(struct inpcb *inp, struct sockopt *sopt) { - struct rm_priotracker in_ifa_tracker; struct ip_mreqn mreqn; struct ip_moptions *imo; struct ifnet *ifp; @@ -1795,7 +1794,7 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sopt) mreqn.imr_ifindex = ifp->if_index; NET_EPOCH_ENTER(et); - IFP_TO_IA(ifp, ia, &in_ifa_tracker); + IFP_TO_IA(ifp, ia); if (ia != NULL) mreqn.imr_address = IA_SIN(ia)->sin_addr; @@ -1887,6 +1886,7 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, struct ifnet *ifp; struct nhop_object *nh; + NET_EPOCH_ASSERT(); KASSERT(inp != NULL, ("%s: inp must not be NULL", __func__)); KASSERT(gsin->sin_family == AF_INET, ("%s: not AF_INET", __func__)); KASSERT(IN_MULTICAST(ntohl(gsin->sin_addr.s_addr)), @@ -1909,7 +1909,6 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, struct ifnet *mifp; mifp = NULL; - IN_IFADDR_RLOCK(&in_ifa_tracker); CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { mifp = ia->ia_ifp; if (!(mifp->if_flags & IFF_LOOPBACK) && @@ -1919,7 +1918,6 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, break; } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); } } diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 04d34b022772..189f73028198 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1363,7 +1362,6 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, u_short *lportp, in_addr_t *faddrp, u_short *fportp, struct inpcb **oinpp, struct ucred *cred) { - struct rm_priotracker in_ifa_tracker; struct sockaddr_in *sin = (struct sockaddr_in *)nam; struct in_ifaddr *ia; struct inpcb *oinp; @@ -1412,20 +1410,16 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam, * choose the broadcast address for that interface. */ if (faddr.s_addr == INADDR_ANY) { - IN_IFADDR_RLOCK(&in_ifa_tracker); faddr = IA_SIN(CK_STAILQ_FIRST(&V_in_ifaddrhead))->sin_addr; - IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (cred != NULL && (error = prison_get_ip4(cred, &faddr)) != 0) return (error); } else if (faddr.s_addr == (u_long)INADDR_BROADCAST) { - IN_IFADDR_RLOCK(&in_ifa_tracker); if (CK_STAILQ_FIRST(&V_in_ifaddrhead)->ia_ifp->if_flags & IFF_BROADCAST) faddr = satosin(&CK_STAILQ_FIRST( &V_in_ifaddrhead)->ia_broadaddr)->sin_addr; - IN_IFADDR_RUNLOCK(&in_ifa_tracker); } } if (laddr.s_addr == INADDR_ANY) { @@ -1443,7 +1437,6 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam, imo = inp->inp_moptions; if (imo->imo_multicast_ifp != NULL) { ifp = imo->imo_multicast_ifp; - IN_IFADDR_RLOCK(&in_ifa_tracker); CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if ((ia->ia_ifp == ifp) && (cred == NULL || @@ -1457,7 +1450,6 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam, laddr = ia->ia_addr.sin_addr; error = 0; } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); } } if (error) diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index b42ca00d5ae7..c33098e2c79c 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -166,18 +166,15 @@ do { \ * Macro for finding the internet address structure (in_ifaddr) corresponding * to a given interface (ifnet structure). */ -#define IFP_TO_IA(ifp, ia, t) \ +#define IFP_TO_IA(ifp, ia) \ /* struct ifnet *ifp; */ \ /* struct in_ifaddr *ia; */ \ - /* struct rm_priotracker *t; */ \ do { \ NET_EPOCH_ASSERT(); \ - IN_IFADDR_RLOCK((t)); \ for ((ia) = CK_STAILQ_FIRST(&V_in_ifaddrhead); \ (ia) != NULL && (ia)->ia_ifp != (ifp); \ - (ia) = CK_STAILQ_NEXT((ia), ia_link)) \ + (ia) = CK_STAILQ_NEXT((ia), ia_link)) \ continue; \ - IN_IFADDR_RUNLOCK((t)); \ } while (0) /* diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index ad41c9df0b8c..d850cf5b5167 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -321,7 +320,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, struct ip_moptions *imo, struct inpcb *inp) { MROUTER_RLOCK_TRACKER; - struct rm_priotracker in_ifa_tracker; struct ip *ip; struct ifnet *ifp = NULL; /* keep compiler happy */ struct mbuf *m0; @@ -463,7 +461,7 @@ again: */ ifp = imo->imo_multicast_ifp; mtu = ifp->if_mtu; - IFP_TO_IA(ifp, ia, &in_ifa_tracker); + IFP_TO_IA(ifp, ia); isbroadcast = 0; /* fool gcc */ /* Interface may have no addresses. */ if (ia != NULL) diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 00c95c451966..38ab5f4a8243 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -817,20 +816,19 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt) void rip_ctlinput(int cmd, struct sockaddr *sa, void *vip) { - struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia; struct ifnet *ifp; int err; int flags; + NET_EPOCH_ASSERT(); + switch (cmd) { case PRC_IFDOWN: - IN_IFADDR_RLOCK(&in_ifa_tracker); CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (ia->ia_ifa.ifa_addr == sa && (ia->ia_flags & IFA_ROUTE)) { ifa_ref(&ia->ia_ifa); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * in_scrubprefix() kills the interface route. */ @@ -846,22 +844,16 @@ rip_ctlinput(int cmd, struct sockaddr *sa, void *vip) break; } } - if (ia == NULL) /* If ia matched, already unlocked. */ - IN_IFADDR_RUNLOCK(&in_ifa_tracker); break; case PRC_IFUP: - IN_IFADDR_RLOCK(&in_ifa_tracker); CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (ia->ia_ifa.ifa_addr == sa) break; } - if (ia == NULL || (ia->ia_flags & IFA_ROUTE)) { - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + if (ia == NULL || (ia->ia_flags & IFA_ROUTE)) return; - } ifa_ref(&ia->ia_ifa); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); flags = RTF_UP; ifp = ia->ia_ifa.ifa_ifp; From nobody Wed Oct 13 18:18:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1CF9C17F7469; Wed, 13 Oct 2021 18:18:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV14j04GZz4V8p; Wed, 13 Oct 2021 18:18:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 372D529987; Wed, 13 Oct 2021 18:18:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: d0f0e0bd741a - main - rtld: Do not install libmap.conf when installing the COMPAT32 version To: Konstantin Belousov , Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110131242.19DCghdV036911@gitrepo.freebsd.org> <20211013181828.36426fe37f41cebbd3a381d5@bidouilliste.com> From: John Baldwin Message-ID: Date: Wed, 13 Oct 2021 11:18:43 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/13/21 9:22 AM, Konstantin Belousov wrote: > On Wed, Oct 13, 2021 at 06:18:28PM +0200, Emmanuel Vadot wrote: >> On Wed, 13 Oct 2021 19:07:00 +0300 >> Konstantin Belousov wrote: >> >>> On Wed, Oct 13, 2021 at 12:42:43PM +0000, Emmanuel Vadot wrote: >>>> The branch main has been updated by manu: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=d0f0e0bd741af867582ceede8ac1b0aec90eae2d >>>> >>>> commit d0f0e0bd741af867582ceede8ac1b0aec90eae2d >>>> Author: Emmanuel Vadot >>>> AuthorDate: 2021-10-13 12:40:26 +0000 >>>> Commit: Emmanuel Vadot >>>> CommitDate: 2021-10-13 12:42:08 +0000 >>>> >>>> rtld: Do not install libmap.conf when installing the COMPAT32 version >>>> >>>> This has the effect of installing the same file twice at the same location >>>> and confuse pkgbase as we add this file twice in the package config part. >>>> >>>> MFC after: 1 week >>>> Sponsored by: Beckhoff Automation GmbH & Co. KG >>>> --- >>>> libexec/rtld-elf/Makefile | 2 ++ >>>> 1 file changed, 2 insertions(+) >>>> >>>> diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile >>>> index db1bf70ca59e..1f3df176992a 100644 >>>> --- a/libexec/rtld-elf/Makefile >>>> +++ b/libexec/rtld-elf/Makefile >>>> @@ -14,7 +14,9 @@ MK_ASAN= no >>>> MK_SSP= no >>>> MK_UBSAN= no >>>> >>>> +.if !defined(NEED_COMPAT) >>>> CONFS= libmap.conf >>>> +.endif >>>> PROG?= ld-elf.so.1 >>>> .if (${PROG:M*ld-elf32*} != "") >>>> TAGS+= lib32 >>> >>> ld-elf32.so.1 tries to read /etc/libmap32.conf AFAIR. >>> I think the Makefile should install the file under that name, for compat. >> >> Indeed it does, but since this file just include the ones >> in /usr/local/etc/libmap.d regardless of the arch that could cause >> problems to have the same content no ? > > Perhaps arrange libmap32.conf to include libmap32.d? It is fine to have > libmap32.conf in rtld-elf if needed. It could even live in rtld-elf32 I think? I would vote for having a dedicated libmap32.conf that gets installed that is suitably converted to lib32. -- John Baldwin From nobody Wed Oct 13 19:14:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DFC0C180F120; Wed, 13 Oct 2021 19:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV2K25vlcz4mGd; Wed, 13 Oct 2021 19:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AACFD2D177; Wed, 13 Oct 2021 19:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DJEUiS060951; Wed, 13 Oct 2021 19:14:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DJEUVj060950; Wed, 13 Oct 2021 19:14:30 GMT (envelope-from git) Date: Wed, 13 Oct 2021 19:14:30 GMT Message-Id: <202110131914.19DJEUVj060950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a63752cce646 - main - ktls: Reject attempts to enable AES-CBC with TLS 1.3. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a63752cce6462d08bbec08cad931d70dec2f5b4c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a63752cce6462d08bbec08cad931d70dec2f5b4c commit a63752cce6462d08bbec08cad931d70dec2f5b4c Author: John Baldwin AuthorDate: 2021-10-13 19:12:58 +0000 Commit: John Baldwin CommitDate: 2021-10-13 19:12:58 +0000 ktls: Reject attempts to enable AES-CBC with TLS 1.3. AES-CBC cipher suites are not supported in TLS 1.3. Reported by: syzbot+ab501c50033ec01d53c6@syzkaller.appspotmail.com Reviewed by: tuexen, markj Differential Revision: https://reviews.freebsd.org/D32404 --- sys/kern/uipc_ktls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index bc21e6fe2493..12bb02876083 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -560,6 +560,10 @@ ktls_create_session(struct socket *so, struct tls_enable *en, } if (en->auth_key_len == 0) return (EINVAL); + if (en->tls_vminor != TLS_MINOR_VER_ZERO && + en->tls_vminor != TLS_MINOR_VER_ONE && + en->tls_vminor != TLS_MINOR_VER_TWO) + return (EINVAL); break; case CRYPTO_CHACHA20_POLY1305: if (en->auth_algorithm != 0 || en->auth_key_len != 0) From nobody Wed Oct 13 20:26:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 665191815E48; Wed, 13 Oct 2021 20:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV3vw1BfBz4TKX; Wed, 13 Oct 2021 20:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08FA42E7BD; Wed, 13 Oct 2021 20:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DKQJVD060514; Wed, 13 Oct 2021 20:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DKQJtD060513; Wed, 13 Oct 2021 20:26:19 GMT (envelope-from git) Date: Wed, 13 Oct 2021 20:26:19 GMT Message-Id: <202110132026.19DKQJtD060513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9f03d2c00167 - main - ktls: Ensure FIFO encryption order for TLS 1.0. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f03d2c00167c8047416e0048e3b7f89d73baf8e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f03d2c00167c8047416e0048e3b7f89d73baf8e commit 9f03d2c00167c8047416e0048e3b7f89d73baf8e Author: John Baldwin AuthorDate: 2021-10-13 19:30:15 +0000 Commit: John Baldwin CommitDate: 2021-10-13 19:30:15 +0000 ktls: Ensure FIFO encryption order for TLS 1.0. TLS 1.0 records are encrypted as one continuous CBC chain where the last block of the previous record is used as the IV for the next record. As a result, TLS 1.0 records cannot be encrypted out of order but must be encrypted as a FIFO. If the later pages of a sendfile(2) request complete before the first pages, then TLS records can be encrypted out of order. For TLS 1.1 and later this is fine, but this can break for TLS 1.0. To cope, add a queue in each TLS session to hold TLS records that contain valid unencrypted data but are waiting for an earlier TLS record to be encrypted first. - In ktls_enqueue(), check if a TLS record being queued is the next record expected for a TLS 1.0 session. If not, it is placed in sorted order in the pending_records queue in the TLS session. If it is the next expected record, queue it for SW encryption like normal. In addition, check if this new record (really a potential batch of records) was holding up any previously queued records in the pending_records queue. Any of those records that are now in order are also placed on the queue for SW encryption. - In ktls_destroy(), free any TLS records on the pending_records queue. These mbufs are marked M_NOTREADY so were not freed when the socket buffer was purged in sbdestroy(). Instead, they must be freed explicitly. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32381 --- sys/kern/uipc_ktls.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++-- sys/sys/ktls.h | 5 +++ 2 files changed, 115 insertions(+), 3 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 12bb02876083..1e778dbf113a 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -162,6 +162,11 @@ static COUNTER_U64_DEFINE_EARLY(ktls_tasks_active); SYSCTL_COUNTER_U64(_kern_ipc_tls, OID_AUTO, tasks_active, CTLFLAG_RD, &ktls_tasks_active, "Number of active tasks"); +static COUNTER_U64_DEFINE_EARLY(ktls_cnt_tx_pending); +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_tx_pending, CTLFLAG_RD, + &ktls_cnt_tx_pending, + "Number of TLS 1.0 records waiting for earlier TLS records"); + static COUNTER_U64_DEFINE_EARLY(ktls_cnt_tx_queued); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_tx_inqueue, CTLFLAG_RD, &ktls_cnt_tx_queued, @@ -612,6 +617,9 @@ ktls_create_session(struct socket *so, struct tls_enable *en, case CRYPTO_SHA1_HMAC: if (en->tls_vminor == TLS_MINOR_VER_ZERO) { /* Implicit IV, no nonce. */ + tls->sequential_records = true; + tls->next_seqno = be64dec(en->rec_seq); + STAILQ_INIT(&tls->pending_records); } else { tls->params.tls_hlen += AES_BLOCK_LEN; } @@ -1490,6 +1498,20 @@ void ktls_destroy(struct ktls_session *tls) { + if (tls->sequential_records) { + struct mbuf *m, *n; + int page_count; + + STAILQ_FOREACH_SAFE(m, &tls->pending_records, m_epg_stailq, n) { + page_count = m->m_epg_enc_cnt; + while (page_count > 0) { + KASSERT(page_count >= m->m_epg_nrdy, + ("%s: too few pages", __func__)); + page_count -= m->m_epg_nrdy; + m = m_free(m); + } + } + } ktls_cleanup(tls); uma_zfree(ktls_session_zone, tls); } @@ -2092,10 +2114,29 @@ ktls_encrypt_record(struct ktls_wq *wq, struct mbuf *m, return (error); } +/* Number of TLS records in a batch passed to ktls_enqueue(). */ +static u_int +ktls_batched_records(struct mbuf *m) +{ + int page_count, records; + + records = 0; + page_count = m->m_epg_enc_cnt; + while (page_count > 0) { + records++; + page_count -= m->m_epg_nrdy; + m = m->m_next; + } + KASSERT(page_count == 0, ("%s: mismatched page count", __func__)); + return (records); +} + void ktls_enqueue(struct mbuf *m, struct socket *so, int page_count) { + struct ktls_session *tls; struct ktls_wq *wq; + int queued; bool running; KASSERT(((m->m_flags & (M_EXTPG | M_NOTREADY)) == @@ -2113,14 +2154,80 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int page_count) */ m->m_epg_so = so; - wq = &ktls_wq[m->m_epg_tls->wq_index]; + queued = 1; + tls = m->m_epg_tls; + wq = &ktls_wq[tls->wq_index]; mtx_lock(&wq->mtx); - STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); + if (__predict_false(tls->sequential_records)) { + /* + * For TLS 1.0, records must be encrypted + * sequentially. For a given connection, all records + * queued to the associated work queue are processed + * sequentially. However, sendfile(2) might complete + * I/O requests spanning multiple TLS records out of + * order. Here we ensure TLS records are enqueued to + * the work queue in FIFO order. + * + * tls->next_seqno holds the sequence number of the + * next TLS record that should be enqueued to the work + * queue. If this next record is not tls->next_seqno, + * it must be a future record, so insert it, sorted by + * TLS sequence number, into tls->pending_records and + * return. + * + * If this TLS record matches tls->next_seqno, place + * it in the work queue and then check + * tls->pending_records to see if any + * previously-queued records are now ready for + * encryption. + */ + if (m->m_epg_seqno != tls->next_seqno) { + struct mbuf *n, *p; + + p = NULL; + STAILQ_FOREACH(n, &tls->pending_records, m_epg_stailq) { + if (n->m_epg_seqno > m->m_epg_seqno) + break; + p = n; + } + if (n == NULL) + STAILQ_INSERT_TAIL(&tls->pending_records, m, + m_epg_stailq); + else if (p == NULL) + STAILQ_INSERT_HEAD(&tls->pending_records, m, + m_epg_stailq); + else + STAILQ_INSERT_AFTER(&tls->pending_records, p, m, + m_epg_stailq); + mtx_unlock(&wq->mtx); + counter_u64_add(ktls_cnt_tx_pending, 1); + return; + } + + tls->next_seqno += ktls_batched_records(m); + STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); + + while (!STAILQ_EMPTY(&tls->pending_records)) { + struct mbuf *n; + + n = STAILQ_FIRST(&tls->pending_records); + if (n->m_epg_seqno != tls->next_seqno) + break; + + queued++; + STAILQ_REMOVE_HEAD(&tls->pending_records, m_epg_stailq); + tls->next_seqno += ktls_batched_records(n); + STAILQ_INSERT_TAIL(&wq->m_head, n, m_epg_stailq); + } + counter_u64_add(ktls_cnt_tx_pending, -(queued - 1)); + } else + STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq); + running = wq->running; mtx_unlock(&wq->mtx); if (!running) wakeup(wq); - counter_u64_add(ktls_cnt_tx_queued, 1); + counter_u64_add(ktls_cnt_tx_queued, queued); } /* diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 71d55ee1b3d8..cd0a786bb345 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -198,6 +198,11 @@ struct ktls_session { bool reset_pending; bool disable_ifnet_pending; bool sync_dispatch; + bool sequential_records; + + /* Only used for TLS 1.0. */ + uint64_t next_seqno; + STAILQ_HEAD(, mbuf) pending_records; } __aligned(CACHE_LINE_SIZE); extern unsigned int ktls_ifnet_max_rexmit_pct; From nobody Wed Oct 13 20:40:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2C03A17F4688; Wed, 13 Oct 2021 20:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV4Ck0kGRz4YMZ; Wed, 13 Oct 2021 20:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC4D32E641; Wed, 13 Oct 2021 20:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DKe13O075596; Wed, 13 Oct 2021 20:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DKe1N3075593; Wed, 13 Oct 2021 20:40:01 GMT (envelope-from git) Date: Wed, 13 Oct 2021 20:40:01 GMT Message-Id: <202110132040.19DKe1N3075593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: 083f6d0e5d58 - main - release: use tab-delimited variables in AZURE_UPLOAD_CONF List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 083f6d0e5d58e9ad6bccc782859c8a28d82c9889 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=083f6d0e5d58e9ad6bccc782859c8a28d82c9889 commit 083f6d0e5d58e9ad6bccc782859c8a28d82c9889 Author: Glen Barber AuthorDate: 2021-10-13 20:39:10 +0000 Commit: Glen Barber CommitDate: 2021-10-13 20:39:51 +0000 release: use tab-delimited variables in AZURE_UPLOAD_CONF Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile.azure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.azure b/release/Makefile.azure index b8e7418f35f7..00eacf22301b 100644 --- a/release/Makefile.azure +++ b/release/Makefile.azure @@ -12,7 +12,7 @@ CLEANFILES+= ${AZURE_UPLOAD_TGTS} .if defined(AZURE_UPLOAD_CONF) && !empty(AZURE_UPLOAD_CONF) . for VAR in _STORAGE _ACCOUNT _RESOURCEGROUP _KEY _LOCATION -AZURE${VAR}!= grep -E ^AZURE${VAR}= ${AZURE_UPLOAD_CONF} | awk '{print $$2}' +AZURE${VAR}!= grep -E '^AZURE${VAR}' ${AZURE_UPLOAD_CONF} | awk -F ' ' '{print $$2}' . endfor .endif From nobody Wed Oct 13 21:12:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C6BF81801278; Wed, 13 Oct 2021 21:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV4ws5J4fz4hRj; Wed, 13 Oct 2021 21:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9689C2F014; Wed, 13 Oct 2021 21:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DLCDQK027415; Wed, 13 Oct 2021 21:12:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DLCDjN027414; Wed, 13 Oct 2021 21:12:13 GMT (envelope-from git) Date: Wed, 13 Oct 2021 21:12:13 GMT Message-Id: <202110132112.19DLCDjN027414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: 364cf0304cf1 - main - release: add _LOCATION to the list of required AZURE variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 364cf0304cf196acdecdbe0e72fb48dd43917ca0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=364cf0304cf196acdecdbe0e72fb48dd43917ca0 commit 364cf0304cf196acdecdbe0e72fb48dd43917ca0 Author: Glen Barber AuthorDate: 2021-10-13 21:11:48 +0000 Commit: Glen Barber CommitDate: 2021-10-13 21:11:48 +0000 release: add _LOCATION to the list of required AZURE variables Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile.azure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.azure b/release/Makefile.azure index 00eacf22301b..bc6f8859dea9 100644 --- a/release/Makefile.azure +++ b/release/Makefile.azure @@ -28,7 +28,7 @@ EXPIRY_DATE!= date -v+1m -I -u azure-upload: ${AZURE_UPLOAD_TGTS} azure-check-depends: -.for VAR in _STORAGE _ACCOUNT _RESOURCEGROUP _KEY +.for VAR in _STORAGE _ACCOUNT _RESOURCEGROUP _KEY _LOCATION . if !defined(AZURE${VAR}) || empty(AZURE${VAR}) @echo "Variable AZURE${VAR} cannot be empty." @false From nobody Wed Oct 13 21:31:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8E61418085FB; Wed, 13 Oct 2021 21:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV5MC3WBBz4mcx; Wed, 13 Oct 2021 21:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 592622F2A9; Wed, 13 Oct 2021 21:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DLVZPj050338; Wed, 13 Oct 2021 21:31:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DLVZUN050337; Wed, 13 Oct 2021 21:31:35 GMT (envelope-from git) Date: Wed, 13 Oct 2021 21:31:35 GMT Message-Id: <202110132131.19DLVZUN050337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: d5fd5cdc0638 - main - Temporarily skip sys.netgraph.hub.loop on RISC-V in CI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5fd5cdc063857132de19a94f63d1adbc581494e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=d5fd5cdc063857132de19a94f63d1adbc581494e commit d5fd5cdc063857132de19a94f63d1adbc581494e Author: Li-Wen Hsu AuthorDate: 2021-10-13 21:31:22 +0000 Commit: Li-Wen Hsu CommitDate: 2021-10-13 21:31:22 +0000 Temporarily skip sys.netgraph.hub.loop on RISC-V in CI This case panics kernel. PR: 259157 Sponsored by: The FreeBSD Foundation --- tests/sys/netgraph/hub.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/sys/netgraph/hub.c b/tests/sys/netgraph/hub.c index 08d083ad9605..9a5ba74b2ad5 100644 --- a/tests/sys/netgraph/hub.c +++ b/tests/sys/netgraph/hub.c @@ -127,6 +127,11 @@ ATF_TC_BODY(loop, dummy) int i; char msg[] = "LOOP Alert!"; +#if defined(__riscv) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/259157"); +#endif + ng_errors(PASS); ng_shutdown("hub1:"); ng_shutdown("hub2:"); From nobody Wed Oct 13 22:52:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B0B89180B65E; Wed, 13 Oct 2021 22:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV78m4bmcz3jF3; Wed, 13 Oct 2021 22:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DB9154C; Wed, 13 Oct 2021 22:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DMqe0p059613; Wed, 13 Oct 2021 22:52:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DMqekb059612; Wed, 13 Oct 2021 22:52:40 GMT (envelope-from git) Date: Wed, 13 Oct 2021 22:52:40 GMT Message-Id: <202110132252.19DMqekb059612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 24af0fcdfc49 - main - nfscl: Make nfscl_getlayout() acquire the correct pNFS layout List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24af0fcdfc4983fd3cef10f9d949aca79476c2c2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=24af0fcdfc4983fd3cef10f9d949aca79476c2c2 commit 24af0fcdfc4983fd3cef10f9d949aca79476c2c2 Author: Rick Macklem AuthorDate: 2021-10-13 22:48:54 +0000 Commit: Rick Macklem CommitDate: 2021-10-13 22:48:54 +0000 nfscl: Make nfscl_getlayout() acquire the correct pNFS layout Without this patch, if a pNFS read layout has already been acquired for a file, writes would be redirected to the Metadata Server (MDS), because nfscl_getlayout() would not acquire a read/write layout for the file. This happened because there was no "mode" argument to nfscl_getlayout() to indicate whether reading or writing was being done. Since doing I/O through the Metadata Server is not encouraged for some pNFS servers, it is preferable to get a read/write layout for writes instead of redirecting the write to the MDS. This patch adds a access mode argument to nfscl_getlayout() and nfsrpc_getlayout(), so that nfscl_getlayout() knows to acquire a read/write layout for writing, even if a read layout has already been acquired. This patch only affects NFSv4.1/4.2 client behaviour when pNFS ("pnfs" mount option against a server that supports pNFS) is in use. This problem was detected during a recent NFSv4 interoperability testing event held by the IETF working group. MFC after: 2 week --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 14 +++++++------- sys/fs/nfsclient/nfs_clstate.c | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 459860078c30..c5d164bd1b93 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -637,7 +637,7 @@ int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t *, int, nfsv4stateid_t *, int, int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, NFSPROC_T *); struct nfscllayout *nfscl_getlayout(struct nfsclclient *, uint8_t *, int, - uint64_t, struct nfsclflayout **, int *); + uint64_t, uint32_t, struct nfsclflayout **, int *); void nfscl_dserr(uint32_t, uint32_t, struct nfscldevinfo *, struct nfscllayout *, struct nfsclds *); void nfscl_cancelreqs(struct nfsclds *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 66e093505ca3..b550ae832ff4 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -150,7 +150,7 @@ static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, static int nfsrpc_setaclrpc(vnode_t, struct ucred *, NFSPROC_T *, struct acl *, nfsv4stateid_t *, void *); static int nfsrpc_getlayout(struct nfsmount *, vnode_t, struct nfsfh *, int, - uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, + uint32_t, uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, struct ucred *, NFSPROC_T *); static int nfsrpc_fillsa(struct nfsmount *, struct sockaddr_in *, struct sockaddr_in6 *, sa_family_t, int, int, struct nfsclds **, @@ -5684,8 +5684,8 @@ nfsmout: */ static int nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, struct nfsfh *nfhp, - int iomode, uint32_t *notifybitsp, nfsv4stateid_t *stateidp, uint64_t off, - struct nfscllayout **lypp, struct ucred *cred, NFSPROC_T *p) + int iomode, uint32_t rw, uint32_t *notifybitsp, nfsv4stateid_t *stateidp, + uint64_t off, struct nfscllayout **lypp, struct ucred *cred, NFSPROC_T *p) { struct nfscllayout *lyp; struct nfsclflayout *flp; @@ -5705,7 +5705,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, struct nfsfh *nfhp, * flp == NULL. */ lyp = nfscl_getlayout(nmp->nm_clp, nfhp->nfh_fh, nfhp->nfh_len, - off, &flp, &recalled); + off, rw, &flp, &recalled); islocked = 0; if (lyp == NULL || flp == NULL) { if (recalled != 0) @@ -6036,7 +6036,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, /* Search for a layout for this file. */ off = uiop->uio_offset; layp = nfscl_getlayout(nmp->nm_clp, np->n_fhp->nfh_fh, - np->n_fhp->nfh_len, off, &rflp, &recalled); + np->n_fhp->nfh_len, off, rwaccess, &rflp, &recalled); if (layp == NULL || rflp == NULL) { if (recalled != 0) { NFSFREECRED(newcred); @@ -6054,7 +6054,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, else iolaymode = NFSLAYOUTIOMODE_READ; error = nfsrpc_getlayout(nmp, vp, np->n_fhp, iolaymode, - NULL, &stateid, off, &layp, newcred, p); + rwaccess, NULL, &stateid, off, &layp, newcred, p); if (error != 0) { NFSLOCKNODE(np); np->n_flag |= NNOLAYOUT; @@ -7740,7 +7740,7 @@ nfsrpc_getopenlayout(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, * on it, iff flp != NULL or a lock (exclusive lock) on it iff * flp == NULL. */ - lyp = nfscl_getlayout(nmp->nm_clp, newfhp, newfhlen, 0, &flp, + lyp = nfscl_getlayout(nmp->nm_clp, newfhp, newfhlen, 0, mode, &flp, &recalled); NFSCL_DEBUG(4, "nfsrpc_getopenlayout nfscl_getlayout lyp=%p\n", lyp); if (lyp == NULL) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9a7a879fffd3..8fca7734c197 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5141,7 +5141,8 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, */ struct nfscllayout * nfscl_getlayout(struct nfsclclient *clp, uint8_t *fhp, int fhlen, - uint64_t off, struct nfsclflayout **retflpp, int *recalledp) + uint64_t off, uint32_t rwaccess, struct nfsclflayout **retflpp, + int *recalledp) { struct nfscllayout *lyp; mount_t mp; @@ -5157,8 +5158,8 @@ nfscl_getlayout(struct nfsclclient *clp, uint8_t *fhp, int fhlen, TAILQ_REMOVE(&clp->nfsc_layout, lyp, nfsly_list); TAILQ_INSERT_HEAD(&clp->nfsc_layout, lyp, nfsly_list); lyp->nfsly_timestamp = NFSD_MONOSEC + 120; - error = nfscl_findlayoutforio(lyp, off, - NFSV4OPEN_ACCESSREAD, retflpp); + error = nfscl_findlayoutforio(lyp, off, rwaccess, + retflpp); if (error == 0) nfsv4_getref(&lyp->nfsly_lock, NULL, NFSCLSTATEMUTEXPTR, mp); From nobody Wed Oct 13 23:03:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 169F517F06BF; Wed, 13 Oct 2021 23:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV7PM73KVz3lvp; Wed, 13 Oct 2021 23:03:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1EAD37C; Wed, 13 Oct 2021 23:03:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DN3ZhO074241; Wed, 13 Oct 2021 23:03:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DN3ZPj074240; Wed, 13 Oct 2021 23:03:35 GMT (envelope-from git) Date: Wed, 13 Oct 2021 23:03:35 GMT Message-Id: <202110132303.19DN3ZPj074240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: a524aaf68341 - main - bpf(4): Fix a misnamed constant List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a524aaf68341d9f83a0ef7dc21ad54728ddaaa1e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a524aaf68341d9f83a0ef7dc21ad54728ddaaa1e commit a524aaf68341d9f83a0ef7dc21ad54728ddaaa1e Author: Felix Johnson AuthorDate: 2021-10-13 23:00:41 +0000 Commit: Guangyuan Yang CommitDate: 2021-10-13 23:03:18 +0000 bpf(4): Fix a misnamed constant rarpd.c was modified in r19859 to use REVARP_REQUEST instead of ARPOP_REVREQUEST. PR: 183333 MFC after: 3 days Reported by: pluknet --- share/man/man4/bpf.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/bpf.4 b/share/man/man4/bpf.4 index 66f4ae72918b..f285d5276376 100644 --- a/share/man/man4/bpf.4 +++ b/share/man/man4/bpf.4 @@ -49,7 +49,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2021 +.Dd October 13, 2021 .Dt BPF 4 .Os .Sh NAME @@ -1079,7 +1079,7 @@ struct bpf_insn insns[] = { BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12), BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_REVARP, 0, 3), BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20), - BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, REVARP_REQUEST, 0, 1), + BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARPOP_REVREQUEST, 0, 1), BPF_STMT(BPF_RET+BPF_K, sizeof(struct ether_arp) + sizeof(struct ether_header)), BPF_STMT(BPF_RET+BPF_K, 0), From nobody Wed Oct 13 23:14:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1F32817F4647; Wed, 13 Oct 2021 23:14:32 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV7dz3KNRz3q7T; Wed, 13 Oct 2021 23:14:31 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 19DNEJ8b016094 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 14 Oct 2021 01:14:20 +0200 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 19DNEJLK012893; Thu, 14 Oct 2021 01:14:19 +0200 Date: Thu, 14 Oct 2021 01:14:19 +0200 From: Lutz Donnerhacke To: Li-Wen Hsu Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: d5fd5cdc0638 - main - Temporarily skip sys.netgraph.hub.loop on RISC-V in CI Message-ID: <20211013231419.GA12832@belenus.iks-jena.de> References: <202110132131.19DLVZUN050337@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110132131.19DLVZUN050337@gitrepo.freebsd.org> X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4HV7dz3KNRz3q7T X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 13, 2021 at 09:31:35PM +0000, Li-Wen Hsu wrote: > Temporarily skip sys.netgraph.hub.loop on RISC-V in CI > > +#if defined(__riscv) > + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) > + atf_tc_skip("https://bugs.freebsd.org/259157"); > +#endif It seems to never worked on RISC, all builds fail since the test was activated two weeks ago. (The builds fail for many reasons ...) Somebody with RISC experience available to have a look? I don't have a clue. From nobody Wed Oct 13 23:44:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 47D4C1802F39; Wed, 13 Oct 2021 23:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HV8J11Wkyz4WY7; Wed, 13 Oct 2021 23:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 148B4109E; Wed, 13 Oct 2021 23:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19DNi0r9026850; Wed, 13 Oct 2021 23:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19DNi0WN026849; Wed, 13 Oct 2021 23:44:00 GMT (envelope-from git) Date: Wed, 13 Oct 2021 23:44:00 GMT Message-Id: <202110132344.19DNi0WN026849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 04c91ac48ad1 - main - selsocket: handle sopoll() errors correctly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04c91ac48ad13ce0d1392cedbd69c2c0223d206f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=04c91ac48ad13ce0d1392cedbd69c2c0223d206f commit 04c91ac48ad13ce0d1392cedbd69c2c0223d206f Author: Brooks Davis AuthorDate: 2021-10-13 23:43:06 +0000 Commit: Brooks Davis CommitDate: 2021-10-13 23:43:48 +0000 selsocket: handle sopoll() errors correctly Without this change, unmounting smbfs filesystems with an INVARIANTS kernel would panic after 10e64782ed59727e8c9fe4a5c7e17f497903c8eb. Found by: markj Reviewed by: markj, jhb Obtained from: CheriBSD MFC after: 3 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D32492 --- sys/kern/sys_generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index e6b2cba27a04..41e9c556f73f 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1794,10 +1794,10 @@ selsocket(struct socket *so, int events, struct timeval *tvp, struct thread *td) */ for (;;) { selfdalloc(td, NULL); - error = sopoll(so, events, NULL, td); - /* error here is actually the ready events. */ - if (error) - return (0); + if (sopoll(so, events, NULL, td) != 0) { + error = 0; + break; + } error = seltdwait(td, asbt, precision); if (error) break; From nobody Thu Oct 14 02:19:42 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 31A9217FE472; Thu, 14 Oct 2021 02:19:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVClg0ZSLz3rTH; Thu, 14 Oct 2021 02:19:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4DA8319A; Thu, 14 Oct 2021 02:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19E2Jgsd026796; Thu, 14 Oct 2021 02:19:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19E2Jgbr026795; Thu, 14 Oct 2021 02:19:42 GMT (envelope-from git) Date: Thu, 14 Oct 2021 02:19:42 GMT Message-Id: <202110140219.19E2Jgbr026795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: 152c35ee4fda - main - unionfs: Ensure SAVENAME is set for unionfs vnode operations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 152c35ee4fdad39d30789fd01cd2fc723ba9568b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=152c35ee4fdad39d30789fd01cd2fc723ba9568b commit 152c35ee4fdad39d30789fd01cd2fc723ba9568b Author: Jason A. Harmening AuthorDate: 2021-09-26 02:56:04 +0000 Commit: Jason A. Harmening CommitDate: 2021-10-14 02:25:31 +0000 unionfs: Ensure SAVENAME is set for unionfs vnode operations "rm-style" system calls such as kern_frmdirat() and kern_funlinkat() don't supply SAVENAME to preserve the pathname buffer for subsequent vnode ops. For unionfs this poses an issue because the pathname may be needed for a relookup operation in unionfs_remove()/unionfs_rmdir(). Currently unionfs doesn't check for this case, leading to a panic on DIAGNOSTIC kernels and use-after-free of cn_nameptr otherwise. The unionfs node's stored buffer would suffice as a replacement for cnp->cn_nameptr in some (but not all) cases, but it's cleaner to just ensure that unionfs vnode ops always have a valid cn_nameptr by setting SAVENAME in unionfs_lookup(). While here, do some light cleanup in unionfs_lookup() and assert that HASBUF is always present in the relevant relookup calls. Reported by: pho Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D32148 --- sys/fs/unionfs/union_subr.c | 6 ++++++ sys/fs/unionfs/union_vnops.c | 35 ++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index eb7681df645b..380a61819f1a 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -678,6 +678,8 @@ unionfs_relookup_for_create(struct vnode *dvp, struct componentname *cnp, udvp = UNIONFSVPTOUPPERVP(dvp); vp = NULLVP; + KASSERT((cnp->cn_flags & HASBUF) != 0, + ("%s called without HASBUF", __func__)); error = unionfs_relookup(udvp, &vp, cnp, &cn, td, cnp->cn_nameptr, cnp->cn_namelen, CREATE); if (error) @@ -712,6 +714,8 @@ unionfs_relookup_for_delete(struct vnode *dvp, struct componentname *cnp, udvp = UNIONFSVPTOUPPERVP(dvp); vp = NULLVP; + KASSERT((cnp->cn_flags & HASBUF) != 0, + ("%s called without HASBUF", __func__)); error = unionfs_relookup(udvp, &vp, cnp, &cn, td, cnp->cn_nameptr, cnp->cn_namelen, DELETE); if (error) @@ -746,6 +750,8 @@ unionfs_relookup_for_rename(struct vnode *dvp, struct componentname *cnp, udvp = UNIONFSVPTOUPPERVP(dvp); vp = NULLVP; + KASSERT((cnp->cn_flags & HASBUF) != 0, + ("%s called without HASBUF", __func__)); error = unionfs_relookup(udvp, &vp, cnp, &cn, td, cnp->cn_nameptr, cnp->cn_namelen, RENAME); if (error) diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index eb74192fd504..b6c088fb3804 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -167,9 +167,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) } else if (error == ENOENT && (cnflags & MAKEENTRY) != 0) cache_enter(dvp, NULLVP, cnp); - UNIONFS_INTERNAL_DEBUG("unionfs_lookup: leave (%d)\n", error); - - return (error); + goto unionfs_lookup_return; } /* @@ -184,10 +182,8 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) *(ap->a_vpp) = dvp; vref(dvp); - UNIONFS_INTERNAL_DEBUG( - "unionfs_lookup: leave (%d)\n", uerror); - - return (uerror); + error = uerror; + goto unionfs_lookup_return; } if (nameiop == DELETE || nameiop == RENAME || (cnp->cn_lkflags & LK_TYPE_MASK)) @@ -246,9 +242,8 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) * check lookup result */ if (uvp == NULLVP && lvp == NULLVP) { - UNIONFS_INTERNAL_DEBUG("unionfs_lookup: leave (%d)\n", - (udvp != NULLVP ? uerror : lerror)); - return (udvp != NULLVP ? uerror : lerror); + error = (udvp != NULLVP ? uerror : lerror); + goto unionfs_lookup_return; } /* @@ -270,7 +265,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) error = unionfs_nodeget(dvp->v_mount, NULLVP, lvp, dvp, &vp, cnp, td); if (error != 0) - goto unionfs_lookup_out; + goto unionfs_lookup_cleanup; if (LK_SHARED == (cnp->cn_lkflags & LK_TYPE_MASK)) VOP_UNLOCK(vp); @@ -289,7 +284,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) vput(vp); else vrele(vp); - goto unionfs_lookup_out; + goto unionfs_lookup_cleanup; } if ((cnp->cn_lkflags & LK_TYPE_MASK) == LK_SHARED) vn_lock(vp, LK_SHARED | LK_RETRY); @@ -303,7 +298,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) else error = lerror; if (error != 0) - goto unionfs_lookup_out; + goto unionfs_lookup_cleanup; /* * get socket vnode. */ @@ -328,7 +323,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) if (error != 0) { UNIONFSDEBUG( "unionfs_lookup: Unable to create unionfs vnode."); - goto unionfs_lookup_out; + goto unionfs_lookup_cleanup; } if ((nameiop == DELETE || nameiop == RENAME) && (cnp->cn_lkflags & LK_TYPE_MASK) == 0) @@ -340,7 +335,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) if ((cnflags & MAKEENTRY) && vp->v_type != VSOCK) cache_enter(dvp, vp, cnp); -unionfs_lookup_out: +unionfs_lookup_cleanup: if (uvp != NULLVP) vrele(uvp); if (lvp != NULLVP) @@ -349,6 +344,12 @@ unionfs_lookup_out: if (error == ENOENT && (cnflags & MAKEENTRY) != 0) cache_enter(dvp, NULLVP, cnp); +unionfs_lookup_return: + + /* Ensure subsequent vnops will get a valid pathname buffer. */ + if (nameiop != LOOKUP && (error == 0 || error == EJUSTRETURN)) + cnp->cn_flags |= SAVENAME; + UNIONFS_INTERNAL_DEBUG("unionfs_lookup: leave (%d)\n", error); return (error); @@ -1372,7 +1373,7 @@ unionfs_mkdir(struct vop_mkdir_args *ap) error = VOP_GETATTR(udvp, &va, cnp->cn_cred); if (error != 0) return (error); - if (va.va_flags & OPAQUE) + if ((va.va_flags & OPAQUE) != 0) cnp->cn_flags |= ISWHITEOUT; } @@ -1434,7 +1435,7 @@ unionfs_rmdir(struct vop_rmdir_args *ap) if (ump->um_whitemode == UNIONFS_WHITE_ALWAYS || lvp != NULLVP) cnp->cn_flags |= DOWHITEOUT; error = unionfs_relookup_for_delete(ap->a_dvp, cnp, td); - if (!error) + if (error == 0) error = VOP_RMDIR(udvp, uvp, cnp); } else if (lvp != NULLVP) From nobody Thu Oct 14 13:31:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0E0EF17F2EBF; Thu, 14 Oct 2021 13:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVVfK6wJSz3NrZ; Thu, 14 Oct 2021 13:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEB0C14157; Thu, 14 Oct 2021 13:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EDV5YG029620; Thu, 14 Oct 2021 13:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EDV5M4029619; Thu, 14 Oct 2021 13:31:05 GMT (envelope-from git) Date: Thu, 14 Oct 2021 13:31:05 GMT Message-Id: <202110141331.19EDV5M4029619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 0a8159d8ca85 - main - ng_ppp(4): Fix a typo in a comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a8159d8ca85383ec84076396c0a457c6d3e08f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0a8159d8ca85383ec84076396c0a457c6d3e08f9 commit 0a8159d8ca85383ec84076396c0a457c6d3e08f9 Author: Gordon Bergling AuthorDate: 2021-10-14 13:30:32 +0000 Commit: Gordon Bergling CommitDate: 2021-10-14 13:30:32 +0000 ng_ppp(4): Fix a typo in a comment - s/delcared/declared/ MFC after: 3 days --- sys/netgraph/ng_ppp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c index eb639aa3d900..c9cb28fd9d04 100644 --- a/sys/netgraph/ng_ppp.c +++ b/sys/netgraph/ng_ppp.c @@ -1514,7 +1514,7 @@ done: * is increased. * * o If we receive a fragment with seq# < MSEQ, we throw it away - * because we've already delcared it lost. + * because we've already declared it lost. * * This assumes linkNum != NG_PPP_BUNDLE_LINKNUM. */ From nobody Thu Oct 14 13:46:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E0E3A17F95FE; Thu, 14 Oct 2021 13:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVVzz5zCjz3jg7; Thu, 14 Oct 2021 13:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACE1B1470E; Thu, 14 Oct 2021 13:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EDkN2O047917; Thu, 14 Oct 2021 13:46:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EDkNsK047916; Thu, 14 Oct 2021 13:46:23 GMT (envelope-from git) Date: Thu, 14 Oct 2021 13:46:23 GMT Message-Id: <202110141346.19EDkNsK047916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 76384bd10fdb - main - powerpc64: fix OFWFB with Radix MMU List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76384bd10fdbb97be2803d969905f15a84255d6a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=76384bd10fdbb97be2803d969905f15a84255d6a commit 76384bd10fdbb97be2803d969905f15a84255d6a Author: Leandro Lupori AuthorDate: 2021-10-14 13:39:52 +0000 Commit: Leandro Lupori CommitDate: 2021-10-14 13:39:52 +0000 powerpc64: fix OFWFB with Radix MMU Current implementation of Radix MMU doesn't support mapping arbitrary virtual addresses, such as the ones generated by "direct mapping" I/O addresses. This caused the system to hang, when early I/O addresses, such as those used by OpenFirmware Frame Buffer, were remapped after the MMU was up. To avoid having to modify mmu_radix_kenter_attr just to support this use case, this change makes early I/O map use virtual addresses from KVA area instead (similar to what mmu_radix_mapdev_attr does), as these can be safely remapped later. Reviewed by: alfredo (earlier version), jhibbits (in irc) MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31232 --- sys/powerpc/aim/aim_machdep.c | 42 +++++++++++++++++++++++++++++++++--------- sys/powerpc/aim/mmu_radix.c | 8 +------- sys/powerpc/include/pmap.h | 3 +++ sys/powerpc/powerpc/machdep.c | 9 +++++++++ 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/sys/powerpc/aim/aim_machdep.c b/sys/powerpc/aim/aim_machdep.c index d582489d9f7e..914296440104 100644 --- a/sys/powerpc/aim/aim_machdep.c +++ b/sys/powerpc/aim/aim_machdep.c @@ -476,14 +476,9 @@ aim_cpu_init(vm_offset_t toc) * in case the platform module had a better idea of what we * should do. */ - if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - radix_mmu = 0; - TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); - if (radix_mmu) - pmap_mmu_install(MMU_TYPE_RADIX, BUS_PROBE_GENERIC); - else - pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); - } else if (cpu_features & PPC_FEATURE_64) + if (radix_mmu) + pmap_mmu_install(MMU_TYPE_RADIX, BUS_PROBE_GENERIC); + else if (cpu_features & PPC_FEATURE_64) pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); else pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); @@ -586,6 +581,25 @@ va_to_vsid(pmap_t pm, vm_offset_t va) #endif +void +pmap_early_io_map_init(void) +{ + if ((cpu_features2 & PPC_FEATURE2_ARCH_3_00) == 0) + radix_mmu = 0; + else + TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); + + /* + * When using Radix, set the start and end of kva early, to be able to + * use KVAs on pmap_early_io_map and avoid issues when remapping them + * later. + */ + if (radix_mmu) { + virtual_avail = VM_MIN_KERNEL_ADDRESS; + virtual_end = VM_MAX_SAFE_KERNEL_ADDRESS; + } +} + /* * These functions need to provide addresses that both (a) work in real mode * (or whatever mode/circumstances the kernel is in in early boot (now)) and @@ -601,10 +615,20 @@ pmap_early_io_map(vm_paddr_t pa, vm_size_t size) * If we have the MMU up in early boot, assume it is 1:1. Otherwise, * try to get the address in a memory region compatible with the * direct map for efficiency later. + * Except for Radix MMU, for which current implementation doesn't + * support mapping arbitrary virtual addresses, such as the ones + * generated by "direct mapping" I/O addresses. In this case, use + * addresses from KVA area. */ if (mfmsr() & PSL_DR) return (pa); - else + else if (radix_mmu) { + vm_offset_t va; + + va = virtual_avail; + virtual_avail += round_page(size + pa - trunc_page(pa)); + return (va); + } else return (DMAP_BASE_ADDRESS + pa); } diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 50c658e58a4a..ca1a4d2f4797 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -907,7 +907,7 @@ kvtopte(vm_offset_t va) pt_entry_t *l3e; l3e = pmap_pml3e(kernel_pmap, va); - if ((be64toh(*l3e) & RPTE_VALID) == 0) + if (l3e == NULL || (be64toh(*l3e) & RPTE_VALID) == 0) return (NULL); return (pmap_l3e_to_pte(l3e, va)); } @@ -2071,12 +2071,6 @@ mmu_radix_late_bootstrap(vm_offset_t start, vm_offset_t end) for (i = 0; phys_avail[i + 2] != 0; i += 2) Maxmem = MAX(Maxmem, powerpc_btop(phys_avail[i + 1])); - /* - * Set the start and end of kva. - */ - virtual_avail = VM_MIN_KERNEL_ADDRESS; - virtual_end = VM_MAX_SAFE_KERNEL_ADDRESS; - /* * Remap any early IO mappings (console framebuffer, etc.) */ diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h index 2f1886a27093..d14398750080 100644 --- a/sys/powerpc/include/pmap.h +++ b/sys/powerpc/include/pmap.h @@ -340,6 +340,9 @@ extern int pmap_bootstrapped; extern int radix_mmu; extern int superpages_enabled; +#ifdef AIM +void pmap_early_io_map_init(void); +#endif vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size); void pmap_early_io_unmap(vm_offset_t va, vm_size_t size); void pmap_track_page(pmap_t pmap, vm_offset_t va); diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 622af17b3305..2dc9a3e9d549 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -419,6 +419,15 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, if (ofw_bootargs) ofw_parse_bootargs(); +#ifdef AIM + /* + * Early I/O map needs to be initialized before console, in order to + * map frame buffers properly, and after boot args have been parsed, + * to handle tunables properly. + */ + pmap_early_io_map_init(); +#endif + /* * Initialize the console before printing anything. */ From nobody Thu Oct 14 14:25:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8BDE5180B487; Thu, 14 Oct 2021 14:25:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVWsJ66jJz4R2V; Thu, 14 Oct 2021 14:25:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf33.google.com with SMTP id j12so3801008qvk.12; Thu, 14 Oct 2021 07:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hHvhfKzLOxDlgXDH50FElTuOqXiQNj42BPP6FlGLkXs=; b=TrFtu+kxi0AUd5zho6W9nnHwrAgSb0Lp3goxJczJT23tmlToiABUCgHsCf79Akfuar mO2d3SFJfKWNzE+rG5IVgkWdoHjqDb9GxUYZCdwfEGnT3XtI0ZzzlTb3h6jpgGEakmT/ wyNAM9kTG4/wGIlTBLfbNZCN3dNTJlYjlzUOD3tbHFfSEJmQNjoqPWmGHe7XQDT4/oja Li5C1ZgOCSEtZD3tvSKNrG/5HRT3IlS44PpwHEXAhPCb0m0eJjE5Qd84cF4x8xZ0o6R7 w6nqz4nN8KGXoAxzPLrBvvAKbGYmWqx6B8l5fyvvbWSuDXuBvXJSKH1TEYohf2Xk0+cf xmOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=hHvhfKzLOxDlgXDH50FElTuOqXiQNj42BPP6FlGLkXs=; b=sOk5LBN0eFu7X9+rbDUyKOxUd9p28ghyQDUmCbeU2QxM6dIipgk5/XFD1nSlyEMO6j r5AIZLVOEQaJSZ5mCSFRvw61f6QzKkOBhOt8SJ8mzFFPb2BDgKlXBKGTtISYGF5nU7Hi INoYrFleiW0b1rWAG7l2NFxyz/VjlvHjVcw5uocpNXbrIBr5hNFmwNi8gvsw5wDgwcdH N3yHouLBF98T1BinB73lAHaKAMA/Q67G3DorFXViGA+tjgDCN96WdFUk+o4TPDkvQsHV uN22nQCaUQP9ndf3C5r2yDGFFiFrL50+qZqGNP9HADLBDksbfzwZL7tbNj7lpgybiqit zlxQ== X-Gm-Message-State: AOAM533FIFIAIdlSz8ztWX3jeIPd140eBGeeIC/2HTjYKAW9+tM1X/Pj bx7atEuDNxpHniIETmoYeVxzAXe4ccw= X-Google-Smtp-Source: ABdhPJx1wsVSDIu0Q/0aEg+pp9fwyOu8v2RzzAt53ODfm38wtkaUad8Ci9wfPgI3n7kBTenWXMfg+Q== X-Received: by 2002:a05:6214:ac8:: with SMTP id g8mr5743989qvi.32.1634221539997; Thu, 14 Oct 2021 07:25:39 -0700 (PDT) Received: from nuc ([142.126.186.191]) by smtp.gmail.com with ESMTPSA id a201sm1359959qkg.67.2021.10.14.07.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 07:25:39 -0700 (PDT) Sender: Mark Johnston Date: Thu, 14 Oct 2021 10:25:37 -0400 From: Mark Johnston To: Hartmut Brandt Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ded77e0237a8 - main - Allow the BPF to be select for write. This is needed for boost:asio which otherwise fails to handle BPFs. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D31967 Message-ID: References: <202110130754.19D7so0V049456@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110130754.19D7so0V049456@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HVWsJ66jJz4R2V X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=TrFtu+kx; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f33 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [1.82 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; NEURAL_HAM_MEDIUM(-0.04)[-0.036]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; LONG_SUBJ(1.54)[206]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f33:from]; NEURAL_HAM_SHORT(-0.98)[-0.984]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 13, 2021 at 07:54:50AM +0000, Hartmut Brandt wrote: > The branch main has been updated by harti: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ded77e0237a8534230746031f373d8a8ae80cdaa > > commit ded77e0237a8534230746031f373d8a8ae80cdaa > Author: Hartmut Brandt > AuthorDate: 2021-10-10 15:03:51 +0000 > Commit: Hartmut Brandt > CommitDate: 2021-10-10 15:03:51 +0000 > > Allow the BPF to be select for write. This is needed for boost:asio > which otherwise fails to handle BPFs. > Reviewed by: ae > Differential Revision: https://reviews.freebsd.org/D31967 Hi, syzbot found a bug in this change: https://syzkaller.appspot.com/bug?id=a99f705b2b8b854d70ec4d47eed481c90046bd3c It seems that filt_bpfwrite() needs to check whether d->bd_bif == NULL before dereferencing. From nobody Thu Oct 14 14:45:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 411201812F79; Thu, 14 Oct 2021 14:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVXJK15Jqz4X9g; Thu, 14 Oct 2021 14:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04B521541C; Thu, 14 Oct 2021 14:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EEjamK027334; Thu, 14 Oct 2021 14:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EEja1F027333; Thu, 14 Oct 2021 14:45:36 GMT (envelope-from git) Date: Thu, 14 Oct 2021 14:45:36 GMT Message-Id: <202110141445.19EEja1F027333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2ec165e3f065 - main - nvme: Reduce traffic to the doorbell register List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ec165e3f065217ae8d54a2a8235fe1f219805ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ec165e3f065217ae8d54a2a8235fe1f219805ea commit 2ec165e3f065217ae8d54a2a8235fe1f219805ea Author: Warner Losh AuthorDate: 2021-10-14 14:44:37 +0000 Commit: Warner Losh CommitDate: 2021-10-14 14:44:37 +0000 nvme: Reduce traffic to the doorbell register Reduce traffic to doorbell register when processing multiple completion events at once. Only write it at the end of the loop after we've processed everything (assuming we found at least one completion, even if that completion wasn't valid). Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32470 --- sys/dev/nvme/nvme_qpair.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 6669eeee6613..54718492ff09 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -629,10 +629,10 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) else tr = NULL; + done++; if (tr != NULL) { nvme_qpair_complete_tracker(tr, &cpl, ERROR_PRINT_ALL); qpair->sq_head = cpl.sqhd; - done++; } else if (!in_panic) { /* * A missing tracker is normally an error. However, a @@ -664,10 +664,13 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) atomic_store_rel_int(&qpair->cq_head, 0); /* 2 */ qpair->phase = !qpair->phase; /* 3 */ } + } + if (done != 0) { bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle, qpair->cq_hdbl_off, qpair->cq_head); } + return (done != 0); } From nobody Thu Oct 14 15:21:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C053417FA57B; Thu, 14 Oct 2021 15:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVY6451PPz4jjj; Thu, 14 Oct 2021 15:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CD4315A72; Thu, 14 Oct 2021 15:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EFLmCA079488; Thu, 14 Oct 2021 15:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EFLmGf079487; Thu, 14 Oct 2021 15:21:48 GMT (envelope-from git) Date: Thu, 14 Oct 2021 15:21:48 GMT Message-Id: <202110141521.19EFLmGf079487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 168b579a4884 - main - Fix RISC-V build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 168b579a4884ab44833b758d9e770c87a37025fc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=168b579a4884ab44833b758d9e770c87a37025fc commit 168b579a4884ab44833b758d9e770c87a37025fc Author: Li-Wen Hsu AuthorDate: 2021-10-14 15:20:12 +0000 Commit: Li-Wen Hsu CommitDate: 2021-10-14 15:20:12 +0000 Fix RISC-V build Fixes: d5fd5cdc063 --- tests/sys/netgraph/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netgraph/hub.c b/tests/sys/netgraph/hub.c index 9a5ba74b2ad5..5fda9b8c7688 100644 --- a/tests/sys/netgraph/hub.c +++ b/tests/sys/netgraph/hub.c @@ -128,7 +128,7 @@ ATF_TC_BODY(loop, dummy) char msg[] = "LOOP Alert!"; #if defined(__riscv) - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + if (atf_tc_get_config_var_as_bool_wd(dummy, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/259157"); #endif From nobody Thu Oct 14 16:17:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E917517F02B4; Thu, 14 Oct 2021 16:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVZLB63cWz3D4j; Thu, 14 Oct 2021 16:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB44B163D3; Thu, 14 Oct 2021 16:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EGHMZW047701; Thu, 14 Oct 2021 16:17:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EGHMtY047700; Thu, 14 Oct 2021 16:17:22 GMT (envelope-from git) Date: Thu, 14 Oct 2021 16:17:22 GMT Message-Id: <202110141617.19EGHMtY047700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 8ecf9a8bab60 - main - powerpc64: make radix with superpages default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ecf9a8bab608c26cb100f393b24e883a706ff03 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=8ecf9a8bab608c26cb100f393b24e883a706ff03 commit 8ecf9a8bab608c26cb100f393b24e883a706ff03 Author: Leandro Lupori AuthorDate: 2021-10-14 16:13:27 +0000 Commit: Leandro Lupori CommitDate: 2021-10-14 16:13:27 +0000 powerpc64: make radix with superpages default As Radix MMU with superpages enabled is now stable, make it the default choice on supported hardware (POWER9 and above), since its performance is greater than that of HPT MMU. Reviewed by: alfredo, jhibbits Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D30797 --- stand/powerpc/ofw/cas.c | 6 +++--- sys/powerpc/aim/aim_machdep.c | 4 +++- sys/powerpc/powerpc/pmap_dispatch.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/stand/powerpc/ofw/cas.c b/stand/powerpc/ofw/cas.c index 4f36a147f36d..6292e04794a8 100644 --- a/stand/powerpc/ofw/cas.c +++ b/stand/powerpc/ofw/cas.c @@ -232,10 +232,10 @@ ppc64_cas(void) } } - if (radix_mmu && (var = getenv("radix_mmu")) != NULL && var[0] != '0') - ov5[OV5_MMU_INDEX] = OV5_MMU_RADIX; - else + if ((var = getenv("radix_mmu")) != NULL && var[0] == '0') radix_mmu = 0; + if (radix_mmu) + ov5[OV5_MMU_INDEX] = OV5_MMU_RADIX; inst = OF_open("/"); if (inst == -1) { diff --git a/sys/powerpc/aim/aim_machdep.c b/sys/powerpc/aim/aim_machdep.c index 914296440104..c5f84675ebd3 100644 --- a/sys/powerpc/aim/aim_machdep.c +++ b/sys/powerpc/aim/aim_machdep.c @@ -586,8 +586,10 @@ pmap_early_io_map_init(void) { if ((cpu_features2 & PPC_FEATURE2_ARCH_3_00) == 0) radix_mmu = 0; - else + else { + radix_mmu = 1; TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); + } /* * When using Radix, set the start and end of kva early, to be able to diff --git a/sys/powerpc/powerpc/pmap_dispatch.c b/sys/powerpc/powerpc/pmap_dispatch.c index 5a47b6d8bf31..8aa09811c95b 100644 --- a/sys/powerpc/powerpc/pmap_dispatch.c +++ b/sys/powerpc/powerpc/pmap_dispatch.c @@ -83,7 +83,7 @@ int vm_level_0_order = 9; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -int superpages_enabled = 0; +int superpages_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, CTLFLAG_RDTUN, &superpages_enabled, 0, "Enable support for transparent superpages"); From nobody Thu Oct 14 16:19:38 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 26D9317F1792; Thu, 14 Oct 2021 16:19:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVZNq0bpdz3DxD; Thu, 14 Oct 2021 16:19:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E55B61671F; Thu, 14 Oct 2021 16:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EGJc2g047979; Thu, 14 Oct 2021 16:19:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EGJchJ047978; Thu, 14 Oct 2021 16:19:38 GMT (envelope-from git) Date: Thu, 14 Oct 2021 16:19:38 GMT Message-Id: <202110141619.19EGJchJ047978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1b85b68da0b2de80e0e3aefb1ade226bcf3951cb commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb Author: Cameron Katri AuthorDate: 2021-10-14 16:00:27 +0000 Commit: Alex Richardson CommitDate: 2021-10-14 16:18:05 +0000 llvm-readobj: Attach to buildsystem Also install it as readelf when MK_LLVM_BINUTILS is set. Reviewed By: dim, arichardson Differential Revision: https://reviews.freebsd.org/D32058 --- lib/clang/libllvm/Makefile | 21 +- tools/build/mk/OptionalObsoleteFiles.inc | 4 + usr.bin/clang/Makefile | 1 + usr.bin/clang/llvm-readobj/Makefile | 31 +++ usr.bin/clang/llvm-readobj/llvm-readelf.1 | 272 ++++++++++++++++++++ usr.bin/clang/llvm-readobj/llvm-readobj.1 | 403 ++++++++++++++++++++++++++++++ 6 files changed, 724 insertions(+), 8 deletions(-) diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 7eaedf65dcb3..cb9ab974abc5 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -148,9 +148,13 @@ SRCS_MIN+= Analysis/VectorUtils.cpp SRCS_MIN+= AsmParser/LLLexer.cpp SRCS_MIN+= AsmParser/LLParser.cpp SRCS_MIN+= AsmParser/Parser.cpp +SRCS_MIN+= BinaryFormat/AMDGPUMetadataVerifier.cpp SRCS_MIN+= BinaryFormat/Dwarf.cpp SRCS_MIN+= BinaryFormat/Magic.cpp SRCS_MIN+= BinaryFormat/MachO.cpp +SRCS_MIN+= BinaryFormat/MsgPackDocument.cpp +SRCS_MIN+= BinaryFormat/MsgPackDocumentYAML.cpp +SRCS_MIN+= BinaryFormat/MsgPackReader.cpp SRCS_MIN+= BinaryFormat/Wasm.cpp SRCS_MIN+= BinaryFormat/XCOFF.cpp SRCS_MIN+= Bitcode/Reader/BitReader.cpp @@ -434,14 +438,14 @@ SRCS_MIN+= DebugInfo/CodeView/CVTypeVisitor.cpp SRCS_MIN+= DebugInfo/CodeView/CodeViewError.cpp SRCS_MIN+= DebugInfo/CodeView/CodeViewRecordIO.cpp SRCS_MIN+= DebugInfo/CodeView/ContinuationRecordBuilder.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugChecksumsSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugChecksumsSubsection.cpp SRCS_EXT+= DebugInfo/CodeView/DebugCrossExSubsection.cpp SRCS_EXT+= DebugInfo/CodeView/DebugCrossImpSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugFrameDataSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugLinesSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugStringTableSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugFrameDataSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugLinesSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugStringTableSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugSubsection.cpp SRCS_EXT+= DebugInfo/CodeView/DebugSubsectionRecord.cpp SRCS_EXT+= DebugInfo/CodeView/DebugSubsectionVisitor.cpp SRCS_EXT+= DebugInfo/CodeView/DebugSymbolRVASubsection.cpp @@ -449,9 +453,9 @@ SRCS_EXT+= DebugInfo/CodeView/DebugSymbolsSubsection.cpp SRCS_MIN+= DebugInfo/CodeView/EnumTables.cpp SRCS_MIN+= DebugInfo/CodeView/Formatters.cpp SRCS_MIN+= DebugInfo/CodeView/GlobalTypeTableBuilder.cpp -SRCS_EXT+= DebugInfo/CodeView/LazyRandomTypeCollection.cpp +SRCS_MIN+= DebugInfo/CodeView/LazyRandomTypeCollection.cpp SRCS_MIN+= DebugInfo/CodeView/Line.cpp -SRCS_EXT+= DebugInfo/CodeView/MergingTypeTableBuilder.cpp +SRCS_MIN+= DebugInfo/CodeView/MergingTypeTableBuilder.cpp SRCS_MIN+= DebugInfo/CodeView/RecordName.cpp SRCS_MIN+= DebugInfo/CodeView/RecordSerialization.cpp SRCS_MIN+= DebugInfo/CodeView/SimpleTypeSerializer.cpp @@ -889,6 +893,7 @@ SRCS_MIN+= Support/APSInt.cpp SRCS_MIN+= Support/ARMAttributeParser.cpp SRCS_MIN+= Support/ARMBuildAttrs.cpp SRCS_MIN+= Support/ARMTargetParser.cpp +SRCS_MIN+= Support/ARMWinEH.cpp SRCS_MIN+= Support/Allocator.cpp SRCS_MIN+= Support/BinaryStreamError.cpp SRCS_MIN+= Support/BinaryStreamReader.cpp diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index b6a32c18a12d..57f8ac63e2de 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1226,6 +1226,8 @@ OLD_FILES+=usr/bin/llvm-nm OLD_FILES+=usr/bin/llvm-objcopy OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-ranlib +OLD_FILES+=usr/bin/llvm-readelf +OLD_FILES+=usr/bin/llvm-readobj OLD_FILES+=usr/bin/llvm-size OLD_FILES+=usr/bin/llvm-strings OLD_FILES+=usr/bin/llvm-symbolizer @@ -1234,6 +1236,8 @@ OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz OLD_FILES+=usr/share/man/man1/llvm-objcopy.1.gz OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz +OLD_FILES+=usr/share/man/man1/llvm-readelf.1.gz +OLD_FILES+=usr/share/man/man1/llvm-readobj.1.gz OLD_FILES+=usr/share/man/man1/llvm-size.1.gz OLD_FILES+=usr/share/man/man1/llvm-strings.1.gz OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile index 7fc31e8df194..b7acb7e6c6db 100644 --- a/usr.bin/clang/Makefile +++ b/usr.bin/clang/Makefile @@ -15,6 +15,7 @@ SUBDIR+= llvm-ar SUBDIR+= llvm-nm SUBDIR+= llvm-objcopy SUBDIR+= llvm-objdump +SUBDIR+= llvm-readobj SUBDIR+= llvm-size SUBDIR+= llvm-strings SUBDIR+= llvm-symbolizer diff --git a/usr.bin/clang/llvm-readobj/Makefile b/usr.bin/clang/llvm-readobj/Makefile new file mode 100644 index 000000000000..71116fcc3955 --- /dev/null +++ b/usr.bin/clang/llvm-readobj/Makefile @@ -0,0 +1,31 @@ +# $FreeBSD$ + +.include + +PROG_CXX= llvm-readobj +MAN= llvm-readobj.1 llvm-readelf.1 + +SRCDIR= llvm/tools/llvm-readobj +SRCS+= ARMWinEHPrinter.cpp +SRCS+= COFFDumper.cpp +SRCS+= COFFImportDumper.cpp +SRCS+= ELFDumper.cpp +SRCS+= llvm-readobj.cpp +SRCS+= MachODumper.cpp +SRCS+= ObjDumper.cpp +SRCS+= WasmDumper.cpp +SRCS+= Win64EHDumper.cpp +SRCS+= WindowsResourceDumper.cpp +SRCS+= XCOFFDumper.cpp + +LIBADD+= z + +LINKS+= ${BINDIR}/llvm-readobj ${BINDIR}/llvm-readelf +MLINKS= llvm-readobj.1 + +.if ${MK_LLVM_BINUTILS} != "no" +LINKS+= ${BINDIR}/llvm-readelf ${BINDIR}/readelf +MLINKS+= llvm-readelf.1 readelf.1 +.endif + +.include "../llvm.prog.mk" diff --git a/usr.bin/clang/llvm-readobj/llvm-readelf.1 b/usr.bin/clang/llvm-readobj/llvm-readelf.1 new file mode 100644 index 000000000000..9bfaf88409d7 --- /dev/null +++ b/usr.bin/clang/llvm-readobj/llvm-readelf.1 @@ -0,0 +1,272 @@ +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.TH "LLVM-READELF" "1" "2021-09-22" "12" "LLVM" +.SH NAME +llvm-readelf \- GNU-style LLVM Object Reader +.SH SYNOPSIS +.sp +\fBllvm\-readelf\fP [\fIoptions\fP] [\fIinput...\fP] +.SH DESCRIPTION +.sp +The \fBllvm\-readelf\fP tool displays low\-level format\-specific information +about one or more object files. +.sp +If \fBinput\fP is "\fB\-\fP", \fBllvm\-readelf\fP reads from standard +input. Otherwise, it will read from the specified \fBfilenames\fP\&. +.SH OPTIONS +.INDENT 0.0 +.TP +.B \-\-all +Equivalent to specifying all the main display options. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-addrsig +Display the address\-significance table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-arch\-specific, \-A +Display architecture\-specific information, e.g. the ARM attributes section on ARM. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-color +Use colors in the output for warnings and errors. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-demangle, \-C +Display demangled symbol names in the output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dyn\-relocations +Display the dynamic relocation entries. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dyn\-symbols, \-\-dyn\-syms +Display the dynamic symbol table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dynamic\-table, \-\-dynamic, \-d +Display the dynamic table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cg\-profile +Display the callgraph profile section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-hash\-histogram, \-\-histogram, \-I +Display a bucket list histogram for dynamic symbol hash tables. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-linker\-options +Display the linker options section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-output\-style= +Format ELF information in the specified style. Valid options are \fBLLVM\fP and +\fBGNU\fP\&. \fBLLVM\fP output is an expanded and structured format, whilst \fBGNU\fP +(the default) output mimics the equivalent GNU \fBreadelf\fP output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-section\-groups, \-\-section\-groups, \-g +Display section groups. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-expand\-relocs +When used with \fI\%\-\-relocations\fP, display each relocation in an expanded +multi\-line format. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-file\-headers, \-h +Display file headers. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-gnu\-hash\-table +Display the GNU hash table for dynamic symbols. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hash\-symbols +Display the expanded hash table with dynamic symbol data. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hash\-table +Display the hash table for dynamic symbols. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-headers, \-e +Equivalent to setting: \fI\%\-\-file\-headers\fP, \fI\%\-\-program\-headers\fP, +and \fI\%\-\-sections\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-help +Display a summary of command line options. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-help\-list +Display an uncategorized summary of command line options. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hex\-dump=, \-x +Display the specified section(s) as hexadecimal bytes. \fBsection\fP may be a +section index or section name. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-needed\-libs +Display the needed libraries. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-notes, \-n +Display all notes. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-program\-headers, \-\-segments, \-l +Display the program headers. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-raw\-relr +Do not decode relocations in RELR relocation sections when displaying them. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-relocations, \-\-relocs, \-r +Display the relocation entries in the file. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-sections, \-\-section\-headers, \-S +Display all sections. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-data +When used with \fI\%\-\-sections\fP, display section data for each section +shown. This option has no effect for GNU style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-details, \-t +Display all section details. Used as an alternative to \fI\%\-\-sections\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-mapping +Display the section to segment mapping. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-relocations +When used with \fI\%\-\-sections\fP, display relocations for each section +shown. This option has no effect for GNU style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-symbols +When used with \fI\%\-\-sections\fP, display symbols for each section shown. +This option has no effect for GNU style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stackmap +Display contents of the stackmap section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stack\-sizes +Display the contents of the stack sizes section(s), i.e. pairs of function +names and the size of their stack frames. Currently only implemented for GNU +style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-string\-dump=, \-p +Display the specified section(s) as a list of strings. \fBsection\fP may be a +section index or section name. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-symbols, \-\-syms, \-s +Display the symbol table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-unwind, \-u +Display unwind information. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-version +Display the version of the \fBllvm\-readelf\fP executable. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-version\-info, \-V +Display version sections. +.UNINDENT +.INDENT 0.0 +.TP +.B @ +Read command\-line options from response file \fI\fP\&. +.UNINDENT +.SH EXIT STATUS +.sp +\fBllvm\-readelf\fP returns 0 under normal operation. It returns a non\-zero +exit code if there were any errors. +.SH SEE ALSO +.sp +\fBllvm\-nm(1)\fP, \fBllvm\-objdump(1)\fP, \fBllvm\-readobj(1)\fP +.SH AUTHOR +Maintained by the LLVM Team (https://llvm.org/). +.SH COPYRIGHT +2003-2021, LLVM Project +.\" Generated by docutils manpage writer. +. diff --git a/usr.bin/clang/llvm-readobj/llvm-readobj.1 b/usr.bin/clang/llvm-readobj/llvm-readobj.1 new file mode 100644 index 000000000000..5b0597e22048 --- /dev/null +++ b/usr.bin/clang/llvm-readobj/llvm-readobj.1 @@ -0,0 +1,403 @@ +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.TH "LLVM-READOBJ" "1" "2021-09-22" "12" "LLVM" +.SH NAME +llvm-readobj \- LLVM Object Reader +.SH SYNOPSIS +.sp +\fBllvm\-readobj\fP [\fIoptions\fP] [\fIinput...\fP] +.SH DESCRIPTION +.sp +The \fBllvm\-readobj\fP tool displays low\-level format\-specific information +about one or more object files. +.sp +If \fBinput\fP is "\fB\-\fP", \fBllvm\-readobj\fP reads from standard +input. Otherwise, it will read from the specified \fBfilenames\fP\&. +.SH DIFFERENCES TO LLVM-READELF +.sp +\fBllvm\-readelf\fP is an alias for the \fBllvm\-readobj\fP tool with a +slightly different command\-line interface and output that is GNU compatible. +Following is a list of differences between \fBllvm\-readelf\fP and +\fBllvm\-readobj\fP: +.INDENT 0.0 +.IP \(bu 2 +\fBllvm\-readelf\fP uses \fIGNU\fP for the \fI\%\-\-elf\-output\-style\fP option +by default. \fBllvm\-readobj\fP uses \fILLVM\fP\&. +.IP \(bu 2 +\fBllvm\-readelf\fP allows single\-letter grouped flags (e.g. +\fBllvm\-readelf \-SW\fP is the same as \fBllvm\-readelf \-S \-W\fP). +\fBllvm\-readobj\fP does not allow grouping. +.IP \(bu 2 +\fBllvm\-readelf\fP provides \fI\%\-s\fP as an alias for +\fI\%\-\-symbols\fP, for GNU \fBreadelf\fP compatibility, whereas it is +an alias for \fI\%\-\-section\-headers\fP in \fBllvm\-readobj\fP\&. +.IP \(bu 2 +\fBllvm\-readobj\fP provides \fB\-t\fP as an alias for \fI\%\-\-symbols\fP\&. +\fBllvm\-readelf\fP does not. +.IP \(bu 2 +\fBllvm\-readobj\fP provides \fB\-\-sr\fP, \fB\-\-sd\fP, \fB\-\-st\fP and \fB\-\-dt\fP as +aliases for \fI\%\-\-section\-relocations\fP, \fI\%\-\-section\-data\fP, +\fI\%\-\-section\-symbols\fP and \fI\%\-\-dyn\-symbols\fP respectively. +\fBllvm\-readelf\fP does not provide these aliases, to avoid conflicting +with grouped flags. +.UNINDENT +.SH GENERAL AND MULTI-FORMAT OPTIONS +.sp +These options are applicable to more than one file format, or are unrelated to +file formats. +.INDENT 0.0 +.TP +.B \-\-all +Equivalent to specifying all the main display options relevant to the file +format. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-addrsig +Display the address\-significance table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-color +Use colors in the output for warnings and errors. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-expand\-relocs +When used with \fI\%\-\-relocations\fP, display each relocation in an expanded +multi\-line format. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-file\-headers, \-h +Display file headers. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-headers, \-e +Equivalent to setting: \fI\%\-\-file\-headers\fP, \fI\%\-\-program\-headers\fP, +and \fI\%\-\-sections\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-help +Display a summary of command line options. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-help\-list +Display an uncategorized summary of command line options. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hex\-dump=, \-x +Display the specified section(s) as hexadecimal bytes. \fBsection\fP may be a +section index or section name. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-needed\-libs +Display the needed libraries. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-relocations, \-\-relocs, \-r +Display the relocation entries in the file. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-sections, \-\-section\-headers, \-s, \-S +Display all sections. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-data, \-\-sd +When used with \fI\%\-\-sections\fP, display section data for each section +shown. This option has no effect for GNU style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-relocations, \-\-sr +When used with \fI\%\-\-sections\fP, display relocations for each section +shown. This option has no effect for GNU style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-symbols, \-\-st +When used with \fI\%\-\-sections\fP, display symbols for each section shown. +This option has no effect for GNU style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stackmap +Display contents of the stackmap section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-string\-dump=, \-p +Display the specified section(s) as a list of strings. \fBsection\fP may be a +section index or section name. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-symbols, \-\-syms, \-t +Display the symbol table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-unwind, \-u +Display unwind information. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-version +Display the version of the \fBllvm\-readobj\fP executable. +.UNINDENT +.INDENT 0.0 +.TP +.B @ +Read command\-line options from response file \fI\fP\&. +.UNINDENT +.SH ELF SPECIFIC OPTIONS +.sp +The following options are implemented only for the ELF file format. +.INDENT 0.0 +.TP +.B \-\-arch\-specific, \-A +Display architecture\-specific information, e.g. the ARM attributes section on ARM. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-demangle, \-C +Display demangled symbol names in the output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dependent\-libraries +Display the dependent libraries section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dyn\-relocations +Display the dynamic relocation entries. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dyn\-symbols, \-\-dyn\-syms, \-\-dt +Display the dynamic symbol table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dynamic\-table, \-\-dynamic, \-d +Display the dynamic table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-cg\-profile +Display the callgraph profile section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-hash\-histogram, \-\-histogram, \-I +Display a bucket list histogram for dynamic symbol hash tables. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-linker\-options +Display the linker options section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-output\-style= +Format ELF information in the specified style. Valid options are \fBLLVM\fP and +\fBGNU\fP\&. \fBLLVM\fP output (the default) is an expanded and structured format, +whilst \fBGNU\fP output mimics the equivalent GNU \fBreadelf\fP output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-elf\-section\-groups, \-\-section\-groups, \-g +Display section groups. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-gnu\-hash\-table +Display the GNU hash table for dynamic symbols. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hash\-symbols +Display the expanded hash table with dynamic symbol data. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hash\-table +Display the hash table for dynamic symbols. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-notes, \-n +Display all notes. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-program\-headers, \-\-segments, \-l +Display the program headers. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-raw\-relr +Do not decode relocations in RELR relocation sections when displaying them. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-section\-mapping +Display the section to segment mapping. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stack\-sizes +Display the contents of the stack sizes section(s), i.e. pairs of function +names and the size of their stack frames. Currently only implemented for GNU +style output. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-version\-info, \-V +Display version sections. +.UNINDENT +.SH MACH-O SPECIFIC OPTIONS +.sp +The following options are implemented only for the Mach\-O file format. +.INDENT 0.0 +.TP +.B \-\-macho\-data\-in\-code +Display the Data in Code command. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-macho\-dsymtab +Display the Dsymtab command. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-macho\-indirect\-symbols +Display indirect symbols. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-macho\-linker\-options +Display the Mach\-O\-specific linker options. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-macho\-segment +Display the Segment command. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-macho\-version\-min +Display the version min command. +.UNINDENT +.SH PE/COFF SPECIFIC OPTIONS +.sp +The following options are implemented only for the PE/COFF file format. +.INDENT 0.0 +.TP +.B \-\-codeview +Display CodeView debug information. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-codeview\-ghash +Enable global hashing for CodeView type stream de\-duplication. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-codeview\-merged\-types +Display the merged CodeView type stream. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-codeview\-subsection\-bytes +Dump raw contents of CodeView debug sections and records. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-basereloc +Display the .reloc section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-debug\-directory +Display the debug directory. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-tls\-directory +Display the TLS directory. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-directives +Display the .drectve section. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-exports +Display the export table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-imports +Display the import table. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-load\-config +Display the load config. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-coff\-resources +Display the .rsrc section. +.UNINDENT +.SH EXIT STATUS +.sp +\fBllvm\-readobj\fP returns 0 under normal operation. It returns a non\-zero +exit code if there were any errors. +.SH SEE ALSO +.sp +\fBllvm\-nm(1)\fP, \fBllvm\-objdump(1)\fP, \fBllvm\-readelf(1)\fP +.SH AUTHOR +Maintained by the LLVM Team (https://llvm.org/). +.SH COPYRIGHT +2003-2021, LLVM Project +.\" Generated by docutils manpage writer. +. From nobody Thu Oct 14 16:41:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5D4D517FA5FE for ; Thu, 14 Oct 2021 16:41:55 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVZtW1qQgz3LcG for ; Thu, 14 Oct 2021 16:41:55 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f41.google.com with SMTP id g25so21301971wrb.2 for ; Thu, 14 Oct 2021 09:41:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=So5G9cn4TisuBvsr7HA79MRraS13aQGxRYTlIbQSf8c=; b=0YtcUT9xLdapOvieBEqTHlb/8IQqdcHtokOPOmmUUdV3kOX5JODb8WgVgkVI9kv/8q 7VL7O43graRIA7Dak3sfZ9LhM47IQIH75uT3RMhvNk1a6fSHMVBqk1t9cyriXWfzUXrz XY/aA/VZ05r/r+lCMZz4DOEIGvsFZDodH8vMOHQ9yFiDWxlohvpJJNuN7r1chowmaKdn 5QHZtLmoitHQjrmBeH1GEH5/qmmwt69CRnnYiIRCbmGJkO4AKTeEA1lDPL7A2ubJ5qg5 px3rfYYVSnP0K+I7zU5NeDEQDsy/9f+ueJ7sM91NfZBH1soz6wKvefn7HCPrDL/583RG QSbA== X-Gm-Message-State: AOAM532NFip6TZyelCBxIIW4gi3y2ajYvUES2vaPOeoEAY5yvMxvu4KW 8M8nYog3Pz3MnUDiNNXON9BpKw== X-Google-Smtp-Source: ABdhPJwwiYjx+0qD4+kG0SQZa+sQea/YCTc5Cq/hQU88PgGaMS6KsbmJnkWUhNB3PVPXhRW68qC8dw== X-Received: by 2002:a1c:1d8d:: with SMTP id d135mr21069292wmd.191.1634229708352; Thu, 14 Oct 2021 09:41:48 -0700 (PDT) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id a2sm2815896wru.82.2021.10.14.09.41.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Oct 2021 09:41:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem From: Jessica Clarke In-Reply-To: <202110141619.19EGJchJ047978@gitrepo.freebsd.org> Date: Thu, 14 Oct 2021 17:41:47 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202110141619.19EGJchJ047978@gitrepo.freebsd.org> To: Alex Richardson X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HVZtW1qQgz3LcG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 14 Oct 2021, at 17:19, Alex Richardson = wrote: >=20 > The branch main has been updated by arichardson: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D1b85b68da0b2de80e0e3aefb1ade226b= cf3951cb >=20 > commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb > Author: Cameron Katri > AuthorDate: 2021-10-14 16:00:27 +0000 > Commit: Alex Richardson > CommitDate: 2021-10-14 16:18:05 +0000 >=20 > llvm-readobj: Attach to buildsystem >=20 > Also install it as readelf when MK_LLVM_BINUTILS is set. >=20 > Reviewed By: dim, arichardson > Differential Revision: https://reviews.freebsd.org/D32058 MFC to stable/13 intended like the other MK_LLVM_BINUTILS patches? Jess From nobody Thu Oct 14 16:43:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EF57817FCAD1; Thu, 14 Oct 2021 16:43:26 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVZwG5vyWz3MwZ; Thu, 14 Oct 2021 16:43:26 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f47.google.com with SMTP id y30so9760668edi.0; Thu, 14 Oct 2021 09:43:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=naGowrc/NxiyouOnEeoSAoRoCcSy21PNQXULVSo2XOQ=; b=NBnQUcMgysWYJbdEbhvCw415NqyAGAER8DMQJJkHNZ9bj2Jf0bfLz1rVfdxoEuQvrc JKakYN1tAFlFA1EMJ75fXB97BzwTXLKoAuA/xb8N9Ib7VsprypZuTLtd2UkLiXBZjiB8 XyIDeardBO5VZccJjIOqRKzYfHZ1yiWw57APx20KdvcyE2xTpb103OP0HNuxU/Wl44ww fUJxW5O/fKH0Z6X8B8S9KKR4MUiBuVGGrSVso74JMTLyVUBpfUo7EyRYK28+/ZubXop7 DUDksSK45rAdD5OFtyDzK1eql3Eo6zgdKaMmccgRgkZJ1TR0GUTOlaI2XFCMmG1D2FmS Txkg== X-Gm-Message-State: AOAM531AxDCOh8zgOViAftzyu+yibGzOnuZBO/n8dL0ai+lNlRxfPVJE VTQ0/itH1FZUMSTX8NnZryVCDbW2PvpGsg== X-Google-Smtp-Source: ABdhPJytiRZdLVCkXuZqDUQs+qW3LqmpuFVEaFb9y4sa81HZKnDATPwOGf2xfXEInhEG4isiUVYoXg== X-Received: by 2002:a17:906:4fc7:: with SMTP id i7mr91380ejw.14.1634229797243; Thu, 14 Oct 2021 09:43:17 -0700 (PDT) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com. [209.85.221.45]) by smtp.gmail.com with ESMTPSA id lb12sm2391859ejc.28.2021.10.14.09.43.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Oct 2021 09:43:17 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id i12so21400661wrb.7; Thu, 14 Oct 2021 09:43:16 -0700 (PDT) X-Received: by 2002:a5d:500f:: with SMTP id e15mr8080185wrt.79.1634229796683; Thu, 14 Oct 2021 09:43:16 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110141619.19EGJchJ047978@gitrepo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Thu, 14 Oct 2021 17:43:05 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HVZwG5vyWz3MwZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, 14 Oct 2021 at 17:41, Jessica Clarke wrote: > > On 14 Oct 2021, at 17:19, Alex Richardson wrote: > > > > The branch main has been updated by arichardson: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1b85b68da0b2de80e0e3aefb1ade226bcf3951cb > > > > commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb > > Author: Cameron Katri > > AuthorDate: 2021-10-14 16:00:27 +0000 > > Commit: Alex Richardson > > CommitDate: 2021-10-14 16:18:05 +0000 > > > > llvm-readobj: Attach to buildsystem > > > > Also install it as readelf when MK_LLVM_BINUTILS is set. > > > > Reviewed By: dim, arichardson > > Differential Revision: https://reviews.freebsd.org/D32058 > > MFC to stable/13 intended like the other MK_LLVM_BINUTILS patches? > > Jess > Yes indeed, this should be MFC'd. Alex From nobody Thu Oct 14 16:46:38 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CC30617FDB45; Thu, 14 Oct 2021 16:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVZzy5SNlz3NvB; Thu, 14 Oct 2021 16:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B42916BB6; Thu, 14 Oct 2021 16:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EGkcjP087991; Thu, 14 Oct 2021 16:46:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EGkcOT087990; Thu, 14 Oct 2021 16:46:38 GMT (envelope-from git) Date: Thu, 14 Oct 2021 16:46:38 GMT Message-Id: <202110141646.19EGkcOT087990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 367ec75323e6 - main - Fix a syntax error in 1b85b68da0b2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 367ec75323e660f7827e960f55688d557291236c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=367ec75323e660f7827e960f55688d557291236c commit 367ec75323e660f7827e960f55688d557291236c Author: Alex Richardson AuthorDate: 2021-10-14 16:44:13 +0000 Commit: Alex Richardson CommitDate: 2021-10-14 16:46:28 +0000 Fix a syntax error in 1b85b68da0b2 Reported by: Michael Butler, jenkins --- usr.bin/clang/llvm-readobj/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/clang/llvm-readobj/Makefile b/usr.bin/clang/llvm-readobj/Makefile index 71116fcc3955..f9294d45491f 100644 --- a/usr.bin/clang/llvm-readobj/Makefile +++ b/usr.bin/clang/llvm-readobj/Makefile @@ -21,7 +21,6 @@ SRCS+= XCOFFDumper.cpp LIBADD+= z LINKS+= ${BINDIR}/llvm-readobj ${BINDIR}/llvm-readelf -MLINKS= llvm-readobj.1 .if ${MK_LLVM_BINUTILS} != "no" LINKS+= ${BINDIR}/llvm-readelf ${BINDIR}/readelf From nobody Thu Oct 14 18:01:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8F58717FBED7; Thu, 14 Oct 2021 18:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVcdm3WWxz4SXC; Thu, 14 Oct 2021 18:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A4AD17BAF; Thu, 14 Oct 2021 18:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EI10RM091298; Thu, 14 Oct 2021 18:01:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EI10bw091297; Thu, 14 Oct 2021 18:01:00 GMT (envelope-from git) Date: Thu, 14 Oct 2021 18:01:00 GMT Message-Id: <202110141801.19EI10bw091297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ef3f98ae4778 - main - cxgbe: Only run ktls_tick when NIC TLS is enabled. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef3f98ae4778a8d4463166c5ff3c7831099c6048 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ef3f98ae4778a8d4463166c5ff3c7831099c6048 commit ef3f98ae4778a8d4463166c5ff3c7831099c6048 Author: John Baldwin AuthorDate: 2021-10-14 17:59:16 +0000 Commit: John Baldwin CommitDate: 2021-10-14 17:59:16 +0000 cxgbe: Only run ktls_tick when NIC TLS is enabled. Previously the body of ktls_tick was a nop when NIC TLS was disabled, but the callout was still scheduled consuming power on otherwise-idle systems with Chelsio T6 adapters. Now the callout only runs while NIC TLS is enabled on at least one interface of an adapter. Reported by: mav Reviewed by: np, mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32491 --- sys/dev/cxgbe/t4_main.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index f728ddf5b212..66f48f2bf922 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5393,11 +5393,9 @@ ktls_tick(void *arg) uint32_t tstamp; sc = arg; - if (sc->flags & KERN_TLS_ON) { - tstamp = tcp_ts_getticks(); - t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); - t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); - } + tstamp = tcp_ts_getticks(); + t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); + t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); callout_schedule_sbt(&sc->ktls_tick, SBT_1MS, 0, C_HARDCLOCK); } @@ -5417,10 +5415,14 @@ t4_config_kern_tls(struct adapter *sc, bool enable) return (rc); } - if (enable) + if (enable) { sc->flags |= KERN_TLS_ON; - else + callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, + C_HARDCLOCK); + } else { sc->flags &= ~KERN_TLS_ON; + callout_stop(&sc->ktls_tick); + } return (rc); } @@ -6468,11 +6470,6 @@ adapter_full_init(struct adapter *sc) write_global_rss_key(sc); t4_intr_enable(sc); } -#ifdef KERN_TLS - if (is_ktls(sc)) - callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, - C_HARDCLOCK); -#endif return (0); } From nobody Thu Oct 14 20:07:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 522A118074AE; Thu, 14 Oct 2021 20:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVgS81XJdz3KGC; Thu, 14 Oct 2021 20:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 145C2192D8; Thu, 14 Oct 2021 20:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EK7qXd056559; Thu, 14 Oct 2021 20:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EK7qvY056558; Thu, 14 Oct 2021 20:07:52 GMT (envelope-from git) Date: Thu, 14 Oct 2021 20:07:52 GMT Message-Id: <202110142007.19EK7qvY056558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1adebca1fc9f - main - Style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1adebca1fc9f6def501f7a5c2b2bde5fe9049477 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1adebca1fc9f6def501f7a5c2b2bde5fe9049477 commit 1adebca1fc9f6def501f7a5c2b2bde5fe9049477 Author: Konstantin Belousov AuthorDate: 2021-10-14 19:30:18 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-14 20:07:32 +0000 Style Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/kern_sig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index edafa7eda57a..b7155074aa5a 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2031,7 +2031,7 @@ trapsignal(struct thread *td, ksiginfo_t *ksi) &td->td_sigmask, code); #endif (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], - ksi, &td->td_sigmask); + ksi, &td->td_sigmask); postsig_done(sig, td, ps); mtx_unlock(&ps->ps_mtx); } else { From nobody Thu Oct 14 20:07:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 87BD918072EC; Thu, 14 Oct 2021 20:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVgS92yMkz3K7T; Thu, 14 Oct 2021 20:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44BDE19574; Thu, 14 Oct 2021 20:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EK7rZx056584; Thu, 14 Oct 2021 20:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EK7rlx056583; Thu, 14 Oct 2021 20:07:53 GMT (envelope-from git) Date: Thu, 14 Oct 2021 20:07:53 GMT Message-Id: <202110142007.19EK7rlx056583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 86929782cfab - main - Fix typo in comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86929782cfab2664010a31979e9e3c0626721ebb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=86929782cfab2664010a31979e9e3c0626721ebb commit 86929782cfab2664010a31979e9e3c0626721ebb Author: Konstantin Belousov AuthorDate: 2021-10-14 20:03:36 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-14 20:07:32 +0000 Fix typo in comment Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/sys/proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 1e3d7359a55b..e83f98646451 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -307,7 +307,7 @@ struct thread { struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ - struct vnode *td_vp_reserved;/* (k) Prealloated vnode. */ + struct vnode *td_vp_reserved;/* (k) Preallocated vnode. */ u_int td_no_sleeping; /* (k) Sleeping disabled count. */ void *td_su; /* (k) FFS SU private */ sbintime_t td_sleeptimo; /* (t) Sleep timeout. */ From nobody Thu Oct 14 23:14:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AB63717F76E7; Thu, 14 Oct 2021 23:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVlbM4QSxz3mVG; Thu, 14 Oct 2021 23:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77E731BE5C; Thu, 14 Oct 2021 23:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19ENENba017471; Thu, 14 Oct 2021 23:14:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19ENENxk017470; Thu, 14 Oct 2021 23:14:23 GMT (envelope-from git) Date: Thu, 14 Oct 2021 23:14:23 GMT Message-Id: <202110142314.19ENENxk017470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a72ee355646c - main - ktls: Defer creation of threads and zones until first use. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a72ee355646c4a379f55ac32d7d8dfe6c0d366f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a72ee355646c4a379f55ac32d7d8dfe6c0d366f9 commit a72ee355646c4a379f55ac32d7d8dfe6c0d366f9 Author: John Baldwin AuthorDate: 2021-10-14 22:48:34 +0000 Commit: John Baldwin CommitDate: 2021-10-14 22:48:34 +0000 ktls: Defer creation of threads and zones until first use. Run ktls_init() when the first KTLS session is created rather than unconditionally during boot. This avoids creating unused threads and allocating unused resources on systems which do not use KTLS. Reviewed by: gallatin, markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32487 --- sys/kern/uipc_ktls.c | 173 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 115 insertions(+), 58 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 1e778dbf113a..bde9fca97f50 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -109,6 +109,9 @@ static struct proc *ktls_proc; static uma_zone_t ktls_session_zone; static uma_zone_t ktls_buffer_zone; static uint16_t ktls_cpuid_lookup[MAXCPU]; +static int ktls_init_state; +static struct sx ktls_init_lock; +SX_SYSINIT(ktls_init_lock, &ktls_init_lock, "ktls init"); SYSCTL_NODE(_kern_ipc, OID_AUTO, tls, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Kernel TLS offload"); @@ -379,12 +382,11 @@ ktls_free_mext_contig(struct mbuf *m) uma_zfree(ktls_buffer_zone, (void *)PHYS_TO_DMAP(m->m_epg_pa[0])); } -static void -ktls_init(void *dummy __unused) +static int +ktls_init(void) { struct thread *td; struct pcpu *pc; - cpuset_t mask; int count, domain, error, i; ktls_wq = malloc(sizeof(*ktls_wq) * (mp_maxid + 1), M_KTLS, @@ -410,36 +412,40 @@ ktls_init(void *dummy __unused) STAILQ_INIT(&ktls_wq[i].m_head); STAILQ_INIT(&ktls_wq[i].so_head); mtx_init(&ktls_wq[i].mtx, "ktls work queue", NULL, MTX_DEF); - error = kproc_kthread_add(ktls_work_thread, &ktls_wq[i], - &ktls_proc, &td, 0, 0, "KTLS", "thr_%d", i); - if (error) - panic("Can't add KTLS thread %d error %d", i, error); - - /* - * Bind threads to cores. If ktls_bind_threads is > - * 1, then we bind to the NUMA domain. - */ - if (ktls_bind_threads) { - if (ktls_bind_threads > 1) { - pc = pcpu_find(i); - domain = pc->pc_domain; - CPU_COPY(&cpuset_domain[domain], &mask); - count = ktls_domains[domain].count; - ktls_domains[domain].cpu[count] = i; - ktls_domains[domain].count++; - } else { - CPU_SETOF(i, &mask); - } - error = cpuset_setthread(td->td_tid, &mask); - if (error) - panic( - "Unable to bind KTLS thread for CPU %d error %d", - i, error); + if (ktls_bind_threads > 1) { + pc = pcpu_find(i); + domain = pc->pc_domain; + count = ktls_domains[domain].count; + ktls_domains[domain].cpu[count] = i; + ktls_domains[domain].count++; } ktls_cpuid_lookup[ktls_number_threads] = i; ktls_number_threads++; } + /* + * If we somehow have an empty domain, fall back to choosing + * among all KTLS threads. + */ + if (ktls_bind_threads > 1) { + for (i = 0; i < vm_ndomains; i++) { + if (ktls_domains[i].count == 0) { + ktls_bind_threads = 1; + break; + } + } + } + + /* Start kthreads for each workqueue. */ + CPU_FOREACH(i) { + error = kproc_kthread_add(ktls_work_thread, &ktls_wq[i], + &ktls_proc, &td, 0, 0, "KTLS", "thr_%d", i); + if (error) { + printf("Can't add KTLS thread %d error %d\n", i, error); + return (error); + } + } + /* * Start an allocation thread per-domain to perform blocking allocations * of 16k physically contiguous TLS crypto destination buffers. @@ -454,35 +460,46 @@ ktls_init(void *dummy __unused) &ktls_domains[domain], &ktls_proc, &ktls_domains[domain].alloc_td.td, 0, 0, "KTLS", "alloc_%d", domain); - if (error) - panic("Can't add KTLS alloc thread %d error %d", + if (error) { + printf("Can't add KTLS alloc thread %d error %d\n", domain, error); - CPU_COPY(&cpuset_domain[domain], &mask); - error = cpuset_setthread(ktls_domains[domain].alloc_td.td->td_tid, - &mask); - if (error) - panic("Unable to bind KTLS alloc %d error %d", - domain, error); - } - } - - /* - * If we somehow have an empty domain, fall back to choosing - * among all KTLS threads. - */ - if (ktls_bind_threads > 1) { - for (i = 0; i < vm_ndomains; i++) { - if (ktls_domains[i].count == 0) { - ktls_bind_threads = 1; - break; + return (error); } } } if (bootverbose) printf("KTLS: Initialized %d threads\n", ktls_number_threads); + return (0); +} + +static int +ktls_start_kthreads(void) +{ + int error, state; + +start: + state = atomic_load_acq_int(&ktls_init_state); + if (__predict_true(state > 0)) + return (0); + if (state < 0) + return (ENXIO); + + sx_xlock(&ktls_init_lock); + if (ktls_init_state != 0) { + sx_xunlock(&ktls_init_lock); + goto start; + } + + error = ktls_init(); + if (error == 0) + state = 1; + else + state = -1; + atomic_store_rel_int(&ktls_init_state, state); + sx_xunlock(&ktls_init_lock); + return (error); } -SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); #if defined(INET) || defined(INET6) static int @@ -583,6 +600,10 @@ ktls_create_session(struct socket *so, struct tls_enable *en, return (EINVAL); } + error = ktls_start_kthreads(); + if (error != 0) + return (error); + tls = uma_zalloc(ktls_session_zone, M_WAITOK | M_ZERO); counter_u64_add(ktls_offload_active, 1); @@ -2457,6 +2478,18 @@ ktls_encrypt_async(struct ktls_wq *wq, struct mbuf *top) CURVNET_RESTORE(); } +static int +ktls_bind_domain(int domain) +{ + int error; + + error = cpuset_setthread(curthread->td_tid, &cpuset_domain[domain]); + if (error != 0) + return (error); + curthread->td_domain.dr_policy = DOMAINSET_PREF(domain); + return (0); +} + static void ktls_alloc_thread(void *ctx) { @@ -2465,14 +2498,16 @@ ktls_alloc_thread(void *ctx) void **buf; struct sysctl_oid *oid; char name[80]; - int i, nbufs; + int domain, error, i, nbufs; - curthread->td_domain.dr_policy = - DOMAINSET_PREF(PCPU_GET(domain)); - snprintf(name, sizeof(name), "domain%d", PCPU_GET(domain)); + domain = ktls_domain - ktls_domains; if (bootverbose) - printf("Starting KTLS alloc thread for domain %d\n", - PCPU_GET(domain)); + printf("Starting KTLS alloc thread for domain %d\n", domain); + error = ktls_bind_domain(domain); + if (error) + printf("Unable to bind KTLS alloc thread for domain %d: error %d\n", + domain, error); + snprintf(name, sizeof(name), "domain%d", domain); oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_kern_ipc_tls), OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "allocs", @@ -2527,10 +2562,32 @@ ktls_work_thread(void *ctx) struct socket *so, *son; STAILQ_HEAD(, mbuf) local_m_head; STAILQ_HEAD(, socket) local_so_head; + int cpu; - if (ktls_bind_threads > 1) { - curthread->td_domain.dr_policy = - DOMAINSET_PREF(PCPU_GET(domain)); + cpu = wq - ktls_wq; + if (bootverbose) + printf("Starting KTLS worker thread for CPU %d\n", cpu); + + /* + * Bind to a core. If ktls_bind_threads is > 1, then + * we bind to the NUMA domain instead. + */ + if (ktls_bind_threads) { + int error; + + if (ktls_bind_threads > 1) { + struct pcpu *pc = pcpu_find(cpu); + + error = ktls_bind_domain(pc->pc_domain); + } else { + cpuset_t mask; + + CPU_SETOF(cpu, &mask); + error = cpuset_setthread(curthread->td_tid, &mask); + } + if (error) + printf("Unable to bind KTLS worker thread for CPU %d: error %d\n", + cpu, error); } #if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) fpu_kern_thread(0); From nobody Fri Oct 15 00:32:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6595617F6347; Fri, 15 Oct 2021 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVnK82PGsz4b3k; Fri, 15 Oct 2021 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 329B91CB7A; Fri, 15 Oct 2021 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19F0WCDg022696; Fri, 15 Oct 2021 00:32:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19F0WCJ5022695; Fri, 15 Oct 2021 00:32:12 GMT (envelope-from git) Date: Fri, 15 Oct 2021 00:32:12 GMT Message-Id: <202110150032.19F0WCJ5022695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 6495766acfb2 - main - nfscl: Restructure nfscl_freeopen() slightly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6495766acfb242048a80d58956b2cebbd885d8cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6495766acfb242048a80d58956b2cebbd885d8cc commit 6495766acfb242048a80d58956b2cebbd885d8cc Author: Rick Macklem AuthorDate: 2021-10-15 00:28:01 +0000 Commit: Rick Macklem CommitDate: 2021-10-15 00:28:01 +0000 nfscl: Restructure nfscl_freeopen() slightly This patch factors the unlinking of the nfsclopen structure out of nfscl_freeopen() into a separate function called nfscl_unlinkopen(). It also adds a new argument to nfscl_freeopen() to conditionally do the unlink. Since this new argument is always passed in as "true" at this time, no semantics change should occur. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. MFC after: 2 week --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- sys/fs/nfsclient/nfs_clstate.c | 40 ++++++++++++++++++++++++++-------------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index c5d164bd1b93..9c5a5ca5c729 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -595,7 +595,7 @@ int nfscl_checkwritelocked(vnode_t, struct flock *, void nfscl_lockrelease(struct nfscllockowner *, int, int); void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t); void nfscl_filllockowner(void *, u_int8_t *, int); -void nfscl_freeopen(struct nfsclopen *, int); +void nfscl_freeopen(struct nfsclopen *, int, bool); void nfscl_umount(struct nfsmount *, NFSPROC_T *); void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *); void nfscl_initiate_recovery(struct nfsclclient *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index b550ae832ff4..1c72269dc276 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -850,7 +850,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) nfscl_freelockowner(lp, 0); - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); } diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 8fca7734c197..40bf5b41361a 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -107,6 +107,7 @@ static bool nfscl_checkown(struct nfsclowner *, struct nfsclopen *, uint8_t *, uint8_t *, struct nfscllockowner **, struct nfsclopen **, struct nfsclopen **); static void nfscl_clrelease(struct nfsclclient *); +static void nfscl_unlinkopen(struct nfsclopen *); static void nfscl_cleanclient(struct nfsclclient *); static void nfscl_expireclient(struct nfsclclient *, struct nfsmount *, struct ucred *, NFSPROC_T *); @@ -846,7 +847,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, nfscl_lockunlock(&owp->nfsow_rwlock); clp = owp->nfsow_clp; if (error && candelete && op->nfso_opencnt == 0) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); } @@ -1540,15 +1541,26 @@ nfscl_lockrelease(struct nfscllockowner *lp, int error, int candelete) } /* - * Free up an open structure and any associated byte range lock structures. + * Unlink the open structure. */ -void -nfscl_freeopen(struct nfsclopen *op, int local) +static void +nfscl_unlinkopen(struct nfsclopen *op) { LIST_REMOVE(op, nfso_list); if (op->nfso_hash.le_prev != NULL) LIST_REMOVE(op, nfso_hash); +} + +/* + * Free up an open structure and any associated byte range lock structures. + */ +void +nfscl_freeopen(struct nfsclopen *op, int local, bool unlink) +{ + + if (unlink) + nfscl_unlinkopen(op); nfscl_freealllocks(&op->nfso_lock, local); free(op, M_NFSCLOPEN); if (local) @@ -1619,7 +1631,7 @@ nfscl_expireopen(struct nfsclclient *clp, struct nfsclopen *op, * If a byte range lock or Share deny or couldn't re-open, free it. */ if (mustdelete) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); return (mustdelete); } @@ -1686,7 +1698,7 @@ nfscl_cleandeleg(struct nfscldeleg *dp) if (op != NULL) { if (LIST_NEXT(op, nfso_list) != NULL) panic("nfscleandel"); - nfscl_freeopen(op, 1); + nfscl_freeopen(op, 1, true); } nfscl_freeopenowner(owp, 1); } @@ -1728,7 +1740,7 @@ nfscl_cleanclient(struct nfsclclient *clp) /* Now, all the OpenOwners, etc. */ LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { LIST_FOREACH_SAFE(op, &owp->nfsow_open, nfso_list, nop) { - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); } nfscl_freeopenowner(owp, 0); } @@ -2267,7 +2279,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, } } if (error != 0 && error != NFSERR_BADSESSION) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); op = nop; } owp = nowp; @@ -3341,7 +3353,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) if (op != NULL) { KASSERT((op->nfso_opencnt == 0), ("nfscl: bad open cnt on deleg")); - nfscl_freeopen(op, 1); + nfscl_freeopen(op, 1, true); } nfscl_freeopenowner(owp, 1); } @@ -4187,7 +4199,7 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, ret == NFSERR_BADSESSION) return (ret); if (ret) { - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); if (!error) error = ret; } @@ -4216,7 +4228,7 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, ret == NFSERR_BADSESSION) return (ret); if (ret) { - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); if (!error) error = ret; } @@ -4268,7 +4280,7 @@ nfscl_moveopen(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp, op->nfso_fhlen == lop->nfso_fhlen && !NFSBCMP(op->nfso_fh, lop->nfso_fh, op->nfso_fhlen)) { op->nfso_opencnt += lop->nfso_opencnt; - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); return (0); } } @@ -4287,11 +4299,11 @@ nfscl_moveopen(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp, NFS4NODENAME(np->n_v4), np->n_v4->n4_namelen, &ndp, 0, 0, cred, p); if (error) { if (newone) - nfscl_freeopen(op, 0); + nfscl_freeopen(op, 0, true); } else { op->nfso_mode |= lop->nfso_mode; op->nfso_opencnt += lop->nfso_opencnt; - nfscl_freeopen(lop, 1); + nfscl_freeopen(lop, 1, true); } if (nop != NULL) free(nop, M_NFSCLOPEN); From nobody Fri Oct 15 07:30:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 685C31807FC4; Fri, 15 Oct 2021 07:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVybV2QYFz3mPQ; Fri, 15 Oct 2021 07:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32E49227B7; Fri, 15 Oct 2021 07:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19F7UEvo072382; Fri, 15 Oct 2021 07:30:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19F7UEUS072372; Fri, 15 Oct 2021 07:30:14 GMT (envelope-from git) Date: Fri, 15 Oct 2021 07:30:14 GMT Message-Id: <202110150730.19F7UEUS072372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 1b0e2f0b607e - main - bhyve: ignore low bits of CFGADR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b0e2f0b607e88feb57accc9521e9623b56ab7e2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1b0e2f0b607e88feb57accc9521e9623b56ab7e2 commit 1b0e2f0b607e88feb57accc9521e9623b56ab7e2 Author: Corvin Köhne AuthorDate: 2021-10-15 07:25:54 +0000 Commit: Emmanuel Vadot CommitDate: 2021-10-15 07:29:45 +0000 bhyve: ignore low bits of CFGADR Bhyve could emulate wrong PCI registers. In the best case, the guest reads wrong registers and the device driver would report some errors. In the worst case, the guest writes to wrong PCI registers and could brick hardware when using PCI passthrough. According to Intels specification, low bits of CFGADR should be ignored. Some OS like linux may rely on it. Otherwise, bhyve could emulate a wrong PCI register. E.g. If linux would like to read 2 bytes from offset 0x02, following would happen. linux: outl 0x80000002 at CFGADR inw at CFGDAT + 2 bhyve: cfgoff = 0x80000002 & 0xFF = 0x02 coff = cfgoff + (port - CFGDAT) = 0x02 + 0x02 = 0x04 Bhyve would emulate the register at offset 0x04 not 0x02. Reviewed By: #bhyve, grehan Differential Revision: https://reviews.freebsd.org/D31819 Sponsored by: Beckhoff Automation GmbH & Co. KG --- usr.sbin/bhyve/pci_emul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index 113ac5121238..fd18fdbdaeab 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -2018,7 +2018,7 @@ pci_emul_cfgaddr(struct vmctx *ctx, int vcpu, int in, int port, int bytes, } else { x = *eax; cfgenable = (x & CONF1_ENABLE) == CONF1_ENABLE; - cfgoff = x & PCI_REGMAX; + cfgoff = (x & PCI_REGMAX) & ~0x03; cfgfunc = (x >> 8) & PCI_FUNCMAX; cfgslot = (x >> 11) & PCI_SLOTMAX; cfgbus = (x >> 16) & PCI_BUSMAX; From nobody Fri Oct 15 08:23:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3097D17F48FD; Fri, 15 Oct 2021 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVzmg0y6vz4Vxf; Fri, 15 Oct 2021 08:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0078D230B9; Fri, 15 Oct 2021 08:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19F8NEOp047195; Fri, 15 Oct 2021 08:23:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19F8NEr9047194; Fri, 15 Oct 2021 08:23:14 GMT (envelope-from git) Date: Fri, 15 Oct 2021 08:23:14 GMT Message-Id: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 889b56c8cd84 - main - setrlimit: Take stack gap into account. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 commit 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 Author: Dawid Gorecki AuthorDate: 2021-10-13 19:01:08 +0000 Commit: Marcin Wojtas CommitDate: 2021-10-15 08:21:47 +0000 setrlimit: Take stack gap into account. Calling setrlimit with stack gap enabled and with low values of stack resource limit often caused the program to abort immediately after exiting the syscall. This happened due to the fact that the resource limit was calculated assuming that the stack started at sv_usrstack, while with stack gap enabled the stack is moved by a random number of bytes. Save information about stack size in struct vmspace and adjust the rlim_cur value. If the rlim_cur and stack gap is bigger than rlim_max, then the value is truncated to rlim_max. PR: 253208 Reviewed by: kib Obtained from: Semihalf Sponsored by: Stormshield MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D31516 --- sys/kern/imgact_elf.c | 5 +++-- sys/kern/kern_exec.c | 11 ++++++++--- sys/kern/kern_resource.c | 3 +++ sys/sys/imgact_elf.h | 2 +- sys/sys/sysent.h | 2 +- sys/vm/vm_map.c | 2 ++ sys/vm/vm_map.h | 1 + 7 files changed, 19 insertions(+), 7 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index ef1edfcabaf0..898f0f66a532 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2684,7 +2684,7 @@ __elfN(untrans_prot)(vm_prot_t prot) return (flags); } -void +vm_size_t __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) { uintptr_t range, rbase, gap; @@ -2692,7 +2692,7 @@ __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) pct = __elfN(aslr_stack_gap); if (pct == 0) - return; + return (0); if (pct > 50) pct = 50; range = imgp->eff_stack_sz * pct / 100; @@ -2700,4 +2700,5 @@ __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) gap = rbase % range; gap &= ~(sizeof(u_long) - 1); *stack_base -= gap; + return (gap); } diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 50e75fda6cfb..9dceebdd8441 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1148,6 +1148,7 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) stack_prot, error, vm_mmap_to_errno(error)); return (vm_mmap_to_errno(error)); } + vmspace->vm_stkgap = 0; /* * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but they @@ -1493,12 +1494,16 @@ exec_args_get_begin_envv(struct image_args *args) void exec_stackgap(struct image_params *imgp, uintptr_t *dp) { + struct proc *p = imgp->proc; + if (imgp->sysent->sv_stackgap == NULL || - (imgp->proc->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | + (p->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | NT_FREEBSD_FCTL_ASG_DISABLE)) != 0 || - (imgp->map_flags & MAP_ASLR) == 0) + (imgp->map_flags & MAP_ASLR) == 0) { + p->p_vmspace->vm_stkgap = 0; return; - imgp->sysent->sv_stackgap(imgp, dp); + } + p->p_vmspace->vm_stkgap = imgp->sysent->sv_stackgap(imgp, dp); } /* diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 4c62961e1bc4..b556d4fded51 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -671,6 +671,9 @@ kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which, if (limp->rlim_max < 0) limp->rlim_max = RLIM_INFINITY; + if (which == RLIMIT_STACK && limp->rlim_cur != RLIM_INFINITY) + limp->rlim_cur += p->p_vmspace->vm_stkgap; + oldssiz.rlim_cur = 0; newlim = lim_alloc(); PROC_LOCK(p); diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index 97383c6eeeb8..294f17c87b6f 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -118,7 +118,7 @@ int __elfN(remove_brand_entry)(Elf_Brandinfo *entry); int __elfN(freebsd_fixup)(uintptr_t *, struct image_params *); int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); size_t __elfN(populate_note)(int, void *, void *, size_t, void **); -void __elfN(stackgap)(struct image_params *, uintptr_t *); +vm_size_t __elfN(stackgap)(struct image_params *, uintptr_t *); int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t); void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int); void __elfN(prepare_notes)(struct thread *, struct note_info_list *, diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index ad50bf56e87d..ea96c87a79af 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -119,7 +119,7 @@ struct sysentvec { void (*sv_elf_core_prepare_notes)(struct thread *, struct note_info_list *, size_t *); int (*sv_imgact_try)(struct image_params *); - void (*sv_stackgap)(struct image_params *, uintptr_t *); + vm_size_t (*sv_stackgap)(struct image_params *, uintptr_t *); int (*sv_copyout_auxargs)(struct image_params *, uintptr_t); int sv_minsigstksz; /* minimum signal stack size */ diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 1ac4ccf72f11..87a290b998b9 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -343,6 +343,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, pmap_pinit_t pinit) vm->vm_taddr = 0; vm->vm_daddr = 0; vm->vm_maxsaddr = 0; + vm->vm_stkgap = 0; return (vm); } @@ -4265,6 +4266,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_charge) vm2->vm_taddr = vm1->vm_taddr; vm2->vm_daddr = vm1->vm_daddr; vm2->vm_maxsaddr = vm1->vm_maxsaddr; + vm2->vm_stkgap = vm1->vm_stkgap; vm_map_lock(old_map); if (old_map->busy) vm_map_wait_busy(old_map); diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index ace205b21b42..873ff62eec4a 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -293,6 +293,7 @@ struct vmspace { caddr_t vm_taddr; /* (c) user virtual address of text */ caddr_t vm_daddr; /* (c) user virtual address of data */ caddr_t vm_maxsaddr; /* user VA at max stack growth */ + vm_size_t vm_stkgap; /* stack gap size in bytes */ u_int vm_refcnt; /* number of references */ /* * Keep the PMAP last, so that CPU-specific variations of that From nobody Fri Oct 15 08:23:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8F08317F4D00; Fri, 15 Oct 2021 08:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVzmh2qmWz4W1G; Fri, 15 Oct 2021 08:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E771233FD; Fri, 15 Oct 2021 08:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19F8NGi6047219; Fri, 15 Oct 2021 08:23:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19F8NG16047218; Fri, 15 Oct 2021 08:23:16 GMT (envelope-from git) Date: Fri, 15 Oct 2021 08:23:16 GMT Message-Id: <202110150823.19F8NG16047218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: a97d697122da - main - kern_exec: Add kern.stacktop sysctl. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a97d697122da2bfb0baae5f0939d118d119dae33 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=a97d697122da2bfb0baae5f0939d118d119dae33 commit a97d697122da2bfb0baae5f0939d118d119dae33 Author: Dawid Gorecki AuthorDate: 2021-10-13 19:03:37 +0000 Commit: Marcin Wojtas CommitDate: 2021-10-15 08:21:55 +0000 kern_exec: Add kern.stacktop sysctl. With stack gap enabled top of the stack is moved down by a random amount of bytes. Because of that some multithreaded applications which use kern.usrstack sysctl to calculate address of stacks for their threads can fail. Add kern.stacktop sysctl, which can be used to retrieve address of the stack after stack gap is applied to it. Returns value identical to kern.usrstack for processes which have no stack gap. Reviewed by: kib Obtained from: Semihalf Sponsored by: Stormshield MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D31897 --- sys/kern/kern_exec.c | 31 ++++++++++++++++++++++++++++++- sys/sys/sysctl.h | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 9dceebdd8441..a9998471dd14 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -119,6 +119,7 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_pack_vmmapinfo, CTLFLAG_RWTUN, static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS); static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); +static int sysctl_kern_stacktop(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); static int do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, struct vmspace *oldvmspace); @@ -133,6 +134,10 @@ SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD| CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU", "Top of process stack"); +SYSCTL_PROC(_kern, KERN_STACKTOP, stacktop, CTLTYPE_ULONG | CTLFLAG_RD | + CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_stacktop, "LU", + "Top of process stack with stack gap."); + SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_stackprot, "I", "Stack memory permissions"); @@ -191,7 +196,31 @@ sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS) #endif error = SYSCTL_OUT(req, &p->p_sysent->sv_usrstack, sizeof(p->p_sysent->sv_usrstack)); - return error; + return (error); +} + +static int +sysctl_kern_stacktop(SYSCTL_HANDLER_ARGS) +{ + vm_offset_t stacktop; + struct proc *p; + int error; + + p = curproc; +#ifdef SCTL_MASK32 + if (req->flags & SCTL_MASK32) { + unsigned int val; + + val = (unsigned int)(p->p_sysent->sv_usrstack - + p->p_vmspace->vm_stkgap); + error = SYSCTL_OUT(req, &val, sizeof(val)); + } else +#endif + { + stacktop = p->p_sysent->sv_usrstack - p->p_vmspace->vm_stkgap; + error = SYSCTL_OUT(req, &stacktop, sizeof(stacktop)); + } + return (error); } static int diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 71a34652ff44..b455fec7209f 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -976,6 +976,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define KERN_HOSTUUID 36 /* string: host UUID identifier */ #define KERN_ARND 37 /* int: from arc4rand() */ #define KERN_MAXPHYS 38 /* int: MAXPHYS value */ +#define KERN_STACKTOP 39 /* int: USRSTACK - stack gap */ /* * KERN_PROC subtypes */ From nobody Fri Oct 15 08:23:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 107A817F4C5C; Fri, 15 Oct 2021 08:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVzmj4TYlz4WBD; Fri, 15 Oct 2021 08:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 566EC2341F; Fri, 15 Oct 2021 08:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19F8NH15047243; Fri, 15 Oct 2021 08:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19F8NHd6047242; Fri, 15 Oct 2021 08:23:17 GMT (envelope-from git) Date: Fri, 15 Oct 2021 08:23:17 GMT Message-Id: <202110150823.19F8NHd6047242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 78df56ccfcb4 - main - libthr: Use kern.stacktop for thread stack calculation. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78df56ccfcb40013a3e6904bd6d39836220c3550 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=78df56ccfcb40013a3e6904bd6d39836220c3550 commit 78df56ccfcb40013a3e6904bd6d39836220c3550 Author: Dawid Gorecki AuthorDate: 2021-10-13 19:06:05 +0000 Commit: Marcin Wojtas CommitDate: 2021-10-15 08:21:56 +0000 libthr: Use kern.stacktop for thread stack calculation. Use the new kern.stacktop sysctl to retrieve the address of stack top instead of kern.usrstack. kern.usrstack does not have any knowledge of the stack gap, so this can cause problems with thread stacks. Using kern.stacktop sysctl should fix most of those problems. kern.usrstack is used as a fallback when kern.stacktop cannot be read. Rename usrstack variables to stacktop to reflect this change. Fixes problems with firefox and thunderbird not starting with stack gap enabled. PR: 239873 Reviewed by: kib Obtained from: Semihalf Sponsored by: Stormshield MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D31898 --- lib/libthr/thread/thr_init.c | 19 +++++++++++-------- lib/libthr/thread/thr_private.h | 2 +- lib/libthr/thread/thr_stack.c | 22 ++++++++++++---------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 82bde10a153e..f2a66c406e85 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "thr_private.h" -char *_usrstack; +char *_stacktop; struct pthread *_thr_initial; int _libthr_debug; int _thread_event_mask; @@ -388,7 +388,7 @@ init_main_thread(struct pthread *thread) * resource limits, so this stack needs an explicitly mapped * red zone to protect the thread stack that is just beyond. */ - if (mmap(_usrstack - _thr_stack_initial - + if (mmap(_stacktop - _thr_stack_initial - _thr_guard_default, _thr_guard_default, 0, MAP_ANON, -1, 0) == MAP_FAILED) PANIC("Cannot allocate red zone for initial thread"); @@ -402,7 +402,7 @@ init_main_thread(struct pthread *thread) * actually free() it; it just puts it in the free * stack queue for later reuse. */ - thread->attr.stackaddr_attr = _usrstack - _thr_stack_initial; + thread->attr.stackaddr_attr = _stacktop - _thr_stack_initial; thread->attr.stacksize_attr = _thr_stack_initial; thread->attr.guardsize_attr = _thr_guard_default; thread->attr.flags |= THR_STACK_USER; @@ -427,7 +427,7 @@ init_main_thread(struct pthread *thread) thread->attr.prio = sched_param.sched_priority; #ifdef _PTHREAD_FORCED_UNWIND - thread->unwind_stackend = _usrstack; + thread->unwind_stackend = _stacktop; #endif /* Others cleared to zero by thr_alloc() */ @@ -464,10 +464,13 @@ init_private(void) __thr_malloc_init(); /* Find the stack top */ mib[0] = CTL_KERN; - mib[1] = KERN_USRSTACK; - len = sizeof (_usrstack); - if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) - PANIC("Cannot get kern.usrstack from sysctl"); + mib[1] = KERN_STACKTOP; + len = sizeof (_stacktop); + if (sysctl(mib, 2, &_stacktop, &len, NULL, 0) == -1) { + mib[1] = KERN_USRSTACK; + if (sysctl(mib, 2, &_stacktop, &len, NULL, 0) == -1) + PANIC("Cannot get kern.usrstack from sysctl"); + } env_bigstack = getenv("LIBPTHREAD_BIGSTACK_MAIN"); env_splitstack = getenv("LIBPTHREAD_SPLITSTACK_MAIN"); if (env_bigstack != NULL || env_splitstack == NULL) { diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index a5bbc5997d30..d6fb74bb4372 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -724,7 +724,7 @@ extern int __isthreaded; * Global variables for the pthread kernel. */ -extern char *_usrstack __hidden; +extern char *_stacktop __hidden; /* For debugger */ extern int _libthr_debug; diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c index b08bafdd9417..fe50bc76db5f 100644 --- a/lib/libthr/thread/thr_stack.c +++ b/lib/libthr/thread/thr_stack.c @@ -149,18 +149,20 @@ singlethread_map_stacks_exec(void) { int mib[2]; struct rlimit rlim; - u_long usrstack; + u_long stacktop; size_t len; mib[0] = CTL_KERN; - mib[1] = KERN_USRSTACK; - len = sizeof(usrstack); - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &usrstack, &len, NULL, 0) - == -1) - return; + mib[1] = KERN_STACKTOP; + len = sizeof(stacktop); + if (sysctl(mib, nitems(mib), &stacktop, &len, NULL, 0) == -1) { + mib[1] = KERN_USRSTACK; + if (sysctl(mib, nitems(mib), &stacktop, &len, NULL, 0) == -1) + return; + } if (getrlimit(RLIMIT_STACK, &rlim) == -1) return; - mprotect((void *)(uintptr_t)(usrstack - rlim.rlim_cur), + mprotect((void *)(uintptr_t)(stacktop - rlim.rlim_cur), rlim.rlim_cur, _rtld_get_stack_prot()); } @@ -213,7 +215,7 @@ _thr_stack_alloc(struct pthread_attr *attr) /* * Use the garbage collector lock for synchronization of the - * spare stack lists and allocations from usrstack. + * spare stack lists and allocations from stacktop. */ THREAD_LIST_WRLOCK(curthread); /* @@ -249,11 +251,11 @@ _thr_stack_alloc(struct pthread_attr *attr) } else { /* - * Allocate a stack from or below usrstack, depending + * Allocate a stack from or below stacktop, depending * on the LIBPTHREAD_BIGSTACK_MAIN env variable. */ if (last_stack == NULL) - last_stack = _usrstack - _thr_stack_initial - + last_stack = _stacktop - _thr_stack_initial - _thr_guard_default; /* Allocate a new stack. */ From nobody Fri Oct 15 09:14:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 31FC21809F68; Fri, 15 Oct 2021 09:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HW0w373jDz4kyV; Fri, 15 Oct 2021 09:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2AD9239F1; Fri, 15 Oct 2021 09:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19F9Eh6w013686; Fri, 15 Oct 2021 09:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19F9Ehrm013684; Fri, 15 Oct 2021 09:14:43 GMT (envelope-from git) Date: Fri, 15 Oct 2021 09:14:43 GMT Message-Id: <202110150914.19F9Ehrm013684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 63dcf7fda2b0 - main - mixer(8): Fix mixer status line for /dev/dspX.vpY mixer devices. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63dcf7fda2b0ec1a2f74406dd26a659914a0c17c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=63dcf7fda2b0ec1a2f74406dd26a659914a0c17c commit 63dcf7fda2b0ec1a2f74406dd26a659914a0c17c Author: Hans Petter Selasky AuthorDate: 2021-10-15 09:11:44 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-15 09:13:29 +0000 mixer(8): Fix mixer status line for /dev/dspX.vpY mixer devices. In some cases when passing /dev/dspX.vpY as mixer devices, m->ci.longname and m->ci.hw_info will be empty. Don't print any brackets and parentheses in this case. Differential Revision: https://reviews.freebsd.org/D32500 Submitted by: christos@ Sponsored by: NVIDIA Networking --- usr.sbin/mixer/mixer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index c32b87fdb7f0..f0e0c2d3b22b 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -219,15 +219,23 @@ printminfo(struct mixer *m, int oflag) if (oflag) return; - printf("%s: <%s> %s", m->mi.name, m->ci.longname, m->ci.hw_info); - printf(" ("); + printf("%s:", m->mi.name); + if (*m->ci.longname != '\0') + printf(" <%s>", m->ci.longname); + if (*m->ci.hw_info != '\0') + printf(" %s", m->ci.hw_info); + + if (m->mode != 0) + printf(" ("); if (m->mode & MIX_MODE_PLAY) printf("play"); if ((m->mode & playrec) == playrec) printf("/"); if (m->mode & MIX_MODE_REC) printf("rec"); - printf(")"); + if (m->mode != 0) + printf(")"); + if (m->f_default) printf(" (default)"); printf("\n"); From nobody Fri Oct 15 13:34:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1155A1809FBB for ; Fri, 15 Oct 2021 13:34:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HW6gc6TCGz4sl3 for ; Fri, 15 Oct 2021 13:34:20 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82a.google.com with SMTP id y11so8721576qtn.13 for ; Fri, 15 Oct 2021 06:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QXjYk+4ol8mxFBE3sYtRMjn4Oatn5uRgZEp0qA5CJ+o=; b=h8cvknQh9eJ9oJx9nwj/0pJ+ZvQVwX7InrCmtdnioyHd9SH3YS2evc1vlJ4Yc+w1h4 o0VFKzl5UmBX9fEzxCza01vRItNraWTNF40XRLrDLp46/Kn+eLBr8OVrmzWXLEQMTvgX fZ0i9M+D3aDF//S671B3iDTS8NRgfiVdG9P0mbQuTbQ8VOHUyclBUvTa/Fh4G+HVvkrv We0sLWMBScmdwFIlRKI3Otp8A8U6Qivo/M9NNTsTL6vLs8VwGSWWkPJNOpjOADDatxik fNJaALFrnCahvrvdNFN0eJNHEl6o3p3Y5w//qLFIZZd5AhhyriUY1MGVxKQ3LQs9VVz8 Vz/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QXjYk+4ol8mxFBE3sYtRMjn4Oatn5uRgZEp0qA5CJ+o=; b=CXg4Xh17IIPoIZH3dzlQIT9wU2gg/GQhXM3YJ65yYDcrfbucrgb6f1FW2txd0/V+vN 3IzQ4hVViWFAYH13SjVNLGHs2aUoiQ1L1h6p+QboUOAxqQI8Enx6IVdjPeRZXWzWtaAF LkZ90c2EF2uecBnKiMzbJOokMoBXkcRe7eYfrN+Unozd5+xj9VQC8I01egDSbFP+IXoO RnvJ8tQLV0pueXYDNsDN2exGm4T+sjFwZgZ2iGdxz1Z/ll+yoAUcyVIZg4vpNlQJ2NKK 3eCwYQHwuI2fZf5r2L+lNqtWLSHyzVxnaWao12LeYs2DsYXdKzDNrlGtWt7d8sdy5Kw5 7u0w== X-Gm-Message-State: AOAM533LcccOfb5YBRMgD6FsZcqwTvbWyABH68kmg/uQ4oCvXCbrsv0A uHmdUznxf3zAeyuV5mhkKtPh/uIAfu5swHGM X-Google-Smtp-Source: ABdhPJw0twJqeDg3ugo3FWPl1sD+JeKlmBJ+0mtiD7szR7FbuhHVa+cqt1kSS+oFWVN2fcIYoynWww== X-Received: by 2002:ac8:6d0b:: with SMTP id o11mr13035430qtt.367.1634304860375; Fri, 15 Oct 2021 06:34:20 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id 125sm2647071qkf.95.2021.10.15.06.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 06:34:19 -0700 (PDT) Date: Fri, 15 Oct 2021 09:34:19 -0400 From: Shawn Webb To: Alex Richardson Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1b85b68da0b2 - main - llvm-readobj: Attach to buildsystem Message-ID: <20211015133419.25mhse5ujpi3fhgr@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202110141619.19EGJchJ047978@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zrof5ybsbpcxb7r2" Content-Disposition: inline In-Reply-To: <202110141619.19EGJchJ047978@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HW6gc6TCGz4sl3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --zrof5ybsbpcxb7r2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 14, 2021 at 04:19:38PM +0000, Alex Richardson wrote: > The branch main has been updated by arichardson: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1b85b68da0b2de80e0e3aefb1a= de226bcf3951cb >=20 > commit 1b85b68da0b2de80e0e3aefb1ade226bcf3951cb > Author: Cameron Katri > AuthorDate: 2021-10-14 16:00:27 +0000 > Commit: Alex Richardson > CommitDate: 2021-10-14 16:18:05 +0000 >=20 > llvm-readobj: Attach to buildsystem > =20 > Also install it as readelf when MK_LLVM_BINUTILS is set. > =20 > Reviewed By: dim, arichardson > Differential Revision: https://reviews.freebsd.org/D32058 > --- > lib/clang/libllvm/Makefile | 21 +- > tools/build/mk/OptionalObsoleteFiles.inc | 4 + > usr.bin/clang/Makefile | 1 + > usr.bin/clang/llvm-readobj/Makefile | 31 +++ > usr.bin/clang/llvm-readobj/llvm-readelf.1 | 272 ++++++++++++++++++++ > usr.bin/clang/llvm-readobj/llvm-readobj.1 | 403 ++++++++++++++++++++++++= ++++++ > 6 files changed, 724 insertions(+), 8 deletions(-) >=20 > diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile > index 7eaedf65dcb3..cb9ab974abc5 100644 > --- a/lib/clang/libllvm/Makefile > +++ b/lib/clang/libllvm/Makefile > @@ -148,9 +148,13 @@ SRCS_MIN+=3D Analysis/VectorUtils.cpp > SRCS_MIN+=3D AsmParser/LLLexer.cpp > SRCS_MIN+=3D AsmParser/LLParser.cpp > SRCS_MIN+=3D AsmParser/Parser.cpp > +SRCS_MIN+=3D BinaryFormat/AMDGPUMetadataVerifier.cpp > SRCS_MIN+=3D BinaryFormat/Dwarf.cpp > SRCS_MIN+=3D BinaryFormat/Magic.cpp > SRCS_MIN+=3D BinaryFormat/MachO.cpp > +SRCS_MIN+=3D BinaryFormat/MsgPackDocument.cpp > +SRCS_MIN+=3D BinaryFormat/MsgPackDocumentYAML.cpp > +SRCS_MIN+=3D BinaryFormat/MsgPackReader.cpp Hey Alex, You'll also want to add BinaryFormat/MsgPackWriter.cpp. Adding that file fixes the build for HardenedBSD, since we use LTO, CFI, and SafeStack in base. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --zrof5ybsbpcxb7r2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmFpg1gACgkQ/y5nonf4 4foTvhAAopjj9O2TCRQ5t3astNUvIUSV0ht1QyUjB28Jkcc8E9O1Mc/lhCNSM76Q mSGv/8I+CnxkFS2VutV8KEzeEhcjlpWKYhJtkGpM1aiEelcjA8tDOEcLYs/PJzj5 fsaBcRfHZ8AutGpTdT+P99vg+72Eih3i309uRLeopT5UvBQbLJvaZhGj147gPMyD Am7k5Me4hTyGASjgimnKdFHgNmKXzYxuiQkOsFZJtfMSUM/WGoNyP8RCvIsvP5RV SdexYk9oPBJORwDP4BcC7fweuQIgCWVY94uJpf5SM1J3jaEUH71fKjivwsusaxmS jBjEJp7KVy0ugSNX+iU+/DZeALoffrs625qKWJQS8KvPNlvFOW/VwahImZ8BKCw+ OzOF4JgvmujGTVBbI4r9bXM4OdRVncQMDIO2Jgex5agzwn2pnAVmOZYBxkepN2Q8 IaOzsmzGzT4SpDUL8DaAmxJ2u6uHGvH83ogfJJ7PIANUKFgxsibWZ88a4d9r0gpK bDpRV7b+LxaXMA/9m6RmUUBv4HumLhPKbp84Ep7zRxHvthmtG73SYgEiEeWBGScw Pi/A0uEKyqIVLHalxgN2g0B8zpFi/L3lI8G3AK7P7q+pSKznDw+aoIj9X+ShRbY7 dIOu863DikIlI97Ix3UqFf6tVhUQO2ioDZJWsMok1zD6NjwVnb0= =Rcq+ -----END PGP SIGNATURE----- --zrof5ybsbpcxb7r2-- From nobody Fri Oct 15 13:57:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 15DDF17F3E7D; Fri, 15 Oct 2021 13:57:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HW7B75HF3z4yp4; Fri, 15 Oct 2021 13:57:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9741F27842; Fri, 15 Oct 2021 13:57:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FDvJ5t086857; Fri, 15 Oct 2021 13:57:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FDvJh8086856; Fri, 15 Oct 2021 13:57:19 GMT (envelope-from git) Date: Fri, 15 Oct 2021 13:57:19 GMT Message-Id: <202110151357.19FDvJh8086856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 67829b6307b8 - main - mixer(8): Print usage to standard error. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67829b6307b8c81397cedaaf7a0e6e281560be32 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=67829b6307b8c81397cedaaf7a0e6e281560be32 commit 67829b6307b8c81397cedaaf7a0e6e281560be32 Author: Hans Petter Selasky AuthorDate: 2021-10-15 13:56:00 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-15 13:56:37 +0000 mixer(8): Print usage to standard error. Differential Revision: https://reviews.freebsd.org/D32507 Submitted by: christos@ Sponsored by: NVIDIA Networking --- usr.sbin/mixer/mixer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index f0e0c2d3b22b..ba13291f7b36 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -174,9 +174,8 @@ next: static void __dead2 usage(void) { - printf("usage: %1$s [-f device] [-d unit] [-os] [dev[.control[=value]]] ...\n" - " %1$s [-d unit] [-os] -a\n", - getprogname()); + fprintf(stderr, "usage: %1$s [-f device] [-d unit] [-os] [dev[.control[=value]]] ...\n" + " %1$s [-d unit] [-os] -a\n", getprogname()); exit(1); } From nobody Fri Oct 15 19:10:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 87EA318046DE; Fri, 15 Oct 2021 19:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWG7Z3Cwlz3j46; Fri, 15 Oct 2021 19:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FF6939E7; Fri, 15 Oct 2021 19:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FJAYQi009049; Fri, 15 Oct 2021 19:10:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FJAYB5009048; Fri, 15 Oct 2021 19:10:34 GMT (envelope-from git) Date: Fri, 15 Oct 2021 19:10:34 GMT Message-Id: <202110151910.19FJAYB5009048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 2e85df652cae - main - Add libcbor to the build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e85df652caef859c532b7e1e8a178c75f1a4a92 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2e85df652caef859c532b7e1e8a178c75f1a4a92 commit 2e85df652caef859c532b7e1e8a178c75f1a4a92 Author: Ed Maste AuthorDate: 2021-10-07 00:42:40 +0000 Commit: Ed Maste CommitDate: 2021-10-15 19:10:24 +0000 Add libcbor to the build From https://github.com/PJK/libcbor: libcbor is a C library for parsing and generating CBOR, the general- purpose schema-less binary data format. libcbor will be used by ssh to support FIDO/U2F keys. It is currently intended only for use by ssh, and so is installed as a PRIVATELIB and is placed in the ssh pkgbase package. cbor_export.h and configuration.h were generated by the upstream CMake build. We could create them with bmake rules instead (as NetBSD has done) but this is a fine start. This is currently disabled for the 32-bit library build as libfido2 is not compatible with the COMPAT_32BIT hack in usb_ioctl.h, and there is no need for libcbor without libfido2. Reviewed by: kevans MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32347 --- lib/Makefile | 3 +++ lib/libcbor/Makefile | 35 ++++++++++++++++++++++++++ lib/libcbor/cbor/cbor_export.h | 42 ++++++++++++++++++++++++++++++++ lib/libcbor/cbor/configuration.h | 16 ++++++++++++ share/mk/src.libnames.mk | 2 ++ tools/build/mk/OptionalObsoleteFiles.inc | 3 +++ 6 files changed, 101 insertions(+) diff --git a/lib/Makefile b/lib/Makefile index 038763bfcba8..d39bbd37c910 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -215,6 +215,9 @@ SUBDIR.${MK_BHYVE}+= libvmmapi .if ${MACHINE_ARCH} != "powerpc" SUBDIR.${MK_OPENMP}+= libomp .endif +.if !defined(COMPAT_32BIT) +SUBDIR.${MK_OPENSSH}+= libcbor +.endif SUBDIR.${MK_OPENSSL}+= libmp SUBDIR.${MK_PF}+= libpfctl SUBDIR.${MK_PMC}+= libpmc libpmcstat diff --git a/lib/libcbor/Makefile b/lib/libcbor/Makefile new file mode 100644 index 000000000000..455efdbfc8ee --- /dev/null +++ b/lib/libcbor/Makefile @@ -0,0 +1,35 @@ +# $FreeBSD$ + +PACKAGE=ssh +LIB= cbor +PRIVATELIB= + +DIST=${SRCTOP}/contrib/libcbor +.PATH: ${DIST}/src + +SRCS= cbor.c +SRCS+= cbor/arrays.c +SRCS+= cbor/bytestrings.c +SRCS+= cbor/callbacks.c +SRCS+= cbor/common.c +SRCS+= cbor/encoding.c +SRCS+= cbor/floats_ctrls.c +SRCS+= cbor/ints.c +SRCS+= cbor/maps.c +SRCS+= cbor/serialization.c +SRCS+= cbor/streaming.c +SRCS+= cbor/strings.c +SRCS+= cbor/tags.c +SRCS+= cbor/internal/builder_callbacks.c +SRCS+= cbor/internal/encoders.c +SRCS+= cbor/internal/loaders.c +SRCS+= cbor/internal/memory_utils.c +SRCS+= cbor/internal/stack.c +SRCS+= cbor/internal/unicode.c + +CFLAGS+= -I${DIST}/src -I${.CURDIR} + +WARNS?= 2 +MAN= + +.include diff --git a/lib/libcbor/cbor/cbor_export.h b/lib/libcbor/cbor/cbor_export.h new file mode 100644 index 000000000000..cce2560b8d29 --- /dev/null +++ b/lib/libcbor/cbor/cbor_export.h @@ -0,0 +1,42 @@ + +#ifndef CBOR_EXPORT_H +#define CBOR_EXPORT_H + +#ifdef CBOR_STATIC_DEFINE +# define CBOR_EXPORT +# define CBOR_NO_EXPORT +#else +# ifndef CBOR_EXPORT +# ifdef cbor_EXPORTS + /* We are building this library */ +# define CBOR_EXPORT __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define CBOR_EXPORT __attribute__((visibility("default"))) +# endif +# endif + +# ifndef CBOR_NO_EXPORT +# define CBOR_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +#endif + +#ifndef CBOR_DEPRECATED +# define CBOR_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef CBOR_DEPRECATED_EXPORT +# define CBOR_DEPRECATED_EXPORT CBOR_EXPORT CBOR_DEPRECATED +#endif + +#ifndef CBOR_DEPRECATED_NO_EXPORT +# define CBOR_DEPRECATED_NO_EXPORT CBOR_NO_EXPORT CBOR_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef CBOR_NO_DEPRECATED +# define CBOR_NO_DEPRECATED +# endif +#endif + +#endif /* CBOR_EXPORT_H */ diff --git a/lib/libcbor/cbor/configuration.h b/lib/libcbor/cbor/configuration.h new file mode 100644 index 000000000000..a1a964c81e7f --- /dev/null +++ b/lib/libcbor/cbor/configuration.h @@ -0,0 +1,16 @@ +#ifndef LIBCBOR_CONFIGURATION_H +#define LIBCBOR_CONFIGURATION_H + +#define CBOR_MAJOR_VERSION 0 +#define CBOR_MINOR_VERSION 8 +#define CBOR_PATCH_VERSION 0 + +#define CBOR_CUSTOM_ALLOC 0 +#define CBOR_BUFFER_GROWTH 2 +#define CBOR_MAX_STACK_SIZE 2048 +#define CBOR_PRETTY_PRINTER 1 + +#define CBOR_RESTRICT_SPECIFIER restrict +#define CBOR_INLINE_SPECIFIER + +#endif //LIBCBOR_CONFIGURATION_H diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index e014e12cb3c9..a3cf355de372 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -17,6 +17,7 @@ _PRIVATELIBS= \ atf_cxx \ auditd \ bsdstat \ + cbor \ devdctl \ event1 \ gmock \ @@ -687,6 +688,7 @@ LIBCAP_NETDIR= ${OBJTOP}/lib/libcasper/services/cap_net LIBCAP_PWDDIR= ${OBJTOP}/lib/libcasper/services/cap_pwd LIBCAP_SYSCTLDIR= ${OBJTOP}/lib/libcasper/services/cap_sysctl LIBCAP_SYSLOGDIR= ${OBJTOP}/lib/libcasper/services/cap_syslog +LIBCBORDIR= ${OBJTOP}/lib/libcbor LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat LIBKVMDIR= ${OBJTOP}/lib/libkvm LIBPTHREADDIR= ${OBJTOP}/lib/libthr diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 57f8ac63e2de..acd578912e77 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -7119,6 +7119,9 @@ OLD_FILES+=usr/bin/ssh-agent OLD_FILES+=usr/bin/ssh-copy-id OLD_FILES+=usr/bin/ssh-keygen OLD_FILES+=usr/bin/ssh-keyscan +OLD_FILES+=usr/lib/libprivatecbor.a +OLD_FILES+=usr/lib/libprivatecbor.so +OLD_LIBS+=usr/lib/libprivatecbor.so.5 OLD_FILES+=usr/lib/pam_ssh.so OLD_LIBS+=usr/lib/pam_ssh.so.6 OLD_FILES+=usr/lib/libprivatessh.a From nobody Fri Oct 15 21:29:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E2B0717FE05B; Fri, 15 Oct 2021 21:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWKCv5vZHz4qHT; Fri, 15 Oct 2021 21:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA8BF5B28; Fri, 15 Oct 2021 21:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FLTVC0086996; Fri, 15 Oct 2021 21:29:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FLTVam086995; Fri, 15 Oct 2021 21:29:31 GMT (envelope-from git) Date: Fri, 15 Oct 2021 21:29:31 GMT Message-Id: <202110152129.19FLTVam086995@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 77c595ce33a3 - main - nfscl: Add an argument to nfscl_tryclose() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77c595ce33a37d321ef35fd840948a2e5fd17c84 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=77c595ce33a37d321ef35fd840948a2e5fd17c84 commit 77c595ce33a37d321ef35fd840948a2e5fd17c84 Author: Rick Macklem AuthorDate: 2021-10-15 21:25:38 +0000 Commit: Rick Macklem CommitDate: 2021-10-15 21:25:38 +0000 nfscl: Add an argument to nfscl_tryclose() This patch adds a new argument to nfscl_tryclose() to indicate whether or not it should loop when a NFSERR_DELAY reply is received from the NFSv4 server. Since this new argument is always passed in as "true" at this time, no semantics change should occur. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. MFC after: 2 week --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- sys/fs/nfsclient/nfs_clstate.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 9c5a5ca5c729..3f0fbc535166 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -631,7 +631,7 @@ void nfscl_deleggetmodtime(vnode_t, struct timespec *); int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, struct nfsmount *, NFSPROC_T *); int nfscl_tryclose(struct nfsclopen *, struct ucred *, - struct nfsmount *, NFSPROC_T *); + struct nfsmount *, NFSPROC_T *, bool); void nfscl_cleanup(NFSPROC_T *); int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t *, int, nfsv4stateid_t *, int, int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 1c72269dc276..04597a27edfa 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -841,7 +841,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); NFSUNLOCKCLSTATE(); do { - error = nfscl_tryclose(op, tcred, nmp, p); + error = nfscl_tryclose(op, tcred, nmp, p, true); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfs_close"); } while (error == NFSERR_GRACE); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 40bf5b41361a..d3ce1c6bef8b 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -2399,7 +2399,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, LIST_FOREACH_SAFE(op, &extra_open, nfso_list, nop) { do { newnfs_copycred(&op->nfso_cred, tcred); - error = nfscl_tryclose(op, tcred, nmp, p); + error = nfscl_tryclose(op, tcred, nmp, p, true); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfsexcls"); } while (error == NFSERR_GRACE); @@ -4506,24 +4506,24 @@ nfscl_trydelegreturn(struct nfscldeleg *dp, struct ucred *cred, */ int nfscl_tryclose(struct nfsclopen *op, struct ucred *cred, - struct nfsmount *nmp, NFSPROC_T *p) + struct nfsmount *nmp, NFSPROC_T *p, bool loop_on_delayed) { struct nfsrv_descript nfsd, *nd = &nfsd; int error; do { error = nfsrpc_closerpc(nd, nmp, op, cred, p, 0); - if (error == NFSERR_DELAY) + if (loop_on_delayed && error == NFSERR_DELAY) (void) nfs_catnap(PZERO, error, "nfstrycl"); - } while (error == NFSERR_DELAY); + } while (loop_on_delayed && error == NFSERR_DELAY); if (error == EAUTH || error == EACCES) { /* Try again using system credentials */ newnfs_setroot(cred); do { error = nfsrpc_closerpc(nd, nmp, op, cred, p, 1); - if (error == NFSERR_DELAY) + if (loop_on_delayed && error == NFSERR_DELAY) (void) nfs_catnap(PZERO, error, "nfstrycl"); - } while (error == NFSERR_DELAY); + } while (loop_on_delayed && error == NFSERR_DELAY); } return (error); } From nobody Fri Oct 15 22:35:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C85F81816CC9; Fri, 15 Oct 2021 22:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWLhH5GX5z3MW6; Fri, 15 Oct 2021 22:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90B046877; Fri, 15 Oct 2021 22:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FMZhe0079109; Fri, 15 Oct 2021 22:35:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FMZhO0079108; Fri, 15 Oct 2021 22:35:43 GMT (envelope-from git) Date: Fri, 15 Oct 2021 22:35:43 GMT Message-Id: <202110152235.19FMZhO0079108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 09c7f2386973 - main - pfctl: delay label macro expansion until after rule optimisation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09c7f2386973f8c36978895a7600320916bc3d07 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=09c7f2386973f8c36978895a7600320916bc3d07 commit 09c7f2386973f8c36978895a7600320916bc3d07 Author: Kristof Provost AuthorDate: 2021-10-13 14:06:47 +0000 Commit: Kristof Provost CommitDate: 2021-10-15 20:19:45 +0000 pfctl: delay label macro expansion until after rule optimisation We used to expand the $nr macro in labels into the rule number prior to the optimisation step. This would occasionally produce incorrect rule numbers in the labels. Delay all macro expansion until after the optimisation step to ensure that we expand the correct values. MFC after: 1 week Reported by: Özkan KIRIK Differential Revision: https://reviews.freebsd.org/D32488 --- sbin/pfctl/parse.y | 85 +++++++++++++++++++++++------------------------------- sbin/pfctl/pfctl.c | 6 ++++ sbin/pfctl/pfctl.h | 2 ++ 3 files changed, 44 insertions(+), 49 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 4be7bd16649a..e22e60182c73 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -333,14 +333,12 @@ int process_tabledef(char *, struct table_opts *); void expand_label_str(char *, size_t, const char *, const char *); void expand_label_if(const char *, char *, size_t, const char *); void expand_label_addr(const char *, char *, size_t, u_int8_t, - struct node_host *); + struct pf_rule_addr *); void expand_label_port(const char *, char *, size_t, - struct node_port *); + struct pf_rule_addr *); void expand_label_proto(const char *, char *, size_t, u_int8_t); -void expand_label_nr(const char *, char *, size_t); -void expand_label(char *, size_t, const char *, u_int8_t, - struct node_host *, struct node_port *, struct node_host *, - struct node_port *, u_int8_t); +void expand_label_nr(const char *, char *, size_t, + struct pfctl_rule *); void expand_rule(struct pfctl_rule *, struct node_if *, struct node_host *, struct node_proto *, struct node_os *, struct node_host *, struct node_port *, struct node_host *, @@ -5022,17 +5020,17 @@ expand_label_if(const char *name, char *label, size_t len, const char *ifname) void expand_label_addr(const char *name, char *label, size_t len, sa_family_t af, - struct node_host *h) + struct pf_rule_addr *addr) { char tmp[64], tmp_not[66]; if (strstr(label, name) != NULL) { - switch (h->addr.type) { + switch (addr->addr.type) { case PF_ADDR_DYNIFTL: - snprintf(tmp, sizeof(tmp), "(%s)", h->addr.v.ifname); + snprintf(tmp, sizeof(tmp), "(%s)", addr->addr.v.ifname); break; case PF_ADDR_TABLE: - snprintf(tmp, sizeof(tmp), "<%s>", h->addr.v.tblname); + snprintf(tmp, sizeof(tmp), "<%s>", addr->addr.v.tblname); break; case PF_ADDR_NOROUTE: snprintf(tmp, sizeof(tmp), "no-route"); @@ -5041,18 +5039,18 @@ expand_label_addr(const char *name, char *label, size_t len, sa_family_t af, snprintf(tmp, sizeof(tmp), "urpf-failed"); break; case PF_ADDR_ADDRMASK: - if (!af || (PF_AZERO(&h->addr.v.a.addr, af) && - PF_AZERO(&h->addr.v.a.mask, af))) + if (!af || (PF_AZERO(&addr->addr.v.a.addr, af) && + PF_AZERO(&addr->addr.v.a.mask, af))) snprintf(tmp, sizeof(tmp), "any"); else { char a[48]; int bits; - if (inet_ntop(af, &h->addr.v.a.addr, a, + if (inet_ntop(af, &addr->addr.v.a.addr, a, sizeof(a)) == NULL) snprintf(tmp, sizeof(tmp), "?"); else { - bits = unmask(&h->addr.v.a.mask, af); + bits = unmask(&addr->addr.v.a.mask, af); if ((af == AF_INET && bits < 32) || (af == AF_INET6 && bits < 128)) snprintf(tmp, sizeof(tmp), @@ -5068,7 +5066,7 @@ expand_label_addr(const char *name, char *label, size_t len, sa_family_t af, break; } - if (h->not) { + if (addr->neg) { snprintf(tmp_not, sizeof(tmp_not), "! %s", tmp); expand_label_str(label, len, name, tmp_not); } else @@ -5078,30 +5076,30 @@ expand_label_addr(const char *name, char *label, size_t len, sa_family_t af, void expand_label_port(const char *name, char *label, size_t len, - struct node_port *port) + struct pf_rule_addr *addr) { char a1[6], a2[6], op[13] = ""; if (strstr(label, name) != NULL) { - snprintf(a1, sizeof(a1), "%u", ntohs(port->port[0])); - snprintf(a2, sizeof(a2), "%u", ntohs(port->port[1])); - if (!port->op) + snprintf(a1, sizeof(a1), "%u", ntohs(addr->port[0])); + snprintf(a2, sizeof(a2), "%u", ntohs(addr->port[1])); + if (!addr->port_op) ; - else if (port->op == PF_OP_IRG) + else if (addr->port_op == PF_OP_IRG) snprintf(op, sizeof(op), "%s><%s", a1, a2); - else if (port->op == PF_OP_XRG) + else if (addr->port_op == PF_OP_XRG) snprintf(op, sizeof(op), "%s<>%s", a1, a2); - else if (port->op == PF_OP_EQ) + else if (addr->port_op == PF_OP_EQ) snprintf(op, sizeof(op), "%s", a1); - else if (port->op == PF_OP_NE) + else if (addr->port_op == PF_OP_NE) snprintf(op, sizeof(op), "!=%s", a1); - else if (port->op == PF_OP_LT) + else if (addr->port_op == PF_OP_LT) snprintf(op, sizeof(op), "<%s", a1); - else if (port->op == PF_OP_LE) + else if (addr->port_op == PF_OP_LE) snprintf(op, sizeof(op), "<=%s", a1); - else if (port->op == PF_OP_GT) + else if (addr->port_op == PF_OP_GT) snprintf(op, sizeof(op), ">%s", a1); - else if (port->op == PF_OP_GE) + else if (addr->port_op == PF_OP_GE) snprintf(op, sizeof(op), ">=%s", a1); expand_label_str(label, len, name, op); } @@ -5125,29 +5123,27 @@ expand_label_proto(const char *name, char *label, size_t len, u_int8_t proto) } void -expand_label_nr(const char *name, char *label, size_t len) +expand_label_nr(const char *name, char *label, size_t len, + struct pfctl_rule *r) { char n[11]; if (strstr(label, name) != NULL) { - snprintf(n, sizeof(n), "%u", pf->anchor->match); + snprintf(n, sizeof(n), "%u", r->nr); expand_label_str(label, len, name, n); } } void -expand_label(char *label, size_t len, const char *ifname, sa_family_t af, - struct node_host *src_host, struct node_port *src_port, - struct node_host *dst_host, struct node_port *dst_port, - u_int8_t proto) +expand_label(char *label, size_t len, struct pfctl_rule *r) { - expand_label_if("$if", label, len, ifname); - expand_label_addr("$srcaddr", label, len, af, src_host); - expand_label_addr("$dstaddr", label, len, af, dst_host); - expand_label_port("$srcport", label, len, src_port); - expand_label_port("$dstport", label, len, dst_port); - expand_label_proto("$proto", label, len, proto); - expand_label_nr("$nr", label, len); + expand_label_if("$if", label, len, r->ifname); + expand_label_addr("$srcaddr", label, len, r->af, &r->src); + expand_label_addr("$dstaddr", label, len, r->af, &r->dst); + expand_label_port("$srcport", label, len, &r->src); + expand_label_port("$dstport", label, len, &r->dst); + expand_label_proto("$proto", label, len, r->proto); + expand_label_nr("$nr", label, len, r); } int @@ -5481,15 +5477,6 @@ expand_rule(struct pfctl_rule *r, if (strlcpy(r->match_tagname, match_tagname, sizeof(r->match_tagname)) >= sizeof(r->match_tagname)) errx(1, "expand_rule: strlcpy"); - for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) - expand_label(r->label[i], PF_RULE_LABEL_SIZE, - r->ifname, r->af, src_host, src_port, dst_host, - dst_port, proto->proto); - expand_label(r->tagname, PF_TAG_NAME_SIZE, r->ifname, r->af, - src_host, src_port, dst_host, dst_port, proto->proto); - expand_label(r->match_tagname, PF_TAG_NAME_SIZE, r->ifname, - r->af, src_host, src_port, dst_host, dst_port, - proto->proto); error += check_netmask(src_host, r->af); error += check_netmask(dst_host, r->af); diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index d7bde0012e9b..a0eec1b09289 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1528,6 +1528,12 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pfctl_ruleset *rs, while ((r = TAILQ_FIRST(rs->rules[rs_num].active.ptr)) != NULL) { TAILQ_REMOVE(rs->rules[rs_num].active.ptr, r, entries); + + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) + expand_label(r->label[i], PF_RULE_LABEL_SIZE, r); + expand_label(r->tagname, PF_TAG_NAME_SIZE, r); + expand_label(r->match_tagname, PF_TAG_NAME_SIZE, r); + if ((error = pfctl_load_rule(pf, path, r, depth))) goto error; if (r->anchor) { diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index 80ef184fa90f..606eb729cd44 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -138,6 +138,8 @@ void pf_remove_if_empty_ruleset(struct pfctl_ruleset *); struct pfctl_ruleset *pf_find_ruleset(const char *); struct pfctl_ruleset *pf_find_or_create_ruleset(const char *); +void expand_label(char *, size_t, struct pfctl_rule *); + const char *pfctl_proto2name(int); #endif /* _PFCTL_H_ */ From nobody Fri Oct 15 22:35:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 50C321816F46; Fri, 15 Oct 2021 22:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWLhJ6gs7z3MkY; Fri, 15 Oct 2021 22:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC8016A8E; Fri, 15 Oct 2021 22:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FMZia0079133; Fri, 15 Oct 2021 22:35:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FMZia1079132; Fri, 15 Oct 2021 22:35:44 GMT (envelope-from git) Date: Fri, 15 Oct 2021 22:35:44 GMT Message-Id: <202110152235.19FMZia1079132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 914ec9c78dcd - main - pf tests: ensure that $nr expansion is correct List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 914ec9c78dcd5d8f77552fb93d3bc15efe9c0f40 Auto-Submitted: auto-generated X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=914ec9c78dcd5d8f77552fb93d3bc15efe9c0f40 commit 914ec9c78dcd5d8f77552fb93d3bc15efe9c0f40 Author: Kristof Provost AuthorDate: 2021-10-03 16:07:04 +0000 Commit: Kristof Provost CommitDate: 2021-10-15 20:19:45 +0000 pf tests: ensure that $nr expansion is correct Test the $nr expansion in labels is correct, even if the optimiser reduces the rule count. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32489 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/macro.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 2f9ce73f381b..246c267e7d2b 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -14,6 +14,7 @@ ATF_TESTS_SH+= altq \ get_state \ icmp \ killstate \ + macro \ map_e \ names \ nat \ diff --git a/tests/sys/netpfil/pf/macro.sh b/tests/sys/netpfil/pf/macro.sh new file mode 100644 index 000000000000..442677c9f946 --- /dev/null +++ b/tests/sys/netpfil/pf/macro.sh @@ -0,0 +1,40 @@ +. $(atf_get_srcdir)/utils.subr + +atf_test_case "nr" "cleanup" +nr_head() +{ + atf_set descr 'Test $nr expansion' + atf_set require.user root +} + +nr_body() +{ + # Ensure that when the optimiser collapses rules the macro expansion + # has the correct rule number + pft_init + + vnet_mkjail alcatraz + jexec alcatraz ifconfig lo0 inet 127.0.0.1/8 + jexec alcatraz ifconfig lo0 inet 127.0.0.2/32 alias + + pft_set_rules alcatraz \ + "pass quick on lo from lo:network to lo:network" \ + "block quick all label \"ruleNo:\$nr\"" + + no=$(jexec alcatraz pfctl -sr -vv | awk '/ruleNo/ { gsub("@", "", $1); print $1; }') + ruleno=$(jexec alcatraz pfctl -sr -vv | awk '/ruleNo/ { gsub(/"ruleNo:/, "", $7); gsub(/"/, "", $7); print $7; }') + if [ "${no}" -ne "${ruleno}" ]; + then + atf_fail "Expected ruleNo $no != $ruleno" + fi +} + +nr_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "nr" +} From nobody Fri Oct 15 23:09:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C145C17FCEEB; Fri, 15 Oct 2021 23:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWMRY4TwDz3m9q; Fri, 15 Oct 2021 23:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 740216DC8; Fri, 15 Oct 2021 23:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FN9jWR019776; Fri, 15 Oct 2021 23:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FN9jXX019775; Fri, 15 Oct 2021 23:09:45 GMT (envelope-from git) Date: Fri, 15 Oct 2021 23:09:45 GMT Message-Id: <202110152309.19FN9jXX019775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 733a832fb515 - main - ntp: Revert "Disable stack gap for ntpd during build." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 733a832fb515ef9ebf9d584896962fd28e714d0b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=733a832fb515ef9ebf9d584896962fd28e714d0b commit 733a832fb515ef9ebf9d584896962fd28e714d0b Author: Cy Schubert AuthorDate: 2021-08-16 14:46:31 +0000 Commit: Cy Schubert CommitDate: 2021-10-15 23:06:14 +0000 ntp: Revert "Disable stack gap for ntpd during build." This reverts commit af949c590bd8a00a5973b5875d7e0fa6832ea64a because 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 fixes the underlying problem. MFC after: 1 month --- usr.sbin/ntp/ntpd/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/usr.sbin/ntp/ntpd/Makefile b/usr.sbin/ntp/ntpd/Makefile index b9c3a05547d4..2d8a8b9d2a2d 100644 --- a/usr.sbin/ntp/ntpd/Makefile +++ b/usr.sbin/ntp/ntpd/Makefile @@ -56,7 +56,4 @@ CLEANFILES+= .version version.c version.c: sh -e ${.CURDIR:H}/scripts/mkver ntpd -afterbuild: - ${ELFCTL} -e +noaslrstkgap ${PROG} - .include From nobody Fri Oct 15 23:09:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ED34017FD1D2; Fri, 15 Oct 2021 23:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWMRZ5Gzyz3mR2; Fri, 15 Oct 2021 23:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 908AF6EE2; Fri, 15 Oct 2021 23:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FN9kZw019800; Fri, 15 Oct 2021 23:09:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FN9kW1019799; Fri, 15 Oct 2021 23:09:46 GMT (envelope-from git) Date: Fri, 15 Oct 2021 23:09:46 GMT Message-Id: <202110152309.19FN9kW1019799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: fc393054398e - main - ntp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc393054398ea50fb0cee52704e9385afe888b48 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fc393054398ea50fb0cee52704e9385afe888b48 commit fc393054398ea50fb0cee52704e9385afe888b48 Author: Cy Schubert AuthorDate: 2021-08-16 15:05:50 +0000 Commit: Cy Schubert CommitDate: 2021-10-15 23:06:26 +0000 ntp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV." This reverts commit 55263180628a386ad38b4b6621919220b137f770 because the underlying problem was fixed by 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021. MFC after: 1 month --- contrib/ntp/ntpd/ntpd.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c index aac315c430da..a5591de79ff5 100644 --- a/contrib/ntp/ntpd/ntpd.c +++ b/contrib/ntp/ntpd/ntpd.c @@ -145,17 +145,6 @@ # include #endif /* LIBSECCOMP and KERN_SECCOMP */ -#ifdef __FreeBSD__ -#include -#ifndef PROC_STACKGAP_CTL -/* - * Even if we compile on an older system we can still run on a newer one. - */ -#define PROC_STACKGAP_CTL 17 -#define PROC_STACKGAP_DISABLE 0x0002 -#endif -#endif - #ifdef HAVE_DNSREGISTRATION # include DNSServiceRef mdns; @@ -438,18 +427,6 @@ main( char *argv[] ) { -# ifdef __FreeBSD__ - { - /* - * We Must disable ASLR stack gap on FreeBSD to avoid a - * segfault. See PR/241421 and PR/241960. - */ - int aslr_var = PROC_STACKGAP_DISABLE; - - pid_t my_pid = getpid(); - procctl(P_PID, my_pid, PROC_STACKGAP_CTL, &aslr_var); - } -# endif return ntpdmain(argc, argv); } #endif /* !SYS_WINNT */ From nobody Fri Oct 15 23:50:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1A7C0180E76E; Fri, 15 Oct 2021 23:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWNLW0H6Cz4SNX; Fri, 15 Oct 2021 23:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D91A077EA; Fri, 15 Oct 2021 23:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19FNoQP2080397; Fri, 15 Oct 2021 23:50:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19FNoQlT080396; Fri, 15 Oct 2021 23:50:26 GMT (envelope-from git) Date: Fri, 15 Oct 2021 23:50:26 GMT Message-Id: <202110152350.19FNoQlT080396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Sobolev Subject: git: 461e6f23db3b - main - Fix fragmented UDP packets handling since rev.360967. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sobomax X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 461e6f23db3b9794e6af88b381b066a2c0463d1c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sobomax: URL: https://cgit.FreeBSD.org/src/commit/?id=461e6f23db3b9794e6af88b381b066a2c0463d1c commit 461e6f23db3b9794e6af88b381b066a2c0463d1c Author: Maxim Sobolev AuthorDate: 2021-10-07 20:41:40 +0000 Commit: Maxim Sobolev CommitDate: 2021-10-15 23:48:12 +0000 Fix fragmented UDP packets handling since rev.360967. Consider IP_MF flag when checking length of the UDP packet to match the declared value. Sponsored by: Sippy Software, Inc. Differential Revision: https://reviews.freebsd.org/D32363 MFC after: 2 weeks --- sys/netinet/libalias/alias.c | 225 +++++++++++++++++++++++-------------------- 1 file changed, 120 insertions(+), 105 deletions(-) diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 39e9b060623d..37f5bd5a1db1 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -721,21 +721,37 @@ ProtoAliasOut(struct libalias *la, struct ip *pip, return (PKT_ALIAS_IGNORED); } +#define MF_ISSET(_pip) (ntohs((_pip)->ip_off) & IP_MF) +#define FRAG_NO_HDR(_pip) (ntohs((_pip)->ip_off) & IP_OFFMASK) + +static struct udphdr * +ValidateUdpLength(struct ip *pip) +{ + struct udphdr *ud; + size_t dlen; + +#ifdef _KERNEL + KASSERT(!FRAG_NO_HDR(pip), ("header-less fragment isn't expected here")); +#endif + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (NULL); + ud = (struct udphdr *)ip_next(pip); + if (!MF_ISSET(pip) && dlen < ntohs(ud->uh_ulen)) + return (NULL); + return (ud); +} + static int UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; - size_t dlen; LIBALIAS_LOCK_ASSERT(la); - dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); - if (dlen < sizeof(struct udphdr)) - return (PKT_ALIAS_IGNORED); - - ud = (struct udphdr *)ip_next(pip); - if (dlen < ntohs(ud->uh_ulen)) + ud = ValidateUdpLength(pip); + if (ud == NULL) return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -828,19 +844,14 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) u_short proxy_server_port; int proxy_type; int error; - size_t dlen; LIBALIAS_LOCK_ASSERT(la); - /* Return if proxy-only mode is enabled and not proxyrule found.*/ - dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); - if (dlen < sizeof(struct udphdr)) - return (PKT_ALIAS_IGNORED); - - ud = (struct udphdr *)ip_next(pip); - if (dlen < ntohs(ud->uh_ulen)) + ud = ValidateUdpLength(pip); + if (ud == NULL) return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled and not proxyrule found.*/ proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); if (proxy_type == 0 && (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY)) @@ -1339,64 +1350,65 @@ LibAliasInLocked(struct libalias *la, struct ip *pip, int maxpacketsize) goto getout; } + if (FRAG_NO_HDR(pip)) { + iresult = FragmentIn(la, pip->ip_src, pip, pip->ip_id, + &pip->ip_sum); + goto getout; + } + iresult = PKT_ALIAS_IGNORED; - if ((ntohs(pip->ip_off) & IP_OFFMASK) == 0) { - switch (pip->ip_p) { - case IPPROTO_ICMP: - iresult = IcmpAliasIn(la, pip); - break; - case IPPROTO_UDP: - iresult = UdpAliasIn(la, pip); - break; - case IPPROTO_TCP: - iresult = TcpAliasIn(la, pip); - break; + switch (pip->ip_p) { + case IPPROTO_ICMP: + iresult = IcmpAliasIn(la, pip); + break; + case IPPROTO_UDP: + iresult = UdpAliasIn(la, pip); + break; + case IPPROTO_TCP: + iresult = TcpAliasIn(la, pip); + break; #ifdef _KERNEL - case IPPROTO_SCTP: - iresult = SctpAlias(la, pip, SN_TO_LOCAL); - break; + case IPPROTO_SCTP: + iresult = SctpAlias(la, pip, SN_TO_LOCAL); + break; #endif - case IPPROTO_GRE: { - int error; - struct alias_data ad = { - .lnk = NULL, - .oaddr = NULL, - .aaddr = NULL, - .aport = NULL, - .sport = NULL, - .dport = NULL, - .maxpktsize = 0 - }; - - /* Walk out chain. */ - error = find_handler(IN, IP, la, pip, &ad); - if (error == 0) - iresult = PKT_ALIAS_OK; - else - iresult = ProtoAliasIn(la, pip->ip_src, - pip, pip->ip_p, &pip->ip_sum); - break; - } - default: - iresult = ProtoAliasIn(la, pip->ip_src, pip, - pip->ip_p, &pip->ip_sum); - break; - } + case IPPROTO_GRE: { + int error; + struct alias_data ad = { + .lnk = NULL, + .oaddr = NULL, + .aaddr = NULL, + .aport = NULL, + .sport = NULL, + .dport = NULL, + .maxpktsize = 0 + }; - if (ntohs(pip->ip_off) & IP_MF) { - struct alias_link *lnk; + /* Walk out chain. */ + error = find_handler(IN, IP, la, pip, &ad); + if (error == 0) + iresult = PKT_ALIAS_OK; + else + iresult = ProtoAliasIn(la, pip->ip_src, + pip, pip->ip_p, &pip->ip_sum); + break; + } + default: + iresult = ProtoAliasIn(la, pip->ip_src, pip, + pip->ip_p, &pip->ip_sum); + break; + } - lnk = FindFragmentIn1(la, pip->ip_src, alias_addr, pip->ip_id); - if (lnk != NULL) { - iresult = PKT_ALIAS_FOUND_HEADER_FRAGMENT; - SetFragmentAddr(lnk, pip->ip_dst); - } else { - iresult = PKT_ALIAS_ERROR; - } + if (MF_ISSET(pip)) { + struct alias_link *lnk; + + lnk = FindFragmentIn1(la, pip->ip_src, alias_addr, pip->ip_id); + if (lnk != NULL) { + iresult = PKT_ALIAS_FOUND_HEADER_FRAGMENT; + SetFragmentAddr(lnk, pip->ip_dst); + } else { + iresult = PKT_ALIAS_ERROR; } - } else { - iresult = FragmentIn(la, pip->ip_src, pip, pip->ip_id, - &pip->ip_sum); } getout: @@ -1492,52 +1504,55 @@ LibAliasOutLocked(struct libalias *la, } else if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) { SetDefaultAliasAddress(la, pip->ip_src); } + + if (FRAG_NO_HDR(pip)) { + iresult = FragmentOut(la, pip, &pip->ip_sum); + goto getout_restore; + } + iresult = PKT_ALIAS_IGNORED; - if ((ntohs(pip->ip_off) & IP_OFFMASK) == 0) { - switch (pip->ip_p) { - case IPPROTO_ICMP: - iresult = IcmpAliasOut(la, pip, create); - break; - case IPPROTO_UDP: - iresult = UdpAliasOut(la, pip, maxpacketsize, create); - break; - case IPPROTO_TCP: - iresult = TcpAliasOut(la, pip, maxpacketsize, create); - break; + switch (pip->ip_p) { + case IPPROTO_ICMP: + iresult = IcmpAliasOut(la, pip, create); + break; + case IPPROTO_UDP: + iresult = UdpAliasOut(la, pip, maxpacketsize, create); + break; + case IPPROTO_TCP: + iresult = TcpAliasOut(la, pip, maxpacketsize, create); + break; #ifdef _KERNEL - case IPPROTO_SCTP: - iresult = SctpAlias(la, pip, SN_TO_GLOBAL); - break; + case IPPROTO_SCTP: + iresult = SctpAlias(la, pip, SN_TO_GLOBAL); + break; #endif - case IPPROTO_GRE: { - int error; - struct alias_data ad = { - .lnk = NULL, - .oaddr = NULL, - .aaddr = NULL, - .aport = NULL, - .sport = NULL, - .dport = NULL, - .maxpktsize = 0 - }; - /* Walk out chain. */ - error = find_handler(OUT, IP, la, pip, &ad); - if (error == 0) - iresult = PKT_ALIAS_OK; - else - iresult = ProtoAliasOut(la, pip, - pip->ip_dst, pip->ip_p, &pip->ip_sum, create); - break; - } - default: + case IPPROTO_GRE: { + int error; + struct alias_data ad = { + .lnk = NULL, + .oaddr = NULL, + .aaddr = NULL, + .aport = NULL, + .sport = NULL, + .dport = NULL, + .maxpktsize = 0 + }; + /* Walk out chain. */ + error = find_handler(OUT, IP, la, pip, &ad); + if (error == 0) + iresult = PKT_ALIAS_OK; + else iresult = ProtoAliasOut(la, pip, pip->ip_dst, pip->ip_p, &pip->ip_sum, create); - break; + break; } - } else { - iresult = FragmentOut(la, pip, &pip->ip_sum); + default: + iresult = ProtoAliasOut(la, pip, + pip->ip_dst, pip->ip_p, &pip->ip_sum, create); + break; } +getout_restore: SetDefaultAliasAddress(la, addr_save); getout: return (iresult); From nobody Sat Oct 16 06:10:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D096D17F5CF1; Sat, 16 Oct 2021 06:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWXmd4Kspz3MNk; Sat, 16 Oct 2021 06:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E11A14E9A; Sat, 16 Oct 2021 06:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19G6A9QB081320; Sat, 16 Oct 2021 06:10:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19G6A9Ia081317; Sat, 16 Oct 2021 06:10:09 GMT (envelope-from git) Date: Sat, 16 Oct 2021 06:10:09 GMT Message-Id: <202110160610.19G6A9Ia081317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 899a3b38f517 - main - Fix two typos in source code comments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 899a3b38f5172d70360396caeebb5b694638282e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=899a3b38f5172d70360396caeebb5b694638282e commit 899a3b38f5172d70360396caeebb5b694638282e Author: Gordon Bergling AuthorDate: 2021-10-16 06:09:31 +0000 Commit: Gordon Bergling CommitDate: 2021-10-16 06:09:31 +0000 Fix two typos in source code comments - s/alocated/allocated/ - s/realocated/reallocated/ MFC after: 3 days --- sys/dev/extres/clk/clk.c | 2 +- sys/dev/mlx4/mlx4_en/mlx4_en_rx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/extres/clk/clk.c b/sys/dev/extres/clk/clk.c index b26158922d74..b1522eb1d4c2 100644 --- a/sys/dev/extres/clk/clk.c +++ b/sys/dev/extres/clk/clk.c @@ -1517,7 +1517,7 @@ clk_get_by_ofw_name(device_t dev, phandle_t cnode, const char *name, clk_t *clk) /* * Get "clock-output-names" and (optional) "clock-indices" lists. - * Both lists are alocated using M_OFWPROP specifier. + * Both lists are allocated using M_OFWPROP specifier. * * Returns number of items or 0. */ diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c index 9e6f4df107bd..8e7c410d1c55 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c @@ -857,7 +857,7 @@ out: mlx4_cq_set_ci(mcq); wmb(); /* ensure HW sees CQ consumer before we post new buffers */ ring->cons = mcq->cons_index; - ring->prod += polled; /* Polled descriptors were realocated in place */ + ring->prod += polled; /* Polled descriptors were reallocated in place */ mlx4_en_update_rx_prod_db(ring); return polled; From nobody Sat Oct 16 08:42:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DFEEC1809A37; Sat, 16 Oct 2021 08:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWc845ywvz4mH9; Sat, 16 Oct 2021 08:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD5A916C52; Sat, 16 Oct 2021 08:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19G8gCuO090369; Sat, 16 Oct 2021 08:42:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19G8gCKO090368; Sat, 16 Oct 2021 08:42:12 GMT (envelope-from git) Date: Sat, 16 Oct 2021 08:42:12 GMT Message-Id: <202110160842.19G8gCKO090368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: aa92785a5b76 - main - mixer(8): Add -h option to show usage. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa92785a5b76e02f3a9b95a2a90e73760f78698c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=aa92785a5b76e02f3a9b95a2a90e73760f78698c commit aa92785a5b76e02f3a9b95a2a90e73760f78698c Author: Hans Petter Selasky AuthorDate: 2021-10-16 08:39:18 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-16 08:40:37 +0000 mixer(8): Add -h option to show usage. Differential Revision: https://reviews.freebsd.org/D32508 Submitted by: christos@ Sponsored by: NVIDIA Networking --- usr.sbin/mixer/mixer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index ba13291f7b36..b95b7502f3f4 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -65,7 +65,7 @@ main(int argc, char *argv[]) int aflag = 0, dflag = 0, oflag = 0, sflag = 0; int ch; - while ((ch = getopt(argc, argv, "ad:f:os")) != -1) { + while ((ch = getopt(argc, argv, "ad:f:hos")) != -1) { switch (ch) { case 'a': aflag = 1; @@ -85,6 +85,7 @@ main(int argc, char *argv[]) case 's': sflag = 1; break; + case 'h': /* FALLTROUGH */ case '?': default: usage(); @@ -175,7 +176,8 @@ static void __dead2 usage(void) { fprintf(stderr, "usage: %1$s [-f device] [-d unit] [-os] [dev[.control[=value]]] ...\n" - " %1$s [-d unit] [-os] -a\n", getprogname()); + " %1$s [-d unit] [-os] -a\n" + " %1$s -h\n", getprogname()); exit(1); } From nobody Sat Oct 16 12:44:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 258D91803E65; Sat, 16 Oct 2021 12:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWjWn0F5gz4rRm; Sat, 16 Oct 2021 12:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB07919BE4; Sat, 16 Oct 2021 12:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GCiaYw010341; Sat, 16 Oct 2021 12:44:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GCiaYY010340; Sat, 16 Oct 2021 12:44:36 GMT (envelope-from git) Date: Sat, 16 Oct 2021 12:44:36 GMT Message-Id: <202110161244.19GCiaYY010340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 498cca14836d - main - pf: selecting pf_map_addr is not an error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 498cca14836da0408841cca8101e481e32151886 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=498cca14836da0408841cca8101e481e32151886 commit 498cca14836da0408841cca8101e481e32151886 Author: Kristof Provost AuthorDate: 2021-10-16 07:32:15 +0000 Commit: Kristof Provost CommitDate: 2021-10-16 07:32:15 +0000 pf: selecting pf_map_addr is not an error When a redirection/nat IP address is selected by pf_map_addr it is logged with PF_DEBUG_MISC level. This one according to the manual means "Generate debug messages for various errors". Selecting an IP address is not an error, it's a normal function of pf for route-to, nat and some other operations. Therefore PF_DEBUG_NOISY level should be choosen which is means "Generate debug messages for common conditions". PR: 259184 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH --- sys/netpfil/pf/pf_lb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 3da27c7df26d..26fe17a9c3b4 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -364,7 +364,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, return (1); PF_ACPY(naddr, &(*sn)->raddr, af); - if (V_pf_status.debug >= PF_DEBUG_MISC) { + if (V_pf_status.debug >= PF_DEBUG_NOISY) { printf("pf_map_addr: src tracking maps "); pf_print_host(saddr, 0, af); printf(" to "); @@ -539,7 +539,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (*sn != NULL) PF_ACPY(&(*sn)->raddr, naddr, af); - if (V_pf_status.debug >= PF_DEBUG_MISC && + if (V_pf_status.debug >= PF_DEBUG_NOISY && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) { printf("pf_map_addr: selected address "); pf_print_host(naddr, 0, af); From nobody Sat Oct 16 16:02:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C77DC181049D; Sat, 16 Oct 2021 16:02:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWnw01RwMz4q25; Sat, 16 Oct 2021 16:02:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id bkaVm7GxSczbLbm8YmhT5t; Sat, 16 Oct 2021 16:02:18 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id bm8Wmi4AUXoZRbm8XmR7Fe; Sat, 16 Oct 2021 16:02:18 +0000 X-Authority-Analysis: v=2.4 cv=R8NgpfdX c=1 sm=1 tr=0 ts=616af78a a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=8gfv0ekSlNoA:10 a=6I5d2MoRAAAA:8 a=oCJs8q-oAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=g9Bdxua8SMYpVTfbOXkA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=qUF70SbvcHBaGhGVny9j:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1C45411F; Sat, 16 Oct 2021 09:02:16 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 19GG2FYs004292; Sat, 16 Oct 2021 09:02:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202110161602.19GG2FYs004292@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Marcin Wojtas cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 889b56c8cd84 - main - setrlimit: Take stack gap into account. In-reply-to: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> References: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> Comments: In-reply-to Marcin Wojtas message dated "Fri, 15 Oct 2021 08:23:14 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 16 Oct 2021 09:02:15 -0700 X-CMAE-Envelope: MS4xfE3yqBmQdi2wlbjcMdAAAQTBLS9KAHRTxWUgjiFjsgYUXMNUFCE/eWxqtsySK1eS4yGFLgp4Em5VkUq6DMh0HBdRLmrS+Ig9dm2wn6lJr5SNZP3B4cOT YZG+0riZ5rCRPdY5xm9kN+j2RLQVpTDXjITa+gQKz0uEDG4gbXfAoqo1WFLkpStU6JuHzxcVYxN4Dy3OtHLEefbOHxfPA8U2T1W4+W7fmPNcSK6RhYQnuINB btPEaGylbYRzV+th3cNZkLVZDvx1rqDtnRCbqFVReDSu1CnCtsSQHG6AMwEqF/wcIctU8Mnj5zQc5ERotH2EMxlVJLREQLCITPg+qzKU66I= X-Rspamd-Queue-Id: 4HWnw01RwMz4q25 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.32) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.60 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RCVD_IN_DNSWL_NONE(0.00)[3.97.99.32:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[3.97.99.32:from]; RECEIVED_SPAMHAUS_PBL(0.00)[70.66.148.124:received] X-ThisMailContainsUnwantedMimeParts: N In message <202110150823.19F8NEr9047194@gitrepo.freebsd.org>, Marcin Wojtas wri tes: > The branch main has been updated by mw: > > URL: https://cgit.FreeBSD.org/src/commit/?id=889b56c8cd84c9a9f2d9e3b019c154d6 > f14d9021 > > commit 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 > Author: Dawid Gorecki > AuthorDate: 2021-10-13 19:01:08 +0000 > Commit: Marcin Wojtas > CommitDate: 2021-10-15 08:21:47 +0000 > > setrlimit: Take stack gap into account. > > Calling setrlimit with stack gap enabled and with low values of stack > resource limit often caused the program to abort immediately after > exiting the syscall. This happened due to the fact that the resource > limit was calculated assuming that the stack started at sv_usrstack, > while with stack gap enabled the stack is moved by a random number > of bytes. > > Save information about stack size in struct vmspace and adjust the > rlim_cur value. If the rlim_cur and stack gap is bigger than rlim_max, > then the value is truncated to rlim_max. > > PR: 253208 > Reviewed by: kib > Obtained from: Semihalf > Sponsored by: Stormshield > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D31516 > --- > sys/kern/imgact_elf.c | 5 +++-- > sys/kern/kern_exec.c | 11 ++++++++--- > sys/kern/kern_resource.c | 3 +++ > sys/sys/imgact_elf.h | 2 +- > sys/sys/sysent.h | 2 +- > sys/vm/vm_map.c | 2 ++ > sys/vm/vm_map.h | 1 + > 7 files changed, 19 insertions(+), 7 deletions(-) > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > index ef1edfcabaf0..898f0f66a532 100644 > --- a/sys/kern/imgact_elf.c > +++ b/sys/kern/imgact_elf.c > @@ -2684,7 +2684,7 @@ __elfN(untrans_prot)(vm_prot_t prot) > return (flags); > } > > -void > +vm_size_t > __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) > { > uintptr_t range, rbase, gap; > @@ -2692,7 +2692,7 @@ __elfN(stackgap)(struct image_params *imgp, uintptr_t * > stack_base) > > pct = __elfN(aslr_stack_gap); > if (pct == 0) > - return; > + return (0); > if (pct > 50) > pct = 50; > range = imgp->eff_stack_sz * pct / 100; > @@ -2700,4 +2700,5 @@ __elfN(stackgap)(struct image_params *imgp, uintptr_t * > stack_base) > gap = rbase % range; > gap &= ~(sizeof(u_long) - 1); > *stack_base -= gap; > + return (gap); > } > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c > index 50e75fda6cfb..9dceebdd8441 100644 > --- a/sys/kern/kern_exec.c > +++ b/sys/kern/kern_exec.c > @@ -1148,6 +1148,7 @@ exec_new_vmspace(struct image_params *imgp, struct syse > ntvec *sv) > stack_prot, error, vm_mmap_to_errno(error)); > return (vm_mmap_to_errno(error)); > } > + vmspace->vm_stkgap = 0; > > /* > * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but they > @@ -1493,12 +1494,16 @@ exec_args_get_begin_envv(struct image_args *args) > void > exec_stackgap(struct image_params *imgp, uintptr_t *dp) > { > + struct proc *p = imgp->proc; > + > if (imgp->sysent->sv_stackgap == NULL || > - (imgp->proc->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > + (p->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > NT_FREEBSD_FCTL_ASG_DISABLE)) != 0 || > - (imgp->map_flags & MAP_ASLR) == 0) > + (imgp->map_flags & MAP_ASLR) == 0) { > + p->p_vmspace->vm_stkgap = 0; > return; > - imgp->sysent->sv_stackgap(imgp, dp); > + } > + p->p_vmspace->vm_stkgap = imgp->sysent->sv_stackgap(imgp, dp); > } > > /* > diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c > index 4c62961e1bc4..b556d4fded51 100644 > --- a/sys/kern/kern_resource.c > +++ b/sys/kern/kern_resource.c > @@ -671,6 +671,9 @@ kern_proc_setrlimit(struct thread *td, struct proc *p, u_ > int which, > if (limp->rlim_max < 0) > limp->rlim_max = RLIM_INFINITY; > > + if (which == RLIMIT_STACK && limp->rlim_cur != RLIM_INFINITY) > + limp->rlim_cur += p->p_vmspace->vm_stkgap; > + > oldssiz.rlim_cur = 0; > newlim = lim_alloc(); > PROC_LOCK(p); > diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h > index 97383c6eeeb8..294f17c87b6f 100644 > --- a/sys/sys/imgact_elf.h > +++ b/sys/sys/imgact_elf.h > @@ -118,7 +118,7 @@ int __elfN(remove_brand_entry)(Elf_Brandinfo *entry > ); > int __elfN(freebsd_fixup)(uintptr_t *, struct image_params *); > int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); > size_t __elfN(populate_note)(int, void *, void *, size_t, void **); > -void __elfN(stackgap)(struct image_params *, uintptr_t *); > +vm_size_t __elfN(stackgap)(struct image_params *, uintptr_t *); > int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t); > void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int); > void __elfN(prepare_notes)(struct thread *, struct note_info_list *, > diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h > index ad50bf56e87d..ea96c87a79af 100644 > --- a/sys/sys/sysent.h > +++ b/sys/sys/sysent.h > @@ -119,7 +119,7 @@ struct sysentvec { > void (*sv_elf_core_prepare_notes)(struct thread *, > struct note_info_list *, size_t *); > int (*sv_imgact_try)(struct image_params *); > - void (*sv_stackgap)(struct image_params *, uintptr_t *); > + vm_size_t (*sv_stackgap)(struct image_params *, uintptr_t *); > int (*sv_copyout_auxargs)(struct image_params *, > uintptr_t); > int sv_minsigstksz; /* minimum signal stack size */ > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > index 1ac4ccf72f11..87a290b998b9 100644 > --- a/sys/vm/vm_map.c > +++ b/sys/vm/vm_map.c > @@ -343,6 +343,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, pmap_pini > t_t pinit) > vm->vm_taddr = 0; > vm->vm_daddr = 0; > vm->vm_maxsaddr = 0; > + vm->vm_stkgap = 0; > return (vm); > } > > @@ -4265,6 +4266,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_ch > arge) > vm2->vm_taddr = vm1->vm_taddr; > vm2->vm_daddr = vm1->vm_daddr; > vm2->vm_maxsaddr = vm1->vm_maxsaddr; > + vm2->vm_stkgap = vm1->vm_stkgap; > vm_map_lock(old_map); > if (old_map->busy) > vm_map_wait_busy(old_map); > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > index ace205b21b42..873ff62eec4a 100644 > --- a/sys/vm/vm_map.h > +++ b/sys/vm/vm_map.h > @@ -293,6 +293,7 @@ struct vmspace { > caddr_t vm_taddr; /* (c) user virtual address of text */ > caddr_t vm_daddr; /* (c) user virtual address of data */ > caddr_t vm_maxsaddr; /* user VA at max stack growth */ > + vm_size_t vm_stkgap; /* stack gap size in bytes */ > u_int vm_refcnt; /* number of references */ > /* > * Keep the PMAP last, so that CPU-specific variations of that > Is it possible to have a __FreeBSD_version bump for ports? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From nobody Sat Oct 16 18:55:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C97C2180ACCB; Sat, 16 Oct 2021 18:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWslr58JZz4XPF; Sat, 16 Oct 2021 18:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81E3A1F08E; Sat, 16 Oct 2021 18:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GItaKb002528; Sat, 16 Oct 2021 18:55:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GItaN9002527; Sat, 16 Oct 2021 18:55:36 GMT (envelope-from git) Date: Sat, 16 Oct 2021 18:55:36 GMT Message-Id: <202110161855.19GItaN9002527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 46dd801acb23 - main - Add userland boot profiling to TSLOG List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46dd801acb2318c8464b185893bb111f09b71138 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=46dd801acb2318c8464b185893bb111f09b71138 commit 46dd801acb2318c8464b185893bb111f09b71138 Author: Colin Percival AuthorDate: 2021-10-16 18:47:34 +0000 Commit: Colin Percival CommitDate: 2021-10-16 18:47:34 +0000 Add userland boot profiling to TSLOG On kernels compiled with 'options TSLOG', record for each process ID: * The timestamp of the fork() which creates it and the parent process ID, * The first path passed to execve(), if any, * The first path resolved by namei, if any, and * The timestamp of the exit() which terminates the process. Expose this information via a new sysctl, debug.tslog_user. On kernels lacking 'options TSLOG' (the default), no information is recorded and the sysctl does not exist. Note that recording namei is needed in order to obtain the names of rc.d scripts being launched, as the rc system sources them in a subshell rather than execing the scripts. With this commit it is now possible to generate flamecharts of the entire boot process from the start of the loader to the end of /etc/rc. The code needed to perform this processing is currently found in github: https://github.com/cperciva/freebsd-boot-profiling Reviewed by: mhorne Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32493 --- sys/kern/kern_exec.c | 1 + sys/kern/kern_exit.c | 1 + sys/kern/kern_fork.c | 1 + sys/kern/kern_tslog.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/vfs_lookup.c | 1 + sys/sys/tslog.h | 7 +++++ 6 files changed, 96 insertions(+) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index a9998471dd14..a8f07bf39564 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -381,6 +381,7 @@ kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p, struct vmspace *oldvmspace) { + TSEXEC(td->td_proc->p_pid, args->begin_argv); AUDIT_ARG_ARGV(args->begin_argv, args->argc, exec_args_get_begin_envv(args) - args->begin_argv); AUDIT_ARG_ENVV(exec_args_get_begin_envv(args), args->envc, diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 1b2cf63c9b82..79f1d5bd63e5 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -228,6 +228,7 @@ exit1(struct thread *td, int rval, int signo) mtx_assert(&Giant, MA_NOTOWNED); KASSERT(rval == 0 || signo == 0, ("exit1 rv %d sig %d", rval, signo)); + TSPROCEXIT(td->td_proc->p_pid); p = td->td_proc; /* diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 606801283a1f..e8c34a31e6a1 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -392,6 +392,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * p2->p_state = PRS_NEW; /* protect against others */ p2->p_pid = fork_findpid(fr->fr_flags); AUDIT_ARG_PID(p2->p_pid); + TSFORK(p2->p_pid, p1->p_pid); sx_xlock(&allproc_lock); LIST_INSERT_HEAD(&allproc, p2, p_list); diff --git a/sys/kern/kern_tslog.c b/sys/kern/kern_tslog.c index dd3b25158340..38c91911ec08 100644 --- a/sys/kern/kern_tslog.c +++ b/sys/kern/kern_tslog.c @@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -131,3 +133,86 @@ sysctl_debug_tslog(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_debug, OID_AUTO, tslog, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_debug_tslog, "", "Dump recorded event timestamps"); + +MALLOC_DEFINE(M_TSLOGUSER, "tsloguser", "Strings used by userland tslog"); +static struct procdata { + pid_t ppid; + uint64_t tsc_forked; + uint64_t tsc_exited; + char * execname; + char * namei; + int reused; +} procs[PID_MAX + 1]; + +void +tslog_user(pid_t pid, pid_t ppid, const char * execname, const char * namei) +{ + uint64_t tsc = get_cyclecount(); + + /* If we wrapped, do nothing. */ + if (procs[pid].reused) + return; + + /* If we have a ppid, we're recording a fork. */ + if (ppid != (pid_t)(-1)) { + /* If we have a ppid already, we wrapped. */ + if (procs[pid].ppid) { + procs[pid].reused = 1; + return; + } + + /* Fill in some fields. */ + procs[pid].ppid = ppid; + procs[pid].tsc_forked = tsc; + return; + } + + /* If we have an execname, record it. */ + if (execname != NULL) { + if (procs[pid].execname == NULL) + procs[pid].execname = strdup(execname, M_TSLOGUSER); + return; + } + + /* Record the first namei for the process. */ + if (namei != NULL) { + if (procs[pid].namei == NULL) + procs[pid].namei = strdup(namei, M_TSLOGUSER); + return; + } + + /* Otherwise we're recording an exit. */ + procs[pid].tsc_exited = tsc; +} + +static int +sysctl_debug_tslog_user(SYSCTL_HANDLER_ARGS) +{ + int error; + struct sbuf *sb; + pid_t pid; + + sb = sbuf_new_for_sysctl(NULL, NULL, 1024, req); + + /* Export the data we logged. */ + for (pid = 0; pid <= PID_MAX; pid++) { + sbuf_printf(sb, "%zu", (size_t)pid); + sbuf_printf(sb, " %zu", (size_t)procs[pid].ppid); + sbuf_printf(sb, " %llu", + (unsigned long long)procs[pid].tsc_forked); + sbuf_printf(sb, " %llu", + (unsigned long long)procs[pid].tsc_exited); + sbuf_printf(sb, " \"%s\"", procs[pid].execname ? + procs[pid].execname : ""); + sbuf_printf(sb, " \"%s\"", procs[pid].namei ? + procs[pid].namei : ""); + sbuf_printf(sb, "\n"); + } + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +SYSCTL_PROC(_debug, OID_AUTO, tslog_user, + CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_debug_tslog_user, + "", "Dump recorded userland event timestamps"); diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index c1cefae543da..9e10c3092f5a 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -611,6 +611,7 @@ namei(struct nameidata *ndp) ktrnamei(cnp->cn_pnbuf); } #endif + TSNAMEI(curthread->td_proc->p_pid, cnp->cn_pnbuf); /* * First try looking up the target without locking any vnodes. diff --git a/sys/sys/tslog.h b/sys/sys/tslog.h index 4b2971e4e643..af3c0931cac8 100644 --- a/sys/sys/tslog.h +++ b/sys/sys/tslog.h @@ -51,12 +51,19 @@ #define TSUNWAIT(x) TSEVENT2("UNWAIT", x); #define TSHOLD(x) TSEVENT2("HOLD", x); #define TSRELEASE(x) TSEVENT2("RELEASE", x); +#define TSFORK(p, pp) TSRAW_USER(p, pp, NULL, NULL) +#define TSEXEC(p, name) TSRAW_USER(p, (pid_t)(-1), name, NULL) +#define TSNAMEI(p, name) TSRAW_USER(p, (pid_t)(-1), NULL, name) +#define TSPROCEXIT(p) TSRAW_USER(p, (pid_t)(-1), NULL, NULL) #ifdef TSLOG #define TSRAW(a, b, c, d) tslog(a, b, c, d) void tslog(void *, int, const char *, const char *); +#define TSRAW_USER(a, b, c, d) tslog_user(a, b, c, d) +void tslog_user(pid_t, pid_t, const char *, const char *); #else #define TSRAW(a, b, c, d) /* Timestamp logging disabled */ +#define TSRAW_USER(a, b, c, d) /* Timestamp logging disabled */ #endif #endif /* _TSLOG_H_ */ From nobody Sat Oct 16 20:09:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 15499180250F; Sat, 16 Oct 2021 20:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWvNr6r2Wz4syk; Sat, 16 Oct 2021 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C78651FB6C; Sat, 16 Oct 2021 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GK9G7A096218; Sat, 16 Oct 2021 20:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GK9GPd096217; Sat, 16 Oct 2021 20:09:16 GMT (envelope-from git) Date: Sat, 16 Oct 2021 20:09:16 GMT Message-Id: <202110162009.19GK9GPd096217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 7dd419cabc6b - main - cache: add empty path support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7dd419cabc6bb9e019c56d15f8e6a88ee2f46859 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7dd419cabc6bb9e019c56d15f8e6a88ee2f46859 commit 7dd419cabc6bb9e019c56d15f8e6a88ee2f46859 Author: Mateusz Guzik AuthorDate: 2021-09-26 13:00:24 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-16 20:08:37 +0000 cache: add empty path support This avoids spurious drop offs as EMPTY is passed regardless of the actual path name. Pushign the work inside the lookup instead of just ignorign the flag allows avoid checking for empty pathname for all other lookups. --- sys/kern/kern_descrip.c | 2 +- sys/kern/vfs_cache.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++--- sys/kern/vfs_lookup.c | 18 ++++++------- 3 files changed, 74 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 55c2a36955a5..a7e3785bc672 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2903,7 +2903,7 @@ fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsear return (EAGAIN); *fsearch = ((fp->f_flag & FSEARCH) != 0); vp = fp->f_vnode; - if (__predict_false(vp == NULL || vp->v_type != VDIR)) { + if (__predict_false(vp == NULL)) { return (EAGAIN); } if (!filecaps_copy(&fde->fde_caps, &ndp->ni_filecaps, false)) { diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ae26dc70bd05..c1a3b0dab1e8 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4176,9 +4176,9 @@ cache_fpl_terminated(struct cache_fpl *fpl) #define CACHE_FPL_SUPPORTED_CN_FLAGS \ (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ - FAILIFEXISTS | FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | \ - ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK | OPENREAD | \ - OPENWRITE) + FAILIFEXISTS | FOLLOW | EMPTYPATH | LOCKSHARED | SAVENAME | SAVESTART | \ + WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK | \ + OPENREAD | OPENWRITE) #define CACHE_FPL_INTERNAL_CN_FLAGS \ (ISDOTDOT | MAKEENTRY | ISLASTCN) @@ -4197,6 +4197,7 @@ static bool cache_fpl_istrailingslash(struct cache_fpl *fpl) { + MPASS(fpl->nulchar > fpl->cnp->cn_pnbuf); return (*(fpl->nulchar - 1) == '/'); } @@ -4767,6 +4768,54 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) return (cache_fpl_handled(fpl)); } +static int __noinline +cache_fplookup_emptypath(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + enum vgetstate tvs; + struct vnode *tvp; + seqc_t tvp_seqc; + int error, lkflags; + + fpl->tvp = fpl->dvp; + fpl->tvp_seqc = fpl->dvp_seqc; + + ndp = fpl->ndp; + cnp = fpl->cnp; + tvp = fpl->tvp; + tvp_seqc = fpl->tvp_seqc; + + MPASS(*cnp->cn_pnbuf == '\0'); + MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); + + if (__predict_false((cnp->cn_flags & EMPTYPATH) == 0)) { + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled_error(fpl, ENOENT)); + } + + tvs = vget_prep_smr(tvp); + cache_fpl_smr_exit(fpl); + if (__predict_false(tvs == VGET_NONE)) { + return (cache_fpl_aborted(fpl)); + } + + if ((cnp->cn_flags & LOCKLEAF) != 0) { + lkflags = LK_SHARED; + if ((cnp->cn_flags & LOCKSHARED) == 0) + lkflags = LK_EXCLUSIVE; + error = vget_finish(tvp, lkflags, tvs); + if (__predict_false(error != 0)) { + return (cache_fpl_aborted(fpl)); + } + } else { + vget_finish_ref(tvp, tvs); + } + + ndp->ni_resflags |= NIRES_EMPTYPATH; + return (cache_fpl_handled(fpl)); +} + static int __noinline cache_fplookup_noentry(struct cache_fpl *fpl) { @@ -4799,6 +4848,10 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fplookup_skip_slashes(fpl)); } + if (cnp->cn_pnbuf[0] == '\0') { + return (cache_fplookup_emptypath(fpl)); + } + if (cnp->cn_nameptr[0] == '\0') { if (fpl->tvp == NULL) { return (cache_fplookup_degenerate(fpl)); @@ -5486,6 +5539,7 @@ cache_fplookup_parse(struct cache_fpl *fpl) * * TODO: fix this to be word-sized. */ + MPASS(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 1] >= cnp->cn_pnbuf); KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 1] == fpl->nulchar, ("%s: mismatch between pathlen (%zu) and nulchar (%p != %p), string [%s]\n", __func__, fpl->debug.ni_pathlen, &cnp->cn_nameptr[fpl->debug.ni_pathlen - 1], @@ -5739,6 +5793,13 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; + /* + * Hack: delayed empty path checking. + */ + if (cnp->cn_pnbuf[0] == '\0') { + return (cache_fplookup_emptypath(fpl)); + } + /* * TODO: Due to ignoring trailing slashes lookup will perform a * permission check on the last dir when it should not be doing it. It diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 9e10c3092f5a..8cccd93152ef 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -463,13 +463,6 @@ namei_getpath(struct nameidata *ndp) if (__predict_false(error != 0)) return (error); - /* - * Don't allow empty pathnames unless EMPTYPATH is specified. - * Caller checks for ENOENT as an indication for the empty path. - */ - if (__predict_false(*cnp->cn_pnbuf == '\0')) - return (ENOENT); - cnp->cn_nameptr = cnp->cn_pnbuf; return (0); } @@ -598,8 +591,6 @@ namei(struct nameidata *ndp) error = namei_getpath(ndp); if (__predict_false(error != 0)) { - if (error == ENOENT && (cnp->cn_flags & EMPTYPATH) != 0) - return (namei_emptypath(ndp)); namei_cleanup_cnp(cnp); SDT_PROBE4(vfs, namei, lookup, return, error, NULL, false, ndp); @@ -642,6 +633,15 @@ namei(struct nameidata *ndp) case CACHE_FPL_STATUS_ABORTED: TAILQ_INIT(&ndp->ni_cap_tracker); MPASS(ndp->ni_lcf == 0); + if (*cnp->cn_pnbuf == '\0') { + if ((cnp->cn_flags & EMPTYPATH) != 0) { + return (namei_emptypath(ndp)); + } + namei_cleanup_cnp(cnp); + SDT_PROBE4(vfs, namei, lookup, return, ENOENT, NULL, + false, ndp); + return (ENOENT); + } error = namei_setup(ndp, &dp, &pwd); if (error != 0) { namei_cleanup_cnp(cnp); From nobody Sat Oct 16 21:17:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B0A6717FC95E; Sat, 16 Oct 2021 21:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWwvS4ZGWz58nc; Sat, 16 Oct 2021 21:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CED020C26; Sat, 16 Oct 2021 21:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GLHOhx088363; Sat, 16 Oct 2021 21:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GLHOwo088362; Sat, 16 Oct 2021 21:17:24 GMT (envelope-from git) Date: Sat, 16 Oct 2021 21:17:24 GMT Message-Id: <202110162117.19GLHOwo088362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 79239b5b4754 - main - llvm-readobj: Add missed source file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 79239b5b47540d64ffd1e1226f0d12d49df339c1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=79239b5b47540d64ffd1e1226f0d12d49df339c1 commit 79239b5b47540d64ffd1e1226f0d12d49df339c1 Author: Dimitry Andric AuthorDate: 2021-10-16 21:16:46 +0000 Commit: Dimitry Andric CommitDate: 2021-10-16 21:16:46 +0000 llvm-readobj: Add missed source file In some configurations (e.g. powerpc64) the llvm-readobj tool also needs contrib/llvm-project/llvm/BinaryFormat/MsgPackWriter.cpp, so add it to libllvm. Reported by: Shawn Webb Fixes: 1b85b68da0b2 --- lib/clang/libllvm/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index cb9ab974abc5..bd0aee918ef3 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -155,6 +155,7 @@ SRCS_MIN+= BinaryFormat/MachO.cpp SRCS_MIN+= BinaryFormat/MsgPackDocument.cpp SRCS_MIN+= BinaryFormat/MsgPackDocumentYAML.cpp SRCS_MIN+= BinaryFormat/MsgPackReader.cpp +SRCS_MIN+= BinaryFormat/MsgPackWriter.cpp SRCS_MIN+= BinaryFormat/Wasm.cpp SRCS_MIN+= BinaryFormat/XCOFF.cpp SRCS_MIN+= Bitcode/Reader/BitReader.cpp From nobody Sat Oct 16 22:52:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B1E3518076D6; Sat, 16 Oct 2021 22:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWz1c4WYHz4RDg; Sat, 16 Oct 2021 22:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BDDF22146; Sat, 16 Oct 2021 22:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GMqqnc021320; Sat, 16 Oct 2021 22:52:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GMqqSN021319; Sat, 16 Oct 2021 22:52:52 GMT (envelope-from git) Date: Sat, 16 Oct 2021 22:52:52 GMT Message-Id: <202110162252.19GMqqSN021319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: e2aab5e2d734 - main - nfscl: Move release of the clientID lock into nfscl_doclose() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2aab5e2d73486aa76bb861d583bbce021661601 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e2aab5e2d73486aa76bb861d583bbce021661601 commit e2aab5e2d73486aa76bb861d583bbce021661601 Author: Rick Macklem AuthorDate: 2021-10-16 22:49:38 +0000 Commit: Rick Macklem CommitDate: 2021-10-16 22:49:38 +0000 nfscl: Move release of the clientID lock into nfscl_doclose() This patch moves release of the shared clientID lock from nfsrpc_close() just after the nfscl_doclose() call to the end of nfscl_doclose() call. This does make the code cleaner, since the shared lock is acquired at the beginning of nfscl_doclose(). The only semantics change is that the code no longer drops and reaquires the NFSCLSTATELOCK() mutex, which I do not believe will have a negative effect on the NFSv4 client. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. MFC after: 2 week --- sys/fs/nfsclient/nfs_clrpcops.c | 11 +++++------ sys/fs/nfsclient/nfs_clstate.c | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 04597a27edfa..08c9117a8fc1 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -749,13 +749,12 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) return (0); if (doclose) error = nfscl_doclose(vp, &clp, p); - else + else { error = nfscl_getclose(vp, &clp); - if (error) - return (error); - - nfscl_clientrelease(clp); - return (0); + if (error == 0) + nfscl_clientrelease(clp); + } + return (error); } /* diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index d3ce1c6bef8b..7ad0f1c1a364 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3381,6 +3381,7 @@ lookformore: goto lookformore; } } + nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); /* * recallp has been set NULL by nfscl_retoncloselayout() if it was From nobody Sat Oct 16 23:06:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CBA74180CF7E; Sat, 16 Oct 2021 23:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWzKB5NSmz4V5n; Sat, 16 Oct 2021 23:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94C452252D; Sat, 16 Oct 2021 23:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GN6MSe036120; Sat, 16 Oct 2021 23:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GN6MLj036119; Sat, 16 Oct 2021 23:06:22 GMT (envelope-from git) Date: Sat, 16 Oct 2021 23:06:22 GMT Message-Id: <202110162306.19GN6MLj036119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 076b3a50fd71 - main - pf: don't drop packets when redirection information comes from a state List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 076b3a50fd71d84f47bca71758e7fff3c02582e9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=076b3a50fd71d84f47bca71758e7fff3c02582e9 commit 076b3a50fd71d84f47bca71758e7fff3c02582e9 Author: Kristof Provost AuthorDate: 2021-10-16 16:53:39 +0000 Commit: Kristof Provost CommitDate: 2021-10-16 21:02:26 +0000 pf: don't drop packets when redirection information comes from a state For some traffic there might be no matching rule in the current ruleset, for example when a state was imported via pfsync from a sytem with a different ruleset checksum. In this case pf_route uses s->rt_addr for routing target instead of r->rpool.cur but r->rpool is checked anyway, resulting in dropped packets. PR: 259183 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH --- sys/netpfil/pf/pf.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index b67f688c3f3f..2c625703c5d9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5856,12 +5856,12 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, bzero(&naddr, sizeof(naddr)); - if (TAILQ_EMPTY(&r->rpool.list)) { - DPFPRINTF(PF_DEBUG_URGENT, - ("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__)); - goto bad_locked; - } if (s == NULL) { + if (TAILQ_EMPTY(&r->rpool.list)) { + DPFPRINTF(PF_DEBUG_URGENT, + ("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__)); + goto bad_locked; + } pf_map_addr(AF_INET, r, (struct pf_addr *)&ip->ip_src, &naddr, NULL, &sn); if (!PF_AZERO(&naddr, AF_INET)) @@ -6042,12 +6042,12 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, bzero(&naddr, sizeof(naddr)); - if (TAILQ_EMPTY(&r->rpool.list)) { - DPFPRINTF(PF_DEBUG_URGENT, - ("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__)); - goto bad_locked; - } if (s == NULL) { + if (TAILQ_EMPTY(&r->rpool.list)) { + DPFPRINTF(PF_DEBUG_URGENT, + ("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__)); + goto bad_locked; + } pf_map_addr(AF_INET6, r, (struct pf_addr *)&ip6->ip6_src, &naddr, NULL, &sn); if (!PF_AZERO(&naddr, AF_INET6)) From nobody Sat Oct 16 23:12:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7FBD918101B3 for ; Sat, 16 Oct 2021 23:12:08 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HWzRr2vzzz4XRL for ; Sat, 16 Oct 2021 23:12:08 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x830.google.com with SMTP id i1so12178695qtr.6 for ; Sat, 16 Oct 2021 16:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OLKXWc6Efue4NFwZ5fortKde2wOnatTl1dte/wexwOE=; b=a7PbvDxb+pI2VaOlZF4fzg8Rsf1NC3EnmeOrCFoeMkIz3/lxlUSaBK7iNhNPnJb00Y IfD+54rw6MtUBswVJhx47TUfPEzMbrPaiy5ju6GslyK4cWN8ofLGdtKr6LeSmI2J7JOr Nhzjj60nyEvKJvrxCVaHm9wsCnNw3XhImHBWkgFiVdHbHLNlZ5C7SLFxCiw6zFobAbe5 v6EV1s1qN2MVxrOXIHU+Tj7LLckLcD0gIopxgdt2ObAUpBjBYhcAgnTY1bb+FeEDtvop lZZTGbMwSn933KbsRW+qC4Kb8U+KgEAgQY/mGfl0su9XxVfNS3YLcth1JQ8WDetO2Gq8 7izw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OLKXWc6Efue4NFwZ5fortKde2wOnatTl1dte/wexwOE=; b=ELD8kHwXwHTIXceNVuXVt2rdabyjzKRcVeYINTc7RvsnJrMTGwHgpBF2q14eiv6Dac m2HCLps6bEJejg8R/UhSLxeh5JwZ1dG1lHMfo7RRb8ZYr6W0C1ljd9SDDt3NSBhqecBA p/5T+ftx7T+RoaSGQwsz2cFuyFMSfAqUBCUx8SXXOiH32nG8R0ALc22Q2beDBo77i0H9 MSuFKjXfgqt0jtfoQaRk5Dp0VVICF7t4A8S0HzkcfyluzM3DDYgMLtnfw2fFrCrBIuHG UQ15wumqv8HtK6bcfAp4bpUU4x/7/sqSCgq9XaA/q8OozPBadQcKLMLYC9KSPKaauJt+ f14Q== X-Gm-Message-State: AOAM530Jv+7CLu778Z+875/xfUKlGUVvGxf8IEfit7ZcOjM8Ql/bHShm 620h42Bzxkb1gX2w99a1deeQtQvYInkA8MXk X-Google-Smtp-Source: ABdhPJw22gskl28caa5UiaztdGDMXS4I+ljIC7GI3rR9CNb7BmFAmqTZWljEjgWuAFEE8mCYtXPzNA== X-Received: by 2002:ac8:7c52:: with SMTP id o18mr22236067qtv.139.1634425928005; Sat, 16 Oct 2021 16:12:08 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id h20sm2255632qtx.10.2021.10.16.16.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 16:12:07 -0700 (PDT) Date: Sat, 16 Oct 2021 19:12:07 -0400 From: Shawn Webb To: Kristof Provost Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 076b3a50fd71 - main - pf: don't drop packets when redirection information comes from a state Message-ID: <20211016231207.s6rw6ndjrsshya2r@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202110162306.19GN6MLj036119@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pxsb6acv6liysvfb" Content-Disposition: inline In-Reply-To: <202110162306.19GN6MLj036119@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HWzRr2vzzz4XRL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --pxsb6acv6liysvfb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 16, 2021 at 11:06:22PM +0000, Kristof Provost wrote: > The branch main has been updated by kp: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D076b3a50fd71d84f47bca71758= e7fff3c02582e9 >=20 > commit 076b3a50fd71d84f47bca71758e7fff3c02582e9 > Author: Kristof Provost > AuthorDate: 2021-10-16 16:53:39 +0000 > Commit: Kristof Provost > CommitDate: 2021-10-16 21:02:26 +0000 >=20 > pf: don't drop packets when redirection information comes from a state > =20 > For some traffic there might be no matching rule in the current rules= et, > for example when a state was imported via pfsync from a sytem with a > different ruleset checksum. In this case pf_route uses s->rt_addr for > routing target instead of r->rpool.cur but r->rpool is checked anyway, > resulting in dropped packets. > =20 > PR: 259183 > Submitted by: Kajetan Staszkiewicz > Sponsored by: InnoGames GmbH Hey Kristof, Any plans to MFC? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --pxsb6acv6liysvfb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmFrXEQACgkQ/y5nonf4 4frwDBAAi/OG1vgbYiKMFkm+vYLZqxakAj7629ezWtbrNHZgsl6Eh6JuG3tdrV3A O+cI9b/pR9VN6uLV6HNzaJigAuvudOs4M3nG3oxNOx/w0d0zBuFL0YQ9/L+MHwLO WpJXnq4mwiuzBY4L3MYgMX6/Tyb/JVsmcTKMvdInJYfLIICL5JuCDCaUVnp9md3b FD92W/eHx0AKxi+AhBbrGoJRkXSFA61Nt3v3pmLSpS0H/VHAH/Z77NvDuaecorrL gQvXuqEbwQWn6TSReGI34MOBhMdjAhn7I/1kvrIOSm+w5Iy/Vtdeyt0OYNmln25/ jSE6t8VJBPkyioBLvF+h1ufuCIT+GejcFHm8Xu9aWCGIjiBzZEwPCeoTmtIRo9co ynRKkp+fkHuzwOeASo8Tv9lgHG4DG0rpPIDjT+gttoej1jnktr1yS4uRwa5siPkk 1lwLvbNds4Ux4H1LecNjgkTEjKtHvhi6ye5wG/O9oa6HqbJiBzZk/DrHdLthTbeF uVRwk2OladTkqrJZf5w0bXjXQ7u314JJNPVsc3DngNGuAmkjYigoYtfxhgsDjQ4G vbeCYXxzQTYgE0ttwHLpzmqI+7XuHqwC/7h8q5XQWtj5Ha90PZXN4EgiiwTaSzlm jfa48mNMvwTkUFH9M2Sn0uNfKQWPj0W3GQiwH+TNuz9cDCeQbXw= =ge0J -----END PGP SIGNATURE----- --pxsb6acv6liysvfb-- From nobody Sat Oct 16 23:37:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E8A7917F1A4F; Sat, 16 Oct 2021 23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HX01B691zz4f99; Sat, 16 Oct 2021 23:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B078A22743; Sat, 16 Oct 2021 23:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GNbYqS075792; Sat, 16 Oct 2021 23:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GNbYFE075791; Sat, 16 Oct 2021 23:37:34 GMT (envelope-from git) Date: Sat, 16 Oct 2021 23:37:34 GMT Message-Id: <202110162337.19GNbYFE075791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1cf06333160a - main - sys: Add definitions for RELR relative relocation format List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cf06333160a9a6a4dabeba19f6d67ab55f0dac2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1cf06333160a9a6a4dabeba19f6d67ab55f0dac2 commit 1cf06333160a9a6a4dabeba19f6d67ab55f0dac2 Author: Fangrui Song AuthorDate: 2021-10-16 21:31:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-16 23:37:13 +0000 sys: Add definitions for RELR relative relocation format MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32526 --- sys/sys/elf32.h | 2 ++ sys/sys/elf64.h | 2 ++ sys/sys/elf_common.h | 3 +++ sys/sys/elf_generic.h | 1 + 4 files changed, 8 insertions(+) diff --git a/sys/sys/elf32.h b/sys/sys/elf32.h index ad44b7cf970a..c328ce3b2f80 100644 --- a/sys/sys/elf32.h +++ b/sys/sys/elf32.h @@ -152,6 +152,8 @@ typedef struct { /* Macro for constructing r_info from field values. */ #define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) +typedef Elf32_Word Elf32_Relr; + /* * Note entry header */ diff --git a/sys/sys/elf64.h b/sys/sys/elf64.h index 880166a3e83a..cc5c682e07da 100644 --- a/sys/sys/elf64.h +++ b/sys/sys/elf64.h @@ -166,6 +166,8 @@ typedef struct { #define ELF64_R_TYPE_INFO(data, type) \ (((Elf64_Xword)(data)<<8)+(Elf64_Xword)(type)) +typedef Elf64_Xword Elf64_Relr; + /* * Note entry header */ diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 4df2751b07cf..e8eda4d91260 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -617,6 +617,9 @@ typedef struct { #define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of pre-initialization functions. */ #define DT_MAXPOSTAGS 34 /* number of positive tags */ +#define DT_RELRSZ 35 /* Total size of ElfNN_Relr relocations. */ +#define DT_RELR 36 /* Address of ElfNN_Relr relocations. */ +#define DT_RELRENT 37 /* Size of each ElfNN_Relr relocation. */ #define DT_LOOS 0x6000000d /* First OS-specific */ #define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */ #define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */ diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h index dcd44fe93b14..177de7339d3f 100644 --- a/sys/sys/elf_generic.h +++ b/sys/sys/elf_generic.h @@ -71,6 +71,7 @@ __ElfType(Phdr); __ElfType(Dyn); __ElfType(Rel); __ElfType(Rela); +__ElfType(Relr); __ElfType(Sym); __ElfType(Verdef); __ElfType(Verdaux); From nobody Sat Oct 16 23:37:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5F37117F19E4; Sat, 16 Oct 2021 23:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HX01D0Jn8z4f48; Sat, 16 Oct 2021 23:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1342229E4; Sat, 16 Oct 2021 23:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GNbZlc075816; Sat, 16 Oct 2021 23:37:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GNbZNi075815; Sat, 16 Oct 2021 23:37:35 GMT (envelope-from git) Date: Sat, 16 Oct 2021 23:37:35 GMT Message-Id: <202110162337.19GNbZNi075815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a7d137fcbcac - main - rtld: Support DT_RELR relative relocation format List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7d137fcbcac7182d4fcdc97a46b10edc5c7041d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a7d137fcbcac7182d4fcdc97a46b10edc5c7041d commit a7d137fcbcac7182d4fcdc97a46b10edc5c7041d Author: Fangrui Song AuthorDate: 2021-10-16 21:34:37 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-16 23:37:13 +0000 rtld: Support DT_RELR relative relocation format PIE and shared objects usually have many relative relocations. In 2017/2018, a compact relative relocation format RELR was proposed on https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/GxjM0L-PBAAJ ("Proposal for a new section type SHT_RELR") and is a pre-standard. RELR usually takes 3% or smaller space than R_*_RELATIVE relocations. The virtual memory size of a mostly statically linked PIE is typically 5~10% smaller. ld.lld --pack-dyn-relocs=relr emits RELR relocations. DT_RELR has been adopted by Android bionic, Linux kernel's arm64 port, Chrome OS (patched glibc). This patch adds DT_RELR support to FreeBSD rtld-elf. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32524 --- libexec/rtld-elf/rtld.c | 36 ++++++++++++++++++++++++++++++++++++ libexec/rtld-elf/rtld.h | 2 ++ 2 files changed, 38 insertions(+) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 6c304f98253a..d598bb044f8e 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1255,6 +1255,18 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath, assert(dynp->d_un.d_val == sizeof(Elf_Rela)); break; + case DT_RELR: + obj->relr = (const Elf_Relr *)(obj->relocbase + dynp->d_un.d_ptr); + break; + + case DT_RELRSZ: + obj->relrsize = dynp->d_un.d_val; + break; + + case DT_RELRENT: + assert(dynp->d_un.d_val == sizeof(Elf_Relr)); + break; + case DT_PLTREL: plttype = dynp->d_un.d_val; assert(dynp->d_un.d_val == DT_REL || plttype == DT_RELA); @@ -3148,6 +3160,29 @@ reloc_textrel_prot(Obj_Entry *obj, bool before) return (0); } +/* Process RELR relative relocations. */ +static void +reloc_relr(Obj_Entry *obj) +{ + const Elf_Relr *relr, *relrlim; + Elf_Addr *where; + + relrlim = (const Elf_Relr *)((const char *)obj->relr + obj->relrsize); + for (relr = obj->relr; relr < relrlim; relr++) { + Elf_Relr entry = *relr; + + if ((entry & 1) == 0) { + where = (Elf_Addr *)(obj->relocbase + entry); + *where++ += (Elf_Addr)obj->relocbase; + } else { + for (long i = 0; (entry >>= 1) != 0; i++) + if ((entry & 1) != 0) + where[i] += (Elf_Addr)obj->relocbase; + where += CHAR_BIT * sizeof(Elf_Relr) - 1; + } + } +} + /* * Relocate single object. * Returns 0 on success, or -1 on failure. @@ -3174,6 +3209,7 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Entry *rtldobj, /* Process the non-PLT non-IFUNC relocations. */ if (reloc_non_plt(obj, rtldobj, flags, lockstate)) return (-1); + reloc_relr(obj); /* Re-protected the text segment. */ if (obj->textrel && reloc_textrel_prot(obj, false) != 0) diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 060b83b2cdad..b216e80115bc 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -174,6 +174,8 @@ typedef struct Struct_Obj_Entry { unsigned long relsize; /* Size in bytes of relocation info */ const Elf_Rela *rela; /* Relocation entries with addend */ unsigned long relasize; /* Size in bytes of addend relocation info */ + const Elf_Relr *relr; /* RELR relocation entries */ + unsigned long relrsize; /* Size in bytes of RELR relocations */ const Elf_Rel *pltrel; /* PLT relocation entries */ unsigned long pltrelsize; /* Size in bytes of PLT relocation info */ const Elf_Rela *pltrela; /* PLT relocation entries with addend */ From nobody Sat Oct 16 23:48:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F042817F5E62; Sat, 16 Oct 2021 23:48:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HX0Fm5rxZz4jGt; Sat, 16 Oct 2021 23:48:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf2c.google.com with SMTP id e13so2727628qvf.5; Sat, 16 Oct 2021 16:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4EoFoRZXqbZoWhfBDSInIQUpmeVWHhulR9oD/S7Md6k=; b=E/995OMc5e7/MX6G3KXT/bew9q0vQ88crkThSvYFcm+FvEJM/cDw4hyFsxld9MYhna fNMTQsXMuBXs+CjP+WYqbqK+KVhJUzgL9jfEFY+YDh3nnDi7F1egBbIaRmaQIQeoEE4g /3LsfafUCcE1mFun4GobYMWrSMQVWFak49zDqxbaXq0t9FBxeXqCP8UA3cRPuVlTQDkM MNf34d+LjBe72ckiUym0rrx3zySV9oBNAe+zAcnzEq7KGUwPGsK7rY3csX0Msp6jWUw5 diqRztvkQne/1toAhrhkVfD22x9j6KUQxhAlu0PTm6/ejAy9vImpu6+HCVE+uqsF383P 6RvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=4EoFoRZXqbZoWhfBDSInIQUpmeVWHhulR9oD/S7Md6k=; b=1L9t3iLTu/xPaJMhoXl4rh/dOpVjibunHw+BXRAU4j30kPsqfQpEzK/aavRHdo1nBk R/IcbIt4+9iYeAbYHoxwaFBikbP7BAB3N71Dw67zsIKU2//2hRxV9QkRtPZhLcXvJhz6 zlIMXvC8cBpb8N0H8CC0k3yPhOL7r/LgGIBkZzV5exQk1t8cZ1FcK6GwzC+MTgmYl8I1 xq5Cze8ieZBjRP/+eKvrrWN8eqSNCPXuu/oNVCOnta+bZ5TXTksVVoep5NrqZOcMh/1V 2DBkW2OILl6UE6Qik98T87QYR/gA+EiGR2yZV7igdL7ZX/HDxlBdfoJj6PneWUoqGNxY ONag== X-Gm-Message-State: AOAM5325PEW40Ot4zvF9p2IuHkYgQjXos/NMK1otU6i7vKatFEfrQR7V Rbq6yBoJtNmqZ5FdmbCkIegDGoCznWs= X-Google-Smtp-Source: ABdhPJzV7TUWRaXMQHgjg3/qVfbiCHVxu6heqoMa9NgGaR1h2XBGs8p2sxLG0tnvFp8eVJd2a6GVkA== X-Received: by 2002:a0c:ed4e:: with SMTP id v14mr19278508qvq.40.1634428108151; Sat, 16 Oct 2021 16:48:28 -0700 (PDT) Received: from nuc ([142.126.186.191]) by smtp.gmail.com with ESMTPSA id g11sm5012656qko.31.2021.10.16.16.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 16:48:27 -0700 (PDT) Sender: Mark Johnston Date: Sat, 16 Oct 2021 19:48:25 -0400 From: Mark Johnston To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7dd419cabc6b - main - cache: add empty path support Message-ID: References: <202110162009.19GK9GPd096217@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110162009.19GK9GPd096217@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HX0Fm5rxZz4jGt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Oct 16, 2021 at 08:09:16PM +0000, Mateusz Guzik wrote: > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7dd419cabc6bb9e019c56d15f8e6a88ee2f46859 > > commit 7dd419cabc6bb9e019c56d15f8e6a88ee2f46859 > Author: Mateusz Guzik > AuthorDate: 2021-09-26 13:00:24 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-10-16 20:08:37 +0000 > > cache: add empty path support > > This avoids spurious drop offs as EMPTY is passed regardless of the > actual path name. > > Pushign the work inside the lookup instead of just ignorign the flag > allows avoid checking for empty pathname for all other lookups. Hi, syzbot hit a bug in this commit: https://syzkaller.appspot.com/bug?id=283995ae4346041c1757f62f3322a3545d0a62a4 There's no reproducer yet but I expect one would appear within a day or so (hopefully much less). > --- > sys/kern/kern_descrip.c | 2 +- > sys/kern/vfs_cache.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++--- > sys/kern/vfs_lookup.c | 18 ++++++------- > 3 files changed, 74 insertions(+), 13 deletions(-) > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 55c2a36955a5..a7e3785bc672 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -2903,7 +2903,7 @@ fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsear > return (EAGAIN); > *fsearch = ((fp->f_flag & FSEARCH) != 0); > vp = fp->f_vnode; > - if (__predict_false(vp == NULL || vp->v_type != VDIR)) { > + if (__predict_false(vp == NULL)) { > return (EAGAIN); > } > if (!filecaps_copy(&fde->fde_caps, &ndp->ni_filecaps, false)) { > diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c > index ae26dc70bd05..c1a3b0dab1e8 100644 > --- a/sys/kern/vfs_cache.c > +++ b/sys/kern/vfs_cache.c > @@ -4176,9 +4176,9 @@ cache_fpl_terminated(struct cache_fpl *fpl) > > #define CACHE_FPL_SUPPORTED_CN_FLAGS \ > (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ > - FAILIFEXISTS | FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | \ > - ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK | OPENREAD | \ > - OPENWRITE) > + FAILIFEXISTS | FOLLOW | EMPTYPATH | LOCKSHARED | SAVENAME | SAVESTART | \ > + WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK | \ > + OPENREAD | OPENWRITE) > > #define CACHE_FPL_INTERNAL_CN_FLAGS \ > (ISDOTDOT | MAKEENTRY | ISLASTCN) > @@ -4197,6 +4197,7 @@ static bool > cache_fpl_istrailingslash(struct cache_fpl *fpl) > { > > + MPASS(fpl->nulchar > fpl->cnp->cn_pnbuf); > return (*(fpl->nulchar - 1) == '/'); > } > > @@ -4767,6 +4768,54 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) > return (cache_fpl_handled(fpl)); > } > > +static int __noinline > +cache_fplookup_emptypath(struct cache_fpl *fpl) > +{ > + struct nameidata *ndp; > + struct componentname *cnp; > + enum vgetstate tvs; > + struct vnode *tvp; > + seqc_t tvp_seqc; > + int error, lkflags; > + > + fpl->tvp = fpl->dvp; > + fpl->tvp_seqc = fpl->dvp_seqc; > + > + ndp = fpl->ndp; > + cnp = fpl->cnp; > + tvp = fpl->tvp; > + tvp_seqc = fpl->tvp_seqc; > + > + MPASS(*cnp->cn_pnbuf == '\0'); > + MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); > + > + if (__predict_false((cnp->cn_flags & EMPTYPATH) == 0)) { > + cache_fpl_smr_exit(fpl); > + return (cache_fpl_handled_error(fpl, ENOENT)); > + } > + > + tvs = vget_prep_smr(tvp); > + cache_fpl_smr_exit(fpl); > + if (__predict_false(tvs == VGET_NONE)) { > + return (cache_fpl_aborted(fpl)); > + } > + > + if ((cnp->cn_flags & LOCKLEAF) != 0) { > + lkflags = LK_SHARED; > + if ((cnp->cn_flags & LOCKSHARED) == 0) > + lkflags = LK_EXCLUSIVE; > + error = vget_finish(tvp, lkflags, tvs); > + if (__predict_false(error != 0)) { > + return (cache_fpl_aborted(fpl)); > + } > + } else { > + vget_finish_ref(tvp, tvs); > + } > + > + ndp->ni_resflags |= NIRES_EMPTYPATH; > + return (cache_fpl_handled(fpl)); > +} > + > static int __noinline > cache_fplookup_noentry(struct cache_fpl *fpl) > { > @@ -4799,6 +4848,10 @@ cache_fplookup_noentry(struct cache_fpl *fpl) > return (cache_fplookup_skip_slashes(fpl)); > } > > + if (cnp->cn_pnbuf[0] == '\0') { > + return (cache_fplookup_emptypath(fpl)); > + } > + > if (cnp->cn_nameptr[0] == '\0') { > if (fpl->tvp == NULL) { > return (cache_fplookup_degenerate(fpl)); > @@ -5486,6 +5539,7 @@ cache_fplookup_parse(struct cache_fpl *fpl) > * > * TODO: fix this to be word-sized. > */ > + MPASS(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 1] >= cnp->cn_pnbuf); > KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 1] == fpl->nulchar, > ("%s: mismatch between pathlen (%zu) and nulchar (%p != %p), string [%s]\n", > __func__, fpl->debug.ni_pathlen, &cnp->cn_nameptr[fpl->debug.ni_pathlen - 1], > @@ -5739,6 +5793,13 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) > dvp = fpl->dvp; > dvp_seqc = fpl->dvp_seqc; > > + /* > + * Hack: delayed empty path checking. > + */ > + if (cnp->cn_pnbuf[0] == '\0') { > + return (cache_fplookup_emptypath(fpl)); > + } > + > /* > * TODO: Due to ignoring trailing slashes lookup will perform a > * permission check on the last dir when it should not be doing it. It > diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c > index 9e10c3092f5a..8cccd93152ef 100644 > --- a/sys/kern/vfs_lookup.c > +++ b/sys/kern/vfs_lookup.c > @@ -463,13 +463,6 @@ namei_getpath(struct nameidata *ndp) > if (__predict_false(error != 0)) > return (error); > > - /* > - * Don't allow empty pathnames unless EMPTYPATH is specified. > - * Caller checks for ENOENT as an indication for the empty path. > - */ > - if (__predict_false(*cnp->cn_pnbuf == '\0')) > - return (ENOENT); > - > cnp->cn_nameptr = cnp->cn_pnbuf; > return (0); > } > @@ -598,8 +591,6 @@ namei(struct nameidata *ndp) > > error = namei_getpath(ndp); > if (__predict_false(error != 0)) { > - if (error == ENOENT && (cnp->cn_flags & EMPTYPATH) != 0) > - return (namei_emptypath(ndp)); > namei_cleanup_cnp(cnp); > SDT_PROBE4(vfs, namei, lookup, return, error, NULL, > false, ndp); > @@ -642,6 +633,15 @@ namei(struct nameidata *ndp) > case CACHE_FPL_STATUS_ABORTED: > TAILQ_INIT(&ndp->ni_cap_tracker); > MPASS(ndp->ni_lcf == 0); > + if (*cnp->cn_pnbuf == '\0') { > + if ((cnp->cn_flags & EMPTYPATH) != 0) { > + return (namei_emptypath(ndp)); > + } > + namei_cleanup_cnp(cnp); > + SDT_PROBE4(vfs, namei, lookup, return, ENOENT, NULL, > + false, ndp); > + return (ENOENT); > + } > error = namei_setup(ndp, &dp, &pwd); > if (error != 0) { > namei_cleanup_cnp(cnp); From nobody Sun Oct 17 08:03:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2298618097DD; Sun, 17 Oct 2021 08:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXCDm0Mf6z4pkT; Sun, 17 Oct 2021 08:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E041918EE; Sun, 17 Oct 2021 08:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19H83JRC053756; Sun, 17 Oct 2021 08:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19H83JwN053755; Sun, 17 Oct 2021 08:03:19 GMT (envelope-from git) Date: Sun, 17 Oct 2021 08:03:19 GMT Message-Id: <202110170803.19H83JwN053755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a3a82ed84312 - main - mixer.8: Document -h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3a82ed84312f76609506a4de909a8ec2ef70c02 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a3a82ed84312f76609506a4de909a8ec2ef70c02 commit a3a82ed84312f76609506a4de909a8ec2ef70c02 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-17 08:02:15 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-17 08:02:15 +0000 mixer.8: Document -h --- usr.sbin/mixer/mixer.8 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/mixer/mixer.8 b/usr.sbin/mixer/mixer.8 index 3a0a70932ba9..2dd7818a1fd4 100644 --- a/usr.sbin/mixer/mixer.8 +++ b/usr.sbin/mixer/mixer.8 @@ -22,7 +22,7 @@ .\" $FreeBSD$ .\" -.Dd September 22, 2021 +.Dd October 17, 2021 .Dt mixer 8 .Os .Sh NAME @@ -39,6 +39,8 @@ .Op Fl d Ar unit .Op Fl os .Fl a +.Nm +.Fl h .Sh DESCRIPTION The .Nm @@ -58,6 +60,8 @@ at the number each mixer device has by running Open .Ar device as the mixer device (see FILES). +.It Fl h +Print a help message. .It Fl o Print mixer values in a format suitable for use inside scripts. The mixer's header (name, audio card name, ...) will not be printed. From nobody Sun Oct 17 08:45:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EE90E17F335E; Sun, 17 Oct 2021 08:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXD9F6Q9fz3Htj; Sun, 17 Oct 2021 08:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD0761F38; Sun, 17 Oct 2021 08:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19H8jLQI006819; Sun, 17 Oct 2021 08:45:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19H8jL6x006818; Sun, 17 Oct 2021 08:45:21 GMT (envelope-from git) Date: Sun, 17 Oct 2021 08:45:21 GMT Message-Id: <202110170845.19H8jL6x006818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 1045352f1503 - main - cache: only assert on flags when dealing with EMPTYPATH List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1045352f150346ba422b3a3ce6344fc694bc3aa4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1045352f150346ba422b3a3ce6344fc694bc3aa4 commit 1045352f150346ba422b3a3ce6344fc694bc3aa4 Author: Mateusz Guzik AuthorDate: 2021-10-17 08:40:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-17 08:42:47 +0000 cache: only assert on flags when dealing with EMPTYPATH Reported by: syzbot+bd48ee0843206a09e6b8@syzkaller.appspotmail.com Fixes: 7dd419cabc6bb9e0 ("cache: add empty path support") --- sys/kern/vfs_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index c1a3b0dab1e8..656f446b7394 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4787,13 +4787,14 @@ cache_fplookup_emptypath(struct cache_fpl *fpl) tvp_seqc = fpl->tvp_seqc; MPASS(*cnp->cn_pnbuf == '\0'); - MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); if (__predict_false((cnp->cn_flags & EMPTYPATH) == 0)) { cache_fpl_smr_exit(fpl); return (cache_fpl_handled_error(fpl, ENOENT)); } + MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); + tvs = vget_prep_smr(tvp); cache_fpl_smr_exit(fpl); if (__predict_false(tvs == VGET_NONE)) { From nobody Sun Oct 17 10:48:49 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3AD4318066A1; Sun, 17 Oct 2021 10:48:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXGvk1G6jz4Ywd; Sun, 17 Oct 2021 10:48:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BBB93C01; Sun, 17 Oct 2021 10:48:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HAmn5l067528; Sun, 17 Oct 2021 10:48:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HAmnZu067527; Sun, 17 Oct 2021 10:48:49 GMT (envelope-from git) Date: Sun, 17 Oct 2021 10:48:49 GMT Message-Id: <202110171048.19HAmnZu067527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 7e7859e7c2b9 - main - linux: Partially implement TCSBRK List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e7859e7c2b900fd1b1af6e90ed31d51b9b5514d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=7e7859e7c2b900fd1b1af6e90ed31d51b9b5514d commit 7e7859e7c2b900fd1b1af6e90ed31d51b9b5514d Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 10:19:51 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-17 10:19:56 +0000 linux: Partially implement TCSBRK This fixes tcflush(3), unbreaking cheribuild.py under arm64 Focal. Reviewed By: imp Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32291 --- sys/compat/linux/linux_ioctl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 62cb958aa42f..e3ce41ed38f8 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -755,7 +755,15 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) td)); break; - /* LINUX_TCSBRK */ + case LINUX_TCSBRK: + if (args->arg != 0) { + error = (fo_ioctl(fp, TIOCDRAIN, (caddr_t)&bios, td->td_ucred, + td)); + } else { + linux_msg(td, "ioctl TCSBRK arg 0 not implemented"); + error = ENOIOCTL; + } + break; case LINUX_TCXONC: { switch (args->arg) { From nobody Sun Oct 17 11:19:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 58C35181171E; Sun, 17 Oct 2021 11:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXHb21qtLz4hG5; Sun, 17 Oct 2021 11:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ED4143AE; Sun, 17 Oct 2021 11:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HBJQ5a008754; Sun, 17 Oct 2021 11:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HBJQri008753; Sun, 17 Oct 2021 11:19:26 GMT (envelope-from git) Date: Sun, 17 Oct 2021 11:19:26 GMT Message-Id: <202110171119.19HBJQri008753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 75a9d95b4d0a - main - linux: Adjust PTRACE_GET_SYSCALL_INFO buffer size semantics List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75a9d95b4d0a043ac0f3f8d1efc0982156337eac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=75a9d95b4d0a043ac0f3f8d1efc0982156337eac commit 75a9d95b4d0a043ac0f3f8d1efc0982156337eac Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 10:49:42 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-17 10:49:46 +0000 linux: Adjust PTRACE_GET_SYSCALL_INFO buffer size semantics The tests/ptrace_syscall_info test from strace(1) complained about this. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32368 --- sys/amd64/linux/linux_ptrace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index eb39e3c9ada6..a59702757972 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -524,7 +524,7 @@ linux_ptrace_seize(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) static int linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, - l_ulong addr, l_ulong data) + l_ulong len, l_ulong data) { struct ptrace_lwpinfo lwpinfo; struct ptrace_sc_ret sr; @@ -589,7 +589,8 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, si.instruction_pointer = b_reg.r_rip; si.stack_pointer = b_reg.r_rsp; - error = copyout(&si, (void *)data, sizeof(si)); + len = MIN(len, sizeof(si)); + error = copyout(&si, (void *)data, len); if (error == 0) td->td_retval[0] = sizeof(si); From nobody Sun Oct 17 11:51:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1C5FA17F622F; Sun, 17 Oct 2021 11:51:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXJHz0F1Kz4qDS; Sun, 17 Oct 2021 11:51:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCA1A49C9; Sun, 17 Oct 2021 11:51:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HBpQcr059960; Sun, 17 Oct 2021 11:51:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HBpQmx059959; Sun, 17 Oct 2021 11:51:26 GMT (envelope-from git) Date: Sun, 17 Oct 2021 11:51:26 GMT Message-Id: <202110171151.19HBpQmx059959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: f9246e148488 - main - linux: Implement some bits of PTRACE_PEEKUSER List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9246e14848820664539763b72b6fdef408d20e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f9246e14848820664539763b72b6fdef408d20e4 commit f9246e14848820664539763b72b6fdef408d20e4 Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 11:20:16 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-17 11:20:21 +0000 linux: Implement some bits of PTRACE_PEEKUSER This makes Linux gdb from Bionic a little less broken. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32455 --- sys/amd64/linux/linux_ptrace.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index a59702757972..39587ec9b2ad 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -97,6 +97,11 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_SYSCALL_INFO_ENTRY 1 #define LINUX_PTRACE_SYSCALL_INFO_EXIT 2 +#define LINUX_PTRACE_PEEKUSER_ORIG_RAX 120 +#define LINUX_PTRACE_PEEKUSER_RIP 128 +#define LINUX_PTRACE_PEEKUSER_CS 136 +#define LINUX_PTRACE_PEEKUSER_DS 184 + #define LINUX_ARCH_AMD64 0xc000003e static int @@ -286,9 +291,37 @@ linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) static int linux_ptrace_peekuser(struct thread *td, pid_t pid, void *addr, void *data) { + struct reg b_reg; + uint64_t val; + int error; - linux_msg(td, "PTRACE_PEEKUSER not implemented; returning EINVAL"); - return (EINVAL); + error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); + if (error != 0) + return (error); + + switch ((uintptr_t)addr) { + case LINUX_PTRACE_PEEKUSER_ORIG_RAX: + val = b_reg.r_rax; + break; + case LINUX_PTRACE_PEEKUSER_RIP: + val = b_reg.r_rip; + break; + case LINUX_PTRACE_PEEKUSER_CS: + val = b_reg.r_cs; + break; + case LINUX_PTRACE_PEEKUSER_DS: + val = b_reg.r_ds; + break; + default: + linux_msg(td, "PTRACE_PEEKUSER offset %ld not implemented; " + "returning EINVAL", (uintptr_t)addr); + return (EINVAL); + } + + error = copyout(&val, data, sizeof(val)); + td->td_retval[0] = error; + + return (error); } static int From nobody Sun Oct 17 12:18:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A7D6018012BF; Sun, 17 Oct 2021 12:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXJtp3hScz3CP7; Sun, 17 Oct 2021 12:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AD994CB8; Sun, 17 Oct 2021 12:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HCIAit088126; Sun, 17 Oct 2021 12:18:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HCIAvb088125; Sun, 17 Oct 2021 12:18:10 GMT (envelope-from git) Date: Sun, 17 Oct 2021 12:18:10 GMT Message-Id: <202110171218.19HCIAvb088125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: a03d4d73e4c7 - main - linux: Improve debugging for PTRACE_GETREGSET List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a03d4d73e4c7c73447263294df6ebd1791ab01f2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=a03d4d73e4c7c73447263294df6ebd1791ab01f2 commit a03d4d73e4c7c73447263294df6ebd1791ab01f2 Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 11:52:39 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-17 11:53:16 +0000 linux: Improve debugging for PTRACE_GETREGSET It's triggered by gdb(1). Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32456 --- sys/amd64/linux/linux_ptrace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 39587ec9b2ad..370b1c818b6f 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -84,7 +84,8 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_O_EXITKILL 1048576 #define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 -#define LINUX_NT_PRSTATUS 1 +#define LINUX_NT_PRSTATUS 0x1 +#define LINUX_NT_X86_XSTATE 0x202 #define LINUX_PTRACE_O_MASK (LINUX_PTRACE_O_TRACESYSGOOD | \ LINUX_PTRACE_O_TRACEFORK | LINUX_PTRACE_O_TRACEVFORK | \ @@ -540,8 +541,12 @@ linux_ptrace_getregset(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) switch (addr) { case LINUX_NT_PRSTATUS: return (linux_ptrace_getregset_prstatus(td, pid, data)); + case LINUX_NT_X86_XSTATE: + linux_msg(td, "PTRAGE_GETREGSET NT_X86_XSTATE not implemented; " + "returning EINVAL"); + return (EINVAL); default: - linux_msg(td, "PTRACE_GETREGSET request %ld not implemented; " + linux_msg(td, "PTRACE_GETREGSET request %#lx not implemented; " "returning EINVAL", addr); return (EINVAL); } From nobody Sun Oct 17 12:43:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CCB7B180D081; Sun, 17 Oct 2021 12:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXKS85BQWz3Lgd; Sun, 17 Oct 2021 12:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 918D55519; Sun, 17 Oct 2021 12:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HChaUS027671; Sun, 17 Oct 2021 12:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HCha9m027670; Sun, 17 Oct 2021 12:43:36 GMT (envelope-from git) Date: Sun, 17 Oct 2021 12:43:36 GMT Message-Id: <202110171243.19HCha9m027670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 99f563ed76f4 - main - linux: recognize TCP_INFO and ratelimit the warning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99f563ed76f49c541e587a2f81bc43c62c86c0e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=99f563ed76f49c541e587a2f81bc43c62c86c0e5 commit 99f563ed76f49c541e587a2f81bc43c62c86c0e5 Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 12:19:05 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-17 12:19:10 +0000 linux: recognize TCP_INFO and ratelimit the warning This ratelimits the "unsupported getsockopt level 6 optname 11" warnings that happen all the time when watching Netflix. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32454 --- sys/compat/linux/linux_socket.c | 4 ++++ sys/compat/linux/linux_socket.h | 1 + 2 files changed, 5 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index e9f95098a407..9ae44b909d80 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -574,6 +574,10 @@ linux_to_bsd_tcp_sockopt(int opt) return (TCP_KEEPINTVL); case LINUX_TCP_KEEPCNT: return (TCP_KEEPCNT); + case LINUX_TCP_INFO: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported TCP socket option TCP_INFO (%d)", opt); + return (-2); case LINUX_TCP_MD5SIG: return (TCP_MD5SIG); } diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index 398f184c5e81..9c37d8c97c3d 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -314,6 +314,7 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #define LINUX_TCP_KEEPIDLE 4 #define LINUX_TCP_KEEPINTVL 5 #define LINUX_TCP_KEEPCNT 6 +#define LINUX_TCP_INFO 11 #define LINUX_TCP_MD5SIG 14 #endif /* _LINUX_SOCKET_H_ */ From nobody Sun Oct 17 12:47:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 31B52180ED4F; Sun, 17 Oct 2021 12:47:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXKX50jFmz3N5Q; Sun, 17 Oct 2021 12:47:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8DA05702; Sun, 17 Oct 2021 12:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HCl0wa028039; Sun, 17 Oct 2021 12:47:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HCl0kB028038; Sun, 17 Oct 2021 12:47:00 GMT (envelope-from git) Date: Sun, 17 Oct 2021 12:47:00 GMT Message-Id: <202110171247.19HCl0kB028038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 70774c637b87 - main - procfs: Document as deprecated List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70774c637b87eac1d9a94bb960e6f5242dad9e43 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=70774c637b87eac1d9a94bb960e6f5242dad9e43 commit 70774c637b87eac1d9a94bb960e6f5242dad9e43 Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 12:44:19 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-17 12:46:00 +0000 procfs: Document as deprecated Update the procfs(5) man page to clarify that it's deprecated. Reviewed By: bcr, 0mp (earlier version) Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D22275 --- share/man/man5/procfs.5 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man5/procfs.5 b/share/man/man5/procfs.5 index 8532762a154e..37da9cf82e4b 100644 --- a/share/man/man5/procfs.5 +++ b/share/man/man5/procfs.5 @@ -2,7 +2,7 @@ .\" Written by Garrett Wollman .\" This file is in the public domain. .\" -.Dd March 4, 2017 +.Dd October 17, 2021 .Dt PROCFS 5 .Os .Sh NAME @@ -13,6 +13,15 @@ proc /proc procfs rw 0 0 .Ed .Sh DESCRIPTION +.Bf -symbolic +This functionality is deprecated. +Users are advised to use +.Xr libprocstat 3 +and +.Xr kvm 3 +instead. +.Ef +.Pp The process file system, or .Nm , implements a view of the system process table inside the file system. From nobody Sun Oct 17 12:52:58 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BF38217F065B; Sun, 17 Oct 2021 12:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXKfy48wkz3PZB; Sun, 17 Oct 2021 12:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70CDD5903; Sun, 17 Oct 2021 12:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HCqwmP040727; Sun, 17 Oct 2021 12:52:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HCqwNR040726; Sun, 17 Oct 2021 12:52:58 GMT (envelope-from git) Date: Sun, 17 Oct 2021 12:52:58 GMT Message-Id: <202110171252.19HCqwNR040726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0f559a9f097b - main - Make vmdaemon timeout configurable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f559a9f097b9eea318e970155fb23e37af07c4e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0f559a9f097b9eea318e970155fb23e37af07c4e commit 0f559a9f097b9eea318e970155fb23e37af07c4e Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 12:48:50 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-17 12:49:29 +0000 Make vmdaemon timeout configurable Make vmdaemon timeout configurable, so that one can adjust how often it runs. Here's a trick: set this to 1, then run 'limits -m 0 sh', then run whatever you want with 'ktrace -it XXX', and observe how the working set changes over time. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D22038 --- sys/vm/vm_swapout.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/vm/vm_swapout.c b/sys/vm/vm_swapout.c index eaa6b9618426..008dd6f00cbc 100644 --- a/sys/vm/vm_swapout.c +++ b/sys/vm/vm_swapout.c @@ -153,6 +153,11 @@ SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold2, CTLFLAG_RW, &swap_idle_threshold2, 0, "Time before a process will be swapped out"); +static int vm_daemon_timeout = 0; +SYSCTL_INT(_vm, OID_AUTO, vmdaemon_timeout, CTLFLAG_RW, + &vm_daemon_timeout, 0, + "Time between vmdaemon runs"); + static int vm_pageout_req_swapout; /* XXX */ static int vm_daemon_needed; static struct mtx vm_daemon_mtx; @@ -374,17 +379,15 @@ vm_daemon(void) int breakout, swapout_flags, tryagain, attempts; #ifdef RACCT uint64_t rsize, ravailable; + + if (racct_enable && vm_daemon_timeout == 0) + vm_daemon_timeout = hz; #endif while (TRUE) { mtx_lock(&vm_daemon_mtx); msleep(&vm_daemon_needed, &vm_daemon_mtx, PPAUSE, "psleep", -#ifdef RACCT - racct_enable ? hz : 0 -#else - 0 -#endif - ); + vm_daemon_timeout); swapout_flags = vm_pageout_req_swapout; vm_pageout_req_swapout = 0; mtx_unlock(&vm_daemon_mtx); From nobody Sun Oct 17 14:37:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3E4EB17F24D0; Sun, 17 Oct 2021 14:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXMzk0q4cz4bLW; Sun, 17 Oct 2021 14:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA5826AEA; Sun, 17 Oct 2021 14:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HEbb38074394; Sun, 17 Oct 2021 14:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HEbbkx074393; Sun, 17 Oct 2021 14:37:37 GMT (envelope-from git) Date: Sun, 17 Oct 2021 14:37:37 GMT Message-Id: <202110171437.19HEbbkx074393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 682c00a6ce2f - main - riscv: Implement pmap_mapdev_attr List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 682c00a6ce2f3870e9c698b283ee2b2a56c28c0b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=682c00a6ce2f3870e9c698b283ee2b2a56c28c0b commit 682c00a6ce2f3870e9c698b283ee2b2a56c28c0b Author: Jessica Clarke AuthorDate: 2021-10-17 14:31:35 +0000 Commit: Jessica Clarke CommitDate: 2021-10-17 14:31:35 +0000 riscv: Implement pmap_mapdev_attr This is needed for LinuxKPI's _ioremap_attr. This reuses the generic implementation introduced for aarch64, and itself requires implementing pmap_kenter, which is trivial to do given riscv currently treats all mapping attributes the same due to the Svpbmt extension not yet being ratified and in hardware. Reviewed by: markj, mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32445 --- sys/kern/subr_devmap.c | 2 +- sys/riscv/include/pmap.h | 2 ++ sys/riscv/riscv/pmap.c | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_devmap.c b/sys/kern/subr_devmap.c index 23baceb05129..1c9b192cc4c8 100644 --- a/sys/kern/subr_devmap.c +++ b/sys/kern/subr_devmap.c @@ -290,7 +290,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t size) return ((void *)(va + offset)); } -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__riscv) void * pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma) { diff --git a/sys/riscv/include/pmap.h b/sys/riscv/include/pmap.h index 024bc3743f67..0ef221ed2393 100644 --- a/sys/riscv/include/pmap.h +++ b/sys/riscv/include/pmap.h @@ -145,10 +145,12 @@ void pmap_activate_boot(pmap_t); void pmap_activate_sw(struct thread *); void pmap_bootstrap(vm_offset_t, vm_paddr_t, vm_size_t); int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); +void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode); void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); +void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t); diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 0918325c13fb..292b1c2f6b3f 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -916,7 +916,7 @@ pmap_kextract(vm_offset_t va) ***************************************************/ void -pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa) +pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode __unused) { pt_entry_t entry; pt_entry_t *l3; @@ -947,6 +947,12 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa) pmap_invalidate_range(kernel_pmap, sva, va); } +void +pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa) +{ + pmap_kenter(sva, size, pa, VM_MEMATTR_DEVICE); +} + /* * Remove a page from the kernel pagetables. * Note: not SMP coherent. From nobody Sun Oct 17 14:37:38 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5A1F217F2562; Sun, 17 Oct 2021 14:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXMzl0whjz4bCg; Sun, 17 Oct 2021 14:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC6CA6BB5; Sun, 17 Oct 2021 14:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HEbcsk074418; Sun, 17 Oct 2021 14:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HEbcVQ074417; Sun, 17 Oct 2021 14:37:38 GMT (envelope-from git) Date: Sun, 17 Oct 2021 14:37:38 GMT Message-Id: <202110171437.19HEbcVQ074417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 60d962e04103 - main - LinuxKPI: Implement _ioremap_attr for riscv List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60d962e0410340f107d062e8f4389c0d467613a2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=60d962e0410340f107d062e8f4389c0d467613a2 commit 60d962e0410340f107d062e8f4389c0d467613a2 Author: Jessica Clarke AuthorDate: 2021-10-17 14:32:20 +0000 Commit: Jessica Clarke CommitDate: 2021-10-17 14:32:20 +0000 LinuxKPI: Implement _ioremap_attr for riscv Now that riscv implements pmap_mapdev_attr we can enable the non-stub implementation for riscv, which is needed for drm-kmod to not fail at run time for drivers that need to map I/O regions. Reviewed by: hselasky, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32446 --- sys/compat/linuxkpi/common/include/linux/io.h | 2 +- sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 074417b892f9..e402ebed0665 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -390,7 +390,7 @@ _outb(u_char data, u_int port) } #endif -#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv) void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); #else #define _ioremap_attr(...) NULL diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 7a062ca36eba..a62cf93dbd82 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1822,7 +1822,7 @@ vmmap_remove(void *addr) return (vmmap); } -#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv) void * _ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr) { @@ -1845,7 +1845,7 @@ iounmap(void *addr) vmmap = vmmap_remove(addr); if (vmmap == NULL) return; -#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv) pmap_unmapdev((vm_offset_t)addr, vmmap->vm_size); #endif kfree(vmmap); From nobody Sun Oct 17 14:37:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9852C17F26BD; Sun, 17 Oct 2021 14:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXMzm2Dtnz4b6C; Sun, 17 Oct 2021 14:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 135936BB6; Sun, 17 Oct 2021 14:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HEbemJ074447; Sun, 17 Oct 2021 14:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HEbdOV074446; Sun, 17 Oct 2021 14:37:39 GMT (envelope-from git) Date: Sun, 17 Oct 2021 14:37:39 GMT Message-Id: <202110171437.19HEbdOV074446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 82098c8bb5b3 - main - LinuxKPI: Support lazy BAR allocation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82098c8bb5b303c7c8b48e7537fadfe74b375bd3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=82098c8bb5b303c7c8b48e7537fadfe74b375bd3 commit 82098c8bb5b303c7c8b48e7537fadfe74b375bd3 Author: Jessica Clarke AuthorDate: 2021-10-17 14:32:35 +0000 Commit: Jessica Clarke CommitDate: 2021-10-17 14:32:35 +0000 LinuxKPI: Support lazy BAR allocation Linux KPIs like pci_resource_start/len assume that BARs have been allocated, but FreeBSD lazily allocates BARs if it cannot allocate the firmware-allocated BARs. Thus using the Linux KPIs must force allocation of the BARs rather than returning 0 for the start and length, which can crash drm-kmod drivers that assume the BARs are valid. This is needed for the AMDGPU driver to be able to attach on SiFive's HiFive Unmatched. Reviewed by: hselasky, jhb, mav MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32447 --- sys/compat/linuxkpi/common/include/linux/pci.h | 22 +++++++++++++++------- sys/compat/linuxkpi/common/src/linux_pci.c | 25 ++++++++++++++++++++++--- sys/dev/pci/pci.c | 2 +- sys/dev/pci/pci_private.h | 4 ++++ 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index a80e6965915d..2bac82de2af5 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -311,19 +311,27 @@ pci_resource_type(struct pci_dev *pdev, int bar) return (SYS_RES_MEMORY); } +struct resource_list_entry *linux_pci_reserve_bar(struct pci_dev *pdev, + struct resource_list *rl, int type, int rid); + static inline struct resource_list_entry * -linux_pci_get_rle(struct pci_dev *pdev, int type, int rid) +linux_pci_get_rle(struct pci_dev *pdev, int type, int rid, bool reserve_bar) { struct pci_devinfo *dinfo; struct resource_list *rl; + struct resource_list_entry *rle; dinfo = device_get_ivars(pdev->dev.bsddev); rl = &dinfo->resources; - return resource_list_find(rl, type, rid); + rle = resource_list_find(rl, type, rid); + /* Reserve resources for this BAR if needed. */ + if (rle == NULL && reserve_bar) + rle = linux_pci_reserve_bar(pdev, rl, type, rid); + return (rle); } static inline struct resource_list_entry * -linux_pci_get_bar(struct pci_dev *pdev, int bar) +linux_pci_get_bar(struct pci_dev *pdev, int bar, bool reserve) { int type; @@ -331,7 +339,7 @@ linux_pci_get_bar(struct pci_dev *pdev, int bar) if (type < 0) return (NULL); bar = PCIR_BAR(bar); - return (linux_pci_get_rle(pdev, type, bar)); + return (linux_pci_get_rle(pdev, type, bar, reserve)); } static inline struct device * @@ -521,7 +529,7 @@ pci_release_region(struct pci_dev *pdev, int bar) struct pci_devres *dr; struct pci_mmio_region *mmio, *p; - if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar, false)) == NULL) return; /* @@ -779,7 +787,7 @@ pci_enable_msix(struct pci_dev *pdev, struct msix_entry *entries, int nreq) pci_release_msi(pdev->dev.bsddev); return avail; } - rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1); + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1, false); pdev->dev.irq_start = rle->start; pdev->dev.irq_end = rle->start + avail; for (i = 0; i < nreq; i++) @@ -832,7 +840,7 @@ pci_enable_msi(struct pci_dev *pdev) if ((error = -pci_alloc_msi(pdev->dev.bsddev, &avail)) != 0) return error; - rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1); + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1, false); pdev->dev.irq_start = rle->start; pdev->dev.irq_end = rle->start + avail; pdev->irq = rle->start; diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 44ed4b22de6f..780ba38d18dd 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -409,7 +409,7 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, PCI_GET_ID(parent, dev, PCI_ID_RID, &rid); pdev->devfn = rid; pdev->pdrv = pdrv; - rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 0); + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 0, false); if (rle != NULL) pdev->dev.irq = rle->start; else @@ -665,6 +665,25 @@ linux_pci_register_driver(struct pci_driver *pdrv) return (_linux_pci_register_driver(pdrv, dc)); } +struct resource_list_entry * +linux_pci_reserve_bar(struct pci_dev *pdev, struct resource_list *rl, + int type, int rid) +{ + device_t dev; + struct resource *res; + + KASSERT(type == SYS_RES_IOPORT || type == SYS_RES_MEMORY, + ("trying to reserve non-BAR type %d", type)); + + dev = pdev->pdrv != NULL && pdev->pdrv->isdrm ? + device_get_parent(pdev->dev.bsddev) : pdev->dev.bsddev; + res = pci_reserve_map(device_get_parent(dev), dev, type, &rid, 0, ~0, + 1, 1, 0); + if (res == NULL) + return (NULL); + return (resource_list_find(rl, type, rid)); +} + unsigned long pci_resource_start(struct pci_dev *pdev, int bar) { @@ -672,7 +691,7 @@ pci_resource_start(struct pci_dev *pdev, int bar) rman_res_t newstart; device_t dev; - if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar, true)) == NULL) return (0); dev = pdev->pdrv != NULL && pdev->pdrv->isdrm ? device_get_parent(pdev->dev.bsddev) : pdev->dev.bsddev; @@ -689,7 +708,7 @@ pci_resource_len(struct pci_dev *pdev, int bar) { struct resource_list_entry *rle; - if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar, true)) == NULL) return (0); return (rle->count); } diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index c215083d3121..702f9fc3aa05 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -5365,7 +5365,7 @@ DB_SHOW_COMMAND(pciregs, db_pci_dump) } #endif /* DDB */ -static struct resource * +struct resource * pci_reserve_map(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int num, u_int flags) diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index 095f22db69a9..4c6c8ddf051a 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -163,6 +163,10 @@ void pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, struct pci_map *pci_add_bar(device_t dev, int reg, pci_addr_t value, pci_addr_t size); +struct resource *pci_reserve_map(device_t dev, device_t child, int type, + int *rid, rman_res_t start, rman_res_t end, + rman_res_t count, u_int num, u_int flags); + struct resource *pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_long num, u_int flags); From nobody Sun Oct 17 14:37:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E569417F267F; Sun, 17 Oct 2021 14:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXMzn5Xmvz4bLp; Sun, 17 Oct 2021 14:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 415E66B66; Sun, 17 Oct 2021 14:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HEbfRr074473; Sun, 17 Oct 2021 14:37:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HEbf0T074472; Sun, 17 Oct 2021 14:37:41 GMT (envelope-from git) Date: Sun, 17 Oct 2021 14:37:41 GMT Message-Id: <202110171437.19HEbf0T074472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 0d6516b45346 - main - Bump __FreeBSD_version for LinuxKPI changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d6516b453469ce1d92ec903c4c4df9ee08be0f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=0d6516b453469ce1d92ec903c4c4df9ee08be0f9 commit 0d6516b453469ce1d92ec903c4c4df9ee08be0f9 Author: Jessica Clarke AuthorDate: 2021-10-17 14:35:48 +0000 Commit: Jessica Clarke CommitDate: 2021-10-17 14:35:48 +0000 Bump __FreeBSD_version for LinuxKPI changes --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 50d861a61985..ecdd233c4c2b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400037 +#define __FreeBSD_version 1400038 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Sun Oct 17 15:13:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4693F180364D; Sun, 17 Oct 2021 15:13:24 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXNn01VW3z4mmd; Sun, 17 Oct 2021 15:13:24 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id EE516727B; Sun, 17 Oct 2021 15:13:23 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id DBCA5197F2; Sun, 17 Oct 2021 17:13:21 +0200 (CEST) From: Kristof Provost To: Shawn Webb Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 076b3a50fd71 - main - pf: don't drop packets when redirection information comes from a state Date: Sun, 17 Oct 2021 17:13:20 +0200 X-Mailer: MailMate (1.14r5818) Message-ID: <336ECE44-FD7F-417B-827A-236FC6224E5B@FreeBSD.org> In-Reply-To: <20211016231207.s6rw6ndjrsshya2r@mutt-hbsd> References: <202110162306.19GN6MLj036119@gitrepo.freebsd.org> <20211016231207.s6rw6ndjrsshya2r@mutt-hbsd> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On 17 Oct 2021, at 1:12, Shawn Webb wrote: > On Sat, Oct 16, 2021 at 11:06:22PM +0000, Kristof Provost wrote: >> The branch main has been updated by kp: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D076b3a50fd71d84f47bca71= 758e7fff3c02582e9 >> >> commit 076b3a50fd71d84f47bca71758e7fff3c02582e9 >> Author: Kristof Provost >> AuthorDate: 2021-10-16 16:53:39 +0000 >> Commit: Kristof Provost >> CommitDate: 2021-10-16 21:02:26 +0000 >> >> pf: don't drop packets when redirection information comes from a s= tate >> >> For some traffic there might be no matching rule in the current ru= leset, >> for example when a state was imported via pfsync from a sytem with= a >> different ruleset checksum. In this case pf_route uses s->rt_addr = for >> routing target instead of r->rpool.cur but r->rpool is checked any= way, >> resulting in dropped packets. >> >> PR: 259183 >> Submitted by: Kajetan Staszkiewicz >> Sponsored by: InnoGames GmbH > > Hey Kristof, > > Any plans to MFC? > I wasn=E2=80=99t planning to, but if it=E2=80=99d fix a problem for you r= emind me to MFC it in a week. Br, Kristof From nobody Sun Oct 17 20:42:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 433F717FEFEC; Sun, 17 Oct 2021 20:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HXX4m1CvLz3snj; Sun, 17 Oct 2021 20:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AD1013DC5; Sun, 17 Oct 2021 20:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19HKgVY8068354; Sun, 17 Oct 2021 20:42:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19HKgVRZ068353; Sun, 17 Oct 2021 20:42:31 GMT (envelope-from git) Date: Sun, 17 Oct 2021 20:42:31 GMT Message-Id: <202110172042.19HKgVRZ068353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 52e125c2bd30 - main - TSLOG: Report final execname, not first List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52e125c2bd302982c179ecc920cc9a6e166033d6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=52e125c2bd302982c179ecc920cc9a6e166033d6 commit 52e125c2bd302982c179ecc920cc9a6e166033d6 Author: Colin Percival AuthorDate: 2021-10-17 20:36:38 +0000 Commit: Colin Percival CommitDate: 2021-10-17 20:36:38 +0000 TSLOG: Report final execname, not first In cases such as daemons launched via limits(1), a process may call exec multiple times; the last name of the last binary executed is usually (always?) more informative. Fixes: 46dd801acb23 Add userland boot profiling to TSLOG Sponsored by: https://www.patreon.com/cperciva --- sys/kern/kern_tslog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_tslog.c b/sys/kern/kern_tslog.c index 38c91911ec08..0e7ad3c9ff23 100644 --- a/sys/kern/kern_tslog.c +++ b/sys/kern/kern_tslog.c @@ -169,8 +169,9 @@ tslog_user(pid_t pid, pid_t ppid, const char * execname, const char * namei) /* If we have an execname, record it. */ if (execname != NULL) { - if (procs[pid].execname == NULL) - procs[pid].execname = strdup(execname, M_TSLOGUSER); + if (procs[pid].execname != NULL) + free(procs[pid].execname, M_TSLOGUSER); + procs[pid].execname = strdup(execname, M_TSLOGUSER); return; }