From owner-dev-commits-src-all@freebsd.org Mon Mar 1 00:32:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 199485512E0; Mon, 1 Mar 2021 00:32: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 4Dph6p06qQz3QBq; Mon, 1 Mar 2021 00:32: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 EB2571A1F6; Mon, 1 Mar 2021 00:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1210WXUh071769; Mon, 1 Mar 2021 00:32:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1210WXXW071768; Mon, 1 Mar 2021 00:32:33 GMT (envelope-from git) Date: Mon, 1 Mar 2021 00:32:33 GMT Message-Id: <202103010032.1210WXXW071768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ba0d063cd6a5 - stable/13 - uma: Update the comment above startup_alloc() to reflect reality MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ba0d063cd6a5b7b6218242a866169a2d8fe32f17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 00:32:34 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d063cd6a5b7b6218242a866169a2d8fe32f17 commit ba0d063cd6a5b7b6218242a866169a2d8fe32f17 Author: Mark Johnston AuthorDate: 2021-02-22 23:21:49 +0000 Commit: Mark Johnston CommitDate: 2021-03-01 00:31:58 +0000 uma: Update the comment above startup_alloc() to reflect reality The scheme used for early slab allocations changed in commit a81c400e75. Reported by: alc Reviewed by: alc (cherry picked from commit 537f92cd351090c09b178a1749cd1d0326f74dc7) --- sys/vm/uma_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 0b6e02861785..8cbd1216678a 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1642,9 +1642,9 @@ fail: } /* - * This function is intended to be used early on in place of page_alloc() so - * that we may use the boot time page cache to satisfy allocations before - * the VM is ready. + * This function is intended to be used early on in place of page_alloc(). It + * performs contiguous physical memory allocations and uses a bump allocator for + * KVA, so is usable before the kernel map is initialized. */ static void * startup_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, From owner-dev-commits-src-all@freebsd.org Mon Mar 1 00:32:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 403955513D8; Mon, 1 Mar 2021 00:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dph6q1LQlz3QSZ; Mon, 1 Mar 2021 00:32: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 20E4E19D7B; Mon, 1 Mar 2021 00:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1210WZC2071792; Mon, 1 Mar 2021 00:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1210WZTw071791; Mon, 1 Mar 2021 00:32:35 GMT (envelope-from git) Date: Mon, 1 Mar 2021 00:32:35 GMT Message-Id: <202103010032.1210WZTw071791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1eee54cbf040 - stable/13 - m_uiotombuf_nomap(): Stop clearing PG_ZERO in newly allocated pages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1eee54cbf040adba158e42150332905630253264 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 00:32:35 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1eee54cbf040adba158e42150332905630253264 commit 1eee54cbf040adba158e42150332905630253264 Author: Mark Johnston AuthorDate: 2021-02-22 15:03:37 +0000 Commit: Mark Johnston CommitDate: 2021-03-01 00:32:18 +0000 m_uiotombuf_nomap(): Stop clearing PG_ZERO in newly allocated pages The caller should not be passing M_ZERO in the first place, so PG_ZERO will not be preserved by the page allocator and clearing it accomplishes nothing. Reviewed by: gallatin, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28808 (cherry picked from commit 608c44f96e88f28f9607374a6c9327d13d3d3d0e) --- sys/kern/uipc_mbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index f73bfab07eaf..5296aac0edc4 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1656,6 +1656,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) VM_ALLOC_WIRED; MPASS((flags & M_PKTHDR) == 0); + MPASS((how & M_ZERO) == 0); /* * len can be zero or an arbitrary large value bound by @@ -1709,7 +1710,6 @@ retry_page: goto retry_page; } } - pg_array[i]->flags &= ~PG_ZERO; mb->m_epg_pa[i] = VM_PAGE_TO_PHYS(pg_array[i]); mb->m_epg_npgs++; } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 00:33:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5F2B551907; Mon, 1 Mar 2021 00:33: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 4Dph7X4LnGz3QgK; Mon, 1 Mar 2021 00:33: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 88B391A1F8; Mon, 1 Mar 2021 00:33: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 1210XCNt072017; Mon, 1 Mar 2021 00:33:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1210XCYE072016; Mon, 1 Mar 2021 00:33:12 GMT (envelope-from git) Date: Mon, 1 Mar 2021 00:33:12 GMT Message-Id: <202103010033.1210XCYE072016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 113bd64cdf4e - releng/13.0 - pmap: Fix largemap restart checks in the kernel_maps sysctl handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 113bd64cdf4ef3f54fffcd9874ae7ec07afd882e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 00:33:12 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=113bd64cdf4ef3f54fffcd9874ae7ec07afd882e commit 113bd64cdf4ef3f54fffcd9874ae7ec07afd882e Author: Mark Johnston AuthorDate: 2021-02-25 23:49:47 +0000 Commit: Mark Johnston CommitDate: 2021-03-01 00:32:58 +0000 pmap: Fix largemap restart checks in the kernel_maps sysctl handler The purpose of these checks is to ensure that the address of the next-level page table page is valid, since nothing is synchronizing with a concurrent update of the large map and large map PTPs are freed to the system. However, if PG_PS is set, there is no next level. Approved by: re (gjb) Reported by: rpokala Reviewed by: kib Tested by: rpokala Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28922 (cherry picked from commit aac25e222525780db8939d07a594d3e090c0a148) (cherry picked from commit 5966aae9c7c25707c785ec056cb8462a037a480e) --- sys/amd64/amd64/pmap.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0e1d1c02d1fc..bd23fd176e88 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -11349,9 +11349,6 @@ restart: continue; } pa = pdpe & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pdpe & PG_PS) != 0) { sva = rounddown2(sva, NBPDP); sysctl_kmaps_check(sb, &range, sva, pml4e, pdpe, @@ -11360,6 +11357,15 @@ restart: sva += NBPDP; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map may be + * freed. Validate the next-level address + * before descending. + */ + goto restart; + } pd = (pd_entry_t *)PHYS_TO_DMAP(pa); for (k = pmap_pde_index(sva); k < NPDEPG; k++) { @@ -11371,9 +11377,6 @@ restart: continue; } pa = pde & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pde & PG_PS) != 0) { sva = rounddown2(sva, NBPDR); sysctl_kmaps_check(sb, &range, sva, @@ -11382,6 +11385,15 @@ restart: sva += NBPDR; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map + * may be freed. Validate the + * next-level address before descending. + */ + goto restart; + } pt = (pt_entry_t *)PHYS_TO_DMAP(pa); for (l = pmap_pte_index(sva); l < NPTEPG; l++, From owner-dev-commits-src-all@freebsd.org Mon Mar 1 02:38:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F4034555301; Mon, 1 Mar 2021 02:38: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 4Dpkvz6Z7cz3nTN; Mon, 1 Mar 2021 02:38: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 D439A1BBB0; Mon, 1 Mar 2021 02:38: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 1212cN5I030627; Mon, 1 Mar 2021 02:38:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1212cN4h030626; Mon, 1 Mar 2021 02:38:23 GMT (envelope-from git) Date: Mon, 1 Mar 2021 02:38:23 GMT Message-Id: <202103010238.1212cN4h030626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: dd95b39235dd - main - [PowerPC64] Fix multiple issues in fpsetmask(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd95b39235dd81c890aa3cce02a5bb7f91f23803 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 02:38:24 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=dd95b39235dd81c890aa3cce02a5bb7f91f23803 commit dd95b39235dd81c890aa3cce02a5bb7f91f23803 Author: Brandon Bergren AuthorDate: 2021-03-01 02:35:53 +0000 Commit: Brandon Bergren CommitDate: 2021-03-01 02:37:48 +0000 [PowerPC64] Fix multiple issues in fpsetmask(). Building R exposed a problem in fpsetmask() whereby we were not properly clamping the provided mask to the valid range. R initilizes the mask by calling fpsetmask(~0) on FreeBSD. Since we recently enabled precise exceptions, this was causing an immediate SIGFPE because we were attempting to set invalid bits in the fpscr. Properly limit the range of bits that can be set via fpsetmask(). While here, use the correct fp_except_t type instead of fp_rnd_t. Reported by: pkubaj (in IRC) MFC after: 1 week Sponsored by: Tag1 Consulting, Inc. --- lib/libc/powerpc64/gen/fpsetmask.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/powerpc64/gen/fpsetmask.c b/lib/libc/powerpc64/gen/fpsetmask.c index 4d63552470be..f5d52eec5482 100644 --- a/lib/libc/powerpc64/gen/fpsetmask.c +++ b/lib/libc/powerpc64/gen/fpsetmask.c @@ -43,11 +43,11 @@ fp_except_t fpsetmask(fp_except_t mask) { u_int64_t fpscr; - fp_rnd_t old; + fp_except_t old; __asm__("mffs %0" : "=f"(fpscr)); - old = (fp_rnd_t)((fpscr >> 3) & 0x1f); - fpscr = (fpscr & 0xffffff07) | (mask << 3); + old = (fp_except_t)((fpscr >> 3) & 0x1f); + fpscr = (fpscr & 0xffffff07) | ((mask & 0x1f) << 3); __asm__ __volatile("mtfsf 0xff,%0" :: "f"(fpscr)); return (old); } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 03:17:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CA9A555BFA; Mon, 1 Mar 2021 03:17: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 4Dplnc32Yxz3qPr; Mon, 1 Mar 2021 03:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AFA51C368; Mon, 1 Mar 2021 03:17: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 1213HuUQ084448; Mon, 1 Mar 2021 03:17:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1213Huie084447; Mon, 1 Mar 2021 03:17:56 GMT (envelope-from git) Date: Mon, 1 Mar 2021 03:17:56 GMT Message-Id: <202103010317.1213Huie084447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: 384ee7cc6e9e - main - [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 384ee7cc6e9e4ddc91a6e9e623fcbbe5826bce38 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 03:17:56 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=384ee7cc6e9e4ddc91a6e9e623fcbbe5826bce38 commit 384ee7cc6e9e4ddc91a6e9e623fcbbe5826bce38 Author: Brandon Bergren AuthorDate: 2021-03-01 03:06:59 +0000 Commit: Brandon Bergren CommitDate: 2021-03-01 03:11:29 +0000 [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask(). Building R on powerpc64 exposed a problem in fpsetmask() whereby we were not properly clamping the provided mask to the valid range. This same issue affects powerpc and powerpcspe. Properly limit the range of bits that can be set via fpsetmask(). While here, use the correct fp_except_t type instead of fp_rnd_t. Reported by: pkubaj, jhibbits (in IRC) Sponsored by: Tag1 Consulting, Inc. MFC after: 1 week --- lib/libc/powerpc/gen/fpsetmask.c | 6 +++--- lib/libc/powerpcspe/gen/fpsetmask.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libc/powerpc/gen/fpsetmask.c b/lib/libc/powerpc/gen/fpsetmask.c index 4d63552470be..f5d52eec5482 100644 --- a/lib/libc/powerpc/gen/fpsetmask.c +++ b/lib/libc/powerpc/gen/fpsetmask.c @@ -43,11 +43,11 @@ fp_except_t fpsetmask(fp_except_t mask) { u_int64_t fpscr; - fp_rnd_t old; + fp_except_t old; __asm__("mffs %0" : "=f"(fpscr)); - old = (fp_rnd_t)((fpscr >> 3) & 0x1f); - fpscr = (fpscr & 0xffffff07) | (mask << 3); + old = (fp_except_t)((fpscr >> 3) & 0x1f); + fpscr = (fpscr & 0xffffff07) | ((mask & 0x1f) << 3); __asm__ __volatile("mtfsf 0xff,%0" :: "f"(fpscr)); return (old); } diff --git a/lib/libc/powerpcspe/gen/fpsetmask.c b/lib/libc/powerpcspe/gen/fpsetmask.c index e71b822d6e0b..2f48802d9ca3 100644 --- a/lib/libc/powerpcspe/gen/fpsetmask.c +++ b/lib/libc/powerpcspe/gen/fpsetmask.c @@ -42,11 +42,11 @@ fp_except_t fpsetmask(fp_except_t mask) { uint32_t fpscr; - fp_rnd_t old; + fp_except_t old; __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); - old = (fp_rnd_t)((fpscr >> 2) & 0x1f); - fpscr = (fpscr & 0xffffff83) | (mask << 2); + old = (fp_except_t)((fpscr >> 2) & 0x1f); + fpscr = (fpscr & 0xffffff83) | ((mask & 0x1f) << 2); __asm__ __volatile("mtspr %1,%0;isync" :: "r"(fpscr), "K"(SPR_SPEFSCR)); return (old); } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 07:05:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6503550A2F; Mon, 1 Mar 2021 07:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dprqy64r7z3Mm2; Mon, 1 Mar 2021 07:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB6CE1F530; Mon, 1 Mar 2021 07:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12175IM7086696; Mon, 1 Mar 2021 07:05:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12175IBs086695; Mon, 1 Mar 2021 07:05:18 GMT (envelope-from git) Date: Mon, 1 Mar 2021 07:05:18 GMT Message-Id: <202103010705.12175IBs086695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a7926435c12e - releng/13.0 - pf: Fix incorrect fragment handling 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: a7926435c12e2304f46c9efadd4216f469f68acc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 07:05:19 -0000 The branch releng/13.0 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a7926435c12e2304f46c9efadd4216f469f68acc commit a7926435c12e2304f46c9efadd4216f469f68acc Author: Kristof Provost AuthorDate: 2021-02-25 07:07:36 +0000 Commit: Kristof Provost CommitDate: 2021-03-01 07:04:47 +0000 pf: Fix incorrect fragment handling A sequence of overlapping IPv4 fragments could crash the kernel in pf due to an assertion. Approved by: re (gjb) Reported by: Alexander Bluhm Obtained from: OpenBSD MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5f1b1f184b7f12330cf4a027e3db7c6700c67640) (cherry picked from commit 86ebf4d3e12c3eae94d3e9a8dcf5bd5741889b58) --- sys/netpfil/pf/pf_norm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index b7a84437630b..d7310c7bccb4 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -549,6 +549,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, struct pf_frent *after, *next, *prev; struct pf_fragment *frag; uint16_t total; + int old_index, new_index; PF_FRAG_ASSERT(); @@ -660,8 +661,30 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, DPFPRINTF(("adjust overlap %d\n", aftercut)); if (aftercut < after->fe_len) { m_adj(after->fe_m, aftercut); + old_index = pf_frent_index(after); after->fe_off += aftercut; after->fe_len -= aftercut; + new_index = pf_frent_index(after); + if (old_index != new_index) { + DPFPRINTF(("frag index %d, new %d", + old_index, new_index)); + /* Fragment switched queue as fe_off changed */ + after->fe_off -= aftercut; + after->fe_len += aftercut; + /* Remove restored fragment from old queue */ + pf_frent_remove(frag, after); + after->fe_off += aftercut; + after->fe_len -= aftercut; + /* Insert into correct queue */ + if (pf_frent_insert(frag, after, prev)) { + DPFPRINTF( + ("fragment requeue limit exceeded")); + m_freem(after->fe_m); + uma_zfree(V_pf_frent_z, after); + /* There is not way to recover */ + goto bad_fragment; + } + } break; } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 07:34:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A0C6552376; Mon, 1 Mar 2021 07:34:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (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 4DpsV55sfnz3PSq; Mon, 1 Mar 2021 07:34:53 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lj1-x22a.google.com with SMTP id q14so18244727ljp.4; Sun, 28 Feb 2021 23:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0j3oUbPY6lEuDtrnknmgOjzQUowDg7yGzx4s2EVYHBo=; b=KgP6JXrkPXsvO8AFKzaP7G5MnG6j11ZHN2fj+4w+eW9qE+AUT3OvaEPovWKg9Ms8wf Wm686Yi4JB204BujjhhQLE8gM48EBz3z7cD1HZ5aW2Mc9IZFEbweg/lxwgTU0J8nff1J w0Eq21wxLrbKBnWwhiXDFtkEZAqd+rkWfw4hfUwAbnTjWAtLuEobenc1eflEo4AJ/we1 k4jPEJMVIWA5p65oFXN23JxQRccUhNW/LpEFO2Wa512x17RtwGiqswzlFsrD7zFyTAz6 GIX3dyVbHGvBYR50xMHhyMG1KfFKQM2iVUgNQXeNBK+f41gAUdIQFOHX5RVMPQb/iZwv p6Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0j3oUbPY6lEuDtrnknmgOjzQUowDg7yGzx4s2EVYHBo=; b=oCLzM3gDlFiTtSDWv4h8534bXpHitQn5ENj1vl0IO1t/I9RDmHJO9NLlfaTMU7wNzU CGSq/ld0n31uHZLq6o3UM4I0uup6HKMytgHut+Ho2yiPEYYayqOkOds//xoiGbfAcEVK CAqwV3Wzq6bEfgXjKZsZhwXOrWDuHyBOg3daOXFFdI8FKFVQ2rXA6dW63mSota46JcI5 s6ap63xW+BdYGcNj870igVqprTdNnkxMp5H7hP7ROb17kMZF+zwBT8kQcqLhlTB4B/EC T8C0WeUCUX5v+ZG6ptnXe4WpP6wPT3CmPBaVYKPN32GWzNjq5Fte/ks7W4V2rxfVxHWC uiZA== X-Gm-Message-State: AOAM531yro0ubVFe7CXUeNChsCC93Ih3a0gk9WYVL0FvuIddQ2YWc7E5 vaXx/mrQ+sY5/ldM4Kgc0mzacXDFxXSnutJ9Ca8fXkltyms= X-Google-Smtp-Source: ABdhPJxM9ZVRLB7dGk4+9xBc9lTkG2cq51Dig06Lw8gXed2qdIxNNa6eyOAXAlF+hMsVOGllUZhaFpjpK3bmtwSOM90= X-Received: by 2002:a2e:a58d:: with SMTP id m13mr8522064ljp.347.1614584092075; Sun, 28 Feb 2021 23:34:52 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a2e:958d:0:0:0:0:0 with HTTP; Sun, 28 Feb 2021 23:34:51 -0800 (PST) In-Reply-To: <202102232010.11NKAMFt014918@gitrepo.freebsd.org> References: <202102232010.11NKAMFt014918@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 1 Mar 2021 08:34:51 +0100 Message-ID: Subject: Re: git: cf97d2a1dab8 - main - Build lib/msun tests with compiler builtins disabled To: Dimitry Andric 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: 4DpsV55sfnz3PSq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=KgP6JXrk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::22a as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::22a:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::22a:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::22a:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 07:34:54 -0000 This breaks riscv: ld: error: undefined symbol: fabs >>> referenced by t_acos.c:93 (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:93) >>> t_acos.o:(atfu_acos_is_plus_zero_body) >>> referenced by t_acos.c:94 (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:94) >>> t_acos.o:(atfu_acos_is_plus_zero_body) >>> did you mean: cabs >>> defined in: /usr/obj/usr/src/riscv.riscv64sf/tmp/usr/lib/libm.so On 2/23/21, Dimitry Andric wrote: > The branch main has been updated by dim: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=cf97d2a1dab8f2cddc4466fe64d37818339c73be > > commit cf97d2a1dab8f2cddc4466fe64d37818339c73be > Author: Dimitry Andric > AuthorDate: 2021-02-23 20:03:32 +0000 > Commit: Dimitry Andric > CommitDate: 2021-02-23 20:10:01 +0000 > > Build lib/msun tests with compiler builtins disabled > > This forces the compiler to emit calls to libm functions, instead of > possibly substituting pre-calculated results at compile time, which > should help to actually test those functions. > > Reviewed by: emaste, arichardson, ngie > Differential Revision: https://reviews.freebsd.org/D28577 > MFC after: 3 days > --- > lib/msun/tests/Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile > index d58333271e9b..85a558bb0733 100644 > --- a/lib/msun/tests/Makefile > +++ b/lib/msun/tests/Makefile > @@ -19,6 +19,10 @@ CFLAGS+= -I${TESTSRC:H}/libc/gen > CFLAGS+= -D__HAVE_LONG_DOUBLE > .endif > > +# Avoid builtins, to force the compiler to emit calls to the libm > +# functions, and not calculate any results in advance. > +CFLAGS+= -fno-builtin > + > NETBSD_ATF_TESTS_C= acos_test > NETBSD_ATF_TESTS_C+= asin_test > NETBSD_ATF_TESTS_C+= atan_test > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Mon Mar 1 07:43:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3BAE552F96; Mon, 1 Mar 2021 07:43:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dpshb59w6z3QZ1; Mon, 1 Mar 2021 07:43:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A48C41FEE0; Mon, 1 Mar 2021 07:43:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1217hxXp038575; Mon, 1 Mar 2021 07:43:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1217hxVH038574; Mon, 1 Mar 2021 07:43:59 GMT (envelope-from git) Date: Mon, 1 Mar 2021 07:43:59 GMT Message-Id: <202103010743.1217hxVH038574@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: 2c1c1255e41a - main - kcsan: add atomic_interrupt_fence 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: 2c1c1255e41ac3fecd79f9f704c934642f34fd60 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 07:43:59 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2c1c1255e41ac3fecd79f9f704c934642f34fd60 commit 2c1c1255e41ac3fecd79f9f704c934642f34fd60 Author: Mateusz Guzik AuthorDate: 2021-03-01 07:42:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-03-01 07:43:27 +0000 kcsan: add atomic_interrupt_fence Unbreaks building GENERIC-KCSAN. --- sys/sys/_cscan_atomic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/_cscan_atomic.h b/sys/sys/_cscan_atomic.h index aed96580e1e4..b458c24841bf 100644 --- a/sys/sys/_cscan_atomic.h +++ b/sys/sys/_cscan_atomic.h @@ -373,6 +373,7 @@ void kcsan_atomic_thread_fence_seq_cst(void); #define atomic_thread_fence_acq_rel kcsan_atomic_thread_fence_acq_rel #define atomic_thread_fence_rel kcsan_atomic_thread_fence_rel #define atomic_thread_fence_seq_cst kcsan_atomic_thread_fence_seq_cst +#define atomic_interrupt_fence __compiler_membar #endif /* !KCSAN_RUNTIME */ From owner-dev-commits-src-all@freebsd.org Mon Mar 1 07:48:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD425552FB3; Mon, 1 Mar 2021 07:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DpsnH4NpPz3QdR; Mon, 1 Mar 2021 07:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FD6B1FC51; Mon, 1 Mar 2021 07:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1217m3QC039298; Mon, 1 Mar 2021 07:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1217m3QR039297; Mon, 1 Mar 2021 07:48:03 GMT (envelope-from git) Date: Mon, 1 Mar 2021 07:48:03 GMT Message-Id: <202103010748.1217m3QR039297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 9596751563dc - stable/13 - Include new data sent in PRR calculation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9596751563dc1819d177fa3ec6660a3bdc18021c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 07:48:03 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=9596751563dc1819d177fa3ec6660a3bdc18021c commit 9596751563dc1819d177fa3ec6660a3bdc18021c Author: Richard Scheffenegger AuthorDate: 2021-02-26 21:30:33 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-01 07:24:24 +0000 Include new data sent in PRR calculation Reviewed By: #transport, kbowling MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28941 (cherry picked from commit 9e83a6a556ed8d9a2821de5d5f5c7d4b1292c694) --- sys/netinet/tcp_input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 42f983f64502..f16c62ae6a1f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2602,7 +2602,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, imax(1, tp->snd_nxt - tp->snd_una); snd_cnt = howmany((long)tp->sackhint.prr_delivered * tp->snd_ssthresh, tp->sackhint.recover_fs) - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - @@ -3951,7 +3952,8 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) imax(1, tp->snd_nxt - tp->snd_una); snd_cnt = howmany((long)tp->sackhint.prr_delivered * tp->snd_ssthresh, tp->sackhint.recover_fs) - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - From owner-dev-commits-src-all@freebsd.org Mon Mar 1 10:34:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3925E55787E; Mon, 1 Mar 2021 10:34:38 +0000 (UTC) (envelope-from dim@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 4DpxTV15DNz3rZ9; Mon, 1 Mar 2021 10:34:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id F25D53152B; Mon, 1 Mar 2021 10:34:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::5d25:8d0f:9793:2693] (unknown [IPv6:2001:470:7a58:0:5d25:8d0f:9793:2693]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E50585AE22; Mon, 1 Mar 2021 11:34:35 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_B55500EF-8766-40D8-9872-35C64F09EE34"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: git: cf97d2a1dab8 - main - Build lib/msun tests with compiler builtins disabled Date: Mon, 1 Mar 2021 11:34:25 +0100 In-Reply-To: Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org To: Mateusz Guzik References: <202102232010.11NKAMFt014918@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.17) X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 10:34:38 -0000 --Apple-Mail=_B55500EF-8766-40D8-9872-35C64F09EE34 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 1 Mar 2021, at 08:34, Mateusz Guzik wrote: >=20 > This breaks riscv: >=20 > ld: error: undefined symbol: fabs >>>> referenced by t_acos.c:93 = (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:93) = >>> = t_acos.o:(atfu_acos_is_plus_zero_body) >>>> referenced by t_acos.c:94 = (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:94) = >>> = t_acos.o:(atfu_acos_is_plus_zero_body) >>>> did you mean: cabs = >>> = defined in: /usr/obj/usr/src/riscv.riscv64sf/tmp/usr/lib/libm.so >=20 >=20 > On 2/23/21, Dimitry Andric wrote: >> The branch main has been updated by dim: >>=20 >> URL: >> = https://cgit.FreeBSD.org/src/commit/?id=3Dcf97d2a1dab8f2cddc4466fe64d37818= 339c73be >>=20 >> commit cf97d2a1dab8f2cddc4466fe64d37818339c73be >> Author: Dimitry Andric >> AuthorDate: 2021-02-23 20:03:32 +0000 >> Commit: Dimitry Andric >> CommitDate: 2021-02-23 20:10:01 +0000 >>=20 >> Build lib/msun tests with compiler builtins disabled Hm, there isn't any reference machine for riscv, so any ideas on how to figure out whether fabs() is being built or not being built for riscv? I don't see anything in lib/msun/Makefile that would exclude it. -Dimitry --Apple-Mail=_B55500EF-8766-40D8-9872-35C64F09EE34 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYDzDMQAKCRCwXqMKLiCW o5nyAJ9bFY8qEARQxUNeEmnMwDsURs3DWwCgrzEQqvEzd+jyz/e0yee41Ij02g0= =g3tz -----END PGP SIGNATURE----- --Apple-Mail=_B55500EF-8766-40D8-9872-35C64F09EE34-- From owner-dev-commits-src-all@freebsd.org Mon Mar 1 10:35:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42425557E1A; Mon, 1 Mar 2021 10:35:44 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (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 4DpxVm1Gs4z3rdv; Mon, 1 Mar 2021 10:35:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lj1-x234.google.com with SMTP id r25so17815902ljk.11; Mon, 01 Mar 2021 02:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wIH0uXqxGQirevpdymqhgCM8buLIBtU9yyiUAdcR7PE=; b=JD+HXyHJvPtfI2lwax9yDUDS9qRUJdSnAYBqxNZOlovF8L75WKG/+6jFFeSWI/ZfET 4rcM/kuf64q/VYgJe+TE7A2Z4xgLPIb5q3t4dDbxnRPTr/C+mSf+2HWkwSWcR/MEz7pV aOnHrQs8WbTeI7tQAFqGVnyOMzaMY9U/SydLzr7TBi8ULNhH/g6L8eSPjhvkKaH6Tq29 dVod9azU+0YGZRByjmJkm7Fu+oKu1xdy4adAhw8ykZPfUlvWSIdY1QlMMYLlhVTxdb/A v0Rq1oAuaWje3yyvFEWuG/z51iL6IknflXwRwkHRkJ05Y1a32G1I2auiWSSO7p+ttYMe wmsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wIH0uXqxGQirevpdymqhgCM8buLIBtU9yyiUAdcR7PE=; b=JE6CHNZCzvuxSVAKbX9Vee/G+lPhxfHHao09Yq0fGAMYmQTGKJGvI2WciKmD2YzhxX al9VqvbT099B15rg9ISpKE9VJS/oRXWaXQ/+uPBZGGfK6vfNVIqiBC/B9Ex9BXywePhG bUBkJHN01SaV9AS+SVO0JcUw7Y4EcRNdJsX78H4t6m9hUyYCfHbvYGwZSTvFyJfbgGsw QPooIZLJstkmcgesJzAO/sEvwm+QIsyUoRUgZxJpR+zeVkK/gYojS9QLHg1ohwOQKs3m UVamUs6FfcVtFc0MAg1VvGeTkLqTsYlMhsNxlKMZHCQzutbGqPiW0Y7y+3F7kSkK+xaU eirw== X-Gm-Message-State: AOAM533DIU4WprCrowOR9XLj2ea52MHzl3nzpqNCfkCe1u1DvfPcKgbM vVrv1fbhCvz8B84+waJu8cKlERDiF7DCrmei+e4tykeOQVo= X-Google-Smtp-Source: ABdhPJxIDN/wK3Qs0JLTbdtm14HMbf9q5BtdptiIQ7VDnneIlPySWA1oNGtlIGh36UpBPNuREnWDjJBkz8NoclOIYto= X-Received: by 2002:a2e:534a:: with SMTP id t10mr9012357ljd.499.1614594942267; Mon, 01 Mar 2021 02:35:42 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a2e:958d:0:0:0:0:0 with HTTP; Mon, 1 Mar 2021 02:35:41 -0800 (PST) In-Reply-To: References: <202102232010.11NKAMFt014918@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 1 Mar 2021 11:35:41 +0100 Message-ID: Subject: Re: git: cf97d2a1dab8 - main - Build lib/msun tests with compiler builtins disabled To: Dimitry Andric 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: 4DpxVm1Gs4z3rdv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 10:35:44 -0000 You can crossbuild with TARGET_ARCH=riscv64sf On 3/1/21, Dimitry Andric wrote: > On 1 Mar 2021, at 08:34, Mateusz Guzik wrote: >> >> This breaks riscv: >> >> ld: error: undefined symbol: fabs >>>>> referenced by t_acos.c:93 >>>>> (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:93) >>>>> >>> >>>>> t_acos.o:(atfu_acos_is_plus_zero_body) >>>>> referenced by t_acos.c:94 >>>>> (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:94) >>>>> >>> >>>>> t_acos.o:(atfu_acos_is_plus_zero_body) >>>>> did you mean: cabs >>>>> >>> defined >>>>> in: /usr/obj/usr/src/riscv.riscv64sf/tmp/usr/lib/libm.so >> >> >> On 2/23/21, Dimitry Andric wrote: >>> The branch main has been updated by dim: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=cf97d2a1dab8f2cddc4466fe64d37818339c73be >>> >>> commit cf97d2a1dab8f2cddc4466fe64d37818339c73be >>> Author: Dimitry Andric >>> AuthorDate: 2021-02-23 20:03:32 +0000 >>> Commit: Dimitry Andric >>> CommitDate: 2021-02-23 20:10:01 +0000 >>> >>> Build lib/msun tests with compiler builtins disabled > > Hm, there isn't any reference machine for riscv, so any ideas on how to > figure out whether fabs() is being built or not being built for riscv? > I don't see anything in lib/msun/Makefile that would exclude it. > > -Dimitry > > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Mon Mar 1 10:54:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F04BE558D27; Mon, 1 Mar 2021 10:54: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 4Dpxwp6Sxcz3srg; Mon, 1 Mar 2021 10:54: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 D0D2A222EA; Mon, 1 Mar 2021 10: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 121Asord088990; Mon, 1 Mar 2021 10: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 121Aso2D088989; Mon, 1 Mar 2021 10:54:50 GMT (envelope-from git) Date: Mon, 1 Mar 2021 10:54:50 GMT Message-Id: <202103011054.121Aso2D088989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 05e4a34e4360 - stable/13 - loader: autoload_font will hung loader when there is no local console MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05e4a34e4360f54ec62616730465410726c96ba2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 10:54:51 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=05e4a34e4360f54ec62616730465410726c96ba2 commit 05e4a34e4360f54ec62616730465410726c96ba2 Author: Toomas Soome AuthorDate: 2021-02-21 10:32:18 +0000 Commit: Toomas Soome CommitDate: 2021-03-01 10:54:36 +0000 loader: autoload_font will hung loader when there is no local console If we start with console set to comconsole, the local console (vidconsole, efi) is never initialized and attempt to use the data can render the loader hung. (cherry picked from commit 61c50cbc096d28e44cb8b627e524ae58158c423a) Reported by: Kamigishi Rei --- stand/efi/libefi/efi_console.c | 3 +++ stand/i386/libi386/vidconsole.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 7024f9c8b2f2..3cbd121c41da 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -886,6 +886,9 @@ cons_update_mode(bool use_gfx_mode) EFI_STATUS status; char env[10], *ptr; + if (!efi_started) + return (false); + /* * Despite the use_gfx_mode, we want to make sure we call * efi_find_framebuffer(). This will populate the fb data, diff --git a/stand/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c index f94ed2d26712..b933a7807687 100644 --- a/stand/i386/libi386/vidconsole.c +++ b/stand/i386/libi386/vidconsole.c @@ -53,7 +53,7 @@ static int vidc_getchar(void); static int vidc_ischar(void); static void cons_draw_frame(teken_attr_t *); -static int vidc_started; +static bool vidc_started; static uint16_t *vgatext; static tf_bell_t vidc_cons_bell; @@ -877,6 +877,10 @@ cons_update_mode(bool use_gfx_mode) char env[10], *ptr; int format, roff, goff, boff; + /* vidc_init() is not called yet. */ + if (!vidc_started) + return (false); + gfx_state.tg_tp.tp_row = TEXT_ROWS; gfx_state.tg_tp.tp_col = TEXT_COLS; @@ -996,7 +1000,7 @@ vidc_init(int arg) if (vidc_started && arg == 0) return (0); - vidc_started = 1; + vidc_started = true; vbe_init(); /* From owner-dev-commits-src-all@freebsd.org Mon Mar 1 12:33:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC1B155C0DC; Mon, 1 Mar 2021 12:33: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 4Dq06Q5rw4z4Sxt; Mon, 1 Mar 2021 12:33: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 BBD4923A0A; Mon, 1 Mar 2021 12:33: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 121CXIHZ020733; Mon, 1 Mar 2021 12:33:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121CXI7Q020732; Mon, 1 Mar 2021 12:33:18 GMT (envelope-from git) Date: Mon, 1 Mar 2021 12:33:18 GMT Message-Id: <202103011233.121CXI7Q020732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: a2c0e94ccfaf - main - xen: remove x86-ism from Xen common code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2c0e94ccfafc6a873fc6acbaccee8a14f968acf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 12:33:18 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=a2c0e94ccfafc6a873fc6acbaccee8a14f968acf commit a2c0e94ccfafc6a873fc6acbaccee8a14f968acf Author: Elliott Mitchell AuthorDate: 2021-03-01 11:44:54 +0000 Commit: Roger Pau Monné CommitDate: 2021-03-01 12:33:01 +0000 xen: remove x86-ism from Xen common code PAT_WRITE_BACK is x86-only, whereas sys/dev/xen could be shared between multiple architectures. Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D28831 --- sys/dev/xen/console/xen_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/xen/console/xen_console.c b/sys/dev/xen/console/xen_console.c index 8e366bba2319..7eed30885e6b 100644 --- a/sys/dev/xen/console/xen_console.c +++ b/sys/dev/xen/console/xen_console.c @@ -273,7 +273,7 @@ static void xencons_early_init_ring(struct xencons_priv *cons) { cons->intf = pmap_mapdev_attr(ptoa(xen_get_console_mfn()), PAGE_SIZE, - PAT_WRITE_BACK); + VM_MEMATTR_WRITE_BACK); cons->evtchn = xen_get_console_evtchn(); } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 12:55:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAAF055C544; Mon, 1 Mar 2021 12:55: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 4Dq0cY4VRFz4VPt; Mon, 1 Mar 2021 12:55: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 8CBFF23F4A; Mon, 1 Mar 2021 12:55: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 121CtvgZ046984; Mon, 1 Mar 2021 12:55:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121CtvCc046983; Mon, 1 Mar 2021 12:55:57 GMT (envelope-from git) Date: Mon, 1 Mar 2021 12:55:57 GMT Message-Id: <202103011255.121CtvCc046983@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: 98202829d1b3 - main - tests/sys/netpfil/pf: Add missing python3 requirements 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: 98202829d1b3727a8706f45d052fc9e9507b562b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 12:55:57 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=98202829d1b3727a8706f45d052fc9e9507b562b commit 98202829d1b3727a8706f45d052fc9e9507b562b Author: Alex Richardson AuthorDate: 2021-02-23 19:04:01 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 12:53:45 +0000 tests/sys/netpfil/pf: Add missing python3 requirements This also fixes a typo in the dup test that caused the head function to not be called. On my test system without python3 the tests are now skipped instead of failing. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28903 --- tests/sys/netpfil/pf/checksum.sh | 1 + tests/sys/netpfil/pf/dup.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/checksum.sh b/tests/sys/netpfil/pf/checksum.sh index 778ae1cd6e9f..836bc1233963 100644 --- a/tests/sys/netpfil/pf/checksum.sh +++ b/tests/sys/netpfil/pf/checksum.sh @@ -32,6 +32,7 @@ unaligned_head() { atf_set descr 'Test unaligned checksum updates' atf_set require.user root + atf_set require.progs scapy } unaligned_body() diff --git a/tests/sys/netpfil/pf/dup.sh b/tests/sys/netpfil/pf/dup.sh index 7b9a91804e96..3b3bef976fc2 100644 --- a/tests/sys/netpfil/pf/dup.sh +++ b/tests/sys/netpfil/pf/dup.sh @@ -30,10 +30,11 @@ common_dir=$(atf_get_srcdir)/../common atf_test_case "dup_to" "cleanup" -do_to_head() +dup_to_head() { atf_set descr 'dup-to test' atf_set require.user root + atf_set require.progs scapy } dup_to_body() From owner-dev-commits-src-all@freebsd.org Mon Mar 1 12:55:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7E0C55C7B8; Mon, 1 Mar 2021 12:55: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 4Dq0cZ5pQRz4VPy; Mon, 1 Mar 2021 12:55: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 BA4D223948; Mon, 1 Mar 2021 12:55: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 121CtwAW047003; Mon, 1 Mar 2021 12:55:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121Ctw93047002; Mon, 1 Mar 2021 12:55:58 GMT (envelope-from git) Date: Mon, 1 Mar 2021 12:55:58 GMT Message-Id: <202103011255.121Ctw93047002@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: 760b2ffc5529 - main - Update scalbn* functions to the musl versions 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: 760b2ffc552985017c5bc74fb9966d4dc1b5b691 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 12:55:58 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=760b2ffc552985017c5bc74fb9966d4dc1b5b691 commit 760b2ffc552985017c5bc74fb9966d4dc1b5b691 Author: Alex Richardson AuthorDate: 2021-02-24 16:56:53 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 12:53:45 +0000 Update scalbn* functions to the musl versions The only diff compared to musl is a minor change to scalbnl() to replace musl's union ldshape with union IEEEl2bits. This fixes the scalbn tests on non-x86 (since x86 has an assembly version that is used instead). Musl commit messages: commit 8c44a060243f04283ca68dad199aab90336141db Author: Szabolcs Nagy Date: Mon Apr 3 02:38:13 2017 +0200 fix scalbn when result is in the subnormal range in nearest rounding mode scalbn could introduce double rounding error when an intermediate value and the final result were both in the subnormal range e.g. scalbn(0x1.7ffffffffffffp-1, -1073) returned 0x1p-1073 instead of 0x1p-1074, because the intermediate computation got rounded to 0x1.8p-1023. with the fix an intermediate value can only be in the subnormal range if the final result is 0 which is correct even after double rounding. (there still can be two roundings so signals may be raised twice, but that's only observable with trapping exceptions which is not supported.) commit 2eaed464e2080d8321d3903b71086a1ecfc4ee4a Author: Szabolcs Nagy Date: Wed Sep 4 15:52:54 2013 +0000 math: use float_t and double_t in scalbnf and scalbn remove STRICT_ASSIGN (c99 semantics is assumed) and use the conventional union to prepare the scaling factor (so libm.h is no longer needed) commit 1b77b9072f374bd26eb0574b83a0d5f18d75ec60 Author: Szabolcs Nagy Date: Thu Aug 15 10:07:46 2013 +0000 math: minor scalbn*.c simplification commit c4359e01303da2755fe7e8033826b132eb3659b1 Author: Szabolcs Nagy Date: Tue Nov 13 10:55:35 2012 +0100 math: excess precision fix modf, modff, scalbn, scalbnf old code was correct only if the result was stored (without the excess precision) or musl was compiled with -ffloat-store. now we use STRICT_ASSIGN to work around the issue. (see note 160 in c11 section 6.8.6.4) commit 666271c105e4137bdfa195e217799d74143370d4 Author: Szabolcs Nagy Date: Tue Nov 13 10:30:40 2012 +0100 math: fix scalbn and scalbnf on overflow/underflow old code was correct only if the result was stored (without the excess precision) or musl was compiled with -ffloat-store. (see note 160 in n1570.pdf section 6.8.6.4) commit 8051e08e10d2b739fcfcbc6bc7466e8d77fa49f1 Author: nsz Date: Mon Mar 19 10:54:07 2012 +0100 simplify scalbn*.c implementations The old scalbn.c was wrong and slow, the new one is just slow. (scalbn(0x1p+1023,-2097) should give 0x1p-1074, but the old code gave 0) Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D28872 --- lib/msun/src/s_scalbn.c | 86 +++++++++++++++----------------------------- lib/msun/src/s_scalbnf.c | 78 ++++++++++++++-------------------------- lib/msun/src/s_scalbnl.c | 92 ++++++++++++++++++------------------------------ 3 files changed, 90 insertions(+), 166 deletions(-) diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c index b048b0596b67..219cd8f0c989 100644 --- a/lib/msun/src/s_scalbn.c +++ b/lib/msun/src/s_scalbn.c @@ -1,63 +1,35 @@ -/* @(#)s_scalbn.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ +#include +#include -#include -__FBSDID("$FreeBSD$"); - -/* - * scalbn (double x, int n) - * scalbn(x,n) returns x* 2**n computed by exponent - * manipulation rather than by actually performing an - * exponentiation or a multiplication. - */ - -#include - -#include "math.h" -#include "math_private.h" - -static const double -two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ -huge = 1.0e+300, -tiny = 1.0e-300; - -double -scalbn (double x, int n) +double scalbn(double x, int n) { - int32_t k,hx,lx; - EXTRACT_WORDS(hx,lx,x); - k = (hx&0x7ff00000)>>20; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ - x *= two54; - GET_HIGH_WORD(hx,x); - k = ((hx&0x7ff00000)>>20) - 54; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0x7ff) return x+x; /* NaN or Inf */ - k = k+n; - if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} - if (k <= -54) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*copysign(huge,x); /*overflow*/ - else - return tiny*copysign(tiny,x); /*underflow*/ + union {double f; uint64_t i;} u; + double_t y = x; + + if (n > 1023) { + y *= 0x1p1023; + n -= 1023; + if (n > 1023) { + y *= 0x1p1023; + n -= 1023; + if (n > 1023) + n = 1023; + } + } else if (n < -1022) { + /* make sure final n < -53 to avoid double + rounding in the subnormal range */ + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; + if (n < -1022) { + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; + if (n < -1022) + n = -1022; + } } - k += 54; /* subnormal result */ - SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); - return x*twom54; + u.i = (uint64_t)(0x3ff+n)<<52; + x = y * u.f; + return x; } #if (LDBL_MANT_DIG == 53) diff --git a/lib/msun/src/s_scalbnf.c b/lib/msun/src/s_scalbnf.c index 21d001c1faf1..3a46470b5661 100644 --- a/lib/msun/src/s_scalbnf.c +++ b/lib/msun/src/s_scalbnf.c @@ -1,57 +1,33 @@ -/* s_scalbnf.c -- float version of s_scalbn.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ +#include +#include -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#include -__FBSDID("$FreeBSD$"); - -#include "math.h" -#include "math_private.h" - -static const float -two25 = 3.355443200e+07, /* 0x4c000000 */ -twom25 = 2.9802322388e-08, /* 0x33000000 */ -huge = 1.0e+30, -tiny = 1.0e-30; - -float -scalbnf (float x, int n) +float scalbnf(float x, int n) { - int32_t k,ix; - GET_FLOAT_WORD(ix,x); - k = (ix&0x7f800000)>>23; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((ix&0x7fffffff)==0) return x; /* +-0 */ - x *= two25; - GET_FLOAT_WORD(ix,x); - k = ((ix&0x7f800000)>>23) - 25; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0xff) return x+x; /* NaN or Inf */ - k = k+n; - if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} - if (k <= -25) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*copysignf(huge,x); /*overflow*/ - else - return tiny*copysignf(tiny,x); /*underflow*/ + union {float f; uint32_t i;} u; + float_t y = x; + + if (n > 127) { + y *= 0x1p127f; + n -= 127; + if (n > 127) { + y *= 0x1p127f; + n -= 127; + if (n > 127) + n = 127; + } + } else if (n < -126) { + y *= 0x1p-126f * 0x1p24f; + n += 126 - 24; + if (n < -126) { + y *= 0x1p-126f * 0x1p24f; + n += 126 - 24; + if (n < -126) + n = -126; + } } - k += 25; /* subnormal result */ - SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); - return x*twom25; + u.i = (uint32_t)(0x7f+n)<<23; + x = y * u.f; + return x; } __strong_reference(scalbnf, ldexpf); diff --git a/lib/msun/src/s_scalbnl.c b/lib/msun/src/s_scalbnl.c index 28b0cf9b7294..65a9415b0d21 100644 --- a/lib/msun/src/s_scalbnl.c +++ b/lib/msun/src/s_scalbnl.c @@ -1,18 +1,7 @@ -/* @(#)s_scalbn.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#include -__FBSDID("$FreeBSD$"); - +#include +#include +#include "math_private.h" +#include "fpmath.h" /* * scalbnl (long double x, int n) * scalbnl(x,n) returns x* 2**n computed by exponent @@ -20,52 +9,39 @@ __FBSDID("$FreeBSD$"); * exponentiation or a multiplication. */ -/* - * We assume that a long double has a 15-bit exponent. On systems - * where long double is the same as double, scalbnl() is an alias - * for scalbn(), so we don't use this routine. - */ - -#include -#include - -#include "fpmath.h" - -#if LDBL_MAX_EXP != 0x4000 -#error "Unsupported long double format" -#endif - -static const long double -huge = 0x1p16000L, -tiny = 0x1p-16000L; - -long double -scalbnl (long double x, int n) +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +long double scalbnl(long double x, int n) +{ + return scalbn(x, n); +} +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 +long double scalbnl(long double x, int n) { union IEEEl2bits u; - int k; - u.e = x; - k = u.bits.exp; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((u.bits.manh|u.bits.manl)==0) return x; /* +-0 */ - u.e *= 0x1p+128; - k = u.bits.exp - 128; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0x7fff) return x+x; /* NaN or Inf */ - k = k+n; - if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {u.bits.exp = k; return u.e;} - if (k <= -128) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*copysign(huge,x); /*overflow*/ - else - return tiny*copysign(tiny,x); /*underflow*/ + + if (n > 16383) { + x *= 0x1p16383L; + n -= 16383; + if (n > 16383) { + x *= 0x1p16383L; + n -= 16383; + if (n > 16383) + n = 16383; + } + } else if (n < -16382) { + x *= 0x1p-16382L * 0x1p113L; + n += 16382 - 113; + if (n < -16382) { + x *= 0x1p-16382L * 0x1p113L; + n += 16382 - 113; + if (n < -16382) + n = -16382; + } } - k += 128; /* subnormal result */ - u.bits.exp = k; - return u.e*0x1p-128; + u.e = 1.0; + u.xbits.expsign = 0x3fff + n; + return x * u.e; } +#endif __strong_reference(scalbnl, ldexpl); From owner-dev-commits-src-all@freebsd.org Mon Mar 1 12:56:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 657FF55C176; Mon, 1 Mar 2021 12:56: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 4Dq0cc0TZMz4VVf; Mon, 1 Mar 2021 12:56: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 E6CF323F4B; Mon, 1 Mar 2021 12:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121CtxC0047025; Mon, 1 Mar 2021 12:55:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121CtxZo047024; Mon, 1 Mar 2021 12:55:59 GMT (envelope-from git) Date: Mon, 1 Mar 2021 12:55:59 GMT Message-Id: <202103011255.121CtxZo047024@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: aac21e66f94e - main - Also use the musl scalbn code for ldexp() 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: aac21e66f94e0a8ad52c1f8cd8dce50fcdd35cca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 12:56:00 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=aac21e66f94e0a8ad52c1f8cd8dce50fcdd35cca commit aac21e66f94e0a8ad52c1f8cd8dce50fcdd35cca Author: Alex Richardson AuthorDate: 2021-02-25 14:29:44 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 12:53:46 +0000 Also use the musl scalbn code for ldexp() Instead of copying the code as 00646ca2047305fce32d99edc7a8e6dfd801f3b4 did, include the implementation with the function name re-defined. --- lib/libc/gen/ldexp.c | 126 +++------------------------------------------------ 1 file changed, 6 insertions(+), 120 deletions(-) diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c index 887f673ee9a5..878271576313 100644 --- a/lib/libc/gen/ldexp.c +++ b/lib/libc/gen/ldexp.c @@ -1,123 +1,9 @@ -/* @(#)s_scalbn.c 5.1 93/09/24 */ -/* @(#)fdlibm.h 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - #include __FBSDID("$FreeBSD$"); -#include -#include -#include - -/* Bit fiddling routines copied from msun/src/math_private.h,v 1.15 */ - -#if BYTE_ORDER == BIG_ENDIAN - -typedef union -{ - double value; - struct - { - u_int32_t msw; - u_int32_t lsw; - } parts; -} ieee_double_shape_type; - -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN - -typedef union -{ - double value; - struct - { - u_int32_t lsw; - u_int32_t msw; - } parts; -} ieee_double_shape_type; - -#endif - -/* Get two 32 bit ints from a double. */ - -#define EXTRACT_WORDS(ix0,ix1,d) \ -do { \ - ieee_double_shape_type ew_u; \ - ew_u.value = (d); \ - (ix0) = ew_u.parts.msw; \ - (ix1) = ew_u.parts.lsw; \ -} while (0) - -/* Get the more significant 32 bit int from a double. */ - -#define GET_HIGH_WORD(i,d) \ -do { \ - ieee_double_shape_type gh_u; \ - gh_u.value = (d); \ - (i) = gh_u.parts.msw; \ -} while (0) - -/* Set the more significant 32 bits of a double from an int. */ - -#define SET_HIGH_WORD(d,v) \ -do { \ - ieee_double_shape_type sh_u; \ - sh_u.value = (d); \ - sh_u.parts.msw = (v); \ - (d) = sh_u.value; \ -} while (0) - - -static const double -two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ -huge = 1.0e+300, -tiny = 1.0e-300; - -static double -_copysign(double x, double y) -{ - u_int32_t hx,hy; - GET_HIGH_WORD(hx,x); - GET_HIGH_WORD(hy,y); - SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000)); - return x; -} - -double -ldexp(double x, int n) -{ - int32_t k,hx,lx; - EXTRACT_WORDS(hx,lx,x); - k = (hx&0x7ff00000)>>20; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ - x *= two54; - GET_HIGH_WORD(hx,x); - k = ((hx&0x7ff00000)>>20) - 54; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0x7ff) return x+x; /* NaN or Inf */ - k = k+n; - if (k > 0x7fe) return huge*_copysign(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} - if (k <= -54) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*_copysign(huge,x); /*overflow*/ - else return tiny*_copysign(tiny,x); /*underflow*/ - } - k += 54; /* subnormal result */ - SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); - return x*twom54; -} +/* + * ldexp() and scalbn() are defined to be identical, but ldexp() lives in libc + * for backwards compatibility. + */ +#define scalbn ldexp +#include "../../msun/src/s_scalbn.c" From owner-dev-commits-src-all@freebsd.org Mon Mar 1 12:56:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC98255C7C0; Mon, 1 Mar 2021 12:56: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 4Dq0cd41lBz4V7X; Mon, 1 Mar 2021 12:56: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 2A56B23E27; Mon, 1 Mar 2021 12:56: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 121Cu0Tw047047; Mon, 1 Mar 2021 12:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121Cu0xk047046; Mon, 1 Mar 2021 12:56:00 GMT (envelope-from git) Date: Mon, 1 Mar 2021 12:56:00 GMT Message-Id: <202103011256.121Cu0xk047046@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: a26ace4db6d9 - main - tools/build/make.py: Don't call brew --prefix if --cross-bindir is set 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: a26ace4db6d974215a4d882948da80eae2b3b0d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 12:56:03 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=a26ace4db6d974215a4d882948da80eae2b3b0d4 commit a26ace4db6d974215a4d882948da80eae2b3b0d4 Author: Alex Richardson AuthorDate: 2021-02-26 17:49:03 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 12:53:46 +0000 tools/build/make.py: Don't call brew --prefix if --cross-bindir is set Also updated the logic to use subprocess.run() instead of the old subprocess.getoutput() which also includes stderr and therefore can trigger an exception inside Path().exists(). Reported by: gnn --- tools/build/make.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/build/make.py b/tools/build/make.py index bc6d8fb449bb..c34147f6ac21 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -124,9 +124,14 @@ def default_cross_toolchain(): # default to homebrew-installed clang on MacOS if available if sys.platform.startswith("darwin"): if shutil.which("brew"): - llvm_dir = subprocess.getoutput("brew --prefix llvm") - if llvm_dir and Path(llvm_dir, "bin").exists(): - return str(Path(llvm_dir, "bin")) + llvm_dir = subprocess.run(["brew", "--prefix", "llvm"], + capture_output=True).stdout.strip() + debug("Inferred LLVM dir as", llvm_dir) + try: + if llvm_dir and Path(llvm_dir.decode("utf-8"), "bin").exists(): + return str(Path(llvm_dir.decode("utf-8"), "bin")) + except OSError: + return None return None @@ -137,7 +142,7 @@ if __name__ == "__main__": help="Directory to look for cc/c++/cpp/ld to build " "host (" + sys.platform + ") binaries", default="/usr/bin") - parser.add_argument("--cross-bindir", default=default_cross_toolchain(), + parser.add_argument("--cross-bindir", default=None, help="Directory to look for cc/c++/cpp/ld to build " "target binaries (only needed if XCC/XCPP/XLD " "are not set)") @@ -165,6 +170,8 @@ if __name__ == "__main__": except ImportError: pass parsed_args, bmake_args = parser.parse_known_args() + if parsed_args.cross_bindir is None: + parsed_args.cross_bindir = default_cross_toolchain() MAKEOBJDIRPREFIX = os.getenv("MAKEOBJDIRPREFIX") if not MAKEOBJDIRPREFIX: From owner-dev-commits-src-all@freebsd.org Mon Mar 1 12:56:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F063E55C9F7; Mon, 1 Mar 2021 12:56:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq0cg3L9Rz4VDJ; Mon, 1 Mar 2021 12:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5964823CCC; Mon, 1 Mar 2021 12:56:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121Cu2k9047065; Mon, 1 Mar 2021 12:56:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121Cu24D047064; Mon, 1 Mar 2021 12:56:02 GMT (envelope-from git) Date: Mon, 1 Mar 2021 12:56:02 GMT Message-Id: <202103011256.121Cu24D047064@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: 524b018d2004 - main - riscv: Add a soft-float implementation of fabs() 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: 524b018d200408bed5eb0d2b892db5b9fb46808b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 12:56:07 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=524b018d200408bed5eb0d2b892db5b9fb46808b commit 524b018d200408bed5eb0d2b892db5b9fb46808b Author: Alex Richardson AuthorDate: 2021-03-01 12:46:30 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 12:53:46 +0000 riscv: Add a soft-float implementation of fabs() We could just use a C implementation using __builtin_fabs(), but using this assembly version guarantees that there is no additional prolog/epilog code. Additionally, clang generates worse code for masking off the top bit than GCC: https://bugs.llvm.org/show_bug.cgi?id=49377. This fixes the RISCV64 softfloat world build after cf97d2a1dab8. That commit added -fno-builtin to the msun tests which resulted in the first references to fabs (previously the compiler inlined all calls). Reviewed By: dim Reported by: mjg Differential Revision: https://reviews.freebsd.org/D28994 --- lib/libc/riscv/gen/fabs.S | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/libc/riscv/gen/fabs.S b/lib/libc/riscv/gen/fabs.S index 44249252e9c1..09042af3b4c0 100644 --- a/lib/libc/riscv/gen/fabs.S +++ b/lib/libc/riscv/gen/fabs.S @@ -1,5 +1,6 @@ /*- * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2021 Alex Richardson * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -10,6 +11,9 @@ * Computer Laboratory as part of the CTSRD Project, with support from the * UK Higher Education Innovation Fund (HEIF). * + * This work was supported by Innovate UK project 105694, "Digital Security + * by Design (DSbD) Technology Platform Prototype". + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -35,9 +39,12 @@ #include __FBSDID("$FreeBSD$"); -#ifdef __riscv_float_abi_double ENTRY(fabs) +#ifdef __riscv_float_abi_double fabs.d fa0, fa0 +#else + slli a0,a0,1 + srli a0,a0,1 +#endif ret END(fabs) -#endif From owner-dev-commits-src-all@freebsd.org Mon Mar 1 13:03:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8700D55CE61; Mon, 1 Mar 2021 13:03: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 4Dq0nj3Ph1z4WD7; Mon, 1 Mar 2021 13:03: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 67BED23B6F; Mon, 1 Mar 2021 13:03: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 121D3rCH060456; Mon, 1 Mar 2021 13:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121D3rah060455; Mon, 1 Mar 2021 13:03:53 GMT (envelope-from git) Date: Mon, 1 Mar 2021 13:03:53 GMT Message-Id: <202103011303.121D3rah060455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: ce5a4083de2d - main - pci_dw_mv: Don't enable unhandled interrupts. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce5a4083de2d79bc44d209c9e355a09ede47346c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 13:03:53 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=ce5a4083de2d79bc44d209c9e355a09ede47346c commit ce5a4083de2d79bc44d209c9e355a09ede47346c Author: Michal Meloun AuthorDate: 2021-01-27 11:45:32 +0000 Commit: Michal Meloun CommitDate: 2021-03-01 13:03:34 +0000 pci_dw_mv: Don't enable unhandled interrupts. Mainly link errors interrupts should only be activated on fully linked port, otherwise noise on lanes can cause livelock. But we don't have error counters yet, so leave these interrupts disabled. --- sys/dev/pci/pci_dw_mv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c index 5d39228dd182..43f45ddef54e 100644 --- a/sys/dev/pci/pci_dw_mv.c +++ b/sys/dev/pci/pci_dw_mv.c @@ -166,8 +166,8 @@ pci_mv_init(struct pci_mv_softc *sc) /* Enable local interrupts */ pci_dw_dbi_wr4(sc->dev, DW_MSI_INTR0_MASK, 0xFFFFFFFF); - pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0xFFFFFFFF); - pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFD); + pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0x0001FE00); + pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0x00000000); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, 0xFFFFFFFF); pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, 0xFFFFFFFF); From owner-dev-commits-src-all@freebsd.org Mon Mar 1 13:23:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F11555D805; Mon, 1 Mar 2021 13:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq1Cr1HL5z4XKF; Mon, 1 Mar 2021 13:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F10F24246; Mon, 1 Mar 2021 13:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121DN4DS086760; Mon, 1 Mar 2021 13:23:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121DN4VO086759; Mon, 1 Mar 2021 13:23:04 GMT (envelope-from git) Date: Mon, 1 Mar 2021 13:23:04 GMT Message-Id: <202103011323.121DN4VO086759@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: e5e4845959ac - main - Makefile.inc1 "Avoid duplicate script for target" warning 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: e5e4845959ac60110677df302a68c220dff75abe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 13:23:04 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=e5e4845959ac60110677df302a68c220dff75abe commit e5e4845959ac60110677df302a68c220dff75abe Author: Alex Richardson AuthorDate: 2021-03-01 13:20:32 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 13:22:15 +0000 Makefile.inc1 "Avoid duplicate script for target" warning This happens if -DBOOTSTRAP_ALL_TOOLS or when building on non-FreeBSD. --- Makefile.inc1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index fd5097d1f8dd..9b52372288f7 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2433,9 +2433,6 @@ ${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_lex_depend} # since "make" will usually point to GNU make there. _other_bootstrap_tools+=usr.bin/bmake -_other_bootstrap_tools+=lib/ncurses/ncurses -${_bt}-usr.bin/ncurses: ${_bt}-lib/ncurses/ncurses - # Avoid dependency on host bz2 headers: _other_bootstrap_tools+=lib/libbz2 ${_bt}-usr.bin/grep: ${_bt}-lib/libbz2 From owner-dev-commits-src-all@freebsd.org Mon Mar 1 13:23:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 562E055D80C; Mon, 1 Mar 2021 13:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq1Cs23mxz4XHM; Mon, 1 Mar 2021 13:23: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 39B69241B6; Mon, 1 Mar 2021 13:23: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 121DN5lH086779; Mon, 1 Mar 2021 13:23:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121DN5it086778; Mon, 1 Mar 2021 13:23:05 GMT (envelope-from git) Date: Mon, 1 Mar 2021 13:23:05 GMT Message-Id: <202103011323.121DN5it086778@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: 79fbd483787a - main - Fix ncurses bootstrap on macOS 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: 79fbd483787a1b2d91d3bed231e6912270aa04c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 13:23:05 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=79fbd483787a1b2d91d3bed231e6912270aa04c6 commit 79fbd483787a1b2d91d3bed231e6912270aa04c6 Author: Alex Richardson AuthorDate: 2021-03-01 13:21:35 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 13:22:15 +0000 Fix ncurses bootstrap on macOS Avoid including machine/console.h when bootstrapping on non-FreeBSD. --- lib/ncurses/ncurses/ncurses_cfg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ncurses/ncurses/ncurses_cfg.h b/lib/ncurses/ncurses/ncurses_cfg.h index ca4ce6b5f32a..2217eabd3580 100644 --- a/lib/ncurses/ncurses/ncurses_cfg.h +++ b/lib/ncurses/ncurses/ncurses_cfg.h @@ -62,7 +62,9 @@ #endif #define HAVE_LONG_FILE_NAMES 1 #define MIXEDCASE_FILENAMES 1 +#ifdef __FreeBSD__ #define USE_SYSMOUSE 1 +#endif #define TERMINFO_DIRS "/usr/share/terminfo:/usr/local/share/site-terminfo" #define TERMINFO "/usr/share/terminfo" #define HAVE_BIG_CORE 1 From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:08:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57FC755E816; Mon, 1 Mar 2021 14:08: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 4Dq2D521Nnz4ZM0; Mon, 1 Mar 2021 14:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29455247F4; Mon, 1 Mar 2021 14:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121E8LFR040516; Mon, 1 Mar 2021 14:08:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121E8LDl040515; Mon, 1 Mar 2021 14:08:21 GMT (envelope-from git) Date: Mon, 1 Mar 2021 14:08:21 GMT Message-Id: <202103011408.121E8LDl040515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 874635e38173 - main - arm64: fix hardware single-stepping from EL1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 874635e381731e1fbd5e2d0459ca87814f1e455c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:08:21 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=874635e381731e1fbd5e2d0459ca87814f1e455c commit 874635e381731e1fbd5e2d0459ca87814f1e455c Author: Mitchell Horne AuthorDate: 2021-03-01 13:59:25 +0000 Commit: Mitchell Horne CommitDate: 2021-03-01 14:04:22 +0000 arm64: fix hardware single-stepping from EL1 The main issue is that debug exceptions must to be disabled for the entire duration that SS bit in MDSCR_EL1 is set. Otherwise, a single-step exception will be generated immediately. This can occur before returning from the debugger (when MDSCR is written to) or before re-entering it after the single-step (when debug exceptions are unmasked in the exception handler). Solve this by delaying the unmask to C code for EL1, and avoid unmasking at all while handling debug exceptions, thus avoiding any recursive debug traps. Reviewed by: markj, jhb MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28944 --- sys/arm64/arm64/debug_monitor.c | 6 ++++++ sys/arm64/arm64/exception.S | 6 +++++- sys/arm64/arm64/trap.c | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/debug_monitor.c b/sys/arm64/arm64/debug_monitor.c index eb5d19567697..c6622650f1ad 100644 --- a/sys/arm64/arm64/debug_monitor.c +++ b/sys/arm64/arm64/debug_monitor.c @@ -186,6 +186,9 @@ void kdb_cpu_set_singlestep(void) { + KASSERT((READ_SPECIALREG(daif) & PSR_D) == PSR_D, + ("%s: debug exceptions are not masked", __func__)); + kdb_frame->tf_spsr |= DBG_SPSR_SS; WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) | DBG_MDSCR_SS | DBG_MDSCR_KDE); @@ -205,6 +208,9 @@ void kdb_cpu_clear_singlestep(void) { + KASSERT((READ_SPECIALREG(daif) & PSR_D) == PSR_D, + ("%s: debug exceptions are not masked", __func__)); + WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) & ~(DBG_MDSCR_SS | DBG_MDSCR_KDE)); diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 9fe825fd12b5..9a28a5eac022 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -75,8 +75,12 @@ __FBSDID("$FreeBSD$"); ldr x0, [x18, #(PC_CURTHREAD)] bl dbg_monitor_enter -.endif msr daifclr, #8 /* Enable the debug exception */ +.endif + /* + * For EL1, debug exceptions are conditionally unmasked in + * do_el1h_sync(). + */ .endm .macro restore_registers el diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index cb3a05ad0163..d793e34a6894 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -377,6 +377,14 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, esr, frame->tf_elr, frame); + /* + * Enable debug exceptions if we aren't already handling one. They will + * be masked again in the exception handler's epilogue. + */ + if (exception != EXCP_BRK && exception != EXCP_WATCHPT_EL1 && + exception != EXCP_SOFTSTP_EL1) + dbg_enable(); + switch (exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:08:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FEF055E88D; Mon, 1 Mar 2021 14:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq2D62HqSz4ZJl; Mon, 1 Mar 2021 14:08: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 41C2024A5F; Mon, 1 Mar 2021 14:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121E8MX2040539; Mon, 1 Mar 2021 14:08:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121E8MX6040538; Mon, 1 Mar 2021 14:08:22 GMT (envelope-from git) Date: Mon, 1 Mar 2021 14:08:22 GMT Message-Id: <202103011408.121E8MX6040538@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: bd0b7cbf5ac1 - main - arm64: update kdb_thrctx->pcb_lr with BKPT_SKIP MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd0b7cbf5ac1baff4211e09584e0b86d4d96228b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:08:22 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=bd0b7cbf5ac1baff4211e09584e0b86d4d96228b commit bd0b7cbf5ac1baff4211e09584e0b86d4d96228b Author: Mitchell Horne AuthorDate: 2021-03-01 14:00:17 +0000 Commit: Mitchell Horne CommitDate: 2021-03-01 14:04:22 +0000 arm64: update kdb_thrctx->pcb_lr with BKPT_SKIP This value should be kept in sync with updates to kdb_frame->tf_elr, since it is queried by PC_REGS() in several places. Reviewed by: markj, jhb MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28943 --- sys/arm64/include/db_machdep.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h index f2fd2a57a9c3..61b58415e41c 100644 --- a/sys/arm64/include/db_machdep.h +++ b/sys/arm64/include/db_machdep.h @@ -49,8 +49,9 @@ typedef long db_expr_t; #define BKPT_SIZE (4) #define BKPT_SET(inst) (BKPT_INST) -#define BKPT_SKIP do { \ - kdb_frame->tf_elr += BKPT_SIZE; \ +#define BKPT_SKIP do { \ + kdb_frame->tf_elr += BKPT_SIZE; \ + kdb_thrctx->pcb_lr += BKPT_SIZE; \ } while (0) #define db_clear_single_step kdb_cpu_clear_singlestep From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:08:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF63755E79D; Mon, 1 Mar 2021 14:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq2D74CrCz4ZXJ; Mon, 1 Mar 2021 14:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C9FB24BF0; Mon, 1 Mar 2021 14:08: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 121E8NEH040559; Mon, 1 Mar 2021 14:08:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121E8NSR040558; Mon, 1 Mar 2021 14:08:23 GMT (envelope-from git) Date: Mon, 1 Mar 2021 14:08:23 GMT Message-Id: <202103011408.121E8NSR040558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: e152c882738f - main - arm64: add definition for IS_SSTEP_TRAP() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e152c882738ffe26a2f52e420e2a92c014943207 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:08:25 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e152c882738ffe26a2f52e420e2a92c014943207 commit e152c882738ffe26a2f52e420e2a92c014943207 Author: Mitchell Horne AuthorDate: 2021-03-01 14:01:25 +0000 Commit: Mitchell Horne CommitDate: 2021-03-01 14:04:23 +0000 arm64: add definition for IS_SSTEP_TRAP() arm64 has a distinct exception code for single-step, so we can use this to detect when an unexpected SS trap is encountered, or when an expected one is not. See db_stop_at_pc(). Reviewed by: markj, jhb MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28942 --- sys/arm64/include/db_machdep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h index 61b58415e41c..105e8e507ce3 100644 --- a/sys/arm64/include/db_machdep.h +++ b/sys/arm64/include/db_machdep.h @@ -38,6 +38,7 @@ #include #define T_BREAKPOINT (EXCP_BRK) +#define T_SINGLESTEP (EXCP_SOFTSTP_EL1) #define T_WATCHPOINT (EXCP_WATCHPT_EL1) typedef vm_offset_t db_addr_t; @@ -58,6 +59,7 @@ typedef long db_expr_t; #define db_set_single_step kdb_cpu_set_singlestep #define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT) +#define IS_SSTEP_TRAP(type, code) (type == T_SINGLESTEP) #define IS_WATCHPOINT_TRAP(type, code) (type == T_WATCHPOINT) #define inst_trap_return(ins) (0) From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:23:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB1C055EA67; Mon, 1 Mar 2021 14:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq2Yd5s52z4bvX; Mon, 1 Mar 2021 14:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBD7D24F6F; Mon, 1 Mar 2021 14:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121ENXQx066194; Mon, 1 Mar 2021 14:23:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121ENXdc066193; Mon, 1 Mar 2021 14:23:33 GMT (envelope-from git) Date: Mon, 1 Mar 2021 14:23:33 GMT Message-Id: <202103011423.121ENXdc066193@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: f5542795b992 - main - s_scalbn.c: Add missing float.h include 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: f5542795b99206a2b4e5a57429d18b9478264e24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:23:33 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f5542795b99206a2b4e5a57429d18b9478264e24 commit f5542795b99206a2b4e5a57429d18b9478264e24 Author: Alex Richardson AuthorDate: 2021-03-01 14:10:24 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 14:22:47 +0000 s_scalbn.c: Add missing float.h include This caused LDBL_MANT_DIG to not be defined and therefore the scalbnl alias was not being emitted for double==long double platforms. Fixes: 760b2ffc ("Update scalbn* functions to the musl versions") Reported by: Jenkins --- lib/libc/gen/ldexp.c | 1 + lib/msun/src/s_scalbn.c | 3 ++- lib/msun/src/s_scalbnl.c | 10 ++-------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c index 878271576313..cbbcf0782387 100644 --- a/lib/libc/gen/ldexp.c +++ b/lib/libc/gen/ldexp.c @@ -7,3 +7,4 @@ __FBSDID("$FreeBSD$"); */ #define scalbn ldexp #include "../../msun/src/s_scalbn.c" +#undef scalbn diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c index 219cd8f0c989..3de663f8b670 100644 --- a/lib/msun/src/s_scalbn.c +++ b/lib/msun/src/s_scalbn.c @@ -1,3 +1,4 @@ +#include #include #include @@ -32,7 +33,7 @@ double scalbn(double x, int n) return x; } -#if (LDBL_MANT_DIG == 53) +#if (LDBL_MANT_DIG == 53) && !defined(scalbn) __weak_reference(scalbn, ldexpl); __weak_reference(scalbn, scalbnl); #endif diff --git a/lib/msun/src/s_scalbnl.c b/lib/msun/src/s_scalbnl.c index 65a9415b0d21..a79f79b33480 100644 --- a/lib/msun/src/s_scalbnl.c +++ b/lib/msun/src/s_scalbnl.c @@ -8,13 +8,7 @@ * manipulation rather than by actually performing an * exponentiation or a multiplication. */ - -#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 -long double scalbnl(long double x, int n) -{ - return scalbn(x, n); -} -#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 +#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 long double scalbnl(long double x, int n) { union IEEEl2bits u; @@ -42,6 +36,6 @@ long double scalbnl(long double x, int n) u.xbits.expsign = 0x3fff + n; return x * u.e; } +__strong_reference(scalbnl, ldexpl); #endif -__strong_reference(scalbnl, ldexpl); From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:23:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3383E55EA69; Mon, 1 Mar 2021 14:23: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 4Dq2Yg0XrQz4by8; Mon, 1 Mar 2021 14:23: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 F16C425059; Mon, 1 Mar 2021 14:23: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 121ENYLh066215; Mon, 1 Mar 2021 14:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121ENYxE066214; Mon, 1 Mar 2021 14:23:34 GMT (envelope-from git) Date: Mon, 1 Mar 2021 14:23:34 GMT Message-Id: <202103011423.121ENYxE066214@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: 10f2a0c2e876 - main - Silence a macro-redefined warning when crossbuilding 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: 10f2a0c2e8766e9878ad4181f555d8dda84da34e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:23:35 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=10f2a0c2e8766e9878ad4181f555d8dda84da34e commit 10f2a0c2e8766e9878ad4181f555d8dda84da34e Author: Alex Richardson AuthorDate: 2021-03-01 14:11:20 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 14:22:47 +0000 Silence a macro-redefined warning when crossbuilding This is already defined by the ncurses headers, so just undef it before defining it again. --- tools/build/cross-build/include/common/string.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build/cross-build/include/common/string.h b/tools/build/cross-build/include/common/string.h index dd039d54583e..8a33f4d4ff19 100644 --- a/tools/build/cross-build/include/common/string.h +++ b/tools/build/cross-build/include/common/string.h @@ -38,7 +38,9 @@ #pragma once /* Avoid incompatible opensolaris redeclarations (without _FORTIFY_SOURCE). */ +#undef HAVE_STRLCAT #define HAVE_STRLCAT 1 +#undef HAVE_STRLCPY #define HAVE_STRLCPY 1 #include_next From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:28:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E346D55F0DF; Mon, 1 Mar 2021 14:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq2fs69LXz4c5F; Mon, 1 Mar 2021 14:28: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 C6ACE24E77; Mon, 1 Mar 2021 14:28: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 121ES5m0066995; Mon, 1 Mar 2021 14:28:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121ES5tq066994; Mon, 1 Mar 2021 14:28:05 GMT (envelope-from git) Date: Mon, 1 Mar 2021 14:28:05 GMT Message-Id: <202103011428.121ES5tq066994@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: 0e4ff0acbe80 - main - AArch64: Don't set flush-subnormals-to-zero flag on startup 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: 0e4ff0acbe80c547988bede738af2e227c7eb47c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:28:05 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=0e4ff0acbe80c547988bede738af2e227c7eb47c commit 0e4ff0acbe80c547988bede738af2e227c7eb47c Author: Alex Richardson AuthorDate: 2021-03-01 14:27:30 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 14:27:30 +0000 AArch64: Don't set flush-subnormals-to-zero flag on startup This flag has been set on startup since 65618fdda0f272a823e6701966421bdca0efa301. However, This causes some of the math-related tests to fail as they report zero instead of a tiny number. This fixes at least /usr/tests/lib/msun/ldexp_test and possibly others. Additionally, setting this flag prevents printf() from printing subnormal numbers in decimal form. See also https://www.openwall.com/lists/musl/2021/02/26/1 PR: 253847 Reviewed By: mmel Differential Revision: https://reviews.freebsd.org/D28938 --- lib/libc/tests/stdio/printfloat_test.c | 35 +++++++++++++++++++++++++++++++++- sys/arm64/arm64/vm_machdep.c | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/lib/libc/tests/stdio/printfloat_test.c b/lib/libc/tests/stdio/printfloat_test.c index 97629fb0d2b1..736ba1b493ef 100644 --- a/lib/libc/tests/stdio/printfloat_test.c +++ b/lib/libc/tests/stdio/printfloat_test.c @@ -50,7 +50,7 @@ smash_stack(void) { static uint32_t junk = 0xdeadbeef; uint32_t buf[512]; - int i; + size_t i; for (i = 0; i < sizeof(buf) / sizeof(buf[0]); i++) buf[i] = junk; @@ -370,6 +370,37 @@ ATF_TC_BODY(hexadecimal_rounding, tc) testfmt("0x1.83p+0", "%.2a", 1.51); } +ATF_TC_WITHOUT_HEAD(subnormal_double); +ATF_TC_BODY(subnormal_double, tc) +{ + /* Regression test for https://bugs.freebsd.org/253847 */ + double positive = __DBL_DENORM_MIN__; + testfmt("4.9406564584124654418e-324", "%20.20g", positive); + testfmt("4.9406564584124654418E-324", "%20.20G", positive); + testfmt("0x1p-1074", "%a", positive); + testfmt("0X1P-1074", "%A", positive); + double negative = -__DBL_DENORM_MIN__; + testfmt("-4.9406564584124654418e-324", "%20.20g", negative); + testfmt("-4.9406564584124654418E-324", "%20.20G", negative); + testfmt("-0x1p-1074", "%a", negative); + testfmt("-0X1P-1074", "%A", negative); +} + +ATF_TC_WITHOUT_HEAD(subnormal_float); +ATF_TC_BODY(subnormal_float, tc) +{ + float positive = __FLT_DENORM_MIN__; + testfmt("1.4012984643248170709e-45", "%20.20g", positive); + testfmt("1.4012984643248170709E-45", "%20.20G", positive); + testfmt("0x1p-149", "%a", positive); + testfmt("0X1P-149", "%A", positive); + float negative = -__FLT_DENORM_MIN__; + testfmt("-1.4012984643248170709e-45", "%20.20g", negative); + testfmt("-1.4012984643248170709E-45", "%20.20G", negative); + testfmt("-0x1p-149", "%a", negative); + testfmt("-0X1P-149", "%A", negative); +} + ATF_TP_ADD_TCS(tp) { @@ -384,6 +415,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, decimal_rounding); ATF_TP_ADD_TC(tp, hexadecimal_floating_point); ATF_TP_ADD_TC(tp, hexadecimal_rounding); + ATF_TP_ADD_TC(tp, subnormal_double); + ATF_TP_ADD_TC(tp, subnormal_float); return (atf_no_error()); } diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index d4dd32caef06..9a496b40ec98 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include #endif -uint32_t initial_fpcr = VFPCR_DN | VFPCR_FZ; +uint32_t initial_fpcr = VFPCR_DN; #include From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:32:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8716455F165; Mon, 1 Mar 2021 14:32: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 4Dq2lf3T0pz4cj1; Mon, 1 Mar 2021 14:32: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 6AAC925399; Mon, 1 Mar 2021 14:32: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 121EWEdN078980; Mon, 1 Mar 2021 14:32:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121EWEYJ078979; Mon, 1 Mar 2021 14:32:14 GMT (envelope-from git) Date: Mon, 1 Mar 2021 14:32:14 GMT Message-Id: <202103011432.121EWEYJ078979@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: a5f9fe2bab78 - main - copy_file_range(2): Fix for small values of input file offset and len 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: a5f9fe2bab789f49e8b53da3a62dbd34725e23ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:32:14 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a5f9fe2bab789f49e8b53da3a62dbd34725e23ea commit a5f9fe2bab789f49e8b53da3a62dbd34725e23ea Author: Rick Macklem AuthorDate: 2021-03-01 14:28:30 +0000 Commit: Rick Macklem CommitDate: 2021-03-01 14:31:10 +0000 copy_file_range(2): Fix for small values of input file offset and len r366302 broke copy_file_range(2) for small values of input file offset and len. It was possible for rem to be greater than len and then "len - rem" was a large value, since both variables are unsigned. Reported by: koobs, Pablo (Python) Reviewed by: asomers, koobs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28981 --- sys/kern/vfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 781968f2db53..7a0951fb07ca 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3143,7 +3143,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, rem = *inoffp % blksize; if (rem > 0) rem = blksize - rem; - if (len - rem > blksize) + if (len > rem && len - rem > blksize) len = savlen = rounddown(len - rem, blksize) + rem; } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 14:50:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2262955FDC5; Mon, 1 Mar 2021 14:50:43 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 4Dq38y31bFz4dpt; Mon, 1 Mar 2021 14:50:42 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f46.google.com with SMTP id w9so4950988edt.13; Mon, 01 Mar 2021 06:50:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AgZVFNTgcwSBTnqXfA5mRPbtXNUHYv1wpNtw0MjAoy0=; b=cCuPp5aIulsF0iUTwdNFFDBO3DBan6B3rSZlSt/eD6jY8vpsFuLh5/oXyPrTY67uW5 +fB5Ud4tkvNzW9pQbYlmEUUG+Ej32vGZhGwvSxfdsEgbrLIqoGqxzjLqXK8+wck+q2TD f2tElxVqF6ZXOPJGRD83Km5P5+UwbUoJlj69utcKRO9mnZ7wR3L+Vr9afa2N1p1WJnQv citFijvVEXscYTQS1ydE8lCPyS+CHsSp8P53wnXywt+Uu7ySSAkvrxxU5GA3vXMLHWoa rmDm/fXasb+MhXWbHtkYCWvTZI0iDAy94+LpPMzermnwfunu6GEeImMMU2d/eqUZkNNb tw6w== X-Gm-Message-State: AOAM532w++3qgl4C2AomhvPDTuuUzOtQ+HgmMJ18k43AqUg9sLNAOD9y GwexnHeD05dHgPkAW7Pw88SBj013751WRg== X-Google-Smtp-Source: ABdhPJx4JdxcWuCcXZcZnXh6Qf0RFA2gLQ87GRDq5FoGbcxHzTuDSkqdNVcSmIhD89ogTM4e2dmvPA== X-Received: by 2002:aa7:cd8d:: with SMTP id x13mr16457611edv.286.1614610240380; Mon, 01 Mar 2021 06:50:40 -0800 (PST) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com. [209.85.128.52]) by smtp.gmail.com with ESMTPSA id v24sm4798433ejw.17.2021.03.01.06.50.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Mar 2021 06:50:40 -0800 (PST) Received: by mail-wm1-f52.google.com with SMTP id i9so13442402wml.0; Mon, 01 Mar 2021 06:50:40 -0800 (PST) X-Received: by 2002:a7b:c119:: with SMTP id w25mr15878706wmi.127.1614610239791; Mon, 01 Mar 2021 06:50:39 -0800 (PST) MIME-Version: 1.0 References: <202102260917.11Q9HUnx061198@gitrepo.freebsd.org> In-Reply-To: <202102260917.11Q9HUnx061198@gitrepo.freebsd.org> From: Alexander Richardson Date: Mon, 1 Mar 2021 14:50:28 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: ec74116ace52 - main - dialog: finish update to 1.3-20210117 To: Baptiste Daroussin 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: 4Dq38y31bFz4dpt X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of arichardsonkde@gmail.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-2.71 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.71)[-0.707]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.208.46:from]; SPAMHAUS_ZRD(0.00)[209.85.208.46:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.46:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.46:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:50:43 -0000 On Fri, 26 Feb 2021 at 09:17, Baptiste Daroussin wrote: > > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ec74116ace52591cf121623e2010ae5efab5524a > > commit ec74116ace52591cf121623e2010ae5efab5524a > Author: Baptiste Daroussin > AuthorDate: 2021-02-26 09:13:13 +0000 > Commit: Baptiste Daroussin > CommitDate: 2021-02-26 09:17:19 +0000 > > dialog: finish update to 1.3-20210117 > > patch dialog.c which requires stddef for the usage of offsetof > catchup on the config header > --- > contrib/dialog/dialog.c | 1 + > gnu/lib/libdialog/Makefile | 2 +- > gnu/lib/libdialog/dlg_config.h | 15 ++++++++++++--- > 3 files changed, 14 insertions(+), 4 deletions(-) > > diff --git a/contrib/dialog/dialog.c b/contrib/dialog/dialog.c > index 510baeb97add..f59c9dc03c13 100644 > --- a/contrib/dialog/dialog.c > +++ b/contrib/dialog/dialog.c > @@ -26,6 +26,7 @@ > > #include > > +#include > #include > #include > #include > diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile > index e4f1b62121d9..8c6b84b64f90 100644 > --- a/gnu/lib/libdialog/Makefile > +++ b/gnu/lib/libdialog/Makefile > @@ -15,7 +15,7 @@ MAN= dialog.3 > > LIBADD= ncursesw m > > -CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DGCC_UNUSED=__unused > +CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -Wno-macro-redefined This appears to have broken the GCC build: cc1: error: unrecognized command line option '-Wno-macro-redefined' [-Werror] Probably fixable by using CFLAGS.clang? Thanks, Alex > .PATH: ${DIALOG} > WARNS?= 1 > > diff --git a/gnu/lib/libdialog/dlg_config.h b/gnu/lib/libdialog/dlg_config.h > index ee1d3f9ad3cb..1bd45183f509 100644 > --- a/gnu/lib/libdialog/dlg_config.h > +++ b/gnu/lib/libdialog/dlg_config.h > @@ -6,8 +6,15 @@ > */ > > #define CURSES_WACS_ARRAY _nc_wacs > -#define DIALOG_PATCHDATE 20180621 > +#define CURSES_WACS_SYMBOLS 1 > +#define DIALOG_PATCHDATE 20210117 > #define DIALOG_VERSION "1.3" > +#define GCC_NORETURN __attribute__((noreturn)) > +#define GCC_PRINTF 1 > +#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) > +#define GCC_SCANF 1 > +#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) > +#define GCC_UNUSED __attribute__((unused)) > #define HAVE_ALLOCA 1 > #define HAVE_BTOWC 1 > #define HAVE_COLOR 1 > @@ -58,6 +65,7 @@ > #define HAVE_NL_TYPES_H 1 > #define HAVE_PUTENV 1 > #define HAVE_RC_FILE 1 > +#define HAVE_RC_FILE2 1 > #define HAVE_SEARCH_H 1 > #define HAVE_SETENV 1 > #define HAVE_SETLOCALE 1 > @@ -93,11 +101,11 @@ > #define HAVE_WCTOMB 1 > #define HAVE_WCURSYNCUP 1 > #define HAVE_WGETPARENT 1 > +#define HAVE_WGET_WCH 1 > #define HAVE_WHIPTAIL 1 > #define HAVE_WSYNCUP 1 > #define HAVE_XDIALOG 1 > #define HAVE_XDIALOG2 1 > -#define HAVE__NC_FREE_AND_EXIT 1 > #define ICONV_CONST > #define MIXEDCASE_FILENAMES 1 > #define NCURSES 1 > @@ -105,7 +113,8 @@ > #define PACKAGE "dialog" > #define RETSIGTYPE void > #define STDC_HEADERS 1 > -#define SYSTEM_NAME "freebsd12.0" > +#define SYSTEM_NAME "FreeBSD" > #define TIME_WITH_SYS_TIME 1 > #define TYPE_CHTYPE_IS_SCALAR 1 > #define USE_WIDE_CURSES 1 > +#define WIDEC_CURSES 1 From owner-dev-commits-src-all@freebsd.org Mon Mar 1 15:01:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93E7F5606EC; Mon, 1 Mar 2021 15:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq3Pt3s8jz4fTt; Mon, 1 Mar 2021 15:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77B17257A3; Mon, 1 Mar 2021 15:01: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 121F1sX6017445; Mon, 1 Mar 2021 15:01:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121F1soq017444; Mon, 1 Mar 2021 15:01:54 GMT (envelope-from git) Date: Mon, 1 Mar 2021 15:01:54 GMT Message-Id: <202103011501.121F1soq017444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 95da5e131a0a - main - dialog: fix macro redefinition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95da5e131a0a9e48f0a063e3ff75000434cc5c52 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 15:01:54 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=95da5e131a0a9e48f0a063e3ff75000434cc5c52 commit 95da5e131a0a9e48f0a063e3ff75000434cc5c52 Author: Baptiste Daroussin AuthorDate: 2021-03-01 14:58:34 +0000 Commit: Baptiste Daroussin CommitDate: 2021-03-01 15:01:44 +0000 dialog: fix macro redefinition dialog.h defines MIN and MAX (making sure to undefine the previous macros if it already exists), but sys/param.h also defines those macros (without guards) and is included after dialog.h resulting in both gcc and clang complaining about macro redefiniton While clang do accept -Wno-macro-redefined to ignore the redefinition warning, gcc does not [1] Undefine both macros prior inclusion of sys/param.h to avoid the warning Reported by: arichardson --- contrib/dialog/util.c | 2 ++ gnu/lib/libdialog/Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/dialog/util.c b/contrib/dialog/util.c index 992be3f433f5..726a36a5031d 100644 --- a/contrib/dialog/util.c +++ b/contrib/dialog/util.c @@ -39,6 +39,8 @@ #endif #ifdef HAVE_SYS_PARAM_H +#undef MIN +#undef MAX #include #endif diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile index 8c6b84b64f90..b97e4df9373a 100644 --- a/gnu/lib/libdialog/Makefile +++ b/gnu/lib/libdialog/Makefile @@ -15,7 +15,7 @@ MAN= dialog.3 LIBADD= ncursesw m -CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -Wno-macro-redefined +CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED .PATH: ${DIALOG} WARNS?= 1 From owner-dev-commits-src-all@freebsd.org Mon Mar 1 15:03:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 555845607DA; Mon, 1 Mar 2021 15:03:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq3R91yNnz4fkf; Mon, 1 Mar 2021 15:03:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 211103371B; Mon, 1 Mar 2021 15:03:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 911D772076; Mon, 1 Mar 2021 16:02:58 +0100 (CET) Date: Mon, 1 Mar 2021 16:02:58 +0100 From: Baptiste Daroussin To: Alexander Richardson Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ec74116ace52 - main - dialog: finish update to 1.3-20210117 Message-ID: <20210301150258.6clx2knt5i7xc7zd@aniel.nours.eu> References: <202102260917.11Q9HUnx061198@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rbvnhix2rpa5opuf" Content-Disposition: inline In-Reply-To: X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 15:03:01 -0000 --rbvnhix2rpa5opuf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 01, 2021 at 02:50:28PM +0000, Alexander Richardson wrote: > On Fri, 26 Feb 2021 at 09:17, Baptiste Daroussin wrote: > > > > The branch main has been updated by bapt: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dec74116ace52591cf121623e= 2010ae5efab5524a > > > > commit ec74116ace52591cf121623e2010ae5efab5524a > > Author: Baptiste Daroussin > > AuthorDate: 2021-02-26 09:13:13 +0000 > > Commit: Baptiste Daroussin > > CommitDate: 2021-02-26 09:17:19 +0000 > > > > dialog: finish update to 1.3-20210117 > > > > patch dialog.c which requires stddef for the usage of offsetof > > catchup on the config header > > --- > > contrib/dialog/dialog.c | 1 + > > gnu/lib/libdialog/Makefile | 2 +- > > gnu/lib/libdialog/dlg_config.h | 15 ++++++++++++--- > > 3 files changed, 14 insertions(+), 4 deletions(-) > > > > diff --git a/contrib/dialog/dialog.c b/contrib/dialog/dialog.c > > index 510baeb97add..f59c9dc03c13 100644 > > --- a/contrib/dialog/dialog.c > > +++ b/contrib/dialog/dialog.c > > @@ -26,6 +26,7 @@ > > > > #include > > > > +#include > > #include > > #include > > #include > > diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile > > index e4f1b62121d9..8c6b84b64f90 100644 > > --- a/gnu/lib/libdialog/Makefile > > +++ b/gnu/lib/libdialog/Makefile > > @@ -15,7 +15,7 @@ MAN=3D dialog.3 > > > > LIBADD=3D ncursesw m > > > > -CFLAGS+=3D -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DG= CC_UNUSED=3D__unused > > +CFLAGS+=3D -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -Wn= o-macro-redefined >=20 > This appears to have broken the GCC build: > cc1: error: unrecognized command line option '-Wno-macro-redefined' [-Wer= ror] > Probably fixable by using CFLAGS.clang? >=20 > Thanks, > Alex >=20 I have fixed the warning instead. Bapt --rbvnhix2rpa5opuf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAmA9Ah8ACgkQY4mL3PG3 PlrSrw/+KRY2aR26L6ZYr3Rnpx6XmYK9hKcrOiSc95hr95AWa8d/rYGWxE0447dR XGC+RpHY7Hn2OYK8pGDYvIXMs+opHnouEk+k4Q7LJeoBqnATfK5Azju39/B6DHg8 PlP3YvDUZHpAE8ZnkkslCHeYBCNbsO7a1ITH4TtmrXocANG3+3zSnTynwhIYWE+P j0CTPfPyyH8KsS934YQnyPJwXYaV9kzxsujDndfsfV6HMJqFZZyqaZ//8dj9cwSz D9FSehF7kbhge+86kvr5eUgHs2VFY5pto+186sb3ZMPOGgpYWH8OG3PmD1scSxz8 VnAx6rC7Gn3px41+gKlAIzL/QlojfGE6hCHWWjxhOph9TClTuSRbW5dkg6OujFk4 ONNsH6CaEZBZvWk0yDlhKcKU2+dFmf65xR8k99cRgBK2ZL2iyuwv3FcW9/zBdiEB 0YJbzaifc2wo2CH4K4r/eQBqiAPx5iAXN1XQNmNdvyP4k2HSAu9UaJNTCQUT/t+y RCSPVW0uBuOZnXnBOLbIJNe/Ct4zAbAXXHNFblYsPZX+jGA3vSYbERCoOWnlL6+1 74KghC4cSzH1PDKQJmcytatRgdFVSmwFHyEdQfvah6VUkI6q7p0glUOoEhNDBBZL kbPzGy/9wuCBJzHvYLVmP0qNkxddtJUf0b+Uu6Rnh5cOiHitaE8= =1ael -----END PGP SIGNATURE----- --rbvnhix2rpa5opuf-- From owner-dev-commits-src-all@freebsd.org Mon Mar 1 15:19:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AE07560F27; Mon, 1 Mar 2021 15:19: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 4Dq3pd28zBz4gcN; Mon, 1 Mar 2021 15:19: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 3D4ED25BA9; Mon, 1 Mar 2021 15:19: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 121FJrTU033343; Mon, 1 Mar 2021 15:19:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121FJrG1033342; Mon, 1 Mar 2021 15:19:53 GMT (envelope-from git) Date: Mon, 1 Mar 2021 15:19:53 GMT Message-Id: <202103011519.121FJrG1033342@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: 066dab17e7a4 - main - riscv: Fix whitespace issues in fabs added in 524b018d2004 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: 066dab17e7a4a78d43dbcef8119960ddc8090a73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 15:19:53 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=066dab17e7a4a78d43dbcef8119960ddc8090a73 commit 066dab17e7a4a78d43dbcef8119960ddc8090a73 Author: Jessica Clarke AuthorDate: 2021-03-01 14:01:13 +0000 Commit: Jessica Clarke CommitDate: 2021-03-01 15:19:36 +0000 riscv: Fix whitespace issues in fabs added in 524b018d2004 --- lib/libc/riscv/gen/fabs.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/riscv/gen/fabs.S b/lib/libc/riscv/gen/fabs.S index 09042af3b4c0..036d50eddf90 100644 --- a/lib/libc/riscv/gen/fabs.S +++ b/lib/libc/riscv/gen/fabs.S @@ -43,8 +43,8 @@ ENTRY(fabs) #ifdef __riscv_float_abi_double fabs.d fa0, fa0 #else - slli a0,a0,1 - srli a0,a0,1 + slli a0, a0, 1 + srli a0, a0, 1 #endif ret END(fabs) From owner-dev-commits-src-all@freebsd.org Mon Mar 1 15:52:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD628562936; Mon, 1 Mar 2021 15: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 4Dq4Xp3F2nz4lqF; Mon, 1 Mar 2021 15: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 3FD832658F; Mon, 1 Mar 2021 15: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 121Fqw7f084291; Mon, 1 Mar 2021 15: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 121Fqw7m084290; Mon, 1 Mar 2021 15:52:58 GMT (envelope-from git) Date: Mon, 1 Mar 2021 15:52:58 GMT Message-Id: <202103011552.121Fqw7m084290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 0b0f8b359d0b - main - calculate prr_out correctly when pipe < ssthresh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b0f8b359d0b94b09cfec35e5d5de01b23c7fbf1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 15:52:58 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=0b0f8b359d0b94b09cfec35e5d5de01b23c7fbf1 commit 0b0f8b359d0b94b09cfec35e5d5de01b23c7fbf1 Author: Richard Scheffenegger AuthorDate: 2021-03-01 15:25:46 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-01 15:26:05 +0000 calculate prr_out correctly when pipe < ssthresh Reviewed By: #transport, tuexen MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28998 --- sys/netinet/tcp_input.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index d802bc8f47ae..eda41d36ab88 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2600,10 +2600,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); else limit = imax(tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit, + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)), del_data) + maxseg; snd_cnt = imin(tp->snd_ssthresh - pipe, limit); } @@ -3976,10 +3978,12 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); else limit = imax(tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit, + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)), del_data) + maxseg; snd_cnt = imin((tp->snd_ssthresh - pipe), limit); } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 16:39:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 999D156418F; Mon, 1 Mar 2021 16:39:50 +0000 (UTC) (envelope-from nwhitehorn@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 4Dq5Zt3lRrz4vRn; Mon, 1 Mar 2021 16:39:50 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:85ea:d09e:32a:9875]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1E34F34179; Mon, 1 Mar 2021 16:39:50 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Brandon Bergren , Warner Losh , Kevin Bowling Cc: Jessica Clarke , Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> From: Nathan Whitehorn Message-ID: Date: Mon, 1 Mar 2021 11:39:49 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 16:39:50 -0000 On 2/28/21 3:44 PM, Brandon Bergren wrote: > > On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: >> Yes. I agree as well. I was just hoping to say just that: EFI is barely >> theoretically possible, but in reality we'll likely never use it.... >> >> The net effect is that we don't want to install efi on powerpc on freebsd. >> >> Warner >> > Yeah. The code before the change excluded mips and powerpc platforms, and it should continue to do so instead of using the existence of a /boot/efi directory as the only clue. > > Currently bsdinstall bails out and leaves powerpc* in a half-installed state because the die in the uname case propagates to the main script, so it never runs the bits after the bootconfig. > So that was a deliberate choice to keep the list of places that know about efi vs. non-EFI centralized. I'd prefer to just not make that directory on systems where it doesn't apply rather than messing with the installer. Do you know where it is being made? -Nathan From owner-dev-commits-src-all@freebsd.org Mon Mar 1 16:42:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40258563F71; Mon, 1 Mar 2021 16:42:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq5dz14gBz3C3r; Mon, 1 Mar 2021 16:42:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 13B0134830; Mon, 1 Mar 2021 16:42:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f176.google.com with SMTP id q85so17141676qke.8; Mon, 01 Mar 2021 08:42:31 -0800 (PST) X-Gm-Message-State: AOAM530EIVPuwQwsNokl18sVFhWVFYaybeWtmWhcK+rY3suafHrNkhk9 c/CgIf8t2+ycvkGSywAdSwZjGBe0NXMNESQDH/c= X-Google-Smtp-Source: ABdhPJxnd9X2OyMAyB7ts7qSjSpIsoaggv6O5bnlxAA4Vk3NU3ceskKkreyHDbeqilyEX6wpqSl1DhHno8Jy0Vqu/II= X-Received: by 2002:a05:620a:89d:: with SMTP id b29mr5285480qka.103.1614616950665; Mon, 01 Mar 2021 08:42:30 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> In-Reply-To: From: Kyle Evans Date: Mon, 1 Mar 2021 10:42:17 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Nathan Whitehorn Cc: Brandon Bergren , Warner Losh , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 16:42:31 -0000 On Mon, Mar 1, 2021 at 10:39 AM Nathan Whitehorn wrote: > > > > On 2/28/21 3:44 PM, Brandon Bergren wrote: > > > > On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: > >> Yes. I agree as well. I was just hoping to say just that: EFI is barely > >> theoretically possible, but in reality we'll likely never use it.... > >> > >> The net effect is that we don't want to install efi on powerpc on freebsd. > >> > >> Warner > >> > > Yeah. The code before the change excluded mips and powerpc platforms, and it should continue to do so instead of using the existence of a /boot/efi directory as the only clue. > > > > Currently bsdinstall bails out and leaves powerpc* in a half-installed state because the die in the uname case propagates to the main script, so it never runs the bits after the bootconfig. > > > > So that was a deliberate choice to keep the list of places that know > about efi vs. non-EFI centralized. I'd prefer to just not make that > directory on systems where it doesn't apply rather than messing with the > installer. Do you know where it is being made? > -Nathan It's part of the hierarchy in ^/etc/mtree/BSD.root.dist From owner-dev-commits-src-all@freebsd.org Mon Mar 1 16:45:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DE1A5641C2; Mon, 1 Mar 2021 16:45:00 +0000 (UTC) (envelope-from nwhitehorn@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 4Dq5hq6svrz3C4m; Mon, 1 Mar 2021 16:44:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:85ea:d09e:32a:9875]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 873A234940; Mon, 1 Mar 2021 16:44:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Kyle Evans Cc: Brandon Bergren , Warner Losh , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> From: Nathan Whitehorn Message-ID: <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> Date: Mon, 1 Mar 2021 11:44:59 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 16:45:00 -0000 On 3/1/21 11:42 AM, Kyle Evans wrote: > On Mon, Mar 1, 2021 at 10:39 AM Nathan Whitehorn wrote: >> >> >> On 2/28/21 3:44 PM, Brandon Bergren wrote: >>> On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: >>>> Yes. I agree as well. I was just hoping to say just that: EFI is barely >>>> theoretically possible, but in reality we'll likely never use it.... >>>> >>>> The net effect is that we don't want to install efi on powerpc on freebsd. >>>> >>>> Warner >>>> >>> Yeah. The code before the change excluded mips and powerpc platforms, and it should continue to do so instead of using the existence of a /boot/efi directory as the only clue. >>> >>> Currently bsdinstall bails out and leaves powerpc* in a half-installed state because the die in the uname case propagates to the main script, so it never runs the bits after the bootconfig. >>> >> So that was a deliberate choice to keep the list of places that know >> about efi vs. non-EFI centralized. I'd prefer to just not make that >> directory on systems where it doesn't apply rather than messing with the >> installer. Do you know where it is being made? >> -Nathan > It's part of the hierarchy in ^/etc/mtree/BSD.root.dist > Is there a reason it needs to be? The installer bits all make it when needed already, so just removing it there seems like the simplest path. -Nathan From owner-dev-commits-src-all@freebsd.org Mon Mar 1 16:50:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC943564273; Mon, 1 Mar 2021 16:50:24 +0000 (UTC) (envelope-from kevans@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 4Dq5q44nJbz3CMR; Mon, 1 Mar 2021 16:50:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 8E37E34A05; Mon, 1 Mar 2021 16:50:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f54.google.com with SMTP id dj14so829331qvb.1; Mon, 01 Mar 2021 08:50:24 -0800 (PST) X-Gm-Message-State: AOAM533rheAmQNdoGEDl0x2vlYvlnkAjcDxtK4gIHAoZs/VRPy4Dy8ZZ ZumnoBE2vD4AMA7+jYC9kmXB1xkj+bqTOspnG1g= X-Google-Smtp-Source: ABdhPJxxtvD84NcW4djlS83mCTjJicYJU1oKQuYygD+jaxWl/tvsCAed5xJwDmwV81mdlHqge784reCPNtxJ87LC7HY= X-Received: by 2002:a05:6214:1424:: with SMTP id o4mr15704344qvx.34.1614617424200; Mon, 01 Mar 2021 08:50:24 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> In-Reply-To: <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> From: Kyle Evans Date: Mon, 1 Mar 2021 10:50:10 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Nathan Whitehorn Cc: Brandon Bergren , Warner Losh , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 16:50:24 -0000 On Mon, Mar 1, 2021 at 10:45 AM Nathan Whitehorn wrote: > > > > On 3/1/21 11:42 AM, Kyle Evans wrote: > > On Mon, Mar 1, 2021 at 10:39 AM Nathan Whitehorn wrote: > >> > >> > >> On 2/28/21 3:44 PM, Brandon Bergren wrote: > >>> On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: > >>>> Yes. I agree as well. I was just hoping to say just that: EFI is barely > >>>> theoretically possible, but in reality we'll likely never use it.... > >>>> > >>>> The net effect is that we don't want to install efi on powerpc on freebsd. > >>>> > >>>> Warner > >>>> > >>> Yeah. The code before the change excluded mips and powerpc platforms, and it should continue to do so instead of using the existence of a /boot/efi directory as the only clue. > >>> > >>> Currently bsdinstall bails out and leaves powerpc* in a half-installed state because the die in the uname case propagates to the main script, so it never runs the bits after the bootconfig. > >>> > >> So that was a deliberate choice to keep the list of places that know > >> about efi vs. non-EFI centralized. I'd prefer to just not make that > >> directory on systems where it doesn't apply rather than messing with the > >> installer. Do you know where it is being made? > >> -Nathan > > It's part of the hierarchy in ^/etc/mtree/BSD.root.dist > > > > Is there a reason it needs to be? The installer bits all make it when > needed already, so just removing it there seems like the simplest path. I can't think of a reason, as long as both the release(7) scripts and the installer create it as needed -- I note that vmimage.subr seems to create it itself, but arm.subr seems to get it wrong atm. It'll need to create /boot/efi for PART_SCHEME == GPT, and /boot/msdos should probably be scoped down to PART_SCHEME == MBR where it's used at the moment. From owner-dev-commits-src-all@freebsd.org Mon Mar 1 16:55:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D67A5564625; Mon, 1 Mar 2021 16:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq5x15ffjz3CbG; Mon, 1 Mar 2021 16:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4F7426FCD; Mon, 1 Mar 2021 16:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121GtXjj063968; Mon, 1 Mar 2021 16:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121GtX1M063966; Mon, 1 Mar 2021 16:55:33 GMT (envelope-from git) Date: Mon, 1 Mar 2021 16:55:33 GMT Message-Id: <202103011655.121GtX1M063966@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: af11c2029006 - main - Cirrus-CI: show mounted filesystems and free space at start 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: af11c2029006b64da41a78f2e2dcc910e13ce07a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 16:55:33 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=af11c2029006b64da41a78f2e2dcc910e13ce07a commit af11c2029006b64da41a78f2e2dcc910e13ce07a Author: Ed Maste AuthorDate: 2021-03-01 03:07:05 +0000 Commit: Ed Maste CommitDate: 2021-03-01 16:54:37 +0000 Cirrus-CI: show mounted filesystems and free space at start CI runs have been encountering disk full errors. Add a `df` invocation so that we can see what we're working with. --- .cirrus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index c577ca8aeca3..e34b99523561 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,7 +14,8 @@ task: timeout_in: 120m install_script: - pkg install -y qemu42 uefi-edk2-qemu-x86_64 llvm11 - setup_user_script: + setup_script: + - df -h - pw useradd user - mkdir -p /usr/obj/$(pwd -P) - chown user:user /usr/obj/$(pwd -P) From owner-dev-commits-src-all@freebsd.org Mon Mar 1 16:56:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35991564721; Mon, 1 Mar 2021 16:56:41 +0000 (UTC) (envelope-from nwhitehorn@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 4Dq5yK0tFMz3D3Q; Mon, 1 Mar 2021 16:56:41 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:85ea:d09e:32a:9875]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id ADF0E34B76; Mon, 1 Mar 2021 16:56:40 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Kyle Evans Cc: Brandon Bergren , Warner Losh , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> From: Nathan Whitehorn Message-ID: <6a409997-24b7-1e25-33b6-a866c3790c5a@freebsd.org> Date: Mon, 1 Mar 2021 11:56:40 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 16:56:41 -0000 On 3/1/21 11:50 AM, Kyle Evans wrote: > On Mon, Mar 1, 2021 at 10:45 AM Nathan Whitehorn wrote: >> >> >> On 3/1/21 11:42 AM, Kyle Evans wrote: >>> On Mon, Mar 1, 2021 at 10:39 AM Nathan Whitehorn wrote: >>>> >>>> On 2/28/21 3:44 PM, Brandon Bergren wrote: >>>>> On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: >>>>>> Yes. I agree as well. I was just hoping to say just that: EFI is barely >>>>>> theoretically possible, but in reality we'll likely never use it.... >>>>>> >>>>>> The net effect is that we don't want to install efi on powerpc on freebsd. >>>>>> >>>>>> Warner >>>>>> >>>>> Yeah. The code before the change excluded mips and powerpc platforms, and it should continue to do so instead of using the existence of a /boot/efi directory as the only clue. >>>>> >>>>> Currently bsdinstall bails out and leaves powerpc* in a half-installed state because the die in the uname case propagates to the main script, so it never runs the bits after the bootconfig. >>>>> >>>> So that was a deliberate choice to keep the list of places that know >>>> about efi vs. non-EFI centralized. I'd prefer to just not make that >>>> directory on systems where it doesn't apply rather than messing with the >>>> installer. Do you know where it is being made? >>>> -Nathan >>> It's part of the hierarchy in ^/etc/mtree/BSD.root.dist >>> >> Is there a reason it needs to be? The installer bits all make it when >> needed already, so just removing it there seems like the simplest path. > I can't think of a reason, as long as both the release(7) scripts and > the installer create it as needed -- I note that vmimage.subr seems to > create it itself, but arm.subr seems to get it wrong atm. It'll need > to create /boot/efi for PART_SCHEME == GPT, and /boot/msdos should > probably be scoped down to PART_SCHEME == MBR where it's used at the > moment. > I can take a look at arm.subr today. Everywhere else (the installer and vmimage.subr) create it already, since I didn't realize it was part of mtree. -Nathan From owner-dev-commits-src-all@freebsd.org Mon Mar 1 17:24:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC78D56598A for ; Mon, 1 Mar 2021 17:24:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 4Dq6Zv5cR8z3GBn for ; Mon, 1 Mar 2021 17:24:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x836.google.com with SMTP id 2so3512384qtw.1 for ; Mon, 01 Mar 2021 09:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vB8sWkJ6mWtwfb+ywf/YDRbHtUOAArg1rmqQRWL2qjc=; b=rsqppuwpuVyp/yvvmbiNTujaxPCOrGIXkSzBfZPpJUDFSoq3tQZQ8tCBKiGuQH6Kfw r3G/bec6bNJrYsYvQ6QKAqSwdey6on6Ksijj45UfwGmkiGT/a2EZjTb6C9vQhQCYkgr+ Wg6U3nqSK/D5ZKkd8STDWwE5w5od9TUC23KJ0py4kwWpqgZSE58lYIoyttLlamNZh0hv +UDadOKwE6fFlySpsRkwXnOvF7ZhLa7xRmZlXL+nek0t0n/T8i/p5fZgENMrrZOeklTp i1egkeF2i1swLINigAAHxMOu76mHNp9/tdqu14bCTKCRTg6Qx04noAO/k7ZNQXo9xzsq EDTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vB8sWkJ6mWtwfb+ywf/YDRbHtUOAArg1rmqQRWL2qjc=; b=OjlHSPk9mDodjeylEHai4nqv0QiPRqimc/Z2ugmqTJPGvMPPOs/Naqj/yi+y3Tl/6S 05pUHeOQRMG9jnUlSOMgej6uyIgNYmshSB0SwNqkXnaJbg6eVHesdR9p5jM9m9NRERfO PajM7wtmwuz+6st0z5zRPPfCEjhjx/MxZ94GI+ZCr9Y+wUOI0Yzi8ZklgQgFGBqZTZKC wSe5IL1+uf9f7WFUn92LwuMgRHScWHHajshMW6gewFqqmOvFknypQGP36Ao//ZMadxfe DOMViEsh9wsWG1pcNDilsWsf9p7PfRhkukmX8CFhimRIWCbBoBBVqYQ6eWTJUaK0qwOH 3rBg== X-Gm-Message-State: AOAM533F7h7DyMD6R/XCPBPEeORzRUGS4uZT/cSJD6lWQtbdy7Hm5Eif JPFoDd6dfZP7+WzReDowzO7nkmzjLWtn4eUhy1ZTAw== X-Google-Smtp-Source: ABdhPJy9y7wtaDh559vd7SHBARfgzijpD1GxMnNJJPXf9H3IKB3UDLxUtoh+/WYrxlLP2hdczh+jAqHEsmL9/hXyr78= X-Received: by 2002:a05:622a:1c9:: with SMTP id t9mr14440370qtw.244.1614619494757; Mon, 01 Mar 2021 09:24:54 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 1 Mar 2021 10:24:43 -0700 Message-ID: Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Kyle Evans Cc: Nathan Whitehorn , Brandon Bergren , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Dq6Zv5cR8z3GBn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 17:24:56 -0000 On Mon, Mar 1, 2021 at 9:50 AM Kyle Evans wrote: > On Mon, Mar 1, 2021 at 10:45 AM Nathan Whitehorn > wrote: > > > > > > > > On 3/1/21 11:42 AM, Kyle Evans wrote: > > > On Mon, Mar 1, 2021 at 10:39 AM Nathan Whitehorn < > nwhitehorn@freebsd.org> wrote: > > >> > > >> > > >> On 2/28/21 3:44 PM, Brandon Bergren wrote: > > >>> On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: > > >>>> Yes. I agree as well. I was just hoping to say just that: EFI is > barely > > >>>> theoretically possible, but in reality we'll likely never use it.... > > >>>> > > >>>> The net effect is that we don't want to install efi on powerpc on > freebsd. > > >>>> > > >>>> Warner > > >>>> > > >>> Yeah. The code before the change excluded mips and powerpc > platforms, and it should continue to do so instead of using the existence > of a /boot/efi directory as the only clue. > > >>> > > >>> Currently bsdinstall bails out and leaves powerpc* in a > half-installed state because the die in the uname case propagates to the > main script, so it never runs the bits after the bootconfig. > > >>> > > >> So that was a deliberate choice to keep the list of places that know > > >> about efi vs. non-EFI centralized. I'd prefer to just not make that > > >> directory on systems where it doesn't apply rather than messing with > the > > >> installer. Do you know where it is being made? > > >> -Nathan > > > It's part of the hierarchy in ^/etc/mtree/BSD.root.dist > > > > > > > Is there a reason it needs to be? The installer bits all make it when > > needed already, so just removing it there seems like the simplest path. > > I can't think of a reason, as long as both the release(7) scripts and > the installer create it as needed -- I note that vmimage.subr seems to > create it itself, but arm.subr seems to get it wrong atm. It'll need > to create /boot/efi for PART_SCHEME == GPT, and /boot/msdos should > probably be scoped down to PART_SCHEME == MBR where it's used at the > moment. > I think that it should be /boot/efi for both, with a symlink from /boot/msdos to /boot/efi so we can migrate away from that old scheme... Warner From owner-dev-commits-src-all@freebsd.org Mon Mar 1 17:54:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0071566584; Mon, 1 Mar 2021 17:54:01 +0000 (UTC) (envelope-from nwhitehorn@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 4Dq7DT6MlCz3HSd; Mon, 1 Mar 2021 17:54:01 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:85ea:d09e:32a:9875]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 7407734F9E; Mon, 1 Mar 2021 17:54:01 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) To: Kyle Evans Cc: Brandon Bergren , Warner Losh , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> From: Nathan Whitehorn Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. Message-ID: Date: Mon, 1 Mar 2021 12:54:00 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 17:54:02 -0000 On 3/1/21 11:50 AM, Kyle Evans wrote: > On Mon, Mar 1, 2021 at 10:45 AM Nathan Whitehorn wrote: >> >> >> On 3/1/21 11:42 AM, Kyle Evans wrote: >>> On Mon, Mar 1, 2021 at 10:39 AM Nathan Whitehorn wrote: >>>> >>>> On 2/28/21 3:44 PM, Brandon Bergren wrote: >>>>> On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: >>>>>> Yes. I agree as well. I was just hoping to say just that: EFI is b= arely >>>>>> theoretically possible, but in reality we'll likely never use it..= =2E. >>>>>> >>>>>> The net effect is that we don't want to install efi on powerpc on = freebsd. >>>>>> >>>>>> Warner >>>>>> >>>>> Yeah. The code before the change excluded mips and powerpc platform= s, and it should continue to do so instead of using the existence of a /b= oot/efi directory as the only clue. >>>>> >>>>> Currently bsdinstall bails out and leaves powerpc* in a half-instal= led state because the die in the uname case propagates to the main script= , so it never runs the bits after the bootconfig. >>>>> >>>> So that was a deliberate choice to keep the list of places that know= >>>> about efi vs. non-EFI centralized. I'd prefer to just not make that >>>> directory on systems where it doesn't apply rather than messing with= the >>>> installer. Do you know where it is being made? >>>> -Nathan >>> It's part of the hierarchy in ^/etc/mtree/BSD.root.dist >>> >> Is there a reason it needs to be? The installer bits all make it when >> needed already, so just removing it there seems like the simplest path= =2E > I can't think of a reason, as long as both the release(7) scripts and > the installer create it as needed -- I note that vmimage.subr seems to > create it itself, but arm.subr seems to get it wrong atm. It'll need > to create /boot/efi for PART_SCHEME =3D=3D GPT, and /boot/msdos should > probably be scoped down to PART_SCHEME =3D=3D MBR where it's used at th= e > moment. > The /boot/uboot in BSD.root.dist also looks like cruft to me, but maybe=20 best to leave for now? -Nathan From owner-dev-commits-src-all@freebsd.org Mon Mar 1 18:28:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DCB65674E9; Mon, 1 Mar 2021 18:28:34 +0000 (UTC) (envelope-from bdragon@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 4Dq80L0tC8z3Kpq; Mon, 1 Mar 2021 18:28:34 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0A12635491; Mon, 1 Mar 2021 18:28:34 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 586B827C0054; Mon, 1 Mar 2021 13:28:33 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Mon, 01 Mar 2021 13:28:33 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleekgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder reejnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepjefhfedtuddtleegkeeg tdegjeekffdvjedttdehgffgveeugffgfeelvdeghffgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsggurhgrghhonhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddtgedvfeehkeeigedqudekuddtkeehuddqsggurh grghhonheppefhrhgvvgeuufffrdhorhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 99480CA005D; Mon, 1 Mar 2021 13:28:32 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd Mime-Version: 1.0 Message-Id: In-Reply-To: References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> Date: Mon, 01 Mar 2021 12:28:12 -0600 From: "Brandon Bergren" To: "Nathan Whitehorn" , "Kyle Evans" Cc: "Warner Losh" , "Kevin Bowling" , "Jessica Clarke" , "Colin Percival" , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_0b7472b3d8d2_-_main_-_Mount_the_EFI_system_partition_?= =?UTF-8?Q?(ESP)_on_newly-installed_systems.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 18:28:34 -0000 On Mon, Mar 1, 2021, at 11:54 AM, Nathan Whitehorn wrote: > The /boot/uboot in BSD.root.dist also looks like cruft to me, but maybe > best to leave for now? > -Nathan It's used on Book-E powerpc* in some cases (and the bootloader is compiled and installed there by default on powerpc*) but it's a regular directory. I don't believe there's any custom behavior to treat it as a mount point because setting up booting is a machine specific thing in this case, and the user is expected to do something like copy it to the boot server or a partition on the bootstrap media. For example, on the X5000, the boot firmware is stored on an onboard SD card that has space left to install loaders and stuff, but this is something that is set up by hand. -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Mon Mar 1 18:38:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A2DD567D52; Mon, 1 Mar 2021 18:38: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 4Dq8D519lnz3M7F; Mon, 1 Mar 2021 18:38: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 1B0B2374; Mon, 1 Mar 2021 18:38: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 121Icjwn096414; Mon, 1 Mar 2021 18:38:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121IciVK096411; Mon, 1 Mar 2021 18:38:44 GMT (envelope-from git) Date: Mon, 1 Mar 2021 18:38:44 GMT Message-Id: <202103011838.121IciVK096411@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: 60c4ec806dfd - main - jail: allow root to implicitly widen its cpuset to attach 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: 60c4ec806dfd0f79edf8ca3abc04bbb69c0418f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 18:38:45 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=60c4ec806dfd0f79edf8ca3abc04bbb69c0418f7 commit 60c4ec806dfd0f79edf8ca3abc04bbb69c0418f7 Author: Kyle Evans AuthorDate: 2021-02-26 21:46:47 +0000 Commit: Kyle Evans CommitDate: 2021-03-01 18:38:31 +0000 jail: allow root to implicitly widen its cpuset to attach The default behavior for attaching processes to jails is that the jail's cpuset augments the attaching processes, so that it cannot be used to escalate a user's ability to take advantage of more CPUs than the administrator wanted them to. This is problematic when root needs to manage jails that have disjoint sets with whatever process is attaching, as this would otherwise result in a deadlock. Therefore, if we did not have an appropriate common subset of cpus/domains for our new policy, we now allow the process to simply take on the jail set *if* it has the privilege to widen its mask anyways. With the new logic, root can still usefully cpuset a process that attaches to a jail with the desire of maintaining the set it was given pre-attachment while still retaining the ability to manage child jails without jumping through hoops. A test has been added to demonstrate the issue; cpuset of a process down to just the first CPU and attempting to attach to a jail without access to any of the same CPUs previously resulted in EDEADLK and now results in taking on the jail's mask for privileged users. PR: 253724 Reviewed by: jamie (also discussed with) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28952 --- lib/libc/tests/sys/cpuset_test.c | 203 ++++++++++++++++++++++++++++++++++++++- sys/kern/kern_cpuset.c | 8 ++ 2 files changed, 210 insertions(+), 1 deletion(-) diff --git a/lib/libc/tests/sys/cpuset_test.c b/lib/libc/tests/sys/cpuset_test.c index d6dd69e7e3c1..52c0dc877ab8 100644 --- a/lib/libc/tests/sys/cpuset_test.c +++ b/lib/libc/tests/sys/cpuset_test.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2020 Kyle Evans + * Copyright (c) 2020-2021 Kyle Evans * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD"); #include #include #include +#include +#include #include #include #include @@ -64,6 +66,10 @@ typedef void (*jail_test_cb)(struct jail_test_cb_params *); #define FAILURE_JAILSET 44 #define FAILURE_PIDSET 45 #define FAILURE_SEND 46 +#define FAILURE_DEADLK 47 +#define FAILURE_ATTACH 48 +#define FAILURE_BADAFFIN 49 +#define FAILURE_SUCCESS 50 static const char * do_jail_errstr(int error) @@ -80,6 +86,14 @@ do_jail_errstr(int error) return ("Failed to get the pid setid"); case FAILURE_SEND: return ("Failed to send(2) cpuset information"); + case FAILURE_DEADLK: + return ("Deadlock hit trying to attach to jail"); + case FAILURE_ATTACH: + return ("jail_attach(2) failed"); + case FAILURE_BADAFFIN: + return ("Unexpected post-attach affinity"); + case FAILURE_SUCCESS: + return ("jail_attach(2) succeeded, but should have failed."); default: return (NULL); } @@ -444,6 +458,192 @@ ATF_TC_BODY(jail_attach_plain, tc) do_jail_test(1, false, &jail_attach_plain_pro, &jail_attach_jset_epi); } +static int +jail_attach_disjoint_newjail(int fd) +{ + struct iovec iov[2]; + char *name; + int jid; + + if (asprintf(&name, "cpuset_%d", getpid()) == -1) + _exit(42); + + iov[0].iov_base = "name"; + iov[0].iov_len = sizeof("name"); + + iov[1].iov_base = name; + iov[1].iov_len = strlen(name) + 1; + + if ((jid = jail_set(iov, 2, JAIL_CREATE | JAIL_ATTACH)) < 0) + return (FAILURE_JAIL); + + /* Signal that we're ready. */ + write(fd, &jid, sizeof(jid)); + for (;;) { + /* Spin */ + } +} + +static int +wait_jail(int fd, int pfd) +{ + fd_set lset; + struct timeval tv; + int error, jid, maxfd; + + FD_ZERO(&lset); + FD_SET(fd, &lset); + FD_SET(pfd, &lset); + + maxfd = MAX(fd, pfd); + + tv.tv_sec = 5; + tv.tv_usec = 0; + + /* Wait for jid to be written. */ + do { + error = select(maxfd + 1, &lset, NULL, NULL, &tv); + } while (error == -1 && errno == EINTR); + + if (error == 0) { + atf_tc_fail("Jail creator did not respond in time."); + } + + ATF_REQUIRE_MSG(error > 0, "Unexpected error %d from select()", errno); + + if (FD_ISSET(pfd, &lset)) { + /* Process died */ + atf_tc_fail("Jail creator died unexpectedly."); + } + + ATF_REQUIRE(FD_ISSET(fd, &lset)); + ATF_REQUIRE_EQ(sizeof(jid), recv(fd, &jid, sizeof(jid), 0)); + + return (jid); +} + +static int +try_attach_child(int jid, cpuset_t *expected_mask) +{ + cpuset_t mask; + + if (jail_attach(jid) == -1) { + if (errno == EDEADLK) + return (FAILURE_DEADLK); + return (FAILURE_ATTACH); + } + + if (expected_mask == NULL) + return (FAILURE_SUCCESS); + + /* If we had an expected mask, check it against the new process mask. */ + CPU_ZERO(&mask); + if (cpuset_getaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, + -1, sizeof(mask), &mask) != 0) { + return (FAILURE_MASK); + } + + if (CPU_CMP(expected_mask, &mask) != 0) + return (FAILURE_BADAFFIN); + + return (0); +} + +static void +try_attach(int jid, cpuset_t *expected_mask) +{ + const char *errstr; + pid_t pid; + int error, fail, status; + + ATF_REQUIRE(expected_mask != NULL); + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) + _exit(try_attach_child(jid, expected_mask)); + + while ((error = waitpid(pid, &status, 0)) == -1 && errno == EINTR) { + /* Try again. */ + } + + /* Sanity check the exit info. */ + ATF_REQUIRE_EQ(pid, error); + ATF_REQUIRE(WIFEXITED(status)); + if ((fail = WEXITSTATUS(status)) != 0) { + errstr = do_jail_errstr(fail); + if (errstr != NULL) + atf_tc_fail("%s", errstr); + else + atf_tc_fail("Unknown error '%d'", WEXITSTATUS(status)); + } +} + +ATF_TC(jail_attach_disjoint); +ATF_TC_HEAD(jail_attach_disjoint, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test root attachment into completely disjoint jail cpuset."); + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(jail_attach_disjoint, tc) +{ + cpuset_t smask, jmask; + int sockpair[2]; + cpusetid_t setid; + pid_t pid; + int fcpu, jid, pfd, sock, scpu; + + ATF_REQUIRE_EQ(0, cpuset(&setid)); + + skip_ltncpu(2, &jmask); + fcpu = CPU_FFS(&jmask) - 1; + ATF_REQUIRE_EQ(0, socketpair(PF_UNIX, SOCK_STREAM, 0, sockpair)); + + /* We'll wait on the procdesc, too, so we can fail faster if it dies. */ + ATF_REQUIRE((pid = pdfork(&pfd, 0)) != -1); + + if (pid == 0) { + /* First child sets up the jail. */ + sock = sockpair[SP_CHILD]; + close(sockpair[SP_PARENT]); + + _exit(jail_attach_disjoint_newjail(sock)); + } + + close(sockpair[SP_CHILD]); + sock = sockpair[SP_PARENT]; + + ATF_REQUIRE((jid = wait_jail(sock, pfd)) > 0); + + /* + * This process will be clamped down to the first cpu, while the jail + * will simply have the first CPU removed to make it a completely + * disjoint operation. + */ + CPU_ZERO(&smask); + CPU_SET(fcpu, &smask); + CPU_CLR(fcpu, &jmask); + + /* + * We'll test with the first and second cpu set as well. Only the + * second cpu should be used. + */ + scpu = CPU_FFS(&jmask) - 1; + + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_ROOT, CPU_WHICH_JAIL, + jid, sizeof(jmask), &jmask)); + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_CPUSET, + setid, sizeof(smask), &smask)); + + try_attach(jid, &jmask); + + CPU_SET(scpu, &smask); + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_CPUSET, + setid, sizeof(smask), &smask)); + + CPU_CLR(fcpu, &smask); + try_attach(jid, &smask); +} + ATF_TC(badparent); ATF_TC_HEAD(badparent, tc) { @@ -488,6 +688,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, jail_attach_newbase_plain); ATF_TP_ADD_TC(tp, jail_attach_prevbase); ATF_TP_ADD_TC(tp, jail_attach_plain); + ATF_TP_ADD_TC(tp, jail_attach_disjoint); ATF_TP_ADD_TC(tp, badparent); return (atf_no_error()); } diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 18cc0c56d697..19ad3fd20955 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -1255,6 +1255,11 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, * as the parent, then we'll check if the process was previously using * the root set and, if it wasn't, create a new base with the process's * mask applied to it. + * + * If the new root is incompatible with the existing mask, then we allow + * the process to take on the new root if and only if they have + * privilege to widen their mask anyways. Unprivileged processes get + * rejected with EDEADLK. */ if (set != NULL && rebase && nroot != tdroot) { cpusetid_t base_id, root_id; @@ -1265,6 +1270,9 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, if (base_id != root_id) { error = cpuset_setproc_newbase(td, set, nroot, &base, &freelist, &domainlist); + if (error == EDEADLK && + priv_check(td, PRIV_SCHED_CPUSET) == 0) + error = 0; if (error != 0) goto unlock_out; } From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74227548644; Mon, 1 Mar 2021 19:00: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 4Dq8j32wHlz3NV0; Mon, 1 Mar 2021 19:00: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 570E19D2; Mon, 1 Mar 2021 19:00: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 121J0N7H030726; Mon, 1 Mar 2021 19:00:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0NTL030725; Mon, 1 Mar 2021 19:00:23 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:23 GMT Message-Id: <202103011900.121J0NTL030725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 84c6bae8db2e - releng/13.0 - acpi: limit the AMDI0020/AMDI0010 workaround to an option 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 84c6bae8db2e0ae98e321f928364b61a7a13cda5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:23 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=84c6bae8db2e0ae98e321f928364b61a7a13cda5 commit 84c6bae8db2e0ae98e321f928364b61a7a13cda5 Author: Warner Losh AuthorDate: 2021-02-08 21:43:25 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:58:52 +0000 acpi: limit the AMDI0020/AMDI0010 workaround to an option It appears that production versions of EPYC firmware get the _STA method right for these nodes. In fact, this workaround breaks on production hardware by including too many uart nodes. This work around was for pre-release hardware that wound up not having a large deployment. Move this work around to a kernel option since the machines that needed it have been powered off and are difficult to resurrect. Should there be a more significant deployment than is understood, we can restrict it based on smbios strings. Discussed with: mmacy@, seanc@, jhb@ MFC After: 3 days Approved by: re@ (gjb) (cherry picked from commit 35af933173d516101f4c44af328fbe2d6e587869) (cherry picked from commit a60c5de933e1516f65ead98b0ee141224ad607f4) --- sys/conf/options | 1 + sys/dev/acpica/acpi.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sys/conf/options b/sys/conf/options index 77979b72fe58..2f324143c574 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -705,6 +705,7 @@ ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h DEV_ACPI opt_acpi.h +ACPI_EARLY_EPYC_WAR opt_acpi.h # options for IOMMU support IOMMU opt_iommu.h diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 04c8c1b27625..18623a6ab240 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2273,6 +2273,8 @@ acpi_DeviceIsPresent(device_t dev) h = acpi_get_handle(dev); if (h == NULL) return (FALSE); + +#ifdef ACPI_EARLY_EPYC_WAR /* * Certain Treadripper boards always returns 0 for FreeBSD because it * only returns non-zero for the OS string "Windows 2015". Otherwise it @@ -2281,6 +2283,7 @@ acpi_DeviceIsPresent(device_t dev) */ if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) return (TRUE); +#endif status = acpi_GetInteger(h, "_STA", &s); From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 875155485A8; Mon, 1 Mar 2021 19:00: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 4Dq8j43T4Vz3NV1; Mon, 1 Mar 2021 19:00: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 6A8F5B92; Mon, 1 Mar 2021 19:00: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 121J0Oae030749; Mon, 1 Mar 2021 19:00:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0O4G030748; Mon, 1 Mar 2021 19:00:24 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:24 GMT Message-Id: <202103011900.121J0O4G030748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5a1ecfa5a986 - releng/13.0 - hid: bump HID_ITEM_MAXUSAGES to 8 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5a1ecfa5a986b888c5d6c8c38383ad38d2adb03a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:24 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5a1ecfa5a986b888c5d6c8c38383ad38d2adb03a commit 5a1ecfa5a986b888c5d6c8c38383ad38d2adb03a Author: Warner Losh AuthorDate: 2021-02-08 19:29:20 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:13 +0000 hid: bump HID_ITEM_MAXUSAGES to 8 My YOGA requires a minimum of 7 to parse w/o an error. Since the memory savings are trivial and the yoga a popular system, bump the default up to 8. There's no API/ABI issues in doing this. This hid_item struct isn't exported to userland and the one libusbhid has is different and only shares a name... MFC After: 3 days Reviewed by: wulf@ Differential Revision: https://reviews.freebsd.org/D28543 Approved by: re@ (gjb) (cherry picked from commit db2f512381ac3c0c227f5c0354690bb929dcac17) (cherry picked from commit 0dc5c9467b5bbcf26a8232553a1c213bb95ce635) --- sys/dev/hid/hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index e88cbba04d9a..37ab8c9cdf7e 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -189,7 +189,7 @@ #if defined(_KERNEL) || defined(_STANDALONE) -#define HID_ITEM_MAXUSAGE 4 +#define HID_ITEM_MAXUSAGE 8 #define HID_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ #define HID_PNP_ID_SIZE 20 /* includes null terminator */ From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC1C454857E; Mon, 1 Mar 2021 19:00: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 4Dq8j55HX7z3NV6; Mon, 1 Mar 2021 19:00: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 99C4C95D; Mon, 1 Mar 2021 19:00: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 121J0Pva030767; Mon, 1 Mar 2021 19:00:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0PYD030766; Mon, 1 Mar 2021 19:00:25 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:25 GMT Message-Id: <202103011900.121J0PYD030766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5eabef5a8223 - releng/13.0 - Giant: move back Giant removal until 14 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5eabef5a82232aa4346c2059b113c608420a1f9f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:26 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5eabef5a82232aa4346c2059b113c608420a1f9f commit 5eabef5a82232aa4346c2059b113c608420a1f9f Author: Warner Losh AuthorDate: 2021-02-17 16:28:41 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:18 +0000 Giant: move back Giant removal until 14 Update the Giant Lock warning message to FreeBSD 14. It's growing increasling clear that this won't be done before 13.0. MFC: Insta (re@'s request) Approved by: re@ (gjb) (cherry picked from commit 00065c7630c25850298dd3ba6919c2d3628e8ad9) (cherry picked from commit d2fb8eb1472ccc1b2175238f7668816544bf15f7) --- sys/kern/kern_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 5211422199bb..29103f83c049 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -667,7 +667,7 @@ prep_cdevsw(struct cdevsw *devsw, int flags) if (devsw->d_flags & D_NEEDGIANT) { printf("WARNING: Device \"%s\" is Giant locked and may be " - "deleted before FreeBSD 13.0.\n", + "deleted before FreeBSD 14.0.\n", devsw->d_name == NULL ? "???" : devsw->d_name); if (devsw->d_gianttrick == NULL) { memcpy(dsw2, devsw, sizeof *dsw2); From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 559C5548708; Mon, 1 Mar 2021 19:00: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 4Dq8j661Lcz3NZJ; Mon, 1 Mar 2021 19:00: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 B044995E; Mon, 1 Mar 2021 19:00: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 121J0QWh030789; Mon, 1 Mar 2021 19:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0QMP030788; Mon, 1 Mar 2021 19:00:26 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:26 GMT Message-Id: <202103011900.121J0QMP030788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 963c8fa8b231 - releng/13.0 - boot: remove gptboot.efifat, it never should have been 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 963c8fa8b231b0313ca3c270ee32cdec49a39bd8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:27 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=963c8fa8b231b0313ca3c270ee32cdec49a39bd8 commit 963c8fa8b231b0313ca3c270ee32cdec49a39bd8 Author: Warner Losh AuthorDate: 2021-02-19 22:34:25 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:26 +0000 boot: remove gptboot.efifat, it never should have been conical hat reduction: Make sure we also remove gotboot.efifat. It was created, briefly, and shouldn't have existed in the first place. Kill it at the same place we kill boot1.efifat. Pointy Hat to: imp@ Approved by: re@ (gjb) (cherry picked from commit 8cd1b2b1a7ab55e96aaf40a401d8792f2697b274) (cherry picked from commit dd9b24be14d4311ca6056f41a2d81801d2c0fa03) --- ObsoleteFiles.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 7ebff0441581..5f4495c50ee6 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -2601,8 +2601,9 @@ OLD_FILES+=usr/bin/mklocale OLD_FILES+=usr/share/man/man1/mklocale.1.gz OLD_FILES+=usr/bin/colldef OLD_FILES+=usr/share/man/man1/colldef.1.gz -# 20190904: Remove boot1.efifat +# 20190904: Remove boot1.efifat and gptboot.efifat (which never should have been) OLD_FILES+=boot/boot1.efifat +OLD_FILES+=boot/gptboot.efifat # 20190903: pc-sysinstall(8) removed OLD_FILES+=usr/share/examples/pc-sysinstall/README OLD_FILES+=usr/share/examples/pc-sysinstall/pc-autoinstall.conf From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2238A5483B3; Mon, 1 Mar 2021 19:00: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 4Dq8j804xDz3NXS; Mon, 1 Mar 2021 19:00: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 CACE995F; Mon, 1 Mar 2021 19:00: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 121J0Rq2030811; Mon, 1 Mar 2021 19:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0RnC030810; Mon, 1 Mar 2021 19:00:27 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:27 GMT Message-Id: <202103011900.121J0RnC030810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: eb62c494bfa0 - releng/13.0 - uart: only use MSI on devices that advertise 1 MSI vector 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: eb62c494bfa0771581dae96f6ae6bdcf4d3f21b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:29 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eb62c494bfa0771581dae96f6ae6bdcf4d3f21b9 commit eb62c494bfa0771581dae96f6ae6bdcf4d3f21b9 Author: Warner Losh AuthorDate: 2021-02-17 22:08:19 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:30 +0000 uart: only use MSI on devices that advertise 1 MSI vector This updates r311987/fb1d9b7f4113d which allowed any number of vectors to be used. Since we're just attaching one instance, the meaning of more than one vector is not clear and seems to cause problems. Fall back to old methods for these cards. PR: 235016 Submitted by: David Cross Approved by: re@ (gjb) (cherry picked from commit 955b6109bb36036e9357006be42dfa89cd7cb0f2) (cherry picked from commit ef1f2056084202c554d5482af9586a8995e604d5) --- sys/dev/uart/uart_bus_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 0ed3d7f4f974..fbd1d68b88ca 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -227,10 +227,10 @@ uart_pci_attach(device_t dev) sc = device_get_softc(dev); /* - * Use MSI in preference to legacy IRQ if available. - * Whilst some PCIe UARTs support >1 MSI vector, use only the first. + * Use MSI in preference to legacy IRQ if available. However, experience + * suggests this is only reliable when one MSI vector is advertised. */ - if (pci_msi_count(dev) > 0) { + if (pci_msi_count(dev) == 1) { count = 1; if (pci_alloc_msi(dev, &count) == 0) { sc->sc_irid = 1; From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AD8454825A; Mon, 1 Mar 2021 19:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq8j975HMz3NlZ; Mon, 1 Mar 2021 19:00: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 08801B93; Mon, 1 Mar 2021 19:00: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 121J0SpC030831; Mon, 1 Mar 2021 19:00:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0SDD030830; Mon, 1 Mar 2021 19:00:28 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:28 GMT Message-Id: <202103011900.121J0SDD030830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 3e95150e8cb3 - releng/13.0 - Remove incorrect statement about EFI environment variables being unsupported. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 3e95150e8cb38795e6e3d06924e4d6c8c6c94cb9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:33 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e95150e8cb38795e6e3d06924e4d6c8c6c94cb9 commit 3e95150e8cb38795e6e3d06924e4d6c8c6c94cb9 Author: Warner Losh AuthorDate: 2021-02-22 20:19:21 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:34 +0000 Remove incorrect statement about EFI environment variables being unsupported. Our uefi support has included environment variable support for several years now. Remove the bogus blanket statement saying we don't support them. MFC After: 3 days Approved by: re@ (gjb) (cherry picked from commit ab77cc9e7bf6d0c2d862dfd514539b81ae248dfd) (cherry picked from commit 78050d4966c5a9c8e953cab2a286450238d51e4f) --- share/man/man8/uefi.8 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 4224af835738..05c74caa6c20 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2020 +.Dd February 22, 2021 .Dt UEFI 8 .Os .Sh NAME @@ -143,7 +143,3 @@ boot support for amd64 first appeared in .Fx 10.1 and for arm64 in .Fx 11.0 . -.Sh CAVEATS -EFI environment variables are not supported by -.Xr loader 8 -or the kernel. From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC4DB5485BC; Mon, 1 Mar 2021 19:00: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 4Dq8jB35J2z3NRy; Mon, 1 Mar 2021 19:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12D50960; Mon, 1 Mar 2021 19:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121J0TS7030851; Mon, 1 Mar 2021 19:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0TkG030850; Mon, 1 Mar 2021 19:00:29 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:29 GMT Message-Id: <202103011900.121J0TkG030850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: abe709deefdf - releng/13.0 - uefi: add historical details 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: abe709deefdfe831f26bbcb5b2eb2f0bca6072ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:34 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=abe709deefdfe831f26bbcb5b2eb2f0bca6072ca commit abe709deefdfe831f26bbcb5b2eb2f0bca6072ca Author: Warner Losh AuthorDate: 2021-02-22 21:20:00 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:38 +0000 uefi: add historical details Add details about when armv6 and armv7 support was added. Approved by: re@ (gjb) (cherry picked from commit 8c09ecb2e25155b4f1490a177826608d52b1bd1b) (cherry picked from commit f88db54fd87471802b44520715d8e373ddf86f60) --- share/man/man8/uefi.8 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 05c74caa6c20..dfc144718f7b 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -140,6 +140,8 @@ EFI boot support for the ia64 architecture first appeared in .Fx 5.0 . .Nm boot support for amd64 first appeared in -.Fx 10.1 -and for arm64 in -.Fx 11.0 . +.Fx 10.1 ; +for arm64 +.Fx 11.0 ; +and for armv6 and armv7 in +.Fx 12.0 . From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25FD8548437; Mon, 1 Mar 2021 19:00: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 4Dq8jC40fHz3Nlh; Mon, 1 Mar 2021 19:00: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 324E066F; Mon, 1 Mar 2021 19:00: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 121J0VrY030873; Mon, 1 Mar 2021 19:00:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0VIP030872; Mon, 1 Mar 2021 19:00:31 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:31 GMT Message-Id: <202103011900.121J0VIP030872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: de3e66f4bb2d - releng/13.0 - Restore missing word 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: de3e66f4bb2d2e72be2d12301fbda1a1525a0ef5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:35 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=de3e66f4bb2d2e72be2d12301fbda1a1525a0ef5 commit de3e66f4bb2d2e72be2d12301fbda1a1525a0ef5 Author: Warner Losh AuthorDate: 2021-02-22 21:39:04 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:41 +0000 Restore missing word "in" got dropped when I shuffled things around. Noticed by: rpokala@ MFC After: 3 days Approved by: re@ (gjb) (cherry picked from commit f11e9f325aee3459fee94f3a660a8e6c1a25c2ac) (cherry picked from commit 1df1b4190b41ee3237486e9daa0a751cbc56312d) --- share/man/man8/uefi.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index dfc144718f7b..3ecfe05ac1c4 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -141,7 +141,7 @@ EFI boot support for the ia64 architecture first appeared in .Nm boot support for amd64 first appeared in .Fx 10.1 ; -for arm64 +for arm64 in .Fx 11.0 ; and for armv6 and armv7 in .Fx 12.0 . From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A85935485C0; Mon, 1 Mar 2021 19:00: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 4Dq8jH1bByz3Nb1; Mon, 1 Mar 2021 19:00: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 46262C0C; Mon, 1 Mar 2021 19:00: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 121J0Wcf030893; Mon, 1 Mar 2021 19:00:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0Wdl030892; Mon, 1 Mar 2021 19:00:32 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:32 GMT Message-Id: <202103011900.121J0Wdl030892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f495e9ed95c9 - releng/13.0 - uefi: Add riscv to historical details 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f495e9ed95c9ff3cf31cfc6554b43fce7a475af6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:37 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f495e9ed95c9ff3cf31cfc6554b43fce7a475af6 commit f495e9ed95c9ff3cf31cfc6554b43fce7a475af6 Author: Jessica Clarke AuthorDate: 2021-02-22 22:27:00 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:44 +0000 uefi: Add riscv to historical details Approved by: re@ (gjb) (cherry picked from commit 963cf6cb0fd7e8708c455ecf567fbc34fe2a7156) (cherry picked from commit 44f483e0fa52c42c8f97cf1600c1f7272a283707) --- share/man/man8/uefi.8 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 3ecfe05ac1c4..64bc30139f97 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -143,5 +143,7 @@ boot support for amd64 first appeared in .Fx 10.1 ; for arm64 in .Fx 11.0 ; -and for armv6 and armv7 in -.Fx 12.0 . +for armv6 and armv7 in +.Fx 12.0 ; +and for riscv in +.Fx 13.0 . From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:00:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EBC154879E; Mon, 1 Mar 2021 19:00: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 4Dq8jK5HPrz3Nnw; Mon, 1 Mar 2021 19:00: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 72E987E5; Mon, 1 Mar 2021 19:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121J0XLf030913; Mon, 1 Mar 2021 19:00:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0X6D030912; Mon, 1 Mar 2021 19:00:33 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:33 GMT Message-Id: <202103011900.121J0X6D030912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: c0708f6835bf - releng/13.0 - efibootmgr: Check for efi supported after parsing args 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: c0708f6835bf752ccfb2b1c48e7c47f9ead529a6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:38 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c0708f6835bf752ccfb2b1c48e7c47f9ead529a6 commit c0708f6835bf752ccfb2b1c48e7c47f9ead529a6 Author: Warner Losh AuthorDate: 2021-02-11 23:06:30 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:49 +0000 efibootmgr: Check for efi supported after parsing args Move the check for efi variables being supported to after parsing the args. This allows '-h' to produce both as a normal user as well as on all systems. Approved by: re@ (gjb) (cherry picked from commit 7fe2f504f8a0e4237872f8528e911c5f7b7ed59d) (cherry picked from commit b8b867a10f56b4a78b680fb5d2a97c83e745a0ce) --- usr.sbin/efibootmgr/efibootmgr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 8c7ba82cb5a5..53bc417c4e07 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1072,11 +1072,12 @@ int main(int argc, char *argv[]) { + memset(&opts, 0, sizeof (bmgr_opts_t)); + parse_args(argc, argv); + if (!efi_variables_supported()) errx(1, "efi variables not supported on this system. root? kldload efirt?"); - memset(&opts, 0, sizeof (bmgr_opts_t)); - parse_args(argc, argv); read_vars(); if (opts.create) From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:34:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72AC154A09C; Mon, 1 Mar 2021 19:34:56 +0000 (UTC) (envelope-from nwhitehorn@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 4Dq9Sw2QX1z3jqh; Mon, 1 Mar 2021 19:34:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:85ea:d09e:32a:9875]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D950F35E99; Mon, 1 Mar 2021 19:34:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Brandon Bergren , Kyle Evans Cc: Warner Losh , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> <6611975a-f126-4a65-9a48-d3ed73c4d073@www.fastmail.com> From: Nathan Whitehorn Message-ID: <836d1eb1-83dd-e704-56c3-e351e7817c59@freebsd.org> Date: Mon, 1 Mar 2021 14:34:55 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <6611975a-f126-4a65-9a48-d3ed73c4d073@www.fastmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:34:56 -0000 On 3/1/21 1:39 PM, Brandon Bergren wrote: > On Mon, Mar 1, 2021, at 12:28 PM, Brandon Bergren wrote: >> >> On Mon, Mar 1, 2021, at 11:54 AM, Nathan Whitehorn wrote: >>> The /boot/uboot in BSD.root.dist also looks like cruft to me, but maybe >>> best to leave for now? >>> -Nathan >> It's used on Book-E powerpc* in some cases (and the bootloader is >> compiled and installed there by default on powerpc*) but it's a regular >> directory. I don't believe there's any custom behavior to treat it as a >> mount point because setting up booting is a machine specific thing in >> this case, and the user is expected to do something like copy it to the >> boot server or a partition on the bootstrap media. >> >> For example, on the X5000, the boot firmware is stored on an onboard SD >> card that has space left to install loaders and stuff, but this is >> something that is set up by hand. >> > Another thing to be aware of: > > On PowerNV (and Playstation 3, although that has bitrotted a bit), we currently use a ms-basic-data or fat32 partition mounted as /boot so that petitboot can load the kernel for direct execution. We do this because fat32 is the only filesystem we have in common with petitboot that we can easily write to. > > Be aware of this when changing detection behavior that we do in fact need this mounted as /boot and not as a subdirectory because of the way we currently do direct-execution on PowerNV. At the moment the behavior is isolated in partedit/partedit.powerpc but if the generic scripts are changed in a way where some assumption that /boot itself lives on the root filesystem comes into play, that they will have to special-case this. > This is one reason I really don't want any of this mechanism to be generic. I'd like the knowledge about the layout to be limited to the partition editor, which can signal to later parts of the install/upgrade process as needed. As written here for EFI, it is meant to do this by the presence of the EFI partition. -Nathan From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:56:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4A5C54A4C3; Mon, 1 Mar 2021 19:56: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 4Dq9xk614yz3kwL; Mon, 1 Mar 2021 19:56: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 C0E7B1716; Mon, 1 Mar 2021 19:56: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 121JuQH5002711; Mon, 1 Mar 2021 19:56:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121JuQjX002710; Mon, 1 Mar 2021 19:56:26 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:56:26 GMT Message-Id: <202103011956.121JuQjX002710@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: 96a9e50e63bf - main - ptrace_test: Add more debug output on test failures 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: 96a9e50e63bfcbca7309c012c2c7a477c8826824 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:56:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=96a9e50e63bfcbca7309c012c2c7a477c8826824 commit 96a9e50e63bfcbca7309c012c2c7a477c8826824 Author: Alex Richardson AuthorDate: 2021-03-01 18:49:31 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 19:55:43 +0000 ptrace_test: Add more debug output on test failures Mostly automatic, using `CHILD_REQUIRE\(([^|&\n]*) ==` -> `CHILD_REQUIRE_EQ_INT($1,` `ATF_REQUIRE\(([^|&\n]*) ==` -> `REQUIRE_EQ_INT($1,` followed by git-clang-format -f and then manually checking ones that contain ||/&&. Test Plan: Still getting the same failure but now it prints `psr.sr_error (0) == EBADF (9) not met` instead of just failing without printing the values. PR: 243605 Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D28887 --- tests/sys/kern/ptrace_test.c | 1516 +++++++++++++++++++++--------------------- 1 file changed, 770 insertions(+), 746 deletions(-) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 5422cce80713..a5655008eaa1 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -88,22 +89,45 @@ __FBSDID("$FreeBSD$"); * processes. This only works if the parent process is tripped up by * the early exit and fails some requirement itself. */ -#define CHILD_REQUIRE(exp) do { \ - if (!(exp)) \ - child_fail_require(__FILE__, __LINE__, \ - #exp " not met"); \ - } while (0) +#define CHILD_REQUIRE(exp) do { \ + if (!(exp)) \ + child_fail_require(__FILE__, __LINE__, \ + #exp " not met\n"); \ +} while (0) + +#define CHILD_REQUIRE_EQ(actual, expected) do { \ + __typeof__(expected) _e = expected; \ + __typeof__(actual) _a = actual; \ + if (_e != _a) \ + child_fail_require(__FILE__, __LINE__, #actual \ + " (%jd) == " #expected " (%jd) not met\n", \ + (intmax_t)_a, (intmax_t)_e); \ +} while (0) static __dead2 void -child_fail_require(const char *file, int line, const char *str) +child_fail_require(const char *file, int line, const char *fmt, ...) { - char buf[128]; + va_list ap; + char buf[1024]; + + /* Use write() not fprintf() to avoid possible duplicate output. */ + snprintf(buf, sizeof(buf), "%s:%d: ", file, line); + write(STDERR_FILENO, buf, strlen(buf)); + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + write(STDERR_FILENO, buf, strlen(buf)); + va_end(ap); - snprintf(buf, sizeof(buf), "%s:%d: %s\n", file, line, str); - write(2, buf, strlen(buf)); _exit(32); } +#define REQUIRE_EQ(actual, expected) do { \ + __typeof__(expected) _e = expected; \ + __typeof__(actual) _a = actual; \ + ATF_REQUIRE_MSG(_e == _a, #actual " (%jd) == " \ + #expected " (%jd) not met", (intmax_t)_a, (intmax_t)_e); \ +} while (0) + static void trace_me(void) { @@ -121,12 +145,12 @@ attach_child(pid_t pid) pid_t wpid; int status; - ATF_REQUIRE(ptrace(PT_ATTACH, pid, NULL, 0) == 0); + REQUIRE_EQ(ptrace(PT_ATTACH, pid, NULL, 0), 0); wpid = waitpid(pid, &status, 0); - ATF_REQUIRE(wpid == pid); + REQUIRE_EQ(wpid, pid); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); } static void @@ -152,7 +176,7 @@ wait_for_zombie(pid_t pid) mib[3] = pid; len = sizeof(kp); if (sysctl(mib, nitems(mib), &kp, &len, NULL, 0) == -1) { - ATF_REQUIRE(errno == ESRCH); + REQUIRE_EQ(errno, ESRCH); break; } if (kp.ki_stat == SZOMB) @@ -183,23 +207,23 @@ ATF_TC_BODY(ptrace__parent_wait_after_trace_me, tc) /* The first wait() should report the stop from SIGSTOP. */ wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == child); + REQUIRE_EQ(wpid, child); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); /* Continue the child ignoring the SIGSTOP. */ ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* The second wait() should report the exit status. */ wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == child); + REQUIRE_EQ(wpid, child); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); /* The child should no longer exist. */ wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -216,14 +240,14 @@ ATF_TC_BODY(ptrace__parent_wait_after_attach, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/244055"); - ATF_REQUIRE(pipe(cpipe) == 0); + REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((child = fork()) != -1); if (child == 0) { /* Child process. */ close(cpipe[0]); /* Wait for the parent to attach. */ - CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == 0); + CHILD_REQUIRE_EQ(0, read(cpipe[1], &c, sizeof(c))); _exit(1); } @@ -242,14 +266,14 @@ ATF_TC_BODY(ptrace__parent_wait_after_attach, tc) /* The second wait() should report the exit status. */ wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == child); + REQUIRE_EQ(wpid, child); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); /* The child should no longer exist. */ wpid = waitpid(child, &status, 0); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -266,7 +290,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239399"); - ATF_REQUIRE(pipe(cpipe) == 0); + REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((child = fork()) != -1); if (child == 0) { @@ -274,13 +298,13 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) close(cpipe[0]); /* Wait for parent to be ready. */ - CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), sizeof(c)); _exit(1); } close(cpipe[1]); - ATF_REQUIRE(pipe(dpipe) == 0); + REQUIRE_EQ(pipe(dpipe), 0); ATF_REQUIRE((debugger = fork()) != -1); if (debugger == 0) { @@ -290,22 +314,22 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); wpid = waitpid(child, &status, 0); - CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE_EQ(wpid, child); CHILD_REQUIRE(WIFSTOPPED(status)); - CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP); + CHILD_REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), sizeof(c)); /* Wait for parent's failed wait. */ - CHILD_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0); + CHILD_REQUIRE_EQ(read(dpipe[1], &c, sizeof(c)), 0); wpid = waitpid(child, &status, 0); - CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE_EQ(wpid, child); CHILD_REQUIRE(WIFEXITED(status)); - CHILD_REQUIRE(WEXITSTATUS(status) == 1); + CHILD_REQUIRE_EQ(WEXITSTATUS(status), 1); _exit(0); } @@ -314,11 +338,11 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) /* Parent process. */ /* Wait for the debugger to attach to the child. */ - ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == sizeof(c)); + REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), sizeof(c)); /* Release the child. */ - ATF_REQUIRE(write(cpipe[0], &c, sizeof(c)) == sizeof(c)); - ATF_REQUIRE(read(cpipe[0], &c, sizeof(c)) == 0); + REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(read(cpipe[0], &c, sizeof(c)), 0); close(cpipe[0]); wait_for_zombie(child); @@ -329,22 +353,22 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) * until the debugger sees the exit. */ wpid = waitpid(child, &status, WNOHANG); - ATF_REQUIRE(wpid == 0); + REQUIRE_EQ(wpid, 0); /* Signal the debugger to wait for the child. */ close(dpipe[0]); /* Wait for the debugger. */ wpid = waitpid(debugger, &status, 0); - ATF_REQUIRE(wpid == debugger); + REQUIRE_EQ(wpid, debugger); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 0); + REQUIRE_EQ(WEXITSTATUS(status), 0); /* The child process should now be ready. */ wpid = waitpid(child, &status, WNOHANG); - ATF_REQUIRE(wpid == child); + REQUIRE_EQ(wpid, child); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); } /* @@ -360,7 +384,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) int cpipe[2], dpipe[2], status; char c; - ATF_REQUIRE(pipe(cpipe) == 0); + REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((child = fork()) != -1); if (child == 0) { @@ -368,13 +392,13 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) close(cpipe[0]); /* Wait for parent to be ready. */ - CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), sizeof(c)); _exit(1); } close(cpipe[1]); - ATF_REQUIRE(pipe(dpipe) == 0); + REQUIRE_EQ(pipe(dpipe), 0); ATF_REQUIRE((debugger = fork()) != -1); if (debugger == 0) { @@ -394,22 +418,22 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); wpid = waitpid(child, &status, 0); - CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE_EQ(wpid, child); CHILD_REQUIRE(WIFSTOPPED(status)); - CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP); + CHILD_REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), sizeof(c)); /* Wait for parent's failed wait. */ - CHILD_REQUIRE(read(dpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE_EQ(read(dpipe[1], &c, sizeof(c)), sizeof(c)); wpid = waitpid(child, &status, 0); - CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE_EQ(wpid, child); CHILD_REQUIRE(WIFEXITED(status)); - CHILD_REQUIRE(WEXITSTATUS(status) == 1); + CHILD_REQUIRE_EQ(WEXITSTATUS(status), 1); _exit(0); } @@ -419,20 +443,20 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) /* Wait for the debugger parent process to exit. */ wpid = waitpid(debugger, &status, 0); - ATF_REQUIRE(wpid == debugger); + REQUIRE_EQ(wpid, debugger); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 2); + REQUIRE_EQ(WEXITSTATUS(status), 2); /* A WNOHANG wait here should see the non-exited child. */ wpid = waitpid(child, &status, WNOHANG); - ATF_REQUIRE(wpid == 0); + REQUIRE_EQ(wpid, 0); /* Wait for the debugger to attach to the child. */ - ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == sizeof(c)); + REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), sizeof(c)); /* Release the child. */ - ATF_REQUIRE(write(cpipe[0], &c, sizeof(c)) == sizeof(c)); - ATF_REQUIRE(read(cpipe[0], &c, sizeof(c)) == 0); + REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(read(cpipe[0], &c, sizeof(c)), 0); close(cpipe[0]); wait_for_zombie(child); @@ -443,20 +467,20 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) * until the debugger sees the exit. */ wpid = waitpid(child, &status, WNOHANG); - ATF_REQUIRE(wpid == 0); + REQUIRE_EQ(wpid, 0); /* Signal the debugger to wait for the child. */ - ATF_REQUIRE(write(dpipe[0], &c, sizeof(c)) == sizeof(c)); + REQUIRE_EQ(write(dpipe[0], &c, sizeof(c)), sizeof(c)); /* Wait for the debugger. */ - ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == 0); + REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), 0); close(dpipe[0]); /* The child process should now be ready. */ wpid = waitpid(child, &status, WNOHANG); - ATF_REQUIRE(wpid == child); + REQUIRE_EQ(wpid, child); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); } /* @@ -472,11 +496,11 @@ ATF_TC_BODY(ptrace__parent_exits_before_child, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/244056"); - ATF_REQUIRE(pipe(cpipe1) == 0); - ATF_REQUIRE(pipe(cpipe2) == 0); - ATF_REQUIRE(pipe(gcpipe) == 0); + REQUIRE_EQ(pipe(cpipe1), 0); + REQUIRE_EQ(pipe(cpipe2), 0); + REQUIRE_EQ(pipe(gcpipe), 0); - ATF_REQUIRE(procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == 0); + REQUIRE_EQ(procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL), 0); ATF_REQUIRE((child = fork()) != -1); if (child == 0) { @@ -496,31 +520,31 @@ ATF_TC_BODY(ptrace__parent_exits_before_child, tc) _exit(status); } - ATF_REQUIRE(read(cpipe1[0], &gchild, sizeof(gchild)) == sizeof(gchild)); + REQUIRE_EQ(read(cpipe1[0], &gchild, sizeof(gchild)), sizeof(gchild)); - ATF_REQUIRE(ptrace(PT_ATTACH, gchild, NULL, 0) == 0); + REQUIRE_EQ(ptrace(PT_ATTACH, gchild, NULL, 0), 0); status = 0; - ATF_REQUIRE(write(cpipe2[1], &status, sizeof(status)) == - sizeof(status)); - ATF_REQUIRE(waitpid(child, &status, 0) == child); - ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 0); + REQUIRE_EQ(write(cpipe2[1], &status, sizeof(status)), sizeof(status)); + REQUIRE_EQ(waitpid(child, &status, 0), child); + ATF_REQUIRE(WIFEXITED(status)); + REQUIRE_EQ(WEXITSTATUS(status), 0); status = 0; - ATF_REQUIRE(write(gcpipe[1], &status, sizeof(status)) == - sizeof(status)); - ATF_REQUIRE(waitpid(gchild, &status, 0) == gchild); + REQUIRE_EQ(write(gcpipe[1], &status, sizeof(status)), sizeof(status)); + REQUIRE_EQ(waitpid(gchild, &status, 0), gchild); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(ptrace(PT_DETACH, gchild, (caddr_t)1, 0) == 0); - ATF_REQUIRE(waitpid(gchild, &status, 0) == gchild); - ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 0); - - ATF_REQUIRE(close(cpipe1[0]) == 0); - ATF_REQUIRE(close(cpipe1[1]) == 0); - ATF_REQUIRE(close(cpipe2[0]) == 0); - ATF_REQUIRE(close(cpipe2[1]) == 0); - ATF_REQUIRE(close(gcpipe[0]) == 0); - ATF_REQUIRE(close(gcpipe[1]) == 0); + REQUIRE_EQ(ptrace(PT_DETACH, gchild, (caddr_t)1, 0), 0); + REQUIRE_EQ(waitpid(gchild, &status, 0), gchild); + ATF_REQUIRE(WIFEXITED(status)); + REQUIRE_EQ(WEXITSTATUS(status), 0); + + REQUIRE_EQ(close(cpipe1[0]), 0); + REQUIRE_EQ(close(cpipe1[1]), 0); + REQUIRE_EQ(close(cpipe2[0]), 0); + REQUIRE_EQ(close(cpipe2[1]), 0); + REQUIRE_EQ(close(gcpipe[0]), 0); + REQUIRE_EQ(close(gcpipe[1]), 0); } /* @@ -543,9 +567,9 @@ follow_fork_parent(bool use_vfork) _exit(2); wpid = waitpid(fpid, &status, 0); - CHILD_REQUIRE(wpid == fpid); + CHILD_REQUIRE_EQ(wpid, fpid); CHILD_REQUIRE(WIFEXITED(status)); - CHILD_REQUIRE(WEXITSTATUS(status) == 2); + CHILD_REQUIRE_EQ(WEXITSTATUS(status), 2); _exit(1); } @@ -585,23 +609,23 @@ handle_fork_events(pid_t parent, struct ptrace_lwpinfo *ppl) (PL_FLAG_FORKED | PL_FLAG_CHILD)); if (pl.pl_flags & PL_FLAG_CHILD) { ATF_REQUIRE(wpid != parent); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); ATF_REQUIRE(!fork_reported[1]); if (child == -1) child = wpid; else - ATF_REQUIRE(child == wpid); + REQUIRE_EQ(child, wpid); if (ppl != NULL) ppl[1] = pl; fork_reported[1] = true; } else { - ATF_REQUIRE(wpid == parent); - ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + REQUIRE_EQ(wpid, parent); + REQUIRE_EQ(WSTOPSIG(status), SIGTRAP); ATF_REQUIRE(!fork_reported[0]); if (child == -1) child = pl.pl_child_pid; else - ATF_REQUIRE(child == pl.pl_child_pid); + REQUIRE_EQ(child, pl.pl_child_pid); if (ppl != NULL) ppl[0] = pl; fork_reported[0] = true; @@ -633,9 +657,9 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached, tc) /* The first wait() should report the stop from SIGSTOP. */ wpid = waitpid(children[0], &status, 0); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1); @@ -653,18 +677,18 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached, tc) * grandchild should report its exit first to the debugger. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[1]); + REQUIRE_EQ(wpid, children[1]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 2); + REQUIRE_EQ(WEXITSTATUS(status), 2); wpid = wait(&status); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -689,9 +713,9 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached, tc) /* The first wait() should report the stop from SIGSTOP. */ wpid = waitpid(children[0], &status, 0); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1); @@ -709,13 +733,13 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached, tc) * child. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -740,9 +764,9 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached, tc) /* The first wait() should report the stop from SIGSTOP. */ wpid = waitpid(children[0], &status, 0); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1); @@ -764,18 +788,18 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached, tc) * after the grandchild. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[1]); + REQUIRE_EQ(wpid, children[1]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 2); + REQUIRE_EQ(WEXITSTATUS(status), 2); wpid = wait(&status); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } static void @@ -792,10 +816,10 @@ attach_fork_parent(int cpipe[2]) /* Send the pid of the disassociated child to the debugger. */ fpid = getpid(); - CHILD_REQUIRE(write(cpipe[1], &fpid, sizeof(fpid)) == sizeof(fpid)); + CHILD_REQUIRE_EQ(write(cpipe[1], &fpid, sizeof(fpid)), sizeof(fpid)); /* Wait for the debugger to attach. */ - CHILD_REQUIRE(read(cpipe[1], &fpid, sizeof(fpid)) == 0); + CHILD_REQUIRE_EQ(read(cpipe[1], &fpid, sizeof(fpid)), 0); } /* @@ -813,7 +837,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239397"); - ATF_REQUIRE(pipe(cpipe) == 0); + REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { attach_fork_parent(cpipe); @@ -825,12 +849,12 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc) /* Wait for the direct child to exit. */ wpid = waitpid(fpid, &status, 0); - ATF_REQUIRE(wpid == fpid); + REQUIRE_EQ(wpid, fpid); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 3); + REQUIRE_EQ(WEXITSTATUS(status), 3); /* Read the pid of the fork parent. */ - ATF_REQUIRE(read(cpipe[0], &children[0], sizeof(children[0])) == + REQUIRE_EQ(read(cpipe[0], &children[0], sizeof(children[0])), sizeof(children[0])); /* Attach to the fork parent. */ @@ -855,18 +879,18 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc) * so the child should report its exit first to the debugger. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[1]); + REQUIRE_EQ(wpid, children[1]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 2); + REQUIRE_EQ(WEXITSTATUS(status), 2); wpid = wait(&status); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -884,7 +908,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239292"); - ATF_REQUIRE(pipe(cpipe) == 0); + REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { attach_fork_parent(cpipe); @@ -896,12 +920,12 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc) /* Wait for the direct child to exit. */ wpid = waitpid(fpid, &status, 0); - ATF_REQUIRE(wpid == fpid); + REQUIRE_EQ(wpid, fpid); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 3); + REQUIRE_EQ(WEXITSTATUS(status), 3); /* Read the pid of the fork parent. */ - ATF_REQUIRE(read(cpipe[0], &children[0], sizeof(children[0])) == + REQUIRE_EQ(read(cpipe[0], &children[0], sizeof(children[0])), sizeof(children[0])); /* Attach to the fork parent. */ @@ -926,13 +950,13 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc) * parent. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -950,7 +974,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239425"); - ATF_REQUIRE(pipe(cpipe) == 0); + REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { attach_fork_parent(cpipe); @@ -962,12 +986,12 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc) /* Wait for the direct child to exit. */ wpid = waitpid(fpid, &status, 0); - ATF_REQUIRE(wpid == fpid); + REQUIRE_EQ(wpid, fpid); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 3); + REQUIRE_EQ(WEXITSTATUS(status), 3); /* Read the pid of the fork parent. */ - ATF_REQUIRE(read(cpipe[0], &children[0], sizeof(children[0])) == + REQUIRE_EQ(read(cpipe[0], &children[0], sizeof(children[0])), sizeof(children[0])); /* Attach to the fork parent. */ @@ -992,13 +1016,13 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc) * the child. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[1]); + REQUIRE_EQ(wpid, children[1]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 2); + REQUIRE_EQ(WEXITSTATUS(status), 2); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -1015,8 +1039,7 @@ ATF_TC_BODY(ptrace__getppid, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/240510"); - - ATF_REQUIRE(pipe(cpipe) == 0); + REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((child = fork()) != -1); if (child == 0) { @@ -1024,7 +1047,7 @@ ATF_TC_BODY(ptrace__getppid, tc) close(cpipe[0]); /* Wait for parent to be ready. */ - CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), sizeof(c)); /* Report the parent PID to the parent. */ ppid = getppid(); @@ -1035,7 +1058,7 @@ ATF_TC_BODY(ptrace__getppid, tc) } close(cpipe[1]); - ATF_REQUIRE(pipe(dpipe) == 0); + REQUIRE_EQ(pipe(dpipe), 0); ATF_REQUIRE((debugger = fork()) != -1); if (debugger == 0) { @@ -1045,20 +1068,20 @@ ATF_TC_BODY(ptrace__getppid, tc) CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); wpid = waitpid(child, &status, 0); - CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE_EQ(wpid, child); CHILD_REQUIRE(WIFSTOPPED(status)); - CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP); + CHILD_REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); + CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), sizeof(c)); /* Wait for traced child to exit. */ wpid = waitpid(child, &status, 0); - CHILD_REQUIRE(wpid == child); + CHILD_REQUIRE_EQ(wpid, child); CHILD_REQUIRE(WIFEXITED(status)); - CHILD_REQUIRE(WEXITSTATUS(status) == 1); + CHILD_REQUIRE_EQ(WEXITSTATUS(status), 1); _exit(0); } @@ -1067,28 +1090,28 @@ ATF_TC_BODY(ptrace__getppid, tc) /* Parent process. */ /* Wait for the debugger to attach to the child. */ - ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == sizeof(c)); + REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), sizeof(c)); /* Release the child. */ - ATF_REQUIRE(write(cpipe[0], &c, sizeof(c)) == sizeof(c)); + REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), sizeof(c)); /* Read the parent PID from the child. */ - ATF_REQUIRE(read(cpipe[0], &ppid, sizeof(ppid)) == sizeof(ppid)); + REQUIRE_EQ(read(cpipe[0], &ppid, sizeof(ppid)), sizeof(ppid)); close(cpipe[0]); - ATF_REQUIRE(ppid == getpid()); + REQUIRE_EQ(ppid, getpid()); /* Wait for the debugger. */ wpid = waitpid(debugger, &status, 0); - ATF_REQUIRE(wpid == debugger); + REQUIRE_EQ(wpid, debugger); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 0); + REQUIRE_EQ(WEXITSTATUS(status), 0); /* The child process should now be ready. */ wpid = waitpid(child, &status, WNOHANG); - ATF_REQUIRE(wpid == child); + REQUIRE_EQ(wpid, child); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); } /* @@ -1113,9 +1136,9 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_fork, tc) /* The first wait() should report the stop from SIGSTOP. */ wpid = waitpid(children[0], &status, 0); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1); @@ -1128,9 +1151,9 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_fork, tc) ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0); ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0); - ATF_REQUIRE(pl[0].pl_syscall_code == SYS_fork); - ATF_REQUIRE(pl[0].pl_syscall_code == pl[1].pl_syscall_code); - ATF_REQUIRE(pl[0].pl_syscall_narg == pl[1].pl_syscall_narg); + REQUIRE_EQ(pl[0].pl_syscall_code, SYS_fork); + REQUIRE_EQ(pl[0].pl_syscall_code, pl[1].pl_syscall_code); + REQUIRE_EQ(pl[0].pl_syscall_narg, pl[1].pl_syscall_narg); ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1); @@ -1140,18 +1163,18 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_fork, tc) * grandchild should report its exit first to the debugger. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[1]); + REQUIRE_EQ(wpid, children[1]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 2); + REQUIRE_EQ(WEXITSTATUS(status), 2); wpid = wait(&status); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } /* @@ -1176,9 +1199,9 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_vfork, tc) /* The first wait() should report the stop from SIGSTOP. */ wpid = waitpid(children[0], &status, 0); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1); @@ -1191,9 +1214,9 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_vfork, tc) ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0); ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0); - ATF_REQUIRE(pl[0].pl_syscall_code == SYS_vfork); - ATF_REQUIRE(pl[0].pl_syscall_code == pl[1].pl_syscall_code); - ATF_REQUIRE(pl[0].pl_syscall_narg == pl[1].pl_syscall_narg); + REQUIRE_EQ(pl[0].pl_syscall_code, SYS_vfork); + REQUIRE_EQ(pl[0].pl_syscall_code, pl[1].pl_syscall_code); + REQUIRE_EQ(pl[0].pl_syscall_narg, pl[1].pl_syscall_narg); ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1); @@ -1203,18 +1226,18 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_vfork, tc) * grandchild should report its exit first to the debugger. */ wpid = wait(&status); - ATF_REQUIRE(wpid == children[1]); + REQUIRE_EQ(wpid, children[1]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 2); + REQUIRE_EQ(WEXITSTATUS(status), 2); wpid = wait(&status); - ATF_REQUIRE(wpid == children[0]); + REQUIRE_EQ(wpid, children[0]); ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE(WEXITSTATUS(status) == 1); + REQUIRE_EQ(WEXITSTATUS(status), 1); wpid = wait(&status); - ATF_REQUIRE(wpid == -1); - ATF_REQUIRE(errno == ECHILD); + REQUIRE_EQ(wpid, -1); + REQUIRE_EQ(errno, ECHILD); } static void * @@ -1229,8 +1252,8 @@ simple_thread_main(void) { pthread_t thread; - CHILD_REQUIRE(pthread_create(&thread, NULL, simple_thread, NULL) == 0); - CHILD_REQUIRE(pthread_join(thread, NULL) == 0); + CHILD_REQUIRE_EQ(pthread_create(&thread, NULL, simple_thread, NULL), 0); + CHILD_REQUIRE_EQ(pthread_join(thread, NULL), 0); exit(1); } @@ -1254,9 +1277,9 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_thread, tc) /* The first wait() should report the stop from SIGSTOP. */ wpid = waitpid(fpid, &status, 0); - ATF_REQUIRE(wpid == fpid); + REQUIRE_EQ(wpid, fpid); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); @@ -1277,10 +1300,10 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_thread, tc) */ for (;;) { wpid = waitpid(fpid, &status, 0); - ATF_REQUIRE(wpid == fpid); + REQUIRE_EQ(wpid, fpid); ATF_REQUIRE(WIFSTOPPED(status)); - ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); - + REQUIRE_EQ(WSTOPSIG(status), SIGTRAP); + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); ATF_REQUIRE((pl.pl_flags & PL_FLAG_SCX) != 0); @@ -1289,27 +1312,27 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_thread, tc) /* New thread seen. */ break; - ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + REQUIRE_EQ(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0), 0); } *** 2627 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:56:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 171E954A917; Mon, 1 Mar 2021 19:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq9xl6m9Fz3kyN; Mon, 1 Mar 2021 19:56: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 D8EC41902; Mon, 1 Mar 2021 19:56: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 121JuRZv002733; Mon, 1 Mar 2021 19:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121JuRbo002732; Mon, 1 Mar 2021 19:56:27 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:56:27 GMT Message-Id: <202103011956.121JuRbo002732@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: 1032131464f1 - main - Remove atf_tc_skip calls from ptrace_test 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: 1032131464f1196ad674b30c14a9e611789a1061 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:56:28 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1032131464f1196ad674b30c14a9e611789a1061 commit 1032131464f1196ad674b30c14a9e611789a1061 Author: Alex Richardson AuthorDate: 2021-03-01 18:51:02 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 19:56:05 +0000 Remove atf_tc_skip calls from ptrace_test I've run these tests many times in a loop on multiple architectures and it works reliably for me, maybe it's time to retire these skips? This also adds an additional waitpid to one of the tests to avoid a potential race condition (suggested by markj@). PR: 239397, 244056, 239425, 240510, 220841, 243605 Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D28888 --- tests/sys/kern/ptrace_test.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index a5655008eaa1..c6183ed573fd 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -237,9 +237,6 @@ ATF_TC_BODY(ptrace__parent_wait_after_attach, tc) int cpipe[2], status; char c; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244055"); - REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((child = fork()) != -1); if (child == 0) { @@ -287,9 +284,6 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) int cpipe[2], dpipe[2], status; char c; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/239399"); - REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((child = fork()) != -1); @@ -493,9 +487,6 @@ ATF_TC_BODY(ptrace__parent_exits_before_child, tc) int cpipe1[2], cpipe2[2], gcpipe[2], status; pid_t child, gchild; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244056"); - REQUIRE_EQ(pipe(cpipe1), 0); REQUIRE_EQ(pipe(cpipe2), 0); REQUIRE_EQ(pipe(gcpipe), 0); @@ -834,9 +825,6 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc) pid_t children[2], fpid, wpid; int cpipe[2], status; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/239397"); - REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -905,9 +893,6 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc) pid_t children[2], fpid, wpid; int cpipe[2], status; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/239292"); - REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -971,9 +956,6 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc) pid_t children[2], fpid, wpid; int cpipe[2], status; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/239425"); - REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -1036,9 +1018,6 @@ ATF_TC_BODY(ptrace__getppid, tc) int cpipe[2], dpipe[2], status; char c; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/240510"); - REQUIRE_EQ(pipe(cpipe), 0); ATF_REQUIRE((child = fork()) != -1); @@ -2123,9 +2102,6 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) struct ptrace_lwpinfo pl; struct sched_param sched_param; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/220841"); - ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { trace_me(); @@ -4219,9 +4195,6 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc) pid_t traced, debuger, wpid; int pd, status; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/243605"); - traced = pdfork(&pd, 0); ATF_REQUIRE(traced >= 0); if (traced == 0) { @@ -4230,6 +4203,8 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc) } ATF_REQUIRE(pd >= 0); + /* Wait until the child process has stopped before fork()ing again. */ + REQUIRE_EQ(traced, waitpid(traced, &status, WSTOPPED)); debuger = fork(); ATF_REQUIRE(debuger >= 0); if (debuger == 0) { From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:56:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7018354A7A1; Mon, 1 Mar 2021 19:56: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 4Dq9xn2G9xz3kwT; Mon, 1 Mar 2021 19:56: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 16ECC1370; Mon, 1 Mar 2021 19:56: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 121JuSRA002752; Mon, 1 Mar 2021 19:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121JuStT002751; Mon, 1 Mar 2021 19:56:28 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:56:28 GMT Message-Id: <202103011956.121JuStT002751@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: 17cc20092cd7 - main - Fix ptrace_test:ptrace__syscall_args after ATF upgrade 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: 17cc20092cd7a45adb6d772e0f449617007a82d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:56:29 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=17cc20092cd7a45adb6d772e0f449617007a82d9 commit 17cc20092cd7a45adb6d772e0f449617007a82d9 Author: Alex Richardson AuthorDate: 2021-02-23 12:51:35 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 19:56:05 +0000 Fix ptrace_test:ptrace__syscall_args after ATF upgrade ATF now opens the results file (without CLOEXEC), so the child actually has a valid file descriptor 3. To fix this simply use a large number that will definitely not be a valid file descriptor. Reviewed by: jhb, cem, lwhsu Differential Revision: https://reviews.freebsd.org/D28889 --- tests/sys/kern/ptrace_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index c6183ed573fd..944be3d31e04 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -3947,7 +3947,8 @@ ATF_TC_BODY(ptrace__syscall_args, tc) if (fpid == 0) { trace_me(); kill(getpid(), 0); - close(3); + /* Close a fd that should not exist. */ + close(12345); exit(1); } @@ -4049,7 +4050,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_GET_SC_ARGS, wpid, (caddr_t)args, sizeof(args)) != -1); - REQUIRE_EQ(args[0], 3); + REQUIRE_EQ(args[0], 12345); REQUIRE_EQ(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0), 0); From owner-dev-commits-src-all@freebsd.org Mon Mar 1 19:56:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22B4054AA03; Mon, 1 Mar 2021 19:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq9xq2gJxz3khn; Mon, 1 Mar 2021 19:56: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 446B81883; Mon, 1 Mar 2021 19:56: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 121JuU7I002774; Mon, 1 Mar 2021 19:56:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121JuUSn002773; Mon, 1 Mar 2021 19:56:30 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:56:30 GMT Message-Id: <202103011956.121JuUSn002773@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: c88c1f23a898 - main - Allow ssp_test:read to pass more reliably 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: c88c1f23a8989b881a5ca51223289ddb4ce74277 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:56:34 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c88c1f23a8989b881a5ca51223289ddb4ce74277 commit c88c1f23a8989b881a5ca51223289ddb4ce74277 Author: Alex Richardson AuthorDate: 2021-03-01 19:50:38 +0000 Commit: Alex Richardson CommitDate: 2021-03-01 19:56:05 +0000 Allow ssp_test:read to pass more reliably It appears that the stackframe layout can be slightly different depending on compiler and target architecture. For example, when using CHERI LLVM for RISC-V we can actually overflow the buffer by up to 8 bytes without SSP detecting it. Fix this by increasing the overflow to 15 bytes. Reviewed By: ngie, emaste Differential Revision: https://reviews.freebsd.org/D28997 --- contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh index 7b963d18e3f7..b9d07b1804b1 100755 --- a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh +++ b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh @@ -390,7 +390,7 @@ read_body() if true; then MAX_PATH=$(getconf _XOPEN_PATH_MAX) || atf_fail "getconf failed" h_pass "$prog $MAX_PATH" "echo foo |" - h_fail "$prog $(( $MAX_PATH + 3 ))" "echo bar |" + h_fail "$prog $(( $MAX_PATH + 15 ))" "echo bar |" else # End FreeBSD h_pass "$prog 1024" "echo foo |" From owner-dev-commits-src-all@freebsd.org Mon Mar 1 20:50:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBF6A54C2B8; Mon, 1 Mar 2021 20:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqC8Z51J0z3prr; Mon, 1 Mar 2021 20:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EE731FE9; Mon, 1 Mar 2021 20:50: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 121KosxZ080180; Mon, 1 Mar 2021 20:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121KosV0080179; Mon, 1 Mar 2021 20:50:54 GMT (envelope-from git) Date: Mon, 1 Mar 2021 20:50:54 GMT Message-Id: <202103012050.121KosV0080179@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: 94f2e42f5e0b - main - nfsclient: Fix the stripe unit size for a File Layout pNFS layout 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: 94f2e42f5e0b78a7a4684d4a4eb62ea470a57eb1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 20:50:54 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=94f2e42f5e0b78a7a4684d4a4eb62ea470a57eb1 commit 94f2e42f5e0b78a7a4684d4a4eb62ea470a57eb1 Author: Rick Macklem AuthorDate: 2021-03-01 20:49:32 +0000 Commit: Rick Macklem CommitDate: 2021-03-01 20:49:32 +0000 nfsclient: Fix the stripe unit size for a File Layout pNFS layout During a recent virtual NFSv4 testing event, a bug in the FreeBSD client was detected when doing a File Layout pNFS DS I/O operation. The size of the I/O operation was smaller than expected. The I/O size is specified as a stripe unit size in bits 6->31 of nflh_util in the layout. I had misinterpreted RFC5661 and had shifted the value right by 6 bits. The correct interpretation is to use the value as presented (it is always an exact multiple of 64), clearing bits 0->5. This patch fixes this. Without the patch, I/O through the DSs work, but the I/O size is 1/64th of what is optimal. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index c95d4dc58e7a..0e503e34810b 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -6024,7 +6024,7 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, np = VTONFS(vp); rel_off = off - flp->nfsfl_patoff; - stripe_unit_size = (flp->nfsfl_util >> 6) & 0x3ffffff; + stripe_unit_size = flp->nfsfl_util & NFSFLAYUTIL_STRIPE_MASK; stripe_pos = (rel_off / stripe_unit_size + flp->nfsfl_stripe1) % dp->nfsdi_stripecnt; transfer = stripe_unit_size - (rel_off % stripe_unit_size); From owner-dev-commits-src-all@freebsd.org Mon Mar 1 21:05:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C74654C7AE; Mon, 1 Mar 2021 21:05: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 4DqCTm2JFVz3qrM; Mon, 1 Mar 2021 21:05: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 41E182444; Mon, 1 Mar 2021 21:05: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 121L5mgD096752; Mon, 1 Mar 2021 21:05:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121L5m3L096751; Mon, 1 Mar 2021 21:05:48 GMT (envelope-from git) Date: Mon, 1 Mar 2021 21:05:48 GMT Message-Id: <202103012105.121L5m3L096751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: b96e66349ed8 - stable/13 - getdirentries.2: fix for NFS mounts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b96e66349ed80f2537777c0cc04266de1a3768b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 21:05:48 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b96e66349ed80f2537777c0cc04266de1a3768b0 commit b96e66349ed80f2537777c0cc04266de1a3768b0 Author: Rick Macklem AuthorDate: 2021-02-15 02:16:58 +0000 Commit: Rick Macklem CommitDate: 2021-03-01 21:00:38 +0000 getdirentries.2: fix for NFS mounts It was reported that getdirentries(2) was returning dirents with d_off set to 0 for an NFS mount. This is believed to be correct behaviour at this time (it may change for some NFS mounts in the future), but is inconsistent with what the getdirentries(2) man page says. This patch fixes the man page. This is a content change. PR: 253428 (cherry picked from commit a0698341cd894ba4a640e9a9bb0f72c2133d1228) --- lib/libc/sys/getdirentries.2 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/libc/sys/getdirentries.2 b/lib/libc/sys/getdirentries.2 index f2d1c05240d5..658be9459af5 100644 --- a/lib/libc/sys/getdirentries.2 +++ b/lib/libc/sys/getdirentries.2 @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd February 14, 2021 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -89,7 +89,7 @@ have the same .Fa d_fileno . The .Fa d_off -field returns a cookie which can be used with +field returns a cookie which, if non-zero, can be used with .Xr lseek 2 to position the directory descriptor to the next entry. The @@ -148,14 +148,16 @@ only .Pc , a value returned in the .Fa d_off -field, +field if it is non-zero, or zero. .Sh IMPLEMENTATION NOTES The .Fa d_off -field is being used as a cookie to readdir for nfs servers. -These cookies can be cached and allow to read directory entries at a specific -offset on demand. +field is currently set to 0 by the NFS client, since the +directory offset cookies returned by an NFS server cannot +be used by +.Xr lseek 2 +at this time. .Sh RETURN VALUES If successful, the number of bytes actually transferred is returned. Otherwise, -1 is returned and the global variable From owner-dev-commits-src-all@freebsd.org Mon Mar 1 22:36:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A503454E955; Mon, 1 Mar 2021 22:36: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 4DqFV74HHhz3wTL; Mon, 1 Mar 2021 22:36: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 859C9382D; Mon, 1 Mar 2021 22:36: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 121MaF4c015161; Mon, 1 Mar 2021 22:36:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121MaFSC015160; Mon, 1 Mar 2021 22:36:15 GMT (envelope-from git) Date: Mon, 1 Mar 2021 22:36:15 GMT Message-Id: <202103012236.121MaFSC015160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 05b267e23257 - main - service: respect nojailvnet keyword MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05b267e23257a5c89ab2d55888a781bf6f90ec4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 22:36:15 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=05b267e23257a5c89ab2d55888a781bf6f90ec4e commit 05b267e23257a5c89ab2d55888a781bf6f90ec4e Author: Mariusz Zaborski AuthorDate: 2021-03-01 22:18:58 +0000 Commit: Mariusz Zaborski CommitDate: 2021-03-01 22:18:58 +0000 service: respect nojailvnet keyword In the 761d2bb5b9e70cf30f9c2dac62a47a2d2593e83f we added nojailvnet keyword. The nojailvnet keyword is used to skip startup scripts in jails that are run without VNET. The service.sh was omitted in this commit. The service.sh even documents that this is the same code as in rc - so lets reflect that. Submitted by: Adam Wołk Sponsored by: Fudo Security --- usr.sbin/service/service.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 42a50fcf61b9..9646aae67b0c 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -83,6 +83,9 @@ if [ -n "$RESTART" ]; then skip="-s nostart" if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then skip="$skip -s nojail" + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + skip="$skip -s nojailvnet" + fi fi [ -n "$local_startup" ] && find_local_scripts_new files=`rcorder ${skip} ${local_rc} 2>/dev/null` @@ -113,6 +116,9 @@ if [ -n "$ENABLED" -o -n "$RCORDER" ]; then skip="-s nostart" if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then skip="$skip -s nojail" + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + skip="$skip -s nojailvnet" + fi fi [ -n "$local_startup" ] && find_local_scripts_new files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` From owner-dev-commits-src-all@freebsd.org Mon Mar 1 22:37:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E5E354EE1C; Mon, 1 Mar 2021 22:37: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 4DqFX641Rnz3wVb; Mon, 1 Mar 2021 22:37: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 7C79A382E; Mon, 1 Mar 2021 22:37: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 121MbwGf015565; Mon, 1 Mar 2021 22:37:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121Mbwfb015564; Mon, 1 Mar 2021 22:37:58 GMT (envelope-from git) Date: Mon, 1 Mar 2021 22:37:58 GMT Message-Id: <202103012237.121Mbwfb015564@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: a7d593dd1da2 - main - Cirrus-CI: temporarily avoid qemu smoke test boot 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: a7d593dd1da27833b5384349700bc3c7bcae6aad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 22:37:58 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a7d593dd1da27833b5384349700bc3c7bcae6aad commit a7d593dd1da27833b5384349700bc3c7bcae6aad Author: Ed Maste AuthorDate: 2021-03-01 21:39:25 +0000 Commit: Ed Maste CommitDate: 2021-03-01 22:37:26 +0000 Cirrus-CI: temporarily avoid qemu smoke test boot Cirrus-CI has been red for some time because we're running out of disk space on the ephemeral GCP VMs. For now remove the package + qemu boot, and just check for build regressions. This change to be reverted once we have identified and addressed the underlying issue. Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index e34b99523561..5e1b9fa3f9ee 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,7 +13,7 @@ env: task: timeout_in: 120m install_script: - - pkg install -y qemu42 uefi-edk2-qemu-x86_64 llvm11 + - pkg install -y llvm11 setup_script: - df -h - pw useradd user @@ -21,7 +21,3 @@ task: - chown user:user /usr/obj/$(pwd -P) script: - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes buildworld buildkernel" - package_script: - - su user -c "make CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages" - test_script: - - sh tools/boot/ci-qemu-test.sh From owner-dev-commits-src-all@freebsd.org Mon Mar 1 23:36:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51121550521; Mon, 1 Mar 2021 23:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqGqy1sBNz4VCd; Mon, 1 Mar 2021 23:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32A1A479A; Mon, 1 Mar 2021 23:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 121Nakkb094499; Mon, 1 Mar 2021 23:36:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121Nak81094498; Mon, 1 Mar 2021 23:36:46 GMT (envelope-from git) Date: Mon, 1 Mar 2021 23:36:46 GMT Message-Id: <202103012336.121Nak81094498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: a59e2982fe3e - main - Optimize out few extra memory accesses. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a59e2982fe3e6339629cc77fe9d349d60e03a05e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 23:36:46 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a59e2982fe3e6339629cc77fe9d349d60e03a05e commit a59e2982fe3e6339629cc77fe9d349d60e03a05e Author: Alexander Motin AuthorDate: 2021-03-01 23:35:45 +0000 Commit: Alexander Motin CommitDate: 2021-03-01 23:36:33 +0000 Optimize out few extra memory accesses. MFC after: 1 week --- sys/cam/ctl/ctl_backend_block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index f50e47a2a6c1..3663bff10f2a 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -438,7 +438,6 @@ ctl_be_block_move_done(union ctl_io *io, bool samethr) struct ctl_lba_len_flags *lbalen; beio = (struct ctl_be_block_io *)PRIV(io)->ptr; - be_lun = beio->lun; DPRINTF("entered\n"); io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; @@ -448,7 +447,7 @@ ctl_be_block_move_done(union ctl_io *io, bool samethr) */ if ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0 && (io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE) { - lbalen = ARGS(beio->io); + lbalen = ARGS(io); if (lbalen->flags & CTL_LLF_READ) { ctl_set_success(&io->scsiio); } else if (lbalen->flags & CTL_LLF_COMPARE) { @@ -476,6 +475,7 @@ ctl_be_block_move_done(union ctl_io *io, bool samethr) * This move done routine is generally called in the SIM's * interrupt context, and therefore we cannot block. */ + be_lun = (struct ctl_be_block_lun *)CTL_BACKEND_LUN(io); if (samethr) { be_lun->dispatch(be_lun, beio); } else { @@ -1280,7 +1280,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_be_block_lun *be_lun, DPRINTF("entered\n"); beio = (struct ctl_be_block_io *)PRIV(io)->ptr; - lbalen = ARGS(beio->io); + lbalen = ARGS(io); if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP | SWS_ANCHOR | SWS_NDOB) || (lbalen->flags & (SWS_UNMAP | SWS_ANCHOR) && be_lun->unmap == NULL)) { From owner-dev-commits-src-all@freebsd.org Tue Mar 2 00:19:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F32F551B27; Tue, 2 Mar 2021 00: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 4DqHnl3C18z4XQc; Tue, 2 Mar 2021 00: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 60E955281; Tue, 2 Mar 2021 00:19: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 1220Jtxi047943; Tue, 2 Mar 2021 00:19:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1220JtBp047942; Tue, 2 Mar 2021 00:19:55 GMT (envelope-from git) Date: Tue, 2 Mar 2021 00:19:55 GMT Message-Id: <202103020019.1220JtBp047942@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: 8742817ba62e - main - FFS extattr: fix handling of the tail 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: 8742817ba62ec604156c139727155d36f5fbad06 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 00:19:55 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8742817ba62ec604156c139727155d36f5fbad06 commit 8742817ba62ec604156c139727155d36f5fbad06 Author: Konstantin Belousov AuthorDate: 2021-03-01 15:24:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 00:19:34 +0000 FFS extattr: fix handling of the tail There are three issues with change that stopped truncating ea area before write, and resulted in possible zero tail in the ea area: - Truncate to zero checked i_ea_len after the reference was dropped, making the last drop effectively truncate to zero length always. - Loop to fill uio for zeroing specified too large length, that triggered assert in normal situation. - Integrity check could trip over the tail, instead we must allow partial header or header with zero length, and clamp ea image in memory at it. Reported by: arichardson Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixup: 5e198e7646a27412c0541719f7bf1bbc0bd89223 Differential Revision: https://reviews.freebsd.org/D28999 --- sys/ufs/ffs/ffs_vnops.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 050a6f66be17..dc638595eb7b 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1346,13 +1346,20 @@ ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td) /* Validate disk xattrfile contents. */ for (eap = (void *)eae, eaend = (void *)(eae + easize); eap < eaend; eap = eapnext) { + /* Detect zeroed out tail */ + if (eap->ea_length < sizeof(*eap) || eap->ea_length == 0) { + easize = (const u_char *)eap - eae; + break; + } + eapnext = EXTATTR_NEXT(eap); - /* Bogusly short entry or bogusly long entry. */ - if (eap->ea_length < sizeof(*eap) || eapnext > eaend) { + /* Bogusly long entry. */ + if (eapnext > eaend) { free(eae, M_TEMP); return (EINTEGRITY); } } + ip->i_ea_len = easize; *p = eae; return (0); } @@ -1407,7 +1414,6 @@ ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td) ffs_unlock_ea(vp); return (error); } - ip->i_ea_len = dp->di_extsize; ip->i_ea_error = 0; ip->i_ea_refs++; ffs_unlock_ea(vp); @@ -1426,6 +1432,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td struct ufs2_dinode *dp; size_t ea_len, tlen; int error, i, lcnt; + bool truncate; ip = VTOI(vp); @@ -1436,6 +1443,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td } dp = ip->i_din2; error = ip->i_ea_error; + truncate = false; if (commit && error == 0) { ASSERT_VOP_ELOCKED(vp, "ffs_close_ea commit"); if (cred == NOCRED) @@ -1452,12 +1460,12 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td liovec[0].iov_base = ip->i_ea_area; liovec[0].iov_len = ip->i_ea_len; - for (i = 1, tlen = ea_len; i < lcnt; i++) { + for (i = 1, tlen = ea_len - ip->i_ea_len; i < lcnt; i++) { liovec[i].iov_base = __DECONST(void *, zero_region); liovec[i].iov_len = MIN(ZERO_REGION_SIZE, tlen); tlen -= liovec[i].iov_len; } - MPASS(tlen == ip->i_ea_len); + MPASS(tlen == 0); luio.uio_iov = liovec; luio.uio_offset = 0; @@ -1466,6 +1474,8 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td luio.uio_rw = UIO_WRITE; luio.uio_td = td; error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred); + if (error == 0 && ip->i_ea_len == 0) + truncate = true; } if (--ip->i_ea_refs == 0) { free(ip->i_ea_area, M_TEMP); @@ -1475,7 +1485,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td } ffs_unlock_ea(vp); - if (commit && error == 0 && ip->i_ea_len == 0) + if (truncate) ffs_truncate(vp, 0, IO_EXT, cred); return (error); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 00:43:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 308EA552782; Tue, 2 Mar 2021 00:43: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 4DqJJg0w9zz4Z7r; Tue, 2 Mar 2021 00:43: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 1231155B6; Tue, 2 Mar 2021 00:43: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 1220hEMZ086205; Tue, 2 Mar 2021 00:43:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1220hE49086204; Tue, 2 Mar 2021 00:43:14 GMT (envelope-from git) Date: Tue, 2 Mar 2021 00:43:14 GMT Message-Id: <202103020043.1220hE49086204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 2224a2872be1 - stable/13 - Bump CTL block backend threads from 14 to 32 per LUN. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2224a2872be189055ce5ff96700502a950bfd548 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 00:43:15 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2224a2872be189055ce5ff96700502a950bfd548 commit 2224a2872be189055ce5ff96700502a950bfd548 Author: Alexander Motin AuthorDate: 2021-02-23 15:58:56 +0000 Commit: Alexander Motin CommitDate: 2021-03-02 00:43:09 +0000 Bump CTL block backend threads from 14 to 32 per LUN. This makes random read benchmarks look better on a wide ZFS pools. I am not sure where the original value goes from, but it is there for too long now. MFC after: 1 week (cherry picked from commit 7d4c444374d53e54ce197138df64bf40c1fb05a3) --- sys/cam/ctl/ctl_backend_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index cd4fab766844..c4e5e0dcf26d 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -226,7 +226,7 @@ struct ctl_be_block_io { extern struct ctl_softc *control_softc; -static int cbb_num_threads = 14; +static int cbb_num_threads = 32; SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CAM Target Layer Block Backend"); SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN, From owner-dev-commits-src-all@freebsd.org Tue Mar 2 00:44:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A22F552913; Tue, 2 Mar 2021 00:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqJLf28Gjz4ZP4; Tue, 2 Mar 2021 00:44: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 3CA2C56C0; Tue, 2 Mar 2021 00:44: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 1220iw8u086577; Tue, 2 Mar 2021 00:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1220iw8w086575; Tue, 2 Mar 2021 00:44:58 GMT (envelope-from git) Date: Tue, 2 Mar 2021 00:44:58 GMT Message-Id: <202103020044.1220iw8w086575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 67dedc2a115e - stable/12 - Bump CTL block backend threads from 14 to 32 per LUN. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 67dedc2a115e3330365809eeb35d313e02785dcf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 00:44:58 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=67dedc2a115e3330365809eeb35d313e02785dcf commit 67dedc2a115e3330365809eeb35d313e02785dcf Author: Alexander Motin AuthorDate: 2021-02-23 15:58:56 +0000 Commit: Alexander Motin CommitDate: 2021-03-02 00:44:45 +0000 Bump CTL block backend threads from 14 to 32 per LUN. This makes random read benchmarks look better on a wide ZFS pools. I am not sure where the original value goes from, but it is there for too long now. MFC after: 1 week (cherry picked from commit 7d4c444374d53e54ce197138df64bf40c1fb05a3) --- sys/cam/ctl/ctl_backend_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index bd233165b10d..85787d35eb6c 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -225,7 +225,7 @@ struct ctl_be_block_io { extern struct ctl_softc *control_softc; -static int cbb_num_threads = 14; +static int cbb_num_threads = 32; SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD, 0, "CAM Target Layer Block Backend"); SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN, From owner-dev-commits-src-all@freebsd.org Tue Mar 2 00:49:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88D8B5525F7; Tue, 2 Mar 2021 00:49: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 4DqJSG3VJcz4ZZX; Tue, 2 Mar 2021 00:49: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 6AF745718; Tue, 2 Mar 2021 00:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1220no5m087442; Tue, 2 Mar 2021 00:49:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1220noIa087441; Tue, 2 Mar 2021 00:49:50 GMT (envelope-from git) Date: Tue, 2 Mar 2021 00:49:50 GMT Message-Id: <202103020049.1220noIa087441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d742dfbddd87 - stable/13 - riscv: Don't set __NO_TLS to disable some uses of TLS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d742dfbddd87769ba417f751a2c8a3d1ff4f11eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 00:49:50 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d742dfbddd87769ba417f751a2c8a3d1ff4f11eb commit d742dfbddd87769ba417f751a2c8a3d1ff4f11eb Author: John Baldwin AuthorDate: 2021-02-18 00:33:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 00:49:42 +0000 riscv: Don't set __NO_TLS to disable some uses of TLS. (cherry picked from commit dd176fd7e7b5aad231cd6ebf49fd14ae7394dfee) --- sys/sys/cdefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 75bedd4b8128..4de1ef011756 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -768,7 +768,7 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__mips) || defined(__riscv) || \ +#if defined(__mips) || \ (defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)) #define __NO_TLS 1 #endif From owner-dev-commits-src-all@freebsd.org Tue Mar 2 00:49:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACFCE5527CC; Tue, 2 Mar 2021 00:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqJSH4Qp3z4ZZY; Tue, 2 Mar 2021 00:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AD455796; Tue, 2 Mar 2021 00:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1220np4m087465; Tue, 2 Mar 2021 00:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1220npEP087464; Tue, 2 Mar 2021 00:49:51 GMT (envelope-from git) Date: Tue, 2 Mar 2021 00:49:51 GMT Message-Id: <202103020049.1220npEP087464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 49fe71bb1e8f - stable/13 - mips: Don't set __NO_TLS to disable some uses of TLS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 49fe71bb1e8f3e916fe856da80486461e3e2c29d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 00:49:51 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49fe71bb1e8f3e916fe856da80486461e3e2c29d commit 49fe71bb1e8f3e916fe856da80486461e3e2c29d Author: John Baldwin AuthorDate: 2021-02-18 00:34:23 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 00:49:42 +0000 mips: Don't set __NO_TLS to disable some uses of TLS. (cherry picked from commit 24fd63e0970f91189dd2acde987bd2e4c8c04a50) --- sys/sys/cdefs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 4de1ef011756..1e670fd87d6f 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -768,8 +768,7 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__mips) || \ - (defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)) +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) #define __NO_TLS 1 #endif From owner-dev-commits-src-all@freebsd.org Tue Mar 2 00:49:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC8CD5528AC; Tue, 2 Mar 2021 00:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqJSJ5XRZz4Zd5; Tue, 2 Mar 2021 00:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFE7C5797; Tue, 2 Mar 2021 00:49: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 1220nq8N087487; Tue, 2 Mar 2021 00:49:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1220nqrW087486; Tue, 2 Mar 2021 00:49:52 GMT (envelope-from git) Date: Tue, 2 Mar 2021 00:49:52 GMT Message-Id: <202103020049.1220nqrW087486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 73dc6674e08c - stable/13 - Remove __NO_TLS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 73dc6674e08c40151c1500860f60f7b22994a0ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 00:49:53 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=73dc6674e08c40151c1500860f60f7b22994a0ff commit 73dc6674e08c40151c1500860f60f7b22994a0ff Author: Konstantin Belousov AuthorDate: 2021-02-19 15:20:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 00:49:42 +0000 Remove __NO_TLS. MFC note: this plus the merge of two preliminary removal of __NO_TLS definitions for mips and risc-v break ABI. It was decided that doing ABI break on tier 2 platforms at this stage of 13.0 release process is better than drag on __NO_TLS presence for the 13.x branch lifetime. (cherry picked from commit 3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e) --- include/runetype.h | 4 ++-- lib/libc/gen/getutxent.c | 5 ----- lib/libc/gen/utxdb.c | 4 ---- lib/libc/locale/setrunelocale.c | 4 ---- lib/libc/locale/xlocale.c | 15 +-------------- lib/libc/locale/xlocale_private.h | 5 +---- lib/libc/string/strerror.c | 5 ----- lib/libgssapi/gss_display_status.c | 10 ---------- sys/sys/cdefs.h | 4 ---- tests/sys/opencrypto/cryptodevh.py | 1 - 10 files changed, 4 insertions(+), 53 deletions(-) diff --git a/include/runetype.h b/include/runetype.h index 4aca128f8c8a..93007809dbf8 100644 --- a/include/runetype.h +++ b/include/runetype.h @@ -88,7 +88,7 @@ typedef struct { __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; extern const _RuneLocale *_CurrentRuneLocale; -#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) +#ifdef __RUNETYPE_INTERNAL extern const _RuneLocale *__getCurrentRuneLocale(void); #else extern _Thread_local const _RuneLocale *_ThreadRuneLocale; @@ -99,7 +99,7 @@ static __inline const _RuneLocale *__getCurrentRuneLocale(void) return _ThreadRuneLocale; return _CurrentRuneLocale; } -#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ +#endif /*__RUNETYPE_INTERNAL */ #define _CurrentRuneLocale (__getCurrentRuneLocale()) __END_DECLS diff --git a/lib/libc/gen/getutxent.c b/lib/libc/gen/getutxent.c index e0d993221e7e..664498126f13 100644 --- a/lib/libc/gen/getutxent.c +++ b/lib/libc/gen/getutxent.c @@ -40,13 +40,8 @@ __FBSDID("$FreeBSD$"); #include "utxdb.h" #include "un-namespace.h" -#ifdef __NO_TLS -static FILE *uf = NULL; -static int udb; -#else static _Thread_local FILE *uf = NULL; static _Thread_local int udb; -#endif int setutxdb(int db, const char *file) diff --git a/lib/libc/gen/utxdb.c b/lib/libc/gen/utxdb.c index f8dea105702c..3edccdbd2c2f 100644 --- a/lib/libc/gen/utxdb.c +++ b/lib/libc/gen/utxdb.c @@ -128,11 +128,7 @@ utx_to_futx(const struct utmpx *ut, struct futx *fu) struct utmpx * futx_to_utx(const struct futx *fu) { -#ifdef __NO_TLS - static struct utmpx *ut; -#else static _Thread_local struct utmpx *ut; -#endif if (ut == NULL) { ut = calloc(1, sizeof *ut); diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index 2e6fed9466e4..551d32b7ab6a 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -56,12 +56,10 @@ __FBSDID("$FreeBSD$"); #undef _CurrentRuneLocale extern _RuneLocale const *_CurrentRuneLocale; -#ifndef __NO_TLS /* * A cached version of the runes for this thread. Used by ctype.h */ _Thread_local const _RuneLocale *_ThreadRuneLocale; -#endif extern int __mb_sb_limit; @@ -199,7 +197,6 @@ __wrap_setrunelocale(const char *locale) return (_LDP_LOADED); } -#ifndef __NO_TLS void __set_thread_rune_locale(locale_t loc) { @@ -212,7 +209,6 @@ __set_thread_rune_locale(locale_t loc) _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; } } -#endif void * __ctype_load(const char *locale, locale_t unused __unused) diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c index fb674f86bbff..d64262da809e 100644 --- a/lib/libc/locale/xlocale.c +++ b/lib/libc/locale/xlocale.c @@ -55,12 +55,11 @@ extern struct xlocale_component __xlocale_global_messages; extern struct xlocale_component __xlocale_C_collate; extern struct xlocale_component __xlocale_C_ctype; -#ifndef __NO_TLS /* * The locale for this thread. */ _Thread_local locale_t __thread_locale; -#endif + /* * Flag indicating that one or more per-thread locales exist. */ @@ -143,16 +142,6 @@ get_thread_locale(void) pthread_getspecific(locale_info_key)); } -#ifdef __NO_TLS -locale_t -__get_locale(void) -{ - locale_t l = get_thread_locale(); - return (l ? l : &__xlocale_global_locale); - -} -#endif - static void set_thread_locale(locale_t loc) { @@ -172,10 +161,8 @@ set_thread_locale(locale_t loc) } else { pthread_setspecific(locale_info_key, l); } -#ifndef __NO_TLS __thread_locale = l; __set_thread_rune_locale(loc); -#endif } /** diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index 391e375bc03d..bc40f28fc9eb 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -185,7 +185,7 @@ void __set_thread_rune_locale(locale_t loc); * locale has ever been set, then we always use the global locale. */ extern int __has_thread_locale; -#ifndef __NO_TLS + /** * The per-thread locale. Avoids the need to use pthread lookup functions when * getting the per-thread locale. @@ -206,9 +206,6 @@ static inline locale_t __get_locale(void) } return (__thread_locale ? __thread_locale : &__xlocale_global_locale); } -#else -locale_t __get_locale(void); -#endif /** * Two magic values are allowed for locale_t objects. NULL and -1. This diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index 11b9701d968f..bb685e4f7dc9 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -128,16 +128,11 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen) char * strerror_l(int num, locale_t locale) { -#ifndef __NO_TLS static _Thread_local char ebuf[NL_TEXTMAX]; if (strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) errno = EINVAL; return (ebuf); -#else - errno = ENOTSUP; - return (NULL); -#endif } char * diff --git a/lib/libgssapi/gss_display_status.c b/lib/libgssapi/gss_display_status.c index 55ca83ce9aa8..d0c3453a0d6b 100644 --- a/lib/libgssapi/gss_display_status.c +++ b/lib/libgssapi/gss_display_status.c @@ -174,16 +174,6 @@ supplementary_error(OM_uint32 v) return msgs[v]; } -#if defined(__NO_TLS) - -/* - * These platforms don't support TLS on FreeBSD - threads will just - * have to step on each other's error values for now. - */ -#define __thread - -#endif - struct mg_thread_ctx { gss_OID mech; OM_uint32 maj_stat; diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 1e670fd87d6f..d11bee96e10a 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -768,10 +768,6 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) -#define __NO_TLS 1 -#endif - /* * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. diff --git a/tests/sys/opencrypto/cryptodevh.py b/tests/sys/opencrypto/cryptodevh.py index be853f496930..c5719e47c8c1 100644 --- a/tests/sys/opencrypto/cryptodevh.py +++ b/tests/sys/opencrypto/cryptodevh.py @@ -133,7 +133,6 @@ __POSIX_VISIBLE = 200809 __XSI_VISIBLE = 700 __BSD_VISIBLE = 1 __ISO_C_VISIBLE = 2011 -__NO_TLS = 1 CRYPTO_DRIVERS_INITIAL = 4 CRYPTO_SW_SESSIONS = 32 NULL_HASH_LEN = 16 From owner-dev-commits-src-all@freebsd.org Tue Mar 2 01:08:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64480552E47; Tue, 2 Mar 2021 01:08: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 4DqJsG2Rz7z4bXG; Tue, 2 Mar 2021 01:08: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 474D95938; Tue, 2 Mar 2021 01:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122182TV013917; Tue, 2 Mar 2021 01:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122182uA013916; Tue, 2 Mar 2021 01:08:02 GMT (envelope-from git) Date: Tue, 2 Mar 2021 01:08:02 GMT Message-Id: <202103020108.122182uA013916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: b22315c7983a - stable/13 - cardbus: Be sure to acquire Giant when calling into newbus MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b22315c7983a03538f3f2a96aa20f0d119555087 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 01:08:02 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b22315c7983a03538f3f2a96aa20f0d119555087 commit b22315c7983a03538f3f2a96aa20f0d119555087 Author: Warner Losh AuthorDate: 2021-02-27 07:00:52 +0000 Commit: Warner Losh CommitDate: 2021-03-02 01:07:50 +0000 cardbus: Be sure to acquire Giant when calling into newbus Acquire Giant in cardbus_detach_card. This used to be done above us, but no more. Tested by: kargl@ MFC After: 3 days (cherry picked from commit c01da939b0998f8de068a23c9016c377e761255e) --- sys/dev/cardbus/cardbus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 391267944ec4..50a21dfc0b82 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -256,10 +256,11 @@ cardbus_detach_card(device_t cbdev) { int err = 0; + mtx_lock(&Giant); err = bus_generic_detach(cbdev); - if (err) - return (err); - err = device_delete_children(cbdev); + if (err == 0) + err = device_delete_children(cbdev); + mtx_unlock(&Giant); if (err) return (err); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 02:10:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 962AA555C4C; Tue, 2 Mar 2021 02:10: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 4DqLFt3vfPz4gBZ; Tue, 2 Mar 2021 02:10: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 77650672C; Tue, 2 Mar 2021 02:10: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 1222AwxJ001680; Tue, 2 Mar 2021 02:10:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1222Awlj001679; Tue, 2 Mar 2021 02:10:58 GMT (envelope-from git) Date: Tue, 2 Mar 2021 02:10:58 GMT Message-Id: <202103020210.1222Awlj001679@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: 7f72497ef756 - main - libc: Use musl's optimized strchr and strchrnul 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: 7f72497ef756ff7d03d5560c2d1c1f92f73fcb52 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 02:10:58 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7f72497ef756ff7d03d5560c2d1c1f92f73fcb52 commit 7f72497ef756ff7d03d5560c2d1c1f92f73fcb52 Author: Ed Maste AuthorDate: 2021-03-02 01:57:36 +0000 Commit: Ed Maste CommitDate: 2021-03-02 02:09:59 +0000 libc: Use musl's optimized strchr and strchrnul Parentheses added to HASZERO macro to avoid a GCC warning, and formatted with clang-format as we have adopted these and don't consider them 'contrib' code. Obtained from: musl (snapshot at commit 4d0a82170a25) Reviewed by: kib (libc integration), mjg (both earlier) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17630 --- lib/libc/string/strchr.c | 65 +++++++++++----------------- lib/libc/string/strchrnul.c | 75 +++++++++++++++++++-------------- libexec/rtld-elf/rtld-libc/Makefile.inc | 4 +- stand/libsa/Makefile | 2 +- 4 files changed, 70 insertions(+), 76 deletions(-) diff --git a/lib/libc/string/strchr.c b/lib/libc/string/strchr.c index 61244da4519c..4a20ea658252 100644 --- a/lib/libc/string/strchr.c +++ b/lib/libc/string/strchr.c @@ -1,56 +1,39 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: MIT * - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2005-2014 Rich Felker, et al. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)index.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); -#include #include +char *__strchrnul(const char *, int); + char * -strchr(const char *p, int ch) +strchr(const char *s, int c) { - char c; - - c = ch; - for (;; ++p) { - if (*p == c) - return ((char *)p); - if (*p == '\0') - return (NULL); - } - /* NOTREACHED */ + char *r = __strchrnul(s, c); + return *(unsigned char *)r == (unsigned char)c ? r : NULL; } __weak_reference(strchr, index); diff --git a/lib/libc/string/strchrnul.c b/lib/libc/string/strchrnul.c index 1c777be1854f..e1fb83886042 100644 --- a/lib/libc/string/strchrnul.c +++ b/lib/libc/string/strchrnul.c @@ -1,51 +1,62 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: MIT * - * Copyright (c) 2013 Niclas Zeising + * Copyright (c) 2005-2014 Rich Felker, et al. * - * 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. + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include -__weak_reference(__strchrnul, strchrnul); +#define ALIGN (sizeof(size_t)) +#define ONES ((size_t)-1 / UCHAR_MAX) +#define HIGHS (ONES * (UCHAR_MAX / 2 + 1)) +#define HASZERO(x) (((x)-ONES) & ~(x)&HIGHS) char *__strchrnul(const char *, int); char * -__strchrnul(const char *p, int ch) +__strchrnul(const char *s, int c) { - char c; + c = (unsigned char)c; + if (!c) + return (char *)s + strlen(s); - c = ch; - for (;; ++p) { - if (*p == c || *p == '\0') - return ((char *)p); - } - /* NOTREACHED */ +#ifdef __GNUC__ + typedef size_t __attribute__((__may_alias__)) word; + const word *w; + for (; (uintptr_t)s % ALIGN; s++) + if (!*s || *(unsigned char *)s == c) + return (char *)s; + size_t k = ONES * c; + for (w = (void *)s; !HASZERO(*w) && !HASZERO(*w ^ k); w++) + ; + s = (void *)w; +#endif + for (; *s && *(unsigned char *)s != c; s++) + ; + return (char *)s; } +__weak_reference(__strchrnul, strchrnul); diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index d682472c3cca..d5f5993e3f16 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -41,8 +41,8 @@ CFLAGS.errlst.c+=-I${LIBC_SRCTOP}/include # Use the string and memory .o files from libc instead of rebuilding them (they # might be using optimized assembly and duplicating that logic here is awkward). _libc_string_objects= bcmp bcopy bzero memset memchr memcmp memcpy memmove \ - stpncpy strcat strchr strcmp stpcpy strcpy strcspn strdup strlcat strlcpy \ - strlen strncmp strncpy strrchr strsep strspn strstr strtok + stpncpy strcat strchr strchrnul strcmp stpcpy strcpy strcspn strdup \ + strlcat strlcpy strlen strncmp strncpy strrchr strsep strspn strstr strtok # Also use all the syscall .o files from libc_nossp_pic: _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \ cerror geteuid getegid sigfastblock munmap mprotect \ diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 6fe916405fe4..838fefb260a8 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -29,7 +29,7 @@ SRCS+= ntoh.c .PATH: ${LIBCSRC}/string SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ - strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ + strcat.c strchr.c strchrnul.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ strnlen.c strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c From owner-dev-commits-src-all@freebsd.org Tue Mar 2 04:34:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD7F455A2AE; Tue, 2 Mar 2021 04:34:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqPRH50r5z4pQL; Tue, 2 Mar 2021 04:34: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 9DFAB10B80; Tue, 2 Mar 2021 04:34: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 1224YJsh091003; Tue, 2 Mar 2021 04:34:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1224YJrm091002; Tue, 2 Mar 2021 04:34:19 GMT (envelope-from git) Date: Tue, 2 Mar 2021 04:34:19 GMT Message-Id: <202103020434.1224YJrm091002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: b85a67f54a40 - main - Optimize TX coalescing by keeping pointer to last mbuf. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b85a67f54a40053e75658a17c620b89bafaba67f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 04:34:19 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=b85a67f54a40053e75658a17c620b89bafaba67f commit b85a67f54a40053e75658a17c620b89bafaba67f Author: Alexander Motin AuthorDate: 2021-03-02 04:31:34 +0000 Commit: Alexander Motin CommitDate: 2021-03-02 04:34:11 +0000 Optimize TX coalescing by keeping pointer to last mbuf. Before m_cat() each time traversed through all the coalesced chain. MFC after: 1 week --- sys/dev/iscsi/icl_soft.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index a5696647169a..c66d8ccdb5fd 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -849,6 +849,7 @@ static void icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) { struct icl_pdu *request, *request2; + struct mbuf *m; struct socket *so; long available, size, size2; int coalesced, error; @@ -908,8 +909,8 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) return; } if (coalesce) { - coalesced = 1; - for (;;) { + m = request->ip_bhs_mbuf; + for (coalesced = 1; ; coalesced++) { request2 = STAILQ_FIRST(queue); if (request2 == NULL) break; @@ -926,13 +927,14 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) icl_conn_fail(ic); return; } - m_cat(request->ip_bhs_mbuf, request2->ip_bhs_mbuf); + while (m->m_next) + m = m->m_next; + m_cat(m, request2->ip_bhs_mbuf); request2->ip_bhs_mbuf = NULL; request->ip_bhs_mbuf->m_pkthdr.len += size2; size += size2; STAILQ_REMOVE_AFTER(queue, request, ip_next); icl_soft_pdu_done(request2, 0); - coalesced++; } #if 0 if (coalesced > 1) { From owner-dev-commits-src-all@freebsd.org Tue Mar 2 07:02:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3A6A55E524; Tue, 2 Mar 2021 07:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqSk05gPhz3Cwp; Tue, 2 Mar 2021 07:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B57FE1255C; Tue, 2 Mar 2021 07:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12272GEi085314; Tue, 2 Mar 2021 07:02:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12272GYX085313; Tue, 2 Mar 2021 07:02:16 GMT (envelope-from git) Date: Tue, 2 Mar 2021 07:02:16 GMT Message-Id: <202103020702.12272GYX085313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Grehan Subject: git: 95331c228a39 - main - Import wireguard fixes from pfSense 2.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95331c228a39b44cb96c4d0142ed8afec8a4d063 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 07:02:16 -0000 The branch main has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=95331c228a39b44cb96c4d0142ed8afec8a4d063 commit 95331c228a39b44cb96c4d0142ed8afec8a4d063 Author: Peter Grehan AuthorDate: 2021-02-27 04:15:04 +0000 Commit: Peter Grehan CommitDate: 2021-03-02 04:55:46 +0000 Import wireguard fixes from pfSense 2.5 Merge the following fixes from https://github.com/pfsense/FreeBSD-src 1940e7d3 Save address of ingress packets to allow wg to work on HA 8f5531f1 Fix connection to IPv6 endpoint 825ed9ee Fix tcpdump for wg IPv6 rx tunnel traffic 2ec232d3 Fix issue with replying to INITIATION messages in server mode ec77593a Return immediately in wg_init if in DETACH'd state 0f0dde6f Remove unnecessary wg debug printf on transmit 2766dc94 Detect and fix case in wg_init() where sockets weren't cleaned up b62cc7ac Close the UDP tunnel sockets when the interface has been stopped Reviewed by: kevans Obtained from: pfSense 2.5 MFC after: 3 days Relnotes: yes Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28962 --- sys/dev/if_wg/module/if_wg_session.c | 45 +++++++++++++++++++++++++++++++++--- sys/dev/if_wg/module/module.c | 23 ++++++++++++++---- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index 54e63d053847..084bc789039d 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1394,8 +1394,8 @@ wg_deliver_in(struct wg_peer *peer) CURVNET_SET(inp->inp_vnet); ip_input(m); CURVNET_RESTORE(); - } else if (version == 6) { - af = AF_INET; + } else if (version == 6) { + af = AF_INET6; BPF_MTAP2(sc->sc_ifp, &af, sizeof(af), m); inp = sotoinpcb(so->so_so6); CURVNET_SET(inp->inp_vnet); @@ -1531,6 +1531,7 @@ wg_handshake(struct wg_softc *sc, struct mbuf *m) peer = CONTAINER_OF(remote, struct wg_peer, p_remote); DPRINTF(sc, "Receiving handshake initiation from peer %llu\n", (unsigned long long)peer->p_id); + wg_peer_set_endpoint_from_tag(peer, t); res = wg_send_response(peer); if (res == 0 && noise_remote_begin_session(&peer->p_remote) == 0) wg_timers_event_session_derived(&peer->p_timers); @@ -1851,6 +1852,40 @@ wg_index_drop(struct wg_softc *sc, uint32_t key0) SLIST_INSERT_HEAD(&peer->p_unused_index, iter, i_unused_entry); } +static int +wg_update_endpoint_addrs(struct wg_endpoint *e, const struct sockaddr *srcsa, + struct ifnet *rcvif) +{ + const struct sockaddr_in *sa4; + const struct sockaddr_in6 *sa6; + int ret = 0; + + /* + * UDP passes a 2-element sockaddr array: first element is the + * source addr/port, second the destination addr/port. + */ + if (srcsa->sa_family == AF_INET) { + sa4 = (const struct sockaddr_in *)srcsa; + e->e_remote.r_sin = sa4[0]; + /* Only update dest if not mcast/bcast */ + if (!(IN_MULTICAST(ntohl(sa4[1].sin_addr.s_addr)) || + sa4[1].sin_addr.s_addr == INADDR_BROADCAST || + in_broadcast(sa4[1].sin_addr, rcvif))) { + e->e_local.l_in = sa4[1].sin_addr; + } + } else if (srcsa->sa_family == AF_INET6) { + sa6 = (const struct sockaddr_in6 *)srcsa; + e->e_remote.r_sin6 = sa6[0]; + /* Only update dest if not multicast */ + if (!IN6_IS_ADDR_MULTICAST(&sa6[1].sin6_addr)) + e->e_local.l_in6 = sa6[1].sin6_addr; + } else { + ret = EAFNOSUPPORT; + } + + return (ret); +} + static void wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, const struct sockaddr *srcsa, void *_sc) @@ -1882,7 +1917,11 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, goto free; } e = wg_mbuf_endpoint_get(m); - e->e_remote.r_sa = *srcsa; + + if (wg_update_endpoint_addrs(e, srcsa, m->m_pkthdr.rcvif)) { + DPRINTF(sc, "unknown family\n"); + goto free; + } verify_endpoint(m); if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); diff --git a/sys/dev/if_wg/module/module.c b/sys/dev/if_wg/module/module.c index 76c7db01cba1..a40a304616c7 100644 --- a/sys/dev/if_wg/module/module.c +++ b/sys/dev/if_wg/module/module.c @@ -255,7 +255,6 @@ wg_transmit(struct ifnet *ifp, struct mbuf *m) peer = wg_route_lookup(&sc->sc_routes, m, OUT); if (__predict_false(peer == NULL)) { rc = ENOKEY; - printf("peer not found - dropping %p\n", m); /* XXX log */ goto err; } @@ -360,8 +359,15 @@ wg_init(if_ctx_t ctx) struct wg_softc *sc; int rc; + if (iflib_in_detach(ctx)) + return; + sc = iflib_get_softc(ctx); ifp = iflib_get_ifp(ctx); + if (sc->sc_socket.so_so4 != NULL) + printf("XXX wg_init, socket non-NULL %p\n", + sc->sc_socket.so_so4); + wg_socket_reinit(sc, NULL, NULL); rc = wg_socket_init(sc); if (rc) return; @@ -377,6 +383,7 @@ wg_stop(if_ctx_t ctx) sc = iflib_get_softc(ctx); ifp = iflib_get_ifp(ctx); if_link_state_change(ifp, LINK_STATE_DOWN); + wg_socket_reinit(sc, NULL, NULL); } static nvlist_t * @@ -386,13 +393,20 @@ wg_peer_to_nvl(struct wg_peer *peer) int i, count; nvlist_t *nvl; caddr_t key; + size_t sa_sz; struct wg_allowedip *aip; + struct wg_endpoint *ep; if ((nvl = nvlist_create(0)) == NULL) return (NULL); key = peer->p_remote.r_public; nvlist_add_binary(nvl, "public-key", key, WG_KEY_SIZE); - nvlist_add_binary(nvl, "endpoint", &peer->p_endpoint.e_remote, sizeof(struct sockaddr)); + ep = &peer->p_endpoint; + if (ep->e_remote.r_sa.sa_family != 0) { + sa_sz = (ep->e_remote.r_sa.sa_family == AF_INET) ? + sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); + nvlist_add_binary(nvl, "endpoint", &ep->e_remote, sa_sz); + } i = count = 0; CK_LIST_FOREACH(rt, &peer->p_routes, r_entry) { count++; @@ -587,13 +601,12 @@ wg_peer_add(struct wg_softc *sc, const nvlist_t *nvl) } if (nvlist_exists_binary(nvl, "endpoint")) { endpoint = nvlist_get_binary(nvl, "endpoint", &size); - if (size != sizeof(*endpoint)) { + if (size > sizeof(peer->p_endpoint.e_remote)) { device_printf(dev, "%s bad length for endpoint %zu\n", __func__, size); err = EBADMSG; goto out; } - memcpy(&peer->p_endpoint.e_remote, endpoint, - sizeof(peer->p_endpoint.e_remote)); + memcpy(&peer->p_endpoint.e_remote, endpoint, size); } if (nvlist_exists_binary(nvl, "pre-shared-key")) { const void *key; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 09:20:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2E8A5622FB; Tue, 2 Mar 2021 09:20: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 4DqWng4hWtz3LbG; Tue, 2 Mar 2021 09:20: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 9408C1439D; Tue, 2 Mar 2021 09:20: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 1229KdlU069346; Tue, 2 Mar 2021 09:20:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1229KdmU069345; Tue, 2 Mar 2021 09:20:39 GMT (envelope-from git) Date: Tue, 2 Mar 2021 09:20:39 GMT Message-Id: <202103020920.1229KdmU069345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: 43afeee2fbf9 - main - share/man/man9: document zero_region(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43afeee2fbf99e51ffd0006e6bb4adcbbd80a6f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 09:20:39 -0000 The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=43afeee2fbf99e51ffd0006e6bb4adcbbd80a6f4 commit 43afeee2fbf99e51ffd0006e6bb4adcbbd80a6f4 Author: Ka Ho Ng AuthorDate: 2021-03-02 09:14:05 +0000 Commit: Philip Paeps CommitDate: 2021-03-02 09:14:06 +0000 share/man/man9: document zero_region(9) The zero_region() kernel interface was previously undocumented. Add a new zero_region(9) manual page to document it. Submitted by: Ka Ho Ng Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28914 --- share/man/man9/Makefile | 1 + share/man/man9/zero_region.9 | 86 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 50e760d3e047..64e234c3d696 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -442,6 +442,7 @@ MAN= accept_filter.9 \ vrele.9 \ vslock.9 \ watchdog.9 \ + zero_region.9 \ zone.9 MLINKS= unr.9 alloc_unr.9 \ diff --git a/share/man/man9/zero_region.9 b/share/man/man9/zero_region.9 new file mode 100644 index 000000000000..27b1b50be14d --- /dev/null +++ b/share/man/man9/zero_region.9 @@ -0,0 +1,86 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 2, 2021 +.Dt ZERO_REGION 9 +.Os +.Sh NAME +.Nm zero_region +.Nd Read-only region prefilled with zeroes +.Sh SYNOPSIS +.In sys/param.h +.In sys/systm.h +.In vm/vm_param.h +.Vt extern const void *zero_region ; +.Sh DESCRIPTION +The global variable +.Va zero_region +points to a read-only region prefilled with zeroes. +The size of the region is specified by the +.Dv ZERO_REGION_SIZE +macro. +.Sh IMPLEMENTATION NOTES +The region +.Va zero_region +points to is mapped to the same page multiple times. +.Sh EXAMPLES +.Bd -literal +/* + * This function writes zeroes to the vnode at offset 0 + * with ZERO_REGION_SIZE length. + */ +static int +write_example(struct vnode *vp) +{ + struct thread *td; + struct iovec aiov; + struct uio auio; + int error; + + td = curthread; + + aiov.iov_base = __DECONST(void *, zero_region); + aiov.iov_len = ZERO_REGION_SIZE; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = 0; + auio.uio_resid = ZERO_REGION_SIZE; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = td; + + error = VOP_WRITE(vp, &auio, 0, td->td_ucred); + return (error); +} +.Ed +.Sh SEE ALSO +.Xr pmap 9 , +.Xr vm_map 9 +.Sh AUTHORS +This manual page was written by +.An Ka Ho Ng Aq Mt khng@FreeBSDFoundation.org +under sponsorship from the FreeBSD Foundation. From owner-dev-commits-src-all@freebsd.org Tue Mar 2 09:48:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F1D0563637; Tue, 2 Mar 2021 09:48: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 4DqXQD3vQqz3NBk; Tue, 2 Mar 2021 09:48: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 74682145E4; Tue, 2 Mar 2021 09:48: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 1229mqWM000937; Tue, 2 Mar 2021 09:48:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1229mqgr000936; Tue, 2 Mar 2021 09:48:52 GMT (envelope-from git) Date: Tue, 2 Mar 2021 09:48:52 GMT Message-Id: <202103020948.1229mqgr000936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: a9f7eba95971 - main - ipfw: add IPv6 support for sockarg opcode. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9f7eba9597189c0e438f6986067d31dca1c53b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 09:48:52 -0000 The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=a9f7eba9597189c0e438f6986067d31dca1c53b0 commit a9f7eba9597189c0e438f6986067d31dca1c53b0 Author: Andrey V. Elsukov AuthorDate: 2021-03-02 09:45:59 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-03-02 09:45:59 +0000 ipfw: add IPv6 support for sockarg opcode. MFC after: 1 week Sponsored by: Yandex LLC --- sys/netpfil/ipfw/ip_fw2.c | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index 7b6cca68fd11..f03180cd3bca 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -2620,9 +2620,7 @@ do { \ #ifndef USERSPACE /* not supported in userspace */ struct inpcb *inp = args->inp; struct inpcbinfo *pi; - - if (is_ipv6) /* XXX can we remove this ? */ - break; + bool inp_locked = false; if (proto == IPPROTO_TCP) pi = &V_tcbinfo; @@ -2638,27 +2636,37 @@ do { \ * certainly be inp_user_cookie? */ - /* For incoming packet, lookup up the - inpcb using the src/dest ip/port tuple */ - if (inp == NULL) { - inp = in_pcblookup(pi, - src_ip, htons(src_port), - dst_ip, htons(dst_port), - INPLOOKUP_RLOCKPCB, NULL); - if (inp != NULL) { - tablearg = - inp->inp_socket->so_user_cookie; - if (tablearg) - match = 1; - INP_RUNLOCK(inp); - } - } else { + /* + * For incoming packet lookup the inpcb + * using the src/dest ip/port tuple. + */ + if (is_ipv4 && inp == NULL) { + inp = in_pcblookup(pi, + src_ip, htons(src_port), + dst_ip, htons(dst_port), + INPLOOKUP_RLOCKPCB, NULL); + inp_locked = true; + } +#ifdef INET6 + if (is_ipv6 && inp == NULL) { + inp = in6_pcblookup(pi, + &args->f_id.src_ip6, + htons(src_port), + &args->f_id.dst_ip6, + htons(dst_port), + INPLOOKUP_RLOCKPCB, NULL); + inp_locked = true; + } +#endif /* INET6 */ + if (inp != NULL) { if (inp->inp_socket) { tablearg = inp->inp_socket->so_user_cookie; if (tablearg) match = 1; } + if (inp_locked) + INP_RUNLOCK(inp); } #endif /* !USERSPACE */ break; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 09:57:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7CD5563B54; Tue, 2 Mar 2021 09:57: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 4DqXcD3mfwz3NpJ; Tue, 2 Mar 2021 09:57:32 +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 1229vGjl032070 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 2 Mar 2021 10:57:16 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 1229vGhI013436; Tue, 2 Mar 2021 10:57:16 +0100 Date: Tue, 2 Mar 2021 10:57:16 +0100 From: Lutz Donnerhacke To: "Andrey V. Elsukov" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a9f7eba95971 - main - ipfw: add IPv6 support for sockarg opcode. Message-ID: <20210302095716.GA13378@belenus.iks-jena.de> References: <202103020948.1229mqgr000936@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202103020948.1229mqgr000936@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: 4DqXcD3mfwz3NpJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 09:57:32 -0000 On Tue, Mar 02, 2021 at 09:48:52AM +0000, Andrey V. Elsukov wrote: > The branch main has been updated by ae: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a9f7eba9597189c0e438f6986067d31dca1c53b0 > > commit a9f7eba9597189c0e438f6986067d31dca1c53b0 > Author: Andrey V. Elsukov > AuthorDate: 2021-03-02 09:45:59 +0000 > Commit: Andrey V. Elsukov > CommitDate: 2021-03-02 09:45:59 +0000 > > ipfw: add IPv6 support for sockarg opcode. > > MFC after: 1 week > Sponsored by: Yandex LLC Can you please use Phabricator next time? From owner-dev-commits-src-all@freebsd.org Tue Mar 2 11:36:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12A9C565BDF; Tue, 2 Mar 2021 11:36: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 4DqZp804mwz3ktj; Tue, 2 Mar 2021 11:36: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 E9BFE160C3; Tue, 2 Mar 2021 11:36: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 122BaFv4045243; Tue, 2 Mar 2021 11:36:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122BaFnu045242; Tue, 2 Mar 2021 11:36:15 GMT (envelope-from git) Date: Tue, 2 Mar 2021 11:36:15 GMT Message-Id: <202103021136.122BaFnu045242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 99adf2300612 - main - RACK: fix an issue triggered by using the CDG CC module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99adf230061268175a36061130e6adb0882270e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 11:36:16 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=99adf230061268175a36061130e6adb0882270e8 commit 99adf230061268175a36061130e6adb0882270e8 Author: Michael Tuexen AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 11:32:16 +0000 RACK: fix an issue triggered by using the CDG CC module Obtained from: rrs@ MFC after: 3 days PR: 238741 Sponsored by: Netlix, Inc. --- sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index abb1cd53103a..98a6f0f2e924 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -12305,7 +12305,7 @@ again: sb_offset = tp->snd_nxt - tp->snd_una; else sb_offset = 0; - if ((IN_RECOVERY(tp->t_flags) == 0) || rack->rack_no_prr) { + if ((IN_FASTRECOVERY(tp->t_flags) == 0) || rack->rack_no_prr) { if (rack->r_ctl.rc_tlp_new_data) { /* TLP is forcing out new data */ if (rack->r_ctl.rc_tlp_new_data > (uint32_t) (avail - sb_offset)) { @@ -12319,7 +12319,7 @@ again: new_data_tlp = doing_tlp = 1; } else len = rack_what_can_we_send(tp, rack, cwnd_to_use, avail, sb_offset); - if (IN_RECOVERY(tp->t_flags) && (len > segsiz)) { + if (IN_FASTRECOVERY(tp->t_flags) && (len > segsiz)) { /* * For prr=off, we need to send only 1 MSS * at a time. We do this because another sack could From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:27:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB576567F7D; Tue, 2 Mar 2021 12:27: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 4DqbxG6Jr7z3pDS; Tue, 2 Mar 2021 12:27: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 C827E16A5E; Tue, 2 Mar 2021 12:27: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 122CRUum011302; Tue, 2 Mar 2021 12:27:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122CRUDH011301; Tue, 2 Mar 2021 12:27:30 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:27:30 GMT Message-Id: <202103021227.122CRUDH011301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: ee21ee1572d4 - main - openzfs: attach pam_zfs_key to build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee21ee1572d40a3b74f18638dae38c1a9ad1e9e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:27:31 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=ee21ee1572d40a3b74f18638dae38c1a9ad1e9e3 commit ee21ee1572d40a3b74f18638dae38c1a9ad1e9e3 Author: Greg V AuthorDate: 2021-03-02 11:01:14 +0000 Commit: Ryan Moeller CommitDate: 2021-03-02 12:26:59 +0000 openzfs: attach pam_zfs_key to build This PAM module allows unlocking encrypted user home datasets when logging in (and changing passphrase when changing the account password), see https://github.com/openzfs/zfs/pull/9903 Also supposed to unload the key when the last session for the user is done, but there are EBUSY issues: https://github.com/openzfs/zfs/issues/11222#issuecomment-731897858 Submitted by: Greg V Reviewed by: mm MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28018 --- cddl/lib/Makefile | 7 ++++++- cddl/lib/pam_zfs_key/Makefile | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile index 2f360a8684a2..ae6862f70443 100644 --- a/cddl/lib/Makefile +++ b/cddl/lib/Makefile @@ -17,7 +17,8 @@ SUBDIR= drti \ ${_libzfs} \ ${_libzfsbootenv} \ ${_libzpool} \ - ${_libzutil} + ${_libzutil} \ + ${_pam_zfs_key} SUBDIR.${MK_TESTS}+= tests @@ -30,6 +31,9 @@ _libzutil= libzutil _libzfsbootenv= libzfsbootenv _libzpool= libzpool _libtpool= libtpool +.if ${MK_OPENSSL} != "no" +_pam_zfs_key= pam_zfs_key +.endif .endif SUBDIR_DEPEND_libctf= libspl @@ -41,6 +45,7 @@ SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core libzutil SUBDIR_DEPEND_libzpool= libavl libnvpair libumem libicp SUBDIR_DEPEND_libzutil= libavl libtpool SUBDIR_DEPEND_libzfsbootenv= libzfs libnvpair +SUBDIR_DEPEND_pam_zfs_key= libnvpair libuutil libzfs libzfs_core SUBDIR_PARALLEL= diff --git a/cddl/lib/pam_zfs_key/Makefile b/cddl/lib/pam_zfs_key/Makefile new file mode 100644 index 000000000000..cf43802090dd --- /dev/null +++ b/cddl/lib/pam_zfs_key/Makefile @@ -0,0 +1,28 @@ +.PATH: ${SRCTOP}/sys/contrib/openzfs/contrib/pam_zfs_key +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + +PACKAGE= utilities +LIB= pam_zfs_key + +SHLIBDIR?= /usr/lib + +LIBADD= zfs zfs_core nvpair uutil crypto + +SRCS= pam_zfs_key.c + +WARNS?= 2 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -DRUNSTATEDIR=\"/var/run\" + +.include "../../lib/libpam/modules/Makefile.inc" +.include From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:47:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 125B15686AE; Tue, 2 Mar 2021 12:47: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 4DqcNQ03Fnz3qG1; Tue, 2 Mar 2021 12:47: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 E4B7816BDA; Tue, 2 Mar 2021 12:47:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122ClXV4037541; Tue, 2 Mar 2021 12:47:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122ClXbw037540; Tue, 2 Mar 2021 12:47:33 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:47:33 GMT Message-Id: <202103021247.122ClXbw037540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 459f1b906515 - stable/13 - sctp: improve consistency MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 459f1b906515076b7ce30a06ab69a60891d8cbe8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:47:34 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=459f1b906515076b7ce30a06ab69a60891d8cbe8 commit 459f1b906515076b7ce30a06ab69a60891d8cbe8 Author: Michael Tuexen AuthorDate: 2021-01-23 19:56:45 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:22:40 +0000 sctp: improve consistency No functional change intended. (cherry picked from commit 7a051c0a7890dc8e490ebe125bfc70a28e89ddaf) --- sys/netinet/sctp_input.c | 2 +- sys/netinet/sctp_output.c | 18 +++++++++--------- sys/netinet/sctp_structs.h | 32 ++++++++++++++++---------------- sys/netinet/sctputil.c | 6 +++--- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 1606e4d9d1cf..43a2b06d1c79 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1871,9 +1871,9 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, asoc->strmout[i].abandoned_sent[0] = 0; asoc->strmout[i].abandoned_unsent[0] = 0; #endif - stcb->asoc.strmout[i].sid = i; stcb->asoc.strmout[i].next_mid_ordered = 0; stcb->asoc.strmout[i].next_mid_unordered = 0; + stcb->asoc.strmout[i].sid = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; } TAILQ_FOREACH_SAFE(strrst, &asoc->resetHead, next_resp, nstrrst) { diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index d8cf063c6b53..67b1aad32f1c 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -3629,9 +3629,8 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er } for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], NULL); stcb->asoc.strmout[i].chunks_on_queues = 0; - stcb->asoc.strmout[i].next_mid_ordered = 0; - stcb->asoc.strmout[i].next_mid_unordered = 0; #if defined(SCTP_DETAILED_STR_STATS) for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { stcb->asoc.strmout[i].abandoned_sent[j] = 0; @@ -3641,10 +3640,11 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er stcb->asoc.strmout[i].abandoned_sent[0] = 0; stcb->asoc.strmout[i].abandoned_unsent[0] = 0; #endif + stcb->asoc.strmout[i].next_mid_ordered = 0; + stcb->asoc.strmout[i].next_mid_unordered = 0; stcb->asoc.strmout[i].sid = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.strmout[i].state = SCTP_STREAM_OPENING; - stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], NULL); } } break; @@ -12136,18 +12136,18 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb, stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 0, 1); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); - stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; - stcb->asoc.strmout[i].next_mid_ordered = oldstream[i].next_mid_ordered; - stcb->asoc.strmout[i].next_mid_unordered = oldstream[i].next_mid_unordered; - stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; - stcb->asoc.strmout[i].sid = i; - stcb->asoc.strmout[i].state = oldstream[i].state; /* FIX ME FIX ME */ /* * This should be a SS_COPY operation FIX ME STREAM * SCHEDULER EXPERT */ stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], &oldstream[i]); + stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; + stcb->asoc.strmout[i].next_mid_ordered = oldstream[i].next_mid_ordered; + stcb->asoc.strmout[i].next_mid_unordered = oldstream[i].next_mid_unordered; + stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; + stcb->asoc.strmout[i].sid = i; + stcb->asoc.strmout[i].state = oldstream[i].state; /* now anything on those queues? */ TAILQ_FOREACH_SAFE(sp, &oldstream[i].outqueue, next, nsp) { TAILQ_REMOVE(&oldstream[i].outqueue, sp, next); diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h index 52fe30098ad7..a22dac047971 100644 --- a/sys/netinet/sctp_structs.h +++ b/sys/netinet/sctp_structs.h @@ -548,6 +548,20 @@ struct sctp_stream_in { TAILQ_HEAD(sctpwheel_listhead, sctp_stream_out); TAILQ_HEAD(sctplist_listhead, sctp_stream_queue_pending); +/* + * This union holds all data necessary for + * different stream schedulers. + */ +struct scheduling_data { + struct sctp_stream_out *locked_on_sending; + /* circular looking for output selection */ + struct sctp_stream_out *last_out_stream; + union { + struct sctpwheel_listhead wheel; + struct sctplist_listhead list; + } out; +}; + /* Round-robin schedulers */ struct ss_rr { /* next link in wheel */ @@ -570,20 +584,6 @@ struct ss_fb { int32_t rounds; }; -/* - * This union holds all data necessary for - * different stream schedulers. - */ -struct scheduling_data { - struct sctp_stream_out *locked_on_sending; - /* circular looking for output selection */ - struct sctp_stream_out *last_out_stream; - union { - struct sctpwheel_listhead wheel; - struct sctplist_listhead list; - } out; -}; - /* * This union holds all parameters per stream * necessary for different stream schedulers. @@ -601,8 +601,6 @@ union scheduling_parameters { #define SCTP_STREAM_RESET_PENDING 0x03 #define SCTP_STREAM_RESET_IN_FLIGHT 0x04 -#define SCTP_MAX_STREAMS_AT_ONCE_RESET 200 - /* This struct is used to track the traffic on outbound streams */ struct sctp_stream_out { struct sctp_streamhead outqueue; @@ -627,6 +625,8 @@ struct sctp_stream_out { uint8_t state; }; +#define SCTP_MAX_STREAMS_AT_ONCE_RESET 200 + /* used to keep track of the addresses yet to try to add/delete */ TAILQ_HEAD(sctp_asconf_addrhead, sctp_asconf_addr); struct sctp_asconf_addr { diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 7772ebd57327..084b7bd6af72 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1291,9 +1291,8 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, * that were dropped must be notified to the upper layer as * failed to send. */ - asoc->strmout[i].next_mid_ordered = 0; - asoc->strmout[i].next_mid_unordered = 0; TAILQ_INIT(&asoc->strmout[i].outqueue); + asoc->ss_functions.sctp_ss_init_stream(stcb, &asoc->strmout[i], NULL); asoc->strmout[i].chunks_on_queues = 0; #if defined(SCTP_DETAILED_STR_STATS) for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { @@ -1304,10 +1303,11 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, asoc->strmout[i].abandoned_sent[0] = 0; asoc->strmout[i].abandoned_unsent[0] = 0; #endif + asoc->strmout[i].next_mid_ordered = 0; + asoc->strmout[i].next_mid_unordered = 0; asoc->strmout[i].sid = i; asoc->strmout[i].last_msg_incomplete = 0; asoc->strmout[i].state = SCTP_STREAM_OPENING; - asoc->ss_functions.sctp_ss_init_stream(stcb, &asoc->strmout[i], NULL); } asoc->ss_functions.sctp_ss_init(stcb, asoc, 0); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:50:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 942925684AE; Tue, 2 Mar 2021 12:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqcSG3qrdz3qP3; Tue, 2 Mar 2021 12:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7684B17116; Tue, 2 Mar 2021 12:50: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 122CosRM046347; Tue, 2 Mar 2021 12:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122CosQw046346; Tue, 2 Mar 2021 12:50:54 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:50:54 GMT Message-Id: <202103021250.122CosQw046346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 21398f02b0c7 - stable/13 - sctp: fix PR-SCTP stats when adding addtional streams MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 21398f02b0c7913f815ae6ded426da60d92c635b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:50:54 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=21398f02b0c7913f815ae6ded426da60d92c635b commit 21398f02b0c7913f815ae6ded426da60d92c635b Author: Michael Tuexen AuthorDate: 2021-01-23 23:50:33 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:27:13 +0000 sctp: fix PR-SCTP stats when adding addtional streams (cherry picked from commit 0f7573ffd6141b19419c9a6238246b9ba0e6dce6) --- sys/netinet/sctp_output.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 67b1aad32f1c..d58ebf785238 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12143,6 +12143,15 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb, */ stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], &oldstream[i]); stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; +#if defined(SCTP_DETAILED_STR_STATS) + for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { + stcb->asoc.strmout[i].abandoned_sent[j] = oldstream[i].abandoned_sent[j]; + stcb->asoc.strmout[i].abandoned_unsent[j] = oldstream[i].abandoned_unsent[j]; + } +#else + stcb->asoc.strmout[i].abandoned_sent[0] = oldstream[i].abandoned_sent[0]; + stcb->asoc.strmout[i].abandoned_unsent[0] = oldstream[i].abandoned_unsent[0]; +#endif stcb->asoc.strmout[i].next_mid_ordered = oldstream[i].next_mid_ordered; stcb->asoc.strmout[i].next_mid_unordered = oldstream[i].next_mid_unordered; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:51:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 532425684BE; Tue, 2 Mar 2021 12:51: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 4DqcTS1xfHz3qks; Tue, 2 Mar 2021 12:51:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35E2F17129; Tue, 2 Mar 2021 12:51: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 122CpubS050467; Tue, 2 Mar 2021 12:51:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Cpuu1050466; Tue, 2 Mar 2021 12:51:56 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:51:56 GMT Message-Id: <202103021251.122Cpuu1050466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3fa95c0fe60b - stable/13 - sctp: fix a locking issue for old unordered data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3fa95c0fe60bbd67db6043c7e18910387bbe1bac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:51:56 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3fa95c0fe60bbd67db6043c7e18910387bbe1bac commit 3fa95c0fe60bbd67db6043c7e18910387bbe1bac Author: Michael Tuexen AuthorDate: 2021-01-31 09:46:23 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:28:09 +0000 sctp: fix a locking issue for old unordered data Thanks to Anatoly Korniltsev for reporting the issue for the userland stack. (cherry picked from commit 8dc6a1edca6de0c64f6c082f69097746d1346592) --- sys/netinet/sctp_indata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 08af27c934fb..6997a0099c88 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -803,7 +803,7 @@ restart: } memset(nc, 0, sizeof(struct sctp_queued_to_read)); TAILQ_REMOVE(&control->reasm, chk, sctp_next); - sctp_add_chk_to_control(control, strm, stcb, asoc, chk, SCTP_READ_LOCK_NOT_HELD); + sctp_add_chk_to_control(control, strm, stcb, asoc, chk, inp_read_lock_held); fsn++; cnt_added++; chk = NULL; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:52:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55500568A07; Tue, 2 Mar 2021 12:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqcVM1yzVz3qpS; Tue, 2 Mar 2021 12:52: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 365F71736A; Tue, 2 Mar 2021 12:52: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 122Cqh39050723; Tue, 2 Mar 2021 12:52:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122CqhrK050722; Tue, 2 Mar 2021 12:52:43 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:52:43 GMT Message-Id: <202103021252.122CqhrK050722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 16b538975024 - stable/13 - sctp: improve input validation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 16b538975024e2b7038807bf5b712124f5a7b889 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:52:43 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=16b538975024e2b7038807bf5b712124f5a7b889 commit 16b538975024e2b7038807bf5b712124f5a7b889 Author: Michael Tuexen AuthorDate: 2021-01-31 22:43:15 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:29:00 +0000 sctp: improve input validation Improve the handling of INIT chunks in specific szenarios and report and appropriate error cause. Thanks to Anatoly Korniltsev for reporting the issue for the userland stack. (cherry picked from commit af885c57d65d33c0306e91d3e090e76772a0d012) --- sys/netinet/sctp_output.c | 100 ++++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 38 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index d58ebf785238..0f7ade931e61 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5232,31 +5232,33 @@ invalid_size: return (op_err); } -static int +/* + * Given a INIT chunk, look through the parameters to verify that there + * are no new addresses. + * Return true, if there is a new address or there is a problem parsing + the parameters. Provide an optional error cause used when sending an ABORT. + * Return false, if there are no new addresses and there is no problem in + parameter processing. + */ +static bool sctp_are_there_new_addresses(struct sctp_association *asoc, - struct mbuf *in_initpkt, int offset, struct sockaddr *src) + struct mbuf *in_initpkt, int offset, int limit, struct sockaddr *src, + struct mbuf **op_err) { - /* - * Given a INIT packet, look through the packet to verify that there - * are NO new addresses. As we go through the parameters add reports - * of any un-understood parameters that require an error. Also we - * must return (1) to drop the packet if we see a un-understood - * parameter that tells us to drop the chunk. - */ struct sockaddr *sa_touse; struct sockaddr *sa; struct sctp_paramhdr *phdr, params; - uint16_t ptype, plen; - uint8_t fnd; struct sctp_nets *net; - int check_src; #ifdef INET struct sockaddr_in sin4, *sa4; #endif #ifdef INET6 struct sockaddr_in6 sin6, *sa6; #endif + uint16_t ptype, plen; + bool fnd, check_src; + *op_err = NULL; #ifdef INET memset(&sin4, 0, sizeof(sin4)); sin4.sin_family = AF_INET; @@ -5268,19 +5270,19 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sin6.sin6_len = sizeof(sin6); #endif /* First what about the src address of the pkt ? */ - check_src = 0; + check_src = false; switch (src->sa_family) { #ifdef INET case AF_INET: if (asoc->scope.ipv4_addr_legal) { - check_src = 1; + check_src = true; } break; #endif #ifdef INET6 case AF_INET6: if (asoc->scope.ipv6_addr_legal) { - check_src = 1; + check_src = true; } break; #endif @@ -5289,7 +5291,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, break; } if (check_src) { - fnd = 0; + fnd = false; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sa = (struct sockaddr *)&net->ro._l_addr; if (sa->sa_family == src->sa_family) { @@ -5300,7 +5302,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa4 = (struct sockaddr_in *)sa; src4 = (struct sockaddr_in *)src; if (sa4->sin_addr.s_addr == src4->sin_addr.s_addr) { - fnd = 1; + fnd = true; break; } } @@ -5312,16 +5314,22 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa6 = (struct sockaddr_in6 *)sa; src6 = (struct sockaddr_in6 *)src; if (SCTP6_ARE_ADDR_EQUAL(sa6, src6)) { - fnd = 1; + fnd = true; break; } } #endif } } - if (fnd == 0) { - /* New address added! no need to look further. */ - return (1); + if (!fnd) { + /* + * If sending an ABORT in case of an additional + * address, don't use the new address error cause. + * This looks no different than if no listener was + * present. + */ + *op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); + return (true); } } /* Ok so far lets munge through the rest of the packet */ @@ -5331,6 +5339,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa_touse = NULL; ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); + if (offset + plen > limit) { + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Partial parameter"); + return (true); + } + if (plen < sizeof(struct sctp_paramhdr)) { + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length too small"); + return (true); + } switch (ptype) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -5338,12 +5354,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, struct sctp_ipv4addr_param *p4, p4_buf; if (plen != sizeof(struct sctp_ipv4addr_param)) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length illegal"); + return (true); } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p4_buf, sizeof(p4_buf)); if (phdr == NULL) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); + return (true); } if (asoc->scope.ipv4_addr_legal) { p4 = (struct sctp_ipv4addr_param *)phdr; @@ -5359,12 +5377,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, struct sctp_ipv6addr_param *p6, p6_buf; if (plen != sizeof(struct sctp_ipv6addr_param)) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length illegal"); + return (true); } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p6_buf, sizeof(p6_buf)); if (phdr == NULL) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); + return (true); } if (asoc->scope.ipv6_addr_legal) { p6 = (struct sctp_ipv6addr_param *)phdr; @@ -5381,7 +5401,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, } if (sa_touse) { /* ok, sa_touse points to one to check */ - fnd = 0; + fnd = false; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sa = (struct sockaddr *)&net->ro._l_addr; if (sa->sa_family != sa_touse->sa_family) { @@ -5392,7 +5412,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa4 = (struct sockaddr_in *)sa; if (sa4->sin_addr.s_addr == sin4.sin_addr.s_addr) { - fnd = 1; + fnd = true; break; } } @@ -5402,21 +5422,31 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa6 = (struct sockaddr_in6 *)sa; if (SCTP6_ARE_ADDR_EQUAL( sa6, &sin6)) { - fnd = 1; + fnd = true; break; } } #endif } if (!fnd) { - /* New addr added! no need to look further */ - return (1); + /* + * If sending an ABORT in case of an + * additional address, don't use the new + * address error cause. This looks no + * different than if no listener was + * present. + */ + *op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); + return (true); } } offset += SCTP_SIZE32(plen); + if (offset >= limit) { + break; + } phdr = sctp_get_next_param(in_initpkt, offset, ¶ms, sizeof(params)); } - return (0); + return (false); } /* @@ -5472,17 +5502,11 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, } if ((asoc != NULL) && (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT)) { - if (sctp_are_there_new_addresses(asoc, init_pkt, offset, src)) { + if (sctp_are_there_new_addresses(asoc, init_pkt, offset, offset + ntohs(init_chk->ch.chunk_length), src, &op_err)) { /* * new addresses, out of here in non-cookie-wait * states - * - * Send an ABORT, without the new address error - * cause. This looks no different than if no - * listener was present. */ - op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), - "Address added"); sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err, mflowtype, mflowid, inp->fibnum, vrf_id, port); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:53:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 586F55689B2; Tue, 2 Mar 2021 12:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqcWC1VC3z3r2X; Tue, 2 Mar 2021 12:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26447170E1; Tue, 2 Mar 2021 12:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122CrRFJ050975; Tue, 2 Mar 2021 12:53:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122CrRt0050974; Tue, 2 Mar 2021 12:53:27 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:53:27 GMT Message-Id: <202103021253.122CrRt0050974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 5573b94fa67f - stable/13 - sctp: small cleanup, no functional change intended. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5573b94fa67f954dd0db57de328e60941ee8c9d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:53:27 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5573b94fa67f954dd0db57de328e60941ee8c9d1 commit 5573b94fa67f954dd0db57de328e60941ee8c9d1 Author: Michael Tuexen AuthorDate: 2021-02-01 13:03:41 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:29:46 +0000 sctp: small cleanup, no functional change intended. (cherry picked from commit bdd4630c9a9cea64830f981fc897ac953c48892c) --- sys/netinet/sctputil.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 084b7bd6af72..319344842d5f 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2032,14 +2032,13 @@ sctp_timeout_handler(void *t) sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_FROM_INPKILL_TIMER); inp = NULL; - goto out_no_decr; + goto out_decr; case SCTP_TIMER_TYPE_ASOCKILL: KASSERT(inp != NULL && stcb != NULL && net == NULL, ("timeout of type %d: inp = %p, stcb = %p, net = %p", type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timoassockill); /* Can we free it yet? */ - SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1); (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, @@ -2049,7 +2048,7 @@ sctp_timeout_handler(void *t) * duplicate unlock or unlock of a free mtx :-0 */ stcb = NULL; - goto out_no_decr; + goto out_decr; case SCTP_TIMER_TYPE_ADDR_WQ: KASSERT(inp == NULL && stcb == NULL && net == NULL, ("timeout of type %d: inp = %p, stcb = %p, net = %p", @@ -2107,7 +2106,6 @@ out_decr: if (net != NULL) { sctp_free_remote_addr(net); } -out_no_decr: SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d handler finished.\n", type); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:54:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F1CA568B19; Tue, 2 Mar 2021 12:54: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 4DqcWy2G5Bz3qvX; Tue, 2 Mar 2021 12:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 409B217133; Tue, 2 Mar 2021 12:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122Cs6OQ051203; Tue, 2 Mar 2021 12:54:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Cs6V0051202; Tue, 2 Mar 2021 12:54:06 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:54:06 GMT Message-Id: <202103021254.122Cs6V0051202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2a9b68d5e1bb - stable/13 - libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a9b68d5e1bba633c37cc829f52e79e1281e910b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:54:06 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2a9b68d5e1bba633c37cc829f52e79e1281e910b commit 2a9b68d5e1bba633c37cc829f52e79e1281e910b Author: Michael Tuexen AuthorDate: 2021-02-09 22:35:55 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:30:24 +0000 libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIG TCP_FASTOPEN_MIN_COOKIE_LEN was incorrectly registered as a name of a IPPROTO_TCP level socket option, which overwrote TCP_NOPUSH. TCP_FASTOPEN_PSK_LEN was incorrectly registered as a name of an IPPROTO_TCP level socket option, which overwrote TCP_MD5SIG. Sponsored by: Netflix, Inc. (cherry picked from commit f25266bee7dafb10f03e06537c8127cc17335bed) --- lib/libsysdecode/mktables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index 3a0284a2deb4..3d152a3a2646 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -140,7 +140,7 @@ gen_table "sockopt" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/ gen_table "sockoptip" "(IP_[[:alnum:]_]+|MCAST_[[:alnum:]_]+_GROUP)[[:space:]]+" "netinet/in.h" "IP_DEFAULT|IP_MIN|IP_MAX|IP_PORTRANGE" gen_table "sockoptipv6" "IPV6_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet6/in6.h" "IPV6_ADDR_|IPV6_TAG_DIRECT|IPV6_OPTIONS|IPV6_RECVOPTS|IPV6_RECVRETOPTS|IPV6_RECVDSTADDR|IPV6_RETOPTS|IPV6_2292|IPV6_RECVRTHDRDSTOPTS|IPV6_REACHCONF|IPV6_PKTOPTIONS" gen_table "sockoptsctp" "SCTP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/sctp.h" -gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX" +gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX|TCP_FASTOPEN_MIN_COOKIE_LEN|TCP_FASTOPEN_PSK_LEN" gen_table "sockoptudp" "UDP_[[:alnum:]]+[[:space:]]+[0-9]+" "netinet/udp.h" "UDP_ENCAP_" gen_table "sockoptudplite" "UDPLITE_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/udplite.h" gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:54:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EC2F568BB1; Tue, 2 Mar 2021 12:54: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 4DqcXZ74Yvz3r97; Tue, 2 Mar 2021 12:54: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 E575C16FD2; Tue, 2 Mar 2021 12:54: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 122Cschr051407; Tue, 2 Mar 2021 12:54:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122CscVE051406; Tue, 2 Mar 2021 12:54:38 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:54:38 GMT Message-Id: <202103021254.122CscVE051406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e949dcc283cd - stable/13 - tcp: improve behaviour when using TCP_NOOPT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e949dcc283cd3b19e8e3113d8d3e10a72c2bbe6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:54:39 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e949dcc283cd3b19e8e3113d8d3e10a72c2bbe6e commit e949dcc283cd3b19e8e3113d8d3e10a72c2bbe6e Author: Michael Tuexen AuthorDate: 2021-02-14 11:10:31 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:31:01 +0000 tcp: improve behaviour when using TCP_NOOPT Use ISS for SEG.SEQ when sending a SYN-ACK segment in response to an SYN segment received in the SYN-SENT state on a socket having the IPPROTO_TCP level socket option TCP_NOOPT enabled. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D28656 (cherry picked from commit ed782b9f5a7a05debe944a33b4ac9e5629a95803) --- sys/netinet/tcp_output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index cacc0c51bd8e..b4c7ab0a1ab7 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -785,6 +785,10 @@ send: #endif hdrlen = sizeof (struct tcpiphdr); + if (flags & TH_SYN) { + tp->snd_nxt = tp->iss; + } + /* * Compute options for segment. * We only have to care about SYN and established connection @@ -795,7 +799,6 @@ send: if ((tp->t_flags & TF_NOOPT) == 0) { /* Maximum segment size. */ if (flags & TH_SYN) { - tp->snd_nxt = tp->iss; to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); to.to_flags |= TOF_MSS; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:55:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45FF15688F0; Tue, 2 Mar 2021 12:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqcYL1VVZz3rNp; Tue, 2 Mar 2021 12:55: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 26C1E17134; Tue, 2 Mar 2021 12:55: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 122CtIoI051658; Tue, 2 Mar 2021 12:55:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122CtI3R051657; Tue, 2 Mar 2021 12:55:18 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:55:18 GMT Message-Id: <202103021255.122CtI3R051657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 04c13928d9f3 - stable/13 - sctp: clear a pointer to a net which will be removed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04c13928d9f306a7d7ac34452644a538d2be6fdc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:55:18 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=04c13928d9f306a7d7ac34452644a538d2be6fdc commit 04c13928d9f306a7d7ac34452644a538d2be6fdc Author: Michael Tuexen AuthorDate: 2021-02-21 12:03:57 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:31:35 +0000 sctp: clear a pointer to a net which will be removed (cherry picked from commit 5ac839029d01c0f48e1b1ff1a599cb47cf5e98ee) --- sys/netinet/sctp_pcb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2e082570cfc1..4d09ad3a7353 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4443,6 +4443,10 @@ out: /* Clear net */ asoc->last_control_chunk_from = NULL; } + if (net == asoc->last_net_cmt_send_started) { + /* Clear net */ + asoc->last_net_cmt_send_started = NULL; + } if (net == stcb->asoc.alternate) { sctp_free_remote_addr(stcb->asoc.alternate); stcb->asoc.alternate = NULL; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:56:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3E81568C35; Tue, 2 Mar 2021 12:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqcZD4FKQz3rJj; Tue, 2 Mar 2021 12:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8469D17229; Tue, 2 Mar 2021 12:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122Cu4ge051914; Tue, 2 Mar 2021 12:56:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Cu45Z051913; Tue, 2 Mar 2021 12:56:04 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:56:04 GMT Message-Id: <202103021256.122Cu45Z051913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 8cf046aff971 - stable/13 - sctp: improve computation of an alternate net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8cf046aff9719779b665f7f4f4a8bad4b3945341 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:56:04 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8cf046aff9719779b665f7f4f4a8bad4b3945341 commit 8cf046aff9719779b665f7f4f4a8bad4b3945341 Author: Michael Tuexen AuthorDate: 2021-02-21 16:13:06 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:32:21 +0000 sctp: improve computation of an alternate net Espeially handle the case where the net passed in is about to be deleted and therefore not in the list of nets anymore. Reported by: syzbot+9756917a7c8381adf5e8@syzkaller.appspotmail.com (cherry picked from commit b963ce4588b33f733aef3f7a7f3fbe5018a89728) --- sys/netinet/sctp_timer.c | 85 ++++++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index bce1f5cd166d..582abd8e8854 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -164,8 +164,8 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, } /* - * sctp_find_alternate_net() returns a non-NULL pointer as long - * the argument net is non-NULL. + * sctp_find_alternate_net() returns a non-NULL pointer as long as there + * exists nets, which are not being deleted. */ struct sctp_nets * sctp_find_alternate_net(struct sctp_tcb *stcb, @@ -174,14 +174,14 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, { /* Find and return an alternate network if possible */ struct sctp_nets *alt, *mnet, *min_errors_net = NULL, *max_cwnd_net = NULL; - int once; + bool looped; /* JRS 5/14/07 - Initialize min_errors to an impossible value. */ int min_errors = -1; uint32_t max_cwnd = 0; if (stcb->asoc.numnets == 1) { - /* No others but net */ + /* No selection can be made. */ return (TAILQ_FIRST(&stcb->asoc.nets)); } /* @@ -328,25 +328,22 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, return (max_cwnd_net); } } - mnet = net; - once = 0; - - if (mnet == NULL) { - mnet = TAILQ_FIRST(&stcb->asoc.nets); - if (mnet == NULL) { - return (NULL); - } + /* Look for an alternate net, which is active. */ + if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { + alt = TAILQ_NEXT(net, sctp_next);; + } else { + alt = TAILQ_FIRST(&stcb->asoc.nets); } + looped = false; for (;;) { - alt = TAILQ_NEXT(mnet, sctp_next); if (alt == NULL) { - once++; - if (once > 1) { - break; + if (!looped) { + alt = TAILQ_FIRST(&stcb->asoc.nets); + looped = true; } - alt = TAILQ_FIRST(&stcb->asoc.nets); + /* Definitely out of candidates. */ if (alt == NULL) { - return (NULL); + break; } } if (alt->ro.ro_nh == NULL) { @@ -358,43 +355,59 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, } if (((alt->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE) && (alt->ro.ro_nh != NULL) && - (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED))) { - /* Found a reachable address */ + (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) && + (alt != net)) { + /* Found an alternate net, which is reachable. */ break; } - mnet = alt; + alt = TAILQ_NEXT(alt, sctp_next); } if (alt == NULL) { - /* Case where NO insv network exists (dormant state) */ - /* we rotate destinations */ - once = 0; - mnet = net; + /* + * In case no active alternate net has been found, look for + * an alternate net, which is confirmed. + */ + if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { + alt = TAILQ_NEXT(net, sctp_next);; + } else { + alt = TAILQ_FIRST(&stcb->asoc.nets); + } + looped = false; for (;;) { - if (mnet == NULL) { - return (TAILQ_FIRST(&stcb->asoc.nets)); - } - alt = TAILQ_NEXT(mnet, sctp_next); if (alt == NULL) { - once++; - if (once > 1) { - break; + if (!looped) { + alt = TAILQ_FIRST(&stcb->asoc.nets); + looped = true; } - alt = TAILQ_FIRST(&stcb->asoc.nets); + /* Definitely out of candidates. */ if (alt == NULL) { break; } } if ((!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) && (alt != net)) { - /* Found an alternate address */ + /* + * Found an alternate net, which is + * confirmed. + */ break; } - mnet = alt; + alt = TAILQ_NEXT(alt, sctp_next); } } if (alt == NULL) { - return (net); + /* + * In case no confirmed alternate net has been found, just + * return net, if it is not being deleted. In the other case + * just return the first net. + */ + if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { + alt = net; + } + if (alt == NULL) { + alt = TAILQ_FIRST(&stcb->asoc.nets); + } } return (alt); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 12:56:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09463568B4D; Tue, 2 Mar 2021 12:56: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 4DqcZv6pPPz3rS8; Tue, 2 Mar 2021 12:56: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 DC99716FD4; Tue, 2 Mar 2021 12:56: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 122CudtX052141; Tue, 2 Mar 2021 12:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Cudnr052140; Tue, 2 Mar 2021 12:56:39 GMT (envelope-from git) Date: Tue, 2 Mar 2021 12:56:39 GMT Message-Id: <202103021256.122Cudnr052140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f7c20120c19b - stable/13 - sctp: avoid integer overflow when starting the HB timer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7c20120c19b6307536908a7f779be2832b133f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 12:56:40 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f7c20120c19b6307536908a7f779be2832b133f3 commit f7c20120c19b6307536908a7f779be2832b133f3 Author: Michael Tuexen AuthorDate: 2021-02-27 22:27:30 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 12:33:01 +0000 sctp: avoid integer overflow when starting the HB timer MFC after: 3 days Reported by: syzbot+14b9d7c3c64208fae62f@syzkaller.appspotmail.com (cherry picked from commit 70e95f0b6917a8b8cd4a2a5f883f3e9753fc86d8) --- sys/netinet/sctputil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 319344842d5f..7ddb4c3710df 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2277,14 +2277,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } rndval = sctp_select_initial_TSN(&inp->sctp_ep); jitter = rndval % to_ticks; - if (jitter >= (to_ticks >> 1)) { - to_ticks = to_ticks + (jitter - (to_ticks >> 1)); + to_ticks >>= 1; + if (jitter < (UINT32_MAX - to_ticks)) { + to_ticks += jitter; } else { - to_ticks = to_ticks - jitter; + to_ticks = UINT32_MAX; } if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) && !(net->dest_state & SCTP_ADDR_PF)) { - to_ticks += net->heart_beat_delay; + if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) { + to_ticks += net->heart_beat_delay; + } else { + to_ticks = UINT32_MAX; + } } /* * Now we must convert the to_ticks that are now in ms to From owner-dev-commits-src-all@freebsd.org Tue Mar 2 13:02:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C1B7568B74; Tue, 2 Mar 2021 13:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqcjk3bD6z3sJg; Tue, 2 Mar 2021 13:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E3F717580; Tue, 2 Mar 2021 13:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122D2Yhi065853; Tue, 2 Mar 2021 13:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122D2YxQ065852; Tue, 2 Mar 2021 13:02:34 GMT (envelope-from git) Date: Tue, 2 Mar 2021 13:02:34 GMT Message-Id: <202103021302.122D2YxQ065852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 135fa1610fa1 - stable/13 - pwm_backlight: Add MODULE_DEPEND on backlight 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 135fa1610fa177bb8c77aab951cfb4395edc249f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 13:02:34 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=135fa1610fa177bb8c77aab951cfb4395edc249f commit 135fa1610fa177bb8c77aab951cfb4395edc249f Author: Brett Mastbergen AuthorDate: 2021-02-22 10:28:28 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-02 13:02:13 +0000 pwm_backlight: Add MODULE_DEPEND on backlight Make the pwm_backlight module depend on backlight, so it has access to the backlight interface symbols. Otherwise you'll get an error like: link_elf: symbol backlight_get_info_desc undefined Signed-off-by: Brett Mastbergen MFC after: 3 days PR: 253765 (cherry picked from commit 43d4dfac96f7f8285a27989f315c075d28aadb12) --- sys/dev/pwm/pwm_backlight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/pwm/pwm_backlight.c b/sys/dev/pwm/pwm_backlight.c index 352a5a02fed5..3a6ec7f61fec 100644 --- a/sys/dev/pwm/pwm_backlight.c +++ b/sys/dev/pwm/pwm_backlight.c @@ -308,4 +308,5 @@ devclass_t pwm_backlight_devclass; DRIVER_MODULE(pwm_backlight, simplebus, pwm_backlight_driver, pwm_backlight_devclass, 0, 0); +MODULE_DEPEND(pwm_backlight, backlight, 1, 1, 1); OFWBUS_PNP_INFO(compat_data); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 13:03:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 099FF568FB0; Tue, 2 Mar 2021 13:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqckH6T6Pz3sHw; Tue, 2 Mar 2021 13:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A4FA17581; Tue, 2 Mar 2021 13:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122D33vf066083; Tue, 2 Mar 2021 13:03:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122D33nb066082; Tue, 2 Mar 2021 13:03:03 GMT (envelope-from git) Date: Tue, 2 Mar 2021 13:03:03 GMT Message-Id: <202103021303.122D33nb066082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 6f6c6480047b - stable/13 - mkimg: Add support for offset if the source is an image 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6f6c6480047ba1ebbc398c1052446e35f8a4ecab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 13:03:04 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6f6c6480047ba1ebbc398c1052446e35f8a4ecab commit 6f6c6480047ba1ebbc398c1052446e35f8a4ecab Author: Emmanuel Vadot AuthorDate: 2021-02-25 17:10:19 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-02 13:02:51 +0000 mkimg: Add support for offset if the source is an image This allow us to create image with the following format: mkimg -v -o sdcard -s gpt -p efi:=esp_aarch64.img:1M -p freebsd-ufs::1G Which will add a efi partition at a 1M offset on the image with its content coming from the esp_aarch64.img file. MFC after: 3 days (cherry picked from commit 8f3c71c85e5f6a4d2bddbfead225d33b96dbd7d7) --- usr.bin/mkimg/mkimg.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index c4f0acbe3927..e5e6c036575b 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -174,8 +174,10 @@ usage(const char *why) fprintf(stderr, "\t[/]::[:[+]]\t- " "empty partition of given size and\n\t\t\t\t\t" " optional relative or absolute offset\n"); - fprintf(stderr, "\t[/]:=\t\t- partition content and size " - "are\n\t\t\t\t\t determined by the named file\n"); + fprintf(stderr, "\t[/]:=[:[+]offset]\t- partition " + "content and size are\n\t\t\t\t\t" + " determined by the named file and\n" + "\t\t\t\t\t optional relative or absolute offset\n"); fprintf(stderr, "\t[/]:-\t\t- partition content and size " "are taken\n\t\t\t\t\t from the output of the command to run\n"); fprintf(stderr, "\t-\t\t\t\t- unused partition entry\n"); @@ -459,9 +461,11 @@ mkimg(void) /* Look for an offset. Set size too if we can. */ switch (part->kind) { case PART_KIND_SIZE: + case PART_KIND_FILE: offset = part->contents; size = strsep(&offset, ":"); - if (expand_number(size, &bytesize) == -1) + if (part->kind == PART_KIND_SIZE && + expand_number(size, &bytesize) == -1) error = errno; if (offset != NULL) { if (*offset != '+') @@ -476,14 +480,13 @@ mkimg(void) /* Work out exactly where the partition starts. */ blkoffset = (byteoffset + secsz - 1) / secsz; - if (abs_offset) { - part->block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, + if (abs_offset) + block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, blkoffset); - } else { + else block = scheme_metadata(SCHEME_META_PART_BEFORE, block + blkoffset); - part->block = block; - } + part->block = block; if (verbose) fprintf(stderr, "partition %d: starting block %llu " From owner-dev-commits-src-all@freebsd.org Tue Mar 2 13:03:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6552569022; Tue, 2 Mar 2021 13:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqckH348xz3sQn; Tue, 2 Mar 2021 13:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D7C2171CE; Tue, 2 Mar 2021 13:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122D32rU066058; Tue, 2 Mar 2021 13:03:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122D326O066057; Tue, 2 Mar 2021 13:03:02 GMT (envelope-from git) Date: Tue, 2 Mar 2021 13:03:02 GMT Message-Id: <202103021303.122D326O066057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 9c5f4f8e4ee8 - stable/13 - mkimg: We always want the last block of the last inserted partition 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c5f4f8e4ee8261a669ab99257bffd439bad6635 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 13:03:04 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=9c5f4f8e4ee8261a669ab99257bffd439bad6635 commit 9c5f4f8e4ee8261a669ab99257bffd439bad6635 Author: Emmanuel Vadot AuthorDate: 2021-02-25 15:34:28 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-02 13:02:45 +0000 mkimg: We always want the last block of the last inserted partition Even with an absolute offset we want to know the last block the partition otherwise we endup with an image the size of the metadata. This allow to create image with the ESP placed at a specific position which is useful on arm/arm64 where u-boot have always a hard time to read the ESP if it's not aligned on 512k. mkimg -v -o sdcard -s gpt -p efi::54M:1M -p freebsd-ufs::1G now works. MFC after: 3 days (cherry picked from commit 3b6268bb9e4aea939c4ce7f37353174aa90e6751) --- usr.bin/mkimg/mkimg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index d870f3a8f0c3..c4f0acbe3927 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -528,10 +528,8 @@ mkimg(void) (long long)blkoffset); } } - if (!abs_offset) { - block = scheme_metadata(SCHEME_META_PART_AFTER, - part->block + part->size); - } + block = scheme_metadata(SCHEME_META_PART_AFTER, + part->block + part->size); } mkimg_validate(); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 14:20:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A2C256AC83; Tue, 2 Mar 2021 14:20: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 4DqfRV6t6gz4RHr; Tue, 2 Mar 2021 14:20: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 DEC92182B5; Tue, 2 Mar 2021 14:20: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 122EKMkS067510; Tue, 2 Mar 2021 14:20:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122EKMd6067509; Tue, 2 Mar 2021 14:20:22 GMT (envelope-from git) Date: Tue, 2 Mar 2021 14:20:22 GMT Message-Id: <202103021420.122EKMd6067509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 90cf334642c2 - releng/13.0 - pwm_backlight: Add MODULE_DEPEND on backlight 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 90cf334642c234675a70721a8b06a7c92c014a8e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 14:20:23 -0000 The branch releng/13.0 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=90cf334642c234675a70721a8b06a7c92c014a8e commit 90cf334642c234675a70721a8b06a7c92c014a8e Author: Brett Mastbergen AuthorDate: 2021-02-22 10:28:28 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-02 14:19:51 +0000 pwm_backlight: Add MODULE_DEPEND on backlight Make the pwm_backlight module depend on backlight, so it has access to the backlight interface symbols. Otherwise you'll get an error like: link_elf: symbol backlight_get_info_desc undefined Approved by: re (gjb) Signed-off-by: Brett Mastbergen MFC after: 3 days PR: 253765 (cherry picked from commit 43d4dfac96f7f8285a27989f315c075d28aadb12) (cherry picked from commit 135fa1610fa177bb8c77aab951cfb4395edc249f) --- sys/dev/pwm/pwm_backlight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/pwm/pwm_backlight.c b/sys/dev/pwm/pwm_backlight.c index 352a5a02fed5..3a6ec7f61fec 100644 --- a/sys/dev/pwm/pwm_backlight.c +++ b/sys/dev/pwm/pwm_backlight.c @@ -308,4 +308,5 @@ devclass_t pwm_backlight_devclass; DRIVER_MODULE(pwm_backlight, simplebus, pwm_backlight_driver, pwm_backlight_devclass, 0, 0); +MODULE_DEPEND(pwm_backlight, backlight, 1, 1, 1); OFWBUS_PNP_INFO(compat_data); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 14:21:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 661ED56ABA7; Tue, 2 Mar 2021 14:21: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 4DqfSn2Gt9z4RH4; Tue, 2 Mar 2021 14:21: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 4114B17EC7; Tue, 2 Mar 2021 14:21: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 122ELTsF068642; Tue, 2 Mar 2021 14:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122ELTtd068641; Tue, 2 Mar 2021 14:21:29 GMT (envelope-from git) Date: Tue, 2 Mar 2021 14:21:29 GMT Message-Id: <202103021421.122ELTtd068641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: f3054d18bfbd - releng/13.0 - mkimg: We always want the last block of the last inserted partition 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f3054d18bfbd4629cb695922f3cd1fab36b1dc5b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 14:21:29 -0000 The branch releng/13.0 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f3054d18bfbd4629cb695922f3cd1fab36b1dc5b commit f3054d18bfbd4629cb695922f3cd1fab36b1dc5b Author: Emmanuel Vadot AuthorDate: 2021-02-25 15:34:28 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-02 14:20:53 +0000 mkimg: We always want the last block of the last inserted partition Even with an absolute offset we want to know the last block the partition otherwise we endup with an image the size of the metadata. This allow to create image with the ESP placed at a specific position which is useful on arm/arm64 where u-boot have always a hard time to read the ESP if it's not aligned on 512k. mkimg -v -o sdcard -s gpt -p efi::54M:1M -p freebsd-ufs::1G now works. MFC after: 3 days Approved by: re (gjb) (cherry picked from commit 3b6268bb9e4aea939c4ce7f37353174aa90e6751) (cherry picked from commit 9c5f4f8e4ee8261a669ab99257bffd439bad6635) --- usr.bin/mkimg/mkimg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index d870f3a8f0c3..c4f0acbe3927 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -528,10 +528,8 @@ mkimg(void) (long long)blkoffset); } } - if (!abs_offset) { - block = scheme_metadata(SCHEME_META_PART_AFTER, - part->block + part->size); - } + block = scheme_metadata(SCHEME_META_PART_AFTER, + part->block + part->size); } mkimg_validate(); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 14:21:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 848C256AC32; Tue, 2 Mar 2021 14:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqfSp32Hwz4R7g; Tue, 2 Mar 2021 14:21: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 593B117EC9; Tue, 2 Mar 2021 14:21: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 122ELUwZ068664; Tue, 2 Mar 2021 14:21:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122ELUFk068663; Tue, 2 Mar 2021 14:21:30 GMT (envelope-from git) Date: Tue, 2 Mar 2021 14:21:30 GMT Message-Id: <202103021421.122ELUFk068663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 856af5ff745f - releng/13.0 - mkimg: Add support for offset if the source is an image 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 856af5ff745f2687015a5564f8daf0cf6cde368d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 14:21:30 -0000 The branch releng/13.0 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=856af5ff745f2687015a5564f8daf0cf6cde368d commit 856af5ff745f2687015a5564f8daf0cf6cde368d Author: Emmanuel Vadot AuthorDate: 2021-02-25 17:10:19 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-02 14:21:08 +0000 mkimg: Add support for offset if the source is an image This allow us to create image with the following format: mkimg -v -o sdcard -s gpt -p efi:=esp_aarch64.img:1M -p freebsd-ufs::1G Which will add a efi partition at a 1M offset on the image with its content coming from the esp_aarch64.img file. MFC after: 3 days Approved by: re (gjb) (cherry picked from commit 8f3c71c85e5f6a4d2bddbfead225d33b96dbd7d7) (cherry picked from commit 6f6c6480047ba1ebbc398c1052446e35f8a4ecab) --- usr.bin/mkimg/mkimg.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index c4f0acbe3927..e5e6c036575b 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -174,8 +174,10 @@ usage(const char *why) fprintf(stderr, "\t[/]::[:[+]]\t- " "empty partition of given size and\n\t\t\t\t\t" " optional relative or absolute offset\n"); - fprintf(stderr, "\t[/]:=\t\t- partition content and size " - "are\n\t\t\t\t\t determined by the named file\n"); + fprintf(stderr, "\t[/]:=[:[+]offset]\t- partition " + "content and size are\n\t\t\t\t\t" + " determined by the named file and\n" + "\t\t\t\t\t optional relative or absolute offset\n"); fprintf(stderr, "\t[/]:-\t\t- partition content and size " "are taken\n\t\t\t\t\t from the output of the command to run\n"); fprintf(stderr, "\t-\t\t\t\t- unused partition entry\n"); @@ -459,9 +461,11 @@ mkimg(void) /* Look for an offset. Set size too if we can. */ switch (part->kind) { case PART_KIND_SIZE: + case PART_KIND_FILE: offset = part->contents; size = strsep(&offset, ":"); - if (expand_number(size, &bytesize) == -1) + if (part->kind == PART_KIND_SIZE && + expand_number(size, &bytesize) == -1) error = errno; if (offset != NULL) { if (*offset != '+') @@ -476,14 +480,13 @@ mkimg(void) /* Work out exactly where the partition starts. */ blkoffset = (byteoffset + secsz - 1) / secsz; - if (abs_offset) { - part->block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, + if (abs_offset) + block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, blkoffset); - } else { + else block = scheme_metadata(SCHEME_META_PART_BEFORE, block + blkoffset); - part->block = block; - } + part->block = block; if (verbose) fprintf(stderr, "partition %d: starting block %llu " From owner-dev-commits-src-all@freebsd.org Tue Mar 2 14:26:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E37D56AE1F; Tue, 2 Mar 2021 14:26:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqfZd38clz4RpB; Tue, 2 Mar 2021 14:26:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A67E18595; Tue, 2 Mar 2021 14:26:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122EQXp4072619; Tue, 2 Mar 2021 14:26:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122EQXjq072618; Tue, 2 Mar 2021 14:26:33 GMT (envelope-from git) Date: Tue, 2 Mar 2021 14:26:33 GMT Message-Id: <202103021426.122EQXjq072618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 9019e7b388c6 - stable/13 - nvi: fix catalog generation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9019e7b388c6a999262d24aa355c11fb53d2e528 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 14:26:33 -0000 The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9019e7b388c6a999262d24aa355c11fb53d2e528 commit 9019e7b388c6a999262d24aa355c11fb53d2e528 Author: dankm AuthorDate: 2021-02-26 15:32:01 +0000 Commit: Baptiste Daroussin CommitDate: 2021-03-02 14:26:08 +0000 nvi: fix catalog generation Upstream broke catalog generation with some over-eagre style cleanups. This brings in my pull request. Obtained from: https://github.com/lichray/nvi2/pull/88 Differential Revision: https://reviews.freebsd.org/D28594 (cherry picked from commit 888ae5725257c251319f14f31c2e941717b675f2) --- contrib/nvi/catalog/dump.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/nvi/catalog/dump.c b/contrib/nvi/catalog/dump.c index 8390e5022841..74ab53b2f12c 100644 --- a/contrib/nvi/catalog/dump.c +++ b/contrib/nvi/catalog/dump.c @@ -36,24 +36,24 @@ parse(FILE *fp) { int ch, s1, s2, s3; -#define TESTD(s) do { \ +#define TESTD(s) { \ if ((s = getc(fp)) == EOF) \ return; \ if (!isdigit(s)) \ continue; \ -} while (0) -#define TESTP do { \ +} +#define TESTP { \ if ((ch = getc(fp)) == EOF) \ return; \ if (ch != '|') \ continue; \ -} while (0) -#define MOVEC(t) do { \ +} +#define MOVEC(t) { \ do { \ if ((ch = getc(fp)) == EOF) \ return; \ } while (ch != (t)); \ -} while (0) +} for (;;) { MOVEC('"'); TESTD(s1); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 14:57:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2A0156BCE6; Tue, 2 Mar 2021 14:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqgFm6XYYz4Tqm; Tue, 2 Mar 2021 14:57: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 CEE9F186F5; Tue, 2 Mar 2021 14:57: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 122Ev0VA012026; Tue, 2 Mar 2021 14:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Ev07c012025; Tue, 2 Mar 2021 14:57:00 GMT (envelope-from git) Date: Tue, 2 Mar 2021 14:57:00 GMT Message-Id: <202103021457.122Ev07c012025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 59b8f72a21b3 - releng/13.0 - libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 59b8f72a21b3e81465dc4ecd96f64dbaa44a4a9f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 14:57:01 -0000 The branch releng/13.0 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=59b8f72a21b3e81465dc4ecd96f64dbaa44a4a9f commit 59b8f72a21b3e81465dc4ecd96f64dbaa44a4a9f Author: Michael Tuexen AuthorDate: 2021-02-09 22:35:55 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 14:55:22 +0000 libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIG TCP_FASTOPEN_MIN_COOKIE_LEN was incorrectly registered as a name of a IPPROTO_TCP level socket option, which overwrote TCP_NOPUSH. TCP_FASTOPEN_PSK_LEN was incorrectly registered as a name of an IPPROTO_TCP level socket option, which overwrote TCP_MD5SIG. Approved by: re (gjb) Sponsored by: Netflix, Inc. (cherry picked from commit f25266bee7dafb10f03e06537c8127cc17335bed) (cherry picked from commit 2a9b68d5e1bba633c37cc829f52e79e1281e910b) --- lib/libsysdecode/mktables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index 3a0284a2deb4..3d152a3a2646 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -140,7 +140,7 @@ gen_table "sockopt" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/ gen_table "sockoptip" "(IP_[[:alnum:]_]+|MCAST_[[:alnum:]_]+_GROUP)[[:space:]]+" "netinet/in.h" "IP_DEFAULT|IP_MIN|IP_MAX|IP_PORTRANGE" gen_table "sockoptipv6" "IPV6_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet6/in6.h" "IPV6_ADDR_|IPV6_TAG_DIRECT|IPV6_OPTIONS|IPV6_RECVOPTS|IPV6_RECVRETOPTS|IPV6_RECVDSTADDR|IPV6_RETOPTS|IPV6_2292|IPV6_RECVRTHDRDSTOPTS|IPV6_REACHCONF|IPV6_PKTOPTIONS" gen_table "sockoptsctp" "SCTP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/sctp.h" -gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX" +gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX|TCP_FASTOPEN_MIN_COOKIE_LEN|TCP_FASTOPEN_PSK_LEN" gen_table "sockoptudp" "UDP_[[:alnum:]]+[[:space:]]+[0-9]+" "netinet/udp.h" "UDP_ENCAP_" gen_table "sockoptudplite" "UDPLITE_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/udplite.h" gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:13:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9735056BDFA; Tue, 2 Mar 2021 15:13: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 4DqgcR3mhRz4WT7; Tue, 2 Mar 2021 15:13: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 7454618FC3; Tue, 2 Mar 2021 15:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122FDBYK038572; Tue, 2 Mar 2021 15:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FDBTZ038571; Tue, 2 Mar 2021 15:13:11 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:13:11 GMT Message-Id: <202103021513.122FDBTZ038571@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: 0be274d37379 - main - Adjust where UNAME_r is defined for ports builds 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: 0be274d3737972532c042d06c53b5807e95aa845 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:13:11 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=0be274d3737972532c042d06c53b5807e95aa845 commit 0be274d3737972532c042d06c53b5807e95aa845 Author: Glen Barber AuthorDate: 2021-03-02 15:11:04 +0000 Commit: Glen Barber CommitDate: 2021-03-02 15:11:04 +0000 Adjust where UNAME_r is defined for ports builds In followup to 80ab50e1de19ca125f05a13937c796d48c4edd4a, export UNAME_r in Makefile.inc1 instead of Makefile.vm. MFC after: 3 days MFC with: 80ab50e1de19 Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile.inc1 | 3 +++ release/Makefile.vm | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/release/Makefile.inc1 b/release/Makefile.inc1 index 64f7c6e049a4..a97dee9994b6 100644 --- a/release/Makefile.inc1 +++ b/release/Makefile.inc1 @@ -40,3 +40,6 @@ BUILDDATE!= date +%Y%m%d .export BUILDDATE .endif +# Override UNAME_r to allow building ports for a different branch. +UNAME_r= ${REVISION}-${BRANCH} +.export UNAME_r diff --git a/release/Makefile.vm b/release/Makefile.vm index b0bd47521dc5..cad1974e3a6f 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -54,7 +54,7 @@ emulator-portinstall: .if ( ${TARGET_ARCH} != "i386" ) || ( ${MACHINE_ARCH} != "amd64" ) .if !exists(/usr/local/bin/qemu-${TARGET_ARCH}-static) .if exists(${PORTSDIR}/emulators/qemu-user-static/Makefile) - env - UNAME_r="${REVISION}-${BRANCH}" PATH=$$PATH make -C ${PORTSDIR}/emulators/qemu-user-static BATCH=1 all install clean + env - UNAME_r=${UNAME_r} PATH=$$PATH make -C ${PORTSDIR}/emulators/qemu-user-static BATCH=1 all install clean .else .if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -y From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B8BF56C450; Tue, 2 Mar 2021 15:17: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 4Dqgjl2cmqz4Wsh; Tue, 2 Mar 2021 15:17: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 4D0AB18EAF; Tue, 2 Mar 2021 15:17: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 122FHlhE039423; Tue, 2 Mar 2021 15:17:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHlUF039422; Tue, 2 Mar 2021 15:17:47 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:47 GMT Message-Id: <202103021517.122FHlUF039422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 02a34c9198d2 - stable/12 - bridge: Support STP on VLAN devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 02a34c9198d2d9c73150e4cae4910fe4af21a39c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:47 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=02a34c9198d2d9c73150e4cae4910fe4af21a39c commit 02a34c9198d2d9c73150e4cae4910fe4af21a39c Author: Kristof Provost AuthorDate: 2021-02-20 09:11:30 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 08:30:37 +0000 bridge: Support STP on VLAN devices VLAN devices have type IFT_L2VLAN, so the STP code mistakenly believed they couldn't be used for STP. That's not the case, so add the ITF_L2VLAN to the check. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28857 (cherry picked from commit 711ed156b94562c3dcb2ee9c1b3f240f960a75d2) --- sys/net/bridgestp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index d613051eb565..ed83a2d646f5 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -2232,6 +2232,7 @@ bstp_enable(struct bstp_port *bp) switch (ifp->if_type) { case IFT_ETHER: /* These can do spanning tree. */ + case IFT_L2VLAN: break; default: /* Nothing else can. */ From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A16156C717; Tue, 2 Mar 2021 15:17: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 4Dqgjm3XRnz4WcS; Tue, 2 Mar 2021 15:17: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 61F2818EB0; Tue, 2 Mar 2021 15:17: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 122FHm9t039448; Tue, 2 Mar 2021 15:17:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHm3D039447; Tue, 2 Mar 2021 15:17:48 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:48 GMT Message-Id: <202103021517.122FHm3D039447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 6a0355a0fe75 - stable/12 - bridge: Remove members when assigned to a new vnet MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6a0355a0fe751368c66ea2e7debee86badb50d2a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:48 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a0355a0fe751368c66ea2e7debee86badb50d2a commit 6a0355a0fe751368c66ea2e7debee86badb50d2a Author: Kristof Provost AuthorDate: 2021-02-21 20:20:32 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 08:31:02 +0000 bridge: Remove members when assigned to a new vnet When the bridge is moved to a different vnet we must remove all of its member interfaces (and span interfaces), because we don't know if those will be moved along with it. We don't want to hold references to interfaces not in our vnet. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28859 (cherry picked from commit 38c0951386d82f4c51cf4e245253cdef18d2254a) --- sys/net/ethernet.h | 4 ++++ sys/net/if_bridge.c | 25 +++++++++++++++++++++++++ sys/net/if_ethersubr.c | 3 --- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index fdfc41b55037..1f718e6e69d2 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -429,6 +429,10 @@ extern uint32_t ether_crc32_be(const uint8_t *, size_t); extern void ether_demux(struct ifnet *, struct mbuf *); extern void ether_ifattach(struct ifnet *, const u_int8_t *); extern void ether_ifdetach(struct ifnet *); +#ifdef VIMAGE +struct vnet; +extern void ether_reassign(struct ifnet *, struct vnet *, char *); +#endif extern int ether_ioctl(struct ifnet *, u_long, caddr_t); extern int ether_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 6ff9cd95e090..4e5c9ada12d1 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -674,6 +674,28 @@ SYSCTL_PROC(_net_link_bridge, OID_AUTO, ipfw, &VNET_NAME(pfil_ipfw), 0, &sysctl_pfil_ipfw, "I", "Layer2 filter with IPFW"); +#ifdef VIMAGE +static void +bridge_reassign(struct ifnet *ifp, struct vnet *newvnet, char *arg) +{ + struct bridge_softc *sc = ifp->if_softc; + struct bridge_iflist *bif; + + BRIDGE_LOCK(sc); + + while ((bif = CK_LIST_FIRST(&sc->sc_iflist)) != NULL) + bridge_delete_member(sc, bif, 0); + + while ((bif = CK_LIST_FIRST(&sc->sc_spanlist)) != NULL) { + bridge_delete_span(sc, bif); + } + + BRIDGE_UNLOCK(sc); + + ether_reassign(ifp, newvnet, arg); +} +#endif + /* * bridge_clone_create: * @@ -756,6 +778,9 @@ bridge_clone_create(struct if_clone *ifc, int unit, caddr_t params) /* Now undo some of the damage... */ ifp->if_baudrate = 0; ifp->if_type = IFT_BRIDGE; +#ifdef VIMAGE + ifp->if_reassign = bridge_reassign; +#endif BRIDGE_LIST_LOCK(); LIST_INSERT_HEAD(&V_bridge_list, sc, sc_list); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 532d6a7a342b..5e255f862221 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -117,9 +117,6 @@ static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = static int ether_resolvemulti(struct ifnet *, struct sockaddr **, struct sockaddr *); -#ifdef VIMAGE -static void ether_reassign(struct ifnet *, struct vnet *, char *); -#endif static int ether_requestencap(struct ifnet *, struct if_encap_req *); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E495156C7A1; Tue, 2 Mar 2021 15:17: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 4Dqgjm66XGz4WcT; Tue, 2 Mar 2021 15:17: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 C4D28188F8; Tue, 2 Mar 2021 15:17: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 122FHm45039531; Tue, 2 Mar 2021 15:17:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHmZF039530; Tue, 2 Mar 2021 15:17:48 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:48 GMT Message-Id: <202103021517.122FHmZF039530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c3438a8438fe - stable/13 - bridge: Support STP on VLAN devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c3438a8438fe44be4d63f1f9091f844cafdcb482 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:49 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3438a8438fe44be4d63f1f9091f844cafdcb482 commit c3438a8438fe44be4d63f1f9091f844cafdcb482 Author: Kristof Provost AuthorDate: 2021-02-20 09:11:30 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 14:50:21 +0000 bridge: Support STP on VLAN devices VLAN devices have type IFT_L2VLAN, so the STP code mistakenly believed they couldn't be used for STP. That's not the case, so add the ITF_L2VLAN to the check. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28857 (cherry picked from commit 711ed156b94562c3dcb2ee9c1b3f240f960a75d2) --- sys/net/bridgestp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index a8bb51c11f51..c36dc61d1397 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -2232,6 +2232,7 @@ bstp_enable(struct bstp_port *bp) switch (ifp->if_type) { case IFT_ETHER: /* These can do spanning tree. */ + case IFT_L2VLAN: break; default: /* Nothing else can. */ From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 724D556C454; Tue, 2 Mar 2021 15:17: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 4Dqgjq0H7wz4WqL; Tue, 2 Mar 2021 15:17: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 0C68418EB1; Tue, 2 Mar 2021 15:17: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 122FHncR039572; Tue, 2 Mar 2021 15:17:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHntC039571; Tue, 2 Mar 2021 15:17:49 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:49 GMT Message-Id: <202103021517.122FHntC039571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a20033be9ed8 - stable/13 - bridge: Remove members when assigned to a new vnet MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a20033be9ed86295d3baac176d99b59c2f6ec7e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:54 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a20033be9ed86295d3baac176d99b59c2f6ec7e5 commit a20033be9ed86295d3baac176d99b59c2f6ec7e5 Author: Kristof Provost AuthorDate: 2021-02-21 20:20:32 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 14:50:21 +0000 bridge: Remove members when assigned to a new vnet When the bridge is moved to a different vnet we must remove all of its member interfaces (and span interfaces), because we don't know if those will be moved along with it. We don't want to hold references to interfaces not in our vnet. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28859 (cherry picked from commit 38c0951386d82f4c51cf4e245253cdef18d2254a) --- sys/net/ethernet.h | 4 ++++ sys/net/if_bridge.c | 25 +++++++++++++++++++++++++ sys/net/if_ethersubr.c | 3 --- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index 38c0aa249272..f174ca9eb143 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -437,6 +437,10 @@ extern uint32_t ether_crc32_be(const uint8_t *, size_t); extern void ether_demux(struct ifnet *, struct mbuf *); extern void ether_ifattach(struct ifnet *, const u_int8_t *); extern void ether_ifdetach(struct ifnet *); +#ifdef VIMAGE +struct vnet; +extern void ether_reassign(struct ifnet *, struct vnet *, char *); +#endif extern int ether_ioctl(struct ifnet *, u_long, caddr_t); extern int ether_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 7c4e48ff04c6..24338267229b 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -670,6 +670,28 @@ SYSCTL_PROC(_net_link_bridge, OID_AUTO, ipfw, &VNET_NAME(pfil_ipfw), 0, &sysctl_pfil_ipfw, "I", "Layer2 filter with IPFW"); +#ifdef VIMAGE +static void +bridge_reassign(struct ifnet *ifp, struct vnet *newvnet, char *arg) +{ + struct bridge_softc *sc = ifp->if_softc; + struct bridge_iflist *bif; + + BRIDGE_LOCK(sc); + + while ((bif = CK_LIST_FIRST(&sc->sc_iflist)) != NULL) + bridge_delete_member(sc, bif, 0); + + while ((bif = CK_LIST_FIRST(&sc->sc_spanlist)) != NULL) { + bridge_delete_span(sc, bif); + } + + BRIDGE_UNLOCK(sc); + + ether_reassign(ifp, newvnet, arg); +} +#endif + /* * bridge_clone_create: * @@ -716,6 +738,9 @@ bridge_clone_create(struct if_clone *ifc, int unit, caddr_t params) /* Now undo some of the damage... */ ifp->if_baudrate = 0; ifp->if_type = IFT_BRIDGE; +#ifdef VIMAGE + ifp->if_reassign = bridge_reassign; +#endif BRIDGE_LIST_LOCK(); LIST_INSERT_HEAD(&V_bridge_list, sc, sc_list); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 77c138d7a092..01c2d2f7b3e8 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -117,9 +117,6 @@ static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = static int ether_resolvemulti(struct ifnet *, struct sockaddr **, struct sockaddr *); -#ifdef VIMAGE -static void ether_reassign(struct ifnet *, struct vnet *, char *); -#endif static int ether_requestencap(struct ifnet *, struct if_encap_req *); #define senderr(e) do { error = (e); goto bad;} while (0) From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2762856C7A6; Tue, 2 Mar 2021 15:17:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqgjs3D5Dz4Wt8; Tue, 2 Mar 2021 15:17: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 3942518FC6; Tue, 2 Mar 2021 15:17: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 122FHqLR039648; Tue, 2 Mar 2021 15:17:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHqaD039647; Tue, 2 Mar 2021 15:17:52 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:52 GMT Message-Id: <202103021517.122FHqaD039647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: eaba3fe1483f - stable/13 - bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eaba3fe1483fe82baccb6d3930347bbd548c6fcd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:56 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=eaba3fe1483fe82baccb6d3930347bbd548c6fcd commit eaba3fe1483fe82baccb6d3930347bbd548c6fcd Author: Kristof Provost AuthorDate: 2021-02-21 20:18:46 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 14:50:21 +0000 bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28858 (cherry picked from commit 89fa9c34d76bbf85cd7cda60c1868f5e3dba4ec7) --- sys/net/bridgestp.c | 9 +++++++++ sys/net/if_bridge.c | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index c36dc61d1397..82524440c241 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -154,6 +154,8 @@ static void bstp_reinit(struct bstp_state *); static void bstp_transmit(struct bstp_state *bs, struct bstp_port *bp) { + NET_EPOCH_ASSERT(); + if (bs->bs_running == 0) return; @@ -346,6 +348,7 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp, struct ether_header *eh; BSTP_LOCK_ASSERT(bs); + NET_EPOCH_ASSERT(); ifp = bp->bp_ifp; @@ -923,6 +926,8 @@ bstp_update_state(struct bstp_state *bs, struct bstp_port *bp) static void bstp_update_roles(struct bstp_state *bs, struct bstp_port *bp) { + NET_EPOCH_ASSERT(); + switch (bp->bp_role) { case BSTP_ROLE_DISABLED: /* Clear any flags if set */ @@ -1862,6 +1867,7 @@ bstp_disable_port(struct bstp_state *bs, struct bstp_port *bp) static void bstp_tick(void *arg) { + struct epoch_tracker et; struct bstp_state *bs = arg; struct bstp_port *bp; @@ -1870,6 +1876,7 @@ bstp_tick(void *arg) if (bs->bs_running == 0) return; + NET_EPOCH_ENTER(et); CURVNET_SET(bs->bs_vnet); /* poll link events on interfaces that do not support linkstate */ @@ -1908,6 +1915,7 @@ bstp_tick(void *arg) } CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); callout_reset(&bs->bs_bstpcallout, hz, bstp_tick, bs); } @@ -2229,6 +2237,7 @@ bstp_enable(struct bstp_port *bp) struct ifnet *ifp = bp->bp_ifp; KASSERT(bp->bp_active == 0, ("already a bstp member")); + NET_EPOCH_ASSERT(); /* Because bstp_update_roles() causes traffic. */ switch (ifp->if_type) { case IFT_ETHER: /* These can do spanning tree. */ diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 24338267229b..3e6b5ba8e0c2 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1351,6 +1351,7 @@ bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg) static int bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) { + struct epoch_tracker et; struct ifbreq *req = arg; struct bridge_iflist *bif; struct bstp_port *bp; @@ -1365,11 +1366,15 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) /* SPAN is readonly */ return (EINVAL); + NET_EPOCH_ENTER(et); + if (req->ifbr_ifsflags & IFBIF_STP) { if ((bif->bif_flags & IFBIF_STP) == 0) { error = bstp_enable(&bif->bif_stp); - if (error) + if (error) { + NET_EPOCH_EXIT(et); return (error); + } } } else { if ((bif->bif_flags & IFBIF_STP) != 0) @@ -1385,6 +1390,8 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) /* Save the bits relating to the bridge */ bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK; + NET_EPOCH_EXIT(et); + return (0); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9645D56C456; Tue, 2 Mar 2021 15:17: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 4Dqgjr3x93z4WwJ; Tue, 2 Mar 2021 15:17: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 1DCA018F10; Tue, 2 Mar 2021 15:17: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 122FHo7f039608; Tue, 2 Mar 2021 15:17:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHoSR039607; Tue, 2 Mar 2021 15:17:50 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:50 GMT Message-Id: <202103021517.122FHoSR039607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 05ac80ac0f3a - stable/13 - arp/nd: Cope with late calls to iflladdr_event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05ac80ac0f3a41092a07e947fea1ed2e5f047d15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:56 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=05ac80ac0f3a41092a07e947fea1ed2e5f047d15 commit 05ac80ac0f3a41092a07e947fea1ed2e5f047d15 Author: Kristof Provost AuthorDate: 2021-02-22 07:19:43 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 14:50:21 +0000 arp/nd: Cope with late calls to iflladdr_event When tearing down vnet jails we can move an if_bridge out (as part of the normal vnet_if_return()). This can, when it's clearing out its list of member interfaces, change its link layer address. That sends an iflladdr_event, but at that point we've already freed the AF_INET/AF_INET6 if_afdata pointers. In other words: when the iflladdr_event callbacks fire we can't assume that ifp->if_afdata[AF_INET] will be set. Reviewed by: donner@, melifaro@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28860 (cherry picked from commit c139b3c19b52abe3b5ba23a8175e58e70c7a528d) --- sys/netinet/if_ether.c | 4 ++++ sys/netinet6/nd6.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index e09ad3d47382..ef50ec9ca964 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1479,6 +1479,10 @@ arp_handle_ifllchange(struct ifnet *ifp) static void arp_iflladdr(void *arg __unused, struct ifnet *ifp) { + /* if_bridge can update its lladdr during if_vmove(), after we've done + * if_detach_internal()/dom_ifdetach(). */ + if (ifp->if_afdata[AF_INET] == NULL) + return; lltable_update_ifaddr(LLTABLE(ifp)); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 497c0bfc10e8..62f0ac733a23 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -208,6 +208,8 @@ nd6_lle_event(void *arg __unused, struct llentry *lle, int evt) static void nd6_iflladdr(void *arg __unused, struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return; lltable_update_ifaddr(LLTABLE6(ifp)); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74E6456C7B2; Tue, 2 Mar 2021 15:17: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 4Dqgjv2Lkqz4Wqg; Tue, 2 Mar 2021 15:17:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5575919078; Tue, 2 Mar 2021 15:17: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 122FHrJr039688; Tue, 2 Mar 2021 15:17:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHrhH039687; Tue, 2 Mar 2021 15:17:53 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:53 GMT Message-Id: <202103021517.122FHrhH039687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 2c19b99c2f1c - stable/13 - bridge tests: Test STP on top of VLAN devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c19b99c2f1c78bebb931f9465146ad4e7f1dec9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:57 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2c19b99c2f1c78bebb931f9465146ad4e7f1dec9 commit 2c19b99c2f1c78bebb931f9465146ad4e7f1dec9 Author: Kristof Provost AuthorDate: 2021-02-20 09:13:33 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 14:50:21 +0000 bridge tests: Test STP on top of VLAN devices This is basically the same test as the existing STP test, but now on top of VLAN interfaces instead of directly using the epair devices. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28861 (cherry picked from commit 26492ba2716f8b839f743bb663ce47405990fdf0) --- tests/sys/net/if_bridge_test.sh | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index b848a03b273d..bc9add68ce25 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -124,6 +124,71 @@ stp_cleanup() vnet_cleanup } +atf_test_case "stp_vlan" "cleanup" +stp_vlan_head() +{ + atf_set descr 'Spanning tree on VLAN test' + atf_set require.user root +} + +stp_vlan_body() +{ + vnet_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + bridge_a=$(vnet_mkbridge) + bridge_b=$(vnet_mkbridge) + + vnet_mkjail a ${bridge_a} ${epair_one}a ${epair_two}a + vnet_mkjail b ${bridge_b} ${epair_one}b ${epair_two}b + + jexec a ifconfig ${epair_one}a up + jexec a ifconfig ${epair_two}a up + vlan_a_one=$(jexec a ifconfig vlan create vlandev ${epair_one}a vlan 42) + vlan_a_two=$(jexec a ifconfig vlan create vlandev ${epair_two}a vlan 42) + jexec a ifconfig ${vlan_a_one} up + jexec a ifconfig ${vlan_a_two} up + jexec a ifconfig ${bridge_a} addm ${vlan_a_one} + jexec a ifconfig ${bridge_a} addm ${vlan_a_two} + + jexec b ifconfig ${epair_one}b up + jexec b ifconfig ${epair_two}b up + vlan_b_one=$(jexec b ifconfig vlan create vlandev ${epair_one}b vlan 42) + vlan_b_two=$(jexec b ifconfig vlan create vlandev ${epair_two}b vlan 42) + jexec b ifconfig ${vlan_b_one} up + jexec b ifconfig ${vlan_b_two} up + jexec b ifconfig ${bridge_b} addm ${vlan_b_one} + jexec b ifconfig ${bridge_b} addm ${vlan_b_two} + + jexec a ifconfig ${bridge_a} 192.0.2.1/24 + + # Enable spanning tree + jexec a ifconfig ${bridge_a} stp ${vlan_a_one} + jexec a ifconfig ${bridge_a} stp ${vlan_a_two} + jexec b ifconfig ${bridge_b} stp ${vlan_b_one} + jexec b ifconfig ${bridge_b} stp ${vlan_b_two} + + jexec b ifconfig ${bridge_b} up + jexec a ifconfig ${bridge_a} up + + # Give STP time to do its thing + sleep 5 + + a_discard=$(jexec a ifconfig ${bridge_a} | grep discarding) + b_discard=$(jexec b ifconfig ${bridge_b} | grep discarding) + + if [ -z "${a_discard}" ] && [ -z "${b_discard}" ] + then + atf_fail "STP failed to detect bridging loop" + fi +} + +stp_vlan_cleanup() +{ + vnet_cleanup +} + atf_test_case "static" "cleanup" static_head() { @@ -329,6 +394,7 @@ atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" + atf_add_test_case "stp_vlan" atf_add_test_case "static" atf_add_test_case "span" atf_add_test_case "inherit_mac" From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FC1656C37E; Tue, 2 Mar 2021 15:17: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 4Dqgjr3fcmz4Wt2; Tue, 2 Mar 2021 15:17: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 DA4D319077; Tue, 2 Mar 2021 15:17: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 122FHojV039590; Tue, 2 Mar 2021 15:17:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHoRs039589; Tue, 2 Mar 2021 15:17:50 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:50 GMT Message-Id: <202103021517.122FHoRs039589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 2d1773f32319 - stable/12 - bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2d1773f323195f2ff4910b1ce0f66207dcae79f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:56 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2d1773f323195f2ff4910b1ce0f66207dcae79f3 commit 2d1773f323195f2ff4910b1ce0f66207dcae79f3 Author: Kristof Provost AuthorDate: 2021-02-21 20:18:46 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28858 (cherry picked from commit 89fa9c34d76bbf85cd7cda60c1868f5e3dba4ec7) --- sys/net/bridgestp.c | 2 ++ sys/net/if_bridge.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index ed83a2d646f5..d0259c37bf84 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -1871,6 +1871,7 @@ bstp_tick(void *arg) if (bs->bs_running == 0) return; + NET_EPOCH_ENTER(); CURVNET_SET(bs->bs_vnet); /* poll link events on interfaces that do not support linkstate */ @@ -1909,6 +1910,7 @@ bstp_tick(void *arg) } CURVNET_RESTORE(); + NET_EPOCH_EXIT(); callout_reset(&bs->bs_bstpcallout, hz, bstp_tick, bs); } diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 4e5c9ada12d1..8b25c28eb554 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1408,11 +1408,15 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) /* SPAN is readonly */ return (EINVAL); + NET_EPOCH_ENTER(); + if (req->ifbr_ifsflags & IFBIF_STP) { if ((bif->bif_flags & IFBIF_STP) == 0) { error = bstp_enable(&bif->bif_stp); - if (error) + if (error) { + NET_EPOCH_EXIT(); return (error); + } } } else { if ((bif->bif_flags & IFBIF_STP) != 0) @@ -1428,6 +1432,8 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) /* Save the bits relating to the bridge */ bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK; + NET_EPOCH_EXIT(); + return (0); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6135756C7A5; Tue, 2 Mar 2021 15:17: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 4Dqgjn6CH3z4Wh7; Tue, 2 Mar 2021 15:17:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93AB618C46; Tue, 2 Mar 2021 15:17:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122FHnXX039552; Tue, 2 Mar 2021 15:17:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHn9S039550; Tue, 2 Mar 2021 15:17:49 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:49 GMT Message-Id: <202103021517.122FHn9S039550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a285c84d517f - stable/12 - arp/nd: Cope with late calls to iflladdr_event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a285c84d517f4b987dfbbcec876d1fd812065a27 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:56 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a285c84d517f4b987dfbbcec876d1fd812065a27 commit a285c84d517f4b987dfbbcec876d1fd812065a27 Author: Kristof Provost AuthorDate: 2021-02-22 07:19:43 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 08:31:13 +0000 arp/nd: Cope with late calls to iflladdr_event When tearing down vnet jails we can move an if_bridge out (as part of the normal vnet_if_return()). This can, when it's clearing out its list of member interfaces, change its link layer address. That sends an iflladdr_event, but at that point we've already freed the AF_INET/AF_INET6 if_afdata pointers. In other words: when the iflladdr_event callbacks fire we can't assume that ifp->if_afdata[AF_INET] will be set. Reviewed by: donner@, melifaro@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28860 (cherry picked from commit c139b3c19b52abe3b5ba23a8175e58e70c7a528d) --- sys/netinet/if_ether.c | 4 ++++ sys/netinet6/nd6.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index a05001999ca4..538f6abb9855 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1461,6 +1461,10 @@ arp_handle_ifllchange(struct ifnet *ifp) static void arp_iflladdr(void *arg __unused, struct ifnet *ifp) { + /* if_bridge can update its lladdr during if_vmove(), after we've done + * if_detach_internal()/dom_ifdetach(). */ + if (ifp->if_afdata[AF_INET] == NULL) + return; lltable_update_ifaddr(LLTABLE(ifp)); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 50fcc3226f97..d1d4b7c7fa88 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -206,6 +206,8 @@ nd6_lle_event(void *arg __unused, struct llentry *lle, int evt) static void nd6_iflladdr(void *arg __unused, struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return; lltable_update_ifaddr(LLTABLE6(ifp)); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E5D256C811; Tue, 2 Mar 2021 15:17: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 4Dqgjt2JkGz4WfS; Tue, 2 Mar 2021 15:17: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 405F318C47; Tue, 2 Mar 2021 15:17: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 122FHpMC039630; Tue, 2 Mar 2021 15:17:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHp27039629; Tue, 2 Mar 2021 15:17:51 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:51 GMT Message-Id: <202103021517.122FHp27039629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 791f370cb5d6 - stable/12 - bridge: Basic test case MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 791f370cb5d6a24a1938a4e0147cc2734df6d076 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:58 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=791f370cb5d6a24a1938a4e0147cc2734df6d076 commit 791f370cb5d6a24a1938a4e0147cc2734df6d076 Author: Kristof Provost AuthorDate: 2020-02-16 13:16:40 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge: Basic test case Very basic bridge test: Set up two jails and test that they can pass IPv4 traffic over the bridge. Reviewed by: melifaro, philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23697 (cherry picked from commit 095aabf7dc814ae96d83bc5327a4b1f2e23be419) --- tests/sys/common/vnet.subr | 7 ++++ tests/sys/net/Makefile | 5 +-- tests/sys/net/if_bridge_test.sh | 74 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) diff --git a/tests/sys/common/vnet.subr b/tests/sys/common/vnet.subr index 53b387ec07e5..d86afaf6aafa 100644 --- a/tests/sys/common/vnet.subr +++ b/tests/sys/common/vnet.subr @@ -16,6 +16,13 @@ vnet_mkepair() echo ${ifname%a} } +vnet_mkbridge() +{ + ifname=$(ifconfig bridge create) + echo $ifname >> created_interfaces.lst + echo ${ifname} +} + vnet_mkjail() { jailname=$1 diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 5989f8be0727..bbb1d1337b2f 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -5,10 +5,11 @@ TESTSDIR= ${TESTSBASE}/sys/net BINDIR= ${TESTSDIR} -ATF_TESTS_SH+= if_lagg_test +ATF_TESTS_C+= if_epair +ATF_TESTS_SH+= if_bridge_test ATF_TESTS_SH+= if_clone_test +ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_tun_test -ATF_TESTS_C+= if_epair # The tests are written to be run in parallel, but doing so leads to random # panics. I think it's because the kernel's list of interfaces isn't properly diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh new file mode 100755 index 000000000000..384857bff589 --- /dev/null +++ b/tests/sys/net/if_bridge_test.sh @@ -0,0 +1,74 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Kristof Provost under sponsorship +# from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "bridge_transmit_ipv4_unicast" "cleanup" +bridge_transmit_ipv4_unicast_head() +{ + atf_set descr 'bridge_transmit_ipv4_unicast bridging test' + atf_set require.user root +} + +bridge_transmit_ipv4_unicast_body() +{ + vnet_init + + epair_alcatraz=$(vnet_mkepair) + epair_singsing=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair_alcatraz}b + vnet_mkjail singsing ${epair_singsing}b + + jexec alcatraz ifconfig ${epair_alcatraz}b 192.0.2.1/24 up + jexec singsing ifconfig ${epair_singsing}b 192.0.2.2/24 up + + bridge=$(vnet_mkbridge) + + ifconfig ${bridge} up + ifconfig ${epair_alcatraz}a up + ifconfig ${epair_singsing}a up + ifconfig ${bridge} addm ${epair_alcatraz}a + ifconfig ${bridge} addm ${epair_singsing}a + + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 3 -t 1 192.0.2.2 + atf_check -s exit:0 -o ignore jexec singsing ping -c 3 -t 1 192.0.2.1 +} + +bridge_transmit_ipv4_unicast_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "bridge_transmit_ipv4_unicast" +} From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59BA456C46A; Tue, 2 Mar 2021 15:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqgjw6qLWz4Wfb; Tue, 2 Mar 2021 15:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F07F1907A; Tue, 2 Mar 2021 15:17: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 122FHtG1039771; Tue, 2 Mar 2021 15:17:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHtuO039770; Tue, 2 Mar 2021 15:17:55 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:55 GMT Message-Id: <202103021517.122FHtuO039770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 51ddfd32cc99 - stable/12 - bridge test: adding and removing static addresses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 51ddfd32cc9952a916d63b0c6780322b90f0873c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:59 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=51ddfd32cc9952a916d63b0c6780322b90f0873c commit 51ddfd32cc9952a916d63b0c6780322b90f0873c Author: Kristof Provost AuthorDate: 2020-03-10 06:29:59 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge test: adding and removing static addresses Reviewed by: philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23960 (cherry picked from commit d99bb677c1cf43b22e91d54c49a8b7f0592e6fce) --- tests/sys/net/if_bridge_test.sh | 57 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index afb260a86cc3..34b72c33bb36 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -135,8 +135,65 @@ stp_cleanup() vnet_cleanup } +atf_test_case "static" "cleanup" +static_head() +{ + atf_set descr 'Bridge static address test' + atf_set require.user root +} + +static_body() +{ + vnet_init + + epair=$(vnet_mkepair) + bridge=$(vnet_mkbridge) + + vnet_mkjail one ${bridge} ${epair}a + + ifconfig ${epair}b up + + jexec one ifconfig ${bridge} up + jexec one ifconfig ${epair}a up + jexec one ifconfig ${bridge} addm ${epair}a + + # Wrong interface + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} static ${epair}b 00:01:02:03:04:05 + + # Bad address format + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} static ${epair}a 00:01:02:03:04 + + # Correct add + atf_check -s exit:0 -o ignore \ + jexec one ifconfig ${bridge} static ${epair}a 00:01:02:03:04:05 + + # List addresses + atf_check -s exit:0 -o ignore \ + jexec one ifconfig ${bridge} addr + + # Delete with bad address format + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} deladdr 00:01:02:03:04 + + # Delete with unlisted address + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:06 + + # Correct delete + atf_check -s exit:0 -o ignore \ + jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:05 +} + +static_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" + atf_add_test_case "static" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FA7656C7B1; Tue, 2 Mar 2021 15:17: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 4Dqgjv16fFz4Wmq; Tue, 2 Mar 2021 15:17:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2E8418FC7; Tue, 2 Mar 2021 15:17: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 122FHql4039668; Tue, 2 Mar 2021 15:17:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHqOa039667; Tue, 2 Mar 2021 15:17:52 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:52 GMT Message-Id: <202103021517.122FHqOa039667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 40fc07a85577 - stable/12 - bridge tests: Remove unneeded 'All rights reserved.' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 40fc07a85577bb22b923978b1fc9e99ce147d4a1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:59 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=40fc07a85577bb22b923978b1fc9e99ce147d4a1 commit 40fc07a85577bb22b923978b1fc9e99ce147d4a1 Author: Kristof Provost AuthorDate: 2020-02-19 16:44:16 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge tests: Remove unneeded 'All rights reserved.' The FreeBSD foundation no longer requires this, as per https://lists.freebsd.org/pipermail/svn-src-all/2019-February/177215.html and private communications. Sponsored by: The FreeBSD Foundation (cherry picked from commit e3c73f3d74c77b2c168519b10bdb6910a84287ef) --- tests/sys/net/if_bridge_test.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 384857bff589..c51321187018 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -3,7 +3,6 @@ # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # # Copyright (c) 2020 The FreeBSD Foundation -# All rights reserved. # # This software was developed by Kristof Provost under sponsorship # from the FreeBSD Foundation. From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:18:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0239356C471; Tue, 2 Mar 2021 15:18: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 4Dqgjz2JmSz4Whv; Tue, 2 Mar 2021 15:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 878A818E7B; Tue, 2 Mar 2021 15:17: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 122FHvYd039811; Tue, 2 Mar 2021 15:17:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHvBS039810; Tue, 2 Mar 2021 15:17:57 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:57 GMT Message-Id: <202103021517.122FHvBS039810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e180cc2fb9c5 - stable/12 - bridge tests: Test deleting a bridge with members MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e180cc2fb9c5d7eb2d198470f54f7dbebbf4bf7c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:18:01 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e180cc2fb9c5d7eb2d198470f54f7dbebbf4bf7c commit e180cc2fb9c5d7eb2d198470f54f7dbebbf4bf7c Author: Kristof Provost AuthorDate: 2020-04-17 14:57:15 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge tests: Test deleting a bridge with members Reviewed by: philip, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24337 (cherry picked from commit 3f359bfd47430183f69b9c03f34458217e7c7970) --- tests/sys/net/if_bridge_test.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 7b26b97967ad..cb9c297220b6 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -245,10 +245,37 @@ span_cleanup() vnet_cleanup } +atf_test_case "delete_with_members" "cleanup" +delete_with_members_head() +{ + atf_set descr 'Delete a bridge which still has member interfaces' + atf_set require.user root +} + +delete_with_members_body() +{ + vnet_init + + bridge=$(vnet_mkbridge) + epair=$(vnet_mkepair) + + ifconfig ${bridge} 192.0.2.1/24 up + ifconfig ${epair}a up + ifconfig ${bridge} addm ${epair}a + + ifconfig ${bridge} destroy +} + +delete_with_members_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" atf_add_test_case "static" atf_add_test_case "span" + atf_add_test_case "delete_with_members" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:18:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 464D856C823; Tue, 2 Mar 2021 15:18: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 4Dqgk14mbsz4X00; Tue, 2 Mar 2021 15:18: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 9EA1C18EB3; Tue, 2 Mar 2021 15:17: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 122FHwrO039833; Tue, 2 Mar 2021 15:17:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHwWD039832; Tue, 2 Mar 2021 15:17:58 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:58 GMT Message-Id: <202103021517.122FHwWD039832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e11329536494 - stable/12 - bridge tests: Ensure that bridges in different jails get different MAC addresses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1132953649454ed7ae40e156c23de20d6a3827c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:18:03 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e1132953649454ed7ae40e156c23de20d6a3827c commit e1132953649454ed7ae40e156c23de20d6a3827c Author: Kristof Provost AuthorDate: 2020-04-19 16:30:49 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge tests: Ensure that bridges in different jails get different MAC addresses We used to have a problem where bridges created in different vnet jails would end up having the same mac address. This is now fixed by including the jail name as a seed for the mac address generation, but we should verify that it doesn't regress. (cherry picked from commit 2885ae0c3ca3ea93e1f227ecb3003db2e94f4129) --- tests/sys/net/if_bridge_test.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index cb9c297220b6..111281799e9d 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -271,6 +271,44 @@ delete_with_members_cleanup() vnet_cleanup } +atf_test_case "mac_conflict" "cleanup" +mac_conflict_head() +{ + atf_set descr 'Ensure that bridges in different jails get different mac addresses' + atf_set require.user root +} + +mac_conflict_body() +{ + vnet_init + + epair=$(vnet_mkepair) + + # Ensure the bridge module is loaded so jails can use it. + tmpbridge=$(vnet_mkbridge) + + vnet_mkjail bridge_mac_conflict_one ${epair}a + vnet_mkjail bridge_mac_conflict_two ${epair}b + + jexec bridge_mac_conflict_one ifconfig bridge create + jexec bridge_mac_conflict_one ifconfig bridge0 192.0.2.1/24 up \ + addm ${epair}a + jexec bridge_mac_conflict_one ifconfig ${epair}a up + + jexec bridge_mac_conflict_two ifconfig bridge create + jexec bridge_mac_conflict_two ifconfig bridge0 192.0.2.2/24 up \ + addm ${epair}b + jexec bridge_mac_conflict_two ifconfig ${epair}b up + + atf_check -s exit:0 -o ignore \ + jexec bridge_mac_conflict_one ping -c 3 192.0.2.2 +} + +mac_conflict_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -278,4 +316,5 @@ atf_init_test_cases() atf_add_test_case "static" atf_add_test_case "span" atf_add_test_case "delete_with_members" + atf_add_test_case "mac_conflict" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:17:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74B9456C75B; Tue, 2 Mar 2021 15:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqgjw6pY2z4Wyg; Tue, 2 Mar 2021 15:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D87B19079; Tue, 2 Mar 2021 15:17: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 122FHrhS039706; Tue, 2 Mar 2021 15:17:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHr1R039705; Tue, 2 Mar 2021 15:17:53 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:53 GMT Message-Id: <202103021517.122FHr1R039705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 5b8932427605 - stable/12 - bridge test: spanning tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5b893242760570495abb09974455ab32a8fd6b95 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:17:59 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b893242760570495abb09974455ab32a8fd6b95 commit 5b893242760570495abb09974455ab32a8fd6b95 Author: Kristof Provost AuthorDate: 2020-03-10 06:28:45 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge test: spanning tree Basic test case where we create a bridge loop, verify that we really are looping and then enable spanning tree to resolve the loop. Reviewed by: philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23959 (cherry picked from commit 6f0a65b080aac1b3144c7489b020b26b345d1a1b) --- tests/sys/net/if_bridge_test.sh | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index c51321187018..afb260a86cc3 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -67,7 +67,76 @@ bridge_transmit_ipv4_unicast_cleanup() vnet_cleanup } +atf_test_case "stp" "cleanup" +stp_head() +{ + atf_set descr 'Spanning tree test' + atf_set require.user root + atf_set require.progs jq +} + +stp_body() +{ + vnet_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + bridge_a=$(vnet_mkbridge) + bridge_b=$(vnet_mkbridge) + + vnet_mkjail a ${bridge_a} ${epair_one}a ${epair_two}a + vnet_mkjail b ${bridge_b} ${epair_one}b ${epair_two}b + + jexec a ifconfig ${bridge_a} up + jexec a ifconfig ${epair_one}a up + jexec a ifconfig ${epair_two}a up + jexec a ifconfig ${bridge_a} addm ${epair_one}a + jexec a ifconfig ${bridge_a} addm ${epair_two}a + + jexec b ifconfig ${bridge_b} up + jexec b ifconfig ${epair_one}b up + jexec b ifconfig ${epair_two}b up + jexec b ifconfig ${bridge_b} addm ${epair_one}b + jexec b ifconfig ${bridge_b} addm ${epair_two}b + + jexec a ifconfig ${bridge_a} 192.0.2.1/24 + + # Give the interfaces some time to come up and pass some traffic + sleep 5 + + # Confirm that there's looping traffic + nbr=$(jexec a netstat -I ${bridge_a} --libxo json \ + | jq ".statistics.interface[0].\"received-packets\"") + if [ ${nbr} -lt 100 ] + then + atf_fail "Expected bridging loop, but found very few packets." + fi + + # Enable spanning tree + jexec a ifconfig ${bridge_a} stp ${epair_one}a + jexec a ifconfig ${bridge_a} stp ${epair_two}a + jexec b ifconfig ${bridge_b} stp ${epair_one}b + jexec b ifconfig ${bridge_b} stp ${epair_two}b + + # Give STP time to do its thing + sleep 5 + + a_discard=$(jexec a ifconfig ${bridge_a} | grep discarding) + b_discard=$(jexec b ifconfig ${bridge_b} | grep discarding) + + if [ -z "${a_discard}" ] && [ -z "${b_discard}" ] + then + atf_fail "STP failed to detect bridging loop" + fi +} + +stp_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" + atf_add_test_case "stp" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:18:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B8D956C575; Tue, 2 Mar 2021 15:18: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 4Dqgjz2Mcsz4Wyr; Tue, 2 Mar 2021 15:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58EFA18EB2; Tue, 2 Mar 2021 15:17: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 122FHuxs039793; Tue, 2 Mar 2021 15:17:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHugH039792; Tue, 2 Mar 2021 15:17:56 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:56 GMT Message-Id: <202103021517.122FHugH039792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c4bf12b43711 - stable/12 - bridge tests: Basic span test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c4bf12b4371112ea5e875b51befbb4c12b9707db Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:18:00 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c4bf12b4371112ea5e875b51befbb4c12b9707db commit c4bf12b4371112ea5e875b51befbb4c12b9707db Author: Kristof Provost AuthorDate: 2020-03-16 08:44:46 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge tests: Basic span test Reviewed by: philip, emaste (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23961 (cherry picked from commit bb490fcf195450d9cbbac00e6338b352aac32c5c) --- tests/sys/net/if_bridge_test.sh | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 34b72c33bb36..7b26b97967ad 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -191,9 +191,64 @@ static_cleanup() vnet_cleanup } +atf_test_case "span" "cleanup" +span_head() +{ + atf_set descr 'Bridge span test' + atf_set require.user root +} + +span_body() +{ + set -x + vnet_init + + epair=$(vnet_mkepair) + epair_span=$(vnet_mkepair) + bridge=$(vnet_mkbridge) + + vnet_mkjail one ${bridge} ${epair}a ${epair_span}a + + ifconfig ${epair}b up + ifconfig ${epair_span}b up + + jexec one ifconfig ${bridge} up + jexec one ifconfig ${epair}a up + jexec one ifconfig ${epair_span}a up + jexec one ifconfig ${bridge} addm ${epair}a + + jexec one ifconfig ${bridge} span ${epair_span}a + jexec one ifconfig ${bridge} 192.0.2.1/24 + + # Send some traffic through the span + jexec one ping -c 1 -t 1 192.0.2.2 + + # Check that we see the traffic on the span interface + atf_check -s exit:0 \ + $(atf_get_srcdir)/../netpfil/common/pft_ping.py \ + --sendif ${epair}b \ + --to 192.0.2.2 \ + --recvif ${epair_span}b + + jexec one ifconfig ${bridge} -span ${epair_span}a + + # And no more traffic after we remove the span + atf_check -s exit:1 \ + $(atf_get_srcdir)/../netpfil/common/pft_ping.py \ + --sendif ${epair}b \ + --to 192.0.2.2 \ + --recvif ${epair_span}b +} + +span_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" atf_add_test_case "static" + atf_add_test_case "span" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:18:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6690756C828; Tue, 2 Mar 2021 15:18: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 4Dqgk369dxz4WlY; Tue, 2 Mar 2021 15:18: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 E0A0718EB4; Tue, 2 Mar 2021 15:18: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 122FI05n039874; Tue, 2 Mar 2021 15:18:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FI0jt039872; Tue, 2 Mar 2021 15:18:00 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:18:00 GMT Message-Id: <202103021518.122FI0jt039872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: fd5828b62bdb - stable/12 - bridge tests: Avoid building a switching loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fd5828b62bdb5738143c81edb139365aa4151567 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:18:07 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fd5828b62bdb5738143c81edb139365aa4151567 commit fd5828b62bdb5738143c81edb139365aa4151567 Author: Kristof Provost AuthorDate: 2020-06-01 19:26:16 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:07 +0000 bridge tests: Avoid building a switching loop Enable STP before bringing the bridges up. This avoids a switching loop, which has a tendency to drown out progress in userspace processes, especially on single-core systems. Only check that we have indeed shut down one of the looped interfaces PR: 246448 Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D25084 (cherry picked from commit e07e002e950aa673266e3d4b30c43e1198af65e0) --- tests/sys/net/if_bridge_test.sh | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index a20eae49998f..b848a03b273d 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -72,7 +72,6 @@ stp_head() { atf_set descr 'Spanning tree test' atf_set require.user root - atf_set require.progs jq } stp_body() @@ -87,13 +86,11 @@ stp_body() vnet_mkjail a ${bridge_a} ${epair_one}a ${epair_two}a vnet_mkjail b ${bridge_b} ${epair_one}b ${epair_two}b - jexec a ifconfig ${bridge_a} up jexec a ifconfig ${epair_one}a up jexec a ifconfig ${epair_two}a up jexec a ifconfig ${bridge_a} addm ${epair_one}a jexec a ifconfig ${bridge_a} addm ${epair_two}a - jexec b ifconfig ${bridge_b} up jexec b ifconfig ${epair_one}b up jexec b ifconfig ${epair_two}b up jexec b ifconfig ${bridge_b} addm ${epair_one}b @@ -101,23 +98,15 @@ stp_body() jexec a ifconfig ${bridge_a} 192.0.2.1/24 - # Give the interfaces some time to come up and pass some traffic - sleep 5 - - # Confirm that there's looping traffic - nbr=$(jexec a netstat -I ${bridge_a} --libxo json \ - | jq ".statistics.interface[0].\"received-packets\"") - if [ ${nbr} -lt 100 ] - then - atf_fail "Expected bridging loop, but found very few packets." - fi - # Enable spanning tree jexec a ifconfig ${bridge_a} stp ${epair_one}a jexec a ifconfig ${bridge_a} stp ${epair_two}a jexec b ifconfig ${bridge_b} stp ${epair_one}b jexec b ifconfig ${bridge_b} stp ${epair_two}b + jexec b ifconfig ${bridge_b} up + jexec a ifconfig ${bridge_a} up + # Give STP time to do its thing sleep 5 From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:18:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57AA156C991; Tue, 2 Mar 2021 15:18: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 4Dqgk33bm3z4WtY; Tue, 2 Mar 2021 15:18: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 C6F131907B; Tue, 2 Mar 2021 15:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122FHxax039855; Tue, 2 Mar 2021 15:17:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHxqJ039854; Tue, 2 Mar 2021 15:17:59 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:59 GMT Message-Id: <202103021517.122FHxqJ039854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 1b73cd3d0a7c - stable/12 - bridge tests: Test for #216510 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1b73cd3d0a7c9fa9b19e28a3bd8e79f405309348 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:18:07 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1b73cd3d0a7c9fa9b19e28a3bd8e79f405309348 commit 1b73cd3d0a7c9fa9b19e28a3bd8e79f405309348 Author: Kristof Provost AuthorDate: 2020-04-26 16:27:03 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:07 +0000 bridge tests: Test for #216510 We used to have an issue with recursive locking with net.link.bridge.inherit_mac. This causes us to send an ARP request while we hold the BRIDGE_LOCK, which used to cause us to acquire the BRIDGE_LOCK again. We can't re-acquire it, so this caused a panic. Now that we no longer need to acquire the BRIDGE_LOCK for bridge_transmit() this should no longer panic. Test this. PR: 216510 Reviewed by: emaste, philip MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24251 (cherry picked from commit 5377560783d95b92fce3bea3caac37d2860b1d48) --- tests/sys/net/if_bridge_test.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 111281799e9d..a20eae49998f 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -309,12 +309,40 @@ mac_conflict_cleanup() vnet_cleanup } +atf_test_case "inherit_mac" "cleanup" +inherit_mac_head() +{ + atf_set descr 'Bridge inherit_mac test, #216510' + atf_set require.user root +} + +inherit_mac_body() +{ + vnet_init + + bridge=$(vnet_mkbridge) + epair=$(vnet_mkepair) + vnet_mkjail one ${bridge} ${epair}a + + jexec one sysctl net.link.bridge.inherit_mac=1 + + # Attempt to provoke the panic described in #216510 + jexec one ifconfig ${bridge} 192.0.0.1/24 up + jexec one ifconfig ${bridge} addm ${epair}a +} + +inherit_mac_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" atf_add_test_case "static" atf_add_test_case "span" + atf_add_test_case "inherit_mac" atf_add_test_case "delete_with_members" atf_add_test_case "mac_conflict" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:18:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7831756C8A5; Tue, 2 Mar 2021 15:18: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 4Dqgk52QgFz4Wr9; Tue, 2 Mar 2021 15:18: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 0AA9918C48; Tue, 2 Mar 2021 15:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122FI1Pi039895; Tue, 2 Mar 2021 15:18:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FI1WN039894; Tue, 2 Mar 2021 15:18:01 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:18:01 GMT Message-Id: <202103021518.122FI1WN039894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 81d747ace024 - stable/12 - bridge tests: Test STP on top of VLAN devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 81d747ace024ff71746f003f4d108f26b69bfede Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:18:07 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81d747ace024ff71746f003f4d108f26b69bfede commit 81d747ace024ff71746f003f4d108f26b69bfede Author: Kristof Provost AuthorDate: 2021-02-20 09:13:33 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:07 +0000 bridge tests: Test STP on top of VLAN devices This is basically the same test as the existing STP test, but now on top of VLAN interfaces instead of directly using the epair devices. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28861 (cherry picked from commit 26492ba2716f8b839f743bb663ce47405990fdf0) --- tests/sys/net/if_bridge_test.sh | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index b848a03b273d..bc9add68ce25 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -124,6 +124,71 @@ stp_cleanup() vnet_cleanup } +atf_test_case "stp_vlan" "cleanup" +stp_vlan_head() +{ + atf_set descr 'Spanning tree on VLAN test' + atf_set require.user root +} + +stp_vlan_body() +{ + vnet_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + bridge_a=$(vnet_mkbridge) + bridge_b=$(vnet_mkbridge) + + vnet_mkjail a ${bridge_a} ${epair_one}a ${epair_two}a + vnet_mkjail b ${bridge_b} ${epair_one}b ${epair_two}b + + jexec a ifconfig ${epair_one}a up + jexec a ifconfig ${epair_two}a up + vlan_a_one=$(jexec a ifconfig vlan create vlandev ${epair_one}a vlan 42) + vlan_a_two=$(jexec a ifconfig vlan create vlandev ${epair_two}a vlan 42) + jexec a ifconfig ${vlan_a_one} up + jexec a ifconfig ${vlan_a_two} up + jexec a ifconfig ${bridge_a} addm ${vlan_a_one} + jexec a ifconfig ${bridge_a} addm ${vlan_a_two} + + jexec b ifconfig ${epair_one}b up + jexec b ifconfig ${epair_two}b up + vlan_b_one=$(jexec b ifconfig vlan create vlandev ${epair_one}b vlan 42) + vlan_b_two=$(jexec b ifconfig vlan create vlandev ${epair_two}b vlan 42) + jexec b ifconfig ${vlan_b_one} up + jexec b ifconfig ${vlan_b_two} up + jexec b ifconfig ${bridge_b} addm ${vlan_b_one} + jexec b ifconfig ${bridge_b} addm ${vlan_b_two} + + jexec a ifconfig ${bridge_a} 192.0.2.1/24 + + # Enable spanning tree + jexec a ifconfig ${bridge_a} stp ${vlan_a_one} + jexec a ifconfig ${bridge_a} stp ${vlan_a_two} + jexec b ifconfig ${bridge_b} stp ${vlan_b_one} + jexec b ifconfig ${bridge_b} stp ${vlan_b_two} + + jexec b ifconfig ${bridge_b} up + jexec a ifconfig ${bridge_a} up + + # Give STP time to do its thing + sleep 5 + + a_discard=$(jexec a ifconfig ${bridge_a} | grep discarding) + b_discard=$(jexec b ifconfig ${bridge_b} | grep discarding) + + if [ -z "${a_discard}" ] && [ -z "${b_discard}" ] + then + atf_fail "STP failed to detect bridging loop" + fi +} + +stp_vlan_cleanup() +{ + vnet_cleanup +} + atf_test_case "static" "cleanup" static_head() { @@ -329,6 +394,7 @@ atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" + atf_add_test_case "stp_vlan" atf_add_test_case "static" atf_add_test_case "span" atf_add_test_case "inherit_mac" From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:19:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B67656C86F; Tue, 2 Mar 2021 15:19: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 4DqglN2JWlz4Xgt; Tue, 2 Mar 2021 15:19: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 5DFDE188F9; Tue, 2 Mar 2021 15:19: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 122FJBp9040328; Tue, 2 Mar 2021 15:19:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FJBKf040327; Tue, 2 Mar 2021 15:19:11 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:19:11 GMT Message-Id: <202103021519.122FJBKf040327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 811deba9df26 - releng/13.0 - Remove __NO_TLS. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 811deba9df266fbe148c95f10ba8fb2a1b32e7bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:19:15 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=811deba9df266fbe148c95f10ba8fb2a1b32e7bf commit 811deba9df266fbe148c95f10ba8fb2a1b32e7bf Author: Konstantin Belousov AuthorDate: 2021-02-19 15:20:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 15:18:56 +0000 Remove __NO_TLS. Approved by: re (gjb) (cherry picked from commit 3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e) --- include/runetype.h | 4 ++-- lib/libc/gen/getutxent.c | 5 ----- lib/libc/gen/utxdb.c | 4 ---- lib/libc/locale/setrunelocale.c | 4 ---- lib/libc/locale/xlocale.c | 15 +-------------- lib/libc/locale/xlocale_private.h | 5 +---- lib/libc/string/strerror.c | 5 ----- lib/libgssapi/gss_display_status.c | 10 ---------- sys/sys/cdefs.h | 4 ---- tests/sys/opencrypto/cryptodevh.py | 1 - 10 files changed, 4 insertions(+), 53 deletions(-) diff --git a/include/runetype.h b/include/runetype.h index 4aca128f8c8a..93007809dbf8 100644 --- a/include/runetype.h +++ b/include/runetype.h @@ -88,7 +88,7 @@ typedef struct { __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; extern const _RuneLocale *_CurrentRuneLocale; -#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) +#ifdef __RUNETYPE_INTERNAL extern const _RuneLocale *__getCurrentRuneLocale(void); #else extern _Thread_local const _RuneLocale *_ThreadRuneLocale; @@ -99,7 +99,7 @@ static __inline const _RuneLocale *__getCurrentRuneLocale(void) return _ThreadRuneLocale; return _CurrentRuneLocale; } -#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ +#endif /*__RUNETYPE_INTERNAL */ #define _CurrentRuneLocale (__getCurrentRuneLocale()) __END_DECLS diff --git a/lib/libc/gen/getutxent.c b/lib/libc/gen/getutxent.c index e0d993221e7e..664498126f13 100644 --- a/lib/libc/gen/getutxent.c +++ b/lib/libc/gen/getutxent.c @@ -40,13 +40,8 @@ __FBSDID("$FreeBSD$"); #include "utxdb.h" #include "un-namespace.h" -#ifdef __NO_TLS -static FILE *uf = NULL; -static int udb; -#else static _Thread_local FILE *uf = NULL; static _Thread_local int udb; -#endif int setutxdb(int db, const char *file) diff --git a/lib/libc/gen/utxdb.c b/lib/libc/gen/utxdb.c index f8dea105702c..3edccdbd2c2f 100644 --- a/lib/libc/gen/utxdb.c +++ b/lib/libc/gen/utxdb.c @@ -128,11 +128,7 @@ utx_to_futx(const struct utmpx *ut, struct futx *fu) struct utmpx * futx_to_utx(const struct futx *fu) { -#ifdef __NO_TLS - static struct utmpx *ut; -#else static _Thread_local struct utmpx *ut; -#endif if (ut == NULL) { ut = calloc(1, sizeof *ut); diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index 2e6fed9466e4..551d32b7ab6a 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -56,12 +56,10 @@ __FBSDID("$FreeBSD$"); #undef _CurrentRuneLocale extern _RuneLocale const *_CurrentRuneLocale; -#ifndef __NO_TLS /* * A cached version of the runes for this thread. Used by ctype.h */ _Thread_local const _RuneLocale *_ThreadRuneLocale; -#endif extern int __mb_sb_limit; @@ -199,7 +197,6 @@ __wrap_setrunelocale(const char *locale) return (_LDP_LOADED); } -#ifndef __NO_TLS void __set_thread_rune_locale(locale_t loc) { @@ -212,7 +209,6 @@ __set_thread_rune_locale(locale_t loc) _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; } } -#endif void * __ctype_load(const char *locale, locale_t unused __unused) diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c index fb674f86bbff..d64262da809e 100644 --- a/lib/libc/locale/xlocale.c +++ b/lib/libc/locale/xlocale.c @@ -55,12 +55,11 @@ extern struct xlocale_component __xlocale_global_messages; extern struct xlocale_component __xlocale_C_collate; extern struct xlocale_component __xlocale_C_ctype; -#ifndef __NO_TLS /* * The locale for this thread. */ _Thread_local locale_t __thread_locale; -#endif + /* * Flag indicating that one or more per-thread locales exist. */ @@ -143,16 +142,6 @@ get_thread_locale(void) pthread_getspecific(locale_info_key)); } -#ifdef __NO_TLS -locale_t -__get_locale(void) -{ - locale_t l = get_thread_locale(); - return (l ? l : &__xlocale_global_locale); - -} -#endif - static void set_thread_locale(locale_t loc) { @@ -172,10 +161,8 @@ set_thread_locale(locale_t loc) } else { pthread_setspecific(locale_info_key, l); } -#ifndef __NO_TLS __thread_locale = l; __set_thread_rune_locale(loc); -#endif } /** diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index 391e375bc03d..bc40f28fc9eb 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -185,7 +185,7 @@ void __set_thread_rune_locale(locale_t loc); * locale has ever been set, then we always use the global locale. */ extern int __has_thread_locale; -#ifndef __NO_TLS + /** * The per-thread locale. Avoids the need to use pthread lookup functions when * getting the per-thread locale. @@ -206,9 +206,6 @@ static inline locale_t __get_locale(void) } return (__thread_locale ? __thread_locale : &__xlocale_global_locale); } -#else -locale_t __get_locale(void); -#endif /** * Two magic values are allowed for locale_t objects. NULL and -1. This diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index 11b9701d968f..bb685e4f7dc9 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -128,16 +128,11 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen) char * strerror_l(int num, locale_t locale) { -#ifndef __NO_TLS static _Thread_local char ebuf[NL_TEXTMAX]; if (strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) errno = EINVAL; return (ebuf); -#else - errno = ENOTSUP; - return (NULL); -#endif } char * diff --git a/lib/libgssapi/gss_display_status.c b/lib/libgssapi/gss_display_status.c index 55ca83ce9aa8..d0c3453a0d6b 100644 --- a/lib/libgssapi/gss_display_status.c +++ b/lib/libgssapi/gss_display_status.c @@ -174,16 +174,6 @@ supplementary_error(OM_uint32 v) return msgs[v]; } -#if defined(__NO_TLS) - -/* - * These platforms don't support TLS on FreeBSD - threads will just - * have to step on each other's error values for now. - */ -#define __thread - -#endif - struct mg_thread_ctx { gss_OID mech; OM_uint32 maj_stat; diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 1e670fd87d6f..d11bee96e10a 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -768,10 +768,6 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) -#define __NO_TLS 1 -#endif - /* * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. diff --git a/tests/sys/opencrypto/cryptodevh.py b/tests/sys/opencrypto/cryptodevh.py index be853f496930..c5719e47c8c1 100644 --- a/tests/sys/opencrypto/cryptodevh.py +++ b/tests/sys/opencrypto/cryptodevh.py @@ -133,7 +133,6 @@ __POSIX_VISIBLE = 200809 __XSI_VISIBLE = 700 __BSD_VISIBLE = 1 __ISO_C_VISIBLE = 2011 -__NO_TLS = 1 CRYPTO_DRIVERS_INITIAL = 4 CRYPTO_SW_SESSIONS = 32 NULL_HASH_LEN = 16 From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:19:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80A9B56CA36; Tue, 2 Mar 2021 15:19: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 4DqglP4zmGz4XXS; Tue, 2 Mar 2021 15:19: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 1278F18EB7; Tue, 2 Mar 2021 15:19: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 122FJ8AC040283; Tue, 2 Mar 2021 15:19:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FJ8n2040282; Tue, 2 Mar 2021 15:19:08 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:19:08 GMT Message-Id: <202103021519.122FJ8n2040282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 229f1e4b1424 - releng/13.0 - riscv: Don't set __NO_TLS to disable some uses of TLS. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 229f1e4b14246cf950ed0536f15fd2b1d563fbf7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:19:14 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=229f1e4b14246cf950ed0536f15fd2b1d563fbf7 commit 229f1e4b14246cf950ed0536f15fd2b1d563fbf7 Author: John Baldwin AuthorDate: 2021-02-18 00:33:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 15:18:56 +0000 riscv: Don't set __NO_TLS to disable some uses of TLS. Approved by: re (gjb) (cherry picked from commit dd176fd7e7b5aad231cd6ebf49fd14ae7394dfee) --- sys/sys/cdefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 75bedd4b8128..4de1ef011756 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -768,7 +768,7 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__mips) || defined(__riscv) || \ +#if defined(__mips) || \ (defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)) #define __NO_TLS 1 #endif From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:19:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F3CE56C94F; Tue, 2 Mar 2021 15:19: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 4DqglN4nv8z4XXM; Tue, 2 Mar 2021 15:19: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 4050C18E7E; Tue, 2 Mar 2021 15:19: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 122FJAZM040306; Tue, 2 Mar 2021 15:19:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FJAdZ040305; Tue, 2 Mar 2021 15:19:10 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:19:10 GMT Message-Id: <202103021519.122FJAdZ040305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 91a611e52160 - releng/13.0 - mips: Don't set __NO_TLS to disable some uses of TLS. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 91a611e5216027ca9e82770882b5f7e8d98a2f15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:19:14 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=91a611e5216027ca9e82770882b5f7e8d98a2f15 commit 91a611e5216027ca9e82770882b5f7e8d98a2f15 Author: John Baldwin AuthorDate: 2021-02-18 00:34:23 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 15:18:56 +0000 mips: Don't set __NO_TLS to disable some uses of TLS. Approved by: re (gjb) (cherry picked from commit 24fd63e0970f91189dd2acde987bd2e4c8c04a50) --- sys/sys/cdefs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 4de1ef011756..1e670fd87d6f 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -768,8 +768,7 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__mips) || \ - (defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)) +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) #define __NO_TLS 1 #endif From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:20:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 743B956CF1A; Tue, 2 Mar 2021 15:20:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqgnK4g2hz4Yww; Tue, 2 Mar 2021 15:20: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 9ABF918FE0; Tue, 2 Mar 2021 15:20:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122FKnZT051245; Tue, 2 Mar 2021 15:20:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FKnqb051244; Tue, 2 Mar 2021 15:20:49 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:20:49 GMT Message-Id: <202103021520.122FKnqb051244@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: c883b6fd8ccd - main - Include Makefile.inc1 in Makefile.vm, missed in previous change 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: c883b6fd8ccd8d9c50b3f8fbb04da20ac0dec1c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:20:54 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=c883b6fd8ccd8d9c50b3f8fbb04da20ac0dec1c4 commit c883b6fd8ccd8d9c50b3f8fbb04da20ac0dec1c4 Author: Glen Barber AuthorDate: 2021-03-02 15:19:59 +0000 Commit: Glen Barber CommitDate: 2021-03-02 15:19:59 +0000 Include Makefile.inc1 in Makefile.vm, missed in previous change MFC after: 3 days MFC with: 80ab50e1de19, 0be274d37379 Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile.vm | 1 + 1 file changed, 1 insertion(+) diff --git a/release/Makefile.vm b/release/Makefile.vm index cad1974e3a6f..d075fa1fb29c 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -178,3 +178,4 @@ cloudware-release: .include "${.CURDIR}/Makefile.azure" .include "${.CURDIR}/Makefile.gce" .include "${.CURDIR}/Makefile.vagrant" +.include "${.CURDIR}/Makefile.inc1" From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:21:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAA2F56CEB9; Tue, 2 Mar 2021 15:21: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 4Dqgnf4VHxz4Z5K; Tue, 2 Mar 2021 15:21: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 C1DD519280; Tue, 2 Mar 2021 15:21: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 122FL8x9051407; Tue, 2 Mar 2021 15:21:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FL8Me051406; Tue, 2 Mar 2021 15:21:08 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:21:08 GMT Message-Id: <202103021521.122FL8Me051406@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: 0401989282d1 - main - vm: Round up npages and alignment for contig reclamation 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: 0401989282d1bb9972ae2bf4862c2c6c92ae5f27 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:21:12 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0401989282d1bb9972ae2bf4862c2c6c92ae5f27 commit 0401989282d1bb9972ae2bf4862c2c6c92ae5f27 Author: Mark Johnston AuthorDate: 2021-03-02 15:19:53 +0000 Commit: Mark Johnston CommitDate: 2021-03-02 15:21:02 +0000 vm: Round up npages and alignment for contig reclamation When searching for runs to reclaim, we need to ensure that the entire run will be added to the buddy allocator as a single unit. Otherwise, it will not be visible to vm_phys_alloc_contig() as it is currently implemented. This is a problem for allocation requests that are not a power of 2 in size, as with 9KB jumbo mbuf clusters. Reported by: alc Reviewed by: alc MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28924 --- sys/vm/vm_page.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 20fbbc304490..98391ccecd82 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2972,17 +2972,29 @@ vm_page_reclaim_contig_domain(int domain, int req, u_long npages, struct vm_domain *vmd; vm_paddr_t curr_low; vm_page_t m_run, m_runs[NRUNS]; - u_long count, reclaimed; + u_long count, minalign, reclaimed; int error, i, options, req_class; KASSERT(npages > 0, ("npages is 0")); KASSERT(powerof2(alignment), ("alignment is not a power of 2")); KASSERT(powerof2(boundary), ("boundary is not a power of 2")); - req_class = req & VM_ALLOC_CLASS_MASK; + + /* + * The caller will attempt an allocation after some runs have been + * reclaimed and added to the vm_phys buddy lists. Due to limitations + * of vm_phys_alloc_contig(), round up the requested length to the next + * power of two or maximum chunk size, and ensure that each run is + * suitably aligned. + */ + minalign = 1ul << imin(flsl(npages - 1), VM_NFREEORDER - 1); + npages = roundup2(npages, minalign); + if (alignment < ptoa(minalign)) + alignment = ptoa(minalign); /* * The page daemon is allowed to dig deeper into the free page list. */ + req_class = req & VM_ALLOC_CLASS_MASK; if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) req_class = VM_ALLOC_SYSTEM; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 16:27:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3FD856F2D3 for ; Tue, 2 Mar 2021 16:27: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 4DqjGQ49r2z4g0R; Tue, 2 Mar 2021 16:27: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 82719197DE; Tue, 2 Mar 2021 16:27: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 122GRgpu032652; Tue, 2 Mar 2021 16:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122GRgR1032651; Tue, 2 Mar 2021 16:27:42 GMT (envelope-from git) Date: Tue, 2 Mar 2021 16:27:42 GMT Message-Id: <202103021627.122GRgR1032651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Alex Richardson Subject: git: c59f30a57b50 - vendor/google/capsicum-test - Update capsicum-test to git commit f4d97414d48b8f8356b971ab9f45dc5c70d53c40 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/vendor/google/capsicum-test X-Git-Reftype: branch X-Git-Commit: c59f30a57b509d88ab47e5cf2e1509fdc8a2749c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 16:27:42 -0000 The branch vendor/google/capsicum-test has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c59f30a57b509d88ab47e5cf2e1509fdc8a2749c commit c59f30a57b509d88ab47e5cf2e1509fdc8a2749c Author: Alex Richardson AuthorDate: 2021-03-02 16:22:31 +0000 Commit: Alex Richardson CommitDate: 2021-03-02 16:22:31 +0000 Update capsicum-test to git commit f4d97414d48b8f8356b971ab9f45dc5c70d53c40 --- GNUmakefile | 4 + capability-fd.cc | 23 ++++-- capmode.cc | 126 +++++++++++++++++++++++------ capsicum-test.cc | 88 ++++++++++++++------ capsicum-test.h | 36 ++++++++- makefile | 2 +- openat.cc | 1 + procdesc.cc | 241 +++++++++++++++++++++++++++++++++++++++++-------------- socket.cc | 18 ++++- 9 files changed, 411 insertions(+), 128 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index d7133ca3b386..426eb49cdfa1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -4,6 +4,10 @@ OS:=$(shell uname) ARCH?=64 ARCHFLAG=-m$(ARCH) +ifeq ($(OS),FreeBSD) +EXTRA_LIBS=-lprocstat +endif + ifeq ($(OS),Linux) PROCESSOR:=$(shell uname -p) diff --git a/capability-fd.cc b/capability-fd.cc index a454d54aa86a..f255c6425cdd 100644 --- a/capability-fd.cc +++ b/capability-fd.cc @@ -486,6 +486,7 @@ FORK_TEST_ON(Capability, Mmap, TmpFile("cap_mmap_operations")) { // Given a file descriptor, create a capability with specific rights and // make sure only those rights work. #define TRY_FILE_OPS(fd, ...) do { \ + SCOPED_TRACE(#__VA_ARGS__); \ cap_rights_t rights; \ cap_rights_init(&rights, __VA_ARGS__); \ TryFileOps((fd), rights); \ @@ -1019,6 +1020,8 @@ FORK_TEST_ON(Capability, SocketTransfer, TmpFile("cap_fd_transfer")) { if (child == 0) { // Child: enter cap mode EXPECT_OK(cap_enter()); + // Child: send startup notification + SEND_INT_MESSAGE(sock_fds[0], MSG_CHILD_STARTED); // Child: wait to receive FD over socket int rc = recvmsg(sock_fds[0], &mh, 0); @@ -1036,10 +1039,12 @@ FORK_TEST_ON(Capability, SocketTransfer, TmpFile("cap_fd_transfer")) { EXPECT_RIGHTS_EQ(&r_rs, &rights); TryReadWrite(cap_fd); + // Child: acknowledge that we have received and tested the file descriptor + SEND_INT_MESSAGE(sock_fds[0], MSG_CHILD_FD_RECEIVED); + // Child: wait for a normal read - int val; - read(sock_fds[0], &val, sizeof(val)); - exit(0); + AWAIT_INT_MESSAGE(sock_fds[0], MSG_PARENT_REQUEST_CHILD_EXIT); + exit(testing::Test::HasFailure()); } int fd = open(TmpFile("cap_fd_transfer"), O_RDWR | O_CREAT, 0644); @@ -1054,6 +1059,9 @@ FORK_TEST_ON(Capability, SocketTransfer, TmpFile("cap_fd_transfer")) { // Confirm we can do the right operations on the capability TryReadWrite(cap_fd); + // Wait for child to start up: + AWAIT_INT_MESSAGE(sock_fds[1], MSG_CHILD_STARTED); + // Send the file descriptor over the pipe to the sub-process mh.msg_controllen = CMSG_LEN(sizeof(int)); cmptr = CMSG_FIRSTHDR(&mh); @@ -1063,13 +1071,14 @@ FORK_TEST_ON(Capability, SocketTransfer, TmpFile("cap_fd_transfer")) { *(int *)CMSG_DATA(cmptr) = cap_fd; buffer1[0] = 0; iov[0].iov_len = 1; - sleep(3); int rc = sendmsg(sock_fds[1], &mh, 0); EXPECT_OK(rc); - sleep(1); // Ensure subprocess runs - int zero = 0; - write(sock_fds[1], &zero, sizeof(zero)); + // Check that the child received the message + AWAIT_INT_MESSAGE(sock_fds[1], MSG_CHILD_FD_RECEIVED); + + // Tell the child to exit + SEND_INT_MESSAGE(sock_fds[1], MSG_PARENT_REQUEST_CHILD_EXIT); } TEST(Capability, SyscallAt) { diff --git a/capmode.cc b/capmode.cc index 567773f319d9..c274f5e1c9f3 100644 --- a/capmode.cc +++ b/capmode.cc @@ -528,6 +528,8 @@ TEST(Capmode, Abort) { FORK_TEST_F(WithFiles, AllowedMiscSyscalls) { umask(022); mode_t um_before = umask(022); + int pipefds[2]; + EXPECT_OK(pipe(pipefds)); EXPECT_OK(cap_enter()); // Enter capability mode. mode_t um = umask(022); @@ -540,13 +542,19 @@ FORK_TEST_F(WithFiles, AllowedMiscSyscalls) { pid_t pid = fork(); EXPECT_OK(pid); if (pid == 0) { - // Child: almost immediately exit. - sleep(1); + // Child: wait for an exit message from parent (so we can test waitpid). + EXPECT_OK(close(pipefds[0])); + SEND_INT_MESSAGE(pipefds[1], MSG_CHILD_STARTED); + AWAIT_INT_MESSAGE(pipefds[1], MSG_PARENT_REQUEST_CHILD_EXIT); exit(0); } else if (pid > 0) { + EXPECT_OK(close(pipefds[1])); + AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); errno = 0; EXPECT_CAPMODE(ptrace_(PTRACE_PEEKDATA_, pid, &pid, NULL)); - EXPECT_CAPMODE(waitpid(pid, NULL, 0)); + EXPECT_CAPMODE(waitpid(pid, NULL, WNOHANG)); + SEND_INT_MESSAGE(pipefds[0], MSG_PARENT_REQUEST_CHILD_EXIT); + if (verbose) fprintf(stderr, " child finished\n"); } // No error return from sync(2) to test, but check errno remains unset. @@ -568,68 +576,136 @@ FORK_TEST_F(WithFiles, AllowedMiscSyscalls) { } void *thread_fn(void *p) { - int delay = *(int *)p; - sleep(delay); + int fd = (int)(intptr_t)p; + if (verbose) fprintf(stderr, " thread waiting to run\n"); + AWAIT_INT_MESSAGE(fd, MSG_PARENT_CHILD_SHOULD_RUN); EXPECT_OK(getpid_()); EXPECT_CAPMODE(open("/dev/null", O_RDWR)); - return NULL; + // Return whether there have been any failures to the main thread. + void *rval = (void *)(intptr_t)testing::Test::HasFailure(); + if (verbose) fprintf(stderr, " thread finished: %p\n", rval); + return rval; } // Check that restrictions are the same in subprocesses and threads FORK_TEST(Capmode, NewThread) { // Fire off a new thread before entering capability mode pthread_t early_thread; - int one = 1; // second - EXPECT_OK(pthread_create(&early_thread, NULL, thread_fn, &one)); + void *thread_rval; + // Create two pipes, one for synchronization with the threads, the other to + // synchronize with the children (since we can't use waitpid after cap_enter). + // Note: Could use pdfork+pdwait instead, but that is tested in procdesc.cc. + int thread_pipe[2]; + EXPECT_OK(pipe(thread_pipe)); + int proc_pipe[2]; + EXPECT_OK(pipe(proc_pipe)); + EXPECT_OK(pthread_create(&early_thread, NULL, thread_fn, + (void *)(intptr_t)thread_pipe[1])); // Fire off a new process before entering capability mode. + if (verbose) fprintf(stderr, " starting second child (non-capability mode)\n"); int early_child = fork(); EXPECT_OK(early_child); if (early_child == 0) { - // Child: wait and then confirm this process is unaffect by capability mode in the parent. - sleep(1); + if (verbose) fprintf(stderr, " first child started\n"); + EXPECT_OK(close(proc_pipe[0])); + // Child: wait and then confirm this process is unaffected by capability mode in the parent. + AWAIT_INT_MESSAGE(proc_pipe[1], MSG_PARENT_CHILD_SHOULD_RUN); int fd = open("/dev/null", O_RDWR); EXPECT_OK(fd); close(fd); - exit(0); + // Notify the parent of success/failure. + int rval = (int)testing::Test::HasFailure(); + SEND_INT_MESSAGE(proc_pipe[1], rval); + if (verbose) fprintf(stderr, " first child finished: %d\n", rval); + exit(rval); } EXPECT_OK(cap_enter()); // Enter capability mode. + // At this point the current process has both a child process and a + // child thread that were created before entering capability mode. + // - The child process is unaffected by capability mode. + // - The child thread is affected by capability mode. + SEND_INT_MESSAGE(proc_pipe[0], MSG_PARENT_CHILD_SHOULD_RUN); + // Do an allowed syscall. EXPECT_OK(getpid_()); + // Wait for the first child to exit (should get a zero exit code message). + AWAIT_INT_MESSAGE(proc_pipe[0], 0); + + // The child processes/threads return HasFailure(), so we depend on no prior errors. + ASSERT_FALSE(testing::Test::HasFailure()) + << "Cannot continue test with pre-existing failures."; + // Now that we're in capability mode, if we create a second child process + // it will be affected by capability mode. + if (verbose) fprintf(stderr, " starting second child (in capability mode)\n"); int child = fork(); EXPECT_OK(child); if (child == 0) { + if (verbose) fprintf(stderr, " second child started\n"); + EXPECT_OK(close(proc_pipe[0])); // Child: do an allowed and a disallowed syscall. EXPECT_OK(getpid_()); EXPECT_CAPMODE(open("/dev/null", O_RDWR)); - exit(0); + // Notify the parent of success/failure. + int rval = (int)testing::Test::HasFailure(); + SEND_INT_MESSAGE(proc_pipe[1], rval); + if (verbose) fprintf(stderr, " second child finished: %d\n", rval); + exit(rval); } - // Don't (can't) wait for either child. - + // Now tell the early_started thread that it can run. We expect it to also + // be affected by capability mode since it's per-process not per-thread. + // Note: it is important that we don't allow the thread to run before fork(), + // since that could result in fork() being called while the thread holds one + // of the gtest-internal mutexes, so the child process deadlocks. + SEND_INT_MESSAGE(thread_pipe[0], MSG_PARENT_CHILD_SHOULD_RUN); // Wait for the early-started thread. - EXPECT_OK(pthread_join(early_thread, NULL)); + EXPECT_OK(pthread_join(early_thread, &thread_rval)); + EXPECT_FALSE((bool)(intptr_t)thread_rval) << "thread returned failure"; - // Fire off a new thread. + // Wait for the second child to exit (should get a zero exit code message). + AWAIT_INT_MESSAGE(proc_pipe[0], 0); + + // Fire off a new (second) child thread, which is also affected by capability mode. + ASSERT_FALSE(testing::Test::HasFailure()) + << "Cannot continue test with pre-existing failures."; pthread_t child_thread; - int zero = 0; // seconds - EXPECT_OK(pthread_create(&child_thread, NULL, thread_fn, &zero)); - EXPECT_OK(pthread_join(child_thread, NULL)); + EXPECT_OK(pthread_create(&child_thread, NULL, thread_fn, + (void *)(intptr_t)thread_pipe[1])); + SEND_INT_MESSAGE(thread_pipe[0], MSG_PARENT_CHILD_SHOULD_RUN); + EXPECT_OK(pthread_join(child_thread, &thread_rval)); + EXPECT_FALSE((bool)(intptr_t)thread_rval) << "thread returned failure"; // Fork a subprocess which fires off a new thread. + ASSERT_FALSE(testing::Test::HasFailure()) + << "Cannot continue test with pre-existing failures."; + if (verbose) fprintf(stderr, " starting third child (in capability mode)\n"); child = fork(); EXPECT_OK(child); if (child == 0) { + if (verbose) fprintf(stderr, " third child started\n"); + EXPECT_OK(close(proc_pipe[0])); pthread_t child_thread2; - EXPECT_OK(pthread_create(&child_thread2, NULL, thread_fn, &zero)); - EXPECT_OK(pthread_join(child_thread2, NULL)); - exit(0); + EXPECT_OK(pthread_create(&child_thread2, NULL, thread_fn, + (void *)(intptr_t)thread_pipe[1])); + SEND_INT_MESSAGE(thread_pipe[0], MSG_PARENT_CHILD_SHOULD_RUN); + EXPECT_OK(pthread_join(child_thread2, &thread_rval)); + EXPECT_FALSE((bool)(intptr_t)thread_rval) << "thread returned failure"; + // Notify the parent of success/failure. + int rval = (int)testing::Test::HasFailure(); + SEND_INT_MESSAGE(proc_pipe[1], rval); + if (verbose) fprintf(stderr, " third child finished: %d\n", rval); + exit(rval); } - // Sleep for a bit to allow the subprocess to finish. - sleep(2); + // Wait for the third child to exit (should get a zero exit code message). + AWAIT_INT_MESSAGE(proc_pipe[0], 0); + close(proc_pipe[0]); + close(proc_pipe[1]); + close(thread_pipe[0]); + close(thread_pipe[1]); } -static int had_signal = 0; +static volatile sig_atomic_t had_signal = 0; static void handle_signal(int) { had_signal = 1; } FORK_TEST(Capmode, SelfKill) { diff --git a/capsicum-test.cc b/capsicum-test.cc index 6adb222ec055..dedad464a4d9 100644 --- a/capsicum-test.cc +++ b/capsicum-test.cc @@ -1,5 +1,15 @@ #include "capsicum-test.h" +#ifdef __FreeBSD__ +#include +#include +#include +#include +#include +#include +#include +#endif + #include #include #include @@ -48,31 +58,59 @@ char ProcessState(int pid) { return '?'; #endif #ifdef __FreeBSD__ - char buffer[1024]; - snprintf(buffer, sizeof(buffer), "ps -p %d -o state | grep -v STAT", pid); - sig_t original = signal(SIGCHLD, SIG_IGN); - FILE* cmd = popen(buffer, "r"); - usleep(50000); // allow any pending SIGCHLD signals to arrive - signal(SIGCHLD, original); - int result = fgetc(cmd); - fclose(cmd); - // Map FreeBSD codes to Linux codes. - switch (result) { - case EOF: - return '\0'; - case 'D': // disk wait - case 'R': // runnable - case 'S': // sleeping - case 'T': // stopped - case 'Z': // zombie - return result; - case 'W': // idle interrupt thread - return 'S'; - case 'I': // idle - return 'S'; - case 'L': // waiting to acquire lock - default: - return '?'; + // First check if the process exists/we have permission to see it. This + // Avoids warning messages being printed to stderr by libprocstat. + size_t len = 0; + int name[4]; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID; + name[3] = pid; + if (sysctl(name, nitems(name), NULL, &len, NULL, 0) < 0 && errno == ESRCH) { + if (verbose) fprintf(stderr, "Process %d does not exist\n", pid); + return '\0'; // No such process. + } + unsigned int count = 0; + struct procstat *prstat = procstat_open_sysctl(); + EXPECT_NE(NULL, prstat) << "procstat_open_sysctl failed."; + errno = 0; + struct kinfo_proc *p = procstat_getprocs(prstat, KERN_PROC_PID, pid, &count); + if (p == NULL || count == 0) { + if (verbose) fprintf(stderr, "procstat_getprocs failed with %p/%d: %s\n", p, count, strerror(errno)); + procstat_close(prstat); + return '\0'; + } + char result = '\0'; + // See state() in bin/ps/print.c + switch (p->ki_stat) { + case SSTOP: + result = 'T'; + break; + case SSLEEP: + if (p->ki_tdflags & TDF_SINTR) /* interruptable (long) */ + result = 'S'; + else + result = 'D'; + break; + case SRUN: + case SIDL: + result = 'R'; + break; + case SWAIT: + case SLOCK: + // We treat SWAIT/SLOCK as 'S' here (instead of 'W'/'L'). + result = 'S'; + break; + case SZOMB: + result = 'Z'; + break; + default: + result = '?'; + break; } + procstat_freeprocs(prstat, p); + procstat_close(prstat); + if (verbose) fprintf(stderr, "Process %d in state '%c'\n", pid, result); + return result; #endif } diff --git a/capsicum-test.h b/capsicum-test.h index 808840f4280e..7433814b31c8 100644 --- a/capsicum-test.h +++ b/capsicum-test.h @@ -140,15 +140,17 @@ const char *TmpFile(const char *pathname); // Expect a syscall to fail with the given error. #define EXPECT_SYSCALL_FAIL(E, C) \ do { \ + SCOPED_TRACE(#C); \ EXPECT_GT(0, C); \ - EXPECT_EQ(E, errno); \ + EXPECT_EQ(E, errno) << "expected '" << strerror(E) \ + << "' but got '" << strerror(errno) << "'"; \ } while (0) // Expect a syscall to fail with anything other than the given error. #define EXPECT_SYSCALL_FAIL_NOT(E, C) \ do { \ EXPECT_GT(0, C); \ - EXPECT_NE(E, errno); \ + EXPECT_NE(E, errno) << strerror(E); \ } while (0) // Expect a void syscall to fail with anything other than the given error. @@ -163,7 +165,8 @@ const char *TmpFile(const char *pathname); // code is OS-specific. #ifdef O_BENEATH #define EXPECT_OPENAT_FAIL_TRAVERSAL(fd, path, flags) \ - do { \ + do { \ + SCOPED_TRACE(GTEST_STRINGIFY_(openat((fd), (path), (flags)))); \ const int result = openat((fd), (path), (flags)); \ if (((flags) & O_BENEATH) == O_BENEATH) { \ EXPECT_SYSCALL_FAIL(E_NO_TRAVERSE_O_BENEATH, result); \ @@ -175,6 +178,7 @@ const char *TmpFile(const char *pathname); #else #define EXPECT_OPENAT_FAIL_TRAVERSAL(fd, path, flags) \ do { \ + SCOPED_TRACE(GTEST_STRINGIFY_(openat((fd), (path), (flags)))); \ const int result = openat((fd), (path), (flags)); \ EXPECT_SYSCALL_FAIL(E_NO_TRAVERSE_CAPABILITY, result); \ if (result >= 0) { close(result); } \ @@ -200,7 +204,8 @@ const char *TmpFile(const char *pathname); int rc = C; \ EXPECT_GT(0, rc); \ EXPECT_TRUE(errno == ECAPMODE || errno == ENOTCAPABLE) \ - << #C << " did not fail with ECAPMODE/ENOTCAPABLE but " << errno; \ + << #C << " did not fail with ECAPMODE/ENOTCAPABLE but " << errno \ + << "(" << strerror(errno) << ")"; \ } while (0) // Ensure that 'rights' are a subset of 'max'. @@ -244,6 +249,29 @@ char ProcessState(int pid); #define EXPECT_PID_ZOMBIE(pid) EXPECT_PID_REACHES_STATES(pid, 'Z', 'Z'); #define EXPECT_PID_GONE(pid) EXPECT_PID_REACHES_STATES(pid, '\0', '\0'); +enum { + // Magic numbers for messages sent by child processes. + MSG_CHILD_STARTED = 1234, + MSG_CHILD_FD_RECEIVED = 4321, + // Magic numbers for messages sent by parent processes. + MSG_PARENT_REQUEST_CHILD_EXIT = 9999, + MSG_PARENT_CLOSED_FD = 10000, + MSG_PARENT_CHILD_SHOULD_RUN = 10001, +}; + +#define SEND_INT_MESSAGE(fd, message) \ + do { \ + int _msg = message; \ + EXPECT_EQ(sizeof(_msg), (size_t)write(fd, &_msg, sizeof(_msg))); \ + } while (0) + +#define AWAIT_INT_MESSAGE(fd, expected) \ + do { \ + int _msg = 0; \ + EXPECT_EQ(sizeof(_msg), (size_t)read(fd, &_msg, sizeof(_msg))); \ + EXPECT_EQ(expected, _msg); \ + } while (0) + // Mark a test that can only be run as root. #define GTEST_SKIP_IF_NOT_ROOT() \ if (getuid() != 0) { GTEST_SKIP() << "requires root"; } diff --git a/makefile b/makefile index 7b95e1927927..ad697f160e2e 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,7 @@ CXXFLAGS+=$(ARCHFLAG) -Wall -g $(GTEST_INCS) $(GTEST_FLAGS) --std=c++11 CFLAGS+=$(ARCHFLAG) -Wall -g capsicum-test: $(OBJECTS) libgtest.a $(LOCAL_LIBS) - $(CXX) $(CXXFLAGS) -g -o $@ $(OBJECTS) libgtest.a -lpthread -lrt $(LIBSCTP) $(LIBCAPRIGHTS) + $(CXX) $(CXXFLAGS) -g -o $@ $(OBJECTS) libgtest.a -lpthread -lrt $(LIBSCTP) $(LIBCAPRIGHTS) $(EXTRA_LIBS) # Small statically-linked program for fexecve tests # (needs to be statically linked so that execve()ing it diff --git a/openat.cc b/openat.cc index ca7e39772f9a..1f48909037bf 100644 --- a/openat.cc +++ b/openat.cc @@ -11,6 +11,7 @@ // Check an open call works and close the resulting fd. #define EXPECT_OPEN_OK(f) do { \ + SCOPED_TRACE(#f); \ int _fd = f; \ EXPECT_OK(_fd); \ close(_fd); \ diff --git a/procdesc.cc b/procdesc.cc index 11274ce9e866..105546cabfb2 100644 --- a/procdesc.cc +++ b/procdesc.cc @@ -27,10 +27,6 @@ #define __WALL 0 #endif -// TODO(drysdale): it would be nice to use proper synchronization between -// processes, rather than synchronization-via-sleep; faster too. - - //------------------------------------------------ // Utilities for the tests. @@ -73,7 +69,10 @@ static void print_stat(FILE *f, const struct stat *stat) { (long)stat->st_atime, (long)stat->st_mtime, (long)stat->st_ctime); } -static std::map had_signal; +static volatile sig_atomic_t had_signal[NSIG]; +void clear_had_signals() { + memset(const_cast(had_signal), 0, sizeof(had_signal)); +} static void handle_signal(int x) { had_signal[x] = true; } @@ -109,7 +108,9 @@ void CheckChildFinished(pid_t pid, bool signaled=false) { TEST(Pdfork, Simple) { int pd = -1; + int pipefds[2]; pid_t parent = getpid_(); + EXPECT_OK(pipe(pipefds)); int pid = pdfork(&pd, 0); EXPECT_OK(pid); if (pid == 0) { @@ -117,19 +118,29 @@ TEST(Pdfork, Simple) { EXPECT_EQ(-1, pd); EXPECT_NE(parent, getpid_()); EXPECT_EQ(parent, getppid()); - sleep(1); - exit(0); + close(pipefds[0]); + SEND_INT_MESSAGE(pipefds[1], MSG_CHILD_STARTED); + if (verbose) fprintf(stderr, "Child waiting for exit message\n"); + // Terminate once the parent has completed the checks + AWAIT_INT_MESSAGE(pipefds[1], MSG_PARENT_REQUEST_CHILD_EXIT); + exit(testing::Test::HasFailure()); } - usleep(100); // ensure the child has a chance to run + close(pipefds[1]); + // Ensure the child has started. + AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); + EXPECT_NE(-1, pd); EXPECT_PID_ALIVE(pid); int pid_got; EXPECT_OK(pdgetpid(pd, &pid_got)); EXPECT_EQ(pid, pid_got); - // Wait long enough for the child to exit(). - sleep(2); + // Tell the child to exit and wait until it is a zombie. + SEND_INT_MESSAGE(pipefds[0], MSG_PARENT_REQUEST_CHILD_EXIT); + // EXPECT_PID_ZOMBIE waits for up to ~500ms, that should be enough time for + // the child to exit successfully. EXPECT_PID_ZOMBIE(pid); + close(pipefds[0]); // Wait for the the child. int status; @@ -223,7 +234,10 @@ TEST(Pdfork, NonProcessDescriptor) { close(fd); } -static void *SubThreadMain(void *) { +static void *SubThreadMain(void *arg) { + // Notify the main thread that we have started + if (verbose) fprintf(stderr, " subthread started: pipe=%p\n", arg); + SEND_INT_MESSAGE((int)(intptr_t)arg, MSG_CHILD_STARTED); while (true) { if (verbose) fprintf(stderr, " subthread: \"I aten't dead\"\n"); usleep(100000); @@ -233,11 +247,28 @@ static void *SubThreadMain(void *) { static void *ThreadMain(void *) { int pd; + int pipefds[2]; + EXPECT_EQ(0, pipe(pipefds)); pid_t child = pdfork(&pd, 0); if (child == 0) { - // Child: start a subthread then loop + close(pipefds[0]); + // Child: start a subthread then loop. pthread_t child_subthread; - EXPECT_OK(pthread_create(&child_subthread, NULL, SubThreadMain, NULL)); + // Wait for the subthread startup using another pipe. + int thread_pipefds[2]; + EXPECT_EQ(0, pipe(thread_pipefds)); + EXPECT_OK(pthread_create(&child_subthread, NULL, SubThreadMain, + (void *)(intptr_t)thread_pipefds[0])); + if (verbose) { + fprintf(stderr, " pdforked process %d: waiting for subthread.\n", + getpid()); + } + AWAIT_INT_MESSAGE(thread_pipefds[1], MSG_CHILD_STARTED); + close(thread_pipefds[0]); + close(thread_pipefds[1]); + // Child: Notify parent that all threads have started + if (verbose) fprintf(stderr, " pdforked process %d: subthread started\n", getpid()); + SEND_INT_MESSAGE(pipefds[1], MSG_CHILD_STARTED); while (true) { if (verbose) fprintf(stderr, " pdforked process %d: \"I aten't dead\"\n", getpid()); usleep(100000); @@ -245,7 +276,9 @@ static void *ThreadMain(void *) { exit(0); } if (verbose) fprintf(stderr, " thread generated pd %d\n", pd); - sleep(2); + close(pipefds[1]); + AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); + if (verbose) fprintf(stderr, "[%d] got child startup message\n", getpid_()); // Pass the process descriptor back to the main thread. return reinterpret_cast(pd); @@ -278,7 +311,7 @@ TEST(Pdfork, FromThread) { class PipePdforkBase : public ::testing::Test { public: PipePdforkBase(int pdfork_flags) : pd_(-1), pid_(-1) { - had_signal.clear(); + clear_had_signals(); int pipes[2]; EXPECT_OK(pipe(pipes)); pipe_ = pipes[1]; @@ -356,24 +389,34 @@ TEST_F(PipePdfork, Poll) { // Can multiple processes poll on the same descriptor? TEST_F(PipePdfork, PollMultiple) { + int pipefds[2]; + EXPECT_EQ(0, pipe(pipefds)); int child = fork(); EXPECT_OK(child); if (child == 0) { - // Child: wait to give time for setup, then write to the pipe (which will - // induce exit of the pdfork()ed process) and exit. - sleep(1); + close(pipefds[0]); + // Child: wait for parent to acknowledge startup + SEND_INT_MESSAGE(pipefds[1], MSG_CHILD_STARTED); + // Child: wait for two messages from the parent and the forked process + // before telling the other process to terminate. + if (verbose) fprintf(stderr, "[%d] waiting for read 1\n", getpid_()); + AWAIT_INT_MESSAGE(pipefds[1], MSG_PARENT_REQUEST_CHILD_EXIT); + if (verbose) fprintf(stderr, "[%d] waiting for read 2\n", getpid_()); + AWAIT_INT_MESSAGE(pipefds[1], MSG_PARENT_REQUEST_CHILD_EXIT); TerminateChild(); - exit(0); + if (verbose) fprintf(stderr, "[%d] about to exit\n", getpid_()); + exit(testing::Test::HasFailure()); } - usleep(100); // ensure the child has a chance to run - + close(pipefds[1]); + AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); + if (verbose) fprintf(stderr, "[%d] got child startup message\n", getpid_()); // Fork again int doppel = fork(); EXPECT_OK(doppel); // We now have: // pid A: main process, here // |--pid B: pdfork()ed process, blocked on read() - // |--pid C: fork()ed process, in sleep(1) above + // |--pid C: fork()ed process, in read() above // +--pid D: doppel process, here // Both A and D execute the following code. @@ -384,12 +427,18 @@ TEST_F(PipePdfork, PollMultiple) { fdp.revents = 0; EXPECT_EQ(0, poll(&fdp, 1, 0)); + // Both A and D ask C to exit, allowing it to do so. + if (verbose) fprintf(stderr, "[%d] telling child to exit\n", getpid_()); + SEND_INT_MESSAGE(pipefds[0], MSG_PARENT_REQUEST_CHILD_EXIT); + close(pipefds[0]); + // Now, wait (indefinitely) for activity on the process descriptor. // We expect: - // - pid C will finish its sleep, write to the pipe and exit + // - pid C will finish its two read() calls, write to the pipe and exit. // - pid B will unblock from read(), and exit // - this will generate an event on the process descriptor... // - ...in both process A and process D. + if (verbose) fprintf(stderr, "[%d] waiting for child to exit\n", getpid_()); EXPECT_EQ(1, poll(&fdp, 1, 2000)); EXPECT_TRUE(fdp.revents & POLLHUP); @@ -522,6 +571,7 @@ TEST_F(PipePdfork, CloseLast) { FORK_TEST(Pdfork, OtherUserIfRoot) { GTEST_SKIP_IF_NOT_ROOT(); int pd; + int status; pid_t pid = pdfork(&pd, 0); EXPECT_OK(pid); if (pid == 0) { @@ -542,15 +592,29 @@ FORK_TEST(Pdfork, OtherUserIfRoot) { EXPECT_EQ(EPERM, errno); EXPECT_PID_ALIVE(pid); - // Succeed with pdkill though. + // Ideally, we should be able to send signals via a process descriptor even + // if it's owned by another user, but this is not implementated on FreeBSD. +#ifdef __FreeBSD__ + // On FreeBSD, pdkill() still performs all the same checks that kill() does + // and therefore cannot be used to send a signal to a process with another + // UID unless we are root. + EXPECT_SYSCALL_FAIL(EBADF, pdkill(pid, SIGKILL)); + EXPECT_PID_ALIVE(pid); + // However, the process will be killed when we close the process descriptor. + EXPECT_OK(close(pd)); + EXPECT_PID_GONE(pid); + // Can't pdwait4() after close() since close() reparents the child to a reaper (init) + EXPECT_SYSCALL_FAIL(EBADF, pdwait4_(pd, &status, WNOHANG, NULL)); +#else + // Sending a signal with pdkill() should be permitted though. EXPECT_OK(pdkill(pd, SIGKILL)); EXPECT_PID_ZOMBIE(pid); - int status; int rc = pdwait4_(pd, &status, WNOHANG, NULL); EXPECT_OK(rc); EXPECT_EQ(pid, rc); EXPECT_TRUE(WIFSIGNALED(status)); +#endif } TEST_F(PipePdfork, WaitPidThenPd) { @@ -624,18 +688,27 @@ TEST_F(PipePdforkDaemon, Pdkill) { TEST(Pdfork, PdkillOtherSignal) { int pd = -1; + int pipefds[2]; + EXPECT_EQ(0, pipe(pipefds)); int pid = pdfork(&pd, 0); EXPECT_OK(pid); if (pid == 0) { - // Child: watch for SIGUSR1 forever. - had_signal.clear(); + // Child: tell the parent that we have started before entering the loop, + // and importantly only do so once we have registered the SIGUSR1 handler. + close(pipefds[0]); + clear_had_signals(); signal(SIGUSR1, handle_signal); + SEND_INT_MESSAGE(pipefds[1], MSG_CHILD_STARTED); + // Child: watch for SIGUSR1 forever. while (!had_signal[SIGUSR1]) { usleep(100000); } exit(123); } - sleep(1); + // Wait for child to start + close(pipefds[1]); + AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); + close(pipefds[0]); // Send an invalid signal. EXPECT_EQ(-1, pdkill(pd, 0xFFFF)); @@ -651,14 +724,15 @@ TEST(Pdfork, PdkillOtherSignal) { int rc = waitpid(pid, &status, __WALL); EXPECT_OK(rc); EXPECT_EQ(pid, rc); - EXPECT_TRUE(WIFEXITED(status)) << "0x" << std::hex << rc; + EXPECT_TRUE(WIFEXITED(status)) << "status: 0x" << std::hex << status; EXPECT_EQ(123, WEXITSTATUS(status)); } pid_t PdforkParentDeath(int pdfork_flags) { // Set up: // pid A: main process, here - // +--pid B: fork()ed process, sleep(4)s then exits + // +--pid B: fork()ed process, starts a child process with pdfork() then + // waits for parent to send a shutdown message. // +--pid C: pdfork()ed process, looping forever int sock_fds[2]; EXPECT_OK(socketpair(AF_UNIX, SOCK_STREAM, 0, sock_fds)); @@ -668,27 +742,45 @@ pid_t PdforkParentDeath(int pdfork_flags) { if (child == 0) { int pd; if (verbose) fprintf(stderr, " [%d] child about to pdfork()...\n", getpid_()); + int pipefds[2]; // for startup notification + EXPECT_OK(pipe(pipefds)); pid_t grandchild = pdfork(&pd, pdfork_flags); if (grandchild == 0) { + close(pipefds[0]); + pid_t grandchildPid = getpid_(); + EXPECT_EQ(sizeof(grandchildPid), (size_t)write(pipefds[1], &grandchildPid, sizeof(grandchildPid))); while (true) { - if (verbose) fprintf(stderr, " [%d] grandchild: \"I aten't dead\"\n", getpid_()); + if (verbose) fprintf(stderr, " [%d] grandchild: \"I aten't dead\"\n", grandchildPid); sleep(1); } } + close(pipefds[1]); if (verbose) fprintf(stderr, " [%d] pdfork()ed grandchild %d, sending ID to parent\n", getpid_(), grandchild); - // send grandchild pid to parent - write(sock_fds[1], &grandchild, sizeof(grandchild)); - sleep(4); + // Wait for grandchild to start. + pid_t grandchild2; + EXPECT_EQ(sizeof(grandchild2), (size_t)read(pipefds[0], &grandchild2, sizeof(grandchild2))); + EXPECT_EQ(grandchild, grandchild2) << "received invalid grandchild pid"; + if (verbose) fprintf(stderr, " [%d] grandchild %d has started successfully\n", getpid_(), grandchild); + close(pipefds[0]); + + // Send grandchild pid to parent. + EXPECT_EQ(sizeof(grandchild), (size_t)write(sock_fds[1], &grandchild, sizeof(grandchild))); + if (verbose) fprintf(stderr, " [%d] sent grandchild pid %d to parent\n", getpid_(), grandchild); + // Wait for parent to acknowledge the message. + AWAIT_INT_MESSAGE(sock_fds[1], MSG_PARENT_REQUEST_CHILD_EXIT); + if (verbose) fprintf(stderr, " [%d] parent acknowledged grandchild pid %d\n", getpid_(), grandchild); if (verbose) fprintf(stderr, " [%d] child terminating\n", getpid_()); - exit(0); + exit(testing::Test::HasFailure()); } if (verbose) fprintf(stderr, "[%d] fork()ed child is %d\n", getpid_(), child); pid_t grandchild; read(sock_fds[0], &grandchild, sizeof(grandchild)); - if (verbose) fprintf(stderr, "[%d] receive grandchild id %d\n", getpid_(), grandchild); + if (verbose) fprintf(stderr, "[%d] received grandchild id %d\n", getpid_(), grandchild); EXPECT_PID_ALIVE(child); EXPECT_PID_ALIVE(grandchild); - sleep(6); + // Tell child to exit. + if (verbose) fprintf(stderr, "[%d] telling child %d to exit\n", getpid_(), child); + SEND_INT_MESSAGE(sock_fds[0], MSG_PARENT_REQUEST_CHILD_EXIT); // Child dies, closing its process descriptor for the grandchild. EXPECT_PID_DEAD(child); CheckChildFinished(child); @@ -713,7 +805,7 @@ TEST(Pdfork, BagpussDaemon) { // The exit of a pdfork()ed process should not generate SIGCHLD. TEST_F(PipePdfork, NoSigchld) { - had_signal.clear(); + clear_had_signals(); sighandler_t original = signal(SIGCHLD, handle_signal); TerminateChild(); int rc = 0; @@ -728,7 +820,7 @@ TEST_F(PipePdfork, NoSigchld) { // all been closed should generate SIGCHLD. The child process needs // PD_DAEMON to survive the closure of the process descriptors. TEST_F(PipePdforkDaemon, NoPDSigchld) { - had_signal.clear(); + clear_had_signals(); sighandler_t original = signal(SIGCHLD, handle_signal); EXPECT_OK(close(pd_)); @@ -766,10 +858,8 @@ TEST_F(PipePdfork, ModeBits) { #endif TEST_F(PipePdfork, WildcardWait) { - // TODO(FreeBSD): make wildcard wait ignore pdfork()ed children - // https://bugs.freebsd.org/201054 TerminateChild(); - sleep(1); // Ensure child is truly dead. + EXPECT_PID_ZOMBIE(pid_); // Ensure child is truly dead. // Wildcard waitpid(-1) should not see the pdfork()ed child because // there is still a process descriptor for it. @@ -782,21 +872,30 @@ TEST_F(PipePdfork, WildcardWait) { } FORK_TEST(Pdfork, Pdkill) { - had_signal.clear(); + clear_had_signals(); int pd; + int pipefds[2]; + EXPECT_OK(pipe(pipefds)); pid_t pid = pdfork(&pd, 0); EXPECT_OK(pid); if (pid == 0) { - // Child: set a SIGINT handler and sleep. - had_signal.clear(); + // Child: set a SIGINT handler, notify the parent and sleep. + close(pipefds[0]); + clear_had_signals(); signal(SIGINT, handle_signal); + if (verbose) fprintf(stderr, "[%d] child started\n", getpid_()); + SEND_INT_MESSAGE(pipefds[1], MSG_CHILD_STARTED); if (verbose) fprintf(stderr, "[%d] child about to sleep(10)\n", getpid_()); - int left = sleep(10); - if (verbose) fprintf(stderr, "[%d] child slept, %d sec left, had[SIGINT]=%d\n", - getpid_(), left, had_signal[SIGINT]); - // Expect this sleep to be interrupted by the signal (and so left > 0). - exit(left == 0); + // Note: we could receive the SIGINT just before sleep(), so we use a loop + // with a short delay instead of one long sleep(). + for (int i = 0; i < 50 && !had_signal[SIGINT]; i++) { + usleep(100000); + } + if (verbose) fprintf(stderr, "[%d] child slept, had[SIGINT]=%d\n", + getpid_(), (int)had_signal[SIGINT]); + // Return non-zero if we didn't see SIGINT. + exit(had_signal[SIGINT] ? 0 : 99); } // Parent: get child's PID. @@ -804,9 +903,12 @@ FORK_TEST(Pdfork, Pdkill) { EXPECT_OK(pdgetpid(pd, &pd_pid)); EXPECT_EQ(pid, pd_pid); - // Interrupt the child after a second. - sleep(1); + // Interrupt the child once it's registered the SIGINT handler. + close(pipefds[1]); + if (verbose) fprintf(stderr, "[%d] waiting for child\n", getpid_()); + AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); EXPECT_OK(pdkill(pd, SIGINT)); + if (verbose) fprintf(stderr, "[%d] sent SIGINT\n", getpid_()); // Make sure the child finished properly (caught signal then exited). CheckChildFinished(pid); @@ -814,19 +916,28 @@ FORK_TEST(Pdfork, Pdkill) { FORK_TEST(Pdfork, PdkillSignal) { int pd; + int pipefds[2]; + EXPECT_OK(pipe(pipefds)); pid_t pid = pdfork(&pd, 0); EXPECT_OK(pid); if (pid == 0) { - // Child: sleep. No SIGINT handler. - if (verbose) fprintf(stderr, "[%d] child about to sleep(10)\n", getpid_()); - int left = sleep(10); - if (verbose) fprintf(stderr, "[%d] child slept, %d sec left\n", getpid_(), left); + close(pipefds[0]); + if (verbose) fprintf(stderr, "[%d] child started\n", getpid_()); + SEND_INT_MESSAGE(pipefds[1], MSG_CHILD_STARTED); + // Child: wait for shutdown message. No SIGINT handler. The message should + // never be received, since SIGINT should terminate the process. + if (verbose) fprintf(stderr, "[%d] child about to read()\n", getpid_()); + AWAIT_INT_MESSAGE(pipefds[1], MSG_PARENT_REQUEST_CHILD_EXIT); + fprintf(stderr, "[%d] child read() returned unexpectedly\n", getpid_()); exit(99); } - + // Wait for child to start before signalling. + if (verbose) fprintf(stderr, "[%d] waiting for child\n", getpid_()); + close(pipefds[1]); + AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); // Kill the child (as it doesn't handle SIGINT). - sleep(1); + if (verbose) fprintf(stderr, "[%d] sending SIGINT\n", getpid_()); EXPECT_OK(pdkill(pd, SIGINT)); // Make sure the child finished properly (terminated by signal). @@ -922,7 +1033,7 @@ TEST_F(PipePdfork, PassProcessDescriptor) { if (child2 == 0) { // Child: close our copy of the original process descriptor. close(pd_); - + SEND_INT_MESSAGE(sock_fds[0], MSG_CHILD_STARTED); // Child: wait to receive process descriptor over socket if (verbose) fprintf(stderr, " [%d] child of %d waiting for process descriptor on socket\n", getpid_(), getppid()); int rc = recvmsg(sock_fds[0], &mh, 0); @@ -934,13 +1045,16 @@ TEST_F(PipePdfork, PassProcessDescriptor) { cmptr = CMSG_NXTHDR(&mh, cmptr); EXPECT_TRUE(cmptr == NULL); if (verbose) fprintf(stderr, " [%d] got process descriptor %d on socket\n", getpid_(), pd); + SEND_INT_MESSAGE(sock_fds[0], MSG_CHILD_FD_RECEIVED); // Child: confirm we can do pd*() operations on the process descriptor pid_t other; EXPECT_OK(pdgetpid(pd, &other)); *** 93 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Mar 2 16:27:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA72856F048 for ; Tue, 2 Mar 2021 16:27: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 4DqjGR4xgqz4gRh; Tue, 2 Mar 2021 16:27: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 9CB4C19E12; Tue, 2 Mar 2021 16:27: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 122GRhIq032677; Tue, 2 Mar 2021 16:27:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122GRh1j032676; Tue, 2 Mar 2021 16:27:43 GMT (envelope-from git) Date: Tue, 2 Mar 2021 16:27:43 GMT Message-Id: <202103021627.122GRh1j032676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Alex Richardson Subject: git: 05e684acef87 - Create tag vendor/google/capsicum-test/20210302 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/tags/vendor/google/capsicum-test/20210302 X-Git-Reftype: annotated tag X-Git-Commit: 05e684acef87cdac7d9584c564406750b75ee78f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 16:27:43 -0000 The annotated tag vendor/google/capsicum-test/20210302 has been created by arichardson: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/google/capsicum-test/20210302 tag vendor/google/capsicum-test/20210302 Tagger: Alex Richardson TaggerDate: 2021-03-02 16:24:55 +0000 Vendor import of https://github.com/google/capsicum-test/commit/f4d97414d48b8f8356b971ab9f45dc5c70d53c40 commit c59f30a57b509d88ab47e5cf2e1509fdc8a2749c Author: Alex Richardson AuthorDate: 2021-03-02 16:22:31 +0000 Commit: Alex Richardson CommitDate: 2021-03-02 16:22:31 +0000 Update capsicum-test to git commit f4d97414d48b8f8356b971ab9f45dc5c70d53c40 From owner-dev-commits-src-all@freebsd.org Tue Mar 2 16:39:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C01C656F3BD; Tue, 2 Mar 2021 16:39: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 4DqjX653nNz4glx; Tue, 2 Mar 2021 16:39: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 9C36619DED; Tue, 2 Mar 2021 16:39: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 122GdYjT046726; Tue, 2 Mar 2021 16:39:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122GdYiZ046723; Tue, 2 Mar 2021 16:39:34 GMT (envelope-from git) Date: Tue, 2 Mar 2021 16:39:34 GMT Message-Id: <202103021639.122GdYiZ046723@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: 955a3f9ad586 - main - Update capsicum-test to git commit f4d97414d48b8f8356b971ab9f45dc5c70d53c40 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: 955a3f9ad586f38395e66127f9f2f4afbf3d5a94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 16:39:34 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=955a3f9ad586f38395e66127f9f2f4afbf3d5a94 commit 955a3f9ad586f38395e66127f9f2f4afbf3d5a94 Merge: 0401989282d1 c59f30a57b50 Author: Alex Richardson AuthorDate: 2021-03-02 16:28:26 +0000 Commit: Alex Richardson CommitDate: 2021-03-02 16:38:05 +0000 Update capsicum-test to git commit f4d97414d48b8f8356b971ab9f45dc5c70d53c40 This includes various fixes that I submitted recently such as updating the pdkill() tests for the actual implemented behaviour (https://github.com/google/capsicum-test/pull/53) and lots of changes to avoid calling sleep() and replacing it with reliable synchronization (pull requests 49,51,52,53,54). This should make the testsuite more reliable when running on Jenkins. Additionally, process status is now retrieved using libprocstat instead of running `ps` and parsing the output (https://github.com/google/capsicum-test/pull/50). This fixes one previously failing test and speeds up execution. Overall, this update reduces the total runtime from ~60s to about 4-5 seconds. contrib/capsicum-test/GNUmakefile | 4 + contrib/capsicum-test/capability-fd.cc | 23 +++- contrib/capsicum-test/capmode.cc | 126 +++++++++++++---- contrib/capsicum-test/capsicum-test.cc | 88 ++++++++---- contrib/capsicum-test/capsicum-test.h | 36 ++++- contrib/capsicum-test/makefile | 2 +- contrib/capsicum-test/openat.cc | 1 + contrib/capsicum-test/procdesc.cc | 241 ++++++++++++++++++++++++--------- contrib/capsicum-test/socket.cc | 18 ++- tests/sys/capsicum/Makefile | 2 +- 10 files changed, 412 insertions(+), 129 deletions(-) diff --cc contrib/capsicum-test/openat.cc index 232fb22dd3f7,000000000000..5447558cde89 mode 100644,000000..100644 --- a/contrib/capsicum-test/openat.cc +++ b/contrib/capsicum-test/openat.cc @@@ -1,361 -1,0 +1,362 @@@ +#include +#include +#include +#include + +#include + +#include "capsicum.h" +#include "capsicum-test.h" +#include "syscalls.h" + +// Check an open call works and close the resulting fd. +#define EXPECT_OPEN_OK(f) do { \ ++ SCOPED_TRACE(#f); \ + int _fd = f; \ + EXPECT_OK(_fd); \ + close(_fd); \ + } while (0) + +static void CreateFile(const char *filename, const char *contents) { + int fd = open(filename, O_CREAT|O_RDWR, 0644); + EXPECT_OK(fd); + EXPECT_OK(write(fd, contents, strlen(contents))); + close(fd); +} + +// Test openat(2) in a variety of sitations to ensure that it obeys Capsicum +// "strict relative" rules: +// +// 1. Use strict relative lookups in capability mode or when operating +// relative to a capability. +// 2. When performing strict relative lookups, absolute paths (including +// symlinks to absolute paths) are not allowed, nor are paths containing +// '..' components. +// +// These rules apply when: +// - the directory FD is a Capsicum capability +// - the process is in capability mode +// - the openat(2) operation includes the O_BENEATH flag. +FORK_TEST(Openat, Relative) { + int etc = open("/etc/", O_RDONLY); + EXPECT_OK(etc); + + cap_rights_t r_base; + cap_rights_init(&r_base, CAP_READ, CAP_WRITE, CAP_SEEK, CAP_LOOKUP, CAP_FCNTL, CAP_IOCTL); + cap_rights_t r_ro; + cap_rights_init(&r_ro, CAP_READ); + cap_rights_t r_rl; + cap_rights_init(&r_rl, CAP_READ, CAP_LOOKUP); + + int etc_cap = dup(etc); + EXPECT_OK(etc_cap); + EXPECT_OK(cap_rights_limit(etc_cap, &r_ro)); + int etc_cap_ro = dup(etc); + EXPECT_OK(etc_cap_ro); + EXPECT_OK(cap_rights_limit(etc_cap_ro, &r_rl)); + int etc_cap_base = dup(etc); + EXPECT_OK(etc_cap_base); + EXPECT_OK(cap_rights_limit(etc_cap_base, &r_base)); +#ifdef HAVE_CAP_FCNTLS_LIMIT + // Also limit fcntl(2) subrights. + EXPECT_OK(cap_fcntls_limit(etc_cap_base, CAP_FCNTL_GETFL)); +#endif +#ifdef HAVE_CAP_IOCTLS_LIMIT + // Also limit ioctl(2) subrights. + cap_ioctl_t ioctl_nread = FIONREAD; + EXPECT_OK(cap_ioctls_limit(etc_cap_base, &ioctl_nread, 1)); +#endif + + // openat(2) with regular file descriptors in non-capability mode + // Should Just Work (tm). + EXPECT_OPEN_OK(openat(etc, "/etc/passwd", O_RDONLY)); + EXPECT_OPEN_OK(openat(AT_FDCWD, "/etc/passwd", O_RDONLY)); + EXPECT_OPEN_OK(openat(etc, "passwd", O_RDONLY)); + EXPECT_OPEN_OK(openat(etc, "../etc/passwd", O_RDONLY)); + + // Lookups relative to capabilities should be strictly relative. + // When not in capability mode, we don't actually require CAP_LOOKUP. + EXPECT_OPEN_OK(openat(etc_cap_ro, "passwd", O_RDONLY)); + EXPECT_OPEN_OK(openat(etc_cap_base, "passwd", O_RDONLY)); + + // Performing openat(2) on a path with leading slash ignores + // the provided directory FD. + EXPECT_OPEN_OK(openat(etc_cap_ro, "/etc/passwd", O_RDONLY)); + EXPECT_OPEN_OK(openat(etc_cap_base, "/etc/passwd", O_RDONLY)); + // Relative lookups that go upward are not allowed. + EXPECT_OPENAT_FAIL_TRAVERSAL(etc_cap_ro, "../etc/passwd", O_RDONLY); + EXPECT_OPENAT_FAIL_TRAVERSAL(etc_cap_base, "../etc/passwd", O_RDONLY); + + // A file opened relative to a capability should itself be a capability. + int fd = openat(etc_cap_base, "passwd", O_RDONLY); + EXPECT_OK(fd); + cap_rights_t rights; + EXPECT_OK(cap_rights_get(fd, &rights)); + EXPECT_RIGHTS_IN(&rights, &r_base); +#ifdef HAVE_CAP_FCNTLS_LIMIT + cap_fcntl_t fcntls; + EXPECT_OK(cap_fcntls_get(fd, &fcntls)); + EXPECT_EQ((cap_fcntl_t)CAP_FCNTL_GETFL, fcntls); +#endif +#ifdef HAVE_CAP_IOCTLS_LIMIT + cap_ioctl_t ioctls[16]; + ssize_t nioctls; + memset(ioctls, 0, sizeof(ioctls)); + nioctls = cap_ioctls_get(fd, ioctls, 16); + EXPECT_OK(nioctls); + EXPECT_EQ(1, nioctls); + EXPECT_EQ((cap_ioctl_t)FIONREAD, ioctls[0]); +#endif + close(fd); + + // Enter capability mode; now ALL lookups are strictly relative. + EXPECT_OK(cap_enter()); + + // Relative lookups on regular files or capabilities with CAP_LOOKUP + // ought to succeed. + EXPECT_OPEN_OK(openat(etc, "passwd", O_RDONLY)); + EXPECT_OPEN_OK(openat(etc_cap_ro, "passwd", O_RDONLY)); + EXPECT_OPEN_OK(openat(etc_cap_base, "passwd", O_RDONLY)); + + // Lookup relative to capabilities without CAP_LOOKUP should fail. + EXPECT_NOTCAPABLE(openat(etc_cap, "passwd", O_RDONLY)); + + // Absolute lookups should fail. + EXPECT_CAPMODE(openat(AT_FDCWD, "/etc/passwd", O_RDONLY)); + EXPECT_OPENAT_FAIL_TRAVERSAL(etc, "/etc/passwd", O_RDONLY); + EXPECT_OPENAT_FAIL_TRAVERSAL(etc_cap_ro, "/etc/passwd", O_RDONLY); + + // Lookups containing '..' should fail in capability mode. + EXPECT_OPENAT_FAIL_TRAVERSAL(etc, "../etc/passwd", O_RDONLY); + EXPECT_OPENAT_FAIL_TRAVERSAL(etc_cap_ro, "../etc/passwd", O_RDONLY); + EXPECT_OPENAT_FAIL_TRAVERSAL(etc_cap_base, "../etc/passwd", O_RDONLY); + + fd = openat(etc, "passwd", O_RDONLY); + EXPECT_OK(fd); + + // A file opened relative to a capability should itself be a capability. + fd = openat(etc_cap_base, "passwd", O_RDONLY); + EXPECT_OK(fd); + EXPECT_OK(cap_rights_get(fd, &rights)); + EXPECT_RIGHTS_IN(&rights, &r_base); + close(fd); + + fd = openat(etc_cap_ro, "passwd", O_RDONLY); + EXPECT_OK(fd); + EXPECT_OK(cap_rights_get(fd, &rights)); + EXPECT_RIGHTS_IN(&rights, &r_rl); + close(fd); +} + +#define TOPDIR "cap_topdir" +#define SUBDIR TOPDIR "/subdir" +class OpenatTest : public ::testing::Test { + public: + // Build a collection of files, subdirs and symlinks: + // /tmp/cap_topdir/ + // /topfile + // /subdir/ + // /subdir/bottomfile + // /symlink.samedir -> topfile + // /dsymlink.samedir -> ./ + // /symlink.down -> subdir/bottomfile + // /dsymlink.down -> subdir/ + // /symlink.absolute_out -> /etc/passwd + // /dsymlink.absolute_out -> /etc/ + // /symlink.relative_in -> ../../tmp/cap_topdir/topfile + // /dsymlink.relative_in -> ../../tmp/cap_topdir/ + // /symlink.relative_out -> ../../etc/passwd + // /dsymlink.relative_out -> ../../etc/ + // /subdir/dsymlink.absolute_in -> /tmp/cap_topdir/ + // /subdir/dsymlink.up -> ../ + // /subdir/symlink.absolute_in -> /tmp/cap_topdir/topfile + // /subdir/symlink.up -> ../topfile + // (In practice, this is a little more complicated because tmpdir might + // not be "/tmp".) + OpenatTest() { + // Create a couple of nested directories + int rc = mkdir(TmpFile(TOPDIR), 0755); + EXPECT_OK(rc); + if (rc < 0) { + EXPECT_EQ(EEXIST, errno); + } + rc = mkdir(TmpFile(SUBDIR), 0755); + EXPECT_OK(rc); + if (rc < 0) { + EXPECT_EQ(EEXIST, errno); + } + + // Figure out a path prefix (like "../..") that gets us to the root + // directory from TmpFile(TOPDIR). + const char *p = TmpFile(TOPDIR); // maybe "/tmp/somewhere/cap_topdir" + std::string dots2root = ".."; + while (*p++ != '\0') { + if (*p == '/') { + dots2root += "/.."; + } + } + + // Create normal files in each. + CreateFile(TmpFile(TOPDIR "/topfile"), "Top-level file"); + CreateFile(TmpFile(SUBDIR "/bottomfile"), "File in subdirectory"); + + // Create various symlinks to files. + EXPECT_OK(symlink("topfile", TmpFile(TOPDIR "/symlink.samedir"))); + EXPECT_OK(symlink("subdir/bottomfile", TmpFile(TOPDIR "/symlink.down"))); + EXPECT_OK(symlink(TmpFile(TOPDIR "/topfile"), TmpFile(SUBDIR "/symlink.absolute_in"))); + EXPECT_OK(symlink("/etc/passwd", TmpFile(TOPDIR "/symlink.absolute_out"))); + std::string dots2top = dots2root + TmpFile(TOPDIR "/topfile"); + EXPECT_OK(symlink(dots2top.c_str(), TmpFile(TOPDIR "/symlink.relative_in"))); + std::string dots2passwd = dots2root + "/etc/passwd"; + EXPECT_OK(symlink(dots2passwd.c_str(), TmpFile(TOPDIR "/symlink.relative_out"))); + EXPECT_OK(symlink("../topfile", TmpFile(SUBDIR "/symlink.up"))); + + // Create various symlinks to directories. + EXPECT_OK(symlink("./", TmpFile(TOPDIR "/dsymlink.samedir"))); + EXPECT_OK(symlink("subdir/", TmpFile(TOPDIR "/dsymlink.down"))); + EXPECT_OK(symlink(TmpFile(TOPDIR "/"), TmpFile(SUBDIR "/dsymlink.absolute_in"))); + EXPECT_OK(symlink("/etc/", TmpFile(TOPDIR "/dsymlink.absolute_out"))); + std::string dots2cwd = dots2root + tmpdir + "/"; + EXPECT_OK(symlink(dots2cwd.c_str(), TmpFile(TOPDIR "/dsymlink.relative_in"))); + std::string dots2etc = dots2root + "/etc/"; + EXPECT_OK(symlink(dots2etc.c_str(), TmpFile(TOPDIR "/dsymlink.relative_out"))); + EXPECT_OK(symlink("../", TmpFile(SUBDIR "/dsymlink.up"))); + + // Open directory FDs for those directories and for cwd. + dir_fd_ = open(TmpFile(TOPDIR), O_RDONLY); + EXPECT_OK(dir_fd_); + sub_fd_ = open(TmpFile(SUBDIR), O_RDONLY); + EXPECT_OK(sub_fd_); + cwd_ = openat(AT_FDCWD, ".", O_RDONLY); + EXPECT_OK(cwd_); + // Move into the directory for the test. + EXPECT_OK(fchdir(dir_fd_)); + } + ~OpenatTest() { + fchdir(cwd_); + close(cwd_); + close(sub_fd_); + close(dir_fd_); + unlink(TmpFile(SUBDIR "/symlink.up")); + unlink(TmpFile(SUBDIR "/symlink.absolute_in")); + unlink(TmpFile(TOPDIR "/symlink.absolute_out")); + unlink(TmpFile(TOPDIR "/symlink.relative_in")); + unlink(TmpFile(TOPDIR "/symlink.relative_out")); + unlink(TmpFile(TOPDIR "/symlink.down")); + unlink(TmpFile(TOPDIR "/symlink.samedir")); + unlink(TmpFile(SUBDIR "/dsymlink.up")); + unlink(TmpFile(SUBDIR "/dsymlink.absolute_in")); + unlink(TmpFile(TOPDIR "/dsymlink.absolute_out")); + unlink(TmpFile(TOPDIR "/dsymlink.relative_in")); + unlink(TmpFile(TOPDIR "/dsymlink.relative_out")); + unlink(TmpFile(TOPDIR "/dsymlink.down")); + unlink(TmpFile(TOPDIR "/dsymlink.samedir")); + unlink(TmpFile(SUBDIR "/bottomfile")); + unlink(TmpFile(TOPDIR "/topfile")); + rmdir(TmpFile(SUBDIR)); + rmdir(TmpFile(TOPDIR)); + } + + // Check openat(2) policing that is common across capabilities, capability mode and O_BENEATH. + void CheckPolicing(int oflag) { + // OK for normal access. + EXPECT_OPEN_OK(openat(dir_fd_, "topfile", O_RDONLY|oflag)); + EXPECT_OPEN_OK(openat(dir_fd_, "subdir/bottomfile", O_RDONLY|oflag)); + EXPECT_OPEN_OK(openat(sub_fd_, "bottomfile", O_RDONLY|oflag)); + EXPECT_OPEN_OK(openat(sub_fd_, ".", O_RDONLY|oflag)); + + // Can't open paths with ".." in them. + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "../topfile", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "../subdir/bottomfile", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "..", O_RDONLY|oflag); + +#ifdef HAVE_OPENAT_INTERMEDIATE_DOTDOT + // OK for dotdot lookups that don't escape the top directory + EXPECT_OPEN_OK(openat(dir_fd_, "subdir/../topfile", O_RDONLY|oflag)); +#endif + + // Check that we can't escape the top directory by the cunning + // ruse of going via a subdirectory. + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "subdir/../../etc/passwd", O_RDONLY|oflag); + + // Should only be able to open symlinks that stay within the directory. + EXPECT_OPEN_OK(openat(dir_fd_, "symlink.samedir", O_RDONLY|oflag)); + EXPECT_OPEN_OK(openat(dir_fd_, "symlink.down", O_RDONLY|oflag)); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "symlink.absolute_out", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "symlink.relative_in", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "symlink.relative_out", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "symlink.absolute_in", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "symlink.up", O_RDONLY|oflag); + + EXPECT_OPEN_OK(openat(dir_fd_, "dsymlink.samedir/topfile", O_RDONLY|oflag)); + EXPECT_OPEN_OK(openat(dir_fd_, "dsymlink.down/bottomfile", O_RDONLY|oflag)); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "dsymlink.absolute_out/passwd", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "dsymlink.relative_in/topfile", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "dsymlink.relative_out/passwd", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "dsymlink.absolute_in/topfile", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "dsymlink.up/topfile", O_RDONLY|oflag); + + // Although recall that O_NOFOLLOW prevents symlink following in final component. + EXPECT_SYSCALL_FAIL(E_TOO_MANY_LINKS, openat(dir_fd_, "symlink.samedir", O_RDONLY|O_NOFOLLOW|oflag)); + EXPECT_SYSCALL_FAIL(E_TOO_MANY_LINKS, openat(dir_fd_, "symlink.down", O_RDONLY|O_NOFOLLOW|oflag)); + } + + protected: + int dir_fd_; + int sub_fd_; + int cwd_; +}; + +TEST_F(OpenatTest, WithCapability) { + // Any kind of symlink can be opened relative to an ordinary directory FD. + EXPECT_OPEN_OK(openat(dir_fd_, "symlink.samedir", O_RDONLY)); + EXPECT_OPEN_OK(openat(dir_fd_, "symlink.down", O_RDONLY)); + EXPECT_OPEN_OK(openat(dir_fd_, "symlink.absolute_out", O_RDONLY)); + EXPECT_OPEN_OK(openat(dir_fd_, "symlink.relative_in", O_RDONLY)); + EXPECT_OPEN_OK(openat(dir_fd_, "symlink.relative_out", O_RDONLY)); + EXPECT_OPEN_OK(openat(sub_fd_, "symlink.absolute_in", O_RDONLY)); + EXPECT_OPEN_OK(openat(sub_fd_, "symlink.up", O_RDONLY)); + + // Now make both DFDs into Capsicum capabilities. + cap_rights_t r_rl; + cap_rights_init(&r_rl, CAP_READ, CAP_LOOKUP, CAP_FCHDIR); + EXPECT_OK(cap_rights_limit(dir_fd_, &r_rl)); + EXPECT_OK(cap_rights_limit(sub_fd_, &r_rl)); + CheckPolicing(0); + // Use of AT_FDCWD is independent of use of a capability. + // Can open paths starting with "/" against a capability dfd, because the dfd is ignored. +} + +FORK_TEST_F(OpenatTest, InCapabilityMode) { + EXPECT_OK(cap_enter()); // Enter capability mode + CheckPolicing(0); + + // Use of AT_FDCWD is banned in capability mode. + EXPECT_CAPMODE(openat(AT_FDCWD, "topfile", O_RDONLY)); + EXPECT_CAPMODE(openat(AT_FDCWD, "subdir/bottomfile", O_RDONLY)); + EXPECT_CAPMODE(openat(AT_FDCWD, "/etc/passwd", O_RDONLY)); + + // Can't open paths starting with "/" in capability mode. + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "/etc/passwd", O_RDONLY); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "/etc/passwd", O_RDONLY); +} + +#ifdef O_BENEATH +TEST_F(OpenatTest, WithFlag) { + CheckPolicing(O_BENEATH); + + // Check with AT_FDCWD. + EXPECT_OPEN_OK(openat(AT_FDCWD, "topfile", O_RDONLY|O_BENEATH)); + EXPECT_OPEN_OK(openat(AT_FDCWD, "subdir/bottomfile", O_RDONLY|O_BENEATH)); + + // Can't open paths starting with "/" with O_BENEATH specified. + EXPECT_OPENAT_FAIL_TRAVERSAL(AT_FDCWD, "/etc/passwd", O_RDONLY|O_BENEATH); + EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "/etc/passwd", O_RDONLY|O_BENEATH); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "/etc/passwd", O_RDONLY|O_BENEATH); +} + +FORK_TEST_F(OpenatTest, WithFlagInCapabilityMode) { + EXPECT_OK(cap_enter()); // Enter capability mode + CheckPolicing(O_BENEATH); +} +#endif diff --cc tests/sys/capsicum/Makefile index 75dd0238895f,000000000000..ded91803cf8a mode 100644,000000..100644 --- a/tests/sys/capsicum/Makefile +++ b/tests/sys/capsicum/Makefile @@@ -1,56 -1,0 +1,56 @@@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/sys/capsicum + +ATF_TESTS_C+= bindat_connectat +ATF_TESTS_C+= ioctls_test + +CFLAGS+= -I${SRCTOP}/tests + +.if ${MK_GOOGLETEST} != no + +.PATH: ${SRCTOP}/contrib/capsicum-test + +GTESTS+= capsicum-test +GTESTS_WRAPPER_SH.capsicum-test= functional + +SRCS.capsicum-test+= \ + capsicum-test-main.cc \ + capsicum-test.cc \ + capability-fd.cc \ + fexecve.cc \ + procdesc.cc \ + capmode.cc \ + fcntl.cc \ + ioctl.cc \ + openat.cc \ + sysctl.cc \ + select.cc \ + mqueue.cc \ + socket.cc \ + sctp.cc \ + capability-fd-pair.cc \ + overhead.cc \ + rename.cc + - LIBADD.capsicum-test+= gtest pthread ++LIBADD.capsicum-test+= gtest pthread procstat +TEST_METADATA.capsicum-test= required_user="unprivileged" + +.for p in mini-me mini-me.noexec mini-me.setuid +PROGS+= $p +NO_SHARED.$p= +SRCS.$p= mini-me.c +.endfor + +BINDIR= ${TESTSDIR} + +BINMODE.mini-me.noexec= ${NOBINMODE} +BINMODE.mini-me.setuid= 4555 + +WARNS.capsicum-test= 3 + +.endif # MK_GOOGLETEST + +.include From owner-dev-commits-src-all@freebsd.org Tue Mar 2 16:42:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7FD956F7A3; Tue, 2 Mar 2021 16: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 4Dqjbl5nvMz4hJ2; Tue, 2 Mar 2021 16: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 B9BA71A316; Tue, 2 Mar 2021 16: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 122Ggh2I058868; Tue, 2 Mar 2021 16: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 122GghHT058867; Tue, 2 Mar 2021 16:42:43 GMT (envelope-from git) Date: Tue, 2 Mar 2021 16:42:43 GMT Message-Id: <202103021642.122GghHT058867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2751e264dfef - releng/13.0 - tcp: improve behaviour when using TCP_NOOPT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 2751e264dfef1e59e9c45d511a2d3ee99839651e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 16:42:43 -0000 The branch releng/13.0 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2751e264dfef1e59e9c45d511a2d3ee99839651e commit 2751e264dfef1e59e9c45d511a2d3ee99839651e Author: Michael Tuexen AuthorDate: 2021-02-14 11:10:31 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 15:17:25 +0000 tcp: improve behaviour when using TCP_NOOPT Use ISS for SEG.SEQ when sending a SYN-ACK segment in response to an SYN segment received in the SYN-SENT state on a socket having the IPPROTO_TCP level socket option TCP_NOOPT enabled. Approved by: re (gjb) Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D28656 (cherry picked from commit ed782b9f5a7a05debe944a33b4ac9e5629a95803) (cherry picked from commit e949dcc283cd3b19e8e3113d8d3e10a72c2bbe6e) --- sys/netinet/tcp_output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index cacc0c51bd8e..b4c7ab0a1ab7 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -785,6 +785,10 @@ send: #endif hdrlen = sizeof (struct tcpiphdr); + if (flags & TH_SYN) { + tp->snd_nxt = tp->iss; + } + /* * Compute options for segment. * We only have to care about SYN and established connection @@ -795,7 +799,6 @@ send: if ((tp->t_flags & TF_NOOPT) == 0) { /* Maximum segment size. */ if (flags & TH_SYN) { - tp->snd_nxt = tp->iss; to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); to.to_flags |= TOF_MSS; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 16:50:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05A7156FBA3; Tue, 2 Mar 2021 16:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqjmB6gmrz4hcq; Tue, 2 Mar 2021 16:50: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 D3C7719FC3; Tue, 2 Mar 2021 16:50:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122Go2WX061431; Tue, 2 Mar 2021 16:50:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Go2nt061428; Tue, 2 Mar 2021 16:50:02 GMT (envelope-from git) Date: Tue, 2 Mar 2021 16:50:02 GMT Message-Id: <202103021650.122Go2nt061428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c26d77d989abe48c662eeb6f52f7e4c9b81680c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 16:50:03 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=2c26d77d989abe48c662eeb6f52f7e4c9b81680c commit 2c26d77d989abe48c662eeb6f52f7e4c9b81680c Author: Nathan Whitehorn AuthorDate: 2021-03-02 16:47:00 +0000 Commit: Nathan Whitehorn CommitDate: 2021-03-02 16:49:41 +0000 Remove /boot/efi from mtree, missed in 0b7472b3d8d2. This had prevented the bootconfig step from determining if an ESP exists, resulting in its unconditional setup. On BIOS-booted amd64, this wasn't harmful, just unnecessary, but it resulted in failed installations on non-EFI-supporting platforms like powerpc64. MFC after: 3 days --- etc/mtree/BSD.root.dist | 2 -- release/tools/arm.subr | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index f734f7891429..1dc9e179b0fc 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -18,8 +18,6 @@ rockchip tags=package=runtime .. .. - efi - .. firmware .. loader.conf.d tags=package=bootloader diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 343d9f3a7034..2f91490c0859 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -184,6 +184,7 @@ arm_install_base() { TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ ${CONF_FILES} installworld installkernel distribution + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/efi chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos arm_create_user From owner-dev-commits-src-all@freebsd.org Tue Mar 2 17:13:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1CD9548AF7; Tue, 2 Mar 2021 17:13: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 4DqkHc4Br3z4l0m; Tue, 2 Mar 2021 17:13: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 82F631A894; Tue, 2 Mar 2021 17:13: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 122HDmWZ099535; Tue, 2 Mar 2021 17:13:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122HDmTi099534; Tue, 2 Mar 2021 17:13:48 GMT (envelope-from git) Date: Tue, 2 Mar 2021 17:13:48 GMT Message-Id: <202103021713.122HDmTi099534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 15a7c88058d4 - stable/13 - update the SACK loss recovery to RFC6675, with the following new features: - improved pipe calculation which does not degrade under heavy loss - engaging in Loss Recovery earlier under adverse conditions - Rescue Retransmission in case some of the trailing packets of a request got lost MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15a7c88058d419e3347673ab891ae77ba28ae1bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 17:13:48 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=15a7c88058d419e3347673ab891ae77ba28ae1bd commit 15a7c88058d419e3347673ab891ae77ba28ae1bd Author: Richard Scheffenegger AuthorDate: 2021-02-16 11:18:43 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-02 15:59:58 +0000 update the SACK loss recovery to RFC6675, with the following new features: - improved pipe calculation which does not degrade under heavy loss - engaging in Loss Recovery earlier under adverse conditions - Rescue Retransmission in case some of the trailing packets of a request got lost All above changes are toggled with the sysctl "rfc6675_pipe" (disabled by default). Reviewers: #transport, tuexen, lstewart, slavash, jtl, hselasky, kib, rgrimes, chengc_netapp.com, thj, #manpages, kbowling, #netapp, rscheff Reviewed By: #transport MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D18985 (cherry picked from commit 3c40e1d52cd86168779cf99dbabe58df465d7e3f) --- share/man/man4/tcp.4 | 10 +++++++++- sys/netinet/tcp_input.c | 34 +++++++++++++++++++++++++++++----- sys/netinet/tcp_sack.c | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 6 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 431bcd95513b..16cf02184516 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 11, 2021 +.Dd February 13, 2021 .Dt TCP 4 .Os .Sh NAME @@ -560,6 +560,14 @@ high losses leading to RTO, but reduces PRR effectiveness in more common setting .It Va rfc6675_pipe Calculate the bytes in flight using the algorithm described in RFC 6675, and is also an improvement when Proportional Rate Reduction is enabled. +Also enables two other mechanisms from RFC6675. +Rescue Retransmission helps timely loss recovery, when the trailing segments +of a transmission are lost, while no additional data is ready to be sent. +In case a partial ACK without a SACK block is received during SACK loss +recovery, the trailing segment is immediately resent, rather than waiting +for a Retransmission timeout. +SACK loss recovery is also engaged, once two segments plus one byte are +SACKed - even if no traditional duplicate ACKs were seen. .It Va rfc3042 Enable the Limited Transmit algorithm as described in RFC 3042. It helps avoid timeouts on lossy links and also when the congestion window diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index f16c62ae6a1f..1a4a4619c4bf 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1507,6 +1507,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct mbuf *mfree; struct tcpopt to; int tfo_syn; + u_int maxseg; #ifdef TCPDEBUG /* @@ -2512,8 +2513,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, #endif if (SEQ_LEQ(th->th_ack, tp->snd_una)) { - u_int maxseg; - maxseg = tcp_maxseg(tp); if (tlen == 0 && (tiwin == tp->snd_wnd || @@ -2648,7 +2647,21 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, tp->snd_cwnd += maxseg; (void) tp->t_fb->tfb_tcp_output(tp); goto drop; - } else if (tp->t_dupacks == tcprexmtthresh) { + } else if (tp->t_dupacks == tcprexmtthresh || + (tp->t_flags & TF_SACK_PERMIT && + V_tcp_do_rfc6675_pipe && + tp->sackhint.sacked_bytes > + (tcprexmtthresh - 1) * maxseg)) { +enter_recovery: + /* + * Above is the RFC6675 trigger condition of + * more than (dupthresh-1)*maxseg sacked data. + * If the count of holes in the + * scoreboard is >= dupthresh, we could + * also enter loss recovery, but don't + * have that value readily available. + */ + tp->t_dupacks = tcprexmtthresh; tcp_seq onxt = tp->snd_nxt; /* @@ -2693,6 +2706,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, tp->snd_recover = tp->snd_nxt; tp->snd_cwnd = maxseg; (void) tp->t_fb->tfb_tcp_output(tp); + if (SEQ_GT(th->th_ack, tp->snd_una)) + goto resume_partialack; goto drop; } tp->snd_nxt = th->th_ack; @@ -2779,10 +2794,19 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, */ if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACK) && - sack_changed) + sack_changed) { tp->t_dupacks++; + /* limit overhead by setting maxseg last */ + if (!IN_FASTRECOVERY(tp->t_flags) && + (tp->sackhint.sacked_bytes > + ((tcprexmtthresh - 1) * + (maxseg = tcp_maxseg(tp))))) { + goto enter_recovery; + } + } } +resume_partialack: KASSERT(SEQ_GT(th->th_ack, tp->snd_una), ("%s: th_ack <= snd_una", __func__)); @@ -2793,7 +2817,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (IN_FASTRECOVERY(tp->t_flags)) { if (SEQ_LT(th->th_ack, tp->snd_recover)) { if (tp->t_flags & TF_SACK_PERMIT) - if (V_tcp_do_prr) + if (V_tcp_do_prr && to.to_flags & TOF_SACK) tcp_prr_partialack(tp, th); else tcp_sack_partialack(tp, th); diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 2cae6a560c48..28cd5c93f106 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -750,6 +750,16 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) else sblkp--; } + if (!(to->to_flags & TOF_SACK)) + /* + * If this ACK did not contain any + * SACK blocks, any only moved the + * left edge right, it is a pure + * cumulative ACK. Do not count + * DupAck for this. Also required + * for RFC6675 rescue retransmission. + */ + sack_changed = 0; tp->sackhint.delivered_data = delivered_data; tp->sackhint.sacked_bytes += delivered_data - left_edge_delta; KASSERT((delivered_data >= 0), ("delivered_data < 0")); @@ -800,6 +810,31 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; tp->t_flags |= TF_ACKNOW; + /* + * RFC6675 rescue retransmission + * Add a hole between th_ack (snd_una is not yet set) and snd_max, + * if this was a pure cumulative ACK and no data was send beyond + * recovery point. Since the data in the socket has not been freed + * at this point, we check if the scoreboard is empty, and the ACK + * delivered some new data, indicating a full ACK. Also, if the + * recovery point is still at snd_max, we are probably application + * limited. However, this inference might not always be true. The + * rescue retransmission may rarely be slightly premature + * compared to RFC6675. + * The corresponding ACK+SACK will cause any further outstanding + * segments to be retransmitted. This addresses a corner case, when + * the trailing packets of a window are lost and no further data + * is available for sending. + */ + if ((V_tcp_do_rfc6675_pipe) && + SEQ_LT(th->th_ack, tp->snd_recover) && + (tp->snd_recover == tp->snd_max) && + TAILQ_EMPTY(&tp->snd_holes) && + (tp->sackhint.delivered_data > 0)) { + struct sackhole *hole; + int maxseg = tcp_maxseg(tp); + hole = tcp_sackhole_insert(tp, SEQ_MAX(th->th_ack, tp->snd_max - maxseg), tp->snd_max, NULL); + } (void) tp->t_fb->tfb_tcp_output(tp); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:12:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 545CB54A5AD; Tue, 2 Mar 2021 18:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqlbk22DJz4nwP; Tue, 2 Mar 2021 18:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 389761B3F2; Tue, 2 Mar 2021 18:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122ICoCC078643; Tue, 2 Mar 2021 18:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122ICouP078642; Tue, 2 Mar 2021 18:12:50 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:12:50 GMT Message-Id: <202103021812.122ICouP078642@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chris Rees Subject: git: ce94bedf475a - stable/13 - Create dhclient pid directory if it doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ce94bedf475ac17307be0d5cbc66a8abe0741bf6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:12:50 -0000 The branch stable/13 has been updated by crees (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ce94bedf475ac17307be0d5cbc66a8abe0741bf6 commit ce94bedf475ac17307be0d5cbc66a8abe0741bf6 Author: Chris Rees AuthorDate: 2021-02-21 18:56:56 +0000 Commit: Chris Rees CommitDate: 2021-03-02 18:12:34 +0000 Create dhclient pid directory if it doesn't exist - Upgrading from older FreeBSD versions can result in errors - /var/run can be a tmpfs, and this should be handled correctly Approved by: markj Differential: https://reviews.freebsd.org/D28843 MFC after: 2 weeks --- libexec/rc/rc.d/dhclient | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rc/rc.d/dhclient b/libexec/rc/rc.d/dhclient index 520a0850ccbc..765e38266408 100755 --- a/libexec/rc/rc.d/dhclient +++ b/libexec/rc/rc.d/dhclient @@ -49,6 +49,11 @@ dhclient_prestart() rc_flags="${rc_flags} -b" fi + + # /var/run/dhclient is not guaranteed to exist, + # e.g. if /var/run is a tmpfs + install -d -o root -g wheel -m 755 ${pidfile%/*} + rc_flags="${rc_flags} ${ifn}" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:15:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 005EB54AAA3; Tue, 2 Mar 2021 18:15: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 4Dqlg66dP2z4pfg; Tue, 2 Mar 2021 18:15: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 D68971B5AB; Tue, 2 Mar 2021 18:15: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 122IFk3l079227; Tue, 2 Mar 2021 18:15:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IFk2I079226; Tue, 2 Mar 2021 18:15:46 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:15:46 GMT Message-Id: <202103021815.122IFk2I079226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6f930137ca6d - releng/13.0 - sctp: several fixes and improvements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 6f930137ca6dac436d10b462a2058b5d9d975c5d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:15:47 -0000 The branch releng/13.0 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6f930137ca6dac436d10b462a2058b5d9d975c5d commit 6f930137ca6dac436d10b462a2058b5d9d975c5d Author: Michael Tuexen AuthorDate: 2021-01-23 19:56:45 +0000 Commit: Michael Tuexen CommitDate: 2021-03-02 15:57:23 +0000 sctp: several fixes and improvements Approved by: re (gjb) sctp: improve consistency No functional change intended. (cherry picked from commit 7a051c0a7890dc8e490ebe125bfc70a28e89ddaf) (cherry picked from commit 459f1b906515076b7ce30a06ab69a60891d8cbe8) sctp: fix PR-SCTP stats when adding addtional streams (cherry picked from commit 0f7573ffd6141b19419c9a6238246b9ba0e6dce6) (cherry picked from commit 21398f02b0c7913f815ae6ded426da60d92c635b) sctp: fix a locking issue for old unordered data Thanks to Anatoly Korniltsev for reporting the issue for the userland stack. (cherry picked from commit 8dc6a1edca6de0c64f6c082f69097746d1346592) (cherry picked from commit 3fa95c0fe60bbd67db6043c7e18910387bbe1bac) sctp: improve input validation Improve the handling of INIT chunks in specific szenarios and report and appropriate error cause. Thanks to Anatoly Korniltsev for reporting the issue for the userland stack. (cherry picked from commit af885c57d65d33c0306e91d3e090e76772a0d012) (cherry picked from commit 16b538975024e2b7038807bf5b712124f5a7b889) sctp: small cleanup, no functional change intended. (cherry picked from commit bdd4630c9a9cea64830f981fc897ac953c48892c) (cherry picked from commit 5573b94fa67f954dd0db57de328e60941ee8c9d1) sctp: clear a pointer to a net which will be removed (cherry picked from commit 5ac839029d01c0f48e1b1ff1a599cb47cf5e98ee) (cherry picked from commit 04c13928d9f306a7d7ac34452644a538d2be6fdc) sctp: improve computation of an alternate net Espeially handle the case where the net passed in is about to be deleted and therefore not in the list of nets anymore. Reported by: syzbot+9756917a7c8381adf5e8@syzkaller.appspotmail.com (cherry picked from commit b963ce4588b33f733aef3f7a7f3fbe5018a89728) (cherry picked from commit 8cf046aff9719779b665f7f4f4a8bad4b3945341) sctp: avoid integer overflow when starting the HB timer Reported by: syzbot+14b9d7c3c64208fae62f@syzkaller.appspotmail.com (cherry picked from commit 70e95f0b6917a8b8cd4a2a5f883f3e9753fc86d8) (cherry picked from commit f7c20120c19b6307536908a7f779be2832b133f3) --- sys/netinet/sctp_indata.c | 2 +- sys/netinet/sctp_input.c | 2 +- sys/netinet/sctp_output.c | 127 ++++++++++++++++++++++++++++----------------- sys/netinet/sctp_pcb.c | 4 ++ sys/netinet/sctp_structs.h | 32 ++++++------ sys/netinet/sctp_timer.c | 85 +++++++++++++++++------------- sys/netinet/sctputil.c | 25 +++++---- 7 files changed, 165 insertions(+), 112 deletions(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 08af27c934fb..6997a0099c88 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -803,7 +803,7 @@ restart: } memset(nc, 0, sizeof(struct sctp_queued_to_read)); TAILQ_REMOVE(&control->reasm, chk, sctp_next); - sctp_add_chk_to_control(control, strm, stcb, asoc, chk, SCTP_READ_LOCK_NOT_HELD); + sctp_add_chk_to_control(control, strm, stcb, asoc, chk, inp_read_lock_held); fsn++; cnt_added++; chk = NULL; diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 1606e4d9d1cf..43a2b06d1c79 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1871,9 +1871,9 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, asoc->strmout[i].abandoned_sent[0] = 0; asoc->strmout[i].abandoned_unsent[0] = 0; #endif - stcb->asoc.strmout[i].sid = i; stcb->asoc.strmout[i].next_mid_ordered = 0; stcb->asoc.strmout[i].next_mid_unordered = 0; + stcb->asoc.strmout[i].sid = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; } TAILQ_FOREACH_SAFE(strrst, &asoc->resetHead, next_resp, nstrrst) { diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index d8cf063c6b53..0f7ade931e61 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -3629,9 +3629,8 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er } for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], NULL); stcb->asoc.strmout[i].chunks_on_queues = 0; - stcb->asoc.strmout[i].next_mid_ordered = 0; - stcb->asoc.strmout[i].next_mid_unordered = 0; #if defined(SCTP_DETAILED_STR_STATS) for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { stcb->asoc.strmout[i].abandoned_sent[j] = 0; @@ -3641,10 +3640,11 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er stcb->asoc.strmout[i].abandoned_sent[0] = 0; stcb->asoc.strmout[i].abandoned_unsent[0] = 0; #endif + stcb->asoc.strmout[i].next_mid_ordered = 0; + stcb->asoc.strmout[i].next_mid_unordered = 0; stcb->asoc.strmout[i].sid = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.strmout[i].state = SCTP_STREAM_OPENING; - stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], NULL); } } break; @@ -5232,31 +5232,33 @@ invalid_size: return (op_err); } -static int +/* + * Given a INIT chunk, look through the parameters to verify that there + * are no new addresses. + * Return true, if there is a new address or there is a problem parsing + the parameters. Provide an optional error cause used when sending an ABORT. + * Return false, if there are no new addresses and there is no problem in + parameter processing. + */ +static bool sctp_are_there_new_addresses(struct sctp_association *asoc, - struct mbuf *in_initpkt, int offset, struct sockaddr *src) + struct mbuf *in_initpkt, int offset, int limit, struct sockaddr *src, + struct mbuf **op_err) { - /* - * Given a INIT packet, look through the packet to verify that there - * are NO new addresses. As we go through the parameters add reports - * of any un-understood parameters that require an error. Also we - * must return (1) to drop the packet if we see a un-understood - * parameter that tells us to drop the chunk. - */ struct sockaddr *sa_touse; struct sockaddr *sa; struct sctp_paramhdr *phdr, params; - uint16_t ptype, plen; - uint8_t fnd; struct sctp_nets *net; - int check_src; #ifdef INET struct sockaddr_in sin4, *sa4; #endif #ifdef INET6 struct sockaddr_in6 sin6, *sa6; #endif + uint16_t ptype, plen; + bool fnd, check_src; + *op_err = NULL; #ifdef INET memset(&sin4, 0, sizeof(sin4)); sin4.sin_family = AF_INET; @@ -5268,19 +5270,19 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sin6.sin6_len = sizeof(sin6); #endif /* First what about the src address of the pkt ? */ - check_src = 0; + check_src = false; switch (src->sa_family) { #ifdef INET case AF_INET: if (asoc->scope.ipv4_addr_legal) { - check_src = 1; + check_src = true; } break; #endif #ifdef INET6 case AF_INET6: if (asoc->scope.ipv6_addr_legal) { - check_src = 1; + check_src = true; } break; #endif @@ -5289,7 +5291,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, break; } if (check_src) { - fnd = 0; + fnd = false; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sa = (struct sockaddr *)&net->ro._l_addr; if (sa->sa_family == src->sa_family) { @@ -5300,7 +5302,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa4 = (struct sockaddr_in *)sa; src4 = (struct sockaddr_in *)src; if (sa4->sin_addr.s_addr == src4->sin_addr.s_addr) { - fnd = 1; + fnd = true; break; } } @@ -5312,16 +5314,22 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa6 = (struct sockaddr_in6 *)sa; src6 = (struct sockaddr_in6 *)src; if (SCTP6_ARE_ADDR_EQUAL(sa6, src6)) { - fnd = 1; + fnd = true; break; } } #endif } } - if (fnd == 0) { - /* New address added! no need to look further. */ - return (1); + if (!fnd) { + /* + * If sending an ABORT in case of an additional + * address, don't use the new address error cause. + * This looks no different than if no listener was + * present. + */ + *op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); + return (true); } } /* Ok so far lets munge through the rest of the packet */ @@ -5331,6 +5339,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa_touse = NULL; ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); + if (offset + plen > limit) { + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Partial parameter"); + return (true); + } + if (plen < sizeof(struct sctp_paramhdr)) { + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length too small"); + return (true); + } switch (ptype) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -5338,12 +5354,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, struct sctp_ipv4addr_param *p4, p4_buf; if (plen != sizeof(struct sctp_ipv4addr_param)) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length illegal"); + return (true); } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p4_buf, sizeof(p4_buf)); if (phdr == NULL) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); + return (true); } if (asoc->scope.ipv4_addr_legal) { p4 = (struct sctp_ipv4addr_param *)phdr; @@ -5359,12 +5377,14 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, struct sctp_ipv6addr_param *p6, p6_buf; if (plen != sizeof(struct sctp_ipv6addr_param)) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "Parameter length illegal"); + return (true); } phdr = sctp_get_next_param(in_initpkt, offset, (struct sctp_paramhdr *)&p6_buf, sizeof(p6_buf)); if (phdr == NULL) { - return (1); + *op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); + return (true); } if (asoc->scope.ipv6_addr_legal) { p6 = (struct sctp_ipv6addr_param *)phdr; @@ -5381,7 +5401,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, } if (sa_touse) { /* ok, sa_touse points to one to check */ - fnd = 0; + fnd = false; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sa = (struct sockaddr *)&net->ro._l_addr; if (sa->sa_family != sa_touse->sa_family) { @@ -5392,7 +5412,7 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa4 = (struct sockaddr_in *)sa; if (sa4->sin_addr.s_addr == sin4.sin_addr.s_addr) { - fnd = 1; + fnd = true; break; } } @@ -5402,21 +5422,31 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, sa6 = (struct sockaddr_in6 *)sa; if (SCTP6_ARE_ADDR_EQUAL( sa6, &sin6)) { - fnd = 1; + fnd = true; break; } } #endif } if (!fnd) { - /* New addr added! no need to look further */ - return (1); + /* + * If sending an ABORT in case of an + * additional address, don't use the new + * address error cause. This looks no + * different than if no listener was + * present. + */ + *op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); + return (true); } } offset += SCTP_SIZE32(plen); + if (offset >= limit) { + break; + } phdr = sctp_get_next_param(in_initpkt, offset, ¶ms, sizeof(params)); } - return (0); + return (false); } /* @@ -5472,17 +5502,11 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, } if ((asoc != NULL) && (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT)) { - if (sctp_are_there_new_addresses(asoc, init_pkt, offset, src)) { + if (sctp_are_there_new_addresses(asoc, init_pkt, offset, offset + ntohs(init_chk->ch.chunk_length), src, &op_err)) { /* * new addresses, out of here in non-cookie-wait * states - * - * Send an ABORT, without the new address error - * cause. This looks no different than if no - * listener was present. */ - op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), - "Address added"); sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err, mflowtype, mflowid, inp->fibnum, vrf_id, port); @@ -12136,18 +12160,27 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb, stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 0, 1); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); - stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; - stcb->asoc.strmout[i].next_mid_ordered = oldstream[i].next_mid_ordered; - stcb->asoc.strmout[i].next_mid_unordered = oldstream[i].next_mid_unordered; - stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; - stcb->asoc.strmout[i].sid = i; - stcb->asoc.strmout[i].state = oldstream[i].state; /* FIX ME FIX ME */ /* * This should be a SS_COPY operation FIX ME STREAM * SCHEDULER EXPERT */ stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], &oldstream[i]); + stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; +#if defined(SCTP_DETAILED_STR_STATS) + for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { + stcb->asoc.strmout[i].abandoned_sent[j] = oldstream[i].abandoned_sent[j]; + stcb->asoc.strmout[i].abandoned_unsent[j] = oldstream[i].abandoned_unsent[j]; + } +#else + stcb->asoc.strmout[i].abandoned_sent[0] = oldstream[i].abandoned_sent[0]; + stcb->asoc.strmout[i].abandoned_unsent[0] = oldstream[i].abandoned_unsent[0]; +#endif + stcb->asoc.strmout[i].next_mid_ordered = oldstream[i].next_mid_ordered; + stcb->asoc.strmout[i].next_mid_unordered = oldstream[i].next_mid_unordered; + stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; + stcb->asoc.strmout[i].sid = i; + stcb->asoc.strmout[i].state = oldstream[i].state; /* now anything on those queues? */ TAILQ_FOREACH_SAFE(sp, &oldstream[i].outqueue, next, nsp) { TAILQ_REMOVE(&oldstream[i].outqueue, sp, next); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2e082570cfc1..4d09ad3a7353 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4443,6 +4443,10 @@ out: /* Clear net */ asoc->last_control_chunk_from = NULL; } + if (net == asoc->last_net_cmt_send_started) { + /* Clear net */ + asoc->last_net_cmt_send_started = NULL; + } if (net == stcb->asoc.alternate) { sctp_free_remote_addr(stcb->asoc.alternate); stcb->asoc.alternate = NULL; diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h index 52fe30098ad7..a22dac047971 100644 --- a/sys/netinet/sctp_structs.h +++ b/sys/netinet/sctp_structs.h @@ -548,6 +548,20 @@ struct sctp_stream_in { TAILQ_HEAD(sctpwheel_listhead, sctp_stream_out); TAILQ_HEAD(sctplist_listhead, sctp_stream_queue_pending); +/* + * This union holds all data necessary for + * different stream schedulers. + */ +struct scheduling_data { + struct sctp_stream_out *locked_on_sending; + /* circular looking for output selection */ + struct sctp_stream_out *last_out_stream; + union { + struct sctpwheel_listhead wheel; + struct sctplist_listhead list; + } out; +}; + /* Round-robin schedulers */ struct ss_rr { /* next link in wheel */ @@ -570,20 +584,6 @@ struct ss_fb { int32_t rounds; }; -/* - * This union holds all data necessary for - * different stream schedulers. - */ -struct scheduling_data { - struct sctp_stream_out *locked_on_sending; - /* circular looking for output selection */ - struct sctp_stream_out *last_out_stream; - union { - struct sctpwheel_listhead wheel; - struct sctplist_listhead list; - } out; -}; - /* * This union holds all parameters per stream * necessary for different stream schedulers. @@ -601,8 +601,6 @@ union scheduling_parameters { #define SCTP_STREAM_RESET_PENDING 0x03 #define SCTP_STREAM_RESET_IN_FLIGHT 0x04 -#define SCTP_MAX_STREAMS_AT_ONCE_RESET 200 - /* This struct is used to track the traffic on outbound streams */ struct sctp_stream_out { struct sctp_streamhead outqueue; @@ -627,6 +625,8 @@ struct sctp_stream_out { uint8_t state; }; +#define SCTP_MAX_STREAMS_AT_ONCE_RESET 200 + /* used to keep track of the addresses yet to try to add/delete */ TAILQ_HEAD(sctp_asconf_addrhead, sctp_asconf_addr); struct sctp_asconf_addr { diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index bce1f5cd166d..582abd8e8854 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -164,8 +164,8 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, } /* - * sctp_find_alternate_net() returns a non-NULL pointer as long - * the argument net is non-NULL. + * sctp_find_alternate_net() returns a non-NULL pointer as long as there + * exists nets, which are not being deleted. */ struct sctp_nets * sctp_find_alternate_net(struct sctp_tcb *stcb, @@ -174,14 +174,14 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, { /* Find and return an alternate network if possible */ struct sctp_nets *alt, *mnet, *min_errors_net = NULL, *max_cwnd_net = NULL; - int once; + bool looped; /* JRS 5/14/07 - Initialize min_errors to an impossible value. */ int min_errors = -1; uint32_t max_cwnd = 0; if (stcb->asoc.numnets == 1) { - /* No others but net */ + /* No selection can be made. */ return (TAILQ_FIRST(&stcb->asoc.nets)); } /* @@ -328,25 +328,22 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, return (max_cwnd_net); } } - mnet = net; - once = 0; - - if (mnet == NULL) { - mnet = TAILQ_FIRST(&stcb->asoc.nets); - if (mnet == NULL) { - return (NULL); - } + /* Look for an alternate net, which is active. */ + if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { + alt = TAILQ_NEXT(net, sctp_next);; + } else { + alt = TAILQ_FIRST(&stcb->asoc.nets); } + looped = false; for (;;) { - alt = TAILQ_NEXT(mnet, sctp_next); if (alt == NULL) { - once++; - if (once > 1) { - break; + if (!looped) { + alt = TAILQ_FIRST(&stcb->asoc.nets); + looped = true; } - alt = TAILQ_FIRST(&stcb->asoc.nets); + /* Definitely out of candidates. */ if (alt == NULL) { - return (NULL); + break; } } if (alt->ro.ro_nh == NULL) { @@ -358,43 +355,59 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, } if (((alt->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE) && (alt->ro.ro_nh != NULL) && - (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED))) { - /* Found a reachable address */ + (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) && + (alt != net)) { + /* Found an alternate net, which is reachable. */ break; } - mnet = alt; + alt = TAILQ_NEXT(alt, sctp_next); } if (alt == NULL) { - /* Case where NO insv network exists (dormant state) */ - /* we rotate destinations */ - once = 0; - mnet = net; + /* + * In case no active alternate net has been found, look for + * an alternate net, which is confirmed. + */ + if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { + alt = TAILQ_NEXT(net, sctp_next);; + } else { + alt = TAILQ_FIRST(&stcb->asoc.nets); + } + looped = false; for (;;) { - if (mnet == NULL) { - return (TAILQ_FIRST(&stcb->asoc.nets)); - } - alt = TAILQ_NEXT(mnet, sctp_next); if (alt == NULL) { - once++; - if (once > 1) { - break; + if (!looped) { + alt = TAILQ_FIRST(&stcb->asoc.nets); + looped = true; } - alt = TAILQ_FIRST(&stcb->asoc.nets); + /* Definitely out of candidates. */ if (alt == NULL) { break; } } if ((!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) && (alt != net)) { - /* Found an alternate address */ + /* + * Found an alternate net, which is + * confirmed. + */ break; } - mnet = alt; + alt = TAILQ_NEXT(alt, sctp_next); } } if (alt == NULL) { - return (net); + /* + * In case no confirmed alternate net has been found, just + * return net, if it is not being deleted. In the other case + * just return the first net. + */ + if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { + alt = net; + } + if (alt == NULL) { + alt = TAILQ_FIRST(&stcb->asoc.nets); + } } return (alt); } diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 7772ebd57327..7ddb4c3710df 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1291,9 +1291,8 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, * that were dropped must be notified to the upper layer as * failed to send. */ - asoc->strmout[i].next_mid_ordered = 0; - asoc->strmout[i].next_mid_unordered = 0; TAILQ_INIT(&asoc->strmout[i].outqueue); + asoc->ss_functions.sctp_ss_init_stream(stcb, &asoc->strmout[i], NULL); asoc->strmout[i].chunks_on_queues = 0; #if defined(SCTP_DETAILED_STR_STATS) for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { @@ -1304,10 +1303,11 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, asoc->strmout[i].abandoned_sent[0] = 0; asoc->strmout[i].abandoned_unsent[0] = 0; #endif + asoc->strmout[i].next_mid_ordered = 0; + asoc->strmout[i].next_mid_unordered = 0; asoc->strmout[i].sid = i; asoc->strmout[i].last_msg_incomplete = 0; asoc->strmout[i].state = SCTP_STREAM_OPENING; - asoc->ss_functions.sctp_ss_init_stream(stcb, &asoc->strmout[i], NULL); } asoc->ss_functions.sctp_ss_init(stcb, asoc, 0); @@ -2032,14 +2032,13 @@ sctp_timeout_handler(void *t) sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_FROM_INPKILL_TIMER); inp = NULL; - goto out_no_decr; + goto out_decr; case SCTP_TIMER_TYPE_ASOCKILL: KASSERT(inp != NULL && stcb != NULL && net == NULL, ("timeout of type %d: inp = %p, stcb = %p, net = %p", type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timoassockill); /* Can we free it yet? */ - SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1); (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, @@ -2049,7 +2048,7 @@ sctp_timeout_handler(void *t) * duplicate unlock or unlock of a free mtx :-0 */ stcb = NULL; - goto out_no_decr; + goto out_decr; case SCTP_TIMER_TYPE_ADDR_WQ: KASSERT(inp == NULL && stcb == NULL && net == NULL, ("timeout of type %d: inp = %p, stcb = %p, net = %p", @@ -2107,7 +2106,6 @@ out_decr: if (net != NULL) { sctp_free_remote_addr(net); } -out_no_decr: SCTPDBG(SCTP_DEBUG_TIMER2, "Timer type %d handler finished.\n", type); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); @@ -2279,14 +2277,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } rndval = sctp_select_initial_TSN(&inp->sctp_ep); jitter = rndval % to_ticks; - if (jitter >= (to_ticks >> 1)) { - to_ticks = to_ticks + (jitter - (to_ticks >> 1)); + to_ticks >>= 1; + if (jitter < (UINT32_MAX - to_ticks)) { + to_ticks += jitter; } else { - to_ticks = to_ticks - jitter; + to_ticks = UINT32_MAX; } if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) && !(net->dest_state & SCTP_ADDR_PF)) { - to_ticks += net->heart_beat_delay; + if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) { + to_ticks += net->heart_beat_delay; + } else { + to_ticks = UINT32_MAX; + } } /* * Now we must convert the to_ticks that are now in ms to From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:22:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8466F54AE4B; Tue, 2 Mar 2021 18:22: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 4Dqlpv3Nnnz4q39; Tue, 2 Mar 2021 18:22: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 672371B79F; Tue, 2 Mar 2021 18:22: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 122IMVnD091714; Tue, 2 Mar 2021 18:22:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IMVDY091713; Tue, 2 Mar 2021 18:22:31 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:22:31 GMT Message-Id: <202103021822.122IMVDY091713@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: 600756afb532 - main - fhlink(2): the syscalls do not take flag 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: 600756afb532a86a39fb488f5c4fc7e248921655 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:22:31 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=600756afb532a86a39fb488f5c4fc7e248921655 commit 600756afb532a86a39fb488f5c4fc7e248921655 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:38:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 18:16:55 +0000 fhlink(2): the syscalls do not take flag Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D28907 --- lib/libc/sys/fhlink.2 | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/lib/libc/sys/fhlink.2 b/lib/libc/sys/fhlink.2 index da35d2b103e6..029ec8d7c2eb 100644 --- a/lib/libc/sys/fhlink.2 +++ b/lib/libc/sys/fhlink.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt FHLINK 2 .Os .Sh NAME @@ -95,33 +95,6 @@ the directory associated with the file descriptor .Fa tofd instead of the current working directory. .Pp -Values for -.Fa flag -are constructed by a bitwise-inclusive OR of flags from the following -list, defined in -.In fcntl.h : -.Bl -tag -width indent -.It Dv AT_SYMLINK_FOLLOW -If -.Fa fhp -names a symbolic link, a new link for the target of the symbolic link is -created. -.It Dv AT_BENEATH -Only allow to link to a file which is beneath of the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. -.It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. -See the description of the -.Dv O_RESOLVE_BENEATH -flag in the -.Xr open 2 -manual page. -.El -.Pp If .Fn fhlinkat is passed the special value From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:22:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A78CB54AAD2; Tue, 2 Mar 2021 18:22: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 4Dqlpw4DM2z4qGc; Tue, 2 Mar 2021 18:22: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 83F351B6A0; Tue, 2 Mar 2021 18:22: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 122IMWHl091736; Tue, 2 Mar 2021 18:22:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IMWIE091735; Tue, 2 Mar 2021 18:22:32 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:22:32 GMT Message-Id: <202103021822.122IMWIE091735@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: 20e91ca36a56 - main - open(2): Remove O_BENEATH and AT_BENEATH 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: 20e91ca36a56b8db1e6677f577ad011b66dd6eb3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:22:32 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=20e91ca36a56b8db1e6677f577ad011b66dd6eb3 commit 20e91ca36a56b8db1e6677f577ad011b66dd6eb3 Author: Konstantin Belousov AuthorDate: 2021-02-16 03:31:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 18:16:55 +0000 open(2): Remove O_BENEATH and AT_BENEATH with the reasoning that the flags did not worked properly, and were not shipped in a release. O_RESOLVE_BENEATH is kept as useful. Reviewed by: markj Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D28907 --- lib/libc/sys/access.2 | 24 +++------------ lib/libc/sys/chflags.2 | 29 +++++------------- lib/libc/sys/chmod.2 | 29 +++++------------- lib/libc/sys/chown.2 | 29 +++++------------- lib/libc/sys/getfh.2 | 37 +++++------------------ lib/libc/sys/link.2 | 28 +++++------------ lib/libc/sys/open.2 | 77 ++++++++--------------------------------------- lib/libc/sys/stat.2 | 50 +++++-------------------------- lib/libc/sys/unlink.2 | 29 +++++------------- lib/libc/sys/utimensat.2 | 29 +++++------------- sys/kern/vfs_lookup.c | 78 +++++++----------------------------------------- sys/kern/vfs_syscalls.c | 51 +++++++++++++------------------ sys/kern/vfs_vnops.c | 2 -- sys/sys/fcntl.h | 14 ++++----- sys/sys/namei.h | 5 ---- 15 files changed, 112 insertions(+), 399 deletions(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 1cd7eed1301b..13bfd7e5a88a 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt ACCESS 2 .Os .Sh NAME @@ -120,15 +120,10 @@ list, defined in The checks for accessibility are performed using the effective user and group IDs instead of the real user and group ID as required in a call to .Fn access . -.It Dv AT_BENEATH -Only operate on files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -218,17 +213,6 @@ or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn faccessat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. .El .Sh SEE ALSO .Xr chmod 2 , diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index b6b0b43249c7..a44713904599 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHFLAGS 2 .Os .Sh NAME @@ -94,16 +94,10 @@ defined in If .Fa path names a symbolic link, then the flags of the symbolic link are changed. -.It Dv AT_BENEATH -Only allow to change flags for a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -327,18 +321,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn chflagsat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 1 , diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2 index 1d66408e3891..0127a5b629e4 100644 --- a/lib/libc/sys/chmod.2 +++ b/lib/libc/sys/chmod.2 @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHMOD 2 .Os .Sh NAME @@ -101,16 +101,10 @@ in If .Fa path names a symbolic link, then the mode of the symbolic link is changed. -.It Dv AT_BENEATH -Only allow to change permissions of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -310,18 +304,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fchmodat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chmod 1 , diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2 index 64bfdeaa961c..4c45ce9174bb 100644 --- a/lib/libc/sys/chown.2 +++ b/lib/libc/sys/chown.2 @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHOWN 2 .Os .Sh NAME @@ -118,16 +118,10 @@ list, defined in If .Fa path names a symbolic link, ownership of the symbolic link is changed. -.It Dv AT_BENEATH -Only allow to change ownership of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -252,18 +246,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fchownat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chgrp 1 , diff --git a/lib/libc/sys/getfh.2 b/lib/libc/sys/getfh.2 index 5dc5896af6d8..cd3d54f54d7f 100644 --- a/lib/libc/sys/getfh.2 +++ b/lib/libc/sys/getfh.2 @@ -29,7 +29,7 @@ .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt GETFH 2 .Os .Sh NAME @@ -76,9 +76,7 @@ and .Fn lgetfh except when the .Fa path -specifies a relative path, or the -.Dv AT_BENEATH -flag is provided. +specifies a relative path. For .Fn getfhat and relative @@ -87,13 +85,6 @@ the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. -For -.Dv AT_BENEATH -and absolute -.Fa path , -the status is retrieved from a file specified by the -.Fa path , -but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -105,15 +96,10 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. -.It Dv AT_BENEATH -Only stat files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -140,19 +126,10 @@ bit is set in When .Fn getfhat is called with an absolute -.Fa path -without the -.Dv AT_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv AT_BENEATH -is specified with an absolute .Fa path , -a directory passed by the +it ignores the .Fa fd -argument is used as the topping point for the resolution. +argument. These system calls are restricted to the superuser. .Sh RETURN VALUES .Rv -std diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index c3451da10884..de0efd5e510f 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt LINK 2 .Os .Sh NAME @@ -115,15 +115,10 @@ If .Fa name1 names a symbolic link, a new link for the target of the symbolic link is created. -.It Dv AT_BENEATH -Only allow to link to a file which is beneath of the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -281,18 +276,9 @@ For example, is absolute or includes a ".." component that escapes the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fa linkat -and the absolute path -.Fa name1 -does not have its tail fully contained under the topping directory, -or the relative path -.Fa name1 -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 2 , diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index e43d012770df..e24c823d039a 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt OPEN 2 .Os .Sh NAME @@ -75,9 +75,7 @@ function is equivalent to the .Fn open function except in the case where the .Fa path -specifies a relative path, or the -.Dv O_BENEATH -flag is provided. +specifies a relative path. For .Fn openat and relative @@ -104,28 +102,10 @@ and the behavior is identical to a call to When .Fn openat is called with an absolute -.Fa path -without the -.Dv O_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv O_BENEATH -is specified with an absolute .Fa path , -a directory passed by the -.Fa fd -argument is used as the topping point for the resolution. -When -.Dv O_BENEATH -is specified with a relative path, the +it ignores the .Fa fd -argument is used both as the starting point, and as the topping point -for the resolution. -See the definition of the -.Dv O_BENEATH -flag below. +argument. .Pp In .Xr capsicum 4 @@ -137,9 +117,7 @@ The argument to .Fn openat must be strictly relative to a file descriptor -.Fa fd , -as defined in -.Pa sys/kern/vfs_lookup.c . +.Fa fd . .Fa path must not be an absolute path and must not contain ".." components which cause the path resolution to escape the directory hierarchy @@ -156,9 +134,8 @@ If the .Dv vfs.lookup_cap_dotdot .Xr sysctl 3 MIB is set to zero, ".." components in the paths, -used in capability mode, or with the -.Dv O_BENEATH -flag, are completely disabled. +used in capability mode, +are completely disabled. If the .Dv vfs.lookup_cap_dotdot_nonlocal MIB is set to zero, ".." is not allowed if found on non-local filesystem. @@ -190,8 +167,7 @@ O_TTY_INIT ignored O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open O_VERIFY verify the contents of the file -O_BENEATH require resolved path to be strictly relative to topping directory -O_RESOLVE_BENEATH require walked path to be strictly relative to topping directory +O_RESOLVE_BENEATH path resolution must not cross the fd directory .Ed .Pp Opening a file with @@ -319,32 +295,12 @@ means is implementation specific. The run-time linker (rtld) uses this flag to ensure shared objects have been verified before operating on them. .Pp -.Dv O_BENEATH -returns -.Er ENOTCAPABLE -if the specified path, after resolving all symlinks and ".." -references, does not end up with tail residing in the directory hierarchy of -children beneath the topping directory. -Topping directory is the process current directory if relative -.Fa path -is used for -.Fn open , -and the directory referenced by the -.Fa fd -argument when using -.Fn openat . -.Dv O_BENEATH -allows arbitrary prefix that ends up at the topping directory, -after which all further resolved components must be under it. -.Pp .Dv O_RESOLVE_BENEATH returns .Er ENOTCAPABLE if any intermediate component of the specified relative path does not -reside in the directory hierarchy beneath the topping directory. -Comparing to -.Dv O_BENEATH , -absolute paths or even the temporal escape from beneath of the topping +reside in the directory hierarchy beneath the starting directory. +Absolute paths or even the temporal escape from beneath of the starting directory is not allowed. .Pp When @@ -601,19 +557,12 @@ directory outside of the directory hierarchy specified by and the process is in capability mode. .It Bq Er ENOTCAPABLE The -.Dv O_BENEATH -flag was provided, and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. -.It Bq Er ENOTCAPABLE -The .Dv O_RESOLVE_BENEATH flag was provided, and the relative .Fa path -escapes topping directory. +escapes the +.Ar fd +directory. .El .Sh SEE ALSO .Xr chmod 2 , diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2 index 4759d297e8da..0ed70620af63 100644 --- a/lib/libc/sys/stat.2 +++ b/lib/libc/sys/stat.2 @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt STAT 2 .Os .Sh NAME @@ -84,9 +84,7 @@ and .Fn lstat except when the .Fa path -specifies a relative path, or the -.Dv AT_BENEATH -flag is provided. +specifies a relative path. For .Fn fstatat and relative @@ -95,13 +93,6 @@ the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. -For -.Dv AT_BENEATH -and absolute -.Fa path , -the status is retrieved from a file specified by the -.Fa path , -but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -113,15 +104,8 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. -.It Dv AT_BENEATH -Only stat files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the starting directory. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -148,19 +132,10 @@ bit is set in When .Fn fstatat is called with an absolute -.Fa path -without the -.Dv AT_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv AT_BENEATH -is specified with an absolute .Fa path , -a directory passed by the +it ignores the .Fa fd -argument is used as the topping point for the resolution. +argument. .Pp The .Fa sb @@ -459,18 +434,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fstatat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr access 2 , diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2 index 838d4da68af2..11fff875abad 100644 --- a/lib/libc/sys/unlink.2 +++ b/lib/libc/sys/unlink.2 @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt UNLINK 2 .Os .Sh NAME @@ -92,16 +92,10 @@ Remove the directory entry specified by and .Fa path as a directory, not a normal file. -.It Dv AT_BENEATH -Only unlink files and directories which are beneath of the topping -directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -246,18 +240,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn unlinkat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Pp In addition to the errors returned by diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2 index 3016d1af72aa..d31ee1f1515a 100644 --- a/lib/libc/sys/utimensat.2 +++ b/lib/libc/sys/utimensat.2 @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -146,16 +146,10 @@ names a symbolic link, the symbolic link's times are changed. By default, .Fn utimensat changes the times of the file referenced by the symbolic link. -.It Dv AT_BENEATH -Only allow to change the times of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -290,18 +284,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn utimensat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 2 , diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index ad65ab11bb1d..4ddd7b63ce5c 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -182,13 +182,6 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; cnp = &ndp->ni_cnd; - if ((cnp->cn_flags & BENEATH) != 0 && - (ndp->ni_lcf & NI_LCF_BENEATH_LATCHED) == 0) { - MPASS((ndp->ni_lcf & NI_LCF_LATCH) != 0); - if (dp != ndp->ni_beneath_latch) - return; - ndp->ni_lcf |= NI_LCF_BENEATH_LATCHED; - } nt = malloc(sizeof(*nt), M_NAMEITRACKER, M_WAITOK); vhold(dp); nt->dp = dp; @@ -196,7 +189,7 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) } static void -nameicap_cleanup(struct nameidata *ndp, bool clean_latch) +nameicap_cleanup(struct nameidata *ndp) { struct nameicap_tracker *nt, *nt1; @@ -207,10 +200,6 @@ nameicap_cleanup(struct nameidata *ndp, bool clean_latch) vdrop(nt->dp); free(nt, M_NAMEITRACKER); } - if (clean_latch && (ndp->ni_lcf & NI_LCF_LATCH) != 0) { - ndp->ni_lcf &= ~NI_LCF_LATCH; - vrele(ndp->ni_beneath_latch); - } } /* @@ -230,21 +219,17 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) struct nameicap_tracker *nt; struct mount *mp; - if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp == NULL || - dp->v_type != VDIR) + if (dp == NULL || dp->v_type != VDIR || (ndp->ni_lcf & + NI_LCF_STRICTRELATIVE) == 0) return (0); + if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0) + return (ENOTCAPABLE); mp = dp->v_mount; if (lookup_cap_dotdot_nonlocal == 0 && mp != NULL && (mp->mnt_flag & MNT_LOCAL) == 0) return (ENOTCAPABLE); TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { - if ((ndp->ni_lcf & NI_LCF_LATCH) != 0 && - ndp->ni_beneath_latch == nt->dp) { - ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; - nameicap_cleanup(ndp, false); - return (0); - } if (dp == nt->dp) return (0); } @@ -275,11 +260,6 @@ namei_handle_root(struct nameidata *ndp, struct vnode **dpp) #endif return (ENOTCAPABLE); } - if ((cnp->cn_flags & BENEATH) != 0) { - ndp->ni_lcf |= NI_LCF_BENEATH_ABS; - ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; - nameicap_cleanup(ndp, false); - } while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; @@ -297,7 +277,6 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) struct thread *td; struct pwd *pwd; cap_rights_t rights; - struct filecaps dirfd_caps; int error; bool startdir_used; @@ -410,26 +389,8 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) if (error == 0 && (*dpp)->v_type != VDIR) error = ENOTDIR; } - if (error == 0 && (cnp->cn_flags & BENEATH) != 0) { - if (ndp->ni_dirfd == AT_FDCWD) { - ndp->ni_beneath_latch = pwd->pwd_cdir; - vrefact(ndp->ni_beneath_latch); - } else { - rights = *ndp->ni_rightsneeded; - cap_rights_set_one(&rights, CAP_LOOKUP); - error = fgetvp_rights(td, ndp->ni_dirfd, &rights, - &dirfd_caps, &ndp->ni_beneath_latch); - if (error == 0 && (*dpp)->v_type != VDIR) { - vrele(ndp->ni_beneath_latch); - error = ENOTDIR; - } - } - if (error == 0) - ndp->ni_lcf |= NI_LCF_LATCH; - } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { - if (cnp->cn_pnbuf[0] == '/' || - (ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) { + if (cnp->cn_pnbuf[0] == '/') { error = EINVAL; } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | @@ -452,12 +413,8 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) pwd_drop(pwd); return (error); } - MPASS((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_LATCH)) != - NI_LCF_BENEATH_ABS); - if (((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && - lookup_cap_dotdot != 0) || - ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0 && - (cnp->cn_flags & BENEATH) != 0)) + if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && + lookup_cap_dotdot != 0) ndp->ni_lcf |= NI_LCF_CAP_DOTDOT; SDT_PROBE4(vfs, namei, lookup, entry, *dpp, cnp->cn_pnbuf, cnp->cn_flags, false); @@ -636,16 +593,8 @@ namei(struct nameidata *ndp) for (;;) { ndp->ni_startdir = dp; error = lookup(ndp); - if (error != 0) { - /* - * Override an error to not allow user to use - * BENEATH as an oracle. - */ - if ((ndp->ni_lcf & (NI_LCF_LATCH | - NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) - error = ENOTCAPABLE; + if (error != 0) goto out; - } /* * If not a symbolic link, we're done. @@ -657,12 +606,7 @@ namei(struct nameidata *ndp) namei_cleanup_cnp(cnp); } else cnp->cn_flags |= HASBUF; - if ((ndp->ni_lcf & (NI_LCF_LATCH | - NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) { - NDFREE(ndp, 0); - error = ENOTCAPABLE; - } - nameicap_cleanup(ndp, true); + nameicap_cleanup(ndp); pwd_drop(pwd); if (error == 0) NDVALIDATE(ndp); @@ -739,7 +683,7 @@ out: MPASS(error != 0); SDT_PROBE4(vfs, namei, lookup, return, error, NULL, false, ndp); namei_cleanup_cnp(cnp); - nameicap_cleanup(ndp, true); + nameicap_cleanup(ndp); pwd_drop(pwd); return (error); } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 11fcc7a3e10d..fec9566cb415 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -120,8 +120,6 @@ at2cnpflags(u_int at_flags, u_int mask) res = 0; at_flags &= mask; - if ((at_flags & AT_BENEATH) != 0) - res |= BENEATH; if ((at_flags & AT_RESOLVE_BENEATH) != 0) res |= RBENEATH; if ((at_flags & AT_SYMLINK_FOLLOW) != 0) @@ -1498,12 +1496,11 @@ sys_linkat(struct thread *td, struct linkat_args *uap) int flag; flag = uap->flag; - if ((flag & ~(AT_SYMLINK_FOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2, - UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_BENEATH | + UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH))); } @@ -1873,7 +1870,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | - at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH), + at2cnpflags(flag, AT_RESOLVE_BENEATH), pathseg, path, dfd, &cap_unlinkat_rights, td); if ((error = namei(&nd)) != 0) { if (error == EINVAL) @@ -2078,7 +2075,7 @@ kern_accessat(struct thread *td, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_EACCESS | AT_BENEATH | AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_EACCESS | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) return (EINVAL); @@ -2099,7 +2096,7 @@ kern_accessat(struct thread *td, int fd, const char *path, usecred = cred; AUDIT_ARG_VALUE(amode); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1 | at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH), + AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH), pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) goto out; @@ -2390,13 +2387,12 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); - NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_BENEATH | - AT_RESOLVE_BENEATH | AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_RESOLVE_BENEATH | + AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, + pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) return (error); @@ -2714,8 +2710,7 @@ int sys_chflagsat(struct thread *td, struct chflagsat_args *uap) { *** 176 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:22:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 102E954AE54; Tue, 2 Mar 2021 18:22: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 4Dqlpy6cq1z4q5p; Tue, 2 Mar 2021 18:22: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 C996E1B4BC; Tue, 2 Mar 2021 18:22: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 122IMYYE091777; Tue, 2 Mar 2021 18:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IMYRK091776; Tue, 2 Mar 2021 18:22:34 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:22:34 GMT Message-Id: <202103021822.122IMYRK091776@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: 2388ad7c293f - main - nameicap_tracker_add: avoid duplicates in the tracker list 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: 2388ad7c293fbc89ee239a1adcb87fd158c4e8e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:22:35 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2388ad7c293fbc89ee239a1adcb87fd158c4e8e9 commit 2388ad7c293fbc89ee239a1adcb87fd158c4e8e9 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:13:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 18:21:23 +0000 nameicap_tracker_add: avoid duplicates in the tracker list Reviewed by: markj Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D28907 --- sys/kern/vfs_lookup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 73290e8da05f..cdd4a914239f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -182,6 +182,9 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; cnp = &ndp->ni_cnd; + nt = TAILQ_LAST(&ndp->ni_cap_tracker, nameicap_tracker_head); + if (nt != NULL && nt->dp == dp) + return; nt = malloc(sizeof(*nt), M_NAMEITRACKER, M_WAITOK); vhold(dp); nt->dp = dp; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:22:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB79154AD54; Tue, 2 Mar 2021 18:22: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 4Dqlpy3N4nz4pvq; Tue, 2 Mar 2021 18:22: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 C36D81B636; Tue, 2 Mar 2021 18:22:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122IMXVo091755; Tue, 2 Mar 2021 18:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IMXu9091754; Tue, 2 Mar 2021 18:22:33 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:22:33 GMT Message-Id: <202103021822.122IMXu9091754@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: 59e749428111 - main - Do not call nameicap_tracker_add() for dotdot case. 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: 59e749428111c029116a4302a544c7cc18b33772 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:22:35 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=59e749428111c029116a4302a544c7cc18b33772 commit 59e749428111c029116a4302a544c7cc18b33772 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:12:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 18:21:14 +0000 Do not call nameicap_tracker_add() for dotdot case. Reviewed by: markj Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D28907 --- sys/kern/vfs_lookup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 4ddd7b63ce5c..73290e8da05f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1258,7 +1258,8 @@ success: } } if (ndp->ni_vp != NULL) { - nameicap_tracker_add(ndp, ndp->ni_vp); + if ((cnp->cn_flags & ISDOTDOT) == 0) + nameicap_tracker_add(ndp, ndp->ni_vp); if ((cnp->cn_flags & (FAILIFEXISTS | ISSYMLINK)) == FAILIFEXISTS) goto bad_eexist; } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:22:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4870B54AE92; Tue, 2 Mar 2021 18:22: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 4Dqlq0119Kz4qH3; Tue, 2 Mar 2021 18:22: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 E27A91B90A; Tue, 2 Mar 2021 18:22: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 122IMZ2v091799; Tue, 2 Mar 2021 18:22:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IMZQT091798; Tue, 2 Mar 2021 18:22:35 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:22:35 GMT Message-Id: <202103021822.122IMZQT091798@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: e8a2862aa038 - main - Add nameicap_cleanup_from(), to clean tracker list starting from some element 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: e8a2862aa0384c75603f801625e309a3dae0ed05 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:22:36 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e8a2862aa0384c75603f801625e309a3dae0ed05 commit e8a2862aa0384c75603f801625e309a3dae0ed05 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:14:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 18:21:30 +0000 Add nameicap_cleanup_from(), to clean tracker list starting from some element Reviewed by: markj Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D28907 --- sys/kern/vfs_lookup.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index cdd4a914239f..abc01c73e24c 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -192,19 +192,26 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) } static void -nameicap_cleanup(struct nameidata *ndp) +nameicap_cleanup_from(struct nameidata *ndp, struct nameicap_tracker *first) { struct nameicap_tracker *nt, *nt1; - KASSERT(TAILQ_EMPTY(&ndp->ni_cap_tracker) || - (ndp->ni_lcf & NI_LCF_CAP_DOTDOT) != 0, ("not strictrelative")); - TAILQ_FOREACH_SAFE(nt, &ndp->ni_cap_tracker, nm_link, nt1) { + nt = first; + TAILQ_FOREACH_FROM_SAFE(nt, &ndp->ni_cap_tracker, nm_link, nt1) { TAILQ_REMOVE(&ndp->ni_cap_tracker, nt, nm_link); vdrop(nt->dp); free(nt, M_NAMEITRACKER); } } +static void +nameicap_cleanup(struct nameidata *ndp) +{ + KASSERT(TAILQ_EMPTY(&ndp->ni_cap_tracker) || + (ndp->ni_lcf & NI_LCF_CAP_DOTDOT) != 0, ("not strictrelative")); + nameicap_cleanup_from(ndp, NULL); +} + /* * For dotdot lookups in capability mode, only allow the component * lookup to succeed if the resulting directory was already traversed From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:22:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C76CE54B09B; Tue, 2 Mar 2021 18:22: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 4Dqlq12r1Tz4qKT; Tue, 2 Mar 2021 18:22: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 0FC991B637; Tue, 2 Mar 2021 18:22: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 122IMaL7091817; Tue, 2 Mar 2021 18:22:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IMaaK091816; Tue, 2 Mar 2021 18:22:36 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:22:36 GMT Message-Id: <202103021822.122IMaaK091816@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: 49c98a4bf3a8 - main - nameicap_check_dotdot: trim tracker on check 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: 49c98a4bf3a87ace0df99056fa683805c1645e61 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:22:38 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49c98a4bf3a87ace0df99056fa683805c1645e61 commit 49c98a4bf3a87ace0df99056fa683805c1645e61 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:15:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 18:21:35 +0000 nameicap_check_dotdot: trim tracker on check Tracker should contain exactly the path from the starting directory to the current lookup point. Otherwise we might not detect some cases of dotdot escape. Consequently, if we are walking up the tree by dotdot lookup, we must remove an entries below the walked directory. Reviewed by: markj Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D28907 --- sys/kern/vfs_lookup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index abc01c73e24c..b4280f85c5b6 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -240,8 +240,12 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) return (ENOTCAPABLE); TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { - if (dp == nt->dp) + if (dp == nt->dp) { + nt = TAILQ_NEXT(nt, nm_link); + if (nt != NULL) + nameicap_cleanup_from(ndp, nt); return (0); + } } return (ENOTCAPABLE); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:22:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB69454AE5F; Tue, 2 Mar 2021 18:22: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 4Dqlq23DCbz4qKY; Tue, 2 Mar 2021 18:22: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 310391B638; Tue, 2 Mar 2021 18:22: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 122IMc4i091839; Tue, 2 Mar 2021 18:22:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IMckR091838; Tue, 2 Mar 2021 18:22:38 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:22:38 GMT Message-Id: <202103021822.122IMckR091838@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: 28cd3a673e0e - main - O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path 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: 28cd3a673e0e32b009fd573764956b280d1affe1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:22:40 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=28cd3a673e0e32b009fd573764956b280d1affe1 commit 28cd3a673e0e32b009fd573764956b280d1affe1 Author: Konstantin Belousov AuthorDate: 2021-02-28 23:59:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-02 18:21:40 +0000 O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path Requested and reviewed by: markj Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28907 --- sys/kern/vfs_lookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b4280f85c5b6..e881e8f909a4 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -405,7 +405,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { if (cnp->cn_pnbuf[0] == '/') { - error = EINVAL; + error = ENOTCAPABLE; } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | NI_LCF_CAP_DOTDOT; From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:24:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A14D54B483; Tue, 2 Mar 2021 18:24:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqlrr70mnz4rD5; Tue, 2 Mar 2021 18:24:12 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 122IO54v047873; Tue, 2 Mar 2021 10:24:05 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 122IO5S4047872; Tue, 2 Mar 2021 10:24:05 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103021824.122IO5S4047872@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: <202103021650.122Go2nt061428@gitrepo.freebsd.org> To: Nathan Whitehorn Date: Tue, 2 Mar 2021 10:24:05 -0800 (PST) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Dqlrr70mnz4rD5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:24:13 -0000 > The branch main has been updated by nwhitehorn: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2c26d77d989abe48c662eeb6f52f7e4c9b81680c > > commit 2c26d77d989abe48c662eeb6f52f7e4c9b81680c > Author: Nathan Whitehorn > AuthorDate: 2021-03-02 16:47:00 +0000 > Commit: Nathan Whitehorn > CommitDate: 2021-03-02 16:49:41 +0000 > > Remove /boot/efi from mtree, missed in 0b7472b3d8d2. > > This had prevented the bootconfig step from determining if an ESP exists, > resulting in its unconditional setup. On BIOS-booted amd64, this wasn't > harmful, just unnecessary, but it resulted in failed installations on > non-EFI-supporting platforms like powerpc64. > > MFC after: 3 days We certainly must have a better way to detect EFI or not than the existance of /boot/efi???? I would of thought that machdep.bootmethod == EFI was the defanitive way to detect this? > --- > etc/mtree/BSD.root.dist | 2 -- > release/tools/arm.subr | 1 + > 2 files changed, 1 insertion(+), 2 deletions(-) > > diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist > index f734f7891429..1dc9e179b0fc 100644 > --- a/etc/mtree/BSD.root.dist > +++ b/etc/mtree/BSD.root.dist > @@ -18,8 +18,6 @@ > rockchip tags=package=runtime > .. > .. > - efi > - .. > firmware > .. > loader.conf.d tags=package=bootloader > diff --git a/release/tools/arm.subr b/release/tools/arm.subr > index 343d9f3a7034..2f91490c0859 100644 > --- a/release/tools/arm.subr > +++ b/release/tools/arm.subr > @@ -184,6 +184,7 @@ arm_install_base() { > TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ > DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ > ${CONF_FILES} installworld installkernel distribution > + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/efi > chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos > > arm_create_user > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:26:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFFDF54B2FB; Tue, 2 Mar 2021 18:26:43 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqlvl3dVlz4rFP; Tue, 2 Mar 2021 18:26:43 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 122IQfFT047889; Tue, 2 Mar 2021 10:26:41 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 122IQfMN047888; Tue, 2 Mar 2021 10:26:41 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103021826.122IQfMN047888@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: <202103021650.122Go2nt061428@gitrepo.freebsd.org> To: Nathan Whitehorn Date: Tue, 2 Mar 2021 10:26:41 -0800 (PST) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Dqlvl3dVlz4rFP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:26:43 -0000 > The branch main has been updated by nwhitehorn: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2c26d77d989abe48c662eeb6f52f7e4c9b81680c > > commit 2c26d77d989abe48c662eeb6f52f7e4c9b81680c > Author: Nathan Whitehorn > AuthorDate: 2021-03-02 16:47:00 +0000 > Commit: Nathan Whitehorn > CommitDate: 2021-03-02 16:49:41 +0000 > > Remove /boot/efi from mtree, missed in 0b7472b3d8d2. > > This had prevented the bootconfig step from determining if an ESP exists, > resulting in its unconditional setup. On BIOS-booted amd64, this wasn't > harmful, just unnecessary, but it resulted in failed installations on > non-EFI-supporting platforms like powerpc64. > > MFC after: 3 days > --- > etc/mtree/BSD.root.dist | 2 -- > release/tools/arm.subr | 1 + > 2 files changed, 1 insertion(+), 2 deletions(-) > > diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist > index f734f7891429..1dc9e179b0fc 100644 > --- a/etc/mtree/BSD.root.dist > +++ b/etc/mtree/BSD.root.dist > @@ -18,8 +18,6 @@ > rockchip tags=package=runtime > .. > .. > - efi > - .. > firmware > .. > loader.conf.d tags=package=bootloader > diff --git a/release/tools/arm.subr b/release/tools/arm.subr > index 343d9f3a7034..2f91490c0859 100644 > --- a/release/tools/arm.subr > +++ b/release/tools/arm.subr > @@ -184,6 +184,7 @@ arm_install_base() { > TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ > DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ > ${CONF_FILES} installworld installkernel distribution > + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/efi This fails to apply the proper owner/group and mode values using what ever defaults are in place of the process running the build. > chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos > > arm_create_user > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:28:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9357754B4BD; Tue, 2 Mar 2021 18:28: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 4Dqly13mNPz4rZb; Tue, 2 Mar 2021 18:28: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 749AE1B7A9; Tue, 2 Mar 2021 18:28: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 122ISf8K092874; Tue, 2 Mar 2021 18:28:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122ISf7D092873; Tue, 2 Mar 2021 18:28:41 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:28:41 GMT Message-Id: <202103021828.122ISf7D092873@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: 53a535c1d80a - main - Simplify the capsicum-test wrapper script 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: 53a535c1d80a2e5ea33a4e8807647e600402b1d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:28:41 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=53a535c1d80a2e5ea33a4e8807647e600402b1d8 commit 53a535c1d80a2e5ea33a4e8807647e600402b1d8 Author: Alex Richardson AuthorDate: 2021-03-02 18:27:34 +0000 Commit: Alex Richardson CommitDate: 2021-03-02 18:27:36 +0000 Simplify the capsicum-test wrapper script Instead of running tests one-by-one with the shell wrapper we now run the full gtest testsuite twice (once as root, once as non root). This significantly speeds up running tests despite running them twice. This change also passes the missing -u flag to capsicum-test that caused test failures (https://bugs.freebsd.org/250178) Previously, running the testsuite with the wrapper script took ~3s per test on aarch64 QEMU, i.e. a total of almost 5 minutes. Now it takes 6 seconds to run all tests twice. Before: root@freebsd-aarch64:/usr/tests/sys/capsicum # /usr/bin/time kyua test functional 94/96 passed (2 failed) 309.97 real 58.46 user 244.31 sys After: root@freebsd-aarch64:/usr/tests/sys/capsicum # /usr/bin/time kyua test functional functional:test_root -> passed [2.659s] functional:test_unprivileged -> passed [2.391s] 2/2 passed (0 failed) 5.48 real 1.06 user 2.52 sys This overhead is caused by kyua + atf-sh spawning lots of additional processes and can be avoided by just running the googletest test binary. syscall seconds calls errors fork 39.810229456 1275 0 sigprocmask 13.546928736 572 0 i.e. 1275 processes spawned to run a single test. Test Plan: All tests pass with D28907. PR: 250178 Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D29014 --- tests/sys/capsicum/functional.sh | 70 ++++++++++------------------------------ 1 file changed, 17 insertions(+), 53 deletions(-) diff --git a/tests/sys/capsicum/functional.sh b/tests/sys/capsicum/functional.sh index 6e11a9c4621a..0bd6b2d5e983 100755 --- a/tests/sys/capsicum/functional.sh +++ b/tests/sys/capsicum/functional.sh @@ -29,69 +29,33 @@ # # $FreeBSD$ -SRCDIR=$(atf_get_srcdir) CAPSICUM_TEST_BIN=capsicum-test -check() -{ - local tc=${1} +atf_test_case "test_root" +test_root_head() { - atf_check -s exit:0 -o match:PASSED -e ignore \ - ${SRCDIR}/${CAPSICUM_TEST_BIN} --gtest_filter=${tc} + atf_set descr 'Run capsicum-test as root' + atf_set require.user root } -skip() -{ - local reason=${1} - - atf_skip "${reason}" +test_root_body() { + atf_check -s exit:0 -o match:PASSED -e ignore \ + "$(atf_get_srcdir)/${CAPSICUM_TEST_BIN}" -u "$(id -u tests)" } -add_testcase() -{ - local tc=${1} - local tc_escaped word - - tc_escaped=$(echo ${tc} | sed -e 's/\./__/') - - atf_test_case ${tc_escaped} - - if [ "$(atf_config_get ci false)" = "true" ]; then - case "${tc_escaped}" in - ForkedOpenatTest_WithFlagInCapabilityMode___|OpenatTest__WithFlag) - eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/249960\"; }" - ;; - PipePdfork__WildcardWait) - eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/244165\"; }" - ;; - Capability__NoBypassDAC) - eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/250178\"; }" - ;; - Pdfork__OtherUserForked) - eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/250179\"; }" - ;; - *) - eval "${tc_escaped}_body() { check ${tc}; }" - ;; - esac - else - eval "${tc_escaped}_body() { check ${tc}; }" - fi +atf_test_case "test_unprivileged" +test_unprivileged_head() { - atf_add_test_case ${tc_escaped} + atf_set descr 'Run capsicum-test as an unprivileged user' + atf_set require.user unprivileged } -list_tests() -{ - ${SRCDIR}/${CAPSICUM_TEST_BIN} --gtest_list_tests | awk ' - /^[^ ]/ { CAT=$0 } - /^[ ]/ { print CAT $1}' +test_unprivileged_body() { + atf_check -s exit:0 -o match:PASSED -e ignore \ + "$(atf_get_srcdir)/${CAPSICUM_TEST_BIN}" -u "$(id -u)" } -atf_init_test_cases() -{ - local t - for t in `list_tests`; do - add_testcase $t - done +atf_init_test_cases() { + atf_add_test_case test_root + atf_add_test_case test_unprivileged } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:32:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A99C254B839; Tue, 2 Mar 2021 18:32:55 +0000 (UTC) (envelope-from nwhitehorn@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 4Dqm2v4S9Xz4sVZ; Tue, 2 Mar 2021 18:32:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:9508:6d03:14a7:a372]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 40D558E86; Tue, 2 Mar 2021 18:32:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103021824.122IO5S4047872@gndrsh.dnsmgr.net> From: Nathan Whitehorn Message-ID: Date: Tue, 2 Mar 2021 13:32:54 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <202103021824.122IO5S4047872@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:32:55 -0000 On 3/2/21 1:24 PM, Rodney W. Grimes wrote: >> The branch main has been updated by nwhitehorn: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=2c26d77d989abe48c662eeb6f52f7e4c9b81680c >> >> commit 2c26d77d989abe48c662eeb6f52f7e4c9b81680c >> Author: Nathan Whitehorn >> AuthorDate: 2021-03-02 16:47:00 +0000 >> Commit: Nathan Whitehorn >> CommitDate: 2021-03-02 16:49:41 +0000 >> >> Remove /boot/efi from mtree, missed in 0b7472b3d8d2. >> >> This had prevented the bootconfig step from determining if an ESP exists, >> resulting in its unconditional setup. On BIOS-booted amd64, this wasn't >> harmful, just unnecessary, but it resulted in failed installations on >> non-EFI-supporting platforms like powerpc64. >> >> MFC after: 3 days > We certainly must have a better way to detect EFI or not > than the existance of /boot/efi???? > > I would of thought that machdep.bootmethod == EFI was the > defanitive way to detect this? > This is about the installer talking to itself internally. That sysctl doesn't exist on many platforms, and the decision of whether to set up an ESP is a policy decision only loosely related to whether the current system booted by EFI or not. As the commit message notes, this is to detect whether an EFI System Partition exists and is configured, which is *not* the same thing as whether the system booted by EFI. As such, this is a more direct check. -Nathan From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:38:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B08AB54BC5F; Tue, 2 Mar 2021 18:38: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 4Dqm9D4bDDz4sqd; Tue, 2 Mar 2021 18:38: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 8BB331B6C1; Tue, 2 Mar 2021 18:38: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 122IcO3e005904; Tue, 2 Mar 2021 18:38:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IcOFr005903; Tue, 2 Mar 2021 18:38:24 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:38:24 GMT Message-Id: <202103021838.122IcOFr005903@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: c97304110a02 - main - tests/sys/audit: add missing comma delimiter between fields 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: c97304110a02f9c41b515e7b94d53229ab8f61af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:38:24 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c97304110a02f9c41b515e7b94d53229ab8f61af commit c97304110a02f9c41b515e7b94d53229ab8f61af Author: Alex Richardson AuthorDate: 2021-03-02 18:34:42 +0000 Commit: Alex Richardson CommitDate: 2021-03-02 18:37:12 +0000 tests/sys/audit: add missing comma delimiter between fields This makes the `kyua report --verbose` output a lot easier to parse when looking at failed tests. It also fixes the closefrom() test since I tested my changes with this commit but forgot to push it together with fa32350347b4e351a144b5423f0fb2ca9d67f4ca. Fixes: fa32350347b4 ("close_range: add audit support") --- tests/sys/audit/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/audit/utils.c b/tests/sys/audit/utils.c index e94279ff93bf..7b0c3445c253 100644 --- a/tests/sys/audit/utils.c +++ b/tests/sys/audit/utils.c @@ -79,6 +79,7 @@ get_records(const char *auditregex, FILE *pipestream) /* Print the tokens as they are obtained, in the default form */ au_print_flags_tok(memstream, &token, del, AU_OFLAG_NONE); + fputc(',', memstream); bytes += token.len; } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:43:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC0FD54C204; Tue, 2 Mar 2021 18:43: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 4DqmHJ4T33z4tPV; Tue, 2 Mar 2021 18:43: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 8C22E1BC62; Tue, 2 Mar 2021 18:43: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 122IheZk018699; Tue, 2 Mar 2021 18:43:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Iheaa018698; Tue, 2 Mar 2021 18:43:40 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:43:40 GMT Message-Id: <202103021843.122Iheaa018698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: e681d7d702d6 - stable/13 - msdosfs: fix double unlock if the source file disappears 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e681d7d702d65f7a44e3bb42e86e7a1784edf847 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:43:40 -0000 The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=e681d7d702d65f7a44e3bb42e86e7a1784edf847 commit e681d7d702d65f7a44e3bb42e86e7a1784edf847 Author: Edward Tomasz Napierala AuthorDate: 2021-01-31 21:07:02 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-02 18:43:26 +0000 msdosfs: fix double unlock if the source file disappears We would unlock fvp here, only to unlock it again below, just before "bad". Reviewed By: kib Tested by: pho Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27339 (cherry picked from commit cb696212495995c8374d9fe12fbae340614af45c) --- sys/fs/msdosfs/msdosfs_vnops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index b940633e0cfd..e1e679d92146 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1139,7 +1139,6 @@ abortit: if (xp != ip) { if (doingdirectory) panic("rename: lost dir entry"); - VOP_UNLOCK(fvp); if (newparent) VOP_UNLOCK(fdvp); vrele(ap->a_fvp); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:43:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBDA954C1A7; Tue, 2 Mar 2021 18:43: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 4DqmHK5SBDz4tRV; Tue, 2 Mar 2021 18:43: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 ADE651BB44; Tue, 2 Mar 2021 18:43: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 122IhfiV018718; Tue, 2 Mar 2021 18:43:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Ihfpn018717; Tue, 2 Mar 2021 18:43:41 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:43:41 GMT Message-Id: <202103021843.122Ihfpn018717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: f6082ba9d2e0 - stable/13 - msdosfs: fix vnode leak with msdosfs_rename() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f6082ba9d2e0f3ba3cfcbdfdccdf2315e3698b8d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:43:41 -0000 The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f6082ba9d2e0f3ba3cfcbdfdccdf2315e3698b8d commit f6082ba9d2e0f3ba3cfcbdfdccdf2315e3698b8d Author: Edward Tomasz Napierala AuthorDate: 2021-01-31 21:37:41 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-02 18:43:26 +0000 msdosfs: fix vnode leak with msdosfs_rename() This could happen when failing due to disappearing source file. Reviewed By: kib Tested by: pho Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27338 (cherry picked from commit b8073b3c74342113398f36a1c68f442ae9e092e6) --- sys/fs/msdosfs/msdosfs_vnops.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index e1e679d92146..8885ac856588 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1122,6 +1122,14 @@ abortit: VOP_UNLOCK(tdvp); vrele(tdvp); vrele(ap->a_fvp); + /* + * fdvp may be locked and has a reference. We need to + * release the lock and reference, unless to and from + * directories are the same. In that case it is already + * unlocked. + */ + if (tdvp != fdvp) + vput(fdvp); return 0; } xp = VTODE(fvp); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:43:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C6CA54BE5F; Tue, 2 Mar 2021 18:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqmHM0ngTz4tPf; Tue, 2 Mar 2021 18:43: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 EA4861BC63; Tue, 2 Mar 2021 18:43: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 122IhgGt018740; Tue, 2 Mar 2021 18:43:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IhgMb018739; Tue, 2 Mar 2021 18:43:42 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:43:42 GMT Message-Id: <202103021843.122IhgMb018739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: a3576b620707 - stable/13 - libc: fix buffer overrun in getrpcport(3) 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a3576b6207074ba5182be253c26af72f8fb51759 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:43:45 -0000 The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=a3576b6207074ba5182be253c26af72f8fb51759 commit a3576b6207074ba5182be253c26af72f8fb51759 Author: Edward Tomasz Napierala AuthorDate: 2021-01-31 21:41:55 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-02 18:43:26 +0000 libc: fix buffer overrun in getrpcport(3) Reviewed By: markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27332 (cherry picked from commit 5299d64b2b9f7a25e423ef1785d9402a0ef198d3) --- lib/libc/rpc/getrpcport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c index 2b2d459c8887..4abc9a0c16af 100644 --- a/lib/libc/rpc/getrpcport.c +++ b/lib/libc/rpc/getrpcport.c @@ -62,14 +62,14 @@ getrpcport(char *host, int prognum, int versnum, int proto) assert(host != NULL); - if ((hp = gethostbyname(host)) == NULL) + if ((hp = gethostbyname2(host, AF_INET)) == NULL) return (0); memset(&addr, 0, sizeof(addr)); addr.sin_len = sizeof(struct sockaddr_in); addr.sin_family = AF_INET; addr.sin_port = 0; - if (hp->h_length > addr.sin_len) - hp->h_length = addr.sin_len; + if (hp->h_length > sizeof(addr.sin_addr.s_addr)) + hp->h_length = sizeof(addr.sin_addr.s_addr); memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length); /* Inconsistent interfaces need casts! :-( */ return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum, From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:43:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 274CC54C06B; Tue, 2 Mar 2021 18:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqmHN0cPLz4tKL; Tue, 2 Mar 2021 18:43: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 F2D4D1BC8A; Tue, 2 Mar 2021 18:43: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 122Ihh2g018762; Tue, 2 Mar 2021 18:43:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IhhSV018761; Tue, 2 Mar 2021 18:43:43 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:43:43 GMT Message-Id: <202103021843.122IhhSV018761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 1b2802ed4ed0 - stable/13 - Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linux 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1b2802ed4ed09746d6870080f85d79a9ccd782b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:43:45 -0000 The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=1b2802ed4ed09746d6870080f85d79a9ccd782b0 commit 1b2802ed4ed09746d6870080f85d79a9ccd782b0 Author: Edward Tomasz Napierala AuthorDate: 2021-02-02 14:40:38 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-02 18:43:26 +0000 Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linux In /etc/rc.d/linux the mounting paths of procfs, sysfs and devfs are hardcoded to "/compat/linux". Switching to the content of compat.linux.emul_path sysctl would allow to switch linuxulator to different place. Submitted by: freebsdnewbie_freenet.de Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27807 (cherry picked from commit e40787f900f3c262d5134d342e5a16757dd2193c) --- libexec/rc/rc.d/linux | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index 4fe9cee6e751..4381b62cc660 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -18,6 +18,7 @@ stop_cmd=":" linux_start() { local _emul_path _tmpdir + _emul_path="$(sysctl -n compat.linux.emul_path)" load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in @@ -25,11 +26,11 @@ linux_start() load_kld -e 'linux64elf' linux64 ;; esac - if [ -x /compat/linux/sbin/ldconfigDisabled ]; then + if [ -x ${_emul_path}/sbin/ldconfigDisabled ]; then _tmpdir=`mktemp -d -t linux-ldconfig` - /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache - if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then - cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache + ${_emul_path}/sbin/ldconfig -C ${_tmpdir}/ld.so.cache + if ! cmp -s ${_tmpdir}/ld.so.cache ${_emul_path}/etc/ld.so.cache; then + cat ${_tmpdir}/ld.so.cache > ${_emul_path}/etc/ld.so.cache fi rm -rf ${_tmpdir} fi @@ -47,7 +48,6 @@ linux_start() fi if checkyesno linux_mounts_enable; then - _emul_path="/compat/linux" mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc" mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys" mount -o nocover -t devfs devfs "${_emul_path}/dev" From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:43:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A89154C131; Tue, 2 Mar 2021 18:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqmHP3qrwz4tPx; Tue, 2 Mar 2021 18:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 273E01BA78; Tue, 2 Mar 2021 18:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122Ihikn018780; Tue, 2 Mar 2021 18:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122Ihit4018779; Tue, 2 Mar 2021 18:43:44 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:43:44 GMT Message-Id: <202103021843.122Ihit4018779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 5dc2e1bcf41f - stable/13 - Don't check compat.linux.emul_path before loading linux(4) 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5dc2e1bcf41f853b31b6d08a5c2d643408e890f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:43:48 -0000 The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=5dc2e1bcf41f853b31b6d08a5c2d643408e890f3 commit 5dc2e1bcf41f853b31b6d08a5c2d643408e890f3 Author: Edward Tomasz Napierala AuthorDate: 2021-02-08 21:52:31 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-02 18:43:26 +0000 Don't check compat.linux.emul_path before loading linux(4) Fix e40787f900f to make libexec/rc/rc.d/linux retrieve the sysctl after loading the kernel module which provides it, not before. Reported By: jkim Sponsored By: The FreeBSD Foundation (cherry picked from commit 07cac176fba947381c8111b8e02e8067e7fa542a) --- libexec/rc/rc.d/linux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index 4381b62cc660..f44a9d02fc8d 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -18,7 +18,6 @@ stop_cmd=":" linux_start() { local _emul_path _tmpdir - _emul_path="$(sysctl -n compat.linux.emul_path)" load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in @@ -26,6 +25,9 @@ linux_start() load_kld -e 'linux64elf' linux64 ;; esac + + _emul_path="$(sysctl -n compat.linux.emul_path)" + if [ -x ${_emul_path}/sbin/ldconfigDisabled ]; then _tmpdir=`mktemp -d -t linux-ldconfig` ${_emul_path}/sbin/ldconfig -C ${_tmpdir}/ld.so.cache From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:43:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BED354BEDE; Tue, 2 Mar 2021 18:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqmHQ74gFz4tQ6; Tue, 2 Mar 2021 18:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60FF41BB45; Tue, 2 Mar 2021 18:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122IhknT018802; Tue, 2 Mar 2021 18:43:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IhkJY018801; Tue, 2 Mar 2021 18:43:46 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:43:46 GMT Message-Id: <202103021843.122IhkJY018801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 9d930fb09072 - stable/13 - linux: fix handling of flags for 32 bit send(2) syscall 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d930fb09072d21464288df8c834cb8d0b760073 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:43:50 -0000 The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=9d930fb09072d21464288df8c834cb8d0b760073 commit 9d930fb09072d21464288df8c834cb8d0b760073 Author: Edward Tomasz Napierala AuthorDate: 2021-02-05 17:24:23 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-02 18:43:27 +0000 linux: fix handling of flags for 32 bit send(2) syscall Previously the flags were passed as-is, which could resulted in spurious EAGAIN returned for non-blocking sockets, which broke some Steam games. PR: 248065 Reported By: Alex S Tested By: Alex S Reviewed By: emaste MFC After: 3 days Sponsored By: The FreeBSD Foundation (cherry picked from commit f6e8256a965d5b7a7d43034ea31b2430a3b51066) --- sys/compat/linux/linux_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 5bfcdbb8fd21..c723af9dfba0 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1178,7 +1178,7 @@ linux_send(struct thread *td, struct linux_send_args *args) bsd_args.s = args->s; bsd_args.buf = (caddr_t)PTRIN(args->msg); bsd_args.len = args->len; - bsd_args.flags = args->flags; + bsd_args.flags = linux_to_bsd_msg_flags(args->flags); bsd_args.to = NULL; bsd_args.tolen = 0; error = sys_sendto(td, &bsd_args); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:43:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1C8554BEF4; Tue, 2 Mar 2021 18:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqmHT4ggjz4tVZ; Tue, 2 Mar 2021 18:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F23A1B6DB; Tue, 2 Mar 2021 18:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122IhlZO018824; Tue, 2 Mar 2021 18:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IhlBs018823; Tue, 2 Mar 2021 18:43:47 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:43:47 GMT Message-Id: <202103021843.122IhlBs018823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 47d6ee406e03 - stable/13 - linux: add support for SO_PEERSEC getsockopt 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 47d6ee406e03061be2e8c333e1931531bb074a9e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:43:52 -0000 The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=47d6ee406e03061be2e8c333e1931531bb074a9e commit 47d6ee406e03061be2e8c333e1931531bb074a9e Author: Edward Tomasz Napierala AuthorDate: 2021-02-07 20:28:35 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-02 18:43:27 +0000 linux: add support for SO_PEERSEC getsockopt It returns "unconfined", like Linux without SELinux would. Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28164 (cherry picked from commit e44a78ce6f249f1eb7df94cb6953698953ebd88b) --- sys/compat/linux/linux_socket.c | 26 ++++++++++++++++++++++++++ sys/compat/linux/linux_socket.h | 1 + 2 files changed, 27 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index c723af9dfba0..a4c5bf0b581e 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define SECURITY_CONTEXT_STRING "unconfined" + static int linux_sendmsg_common(struct thread *, l_int, struct l_msghdr *, l_uint); static int linux_recvmsg_common(struct thread *, l_int, struct l_msghdr *, @@ -1861,6 +1863,28 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) return (error); } +static int +linux_getsockopt_so_peersec(struct thread *td, + struct linux_getsockopt_args *args) +{ + socklen_t len; + int error; + + len = sizeof(SECURITY_CONTEXT_STRING); + if (args->optlen < len) { + error = copyout(&len, PTRIN(args->optlen), sizeof(len)); + if (error == 0) + error = ERANGE; + return (error); + } + + error = copyout(SECURITY_CONTEXT_STRING, + PTRIN(args->optval), sizeof(SECURITY_CONTEXT_STRING)); + if (error == 0) + error = copyout(&len, PTRIN(args->optlen), sizeof(len)); + return (error); +} + int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) { @@ -1875,6 +1899,8 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) level = linux_to_bsd_sockopt_level(args->level); switch (level) { case SOL_SOCKET: + if (args->optname == LINUX_SO_PEERSEC) + return (linux_getsockopt_so_peersec(td, args)); name = linux_to_bsd_so_sockopt(args->optname); switch (name) { case LOCAL_CREDS_PERSISTENT: diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index 5ebd6392264b..32a19a348312 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -195,6 +195,7 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #endif #define LINUX_SO_TIMESTAMP 29 #define LINUX_SO_ACCEPTCONN 30 +#define LINUX_SO_PEERSEC 31 #define LINUX_SO_SNDBUFFORCE 32 #define LINUX_SO_RCVBUFFORCE 33 #define LINUX_SO_PROTOCOL 38 From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:44:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3FF954C162; Tue, 2 Mar 2021 18:44:51 +0000 (UTC) (envelope-from nwhitehorn@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 4DqmJd28D9z4vBC; Tue, 2 Mar 2021 18:44:49 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:9508:6d03:14a7:a372]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 15DC78E2A; Tue, 2 Mar 2021 18:44:46 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103021826.122IQfMN047888@gndrsh.dnsmgr.net> From: Nathan Whitehorn Message-ID: Date: Tue, 2 Mar 2021 13:44:45 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <202103021826.122IQfMN047888@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:44:52 -0000 On 3/2/21 1:26 PM, Rodney W. Grimes wrote: >> The branch main has been updated by nwhitehorn: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=2c26d77d989abe48c662eeb6f52f7e4c9b81680c >> >> commit 2c26d77d989abe48c662eeb6f52f7e4c9b81680c >> Author: Nathan Whitehorn >> AuthorDate: 2021-03-02 16:47:00 +0000 >> Commit: Nathan Whitehorn >> CommitDate: 2021-03-02 16:49:41 +0000 >> >> Remove /boot/efi from mtree, missed in 0b7472b3d8d2. >> >> This had prevented the bootconfig step from determining if an ESP exists, >> resulting in its unconditional setup. On BIOS-booted amd64, this wasn't >> harmful, just unnecessary, but it resulted in failed installations on >> non-EFI-supporting platforms like powerpc64. >> >> MFC after: 3 days >> --- >> etc/mtree/BSD.root.dist | 2 -- >> release/tools/arm.subr | 1 + >> 2 files changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist >> index f734f7891429..1dc9e179b0fc 100644 >> --- a/etc/mtree/BSD.root.dist >> +++ b/etc/mtree/BSD.root.dist >> @@ -18,8 +18,6 @@ >> rockchip tags=package=runtime >> .. >> .. >> - efi >> - .. >> firmware >> .. >> loader.conf.d tags=package=bootloader >> diff --git a/release/tools/arm.subr b/release/tools/arm.subr >> index 343d9f3a7034..2f91490c0859 100644 >> --- a/release/tools/arm.subr >> +++ b/release/tools/arm.subr >> @@ -184,6 +184,7 @@ arm_install_base() { >> TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ >> DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ >> ${CONF_FILES} installworld installkernel distribution >> + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/efi > This fails to apply the proper owner/group and mode values > using what ever defaults are in place of the process running > the build. This script is riddled with such issues (see the line immediately below and copied here, for instance). Presumably, as run in the official build environment to generate SD-card images, this works -- if it didn't, large sections of the rest of the script would not either. It did not seem reasonable to fix it for this one case only or to retool the entire script at present, though some of this code should probably be looked at sooner rather than later -- I started with vmimage.subr already, but the rest will take a while. -Nathan >> chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos >> >> arm_create_user >> From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:48:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9EC354C62E; Tue, 2 Mar 2021 18:48:38 +0000 (UTC) (envelope-from bdragon@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 4DqmP24CYNz4vNv; Tue, 2 Mar 2021 18:48:38 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 7CA54915A; Tue, 2 Mar 2021 18:48:38 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 347C327C0054; Tue, 2 Mar 2021 13:48:38 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Tue, 02 Mar 2021 13:48:38 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddttddgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredt reerjeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgoh hnsefhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfeftddutdelgeek gedtgeejkeffvdejtddthefggfevuefggfefledvgefhgfenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgr uhhthhhpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsug hrrghgohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9875FCA005D; Tue, 2 Mar 2021 13:48:37 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd Mime-Version: 1.0 Message-Id: <79dbff79-c40b-4742-98a6-5ce3e2079b70@www.fastmail.com> In-Reply-To: <202103021826.122IQfMN047888@gndrsh.dnsmgr.net> References: <202103021826.122IQfMN047888@gndrsh.dnsmgr.net> Date: Tue, 02 Mar 2021 12:48:17 -0600 From: "Brandon Bergren" To: rgrimes@freebsd.org, "Nathan Whitehorn" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_2c26d77d989a_-_main_-_Remove_/boot/efi_from_mtree, _mi?= =?UTF-8?Q?ssed_in_0b7472b3d8d2.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:48:38 -0000 On Tue, Mar 2, 2021, at 12:26 PM, Rodney W. Grimes wrote: > > This fails to apply the proper owner/group and mode values > using what ever defaults are in place of the process running > the build. Keep in mind that this is the root of a mounted filesystem in the case where it matters, and the filesystem being mounted there doesn't support proper modes anyway, so the mtree values are a bit irrelevant anyway as the actual control of that is in the fstab. -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:50:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E16654C6D3; Tue, 2 Mar 2021 18:50:27 +0000 (UTC) (envelope-from nwhitehorn@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 4DqmR70fs2z4vgr; Tue, 2 Mar 2021 18:50:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:9508:6d03:14a7:a372]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A2B74836F; Tue, 2 Mar 2021 18:50:26 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Kyle Evans Cc: Brandon Bergren , Warner Losh , Kevin Bowling , Jessica Clarke , Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> <82f307a1-d7e2-0950-510d-148a1a7e61a2@freebsd.org> From: Nathan Whitehorn Message-ID: Date: Tue, 2 Mar 2021 13:50:26 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:50:27 -0000 On 3/1/21 11:50 AM, Kyle Evans wrote: > On Mon, Mar 1, 2021 at 10:45 AM Nathan Whitehorn wrote: >> >> >> On 3/1/21 11:42 AM, Kyle Evans wrote: >>> On Mon, Mar 1, 2021 at 10:39 AM Nathan Whitehorn wrote: >>>> >>>> On 2/28/21 3:44 PM, Brandon Bergren wrote: >>>>> On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: >>>>>> Yes. I agree as well. I was just hoping to say just that: EFI is barely >>>>>> theoretically possible, but in reality we'll likely never use it.... >>>>>> >>>>>> The net effect is that we don't want to install efi on powerpc on freebsd. >>>>>> >>>>>> Warner >>>>>> >>>>> Yeah. The code before the change excluded mips and powerpc platforms, and it should continue to do so instead of using the existence of a /boot/efi directory as the only clue. >>>>> >>>>> Currently bsdinstall bails out and leaves powerpc* in a half-installed state because the die in the uname case propagates to the main script, so it never runs the bits after the bootconfig. >>>>> >>>> So that was a deliberate choice to keep the list of places that know >>>> about efi vs. non-EFI centralized. I'd prefer to just not make that >>>> directory on systems where it doesn't apply rather than messing with the >>>> installer. Do you know where it is being made? >>>> -Nathan >>> It's part of the hierarchy in ^/etc/mtree/BSD.root.dist >>> >> Is there a reason it needs to be? The installer bits all make it when >> needed already, so just removing it there seems like the simplest path. > I can't think of a reason, as long as both the release(7) scripts and > the installer create it as needed -- I note that vmimage.subr seems to > create it itself, but arm.subr seems to get it wrong atm. It'll need > to create /boot/efi for PART_SCHEME == GPT, and /boot/msdos should > probably be scoped down to PART_SCHEME == MBR where it's used at the > moment. > I just committed 2c26d77d989a, which implements these changes. I kicked the tires on a few relevant platforms and it seems to work. I used a light touch on arm.subr, since it seems like it needs a bunch more work later, but it should at least do the right thing now. -Nathan From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:53:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0DB754CA5B; Tue, 2 Mar 2021 18:53: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 4DqmVf54fjz3Br2; Tue, 2 Mar 2021 18:53: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 9C7AF1BD2F; Tue, 2 Mar 2021 18:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122IrU7x031829; Tue, 2 Mar 2021 18:53:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122IrUsp031827; Tue, 2 Mar 2021 18:53:30 GMT (envelope-from git) Date: Tue, 2 Mar 2021 18:53:30 GMT Message-Id: <202103021853.122IrUsp031827@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: 907023b454f0 - main - security(7): mention new W^X sysctls in the manual page 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: 907023b454f06a6af87f21f8a9d6de6c11b2d275 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:53:30 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=907023b454f06a6af87f21f8a9d6de6c11b2d275 commit 907023b454f06a6af87f21f8a9d6de6c11b2d275 Author: Evgeniy Khramtsov AuthorDate: 2021-03-02 18:52:22 +0000 Commit: Gordon Bergling CommitDate: 2021-03-02 18:52:22 +0000 security(7): mention new W^X sysctls in the manual page Reviewed by: emaste, gbe MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28986 --- share/man/man7/security.7 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man7/security.7 b/share/man/man7/security.7 index 9ff39c74759c..b4aeb5728313 100644 --- a/share/man/man7/security.7 +++ b/share/man/man7/security.7 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2020 +.Dd February 28, 2021 .Dt SECURITY 7 .Os .Sh NAME @@ -1080,6 +1080,12 @@ Enables non-executable stack for 32bit processes. Enabled by default if supported by hardware and corresponding binary. .It Dv kern.elf64.nxstack Enables non-executable stack for 64bit processes. +.It Dv kern.elf32.allow_wx +Enables mapping of simultaneously writable and executable pages for +32bit processes. +.It Dv kern.elf64.allow_wx +Enables mapping of simultaneously writable and executable pages for +64bit processes. .El .Sh SEE ALSO .Xr chflags 1 , From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:56:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A93454CCA0; Tue, 2 Mar 2021 18:56:37 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqmZD5fryz3CMC; Tue, 2 Mar 2021 18:56:36 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 122IuYnN048087; Tue, 2 Mar 2021 10:56:34 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 122IuYgV048086; Tue, 2 Mar 2021 10:56:34 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: <79dbff79-c40b-4742-98a6-5ce3e2079b70@www.fastmail.com> To: Brandon Bergren Date: Tue, 2 Mar 2021 10:56:34 -0800 (PST) CC: rgrimes@FreeBSD.org, Nathan Whitehorn , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4DqmZD5fryz3CMC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:56:37 -0000 > > > On Tue, Mar 2, 2021, at 12:26 PM, Rodney W. Grimes wrote: > > > > This fails to apply the proper owner/group and mode values > > using what ever defaults are in place of the process running > > the build. > > Keep in mind that this is the root of a mounted filesystem in the case where it matters, and the filesystem being mounted there doesn't support proper modes anyway, so the mtree values are a bit irrelevant anyway as the actual control of that is in the fstab. That assumes the mount is done and/or kept. My concern is more of a lack security (aka world writable) /boot/efi getting created in a distribution that then is *not* mounted for some reason, either by choice or error. mkdir should be stricken from use when possible, install -d should be used instead. -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Mar 2 18:58:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5AD954CDA1; Tue, 2 Mar 2021 18:58:12 +0000 (UTC) (envelope-from nwhitehorn@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 4Dqmc45qR1z3CHq; Tue, 2 Mar 2021 18:58:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:9508:6d03:14a7:a372]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 81F9E9016; Tue, 2 Mar 2021 18:58:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: rgrimes@FreeBSD.org, Brandon Bergren Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> From: Nathan Whitehorn Message-ID: <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> Date: Tue, 2 Mar 2021 13:58:12 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:58:12 -0000 On 3/2/21 1:56 PM, Rodney W. Grimes wrote: >> >> On Tue, Mar 2, 2021, at 12:26 PM, Rodney W. Grimes wrote: >>> This fails to apply the proper owner/group and mode values >>> using what ever defaults are in place of the process running >>> the build. >> Keep in mind that this is the root of a mounted filesystem in the case where it matters, and the filesystem being mounted there doesn't support proper modes anyway, so the mtree values are a bit irrelevant anyway as the actual control of that is in the fstab. > That assumes the mount is done and/or kept. My concern is more > of a lack security (aka world writable) /boot/efi getting created > in a distribution that then is *not* mounted for some reason, > either by choice or error. > > mkdir should be stricken from use when possible, install -d > should be used instead. > But that can't happen in this code. For one thing, it's only used in a controlled environment to generate SD-card images for a handful of ARM boards. For another the mount is set up and installed in fstab a couple lines further down the same script. -Nathan From owner-dev-commits-src-all@freebsd.org Tue Mar 2 19:16:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D78254D3C4; Tue, 2 Mar 2021 19:16: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 4Dqn1037jMz3Dc7; Tue, 2 Mar 2021 19:16: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 59D511BDD7; Tue, 2 Mar 2021 19:16: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 122JGKnI059467; Tue, 2 Mar 2021 19:16:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122JGKDv059466; Tue, 2 Mar 2021 19:16:20 GMT (envelope-from git) Date: Tue, 2 Mar 2021 19:16:20 GMT Message-Id: <202103021916.122JGKDv059466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chris Rees Subject: git: 945184b92f65 - releng/13.0 - Create dhclient pid directory if it doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 945184b92f654e50692a42e58b477f9c473b948d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 19:16:20 -0000 The branch releng/13.0 has been updated by crees (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=945184b92f654e50692a42e58b477f9c473b948d commit 945184b92f654e50692a42e58b477f9c473b948d Author: Chris Rees AuthorDate: 2021-02-21 18:56:56 +0000 Commit: Chris Rees CommitDate: 2021-03-02 19:16:06 +0000 Create dhclient pid directory if it doesn't exist - Upgrading from older FreeBSD versions can result in errors - /var/run can be a tmpfs, and this should be handled correctly Approved by: re (gjb) Approved by: markj Differential: https://reviews.freebsd.org/D28843 MFC after: 2 weeks (cherry picked from commit ce94bedf475ac17307be0d5cbc66a8abe0741bf6) --- libexec/rc/rc.d/dhclient | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rc/rc.d/dhclient b/libexec/rc/rc.d/dhclient index 520a0850ccbc..765e38266408 100755 --- a/libexec/rc/rc.d/dhclient +++ b/libexec/rc/rc.d/dhclient @@ -49,6 +49,11 @@ dhclient_prestart() rc_flags="${rc_flags} -b" fi + + # /var/run/dhclient is not guaranteed to exist, + # e.g. if /var/run is a tmpfs + install -d -o root -g wheel -m 755 ${pidfile%/*} + rc_flags="${rc_flags} ${ifn}" } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 21:11:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1EDE550A66; Tue, 2 Mar 2021 21:11: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 4DqqZ368bkz3M4h; Tue, 2 Mar 2021 21:11: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 C67D41D67E; Tue, 2 Mar 2021 21:11: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 122LBdYq015653; Tue, 2 Mar 2021 21:11:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122LBdUW015652; Tue, 2 Mar 2021 21:11:39 GMT (envelope-from git) Date: Tue, 2 Mar 2021 21:11:39 GMT Message-Id: <202103022111.122LBdUW015652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 06e9c710998b - main - Fix initiator panic after 6895f89fe54e. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06e9c710998b83a3be21f7f264187fff5d590bc3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 21:11:39 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=06e9c710998b83a3be21f7f264187fff5d590bc3 commit 06e9c710998b83a3be21f7f264187fff5d590bc3 Author: Alexander Motin AuthorDate: 2021-03-02 21:07:22 +0000 Commit: Alexander Motin CommitDate: 2021-03-02 21:11:29 +0000 Fix initiator panic after 6895f89fe54e. There are sessions without socket that are not disconnecting yet. MFC after: 3 weeks --- sys/dev/iscsi/icl_soft.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index c66d8ccdb5fd..c64f0cfde71b 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -1364,9 +1364,11 @@ icl_soft_conn_close(struct icl_conn *ic) ICL_CONN_LOCK(ic); if (!ic->ic_disconnecting) { so = ic->ic_socket; - SOCKBUF_LOCK(&so->so_rcv); + if (so) + SOCKBUF_LOCK(&so->so_rcv); ic->ic_disconnecting = true; - SOCKBUF_UNLOCK(&so->so_rcv); + if (so) + SOCKBUF_UNLOCK(&so->so_rcv); } while (ic->ic_receive_running || ic->ic_send_running) { cv_signal(&ic->ic_receive_cv); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 21:22:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD389551469; Tue, 2 Mar 2021 21:22: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 4Dqqpb53rBz3NVt; Tue, 2 Mar 2021 21:22: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 A095A1DAC7; Tue, 2 Mar 2021 21:22: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 122LMVrE029707; Tue, 2 Mar 2021 21:22:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122LMVLI029706; Tue, 2 Mar 2021 21:22:31 GMT (envelope-from git) Date: Tue, 2 Mar 2021 21:22:31 GMT Message-Id: <202103022122.122LMVLI029706@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: ca4e1ea19fc3 - main - Regenerate src.conf(5) after PIE default change 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: ca4e1ea19fc31e8c58feb133719302c94557c1ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 21:22:31 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ca4e1ea19fc31e8c58feb133719302c94557c1ae commit ca4e1ea19fc31e8c58feb133719302c94557c1ae Author: Kyle Evans AuthorDate: 2021-03-02 21:21:27 +0000 Commit: Kyle Evans CommitDate: 2021-03-02 21:22:05 +0000 Regenerate src.conf(5) after PIE default change --- share/man/man5/src.conf.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 48bd0eb04293..e9fe277f23e7 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 13, 2021 +.Dd March 2, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1351,8 +1351,8 @@ When set, it enforces these options: .It .Va WITHOUT_AUTHPF .El -.It Va WITH_PIE -Build dynamically linked binaries as +.It Va WITHOUT_PIE +Do not build dynamically linked binaries as Position-Independent Executable (PIE). .It Va WITHOUT_PKGBOOTSTRAP Set to not build From owner-dev-commits-src-all@freebsd.org Tue Mar 2 21:22:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E60D4551321; Tue, 2 Mar 2021 21:22: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 4Dqqpc68tSz3NF9; Tue, 2 Mar 2021 21:22: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 C62921DE89; Tue, 2 Mar 2021 21:22: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 122LMW5s029725; Tue, 2 Mar 2021 21:22:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122LMWR9029724; Tue, 2 Mar 2021 21:22:32 GMT (envelope-from git) Date: Tue, 2 Mar 2021 21:22:32 GMT Message-Id: <202103022122.122LMWR9029724@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: e4d63c5d5ff8 - main - Remove fmtree(8) 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: e4d63c5d5ff85d1eb84501d60806651adb552159 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 21:22:33 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e4d63c5d5ff85d1eb84501d60806651adb552159 commit e4d63c5d5ff85d1eb84501d60806651adb552159 Author: Kyle Evans AuthorDate: 2021-03-02 21:15:17 +0000 Commit: Kyle Evans CommitDate: 2021-03-02 21:22:05 +0000 Remove fmtree(8) fmtree(8) deprecation was announced on February 12, 2021, and no longer built by default as of that date. The deprecation notice was merged back to stable/12 and stable/13 + releng/13.0. Continue with the plan by finishing the removal. Relnotes: yes --- ObsoleteFiles.inc | 4 + share/mk/src.opts.mk | 1 - tools/build/mk/OptionalObsoleteFiles.inc | 5 - tools/build/options/WITHOUT_FMTREE | 3 - tools/build/options/WITH_FMTREE | 5 - usr.sbin/Makefile | 1 - usr.sbin/fmtree/Makefile | 21 -- usr.sbin/fmtree/Makefile.depend | 18 -- usr.sbin/fmtree/compare.c | 389 ---------------------------- usr.sbin/fmtree/create.c | 431 ------------------------------- usr.sbin/fmtree/excludes.c | 111 -------- usr.sbin/fmtree/extern.h | 59 ----- usr.sbin/fmtree/misc.c | 124 --------- usr.sbin/fmtree/mtree.8 | 408 ----------------------------- usr.sbin/fmtree/mtree.c | 191 -------------- usr.sbin/fmtree/mtree.h | 98 ------- usr.sbin/fmtree/spec.c | 323 ----------------------- usr.sbin/fmtree/specspec.c | 256 ------------------ usr.sbin/fmtree/test/test00.sh | 67 ----- usr.sbin/fmtree/test/test01.sh | 40 --- usr.sbin/fmtree/test/test02.sh | 36 --- usr.sbin/fmtree/test/test03.sh | 60 ----- usr.sbin/fmtree/test/test04.sh | 51 ---- usr.sbin/fmtree/test/test05.sh | 25 -- usr.sbin/fmtree/verify.c | 261 ------------------- 25 files changed, 4 insertions(+), 2984 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 61c8d3dba2fe..5821e9f04e89 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20210302: fmtree removed +OLD_FILES+=usr/sbin/fmtree +OLD_FILES+=usr/share/man/man8/fmtree.8.gz + # 20210201: bump shared libraries which link against ncurses OLD_LIBS+=lib/libedit.so.7 OLD_LIBS+=usr/lib/libdialog.so.8 diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 9e7a0c88f8af..619aa8f4a1d8 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -201,7 +201,6 @@ __DEFAULT_NO_OPTIONS = \ CLANG_FORMAT \ DTRACE_TESTS \ EXPERIMENTAL \ - FMTREE \ HESIOD \ LIBSOFT \ LOADER_FIREWIRE \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 87fab14e45e7..5984645cbc14 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1684,11 +1684,6 @@ OLD_FILES+=usr/sbin/uefisign OLD_FILES+=usr/share/examples/uefisign/uefikeys .endif -.if ${MK_FMTREE} == no -OLD_FILES+=usr/sbin/fmtree -OLD_FILES+=usr/share/man/man8/fmtree.8.gz -.endif - .if ${MK_FTP} == no OLD_FILES+=etc/ftpusers OLD_FILES+=etc/newsyslog.conf.d/ftp.conf diff --git a/tools/build/options/WITHOUT_FMTREE b/tools/build/options/WITHOUT_FMTREE deleted file mode 100644 index f8225c1e90c0..000000000000 --- a/tools/build/options/WITHOUT_FMTREE +++ /dev/null @@ -1,3 +0,0 @@ -.\" $FreeBSD$ -Set to not build and install -.Pa /usr/sbin/fmtree . diff --git a/tools/build/options/WITH_FMTREE b/tools/build/options/WITH_FMTREE deleted file mode 100644 index e384ff426774..000000000000 --- a/tools/build/options/WITH_FMTREE +++ /dev/null @@ -1,5 +0,0 @@ -.\" $FreeBSD$ -Set to build and install -.Pa /usr/sbin/fmtree . -This option is deprecated, and will be gone in -.Fx 14.0 . diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 259ab72f2281..ae568746119a 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -137,7 +137,6 @@ SUBDIR.${MK_FLOPPY}+= fdcontrol SUBDIR.${MK_FLOPPY}+= fdformat SUBDIR.${MK_FLOPPY}+= fdread SUBDIR.${MK_FLOPPY}+= fdwrite -SUBDIR.${MK_FMTREE}+= fmtree SUBDIR.${MK_FREEBSD_UPDATE}+= freebsd-update SUBDIR.${MK_GSSAPI}+= gssd SUBDIR.${MK_GPIO}+= gpioctl diff --git a/usr.sbin/fmtree/Makefile b/usr.sbin/fmtree/Makefile deleted file mode 100644 index c1ba3737b258..000000000000 --- a/usr.sbin/fmtree/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# From: @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $FreeBSD$ - -.include - -.PATH: ${SRCTOP}/usr.bin/cksum - -PROG= fmtree -MAN= fmtree.8 -SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c verify.c -SRCS+= specspec.c - -CFLAGS+= -DWITH_MD5 -DWITH_SHA1 -DWITH_RMD160 -DWITH_SHA256 -LIBADD= md - -CLEANFILES+= fmtree.8 - -fmtree.8: mtree.8 - ${CP} ${.ALLSRC} ${.TARGET} - -.include diff --git a/usr.sbin/fmtree/Makefile.depend b/usr.sbin/fmtree/Makefile.depend deleted file mode 100644 index 31fbf9bc2f9f..000000000000 --- a/usr.sbin/fmtree/Makefile.depend +++ /dev/null @@ -1,18 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libmd \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.sbin/fmtree/compare.c b/usr.sbin/fmtree/compare.c deleted file mode 100644 index c59d01e651d4..000000000000 --- a/usr.sbin/fmtree/compare.c +++ /dev/null @@ -1,389 +0,0 @@ -/*- - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -#ifndef lint -static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ -#endif -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include -#include -#include -#include -#ifdef WITH_MD5 -#include -#endif -#ifdef WITH_RMD160 -#include -#endif -#ifdef WITH_SHA1 -#include -#endif -#ifdef WITH_SHA256 -#include -#endif -#include -#include -#include -#include -#include - -#include "mtree.h" -#include "extern.h" - -#define INDENTNAMELEN 8 -#define LABEL \ - if (!label++) { \ - len = printf("%s changed\n", RP(p)); \ - tab = "\t"; \ - } - -int -compare(char *name __unused, NODE *s, FTSENT *p) -{ - struct timeval tv[2]; - uint32_t val; - int fd, label; - off_t len; - char *cp; - const char *tab = ""; - char *fflags; - - label = 0; - switch(s->type) { - case F_BLOCK: - if (!S_ISBLK(p->fts_statp->st_mode)) - goto typeerr; - break; - case F_CHAR: - if (!S_ISCHR(p->fts_statp->st_mode)) - goto typeerr; - break; - case F_DIR: - if (!S_ISDIR(p->fts_statp->st_mode)) - goto typeerr; - break; - case F_FIFO: - if (!S_ISFIFO(p->fts_statp->st_mode)) - goto typeerr; - break; - case F_FILE: - if (!S_ISREG(p->fts_statp->st_mode)) - goto typeerr; - break; - case F_LINK: - if (!S_ISLNK(p->fts_statp->st_mode)) - goto typeerr; - break; - case F_SOCK: - if (!S_ISSOCK(p->fts_statp->st_mode)) { -typeerr: LABEL; - (void)printf("\ttype expected %s found %s\n", - ftype(s->type), inotype(p->fts_statp->st_mode)); - return (label); - } - break; - } - /* Set the uid/gid first, then set the mode. */ - if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) { - LABEL; - (void)printf("%suser expected %lu found %lu", - tab, (u_long)s->st_uid, (u_long)p->fts_statp->st_uid); - if (uflag) - if (chown(p->fts_accpath, s->st_uid, -1)) - (void)printf(" not modified: %s\n", - strerror(errno)); - else - (void)printf(" modified\n"); - else - (void)printf("\n"); - tab = "\t"; - } - if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) { - LABEL; - (void)printf("%sgid expected %lu found %lu", - tab, (u_long)s->st_gid, (u_long)p->fts_statp->st_gid); - if (uflag) - if (chown(p->fts_accpath, -1, s->st_gid)) - (void)printf(" not modified: %s\n", - strerror(errno)); - else - (void)printf(" modified\n"); - else - (void)printf("\n"); - tab = "\t"; - } - if (s->flags & F_MODE && - !S_ISLNK(p->fts_statp->st_mode) && - s->st_mode != (p->fts_statp->st_mode & MBITS)) { - LABEL; - (void)printf("%spermissions expected %#o found %#o", - tab, s->st_mode, p->fts_statp->st_mode & MBITS); - if (uflag) - if (chmod(p->fts_accpath, s->st_mode)) - (void)printf(" not modified: %s\n", - strerror(errno)); - else - (void)printf(" modified\n"); - else - (void)printf("\n"); - tab = "\t"; - } - if (s->flags & F_NLINK && s->type != F_DIR && - s->st_nlink != p->fts_statp->st_nlink) { - LABEL; - (void)printf("%slink_count expected %ju found %ju\n", - tab, (uintmax_t)s->st_nlink, - (uintmax_t)p->fts_statp->st_nlink); - tab = "\t"; - } - if (s->flags & F_SIZE && s->st_size != p->fts_statp->st_size && - !S_ISDIR(p->fts_statp->st_mode)) { - LABEL; - (void)printf("%ssize expected %jd found %jd\n", tab, - (intmax_t)s->st_size, (intmax_t)p->fts_statp->st_size); - tab = "\t"; - } - /* - * XXX - * Catches nano-second differences, but doesn't display them. - */ - if ((s->flags & F_TIME) && - ((s->st_mtimespec.tv_sec != p->fts_statp->st_mtim.tv_sec) || - (s->st_mtimespec.tv_nsec != p->fts_statp->st_mtim.tv_nsec))) { - LABEL; - (void)printf("%smodification time expected %.24s ", - tab, ctime(&s->st_mtimespec.tv_sec)); - (void)printf("found %.24s", - ctime(&p->fts_statp->st_mtim.tv_sec)); - if (uflag) { - tv[0].tv_sec = s->st_mtimespec.tv_sec; - tv[0].tv_usec = s->st_mtimespec.tv_nsec / 1000; - tv[1] = tv[0]; - if (utimes(p->fts_accpath, tv)) - (void)printf(" not modified: %s\n", - strerror(errno)); - else - (void)printf(" modified\n"); - } else - (void)printf("\n"); - tab = "\t"; - } - if (s->flags & F_CKSUM) { - if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0) { - LABEL; - (void)printf("%scksum: %s: %s\n", - tab, p->fts_accpath, strerror(errno)); - tab = "\t"; - } else if (crc(fd, &val, &len)) { - (void)close(fd); - LABEL; - (void)printf("%scksum: %s: %s\n", - tab, p->fts_accpath, strerror(errno)); - tab = "\t"; - } else { - (void)close(fd); - if (s->cksum != val) { - LABEL; - (void)printf("%scksum expected %lu found %lu\n", - tab, s->cksum, (unsigned long)val); - tab = "\t"; - } - } - } - if ((s->flags & F_FLAGS) && s->st_flags != p->fts_statp->st_flags) { - LABEL; - fflags = flags_to_string(s->st_flags); - (void)printf("%sflags expected \"%s\"", tab, fflags); - free(fflags); - - fflags = flags_to_string(p->fts_statp->st_flags); - (void)printf(" found \"%s\"", fflags); - free(fflags); - - if (uflag) - if (chflags(p->fts_accpath, s->st_flags)) - (void)printf(" not modified: %s\n", - strerror(errno)); - else - (void)printf(" modified\n"); - else - (void)printf("\n"); - tab = "\t"; - } -#ifdef WITH_MD5 - if (s->flags & F_MD5) { - char *new_digest, buf[33]; - - new_digest = MD5File(p->fts_accpath, buf); - if (!new_digest) { - LABEL; - printf("%sMD5: %s: %s\n", tab, p->fts_accpath, - strerror(errno)); - tab = "\t"; - } else if (strcmp(new_digest, s->md5digest)) { - LABEL; - printf("%sMD5 expected %s found %s\n", tab, s->md5digest, - new_digest); - tab = "\t"; - } - } -#endif /* MD5 */ -#ifdef WITH_SHA1 - if (s->flags & F_SHA1) { - char *new_digest, buf[41]; - - new_digest = SHA1_File(p->fts_accpath, buf); - if (!new_digest) { - LABEL; - printf("%sSHA-1: %s: %s\n", tab, p->fts_accpath, - strerror(errno)); - tab = "\t"; - } else if (strcmp(new_digest, s->sha1digest)) { - LABEL; - printf("%sSHA-1 expected %s found %s\n", - tab, s->sha1digest, new_digest); - tab = "\t"; - } - } -#endif /* SHA1 */ -#ifdef WITH_RMD160 - if (s->flags & F_RMD160) { - char *new_digest, buf[41]; - - new_digest = RIPEMD160_File(p->fts_accpath, buf); - if (!new_digest) { - LABEL; - printf("%sRIPEMD160: %s: %s\n", tab, - p->fts_accpath, strerror(errno)); - tab = "\t"; - } else if (strcmp(new_digest, s->rmd160digest)) { - LABEL; - printf("%sRIPEMD160 expected %s found %s\n", - tab, s->rmd160digest, new_digest); - tab = "\t"; - } - } -#endif /* RMD160 */ -#ifdef WITH_SHA256 - if (s->flags & F_SHA256) { - char *new_digest, buf[65]; - - new_digest = SHA256_File(p->fts_accpath, buf); - if (!new_digest) { - LABEL; - printf("%sSHA-256: %s: %s\n", tab, p->fts_accpath, - strerror(errno)); - tab = "\t"; - } else if (strcmp(new_digest, s->sha256digest)) { - LABEL; - printf("%sSHA-256 expected %s found %s\n", - tab, s->sha256digest, new_digest); - tab = "\t"; - } - } -#endif /* SHA256 */ - - if (s->flags & F_SLINK && - strcmp(cp = rlink(p->fts_accpath), s->slink)) { - LABEL; - (void)printf("%slink_ref expected %s found %s\n", - tab, s->slink, cp); - } - return (label); -} - -const char * -inotype(u_int type) -{ - switch(type & S_IFMT) { - case S_IFBLK: - return ("block"); - case S_IFCHR: - return ("char"); - case S_IFDIR: - return ("dir"); - case S_IFIFO: - return ("fifo"); - case S_IFREG: - return ("file"); - case S_IFLNK: - return ("link"); - case S_IFSOCK: - return ("socket"); - default: - return ("unknown"); - } - /* NOTREACHED */ -} - -const char * -ftype(u_int type) -{ - switch(type) { - case F_BLOCK: - return ("block"); - case F_CHAR: - return ("char"); - case F_DIR: - return ("dir"); - case F_FIFO: - return ("fifo"); - case F_FILE: - return ("file"); - case F_LINK: - return ("link"); - case F_SOCK: - return ("socket"); - default: - return ("unknown"); - } - /* NOTREACHED */ -} - -char * -rlink(char *name) -{ - static char lbuf[MAXPATHLEN * 4]; - int len; - char tbuf[MAXPATHLEN]; - - if ((len = readlink(name, tbuf, sizeof(tbuf) - 1)) == -1) - err(1, "line %d: %s", lineno, name); - tbuf[len] = '\0'; - strvis(lbuf, tbuf, VIS_WHITE | VIS_OCTAL); - return (lbuf); -} diff --git a/usr.sbin/fmtree/create.c b/usr.sbin/fmtree/create.c deleted file mode 100644 index edfb09ebd2f2..000000000000 --- a/usr.sbin/fmtree/create.c +++ /dev/null @@ -1,431 +0,0 @@ -/*- - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -#ifndef lint -static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ -#endif -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef MD5 -#include -#endif -#ifdef SHA1 -#include -#endif -#ifdef RMD160 -#include -#endif -#ifdef SHA256 -#include -#endif -#include -#include -#include -#include -#include -#include -#include "mtree.h" -#include "extern.h" - -#define INDENTNAMELEN 15 -#define MAXLINELEN 80 - -static gid_t gid; -static uid_t uid; -static mode_t mode; -static u_long flags = 0xffffffff; - -static int dsort(const FTSENT * const *, const FTSENT * const *); -static void output(int, int *, const char *, ...) __printflike(3, 4); -static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); -static void statf(int, FTSENT *); - -void -cwalk(void) -{ - FTS *t; - FTSENT *p; - time_t cl; - char *argv[2], host[MAXHOSTNAMELEN]; - char dot[] = "."; - int indent = 0; - - if (!nflag) { - (void)time(&cl); - (void)gethostname(host, sizeof(host)); - (void)printf( - "#\t user: %s\n#\tmachine: %s\n", - getlogin(), host); - (void)printf( - "#\t tree: %s\n#\t date: %s", - fullpath, ctime(&cl)); - } - - argv[0] = dot; - argv[1] = NULL; - if ((t = fts_open(argv, ftsoptions, dsort)) == NULL) - err(1, "fts_open()"); - while (errno = 0, (p = fts_read(t))) { - if (iflag) - indent = p->fts_level * 4; - if (check_excludes(p->fts_name, p->fts_path)) { - fts_set(t, p, FTS_SKIP); - continue; - } - switch(p->fts_info) { - case FTS_D: - if (!dflag) - (void)printf("\n"); - if (!nflag) - (void)printf("# %s\n", p->fts_path); - statd(t, p, &uid, &gid, &mode, &flags); - statf(indent, p); - break; - case FTS_DP: - if (!nflag && (p->fts_level > 0)) - (void)printf("%*s# %s\n", indent, "", p->fts_path); - (void)printf("%*s..\n", indent, ""); - if (!dflag) - (void)printf("\n"); - break; - case FTS_DNR: - case FTS_ERR: - case FTS_NS: - warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); - break; - default: - if (!dflag) - statf(indent, p); - break; - - } - } - if (errno != 0) - err(1, "fts_read()"); - (void)fts_close(t); - if (sflag && keys & F_CKSUM) - warnx("%s checksum: %lu", fullpath, (unsigned long)crc_total); -} - -static void -statf(int indent, FTSENT *p) -{ - struct group *gr; - struct passwd *pw; - uint32_t val; - off_t len; - int fd, offset; - char *fflags; - char *escaped_name; - - escaped_name = calloc(1, p->fts_namelen * 4 + 1); - if (escaped_name == NULL) - errx(1, "statf(): calloc() failed"); - strvis(escaped_name, p->fts_name, VIS_WHITE | VIS_OCTAL | VIS_GLOB); - - if (iflag || S_ISDIR(p->fts_statp->st_mode)) - offset = printf("%*s%s", indent, "", escaped_name); - else - offset = printf("%*s %s", indent, "", escaped_name); - - free(escaped_name); - - if (offset > (INDENTNAMELEN + indent)) - offset = MAXLINELEN; - else - offset += printf("%*s", (INDENTNAMELEN + indent) - offset, ""); - - if (!S_ISREG(p->fts_statp->st_mode) && !dflag) - output(indent, &offset, "type=%s", inotype(p->fts_statp->st_mode)); - if (p->fts_statp->st_uid != uid) { - if (keys & F_UNAME) { - pw = getpwuid(p->fts_statp->st_uid); - if (pw != NULL) - output(indent, &offset, "uname=%s", pw->pw_name); - else if (wflag) - warnx("Could not get uname for uid=%u", - p->fts_statp->st_uid); - else - errx(1, - "Could not get uname for uid=%u", - p->fts_statp->st_uid); - } - if (keys & F_UID) - output(indent, &offset, "uid=%u", p->fts_statp->st_uid); - } - if (p->fts_statp->st_gid != gid) { - if (keys & F_GNAME) { - gr = getgrgid(p->fts_statp->st_gid); - if (gr != NULL) - output(indent, &offset, "gname=%s", gr->gr_name); - else if (wflag) - warnx("Could not get gname for gid=%u", - p->fts_statp->st_gid); - else - errx(1, - "Could not get gname for gid=%u", - p->fts_statp->st_gid); - } - if (keys & F_GID) - output(indent, &offset, "gid=%u", p->fts_statp->st_gid); - } - if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) - output(indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); - if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(indent, &offset, "nlink=%ju", - (uintmax_t)p->fts_statp->st_nlink); - if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode)) - output(indent, &offset, "size=%jd", - (intmax_t)p->fts_statp->st_size); - if (keys & F_TIME) - output(indent, &offset, "time=%ld.%09ld", - (long)p->fts_statp->st_mtim.tv_sec, - p->fts_statp->st_mtim.tv_nsec); - if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { - if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || - crc(fd, &val, &len)) - err(1, "%s", p->fts_accpath); - (void)close(fd); - output(indent, &offset, "cksum=%lu", (unsigned long)val); - } -#ifdef MD5 - if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { - char *digest, buf[33]; - - digest = MD5File(p->fts_accpath, buf); - if (!digest) - err(1, "%s", p->fts_accpath); - output(indent, &offset, "md5digest=%s", digest); - } -#endif /* MD5 */ -#ifdef SHA1 - if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) { - char *digest, buf[41]; - - digest = SHA1_File(p->fts_accpath, buf); - if (!digest) - err(1, "%s", p->fts_accpath); - output(indent, &offset, "sha1digest=%s", digest); - } -#endif /* SHA1 */ -#ifdef RMD160 - if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { - char *digest, buf[41]; - - digest = RIPEMD160_File(p->fts_accpath, buf); - if (!digest) - err(1, "%s", p->fts_accpath); - output(indent, &offset, "ripemd160digest=%s", digest); - } -#endif /* RMD160 */ -#ifdef SHA256 - if (keys & F_SHA256 && S_ISREG(p->fts_statp->st_mode)) { - char *digest, buf[65]; - - digest = SHA256_File(p->fts_accpath, buf); - if (!digest) - err(1, "%s", p->fts_accpath); - output(indent, &offset, "sha256digest=%s", digest); - } -#endif /* SHA256 */ - if (keys & F_SLINK && - (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) - output(indent, &offset, "link=%s", rlink(p->fts_accpath)); - if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { - fflags = flags_to_string(p->fts_statp->st_flags); - output(indent, &offset, "flags=%s", fflags); - free(fflags); - } - (void)putchar('\n'); -} - -#define MAXGID 5000 -#define MAXUID 5000 -#define MAXMODE MBITS + 1 -#define MAXFLAGS 256 -#define MAXS 16 - -static int -statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, u_long *pflags) -{ - FTSENT *p; - gid_t sgid; - uid_t suid; - mode_t smode; - u_long sflags; - struct group *gr; - struct passwd *pw; - gid_t savegid = *pgid; - uid_t saveuid = *puid; - mode_t savemode = *pmode; - u_long saveflags = *pflags; - u_short maxgid, maxuid, maxmode, maxflags; - u_short g[MAXGID], u[MAXUID], m[MAXMODE], f[MAXFLAGS]; - char *fflags; - static int first = 1; - - if ((p = fts_children(t, 0)) == NULL) { - if (errno) - err(1, "%s", RP(parent)); - return (1); - } - - bzero(g, sizeof(g)); - bzero(u, sizeof(u)); - bzero(m, sizeof(m)); - bzero(f, sizeof(f)); - - maxuid = maxgid = maxmode = maxflags = 0; - for (; p; p = p->fts_link) { - if (!dflag || (dflag && S_ISDIR(p->fts_statp->st_mode))) { - smode = p->fts_statp->st_mode & MBITS; - if (smode < MAXMODE && ++m[smode] > maxmode) { - savemode = smode; - maxmode = m[smode]; - } - sgid = p->fts_statp->st_gid; - if (sgid < MAXGID && ++g[sgid] > maxgid) { - savegid = sgid; - maxgid = g[sgid]; - } - suid = p->fts_statp->st_uid; - if (suid < MAXUID && ++u[suid] > maxuid) { - saveuid = suid; - maxuid = u[suid]; - } - - /* - * XXX - * note that the below will break when file flags - * are extended beyond the first 4 bytes of each - * half word of the flags - */ -#define FLAGS2IDX(f) ((f & 0xf) | ((f >> 12) & 0xf0)) - sflags = p->fts_statp->st_flags; - if (FLAGS2IDX(sflags) < MAXFLAGS && - ++f[FLAGS2IDX(sflags)] > maxflags) { - saveflags = sflags; - maxflags = f[FLAGS2IDX(sflags)]; - } - } - } - /* - * If the /set record is the same as the last one we do not need to output - * a new one. So first we check to see if anything changed. Note that we - * always output a /set record for the first directory. - */ - if ((((keys & F_UNAME) | (keys & F_UID)) && (*puid != saveuid)) || - (((keys & F_GNAME) | (keys & F_GID)) && (*pgid != savegid)) || - ((keys & F_MODE) && (*pmode != savemode)) || - ((keys & F_FLAGS) && (*pflags != saveflags)) || - (first)) { - first = 0; - if (dflag) - (void)printf("/set type=dir"); - else - (void)printf("/set type=file"); - if (keys & F_UNAME) { - pw = getpwuid(saveuid); - if (pw != NULL) - (void)printf(" uname=%s", pw->pw_name); - else if (wflag) - warnx( "Could not get uname for uid=%u", saveuid); - else - errx(1, "Could not get uname for uid=%u", saveuid); - } - if (keys & F_UID) - (void)printf(" uid=%lu", (u_long)saveuid); - if (keys & F_GNAME) { - gr = getgrgid(savegid); - if (gr != NULL) - (void)printf(" gname=%s", gr->gr_name); - else if (wflag) - warnx("Could not get gname for gid=%u", savegid); - else - errx(1, "Could not get gname for gid=%u", savegid); - } - if (keys & F_GID) - (void)printf(" gid=%lu", (u_long)savegid); - if (keys & F_MODE) - (void)printf(" mode=%#o", savemode); - if (keys & F_NLINK) - (void)printf(" nlink=1"); - if (keys & F_FLAGS) { - fflags = flags_to_string(saveflags); - (void)printf(" flags=%s", fflags); - free(fflags); - } - (void)printf("\n"); - *puid = saveuid; - *pgid = savegid; - *pmode = savemode; - *pflags = saveflags; - } - return (0); -} - -static int -dsort(const FTSENT * const *a, const FTSENT * const *b) -{ - if (S_ISDIR((*a)->fts_statp->st_mode)) { - if (!S_ISDIR((*b)->fts_statp->st_mode)) - return (1); - } else if (S_ISDIR((*b)->fts_statp->st_mode)) - return (-1); - return (strcmp((*a)->fts_name, (*b)->fts_name)); -} *** 2218 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Mar 2 21:22:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A49D855117D; Tue, 2 Mar 2021 21:22: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 4Dqqpf2Tf6z3NW3; Tue, 2 Mar 2021 21:22: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 091B01DD24; Tue, 2 Mar 2021 21:22: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 122LMXBC029748; Tue, 2 Mar 2021 21:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122LMXtc029747; Tue, 2 Mar 2021 21:22:33 GMT (envelope-from git) Date: Tue, 2 Mar 2021 21:22:33 GMT Message-Id: <202103022122.122LMXtc029747@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: 13686dffbbeb - main - Regenerate src.conf(5) after FMTREE removal 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: 13686dffbbeb7549d4e6ff54f941c87d4bb558f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 21:22:34 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=13686dffbbeb7549d4e6ff54f941c87d4bb558f5 commit 13686dffbbeb7549d4e6ff54f941c87d4bb558f5 Author: Kyle Evans AuthorDate: 2021-03-02 21:21:46 +0000 Commit: Kyle Evans CommitDate: 2021-03-02 21:22:06 +0000 Regenerate src.conf(5) after FMTREE removal --- share/man/man5/src.conf.5 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index e9fe277f23e7..5d211bc1cc31 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -630,11 +630,6 @@ and .It Va WITHOUT_FLOPPY Set to not build or install programs for operating floppy disk driver. -.It Va WITH_FMTREE -Set to build and install -.Pa /usr/sbin/fmtree . -This option is deprecated, and will be gone in -.Fx 14.0 . .It Va WITHOUT_FORMAT_EXTENSIONS Set to not enable .Fl fformat-extensions From owner-dev-commits-src-all@freebsd.org Tue Mar 2 21:59:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2E6C552718; Tue, 2 Mar 2021 21:59:02 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_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 4Dqrck5ZVLz3Ql5; Tue, 2 Mar 2021 21:59:02 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id 6B80316057; Tue, 2 Mar 2021 22:58:55 +0100 (CET) Date: Tue, 02 Mar 2021 22:58:54 +0100 From: Steffen Nurpmeso To: Ryan Moeller Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ee21ee1572d4 - main - openzfs: attach pam_zfs_key to build Message-ID: <20210302215854.8IaH7%steffen@sdaoden.eu> In-Reply-To: <202103021227.122CRUDH011301@gitrepo.freebsd.org> References: <202103021227.122CRUDH011301@gitrepo.freebsd.org> User-Agent: s-nail v14.9.22-99-g733424fe OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4Dqrck5ZVLz3Ql5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 21:59:02 -0000 Ryan Moeller wrote in <202103021227.122CRUDH011301@gitrepo.freebsd.org>: ... |URL: https://cgit.FreeBSD.org/src/commit/?id=ee21ee1572d40a3b74f18638dae\ |38c1a9ad1e9e3 | |commit ee21ee1572d40a3b74f18638dae38c1a9ad1e9e3 |Author: Greg V |AuthorDate: 2021-03-02 11:01:14 +0000 |Commit: Ryan Moeller |CommitDate: 2021-03-02 12:26:59 +0000 | | openzfs: attach pam_zfs_key to build | | This PAM module allows unlocking encrypted user home datasets when | logging in (and changing passphrase when changing the account password)\ | , | see https://github.com/openzfs/zfs/pull/9903 | | Also supposed to unload the key when the last session for the user is | done, but there are EBUSY issues: | https://github.com/openzfs/zfs/issues/11222#issuecomment-731897858 Very interesting. This is "cool" per se. (Especially on encrypted block devices where a resume requires a password anyhow. I would not do it like this for myself, but don't mind this.) As i could not figure it out, how do you manage a session without having a supervisor like (please let me say the greedy monster) systemd? I wrote a pam_xdg module [1] to create the /run/user/PID of the XDG spec of FreeDesktop (as well as inject the other XDG path environment variables, optionally), but in the end i had to strip it down to the absolute core because session handling seemed impossible. (As in, daemonized scripts and important things like tmux, they keep on living even after the "session" has ended.) (In my superficial opinion PAM is a terrible and under-documented mess, and each and every module is left alone fiddling around with effective-[gu]id flags, for example, in order to work gracefully under all circumstances.) [1] https://git.sdaoden.eu/browse?p=s-toolbox.git;a=blob;f=pam_xdg.c;h=4c121e93ca76d2f53a9de67aa9bc100f639f6a05;hb=HEAD --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From owner-dev-commits-src-all@freebsd.org Tue Mar 2 22:20:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0F99553134; Tue, 2 Mar 2021 22:20: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 4Dqs5N53rRz3htW; Tue, 2 Mar 2021 22:20: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 A13BE1E80B; Tue, 2 Mar 2021 22:20: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 122MKOEH004621; Tue, 2 Mar 2021 22:20:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122MKOur004620; Tue, 2 Mar 2021 22:20:24 GMT (envelope-from git) Date: Tue, 2 Mar 2021 22:20:24 GMT Message-Id: <202103022220.122MKOur004620@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: c04199affeac - main - nfsclient: Fix ReadDS/WriteDS/CommitDS nfsstats RPC counts for a NFSv3 DS 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: c04199affeacbd9e9dda3aaf5ca0b1b180031e78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 22:20:24 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c04199affeacbd9e9dda3aaf5ca0b1b180031e78 commit c04199affeacbd9e9dda3aaf5ca0b1b180031e78 Author: Rick Macklem AuthorDate: 2021-03-02 22:18:23 +0000 Commit: Rick Macklem CommitDate: 2021-03-02 22:18:23 +0000 nfsclient: Fix ReadDS/WriteDS/CommitDS nfsstats RPC counts for a NFSv3 DS During a recent virtual NFSv4 testing event, a bug in the FreeBSD client was detected when doing I/O DS operations on a Flexible File Layout pNFS server. For an NFSv3 DS, the Read/Write/Commit nfsstats were incremented instead of the ReadDS/WriteDS/CommitDS counts. This patch fixes this. Only the RPC counts reported by nfsstat(1) were affected by this bug, the I/O operations were performed correctly. MFC after: 2 weeks --- sys/fs/nfs/nfsport.h | 1 + sys/fs/nfsclient/nfs_clrpcops.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 9f2789f57bec..255c9a47ebdf 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -1006,6 +1006,7 @@ bool ncl_pager_setsize(struct vnode *vp, u_quad_t *nsizep); * "out by one" without disastrous consequences. */ #define NFSINCRGLOBAL(a) ((a)++) +#define NFSDECRGLOBAL(a) ((a)--) /* * Assorted funky stuff to make things work under Darwin8. diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 0e503e34810b..527a47338b3f 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -65,6 +65,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, dssameconn, CTLFLAG_RW, /* * Global variables */ +extern struct nfsstatsv1 nfsstatsv1; extern int nfs_numnfscbd; extern struct timeval nfsboottime; extern u_int32_t newnfs_false, newnfs_true; @@ -6320,6 +6321,8 @@ nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4stateid_t *stateidp, int *eofp, } else { nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); + NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); } NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED * 3); @@ -6395,6 +6398,8 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, } else { nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); + NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 3 * NFSX_UNSIGNED); } @@ -6522,6 +6527,8 @@ nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_commit, } else { nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); + NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 3 * NFSX_UNSIGNED); } @@ -6737,9 +6744,12 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp, nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); vers = NFS_VER4; - } else + } else { nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); + NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); + } NFSCL_DEBUG(4, "nfsrpc_commitds: vers=%d minvers=%d\n", vers, minorvers); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + NFSX_UNSIGNED); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 22:22:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 604EB553328; Tue, 2 Mar 2021 22:22: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 4Dqs7x1lqqz3jJL; Tue, 2 Mar 2021 22:22: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 2F0351E7C7; Tue, 2 Mar 2021 22:22: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 122MMbpU008993; Tue, 2 Mar 2021 22:22:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122MMbUd008992; Tue, 2 Mar 2021 22:22:37 GMT (envelope-from git) Date: Tue, 2 Mar 2021 22:22:37 GMT Message-Id: <202103022222.122MMbUd008992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 71900a794da0 - main - mpr: big-endian support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71900a794da046ad5322caae2774aed5b3d361b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 22:22:37 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=71900a794da046ad5322caae2774aed5b3d361b9 commit 71900a794da046ad5322caae2774aed5b3d361b9 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-03-02 14:05:15 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-03-03 01:21:42 +0000 mpr: big-endian support This fixes mpr driver on big-endian devices. Tested on powerpc64 and powerpc64le targets using a SAS9300-8i card (LSISAS3008 pci vendor=0x1000 device=0x0097) Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, Sreekanth Reddy (by email) Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25785 --- sys/dev/mpr/mpr.c | 75 ++++++++++++++++++++++++++++++++++------------- sys/dev/mpr/mpr_config.c | 16 +++++----- sys/dev/mpr/mpr_mapping.c | 4 +-- sys/dev/mpr/mpr_sas.c | 14 +++++---- sys/dev/mpr/mpr_sas_lsi.c | 21 +++++++------ sys/dev/mpr/mpr_table.c | 66 ++++++++++++++++++++--------------------- sys/dev/mpr/mprvar.h | 4 +++ 7 files changed, 119 insertions(+), 81 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 678fe5052fca..5d57be27f9b2 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -111,6 +111,7 @@ static int mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag); static int mpr_debug_sysctl(SYSCTL_HANDLER_ARGS); static int mpr_dump_reqs(SYSCTL_HANDLER_ARGS); static void mpr_parse_debug(struct mpr_softc *sc, char *list); +static void adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts); SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "MPR Driver Parameters"); @@ -413,7 +414,7 @@ mpr_resize_queues(struct mpr_softc *sc) * the size of an IEEE Simple SGE. */ if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { - chain_seg_size = htole16(sc->facts->IOCMaxChainSegmentSize); + chain_seg_size = sc->facts->IOCMaxChainSegmentSize; if (chain_seg_size == 0) chain_seg_size = MPR_DEFAULT_CHAIN_SEG_SIZE; sc->chain_frame_size = chain_seg_size * @@ -1054,15 +1055,21 @@ mpr_request_sync(struct mpr_softc *sc, void *req, MPI2_DEFAULT_REPLY *reply, mpr_dprint(sc, MPR_FAULT, "Timeout reading doorbell 0\n"); return (ENXIO); } + + /* + * If in a BE platform, swap bytes using le16toh to not + * disturb 8 bit field neighbors in destination structure + * pointed by data16. + */ data16[0] = - mpr_regread(sc, MPI2_DOORBELL_OFFSET) & MPI2_DOORBELL_DATA_MASK; + le16toh(mpr_regread(sc, MPI2_DOORBELL_OFFSET)) & MPI2_DOORBELL_DATA_MASK; mpr_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); if (mpr_wait_db_int(sc) != 0) { mpr_dprint(sc, MPR_FAULT, "Timeout reading doorbell 1\n"); return (ENXIO); } data16[1] = - mpr_regread(sc, MPI2_DOORBELL_OFFSET) & MPI2_DOORBELL_DATA_MASK; + le16toh(mpr_regread(sc, MPI2_DOORBELL_OFFSET)) & MPI2_DOORBELL_DATA_MASK; mpr_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); /* Number of 32bit words in the message */ @@ -1087,7 +1094,7 @@ mpr_request_sync(struct mpr_softc *sc, void *req, MPI2_DEFAULT_REPLY *reply, "Timeout reading doorbell %d\n", i); return (ENXIO); } - data16[i] = mpr_regread(sc, MPI2_DOORBELL_OFFSET) & + data16[i] = le16toh(mpr_regread(sc, MPI2_DOORBELL_OFFSET)) & MPI2_DOORBELL_DATA_MASK; mpr_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); } @@ -1142,9 +1149,8 @@ mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm) mpr_regwrite(sc, MPI26_ATOMIC_REQUEST_DESCRIPTOR_POST_OFFSET, rd.u.low); } else { - rd.u.low = cm->cm_desc.Words.Low; - rd.u.high = cm->cm_desc.Words.High; - rd.word = htole64(rd.word); + rd.u.low = htole32(cm->cm_desc.Words.Low); + rd.u.high = htole32(cm->cm_desc.Words.High); mpr_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET, rd.u.low); mpr_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET, @@ -1152,6 +1158,36 @@ mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm) } } +/* + * Ioc facts are read in 16 bit words and and stored with le16toh, + * this takes care of proper U8 fields endianness in + * MPI2_IOC_FACTS_REPLY, but we still need to swap back U16 fields. + */ +static void +adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts) +{ + facts->HeaderVersion = le16toh(facts->HeaderVersion); + facts->Reserved1 = le16toh(facts->Reserved1); + facts->IOCExceptions = le16toh(facts->IOCExceptions); + facts->IOCStatus = le16toh(facts->IOCStatus); + facts->IOCLogInfo = le32toh(facts->IOCLogInfo); + facts->RequestCredit = le16toh(facts->RequestCredit); + facts->ProductID = le16toh(facts->ProductID); + facts->IOCCapabilities = le32toh(facts->IOCCapabilities); + facts->IOCRequestFrameSize = le16toh(facts->IOCRequestFrameSize); + facts->IOCMaxChainSegmentSize = le16toh(facts->IOCMaxChainSegmentSize); + facts->MaxInitiators = le16toh(facts->MaxInitiators); + facts->MaxTargets = le16toh(facts->MaxTargets); + facts->MaxSasExpanders = le16toh(facts->MaxSasExpanders); + facts->MaxEnclosures = le16toh(facts->MaxEnclosures); + facts->ProtocolFlags = le16toh(facts->ProtocolFlags); + facts->HighPriorityCredit = le16toh(facts->HighPriorityCredit); + facts->MaxReplyDescriptorPostQueueDepth = le16toh(facts->MaxReplyDescriptorPostQueueDepth); + facts->MaxDevHandle = le16toh(facts->MaxDevHandle); + facts->MaxPersistentEntries = le16toh(facts->MaxPersistentEntries); + facts->MinDevHandle = le16toh(facts->MinDevHandle); +} + /* * Just the FACTS, ma'am. */ @@ -1173,6 +1209,9 @@ mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) request.Function = MPI2_FUNCTION_IOC_FACTS; error = mpr_request_sync(sc, &request, reply, req_sz, reply_sz, 5); + adjust_iocfacts_endianness(facts); + mpr_dprint(sc, MPR_TRACE, "facts->IOCCapabilities 0x%x\n", facts->IOCCapabilities); + mpr_dprint(sc, MPR_INIT, "%s exit, error= %d\n", __func__, error); return (error); } @@ -1231,10 +1270,10 @@ mpr_send_iocinit(struct mpr_softc *sc) init.HostPageSize = HOST_PAGE_SIZE_4K; error = mpr_request_sync(sc, &init, &reply, req_sz, reply_sz, 5); - if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) + if ((le16toh(reply.IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) error = ENXIO; - mpr_dprint(sc, MPR_INIT, "IOCInit status= 0x%x\n", reply.IOCStatus); + mpr_dprint(sc, MPR_INIT, "IOCInit status= 0x%x\n", le16toh(reply.IOCStatus)); mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); return (error); } @@ -1532,7 +1571,7 @@ mpr_alloc_requests(struct mpr_softc *sc) cm->cm_req_busaddr = sc->req_busaddr + i * sc->reqframesz; cm->cm_sense = &sc->sense_frames[i]; cm->cm_sense_busaddr = sc->sense_busaddr + i * MPR_SENSE_LEN; - cm->cm_desc.Default.SMID = i; + cm->cm_desc.Default.SMID = htole16(i); cm->cm_sc = sc; cm->cm_state = MPR_CM_STATE_BUSY; TAILQ_INIT(&cm->cm_chain_list); @@ -1650,7 +1689,7 @@ mpr_init_queues(struct mpr_softc *sc) * Initialize all of the free queue entries. */ for (i = 0; i < sc->fqdepth; i++) { - sc->free_queue[i] = sc->reply_busaddr + (i * sc->replyframesz); + sc->free_queue[i] = htole32(sc->reply_busaddr + (i * sc->replyframesz)); } sc->replyfreeindex = sc->num_replies; @@ -2719,7 +2758,8 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else - bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, 16); + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + evtreq->EventMasks[i] = htole32(sc->event_mask[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -2773,7 +2813,8 @@ mpr_reregister_events(struct mpr_softc *sc) bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else - bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, 16); + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + evtreq->EventMasks[i] = htole32(sc->event_mask[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -3446,8 +3487,6 @@ mpr_push_sge(struct mpr_command *cm, MPI2_SGE_SIMPLE64 *sge, size_t len, /* Endian Safe code */ sge_flags = sge->FlagsLength; sge->FlagsLength = htole32(sge_flags); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sge, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); } @@ -3474,8 +3513,6 @@ mpr_push_sge(struct mpr_command *cm, MPI2_SGE_SIMPLE64 *sge, size_t len, /* Endian Safe code */ sge_flags = sge->FlagsLength; sge->FlagsLength = htole32(sge_flags); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sge, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); return (0); @@ -3534,8 +3571,6 @@ mpr_push_ieee_sge(struct mpr_command *cm, void *sgep, int segsleft) /* Endian Safe code */ sge_length = sge->Length; sge->Length = htole32(sge_length); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sgep, cm->cm_sge, ieee_sge_size); cm->cm_sge = (MPI25_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + @@ -3553,8 +3588,6 @@ mpr_push_ieee_sge(struct mpr_command *cm, void *sgep, int segsleft) /* Endian Safe code */ sge_length = sge->Length; sge->Length = htole32(sge_length); - sge->Address.High = htole32(sge->Address.High); - sge->Address.Low = htole32(sge->Address.Low); bcopy(sgep, cm->cm_sge, ieee_sge_size); cm->cm_sge = (MPI25_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + ieee_sge_size); diff --git a/sys/dev/mpr/mpr_config.c b/sys/dev/mpr/mpr_config.c index 1916dc1cb3dc..2b5bc7e3964b 100644 --- a/sys/dev/mpr/mpr_config.c +++ b/sys/dev/mpr/mpr_config.c @@ -142,7 +142,7 @@ mpr_config_get_ioc_pg8(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 8; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -274,7 +274,7 @@ mpr_config_get_iounit_pg8(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 8; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -406,7 +406,7 @@ mpr_config_get_man_pg11(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 11; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -602,7 +602,7 @@ mpr_config_get_dpm_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->PageAddress = sc->max_dpm_entries << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; request->ExtPageLength = mpi_reply->ExtPageLength; - cm->cm_length = le16toh(request->ExtPageLength) * 4; + cm->cm_length = le16toh(request->ExtPageLength) * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1282,7 +1282,7 @@ mpr_config_get_bios_pg3(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 3; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->Header.PageLength = mpi_reply->Header.PageLength; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1414,7 +1414,7 @@ mpr_config_get_raid_volume_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t request->Header.PageLength = mpi_reply->Header.PageLength; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->PageAddress = page_address; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1546,7 +1546,7 @@ mpr_config_get_raid_volume_pg1(struct mpr_softc *sc, Mpi2ConfigReply_t request->Header.PageLength = mpi_reply->Header.PageLength; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->PageAddress = htole32(form | handle); - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; @@ -1704,7 +1704,7 @@ mpr_config_get_raid_pd_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageLength = mpi_reply->Header.PageLength; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->PageAddress = page_address; - cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_length = mpi_reply->Header.PageLength * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; diff --git a/sys/dev/mpr/mpr_mapping.c b/sys/dev/mpr/mpr_mapping.c index 2b83ce49c158..ef97080fb175 100644 --- a/sys/dev/mpr/mpr_mapping.c +++ b/sys/dev/mpr/mpr_mapping.c @@ -2567,7 +2567,7 @@ mpr_mapping_initialize(struct mpr_softc *sc) sc->pending_map_events = 0; sc->num_enc_table_entries = 0; sc->num_rsvd_entries = 0; - sc->max_dpm_entries = sc->ioc_pg8.MaxPersistentEntries; + sc->max_dpm_entries = le16toh(sc->ioc_pg8.MaxPersistentEntries); sc->is_dpm_enable = (sc->max_dpm_entries) ? 1 : 0; sc->track_mapping_events = 0; @@ -2581,7 +2581,7 @@ mpr_mapping_initialize(struct mpr_softc *sc) if (ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0) sc->num_rsvd_entries = 1; - volume_mapping_flags = sc->ioc_pg8.IRVolumeMappingFlags & + volume_mapping_flags = le16toh(sc->ioc_pg8.IRVolumeMappingFlags) & MPI2_IOCPAGE8_IRFLAGS_MASK_VOLUME_MAPPING_MODE; if (sc->ir_firmware && (volume_mapping_flags == MPI2_IOCPAGE8_IRFLAGS_LOW_VOLUME_MAPPING)) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index de61ac7b8dd8..a60881553f01 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -2034,7 +2034,7 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb) } if ((lun != NULL) && (lun->eedp_formatted)) { - req->EEDPBlockSize = htole16(lun->eedp_block_size); + req->EEDPBlockSize = htole32(lun->eedp_block_size); eedp_flags |= (MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG | MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD); @@ -2400,10 +2400,6 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) target_id_t target_id; MPR_FUNCTRACE(sc); - mpr_dprint(sc, MPR_TRACE, - "cm %p SMID %u ccb %p reply %p outstanding %u\n", cm, - cm->cm_desc.Default.SMID, cm->cm_ccb, cm->cm_reply, - cm->cm_targ->outstanding); callout_stop(&cm->cm_callout); mtx_assert(&sc->mpr_mtx, MA_OWNED); @@ -2413,6 +2409,12 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) csio = &ccb->csio; target_id = csio->ccb_h.target_id; rep = (MPI2_SCSI_IO_REPLY *)cm->cm_reply; + mpr_dprint(sc, MPR_TRACE, + "cm %p SMID %u ccb %p reply %p outstanding %u csio->scsi_status 0x%x," + "csio->dxfer_len 0x%x, csio->msg_le 0x%xn\n", cm, + cm->cm_desc.Default.SMID, cm->cm_ccb, cm->cm_reply, + cm->cm_targ->outstanding, csio->scsi_status, + csio->dxfer_len, csio->msg_len); /* * XXX KDM if the chain allocation fails, does it matter if we do * the sync and unload here? It is simpler to do it in every case, @@ -3483,7 +3485,7 @@ mprsas_portenable_complete(struct mpr_softc *sc, struct mpr_command *cm) reply = (MPI2_PORT_ENABLE_REPLY *)cm->cm_reply; if (reply == NULL) mpr_dprint(sc, MPR_FAULT, "Portenable NULL reply\n"); - else if (le16toh(reply->IOCStatus & MPI2_IOCSTATUS_MASK) != + else if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) mpr_dprint(sc, MPR_FAULT, "Portenable failed\n"); diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c index db4cbbb24440..3d698cc4d431 100644 --- a/sys/dev/mpr/mpr_sas_lsi.c +++ b/sys/dev/mpr/mpr_sas_lsi.c @@ -160,11 +160,11 @@ mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, } bcopy(event->EventData, fw_event->event_data, sz); - fw_event->event = event->Event; - if ((event->Event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE || - event->Event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && + fw_event->event = le16toh(event->Event); + if ((fw_event->event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE || + fw_event->event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && sc->track_mapping_events) sc->pending_map_events++; @@ -173,9 +173,9 @@ mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, * are processed. Increment the startup_refcount and decrement it after * events are processed. */ - if ((event->Event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || - event->Event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && + if ((fw_event->event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || + fw_event->event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && sc->wait_for_port_enable) mprsas_startup_increment(sc->sassc); @@ -867,9 +867,8 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate) parent_devinfo = le32toh(parent_config_page.DeviceInfo); } } - /* TODO Check proper endianness */ - sas_address = config_page.SASAddress.High; - sas_address = (sas_address << 32) | config_page.SASAddress.Low; + sas_address = htole32(config_page.SASAddress.High); + sas_address = (sas_address << 32) | htole32(config_page.SASAddress.Low); mpr_dprint(sc, MPR_MAPPING, "Handle 0x%04x SAS Address from SAS device " "page0 = %jx\n", handle, sas_address); diff --git a/sys/dev/mpr/mpr_table.c b/sys/dev/mpr/mpr_table.c index c2f31af14e91..719866b5fa74 100644 --- a/sys/dev/mpr/mpr_table.c +++ b/sys/dev/mpr/mpr_table.c @@ -316,7 +316,7 @@ mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) MPR_PRINTFIELD_START(sc, "PortFacts"); MPR_PRINTFIELD(sc, facts, PortNumber, %d); MPR_PRINTFIELD(sc, facts, PortType, 0x%x); - MPR_PRINTFIELD(sc, facts, MaxPostedCmdBuffers, %d); + MPR_PRINTFIELD_16(sc, facts, MaxPostedCmdBuffers, %d); } void @@ -324,33 +324,33 @@ mpr_print_evt_generic(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event { MPR_PRINTFIELD_START(sc, "EventReply"); - MPR_PRINTFIELD(sc, event, EventDataLength, %d); + MPR_PRINTFIELD_16(sc, event, EventDataLength, %d); MPR_PRINTFIELD(sc, event, AckRequired, %d); mpr_print_field(sc, "Event: %s (0x%x)\n", - mpr_describe_table(mpr_event_names, event->Event), event->Event); - MPR_PRINTFIELD(sc, event, EventContext, 0x%x); + mpr_describe_table(mpr_event_names, le16toh(event->Event)), le16toh(event->Event)); + MPR_PRINTFIELD_32(sc, event, EventContext, 0x%x); } void mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS Device Page 0"); - MPR_PRINTFIELD(sc, buf, Slot, %d); - MPR_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x); + MPR_PRINTFIELD_16(sc, buf, Slot, %d); + MPR_PRINTFIELD_16(sc, buf, EnclosureHandle, 0x%x); mpr_print_field(sc, "SASAddress: 0x%jx\n", mpr_to_u64(&buf->SASAddress)); - MPR_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, buf, ParentDevHandle, 0x%x); MPR_PRINTFIELD(sc, buf, PhyNum, %d); MPR_PRINTFIELD(sc, buf, AccessStatus, 0x%x); - MPR_PRINTFIELD(sc, buf, DevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, buf, DevHandle, 0x%x); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x); MPR_PRINTFIELD(sc, buf, ZoneGroup, %d); - mpr_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo, + mpr_print_field(sc, "DeviceInfo: %b,%s\n", le32toh(buf->DeviceInfo), "\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit" "\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct" "\15LsiDev" "\16AtapiDev" "\17SepDev", mpr_describe_table(mpr_sasdev0_devtype, buf->DeviceInfo & 0x03)); - MPR_PRINTFIELD(sc, buf, Flags, 0x%x); + MPR_PRINTFIELD_16(sc, buf, Flags, 0x%x); MPR_PRINTFIELD(sc, buf, PhysicalPort, %d); MPR_PRINTFIELD(sc, buf, MaxPortConnections, %d); mpr_print_field(sc, "DeviceName: 0x%jx\n", @@ -366,7 +366,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) mpr_print_evt_generic(sc, event); - switch(event->Event) { + switch(le16toh(event->Event)) { case MPI2_EVENT_SAS_DISCOVERY: { MPI2_EVENT_DATA_SAS_DISCOVERY *data; @@ -378,7 +378,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) mpr_describe_table(mpr_sasdisc_reason, data->ReasonCode)); MPR_PRINTFIELD(sc, data, PhysicalPort, %d); mpr_print_field(sc, "DiscoveryStatus: %b\n", - data->DiscoveryStatus, "\20" + le32toh(data->DiscoveryStatus), "\20" "\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout" "\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed" "\11SmpCrcError" "\12SubSubLink" "\13TableTableLink" @@ -397,8 +397,8 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *) &event->EventData; - MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); - MPR_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, EnclosureHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, ExpanderDevHandle, 0x%x); MPR_PRINTFIELD(sc, data, NumPhys, %d); MPR_PRINTFIELD(sc, data, NumEntries, %d); MPR_PRINTFIELD(sc, data, StartPhyNum, %d); @@ -411,7 +411,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) phynum = data->StartPhyNum + i; mpr_print_field(sc, "PHY[%d].AttachedDevHandle: 0x%04x\n", phynum, - phy->AttachedDevHandle); + le16toh(phy->AttachedDevHandle)); mpr_print_field(sc, "PHY[%d].LinkRate: %s (0x%x)\n", phynum, mpr_describe_table(mpr_linkrate_names, @@ -428,13 +428,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *) &event->EventData; - MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, EnclosureHandle, 0x%x); mpr_print_field(sc, "ReasonCode: %s\n", mpr_describe_table(mpr_sastopo_exp, data->ReasonCode)); MPR_PRINTFIELD(sc, data, PhysicalPort, %d); - MPR_PRINTFIELD(sc, data, NumSlots, %d); - MPR_PRINTFIELD(sc, data, StartSlot, %d); - MPR_PRINTFIELD(sc, data, PhyBits, 0x%x); + MPR_PRINTFIELD_16(sc, data, NumSlots, %d); + MPR_PRINTFIELD_16(sc, data, StartSlot, %d); + MPR_PRINTFIELD_32(sc, data, PhyBits, 0x%x); break; } case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: @@ -443,12 +443,12 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *) &event->EventData; - MPR_PRINTFIELD(sc, data, TaskTag, 0x%x); + MPR_PRINTFIELD_16(sc, data, TaskTag, 0x%x); mpr_print_field(sc, "ReasonCode: %s\n", mpr_describe_table(mpr_sasdev_reason, data->ReasonCode)); MPR_PRINTFIELD(sc, data, ASC, 0x%x); MPR_PRINTFIELD(sc, data, ASCQ, 0x%x); - MPR_PRINTFIELD(sc, data, DevHandle, 0x%x); + MPR_PRINTFIELD_16(sc, data, DevHandle, 0x%x); mpr_print_field(sc, "SASAddress: 0x%jx\n", mpr_to_u64(&data->SASAddress)); break; @@ -476,24 +476,24 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) MPR_PRINTFIELD(sc, buf, PhysicalPort, %d); MPR_PRINTFIELD(sc, buf, NumPhys, %d); MPR_PRINTFIELD(sc, buf, Phy, %d); - MPR_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d); + MPR_PRINTFIELD_16(sc, buf, NumTableEntriesProgrammed, %d); mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate); - MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); + MPR_PRINTFIELD_16(sc, buf, AttachedDevHandle, 0x%04x); mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); + (le32toh(buf->PhyInfo) >> 16) & 0xf), le32toh(buf->PhyInfo)); mpr_print_field(sc, "AttachedDeviceInfo: %b,%s\n", - buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit" + le32toh(buf->AttachedDeviceInfo), "\20" "\4SATAhost" "\5SMPinit" "\6STPinit" "\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg" "\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev", mpr_describe_table(mpr_sasdev0_devtype, - buf->AttachedDeviceInfo & 0x03)); - MPR_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x); + le32toh(buf->AttachedDeviceInfo) & 0x03)); + MPR_PRINTFIELD_16(sc, buf, ExpanderDevHandle, 0x%04x); MPR_PRINTFIELD(sc, buf, ChangeCount, %d); mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, @@ -501,10 +501,10 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) MPR_PRINTFIELD(sc, buf, PhyIdentifier, %d); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); MPR_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x); - MPR_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x); + MPR_PRINTFIELD_32(sc, buf, AttachedPhyInfo, 0x%x); mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); + le32toh(buf->AttachedPhyInfo) & 0xf), le32toh(buf->AttachedPhyInfo)); MPR_PRINTFIELD(sc, buf, ZoneGroup, %d); MPR_PRINTFIELD(sc, buf, SelfConfigStatus, 0x%x); } @@ -513,12 +513,12 @@ void mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS PHY Page 0"); - MPR_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x); - MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); + MPR_PRINTFIELD_16(sc, buf, OwnerDevHandle, 0x%04x); + MPR_PRINTFIELD_16(sc, buf, AttachedDevHandle, 0x%04x); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); + le32toh(buf->AttachedPhyInfo) & 0xf), le32toh(buf->AttachedPhyInfo)); mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); @@ -529,7 +529,7 @@ mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) MPR_PRINTFIELD(sc, buf, Flags, 0x%x); mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, - (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); + (le32toh(buf->PhyInfo) >> 16) & 0xf), le32toh(buf->PhyInfo)); mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate); diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h index 3728a6b5a131..ce755188d706 100644 --- a/sys/dev/mpr/mprvar.h +++ b/sys/dev/mpr/mprvar.h @@ -764,6 +764,10 @@ do { \ mpr_printf((sc), tag "\n") #define MPR_PRINTFIELD(sc, facts, attr, fmt) \ mpr_print_field((sc), #attr ": " #fmt "\n", (facts)->attr) +#define MPR_PRINTFIELD_16(sc, facts, attr, fmt) \ + mpr_print_field((sc), #attr ": " #fmt "\n", le16toh((facts)->attr)) +#define MPR_PRINTFIELD_32(sc, facts, attr, fmt) \ + mpr_print_field((sc), #attr ": " #fmt "\n", le32toh((facts)->attr)) static __inline void mpr_from_u64(uint64_t data, U64 *mpr) From owner-dev-commits-src-all@freebsd.org Tue Mar 2 22:22:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63071553329; Tue, 2 Mar 2021 22:22: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 4Dqs7y2Jgyz3jTm; Tue, 2 Mar 2021 22:22: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 4208C1EB81; Tue, 2 Mar 2021 22:22: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 122MMcWj009016; Tue, 2 Mar 2021 22:22:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122MMccZ009015; Tue, 2 Mar 2021 22:22:38 GMT (envelope-from git) Date: Tue, 2 Mar 2021 22:22:38 GMT Message-Id: <202103022222.122MMccZ009015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 231633a2e900 - main - [PowerPC64] add mpr to GENERIC64 and GENERIC64LE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 231633a2e9000d67b09f132ee26951a4621c778a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 22:22:38 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=231633a2e9000d67b09f132ee26951a4621c778a commit 231633a2e9000d67b09f132ee26951a4621c778a Author: Alfredo Dal'Ava Junior AuthorDate: 2021-03-02 14:05:37 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-03-03 01:21:43 +0000 [PowerPC64] add mpr to GENERIC64 and GENERIC64LE Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, Sreekanth Reddy (by email) Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25785 --- sys/powerpc/conf/GENERIC64 | 1 + sys/powerpc/conf/GENERIC64LE | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index e19052379c4a..634a8c2731a8 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -147,6 +147,7 @@ device ispfw # Firmware module for Qlogic host adapters device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI SAS3008 MPT-Fusion SAS-3 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D # ATA/SCSI peripherals diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index fc4fc4ceac7c..41815a6a01cc 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -139,6 +139,7 @@ device ispfw # Firmware module for Qlogic host adapters device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI SAS3008 MPT-Fusion SAS-3 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D # ATA/SCSI peripherals From owner-dev-commits-src-all@freebsd.org Tue Mar 2 23:22:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31870554D00; Tue, 2 Mar 2021 23:22: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 4DqtT110Q2z3mdp; Tue, 2 Mar 2021 23:22: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 152211F5D6; Tue, 2 Mar 2021 23:22: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 122NMT7J087573; Tue, 2 Mar 2021 23:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122NMTeC087572; Tue, 2 Mar 2021 23:22:29 GMT (envelope-from git) Date: Tue, 2 Mar 2021 23:22:29 GMT Message-Id: <202103022322.122NMTeC087572@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: ce22a792deed - main - autounmountd: set filter-specific flags for the EVFILT_FS filter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce22a792deed226ba329005a3fc21b38255c689c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 23:22:29 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=ce22a792deed226ba329005a3fc21b38255c689c commit ce22a792deed226ba329005a3fc21b38255c689c Author: Robert Wing AuthorDate: 2021-03-02 23:18:40 +0000 Commit: Robert Wing CommitDate: 2021-03-02 23:18:40 +0000 autounmountd: set filter-specific flags for the EVFILT_FS filter Set the filter-specific flags VQ_MOUNT and VQ_UNMOUNT for the EVFILT_FS filter. The filter-specific flags for the EVFILT_FS filter are undocumented, but their usage can be found by looking up vfs_event_signal(). Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D28975 --- usr.sbin/autofs/autounmountd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/autofs/autounmountd.c b/usr.sbin/autofs/autounmountd.c index 92bc8a03c96f..7a4f04c0b848 100644 --- a/usr.sbin/autofs/autounmountd.c +++ b/usr.sbin/autofs/autounmountd.c @@ -327,7 +327,7 @@ main_autounmountd(int argc, char **argv) if (kq < 0) log_err(1, "kqueue"); - EV_SET(&event, 0, EVFILT_FS, EV_ADD | EV_CLEAR, 0, 0, NULL); + EV_SET(&event, 0, EVFILT_FS, EV_ADD | EV_CLEAR, VQ_MOUNT | VQ_UNMOUNT, 0, NULL); error = kevent(kq, &event, 1, NULL, 0, NULL); if (error < 0) log_err(1, "kevent"); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 23:22:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54577554E00; Tue, 2 Mar 2021 23:22: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 4DqtT21ykSz3mk6; Tue, 2 Mar 2021 23:22: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 369C11F7E8; Tue, 2 Mar 2021 23:22: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 122NMUiv087591; Tue, 2 Mar 2021 23:22:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122NMUmE087590; Tue, 2 Mar 2021 23:22:30 GMT (envelope-from git) Date: Tue, 2 Mar 2021 23:22:30 GMT Message-Id: <202103022322.122NMUmE087590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 0cc746f19352 - main - filt_fsevent: only record interested events MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0cc746f19352979b65a3652149e4f6bd21c0104c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 23:22:30 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=0cc746f19352979b65a3652149e4f6bd21c0104c commit 0cc746f19352979b65a3652149e4f6bd21c0104c Author: Robert Wing AuthorDate: 2021-03-02 23:19:22 +0000 Commit: Robert Wing CommitDate: 2021-03-02 23:19:22 +0000 filt_fsevent: only record interested events Respect filter-specific flags for the EVFILT_FS filter. When a kevent is registered with the EVFILT_FS filter, it is always triggered when an EVFILT_FS event occurs, regardless of the filter-specific flags used. Fix that. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28974 --- sys/kern/vfs_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 3f7dae762de0..c4772f691397 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6016,7 +6016,8 @@ static int filt_fsevent(struct knote *kn, long hint) { - kn->kn_fflags |= hint; + kn->kn_fflags |= kn->kn_sfflags & hint; + return (kn->kn_fflags != 0); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 23:23:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43FE5554D97; Tue, 2 Mar 2021 23:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqtTq1WJzz3mym; Tue, 2 Mar 2021 23:23: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 26D991F3B8; Tue, 2 Mar 2021 23:23: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 122NNBf3087816; Tue, 2 Mar 2021 23:23:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122NNB2V087813; Tue, 2 Mar 2021 23:23:11 GMT (envelope-from git) Date: Tue, 2 Mar 2021 23:23:11 GMT Message-Id: <202103022323.122NNB2V087813@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: 819760b35f31 - main - mvebu_gpio: fix interrupt cause register configuration 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: 819760b35f3196227a1d90089fb98ee115e7ed0d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 23:23:11 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=819760b35f3196227a1d90089fb98ee115e7ed0d commit 819760b35f3196227a1d90089fb98ee115e7ed0d Author: Marcin Wojtas AuthorDate: 2021-02-24 17:02:40 +0000 Commit: Marcin Wojtas CommitDate: 2021-03-02 23:22:42 +0000 mvebu_gpio: fix interrupt cause register configuration According to Armada 8k documentation, the interrupt cause register (at offset 0x14) is RW0C. Update the configuration in attach and the mvebu_gpio_isrc_eoi() to follow the description. Reviewed by: mmel Obtained from: Semihalf Sponsored by: Marvell Differential Revision: https://reviews.freebsd.org/D29013 --- sys/arm/mv/mvebu_gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c index afc3f177ade3..f0471b8d019c 100644 --- a/sys/arm/mv/mvebu_gpio.c +++ b/sys/arm/mv/mvebu_gpio.c @@ -333,7 +333,7 @@ mvebu_gpio_isrc_eoi(struct mvebu_gpio_softc *sc, { if (!mgi->is_level) - intr_modify(sc, GPIO_INT_CAUSE, mgi, 1, 1); + intr_modify(sc, GPIO_INT_CAUSE, mgi, 0, 1); } static int @@ -778,7 +778,7 @@ mvebu_gpio_attach(device_t dev) /* Init HW */ gpio_write(sc, GPIO_INT_MASK, pin, 0); gpio_write(sc, GPIO_INT_LEVEL_MASK, pin, 0); - gpio_write(sc, GPIO_INT_CAUSE, pin, 1); + gpio_write(sc, GPIO_INT_CAUSE, pin, 0); gpio_write(sc, GPIO_DATA_IN_POL, pin, 1); gpio_write(sc, GPIO_BLINK_ENA, pin, 0); } From owner-dev-commits-src-all@freebsd.org Tue Mar 2 23:33:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4267D555058; Tue, 2 Mar 2021 23:33: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 4Dqtk01S4mz3nGF; Tue, 2 Mar 2021 23:33: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 24DF41F772; Tue, 2 Mar 2021 23:33: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 122NXi5h001478; Tue, 2 Mar 2021 23:33:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122NXi9w001477; Tue, 2 Mar 2021 23:33:44 GMT (envelope-from git) Date: Tue, 2 Mar 2021 23:33:44 GMT Message-Id: <202103022333.122NXi9w001477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: e175b519a6fb - main - lib/flua/libjail: Allow empty params table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e175b519a6fb83889fb3ca679b73d11ea5bea7ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 23:33:44 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=e175b519a6fb83889fb3ca679b73d11ea5bea7ad commit e175b519a6fb83889fb3ca679b73d11ea5bea7ad Author: Ryan Moeller AuthorDate: 2021-02-25 05:16:52 +0000 Commit: Ryan Moeller CommitDate: 2021-03-02 23:32:22 +0000 lib/flua/libjail: Allow empty params table The name or jid always gets added to the params, and that's enough to avoid allocating a 0 length params array. Reported by: kevans Reviewed by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28778 --- lib/flua/libjail/lua_jail.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/flua/libjail/lua_jail.c b/lib/flua/libjail/lua_jail.c index 9981fd5421c6..b66c60b43bc8 100644 --- a/lib/flua/libjail/lua_jail.c +++ b/lib/flua/libjail/lua_jail.c @@ -113,7 +113,6 @@ l_getparams(lua_State *L) "expected a jail name (string) or id (integer)"); luaL_checktype(L, 2, LUA_TTABLE); params_count = 1 + lua_rawlen(L, 2); - luaL_argcheck(L, params_count > 1, 2, "expected #params > 0"); flags = luaL_optinteger(L, 3, 0); params = malloc(params_count * sizeof(struct jailparam)); @@ -236,7 +235,6 @@ l_setparams(lua_State *L) lua_pushnil(L); for (params_count = 1; lua_next(L, 2) != 0; ++params_count) lua_pop(L, 1); - luaL_argcheck(L, params_count > 1, 2, "expected #params > 0"); flags = luaL_optinteger(L, 3, 0); From owner-dev-commits-src-all@freebsd.org Tue Mar 2 23:41:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F62955507A; Tue, 2 Mar 2021 23:41: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 4Dqttp3DsKz3ngG; Tue, 2 Mar 2021 23:41: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 5795E1F6BD; Tue, 2 Mar 2021 23:41: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 122NfMcY012502; Tue, 2 Mar 2021 23:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122NfMuH012501; Tue, 2 Mar 2021 23:41:22 GMT (envelope-from git) Date: Tue, 2 Mar 2021 23:41:22 GMT Message-Id: <202103022341.122NfMuH012501@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: 09c3f04ff3be - main - iflib: add support for admin completion queues 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: 09c3f04ff3be97ef442f2484396b1f963565b259 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 23:41:22 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=09c3f04ff3be97ef442f2484396b1f963565b259 commit 09c3f04ff3be97ef442f2484396b1f963565b259 Author: Marcin Wojtas AuthorDate: 2021-03-02 23:24:29 +0000 Commit: Marcin Wojtas CommitDate: 2021-03-02 23:40:47 +0000 iflib: add support for admin completion queues For interfaces with admin completion queues, introduce a new devmethod IFDI_ADMIN_COMPLETION_HANDLE and a corresponding flag IFLIB_HAS_ADMINCQ. This provides an option for handling any admin cq logic, which cannot be run from an interrupt context. Said method is called from within iflib's admin task, making it safe to sleep. Reviewed by: mmacy Submitted by: Artur Rojek Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D28708 --- sys/net/ifdi_if.m | 4 ++++ sys/net/iflib.c | 2 ++ sys/net/iflib.h | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m index 2214d17fbcf1..077b19dd7481 100644 --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -321,6 +321,10 @@ METHOD void link_intr_enable { if_ctx_t _ctx; } DEFAULT null_void_op; +METHOD void admin_completion_handle { + if_ctx_t _ctx; +} DEFAULT null_void_op; + # # interface configuration # diff --git a/sys/net/iflib.c b/sys/net/iflib.c index a7d5a8c24658..05e99ba318df 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4008,6 +4008,8 @@ _task_fn_admin(void *context) callout_stop(&txq->ift_timer); CALLOUT_UNLOCK(txq); } + if (ctx->ifc_sctx->isc_flags & IFLIB_HAS_ADMINCQ) + IFDI_ADMIN_COMPLETION_HANDLE(ctx); if (do_watchdog) { ctx->ifc_watchdog_events++; IFDI_WATCHDOG_RESET(ctx); diff --git a/sys/net/iflib.h b/sys/net/iflib.h index 95305850f7d3..1e8aed271334 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -398,6 +398,11 @@ typedef enum { */ #define IFLIB_PSEUDO_ETHER 0x80000 +/* + * Interface has an admin completion queue + */ +#define IFLIB_HAS_ADMINCQ 0x100000 + /* * These enum values are used in iflib_needs_restart to indicate to iflib * functions whether or not the interface needs restarting when certain events From owner-dev-commits-src-all@freebsd.org Tue Mar 2 23:48:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D7995554A6; Tue, 2 Mar 2021 23:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqv3V44bfz3ntc; Tue, 2 Mar 2021 23:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B2581F9E6; Tue, 2 Mar 2021 23:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122NmswK015470; Tue, 2 Mar 2021 23:48:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122NmsBD015469; Tue, 2 Mar 2021 23:48:54 GMT (envelope-from git) Date: Tue, 2 Mar 2021 23:48:54 GMT Message-Id: <202103022348.122NmsBD015469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: df3747c6607b - main - Replace STAILQ_SWAP() with simpler STAILQ_CONCAT(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df3747c6607be12d48db825653e6adfc3041e97f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 23:48:54 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=df3747c6607be12d48db825653e6adfc3041e97f commit df3747c6607be12d48db825653e6adfc3041e97f Author: Alexander Motin AuthorDate: 2021-03-02 23:39:44 +0000 Commit: Alexander Motin CommitDate: 2021-03-02 23:48:49 +0000 Replace STAILQ_SWAP() with simpler STAILQ_CONCAT(). Also remove stray STAILQ_REMOVE_AFTER(), not causing problems only because STAILQ_SWAP() fixed corrupted stqh_last. MFC after: 1 week --- sys/dev/iscsi/icl_soft.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index c64f0cfde71b..d579c034e63f 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -933,7 +933,6 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) request2->ip_bhs_mbuf = NULL; request->ip_bhs_mbuf->m_pkthdr.len += size2; size += size2; - STAILQ_REMOVE_AFTER(queue, request, ip_next); icl_soft_pdu_done(request2, 0); } #if 0 @@ -972,13 +971,11 @@ icl_send_thread(void *arg) for (;;) { for (;;) { /* - * If the local queue is empty, populate it from - * the main one. This way the icl_conn_send_pdus() - * can go through all the queued PDUs without holding - * any locks. + * Populate the local queue from the main one. + * This way the icl_conn_send_pdus() can go through + * all the queued PDUs without holding any locks. */ - if (STAILQ_EMPTY(&queue)) - STAILQ_SWAP(&ic->ic_to_send, &queue, icl_pdu); + STAILQ_CONCAT(&queue, &ic->ic_to_send); ic->ic_check_send_space = false; ICL_CONN_UNLOCK(ic); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 00:26:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F056855672E for ; Wed, 3 Mar 2021 00:26:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqvth676pz3r0b for ; Wed, 3 Mar 2021 00:26:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82c.google.com with SMTP id j3so583234qtj.12 for ; Tue, 02 Mar 2021 16:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PbdnyUqeSy9ovjvbRZ0JWbLz/LQB2M2jtoMyiZlCvhs=; b=lxnXo3MTkAET5KOHv7DL5fKmKifBfomDaZjK6vAOF5wt74AWOsKAyLnuent1cXn0nA ygPtcsUeCVB1oA6MYxgiKAKUktpKLFjBVs+tAjkXn1A9RvZ2h9r+WAOzW9rVDQv7Fg4k 0MLKq4586mwhPExI8abfbUV64AIMjTfRCAIeMWKdBtRKy0lYsgFkZFT9nO6dybhHcQ9u gyAmzcS/IbEFPL2VdqAQeK6sjU4Hqa/kv4oUpRyocg6TY6gIMtYdgUl5PU1OGfsdim1g EE+1/eCXKjXbhtq544290x6yqlHpk3kg7E2leDaYF1iQFeH4OZsE6KSOzPqUG+tjNh58 sB2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PbdnyUqeSy9ovjvbRZ0JWbLz/LQB2M2jtoMyiZlCvhs=; b=c9Qvb8I/dvJsO+zEVzRLj4cisKrJMClwx1zy3eU5MkHJA1dfy65wW287a/uJVS1oGA h5MNJeL2R6sRfCSVIGadW2v2Mu3ykkZG19KfEcGyssnsKVfk1x0nQburKzvH3lhIxctB Y5A0ayA9OPjjq74WNeGPXgYQ8z2JjEjyadixYB/057gPGHYjBuTAo9e2Chiev6uvugbN iWLDM2XFjBw88f1Auk8/OBQFBL8N6PgGlLsM7ZQzd42y7sEFVgLeFuHQqHJAY3QvRg0e JeeNHFYBXptx9cBD2HTC5boKEO/M9TVo8WXKFE+oemVGrWPmuefBHkxuOJwhiNpSYcsg 0yxw== X-Gm-Message-State: AOAM532azwjDwekNUrt+wwhqHq/l+qZIp5wEE4Pj7suLe/LSLa7klPqy 0BjBYXqifk3X0AetBbA9zSgJOVTE+z3v3bu3ME2o7g== X-Google-Smtp-Source: ABdhPJxJNLbf6CX+7CnbTNr9AJJ84OG2U62/yeVO5E4F+SD5Gp2NznXO+Qk8q6rB9MTUCeJXmVJ/dJCJHJK0U+QvIN0= X-Received: by 2002:ac8:6796:: with SMTP id b22mr20555816qtp.101.1614731180134; Tue, 02 Mar 2021 16:26:20 -0800 (PST) MIME-Version: 1.0 References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> In-Reply-To: <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> From: Warner Losh Date: Tue, 2 Mar 2021 17:26:09 -0700 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Nathan Whitehorn Cc: "Rodney W. Grimes" , Brandon Bergren , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Dqvth676pz3r0b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 00:26:21 -0000 On Tue, Mar 2, 2021 at 11:58 AM Nathan Whitehorn wrote: > > > On 3/2/21 1:56 PM, Rodney W. Grimes wrote: > >> > >> On Tue, Mar 2, 2021, at 12:26 PM, Rodney W. Grimes wrote: > >>> This fails to apply the proper owner/group and mode values > >>> using what ever defaults are in place of the process running > >>> the build. > >> Keep in mind that this is the root of a mounted filesystem in the case > where it matters, and the filesystem being mounted there doesn't support > proper modes anyway, so the mtree values are a bit irrelevant anyway as the > actual control of that is in the fstab. > > That assumes the mount is done and/or kept. My concern is more > > of a lack security (aka world writable) /boot/efi getting created > > in a distribution that then is *not* mounted for some reason, > > either by choice or error. > > > > mkdir should be stricken from use when possible, install -d > > should be used instead. > > > > But that can't happen in this code. For one thing, it's only used in a > controlled environment to generate SD-card images for a handful of ARM > boards. For another the mount is set up and installed in fstab a couple > lines further down the same script. > Removing this from mtree.root wasn't what was agreed upon. Please put it back and fix it another way. It needs to be in mtree.root because we need it for x86 automatic updating code that's coming later. Warner From owner-dev-commits-src-all@freebsd.org Wed Mar 3 00:29:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F17C556DBA for ; Wed, 3 Mar 2021 00:29:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqvyr339rz3rHv for ; Wed, 3 Mar 2021 00:29:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82c.google.com with SMTP id b3so16252614qtj.10 for ; Tue, 02 Mar 2021 16:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7TXoQMBcBCrCo2Y18xbdJAPXVlEgTZ1kXAPzDUshS1c=; b=wZA9gePAScKoc5TpISwRlZY0lfYfXWbPf7+tcykOQVf/2gw/vYLUqKP4ERDBEgMuDq L6/zG1bcVpWz3+rk4NQmyM8sxGYfzVCwqIDMCoEQxPFS/rsXBrQVYQyvee2Nv86kCTNM onaJHvsW4U2xilVdwT4j+JdxFcAbKvG1EXVOK+nhYK3udiOGhHHi5Sa/QGDEMS5VWg0F txSmqUigs1iCBbMexdWtN2JdTTLYjFSW+GhgouL7GhvZsoQhfmejVvxpZRSmIH/mZLqi WsXHv1Bsr5wP3wmKmQH2D7WZkW0vQ5O1LlfAgnMkkKMy91Gsg2QgeNlBVeoLA/7L59Q0 dXZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7TXoQMBcBCrCo2Y18xbdJAPXVlEgTZ1kXAPzDUshS1c=; b=ZfWR2TKTenXyvhjothakPBZyYMEuvgocB5S7kzsZ+89lJrfg//YR6bUhw4bWSwhYWF JGAVB0j4cS+yj4rriRYgcWO7zjhVBVdPKtf+NLN+UjNwMGWTkfMb3/10a2j77kMo9+x6 G3DJxHr79xSjK4+qfV7NDbjHW4MJk1PoF8z8gF7vLX9vnQ732G8zdaPNK8e+a50WUVl6 EnWfwAlzkOzHRSCV9R1JTRICf+9McmEPI32waOUxlQ63hCM1sDvV5zbHT0SrSQlqsTc+ BwHXATZsZSr3OpUXIDdHyLp9279GEmDm7WSb4IeV8mOlObHPeYHsOxnKRbwZTeKO/deP XLOg== X-Gm-Message-State: AOAM530KPtEQ2RYr/LqE/JaXTmGwMKcpnkd1H1lPE5fWz+6fw7GTjrai oHMqQxDmNgbDMl7lVeiJH3WFFlXS+96nyIC1a7/W7BYl78JQhA== X-Google-Smtp-Source: ABdhPJzvWZwFj4SGKE1wLod7FUe0qSCP9BorNWV0SC44W7gTPAaIegHxFdPc9OS6L+Rglf6U1LvbCXexf1sO/4Zk+T8= X-Received: by 2002:a05:622a:90:: with SMTP id o16mr19807264qtw.49.1614731395577; Tue, 02 Mar 2021 16:29:55 -0800 (PST) MIME-Version: 1.0 References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 2 Mar 2021 17:29:44 -0700 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Nathan Whitehorn Cc: "Rodney W. Grimes" , Brandon Bergren , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Dqvyr339rz3rHv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=wZA9gePA; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82c) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::82c:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82c:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::82c:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[dev-commits-src-all]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 00:29:57 -0000 On Tue, Mar 2, 2021 at 5:26 PM Warner Losh wrote: > > > On Tue, Mar 2, 2021 at 11:58 AM Nathan Whitehorn > wrote: > >> >> >> On 3/2/21 1:56 PM, Rodney W. Grimes wrote: >> >> >> >> On Tue, Mar 2, 2021, at 12:26 PM, Rodney W. Grimes wrote: >> >>> This fails to apply the proper owner/group and mode values >> >>> using what ever defaults are in place of the process running >> >>> the build. >> >> Keep in mind that this is the root of a mounted filesystem in the case >> where it matters, and the filesystem being mounted there doesn't support >> proper modes anyway, so the mtree values are a bit irrelevant anyway as the >> actual control of that is in the fstab. >> > That assumes the mount is done and/or kept. My concern is more >> > of a lack security (aka world writable) /boot/efi getting created >> > in a distribution that then is *not* mounted for some reason, >> > either by choice or error. >> > >> > mkdir should be stricken from use when possible, install -d >> > should be used instead. >> > >> >> But that can't happen in this code. For one thing, it's only used in a >> controlled environment to generate SD-card images for a handful of ARM >> boards. For another the mount is set up and installed in fstab a couple >> lines further down the same script. >> > > Removing this from mtree.root wasn't what was agreed upon. Please put it > back and fix it another way. > > It needs to be in mtree.root because we need it for x86 automatic updating > code that's coming later. > I should explain that it was there as the result of careful negotiation about a year or so ago. If some architecture shouldn't have it, that architecture should remove it. All mainstream architectures need it, and we've biased towards convenience of the vast majority of our users over catering to less popular architectures. It doesn't have to have the ESP mounted on it, but it does need to be there, be in heir, etc. There has been some talk of moving the mount point to /efi, but I think that went nowhere... Warner From owner-dev-commits-src-all@freebsd.org Wed Mar 3 00:35:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B72A557193; Wed, 3 Mar 2021 00:35: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 4Dqw552GvWz3rsR; Wed, 3 Mar 2021 00:35: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 410781FDF9; Wed, 3 Mar 2021 00:35: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 1230ZLb2080686; Wed, 3 Mar 2021 00:35:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1230ZLDe080685; Wed, 3 Mar 2021 00:35:21 GMT (envelope-from git) Date: Wed, 3 Mar 2021 00:35:21 GMT Message-Id: <202103030035.1230ZLDe080685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 68b5d0bea6d2 - stable/11 - rmlock: Add a required compiler membar to the rlock slow path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 68b5d0bea6d244093e1923ddf350dff1b5a1ebe9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 00:35:21 -0000 The branch stable/11 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=68b5d0bea6d244093e1923ddf350dff1b5a1ebe9 commit 68b5d0bea6d244093e1923ddf350dff1b5a1ebe9 Author: Mark Johnston AuthorDate: 2021-02-24 02:15:50 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 00:34:34 +0000 rmlock: Add a required compiler membar to the rlock slow path The tracker flags need to be loaded only after the tracker is removed from its per-CPU queue. Otherwise, readers may fail to synchronize with pending writers attempting to propagate priority to active readers, and readers and writers deadlock on each other. This was observed in a stable/12-based armv7 kernel where the compiler had reordered the load of rmp_flags to before the stores updating the queue. Reviewed by: rlibby, scottl Discussed with: kib Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28821 (cherry picked from commit 1d44514fcd68809cfd493a7352ace29ddad443d6) --- sys/kern/kern_rmlock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index c7661bc30cb3..a630f3b0acb5 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -359,7 +359,11 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) /* Remove our tracker from the per-cpu list. */ rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all. */ + /* + * Check to see if the IPI granted us the lock after all. The load of + * rmp_flags must happen after the tracker is removed from the list. + */ + __compiler_membar(); if (tracker->rmp_flags) { /* Just add back tracker - we hold the lock. */ rm_tracker_add(pc, tracker); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 00:35:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06D46557194; Wed, 3 Mar 2021 00:35: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 4Dqw586mQbz3rbq; Wed, 3 Mar 2021 00:35: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 DA1551FEDD; Wed, 3 Mar 2021 00:35: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 1230ZOlp080801; Wed, 3 Mar 2021 00:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1230ZO6f080800; Wed, 3 Mar 2021 00:35:24 GMT (envelope-from git) Date: Wed, 3 Mar 2021 00:35:24 GMT Message-Id: <202103030035.1230ZO6f080800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2655a711df3c - stable/12 - rmlock: Add a required compiler membar to the rlock slow path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2655a711df3cc525d054dd372e67b7803ea2acfa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 00:35:25 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2655a711df3cc525d054dd372e67b7803ea2acfa commit 2655a711df3cc525d054dd372e67b7803ea2acfa Author: Mark Johnston AuthorDate: 2021-02-24 02:15:50 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 00:34:22 +0000 rmlock: Add a required compiler membar to the rlock slow path The tracker flags need to be loaded only after the tracker is removed from its per-CPU queue. Otherwise, readers may fail to synchronize with pending writers attempting to propagate priority to active readers, and readers and writers deadlock on each other. This was observed in a stable/12-based armv7 kernel where the compiler had reordered the load of rmp_flags to before the stores updating the queue. Reviewed by: rlibby, scottl Discussed with: kib Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28821 (cherry picked from commit 1d44514fcd68809cfd493a7352ace29ddad443d6) --- sys/kern/kern_rmlock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 5cb18fbfa582..de2a5818c5bf 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -361,7 +361,11 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) /* Remove our tracker from the per-cpu list. */ rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all. */ + /* + * Check to see if the IPI granted us the lock after all. The load of + * rmp_flags must happen after the tracker is removed from the list. + */ + __compiler_membar(); if (tracker->rmp_flags) { /* Just add back tracker - we hold the lock. */ rm_tracker_add(pc, tracker); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 00:35:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34C5F5570B2; Wed, 3 Mar 2021 00:35: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 4Dqw5F35Ghz3rf2; Wed, 3 Mar 2021 00:35: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 322AE202E8; Wed, 3 Mar 2021 00:35: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 1230ZTgN080915; Wed, 3 Mar 2021 00:35:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1230ZT98080914; Wed, 3 Mar 2021 00:35:29 GMT (envelope-from git) Date: Wed, 3 Mar 2021 00:35:29 GMT Message-Id: <202103030035.1230ZT98080914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c29d3ecdc8b3 - stable/13 - rmlock: Add a required compiler membar to the rlock slow path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c29d3ecdc8b3903d812c0467319ced6f85872d0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 00:35:31 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c29d3ecdc8b3903d812c0467319ced6f85872d0e commit c29d3ecdc8b3903d812c0467319ced6f85872d0e Author: Mark Johnston AuthorDate: 2021-02-24 02:15:50 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 00:34:11 +0000 rmlock: Add a required compiler membar to the rlock slow path The tracker flags need to be loaded only after the tracker is removed from its per-CPU queue. Otherwise, readers may fail to synchronize with pending writers attempting to propagate priority to active readers, and readers and writers deadlock on each other. This was observed in a stable/12-based armv7 kernel where the compiler had reordered the load of rmp_flags to before the stores updating the queue. Reviewed by: rlibby, scottl Discussed with: kib Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28821 (cherry picked from commit 1d44514fcd68809cfd493a7352ace29ddad443d6) --- sys/kern/kern_rmlock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 401445d3d03f..9135709d88cf 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -362,7 +362,11 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) /* Remove our tracker from the per-cpu list. */ rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all. */ + /* + * Check to see if the IPI granted us the lock after all. The load of + * rmp_flags must happen after the tracker is removed from the list. + */ + __compiler_membar(); if (tracker->rmp_flags) { /* Just add back tracker - we hold the lock. */ rm_tracker_add(pc, tracker); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 00:45:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2515255742D for ; Wed, 3 Mar 2021 00:45: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 4DqwJh0ZLKz3sLh; Wed, 3 Mar 2021 00:45: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 066902080F; Wed, 3 Mar 2021 00:45: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 1230jOFN094390; Wed, 3 Mar 2021 00:45:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1230jN9n094389; Wed, 3 Mar 2021 00:45:23 GMT (envelope-from git) Date: Wed, 3 Mar 2021 00:45:23 GMT Message-Id: <202103030045.1230jN9n094389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 154ce66101db - vendor/openzfs - Update vendor/openzfs to master-bedbc13da MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs X-Git-Reftype: branch X-Git-Commit: 154ce66101db0e1a9c90a94e391612b2ab8c048f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 00:45:24 -0000 The branch vendor/openzfs has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=154ce66101db0e1a9c90a94e391612b2ab8c048f commit 154ce66101db0e1a9c90a94e391612b2ab8c048f Author: Martin Matuska AuthorDate: 2021-03-03 00:40:13 +0000 Commit: Martin Matuska CommitDate: 2021-03-03 00:40:13 +0000 Update vendor/openzfs to master-bedbc13da Notable upstream commits: 8e43fa12c Fix vdev_rebuild_thread deadlock 03ef8f09e Add missing checks for unsupported features 2e160dee9 Fix assert in FreeBSD-specific dmu_read_pages bedbc13da Cancel TRIM / initialize on FAULTED non-writeable vdevs --- cmd/vdev_id/vdev_id | 12 ++- cmd/zpool/Makefile.am | 2 +- cmd/zpool/zpool_main.c | 2 + cmd/ztest/ztest.c | 3 + config/kernel-bio.m4 | 29 ++++++++ config/kernel-generic_io_acct.m4 | 69 +++++++++++------ configure.ac | 1 + include/os/linux/kernel/linux/blkdev_compat.h | 8 +- include/sys/dsl_synctask.h | 9 ++- lib/libzfs/libzfs_sendrecv.c | 9 +++ lib/libzfs/libzfs_status.c | 2 + man/man5/zfs-module-parameters.5 | 2 +- module/os/freebsd/zfs/dmu_os.c | 2 +- module/os/linux/zfs/vdev_disk.c | 4 + module/os/linux/zfs/zfs_ioctl_os.c | 2 +- module/os/linux/zfs/zvol_os.c | 4 + module/zcommon/zfeature_common.c | 2 + module/zfs/spa_misc.c | 31 +++++--- module/zfs/vdev_initialize.c | 10 ++- module/zfs/vdev_rebuild.c | 2 +- module/zfs/vdev_trim.c | 15 +++- module/zfs/zfs_ioctl.c | 4 +- tests/runfiles/common.run | 4 +- tests/zfs-tests/cmd/Makefile.am | 1 + tests/zfs-tests/cmd/send_doall/.gitignore | 1 + tests/zfs-tests/cmd/send_doall/Makefile.am | 11 +++ tests/zfs-tests/cmd/send_doall/send_doall.c | 87 ++++++++++++++++++++++ tests/zfs-tests/include/commands.cfg | 1 + .../cli_root/zpool_initialize/Makefile.am | 1 + ...zpool_initialize_fault_export_import_online.ksh | 59 +++++++++++++++ .../functional/cli_root/zpool_trim/Makefile.am | 1 + .../zpool_trim_fault_export_import_online.ksh | 62 +++++++++++++++ .../zpool_trim/zpool_trim_start_and_cancel_pos.ksh | 22 +++--- tests/zfs-tests/tests/functional/rsend/Makefile.am | 4 +- .../tests/functional/rsend/send_doall.ksh | 67 +++++++++++++++++ 35 files changed, 476 insertions(+), 69 deletions(-) diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index 95a4e483b876..8a379a72690e 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -285,7 +285,9 @@ sas_handler() { # we have to append the -part suffix directly in the # helper. if [ "$DEVTYPE" != "partition" ] ; then - PART=$(echo "$DM_NAME" | awk -Fp '/p/{print "-part"$2}') + # Match p[number], remove the 'p' and prepend "-part" + PART=$(echo "$DM_NAME" | + awk 'match($0,/p[0-9]+$/) {print "-part"substr($0,RSTART+1,RLENGTH-1)}') fi # Strip off partition information. @@ -499,7 +501,9 @@ scsi_handler() { # we have to append the -part suffix directly in the # helper. if [ "$DEVTYPE" != "partition" ] ; then - PART=$(echo "$DM_NAME" | awk -Fp '/p/{print "-part"$2}') + # Match p[number], remove the 'p' and prepend "-part" + PART=$(echo "$DM_NAME" | + awk 'match($0,/p[0-9]+$/) {print "-part"substr($0,RSTART+1,RLENGTH-1)}') fi # Strip off partition information. @@ -648,7 +652,9 @@ alias_handler () { DM_PART= if echo "$DM_NAME" | grep -q -E 'p[0-9][0-9]*$' ; then if [ "$DEVTYPE" != "partition" ] ; then - DM_PART=$(echo "$DM_NAME" | awk -Fp '/p/{print "-part"$2}') + # Match p[number], remove the 'p' and prepend "-part" + DM_PART=$(echo "$DM_NAME" | + awk 'match($0,/p[0-9]+$/) {print "-part"substr($0,RSTART+1,RLENGTH-1)}') fi fi diff --git a/cmd/zpool/Makefile.am b/cmd/zpool/Makefile.am index d47051e4fe50..abfa940c3d72 100644 --- a/cmd/zpool/Makefile.am +++ b/cmd/zpool/Makefile.am @@ -179,5 +179,5 @@ install-data-hook: ln -s "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \ done for l in $(zpoolcompatlinks); do \ - (cd "$(DESTDIR)$(zpoolcompatdir)"; ln -s $${l} ); \ + (cd "$(DESTDIR)$(zpoolcompatdir)"; ln -sf $${l} ); \ done diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 29252e6a24f4..e89eb3bea770 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -9030,6 +9030,8 @@ zpool_do_upgrade(int argc, char **argv) "---------------\n"); for (i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *fi = &spa_feature_table[i]; + if (!fi->fi_zfs_mod_supported) + continue; const char *ro = (fi->fi_flags & ZFEATURE_FLAG_READONLY_COMPAT) ? " (read-only compatible)" : ""; diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index cfa1290d78d1..1a030280704a 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -7592,6 +7592,9 @@ ztest_init(ztest_shared_t *zs) for (i = 0; i < SPA_FEATURES; i++) { char *buf; + if (!spa_feature_table[i].fi_zfs_mod_supported) + continue; + /* * 75% chance of using the log space map feature. We want ztest * to exercise both the code paths that use the log space map diff --git a/config/kernel-bio.m4 b/config/kernel-bio.m4 index 0c533531dceb..d8692bd39999 100644 --- a/config/kernel-bio.m4 +++ b/config/kernel-bio.m4 @@ -369,6 +369,33 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [ ]) ]) +dnl # +dnl # Linux 5.12 API, +dnl # +dnl # The Linux 5.12 kernel updated struct bio to create a new bi_bdev member +dnl # and bio->bi_disk was moved to bio->bi_bdev->bd_disk +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK], [ + ZFS_LINUX_TEST_SRC([bio_bdev_disk], [ + #include + #include + ],[ + struct bio *b = NULL; + struct gendisk *d = b->bi_bdev->bd_disk; + blk_register_queue(d); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BIO_BDEV_DISK], [ + AC_MSG_CHECKING([whether bio->bi_bdev->bd_disk exists]) + ZFS_LINUX_TEST_RESULT([bio_bdev_disk], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BIO_BDEV_DISK, 1, [bio->bi_bdev->bd_disk exists]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [ ZFS_AC_KERNEL_SRC_REQ ZFS_AC_KERNEL_SRC_BIO_OPS @@ -379,6 +406,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [ ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST ZFS_AC_KERNEL_SRC_BLKG_TRYGET + ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK ]) AC_DEFUN([ZFS_AC_KERNEL_BIO], [ @@ -400,4 +428,5 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO], [ ZFS_AC_KERNEL_BIO_SUBMIT_BIO ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST ZFS_AC_KERNEL_BLKG_TRYGET + ZFS_AC_KERNEL_BIO_BDEV_DISK ]) diff --git a/config/kernel-generic_io_acct.m4 b/config/kernel-generic_io_acct.m4 index e4ab503d5e1c..0f4381db4c5e 100644 --- a/config/kernel-generic_io_acct.m4 +++ b/config/kernel-generic_io_acct.m4 @@ -2,6 +2,17 @@ dnl # dnl # Check for generic io accounting interface. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [ + ZFS_LINUX_TEST_SRC([disk_io_acct], [ + #include + ], [ + struct gendisk *disk = NULL; + struct bio *bio = NULL; + unsigned long start_time; + + start_time = disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio)); + disk_end_io_acct(disk, bio_op(bio), start_time); + ]) + ZFS_LINUX_TEST_SRC([bio_io_acct], [ #include ], [ @@ -39,48 +50,62 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [ dnl # - dnl # 5.7 API, + dnl # 5.12 API, dnl # - dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers. + dnl # bio_start_io_acct() and bio_end_io_acct() became GPL-exported + dnl # so use disk_start_io_acct() and disk_end_io_acct() instead dnl # - AC_MSG_CHECKING([whether generic bio_*_io_acct() are available]) - ZFS_LINUX_TEST_RESULT([bio_io_acct], [ + AC_MSG_CHECKING([whether generic disk_*_io_acct() are available]) + ZFS_LINUX_TEST_RESULT([disk_io_acct], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available]) + AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available]) ], [ AC_MSG_RESULT(no) dnl # - dnl # 4.14 API, + dnl # 5.7 API, dnl # - dnl # generic_start_io_acct/generic_end_io_acct now require - dnl # request_queue to be provided. No functional changes, - dnl # but preparation for inflight accounting. + dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers. dnl # - AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args]) - ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args], - [generic_start_io_acct], [block/bio.c], [ + AC_MSG_CHECKING([whether generic bio_*_io_acct() are available]) + ZFS_LINUX_TEST_RESULT([bio_io_acct], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1, - [generic_*_io_acct() 4 arg available]) + AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available]) ], [ AC_MSG_RESULT(no) dnl # - dnl # 3.19 API addition + dnl # 4.14 API, dnl # - dnl # torvalds/linux@394ffa50 allows us to increment - dnl # iostat counters without generic_make_request(). + dnl # generic_start_io_acct/generic_end_io_acct now require + dnl # request_queue to be provided. No functional changes, + dnl # but preparation for inflight accounting. dnl # - AC_MSG_CHECKING( - [whether generic_*_io_acct wants 3 args]) - ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args], + AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args]) + ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args], [generic_start_io_acct], [block/bio.c], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1, - [generic_*_io_acct() 3 arg available]) + AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1, + [generic_*_io_acct() 4 arg available]) ], [ AC_MSG_RESULT(no) + + dnl # + dnl # 3.19 API addition + dnl # + dnl # torvalds/linux@394ffa50 allows us to increment + dnl # iostat counters without generic_make_request(). + dnl # + AC_MSG_CHECKING( + [whether generic_*_io_acct wants 3 args]) + ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args], + [generic_start_io_acct], [block/bio.c], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1, + [generic_*_io_acct() 3 arg available]) + ], [ + AC_MSG_RESULT(no) + ]) ]) ]) ]) diff --git a/configure.ac b/configure.ac index 4520a290a9a5..b2d88554ed7d 100644 --- a/configure.ac +++ b/configure.ac @@ -230,6 +230,7 @@ AC_CONFIG_FILES([ tests/zfs-tests/cmd/readmmap/Makefile tests/zfs-tests/cmd/rename_dir/Makefile tests/zfs-tests/cmd/rm_lnkcnt_zero_file/Makefile + tests/zfs-tests/cmd/send_doall/Makefile tests/zfs-tests/cmd/stride_dd/Makefile tests/zfs-tests/cmd/threadsappend/Makefile tests/zfs-tests/cmd/user_ns_exec/Makefile diff --git a/include/os/linux/kernel/linux/blkdev_compat.h b/include/os/linux/kernel/linux/blkdev_compat.h index e41b248b0405..ee066537b900 100644 --- a/include/os/linux/kernel/linux/blkdev_compat.h +++ b/include/os/linux/kernel/linux/blkdev_compat.h @@ -520,7 +520,9 @@ blk_generic_start_io_acct(struct request_queue *q __attribute__((unused)), struct gendisk *disk __attribute__((unused)), int rw __attribute__((unused)), struct bio *bio) { -#if defined(HAVE_BIO_IO_ACCT) +#if defined(HAVE_DISK_IO_ACCT) + return (disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio))); +#elif defined(HAVE_BIO_IO_ACCT) return (bio_start_io_acct(bio)); #elif defined(HAVE_GENERIC_IO_ACCT_3ARG) unsigned long start_time = jiffies; @@ -541,7 +543,9 @@ blk_generic_end_io_acct(struct request_queue *q __attribute__((unused)), struct gendisk *disk __attribute__((unused)), int rw __attribute__((unused)), struct bio *bio, unsigned long start_time) { -#if defined(HAVE_BIO_IO_ACCT) +#if defined(HAVE_DISK_IO_ACCT) + disk_end_io_acct(disk, bio_op(bio), start_time); +#elif defined(HAVE_BIO_IO_ACCT) bio_end_io_acct(bio, start_time); #elif defined(HAVE_GENERIC_IO_ACCT_3ARG) generic_end_io_acct(rw, &disk->part0, start_time); diff --git a/include/sys/dsl_synctask.h b/include/sys/dsl_synctask.h index 0bb602e8f7ff..5a5b306419f1 100644 --- a/include/sys/dsl_synctask.h +++ b/include/sys/dsl_synctask.h @@ -41,10 +41,11 @@ typedef void (dsl_sigfunc_t)(void *, dmu_tx_t *); typedef enum zfs_space_check { /* - * Normal space check: if there is less than 3.2% free space, - * the operation will fail. Operations which are logically - * creating things should use this (e.g. "zfs create", "zfs snapshot"). - * User writes (via the ZPL / ZVOL) also fail at this point. + * Normal space check: if there is less than 3.2% free space (bounded + * by spa_max_slop), the operation will fail. Operations which are + * logically creating things should use this (e.g. "zfs create", "zfs + * snapshot"). User writes (via the ZPL / ZVOL) also fail at this + * point. */ ZFS_SPACE_CHECK_NORMAL, diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 62a94264494f..1e3a0bf5618a 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -321,6 +321,15 @@ send_iterate_snap(zfs_handle_t *zhp, void *arg) } if (!sd->recursive) { + + /* + * To allow a doall stream to work properly + * with a NULL fromsnap + */ + if (sd->doall && sd->fromsnap == NULL && !sd->seenfrom) { + sd->seenfrom = B_TRUE; + } + if (!sd->seenfrom && isfromsnap) { sd->seenfrom = B_TRUE; zfs_close(zhp); diff --git a/lib/libzfs/libzfs_status.c b/lib/libzfs/libzfs_status.c index fadae9388ac1..5e5cb5f5d440 100644 --- a/lib/libzfs/libzfs_status.c +++ b/lib/libzfs/libzfs_status.c @@ -482,6 +482,8 @@ check_status(nvlist_t *config, boolean_t isimport, return (ZPOOL_STATUS_COMPATIBILITY_ERR); for (i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *fi = &spa_feature_table[i]; + if (!fi->fi_zfs_mod_supported) + continue; if (pool_features[i] && !nvlist_exists(feat, fi->fi_guid)) return (ZPOOL_STATUS_FEAT_DISABLED); diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index 8fec44dd37e5..d68e85fa078d 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -1238,7 +1238,7 @@ amount of memory. When the limit is exceeded, the ioctl fails with EINVAL and a description of the error is sent to the zfs-dbgmsg log. This parameter should not need to be touched under normal circumstances. On FreeBSD, the default is based on the system limit on user wired memory. On Linux, the default is -\fBKMALLOC_MAX_SIZE\fR . +\fB128MB\fR. .sp Default value: \fB0\fR (kernel decides) .RE diff --git a/module/os/freebsd/zfs/dmu_os.c b/module/os/freebsd/zfs/dmu_os.c index 8e412d9c1359..fb8f560316ea 100644 --- a/module/os/freebsd/zfs/dmu_os.c +++ b/module/os/freebsd/zfs/dmu_os.c @@ -319,7 +319,7 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, break; } ASSERT(m->dirty == 0); - ASSERT(!pmap_page_is_mapped(m)); + ASSERT(!pmap_page_is_write_mapped(m)); ASSERT(db->db_size > PAGE_SIZE); bufoff = IDX_TO_OFF(m->pindex) % db->db_size; diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c index b373f2c2e83c..ff71ef4cd065 100644 --- a/module/os/linux/zfs/vdev_disk.c +++ b/module/os/linux/zfs/vdev_disk.c @@ -494,7 +494,11 @@ vdev_blkg_tryget(struct blkcg_gq *blkg) static inline void vdev_bio_associate_blkg(struct bio *bio) { +#if defined(HAVE_BIO_BDEV_DISK) + struct request_queue *q = bio->bi_bdev->bd_disk->queue; +#else struct request_queue *q = bio->bi_disk->queue; +#endif ASSERT3P(q, !=, NULL); ASSERT3P(bio->bi_blkg, ==, NULL); diff --git a/module/os/linux/zfs/zfs_ioctl_os.c b/module/os/linux/zfs/zfs_ioctl_os.c index b88e0497d000..6f5cff1770e1 100644 --- a/module/os/linux/zfs/zfs_ioctl_os.c +++ b/module/os/linux/zfs/zfs_ioctl_os.c @@ -209,7 +209,7 @@ zfs_max_nvlist_src_size_os(void) if (zfs_max_nvlist_src_size != 0) return (zfs_max_nvlist_src_size); - return (KMALLOC_MAX_SIZE); + return (MIN(ptob(zfs_totalram_pages) / 4, 128 * 1024 * 1024)); } void diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c index 0caf31307718..0d62b1490702 100644 --- a/module/os/linux/zfs/zvol_os.c +++ b/module/os/linux/zfs/zvol_os.c @@ -307,7 +307,11 @@ zvol_request(struct request_queue *q, struct bio *bio) #endif { #ifdef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS +#if defined(HAVE_BIO_BDEV_DISK) + struct request_queue *q = bio->bi_bdev->bd_disk->queue; +#else struct request_queue *q = bio->bi_disk->queue; +#endif #endif zvol_state_t *zv = q->queuedata; fstrans_cookie_t cookie = spl_fstrans_mark(); diff --git a/module/zcommon/zfeature_common.c b/module/zcommon/zfeature_common.c index e95a85e89ba2..fc0e09605eef 100644 --- a/module/zcommon/zfeature_common.c +++ b/module/zcommon/zfeature_common.c @@ -100,6 +100,8 @@ zfeature_is_supported(const char *guid) for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; + if (!feature->fi_zfs_mod_supported) + continue; if (strcmp(guid, feature->fi_guid) == 0) return (B_TRUE); } diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c index b4c73f58d3bc..0dacf9027b27 100644 --- a/module/zfs/spa_misc.c +++ b/module/zfs/spa_misc.c @@ -347,13 +347,14 @@ int spa_asize_inflation = 24; /* * Normally, we don't allow the last 3.2% (1/(2^spa_slop_shift)) of space in - * the pool to be consumed. This ensures that we don't run the pool - * completely out of space, due to unaccounted changes (e.g. to the MOS). - * It also limits the worst-case time to allocate space. If we have less than - * this amount of free space, most ZPL operations (e.g. write, create) will - * return ENOSPC. The ZIL metaslabs (spa_embedded_log_class) are also part of - * this 3.2% of space which can't be consumed by normal writes; the slop space - * "proper" (spa_get_slop_space()) is decreased by the embedded log space. + * the pool to be consumed (bounded by spa_max_slop). This ensures that we + * don't run the pool completely out of space, due to unaccounted changes (e.g. + * to the MOS). It also limits the worst-case time to allocate space. If we + * have less than this amount of free space, most ZPL operations (e.g. write, + * create) will return ENOSPC. The ZIL metaslabs (spa_embedded_log_class) are + * also part of this 3.2% of space which can't be consumed by normal writes; + * the slop space "proper" (spa_get_slop_space()) is decreased by the embedded + * log space. * * Certain operations (e.g. file removal, most administrative actions) can * use half the slop space. They will only return ENOSPC if less than half @@ -376,10 +377,15 @@ int spa_asize_inflation = 24; * 3.2%, in an effort to have it be at least spa_min_slop (128MB), * but we never allow it to be more than half the pool size. * + * Further, on very large pools, the slop space will be smaller than + * 3.2%, to avoid reserving much more space than we actually need; bounded + * by spa_max_slop (128GB). + * * See also the comments in zfs_space_check_t. */ int spa_slop_shift = 5; -uint64_t spa_min_slop = 128 * 1024 * 1024; +uint64_t spa_min_slop = 128ULL * 1024 * 1024; +uint64_t spa_max_slop = 128ULL * 1024 * 1024 * 1024; int spa_allocators = 4; @@ -1278,9 +1284,9 @@ spa_vdev_config_exit(spa_t *spa, vdev_t *vd, uint64_t txg, int error, char *tag) */ vdev_autotrim_stop_wait(vd); - spa_config_enter(spa, SCL_ALL, spa, RW_WRITER); + spa_config_enter(spa, SCL_STATE_ALL, spa, RW_WRITER); vdev_free(vd); - spa_config_exit(spa, SCL_ALL, spa); + spa_config_exit(spa, SCL_STATE_ALL, spa); } /* @@ -1781,7 +1787,8 @@ spa_get_worst_case_asize(spa_t *spa, uint64_t lsize) /* * Return the amount of slop space in bytes. It is typically 1/32 of the pool * (3.2%), minus the embedded log space. On very small pools, it may be - * slightly larger than this. The embedded log space is not included in + * slightly larger than this. On very large pools, it will be capped to + * the value of spa_max_slop. The embedded log space is not included in * spa_dspace. By subtracting it, the usable space (per "zfs list") is a * constant 97% of the total space, regardless of metaslab size (assuming the * default spa_slop_shift=5 and a non-tiny pool). @@ -1792,7 +1799,7 @@ uint64_t spa_get_slop_space(spa_t *spa) { uint64_t space = spa_get_dspace(spa); - uint64_t slop = space >> spa_slop_shift; + uint64_t slop = MIN(space >> spa_slop_shift, spa_max_slop); /* * Subtract the embedded log space, but no more than half the (3.2%) diff --git a/module/zfs/vdev_initialize.c b/module/zfs/vdev_initialize.c index 083ad2861b5b..e9156c32f384 100644 --- a/module/zfs/vdev_initialize.c +++ b/module/zfs/vdev_initialize.c @@ -553,8 +553,14 @@ vdev_initialize_thread(void *arg) vd->vdev_initialize_tree = NULL; mutex_enter(&vd->vdev_initialize_lock); - if (!vd->vdev_initialize_exit_wanted && vdev_writeable(vd)) { - vdev_initialize_change_state(vd, VDEV_INITIALIZE_COMPLETE); + if (!vd->vdev_initialize_exit_wanted) { + if (vdev_writeable(vd)) { + vdev_initialize_change_state(vd, + VDEV_INITIALIZE_COMPLETE); + } else if (vd->vdev_faulted) { + vdev_initialize_change_state(vd, + VDEV_INITIALIZE_CANCELED); + } } ASSERT(vd->vdev_initialize_thread != NULL || vd->vdev_initialize_inflight == 0); diff --git a/module/zfs/vdev_rebuild.c b/module/zfs/vdev_rebuild.c index 037abc01f7a7..a77ff99faa92 100644 --- a/module/zfs/vdev_rebuild.c +++ b/module/zfs/vdev_rebuild.c @@ -807,8 +807,8 @@ vdev_rebuild_thread(void *arg) ASSERT0(range_tree_space(vr->vr_scan_tree)); /* Disable any new allocations to this metaslab */ - metaslab_disable(msp); spa_config_exit(spa, SCL_CONFIG, FTAG); + metaslab_disable(msp); mutex_enter(&msp->ms_sync_lock); mutex_enter(&msp->ms_lock); diff --git a/module/zfs/vdev_trim.c b/module/zfs/vdev_trim.c index 895957bda195..deea7fedd770 100644 --- a/module/zfs/vdev_trim.c +++ b/module/zfs/vdev_trim.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2016 by Delphix. All rights reserved. * Copyright (c) 2019 by Lawrence Livermore National Security, LLC. + * Copyright (c) 2021 Hewlett Packard Enterprise Development LP */ #include @@ -930,10 +931,16 @@ vdev_trim_thread(void *arg) range_tree_destroy(ta.trim_tree); mutex_enter(&vd->vdev_trim_lock); - if (!vd->vdev_trim_exit_wanted && vdev_writeable(vd)) { - vdev_trim_change_state(vd, VDEV_TRIM_COMPLETE, - vd->vdev_trim_rate, vd->vdev_trim_partial, - vd->vdev_trim_secure); + if (!vd->vdev_trim_exit_wanted) { + if (vdev_writeable(vd)) { + vdev_trim_change_state(vd, VDEV_TRIM_COMPLETE, + vd->vdev_trim_rate, vd->vdev_trim_partial, + vd->vdev_trim_secure); + } else if (vd->vdev_faulted) { + vdev_trim_change_state(vd, VDEV_TRIM_CANCELED, + vd->vdev_trim_rate, vd->vdev_trim_partial, + vd->vdev_trim_secure); + } } ASSERT(vd->vdev_trim_thread != NULL || vd->vdev_trim_inflight[0] == 0); diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 4e64563388f1..db02f2ea0987 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -3986,7 +3986,7 @@ zfs_ioc_pool_initialize(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) fnvlist_free(vdev_errlist); spa_close(spa, FTAG); - return (total_errors > 0 ? EINVAL : 0); + return (total_errors > 0 ? SET_ERROR(EINVAL) : 0); } /* @@ -4071,7 +4071,7 @@ zfs_ioc_pool_trim(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) fnvlist_free(vdev_errlist); spa_close(spa, FTAG); - return (total_errors > 0 ? EINVAL : 0); + return (total_errors > 0 ? SET_ERROR(EINVAL) : 0); } /* diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run index e656785d95d8..fcb0fa6cd24f 100644 --- a/tests/runfiles/common.run +++ b/tests/runfiles/common.run @@ -415,6 +415,7 @@ tags = ['functional', 'cli_root', 'zpool_labelclear'] [tests/functional/cli_root/zpool_initialize] tests = ['zpool_initialize_attach_detach_add_remove', + 'zpool_initialize_fault_export_import_online', 'zpool_initialize_import_export', 'zpool_initialize_offline_export_import_online', 'zpool_initialize_online_offline', @@ -480,6 +481,7 @@ tags = ['functional', 'cli_root', 'zpool_sync'] [tests/functional/cli_root/zpool_trim] tests = ['zpool_trim_attach_detach_add_remove', + 'zpool_trim_fault_export_import_online', 'zpool_trim_import_export', 'zpool_trim_multiple', 'zpool_trim_neg', 'zpool_trim_offline_export_import_online', 'zpool_trim_online_offline', 'zpool_trim_partial', 'zpool_trim_rate', 'zpool_trim_rate_neg', @@ -807,7 +809,7 @@ tests = ['recv_dedup', 'recv_dedup_encrypted_zvol', 'rsend_001_pos', 'send_freeobjects', 'send_realloc_files', 'send_realloc_encrypted_files', 'send_spill_block', 'send_holds', 'send_hole_birth', 'send_mixed_raw', 'send-wR_encrypted_zvol', - 'send_partial_dataset', 'send_invalid'] + 'send_partial_dataset', 'send_invalid', 'send_doall'] tags = ['functional', 'rsend'] [tests/functional/scrub_mirror] diff --git a/tests/zfs-tests/cmd/Makefile.am b/tests/zfs-tests/cmd/Makefile.am index 7fe9a2c571f8..2b965ca70009 100644 --- a/tests/zfs-tests/cmd/Makefile.am +++ b/tests/zfs-tests/cmd/Makefile.am @@ -25,6 +25,7 @@ SUBDIRS = \ readmmap \ rename_dir \ rm_lnkcnt_zero_file \ + send_doall \ stride_dd \ threadsappend diff --git a/tests/zfs-tests/cmd/send_doall/.gitignore b/tests/zfs-tests/cmd/send_doall/.gitignore new file mode 100644 index 000000000000..6ba2e603f744 --- /dev/null +++ b/tests/zfs-tests/cmd/send_doall/.gitignore @@ -0,0 +1 @@ +/send_doall diff --git a/tests/zfs-tests/cmd/send_doall/Makefile.am b/tests/zfs-tests/cmd/send_doall/Makefile.am new file mode 100644 index 000000000000..33a6b83122b8 --- /dev/null +++ b/tests/zfs-tests/cmd/send_doall/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/config/Rules.am + +pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin + +pkgexec_PROGRAMS = send_doall + +send_doall_SOURCES = send_doall.c +send_doall_LDADD = \ + $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \ + $(abs_top_builddir)/lib/libzfs/libzfs.la \ + $(abs_top_builddir)/lib/libnvpair/libnvpair.la diff --git a/tests/zfs-tests/cmd/send_doall/send_doall.c b/tests/zfs-tests/cmd/send_doall/send_doall.c new file mode 100644 index 000000000000..6f47df047478 --- /dev/null +++ b/tests/zfs-tests/cmd/send_doall/send_doall.c @@ -0,0 +1,87 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Portions Copyright 2020 iXsystems, Inc. + */ + +/* + * Test a corner case : a "doall" send without children datasets. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +static void +usage(const char *name) +{ + fprintf(stderr, "usage: %s snap\n", name); + exit(EX_USAGE); +} + +int +main(int argc, char const * const argv[]) +{ + sendflags_t flags = { 0 }; + libzfs_handle_t *zhdl; + zfs_handle_t *zhp; + const char *tofull, *fsname, *tosnap, *p; + int error; + + if (argc != 2) + usage(argv[0]); + + tofull = argv[1]; + + p = strchr(tofull, '@'); + if (p == NULL) + usage(argv[0]); + tosnap = p + 1; + + fsname = strndup(tofull, p - tofull); + + zhdl = libzfs_init(); + if (zhdl == NULL) + errx(EX_OSERR, "libzfs_init(): %s", libzfs_error_init(errno)); + + zhp = zfs_open(zhdl, fsname, ZFS_TYPE_FILESYSTEM); + if (zhp == NULL) + err(EX_OSERR, "zfs_open(\"%s\")", fsname); + + flags.doall = B_TRUE; + + error = zfs_send(zhp, NULL, tosnap, &flags, + STDOUT_FILENO, NULL, NULL, NULL); + + zfs_close(zhp); + + libzfs_fini(zhdl); + free((void *)fsname); + + return (error); +} diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg index 299653547759..a43ddd016fde 100644 --- a/tests/zfs-tests/include/commands.cfg +++ b/tests/zfs-tests/include/commands.cfg @@ -217,6 +217,7 @@ export ZFSTEST_FILES='badsend readmmap rename_dir rm_lnkcnt_zero_file + send_doall threadsappend user_ns_exec xattrtest diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am index 2ebc376d9cb9..3968902ec36d 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am @@ -2,6 +2,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_init dist_pkgdata_SCRIPTS = \ cleanup.ksh \ zpool_initialize_attach_detach_add_remove.ksh \ + zpool_initialize_fault_export_import_online.ksh \ zpool_initialize_import_export.ksh \ zpool_initialize_offline_export_import_online.ksh \ zpool_initialize_online_offline.ksh \ diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh new file mode 100755 index 000000000000..11b8a483e662 --- /dev/null +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh @@ -0,0 +1,59 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2021 Lawrence Livermore National Security, LLC. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_initialize/zpool_initialize.kshlib + +# +# DESCRIPTION: +# Miscellaneous complex sequences of operations function as expected. +# +# STRATEGY: +# 1. Create a pool with a two-way mirror. +# 2. Start initializing, fault, export, import, online and verify along +# the way that the initializing was cancelled and not restarted. +# + +DISK1="$(echo $DISKS | cut -d' ' -f1)" +DISK2="$(echo $DISKS | cut -d' ' -f2)" + +log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2 + +log_must zpool initialize $TESTPOOL $DISK1 +progress="$(initialize_progress $TESTPOOL $DISK1)" +[[ -z "$progress" ]] && log_fail "Initializing did not start" + +log_must zpool offline -f $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_must zpool export $TESTPOOL +log_must zpool import $TESTPOOL + +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_must zpool online $TESTPOOL $DISK1 +log_must zpool clear $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "ONLINE" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_pass "Initializing behaves as expected at each step of:" \ + "initialize + fault + export + import + online" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am index d2d3b4ae88bb..0411ab4e0070 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am @@ -3,6 +3,7 @@ dist_pkgdata_SCRIPTS = \ setup.ksh \ cleanup.ksh \ zpool_trim_attach_detach_add_remove.ksh \ + zpool_trim_fault_export_import_online.ksh \ zpool_trim_import_export.ksh \ zpool_trim_multiple.ksh \ zpool_trim_neg.ksh \ diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh new file mode 100755 index 000000000000..6bb9fc346daf --- /dev/null +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh @@ -0,0 +1,62 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2019 by Tim Chase. All rights reserved. +# Copyright (c) 2021 Lawrence Livermore National Security, LLC. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_trim/zpool_trim.kshlib + +# +# DESCRIPTION: +# Miscellaneous complex sequences of operations function as expected. +# +# STRATEGY: +# 1. Create a pool with a two-way mirror. +# 2. Start trimming, fault, export, import, online and verify along +# the way that the trim was cancelled and not restarted. +# + +DISK1="$(echo $DISKS | cut -d' ' -f1)" +DISK2="$(echo $DISKS | cut -d' ' -f2)" + +log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2 + +log_must zpool trim -r 128M $TESTPOOL $DISK1 +progress="$(trim_progress $TESTPOOL $DISK1)" +[[ -z "$progress" ]] && log_fail "Trimming did not start" + +log_must zpool offline -f $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep untrimmed" + +log_must zpool export $TESTPOOL +log_must zpool import $TESTPOOL + +# Note: the expected state here is unsupported since the faulted device +# cannot be checked to determine if it supports TRIM. +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep unsupported" + +log_must zpool online $TESTPOOL $DISK1 +log_must zpool clear $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "ONLINE" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep untrimmed" + +log_pass "Trimming behaves as expected at each step of:" \ + "trim + fault + export + import + online" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_start_and_cancel_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_start_and_cancel_pos.ksh index eaa4d90444b6..fbb0c291046c 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_start_and_cancel_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_start_and_cancel_pos.ksh @@ -20,29 +20,29 @@ # . $STF_SUITE/include/libtest.shlib -. $STF_SUITE/tests/functional/cli_root/zpool_initialize/zpool_initialize.kshlib +. $STF_SUITE/tests/functional/cli_root/zpool_trim/zpool_trim.kshlib # # DESCRIPTION: -# Starting and stopping an initialize works. +# Starting and stopping a trim works. # # STRATEGY: # 1. Create a one-disk pool. -# 2. Start initializing and verify that initializing is active. -# 3. Cancel initializing and verify that initializing is not active. +# 2. Start trimming and verify that trimming is active. +# 3. Cancel trimming and verify that trimming is not active. # DISK1=${DISKS%% *} log_must zpool create -f $TESTPOOL $DISK1 -log_must zpool initialize $TESTPOOL +log_must zpool trim $TESTPOOL -[[ -z "$(initialize_progress $TESTPOOL $DISK1)" ]] && \ - log_fail "Initialize did not start" *** 105 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:16:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5319555820F; Wed, 3 Mar 2021 01:16: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 4Dqx0S1T0sz3tpL; Wed, 3 Mar 2021 01:16: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 21131208DF; Wed, 3 Mar 2021 01:16: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 1231GOcG034148; Wed, 3 Mar 2021 01:16:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231GNDc034147; Wed, 3 Mar 2021 01:16:23 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:16:23 GMT Message-Id: <202103030116.1231GNDc034147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: caed7b1c399d - main - zfs: merge OpenZFS master-bedbc13da MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: caed7b1c399de04279822028e15b36367e84232f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:16:24 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=caed7b1c399de04279822028e15b36367e84232f commit caed7b1c399de04279822028e15b36367e84232f Merge: df3747c6607b 154ce66101db Author: Martin Matuska AuthorDate: 2021-03-03 01:15:33 +0000 Commit: Martin Matuska CommitDate: 2021-03-03 01:15:33 +0000 zfs: merge OpenZFS master-bedbc13da Notable upstream commits: 8e43fa12c Fix vdev_rebuild_thread deadlock 03ef8f09e Add missing checks for unsupported features 2e160dee9 Fix assert in FreeBSD-specific dmu_read_pages bedbc13da Cancel TRIM / initialize on FAULTED non-writeable vdevs MFC after: 1 week Obtained from: OpenZFS sys/contrib/openzfs/cmd/vdev_id/vdev_id | 12 ++- sys/contrib/openzfs/cmd/zpool/Makefile.am | 2 +- sys/contrib/openzfs/config/kernel-bio.m4 | 29 ++++++++ .../openzfs/config/kernel-generic_io_acct.m4 | 69 +++++++++++------ sys/contrib/openzfs/configure.ac | 1 + .../include/os/linux/kernel/linux/blkdev_compat.h | 8 +- sys/contrib/openzfs/include/sys/dsl_synctask.h | 9 ++- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 9 +++ .../openzfs/man/man5/zfs-module-parameters.5 | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 2 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 4 + .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 2 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 4 + sys/contrib/openzfs/module/zfs/spa_misc.c | 31 +++++--- sys/contrib/openzfs/module/zfs/vdev_initialize.c | 10 ++- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_trim.c | 15 +++- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 4 +- sys/contrib/openzfs/tests/runfiles/common.run | 4 +- .../openzfs/tests/zfs-tests/cmd/Makefile.am | 1 + .../tests/zfs-tests/cmd/send_doall/.gitignore | 1 + .../tests/zfs-tests/cmd/send_doall/Makefile.am | 11 +++ .../tests/zfs-tests/cmd/send_doall/send_doall.c | 87 ++++++++++++++++++++++ .../openzfs/tests/zfs-tests/include/commands.cfg | 1 + .../cli_root/zpool_initialize/Makefile.am | 1 + ...zpool_initialize_fault_export_import_online.ksh | 59 +++++++++++++++ .../functional/cli_root/zpool_trim/Makefile.am | 1 + .../zpool_trim_fault_export_import_online.ksh | 62 +++++++++++++++ .../zpool_trim/zpool_trim_start_and_cancel_pos.ksh | 22 +++--- .../zfs-tests/tests/functional/rsend/Makefile.am | 4 +- .../tests/functional/rsend/send_doall.ksh | 67 +++++++++++++++++ 31 files changed, 467 insertions(+), 69 deletions(-) diff --cc sys/contrib/openzfs/module/zfs/zfs_ioctl.c index 922253469fba,000000000000..5f291d067bef mode 100644,000000..100644 --- a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c +++ b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c @@@ -1,7688 -1,0 +1,7688 @@@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 Martin Matuska + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. + * Portions Copyright 2012 Pawel Jakub Dawidek + * Copyright (c) 2014, 2016 Joyent, Inc. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Toomas Soome + * Copyright (c) 2016 Actifio, Inc. All rights reserved. + * Copyright (c) 2018, loli10K . All rights reserved. + * Copyright 2017 RackTop Systems. + * Copyright (c) 2017 Open-E, Inc. All Rights Reserved. + * Copyright (c) 2019 Datto Inc. + * Copyright (c) 2019, 2020 by Christian Schwarz. All rights reserved. + * Copyright (c) 2019, Klara Inc. + * Copyright (c) 2019, Allan Jude + */ + +/* + * ZFS ioctls. + * + * This file handles the ioctls to /dev/zfs, used for configuring ZFS storage + * pools and filesystems, e.g. with /sbin/zfs and /sbin/zpool. + * + * There are two ways that we handle ioctls: the legacy way where almost + * all of the logic is in the ioctl callback, and the new way where most + * of the marshalling is handled in the common entry point, zfsdev_ioctl(). + * + * Non-legacy ioctls should be registered by calling + * zfs_ioctl_register() from zfs_ioctl_init(). The ioctl is invoked + * from userland by lzc_ioctl(). + * + * The registration arguments are as follows: + * + * const char *name + * The name of the ioctl. This is used for history logging. If the + * ioctl returns successfully (the callback returns 0), and allow_log + * is true, then a history log entry will be recorded with the input & + * output nvlists. The log entry can be printed with "zpool history -i". + * + * zfs_ioc_t ioc + * The ioctl request number, which userland will pass to ioctl(2). + * We want newer versions of libzfs and libzfs_core to run against + * existing zfs kernel modules (i.e. a deferred reboot after an update). + * Therefore the ioctl numbers cannot change from release to release. + * + * zfs_secpolicy_func_t *secpolicy + * This function will be called before the zfs_ioc_func_t, to + * determine if this operation is permitted. It should return EPERM + * on failure, and 0 on success. Checks include determining if the + * dataset is visible in this zone, and if the user has either all + * zfs privileges in the zone (SYS_MOUNT), or has been granted permission + * to do this operation on this dataset with "zfs allow". + * + * zfs_ioc_namecheck_t namecheck + * This specifies what to expect in the zfs_cmd_t:zc_name -- a pool + * name, a dataset name, or nothing. If the name is not well-formed, + * the ioctl will fail and the callback will not be called. + * Therefore, the callback can assume that the name is well-formed + * (e.g. is null-terminated, doesn't have more than one '@' character, + * doesn't have invalid characters). + * + * zfs_ioc_poolcheck_t pool_check + * This specifies requirements on the pool state. If the pool does + * not meet them (is suspended or is readonly), the ioctl will fail + * and the callback will not be called. If any checks are specified + * (i.e. it is not POOL_CHECK_NONE), namecheck must not be NO_NAME. + * Multiple checks can be or-ed together (e.g. POOL_CHECK_SUSPENDED | + * POOL_CHECK_READONLY). + * + * zfs_ioc_key_t *nvl_keys + * The list of expected/allowable innvl input keys. This list is used + * to validate the nvlist input to the ioctl. + * + * boolean_t smush_outnvlist + * If smush_outnvlist is true, then the output is presumed to be a + * list of errors, and it will be "smushed" down to fit into the + * caller's buffer, by removing some entries and replacing them with a + * single "N_MORE_ERRORS" entry indicating how many were removed. See + * nvlist_smush() for details. If smush_outnvlist is false, and the + * outnvlist does not fit into the userland-provided buffer, then the + * ioctl will fail with ENOMEM. + * + * zfs_ioc_func_t *func + * The callback function that will perform the operation. + * + * The callback should return 0 on success, or an error number on + * failure. If the function fails, the userland ioctl will return -1, + * and errno will be set to the callback's return value. The callback + * will be called with the following arguments: + * + * const char *name + * The name of the pool or dataset to operate on, from + * zfs_cmd_t:zc_name. The 'namecheck' argument specifies the + * expected type (pool, dataset, or none). + * + * nvlist_t *innvl + * The input nvlist, deserialized from zfs_cmd_t:zc_nvlist_src. Or + * NULL if no input nvlist was provided. Changes to this nvlist are + * ignored. If the input nvlist could not be deserialized, the + * ioctl will fail and the callback will not be called. + * + * nvlist_t *outnvl + * The output nvlist, initially empty. The callback can fill it in, + * and it will be returned to userland by serializing it into + * zfs_cmd_t:zc_nvlist_dst. If it is non-empty, and serialization + * fails (e.g. because the caller didn't supply a large enough + * buffer), then the overall ioctl will fail. See the + * 'smush_nvlist' argument above for additional behaviors. + * + * There are two typical uses of the output nvlist: + * - To return state, e.g. property values. In this case, + * smush_outnvlist should be false. If the buffer was not large + * enough, the caller will reallocate a larger buffer and try + * the ioctl again. + * + * - To return multiple errors from an ioctl which makes on-disk + * changes. In this case, smush_outnvlist should be true. + * Ioctls which make on-disk modifications should generally not + * use the outnvl if they succeed, because the caller can not + * distinguish between the operation failing, and + * deserialization failing. + * + * IOCTL Interface Errors + * + * The following ioctl input errors can be returned: + * ZFS_ERR_IOC_CMD_UNAVAIL the ioctl number is not supported by kernel + * ZFS_ERR_IOC_ARG_UNAVAIL an input argument is not supported by kernel + * ZFS_ERR_IOC_ARG_REQUIRED a required input argument is missing + * ZFS_ERR_IOC_ARG_BADTYPE an input argument has an invalid type + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zfs_namecheck.h" +#include "zfs_prop.h" +#include "zfs_deleg.h" +#include "zfs_comutil.h" + +#include +#include +#include + +kmutex_t zfsdev_state_lock; +zfsdev_state_t *zfsdev_state_list; + +/* + * Limit maximum nvlist size. We don't want users passing in insane values + * for zc->zc_nvlist_src_size, since we will need to allocate that much memory. + * Defaults to 0=auto which is handled by platform code. + */ +unsigned long zfs_max_nvlist_src_size = 0; + +/* + * When logging the output nvlist of an ioctl in the on-disk history, limit + * the logged size to this many bytes. This must be less then DMU_MAX_ACCESS. + * This applies primarily to zfs_ioc_channel_program(). + */ +unsigned long zfs_history_output_max = 1024 * 1024; + +uint_t zfs_fsyncer_key; +uint_t zfs_allow_log_key; + +/* DATA_TYPE_ANY is used when zkey_type can vary. */ +#define DATA_TYPE_ANY DATA_TYPE_UNKNOWN + +typedef struct zfs_ioc_vec { + zfs_ioc_legacy_func_t *zvec_legacy_func; + zfs_ioc_func_t *zvec_func; + zfs_secpolicy_func_t *zvec_secpolicy; + zfs_ioc_namecheck_t zvec_namecheck; + boolean_t zvec_allow_log; + zfs_ioc_poolcheck_t zvec_pool_check; + boolean_t zvec_smush_outnvlist; + const char *zvec_name; + const zfs_ioc_key_t *zvec_nvl_keys; + size_t zvec_nvl_key_count; +} zfs_ioc_vec_t; + +/* This array is indexed by zfs_userquota_prop_t */ +static const char *userquota_perms[] = { + ZFS_DELEG_PERM_USERUSED, + ZFS_DELEG_PERM_USERQUOTA, + ZFS_DELEG_PERM_GROUPUSED, + ZFS_DELEG_PERM_GROUPQUOTA, + ZFS_DELEG_PERM_USEROBJUSED, + ZFS_DELEG_PERM_USEROBJQUOTA, + ZFS_DELEG_PERM_GROUPOBJUSED, + ZFS_DELEG_PERM_GROUPOBJQUOTA, + ZFS_DELEG_PERM_PROJECTUSED, + ZFS_DELEG_PERM_PROJECTQUOTA, + ZFS_DELEG_PERM_PROJECTOBJUSED, + ZFS_DELEG_PERM_PROJECTOBJQUOTA, +}; + +static int zfs_ioc_userspace_upgrade(zfs_cmd_t *zc); +static int zfs_ioc_id_quota_upgrade(zfs_cmd_t *zc); +static int zfs_check_settable(const char *name, nvpair_t *property, + cred_t *cr); +static int zfs_check_clearable(const char *dataset, nvlist_t *props, + nvlist_t **errors); +static int zfs_fill_zplprops_root(uint64_t, nvlist_t *, nvlist_t *, + boolean_t *); +int zfs_set_prop_nvlist(const char *, zprop_source_t, nvlist_t *, nvlist_t *); +static int get_nvlist(uint64_t nvl, uint64_t size, int iflag, nvlist_t **nvp); + +static void +history_str_free(char *buf) +{ + kmem_free(buf, HIS_MAX_RECORD_LEN); +} + +static char * +history_str_get(zfs_cmd_t *zc) +{ + char *buf; + + if (zc->zc_history == 0) + return (NULL); + + buf = kmem_alloc(HIS_MAX_RECORD_LEN, KM_SLEEP); + if (copyinstr((void *)(uintptr_t)zc->zc_history, + buf, HIS_MAX_RECORD_LEN, NULL) != 0) { + history_str_free(buf); + return (NULL); + } + + buf[HIS_MAX_RECORD_LEN -1] = '\0'; + + return (buf); +} + +/* + * Return non-zero if the spa version is less than requested version. + */ +static int +zfs_earlier_version(const char *name, int version) +{ + spa_t *spa; + + if (spa_open(name, &spa, FTAG) == 0) { + if (spa_version(spa) < version) { + spa_close(spa, FTAG); + return (1); + } + spa_close(spa, FTAG); + } + return (0); +} + +/* + * Return TRUE if the ZPL version is less than requested version. + */ +static boolean_t +zpl_earlier_version(const char *name, int version) +{ + objset_t *os; + boolean_t rc = B_TRUE; + + if (dmu_objset_hold(name, FTAG, &os) == 0) { + uint64_t zplversion; + + if (dmu_objset_type(os) != DMU_OST_ZFS) { + dmu_objset_rele(os, FTAG); + return (B_TRUE); + } + /* XXX reading from non-owned objset */ + if (zfs_get_zplprop(os, ZFS_PROP_VERSION, &zplversion) == 0) + rc = zplversion < version; + dmu_objset_rele(os, FTAG); + } + return (rc); +} + +static void +zfs_log_history(zfs_cmd_t *zc) +{ + spa_t *spa; + char *buf; + + if ((buf = history_str_get(zc)) == NULL) + return; + + if (spa_open(zc->zc_name, &spa, FTAG) == 0) { + if (spa_version(spa) >= SPA_VERSION_ZPOOL_HISTORY) + (void) spa_history_log(spa, buf); + spa_close(spa, FTAG); + } + history_str_free(buf); +} + +/* + * Policy for top-level read operations (list pools). Requires no privileges, + * and can be used in the local zone, as there is no associated dataset. + */ +/* ARGSUSED */ +static int +zfs_secpolicy_none(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (0); +} + +/* + * Policy for dataset read operations (list children, get statistics). Requires + * no privileges, but must be visible in the local zone. + */ +/* ARGSUSED */ +static int +zfs_secpolicy_read(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + if (INGLOBALZONE(curproc) || + zone_dataset_visible(zc->zc_name, NULL)) + return (0); + + return (SET_ERROR(ENOENT)); +} + +static int +zfs_dozonecheck_impl(const char *dataset, uint64_t zoned, cred_t *cr) +{ + int writable = 1; + + /* + * The dataset must be visible by this zone -- check this first + * so they don't see EPERM on something they shouldn't know about. + */ + if (!INGLOBALZONE(curproc) && + !zone_dataset_visible(dataset, &writable)) + return (SET_ERROR(ENOENT)); + + if (INGLOBALZONE(curproc)) { + /* + * If the fs is zoned, only root can access it from the + * global zone. + */ + if (secpolicy_zfs(cr) && zoned) + return (SET_ERROR(EPERM)); + } else { + /* + * If we are in a local zone, the 'zoned' property must be set. + */ + if (!zoned) + return (SET_ERROR(EPERM)); + + /* must be writable by this zone */ + if (!writable) + return (SET_ERROR(EPERM)); + } + return (0); +} + +static int +zfs_dozonecheck(const char *dataset, cred_t *cr) +{ + uint64_t zoned; + + if (dsl_prop_get_integer(dataset, zfs_prop_to_name(ZFS_PROP_ZONED), + &zoned, NULL)) + return (SET_ERROR(ENOENT)); + + return (zfs_dozonecheck_impl(dataset, zoned, cr)); +} + +static int +zfs_dozonecheck_ds(const char *dataset, dsl_dataset_t *ds, cred_t *cr) +{ + uint64_t zoned; + + if (dsl_prop_get_int_ds(ds, zfs_prop_to_name(ZFS_PROP_ZONED), &zoned)) + return (SET_ERROR(ENOENT)); + + return (zfs_dozonecheck_impl(dataset, zoned, cr)); +} + +static int +zfs_secpolicy_write_perms_ds(const char *name, dsl_dataset_t *ds, + const char *perm, cred_t *cr) +{ + int error; + + error = zfs_dozonecheck_ds(name, ds, cr); + if (error == 0) { + error = secpolicy_zfs(cr); + if (error != 0) + error = dsl_deleg_access_impl(ds, perm, cr); + } + return (error); +} + +static int +zfs_secpolicy_write_perms(const char *name, const char *perm, cred_t *cr) +{ + int error; + dsl_dataset_t *ds; + dsl_pool_t *dp; + + /* + * First do a quick check for root in the global zone, which + * is allowed to do all write_perms. This ensures that zfs_ioc_* + * will get to handle nonexistent datasets. + */ + if (INGLOBALZONE(curproc) && secpolicy_zfs(cr) == 0) + return (0); + + error = dsl_pool_hold(name, FTAG, &dp); + if (error != 0) + return (error); + + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error != 0) { + dsl_pool_rele(dp, FTAG); + return (error); + } + + error = zfs_secpolicy_write_perms_ds(name, ds, perm, cr); + + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + return (error); +} + +/* + * Policy for setting the security label property. + * + * Returns 0 for success, non-zero for access and other errors. + */ +static int +zfs_set_slabel_policy(const char *name, const char *strval, cred_t *cr) +{ +#ifdef HAVE_MLSLABEL + char ds_hexsl[MAXNAMELEN]; + bslabel_t ds_sl, new_sl; + boolean_t new_default = FALSE; + uint64_t zoned; + int needed_priv = -1; + int error; + + /* First get the existing dataset label. */ + error = dsl_prop_get(name, zfs_prop_to_name(ZFS_PROP_MLSLABEL), + 1, sizeof (ds_hexsl), &ds_hexsl, NULL); + if (error != 0) + return (SET_ERROR(EPERM)); + + if (strcasecmp(strval, ZFS_MLSLABEL_DEFAULT) == 0) + new_default = TRUE; + + /* The label must be translatable */ + if (!new_default && (hexstr_to_label(strval, &new_sl) != 0)) + return (SET_ERROR(EINVAL)); + + /* + * In a non-global zone, disallow attempts to set a label that + * doesn't match that of the zone; otherwise no other checks + * are needed. + */ + if (!INGLOBALZONE(curproc)) { + if (new_default || !blequal(&new_sl, CR_SL(CRED()))) + return (SET_ERROR(EPERM)); + return (0); + } + + /* + * For global-zone datasets (i.e., those whose zoned property is + * "off", verify that the specified new label is valid for the + * global zone. + */ + if (dsl_prop_get_integer(name, + zfs_prop_to_name(ZFS_PROP_ZONED), &zoned, NULL)) + return (SET_ERROR(EPERM)); + if (!zoned) { + if (zfs_check_global_label(name, strval) != 0) + return (SET_ERROR(EPERM)); + } + + /* + * If the existing dataset label is nondefault, check if the + * dataset is mounted (label cannot be changed while mounted). + * Get the zfsvfs_t; if there isn't one, then the dataset isn't + * mounted (or isn't a dataset, doesn't exist, ...). + */ + if (strcasecmp(ds_hexsl, ZFS_MLSLABEL_DEFAULT) != 0) { + objset_t *os; + static const char *setsl_tag = "setsl_tag"; + + /* + * Try to own the dataset; abort if there is any error, + * (e.g., already mounted, in use, or other error). + */ + error = dmu_objset_own(name, DMU_OST_ZFS, B_TRUE, B_TRUE, + setsl_tag, &os); + if (error != 0) + return (SET_ERROR(EPERM)); + + dmu_objset_disown(os, B_TRUE, setsl_tag); + + if (new_default) { + needed_priv = PRIV_FILE_DOWNGRADE_SL; + goto out_check; + } + + if (hexstr_to_label(strval, &new_sl) != 0) + return (SET_ERROR(EPERM)); + + if (blstrictdom(&ds_sl, &new_sl)) + needed_priv = PRIV_FILE_DOWNGRADE_SL; + else if (blstrictdom(&new_sl, &ds_sl)) + needed_priv = PRIV_FILE_UPGRADE_SL; + } else { + /* dataset currently has a default label */ + if (!new_default) + needed_priv = PRIV_FILE_UPGRADE_SL; + } + +out_check: + if (needed_priv != -1) + return (PRIV_POLICY(cr, needed_priv, B_FALSE, EPERM, NULL)); + return (0); +#else + return (SET_ERROR(ENOTSUP)); +#endif /* HAVE_MLSLABEL */ +} + +static int +zfs_secpolicy_setprop(const char *dsname, zfs_prop_t prop, nvpair_t *propval, + cred_t *cr) +{ + char *strval; + + /* + * Check permissions for special properties. + */ + switch (prop) { + default: + break; + case ZFS_PROP_ZONED: + /* + * Disallow setting of 'zoned' from within a local zone. + */ + if (!INGLOBALZONE(curproc)) + return (SET_ERROR(EPERM)); + break; + + case ZFS_PROP_QUOTA: + case ZFS_PROP_FILESYSTEM_LIMIT: + case ZFS_PROP_SNAPSHOT_LIMIT: + if (!INGLOBALZONE(curproc)) { + uint64_t zoned; + char setpoint[ZFS_MAX_DATASET_NAME_LEN]; + /* + * Unprivileged users are allowed to modify the + * limit on things *under* (ie. contained by) + * the thing they own. + */ + if (dsl_prop_get_integer(dsname, + zfs_prop_to_name(ZFS_PROP_ZONED), &zoned, setpoint)) + return (SET_ERROR(EPERM)); + if (!zoned || strlen(dsname) <= strlen(setpoint)) + return (SET_ERROR(EPERM)); + } + break; + + case ZFS_PROP_MLSLABEL: + if (!is_system_labeled()) + return (SET_ERROR(EPERM)); + + if (nvpair_value_string(propval, &strval) == 0) { + int err; + + err = zfs_set_slabel_policy(dsname, strval, CRED()); + if (err != 0) + return (err); + } + break; + } + + return (zfs_secpolicy_write_perms(dsname, zfs_prop_to_name(prop), cr)); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_set_fsacl(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + int error; + + error = zfs_dozonecheck(zc->zc_name, cr); + if (error != 0) + return (error); + + /* + * permission to set permissions will be evaluated later in + * dsl_deleg_can_allow() + */ + return (0); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_rollback(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_ROLLBACK, cr)); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + dsl_pool_t *dp; + dsl_dataset_t *ds; + const char *cp; + int error; + + /* + * Generate the current snapshot name from the given objsetid, then + * use that name for the secpolicy/zone checks. + */ + cp = strchr(zc->zc_name, '@'); + if (cp == NULL) + return (SET_ERROR(EINVAL)); + error = dsl_pool_hold(zc->zc_name, FTAG, &dp); + if (error != 0) + return (error); + + error = dsl_dataset_hold_obj(dp, zc->zc_sendobj, FTAG, &ds); + if (error != 0) { + dsl_pool_rele(dp, FTAG); + return (error); + } + + dsl_dataset_name(ds, zc->zc_name); + + error = zfs_secpolicy_write_perms_ds(zc->zc_name, ds, + ZFS_DELEG_PERM_SEND, cr); + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + + return (error); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_send_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_SEND, cr)); +} + +static int +zfs_secpolicy_share(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (SET_ERROR(ENOTSUP)); +} + +static int +zfs_secpolicy_smb_acl(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (SET_ERROR(ENOTSUP)); +} + +static int +zfs_get_parent(const char *datasetname, char *parent, int parentsize) +{ + char *cp; + + /* + * Remove the @bla or /bla from the end of the name to get the parent. + */ + (void) strncpy(parent, datasetname, parentsize); + cp = strrchr(parent, '@'); + if (cp != NULL) { + cp[0] = '\0'; + } else { + cp = strrchr(parent, '/'); + if (cp == NULL) + return (SET_ERROR(ENOENT)); + cp[0] = '\0'; + } + + return (0); +} + +int +zfs_secpolicy_destroy_perms(const char *name, cred_t *cr) +{ + int error; + + if ((error = zfs_secpolicy_write_perms(name, + ZFS_DELEG_PERM_MOUNT, cr)) != 0) + return (error); + + return (zfs_secpolicy_write_perms(name, ZFS_DELEG_PERM_DESTROY, cr)); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_destroy(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (zfs_secpolicy_destroy_perms(zc->zc_name, cr)); +} + +/* + * Destroying snapshots with delegated permissions requires + * descendant mount and destroy permissions. + */ +/* ARGSUSED */ +static int +zfs_secpolicy_destroy_snaps(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + nvlist_t *snaps; + nvpair_t *pair, *nextpair; + int error = 0; + + snaps = fnvlist_lookup_nvlist(innvl, "snaps"); + + for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; + pair = nextpair) { + nextpair = nvlist_next_nvpair(snaps, pair); + error = zfs_secpolicy_destroy_perms(nvpair_name(pair), cr); + if (error == ENOENT) { + /* + * Ignore any snapshots that don't exist (we consider + * them "already destroyed"). Remove the name from the + * nvl here in case the snapshot is created between + * now and when we try to destroy it (in which case + * we don't want to destroy it since we haven't + * checked for permission). + */ + fnvlist_remove_nvpair(snaps, pair); + error = 0; + } + if (error != 0) + break; + } + + return (error); +} + +int +zfs_secpolicy_rename_perms(const char *from, const char *to, cred_t *cr) +{ + char parentname[ZFS_MAX_DATASET_NAME_LEN]; + int error; + + if ((error = zfs_secpolicy_write_perms(from, + ZFS_DELEG_PERM_RENAME, cr)) != 0) + return (error); + + if ((error = zfs_secpolicy_write_perms(from, + ZFS_DELEG_PERM_MOUNT, cr)) != 0) + return (error); + + if ((error = zfs_get_parent(to, parentname, + sizeof (parentname))) != 0) + return (error); + + if ((error = zfs_secpolicy_write_perms(parentname, + ZFS_DELEG_PERM_CREATE, cr)) != 0) + return (error); + + if ((error = zfs_secpolicy_write_perms(parentname, + ZFS_DELEG_PERM_MOUNT, cr)) != 0) + return (error); + + return (error); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_rename(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (zfs_secpolicy_rename_perms(zc->zc_name, zc->zc_value, cr)); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_promote(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + dsl_pool_t *dp; + dsl_dataset_t *clone; + int error; + + error = zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_PROMOTE, cr); + if (error != 0) + return (error); + + error = dsl_pool_hold(zc->zc_name, FTAG, &dp); + if (error != 0) + return (error); + + error = dsl_dataset_hold(dp, zc->zc_name, FTAG, &clone); + + if (error == 0) { + char parentname[ZFS_MAX_DATASET_NAME_LEN]; + dsl_dataset_t *origin = NULL; + dsl_dir_t *dd; + dd = clone->ds_dir; + + error = dsl_dataset_hold_obj(dd->dd_pool, + dsl_dir_phys(dd)->dd_origin_obj, FTAG, &origin); + if (error != 0) { + dsl_dataset_rele(clone, FTAG); + dsl_pool_rele(dp, FTAG); + return (error); + } + + error = zfs_secpolicy_write_perms_ds(zc->zc_name, clone, + ZFS_DELEG_PERM_MOUNT, cr); + + dsl_dataset_name(origin, parentname); + if (error == 0) { + error = zfs_secpolicy_write_perms_ds(parentname, origin, + ZFS_DELEG_PERM_PROMOTE, cr); + } + dsl_dataset_rele(clone, FTAG); + dsl_dataset_rele(origin, FTAG); + } + dsl_pool_rele(dp, FTAG); + return (error); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_recv(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + int error; + + if ((error = zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_RECEIVE, cr)) != 0) + return (error); + + if ((error = zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_MOUNT, cr)) != 0) + return (error); + + return (zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_CREATE, cr)); +} + +/* ARGSUSED */ +static int +zfs_secpolicy_recv_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (zfs_secpolicy_recv(zc, innvl, cr)); +} + *** 6794 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:19:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CDB65582BD; Wed, 3 Mar 2021 01: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 4Dqx4H1GLrz3v85; Wed, 3 Mar 2021 01: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 1E41220E85; Wed, 3 Mar 2021 01:19: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 1231Jh3g034768; Wed, 3 Mar 2021 01:19:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231Jhna034767; Wed, 3 Mar 2021 01:19:43 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:19:43 GMT Message-Id: <202103030119.1231Jhna034767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 20f9e2a723f5 - releng/13.0 - rmlock: Add a required compiler membar to the rlock slow path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 20f9e2a723f5f560d6219e28f36dd3b8f8561b3a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:19:43 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20f9e2a723f5f560d6219e28f36dd3b8f8561b3a commit 20f9e2a723f5f560d6219e28f36dd3b8f8561b3a Author: Mark Johnston AuthorDate: 2021-02-24 02:15:50 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 01:16:54 +0000 rmlock: Add a required compiler membar to the rlock slow path The tracker flags need to be loaded only after the tracker is removed from its per-CPU queue. Otherwise, readers may fail to synchronize with pending writers attempting to propagate priority to active readers, and readers and writers deadlock on each other. This was observed in a stable/12-based armv7 kernel where the compiler had reordered the load of rmp_flags to before the stores updating the queue. Approved by: re (gjb) Reviewed by: rlibby, scottl Discussed with: kib Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28821 (cherry picked from commit 1d44514fcd68809cfd493a7352ace29ddad443d6) (cherry picked from commit c29d3ecdc8b3903d812c0467319ced6f85872d0e) --- sys/kern/kern_rmlock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 401445d3d03f..9135709d88cf 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -362,7 +362,11 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) /* Remove our tracker from the per-cpu list. */ rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all. */ + /* + * Check to see if the IPI granted us the lock after all. The load of + * rmp_flags must happen after the tracker is removed from the list. + */ + __compiler_membar(); if (tracker->rmp_flags) { /* Just add back tracker - we hold the lock. */ rm_tracker_add(pc, tracker); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:31:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 674FB5588A6; Wed, 3 Mar 2021 01:31: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 4DqxKW2XbLz3wVy; Wed, 3 Mar 2021 01:31: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 49D5821108; Wed, 3 Mar 2021 01:31: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 1231VBur056555; Wed, 3 Mar 2021 01:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231VBqq056554; Wed, 3 Mar 2021 01:31:11 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:31:11 GMT Message-Id: <202103030131.1231VBqq056554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: afb1aa4e6df2 - main - ix(4): Report RX errors as sum of all RX error counters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afb1aa4e6df245d38fd2ba683fa521d5dabe8392 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:31:11 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=afb1aa4e6df245d38fd2ba683fa521d5dabe8392 commit afb1aa4e6df245d38fd2ba683fa521d5dabe8392 Author: Piotr Pietruszewski AuthorDate: 2021-03-03 01:21:58 +0000 Commit: Eric Joyner CommitDate: 2021-03-03 01:25:32 +0000 ix(4): Report RX errors as sum of all RX error counters HW keeps track of RX errors using several counters, each for specific type of errors. Report RX errors to OS as sum of all those counters: CRC errors, illegal bytes, checksum, length, undersize, fragment, oversize and jabber errors. Also, add new "rx_errs" sysctl in the dev.ix.N.mac_stats tree. This is to provide an another way to display the sum of RX errors. Signed-off-by: Piotr Pietruszewski Reviewed By: erj Tested By: gowtham.kumar.ks@intel.com Sponsored By: Intel Corporation Differential Revision: https://reviews.freebsd.org/D27191 --- sys/dev/ixgbe/if_ix.c | 19 ++++++++++++++++++- sys/dev/ixgbe/ixgbe.h | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 7eb32077f8b0..9f3674cdab5d 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1531,7 +1531,22 @@ ixgbe_update_stats_counters(struct adapter *adapter) IXGBE_SET_OMCASTS(adapter, stats->mptc); IXGBE_SET_COLLISIONS(adapter, 0); IXGBE_SET_IQDROPS(adapter, total_missed_rx); - IXGBE_SET_IERRORS(adapter, stats->crcerrs + stats->rlec); + + /* + * Aggregate following types of errors as RX errors: + * - CRC error count, + * - illegal byte error count, + * - checksum error count, + * - missed packets count, + * - length error count, + * - undersized packets count, + * - fragmented packets count, + * - oversized packets count, + * - jabber count. + */ + IXGBE_SET_IERRORS(adapter, stats->crcerrs + stats->illerrc + stats->xec + + stats->mpc[0] + stats->rlec + stats->ruc + stats->rfc + stats->roc + + stats->rjc); } /* ixgbe_update_stats_counters */ /************************************************************************ @@ -1621,6 +1636,8 @@ ixgbe_add_hw_stats(struct adapter *adapter) CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MAC Statistics"); stat_list = SYSCTL_CHILDREN(stat_node); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "rx_errs", + CTLFLAG_RD, &adapter->ierrors, IXGBE_SYSCTL_DESC_RX_ERRS); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "crc_errs", CTLFLAG_RD, &stats->crcerrs, "CRC Errors"); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "ill_errs", diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 1502c7fb866e..30dd1d5368fb 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -536,6 +536,18 @@ struct adapter { "\t2 - tx pause\n" \ "\t3 - tx and rx pause" +#define IXGBE_SYSCTL_DESC_RX_ERRS \ + "\nSum of the following RX errors counters:\n" \ + " * CRC errors,\n" \ + " * illegal byte error count,\n" \ + " * checksum error count,\n" \ + " * missed packet count,\n" \ + " * length error count,\n" \ + " * undersized packets count,\n" \ + " * fragmented packets count,\n" \ + " * oversized packets count,\n" \ + " * jabber count." + /* Workaround to make 8.0 buildable */ #if __FreeBSD_version >= 800000 && __FreeBSD_version < 800504 static __inline int From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:34:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47DF85589BC; Wed, 3 Mar 2021 01:34: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 4DqxPY1Rwrz4RFS; Wed, 3 Mar 2021 01:34: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 248212111F; Wed, 3 Mar 2021 01:34: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 1231Yf8M060578; Wed, 3 Mar 2021 01:34:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231YfMj060577; Wed, 3 Mar 2021 01:34:41 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:34:41 GMT Message-Id: <202103030134.1231YfMj060577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: ab63da3564e8 - main - Speed up geom_stats_resync in the presence of many devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab63da3564e8ab0907f9d8eb565774848ffdadeb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:34:41 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=ab63da3564e8ab0907f9d8eb565774848ffdadeb commit ab63da3564e8ab0907f9d8eb565774848ffdadeb Author: Alan Somers AuthorDate: 2021-02-27 15:59:40 +0000 Commit: Alan Somers CommitDate: 2021-03-03 01:33:45 +0000 Speed up geom_stats_resync in the presence of many devices The old code had a O(n) loop, where n is the size of /dev/devstat. Multiply that by another O(n) loop in devstat_mmap for a total of O(n^2). This change adds DIOCGMEDIASIZE support to /dev/devstat so userland can quickly determine the right amount of memory to map, eliminating the O(n) loop in userland. This change decreases the time to run "gstat -bI0.001" with 16,384 md devices from 29.7s to 4.2s. Also, fix a memory leak first reported as PR 203097. Sponsored by: Axcient Reviewed by: mav, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28968 --- lib/libgeom/geom_stats.c | 26 +++++++++++++++++--------- sys/kern/subr_devstat.c | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/lib/libgeom/geom_stats.c b/lib/libgeom/geom_stats.c index ebf7868c3c65..450ee491ea1c 100644 --- a/lib/libgeom/geom_stats.c +++ b/lib/libgeom/geom_stats.c @@ -32,9 +32,12 @@ */ #include +#include +#include #include #include #include +#include #include #include #include @@ -53,7 +56,7 @@ geom_stats_close(void) { if (statsfd == -1) return; - munmap(statp, npages *pagesize); + munmap(statp, npages * pagesize); statp = NULL; close (statsfd); statsfd = -1; @@ -63,17 +66,22 @@ void geom_stats_resync(void) { void *p; + off_t mediasize; + int error; if (statsfd == -1) return; - for (;;) { - p = mmap(statp, (npages + 1) * pagesize, - PROT_READ, MAP_SHARED, statsfd, 0); - if (p == MAP_FAILED) - break; - else - statp = p; - npages++; + error = ioctl(statsfd, DIOCGMEDIASIZE, &mediasize); + if (error) + err(1, "DIOCGMEDIASIZE(" _PATH_DEV DEVSTAT_DEVICE_NAME ")"); + + munmap(statp, npages * pagesize); + p = mmap(statp, mediasize, PROT_READ, MAP_SHARED, statsfd, 0); + if (p == MAP_FAILED) + err(1, "mmap(/dev/devstat):"); + else { + statp = p; + npages = mediasize / pagesize; } } diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c index 091164a11fcf..98a41fd179c2 100644 --- a/sys/kern/subr_devstat.c +++ b/sys/kern/subr_devstat.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -473,10 +474,12 @@ SYSCTL_INT(_kern_devstat, OID_AUTO, version, CTLFLAG_RD, #define statsperpage (PAGE_SIZE / sizeof(struct devstat)) +static d_ioctl_t devstat_ioctl; static d_mmap_t devstat_mmap; static struct cdevsw devstat_cdevsw = { .d_version = D_VERSION, + .d_ioctl = devstat_ioctl, .d_mmap = devstat_mmap, .d_name = "devstat", }; @@ -487,9 +490,26 @@ struct statspage { u_int nfree; }; +static size_t pagelist_pages = 0; static TAILQ_HEAD(, statspage) pagelist = TAILQ_HEAD_INITIALIZER(pagelist); static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics"); +static int +devstat_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + int error = ENOTTY; + + switch (cmd) { + case DIOCGMEDIASIZE: + error = 0; + *(off_t *)data = pagelist_pages * PAGE_SIZE; + break; + } + + return (error); +} + static int devstat_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) @@ -556,6 +576,7 @@ devstat_alloc(void) * head but the order on the list determine the * sequence of the mapping so we can't do that. */ + pagelist_pages++; TAILQ_INSERT_TAIL(&pagelist, spp, list); } else break; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:34:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61DF4558CCE; Wed, 3 Mar 2021 01:34: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 4DqxPZ2NRZz4QtZ; Wed, 3 Mar 2021 01:34: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 44CEB20CEE; Wed, 3 Mar 2021 01:34: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 1231YgeF060600; Wed, 3 Mar 2021 01:34:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231YgLO060599; Wed, 3 Mar 2021 01:34:42 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:34:42 GMT Message-Id: <202103030134.1231YgLO060599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: d977417d74a7 - main - [skip ci] fix a typo in a comment in mdconfig.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d977417d74a704930b5952cbd653638ccd25eaa7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:34:42 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=d977417d74a704930b5952cbd653638ccd25eaa7 commit d977417d74a704930b5952cbd653638ccd25eaa7 Author: Alan Somers AuthorDate: 2021-02-27 16:04:10 +0000 Commit: Alan Somers CommitDate: 2021-03-03 01:33:45 +0000 [skip ci] fix a typo in a comment in mdconfig.c Sponsored by: Axcient Reviewed by: mav, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28968 --- sbin/mdconfig/mdconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index 852909aa9032..0f76ca6149f1 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -423,7 +423,7 @@ md_set_file(const char *fn) /* * Lists md(4) disks. Is used also as a query routine, since it handles XML * interface. 'units' can be NULL for listing memory disks. It might be - * coma-separated string containing md(4) disk names. 'opt' distinguished + * comma-separated string containing md(4) disk names. 'opt' distinguished * between list and query mode. */ static int From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:35:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F83A558D28; Wed, 3 Mar 2021 01:35: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 4DqxQL1Mc9z4RTr; Wed, 3 Mar 2021 01:35: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 173F321317; Wed, 3 Mar 2021 01:35: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 1231ZLqO060826; Wed, 3 Mar 2021 01:35:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231ZLFh060825; Wed, 3 Mar 2021 01:35:21 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:35:21 GMT Message-Id: <202103030135.1231ZLFh060825@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: b3fce46a3eac - main - cam: remove redundant scsi_vpd_block_characteristics definition 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: b3fce46a3eac600935f3aac2b224a83defcf1cb3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:35:22 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b3fce46a3eac600935f3aac2b224a83defcf1cb3 commit b3fce46a3eac600935f3aac2b224a83defcf1cb3 Author: Warner Losh AuthorDate: 2021-03-03 01:31:43 +0000 Commit: Warner Losh CommitDate: 2021-03-03 01:35:09 +0000 cam: remove redundant scsi_vpd_block_characteristics definition There were two definitions for the SCSI VPD Block Device Characteristics (page 0xb1): struct scsi_vpd_block_characteristics and struct scsi_vpd_block_device_characteristics. The latter is more complete and more widely used. Convert uses of the former to the latter by tweaking the da driver and removing sturct scsi_vpd_block_characteristics. --- sys/cam/scsi/scsi_all.h | 24 ------------------------ sys/cam/scsi/scsi_da.c | 7 +++---- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index ff27388e446c..597d5fd68447 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -2820,30 +2820,6 @@ struct scsi_vpd_sfs uint8_t codes[]; }; -/* - * Block Device Characteristics VPD Page based on - * T10/1799-D Revision 31 - */ -struct scsi_vpd_block_characteristics -{ - u_int8_t device; - u_int8_t page_code; -#define SVPD_BDC 0xB1 - u_int8_t page_length[2]; - u_int8_t medium_rotation_rate[2]; -#define SVPD_BDC_RATE_NOT_REPORTED 0x00 -#define SVPD_BDC_RATE_NON_ROTATING 0x01 - u_int8_t reserved1; - u_int8_t nominal_form_factor; -#define SVPD_BDC_FORM_NOT_REPORTED 0x00 -#define SVPD_BDC_FORM_5_25INCH 0x01 -#define SVPD_BDC_FORM_3_5INCH 0x02 -#define SVPD_BDC_FORM_2_5INCH 0x03 -#define SVPD_BDC_FORM_1_5INCH 0x04 -#define SVPD_BDC_FORM_LESSTHAN_1_5INCH 0x05 - u_int8_t reserved2[56]; -}; - /* * Block Device Characteristics VPD Page */ diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index e426fe07621b..c13b51921745 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -3650,14 +3650,14 @@ out: } case DA_STATE_PROBE_BDC: { - struct scsi_vpd_block_characteristics *bdc; + struct scsi_vpd_block_device_characteristics *bdc; if (!scsi_vpd_supported_page(periph, SVPD_BDC)) { softc->state = DA_STATE_PROBE_ATA; goto skipstate; } - bdc = (struct scsi_vpd_block_characteristics *) + bdc = (struct scsi_vpd_block_device_characteristics *) malloc(sizeof(*bdc), M_SCSIDA, M_NOWAIT|M_ZERO); if (bdc == NULL) { @@ -5208,8 +5208,7 @@ dadone_probebdc(struct cam_periph *periph, union ccb *done_ccb) medium_rotation_rate)) { softc->disk->d_rotation_rate = scsi_2btoul(bdc->medium_rotation_rate); - if (softc->disk->d_rotation_rate == - SVPD_BDC_RATE_NON_ROTATING) { + if (softc->disk->d_rotation_rate == SVPD_NON_ROTATING) { cam_iosched_set_sort_queue( softc->cam_iosched, 0); softc->flags &= ~DA_FLAG_ROTATING; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:37:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A329558E0B; Wed, 3 Mar 2021 01:37: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 4DqxSk3W8nz4Rf2; Wed, 3 Mar 2021 01:37: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 6B87D20E72; Wed, 3 Mar 2021 01:37: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 1231bQSs061311; Wed, 3 Mar 2021 01:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231bQsF061310; Wed, 3 Mar 2021 01:37:26 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:37:26 GMT Message-Id: <202103030137.1231bQsF061310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 9f99061ef9c9 - main - ixl(4): Report RX errors as sum of all RX error counters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f99061ef9c95b171fc92d34026222bb5e052337 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:37:26 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=9f99061ef9c95b171fc92d34026222bb5e052337 commit 9f99061ef9c95b171fc92d34026222bb5e052337 Author: Krzysztof Galazka AuthorDate: 2021-03-03 01:33:11 +0000 Commit: Eric Joyner CommitDate: 2021-03-03 01:37:04 +0000 ixl(4): Report RX errors as sum of all RX error counters HW keeps track of RX errors using several counters, each for specific type of errors. Report RX errors to OS as sum of all those counters: CRC errors, illegal bytes, checksum, length, undersize, fragment, oversize and jabber errors. There is no HW counter for frames with invalid L3/L4 checksums so add a SW one. Also add a "rx_errors" sysctl with a copy of netstat IERRORS counter value to make it easier accessible from scripts. Reviewed By: erj Tested By: gowtham.kumar.ks@intel.com Sponsored By: Intel Corporation Differential Revision: https://reviews.freebsd.org/D27639 --- sys/dev/ixl/ixl.h | 1 + sys/dev/ixl/ixl_pf_main.c | 15 +++++++++++++-- sys/dev/ixl/ixl_txrx.c | 16 +++++++++------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 3eb0fa4f6b5a..9828760e4ea6 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -390,6 +390,7 @@ struct rx_ring { u64 rx_packets; u64 rx_bytes; u64 desc_errs; + u64 csum_errs; }; /* diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 2714b1a0e6d8..070ddaef522e 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -808,6 +808,11 @@ ixl_vsi_add_sysctls(struct ixl_vsi * vsi, const char * sysctl_name, bool queues_ vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); ixl_add_sysctls_eth_stats(&vsi->sysctl_ctx, vsi_list, &vsi->eth_stats); + /* Copy of netstat RX errors counter for validation purposes */ + SYSCTL_ADD_UQUAD(&vsi->sysctl_ctx, vsi_list, OID_AUTO, "rx_errors", + CTLFLAG_RD, &vsi->ierrors, + "RX packet errors"); + if (queues_sysctls) ixl_vsi_add_queues_stats(vsi, &vsi->sysctl_ctx); } @@ -2183,7 +2188,7 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) struct ixl_pf *pf; struct ifnet *ifp; struct i40e_eth_stats *es; - u64 tx_discards; + u64 tx_discards, csum_errs; struct i40e_hw_port_stats *nsd; @@ -2196,6 +2201,11 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) tx_discards = es->tx_discards + nsd->tx_dropped_link_down; + csum_errs = 0; + for (int i = 0; i < vsi->num_rx_queues; i++) + csum_errs += vsi->rx_queues[i].rxr.csum_errs; + nsd->checksum_error = csum_errs; + /* Update ifnet stats */ IXL_SET_IPACKETS(vsi, es->rx_unicast + es->rx_multicast + @@ -2209,7 +2219,8 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) IXL_SET_OMCASTS(vsi, es->tx_multicast); IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes + - nsd->rx_undersize + nsd->rx_oversize + nsd->rx_fragments + + nsd->checksum_error + nsd->rx_length_errors + + nsd->rx_undersize + nsd->rx_fragments + nsd->rx_oversize + nsd->rx_jabber); IXL_SET_OERRORS(vsi, es->tx_errors); IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c index e589bb8392cd..bdd3cb8725f8 100644 --- a/sys/dev/ixl/ixl_txrx.c +++ b/sys/dev/ixl/ixl_txrx.c @@ -51,7 +51,7 @@ #endif /* Local Prototypes */ -static void ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype); +static u8 ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype); static int ixl_isc_txd_encap(void *arg, if_pkt_info_t pi); static void ixl_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx); @@ -720,7 +720,7 @@ ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) rxr->rx_packets++; if ((if_getcapenable(vsi->ifp) & IFCAP_RXCSUM) != 0) - ixl_rx_checksum(ri, status, error, ptype); + rxr->csum_errs += ixl_rx_checksum(ri, status, error, ptype); ri->iri_flowid = le32toh(cur->wb.qword0.hi_dword.rss); ri->iri_rsstype = ixl_ptype_to_hash(ptype); ri->iri_vtag = vtag; @@ -737,7 +737,7 @@ ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) * doesn't spend time verifying the checksum. * *********************************************************************/ -static void +static u8 ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) { struct i40e_rx_ptype_decoded decoded; @@ -746,7 +746,7 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) /* No L3 or L4 checksum was calculated */ if (!(status & (1 << I40E_RX_DESC_STATUS_L3L4P_SHIFT))) - return; + return (0); decoded = decode_rx_desc_ptype(ptype); @@ -756,7 +756,7 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) if (status & (1 << I40E_RX_DESC_STATUS_IPV6EXADD_SHIFT)) { ri->iri_csum_flags = 0; - return; + return (1); } } @@ -764,17 +764,19 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) /* IPv4 checksum error */ if (error & (1 << I40E_RX_DESC_ERROR_IPE_SHIFT)) - return; + return (1); ri->iri_csum_flags |= CSUM_L3_VALID; ri->iri_csum_flags |= CSUM_L4_CALC; /* L4 checksum error */ if (error & (1 << I40E_RX_DESC_ERROR_L4E_SHIFT)) - return; + return (1); ri->iri_csum_flags |= CSUM_L4_VALID; ri->iri_csum_data |= htons(0xffff); + + return (0); } /* Set Report Status queue fields to 0 */ From owner-dev-commits-src-all@freebsd.org Wed Mar 3 01:50:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE9EA558D75; Wed, 3 Mar 2021 01:50: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 4Dqxlt5lDTz4S3G; Wed, 3 Mar 2021 01:50: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 B817321514; Wed, 3 Mar 2021 01:50: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 1231oYxh082143; Wed, 3 Mar 2021 01:50:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1231oYMc082142; Wed, 3 Mar 2021 01:50:34 GMT (envelope-from git) Date: Wed, 3 Mar 2021 01:50:34 GMT Message-Id: <202103030150.1231oYMc082142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 21802a127d83 - main - ixl(4): Add ability to control link state on ifconfig down MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21802a127d83e8a8c721d69b697e7ddb223d7797 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 01:50:34 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=21802a127d83e8a8c721d69b697e7ddb223d7797 commit 21802a127d83e8a8c721d69b697e7ddb223d7797 Author: Krzysztof Galazka AuthorDate: 2021-03-03 01:38:51 +0000 Commit: Eric Joyner CommitDate: 2021-03-03 01:43:38 +0000 ixl(4): Add ability to control link state on ifconfig down Add sysctl link_active_on_if_down, which allows user to control if interface is kept in active state when it is brought down with ifconfig. Set it to enabled by default to preserve backwards compatibility. Reviewed by: erj Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D28028 --- sys/dev/ixl/if_ixl.c | 18 +++++++ sys/dev/ixl/ixl_pf.h | 7 +++ sys/dev/ixl/ixl_pf_iflib.c | 2 + sys/dev/ixl/ixl_pf_main.c | 128 ++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 154 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 340565d66bc8..a79648de274f 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -770,6 +770,12 @@ ixl_if_attach_post(if_ctx_t ctx) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); + /* + * Driver may have been reloaded. Ensure that the link state + * is consistent with current settings. + */ + ixl_set_link(pf, (pf->state & IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0); + hw->phy.get_link_info = true; i40e_get_link_status(hw, &pf->link_up); ixl_update_link_status(pf); @@ -961,6 +967,8 @@ ixl_if_init(if_ctx_t ctx) return; } + ixl_set_link(pf, true); + /* Reconfigure multicast filters in HW */ ixl_if_multi_set(ctx); @@ -1003,6 +1011,7 @@ void ixl_if_stop(if_ctx_t ctx) { struct ixl_pf *pf = iflib_get_softc(ctx); + struct ifnet *ifp = iflib_get_ifp(ctx); struct ixl_vsi *vsi = &pf->vsi; INIT_DEBUGOUT("ixl_if_stop: begin\n"); @@ -1019,6 +1028,15 @@ ixl_if_stop(if_ctx_t ctx) ixl_disable_rings_intr(vsi); ixl_disable_rings(pf, vsi, &pf->qtag); + + /* + * Don't set link state if only reconfiguring + * e.g. on MTU change. + */ + if ((if_getflags(ifp) & IFF_UP) == 0 && + (atomic_load_acq_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) == 0) + ixl_set_link(pf, false); } static int diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index c3fbdc91d358..83c764bc617c 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -88,6 +88,7 @@ enum ixl_pf_state { IXL_PF_STATE_EMP_RESET_REQ = (1 << 8), IXL_PF_STATE_FW_LLDP_DISABLED = (1 << 9), IXL_PF_STATE_EEE_ENABLED = (1 << 10), + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN = (1 << 11), }; #define IXL_PF_IN_RECOVERY_MODE(pf) \ @@ -229,6 +230,11 @@ struct ixl_pf { "\t0 - disable\n" \ "\t1 - enable\n" +#define IXL_SYSCTL_HELP_SET_LINK_ACTIVE \ +"\nKeep link active after setting interface down:\n" \ +"\t0 - disable\n" \ +"\t1 - enable\n" + #define IXL_SYSCTL_HELP_READ_I2C \ "\nRead a byte from I2C bus\n" \ "Input: 32-bit value\n" \ @@ -351,6 +357,7 @@ void ixl_pf_reset_stats(struct ixl_pf *); void ixl_get_bus_info(struct ixl_pf *pf); int ixl_aq_get_link_status(struct ixl_pf *, struct i40e_aqc_get_link_status *); +void ixl_set_link(struct ixl_pf *, bool); int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); int ixl_handle_i2c_eeprom_read_cmd(struct ixl_pf *, struct ifreq *ifr); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 2b3d035fbcfe..23d9f30299a9 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -413,6 +413,8 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) /* Print out message if an unqualified module is found */ if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && (pf->advertised_speed) && + (atomic_load_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0 && (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && (!(status->link_info & I40E_AQ_LINK_UP))) device_printf(dev, "Link failed because " diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 070ddaef522e..b546701608f1 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -62,6 +62,7 @@ static int ixl_sysctl_pf_tx_itr(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_pf_rx_itr(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_set_link_active(SYSCTL_HANDLER_ARGS); /* Debug Sysctls */ static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); @@ -385,6 +386,9 @@ retry: break; } + /* Keep link active by default */ + atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + /* Print a subset of the capability information. */ device_printf(dev, "PF-ID[%d]: VFs %d, MSI-X %d, VF MSI-X %d, QPs %d, %s\n", @@ -2499,6 +2503,12 @@ ixl_add_device_sysctls(struct ixl_pf *pf) CTLFLAG_RD | CTLFLAG_MPSAFE, &pf->stats.rx_lpi_count, "RX LPI count"); + SYSCTL_ADD_PROC(ctx, ctx_list, OID_AUTO, + "link_active_on_if_down", + CTLTYPE_INT | CTLFLAG_RWTUN, + pf, 0, ixl_sysctl_set_link_active, "I", + IXL_SYSCTL_HELP_SET_LINK_ACTIVE); + /* Add sysctls meant to print debug information, but don't list them * in "sysctl -a" output. */ debug_node = SYSCTL_ADD_NODE(ctx, ctx_list, @@ -2519,6 +2529,11 @@ ixl_add_device_sysctls(struct ixl_pf *pf) CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pf, 0, ixl_sysctl_link_status, "A", IXL_SYSCTL_HELP_LINK_STATUS); + SYSCTL_ADD_PROC(ctx, debug_list, + OID_AUTO, "phy_abilities_init", + CTLTYPE_STRING | CTLFLAG_RD, + pf, 1, ixl_sysctl_phy_abilities, "A", "Initial PHY Abilities"); + SYSCTL_ADD_PROC(ctx, debug_list, OID_AUTO, "phy_abilities", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, @@ -3107,6 +3122,95 @@ ixl_find_i2c_interface(struct ixl_pf *pf) return (-1); } +void +ixl_set_link(struct ixl_pf *pf, bool enable) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; + enum i40e_status_code aq_error = 0; + u32 phy_type, phy_type_ext; + + /* Get initial capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, TRUE, &abilities, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + phy_type = abilities.phy_type; + phy_type_ext = abilities.phy_type_ext; + + /* Get current capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, FALSE, &abilities, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + /* Prepare new config */ + memset(&config, 0, sizeof(config)); + config.link_speed = abilities.link_speed; + config.abilities = abilities.abilities; + config.eee_capability = abilities.eee_capability; + config.eeer = abilities.eeer_val; + config.low_power_ctrl = abilities.d3_lpan; + config.fec_config = abilities.fec_cfg_curr_mod_ext_info + & I40E_AQ_PHY_FEC_CONFIG_MASK; + config.phy_type = 0; + config.phy_type_ext = 0; + + if (enable) { + config.phy_type = phy_type; + config.phy_type_ext = phy_type_ext; + + config.abilities &= ~(I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX); + + switch (pf->fc) { + case I40E_FC_FULL: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_RX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_TX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX; + break; + default: + break; + } + } + + aq_error = i40e_aq_set_phy_config(hw, &config, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error setting new phy config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + aq_error = i40e_aq_set_link_restart_an(hw, enable, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error set link config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } +} + static char * ixl_phy_type_string(u32 bit_pos, bool ext) { @@ -3265,7 +3369,7 @@ ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS) } status = i40e_aq_get_phy_capabilities(hw, - FALSE, FALSE, &abilities, NULL); + FALSE, arg2 != 0, &abilities, NULL); if (status) { device_printf(dev, "%s: i40e_aq_get_phy_capabilities() status %s, aq error %s\n", @@ -4447,6 +4551,28 @@ ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) return (0); } +static int +ixl_sysctl_set_link_active(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + int error, state; + + state = !!(atomic_load_acq_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + + error = sysctl_handle_int(oidp, &state, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + if (state == 0) + atomic_clear_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + else + atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + + return (0); +} + + int ixl_attach_get_link_status(struct ixl_pf *pf) { From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:00:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 999FA5593AE; Wed, 3 Mar 2021 02:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqxzh35qBz4SJs; Wed, 3 Mar 2021 02:00: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 5D88721700; Wed, 3 Mar 2021 02:00: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 12320mDI096500; Wed, 3 Mar 2021 02:00:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12320mCi096499; Wed, 3 Mar 2021 02:00:48 GMT (envelope-from git) Date: Wed, 3 Mar 2021 02:00:48 GMT Message-Id: <202103030200.12320mCi096499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: f08e17c8a251 - stable/13 - zfs: fix overly broad locking in spa_vdev_config_exit() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f08e17c8a251210b58d63b52bfe1a77dccff6e78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:00:48 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=f08e17c8a251210b58d63b52bfe1a77dccff6e78 commit f08e17c8a251210b58d63b52bfe1a77dccff6e78 Author: Martin Matuska AuthorDate: 2021-03-03 01:25:03 +0000 Commit: Martin Matuska CommitDate: 2021-03-03 01:25:03 +0000 zfs: fix overly broad locking in spa_vdev_config_exit() Resolves a deadlock which can occur when the ZED or zpool command attaches a new device. From the openzfs 75a089ed3 commit message: Calling vdev_free() only requires the we acquire the spa config SCL_STATE_ALL locks, not the SCL_ALL locks. In particular, we need need to avoid taking the SCL_CONFIG lock (included in SCL_ALL) as a writer since this can lead to a deadlock. The txg_sync_thread() may block in spa_txg_history_init_io() when taking the SCL_CONFIG lock as a reading when it detects there's a pending writer. Obtained from: openzfs/zfs@75a089ed34befb8d11df9be92a4438cc49554bf6 MFS after: 3 days (direct commit) --- sys/contrib/openzfs/module/zfs/spa_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/spa_misc.c b/sys/contrib/openzfs/module/zfs/spa_misc.c index f49be8eec01a..f11ec0f60574 100644 --- a/sys/contrib/openzfs/module/zfs/spa_misc.c +++ b/sys/contrib/openzfs/module/zfs/spa_misc.c @@ -1275,9 +1275,9 @@ spa_vdev_config_exit(spa_t *spa, vdev_t *vd, uint64_t txg, int error, char *tag) */ vdev_autotrim_stop_wait(vd); - spa_config_enter(spa, SCL_ALL, spa, RW_WRITER); + spa_config_enter(spa, SCL_STATE_ALL, spa, RW_WRITER); vdev_free(vd); - spa_config_exit(spa, SCL_ALL, spa); + spa_config_exit(spa, SCL_STATE_ALL, spa); } /* From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:01:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A028559676; Wed, 3 Mar 2021 02:01:01 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 4Dqxzx3kNfz4SGs; Wed, 3 Mar 2021 02:01:01 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f169.google.com with SMTP id p10so7797538ils.9; Tue, 02 Mar 2021 18:01:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8dyNTo0sFalEHSF/N9Im4Aiyx7vK/96dD1DYZ5wtBG0=; b=V7GS8arj4HJaauu7lUJGypJOeAyqx0BtwpZ0jyROwPIJRQjuvegUiCNWKRZBCeir96 TWVWTzeRfQbC8jJizqxfXFd3U/6rGuQ81oXtHj/tORd7v3OkqOq2X5vbpOwY6D4DzpB1 QhyD9yRR/iuXFiyqOwbif8vS1zEcobE2s9NJ/pVXIxrq8OpnOEnzLximpbrLnZBEffUV eqzlydO73wLevAabvQ47oJZaugWc+ynhEitih4rkYHJSKvW0CBe/ACk/rlvv43NDgGrx txTg1V0+Z8iPX3XDnq8IlXH2wmGrq40gClDR9miFaQyoSjysRyNIwm1O+Z0B8kX755rd gnSQ== X-Gm-Message-State: AOAM531k2N9ZacvTqTT83tMLi7FikNhK6v22BOWrraHNtXWe9VA7brwH lvejNVnU2wj+UX8nxebfYOIJHxnwvaUJNRZ2aKs= X-Google-Smtp-Source: ABdhPJwDuhJZsmZ8tkQeEMtg5NxQDV8zvPkpKDUpxeAl9X8wk8W+U/0yEkIpahqotDWiFuGmm1sKcLkgtNE7dLbOWZU= X-Received: by 2002:a92:d981:: with SMTP id r1mr19638899iln.98.1614736860349; Tue, 02 Mar 2021 18:01:00 -0800 (PST) MIME-Version: 1.0 References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> In-Reply-To: From: Ed Maste Date: Tue, 2 Mar 2021 21:00:45 -0500 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Warner Losh Cc: Nathan Whitehorn , "Rodney W. Grimes" , Brandon Bergren , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Dqxzx3kNfz4SGs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:01:01 -0000 On Tue, 2 Mar 2021 at 19:30, Warner Losh wrote: > > There has been some talk of moving the mount point to /efi, but I think that went nowhere... I thought about /efi based on arguments from the Linux world, more info at https://wiki.archlinux.org/index.php/EFI_system_partition#Typical_mount_points. I did open https://reviews.freebsd.org/D28814 to move the existing uses to /efi. That said, I'm much more interested in us picking something and using it in the installer/other tooling than whether it's /boot/efi or /efi. From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:01:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6752F5594B8; Wed, 3 Mar 2021 02:01: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 4Dqy0C2LFJz4SfP; Wed, 3 Mar 2021 02:01: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 968002184D; Wed, 3 Mar 2021 02:01: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 12321Dxc096670; Wed, 3 Mar 2021 02:01:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12321DdU096669; Wed, 3 Mar 2021 02:01:13 GMT (envelope-from git) Date: Wed, 3 Mar 2021 02:01:13 GMT Message-Id: <202103030201.12321DdU096669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: c70690631443 - stable/13 - zfs: fix vdev_rebuild_thread deadlock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7069063144395b025c0ef178431eb2cafdbe1ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:01:15 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=c7069063144395b025c0ef178431eb2cafdbe1ca commit c7069063144395b025c0ef178431eb2cafdbe1ca Author: Martin Matuska AuthorDate: 2021-03-03 01:28:56 +0000 Commit: Martin Matuska CommitDate: 2021-03-03 01:28:56 +0000 zfs: fix vdev_rebuild_thread deadlock From the openzfs 8e43fa12c commit message: The metaslab_disable() call may block waiting for a txg sync. Therefore it's important that vdev_rebuild_thread release the SCL_CONFIG read lock it is holding before this call. Failure to do so can result in the txg_sync thread getting blocked waiting for this lock which results in a deadlock. Obtained from: openzfs/zfs@8e43fa12c571878f32119122771888ab9092a75a MFS after: 3 days (direct commit) --- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/zfs/vdev_rebuild.c b/sys/contrib/openzfs/module/zfs/vdev_rebuild.c index 784d1af15a81..112c04d0ba04 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_rebuild.c +++ b/sys/contrib/openzfs/module/zfs/vdev_rebuild.c @@ -804,8 +804,8 @@ vdev_rebuild_thread(void *arg) ASSERT0(range_tree_space(vr->vr_scan_tree)); /* Disable any new allocations to this metaslab */ - metaslab_disable(msp); spa_config_exit(spa, SCL_CONFIG, FTAG); + metaslab_disable(msp); mutex_enter(&msp->ms_sync_lock); mutex_enter(&msp->ms_lock); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:01:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F667559263; Wed, 3 Mar 2021 02:01: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 4Dqy0S3sw4z4T07; Wed, 3 Mar 2021 02:01: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 4263E21902; Wed, 3 Mar 2021 02:01: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 12321RJZ097507; Wed, 3 Mar 2021 02:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12321R8h097506; Wed, 3 Mar 2021 02:01:27 GMT (envelope-from git) Date: Wed, 3 Mar 2021 02:01:27 GMT Message-Id: <202103030201.12321R8h097506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 19049a2b2bd7 - stable/13 - zfs: fix assert in FreeBSD-specific dmu_read_pages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19049a2b2bd7119ef7b34102513f6bbfdf9ff862 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:01:28 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=19049a2b2bd7119ef7b34102513f6bbfdf9ff862 commit 19049a2b2bd7119ef7b34102513f6bbfdf9ff862 Author: Martin Matuska AuthorDate: 2021-03-03 01:32:59 +0000 Commit: Martin Matuska CommitDate: 2021-03-03 01:32:59 +0000 zfs: fix assert in FreeBSD-specific dmu_read_pages From the openzfs 2e160dee9 commit message: The function has three similar pieces of code: for read-behind pages, requested pages and read-ahead pages. All three pieces had an assert to ensure that the page is not mapped. Later the assert was relaxed to require that the page is not mapped for writing. But that was done in two places out of three. This change fixes the third piece, read-ahead. Obtained from: openzfs/zfs@2e160dee97a4badbc318561f76ea56451c916d2f MFS after: 3 days (direct commit) --- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c index 8e412d9c1359..fb8f560316ea 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c @@ -319,7 +319,7 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, break; } ASSERT(m->dirty == 0); - ASSERT(!pmap_page_is_mapped(m)); + ASSERT(!pmap_page_is_write_mapped(m)); ASSERT(db->db_size > PAGE_SIZE); bufoff = IDX_TO_OFF(m->pindex) % db->db_size; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:01:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8412559794; Wed, 3 Mar 2021 02:01: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 4Dqy0m6GpLz4T14; Wed, 3 Mar 2021 02:01: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 CA026210E0; Wed, 3 Mar 2021 02:01: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 12321ioF097651; Wed, 3 Mar 2021 02:01:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12321i4I097650; Wed, 3 Mar 2021 02:01:44 GMT (envelope-from git) Date: Wed, 3 Mar 2021 02:01:44 GMT Message-Id: <202103030201.12321i4I097650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: dc2743434f6c - stable/13 - zfs: cancel TRIM or initialize on FAULTED non-writeable vdevs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc2743434f6cc73ca8ec1d551aba03a678eac804 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:01:45 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=dc2743434f6cc73ca8ec1d551aba03a678eac804 commit dc2743434f6cc73ca8ec1d551aba03a678eac804 Author: Martin Matuska AuthorDate: 2021-03-03 01:38:09 +0000 Commit: Martin Matuska CommitDate: 2021-03-03 01:38:09 +0000 zfs: cancel TRIM or initialize on FAULTED non-writeable vdevs From the openzfs commit message: When a device which is actively trimming or initializing becomes FAULTED, and therefore no longer writable, cancel the active TRIM or initialization. When the device is merely taken offline with `zpool offline` then stop the operation but do not cancel it. When the device is brought back online the operation will be resumed if possible. Obtained from: openzfs/zfs@bedbc13daa6dfe9e0221bfadb8d8db2378deaacc MFS after: 3 days (direct commit) --- sys/contrib/openzfs/module/zfs/vdev_initialize.c | 10 +++- sys/contrib/openzfs/module/zfs/vdev_trim.c | 15 ++++-- sys/contrib/openzfs/tests/runfiles/common.run | 2 + .../cli_root/zpool_initialize/Makefile.am | 1 + ...zpool_initialize_fault_export_import_online.ksh | 59 ++++++++++++++++++++ .../functional/cli_root/zpool_trim/Makefile.am | 1 + .../zpool_trim_fault_export_import_online.ksh | 62 ++++++++++++++++++++++ 7 files changed, 144 insertions(+), 6 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/vdev_initialize.c b/sys/contrib/openzfs/module/zfs/vdev_initialize.c index 083ad2861b5b..e9156c32f384 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_initialize.c +++ b/sys/contrib/openzfs/module/zfs/vdev_initialize.c @@ -553,8 +553,14 @@ vdev_initialize_thread(void *arg) vd->vdev_initialize_tree = NULL; mutex_enter(&vd->vdev_initialize_lock); - if (!vd->vdev_initialize_exit_wanted && vdev_writeable(vd)) { - vdev_initialize_change_state(vd, VDEV_INITIALIZE_COMPLETE); + if (!vd->vdev_initialize_exit_wanted) { + if (vdev_writeable(vd)) { + vdev_initialize_change_state(vd, + VDEV_INITIALIZE_COMPLETE); + } else if (vd->vdev_faulted) { + vdev_initialize_change_state(vd, + VDEV_INITIALIZE_CANCELED); + } } ASSERT(vd->vdev_initialize_thread != NULL || vd->vdev_initialize_inflight == 0); diff --git a/sys/contrib/openzfs/module/zfs/vdev_trim.c b/sys/contrib/openzfs/module/zfs/vdev_trim.c index 895957bda195..deea7fedd770 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_trim.c +++ b/sys/contrib/openzfs/module/zfs/vdev_trim.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2016 by Delphix. All rights reserved. * Copyright (c) 2019 by Lawrence Livermore National Security, LLC. + * Copyright (c) 2021 Hewlett Packard Enterprise Development LP */ #include @@ -930,10 +931,16 @@ vdev_trim_thread(void *arg) range_tree_destroy(ta.trim_tree); mutex_enter(&vd->vdev_trim_lock); - if (!vd->vdev_trim_exit_wanted && vdev_writeable(vd)) { - vdev_trim_change_state(vd, VDEV_TRIM_COMPLETE, - vd->vdev_trim_rate, vd->vdev_trim_partial, - vd->vdev_trim_secure); + if (!vd->vdev_trim_exit_wanted) { + if (vdev_writeable(vd)) { + vdev_trim_change_state(vd, VDEV_TRIM_COMPLETE, + vd->vdev_trim_rate, vd->vdev_trim_partial, + vd->vdev_trim_secure); + } else if (vd->vdev_faulted) { + vdev_trim_change_state(vd, VDEV_TRIM_CANCELED, + vd->vdev_trim_rate, vd->vdev_trim_partial, + vd->vdev_trim_secure); + } } ASSERT(vd->vdev_trim_thread != NULL || vd->vdev_trim_inflight[0] == 0); diff --git a/sys/contrib/openzfs/tests/runfiles/common.run b/sys/contrib/openzfs/tests/runfiles/common.run index c0bfc09ac5b3..290b9ffba65c 100644 --- a/sys/contrib/openzfs/tests/runfiles/common.run +++ b/sys/contrib/openzfs/tests/runfiles/common.run @@ -413,6 +413,7 @@ tags = ['functional', 'cli_root', 'zpool_labelclear'] [tests/functional/cli_root/zpool_initialize] tests = ['zpool_initialize_attach_detach_add_remove', + 'zpool_initialize_fault_export_import_online', 'zpool_initialize_import_export', 'zpool_initialize_offline_export_import_online', 'zpool_initialize_online_offline', @@ -477,6 +478,7 @@ tags = ['functional', 'cli_root', 'zpool_sync'] [tests/functional/cli_root/zpool_trim] tests = ['zpool_trim_attach_detach_add_remove', + 'zpool_trim_fault_export_import_online', 'zpool_trim_import_export', 'zpool_trim_multiple', 'zpool_trim_neg', 'zpool_trim_offline_export_import_online', 'zpool_trim_online_offline', 'zpool_trim_partial', 'zpool_trim_rate', 'zpool_trim_rate_neg', diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am index 2ebc376d9cb9..3968902ec36d 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am @@ -2,6 +2,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_init dist_pkgdata_SCRIPTS = \ cleanup.ksh \ zpool_initialize_attach_detach_add_remove.ksh \ + zpool_initialize_fault_export_import_online.ksh \ zpool_initialize_import_export.ksh \ zpool_initialize_offline_export_import_online.ksh \ zpool_initialize_online_offline.ksh \ diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh new file mode 100755 index 000000000000..11b8a483e662 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh @@ -0,0 +1,59 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2021 Lawrence Livermore National Security, LLC. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_initialize/zpool_initialize.kshlib + +# +# DESCRIPTION: +# Miscellaneous complex sequences of operations function as expected. +# +# STRATEGY: +# 1. Create a pool with a two-way mirror. +# 2. Start initializing, fault, export, import, online and verify along +# the way that the initializing was cancelled and not restarted. +# + +DISK1="$(echo $DISKS | cut -d' ' -f1)" +DISK2="$(echo $DISKS | cut -d' ' -f2)" + +log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2 + +log_must zpool initialize $TESTPOOL $DISK1 +progress="$(initialize_progress $TESTPOOL $DISK1)" +[[ -z "$progress" ]] && log_fail "Initializing did not start" + +log_must zpool offline -f $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_must zpool export $TESTPOOL +log_must zpool import $TESTPOOL + +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_must zpool online $TESTPOOL $DISK1 +log_must zpool clear $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "ONLINE" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_pass "Initializing behaves as expected at each step of:" \ + "initialize + fault + export + import + online" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am index d2d3b4ae88bb..0411ab4e0070 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am @@ -3,6 +3,7 @@ dist_pkgdata_SCRIPTS = \ setup.ksh \ cleanup.ksh \ zpool_trim_attach_detach_add_remove.ksh \ + zpool_trim_fault_export_import_online.ksh \ zpool_trim_import_export.ksh \ zpool_trim_multiple.ksh \ zpool_trim_neg.ksh \ diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh new file mode 100755 index 000000000000..6bb9fc346daf --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh @@ -0,0 +1,62 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2019 by Tim Chase. All rights reserved. +# Copyright (c) 2021 Lawrence Livermore National Security, LLC. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_trim/zpool_trim.kshlib + +# +# DESCRIPTION: +# Miscellaneous complex sequences of operations function as expected. +# +# STRATEGY: +# 1. Create a pool with a two-way mirror. +# 2. Start trimming, fault, export, import, online and verify along +# the way that the trim was cancelled and not restarted. +# + +DISK1="$(echo $DISKS | cut -d' ' -f1)" +DISK2="$(echo $DISKS | cut -d' ' -f2)" + +log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2 + +log_must zpool trim -r 128M $TESTPOOL $DISK1 +progress="$(trim_progress $TESTPOOL $DISK1)" +[[ -z "$progress" ]] && log_fail "Trimming did not start" + +log_must zpool offline -f $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep untrimmed" + +log_must zpool export $TESTPOOL +log_must zpool import $TESTPOOL + +# Note: the expected state here is unsupported since the faulted device +# cannot be checked to determine if it supports TRIM. +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep unsupported" + +log_must zpool online $TESTPOOL $DISK1 +log_must zpool clear $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "ONLINE" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep untrimmed" + +log_pass "Trimming behaves as expected at each step of:" \ + "trim + fault + export + import + online" From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:16:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B3B1559BE9; Wed, 3 Mar 2021 02:16: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 4DqyKj0GV3z4Trj; Wed, 3 Mar 2021 02:16: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 F00C8218AF; Wed, 3 Mar 2021 02:16: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 1232GOvK014675; Wed, 3 Mar 2021 02:16:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1232GOjv014674; Wed, 3 Mar 2021 02:16:24 GMT (envelope-from git) Date: Wed, 3 Mar 2021 02:16:24 GMT Message-Id: <202103030216.1232GOjv014674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 8b22242550c9 - main - sbin/ifconfig: Use a global libifconfig handle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b22242550c98d0a59b6589f2be0beb1dc2eac13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:16:25 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=8b22242550c98d0a59b6589f2be0beb1dc2eac13 commit 8b22242550c98d0a59b6589f2be0beb1dc2eac13 Author: Ryan Moeller AuthorDate: 2021-02-28 10:30:09 +0000 Commit: Ryan Moeller CommitDate: 2021-03-03 02:15:40 +0000 sbin/ifconfig: Use a global libifconfig handle This should eventually replace the socket passed to the various handlers. In the meantime, making it global avoids repeatedly opening and closing handles. Reported by: kp Reviewed by: kp (earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28990 --- sbin/ifconfig/carp.c | 9 +-------- sbin/ifconfig/ifbridge.c | 9 +-------- sbin/ifconfig/ifclone.c | 6 ------ sbin/ifconfig/ifconfig.c | 9 +++++++++ sbin/ifconfig/ifconfig.h | 5 +++++ sbin/ifconfig/ifgroup.c | 9 +-------- sbin/ifconfig/iflagg.c | 9 +-------- sbin/ifconfig/sfp.c | 14 +++----------- 8 files changed, 21 insertions(+), 49 deletions(-) diff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c index d6f8d78ba920..23a119e3b9d7 100644 --- a/sbin/ifconfig/carp.c +++ b/sbin/ifconfig/carp.c @@ -73,14 +73,9 @@ static void carp_status(int s) { struct carpreq carpr[CARP_MAXVHID]; - ifconfig_handle_t *lifh; - - lifh = ifconfig_open(); - if (lifh == NULL) - return; if (ifconfig_carp_get_info(lifh, name, carpr, CARP_MAXVHID) == -1) - goto close; + return; for (size_t i = 0; i < carpr[0].carpr_count; i++) { printf("\tcarp: %s vhid %d advbase %d advskew %d", @@ -91,8 +86,6 @@ carp_status(int s) else printf("\n"); } -close: - ifconfig_close(lifh); } static void diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index cc1520a2e3f0..2bd9c96f2489 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -156,19 +156,14 @@ bridge_addresses(int s, const char *prefix) static void bridge_status(int s) { - ifconfig_handle_t *lifh; struct ifconfig_bridge_status *bridge; struct ifbropreq *params; const char *pad, *prefix; uint8_t lladdr[ETHER_ADDR_LEN]; uint16_t bprio; - lifh = ifconfig_open(); - if (lifh == NULL) - return; - if (ifconfig_bridge_get_bridge_status(lifh, name, &bridge) == -1) - goto close; + return; params = bridge->params; @@ -227,8 +222,6 @@ bridge_status(int s) } ifconfig_bridge_free_bridge_status(bridge); -close: - ifconfig_close(lifh); } static void diff --git a/sbin/ifconfig/ifclone.c b/sbin/ifconfig/ifclone.c index ad39bd43757a..9cacff239967 100644 --- a/sbin/ifconfig/ifclone.c +++ b/sbin/ifconfig/ifclone.c @@ -57,17 +57,11 @@ typedef enum { static void list_cloners(void) { - ifconfig_handle_t *lifh; char *cloners; size_t cloners_count; - lifh = ifconfig_open(); - if (lifh == NULL) - return; - if (ifconfig_list_cloners(lifh, &cloners, &cloners_count) < 0) errc(1, ifconfig_err_errno(lifh), "unable to list cloners"); - ifconfig_close(lifh); for (const char *name = cloners; name < cloners + cloners_count * IFNAMSIZ; diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 5b12baa0656e..fc5351bd420e 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -78,8 +78,12 @@ static const char rcsid[] = #include #include +#include + #include "ifconfig.h" +ifconfig_handle_t *lifh; + /* * Since "struct ifreq" is composed of various union members, callers * should pay special attention to interpret the value. @@ -427,6 +431,10 @@ main(int argc, char *argv[]) f_inet = f_inet6 = f_ether = f_addr = NULL; matchgroup = nogroup = NULL; + lifh = ifconfig_open(); + if (lifh == NULL) + err(EXIT_FAILURE, "ifconfig_open"); + envformat = getenv("IFCONFIG_FORMAT"); if (envformat != NULL) setformat(envformat); @@ -699,6 +707,7 @@ main(int argc, char *argv[]) done: freeformat(); + ifconfig_close(lifh); exit(exit_code); } diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 67c25f5921d6..61b1137b47ba 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -36,6 +36,10 @@ * $FreeBSD$ */ +#pragma once + +#include + #define __constructor __attribute__((constructor)) struct afswtch; @@ -128,6 +132,7 @@ struct option { }; void opt_register(struct option *); +extern ifconfig_handle_t *lifh; extern struct ifreq ifr; extern char name[IFNAMSIZ]; /* name of interface */ extern int allmedia; diff --git a/sbin/ifconfig/ifgroup.c b/sbin/ifconfig/ifgroup.c index 2b13227af4f3..7f1173c316d7 100644 --- a/sbin/ifconfig/ifgroup.c +++ b/sbin/ifconfig/ifgroup.c @@ -86,16 +86,11 @@ unsetifgroup(const char *group_name, int d, int s, const struct afswtch *rafp) static void getifgroups(int s) { - ifconfig_handle_t *lifh; struct ifgroupreq ifgr; size_t cnt; - lifh = ifconfig_open(); - if (lifh == NULL) - return; - if (ifconfig_get_groups(lifh, name, &ifgr) == -1) - goto close; + return; cnt = 0; for (size_t i = 0; i < ifgr.ifgr_len / sizeof(struct ifg_req); ++i) { @@ -112,8 +107,6 @@ getifgroups(int s) printf("\n"); free(ifgr.ifgr_groups); -close: - ifconfig_close(lifh); } static void diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c index 5e726115662a..48d7450076a9 100644 --- a/sbin/ifconfig/iflagg.c +++ b/sbin/ifconfig/iflagg.c @@ -219,7 +219,6 @@ static void lagg_status(int s) { struct lagg_protos protos[] = LAGG_PROTOS; - ifconfig_handle_t *lifh; struct ifconfig_lagg_status *lagg; struct lagg_reqall *ra; struct lagg_reqflags *rf; @@ -228,12 +227,8 @@ lagg_status(int s) struct lacp_opreq *lp; const char *proto; - lifh = ifconfig_open(); - if (lifh == NULL) - return; - if (ifconfig_lagg_get_lagg_status(lifh, name, &lagg) == -1) - goto close; + return; ra = lagg->ra; rf = lagg->rf; @@ -297,8 +292,6 @@ lagg_status(int s) } ifconfig_lagg_free_lagg_status(lagg); -close: - ifconfig_close(lifh); } static diff --git a/sbin/ifconfig/sfp.c b/sbin/ifconfig/sfp.c index 15ff22639060..4900b18ff2c8 100644 --- a/sbin/ifconfig/sfp.c +++ b/sbin/ifconfig/sfp.c @@ -61,15 +61,10 @@ sfp_status(int s, struct ifreq *ifr, int verbose) struct ifconfig_sfp_info_strings strings; struct ifconfig_sfp_vendor_info vendor_info; struct ifconfig_sfp_status status; - ifconfig_handle_t *lifh; size_t channel_count; - lifh = ifconfig_open(); - if (lifh == NULL) - return; - if (ifconfig_sfp_get_sfp_info(lifh, name, &info) == -1) - goto close; + return; ifconfig_sfp_get_sfp_info_strings(&info, &strings); @@ -79,7 +74,7 @@ sfp_status(int s, struct ifreq *ifr, int verbose) strings.sfp_conn); if (ifconfig_sfp_get_sfp_vendor_info(lifh, name, &vendor_info) == -1) - goto close; + return; printf("\tvendor: %s PN: %s SN: %s DATE: %s\n", vendor_info.name, vendor_info.pn, vendor_info.sn, vendor_info.date); @@ -118,7 +113,7 @@ sfp_status(int s, struct ifreq *ifr, int verbose) struct ifconfig_sfp_dump dump; if (ifconfig_sfp_get_sfp_dump(lifh, name, &dump) == -1) - goto close; + return; if (ifconfig_sfp_id_is_qsfp(info.sfp_id)) { printf("\n\tSFF8436 DUMP (0xA0 128..255 range):\n"); @@ -133,7 +128,4 @@ sfp_status(int s, struct ifreq *ifr, int verbose) "\t", HD_OMIT_COUNT | HD_OMIT_CHARS); } } - -close: - ifconfig_close(lifh); } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:20:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7F70559C16; Wed, 3 Mar 2021 02:20: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 4DqyQK5hG2z4TqX; Wed, 3 Mar 2021 02:20: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 B1F1B218B1; Wed, 3 Mar 2021 02:20: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 1232KP1p022720; Wed, 3 Mar 2021 02:20:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1232KPue022718; Wed, 3 Mar 2021 02:20:25 GMT (envelope-from git) Date: Wed, 3 Mar 2021 02:20:25 GMT Message-Id: <202103030220.1232KPue022718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 80545a16df95 - main - libifconfig: Fix typo in symbol map MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80545a16df95263781b3422695527b6238f4bd2c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:20:25 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=80545a16df95263781b3422695527b6238f4bd2c commit 80545a16df95263781b3422695527b6238f4bd2c Author: Ryan Moeller AuthorDate: 2021-03-03 01:55:18 +0000 Commit: Ryan Moeller CommitDate: 2021-03-03 02:19:42 +0000 libifconfig: Fix typo in symbol map MFC after: 1 week --- lib/libifconfig/Symbol.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libifconfig/Symbol.map b/lib/libifconfig/Symbol.map index b3e81d6ee497..235092376b11 100644 --- a/lib/libifconfig/Symbol.map +++ b/lib/libifconfig/Symbol.map @@ -10,7 +10,7 @@ FBSD_1.6 { ifconfig_err_errtype; ifconfig_err_ioctlreq; ifconfig_foreach_ifaddr; - ifconfig_foreach_interface; + ifconfig_foreach_iface; ifconfig_get_capability; ifconfig_get_description; ifconfig_get_fib; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 02:41:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F339555A333; Wed, 3 Mar 2021 02:41: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 4DqytF6cjhz4Vps; Wed, 3 Mar 2021 02:41: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 D606F21C70; Wed, 3 Mar 2021 02:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1232f9lA049200; Wed, 3 Mar 2021 02:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1232f9QW049199; Wed, 3 Mar 2021 02:41:09 GMT (envelope-from git) Date: Wed, 3 Mar 2021 02:41:09 GMT Message-Id: <202103030241.1232f9QW049199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: de415e663c75 - main - release.7: describe the NOGIT option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de415e663c7507f6cc59aafeb20243f1fa0994f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 02:41:10 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=de415e663c7507f6cc59aafeb20243f1fa0994f9 commit de415e663c7507f6cc59aafeb20243f1fa0994f9 Author: Alan Somers AuthorDate: 2021-03-03 01:05:25 +0000 Commit: Alan Somers CommitDate: 2021-03-03 02:39:57 +0000 release.7: describe the NOGIT option It was added in 91ce469984500aa994c85640e0af129e3e0c938f (svn r365638) MFC after: 7 days Sponsored by: Axcient Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D29027 --- share/man/man7/release.7 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index f176251d89cc..82c1b83fe3a4 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 2, 2021 .Dt RELEASE 7 .Os .Sh NAME @@ -143,6 +143,10 @@ Additional .Xr make 1 arguments to pass through, which directly affect the tuning of the build chroot. +.It Va NOGIT +Do not explicitly require the +.Xr git 1 +port to be installed. .It Va GITROOT The .Xr git 1 From owner-dev-commits-src-all@freebsd.org Wed Mar 3 03:20:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F99955AAC6 for ; Wed, 3 Mar 2021 03:20:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (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 4Dqzl60Qf1z4XTg for ; Wed, 3 Mar 2021 03:20:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf30.google.com with SMTP id cw15so10287209qvb.11 for ; Tue, 02 Mar 2021 19:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G82nZB1qjjdOmSzV3pBP7dqcm/bpWcuHpub2Bd3X7yU=; b=Ib/7ziK+rSw0DzE6WWU47G55cbiv1NcNFhoYctXhnWUXSEga0Bk7C0u/kj6JnDrt+j ugdLSiWkGzgUQTu9YtlNdYFBSqslWStPL94Kxu2yy5Dp4C0Mu2k9JPr8BoahlrpR3QOT SMvlIzpsdINggmzvxwTJL8kAA6uCR/QImIsg2jkur3uLW20vyDImUezzjb1hV9g/NtG7 ktnF5SVzg5DXWjuiLWKwsCk7Ignw8E6F2vy8hQvOxOtsVWHvhClzTnusm+xl+D1mP+fu jiASBZYm/KvRYgOWBWXWJifDpADjWUTo5VM5eTY1/jkndxtraR8/SYC7FXKLwpJhYI/J 8EHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G82nZB1qjjdOmSzV3pBP7dqcm/bpWcuHpub2Bd3X7yU=; b=IU+OJ/r7V0TFIfd857F9TQP2JSlxF6yZTXKgVq5JgbAWYPX1XMN31ZVIFscEPmGayc ZmA2DLCfq5eJSOQv4udZcENIRCsDNUv/U8z28ujl/7IkUabtAXd+eDDjHnTGZ3zYlfg6 m2Hhfw2TRTkzWjZFl8ndSC1sGnNfhE23DAMrL9l3IHCmwerUFB0UaNdOB5biguXJCXDf QiXV1R2XuGsKQLxyQp3ARELNQQEGff5f0+rvfNxPRBsiq0b+bN5hHTokx/FeR77MGfyM U3jJZtDEt4Z9/VEyRzW8OQ44HPezh4UmB6G5ViU9bY2mWFDcHaWT7LE4aIjvuU67Rqf+ B37w== X-Gm-Message-State: AOAM531eUwH0ggf8U6p6rplDMmCRaFsfqnp6GYg4g7Nu0KHfnIz4spQM sK4WZSuN7bsaOkjWfyltBO0R5aG9F8e9S6ZiUOWiHw== X-Google-Smtp-Source: ABdhPJx/7qNC3LgUN/CQKJECX/SXr1yjU9y9LDsGW1YFpP6yFIjye4PgUI/U8RFrYsY62Q+7+z4HwmcZYMAH2r5IMsc= X-Received: by 2002:a0c:a954:: with SMTP id z20mr886084qva.29.1614741600932; Tue, 02 Mar 2021 19:20:00 -0800 (PST) MIME-Version: 1.0 References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 2 Mar 2021 20:19:38 -0700 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Ed Maste Cc: Nathan Whitehorn , "Rodney W. Grimes" , Brandon Bergren , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Dqzl60Qf1z4XTg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 03:20:02 -0000 On Tue, Mar 2, 2021, 7:01 PM Ed Maste wrote: > On Tue, 2 Mar 2021 at 19:30, Warner Losh wrote: > > > > There has been some talk of moving the mount point to /efi, but I think > that went nowhere... > > I thought about /efi based on arguments from the Linux world, more > info at > https://wiki.archlinux.org/index.php/EFI_system_partition#Typical_mount_points > . > I did open https://reviews.freebsd.org/D28814 to move the existing > uses to /efi. That said, I'm much more interested in us picking > something and using it in the installer/other tooling than whether > it's /boot/efi or /efi. > Me too. I am actually open to either. If I had a do over, I'd pick /efi honestly. But the directory presence or absence shouldn't be used to know if we have an ESP to deal with or not. Warner > From owner-dev-commits-src-all@freebsd.org Wed Mar 3 03:34:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85AD255B592; Wed, 3 Mar 2021 03:34:26 +0000 (UTC) (envelope-from bdragon@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 4Dr03k2sMDz4YF7; Wed, 3 Mar 2021 03:34:26 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4BF4BC94B; Wed, 3 Mar 2021 03:34:26 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 010D027C005C; Tue, 2 Mar 2021 22:34:25 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Tue, 02 Mar 2021 22:34:26 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtuddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder reejnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepjefhfedtuddtleegkeeg tdegjeekffdvjedttdehgffgveeugffgfeelvdeghffgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsggurhgrghhonhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddtgedvfeehkeeigedqudekuddtkeehuddqsggurh grghhonheppefhrhgvvgeuufffrdhorhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 72094CA005D; Tue, 2 Mar 2021 22:34:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd Mime-Version: 1.0 Message-Id: <63ccc815-d23b-44f5-8bf8-d301ce0665f7@www.fastmail.com> In-Reply-To: References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> Date: Tue, 02 Mar 2021 21:34:04 -0600 From: "Brandon Bergren" To: "Ed Maste" , "Warner Losh" Cc: "Nathan Whitehorn" , "Rodney W. Grimes" , src-committers , "" , dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_2c26d77d989a_-_main_-_Remove_/boot/efi_from_mtree, _mi?= =?UTF-8?Q?ssed_in_0b7472b3d8d2.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 03:34:26 -0000 OK, how about this as an idea then: Parse mount output to see if anything is mounted to /boot/efi directly? if mount -p | cut -f 2 | grep '^/boot/efi$'; then .... fi -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Wed Mar 3 03:38:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBE2955B535; Wed, 3 Mar 2021 03:38:17 +0000 (UTC) (envelope-from bdragon@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 4Dr0895Xg6z4YWm; Wed, 3 Mar 2021 03:38:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A97F3C94C; Wed, 3 Mar 2021 03:38:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 9E74727C005B; Tue, 2 Mar 2021 22:38:17 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Tue, 02 Mar 2021 22:38:17 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtuddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder reejnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepjefhfedtuddtleegkeeg tdegjeekffdvjedttdehgffgveeugffgfeelvdeghffgnecuvehluhhsthgvrhfuihiivg epudenucfrrghrrghmpehmrghilhhfrhhomhepsggurhgrghhonhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddtgedvfeehkeeigedqudekuddtkeehuddqsggurh grghhonheppefhrhgvvgeuufffrdhorhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 16633CA005D; Tue, 2 Mar 2021 22:38:17 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd Mime-Version: 1.0 Message-Id: In-Reply-To: <63ccc815-d23b-44f5-8bf8-d301ce0665f7@www.fastmail.com> References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> <63ccc815-d23b-44f5-8bf8-d301ce0665f7@www.fastmail.com> Date: Tue, 02 Mar 2021 21:37:43 -0600 From: "Brandon Bergren" To: "Brandon Bergren" , "Ed Maste" , "Warner Losh" Cc: "Nathan Whitehorn" , "Rodney W. Grimes" , src-committers , "" , dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_2c26d77d989a_-_main_-_Remove_/boot/efi_from_mtree, _mi?= =?UTF-8?Q?ssed_in_0b7472b3d8d2.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 03:38:18 -0000 grep -q rather. In any case, instead of checking for directory existence, checking whether something is actually mounted there. On Tue, Mar 2, 2021, at 9:34 PM, Brandon Bergren wrote: > OK, how about this as an idea then: > > Parse mount output to see if anything is mounted to /boot/efi directly? > > if mount -p | cut -f 2 | grep '^/boot/efi$'; then > .... > fi > > -- > Brandon Bergren > bdragon@FreeBSD.org > -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Wed Mar 3 03:49:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4637355B91C; Wed, 3 Mar 2021 03:49: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 4Dr0Nn1QF2z4ZHB; Wed, 3 Mar 2021 03:49: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 2347A22B63; Wed, 3 Mar 2021 03:49: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 1233nD3W034721; Wed, 3 Mar 2021 03:49:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1233nDSQ034720; Wed, 3 Mar 2021 03:49:13 GMT (envelope-from git) Date: Wed, 3 Mar 2021 03:49:13 GMT Message-Id: <202103030349.1233nDSQ034720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c79e239ceeda - stable/13 - Add VOP_READ_PGCACHE(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c79e239ceedae35b63334cc2879fb7a771224d0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 03:49:13 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c79e239ceedae35b63334cc2879fb7a771224d0f commit c79e239ceedae35b63334cc2879fb7a771224d0f Author: Konstantin Belousov AuthorDate: 2021-02-28 01:08:37 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-03 03:07:59 +0000 Add VOP_READ_PGCACHE(9) PR: 253894 (cherry picked from commit 55eb51ab6649c3c10bf201f82a4ec410fe4da4a2) --- share/man/man9/Makefile | 1 + share/man/man9/VOP_RDWR.9 | 1 + share/man/man9/VOP_READ_PGCACHE.9 | 134 ++++++++++++++++++++++++++++++++++++++ share/man/man9/vnode.9 | 1 + 4 files changed, 137 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 7b55bf8516c7..50e760d3e047 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -425,6 +425,7 @@ MAN= accept_filter.9 \ VOP_PATHCONF.9 \ VOP_PRINT.9 \ VOP_RDWR.9 \ + VOP_READ_PGCACHE.9 \ VOP_READDIR.9 \ VOP_READLINK.9 \ VOP_REALLOCBLKS.9 \ diff --git a/share/man/man9/VOP_RDWR.9 b/share/man/man9/VOP_RDWR.9 index 4719ebabd094..2de7f9c9e7d2 100644 --- a/share/man/man9/VOP_RDWR.9 +++ b/share/man/man9/VOP_RDWR.9 @@ -83,6 +83,7 @@ Data already in VMIO space. .El .Sh LOCKS The file should be locked on entry and will still be locked on exit. +Rangelock covering the whole i/o range should be owned around the call. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh ERRORS diff --git a/share/man/man9/VOP_READ_PGCACHE.9 b/share/man/man9/VOP_READ_PGCACHE.9 new file mode 100644 index 000000000000..3e6ae9be4fc7 --- /dev/null +++ b/share/man/man9/VOP_READ_PGCACHE.9 @@ -0,0 +1,134 @@ +.\" Copyright (c) 2021 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 28, 2021 +.Dt VOP_READ_PGCACHE 9 +.Os +.Sh NAME +.Nm VOP_READ_PGCACHE +.Nd read a file, fast +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.In sys/uio.h +.Ft int +.Fo VOP_READ_PGCACHE +.Fa "struct vnode *vp" +.Fa "struct uio *uio" +.Fa "int ioflag" +.Fa "struct ucred *cred" +.Fc +.Sh DESCRIPTION +This entry point reads the contents of a file. +The intent is to provide the data from caches, which do not require +expensive operations or any disk IO. +For instance, if filesystem uses normal VM page cache and maintains +.Dv v_object +lifetime, it can use +.Xr vn_read_from_obj 9 +helper to return data from the resident +.Dv vp->v_object +pages. +.Pp +The filesystem indicates support for the +.Nm +on specific vnode by setting the +.Dv VIRF_PGREAD +flag in +.Dv vp->v_irflag . +.Pp +The function does not need to satisfy the whole request; it also might choose +to not provide any data. +In these cases, the +.Fa uio +must be advanced by the amount of read data, +.Nm +should return +.Er EJUSTRETURN , +and VFS would handle the rest of the read operation using the +.Xr VOP_READ 9 . +.Pp +The VFS layer does the same deadlock avoidance for accessing userspace +pages from +.Nm +as for +.Xr VOP_READ 9 . +.Pp +Vnode is not locked on the call entry and should not be locked on return. +For a filesystem that requires vnode lock to return any data, it does +not make sense to implement +.Nm +(and set +.Dv VIRF_PGREAD +flag) since VFS arranges the call to +.Xr VOP_READ 9 +as needed. +.Pp +The arguments are: +.Bl -tag -width ioflag +.It Fa vp +The vnode of the file. +.It Fa uio +The location of the data to be read. +.It Fa ioflag +Various flags, see +.Xr VOP_READ 9 +for the list. +.It Fa cred +The credentials of the caller. +.El +.Pp +.Nm +does not handle non-zero +.Fa ioflag +argument. +.Sh LOCKS +The file should be referenced on entry on entry and will still be +referenced on exit. +Rangelock covering the whole read range should be owned around the call. +.Sh RETURN VALUES +Zero is returned on success, when the whole request is satisfied, and no +more data cannot be provided for it by any means. +If more data can be returned, but +.Nm +was unable to provide it, +.Er EJUSTRETURN +must be returned. +The +.Dv uio +records should be updated according to the partial operation done. +.Pp +Otherwise an error code is returned, +same as from +.Xr VOP_READ 9 +.Sh SEE ALSO +.Xr uiomove 9 , +.Xr vnode 9 , +.Xr VOP_READ 9 diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 91360a755fbc..7a58f07b22b0 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -181,6 +181,7 @@ intertwining of VM Objects and Vnodes. .Xr VOP_PATHCONF 9 , .Xr VOP_PRINT 9 , .Xr VOP_RDWR 9 , +.Xr VOP_READ_PGCACHE 9 , .Xr VOP_READDIR 9 , .Xr VOP_READLINK 9 , .Xr VOP_REALLOCBLKS 9 , From owner-dev-commits-src-all@freebsd.org Wed Mar 3 03:49:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6352E55B995; Wed, 3 Mar 2021 03:49: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 4Dr0Np2Lh7z4Z25; Wed, 3 Mar 2021 03:49: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 43F2B22E7B; Wed, 3 Mar 2021 03:49: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 1233nEYP034745; Wed, 3 Mar 2021 03: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 1233nERW034744; Wed, 3 Mar 2021 03:49:14 GMT (envelope-from git) Date: Wed, 3 Mar 2021 03:49:14 GMT Message-Id: <202103030349.1233nERW034744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e7be16de5044 - stable/13 - atomic: add atomic_interrupt_fence() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7be16de504447e258593ffd290d3d0aef5f1cdf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 03:49:14 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e7be16de504447e258593ffd290d3d0aef5f1cdf commit e7be16de504447e258593ffd290d3d0aef5f1cdf Author: Konstantin Belousov AuthorDate: 2021-02-23 22:12:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-03 03:08:15 +0000 atomic: add atomic_interrupt_fence() (cherry picked from commit e2494f7561c852951d8ac567314f5e12f19ee7af) --- share/man/man9/atomic.9 | 13 ++++++++++++- sys/sys/atomic_common.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index 39a4fa9c6f96..397a8fcd6b18 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2019 +.Dd February 24, 2021 .Dt ATOMIC 9 .Os .Sh NAME @@ -31,6 +31,7 @@ .Nm atomic_cmpset , .Nm atomic_fcmpset , .Nm atomic_fetchadd , +.Nm atomic_interrupt_fence , .Nm atomic_load , .Nm atomic_readandclear , .Nm atomic_set , @@ -59,6 +60,8 @@ .Fc .Ft .Fn atomic_fetchadd_ "volatile *p" " v" +.Ft void +.Fn atomic_interrupt_fence "void" .Ft .Fn atomic_load_[acq_] "volatile *p" .Ft @@ -292,6 +295,14 @@ release stores, by separating access from ordering, they can sometimes facilitate more efficient implementations of synchronization primitives. For example, they can be used to avoid executing a memory barrier until a memory access shows that some condition is satisfied. +.Ss Interrupt Fence Operations +The +.Fn atomic_interrupt_fence() +function establishes ordering between its call location and any interrupt +handler executing on the same CPU. +It is modeled after the similar C11 function +.Fn atomic_signal_fence() , +and adapted for the kernel environment. .Ss Multiple Processors In multiprocessor systems, the atomicity of the atomic operations on memory depends on support for cache coherence in the underlying architecture. diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index 48f0a8b8939c..403b3de8a092 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -78,4 +78,6 @@ #define atomic_load_consume_ptr(p) \ ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) +#define atomic_interrupt_fence() __compiler_membar() + #endif From owner-dev-commits-src-all@freebsd.org Wed Mar 3 03:56:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE1BF55BB75; Wed, 3 Mar 2021 03:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dr0Yb6StWz4ZlD; Wed, 3 Mar 2021 03:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D080A23032; Wed, 3 Mar 2021 03:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1233upaa048362; Wed, 3 Mar 2021 03:56:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1233upTF048361; Wed, 3 Mar 2021 03:56:51 GMT (envelope-from git) Date: Wed, 3 Mar 2021 03:56:51 GMT Message-Id: <202103030356.1233upTF048361@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: 852f70b24043 - main - init: use explicit_bzero() for clearing passwords 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: 852f70b24043885f0e438e8fecedd482a9a96d5e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 03:56:52 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=852f70b24043885f0e438e8fecedd482a9a96d5e commit 852f70b24043885f0e438e8fecedd482a9a96d5e Author: Kyle Evans AuthorDate: 2021-03-03 03:38:37 +0000 Commit: Kyle Evans CommitDate: 2021-03-03 03:55:41 +0000 init: use explicit_bzero() for clearing passwords This is a nop in practice, because it cannot be proven that this particular bzero() is not significant. Make it explicit anyways, rather than relying on an implementation detail of how the password is collected. Discussed with: Andrew Gierth --- sbin/init/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/init/init.c b/sbin/init/init.c index c5f3c121f7f9..943db9f26bd3 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -908,7 +908,7 @@ single_user(void) if (clear == NULL || *clear == '\0') _exit(0); password = crypt(clear, pp->pw_passwd); - bzero(clear, _PASSWORD_LEN); + explicit_bzero(clear, _PASSWORD_LEN); if (password != NULL && strcmp(password, pp->pw_passwd) == 0) break; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 06:57:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8DBB55FF18; Wed, 3 Mar 2021 06:57: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 4Dr4Z1478yz4kvx; Wed, 3 Mar 2021 06:57: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 7F3FD25060; Wed, 3 Mar 2021 06:57: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 1236vTAi086591; Wed, 3 Mar 2021 06:57:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1236vTTw086590; Wed, 3 Mar 2021 06:57:29 GMT (envelope-from git) Date: Wed, 3 Mar 2021 06:57:29 GMT Message-Id: <202103030657.1236vTTw086590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 5842073a9b74 - main - arcmsr(4): Fixed no action of hot plugging device on type_F adapter. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5842073a9b7471831e0da48d29dd984d575f4e9e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 06:57:29 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=5842073a9b7471831e0da48d29dd984d575f4e9e commit 5842073a9b7471831e0da48d29dd984d575f4e9e Author: Xin LI AuthorDate: 2021-03-03 06:57:20 +0000 Commit: Xin LI CommitDate: 2021-03-03 06:57:20 +0000 arcmsr(4): Fixed no action of hot plugging device on type_F adapter. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 3 days --- sys/dev/arcmsr/arcmsr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index cba2a956ff37..f2217deb1ce0 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -82,6 +82,7 @@ ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller +** 1.50.00.01 02/26/2021 Ching Huang Fixed no action of hot plugging device on type_F adapter ****************************************************************************************** */ @@ -139,7 +140,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.01 2021-02-26" #include /* ************************************************************************** @@ -1902,7 +1903,10 @@ static void arcmsr_hbe_message_isr(struct AdapterControlBlock *acb) { u_int32_t outbound_message; CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); - outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + if (acb->adapter_type == ACB_ADAPTER_TYPE_E) + outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + else + outbound_message = acb->msgcode_rwbuffer[0]; if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) arcmsr_dr_handle( acb ); } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 07:07:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8733A5600F7; Wed, 3 Mar 2021 07:07: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 4Dr4nN3RWqz4llD; Wed, 3 Mar 2021 07:07: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 6943A2526C; Wed, 3 Mar 2021 07:07: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 12377KET000335; Wed, 3 Mar 2021 07:07:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12377KRn000334; Wed, 3 Mar 2021 07:07:20 GMT (envelope-from git) Date: Wed, 3 Mar 2021 07:07:20 GMT Message-Id: <202103030707.12377KRn000334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 06eba90acb62 - stable/12 - atomic: add atomic_interrupt_fence() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 06eba90acb6201bbf2af76ca8acee5232abf9f82 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 07:07:20 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=06eba90acb6201bbf2af76ca8acee5232abf9f82 commit 06eba90acb6201bbf2af76ca8acee5232abf9f82 Author: Konstantin Belousov AuthorDate: 2021-02-23 22:12:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-03 07:07:05 +0000 atomic: add atomic_interrupt_fence() (cherry picked from commit e2494f7561c852951d8ac567314f5e12f19ee7af) --- share/man/man9/atomic.9 | 13 ++++++++++++- sys/sys/atomic_common.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index 914da97764f0..7e72d127e168 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2019 +.Dd February 24, 2021 .Dt ATOMIC 9 .Os .Sh NAME @@ -31,6 +31,7 @@ .Nm atomic_cmpset , .Nm atomic_fcmpset , .Nm atomic_fetchadd , +.Nm atomic_interrupt_fence , .Nm atomic_load , .Nm atomic_readandclear , .Nm atomic_set , @@ -59,6 +60,8 @@ .Fc .Ft .Fn atomic_fetchadd_ "volatile *p" " v" +.Ft void +.Fn atomic_interrupt_fence "void" .Ft .Fn atomic_load_[acq_] "volatile *p" .Ft @@ -290,6 +293,14 @@ release stores, by separating access from ordering, they can sometimes facilitate more efficient implementations of synchronization primitives. For example, they can be used to avoid executing a memory barrier until a memory access shows that some condition is satisfied. +.Ss Interrupt Fence Operations +The +.Fn atomic_interrupt_fence() +function establishes ordering between its call location and any interrupt +handler executing on the same CPU. +It is modeled after the similar C11 function +.Fn atomic_signal_fence() , +and adapted for the kernel environment. .Ss Multiple Processors In multiprocessor systems, the atomicity of the atomic operations on memory depends on support for cache coherence in the underlying architecture. diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index 16db4a81eb28..3d1920069362 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -70,4 +70,6 @@ (*(volatile uint64_t *)(p) = (uint64_t)(v)) #endif +#define atomic_interrupt_fence() __compiler_membar() + #endif From owner-dev-commits-src-all@freebsd.org Wed Mar 3 07:57:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 023DD5611B7; Wed, 3 Mar 2021 07:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dr5tg6MrJz4nTM; Wed, 3 Mar 2021 07:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C967C26164; Wed, 3 Mar 2021 07:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1237uxhI066033; Wed, 3 Mar 2021 07:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1237uxNO066032; Wed, 3 Mar 2021 07:56:59 GMT (envelope-from git) Date: Wed, 3 Mar 2021 07:56:59 GMT Message-Id: <202103030756.1237uxNO066032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 2b43cd2ea26f - stable/13 - Improve PRR initial transmission timing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b43cd2ea26f758d23e8c009cf7521c4ddec7353 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 07:57:00 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=2b43cd2ea26f758d23e8c009cf7521c4ddec7353 commit 2b43cd2ea26f758d23e8c009cf7521c4ddec7353 Author: Richard Scheffenegger AuthorDate: 2021-02-28 14:46:38 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-03 07:12:49 +0000 Improve PRR initial transmission timing Reviewed By: tuexen, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28953 (cherry picked from commit e9071000c9a04e3f685579500e24da9848944bb1) --- sys/netinet/tcp_input.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 1a4a4619c4bf..f7ef3ed81da2 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2595,7 +2595,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; tp->sackhint.prr_delivered += del_data; - if (pipe > tp->snd_ssthresh) { + if (pipe >= tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = imax(1, tp->snd_nxt - tp->snd_una); @@ -2695,7 +2695,8 @@ enter_recovery: * snd_ssthresh is already updated by * cc_cong_signal. */ - tp->sackhint.prr_delivered = 0; + tp->sackhint.prr_delivered = + tp->sackhint.sacked_bytes; tp->sackhint.sack_bytes_rexmit = 0; tp->sackhint.recover_fs = max(1, tp->snd_nxt - tp->snd_una); @@ -3970,7 +3971,7 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) /* * Proportional Rate Reduction */ - if (pipe > tp->snd_ssthresh) { + if (pipe >= tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = imax(1, tp->snd_nxt - tp->snd_una); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 08:01:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 899EA56240C; Wed, 3 Mar 2021 08: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 4Dr60P3Xbsz4pQ1; Wed, 3 Mar 2021 08: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 6C6DE26287; Wed, 3 Mar 2021 08: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 12381vkf079137; Wed, 3 Mar 2021 08: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 12381vV9079134; Wed, 3 Mar 2021 08:01:57 GMT (envelope-from git) Date: Wed, 3 Mar 2021 08:01:57 GMT Message-Id: <202103030801.12381vV9079134@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: 3b005d51bd0f - main - backlight: Fix incr/decr with percent value of 0 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: 3b005d51bd0fe4d8d19fb2df4d470b6e8baebf16 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 08:01:57 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3b005d51bd0fe4d8d19fb2df4d470b6e8baebf16 commit 3b005d51bd0fe4d8d19fb2df4d470b6e8baebf16 Author: David Schlachter AuthorDate: 2021-03-03 07:57:35 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-03 07:57:35 +0000 backlight: Fix incr/decr with percent value of 0 This now does nothing instead of incr/decr by 10% MFC After: 3 days PR: 253736 --- usr.bin/backlight/backlight.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.bin/backlight/backlight.c b/usr.bin/backlight/backlight.c index 1dae0cfe5c62..9cf7a0912e95 100644 --- a/usr.bin/backlight/backlight.c +++ b/usr.bin/backlight/backlight.c @@ -98,7 +98,7 @@ main(int argc, char *argv[]) BACKLIGHTGETSTATUS, BACKLIGHTUPDATESTATUS, BACKLIGHTGETINFO}; - long percent = 0; + long percent = -1; const char *percent_error; uint32_t i; bool setname; @@ -188,15 +188,20 @@ main(int argc, char *argv[]) } break; case BACKLIGHT_SET_BRIGHTNESS: + if (percent == -1) + usage(); props.brightness = percent; if (ioctl(fd, BACKLIGHTUPDATESTATUS, &props) == -1) errx(1, "Cannot update the backlight device"); break; case BACKLIGHT_INCR: case BACKLIGHT_DECR: + if (percent == 0) + /* Avoid any ioctl if we don't have anything to do */ + break; if (ioctl(fd, BACKLIGHTGETSTATUS, &props) == -1) errx(1, "Cannot query the backlight device"); - percent = percent == 0 ? 10 : percent; + percent = percent == -1 ? 10 : percent; percent = action == BACKLIGHT_INCR ? percent : -percent; props.brightness += percent; if ((int)props.brightness < 0) From owner-dev-commits-src-all@freebsd.org Wed Mar 3 08:01:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFA40562148; Wed, 3 Mar 2021 08:01: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 4Dr60Q4V94z4pdl; Wed, 3 Mar 2021 08:01: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 8DBBD25F68; Wed, 3 Mar 2021 08:01: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 12381wTa079158; Wed, 3 Mar 2021 08:01:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12381wKf079157; Wed, 3 Mar 2021 08:01:58 GMT (envelope-from git) Date: Wed, 3 Mar 2021 08:01:58 GMT Message-Id: <202103030801.12381wKf079157@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: 1df30489a8f7 - main - backlight(8): Add note that with option it print the current brightness. 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: 1df30489a8f7083c98010c94d9ce522f9e8213dc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 08:01:58 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1df30489a8f7083c98010c94d9ce522f9e8213dc commit 1df30489a8f7083c98010c94d9ce522f9e8213dc Author: Emmanuel Vadot AuthorDate: 2021-03-03 08:00:42 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-03 08:00:42 +0000 backlight(8): Add note that with option it print the current brightness. MFC after: 3 days PR: 253737 --- usr.bin/backlight/backlight.8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/backlight/backlight.8 b/usr.bin/backlight/backlight.8 index 8c3b634e152b..ce2d0e4b0325 100644 --- a/usr.bin/backlight/backlight.8 +++ b/usr.bin/backlight/backlight.8 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2020 +.Dd March 03, 2021 .Dt BACKLIGHT 8 .Os .Sh NAME @@ -47,6 +47,9 @@ The .Nm utility can be used to configure brightness levels for registered backlights. .Pp +If call without any option it will print the current brightness level of the first +registered backlight. +.Pp The options are as follows: .Bl -tag -width "-f device" .It Fl f Ar device From owner-dev-commits-src-all@freebsd.org Wed Mar 3 09:49:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 164A3564F25; Wed, 3 Mar 2021 09:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dr8N070llz3D4X; Wed, 3 Mar 2021 09:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3410275CE; Wed, 3 Mar 2021 09:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1239n4UC014225; Wed, 3 Mar 2021 09:49:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1239n4d7014224; Wed, 3 Mar 2021 09:49:04 GMT (envelope-from git) Date: Wed, 3 Mar 2021 09:49:04 GMT Message-Id: <202103030949.1239n4d7014224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 17cc6689eb16 - stable/13 - MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17cc6689eb16302f897023c1b227c30de1e373a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 09:49:05 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=17cc6689eb16302f897023c1b227c30de1e373a4 commit 17cc6689eb16302f897023c1b227c30de1e373a4 Author: Hans Petter Selasky AuthorDate: 2021-02-22 10:58:46 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-03 09:47:44 +0000 MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. If a TCP packet must be retransmitted and the data length has changed in the retransmitted packet, due to the internal workings of TCP, typically when ACK packets are lost, then there is a 30% chance that the logic in GetDeltaSeqOut() will find the correct length, which is the last length received. This can be explained as follows: If a "227 Entering Passive Mode" packet must be retransmittet and the length changes from 51 to 50 bytes, for example, then we have three cases for the list scan in GetDeltaSeqOut(), depending on how many prior packets were received modulus N_LINK_TCP_DATA=3: case 1: index 0: original packet 51 index 1: retransmitted packet 50 index 2: not relevant case 2: index 0: not relevant index 1: original packet 51 index 2: retransmitted packet 50 case 3: index 0: retransmitted packet 50 index 1: not relevant index 2: original packet 51 This patch simply changes the searching order for TCP packets, always starting at the last received packet instead of any received packet, in GetDeltaAckIn() and GetDeltaSeqOut(). Else no functional changes. Discussed with: rscheff@ Submitted by: Andreas Longwitz PR: 230755 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef) --- sys/netinet/libalias/alias_db.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 1f85a606b2d5..c87273c863ca 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1937,14 +1937,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, ack_diff_min; delta = 0; ack_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int ack_diff; @@ -1976,14 +1980,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, seq_diff_min; delta = 0; seq_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int seq_diff; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 09:51:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 828F3564D43; Wed, 3 Mar 2021 09:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dr8Qb39xTz3DPq; Wed, 3 Mar 2021 09:51: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 5EA4527739; Wed, 3 Mar 2021 09:51: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 1239pJwN022063; Wed, 3 Mar 2021 09:51:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1239pJUA022062; Wed, 3 Mar 2021 09:51:19 GMT (envelope-from git) Date: Wed, 3 Mar 2021 09:51:19 GMT Message-Id: <202103030951.1239pJUA022062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 25858ea74b07 - stable/12 - MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 25858ea74b07383145d91773635107ceddf7ca33 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 09:51:19 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=25858ea74b07383145d91773635107ceddf7ca33 commit 25858ea74b07383145d91773635107ceddf7ca33 Author: Hans Petter Selasky AuthorDate: 2021-02-22 10:58:46 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-03 09:50:11 +0000 MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. If a TCP packet must be retransmitted and the data length has changed in the retransmitted packet, due to the internal workings of TCP, typically when ACK packets are lost, then there is a 30% chance that the logic in GetDeltaSeqOut() will find the correct length, which is the last length received. This can be explained as follows: If a "227 Entering Passive Mode" packet must be retransmittet and the length changes from 51 to 50 bytes, for example, then we have three cases for the list scan in GetDeltaSeqOut(), depending on how many prior packets were received modulus N_LINK_TCP_DATA=3: case 1: index 0: original packet 51 index 1: retransmitted packet 50 index 2: not relevant case 2: index 0: not relevant index 1: original packet 51 index 2: retransmitted packet 50 case 3: index 0: retransmitted packet 50 index 1: not relevant index 2: original packet 51 This patch simply changes the searching order for TCP packets, always starting at the last received packet instead of any received packet, in GetDeltaAckIn() and GetDeltaSeqOut(). Else no functional changes. Discussed with: rscheff@ Submitted by: Andreas Longwitz PR: 230755 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef) --- sys/netinet/libalias/alias_db.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index b3792c748c56..9eb6901ed5bc 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1998,14 +1998,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, ack_diff_min; delta = 0; ack_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int ack_diff; @@ -2037,14 +2041,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, seq_diff_min; delta = 0; seq_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int seq_diff; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 09:52:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6004565295; Wed, 3 Mar 2021 09:52: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 4Dr8Rz5lbjz3DTK; Wed, 3 Mar 2021 09:52: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 B835427756; Wed, 3 Mar 2021 09:52: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 1239qV95026292; Wed, 3 Mar 2021 09:52:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1239qVqi026291; Wed, 3 Mar 2021 09:52:31 GMT (envelope-from git) Date: Wed, 3 Mar 2021 09:52:31 GMT Message-Id: <202103030952.1239qVqi026291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e3d9b9cc02b6 - stable/11 - MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: e3d9b9cc02b6e00858526d302c82bfa1dbeb87ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 09:52:31 -0000 The branch stable/11 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e3d9b9cc02b6e00858526d302c82bfa1dbeb87ee commit e3d9b9cc02b6e00858526d302c82bfa1dbeb87ee Author: Hans Petter Selasky AuthorDate: 2021-02-22 10:58:46 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-03 09:51:48 +0000 MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. If a TCP packet must be retransmitted and the data length has changed in the retransmitted packet, due to the internal workings of TCP, typically when ACK packets are lost, then there is a 30% chance that the logic in GetDeltaSeqOut() will find the correct length, which is the last length received. This can be explained as follows: If a "227 Entering Passive Mode" packet must be retransmittet and the length changes from 51 to 50 bytes, for example, then we have three cases for the list scan in GetDeltaSeqOut(), depending on how many prior packets were received modulus N_LINK_TCP_DATA=3: case 1: index 0: original packet 51 index 1: retransmitted packet 50 index 2: not relevant case 2: index 0: not relevant index 1: original packet 51 index 2: retransmitted packet 50 case 3: index 0: retransmitted packet 50 index 1: not relevant index 2: original packet 51 This patch simply changes the searching order for TCP packets, always starting at the last received packet instead of any received packet, in GetDeltaAckIn() and GetDeltaSeqOut(). Else no functional changes. Discussed with: rscheff@ Submitted by: Andreas Longwitz PR: 230755 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef) --- sys/netinet/libalias/alias_db.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 4f8159ba753a..a057b9847313 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1985,14 +1985,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, ack_diff_min; delta = 0; ack_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int ack_diff; @@ -2024,14 +2028,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, seq_diff_min; delta = 0; seq_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int seq_diff; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 09:58:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56E745651F5; Wed, 3 Mar 2021 09:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dr8bL1yMrz3F5W; Wed, 3 Mar 2021 09:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 313F92717D; Wed, 3 Mar 2021 09:58: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 1239wss1027435; Wed, 3 Mar 2021 09:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1239wsEm027434; Wed, 3 Mar 2021 09:58:54 GMT (envelope-from git) Date: Wed, 3 Mar 2021 09:58:54 GMT Message-Id: <202103030958.1239wsEm027434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 0a62368c6a53 - stable/10 - MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/10 X-Git-Reftype: branch X-Git-Commit: 0a62368c6a53054fcc255583cf6308f85a1533d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 09:58:54 -0000 The branch stable/10 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=0a62368c6a53054fcc255583cf6308f85a1533d2 commit 0a62368c6a53054fcc255583cf6308f85a1533d2 Author: Hans Petter Selasky AuthorDate: 2021-02-22 10:58:46 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-03 09:57:29 +0000 MFC 9febbc454190: Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. If a TCP packet must be retransmitted and the data length has changed in the retransmitted packet, due to the internal workings of TCP, typically when ACK packets are lost, then there is a 30% chance that the logic in GetDeltaSeqOut() will find the correct length, which is the last length received. This can be explained as follows: If a "227 Entering Passive Mode" packet must be retransmittet and the length changes from 51 to 50 bytes, for example, then we have three cases for the list scan in GetDeltaSeqOut(), depending on how many prior packets were received modulus N_LINK_TCP_DATA=3: case 1: index 0: original packet 51 index 1: retransmitted packet 50 index 2: not relevant case 2: index 0: not relevant index 1: original packet 51 index 2: retransmitted packet 50 case 3: index 0: retransmitted packet 50 index 1: not relevant index 2: original packet 51 This patch simply changes the searching order for TCP packets, always starting at the last received packet instead of any received packet, in GetDeltaAckIn() and GetDeltaSeqOut(). Else no functional changes. Discussed with: rscheff@ Submitted by: Andreas Longwitz PR: 230755 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef) --- sys/netinet/libalias/alias_db.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 052e04563fa1..a0144d3ef9f3 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1992,14 +1992,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, ack_diff_min; delta = 0; ack_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int ack_diff; @@ -2031,14 +2035,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, seq_diff_min; delta = 0; seq_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int seq_diff; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 11:44:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69AEF567F0D; Wed, 3 Mar 2021 11:44: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 4DrBxj2XH7z3Mgg; Wed, 3 Mar 2021 11:44: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 4A28DE70; Wed, 3 Mar 2021 11:44: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 123BivrL071640; Wed, 3 Mar 2021 11:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123BivCW071639; Wed, 3 Mar 2021 11:44:57 GMT (envelope-from git) Date: Wed, 3 Mar 2021 11:44:57 GMT Message-Id: <202103031144.123BivCW071639@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: 1fcbddec14dd - main - Fix GCC build of ptrace_test after 96a9e50e63bfc 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: 1fcbddec14dd693acf6a4be579f8d9e10b6a06a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 11:44:57 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1fcbddec14dd693acf6a4be579f8d9e10b6a06a4 commit 1fcbddec14dd693acf6a4be579f8d9e10b6a06a4 Author: Alex Richardson AuthorDate: 2021-03-03 11:21:04 +0000 Commit: Alex Richardson CommitDate: 2021-03-03 11:22:43 +0000 Fix GCC build of ptrace_test after 96a9e50e63bfc It seems like GCC's -Wsign-compare is stricter and also warns for constants. Appease GCC by adding the required casts. Fixes: 96a9e50e63bfc ("ptrace_test: Add more debug output on test failures") Reported by: Jenkins CI --- tests/sys/kern/ptrace_test.c | 89 +++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 39 deletions(-) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 944be3d31e04..16c047db574a 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -292,7 +292,8 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) close(cpipe[0]); /* Wait for parent to be ready. */ - CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), sizeof(c)); + CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), + (ssize_t)sizeof(c)); _exit(1); } @@ -315,7 +316,8 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), sizeof(c)); + CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), + (ssize_t)sizeof(c)); /* Wait for parent's failed wait. */ CHILD_REQUIRE_EQ(read(dpipe[1], &c, sizeof(c)), 0); @@ -332,10 +334,10 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc) /* Parent process. */ /* Wait for the debugger to attach to the child. */ - REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), (ssize_t)sizeof(c)); /* Release the child. */ - REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), (ssize_t)sizeof(c)); REQUIRE_EQ(read(cpipe[0], &c, sizeof(c)), 0); close(cpipe[0]); @@ -386,7 +388,8 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) close(cpipe[0]); /* Wait for parent to be ready. */ - CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), sizeof(c)); + CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), + (ssize_t)sizeof(c)); _exit(1); } @@ -419,10 +422,12 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), sizeof(c)); + CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), + (ssize_t)sizeof(c)); /* Wait for parent's failed wait. */ - CHILD_REQUIRE_EQ(read(dpipe[1], &c, sizeof(c)), sizeof(c)); + CHILD_REQUIRE_EQ(read(dpipe[1], &c, sizeof(c)), + (ssize_t)sizeof(c)); wpid = waitpid(child, &status, 0); CHILD_REQUIRE_EQ(wpid, child); @@ -446,10 +451,10 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) REQUIRE_EQ(wpid, 0); /* Wait for the debugger to attach to the child. */ - REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), (ssize_t)sizeof(c)); /* Release the child. */ - REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), (ssize_t)sizeof(c)); REQUIRE_EQ(read(cpipe[0], &c, sizeof(c)), 0); close(cpipe[0]); @@ -464,7 +469,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc) REQUIRE_EQ(wpid, 0); /* Signal the debugger to wait for the child. */ - REQUIRE_EQ(write(dpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(write(dpipe[0], &c, sizeof(c)), (ssize_t)sizeof(c)); /* Wait for the debugger. */ REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), 0); @@ -504,25 +509,28 @@ ATF_TC_BODY(ptrace__parent_exits_before_child, tc) _exit(status); } - CHILD_REQUIRE(write(cpipe1[1], &gchild, sizeof(gchild)) == - sizeof(gchild)); - CHILD_REQUIRE(read(cpipe2[0], &status, sizeof(status)) == - sizeof(status)); + CHILD_REQUIRE_EQ(write(cpipe1[1], &gchild, sizeof(gchild)), + (ssize_t)sizeof(gchild)); + CHILD_REQUIRE_EQ(read(cpipe2[0], &status, sizeof(status)), + (ssize_t)sizeof(status)); _exit(status); } - REQUIRE_EQ(read(cpipe1[0], &gchild, sizeof(gchild)), sizeof(gchild)); + REQUIRE_EQ(read(cpipe1[0], &gchild, sizeof(gchild)), + (ssize_t)sizeof(gchild)); REQUIRE_EQ(ptrace(PT_ATTACH, gchild, NULL, 0), 0); status = 0; - REQUIRE_EQ(write(cpipe2[1], &status, sizeof(status)), sizeof(status)); + REQUIRE_EQ(write(cpipe2[1], &status, sizeof(status)), + (ssize_t)sizeof(status)); REQUIRE_EQ(waitpid(child, &status, 0), child); ATF_REQUIRE(WIFEXITED(status)); REQUIRE_EQ(WEXITSTATUS(status), 0); status = 0; - REQUIRE_EQ(write(gcpipe[1], &status, sizeof(status)), sizeof(status)); + REQUIRE_EQ(write(gcpipe[1], &status, sizeof(status)), + (ssize_t)sizeof(status)); REQUIRE_EQ(waitpid(gchild, &status, 0), gchild); ATF_REQUIRE(WIFSTOPPED(status)); REQUIRE_EQ(ptrace(PT_DETACH, gchild, (caddr_t)1, 0), 0); @@ -807,7 +815,8 @@ attach_fork_parent(int cpipe[2]) /* Send the pid of the disassociated child to the debugger. */ fpid = getpid(); - CHILD_REQUIRE_EQ(write(cpipe[1], &fpid, sizeof(fpid)), sizeof(fpid)); + CHILD_REQUIRE_EQ(write(cpipe[1], &fpid, sizeof(fpid)), + (ssize_t)sizeof(fpid)); /* Wait for the debugger to attach. */ CHILD_REQUIRE_EQ(read(cpipe[1], &fpid, sizeof(fpid)), 0); @@ -843,7 +852,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc) /* Read the pid of the fork parent. */ REQUIRE_EQ(read(cpipe[0], &children[0], sizeof(children[0])), - sizeof(children[0])); + (ssize_t)sizeof(children[0])); /* Attach to the fork parent. */ attach_child(children[0]); @@ -911,7 +920,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc) /* Read the pid of the fork parent. */ REQUIRE_EQ(read(cpipe[0], &children[0], sizeof(children[0])), - sizeof(children[0])); + (ssize_t)sizeof(children[0])); /* Attach to the fork parent. */ attach_child(children[0]); @@ -974,7 +983,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc) /* Read the pid of the fork parent. */ REQUIRE_EQ(read(cpipe[0], &children[0], sizeof(children[0])), - sizeof(children[0])); + (ssize_t)sizeof(children[0])); /* Attach to the fork parent. */ attach_child(children[0]); @@ -1026,12 +1035,13 @@ ATF_TC_BODY(ptrace__getppid, tc) close(cpipe[0]); /* Wait for parent to be ready. */ - CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), sizeof(c)); + CHILD_REQUIRE_EQ(read(cpipe[1], &c, sizeof(c)), + (ssize_t)sizeof(c)); /* Report the parent PID to the parent. */ ppid = getppid(); - CHILD_REQUIRE(write(cpipe[1], &ppid, sizeof(ppid)) == - sizeof(ppid)); + CHILD_REQUIRE_EQ(write(cpipe[1], &ppid, sizeof(ppid)), + (ssize_t)sizeof(ppid)); _exit(1); } @@ -1054,7 +1064,8 @@ ATF_TC_BODY(ptrace__getppid, tc) CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); /* Signal parent that debugger is attached. */ - CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), sizeof(c)); + CHILD_REQUIRE_EQ(write(dpipe[1], &c, sizeof(c)), + (ssize_t)sizeof(c)); /* Wait for traced child to exit. */ wpid = waitpid(child, &status, 0); @@ -1069,13 +1080,13 @@ ATF_TC_BODY(ptrace__getppid, tc) /* Parent process. */ /* Wait for the debugger to attach to the child. */ - REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(read(dpipe[0], &c, sizeof(c)), (ssize_t)sizeof(c)); /* Release the child. */ - REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), sizeof(c)); + REQUIRE_EQ(write(cpipe[0], &c, sizeof(c)), (ssize_t)sizeof(c)); /* Read the parent PID from the child. */ - REQUIRE_EQ(read(cpipe[0], &ppid, sizeof(ppid)), sizeof(ppid)); + REQUIRE_EQ(read(cpipe[0], &ppid, sizeof(ppid)), (ssize_t)sizeof(ppid)); close(cpipe[0]); REQUIRE_EQ(ppid, getpid()); @@ -1130,7 +1141,7 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_fork, tc) ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0); ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0); - REQUIRE_EQ(pl[0].pl_syscall_code, SYS_fork); + REQUIRE_EQ(pl[0].pl_syscall_code, (unsigned)SYS_fork); REQUIRE_EQ(pl[0].pl_syscall_code, pl[1].pl_syscall_code); REQUIRE_EQ(pl[0].pl_syscall_narg, pl[1].pl_syscall_narg); @@ -1193,7 +1204,7 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall_code_vfork, tc) ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0); ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0); - REQUIRE_EQ(pl[0].pl_syscall_code, SYS_vfork); + REQUIRE_EQ(pl[0].pl_syscall_code, (unsigned)SYS_vfork); REQUIRE_EQ(pl[0].pl_syscall_code, pl[1].pl_syscall_code); REQUIRE_EQ(pl[0].pl_syscall_narg, pl[1].pl_syscall_narg); @@ -2861,7 +2872,7 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_with_signal_kqueue, tc) continue; CHILD_REQUIRE(nevents > 0); CHILD_REQUIRE_EQ(kev.filter, EVFILT_SIGNAL); - CHILD_REQUIRE_EQ(kev.ident, SIGUSR1); + CHILD_REQUIRE_EQ(kev.ident, (uintptr_t)SIGUSR1); break; } @@ -3974,7 +3985,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); - REQUIRE_EQ(pl.pl_syscall_code, SYS_getpid); + REQUIRE_EQ(pl.pl_syscall_code, (unsigned)SYS_getpid); REQUIRE_EQ(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0), 0); @@ -3988,7 +3999,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCX); - REQUIRE_EQ(pl.pl_syscall_code, SYS_getpid); + REQUIRE_EQ(pl.pl_syscall_code, (unsigned)SYS_getpid); ATF_REQUIRE(ptrace(PT_GET_SC_RET, wpid, (caddr_t)&psr, sizeof(psr)) != -1); @@ -4007,8 +4018,8 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); - REQUIRE_EQ(pl.pl_syscall_code, SYS_kill); - REQUIRE_EQ(pl.pl_syscall_narg, 2); + REQUIRE_EQ(pl.pl_syscall_code, (unsigned)SYS_kill); + REQUIRE_EQ(pl.pl_syscall_narg, 2u); ATF_REQUIRE(ptrace(PT_GET_SC_ARGS, wpid, (caddr_t)args, sizeof(args)) != -1); @@ -4027,7 +4038,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCX); - REQUIRE_EQ(pl.pl_syscall_code, SYS_kill); + REQUIRE_EQ(pl.pl_syscall_code, (unsigned)SYS_kill); ATF_REQUIRE(ptrace(PT_GET_SC_RET, wpid, (caddr_t)&psr, sizeof(psr)) != -1); @@ -4045,8 +4056,8 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); - REQUIRE_EQ(pl.pl_syscall_code, SYS_close); - REQUIRE_EQ(pl.pl_syscall_narg, 1); + REQUIRE_EQ(pl.pl_syscall_code, (unsigned)SYS_close); + REQUIRE_EQ(pl.pl_syscall_narg, 1u); ATF_REQUIRE(ptrace(PT_GET_SC_ARGS, wpid, (caddr_t)args, sizeof(args)) != -1); @@ -4064,7 +4075,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCX); - REQUIRE_EQ(pl.pl_syscall_code, SYS_close); + REQUIRE_EQ(pl.pl_syscall_code, (unsigned)SYS_close); ATF_REQUIRE(ptrace(PT_GET_SC_RET, wpid, (caddr_t)&psr, sizeof(psr)) != -1); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 12:42:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC46B5695D5; Wed, 3 Mar 2021 12:42:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrDD94yZ3z3hPm; Wed, 3 Mar 2021 12:42:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 123CgUMT051315; Wed, 3 Mar 2021 04:42:30 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 123CgUmk051314; Wed, 3 Mar 2021 04:42:30 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103031242.123CgUmk051314@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: To: Ed Maste Date: Wed, 3 Mar 2021 04:42:30 -0800 (PST) CC: Warner Losh , Nathan Whitehorn , "Rodney W. Grimes" , Brandon Bergren , src-committers , "" , dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4DrDD94yZ3z3hPm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 12:42:34 -0000 > On Tue, 2 Mar 2021 at 19:30, Warner Losh wrote: > > > > There has been some talk of moving the mount point to /efi, but I think that went nowhere... > > I thought about /efi based on arguments from the Linux world, more > info at https://wiki.archlinux.org/index.php/EFI_system_partition#Typical_mount_points. > I did open https://reviews.freebsd.org/D28814 to move the existing > uses to /efi. That said, I'm much more interested in us picking > something and using it in the installer/other tooling than whether > it's /boot/efi or /efi. > I personally prefer /efi, as I consider /boot to belong to FreeBSD and contain the FreeBSD specific boot code. EFI is a platform specific set of boot code and belongs to the system board, and though it may contain freeBSD specific code it may also contain OTHER code, especially in a multiboot environment. If it happens to align us with Linux, all the more reason to have it at /efi. Regards, -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Wed Mar 3 12:54:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 703FE569D6B; Wed, 3 Mar 2021 12:54:01 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrDTP0ds8z3j4B; Wed, 3 Mar 2021 12:54:00 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 123Crxav051358; Wed, 3 Mar 2021 04:53:59 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 123CrxKG051357; Wed, 3 Mar 2021 04:53:59 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: <63ccc815-d23b-44f5-8bf8-d301ce0665f7@www.fastmail.com> To: Brandon Bergren Date: Wed, 3 Mar 2021 04:53:59 -0800 (PST) CC: Ed Maste , Warner Losh , Nathan Whitehorn , "Rodney W. Grimes" , src-committers , "" , dev-commits-src-main@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4DrDTP0ds8z3j4B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 12:54:01 -0000 > OK, how about this as an idea then: > > Parse mount output to see if anything is mounted to /boot/efi directly? > > if mount -p | cut -f 2 | grep '^/boot/efi$'; then > .... > fi What am I missing here? One place I am being told this is run in an environment that may not even be an EFI booted system, and in another place it is being used as a test if something is mounted on it, which should only be true on an EFI booted system. Using the existance of a directory or something mounted on that directory is probably one of the worse ways to make a decsiion about if the system is or is not EFI capable, or if it needs or doesnt need EFI support stuff. I often boot from a MBR sd card or usb memstick and install an EFI system on another type of media. I am sure there is stuff in the release process that has to make EFI related platform issues, and that should probably be controled by a platform specific MK_foo knob, and not by these "exists" tests. > Brandon Bergren > bdragon@FreeBSD.org -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Wed Mar 3 13:34:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B74056AA55; Wed, 3 Mar 2021 13:34: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 4DrFMq40qgz3kwv; Wed, 3 Mar 2021 13:34: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 77E2C28AB; Wed, 3 Mar 2021 13:34: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 123DYFdK016516; Wed, 3 Mar 2021 13:34:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123DYFNn016515; Wed, 3 Mar 2021 13:34:15 GMT (envelope-from git) Date: Wed, 3 Mar 2021 13:34:15 GMT Message-Id: <202103031334.123DYFNn016515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: cdef48b528b6 - stable/10 - MFC 12148d4300db: Fix for locking order reversal in USB audio driver, when using mmap(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/10 X-Git-Reftype: branch X-Git-Commit: cdef48b528b6d4ac2771bac376c09905aa7edfd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 13:34:15 -0000 The branch stable/10 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=cdef48b528b6d4ac2771bac376c09905aa7edfd2 commit cdef48b528b6d4ac2771bac376c09905aa7edfd2 Author: Hans Petter Selasky AuthorDate: 2021-02-14 19:29:16 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-03 13:33:16 +0000 MFC 12148d4300db: Fix for locking order reversal in USB audio driver, when using mmap(). Locking the second lock which causes the LOR, can be skipped because the code updating the shared variables is always executing from the same USB thread. lock order reversal: 1st 0xfffff80005cc3840 pcm7:play:dsp7.p0 (pcm play channel, sleep mutex) @ usb_transfer.c:2342 2nd 0xfffff80005cc3860 pcm7:record:dsp7.r0 (pcm record channel, sleep mutex) @ uaudio.c:2317 lock order pcm record channel -> pcm play channel established at: witness_checkorder+0x461 __mtx_lock_flags+0x98 dsp_mmap_single+0x151 vm_mmap_cdev+0x65 devfs_mmap_f+0x143 kern_mmap_req+0x594 sys_mmap+0x46 amd64_syscall+0x12e fast_syscall_common+0xf8 lock order pcm play channel -> pcm record channel attempted at: witness_checkorder+0xd82 __mtx_lock_flags+0x98 uaudio_chan_play_callback+0xeb usbd_callback_wrapper+0x7ec usb_command_wrapper+0x7e usb_callback_proc+0x8e usb_process+0xf3 fork_exit+0x80 fork_trampoline+0xe Found by: Stefan Ehmann Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 12148d4300dbbd93260bf2801cdb9eda8b3b05a4) --- sys/dev/sound/usb/uaudio.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index fb2c98132879..ea54e1b4232c 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -2320,11 +2320,16 @@ uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: tr_setup: if (ch_rec != NULL) { + /* + * NOTE: The play and record callbacks are + * executed from the same USB thread and + * locking the record channel mutex here is + * not needed. This avoids a LOR situation. + */ + /* reset receive jitter counters */ - mtx_lock(ch_rec->pcm_mtx); ch_rec->jitter_curr = 0; ch_rec->jitter_rem = 0; - mtx_unlock(ch_rec->pcm_mtx); } /* reset transmit jitter counters */ @@ -2345,10 +2350,17 @@ tr_setup: */ if (ch_rec != NULL && uaudio_chan_is_async(ch, ch->cur_alt) != 0) { - mtx_lock(ch_rec->pcm_mtx); - if (ch_rec->cur_alt < ch_rec->num_alt) { + uint32_t rec_alt = ch_rec->cur_alt; + if (rec_alt < ch_rec->num_alt) { int64_t tx_jitter; int64_t rx_rate; + /* + * NOTE: The play and record callbacks + * are executed from the same USB + * thread and locking the record + * channel mutex here is not needed. + * This avoids a LOR situation. + */ /* translate receive jitter into transmit jitter */ tx_jitter = ch->usb_alt[ch->cur_alt].sample_rate; @@ -2360,11 +2372,10 @@ tr_setup: ch_rec->jitter_rem = 0; /* compute exact number of transmit jitter samples */ - rx_rate = ch_rec->usb_alt[ch_rec->cur_alt].sample_rate; + rx_rate = ch_rec->usb_alt[rec_alt].sample_rate; ch->jitter_curr += tx_jitter / rx_rate; ch->jitter_rem = tx_jitter % rx_rate; } - mtx_unlock(ch_rec->pcm_mtx); } /* start the SYNC transfer one time per second, if any */ From owner-dev-commits-src-all@freebsd.org Wed Mar 3 13:54:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8144556B41E; Wed, 3 Mar 2021 13:54:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrFpj3HmMz3mZg; Wed, 3 Mar 2021 13:54: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 63F802B35; Wed, 3 Mar 2021 13:54: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 123Ds5Mb042884; Wed, 3 Mar 2021 13:54:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123Ds5OK042883; Wed, 3 Mar 2021 13:54:05 GMT (envelope-from git) Date: Wed, 3 Mar 2021 13:54:05 GMT Message-Id: <202103031354.123Ds5OK042883@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: 47ceb65f3c21 - main - Fix capsicum-test build with GCC 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: 47ceb65f3c213904642f4859a53a3139e9cb287d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 13:54:05 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=47ceb65f3c213904642f4859a53a3139e9cb287d commit 47ceb65f3c213904642f4859a53a3139e9cb287d Author: Alex Richardson AuthorDate: 2021-03-03 13:53:30 +0000 Commit: Alex Richardson CommitDate: 2021-03-03 13:53:45 +0000 Fix capsicum-test build with GCC Apparently GCC defines NULL to 0 in C++11 mode (instead of nullptr), so this causes the following error: ``` In file included from capsicum-test.h:15, from capsicum-test.cc:1: gtest-1.10.0/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperNE(const char*, const char*, const T1&, const T2&) [with T1 = long int; T2 = procstat*]': capsicum-test.cc:75:3: required from here gtest-1.10.0/include/gtest/gtest.h:1621:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 1609 | if (val1 op val2) {\ | ~~~~~~~~~~~~ ...... 1621 | GTEST_IMPL_CMP_HELPER_(NE, !=); gtest-1.10.0/include/gtest/gtest.h:1609:12: note: in definition of macro 'GTEST_IMPL_CMP_HELPER_' 1609 | if (val1 op val2) {\ | ^~ ``` Fix this by using nullptr directly. Submitted upstream as https://github.com/google/capsicum-test/pull/56 Reported by: Jenkins CI --- contrib/capsicum-test/capsicum-test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/capsicum-test/capsicum-test.cc b/contrib/capsicum-test/capsicum-test.cc index dedad464a4d9..ba7936c788fc 100644 --- a/contrib/capsicum-test/capsicum-test.cc +++ b/contrib/capsicum-test/capsicum-test.cc @@ -72,7 +72,7 @@ char ProcessState(int pid) { } unsigned int count = 0; struct procstat *prstat = procstat_open_sysctl(); - EXPECT_NE(NULL, prstat) << "procstat_open_sysctl failed."; + EXPECT_NE(nullptr, prstat) << "procstat_open_sysctl failed."; errno = 0; struct kinfo_proc *p = procstat_getprocs(prstat, KERN_PROC_PID, pid, &count); if (p == NULL || count == 0) { From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:06:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0610C56B6C5; Wed, 3 Mar 2021 14:06:17 +0000 (UTC) (envelope-from bdragon@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 4DrG4m6YkJz3nHB; Wed, 3 Mar 2021 14:06:16 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id CDE8F223BB; Wed, 3 Mar 2021 14:06:16 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id A1E0527C0054; Wed, 3 Mar 2021 09:06:16 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Wed, 03 Mar 2021 09:06:16 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtvddgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder reejnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepjefhfedtuddtleegkeeg tdegjeekffdvjedttdehgffgveeugffgfeelvdeghffgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsggurhgrghhonhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddtgedvfeehkeeigedqudekuddtkeehuddqsggurh grghhonheppefhrhgvvgeuufffrdhorhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id F2CEFCA005D; Wed, 3 Mar 2021 09:06:15 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd Mime-Version: 1.0 Message-Id: <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> In-Reply-To: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> Date: Wed, 03 Mar 2021 08:05:56 -0600 From: "Brandon Bergren" To: rgrimes@FreeBSD.org Cc: "Ed Maste" , "Warner Losh" , "Nathan Whitehorn" , src-committers , "" , dev-commits-src-main@FreeBSD.org Subject: =?UTF-8?Q?Re:_git:_2c26d77d989a_-_main_-_Remove_/boot/efi_from_mtree, _mi?= =?UTF-8?Q?ssed_in_0b7472b3d8d2.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:06:17 -0000 On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: > What am I missing here? One place I am being told this is run in > an environment that may not even be an EFI booted system, and in > another place it is being used as a test if something is mounted > on it, which should only be true on an EFI booted system. That the script in question is a generic script that runs as part of bsdinstall on every platform and has to be universal. The actual *problem* here is that usr.sbin/bsdinstall/scripts/bootconfig has a default case that is *) die "Unsupported arch $(uname -m) for UEFI install" which then causes the main script to bail out, leaving the system in a half-installed state. If that had just been an exit 0 this would have never been a problem, I suppose. Before the original change that broke this, there was a check that the script was not running on powerpc or mips platforms before running the efi bits, but this got taken out. -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:08:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2925656B6E6; Wed, 3 Mar 2021 14:08: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 4DrG7W0hf5z3nYv; Wed, 3 Mar 2021 14:08: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 0699E2F00; Wed, 3 Mar 2021 14:08: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 123E8cIn057272; Wed, 3 Mar 2021 14:08:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123E8cOE057271; Wed, 3 Mar 2021 14:08:38 GMT (envelope-from git) Date: Wed, 3 Mar 2021 14:08:38 GMT Message-Id: <202103031408.123E8cOE057271@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: 3adf72a36b9b - main - qat.4: Fix some firmware module names 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: 3adf72a36b9b151eef57e3d83f71a3a9fbacb78d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:08:39 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3adf72a36b9b151eef57e3d83f71a3a9fbacb78d commit 3adf72a36b9b151eef57e3d83f71a3a9fbacb78d Author: Mark Johnston AuthorDate: 2021-03-03 14:07:53 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 14:07:53 +0000 qat.4: Fix some firmware module names PR: 252984 MFC after: 1 week --- share/man/man4/qat.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/qat.4 b/share/man/man4/qat.4 index 92ee85ac64eb..6aa8343aa309 100644 --- a/share/man/man4/qat.4 +++ b/share/man/man4/qat.4 @@ -47,9 +47,9 @@ module at boot time, place the following lines in qat_load="YES" qat_c2xxxfw_load="YES" qat_c3xxxfw_load="YES" -qat_c63xfw_load="YES" +qat_c62xfw_load="YES" qat_d15xxfw_load="YES" -qat_dh895xcc_load="YES" +qat_dh895xccfw_load="YES" .Ed .Sh DESCRIPTION The From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:09:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 817E756B8D6; Wed, 3 Mar 2021 14:09:13 +0000 (UTC) (envelope-from nwhitehorn@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 4DrG893FWxz3nV7; Wed, 3 Mar 2021 14:09:13 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:cc7b:682b:f804:9afd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1CCEA223BC; Wed, 3 Mar 2021 14:09:13 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) To: Warner Losh , Ed Maste Cc: "Rodney W. Grimes" , Brandon Bergren , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> From: Nathan Whitehorn Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. Message-ID: Date: Wed, 3 Mar 2021 09:09:12 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:09:13 -0000 On 3/2/21 10:19 PM, Warner Losh wrote: > > > On Tue, Mar 2, 2021, 7:01 PM Ed Maste > wrote: > > On Tue, 2 Mar 2021 at 19:30, Warner Losh > wrote: > > > > There has been some talk of moving the mount point to /efi, but > I think that went nowhere... > > I thought about /efi based on arguments from the Linux world, more > info at > https://wiki.archlinux.org/index.php/EFI_system_partition#Typical_m= ount_points > . > I did open https://reviews.freebsd.org/D28814 > to move the existing > uses to /efi. That said, I'm much more interested in us picking > something and using it in the installer/other tooling than whether > it's /boot/efi or /efi. > > > Me too. I am actually open to either. If I had a do over, I'd pick=20 > /efi honestly. > > But the directory presence or absence shouldn't be used to know if we=20 > have an ESP to deal with or not. > > Warner > It would have been nice to know that when I posted the original patch=20 for review that relied on this mechanism two weeks ago and you and Ed=20 both signed off. Or when we discussed this on Friday and no one knew why = it was in mtree -- I still honestly don't know from this thread -- and=20 then I proposed removing it and everyone said that was fine. There are=20 lots of other directories that we make in the installer that aren't in=20 mtree. What's special about this one? The problem here is that the installer needs to know if an ESP has been=20 made. If /boot/efi is supposed to be the mountpoint for an ESP, its=20 presence seemed like a reasonable way to signal that. Here are some optio= ns: - We could try to see if a partition is actually mounted there. That's=20 mildly annoying -- it involves parsing some shell output -- and results=20 in making a pointless directory on all non-EFI architectures. - We could try to have the installer signal to itself via some temp=20 file. This seems fragile and complicated. - We could duplicate the logic for whether to make an ESP in the first=20 place in several places, which seems like a terrible idea. But this needs to be settled *now*. It's already very, very late to get=20 this into 13.0 and we can't have another cycle of changing our minds=20 about reviewed code. -Nathan From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:12:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7C8956BC9C; Wed, 3 Mar 2021 14:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrGCS5g9dz3pMb; Wed, 3 Mar 2021 14:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B53FB2BCA; Wed, 3 Mar 2021 14:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 123EC40K069183; Wed, 3 Mar 2021 14:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123EC3oa069178; Wed, 3 Mar 2021 14:12:03 GMT (envelope-from git) Date: Wed, 3 Mar 2021 14:12:03 GMT Message-Id: <202103031412.123EC3oa069178@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: 8a272653d9fb - main - stress2: Initial import 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: 8a272653d9fbd9fc37691c9aad6a05089b4ecb4d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:12:05 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=8a272653d9fbd9fc37691c9aad6a05089b4ecb4d commit 8a272653d9fbd9fc37691c9aad6a05089b4ecb4d Author: Peter Holm AuthorDate: 2021-03-03 12:56:56 +0000 Commit: Peter Holm CommitDate: 2021-03-03 14:11:40 +0000 stress2: Initial import Discussed with: kib --- tools/test/README | 1 + tools/test/stress2/Makefile | 11 + tools/test/stress2/README | 20 + tools/test/stress2/all.cfg | 8 + tools/test/stress2/creat.cfg | 8 + tools/test/stress2/ddb.conf | 6 + tools/test/stress2/default.cfg | 122 ++ tools/test/stress2/df.cfg | 8 + tools/test/stress2/disk.cfg | 8 + tools/test/stress2/doc/README | 3 + tools/test/stress2/doc/linuxforum06.pdf | Bin 0 -> 523790 bytes tools/test/stress2/doc/stress.pdf | Bin 0 -> 39840 bytes tools/test/stress2/include/stress.h | 64 + tools/test/stress2/io.cfg | 9 + tools/test/stress2/jeff.cfg | 8 + tools/test/stress2/lib/Makefile | 9 + tools/test/stress2/lib/main.c | 212 ++++ tools/test/stress2/lib/options.c | 268 +++++ tools/test/stress2/lib/random_int.c | 56 + tools/test/stress2/lib/resources.c | 248 ++++ tools/test/stress2/link.cfg | 9 + tools/test/stress2/load.cfg | 18 + tools/test/stress2/lockf.cfg | 9 + tools/test/stress2/marcus.cfg | 24 + tools/test/stress2/misc/1st.sh | 73 ++ tools/test/stress2/misc/256m.sh | 45 + tools/test/stress2/misc/README | 4 + tools/test/stress2/misc/advlock.sh | 245 ++++ tools/test/stress2/misc/aesni.sh | 38 + tools/test/stress2/misc/all.debug.inc | 95 ++ tools/test/stress2/misc/all.exclude | 111 ++ tools/test/stress2/misc/all.exclude.pae | 11 + tools/test/stress2/misc/all.sh | 255 ++++ tools/test/stress2/misc/altbufferflushes.sh | 98 ++ tools/test/stress2/misc/alternativeFlushPath.sh | 131 ++ tools/test/stress2/misc/arp.sh | 57 + tools/test/stress2/misc/aslr.sh | 46 + tools/test/stress2/misc/audit.sh | 58 + tools/test/stress2/misc/audit2.sh | 59 + tools/test/stress2/misc/backingstore.sh | 81 ++ tools/test/stress2/misc/backingstore2.sh | 72 ++ tools/test/stress2/misc/backingstore3.sh | 73 ++ tools/test/stress2/misc/badcode.sh | 65 + tools/test/stress2/misc/badcode2.sh | 57 + tools/test/stress2/misc/badcode3.sh | 57 + tools/test/stress2/misc/bench.sh | 300 +++++ tools/test/stress2/misc/beneath.sh | 110 ++ tools/test/stress2/misc/beneath2.sh | 101 ++ tools/test/stress2/misc/beneath3.sh | 92 ++ tools/test/stress2/misc/beneath4.sh | 133 ++ tools/test/stress2/misc/bio.sh | 225 ++++ tools/test/stress2/misc/buildkernel.sh | 63 + tools/test/stress2/misc/buildworld.sh | 67 ++ tools/test/stress2/misc/buildworld2.sh | 57 + tools/test/stress2/misc/buildworld3.sh | 95 ++ tools/test/stress2/misc/buildworld4.sh | 74 ++ tools/test/stress2/misc/burnin.sh | 210 ++++ tools/test/stress2/misc/callout_reset_on.sh | 331 +++++ tools/test/stress2/misc/callout_reset_on2.sh | 303 +++++ tools/test/stress2/misc/chain.sh | 77 ++ tools/test/stress2/misc/churn.sh | 211 ++++ tools/test/stress2/misc/cleanup.sh | 105 ++ tools/test/stress2/misc/cluster.sh | 269 +++++ tools/test/stress2/misc/cmp.sh | 187 +++ tools/test/stress2/misc/collapse.sh | 153 +++ tools/test/stress2/misc/compare.sh | 44 + tools/test/stress2/misc/context.sh | 130 ++ tools/test/stress2/misc/context2.sh | 131 ++ tools/test/stress2/misc/contigmalloc.sh | 255 ++++ tools/test/stress2/misc/contigmalloc2.sh | 223 ++++ tools/test/stress2/misc/contigmalloc3.sh | 225 ++++ tools/test/stress2/misc/core.sh | 77 ++ tools/test/stress2/misc/core2.sh | 95 ++ tools/test/stress2/misc/core3.sh | 171 +++ tools/test/stress2/misc/core4.sh | 89 ++ tools/test/stress2/misc/core5.sh | 199 +++ tools/test/stress2/misc/cpuset.sh | 49 + tools/test/stress2/misc/credleak.sh | 162 +++ tools/test/stress2/misc/crossmp.sh | 89 ++ tools/test/stress2/misc/crossmp10.sh | 104 ++ tools/test/stress2/misc/crossmp11.sh | 121 ++ tools/test/stress2/misc/crossmp2.sh | 86 ++ tools/test/stress2/misc/crossmp3.sh | 108 ++ tools/test/stress2/misc/crossmp4.sh | 107 ++ tools/test/stress2/misc/crossmp5.sh | 95 ++ tools/test/stress2/misc/crossmp6.sh | 103 ++ tools/test/stress2/misc/crossmp7.sh | 100 ++ tools/test/stress2/misc/crossmp8.sh | 125 ++ tools/test/stress2/misc/crossmp9.sh | 90 ++ tools/test/stress2/misc/dangling.sh | 87 ++ tools/test/stress2/misc/datagram.sh | 96 ++ tools/test/stress2/misc/datagram2.sh | 104 ++ tools/test/stress2/misc/datagram3.sh | 106 ++ tools/test/stress2/misc/datamove.sh | 230 ++++ tools/test/stress2/misc/datamove2.sh | 244 ++++ tools/test/stress2/misc/datamove3.sh | 241 ++++ tools/test/stress2/misc/datamove4.sh | 251 ++++ tools/test/stress2/misc/datamove5.sh | 262 ++++ tools/test/stress2/misc/db.sh | 178 +++ tools/test/stress2/misc/dd.sh | 64 + tools/test/stress2/misc/dev.sh | 137 +++ tools/test/stress2/misc/dev2.sh | 144 +++ tools/test/stress2/misc/dev3.sh | 160 +++ tools/test/stress2/misc/devfd.sh | 130 ++ tools/test/stress2/misc/devfs.sh | 72 ++ tools/test/stress2/misc/devfs2.sh | 107 ++ tools/test/stress2/misc/devfs3.sh | 45 + tools/test/stress2/misc/devfs4.sh | 35 + tools/test/stress2/misc/devfs5.sh | 68 ++ tools/test/stress2/misc/dfull.sh | 56 + tools/test/stress2/misc/dtrace.sh | 68 ++ tools/test/stress2/misc/dtrace_fault.sh | 65 + tools/test/stress2/misc/dumpfs.sh | 73 ++ tools/test/stress2/misc/dup.sh | 122 ++ tools/test/stress2/misc/dup2.sh | 71 ++ tools/test/stress2/misc/execi386.sh | 86 ++ tools/test/stress2/misc/execve.sh | 130 ++ tools/test/stress2/misc/exlock.sh | 122 ++ tools/test/stress2/misc/exlock2.sh | 210 ++++ tools/test/stress2/misc/ext2fs.sh | 57 + tools/test/stress2/misc/ext2fs2.sh | 55 + tools/test/stress2/misc/ext2fs3.sh | 68 ++ tools/test/stress2/misc/ext3fs.sh | 61 + tools/test/stress2/misc/ext4fs.sh | 64 + tools/test/stress2/misc/extattr.sh | 95 ++ tools/test/stress2/misc/extattr2.sh | 94 ++ tools/test/stress2/misc/extattr3.sh | 62 + tools/test/stress2/misc/extattr_set_fd.sh | 79 ++ tools/test/stress2/misc/extattrctl.sh | 73 ++ tools/test/stress2/misc/f_offset.sh | 160 +++ tools/test/stress2/misc/fcntl.sh | 234 ++++ tools/test/stress2/misc/fcntl2.sh | 188 +++ tools/test/stress2/misc/fcntl3.sh | 56 + tools/test/stress2/misc/fdatasync.sh | 197 +++ tools/test/stress2/misc/fdatasync2.sh | 196 +++ tools/test/stress2/misc/fdescfs.sh | 74 ++ tools/test/stress2/misc/fdgrowtable.sh | 105 ++ tools/test/stress2/misc/fexecve.sh | 94 ++ tools/test/stress2/misc/ffs_blkfree.sh | 76 ++ tools/test/stress2/misc/ffs_sync.sh | 254 ++++ tools/test/stress2/misc/ffs_syncvnode.sh | 59 + tools/test/stress2/misc/ffs_syncvnode2.sh | 63 + tools/test/stress2/misc/fifo.sh | 87 ++ tools/test/stress2/misc/fifo2.sh | 206 ++++ tools/test/stress2/misc/fifo3.sh | 209 ++++ tools/test/stress2/misc/fifo4.sh | 80 ++ tools/test/stress2/misc/flock.sh | 191 +++ tools/test/stress2/misc/flock_open_close.sh | 174 +++ tools/test/stress2/misc/force.sh | 70 ++ tools/test/stress2/misc/force2.sh | 79 ++ tools/test/stress2/misc/force3.sh | 65 + tools/test/stress2/misc/force4.sh | 91 ++ tools/test/stress2/misc/force5.sh | 74 ++ tools/test/stress2/misc/force6.sh | 79 ++ tools/test/stress2/misc/fork.sh | 129 ++ tools/test/stress2/misc/forkbomb.sh | 148 +++ tools/test/stress2/misc/fpclone.sh | 192 +++ tools/test/stress2/misc/fpclone2.sh | 117 ++ tools/test/stress2/misc/fpu.sh | 103 ++ tools/test/stress2/misc/fragments.sh | 275 +++++ tools/test/stress2/misc/freepages.sh | 130 ++ tools/test/stress2/misc/fs.sh | 91 ++ tools/test/stress2/misc/fsck.sh | 149 +++ tools/test/stress2/misc/fsck2.sh | 38 + tools/test/stress2/misc/fsck3.sh | 88 ++ tools/test/stress2/misc/fsck4.sh | 67 ++ tools/test/stress2/misc/fsck5.sh | 72 ++ tools/test/stress2/misc/fsck6.sh | 80 ++ tools/test/stress2/misc/fsgs.sh | 135 +++ tools/test/stress2/misc/fstat.sh | 178 +++ tools/test/stress2/misc/fsync.sh | 91 ++ tools/test/stress2/misc/fsync2.sh | 138 +++ tools/test/stress2/misc/ftruncate.sh | 189 +++ tools/test/stress2/misc/ftruncate2.sh | 205 ++++ tools/test/stress2/misc/fts.sh | 144 +++ tools/test/stress2/misc/fts2.sh | 285 +++++ tools/test/stress2/misc/fts3.sh | 133 ++ tools/test/stress2/misc/full.sh | 67 ++ tools/test/stress2/misc/fullpath.sh | 111 ++ tools/test/stress2/misc/fullpath2.sh | 214 ++++ tools/test/stress2/misc/fuse.sh | 57 + tools/test/stress2/misc/fuse2.sh | 89 ++ tools/test/stress2/misc/fuse3.sh | 42 + tools/test/stress2/misc/fuzz.sh | 180 +++ tools/test/stress2/misc/gbde.sh | 55 + tools/test/stress2/misc/geli.sh | 68 ++ tools/test/stress2/misc/geomleak.sh | 52 + tools/test/stress2/misc/geomleak2.sh | 57 + tools/test/stress2/misc/getrandom.sh | 142 +++ tools/test/stress2/misc/getrandom2.sh | 188 +++ tools/test/stress2/misc/gjournal.sh | 76 ++ tools/test/stress2/misc/gjournal2.sh | 63 + tools/test/stress2/misc/gjournal3.sh | 85 ++ tools/test/stress2/misc/gjournal4.sh | 65 + tools/test/stress2/misc/gnop.sh | 77 ++ tools/test/stress2/misc/gnop10.sh | 139 +++ tools/test/stress2/misc/gnop2.sh | 80 ++ tools/test/stress2/misc/gnop3.sh | 73 ++ tools/test/stress2/misc/gnop4.sh | 79 ++ tools/test/stress2/misc/gnop5.sh | 69 ++ tools/test/stress2/misc/gnop6.sh | 68 ++ tools/test/stress2/misc/gnop7.sh | 80 ++ tools/test/stress2/misc/gnop8.sh | 68 ++ tools/test/stress2/misc/gnop9.sh | 139 +++ tools/test/stress2/misc/gpt.sh | 51 + tools/test/stress2/misc/graid0.sh | 71 ++ tools/test/stress2/misc/graid1.sh | 80 ++ tools/test/stress2/misc/graid1_10.sh | 96 ++ tools/test/stress2/misc/graid1_2.sh | 131 ++ tools/test/stress2/misc/graid1_3.sh | 93 ++ tools/test/stress2/misc/graid1_4.sh | 97 ++ tools/test/stress2/misc/graid1_5.sh | 116 ++ tools/test/stress2/misc/graid1_6.sh | 106 ++ tools/test/stress2/misc/graid1_7.sh | 127 ++ tools/test/stress2/misc/graid1_8.sh | 102 ++ tools/test/stress2/misc/graid1_9.sh | 114 ++ tools/test/stress2/misc/graid3.sh | 71 ++ tools/test/stress2/misc/growfs.sh | 63 + tools/test/stress2/misc/holdcnt0.sh | 261 ++++ tools/test/stress2/misc/holdcnt02.sh | 238 ++++ tools/test/stress2/misc/holdcnt03.sh | 237 ++++ tools/test/stress2/misc/holdcnt04.sh | 248 ++++ tools/test/stress2/misc/holdcnt05.sh | 249 ++++ tools/test/stress2/misc/ifconfig.sh | 60 + tools/test/stress2/misc/ifconfig2.sh | 67 ++ tools/test/stress2/misc/indir.sh | 201 ++++ tools/test/stress2/misc/indir_trunc.sh | 231 ++++ tools/test/stress2/misc/inversion.sh | 97 ++ tools/test/stress2/misc/isofs.sh | 60 + tools/test/stress2/misc/isofs2.sh | 58 + tools/test/stress2/misc/isofs3.sh | 66 + tools/test/stress2/misc/jail.sh | 66 + tools/test/stress2/misc/jail2.sh | 76 ++ tools/test/stress2/misc/jail3.sh | 76 ++ tools/test/stress2/misc/jail4.sh | 78 ++ tools/test/stress2/misc/jexec.sh | 67 ++ tools/test/stress2/misc/jumbo.sh | 221 ++++ tools/test/stress2/misc/kern_umtx_inf_loop.sh | 148 +++ tools/test/stress2/misc/kevent.sh | 174 +++ tools/test/stress2/misc/kevent10.sh | 96 ++ tools/test/stress2/misc/kevent11.sh | 178 +++ tools/test/stress2/misc/kevent12.sh | 233 ++++ tools/test/stress2/misc/kevent13.sh | 141 +++ tools/test/stress2/misc/kevent14.sh | 77 ++ tools/test/stress2/misc/kevent15.sh | 161 +++ tools/test/stress2/misc/kevent2.sh | 170 +++ tools/test/stress2/misc/kevent3.sh | 74 ++ tools/test/stress2/misc/kevent4.sh | 174 +++ tools/test/stress2/misc/kevent5.sh | 183 +++ tools/test/stress2/misc/kevent6.sh | 168 +++ tools/test/stress2/misc/kevent7.sh | 281 +++++ tools/test/stress2/misc/kevent8.sh | 163 +++ tools/test/stress2/misc/kevent9.sh | 206 ++++ tools/test/stress2/misc/killpg.sh | 155 +++ tools/test/stress2/misc/kinfo.sh | 162 +++ tools/test/stress2/misc/kinfo2.sh | 186 +++ tools/test/stress2/misc/kinfo3.sh | 197 +++ tools/test/stress2/misc/kpti.sh | 50 + tools/test/stress2/misc/largepage.sh | 152 +++ tools/test/stress2/misc/laundry.sh | 177 +++ tools/test/stress2/misc/ldt.sh | 370 ++++++ tools/test/stress2/misc/ldt2.sh | 99 ++ tools/test/stress2/misc/libMicro.sh | 53 + tools/test/stress2/misc/linger.sh | 168 +++ tools/test/stress2/misc/linger2.sh | 172 +++ tools/test/stress2/misc/linger3.sh | 134 +++ tools/test/stress2/misc/linger4.sh | 155 +++ tools/test/stress2/misc/link.sh | 193 +++ tools/test/stress2/misc/link2.sh | 78 ++ tools/test/stress2/misc/linux.sh | 55 + tools/test/stress2/misc/lockd.sh | 70 ++ tools/test/stress2/misc/lockf.sh | 73 ++ tools/test/stress2/misc/lockf2.sh | 43 + tools/test/stress2/misc/lockf3.sh | 163 +++ tools/test/stress2/misc/lockf4.sh | 183 +++ tools/test/stress2/misc/lockf5.sh | 61 + tools/test/stress2/misc/lookup_shared.sh | 38 + tools/test/stress2/misc/lstat.sh | 236 ++++ tools/test/stress2/misc/mac.sh | 38 + tools/test/stress2/misc/mac_chkexec.sh | 57 + tools/test/stress2/misc/machipc.sh | 184 +++ tools/test/stress2/misc/machipc2.sh | 292 +++++ tools/test/stress2/misc/marcus.sh | 55 + tools/test/stress2/misc/marcus2.sh | 73 ++ tools/test/stress2/misc/marcus3.sh | 52 + tools/test/stress2/misc/marcus4.sh | 86 ++ tools/test/stress2/misc/marcus5.sh | 85 ++ tools/test/stress2/misc/marcus6.sh | 83 ++ tools/test/stress2/misc/marcus7.sh | 90 ++ tools/test/stress2/misc/maxmemdom.sh | 52 + tools/test/stress2/misc/maxproc.sh | 167 +++ tools/test/stress2/misc/maxvnodes.sh | 70 ++ tools/test/stress2/misc/maxvnodes2.sh | 42 + tools/test/stress2/misc/md.sh | 58 + tools/test/stress2/misc/md2.sh | 57 + tools/test/stress2/misc/md3.sh | 56 + tools/test/stress2/misc/md4.sh | 43 + tools/test/stress2/misc/md5.sh | 48 + tools/test/stress2/misc/md6.sh | 44 + tools/test/stress2/misc/md7.sh | 39 + tools/test/stress2/misc/md8.sh | 121 ++ tools/test/stress2/misc/md9.sh | 59 + tools/test/stress2/misc/mdconfig.sh | 39 + tools/test/stress2/misc/mdconfig2.sh | 53 + tools/test/stress2/misc/mdconfig3.sh | 46 + tools/test/stress2/misc/memguard.sh | 65 + tools/test/stress2/misc/memguard2.sh | 68 ++ tools/test/stress2/misc/memguard3.sh | 63 + tools/test/stress2/misc/memguard4.sh | 61 + tools/test/stress2/misc/midi.sh | 94 ++ tools/test/stress2/misc/midi2.sh | 114 ++ tools/test/stress2/misc/mincore.sh | 157 +++ tools/test/stress2/misc/minherit.sh | 176 +++ tools/test/stress2/misc/mkfifo.sh | 86 ++ tools/test/stress2/misc/mkfifo2c.sh | 89 ++ tools/test/stress2/misc/mkfifo2d.sh | 81 ++ tools/test/stress2/misc/mkfifo3.sh | 139 +++ tools/test/stress2/misc/mkfifo4.sh | 186 +++ tools/test/stress2/misc/mkfifo5.sh | 214 ++++ tools/test/stress2/misc/mkfifo6.sh | 183 +++ tools/test/stress2/misc/mkfifo7.sh | 203 ++++ tools/test/stress2/misc/mkfifo8.sh | 200 +++ tools/test/stress2/misc/mknod.sh | 163 +++ tools/test/stress2/misc/mlockall.sh | 80 ++ tools/test/stress2/misc/mlockall2.sh | 165 +++ tools/test/stress2/misc/mlockall3.sh | 167 +++ tools/test/stress2/misc/mlockall4.sh | 66 + tools/test/stress2/misc/mlockall5.sh | 162 +++ tools/test/stress2/misc/mlockall6.sh | 203 ++++ tools/test/stress2/misc/mlockall7.sh | 262 ++++ tools/test/stress2/misc/mmap.sh | 63 + tools/test/stress2/misc/mmap10.sh | 273 +++++ tools/test/stress2/misc/mmap11.sh | 301 +++++ tools/test/stress2/misc/mmap12.sh | 81 ++ tools/test/stress2/misc/mmap13.sh | 81 ++ tools/test/stress2/misc/mmap14.sh | 252 ++++ tools/test/stress2/misc/mmap15.sh | 223 ++++ tools/test/stress2/misc/mmap16.sh | 145 +++ tools/test/stress2/misc/mmap17.sh | 86 ++ tools/test/stress2/misc/mmap18.sh | 308 +++++ tools/test/stress2/misc/mmap19.sh | 241 ++++ tools/test/stress2/misc/mmap2.sh | 177 +++ tools/test/stress2/misc/mmap20.sh | 83 ++ tools/test/stress2/misc/mmap21.sh | 165 +++ tools/test/stress2/misc/mmap22.sh | 130 ++ tools/test/stress2/misc/mmap23.sh | 108 ++ tools/test/stress2/misc/mmap24.sh | 99 ++ tools/test/stress2/misc/mmap25.sh | 120 ++ tools/test/stress2/misc/mmap26.sh | 123 ++ tools/test/stress2/misc/mmap27.sh | 126 ++ tools/test/stress2/misc/mmap28.sh | 131 ++ tools/test/stress2/misc/mmap29.sh | 71 ++ tools/test/stress2/misc/mmap3.sh | 167 +++ tools/test/stress2/misc/mmap30.sh | 77 ++ tools/test/stress2/misc/mmap31.sh | 174 +++ tools/test/stress2/misc/mmap32.sh | 202 ++++ tools/test/stress2/misc/mmap33.sh | 121 ++ tools/test/stress2/misc/mmap34.sh | 230 ++++ tools/test/stress2/misc/mmap35.sh | 112 ++ tools/test/stress2/misc/mmap36.sh | 80 ++ tools/test/stress2/misc/mmap37.sh | 153 +++ tools/test/stress2/misc/mmap38.sh | 42 + tools/test/stress2/misc/mmap39.sh | 131 ++ tools/test/stress2/misc/mmap4.sh | 116 ++ tools/test/stress2/misc/mmap40.sh | 159 +++ tools/test/stress2/misc/mmap5.sh | 129 ++ tools/test/stress2/misc/mmap6.sh | 179 +++ tools/test/stress2/misc/mmap7.sh | 147 +++ tools/test/stress2/misc/mmap8.sh | 89 ++ tools/test/stress2/misc/mmap9.sh | 95 ++ tools/test/stress2/misc/mount.sh | 82 ++ tools/test/stress2/misc/mount2.sh | 73 ++ tools/test/stress2/misc/mountro.sh | 67 ++ tools/test/stress2/misc/mountro2.sh | 54 + tools/test/stress2/misc/mountro3.sh | 56 + tools/test/stress2/misc/mountro4.sh | 100 ++ tools/test/stress2/misc/mountro5.sh | 63 + tools/test/stress2/misc/mountro6.sh | 57 + tools/test/stress2/misc/mountu.sh | 284 +++++ tools/test/stress2/misc/mprotect.sh | 75 ++ tools/test/stress2/misc/mprotect2.sh | 97 ++ tools/test/stress2/misc/msdos.sh | 60 + tools/test/stress2/misc/msdos10.sh | 89 ++ tools/test/stress2/misc/msdos2.sh | 58 + tools/test/stress2/misc/msdos3.sh | 52 + tools/test/stress2/misc/msdos4.sh | 76 ++ tools/test/stress2/misc/msdos5.sh | 59 + tools/test/stress2/misc/msdos6.sh | 93 ++ tools/test/stress2/misc/msdos7.sh | 57 + tools/test/stress2/misc/msdos8.sh | 157 +++ tools/test/stress2/misc/msdos9.sh | 77 ++ tools/test/stress2/misc/msetdomain.sh | 144 +++ tools/test/stress2/misc/msync.sh | 201 ++++ tools/test/stress2/misc/msync2.sh | 131 ++ tools/test/stress2/misc/multicast.sh | 118 ++ tools/test/stress2/misc/multicast2.sh | 26 + tools/test/stress2/misc/namecache.sh | 214 ++++ tools/test/stress2/misc/namecache2.sh | 192 +++ tools/test/stress2/misc/nanosleep.sh | 87 ++ tools/test/stress2/misc/nbufkv.sh | 156 +++ tools/test/stress2/misc/newfs.sh | 94 ++ tools/test/stress2/misc/newfs2.sh | 69 ++ tools/test/stress2/misc/newfs3.sh | 81 ++ tools/test/stress2/misc/newfs4.sh | 128 ++ tools/test/stress2/misc/newfs5.sh | 116 ++ tools/test/stress2/misc/nfs.sh | 55 + tools/test/stress2/misc/nfs10.sh | 73 ++ tools/test/stress2/misc/nfs11.sh | 67 ++ tools/test/stress2/misc/nfs12.sh | 160 +++ tools/test/stress2/misc/nfs13.sh | 66 + tools/test/stress2/misc/nfs14.sh | 74 ++ tools/test/stress2/misc/nfs15.sh | 212 ++++ tools/test/stress2/misc/nfs15lockd.sh | 240 ++++ tools/test/stress2/misc/nfs15lockd2.sh | 41 + tools/test/stress2/misc/nfs15lockd3.sh | 250 ++++ tools/test/stress2/misc/nfs16.sh | 196 +++ tools/test/stress2/misc/nfs17.sh | 76 ++ tools/test/stress2/misc/nfs2.sh | 69 ++ tools/test/stress2/misc/nfs3.sh | 60 + tools/test/stress2/misc/nfs4.sh | 70 ++ tools/test/stress2/misc/nfs5.sh | 68 ++ tools/test/stress2/misc/nfs6.sh | 81 ++ tools/test/stress2/misc/nfs7.sh | 68 ++ tools/test/stress2/misc/nfs8.sh | 66 + tools/test/stress2/misc/nfs9.sh | 88 ++ tools/test/stress2/misc/nfs_halfpage.sh | 99 ++ tools/test/stress2/misc/nfs_halfpage2.sh | 103 ++ tools/test/stress2/misc/nfsdelegation.sh | 169 +++ tools/test/stress2/misc/nfsdepth.sh | 239 ++++ tools/test/stress2/misc/nfsrename.sh | 224 ++++ tools/test/stress2/misc/nfssillyrename.sh | 67 ++ tools/test/stress2/misc/nullfs.sh | 72 ++ tools/test/stress2/misc/nullfs10.sh | 71 ++ tools/test/stress2/misc/nullfs11.sh | 89 ++ tools/test/stress2/misc/nullfs12.sh | 64 + tools/test/stress2/misc/nullfs13.sh | 77 ++ tools/test/stress2/misc/nullfs14.sh | 58 + tools/test/stress2/misc/nullfs15.sh | 64 + tools/test/stress2/misc/nullfs16.sh | 61 + tools/test/stress2/misc/nullfs17.sh | 84 ++ tools/test/stress2/misc/nullfs18.sh | 133 ++ tools/test/stress2/misc/nullfs19.sh | 90 ++ tools/test/stress2/misc/nullfs2.sh | 54 + tools/test/stress2/misc/nullfs20.sh | 74 ++ tools/test/stress2/misc/nullfs21.sh | 71 ++ tools/test/stress2/misc/nullfs22.sh | 247 ++++ tools/test/stress2/misc/nullfs23.sh | 50 + tools/test/stress2/misc/nullfs24.sh | 69 ++ tools/test/stress2/misc/nullfs25.sh | 90 ++ tools/test/stress2/misc/nullfs26.sh | 47 + tools/test/stress2/misc/nullfs27.sh | 91 ++ tools/test/stress2/misc/nullfs3.sh | 56 + tools/test/stress2/misc/nullfs4.sh | 50 + tools/test/stress2/misc/nullfs5.sh | 79 ++ tools/test/stress2/misc/nullfs6.sh | 50 + tools/test/stress2/misc/nullfs7.sh | 63 + tools/test/stress2/misc/nullfs8.sh | 67 ++ tools/test/stress2/misc/nullfs9.sh | 82 ++ tools/test/stress2/misc/numa.sh | 46 + tools/test/stress2/misc/oom.sh | 47 + tools/test/stress2/misc/oom2.sh | 49 + tools/test/stress2/misc/oovm.sh | 134 +++ tools/test/stress2/misc/oovm2.sh | 136 +++ tools/test/stress2/misc/open.sh | 84 ++ tools/test/stress2/misc/openlock.sh | 94 ++ tools/test/stress2/misc/overcommit.sh | 62 + tools/test/stress2/misc/overcommit2.sh | 65 + tools/test/stress2/misc/overflow3.sh | 96 ++ tools/test/stress2/misc/overlap.sh | 160 +++ tools/test/stress2/misc/pageout.sh | 144 +++ tools/test/stress2/misc/parallelmount.sh | 68 ++ tools/test/stress2/misc/parallelmount2.sh | 84 ++ tools/test/stress2/misc/pathconf.sh | 56 + tools/test/stress2/misc/pathconf2.sh | 37 + tools/test/stress2/misc/pause.sh | 159 +++ tools/test/stress2/misc/pcatch.sh | 154 +++ tools/test/stress2/misc/pcatch2.sh | 44 + tools/test/stress2/misc/pdfork.sh | 58 + tools/test/stress2/misc/perf.sh | 151 +++ tools/test/stress2/misc/pfl.sh | 188 +++ tools/test/stress2/misc/pfl2.sh | 104 ++ tools/test/stress2/misc/pfl3.sh | 47 + tools/test/stress2/misc/pfl4.sh | 95 ++ tools/test/stress2/misc/ping.sh | 53 + tools/test/stress2/misc/pipe.sh | 132 ++ tools/test/stress2/misc/pipe2.sh | 163 +++ tools/test/stress2/misc/pipe3.sh | 148 +++ tools/test/stress2/misc/pipe_enomem.sh | 102 ++ tools/test/stress2/misc/pkru.sh | 512 ++++++++ tools/test/stress2/misc/pkru2.sh | 108 ++ tools/test/stress2/misc/pmc.sh | 55 + tools/test/stress2/misc/pmc2.sh | 51 + tools/test/stress2/misc/pmc3.sh | 44 + tools/test/stress2/misc/pmc4.sh | 124 ++ tools/test/stress2/misc/pmc5.sh | 138 +++ tools/test/stress2/misc/pmc6.sh | 41 + tools/test/stress2/misc/pmc7.sh | 12 + tools/test/stress2/misc/poll.sh | 57 + tools/test/stress2/misc/poll2.sh | 212 ++++ tools/test/stress2/misc/posix_fadvise.sh | 72 ++ tools/test/stress2/misc/posix_fadvise2.sh | 78 ++ tools/test/stress2/misc/posix_fadvise3.sh | 120 ++ tools/test/stress2/misc/posix_openpt.sh | 79 ++ tools/test/stress2/misc/posix_openpt2.sh | 152 +++ tools/test/stress2/misc/pread.sh | 190 +++ tools/test/stress2/misc/proccontrol.sh | 54 + tools/test/stress2/misc/procfs.sh | 69 ++ tools/test/stress2/misc/procfs2.sh | 37 + tools/test/stress2/misc/procfs3.sh | 154 +++ tools/test/stress2/misc/procfs4.sh | 156 +++ tools/test/stress2/misc/procfs5.sh | 84 ++ tools/test/stress2/misc/procfs6.sh | 42 + tools/test/stress2/misc/procstat.sh | 44 + tools/test/stress2/misc/procstat2.sh | 44 + tools/test/stress2/misc/pthread.sh | 137 +++ tools/test/stress2/misc/pthread2.sh | 296 +++++ tools/test/stress2/misc/pthread3.sh | 304 +++++ tools/test/stress2/misc/pthread4.sh | 296 +++++ tools/test/stress2/misc/pthread5.sh | 121 ++ tools/test/stress2/misc/pthread6.sh | 308 +++++ tools/test/stress2/misc/pthread7.sh | 285 +++++ tools/test/stress2/misc/pthread8.sh | 137 +++ tools/test/stress2/misc/pthread9.sh | 185 +++ tools/test/stress2/misc/ptrace.sh | 106 ++ tools/test/stress2/misc/ptrace10.sh | 161 +++ tools/test/stress2/misc/ptrace11.sh | 124 ++ tools/test/stress2/misc/ptrace2.sh | 143 +++ tools/test/stress2/misc/ptrace3.sh | 130 ++ tools/test/stress2/misc/ptrace4.sh | 58 + tools/test/stress2/misc/ptrace5.sh | 200 +++ tools/test/stress2/misc/ptrace6.sh | 204 ++++ tools/test/stress2/misc/ptrace7.sh | 238 ++++ tools/test/stress2/misc/ptrace8.sh | 122 ++ tools/test/stress2/misc/ptrace9.sh | 133 ++ tools/test/stress2/misc/pts.sh | 154 +++ tools/test/stress2/misc/pts2.sh | 79 ++ tools/test/stress2/misc/pts3.sh | 102 ++ tools/test/stress2/misc/pty.sh | 161 +++ tools/test/stress2/misc/pty2.sh | 101 ++ tools/test/stress2/misc/quota1.sh | 57 + tools/test/stress2/misc/quota10.sh | 105 ++ tools/test/stress2/misc/quota11.sh | 67 ++ tools/test/stress2/misc/quota12.sh | 80 ++ tools/test/stress2/misc/quota2.sh | 57 + tools/test/stress2/misc/quota3.sh | 57 + tools/test/stress2/misc/quota4.sh | 65 + tools/test/stress2/misc/quota5.sh | 44 + tools/test/stress2/misc/quota6.sh | 69 ++ tools/test/stress2/misc/quota7.sh | 79 ++ tools/test/stress2/misc/quota8.sh | 89 ++ tools/test/stress2/misc/quota9.sh | 93 ++ tools/test/stress2/misc/r335171.sh | 158 +++ tools/test/stress2/misc/racct.sh | 57 + tools/test/stress2/misc/radix.sh | 271 +++++ tools/test/stress2/misc/random.sh | 37 + tools/test/stress2/misc/rdgsbase.sh | 182 +++ tools/test/stress2/misc/rdwr.sh | 118 ++ tools/test/stress2/misc/readdir.sh | 179 +++ tools/test/stress2/misc/recursiveflushes.sh | 75 ++ tools/test/stress2/misc/rename.sh | 130 ++ tools/test/stress2/misc/rename10.sh | 184 +++ tools/test/stress2/misc/rename11.sh | 139 +++ tools/test/stress2/misc/rename12.sh | 192 +++ tools/test/stress2/misc/rename13.sh | 60 + tools/test/stress2/misc/rename14.sh | 198 +++ tools/test/stress2/misc/rename15.sh | 82 ++ tools/test/stress2/misc/rename2.sh | 103 ++ tools/test/stress2/misc/rename3.sh | 51 + tools/test/stress2/misc/rename4.sh | 62 + tools/test/stress2/misc/rename5.sh | 137 +++ tools/test/stress2/misc/rename6.sh | 149 +++ tools/test/stress2/misc/rename7.sh | 150 +++ tools/test/stress2/misc/rename8.sh | 173 +++ tools/test/stress2/misc/rename9.sh | 169 +++ tools/test/stress2/misc/revoke.sh | 116 ++ tools/test/stress2/misc/rot.sh | 142 +++ tools/test/stress2/misc/routetbl.sh | 61 + tools/test/stress2/misc/ruby.sh | 38 + tools/test/stress2/misc/rw.sh | 65 + tools/test/stress2/misc/rwlock_ronly.sh | 82 ++ tools/test/stress2/misc/sched.sh | 161 +++ tools/test/stress2/misc/schedfuzz.sh | 79 ++ tools/test/stress2/misc/sctp.sh | 158 +++ tools/test/stress2/misc/sctp2.sh | 169 +++ tools/test/stress2/misc/sctp3.sh | 172 +++ tools/test/stress2/misc/seekdir.sh | 157 +++ tools/test/stress2/misc/segnp.sh | 57 + tools/test/stress2/misc/segregs.sh | 144 +++ tools/test/stress2/misc/select.sh | 168 +++ tools/test/stress2/misc/select3.sh | 39 + tools/test/stress2/misc/selfd.sh | 152 +++ tools/test/stress2/misc/sem.sh | 142 +++ tools/test/stress2/misc/sem_post.sh | 107 ++ tools/test/stress2/misc/sem_timedwait.sh | 161 +++ tools/test/stress2/misc/sem_wait.sh | 109 ++ tools/test/stress2/misc/sendfile.sh | 213 ++++ tools/test/stress2/misc/sendfile10.sh | 313 +++++ tools/test/stress2/misc/sendfile11.sh | 235 ++++ tools/test/stress2/misc/sendfile12.sh | 241 ++++ tools/test/stress2/misc/sendfile13.sh | 371 ++++++ tools/test/stress2/misc/sendfile14.sh | 382 ++++++ tools/test/stress2/misc/sendfile15.sh | 218 ++++ tools/test/stress2/misc/sendfile16.sh | 224 ++++ tools/test/stress2/misc/sendfile17.sh | 225 ++++ tools/test/stress2/misc/sendfile18.sh | 125 ++ tools/test/stress2/misc/sendfile19.sh | 246 ++++ tools/test/stress2/misc/sendfile2.sh | 142 +++ tools/test/stress2/misc/sendfile20.sh | 247 ++++ tools/test/stress2/misc/sendfile21.sh | 243 ++++ tools/test/stress2/misc/sendfile22.sh | 282 +++++ tools/test/stress2/misc/sendfile23.sh | 207 ++++ tools/test/stress2/misc/sendfile24.sh | 235 ++++ tools/test/stress2/misc/sendfile25.sh | 237 ++++ tools/test/stress2/misc/sendfile26.sh | 308 +++++ tools/test/stress2/misc/sendfile3.sh | 210 ++++ tools/test/stress2/misc/sendfile4.sh | 141 +++ tools/test/stress2/misc/sendfile5.sh | 165 +++ tools/test/stress2/misc/sendfile6.sh | 255 ++++ tools/test/stress2/misc/sendfile7.sh | 42 + tools/test/stress2/misc/sendfile8.sh | 267 ++++ tools/test/stress2/misc/sendfile9.sh | 266 ++++ tools/test/stress2/misc/sendfile_shm.sh | 200 +++ tools/test/stress2/misc/sendmsg.sh | 224 ++++ tools/test/stress2/misc/sendmsg2.sh | 142 +++ tools/test/stress2/misc/sethostname.sh | 36 + tools/test/stress2/misc/setsockopt.sh | 152 +++ tools/test/stress2/misc/setsockopt2.sh | 208 ++++ tools/test/stress2/misc/setuid.sh | 122 ++ tools/test/stress2/misc/shm.sh | 201 ++++ tools/test/stress2/misc/shm2.sh | 167 +++ tools/test/stress2/misc/shm_open.sh | 85 ++ tools/test/stress2/misc/shm_super.sh | 87 ++ tools/test/stress2/misc/sigaltstack.sh | 128 ++ tools/test/stress2/misc/sigfastblock.sh | 141 +++ tools/test/stress2/misc/sigfastblock2.sh | 132 ++ tools/test/stress2/misc/signal.sh | 247 ++++ tools/test/stress2/misc/signal0.sh | 102 ++ tools/test/stress2/misc/sigreturn.sh | 121 ++ tools/test/stress2/misc/sigstop.sh | 98 ++ tools/test/stress2/misc/sigstop2.sh | 144 +++ tools/test/stress2/misc/sigxcpu.sh | 155 +++ tools/test/stress2/misc/smrstress.sh | 56 + tools/test/stress2/misc/smrstress2.sh | 80 ++ tools/test/stress2/misc/snap.sh | 55 + tools/test/stress2/misc/snap10.sh | 68 ++ tools/test/stress2/misc/snap11.sh | 87 ++ tools/test/stress2/misc/snap12.sh | 72 ++ tools/test/stress2/misc/snap2-1.sh | 60 + tools/test/stress2/misc/snap2.sh | 60 + tools/test/stress2/misc/snap3.sh | 64 + tools/test/stress2/misc/snap4.sh | 57 + tools/test/stress2/misc/snap5-1.sh | 61 + tools/test/stress2/misc/snap5.sh | 55 + tools/test/stress2/misc/snap6.sh | 48 + tools/test/stress2/misc/snap7.sh | 59 + tools/test/stress2/misc/snap8.sh | 92 ++ tools/test/stress2/misc/snap9.sh | 62 + tools/test/stress2/misc/sndstat.sh | 138 +++ tools/test/stress2/misc/socketpair.sh | 104 ++ tools/test/stress2/misc/socketpair2.sh | 273 +++++ tools/test/stress2/misc/socketpair3.sh | 144 +++ tools/test/stress2/misc/socketpair4.sh | 207 ++++ tools/test/stress2/misc/softupdate.sh | 58 + tools/test/stress2/misc/sort.sh | 50 + tools/test/stress2/misc/sort2.sh | 52 + tools/test/stress2/misc/sparse.sh | 74 ++ tools/test/stress2/misc/spin.sh | 124 ++ tools/test/stress2/misc/split.sh | 99 ++ tools/test/stress2/misc/stack_guard_page.sh | 50 + tools/test/stress2/misc/statfs.sh | 126 ++ tools/test/stress2/misc/stealer.sh | 133 ++ tools/test/stress2/misc/su.sh | 54 + tools/test/stress2/misc/suj.sh | 52 + tools/test/stress2/misc/suj10.sh | 180 +++ tools/test/stress2/misc/suj11.sh | 58 + tools/test/stress2/misc/suj12.sh | 60 + tools/test/stress2/misc/suj13.sh | 60 + tools/test/stress2/misc/suj14.sh | 56 + tools/test/stress2/misc/suj15.sh | 66 + tools/test/stress2/misc/suj16.sh | 82 ++ tools/test/stress2/misc/suj17.sh | 136 +++ tools/test/stress2/misc/suj18.sh | 68 ++ tools/test/stress2/misc/suj19.sh | 77 ++ tools/test/stress2/misc/suj2.sh | 78 ++ tools/test/stress2/misc/suj20.sh | 177 +++ tools/test/stress2/misc/suj21.sh | 178 +++ tools/test/stress2/misc/suj22.sh | 195 +++ tools/test/stress2/misc/suj23.sh | 440 +++++++ tools/test/stress2/misc/suj24.sh | 52 + tools/test/stress2/misc/suj25.sh | 67 ++ tools/test/stress2/misc/suj26.sh | 85 ++ tools/test/stress2/misc/suj27.sh | 84 ++ tools/test/stress2/misc/suj28.sh | 87 ++ tools/test/stress2/misc/suj29.sh | 74 ++ tools/test/stress2/misc/suj3.sh | 64 + tools/test/stress2/misc/suj30.sh | 278 +++++ tools/test/stress2/misc/suj31.sh | 65 + tools/test/stress2/misc/suj32.sh | 92 ++ tools/test/stress2/misc/suj33.sh | 66 + tools/test/stress2/misc/suj34.sh | 61 + tools/test/stress2/misc/suj35.sh | 61 + tools/test/stress2/misc/suj4.sh | 56 + tools/test/stress2/misc/suj5.sh | 180 +++ tools/test/stress2/misc/suj6.sh | 183 +++ tools/test/stress2/misc/suj7.sh | 60 + tools/test/stress2/misc/suj8.sh | 61 + tools/test/stress2/misc/suj9.sh | 64 + tools/test/stress2/misc/swap.sh | 157 +++ tools/test/stress2/misc/swap2.sh | 176 +++ tools/test/stress2/misc/swap3.sh | 38 + tools/test/stress2/misc/swap4.sh | 152 +++ tools/test/stress2/misc/swap5.sh | 50 + tools/test/stress2/misc/swap6.sh | 52 + tools/test/stress2/misc/swapoff.sh | 69 ++ tools/test/stress2/misc/swapoff2.sh | 76 ++ tools/test/stress2/misc/swapoff3.sh | 144 +++ tools/test/stress2/misc/swapoff4.sh | 82 ++ tools/test/stress2/misc/swapoff5.sh | 182 +++ tools/test/stress2/misc/swappedout.sh | 52 + tools/test/stress2/misc/symlink.sh | 128 ++ tools/test/stress2/misc/symlink2.sh | 121 ++ tools/test/stress2/misc/symlink3.sh | 69 ++ tools/test/stress2/misc/symlink4.sh | 125 ++ tools/test/stress2/misc/symlink5.sh | 137 +++ tools/test/stress2/misc/syscall4.sh | 386 ++++++ tools/test/stress2/misc/syscall5.sh | 99 ++ tools/test/stress2/misc/syscall6.sh | 46 + tools/test/stress2/misc/sysctl.sh | 44 + tools/test/stress2/misc/sysctl2.sh | 43 + tools/test/stress2/misc/sysctl3.sh | 56 + tools/test/stress2/misc/sysctl4.sh | 54 + tools/test/stress2/misc/systrace.sh | 62 + tools/test/stress2/misc/systrace2.sh | 48 + tools/test/stress2/misc/syzkaller1.sh | 246 ++++ tools/test/stress2/misc/syzkaller10.sh | 93 ++ tools/test/stress2/misc/syzkaller11.sh | 299 +++++ tools/test/stress2/misc/syzkaller12.sh | 176 +++ tools/test/stress2/misc/syzkaller13.sh | 249 ++++ tools/test/stress2/misc/syzkaller14.sh | 295 +++++ tools/test/stress2/misc/syzkaller15.sh | 190 +++ tools/test/stress2/misc/syzkaller16.sh | 417 +++++++ tools/test/stress2/misc/syzkaller17.sh | 131 ++ tools/test/stress2/misc/syzkaller18.sh | 128 ++ tools/test/stress2/misc/syzkaller19.sh | 171 +++ tools/test/stress2/misc/syzkaller2.sh | 89 ++ tools/test/stress2/misc/syzkaller20.sh | 108 ++ tools/test/stress2/misc/syzkaller21.sh | 403 +++++++ tools/test/stress2/misc/syzkaller22.sh | 69 ++ tools/test/stress2/misc/syzkaller23.sh | 400 ++++++ tools/test/stress2/misc/syzkaller24.sh | 133 ++ tools/test/stress2/misc/syzkaller25.sh | 476 ++++++++ tools/test/stress2/misc/syzkaller26.sh | 166 +++ tools/test/stress2/misc/syzkaller27.sh | 150 +++ tools/test/stress2/misc/syzkaller28.sh | 356 ++++++ tools/test/stress2/misc/syzkaller29.sh | 128 ++ tools/test/stress2/misc/syzkaller3.sh | 49 + tools/test/stress2/misc/syzkaller30.sh | 67 ++ tools/test/stress2/misc/syzkaller4.sh | 382 ++++++ tools/test/stress2/misc/syzkaller5.sh | 83 ++ tools/test/stress2/misc/syzkaller6.sh | 84 ++ tools/test/stress2/misc/syzkaller7.sh | 161 +++ tools/test/stress2/misc/syzkaller8.sh | 111 ++ tools/test/stress2/misc/syzkaller9.sh | 102 ++ tools/test/stress2/misc/tar.sh | 132 ++ tools/test/stress2/misc/tcp.sh | 59 + tools/test/stress2/misc/tcp2.sh | 62 + tools/test/stress2/misc/tcp3.sh | 288 +++++ tools/test/stress2/misc/tcp4.sh | 249 ++++ tools/test/stress2/misc/temp.sh | 167 +++ tools/test/stress2/misc/thr.sh | 99 ++ tools/test/stress2/misc/thr2.sh | 42 + tools/test/stress2/misc/thr3.sh | 104 ++ tools/test/stress2/misc/timeout.sh | 51 + tools/test/stress2/misc/tmpfs.sh | 48 + tools/test/stress2/misc/tmpfs10.sh | 155 +++ tools/test/stress2/misc/tmpfs11.sh | 81 ++ tools/test/stress2/misc/tmpfs12.sh | 95 ++ tools/test/stress2/misc/tmpfs13.sh | 95 ++ tools/test/stress2/misc/tmpfs14.sh | 112 ++ tools/test/stress2/misc/tmpfs15.sh | 48 + tools/test/stress2/misc/tmpfs16.sh | 200 +++ tools/test/stress2/misc/tmpfs17.sh | 144 +++ tools/test/stress2/misc/tmpfs18.sh | 58 + tools/test/stress2/misc/tmpfs19.sh | 56 + tools/test/stress2/misc/tmpfs2.sh | 64 + tools/test/stress2/misc/tmpfs20.sh | 60 + tools/test/stress2/misc/tmpfs21.sh | 59 + tools/test/stress2/misc/tmpfs22.sh | 117 ++ tools/test/stress2/misc/tmpfs23.sh | 52 + tools/test/stress2/misc/tmpfs3.sh | 45 + tools/test/stress2/misc/tmpfs4.sh | 46 + tools/test/stress2/misc/tmpfs5.sh | 53 + tools/test/stress2/misc/tmpfs6.sh | 110 ++ tools/test/stress2/misc/tmpfs7.sh | 249 ++++ tools/test/stress2/misc/tmpfs8.sh | 178 +++ tools/test/stress2/misc/tmpfs9.sh | 110 ++ tools/test/stress2/misc/trim.sh | 72 ++ tools/test/stress2/misc/trim2.sh | 59 + tools/test/stress2/misc/trim3.sh | 71 ++ tools/test/stress2/misc/trim4.sh | 68 ++ tools/test/stress2/misc/trim5.sh | 49 + tools/test/stress2/misc/trim6.sh | 57 + tools/test/stress2/misc/trim7.sh | 62 + tools/test/stress2/misc/trim8.sh | 62 + tools/test/stress2/misc/truncate.sh | 99 ++ tools/test/stress2/misc/truncate2.sh | 99 ++ tools/test/stress2/misc/truncate3.sh | 119 ++ tools/test/stress2/misc/truncate4.sh | 54 + tools/test/stress2/misc/truncate5.sh | 105 ++ tools/test/stress2/misc/truncate6.sh | 122 ++ tools/test/stress2/misc/truncate7.sh | 124 ++ tools/test/stress2/misc/truncate8.sh | 212 ++++ tools/test/stress2/misc/truncate9.sh | 119 ++ tools/test/stress2/misc/truss.sh | 129 ++ tools/test/stress2/misc/truss3.sh | 36 + tools/test/stress2/misc/tvnlru.sh | 251 ++++ tools/test/stress2/misc/udp.sh | 48 + tools/test/stress2/misc/udp2.sh | 57 + tools/test/stress2/misc/ufsbench.sh | 58 + tools/test/stress2/misc/ufssuspend.sh | 131 ++ tools/test/stress2/misc/uma_zalloc_arg.sh | 302 +++++ tools/test/stress2/misc/umount.sh | 50 + tools/test/stress2/misc/umount2.sh | 90 ++ tools/test/stress2/misc/umount3.sh | 66 + tools/test/stress2/misc/umount4.sh | 71 ++ tools/test/stress2/misc/umountf.sh | 69 ++ tools/test/stress2/misc/umountf10.sh | 133 ++ tools/test/stress2/misc/umountf11.sh | 50 + tools/test/stress2/misc/umountf12.sh | 68 ++ tools/test/stress2/misc/umountf2.sh | 1273 ++++++++++++++++++++ tools/test/stress2/misc/umountf3.sh | 118 ++ tools/test/stress2/misc/umountf4.sh | 85 ++ tools/test/stress2/misc/umountf5.sh | 69 ++ tools/test/stress2/misc/umountf6.sh | 85 ++ tools/test/stress2/misc/umountf7.sh | 168 +++ tools/test/stress2/misc/umountf8.sh | 42 + tools/test/stress2/misc/umountf9.sh | 45 + tools/test/stress2/misc/umtx_suspend.sh | 88 ++ tools/test/stress2/misc/union.sh | 65 + tools/test/stress2/misc/unionfs.sh | 52 + tools/test/stress2/misc/unionfs2.sh | 46 + tools/test/stress2/misc/unionfs3.sh | 52 + tools/test/stress2/misc/unix_socket.sh | 161 +++ tools/test/stress2/misc/unix_socket_detach.sh | 124 ++ tools/test/stress2/misc/unix_socket_detach2.sh | 157 +++ tools/test/stress2/misc/unlink.sh | 69 ++ tools/test/stress2/misc/vfork.sh | 131 ++ tools/test/stress2/misc/vm_fault_dontneed.sh | 99 ++ tools/test/stress2/misc/vm_map.sh | 117 ++ tools/test/stress2/misc/vm_reserv_populate.sh | 278 +++++ tools/test/stress2/misc/vmio.sh | 56 + tools/test/stress2/misc/vmstat.sh | 47 + tools/test/stress2/misc/vmstat2.sh | 41 + tools/test/stress2/misc/vmtotal.sh | 42 + tools/test/stress2/misc/vnodes.sh | 87 ++ tools/test/stress2/misc/vunref.sh | 212 ++++ tools/test/stress2/misc/vunref2.sh | 72 ++ tools/test/stress2/misc/watchman.sh | 43 + tools/test/stress2/misc/wire_no_page.sh | 104 ++ tools/test/stress2/misc/write.sh | 231 ++++ tools/test/stress2/misc/zfs.sh | 68 ++ tools/test/stress2/misc/zfs10.sh | 142 +++ tools/test/stress2/misc/zfs11.sh | 77 ++ tools/test/stress2/misc/zfs2.sh | 71 ++ tools/test/stress2/misc/zfs3.sh | 83 ++ tools/test/stress2/misc/zfs4.sh | 91 ++ tools/test/stress2/misc/zfs5.sh | 71 ++ tools/test/stress2/misc/zfs6.sh | 80 ++ tools/test/stress2/misc/zfs7.sh | 72 ++ tools/test/stress2/misc/zfs8.sh | 73 ++ tools/test/stress2/misc/zfs9.sh | 73 ++ tools/test/stress2/misc/zz-combo01.sh | 44 + tools/test/stress2/misc/zz-combo02.sh | 34 + tools/test/stress2/misc/zz-combo03.sh | 39 + tools/test/stress2/misc/zz-combo04.sh | 37 + tools/test/stress2/misc/zzbuildworld.sh | 54 + tools/test/stress2/mkdir.cfg | 9 + tools/test/stress2/mkfifo.cfg | 8 + tools/test/stress2/norw.cfg | 6 + tools/test/stress2/noswap.cfg | 6 + tools/test/stress2/pty.cfg | 8 + tools/test/stress2/run.sh | 84 ++ tools/test/stress2/rw.cfg | 8 + tools/test/stress2/syscall.cfg | 11 + tools/test/stress2/sysctl.cfg | 12 + tools/test/stress2/testcases/Makefile | 28 + tools/test/stress2/testcases/Makefile.inc | 6 + tools/test/stress2/testcases/README | 9 + tools/test/stress2/testcases/badcode/Makefile | 3 + tools/test/stress2/testcases/badcode/badcode.c | 133 ++ tools/test/stress2/testcases/creat/Makefile | 3 + tools/test/stress2/testcases/creat/creat.c | 136 +++ tools/test/stress2/testcases/dirnprename/Makefile | 3 + .../stress2/testcases/dirnprename/dirnprename.c | 172 +++ tools/test/stress2/testcases/dirrename/Makefile | 3 + tools/test/stress2/testcases/dirrename/dirrename.c | 144 +++ tools/test/stress2/testcases/fts/Makefile | 3 + tools/test/stress2/testcases/fts/fts.c | 102 ++ tools/test/stress2/testcases/link/Makefile | 3 + tools/test/stress2/testcases/link/link.c | 144 +++ tools/test/stress2/testcases/lockf/Makefile | 3 + tools/test/stress2/testcases/lockf/lockf.c | 184 +++ tools/test/stress2/testcases/lockf2/Makefile | 3 + tools/test/stress2/testcases/lockf2/lockf2.c | 130 ++ tools/test/stress2/testcases/mkdir/Makefile | 3 + tools/test/stress2/testcases/mkdir/mkdir.c | 135 +++ tools/test/stress2/testcases/mkfifo/Makefile | 4 + tools/test/stress2/testcases/mkfifo/mkfifo.c | 183 +++ tools/test/stress2/testcases/mmap/Makefile | 3 + tools/test/stress2/testcases/mmap/mmap.c | 148 +++ tools/test/stress2/testcases/openat/Makefile | 3 + tools/test/stress2/testcases/openat/doat.c | 688 +++++++++++ tools/test/stress2/testcases/openat/openat.c | 187 +++ tools/test/stress2/testcases/pty/Makefile | 4 + tools/test/stress2/testcases/pty/pty.c | 111 ++ tools/test/stress2/testcases/rename/Makefile | 3 + tools/test/stress2/testcases/rename/rename.c | 134 +++ tools/test/stress2/testcases/run/Makefile | 3 + tools/test/stress2/testcases/run/run.c | 117 ++ tools/test/stress2/testcases/rw/Makefile | 3 + tools/test/stress2/testcases/rw/rw.c | 180 +++ tools/test/stress2/testcases/shm/Makefile | 4 + tools/test/stress2/testcases/shm/shm.c | 182 +++ tools/test/stress2/testcases/socket/Makefile | 3 + tools/test/stress2/testcases/socket/socket.c | 118 ++ tools/test/stress2/testcases/swap/Makefile | 3 + tools/test/stress2/testcases/swap/swap.c | 166 +++ tools/test/stress2/testcases/symlink/Makefile | 3 + tools/test/stress2/testcases/symlink/symlink.c | 138 +++ tools/test/stress2/testcases/sysctl/Makefile | 3 + tools/test/stress2/testcases/sysctl/sysctl.c | 63 + tools/test/stress2/testcases/tcp/Makefile | 3 + tools/test/stress2/testcases/tcp/tcp.c | 188 +++ tools/test/stress2/testcases/thr1/Makefile | 5 + tools/test/stress2/testcases/thr1/thr1.c | 75 ++ tools/test/stress2/testcases/thr2/Makefile | 5 + tools/test/stress2/testcases/thr2/thr2.c | 93 ++ tools/test/stress2/testcases/udp/Makefile | 3 + tools/test/stress2/testcases/udp/udp.c | 112 ++ tools/test/stress2/tools/bench.c | 356 ++++++ tools/test/stress2/tools/calc_mem_use.pl | 61 + tools/test/stress2/tools/df.sh | 42 + tools/test/stress2/tools/fail.sh | 74 ++ tools/test/stress2/tools/fast.sh | 59 + tools/test/stress2/tools/flip.c | 121 ++ tools/test/stress2/tools/freeze.sh | 42 + tools/test/stress2/tools/freeze2.sh | 43 + tools/test/stress2/tools/fstool.c | 236 ++++ tools/test/stress2/tools/iwatch.sh | 47 + tools/test/stress2/tools/killall.sh | 50 + tools/test/stress2/tools/kldload.sh | 71 ++ tools/test/stress2/tools/leaks.sh | 112 ++ tools/test/stress2/tools/leaks2.sh | 113 ++ tools/test/stress2/tools/maxvnodes.sh | 43 + tools/test/stress2/tools/ministat.sh | 52 + tools/test/stress2/tools/monitor.sh | 40 + tools/test/stress2/tools/ps.sh | 50 + tools/test/stress2/tools/ptsleak.sh | 39 + tools/test/stress2/tools/ptyleak.sh | 40 + tools/test/stress2/tools/rwatch.sh | 57 + tools/test/stress2/tools/setup.sh | 45 + tools/test/stress2/tools/shuffle | 47 + tools/test/stress2/tools/splitall.sh | 60 + tools/test/stress2/tools/swap.c | 225 ++++ tools/test/stress2/tools/uleak.sh | 71 ++ tools/test/stress2/tools/vmstat.sh | 113 ++ tools/test/stress2/udp.cfg | 9 + tools/test/stress2/vfs.cfg | 8 + 968 files changed, 111344 insertions(+) diff --git a/tools/test/README b/tools/test/README index 2bafa48a9764..5512fd5203ba 100644 --- a/tools/test/README *** 117149 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:13:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D13456BB66; Wed, 3 Mar 2021 14:13:30 +0000 (UTC) (envelope-from nwhitehorn@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 4DrGF40bKHz3pFk; Wed, 3 Mar 2021 14:13:28 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:cc7b:682b:f804:9afd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 83FF2217FA; Wed, 3 Mar 2021 14:13:26 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Brandon Bergren , rgrimes@FreeBSD.org Cc: Ed Maste , Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@FreeBSD.org References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> From: Nathan Whitehorn Message-ID: Date: Wed, 3 Mar 2021 09:13:25 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:13:30 -0000 On 3/3/21 9:05 AM, Brandon Bergren wrote: > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: >> What am I missing here? One place I am being told this is run in >> an environment that may not even be an EFI booted system, and in >> another place it is being used as a test if something is mounted >> on it, which should only be true on an EFI booted system. > That the script in question is a generic script that runs as part of bsdinstall on every platform and has to be universal. > > The actual *problem* here is that usr.sbin/bsdinstall/scripts/bootconfig has a default case that is > *) die "Unsupported arch $(uname -m) for UEFI install" > > which then causes the main script to bail out, leaving the system in a half-installed state. > > If that had just been an exit 0 this would have never been a problem, I suppose. > > Before the original change that broke this, there was a check that the script was not running on powerpc or mips platforms before running the efi bits, but this got taken out. > Well, incidentally. The bootconfig script needs to know if there is an ESP it should configure, but the signalling mechanism (the presence of the ESP mount point) was being broken by mtree making that directory unconditionally even on systems that don't use EFI. So then bootconfig tried to set it up, but failed later on, because there was no EFI loader to set up. The mtree change makes the ESP mount point only exist on systems with an ESP. -Nathan From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:26:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D219656C27A; Wed, 3 Mar 2021 14:26: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 4DrGXS5c8Xz3q8m; Wed, 3 Mar 2021 14:26: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 B32763301; Wed, 3 Mar 2021 14:26: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 123EQmvH082876; Wed, 3 Mar 2021 14:26:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123EQmU4082875; Wed, 3 Mar 2021 14:26:48 GMT (envelope-from git) Date: Wed, 3 Mar 2021 14:26:48 GMT Message-Id: <202103031426.123EQmU4082875@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: c8db60c0673d - main - Split out the loader efifb setup to a new function 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: c8db60c0673d4bb7a3a3e2c043804e1ed1108c2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:26:48 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c8db60c0673d4bb7a3a3e2c043804e1ed1108c2f commit c8db60c0673d4bb7a3a3e2c043804e1ed1108c2f Author: Andrew Turner AuthorDate: 2021-02-26 11:47:34 +0000 Commit: Andrew Turner CommitDate: 2021-03-03 14:18:02 +0000 Split out the loader efifb setup to a new function This makes bi_load_efi_data cleaner to add common acpi setup code. Reviewed by: imp, tsoome Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D28936 --- stand/efi/loader/bootinfo.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 9924901d29e6..327751e32f0b 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -299,6 +299,9 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) bool do_vmap; #if defined(__amd64__) || defined(__aarch64__) +static void +bi_load_efifb(struct preloaded_file *kfp) +{ struct efi_fb efifb; efifb.fb_addr = gfx_state.tg_fb.fb_addr; @@ -321,6 +324,25 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) if (efifb.fb_addr != 0) file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), &efifb); +} +#endif + +static int +bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) +{ + EFI_MEMORY_DESCRIPTOR *mm; + EFI_PHYSICAL_ADDRESS addr = 0; + EFI_STATUS status; + const char *efi_novmap; + size_t efisz; + UINTN efi_mapkey; + UINTN dsz, pages, retry, sz; + UINT32 mmver; + struct efi_map_header *efihdr; + bool do_vmap; + +#if defined(__amd64__) || defined(__aarch64__) + bi_load_efifb(kfp); #endif do_vmap = true; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:26:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 081E356BEF5; Wed, 3 Mar 2021 14:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrGXT6rhKz3qHg; Wed, 3 Mar 2021 14:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE86D324D; Wed, 3 Mar 2021 14:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 123EQnLc082899; Wed, 3 Mar 2021 14:26:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123EQnRg082898; Wed, 3 Mar 2021 14:26:49 GMT (envelope-from git) Date: Wed, 3 Mar 2021 14:26:49 GMT Message-Id: <202103031426.123EQnRg082898@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: 48ba9b2669e6 - main - Use L2 blocks when in the identity map 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: 48ba9b2669e6a92a3254ec34461d0d86fb20b9f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:26:50 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=48ba9b2669e6a92a3254ec34461d0d86fb20b9f4 commit 48ba9b2669e6a92a3254ec34461d0d86fb20b9f4 Author: Andrew Turner AuthorDate: 2020-12-24 11:02:34 +0000 Commit: Andrew Turner CommitDate: 2021-03-03 14:18:03 +0000 Use L2 blocks when in the identity map This reduces the memory mapped to be closer to the minimal memory needed to enable the MMU. Reviewed by: mmel Sponsored by: Innovate UK Differential Revision:://reviews.freebsd.org/D27765 --- sys/arm64/arm64/locore.S | 101 ++++++++++++++++++-------------------------- sys/arm64/include/machdep.h | 8 ++++ sys/conf/options.arm64 | 1 - 3 files changed, 49 insertions(+), 61 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index b340041eb163..4d356e8897f0 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -466,35 +466,58 @@ common: add x27, x24, #PAGE_SIZE mov x6, x27 /* The initial page table */ -#if defined(SOCDEV_PA) && defined(SOCDEV_VA) + + /* Create the VA = PA map */ + mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) + adrp x16, _start + and x16, x16, #(~L2_OFFSET) + mov x9, x16 /* PA start */ + mov x8, x16 /* VA start (== PA start) */ + mov x10, #1 + bl build_l2_block_pagetable + +#if defined(SOCDEV_PA) /* Create a table for the UART */ mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_DEVICE)) - mov x8, #(SOCDEV_VA) /* VA start */ - mov x9, #(SOCDEV_PA) /* PA start */ + add x16, x16, #(L2_SIZE) /* VA start */ + mov x8, x16 + + /* Store the socdev virtual address */ + add x17, x8, #(SOCDEV_PA & L2_OFFSET) + adrp x9, socdev_va + str x17, [x9, :lo12:socdev_va] + + mov x9, #(SOCDEV_PA & ~L2_OFFSET) /* PA start */ mov x10, #1 - bl build_l1_block_pagetable + bl build_l2_block_pagetable #endif #if defined(LINUX_BOOT_ABI) /* Map FDT data ? */ cbz x19, 1f - /* Create the identity mapping for FDT data (2 MiB max) */ + /* Create the mapping for FDT data (2 MiB max) */ mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) - mov x9, x0 - mov x8, x0 /* VA start (== PA start) */ + add x16, x16, #(L2_SIZE) /* VA start */ + mov x8, x16 + mov x9, x0 /* PA start */ + /* Update the module pointer to point at the allocated memory */ + and x0, x0, #(L2_OFFSET) /* Keep the lower bits */ + add x0, x0, x8 /* Add the aligned virtual address */ + mov x10, #1 - bl build_l1_block_pagetable + bl build_l2_block_pagetable 1: #endif - /* Create the VA = PA map */ - mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) - mov x9, x28 - mov x8, x9 /* VA start (== PA start) */ - mov x10, #1 - bl build_l1_block_pagetable + /* Move to the l1 table */ + add x27, x27, #PAGE_SIZE + + /* Link the l1 -> l2 table */ + mov x9, x6 + mov x6, x27 + bl link_l1_pagetable /* Move to the l0 table */ add x27, x27, #PAGE_SIZE @@ -513,13 +536,10 @@ LEND(create_pagetables) /* * Builds an L0 -> L1 table descriptor * - * This is a link for a 512GiB block of memory with up to 1GiB regions mapped - * within it by build_l1_block_pagetable. - * * x6 = L0 table * x8 = Virtual Address * x9 = L1 PA (trashed) - * x10 = Entry count + * x10 = Entry count (trashed) * x11, x12 and x13 are trashed */ LENTRY(link_l0_pagetable) @@ -551,9 +571,6 @@ LEND(link_l0_pagetable) /* * Builds an L1 -> L2 table descriptor * - * This is a link for a 1GiB block of memory with up to 2MiB regions mapped - * within it by build_l2_block_pagetable. - * * x6 = L1 table * x8 = Virtual Address * x9 = L2 PA (trashed) @@ -580,51 +597,13 @@ LENTRY(link_l1_pagetable) ret LEND(link_l1_pagetable) -/* - * Builds count 1 GiB page table entry - * x6 = L1 table - * x7 = Variable lower block attributes - * x8 = VA start - * x9 = PA start (trashed) - * x10 = Entry count - * x11, x12 and x13 are trashed - */ -LENTRY(build_l1_block_pagetable) - /* - * Build the L1 table entry. - */ - /* Find the table index */ - lsr x11, x8, #L1_SHIFT - and x11, x11, #Ln_ADDR_MASK - - /* Build the L1 block entry */ - orr x12, x7, #L1_BLOCK - orr x12, x12, #(ATTR_DEFAULT) - - /* Only use the output address bits */ - lsr x9, x9, #L1_SHIFT - - /* Set the physical address for this virtual address */ -1: orr x13, x12, x9, lsl #L1_SHIFT - - /* Store the entry */ - str x13, [x6, x11, lsl #3] - - sub x10, x10, #1 - add x11, x11, #1 - add x9, x9, #1 - cbnz x10, 1b - - ret -LEND(build_l1_block_pagetable) - /* * Builds count 2 MiB page table entry * x6 = L2 table * x7 = Type (0 = Device, 1 = Normal) * x8 = VA start * x9 = PA start (trashed) - * x10 = Entry count + * x10 = Entry count (trashed) * x11, x12 and x13 are trashed */ LENTRY(build_l2_block_pagetable) @@ -778,6 +757,8 @@ pagetable_l1_ttbr1: .space PAGE_SIZE pagetable_l0_ttbr1: .space PAGE_SIZE +pagetable_l2_ttbr0_bootstrap: + .space PAGE_SIZE pagetable_l1_ttbr0_bootstrap: .space PAGE_SIZE pagetable_l0_ttbr0_boostrap: diff --git a/sys/arm64/include/machdep.h b/sys/arm64/include/machdep.h index 54ffcbd46c81..45ff0065930a 100644 --- a/sys/arm64/include/machdep.h +++ b/sys/arm64/include/machdep.h @@ -60,6 +60,14 @@ void parse_fdt_bootargs(void); int memory_mapping_mode(vm_paddr_t pa); extern void (*pagezero)(void *); +#ifdef SOCDEV_PA +/* + * The virtual address SOCDEV_PA is mapped at. + * Only valid while the early pagetables are valid. + */ +extern uintptr_t socdev_va; +#endif + #endif /* _KERNEL */ #endif /* _MACHINE_MACHDEP_H_ */ diff --git a/sys/conf/options.arm64 b/sys/conf/options.arm64 index 5a97fd6b3ef6..5185a301e55e 100644 --- a/sys/conf/options.arm64 +++ b/sys/conf/options.arm64 @@ -3,7 +3,6 @@ ARM64 opt_global.h INTRNG opt_global.h SOCDEV_PA opt_global.h -SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h LINUX_BOOT_ABI opt_global.h From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:26:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6602856C1CD; Wed, 3 Mar 2021 14:26: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 4DrGXW4GVkz3qFS; Wed, 3 Mar 2021 14:26: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 140582EED; Wed, 3 Mar 2021 14:26: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 123EQo5J082921; Wed, 3 Mar 2021 14:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123EQoM5082920; Wed, 3 Mar 2021 14:26:50 GMT (envelope-from git) Date: Wed, 3 Mar 2021 14:26:50 GMT Message-Id: <202103031426.123EQoM5082920@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: 28d945204ea1 - main - Handle functions that use a nop in the arm64 fbt 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: 28d945204ea1014d7de6906af8470ed8b3311335 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:26:52 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=28d945204ea1014d7de6906af8470ed8b3311335 commit 28d945204ea1014d7de6906af8470ed8b3311335 Author: Andrew Turner AuthorDate: 2021-01-13 11:08:19 +0000 Commit: Andrew Turner CommitDate: 2021-03-03 14:18:03 +0000 Handle functions that use a nop in the arm64 fbt To trace leaf asm functions we can insert a single nop instruction as the first instruction in a function and trigger off this. Reviewed by: gnn Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D28132 --- sys/arm64/include/asm.h | 8 +++- .../contrib/opensolaris/uts/common/sys/dtrace.h | 2 + sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 5 +++ sys/cddl/dev/fbt/aarch64/fbt_isa.c | 51 ++++++++++++++-------- 4 files changed, 46 insertions(+), 20 deletions(-) diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index 05e618500e59..32b79d256e80 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -38,9 +38,15 @@ #define _C_LABEL(x) x +#ifdef KDTRACE_HOOKS +#define DTRACE_NOP nop +#else +#define DTRACE_NOP +#endif + #define LENTRY(sym) \ .text; .align 2; .type sym,#function; sym: \ - .cfi_startproc + .cfi_startproc; DTRACE_NOP #define ENTRY(sym) \ .globl sym; LENTRY(sym) #define EENTRY(sym) \ diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 2bedd01cf3e7..f15a971f12be 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -2466,6 +2466,8 @@ extern void dtrace_helpers_destroy(proc_t *); #define B_DATA_MASK 0x00ffffff #define B_INSTR 0x14000000 +#define NOP_INSTR 0xd503201f + #define RET_INSTR 0xd65f03c0 #define SUB_MASK 0xffc00000 diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index 9bf9f0798bb5..58d33511560b 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -314,6 +314,11 @@ dtrace_invop_start(struct trapframe *frame) return (0); } + if (invop == NOP_INSTR) { + frame->tf_elr += INSN_SIZE; + return (0); + } + if ((invop & B_MASK) == B_INSTR) { data = (invop & B_DATA_MASK); /* The data is the number of 4-byte words to change the pc */ diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index f15bc12291d3..12be95ea2217 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -110,28 +110,41 @@ fbt_provide_module_function(linker_file_t lf, int symindx, /* Look for stp (pre-indexed) operation */ found = false; - for (; instr < limit; instr++) { - /* Some functions start with "stp xt1, xt2, [xn, ]!" */ - if ((*instr & LDP_STP_MASK) == STP_64) { + /* + * If the first instruction is a nop it's a specially marked + * asm function. We only support a nop first as it's not a normal + * part of the function prologue. + */ + if (*instr == NOP_INSTR) + found = true; + if (!found) { + for (; instr < limit; instr++) { /* - * Assume any other store of this type means we - * are past the function prolog. + * Some functions start with + * "stp xt1, xt2, [xn, ]!" */ - if (((*instr >> ADDR_SHIFT) & ADDR_MASK) == 31) - found = true; - break; - } + if ((*instr & LDP_STP_MASK) == STP_64) { + /* + * Assume any other store of this type means we + * are past the function prolog. + */ + if (((*instr >> ADDR_SHIFT) & ADDR_MASK) == 31) + found = true; + break; + } - /* - * Some functions start with a "sub sp, sp, " - * Sometimes the compiler will have a sub instruction that - * is not of the above type so don't stop if we see one. - */ - if ((*instr & SUB_MASK) == SUB_INSTR && - ((*instr >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && - ((*instr >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) { - found = true; - break; + /* + * Some functions start with a "sub sp, sp, " + * Sometimes the compiler will have a sub instruction + * that is not of the above type so don't stop if we + * see one. + */ + if ((*instr & SUB_MASK) == SUB_INSTR && + ((*instr >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && + ((*instr >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) { + found = true; + break; + } } } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:29:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D085E56C511 for ; Wed, 3 Mar 2021 14:29:03 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 4DrGb34Jr1z3qbS for ; Wed, 3 Mar 2021 14:29:03 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f53.google.com with SMTP id u187so5340137wmg.4 for ; Wed, 03 Mar 2021 06:29:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KfoTTHpSVeH7z+JopN9RXRL/LV5G+X6GVJMXIzgSJls=; b=jvR2avBg8x+ny9np6mJ47zjHVjFYswS2N2YvAvGmkFzxGhvhesLs03mYsx46Rpsmig 0rUSdkRszzqZNyMG0i0jYfob4EECQzfIlxZ3QnD6PQ6eLYVTdwTPTP7M5QDV596jNEZW saN4c/s2gJYAFSbc/uFSZC2wkLaENcEt5+kmWuLqD9PcRIqivM6STe3BtVYd5ZC174S0 41yUibw8rYNUArYjMaPDJlXI7aoTRDlvQLkAOWILSnn9mNKy/pfBUB+fYJeurK1R5WL5 Ko9aqQw+2nmh2VkPxS56mmHNytaXFdqTFzkc0JR4OnB5Yr7foFVidSgqemi3s9OLRBwc WPgg== X-Gm-Message-State: AOAM530ERkhOcXnXoiy7iY+EL1PNl51uUW06G6uu/xE/U7Hu4+QVj6C2 O0FTGCuBBUYwnfxFRzk1YaO4Dw== X-Google-Smtp-Source: ABdhPJyguqmVXW5KwRZvV4KsuWf7Q9PkApi8Gb+F6GwFa8i95eLbsdPbvgmTJp7+eaoutNvX6+1aYQ== X-Received: by 2002:a1c:448a:: with SMTP id r132mr3138593wma.157.1614781742098; Wed, 03 Mar 2021 06:29:02 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id h62sm6862614wmf.37.2021.03.03.06.29.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Mar 2021 06:29:01 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 28d945204ea1 - main - Handle functions that use a nop in the arm64 fbt From: Jessica Clarke In-Reply-To: <202103031426.123EQoM5082920@gitrepo.freebsd.org> Date: Wed, 3 Mar 2021 14:29:00 +0000 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: <202103031426.123EQoM5082920@gitrepo.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DrGb34Jr1z3qbS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:29:03 -0000 On 3 Mar 2021, at 14:26, Andrew Turner wrote: >=20 > The branch main has been updated by andrew: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D28d945204ea1014d7de6906af8470ed8= b3311335 >=20 > commit 28d945204ea1014d7de6906af8470ed8b3311335 > Author: Andrew Turner > AuthorDate: 2021-01-13 11:08:19 +0000 > Commit: Andrew Turner > CommitDate: 2021-03-03 14:18:03 +0000 >=20 > Handle functions that use a nop in the arm64 fbt >=20 > To trace leaf asm functions we can insert a single nop instruction = as > the first instruction in a function and trigger off this. >=20 > Reviewed by: gnn > Sponsored by: Innovate UK > Differential Revision: https://reviews.freebsd.org/D28132 > --- > sys/arm64/include/asm.h | 8 +++- > .../contrib/opensolaris/uts/common/sys/dtrace.h | 2 + > sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 5 +++ > sys/cddl/dev/fbt/aarch64/fbt_isa.c | 51 = ++++++++++++++-------- > 4 files changed, 46 insertions(+), 20 deletions(-) >=20 > diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h > index 05e618500e59..32b79d256e80 100644 > --- a/sys/arm64/include/asm.h > +++ b/sys/arm64/include/asm.h > @@ -38,9 +38,15 @@ >=20 > #define _C_LABEL(x) x >=20 > +#ifdef KDTRACE_HOOKS > +#define DTRACE_NOP nop > +#else > +#define DTRACE_NOP > +#endif > + > #define LENTRY(sym) = \ > .text; .align 2; .type sym,#function; sym: \ > - .cfi_startproc > + .cfi_startproc; DTRACE_NOP > #define ENTRY(sym) = \ > .globl sym; LENTRY(sym) Doesn't this mean ENTRY incorrectly also has the nop? Jess From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:37:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5281556C53E for ; Wed, 3 Mar 2021 14:37:05 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 4DrGmJ2T9Hz3r6Q for ; Wed, 3 Mar 2021 14:37:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f48.google.com with SMTP id f12so20129837wrx.8 for ; Wed, 03 Mar 2021 06:37:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Id9pCmCMHJWrTFKmTl/PJsb404xFqRp4IlA8syhA+84=; b=An6e/ic43F3qycD3AvUzwIMs+GKQzdCwWtvofzxCuGOtd8tzvi1LmKJLIscMP6MZLV HaGnxBX8nLGudf45iY+MXGzBeQOlY3JsSRGvzKvS2JWtu1bKNt91XQXoj3LCodYRJVUt HFCdXQFP/WVX/dGJEpuXmaPK6GIQfxkyd9WjAPFhYMnoJvbJaMliEu1cs3e1bLTyvSdp VnBjz+Duev6WnxDIdbMvByRxKe90dGlW9+NKbjJ2A6onVzic0V3c9YEvK6u9dy+ls6d/ RHYOGMQmjFMFIxpCc7SQ8mcxJl/cU8ofh2xJHBEzV0I7SgDotyidiBs/H2qWfx1JZ98S 6a8w== X-Gm-Message-State: AOAM532BXXLpZ8A9J2YhHjKALLvC0wTNN2GOoZSqjH64fbZjFqdIN7vz w32uO5B+QFlpHtPPQc6wyq/y6g== X-Google-Smtp-Source: ABdhPJxI0IEse/bqzqQFxDaI7mR5892YT3IpyHxRo6Ihz5wXRExwoPx3MxZiFHy7TS8w1fg/sxirvg== X-Received: by 2002:adf:e485:: with SMTP id i5mr3626325wrm.26.1614782222840; Wed, 03 Mar 2021 06:37:02 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id q25sm5978816wmq.15.2021.03.03.06.37.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Mar 2021 06:37:02 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 28d945204ea1 - main - Handle functions that use a nop in the arm64 fbt From: Jessica Clarke In-Reply-To: Date: Wed, 3 Mar 2021 14:37:01 +0000 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: <202103031426.123EQoM5082920@gitrepo.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DrGmJ2T9Hz3r6Q X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.48 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.221.48:from]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.221.48:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.48:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.48:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:37:05 -0000 On 3 Mar 2021, at 14:29, Jessica Clarke wrote: > On 3 Mar 2021, at 14:26, Andrew Turner wrote: >>=20 >> The branch main has been updated by andrew: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D28d945204ea1014d7de6906af8470ed8= b3311335 >>=20 >> commit 28d945204ea1014d7de6906af8470ed8b3311335 >> Author: Andrew Turner >> AuthorDate: 2021-01-13 11:08:19 +0000 >> Commit: Andrew Turner >> CommitDate: 2021-03-03 14:18:03 +0000 >>=20 >> Handle functions that use a nop in the arm64 fbt >>=20 >> To trace leaf asm functions we can insert a single nop instruction = as >> the first instruction in a function and trigger off this. >>=20 >> Reviewed by: gnn >> Sponsored by: Innovate UK >> Differential Revision: https://reviews.freebsd.org/D28132 >> --- >> sys/arm64/include/asm.h | 8 +++- >> .../contrib/opensolaris/uts/common/sys/dtrace.h | 2 + >> sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 5 +++ >> sys/cddl/dev/fbt/aarch64/fbt_isa.c | 51 = ++++++++++++++-------- >> 4 files changed, 46 insertions(+), 20 deletions(-) >>=20 >> diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h >> index 05e618500e59..32b79d256e80 100644 >> --- a/sys/arm64/include/asm.h >> +++ b/sys/arm64/include/asm.h >> @@ -38,9 +38,15 @@ >>=20 >> #define _C_LABEL(x) x >>=20 >> +#ifdef KDTRACE_HOOKS >> +#define DTRACE_NOP nop >> +#else >> +#define DTRACE_NOP >> +#endif >> + >> #define LENTRY(sym) = \ >> .text; .align 2; .type sym,#function; sym: \ >> - .cfi_startproc >> + .cfi_startproc; DTRACE_NOP >> #define ENTRY(sym) = \ >> .globl sym; LENTRY(sym) >=20 > Doesn't this mean ENTRY incorrectly also has the nop? Hm, right, the L in LENTRY means local not leaf. Isn't this a problem though? (L)ENTRY are perfectly legal to use for non-leaf assembly functions today. Shouldn't there be separate ones specifically for leaf functions if you want to treat them differently? Jess From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:49:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 838BD56CA18; Wed, 3 Mar 2021 14:49:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrH2R3J2Mz3rZd; Wed, 3 Mar 2021 14:49: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 5FAC033B7; Wed, 3 Mar 2021 14:49: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 123EnJ58009802; Wed, 3 Mar 2021 14:49:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123EnJ8D009801; Wed, 3 Mar 2021 14:49:19 GMT (envelope-from git) Date: Wed, 3 Mar 2021 14:49:19 GMT Message-Id: <202103031449.123EnJ8D009801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 902a18d50aef - stable/13 - copy_file_range(2): Fix for small values of input file offset and len MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 902a18d50aef8775aa833dde3638356f994e28e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:49:19 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=902a18d50aef8775aa833dde3638356f994e28e8 commit 902a18d50aef8775aa833dde3638356f994e28e8 Author: Rick Macklem AuthorDate: 2021-03-01 14:28:30 +0000 Commit: Rick Macklem CommitDate: 2021-03-03 14:46:33 +0000 copy_file_range(2): Fix for small values of input file offset and len r366302 broke copy_file_range(2) for small values of input file offset and len. It was possible for rem to be greater than len and then "len - rem" was a large value, since both variables are unsigned. (cherry picked from commit a5f9fe2bab789f49e8b53da3a62dbd34725e23ea) --- sys/kern/vfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 781968f2db53..7a0951fb07ca 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3143,7 +3143,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, rem = *inoffp % blksize; if (rem > 0) rem = blksize - rem; - if (len - rem > blksize) + if (len > rem && len - rem > blksize) len = savlen = rounddown(len - rem, blksize) + rem; } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:55:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0813E56CB4A; Wed, 3 Mar 2021 14:55:42 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4DrH9n4tGTz3s4w; Wed, 3 Mar 2021 14:55:41 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [192.168.42.21] (cpc91232-cmbg18-2-0-cust554.5-4.cable.virginm.net [82.2.126.43]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 9326D4E71F; Wed, 3 Mar 2021 14:55:34 +0000 (UTC) From: Andrew Turner Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: git: 28d945204ea1 - main - Handle functions that use a nop in the arm64 fbt Date: Wed, 3 Mar 2021 14:55:33 +0000 In-Reply-To: Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Jessica Clarke References: <202103031426.123EQoM5082920@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.17) X-Rspamd-Queue-Id: 4DrH9n4tGTz3s4w X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:55:42 -0000 > On 3 Mar 2021, at 14:37, Jessica Clarke wrote: >=20 > On 3 Mar 2021, at 14:29, Jessica Clarke > wrote: >> On 3 Mar 2021, at 14:26, Andrew Turner wrote: >>>=20 >>> The branch main has been updated by andrew: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D28d945204ea1014d7de6906af8470ed8= b3311335 >>>=20 >>> commit 28d945204ea1014d7de6906af8470ed8b3311335 >>> Author: Andrew Turner >>> AuthorDate: 2021-01-13 11:08:19 +0000 >>> Commit: Andrew Turner >>> CommitDate: 2021-03-03 14:18:03 +0000 >>>=20 >>> Handle functions that use a nop in the arm64 fbt >>>=20 >>> To trace leaf asm functions we can insert a single nop instruction = as >>> the first instruction in a function and trigger off this. >>>=20 >>> Reviewed by: gnn >>> Sponsored by: Innovate UK >>> Differential Revision: https://reviews.freebsd.org/D28132 >>> --- >>> sys/arm64/include/asm.h | 8 +++- >>> .../contrib/opensolaris/uts/common/sys/dtrace.h | 2 + >>> sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 5 +++ >>> sys/cddl/dev/fbt/aarch64/fbt_isa.c | 51 = ++++++++++++++-------- >>> 4 files changed, 46 insertions(+), 20 deletions(-) >>>=20 >>> diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h >>> index 05e618500e59..32b79d256e80 100644 >>> --- a/sys/arm64/include/asm.h >>> +++ b/sys/arm64/include/asm.h >>> @@ -38,9 +38,15 @@ >>>=20 >>> #define _C_LABEL(x) x >>>=20 >>> +#ifdef KDTRACE_HOOKS >>> +#define DTRACE_NOP nop >>> +#else >>> +#define DTRACE_NOP >>> +#endif >>> + >>> #define LENTRY(sym) = \ >>> .text; .align 2; .type sym,#function; sym: \ >>> - .cfi_startproc >>> + .cfi_startproc; DTRACE_NOP >>> #define ENTRY(sym) = \ >>> .globl sym; LENTRY(sym) >>=20 >> Doesn't this mean ENTRY incorrectly also has the nop? >=20 > Hm, right, the L in LENTRY means local not leaf. Isn't this a problem > though? (L)ENTRY are perfectly legal to use for non-leaf assembly > functions today. Shouldn't there be separate ones specifically for = leaf > functions if you want to treat them differently? Other than early boot handling, pmap_switch, and the exception handlers = I think we only have a few non-leaf asm functions on arm64. The only = ones I can think of use tail recursion, e.g. memmove -> memcpy when = possible. Other than exception handlers these functions don=E2=80=99t = have the needed instructions to manage the stack frame as they don=E2=80=99= t use any stack space. I decided it was easier to add the nop = instruction to the start of function than try to create an unneeded = stack frame. Andrew= From owner-dev-commits-src-all@freebsd.org Wed Mar 3 14:59:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4C7156CD64 for ; Wed, 3 Mar 2021 14:59:47 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 4DrHGW3x8hz3s6H for ; Wed, 3 Mar 2021 14:59:47 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f46.google.com with SMTP id e10so23777744wro.12 for ; Wed, 03 Mar 2021 06:59:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=F6BwBxdydg6SxdsmiSKVRFrNAamwVtDvqyJ/8EbbW8k=; b=LTeN7tBifX36a2ZhqGNt+037/nW4zMlcTSubVfKNm3HcDeZ7aq+8z5aXD1FuBzvVQc 2khY/LmZRDaBJ31m1xDgucEvZ2jcGaUsvvi3zUYf4hJAmDD0L1I5aqIO6y6yh7k1GW9B qUwgKpF0by59Fcqok75bw7SN7hIn18BFctJgksPvuUz8CTeICAaXeE8M6h75+PaOVKPD s4xKbopR8WV5LwBpr/fQ6LTMrEc74EWYK6heHIIC0TmQgsuyu5qc6DorSGx1makfKNle pr+9FPNioaDMMCqV32sZEj+DhCRSS1UKMNWn2QzwHOyhLNbW1xup8lWF+3dRifv3e24v ZXGg== X-Gm-Message-State: AOAM5311OjJda+AjdPgrSPP7M7X9dD/2+2Y2l6IuLtTsptquG0v3vaSw 8fhPaIX2ioKCf83SwRmnZ892vQ== X-Google-Smtp-Source: ABdhPJzHRYQULiboNtwIr+2lGKml0NCoOQ6FbEwG/z7PMg3r7I5HeUsBK5/P110tgmYZcHv6VQjqRA== X-Received: by 2002:adf:d1ce:: with SMTP id b14mr27663507wrd.126.1614783584845; Wed, 03 Mar 2021 06:59:44 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id k4sm42280022wrd.9.2021.03.03.06.59.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Mar 2021 06:59:44 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 28d945204ea1 - main - Handle functions that use a nop in the arm64 fbt From: Jessica Clarke In-Reply-To: Date: Wed, 3 Mar 2021 14:59:43 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <8B945F5B-AC79-47E6-98D9-16762D3DBBF5@freebsd.org> References: <202103031426.123EQoM5082920@gitrepo.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DrHGW3x8hz3s6H X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 14:59:47 -0000 On 3 Mar 2021, at 14:55, Andrew Turner wrote: >=20 >> On 3 Mar 2021, at 14:37, Jessica Clarke wrote: >>=20 >> On 3 Mar 2021, at 14:29, Jessica Clarke wrote: >>> On 3 Mar 2021, at 14:26, Andrew Turner wrote: >>>>=20 >>>> The branch main has been updated by andrew: >>>>=20 >>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D28d945204ea1014d7de6906af8470ed8= b3311335 >>>>=20 >>>> commit 28d945204ea1014d7de6906af8470ed8b3311335 >>>> Author: Andrew Turner >>>> AuthorDate: 2021-01-13 11:08:19 +0000 >>>> Commit: Andrew Turner >>>> CommitDate: 2021-03-03 14:18:03 +0000 >>>>=20 >>>> Handle functions that use a nop in the arm64 fbt >>>>=20 >>>> To trace leaf asm functions we can insert a single nop instruction = as >>>> the first instruction in a function and trigger off this. >>>>=20 >>>> Reviewed by: gnn >>>> Sponsored by: Innovate UK >>>> Differential Revision: https://reviews.freebsd.org/D28132 >>>> --- >>>> sys/arm64/include/asm.h | 8 +++- >>>> .../contrib/opensolaris/uts/common/sys/dtrace.h | 2 + >>>> sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 5 +++ >>>> sys/cddl/dev/fbt/aarch64/fbt_isa.c | 51 = ++++++++++++++-------- >>>> 4 files changed, 46 insertions(+), 20 deletions(-) >>>>=20 >>>> diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h >>>> index 05e618500e59..32b79d256e80 100644 >>>> --- a/sys/arm64/include/asm.h >>>> +++ b/sys/arm64/include/asm.h >>>> @@ -38,9 +38,15 @@ >>>>=20 >>>> #define _C_LABEL(x) x >>>>=20 >>>> +#ifdef KDTRACE_HOOKS >>>> +#define DTRACE_NOP nop >>>> +#else >>>> +#define DTRACE_NOP >>>> +#endif >>>> + >>>> #define LENTRY(sym) = \ >>>> .text; .align 2; .type sym,#function; sym: \ >>>> - .cfi_startproc >>>> + .cfi_startproc; DTRACE_NOP >>>> #define ENTRY(sym) = \ >>>> .globl sym; LENTRY(sym) >>>=20 >>> Doesn't this mean ENTRY incorrectly also has the nop? >>=20 >> Hm, right, the L in LENTRY means local not leaf. Isn't this a problem >> though? (L)ENTRY are perfectly legal to use for non-leaf assembly >> functions today. Shouldn't there be separate ones specifically for = leaf >> functions if you want to treat them differently? >=20 > Other than early boot handling, pmap_switch, and the exception = handlers I think we only have a few non-leaf asm functions on arm64. The = only ones I can think of use tail recursion, e.g. memmove -> memcpy when = possible. Other than exception handlers these functions don=E2=80=99t = have the needed instructions to manage the stack frame as they don=E2=80=99= t use any stack space. I decided it was easier to add the nop = instruction to the start of function than try to create an unneeded = stack frame. I don't contest that. My problem is that there is now a hidden requirement that (L)ENTRY only be used for leaf functions lest you get broken FBT for them. That is a surprising restriction, which to me should be indicated by having a different macro name from the generic (L)ENTRY shared across most (all?) ports. Despite its flaws, MIPS does have special LEAF macros that are distinct from the others. Jess From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:09:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B556756D3AB; Wed, 3 Mar 2021 15:09:11 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4DrHTM47jfz3t2y; Wed, 3 Mar 2021 15:09:11 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [192.168.42.21] (cpc91232-cmbg18-2-0-cust554.5-4.cable.virginm.net [82.2.126.43]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 7A8BC4E716; Wed, 3 Mar 2021 15:09:10 +0000 (UTC) From: Andrew Turner Message-Id: <9D7C6FED-2B65-4219-9B1E-4BAF5AC5CEC8@freebsd.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: git: 28d945204ea1 - main - Handle functions that use a nop in the arm64 fbt Date: Wed, 3 Mar 2021 15:09:09 +0000 In-Reply-To: <8B945F5B-AC79-47E6-98D9-16762D3DBBF5@freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Jessica Clarke References: <202103031426.123EQoM5082920@gitrepo.freebsd.org> <8B945F5B-AC79-47E6-98D9-16762D3DBBF5@freebsd.org> X-Mailer: Apple Mail (2.3445.104.17) X-Rspamd-Queue-Id: 4DrHTM47jfz3t2y X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:09:11 -0000 > On 3 Mar 2021, at 14:59, Jessica Clarke wrote: >=20 > On 3 Mar 2021, at 14:55, Andrew Turner > wrote: >>=20 >>> On 3 Mar 2021, at 14:37, Jessica Clarke wrote: >>>=20 >>> On 3 Mar 2021, at 14:29, Jessica Clarke wrote: >>>> On 3 Mar 2021, at 14:26, Andrew Turner wrote: >>>>>=20 >>>>> The branch main has been updated by andrew: >>>>>=20 >>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D28d945204ea1014d7de6906af8470ed8= b3311335 >>>>>=20 >>>>> commit 28d945204ea1014d7de6906af8470ed8b3311335 >>>>> Author: Andrew Turner >>>>> AuthorDate: 2021-01-13 11:08:19 +0000 >>>>> Commit: Andrew Turner >>>>> CommitDate: 2021-03-03 14:18:03 +0000 >>>>>=20 >>>>> Handle functions that use a nop in the arm64 fbt >>>>>=20 >>>>> To trace leaf asm functions we can insert a single nop instruction = as >>>>> the first instruction in a function and trigger off this. >>>>>=20 >>>>> Reviewed by: gnn >>>>> Sponsored by: Innovate UK >>>>> Differential Revision: https://reviews.freebsd.org/D28132 >>>>> --- >>>>> sys/arm64/include/asm.h | 8 +++- >>>>> .../contrib/opensolaris/uts/common/sys/dtrace.h | 2 + >>>>> sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 5 +++ >>>>> sys/cddl/dev/fbt/aarch64/fbt_isa.c | 51 = ++++++++++++++-------- >>>>> 4 files changed, 46 insertions(+), 20 deletions(-) >>>>>=20 >>>>> diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h >>>>> index 05e618500e59..32b79d256e80 100644 >>>>> --- a/sys/arm64/include/asm.h >>>>> +++ b/sys/arm64/include/asm.h >>>>> @@ -38,9 +38,15 @@ >>>>>=20 >>>>> #define _C_LABEL(x) x >>>>>=20 >>>>> +#ifdef KDTRACE_HOOKS >>>>> +#define DTRACE_NOP nop >>>>> +#else >>>>> +#define DTRACE_NOP >>>>> +#endif >>>>> + >>>>> #define LENTRY(sym) = \ >>>>> .text; .align 2; .type sym,#function; sym: \ >>>>> - .cfi_startproc >>>>> + .cfi_startproc; DTRACE_NOP >>>>> #define ENTRY(sym) = \ >>>>> .globl sym; LENTRY(sym) >>>>=20 >>>> Doesn't this mean ENTRY incorrectly also has the nop? >>>=20 >>> Hm, right, the L in LENTRY means local not leaf. Isn't this a = problem >>> though? (L)ENTRY are perfectly legal to use for non-leaf assembly >>> functions today. Shouldn't there be separate ones specifically for = leaf >>> functions if you want to treat them differently? >>=20 >> Other than early boot handling, pmap_switch, and the exception = handlers I think we only have a few non-leaf asm functions on arm64. The = only ones I can think of use tail recursion, e.g. memmove -> memcpy when = possible. Other than exception handlers these functions don=E2=80=99t = have the needed instructions to manage the stack frame as they don=E2=80=99= t use any stack space. I decided it was easier to add the nop = instruction to the start of function than try to create an unneeded = stack frame. >=20 > I don't contest that. My problem is that there is now a hidden > requirement that (L)ENTRY only be used for leaf functions lest you get > broken FBT for them. That is a surprising restriction, which to me > should be indicated by having a different macro name from the generic > (L)ENTRY shared across most (all?) ports. Despite its flaws, MIPS does > have special LEAF macros that are distinct from the others. Why would you get broken FBT? All it cares about is finding an = instruction it can emulate and replace it with a specific breakpoint. In = a non-leaf asm function we will place a nop as the first instruction = followed by the standard stack frame manipulation instructions. In this = case the nop is unneeded, but should add minimal overhead if such a = function is added. I only mentioned leaf functions in the commit message as an example of = something that we may not have previously been able to trace due to a = lack of stack usage. Andrew= From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:11:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14C2256D36B; Wed, 3 Mar 2021 15:11: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 4DrHXR06zmz3tdg; Wed, 3 Mar 2021 15:11: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 EB6C43E89; Wed, 3 Mar 2021 15:11: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 123FBo8v048448; Wed, 3 Mar 2021 15:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123FBoNq048447; Wed, 3 Mar 2021 15:11:50 GMT (envelope-from git) Date: Wed, 3 Mar 2021 15:11:50 GMT Message-Id: <202103031511.123FBoNq048447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: a2a4cfc3157f - stable/13 - nfsclient: fix panic in cache_enter_time() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a2a4cfc3157ff19a192eff96c017169ede15c054 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:11:51 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a2a4cfc3157ff19a192eff96c017169ede15c054 commit a2a4cfc3157ff19a192eff96c017169ede15c054 Author: Rick Macklem AuthorDate: 2021-02-28 01:54:05 +0000 Commit: Rick Macklem CommitDate: 2021-03-03 15:10:51 +0000 nfsclient: fix panic in cache_enter_time() Juraj Lutter (otis@) reported a panic "dvp != vp not true" in cache_enter_time() called from the NFS client's nfsrpc_readdirplus() function. This is specific to an NFSv3 mount with the "rdirplus" mount option. Unlike NFSv4, NFSv3 replies to ReaddirPlus includes entries for the current directory. This trivial patch avoids doing a cache_enter_time() call for the current directory to avoid the panic. (cherry picked from commit 3fe2c68ba20fb3365ef91e0b85f88237b5369f38) --- sys/fs/nfsclient/nfs_clrpcops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index b4f2d5301d13..c95d4dc58e7a 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3761,6 +3761,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ndp->ni_vp = newvp; NFSCNHASH(cnp, HASHINIT); if (cnp->cn_namelen <= NCHNAMLEN && + ndp->ni_dvp != ndp->ni_vp && (newvp->v_type != VDIR || dctime.tv_sec != 0)) { cache_enter_time(ndp->ni_dvp, From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:14:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DE6A56DB01 for ; Wed, 3 Mar 2021 15:14:58 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.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 4DrHc22zGdz3tjm for ; Wed, 3 Mar 2021 15:14:58 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f41.google.com with SMTP id n4so6664951wmq.3 for ; Wed, 03 Mar 2021 07:14:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KH7n4N8muXRs0tUlMFGUIz8Sm7UFW84+7FRVgfV/rd4=; b=G3DZ6SOsbO4k4UjInqmAsTK7NTa1HTTvoYd272+1chK474P734fNMjDjNvP35WOywm IsQCduhMafVF1EQdDPwt2vxXzUdhlggfh1zniN6kFhgdgNv+CNv6M7AyMR64zLJJj0er P2g2irrpoG/X/rKIWEWkBRKMolm+WjbbGquWIF9SSPm3InHWZI/aZnQa4Sh4/ytrFFkd 47Rf/JWKFtE0LCDt2Qx3As4IObcde/eKzpimxeeDMpoi2BJAz+4VU7OYv4bZfxSNHwQG ejdlD4J845rXrjFsAF7AQkUAaF+RcTiRo/l7wg639u4sufVZiBL7XScwtOcvH19LicPJ 8qXw== X-Gm-Message-State: AOAM530sQGMi1ZaVF2DvlwumxuwGyf5/38ZuniUhGs9AOHSvMZd2qnuB va9qScdkbrWZW7vjAG2nEjugsA== X-Google-Smtp-Source: ABdhPJxFXLyAiBPWIAUEY3AFgasjt7a09GCtbX4hD466mnrk/m9RlOvWpx68sDMEycb+exgOcQoQdg== X-Received: by 2002:a1c:a543:: with SMTP id o64mr9564706wme.107.1614784495597; Wed, 03 Mar 2021 07:14:55 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id b186sm4707048wmc.44.2021.03.03.07.14.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Mar 2021 07:14:55 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 28d945204ea1 - main - Handle functions that use a nop in the arm64 fbt From: Jessica Clarke In-Reply-To: <9D7C6FED-2B65-4219-9B1E-4BAF5AC5CEC8@freebsd.org> Date: Wed, 3 Mar 2021 15:14:54 +0000 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: <202103031426.123EQoM5082920@gitrepo.freebsd.org> <8B945F5B-AC79-47E6-98D9-16762D3DBBF5@freebsd.org> <9D7C6FED-2B65-4219-9B1E-4BAF5AC5CEC8@freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DrHc22zGdz3tjm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:14:58 -0000 > On 3 Mar 2021, at 15:09, Andrew Turner wrote: >=20 >>=20 >> On 3 Mar 2021, at 14:59, Jessica Clarke wrote: >>=20 >> On 3 Mar 2021, at 14:55, Andrew Turner wrote: >>>=20 >>>> On 3 Mar 2021, at 14:37, Jessica Clarke wrote: >>>>=20 >>>> On 3 Mar 2021, at 14:29, Jessica Clarke wrote: >>>>> On 3 Mar 2021, at 14:26, Andrew Turner wrote: >>>>>>=20 >>>>>> The branch main has been updated by andrew: >>>>>>=20 >>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D28d945204ea1014d7de6906af8470ed8= b3311335 >>>>>>=20 >>>>>> commit 28d945204ea1014d7de6906af8470ed8b3311335 >>>>>> Author: Andrew Turner >>>>>> AuthorDate: 2021-01-13 11:08:19 +0000 >>>>>> Commit: Andrew Turner >>>>>> CommitDate: 2021-03-03 14:18:03 +0000 >>>>>>=20 >>>>>> Handle functions that use a nop in the arm64 fbt >>>>>>=20 >>>>>> To trace leaf asm functions we can insert a single nop = instruction as >>>>>> the first instruction in a function and trigger off this. >>>>>>=20 >>>>>> Reviewed by: gnn >>>>>> Sponsored by: Innovate UK >>>>>> Differential Revision: https://reviews.freebsd.org/D28132 >>>>>> --- >>>>>> sys/arm64/include/asm.h | 8 +++- >>>>>> .../contrib/opensolaris/uts/common/sys/dtrace.h | 2 + >>>>>> sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 5 +++ >>>>>> sys/cddl/dev/fbt/aarch64/fbt_isa.c | 51 = ++++++++++++++-------- >>>>>> 4 files changed, 46 insertions(+), 20 deletions(-) >>>>>>=20 >>>>>> diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h >>>>>> index 05e618500e59..32b79d256e80 100644 >>>>>> --- a/sys/arm64/include/asm.h >>>>>> +++ b/sys/arm64/include/asm.h >>>>>> @@ -38,9 +38,15 @@ >>>>>>=20 >>>>>> #define _C_LABEL(x) x >>>>>>=20 >>>>>> +#ifdef KDTRACE_HOOKS >>>>>> +#define DTRACE_NOP nop >>>>>> +#else >>>>>> +#define DTRACE_NOP >>>>>> +#endif >>>>>> + >>>>>> #define LENTRY(sym) = \ >>>>>> .text; .align 2; .type sym,#function; sym: \ >>>>>> - .cfi_startproc >>>>>> + .cfi_startproc; DTRACE_NOP >>>>>> #define ENTRY(sym) = \ >>>>>> .globl sym; LENTRY(sym) >>>>>=20 >>>>> Doesn't this mean ENTRY incorrectly also has the nop? >>>>=20 >>>> Hm, right, the L in LENTRY means local not leaf. Isn't this a = problem >>>> though? (L)ENTRY are perfectly legal to use for non-leaf assembly >>>> functions today. Shouldn't there be separate ones specifically for = leaf >>>> functions if you want to treat them differently? >>>=20 >>> Other than early boot handling, pmap_switch, and the exception = handlers I think we only have a few non-leaf asm functions on arm64. The = only ones I can think of use tail recursion, e.g. memmove -> memcpy when = possible. Other than exception handlers these functions don=E2=80=99t = have the needed instructions to manage the stack frame as they don=E2=80=99= t use any stack space. I decided it was easier to add the nop = instruction to the start of function than try to create an unneeded = stack frame. >>=20 >> I don't contest that. My problem is that there is now a hidden >> requirement that (L)ENTRY only be used for leaf functions lest you = get >> broken FBT for them. That is a surprising restriction, which to me >> should be indicated by having a different macro name from the generic >> (L)ENTRY shared across most (all?) ports. Despite its flaws, MIPS = does >> have special LEAF macros that are distinct from the others. >=20 > Why would you get broken FBT? All it cares about is finding an = instruction it can emulate and replace it with a specific breakpoint. In = a non-leaf asm function we will place a nop as the first instruction = followed by the standard stack frame manipulation instructions. In this = case the nop is unneeded, but should add minimal overhead if such a = function is added. >=20 > I only mentioned leaf functions in the commit message as an example of = something that we may not have previously been able to trace due to a = lack of stack usage. Oh I see, I didn't read the commit properly, I assumed it was to watermark leaf functions for better stack traces. My bad. Jess From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:24:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02C5456D9BD for ; Wed, 3 Mar 2021 15:24:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 4DrHpm69VRz3vGR for ; Wed, 3 Mar 2021 15:24:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id r24so17754754qtt.8 for ; Wed, 03 Mar 2021 07:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Cp6u1g/nLZnivDUEe9PnRNT2IAoeKZ87PnauSyvVsng=; b=RYRVb8VQY3czDV/bT0DJD8of44JyPSzg7JOtTrrqC8cLGaSXWx4322BgcUrdRoO9OL S4yL5ZbsrT3RkBLm+ICWrTPlQ+K+2SBv7NnklxClCGHKzdCh0UMlaPgohFBcn0mF6ITp yq2XTdFEk/gGfD+/HdfSUg3M6GHLfZHlB6OvcAgFCXf9i0MQOBKy9LAK8+Ofmku5lHp0 cQFly6AMtgnpTuI3Lu7q8QvhFdqjHIu6JUxe4/sRsvE12cLkUDhMG2Yg0auDkS/naZIE z/nveMVhL+e9aQxAQhCViWv5i/1hBAym0GrIbz5zf9mWyvf5M62rchiFUD/XWxvun+n1 s24g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Cp6u1g/nLZnivDUEe9PnRNT2IAoeKZ87PnauSyvVsng=; b=oqc4H8/O9yMRhXOmuU+Il9075MXJXr6WCCso6sJEYPohgbv6+4n9eknC91Nm/TcXlA 3X2C0kGcrdwlzHKZBlu/L82VKIZw55MST23b7c3XVYzqiGLjPdXNV4gallAepWzUbJIn H6yJBKRmuQspyOjBgBwjdnWzDy+mMbmGSLQYbDspfjWVpYQs5mhL8v7ce45Rjy0OKeN1 aeFL6PEad/rpieH5q3HsUeQcx6grXecpxqw3q6rPQwy/twDLsrLIrIRYcNba1BlXomsb isFKStEoZh8EMq37UlHk+BE7J+lzSvuUfPFhn07RVz2dhs8D+NoEJGyHNkUt4z+R6/0a ipJg== X-Gm-Message-State: AOAM533lkdvDGOlSrB6DDiXkNeiW6RZhyFlhtKngiXddNjDn6PVB0Pwd i0VDjYJJu6hXtzG31GlkUHmcqpDPZ7vVJjNOF5A9MQ== X-Google-Smtp-Source: ABdhPJw1AFTZKO0Bg36ErqZIBU+byon/yDHvXKlqhgqth2PtJNGl+KlLz/u9iG0wB5P4EpdmFtCNmNpYxFYC/oD7zlQ= X-Received: by 2002:a05:622a:303:: with SMTP id q3mr22377222qtw.235.1614785055948; Wed, 03 Mar 2021 07:24:15 -0800 (PST) MIME-Version: 1.0 References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 3 Mar 2021 08:24:05 -0700 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Nathan Whitehorn Cc: Ed Maste , "Rodney W. Grimes" , Brandon Bergren , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DrHpm69VRz3vGR X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:24:17 -0000 On Wed, Mar 3, 2021 at 7:09 AM Nathan Whitehorn wrote: > > > On 3/2/21 10:19 PM, Warner Losh wrote: > > > > > > On Tue, Mar 2, 2021, 7:01 PM Ed Maste > > wrote: > > > > On Tue, 2 Mar 2021 at 19:30, Warner Losh > > wrote: > > > > > > There has been some talk of moving the mount point to /efi, but > > I think that went nowhere... > > > > I thought about /efi based on arguments from the Linux world, more > > info at > > > https://wiki.archlinux.org/index.php/EFI_system_partition#Typical_mount_points > > < > https://wiki.archlinux.org/index.php/EFI_system_partition#Typical_mount_points > >. > > I did open https://reviews.freebsd.org/D28814 > > to move the existing > > uses to /efi. That said, I'm much more interested in us picking > > something and using it in the installer/other tooling than whether > > it's /boot/efi or /efi. > > > > > > Me too. I am actually open to either. If I had a do over, I'd pick > > /efi honestly. > > > > But the directory presence or absence shouldn't be used to know if we > > have an ESP to deal with or not. > > > > Warner > > > > It would have been nice to know that when I posted the original patch > for review that relied on this mechanism two weeks ago and you and Ed > both signed off. Or when we discussed this on Friday and no one knew why > it was in mtree -- I still honestly don't know from this thread -- and > then I proposed removing it and everyone said that was fine. There are > lots of other directories that we make in the installer that aren't in > mtree. What's special about this one? > You could have asked me directly rather than rely on an IRC conversation I wasn't part of. You didn't post the review widely enough, nor did you wait for my comments or seek them out despite knowing I was deeply involved in this. To get maximal reuse out of things, we need it in mtree. It's part of the base system, part of the updates, etc. Arbitrarily removing it without even asking me for input is what I'm upset about. The problem here is that the installer needs to know if an ESP has been > made. If /boot/efi is supposed to be the mountpoint for an ESP, its > presence seemed like a reasonable way to signal that. Here are some > options: > - We could try to see if a partition is actually mounted there. That's > mildly annoying -- it involves parsing some shell output -- and results > in making a pointless directory on all non-EFI architectures. > - We could try to have the installer signal to itself via some temp > file. This seems fragile and complicated. > - We could duplicate the logic for whether to make an ESP in the first > place in several places, which seems like a terrible idea. > The installer should just mount it early, then it will know. This will make the install script reusable on all architectures which will know if it is mounted to update it. There's no need for anything else to happen and you don't need to change the wider system. > But this needs to be settled *now*. It's already very, very late to get > this into 13.0 and we can't have another cycle of changing our minds > about reviewed code. > No. This was not reviewed code. It was hastily tossed together without proper follow up. You knew of my interest. You could have seen who committed the change to mtree in the first place and added them to a reviewboard review, but you didn't do that. I've hardly been absent, but I'm not on IRC 24/7. You could have at least asked. But you didn't and now want to use that fact to prevent me from objecting. That's not a functional way to run a project. I'm happy to settle it now and put this aside and get this settled... Warner From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:34:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3EE556E023; Wed, 3 Mar 2021 15:34: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 4DrJ2m59bdz3w7m; Wed, 3 Mar 2021 15:34: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 9FFAA3EC2; Wed, 3 Mar 2021 15:34: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 123FYe6F075455; Wed, 3 Mar 2021 15:34:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123FYeTn075454; Wed, 3 Mar 2021 15:34:40 GMT (envelope-from git) Date: Wed, 3 Mar 2021 15:34:40 GMT Message-Id: <202103031534.123FYeTn075454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chris Rees Subject: git: 949eb16e3b4d - stable/12 - Clarify kld_list format MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 949eb16e3b4dff61fa99c0c0a8be49ba38bea053 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:34:40 -0000 The branch stable/12 has been updated by crees (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=949eb16e3b4dff61fa99c0c0a8be49ba38bea053 commit 949eb16e3b4dff61fa99c0c0a8be49ba38bea053 Author: Chris Rees AuthorDate: 2018-12-24 10:47:48 +0000 Commit: Chris Rees CommitDate: 2021-03-03 15:34:09 +0000 Clarify kld_list format PR: docs/234248 Submitted by: David Fiander Submitted by: Miroslav Lachman (cherry picked from commit 261e62db4c62ecab7c8d8055b1a548acb80c16dc) --- share/man/man5/rc.conf.5 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 25666f9810e0..fdb48845da26 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -258,12 +258,14 @@ A whitespace-separated list of kernel modules to be ignored by .Xr devmatch 8 . .It Va kld_list .Pq Vt str -A list of kernel modules to load right after the local -disks are mounted. +A whitespace-separated list of kernel modules to load right after +the local disks are mounted, without any +.Pa .ko +extension or path. Loading modules at this point in the boot process is much faster than doing it via .Pa /boot/loader.conf -for those modules not necessary for mounting local disk. +for those modules not necessary for mounting local disks. .It Va kldxref_enable .Pq Vt bool Set to From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:38:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74C6056E240 for ; Wed, 3 Mar 2021 15:38:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 4DrJ6x2fxqz3w6N for ; Wed, 3 Mar 2021 15:38:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72b.google.com with SMTP id a9so9789453qkn.13 for ; Wed, 03 Mar 2021 07:38:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OfxdMQ9K83s8cNZVwv5YEIuT/l5+sxRoQu4abRvbDN8=; b=VVzxaJrpqYwD7a1PZv8Y5OD/cdteNwhGhn9qoxj4Mbzmi8MP9mI3n5KCfmiFw9PnXO 9YSA8vlt7ZUb6314JAMYmD32rnn1YhOo+IDb5AyxXIIiAiDmvrtPoeAsum0yuy0z6Wh8 uh3pJ8bZhtGd2qLomuQNocWToH3tRhcZftnGsiXtrdcnRBhveZvsUKfOh8SJP7rGy0MX 8lCACyXIJTwmpFLs0y9gu20c93Ty58tUVvzJmptInu6tZBzdZ5yIVSO3Ibil4YnmytCv ZUav1mSVP6mLkkx+RG/HId0FQfodreFPVQI2LAvRD5XXUX/P1qpq115wI5OT1hoSZM7t YNoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OfxdMQ9K83s8cNZVwv5YEIuT/l5+sxRoQu4abRvbDN8=; b=WP30lDGBhYJCmJzGZ/IRbVhMYtL/qgZFzP3Jqmje70FghSstMOuYRlduff7ecXzAna TtbwM89UqYkFxgL6sxil0FdIPueeUL5UJ3dyBfq+vaJbIZVQuxyeLIl1tairqsf75nva IWVy1/RAAl89vFmRPob67W3lNHeZPXF3q4x+7hS2qgywZE6CR6iKbXnEwu7iG0yGEE4q ALm2NIXoL/bdFWKwqGPFIsGdImfPBarawpVQkLpgV5Gd5OyXGEIyahtudAmqMzX3RuH4 mqNc1ao3oOKpftXQXQejMqVrZUZMgiZWFPsZvussi/bsqENONRqFz+1P+gQ3oXHgI4dX MPTA== X-Gm-Message-State: AOAM531Vh4GsnW9vtqdlB1al9oLSJ7dvc1wXR5qa01Xf8cQVJ75F1Il4 7kfECKVfeyDwlVZZW4InAcMi6P3d5c9i/Bgej+nCyQ== X-Google-Smtp-Source: ABdhPJzD1lSds62JoJ+5+KMA+f2UsILHA7iEIVuSx72dqWsdzrJfZvsgxO7gBcqOO1AFhSzJPhfuATTepPSs2KwqVrg= X-Received: by 2002:a37:6cc6:: with SMTP id h189mr25891589qkc.195.1614785896534; Wed, 03 Mar 2021 07:38:16 -0800 (PST) MIME-Version: 1.0 References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> In-Reply-To: From: Warner Losh Date: Wed, 3 Mar 2021 08:38:05 -0700 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Nathan Whitehorn Cc: Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DrJ6x2fxqz3w6N X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:38:17 -0000 On Wed, Mar 3, 2021 at 7:13 AM Nathan Whitehorn wrote: > > > On 3/3/21 9:05 AM, Brandon Bergren wrote: > > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: > >> What am I missing here? One place I am being told this is run in > >> an environment that may not even be an EFI booted system, and in > >> another place it is being used as a test if something is mounted > >> on it, which should only be true on an EFI booted system. > > That the script in question is a generic script that runs as part of > bsdinstall on every platform and has to be universal. > > > > The actual *problem* here is that usr.sbin/bsdinstall/scripts/bootconfig > has a default case that is > > *) die "Unsupported arch $(uname -m) for UEFI > install" > > > > which then causes the main script to bail out, leaving the system in a > half-installed state. > > > > If that had just been an exit 0 this would have never been a problem, I > suppose. > > > > Before the original change that broke this, there was a check that the > script was not running on powerpc or mips platforms before running the efi > bits, but this got taken out. > > > > Well, incidentally. The bootconfig script needs to know if there is an > ESP it should configure, but the signalling mechanism (the presence of > the ESP mount point) was being broken by mtree making that directory > unconditionally even on systems that don't use EFI. So then bootconfig > tried to set it up, but failed later on, because there was no EFI loader > to set up. The mtree change makes the ESP mount point only exist on > systems with an ESP. > So you made a unilateral change, without discussion of the bigger design, to something without even asking the original person who made the change to mtree about it for what sounds like an obscure case in the installer that could be solved in a different way? It's trivial enough to look at the boot method sysctl and skip the EFI update if we didn't boot EFI (and if by change that's not on all systems, it's easy enough to add it on all systems). I have no notion about why that wasn't considered, at least, before jumping in and taking people by surprise. Next time, talk to people first. That's the whole point of having review tools, mailing list and git blame. Warner From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:41:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4959656DFDF; Wed, 3 Mar 2021 15:41: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 4DrJC71bHMz3wLS; Wed, 3 Mar 2021 15:41: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 2821840E3; Wed, 3 Mar 2021 15:41: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 123FftdU084821; Wed, 3 Mar 2021 15:41:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123FftBC084820; Wed, 3 Mar 2021 15:41:55 GMT (envelope-from git) Date: Wed, 3 Mar 2021 15:41:55 GMT Message-Id: <202103031541.123FftBC084820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 2d379aed1e5c - releng/13.0 - copy_file_range(2): Fix for small values of input file offset and len 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 2d379aed1e5c52956c5257d286a781e9a32e68b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:41:55 -0000 The branch releng/13.0 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2d379aed1e5c52956c5257d286a781e9a32e68b3 commit 2d379aed1e5c52956c5257d286a781e9a32e68b3 Author: Rick Macklem AuthorDate: 2021-03-01 14:28:30 +0000 Commit: Rick Macklem CommitDate: 2021-03-03 15:40:39 +0000 copy_file_range(2): Fix for small values of input file offset and len r366302 broke copy_file_range(2) for small values of input file offset and len. It was possible for rem to be greater than len and then "len - rem" was a large value, since both variables are unsigned. Approved by: re (gjb) (cherry picked from commit a5f9fe2bab789f49e8b53da3a62dbd34725e23ea) --- sys/kern/vfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 71dd379558cb..9ea792833255 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3126,7 +3126,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, rem = *inoffp % blksize; if (rem > 0) rem = blksize - rem; - if (len - rem > blksize) + if (len > rem && len - rem > blksize) len = savlen = rounddown(len - rem, blksize) + rem; } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:49:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10EDC56E6E7; Wed, 3 Mar 2021 15:49:22 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrJMj5RQYz4R0g; Wed, 3 Mar 2021 15:49:21 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1614786559; bh=lzx5PnigGPPv45IYz6TZqodKZiy9l3w6Tr5zgyJutsg=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=fn/6422pvOsll4jVNDqNwbO2R/t2hj7dVNO0HQkID5AueKukBt9dKpsk/PtVdRzgD 0LhVaNEkDSMVJM/GYC2puH+2I5Bl8XPtv/Ls5DDz0oaqPMda2aDGxBSGHjzlWaVmJp SMAQDopvWWkxBNrw1wPBn/m0lXFp/AxmVE3jfmL4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from thor.intern.walstatt.dynvpn.de ([89.14.166.244]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mf0BG-1ljOZZ1Z0M-00gUAn; Wed, 03 Mar 2021 16:49:19 +0100 Date: Wed, 3 Mar 2021 16:48:46 +0100 From: "O. Hartmann" To: Andrew Turner Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c8db60c0673d - main - Split out the loader efifb setup to a new function Message-ID: <20210303164913.010b2f03@thor.intern.walstatt.dynvpn.de> In-Reply-To: <202103031426.123EQmU4082875@gitrepo.freebsd.org> References: <202103031426.123EQmU4082875@gitrepo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:BOf+zj3iuRQVsrrUL4MVf4RzBMNFgGD3Oj/QtVl5muUOlFkZ9oj z/xT8A06hvQR32hduh1kiB9FAryUK7JsMzVM0kYOgGMbjYCvjf1rxIe8wDRfgorrCOUSEk0 ZM/c8LuAS2biFDoVxVlw5Az2TP7L/Y9eIx2AgN1vxP0zTRj0qdaLKmd0Ms6+1poIQNKgGo9 bQRYzEu+lHWwfn/IuQaiQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:LNH2+Ne5JJU=:9IuhWkT/GFsZg584JupNXt P8V2pkI93uGE3pxpoGJjQQWI6WR024QE4PzI8yQ7AeSdcUaz7W0HAAJIndafoTsNr4ng3vMNS PqvlU58cooQKhfw1nwqOGGgRT/o0sH/hsK9FvRzzjerVbRLUO/i+NvBq3gRoCFRAnWnj55UOg DJKgJwZhJIJ5EINxGdoot5rPrWNIInA01UcfGJHX93ZWImrqWyEC9Yjtb78POCT6pGtVbTNhj opneB6xxxqqZO194mfmq0PWpU4DzAoQpgzZHvYNAkweeGS/vYLfSTwt8XZtSFoG7VRHyI/sP/ QuAogmc7RbdIAic9F30rBwvxOl/YH4S75ncqaZwGz2WU7TpXne+9LQtblonSGOAU8GNu8q+Tq +iqpiWD4UN4Xoua2IqnIwL4CEwyEbDCW69o8H4W91YStzFtPTvEms9mQg0NIrZfDYzmQpp/aQ CmcBiNo4YowEiYfMikejZ33cUtkKQfT10euO4k7rWLytuzP1UqSJUWe3q47V45e3vz1VGAN8v OOY52kYcyFNur/CpUn43kOckslj2PD5bpCG67zx34vkWQ7SnQ3ziwSztQj0nySBj+40vd/kb2 VV4tpBkD7BHwQcJqTW8h1WLnWoNqnyiaYrX1nUi0h89iaw12RjLLH7RrLbGaiaWVa20zs1pOt UNcgqBZ7haxZZL+5IQe3ZKrmDzK+lcC3KZM2E4ILgyZEn/ehlja9MFx8XGHvRnmK90u+8aK2R AhvT+gxUG2O4I8x+tMrT7jKnO3cUuszONUmFMoyjew54aDlQiKxZeMjm09wccb/pNN8Nb611j MAzAZzTx1wKnfx+A1hmPbgMYWnZKeiJPqMo2SOEXzcToQL3qkwuMHYqo9BtAwPpmqC5HjV2nr O0IApnZ+hgrroastqMCw== X-Rspamd-Queue-Id: 4DrJMj5RQYz4R0g X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:49:22 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIFdl ZCwgMyBNYXIgMjAyMSAxNDoyNjo0OCBHTVQNCkFuZHJldyBUdXJuZXIgPGFuZHJld0BGcmVlQlNE Lm9yZz4gc2NocmllYjoNCg0KPiBUaGUgYnJhbmNoIG1haW4gaGFzIGJlZW4gdXBkYXRlZCBieSBh bmRyZXc6DQo+IA0KPiBVUkw6IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9zcmMvY29tbWl0Lz9p ZD1jOGRiNjBjMDY3M2Q0YmI3YTNhM2UyYzA0MzgwNGUxZWQxMTA4YzJmDQo+IA0KPiBjb21taXQg YzhkYjYwYzA2NzNkNGJiN2EzYTNlMmMwNDM4MDRlMWVkMTEwOGMyZg0KPiBBdXRob3I6ICAgICBB bmRyZXcgVHVybmVyIDxhbmRyZXdARnJlZUJTRC5vcmc+DQo+IEF1dGhvckRhdGU6IDIwMjEtMDIt MjYgMTE6NDc6MzQgKzAwMDANCj4gQ29tbWl0OiAgICAgQW5kcmV3IFR1cm5lciA8YW5kcmV3QEZy ZWVCU0Qub3JnPg0KPiBDb21taXREYXRlOiAyMDIxLTAzLTAzIDE0OjE4OjAyICswMDAwDQo+IA0K PiAgICAgU3BsaXQgb3V0IHRoZSBsb2FkZXIgZWZpZmIgc2V0dXAgdG8gYSBuZXcgZnVuY3Rpb24N Cj4gICAgIA0KPiAgICAgVGhpcyBtYWtlcyBiaV9sb2FkX2VmaV9kYXRhIGNsZWFuZXIgdG8gYWRk IGNvbW1vbiBhY3BpIHNldHVwIGNvZGUuDQo+ICAgICANCj4gICAgIFJldmlld2VkIGJ5OiAgICBp bXAsIHRzb29tZQ0KPiAgICAgU3BvbnNvcmVkIGJ5OiAgIElubm92YXRlIFVLDQo+ICAgICBEaWZm ZXJlbnRpYWwgUmV2aXNpb246ICBodHRwczovL3Jldmlld3MuZnJlZWJzZC5vcmcvRDI4OTM2DQo+ IC0tLQ0KPiAgc3RhbmQvZWZpL2xvYWRlci9ib290aW5mby5jIHwgMjIgKysrKysrKysrKysrKysr KysrKysrKw0KPiAgMSBmaWxlIGNoYW5nZWQsIDIyIGluc2VydGlvbnMoKykNCj4gDQo+IGRpZmYg LS1naXQgYS9zdGFuZC9lZmkvbG9hZGVyL2Jvb3RpbmZvLmMgYi9zdGFuZC9lZmkvbG9hZGVyL2Jv b3RpbmZvLmMNCj4gaW5kZXggOTkyNDkwMWQyOWU2Li4zMjc3NTFlMzJmMGIgMTAwNjQ0DQo+IC0t LSBhL3N0YW5kL2VmaS9sb2FkZXIvYm9vdGluZm8uYw0KPiArKysgYi9zdGFuZC9lZmkvbG9hZGVy L2Jvb3RpbmZvLmMNCj4gQEAgLTI5OSw2ICsyOTksOSBAQCBiaV9sb2FkX2VmaV9kYXRhKHN0cnVj dCBwcmVsb2FkZWRfZmlsZSAqa2ZwLCBib29sIGV4aXRfYnMpDQo+ICAJYm9vbCBkb192bWFwOw0K PiAgDQo+ICAjaWYgZGVmaW5lZChfX2FtZDY0X18pIHx8IGRlZmluZWQoX19hYXJjaDY0X18pDQo+ ICtzdGF0aWMgdm9pZA0KPiArYmlfbG9hZF9lZmlmYihzdHJ1Y3QgcHJlbG9hZGVkX2ZpbGUgKmtm cCkNCj4gK3sNCj4gIAlzdHJ1Y3QgZWZpX2ZiIGVmaWZiOw0KPiAgDQo+ICAJZWZpZmIuZmJfYWRk ciA9IGdmeF9zdGF0ZS50Z19mYi5mYl9hZGRyOw0KPiBAQCAtMzIxLDYgKzMyNCwyNSBAQCBiaV9s b2FkX2VmaV9kYXRhKHN0cnVjdCBwcmVsb2FkZWRfZmlsZSAqa2ZwLCBib29sIGV4aXRfYnMpDQo+ ICANCj4gIAlpZiAoZWZpZmIuZmJfYWRkciAhPSAwKQ0KPiAgCQlmaWxlX2FkZG1ldGFkYXRhKGtm cCwgTU9ESU5GT01EX0VGSV9GQiwgc2l6ZW9mKGVmaWZiKSwgJmVmaWZiKTsNCj4gK30NCj4gKyNl bmRpZg0KPiArDQo+ICtzdGF0aWMgaW50DQo+ICtiaV9sb2FkX2VmaV9kYXRhKHN0cnVjdCBwcmVs b2FkZWRfZmlsZSAqa2ZwLCBib29sIGV4aXRfYnMpDQo+ICt7DQo+ICsJRUZJX01FTU9SWV9ERVND UklQVE9SICptbTsNCj4gKwlFRklfUEhZU0lDQUxfQUREUkVTUyBhZGRyID0gMDsNCj4gKwlFRklf U1RBVFVTIHN0YXR1czsNCj4gKwljb25zdCBjaGFyICplZmlfbm92bWFwOw0KPiArCXNpemVfdCBl ZmlzejsNCj4gKwlVSU5UTiBlZmlfbWFwa2V5Ow0KPiArCVVJTlROIGRzeiwgcGFnZXMsIHJldHJ5 LCBzejsNCj4gKwlVSU5UMzIgbW12ZXI7DQo+ICsJc3RydWN0IGVmaV9tYXBfaGVhZGVyICplZmlo ZHI7DQo+ICsJYm9vbCBkb192bWFwOw0KPiArDQo+ICsjaWYgZGVmaW5lZChfX2FtZDY0X18pIHx8 IGRlZmluZWQoX19hYXJjaDY0X18pDQo+ICsJYmlfbG9hZF9lZmlmYihrZnApOw0KPiAgI2VuZGlm DQo+ICANCj4gIAlkb192bWFwID0gdHJ1ZTsNCj4gX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX18NCj4gZGV2LWNvbW1pdHMtc3JjLW1haW5AZnJlZWJzZC5vcmcg bWFpbGluZyBsaXN0DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5vcmcvbWFpbG1hbi9saXN0aW5m by9kZXYtY29tbWl0cy1zcmMtbWFpbg0KPiBUbyB1bnN1YnNjcmliZSwgc2VuZCBhbnkgbWFpbCB0 byAiZGV2LWNvbW1pdHMtc3JjLW1haW4tdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNClRoZSBj b21taXQgc2VlbXMgdG8gcmVuZGVyICJtYWtlIGJ1aWxkd29ybGQiIGZhaWxpbmcgd2l0aCB0aGUg ZXJyb3Igc2hvd24gYmVsb3c6DQoNClsuLi5dDQotIC0tLSBhbGxfc3ViZGlyX3N0YW5kIC0tLQ0K LSAtLS0gYm9vdGluZm8ubyAtLS0NCmNjIC10YXJnZXQgeDg2XzY0LXVua25vd24tZnJlZWJzZDE0 LjAgLS1zeXNyb290PS91c3Ivb2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQvdG1wDQotIC1CL3Vzci9v YmovdXNyL3NyYy9hbWQ2NC5hbWQ2NC90bXAvdXNyL2JpbiAgLU8yIC1waXBlIC1PMyAtZm5vLWNv bW1vbiAtbWFyY2g9bmF0aXZlICAtV2Zvcm1hdA0KLSAtZnNob3J0LXdjaGFyIC1tbm8tcmVkLXpv bmUgLW5vc3RkaW5jICAgIC1JL3Vzci9vYmovdXNyL3NyYy9hbWQ2NC5hbWQ2NC9zdGFuZC9saWJz YQ0KLSAtSS91c3Ivc3JjL3N0YW5kL2xpYnNhIC1EX1NUQU5EQUxPTkUgLUkvdXNyL3NyYy9zeXMg LURkb3VibGU9amFnZ2VkLWxpdHRsZS1waWxsDQotIC1EZmxvYXQ9ZmxvYXR5LW1jZmxvYXRmYWNl IC1mZnVuY3Rpb24tc2VjdGlvbnMgLWZkYXRhLXNlY3Rpb25zIC1ETE9BREVSX0dFTElfU1VQUE9S VA0KLSAtSS91c3Ivc3JjL3N0YW5kL2xpYnNhL2dlbGkgLURMT0FERVJfRElTS19TVVBQT1JUIC1m ZnJlZXN0YW5kaW5nIC1tbm8tbW14IC1tbm8tc3NlIC1tbm8tYXZ4DQotIC1tbm8tYXZ4MiAtbXNv ZnQtZmxvYXQgLWZQSUMgLW1uby1yZWQtem9uZSAtbW5vLXJlbGF4IC1JLiAtSWluY2x1ZGUNCi0g LUkvdXNyL3NyYy9zdGFuZC9lZmkvbG9hZGVyXzR0aC8uLi9sb2FkZXIgLUkvdXNyL3NyYy9zdGFu ZC9saWJzYS96ZnMNCi0gLUkvdXNyL3NyYy9zeXMvY29udHJpYi9vcGVuemZzL2luY2x1ZGUgLUkv dXNyL3NyYy9zeXMvY29udHJpYi9vcGVuemZzL2luY2x1ZGUvb3MvZnJlZWJzZC96ZnMNCi0gLURF RklfWkZTX0JPT1QgLWZQSUMgLUkvdXNyL3NyYy9zdGFuZC9lZmkvbG9hZGVyXzR0aA0KLSAtSS91 c3Ivc3JjL3N0YW5kL2VmaS9sb2FkZXJfNHRoL2FyY2gvYW1kNjQgLUkvdXNyL3NyYy9zdGFuZC9l ZmkvaW5jbHVkZQ0KLSAtSS91c3Ivc3JjL3N0YW5kL2VmaS9pbmNsdWRlL2FtZDY0IC1JL3Vzci9z cmMvc3lzL2NvbnRyaWIvZGV2L2FjcGljYS9pbmNsdWRlDQotIC1JL3Vzci9zcmMvc3RhbmQvaTM4 Ni9saWJpMzg2IC1ERUZJIC1ERUZJX1NFQ1VSRUJPT1QgLUkvdXNyL3NyYy9zdGFuZC9jb21tb24g LWZQSUMNCi0gLUkvdXNyL3NyYy9zdGFuZC9maWNsIC1JL3Vzci9zcmMvc3RhbmQvZmljbC9hbWQ2 NCAtSS91c3Ivc3JjL3N0YW5kL2NvbW1vbiAtREJGX0RJQ1RTSVpFPTMwMDAwDQotIC1ETE9BREVS X1ZFUklFWEVDIC1JL3Vzci9zcmMvbGliL2xpYnNlY3VyZWJvb3QvaCAtRExPQURFUl9WRVJJRVhF Qw0KLSAtSS91c3Ivc3JjL2xpYi9saWJzZWN1cmVib290L2ggLURMT0FERVJfVkVSSUVYRUNfVkVD VFggLURMT0FERVJfTVNET1NfU1VQUE9SVA0KLSAtRExPQURFUl9VRlNfU1VQUE9SVCAtRExPQURF Ul9ORVRfU1VQUE9SVCAtRExPQURFUl9HUFRfU1VQUE9SVCAtRExPQURFUl9NQlJfU1VQUE9SVA0K LSAtRExPQURFUl9aRlNfU1VQUE9SVCAtSS91c3Ivc3JjL3N0YW5kL2xpYnNhL3pmcyAtSS91c3Iv c3JjL3N5cy9jZGRsL2Jvb3QvemZzDQotIC1JL3Vzci9zcmMvc3lzL2NkZGwvY29udHJpYi9vcGVu c29sYXJpcy91dHMvY29tbW9uIC1ETkRFQlVHIC1mUElFIC1NRCAgLU1GLmRlcGVuZC5ib290aW5m by5vDQotIC1NVGJvb3RpbmZvLm8gLXN0ZD1nbnU5OSAtV25vLWZvcm1hdC16ZXJvLWxlbmd0aCAt V3N5c3RlbS1oZWFkZXJzIC1Xbm8tcG9pbnRlci1zaWduDQotIC1Xbm8tZW1wdHktYm9keSAtV25v LXN0cmluZy1wbHVzLWludCAtV25vLXVudXNlZC1jb25zdC12YXJpYWJsZSAtV25vLXRhdXRvbG9n aWNhbC1jb21wYXJlDQotIC1Xbm8tdW51c2VkLXZhbHVlIC1Xbm8tcGFyZW50aGVzZXMtZXF1YWxp dHkgLVduby11bnVzZWQtZnVuY3Rpb24gLVduby1lbnVtLWNvbnZlcnNpb24NCi0gLVduby11bnVz ZWQtbG9jYWwtdHlwZWRlZiAtV25vLWFkZHJlc3Mtb2YtcGFja2VkLW1lbWJlciAtV25vLXN3aXRj aCAtV25vLXN3aXRjaC1lbnVtDQotIC1Xbm8ta25yLXByb21vdGVkLXBhcmFtZXRlciAtV25vLXBh cmVudGhlc2VzICAtT3ogLVF1bnVzZWQtYXJndW1lbnRzIC1JL3Vzci9zcmMvc3lzL3Rla2VuDQot IC1JL3Vzci9zcmMvY29udHJpYi9wbmdsaXRlICAgLWMgL3Vzci9zcmMvc3RhbmQvZWZpL2xvYWRl cl80dGgvLi4vbG9hZGVyL2Jvb3RpbmZvLmMgLW8NCmJvb3RpbmZvLm8gLS0tIGFsbF9zdWJkaXJf c2hhcmUgLS0tIC0tLSBhbGxfc3ViZGlyX3NoYXJlL2kxOG4vY3NtYXBwZXIvQklHNSAtLS0gPT09 Pg0Kc2hhcmUvaTE4bi9jc21hcHBlci9CSUc1IChhbGwpIC0tLSBhbGxfc3ViZGlyX3NoYXJlL2kx OG4vY3NtYXBwZXIvQ05TIC0tLSA9PT0+DQpzaGFyZS9pMThuL2NzbWFwcGVyL0NOUyAoYWxsKSAt LS0gYWxsX3N1YmRpcl9zaGFyZS9pMThuL2NzbWFwcGVyL0NQIC0tLSA9PT0+DQpzaGFyZS9pMThu L2NzbWFwcGVyL0NQIChhbGwpIC0tLSBhbGxfc3ViZGlyX3N0YW5kIC0tLQ0KL3Vzci9zcmMvc3Rh bmQvZWZpL2xvYWRlcl80dGgvLi4vbG9hZGVyL2Jvb3RpbmZvLmM6MzA0OjE6IGVycm9yOiBmdW5j dGlvbiBkZWZpbml0aW9uIGlzIG5vdA0KYWxsb3dlZCBoZXJlIC0tLSBhbGxfc3ViZGlyX3NoYXJl IC0tLSAtLS0gYWxsX3N1YmRpcl9zaGFyZS9leGFtcGxlcyAtLS0gLS0tDQphbGxfc3ViZGlyX3No YXJlL2V4YW1wbGVzL2lwZmlsdGVyIC0tLSA9PT0+IHNoYXJlL2V4YW1wbGVzL2lwZmlsdGVyIChh bGwpDQoNCm1ha2VbMV06IHN0b3BwZWQgaW4gL3Vzci9zcmMNCg0KDQotIC0tIA0KTy4gSGFydG1h bm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVuZyBvZGVyIMOcYmVybWl0dGx1bmcgbWVp bmVyIERhdGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIgZsO8ciBkaWUgTWFya3QtIG9kZXIgTWVp bnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNHKS4NCi0tLS0tQkVHSU4gUEdQIFNJR05B VFVSRS0tLS0tDQoNCmlIVUVBUllJQUIwV0lRU3k4SUJ4QVBEa3FWQmFUSjQ0TjFaWlBiYTVSd1VD WUQrditRQUtDUkE0TjFaWlBiYTUNClJ5eVlBUDBmanhjVVRsV3M4dmNUZExYNUZCcFljd1Z2SDN0 Zzd4OThpNEZ5ekJMdExnRDdCbG0wb1hYWkJKTnANCjZnOTZwUWVxVi85VUVDQTZrRStyZEF1N2Vz UkROQWc9DQo9ZXkwOA0KLS0tLS1FTkQgUEdQIFNJR05BVFVSRS0tLS0tDQo= From owner-dev-commits-src-all@freebsd.org Wed Mar 3 15:55:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C77256E7FD; Wed, 3 Mar 2021 15:55:18 +0000 (UTC) (envelope-from nwhitehorn@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 4DrJVZ0p1kz4Rqx; Wed, 3 Mar 2021 15:55:18 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:cc7b:682b:f804:9afd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id BA41522D98; Wed, 3 Mar 2021 15:55:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) To: Warner Losh Cc: Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> From: Nathan Whitehorn Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. Message-ID: <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> Date: Wed, 3 Mar 2021 10:55:17 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 15:55:18 -0000 On 3/3/21 10:38 AM, Warner Losh wrote: > > > On Wed, Mar 3, 2021 at 7:13 AM Nathan Whitehorn=20 > > wrote: > > > > On 3/3/21 9:05 AM, Brandon Bergren wrote: > > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: > >> What am I missing here?=C2=A0 One place I am being told this is = run in > >> an environment that may not even be an EFI booted system, and in= > >> another place it is being used as a test if something is mounted= > >> on it, which should only be true on an EFI booted system. > > That the script in question is a generic script that runs as > part of bsdinstall on every platform and has to be universal. > > > > The actual *problem* here is that > usr.sbin/bsdinstall/scripts/bootconfig has a default case that is > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *)=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 die "Unsupported arch $(uname -m) for > UEFI install" > > > > which then causes the main script to bail out, leaving the > system in a half-installed state. > > > > If that had just been an exit 0 this would have never been a > problem, I suppose. > > > > Before the original change that broke this, there was a check > that the script was not running on powerpc or mips platforms > before running the efi bits, but this got taken out. > > > > Well, incidentally. The bootconfig script needs to know if there > is an > ESP it should configure, but the signalling mechanism (the > presence of > the ESP mount point) was being broken by mtree making that director= y > unconditionally even on systems that don't use EFI. So then > bootconfig > tried to set it up, but failed later on, because there was no EFI > loader > to set up. The mtree change makes the ESP mount point only exist on= > systems with an ESP. > > > So you made a unilateral change, without discussion of the bigger=20 > design, to something without even asking the original person who made=20 > the change to mtree about it for what sounds like an obscure case in=20 > the installer that could be solved in a different way? It's trivial=20 > enough to look at the boot method sysctl and skip the EFI update if we = > didn't boot EFI (and if by change that's not on all systems, it's easy = > enough to add it on all systems). I have no notion about why that=20 > wasn't considered, at least, before jumping in and taking people by=20 > surprise. > > Next time, talk to people first. That's the whole point of having=20 > review tools, mailing list and git blame. > > Warner This method of testing was in the original review here posted on Feb.=20 23: https://reviews.freebsd.org/D28897 The description of the test procedure you're objecting to was even in=20 the summary! Then we had a discussion by email about the change to mtree = on the committers list on Feb. 28 to resolve a bug affecting PowerPC in=20 the patch reviewed and approved by you. I then waited several days and=20 had a long thread for several days on the mailing list about the=20 approach. coming up with this short patch -- again, as a bug fix to a=20 reviewed approach. We can change the logic -- that's fine! But, to paraphrase, the reason=20 we have reviews is so people like you can look at the review and note=20 these kinds of problems when they are reviewed, not after the commit=20 goes in. There's a significant amount of whiplash when you do get=20 patches reviewed, approved, and then the person who reviewed and=20 approved them accuses you of "taking people by surprise". The installer *does* mount the partition in advance, so checking whether = there is a mounted file system is a perfectly reasonable test to do. We=20 could also check fstab. I would like to understand what is actually=20 wrong here first, though. Especially after this misfire -- which is=20 problematic for reasons that are still not clear to me, since there are=20 a number of standard directories in hier(7) not in mtree -- I want to=20 make sure we actually do have consensus about what is changing and why. -Nathan From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:11:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C323856F085; Wed, 3 Mar 2021 16:11: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 4DrJrr5DYXz4Str; Wed, 3 Mar 2021 16:11: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 A4F054945; Wed, 3 Mar 2021 16:11: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 123GB8Rk024815; Wed, 3 Mar 2021 16:11:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123GB8xe024814; Wed, 3 Mar 2021 16:11:08 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:11:08 GMT Message-Id: <202103031611.123GB8xe024814@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: 622d17da46eb - main - arm64: mv_ap806_gicp: Fix spi_ranges_cnt 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: 622d17da46eb360c3d6847e4da8dbb166b775d14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:11:08 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=622d17da46eb360c3d6847e4da8dbb166b775d14 commit 622d17da46eb360c3d6847e4da8dbb166b775d14 Author: Zyta Szpak AuthorDate: 2021-02-19 14:31:45 +0000 Commit: Marcin Wojtas CommitDate: 2021-03-03 16:08:12 +0000 arm64: mv_ap806_gicp: Fix spi_ranges_cnt Previously the spi_ranges_cnt stored the table size in bytes instead of the number of elements. Fix that. Reviewed by: mmel Submitted by: Zyta Szpak Obtained from: Semihalf Sponsored by: Marvell --- sys/arm/mv/mv_ap806_gicp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm/mv/mv_ap806_gicp.c b/sys/arm/mv/mv_ap806_gicp.c index da93a32f2b23..0a1a69707956 100644 --- a/sys/arm/mv/mv_ap806_gicp.c +++ b/sys/arm/mv/mv_ap806_gicp.c @@ -107,8 +107,8 @@ mv_ap806_gicp_attach(device_t dev) return (ENXIO); } - sc->spi_ranges_cnt = OF_getencprop_alloc(node, "marvell,spi-ranges", - (void **)&sc->spi_ranges); + sc->spi_ranges_cnt = OF_getencprop_alloc_multi(node, "marvell,spi-ranges", + sizeof(*sc->spi_ranges), (void **)&sc->spi_ranges); xref = OF_xref_from_node(node); if (intr_pic_register(dev, xref) == NULL) { @@ -153,7 +153,7 @@ mv_ap806_gicp_convert_map_data(struct mv_ap806_gicp_softc *sc, sc->parent_map_data->cells[2] = irq_type; /* Map the interrupt number to SPI number */ - for (i = 0; i < sc->spi_ranges_cnt / 2; i += 2) { + for (i = 0; i < sc->spi_ranges_cnt; i += 2) { if (irq_num < sc->spi_ranges[i + 1]) { irq_num += sc->spi_ranges[i]; break; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:15:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A771256F05A; Wed, 3 Mar 2021 16:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrJyR1gtCz4TL5; Wed, 3 Mar 2021 16:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CA824C9C; Wed, 3 Mar 2021 16:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 123GFxiQ028934; Wed, 3 Mar 2021 16:15:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123GFxgQ028933; Wed, 3 Mar 2021 16:15:59 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:15:59 GMT Message-Id: <202103031615.123GFxgQ028933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 0ae676239927 - stable/13 - armv8crypto: add missing newline MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0ae67623992788538b90b7c0e2882c4aa645a81f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:15:59 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=0ae67623992788538b90b7c0e2882c4aa645a81f commit 0ae67623992788538b90b7c0e2882c4aa645a81f Author: Elliott Mitchell AuthorDate: 2021-02-28 20:03:44 +0000 Commit: Mitchell Horne CommitDate: 2021-03-03 16:14:51 +0000 armv8crypto: add missing newline The missing newline mildly garbles boot-time messages and this can be troublesome if you need those. Reported by: Mike Karels (mike@karels.net) Reviewed By: gonzo (cherry picked from commit 530d38441d55b7ac62ebae6ac8ea76903a4a3b0c) --- sys/crypto/armv8/armv8_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c index be39168d50f3..24f6eff5608d 100644 --- a/sys/crypto/armv8/armv8_crypto.c +++ b/sys/crypto/armv8/armv8_crypto.c @@ -122,7 +122,7 @@ armv8_crypto_probe(device_t dev) default: break; case ID_AA64ISAR0_AES_NONE: - device_printf(dev, "CPU lacks AES instructions"); + device_printf(dev, "CPU lacks AES instructions\n"); break; } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:19:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68A6D56F4E4; Wed, 3 Mar 2021 16:19:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrK2Y2Z7Lz4V0d; Wed, 3 Mar 2021 16:19:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B0294C9D; Wed, 3 Mar 2021 16:19:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 123GJXaF029578; Wed, 3 Mar 2021 16:19:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123GJXKW029577; Wed, 3 Mar 2021 16:19:33 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:19:33 GMT Message-Id: <202103031619.123GJXKW029577@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: 773fc43fb060 - main - Revert "Split out the loader efifb setup to a new function" 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: 773fc43fb060149f8e59c183e5da79feaf118c8c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:19:33 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=773fc43fb060149f8e59c183e5da79feaf118c8c commit 773fc43fb060149f8e59c183e5da79feaf118c8c Author: Andrew Turner AuthorDate: 2021-03-03 16:09:00 +0000 Commit: Andrew Turner CommitDate: 2021-03-03 16:10:12 +0000 Revert "Split out the loader efifb setup to a new function" It was broken by a rebase. Revert until it can be fixed. This reverts commit c8db60c0673d4bb7a3a3e2c043804e1ed1108c2f. --- stand/efi/loader/bootinfo.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 327751e32f0b..9924901d29e6 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -299,9 +299,6 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) bool do_vmap; #if defined(__amd64__) || defined(__aarch64__) -static void -bi_load_efifb(struct preloaded_file *kfp) -{ struct efi_fb efifb; efifb.fb_addr = gfx_state.tg_fb.fb_addr; @@ -324,25 +321,6 @@ bi_load_efifb(struct preloaded_file *kfp) if (efifb.fb_addr != 0) file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), &efifb); -} -#endif - -static int -bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) -{ - EFI_MEMORY_DESCRIPTOR *mm; - EFI_PHYSICAL_ADDRESS addr = 0; - EFI_STATUS status; - const char *efi_novmap; - size_t efisz; - UINTN efi_mapkey; - UINTN dsz, pages, retry, sz; - UINT32 mmver; - struct efi_map_header *efihdr; - bool do_vmap; - -#if defined(__amd64__) || defined(__aarch64__) - bi_load_efifb(kfp); #endif do_vmap = true; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:20:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC58C56F926; Wed, 3 Mar 2021 16:20: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 4DrK3k5V8Sz4VLl; Wed, 3 Mar 2021 16:20: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 AF14F47FB; Wed, 3 Mar 2021 16:20: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 123GKYRr037218; Wed, 3 Mar 2021 16:20:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123GKYCs037217; Wed, 3 Mar 2021 16:20:34 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:20:34 GMT Message-Id: <202103031620.123GKYCs037217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chris Rees Subject: git: 25352f9fda43 - main - Minor grammar nit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25352f9fda43f6ad112d78a8a6e00b77259802d7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:20:34 -0000 The branch main has been updated by crees (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=25352f9fda43f6ad112d78a8a6e00b77259802d7 commit 25352f9fda43f6ad112d78a8a6e00b77259802d7 Author: Andreas Bjornestad AuthorDate: 2021-03-03 16:17:26 +0000 Commit: Chris Rees CommitDate: 2021-03-03 16:20:29 +0000 Minor grammar nit PR: docs/253975 --- lib/geom/part/gpart.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/geom/part/gpart.8 b/lib/geom/part/gpart.8 index 378971cbd773..d27844f709e9 100644 --- a/lib/geom/part/gpart.8 +++ b/lib/geom/part/gpart.8 @@ -169,7 +169,7 @@ to be multiple of value. .It Fl b Ar start The logical block address where the partition will begin. -A SI unit suffix is allowed. +An SI unit suffix is allowed. .It Fl f Ar flags Additional operational flags. See the section entitled @@ -188,7 +188,7 @@ partition labels. .It Fl s Ar size Create a partition of size .Ar size . -A SI unit suffix is allowed. +An SI unit suffix is allowed. .It Fl t Ar type Create a partition of type .Ar type . @@ -424,7 +424,7 @@ about its use. Specifies the index of the partition to be resized. .It Fl s Ar size Specifies the new size of the partition, in logical blocks. -A SI unit suffix is allowed. +An SI unit suffix is allowed. .El .\" ==== RESTORE ==== .It Cm restore From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:21:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CC6656FA3D; Wed, 3 Mar 2021 16:21:58 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4DrK5K6r7Kz4VNk; Wed, 3 Mar 2021 16:21:57 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [192.168.42.21] (cpc91232-cmbg18-2-0-cust554.5-4.cable.virginm.net [82.2.126.43]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 75F054E716; Wed, 3 Mar 2021 16:21:24 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: git: c8db60c0673d - main - Split out the loader efifb setup to a new function From: Andrew Turner In-Reply-To: <20210303164913.010b2f03@thor.intern.walstatt.dynvpn.de> Date: Wed, 3 Mar 2021 16:21:19 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6989F292-2908-4E97-A50E-19C80648A6F8@freebsd.org> References: <202103031426.123EQmU4082875@gitrepo.freebsd.org> <20210303164913.010b2f03@thor.intern.walstatt.dynvpn.de> To: "O. Hartmann" X-Mailer: Apple Mail (2.3445.104.17) X-Rspamd-Queue-Id: 4DrK5K6r7Kz4VNk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:21:58 -0000 > On 3 Mar 2021, at 15:48, O. Hartmann wrote: >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 >=20 > Am Wed, 3 Mar 2021 14:26:48 GMT > Andrew Turner schrieb: >=20 >> The branch main has been updated by andrew: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc8db60c0673d4bb7a3a3e2c043804e1e= d1108c2f >>=20 >> commit c8db60c0673d4bb7a3a3e2c043804e1ed1108c2f >> Author: Andrew Turner >> AuthorDate: 2021-02-26 11:47:34 +0000 >> Commit: Andrew Turner >> CommitDate: 2021-03-03 14:18:02 +0000 >>=20 >> Split out the loader efifb setup to a new function >>=20 >> This makes bi_load_efi_data cleaner to add common acpi setup code. >>=20 >> Reviewed by: imp, tsoome >> Sponsored by: Innovate UK >> Differential Revision: https://reviews.freebsd.org/D28936 >> --- >> stand/efi/loader/bootinfo.c | 22 ++++++++++++++++++++++ >> 1 file changed, 22 insertions(+) >>=20 >> diff --git a/stand/efi/loader/bootinfo.c = b/stand/efi/loader/bootinfo.c >> index 9924901d29e6..327751e32f0b 100644 >> --- a/stand/efi/loader/bootinfo.c >> +++ b/stand/efi/loader/bootinfo.c >> @@ -299,6 +299,9 @@ bi_load_efi_data(struct preloaded_file *kfp, bool = exit_bs) >> bool do_vmap; >>=20 >> #if defined(__amd64__) || defined(__aarch64__) >> +static void >> +bi_load_efifb(struct preloaded_file *kfp) >> +{ >> struct efi_fb efifb; >>=20 >> efifb.fb_addr =3D gfx_state.tg_fb.fb_addr; >> @@ -321,6 +324,25 @@ bi_load_efi_data(struct preloaded_file *kfp, = bool exit_bs) >>=20 >> if (efifb.fb_addr !=3D 0) >> file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), = &efifb); >> +} >> +#endif >> + >> +static int >> +bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) >> +{ >> + EFI_MEMORY_DESCRIPTOR *mm; >> + EFI_PHYSICAL_ADDRESS addr =3D 0; >> + EFI_STATUS status; >> + const char *efi_novmap; >> + size_t efisz; >> + UINTN efi_mapkey; >> + UINTN dsz, pages, retry, sz; >> + UINT32 mmver; >> + struct efi_map_header *efihdr; >> + bool do_vmap; >> + >> +#if defined(__amd64__) || defined(__aarch64__) >> + bi_load_efifb(kfp); >> #endif >>=20 >> do_vmap =3D true; >> _______________________________________________ >> dev-commits-src-main@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >> To unsubscribe, send any mail to = "dev-commits-src-main-unsubscribe@freebsd.org" >=20 > The commit seems to render "make buildworld" failing with the error = shown below: >=20 > [...] > - --- all_subdir_stand --- > - --- bootinfo.o --- > cc -target x86_64-unknown-freebsd14.0 = --sysroot=3D/usr/obj/usr/src/amd64.amd64/tmp > - -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -O3 = -fno-common -march=3Dnative -Wformat > - -fshort-wchar -mno-red-zone -nostdinc = -I/usr/obj/usr/src/amd64.amd64/stand/libsa > - -I/usr/src/stand/libsa -D_STANDALONE -I/usr/src/sys = -Ddouble=3Djagged-little-pill > - -Dfloat=3Dfloaty-mcfloatface -ffunction-sections -fdata-sections = -DLOADER_GELI_SUPPORT > - -I/usr/src/stand/libsa/geli -DLOADER_DISK_SUPPORT -ffreestanding = -mno-mmx -mno-sse -mno-avx > - -mno-avx2 -msoft-float -fPIC -mno-red-zone -mno-relax -I. -Iinclude > - -I/usr/src/stand/efi/loader_4th/../loader -I/usr/src/stand/libsa/zfs > - -I/usr/src/sys/contrib/openzfs/include = -I/usr/src/sys/contrib/openzfs/include/os/freebsd/zfs > - -DEFI_ZFS_BOOT -fPIC -I/usr/src/stand/efi/loader_4th > - -I/usr/src/stand/efi/loader_4th/arch/amd64 = -I/usr/src/stand/efi/include > - -I/usr/src/stand/efi/include/amd64 = -I/usr/src/sys/contrib/dev/acpica/include > - -I/usr/src/stand/i386/libi386 -DEFI -DEFI_SECUREBOOT = -I/usr/src/stand/common -fPIC > - -I/usr/src/stand/ficl -I/usr/src/stand/ficl/amd64 = -I/usr/src/stand/common -DBF_DICTSIZE=3D30000 > - -DLOADER_VERIEXEC -I/usr/src/lib/libsecureboot/h -DLOADER_VERIEXEC > - -I/usr/src/lib/libsecureboot/h -DLOADER_VERIEXEC_VECTX = -DLOADER_MSDOS_SUPPORT > - -DLOADER_UFS_SUPPORT -DLOADER_NET_SUPPORT -DLOADER_GPT_SUPPORT = -DLOADER_MBR_SUPPORT > - -DLOADER_ZFS_SUPPORT -I/usr/src/stand/libsa/zfs = -I/usr/src/sys/cddl/boot/zfs > - -I/usr/src/sys/cddl/contrib/opensolaris/uts/common -DNDEBUG -fPIE = -MD -MF.depend.bootinfo.o > - -MTbootinfo.o -std=3Dgnu99 -Wno-format-zero-length -Wsystem-headers = -Wno-pointer-sign > - -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable = -Wno-tautological-compare > - -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function = -Wno-enum-conversion > - -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch = -Wno-switch-enum > - -Wno-knr-promoted-parameter -Wno-parentheses -Oz -Qunused-arguments = -I/usr/src/sys/teken > - -I/usr/src/contrib/pnglite -c = /usr/src/stand/efi/loader_4th/../loader/bootinfo.c -o > bootinfo.o --- all_subdir_share --- --- = all_subdir_share/i18n/csmapper/BIG5 --- =3D=3D=3D> > share/i18n/csmapper/BIG5 (all) --- all_subdir_share/i18n/csmapper/CNS = --- =3D=3D=3D> > share/i18n/csmapper/CNS (all) --- all_subdir_share/i18n/csmapper/CP = --- =3D=3D=3D> > share/i18n/csmapper/CP (all) --- all_subdir_stand --- > /usr/src/stand/efi/loader_4th/../loader/bootinfo.c:304:1: error: = function definition is not > allowed here --- all_subdir_share --- --- all_subdir_share/examples = --- --- > all_subdir_share/examples/ipfilter --- =3D=3D=3D> = share/examples/ipfilter (all) >=20 > make[1]: stopped in /usr/src It looks like it might have been broken by a rebase. I=E2=80=99ve = reverted until I have time to fix. Andrew From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:28:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68E6D56FBE2; Wed, 3 Mar 2021 16:28: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 4DrKDl2W1Qz4Vsv; Wed, 3 Mar 2021 16:28: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 48C284F12; Wed, 3 Mar 2021 16:28: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 123GSNk7043051; Wed, 3 Mar 2021 16:28:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123GSNc2043050; Wed, 3 Mar 2021 16:28:23 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:28:23 GMT Message-Id: <202103031628.123GSNc2043050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 3664067ea91a - releng/13.0 - nfsclient: fix panic in cache_enter_time() 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 3664067ea91a5484e0f75c9938d559ec1134a565 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:28:23 -0000 The branch releng/13.0 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3664067ea91a5484e0f75c9938d559ec1134a565 commit 3664067ea91a5484e0f75c9938d559ec1134a565 Author: Rick Macklem AuthorDate: 2021-02-28 01:54:05 +0000 Commit: Rick Macklem CommitDate: 2021-03-03 16:27:06 +0000 nfsclient: fix panic in cache_enter_time() Juraj Lutter (otis@) reported a panic "dvp != vp not true" in cache_enter_time() called from the NFS client's nfsrpc_readdirplus() function. This is specific to an NFSv3 mount with the "rdirplus" mount option. Unlike NFSv4, NFSv3 replies to ReaddirPlus includes entries for the current directory. This trivial patch avoids doing a cache_enter_time() call for the current directory to avoid the panic. Approved by: re (gjb) (cherry picked from commit 3fe2c68ba20fb3365ef91e0b85f88237b5369f38) --- sys/fs/nfsclient/nfs_clrpcops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index b4f2d5301d13..c95d4dc58e7a 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3761,6 +3761,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ndp->ni_vp = newvp; NFSCNHASH(cnp, HASHINIT); if (cnp->cn_namelen <= NCHNAMLEN && + ndp->ni_dvp != ndp->ni_vp && (newvp->v_type != VDIR || dctime.tv_sec != 0)) { cache_enter_time(ndp->ni_dvp, From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:39:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4E3F56FFF6; Wed, 3 Mar 2021 16:39: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 4DrKT14p87z4WvM; Wed, 3 Mar 2021 16:39: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 97A7D519B; Wed, 3 Mar 2021 16:39: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 123Gd1Tv056029; Wed, 3 Mar 2021 16:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123Gd1l7056028; Wed, 3 Mar 2021 16:39:01 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:39:01 GMT Message-Id: <202103031639.123Gd1l7056028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chris Rees Subject: git: 29358694281f - main - crontab.5: Correct claims on ranges and names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29358694281ffa12c7dc8b94f09a9a146579fe6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:39:01 -0000 The branch main has been updated by crees (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=29358694281ffa12c7dc8b94f09a9a146579fe6e commit 29358694281ffa12c7dc8b94f09a9a146579fe6e Author: Chris Rees AuthorDate: 2021-03-03 16:35:45 +0000 Commit: Chris Rees CommitDate: 2021-03-03 16:35:45 +0000 crontab.5: Correct claims on ranges and names Ranges use the function get_number, which means that ranges of names are supported and indeed always have been, righ back to the initial import. PR: docs/253969 Reported by: Ben Bullock --- usr.sbin/cron/crontab/crontab.5 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/cron/crontab/crontab.5 b/usr.sbin/cron/crontab/crontab.5 index 44c3c3a36f0f..0e48a0d804f4 100644 --- a/usr.sbin/cron/crontab/crontab.5 +++ b/usr.sbin/cron/crontab/crontab.5 @@ -203,8 +203,7 @@ Names can also be used for the ``month'' and ``day of week'' fields. Use the first three letters of the particular day or month (case does not matter). -Ranges or -lists of names are not allowed. +Ranges and lists are also allowed. .Pp The ``sixth'' field (the rest of the line) specifies the command to be run. From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:52:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59399548E02; Wed, 3 Mar 2021 16: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 4DrKmm27q9z4YJQ; Wed, 3 Mar 2021 16: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 3C42B516E; Wed, 3 Mar 2021 16: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 123Gqevd081504; Wed, 3 Mar 2021 16: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 123GqeFq081503; Wed, 3 Mar 2021 16:52:40 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:52:40 GMT Message-Id: <202103031652.123GqeFq081503@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: f2f24008a2b1 - main - Cirrus-CI: Add more information to help track down disk full issues 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: f2f24008a2b1b3c7a1c4b75e9b9c2d0f08abc27b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:52:40 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f2f24008a2b1b3c7a1c4b75e9b9c2d0f08abc27b commit f2f24008a2b1b3c7a1c4b75e9b9c2d0f08abc27b Author: Ed Maste AuthorDate: 2021-03-01 21:19:01 +0000 Commit: Ed Maste CommitDate: 2021-03-03 16:51:08 +0000 Cirrus-CI: Add more information to help track down disk full issues Execute df(1) before and after the build (reporting in MiB for consistency), and du(1) of /usr/obj. Also include the uname. --- .cirrus.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5e1b9fa3f9ee..0b1814790071 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -15,9 +15,13 @@ task: install_script: - pkg install -y llvm11 setup_script: - - df -h + - uname -a + - df -m - pw useradd user - mkdir -p /usr/obj/$(pwd -P) - chown user:user /usr/obj/$(pwd -P) script: - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes buildworld buildkernel" + post_script: + - df -m + - du -m -s /usr/obj From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:53:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1D66548E87 for ; Wed, 3 Mar 2021 16:53:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 4DrKpC6DnQz4YH8 for ; Wed, 3 Mar 2021 16:53:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id n79so13046854qke.3 for ; Wed, 03 Mar 2021 08:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z1TFELr0rieE1fJITpeppTIQj7JRe8DaH221JOdljoI=; b=DRp+uaH70TsfNpkCd70PEDvA7BoeMOkh44EK2Lh85Sej3jdmAYaPBqyAYW2DLO0Mtb 5VcJ/XOlYFQpJQlyltJ+cYv3fv927koJmTxomKdJQDwo/lgPV1bs+Pe8wQ9m/hg2jrch x0bgXqDeX7mL39t0DXO4Cp/pzQuKOcm8+Hf0AvK4IQOiQRgPQ8GlWWMcE1tSHPYVT64A mq/9VW9mCESKmSY29zey/yR0ajp+QB0w1FMuQLPn1maMOxVwP5jZwT6JD7Vjbtqvt6AI stvMTiBvL/pNhcmwapqn6VCia0KNS3IAqh+2E2SbOSo3bB8dXoTjwAnjdmOj+NF2SlXP Qn1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z1TFELr0rieE1fJITpeppTIQj7JRe8DaH221JOdljoI=; b=Huh9zNB+L3a1jnef2gnn3E2t8jAz2MGbaGjo11MbFl0627dw1HFQ2T/ZkwPF0VU/cw uHA/IlKKj1FHfIiG9OZz721fN3tcbWX6FuaPZlputHpPIwj1TBCUhZoa0ZM65Fu8SGKZ 4E73RC73stwgOMrV6w9k4G+gkiFWKDiV7De5oI6dWgpqCD5NsQ4vinRjy3onjROwuQ8k 4wwhZi6CVjAU9wMPXwM++pFD6RDToDYyYtvtdDFMvF0LCyY6gz6/8GZmKLHEYT74gkIG 6MIF4PriFeQy0JH8/3n3WDJ76HorgnX2GF4vQILwXoqCHjHz91bpQ7KOHFbvH8k9zXIy CQvQ== X-Gm-Message-State: AOAM533x5WsQramL9U8v1Gy2G9g0OyarmChxd6yeCexPWB0M/tWu3VLp ITB30BE9XLuAoSPox/m4UbACuf8ks27wREjZjmlsdA== X-Google-Smtp-Source: ABdhPJzymoQ/QZfJpFMPSy6kfJbJcoJAj7I1E74EDWa7eEGWTTsGhI55SN2/8WIj6VqCHU3GJ7/zUsSgGfrXgVPeT6Y= X-Received: by 2002:a37:a085:: with SMTP id j127mr24301369qke.206.1614790434739; Wed, 03 Mar 2021 08:53:54 -0800 (PST) MIME-Version: 1.0 References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> In-Reply-To: <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> From: Warner Losh Date: Wed, 3 Mar 2021 09:53:43 -0700 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Nathan Whitehorn Cc: Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DrKpC6DnQz4YH8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:53:56 -0000 On Wed, Mar 3, 2021 at 8:55 AM Nathan Whitehorn wrote: > > > On 3/3/21 10:38 AM, Warner Losh wrote: > > > > > > On Wed, Mar 3, 2021 at 7:13 AM Nathan Whitehorn > > > wrote: > > > > > > > > On 3/3/21 9:05 AM, Brandon Bergren wrote: > > > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: > > >> What am I missing here? One place I am being told this is run in > > >> an environment that may not even be an EFI booted system, and in > > >> another place it is being used as a test if something is mounted > > >> on it, which should only be true on an EFI booted system. > > > That the script in question is a generic script that runs as > > part of bsdinstall on every platform and has to be universal. > > > > > > The actual *problem* here is that > > usr.sbin/bsdinstall/scripts/bootconfig has a default case that is > > > *) die "Unsupported arch $(uname -m) for > > UEFI install" > > > > > > which then causes the main script to bail out, leaving the > > system in a half-installed state. > > > > > > If that had just been an exit 0 this would have never been a > > problem, I suppose. > > > > > > Before the original change that broke this, there was a check > > that the script was not running on powerpc or mips platforms > > before running the efi bits, but this got taken out. > > > > > > > Well, incidentally. The bootconfig script needs to know if there > > is an > > ESP it should configure, but the signalling mechanism (the > > presence of > > the ESP mount point) was being broken by mtree making that directory > > unconditionally even on systems that don't use EFI. So then > > bootconfig > > tried to set it up, but failed later on, because there was no EFI > > loader > > to set up. The mtree change makes the ESP mount point only exist on > > systems with an ESP. > > > > > > So you made a unilateral change, without discussion of the bigger > > design, to something without even asking the original person who made > > the change to mtree about it for what sounds like an obscure case in > > the installer that could be solved in a different way? It's trivial > > enough to look at the boot method sysctl and skip the EFI update if we > > didn't boot EFI (and if by change that's not on all systems, it's easy > > enough to add it on all systems). I have no notion about why that > > wasn't considered, at least, before jumping in and taking people by > > surprise. > > > > Next time, talk to people first. That's the whole point of having > > review tools, mailing list and git blame. > > > > Warner > > This method of testing was in the original review here posted on Feb. > 23: https://reviews.freebsd.org/D28897 That review didn't remove it from mtree, though... > > The description of the test procedure you're objecting to was even in > the summary! Then we had a discussion by email about the change to mtree > on the committers list on Feb. 28 to resolve a bug affecting PowerPC in > the patch reviewed and approved by you. I then waited several days and > had a long thread for several days on the mailing list about the > approach. coming up with this short patch -- again, as a bug fix to a > reviewed approach. > We can change the logic -- that's fine! But, to paraphrase, the reason > we have reviews is so people like you can look at the review and note > these kinds of problems when they are reviewed, not after the commit > goes in. There's a significant amount of whiplash when you do get > patches reviewed, approved, and then the person who reviewed and > approved them accuses you of "taking people by surprise". > The mtree stuff was a surprise. It wasn't in the review. It was a big surprise in an area that had been carefully negotiated over a year ago, so I had a strong reaction. Especially when git blame shows I did the commit, I'd have expected at least a 'hey, why is this here?' to come up... But rather than rehashing here, I'd like to focus on the technical side. The installer *does* mount the partition in advance, so checking whether > there is a mounted file system is a perfectly reasonable test to do. We > could also check fstab. I would like to understand what is actually > wrong here first, though. Especially after this misfire -- which is > problematic for reasons that are still not clear to me, since there are > a number of standard directories in hier(7) not in mtree -- I want to > make sure we actually do have consensus about what is changing and why. > At the top level, we default to having directories in mtree unless there's a good reason not to. We disagree as to whether the installer should take the presence or absence of the directory as a strong enough reason to do something. I don't think that's a good reason. But leaving that aside, let's say we wanted to reuse the install boot part of the installer to update boot blocks as part of installworld. If we can talk through that example w/o it in mtree, then we can leave it out. The last time I worked through this, though, I thought I'd talked myself into needing it. Looking at bootconfig, we could use machdep.bootmethod to determine if we need to update the ESP. If we didn't use that, then the ESP shouldn't be touched. This is, at the moment, x86 centric, but could trivially be added to architectures (I'm happy to add it). This would prevent the 'false positive' that's possible in cases where we've installed UEFI then downgraded to BIOS because of some problem (though purely in the context of the installer, I guess this isn't an issue). Even with your approach, we'd bogusly update an ESP (though one could argue you might want that). We could also change the code so that 'unsupported' architectures just didn't update. This is why I think it's a bit fragile to rely only on the directory being present. It should have something mounted there. If you wanted to mkfs_dos + mkdir efi at the top level, you could check for that directory if you were looking for a flag, though that would still update on a BIOS boot the ESP, and prevent false positives if run as part of an update. A long-term project I've had has been to try to update the boot blocks as part of installworld or maybe as part of installboot. We have really poor reuse as a project in this area. Every little orchestration thing wrote its own thing, and all of them have done it badly. I was hoping to be able to reuse this code, or modify the installer to use whatever we come up with there. As part of that, I had talked myself into thinking we always needed /boot/efi, but I'm having trouble reconstructing why that is now though I know it had to do with installed systems and bootstrapping issues... I know I was worried about questions about 'why isn't /boot/efi on the system by default so I can mount it' for people that have upgraded, but I recall there was more to it than that. With it in mtree, an installworld (even w/o an ESP update) would create it and people could mount it w/o having to mkdir which they might make as $SOMETHING_ELSE. So I guess that's a bit of a weak reason to absolutely require it in mtree. Warner From owner-dev-commits-src-all@freebsd.org Wed Mar 3 17:06:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA66E548CF7; Wed, 3 Mar 2021 17:06: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 4DrL4V3FLvz4ZCZ; Wed, 3 Mar 2021 17:06: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 5EAE655A0; Wed, 3 Mar 2021 17:06: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 123H6IR5095834; Wed, 3 Mar 2021 17:06:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123H6IO0095833; Wed, 3 Mar 2021 17:06:18 GMT (envelope-from git) Date: Wed, 3 Mar 2021 17:06:18 GMT Message-Id: <202103031706.123H6IO0095833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: aff9b9ee894e - main - Restore condition removed in df3747c6607b. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aff9b9ee894e3e6b6d8c7e4182d6b973804df853 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 17:06:19 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=aff9b9ee894e3e6b6d8c7e4182d6b973804df853 commit aff9b9ee894e3e6b6d8c7e4182d6b973804df853 Author: Alexander Motin AuthorDate: 2021-03-03 16:58:04 +0000 Commit: Alexander Motin CommitDate: 2021-03-03 17:03:08 +0000 Restore condition removed in df3747c6607b. I think it allowed to avoid some TX thread wakeups while the socket buffer is full. But add there another options if ic_check_send_space is set, which means socket just reported that new space appeared, so it may have sense to pull more data from ic_to_send for better TX coalescing. MFC after: 1 week --- sys/dev/iscsi/icl_soft.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index d579c034e63f..57ab24defabb 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -975,7 +975,8 @@ icl_send_thread(void *arg) * This way the icl_conn_send_pdus() can go through * all the queued PDUs without holding any locks. */ - STAILQ_CONCAT(&queue, &ic->ic_to_send); + if (STAILQ_EMPTY(&queue) || ic->ic_check_send_space) + STAILQ_CONCAT(&queue, &ic->ic_to_send); ic->ic_check_send_space = false; ICL_CONN_UNLOCK(ic); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 17:21:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 431755494CC; Wed, 3 Mar 2021 17:21:50 +0000 (UTC) (envelope-from nwhitehorn@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 4DrLQQ1QXrz4bKJ; Wed, 3 Mar 2021 17:21:50 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:cc7b:682b:f804:9afd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D42C523B6D; Wed, 3 Mar 2021 17:21:49 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) To: Warner Losh Cc: Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> From: Nathan Whitehorn Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. Message-ID: <91a51b75-9872-d202-53c0-fa1a21dc9cb3@freebsd.org> Date: Wed, 3 Mar 2021 12:21:49 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 17:21:50 -0000 On 3/3/21 11:53 AM, Warner Losh wrote: > [clipping non-technical pre-history] > > The installer *does* mount the partition in advance, so checking > whether > there is a mounted file system is a perfectly reasonable test to > do. We > could also check fstab. I would like to understand what is actually= > wrong here first, though. Especially after this misfire -- which is= > problematic for reasons that are still not clear to me, since > there are > a number of standard directories in hier(7) not in mtree -- I want = to > make sure we actually do have consensus about what is changing and > why. > > > At the top level, we default to having directories in mtree unless=20 > there's a good reason not to. We disagree as to whether the installer=20 > should take the presence or absence of the directory as a strong=20 > enough reason to do something. I don't think that's a good reason. > > But leaving that aside, let's say we=C2=A0wanted to reuse the install b= oot=20 > part of the installer to update boot blocks as part of installworld.=20 > If we can talk through that example w/o it in mtree, then we can leave = > it out. The last time I worked through this, though, I thought I'd=20 > talked myself into needing it. > Looking at bootconfig, we could use machdep.bootmethod to determine if = > we need to update the ESP. If we didn't use that, then the ESP=20 > shouldn't be touched. This is, at the moment, x86 centric, but could=20 > trivially be added to architectures (I'm happy to add it). This would=20 > prevent the 'false positive' that's possible in cases where we've=20 > installed UEFI then downgraded to BIOS because of some problem (though = > purely in the context of the installer, I guess this isn't an issue).=20 > Even with your approach, we'd bogusly update an ESP (though one could=20 > argue you might want that). We could also change the code so that=20 > 'unsupported' architectures just didn't update. This is why I think=20 > it's a bit fragile to rely only on the directory being present. It=20 > should have something mounted there. If you wanted to mkfs_dos=C2=A0+ m= kdir=20 > efi at the top level, you could check for that directory if you were=20 > looking for a flag, though that would still update on a BIOS boot the=20 > ESP, and prevent false positives if run as part of an update. I think we would *want* to update an ESP that is mounted but not=20 currently being used. If I set up a dual BIOS/EFI-boot system for some=20 reason and happened to install an update while booted from BIOS, I would = be deeply astonished if my configured-by-the-installer EFI bootloader=20 did not also get updated. (As an aside, I would also much rather the installer use an update=20 utility to set up the ESP than have the update utility use the installer.= ) So here's a proposal, now that everyone is in the CC list: - We add /boot/efi back to mtree, even though I find it kind of weird to = have it there I think we're too close to the release to have a=20 conclusion on this. - We have the installer check for either the ESP directory being an=20 active mountpoint or being in the in-progress fstab, whichever is=20 easiest to implement (they are equivalent for the installer). If that seems OK, I'll post another review for the change. > A long-term project I've had has been to try to update the boot blocks = > as part of installworld or maybe as part of installboot. We have=20 > really poor reuse as a project in this area. Every little=20 > orchestration thing wrote its own thing, and all of them have done it=20 > badly. I was hoping to be able to reuse this code, or modify the=20 > installer to use whatever we come up with there. As part of that, I=20 > had talked myself into thinking we always needed /boot/efi, but I'm=20 > having trouble reconstructing why that is now though I know it had to=20 > do with installed systems and bootstrapping issues... I know I was=20 > worried about questions about 'why isn't /boot/efi on the system by=20 > default so I can mount it' for people that have upgraded, but I recall = > there was more to it than that. With it in mtree, an installworld > (even w/o an ESP update) would create it and people could mount it w/o = > having to mkdir which they might make as $SOMETHING_ELSE. So I guess=20 > that's a bit of a weak reason to absolutely require it in mtree. Thanks a lot for the explanation. I'm agreed entirely about the problem=20 and the difficulty -- hopefully this set of changes helps at least. As for mtree, I was imagining this as something like /home, which is a=20 standard part of the system but isn't part of mtree since it depends on=20 local-system policy. It's also different from /home in that we *do* want = it to be a standard place for updates, of course. I think there's really = not a ton of precedent either way: we don't have any other mount points=20 in there for file systems that may or may not exist depending on=20 circumstances, as far as I can tell. My worry with having it in mtree is = that having it exist but potentially be a directory rather than an=20 actual ESP requires that update tools be a little smarter and errors=20 will be a little less obvious, since updates that don't pay enough=20 attention will be a bit more likely to splat files there assuming there=20 is an ESP even if makes no sense. It's a weak consideration either way,=20 I think. -Nathan > > Warner From owner-dev-commits-src-all@freebsd.org Wed Mar 3 18:28:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBFB054CDE7; Wed, 3 Mar 2021 18:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrMvK4ywkz4skC; Wed, 3 Mar 2021 18:28: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 9937F6763; Wed, 3 Mar 2021 18:28: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 123ISTZv001653; Wed, 3 Mar 2021 18:28:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123ISTI5001652; Wed, 3 Mar 2021 18:28:29 GMT (envelope-from git) Date: Wed, 3 Mar 2021 18:28:29 GMT Message-Id: <202103031828.123ISTI5001652@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: 55deb0a5f089 - main - service(8): use an environment more consistent with init(8) 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: 55deb0a5f089c8a27cfc1666655b93881c2b47ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 18:28:29 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=55deb0a5f089c8a27cfc1666655b93881c2b47ae commit 55deb0a5f089c8a27cfc1666655b93881c2b47ae Author: Andrew Gierth AuthorDate: 2021-03-03 18:25:11 +0000 Commit: Kyle Evans CommitDate: 2021-03-03 18:25:11 +0000 service(8): use an environment more consistent with init(8) init(8) sets the "daemon" login class without specifying a pw entry (so no substitutions are done on the variables). service(8)'s use of env -L had the effect of specifying root's pw entry, with two effects: getpwnam and getpwuid are being called, which may not be entirely safe depending on what nsswitch is up to and what stage of boot we are at, and substitutions would have been done. Fix by teaching env(8) to allow -L -/classname to set the class environment with no pw entry at all specified, and use it in service(8). PR: 253959 --- usr.bin/env/env.1 | 7 ++++++- usr.bin/env/env.c | 25 ++++++++++++++++--------- usr.sbin/service/service.sh | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/usr.bin/env/env.1 b/usr.bin/env/env.1 index 8c0527608506..9aff9508e47b 100644 --- a/usr.bin/env/env.1 +++ b/usr.bin/env/env.1 @@ -31,7 +31,7 @@ .\" From FreeBSD: src/usr.bin/printenv/printenv.1,v 1.17 2002/11/26 17:33:35 ru Exp .\" $FreeBSD$ .\" -.Dd November 11, 2020 +.Dd March 3, 2021 .Dt ENV 1 .Os .Sh NAME @@ -104,6 +104,11 @@ is used, then the specified user's .Pa ~/.login_conf is read as well. The user may be specified by name or by uid. +If a username of +.Sq Li \&- +is given, then no user lookup will be done, the login class will default to +.Sq Li default +if not explicitly given, and no substitutions will be done on the values. .\" -P .It Fl P Ar altpath Search the set of directories as specified by diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c index e408577ea7a4..0aa42a4663dd 100644 --- a/usr.bin/env/env.c +++ b/usr.bin/env/env.c @@ -144,16 +144,23 @@ main(int argc, char **argv) login_class = strchr(login_name, '/'); if (login_class) *login_class++ = '\0'; - pw = getpwnam(login_name); - if (pw == NULL) { - char *endp = NULL; - errno = 0; - uid = strtoul(login_name, &endp, 10); - if (errno == 0 && *endp == '\0') - pw = getpwuid(uid); + if (*login_name != '\0' && strcmp(login_name,"-") != 0) { + pw = getpwnam(login_name); + if (pw == NULL) { + char *endp = NULL; + errno = 0; + uid = strtoul(login_name, &endp, 10); + if (errno == 0 && *endp == '\0') + pw = getpwuid(uid); + } + if (pw == NULL) + errx(EXIT_FAILURE, "no such user: %s", login_name); } - if (pw == NULL) - errx(EXIT_FAILURE, "no such user: %s", login_name); + /* + * Note that it is safe for pw to be null here; the libutil + * code handles that, bypassing substitution of $ and using + * the class "default" if no class name is given either. + */ if (login_class != NULL) { lc = login_getclass(login_class); if (lc == NULL) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 9646aae67b0c..76cce580c5b4 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -171,7 +171,7 @@ cd / for dir in /etc/rc.d $local_startup; do if [ -x "$dir/$script" ]; then [ -n "$VERBOSE" ] && echo "$script is located in $dir" - exec env -i -L 0/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" + exec env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" fi done From owner-dev-commits-src-all@freebsd.org Wed Mar 3 18:58:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC71454DD1C; Wed, 3 Mar 2021 18:58: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 4DrNZC4SRRz3C94; Wed, 3 Mar 2021 18:58: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 878E26E1E; Wed, 3 Mar 2021 18:58: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 123IwhlC041126; Wed, 3 Mar 2021 18:58:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123Iwh8H041125; Wed, 3 Mar 2021 18:58:43 GMT (envelope-from git) Date: Wed, 3 Mar 2021 18:58:43 GMT Message-Id: <202103031858.123Iwh8H041125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rajesh Kumar M A Subject: git: 2845cb445f76 - stable/13 - Update manpage for AMD 10GbE driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rajeshasp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2845cb445f76190aced1f81d174ef1d0a7d228c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 18:58:43 -0000 The branch stable/13 has been updated by rajeshasp: URL: https://cgit.FreeBSD.org/src/commit/?id=2845cb445f76190aced1f81d174ef1d0a7d228c2 commit 2845cb445f76190aced1f81d174ef1d0a7d228c2 Author: Rajesh Kumar M A AuthorDate: 2021-02-24 05:01:10 +0000 Commit: Rajesh Kumar M A CommitDate: 2021-03-03 18:58:11 +0000 Update manpage for AMD 10GbE driver Approved by: vmaffione, gallatin Differential Revision: https://reviews.freebsd.org/D28724 (cherry picked from commit ec786886661ac8d6c41420c4460eba8461308e0b) --- share/man/man4/axp.4 | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/share/man/man4/axp.4 b/share/man/man4/axp.4 new file mode 100644 index 000000000000..41c2737bc7f1 --- /dev/null +++ b/share/man/man4/axp.4 @@ -0,0 +1,196 @@ +.\" Copyright (c) 2020, Advanced Micro Devices Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright notice, +.\" this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" 3. Neither the name of Advanced Micro Devices Inc., nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.Dd February 19, 2021 +.Dt AXP 4 +.Os +.Sh NAME +.Nm axp +.Nd "Advanced Micro Devices 10G Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iflib" +.Cd "device axp" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_axp_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver enables PCI-E based 10G Ethernet controller inbuilt in the +AMD EPYC processors. +.Pp +The following features are supported. +.Pp +.Bl -bullet -compact +.It +1G/10G SFP+ Link +.It +Jumbo frames (9000 Bytes) +.It +Transmit and Receive checksum offload +.It +TCP segmentation offload (TSO) +.It +VLAN tag insertion/extraction +.It +VLAN checksum offload +.It +VLAN TSO +.It +Receive side steering (RSS) +.It +IPV4 and IPV6 capable +.It +MSI-X interrupts +.It +Split header +.El +.Pp +All the above mentioned features are enabled by default. +.Pp +For hardware related questions, please refer the documentation supplied +along with AMD EPYC processors. +.Sh SYSCTL VARIABLES +The following variables are available as +.Xr sysctl 8 +variables: +.Bl -tag -width indent +.It Va dev.ax.X.mac_stats +Dumps the transmit and receive statistics counter values for the controller. +This includes statistics specific to each transmit and receive queue. +.It Va dev.ax.X.channels_info +Dumps the permissible and default configured transmit and receive channel +information. +.It Va dev.ax.X.ringparam_info +Dumps the permissible and default configured descriptor information for the +transmit and receive queue. +.It Va dev.ax.X.link_ksettings_info +Dumps the current link setting like link mode, speed, duplex settings. +.It Va dev.ax.X.pauseparam_info +Dumps the current flow-control settings. +.It Va dev.ax.X.coalesce_info +Dumps the current interrupt coalescing settings. +.It Va dev.ax.X.link_info +Dumps the current state of the Link. +.It Va dev.ax.X.drv_info +Dumps the driver and controller firmware version information. +.It Va dev.ax.X.YYYY_register +.It Va dev.ax.X.YYYY_register_values +Sysctl to dump a specific register from a specific block of the controller. +YYYY specifies the block. +The following blocks are supported. +.Bl -bullet -compact +.It +xpcs +.It +xgmac +.It +xprop +.It +xi2c +.El +.Pp +Set the offset of the register to the first variable, and then read the value +of the register by reading the second variable. +.It Va dev.ax.X.axgbe_debug_level +Configure the log-level for the driver. +Default is 0. +Supports 0-3. +.It Va dev.ax.X.link_workaround +This variable enables the workaround for an intermittent link issue. +When link does not come up for long time, this variable can be set to 1 to +reset the phy and bring up the link. +.El +.Sh LOADER TUNABLES +The following variable is available as +.Xr loader.conf 5 +tunable. +.Bl -tag -width indent +.It Va dev.ax.X.sph_enable +This variable controls split header feature for the interface. +Default is 1, meaning the split header support is enabled. +.Pp +This variable must be set before loading the driver, either via +.Xr loader.conf 5 +or through +.Xr kenv 1 . +This cannot be modified when driver is loaded. +.Pp +Setting this variable in +.Xr loader.conf 5 +needs the system to be restarted to take effect. +When using +.Xr kenv 1 , +use the wrapper variable +.Va dev.ax.sph_enable , +which will configure(enable/disable) split header support for all +.Nm +interfaces. +.Pp +To use netmap with this device, split header support must be disabled +(set this variable to 0). +.El +.Sh SEE ALSO +.Xr arp 4 , +.Xr iflib 4 , +.Xr netmap 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 13.0 . +.Pp +Another version of the driver is already present in +.Fx . +This driver was named as "axgbe" earlier, which is renamed as "axa" now. +This driver is for the ACPI based Ethernet controllers in the previous/older +version of the hardware. +This driver is authored by +.Aq Mt andrew@FreeBSD.org . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Advanced Micro Devices Inc . +.Pp +For any issues and support requirements, email the details to +.Aq Mt rajesh1.kumar@amd.com . From owner-dev-commits-src-all@freebsd.org Wed Mar 3 20:22:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B253550198; Wed, 3 Mar 2021 20:22: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 4DrQQn0Db0z3HLG; Wed, 3 Mar 2021 20:22: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 EF7471016B; Wed, 3 Mar 2021 20:22: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 123KMOHn059031; Wed, 3 Mar 2021 20:22:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123KMOje059030; Wed, 3 Mar 2021 20:22:24 GMT (envelope-from git) Date: Wed, 3 Mar 2021 20:22:24 GMT Message-Id: <202103032022.123KMOje059030@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: 0c1a5eaae832 - main - env: style(9) fix, add a space 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: 0c1a5eaae83267365330437adb60f44e1a622a2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 20:22:25 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0c1a5eaae83267365330437adb60f44e1a622a2b commit 0c1a5eaae83267365330437adb60f44e1a622a2b Author: Kyle Evans AuthorDate: 2021-03-03 20:20:17 +0000 Commit: Kyle Evans CommitDate: 2021-03-03 20:21:56 +0000 env: style(9) fix, add a space Reported by: pstef Fixes: 55deb0a5f089 ("service(8): use an environment more [...]") --- usr.bin/env/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c index 0aa42a4663dd..a0f55d665a9a 100644 --- a/usr.bin/env/env.c +++ b/usr.bin/env/env.c @@ -144,7 +144,7 @@ main(int argc, char **argv) login_class = strchr(login_name, '/'); if (login_class) *login_class++ = '\0'; - if (*login_name != '\0' && strcmp(login_name,"-") != 0) { + if (*login_name != '\0' && strcmp(login_name, "-") != 0) { pw = getpwnam(login_name); if (pw == NULL) { char *endp = NULL; From owner-dev-commits-src-all@freebsd.org Wed Mar 3 20:29:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E2BB5501C1; Wed, 3 Mar 2021 20:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrQb66hv5z3HJx; Wed, 3 Mar 2021 20:29: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 D4B4E10395; Wed, 3 Mar 2021 20:29: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 123KTcJa060203; Wed, 3 Mar 2021 20:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123KTcTN060202; Wed, 3 Mar 2021 20:29:38 GMT (envelope-from git) Date: Wed, 3 Mar 2021 20:29:38 GMT Message-Id: <202103032029.123KTcTN060202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: afc3e54eeee6 - main - Move ic_check_send_space clear to the actual check. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afc3e54eeee635a525c88e4678cc38e3219302c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 20:29:39 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=afc3e54eeee635a525c88e4678cc38e3219302c3 commit afc3e54eeee635a525c88e4678cc38e3219302c3 Author: Alexander Motin AuthorDate: 2021-03-03 20:21:26 +0000 Commit: Alexander Motin CommitDate: 2021-03-03 20:29:35 +0000 Move ic_check_send_space clear to the actual check. It closes tiny race when the flag could be set between being cleared and the space is checked, that would create us some more work. The flag setting is protected by both locks, so we can clear it in either place, but in between both locks are dropped. MFC after: 1 week --- sys/dev/iscsi/icl_soft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 57ab24defabb..9cede6b44311 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -866,6 +866,7 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) * of error. */ available = sbspace(&so->so_snd); + ic->ic_check_send_space = false; /* * Notify the socket upcall that we don't need wakeups @@ -978,7 +979,6 @@ icl_send_thread(void *arg) if (STAILQ_EMPTY(&queue) || ic->ic_check_send_space) STAILQ_CONCAT(&queue, &ic->ic_to_send); - ic->ic_check_send_space = false; ICL_CONN_UNLOCK(ic); icl_conn_send_pdus(ic, &queue); ICL_CONN_LOCK(ic); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 21:55:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 235C555225C; Wed, 3 Mar 2021 21:55: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 4DrSTs0Ss9z3NWP; Wed, 3 Mar 2021 21:55: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 F2C2A11465; Wed, 3 Mar 2021 21:55: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 123LtCTe078135; Wed, 3 Mar 2021 21:55:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123LtCoQ078134; Wed, 3 Mar 2021 21:55:12 GMT (envelope-from git) Date: Wed, 3 Mar 2021 21:55:12 GMT Message-Id: <202103032155.123LtCoQ078134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: d2d99e6757fb - releng/13.0 - armv8crypto: add missing newline MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: d2d99e6757fb69f5b02711bba444774222ee9b3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 21:55:13 -0000 The branch releng/13.0 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d2d99e6757fb69f5b02711bba444774222ee9b3e commit d2d99e6757fb69f5b02711bba444774222ee9b3e Author: Elliott Mitchell AuthorDate: 2021-02-28 20:03:44 +0000 Commit: Mitchell Horne CommitDate: 2021-03-03 21:54:22 +0000 armv8crypto: add missing newline The missing newline mildly garbles boot-time messages and this can be troublesome if you need those. Reported by: Mike Karels (mike@karels.net) Reviewed by: gonzo Approved by: re (gjb) (cherry picked from commit 530d38441d55b7ac62ebae6ac8ea76903a4a3b0c) (cherry picked from commit 0ae67623992788538b90b7c0e2882c4aa645a81f) --- sys/crypto/armv8/armv8_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c index be39168d50f3..24f6eff5608d 100644 --- a/sys/crypto/armv8/armv8_crypto.c +++ b/sys/crypto/armv8/armv8_crypto.c @@ -122,7 +122,7 @@ armv8_crypto_probe(device_t dev) default: break; case ID_AA64ISAR0_AES_NONE: - device_printf(dev, "CPU lacks AES instructions"); + device_printf(dev, "CPU lacks AES instructions\n"); break; } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 21:55:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE155522AF; Wed, 3 Mar 2021 21:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrSTt0smqz3NT8; Wed, 3 Mar 2021 21:55: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 0DCB111733; Wed, 3 Mar 2021 21:55: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 123LtDxd078156; Wed, 3 Mar 2021 21:55:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123LtDN2078154; Wed, 3 Mar 2021 21:55:13 GMT (envelope-from git) Date: Wed, 3 Mar 2021 21:55:13 GMT Message-Id: <202103032155.123LtDN2078154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 661e2b8e1486 - releng/13.0 - ddb: fix show devmap output on 32-bit arm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 661e2b8e1486cc966304ff98f766463de07e3f02 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 21:55:14 -0000 The branch releng/13.0 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=661e2b8e1486cc966304ff98f766463de07e3f02 commit 661e2b8e1486cc966304ff98f766463de07e3f02 Author: Thomas Skibo AuthorDate: 2021-01-11 20:58:12 +0000 Commit: Mitchell Horne CommitDate: 2021-03-03 21:54:45 +0000 ddb: fix show devmap output on 32-bit arm The output has been broken since 1b6dd6d772ca. Casting to uintmax_t before the call to printf is necessary to ensure that 32-bit addresses are interpreted correctly. PR: 243236 Approved by: re (gjb) (cherry picked from commit 9976b42b697ce203b1d257b2a6fe64c8a2961645) (cherry picked from commit 0a223cf980b5ef8bea726a843fe5a7faf2278330) --- sys/kern/subr_devmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_devmap.c b/sys/kern/subr_devmap.c index 8e07199b7f73..23baceb05129 100644 --- a/sys/kern/subr_devmap.c +++ b/sys/kern/subr_devmap.c @@ -74,7 +74,9 @@ devmap_dump_table(int (*prfunc)(const char *, ...)) prfunc("Static device mappings:\n"); for (pd = devmap_table; pd->pd_size != 0; ++pd) { prfunc(" 0x%08jx - 0x%08jx mapped at VA 0x%08jx\n", - pd->pd_pa, pd->pd_pa + pd->pd_size - 1, pd->pd_va); + (uintmax_t)pd->pd_pa, + (uintmax_t)(pd->pd_pa + pd->pd_size - 1), + (uintmax_t)pd->pd_va); } } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 22:01:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCB5D55239F; Wed, 3 Mar 2021 22:01: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 4DrSd23Y8wz3NmN; Wed, 3 Mar 2021 22:01: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 6ABD31174A; Wed, 3 Mar 2021 22:01: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 123M1Qe2088307; Wed, 3 Mar 2021 22:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123M1Qah088306; Wed, 3 Mar 2021 22:01:26 GMT (envelope-from git) Date: Wed, 3 Mar 2021 22:01:26 GMT Message-Id: <202103032201.123M1Qah088306@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: c49b075305a7 - main - git-arc: Handle commit ranges in the "update" verb 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: c49b075305a7aa1c7f500db1672cd1d2b8066b55 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 22:01:26 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c49b075305a7aa1c7f500db1672cd1d2b8066b55 commit c49b075305a7aa1c7f500db1672cd1d2b8066b55 Author: Mark Johnston AuthorDate: 2021-03-03 22:00:58 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 22:00:58 +0000 git-arc: Handle commit ranges in the "update" verb Reported by: imp --- tools/tools/git/git-arc.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index 07b042ceb151..c3541e438c9f 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -53,7 +53,7 @@ Commands: list | patch [ ...] stage [-b branch] [|] - update + update [|] Description: Create or manage FreeBSD Phabricator reviews based on git commits. There @@ -500,24 +500,24 @@ gitarc::stage() gitarc::update() { - local commit diff - - commit=$1 - diff=$(commit2diff $commit) - - if ! show_and_prompt $commit; then - return - fi + local commit commits diff + commits=$(build_commit_list $@) save_head + for commit in ${commits}; do + diff=$(commit2diff $commit) - git checkout -q $commit + if ! show_and_prompt $commit; then + break + fi - # The linter is stupid and applies patches to the working copy. - # This would be tolerable if it didn't try to correct "misspelled" variable - # names. - arc diff --allow-untracked --never-apply-patches --update $diff HEAD~ + git checkout -q $commit + # The linter is stupid and applies patches to the working copy. + # This would be tolerable if it didn't try to correct "misspelled" variable + # names. + arc diff --allow-untracked --never-apply-patches --update $diff HEAD~ + done restore_head } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 22:01:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 070875523A0; Wed, 3 Mar 2021 22:01: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 4DrSd35DZnz3Nf1; Wed, 3 Mar 2021 22:01: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 97A62118AE; Wed, 3 Mar 2021 22:01: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 123M1Rl1088330; Wed, 3 Mar 2021 22:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123M1RuA088329; Wed, 3 Mar 2021 22:01:27 GMT (envelope-from git) Date: Wed, 3 Mar 2021 22:01:27 GMT Message-Id: <202103032201.123M1RuA088329@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: c113740f266e - main - git-arc.1: Fix synopsis for the "update" verb 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: c113740f266ecfbe4a34c97607f860d63c08eb76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 22:01:28 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c113740f266ecfbe4a34c97607f860d63c08eb76 commit c113740f266ecfbe4a34c97607f860d63c08eb76 Author: Mark Johnston AuthorDate: 2021-03-03 22:01:04 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 22:01:04 +0000 git-arc.1: Fix synopsis for the "update" verb --- tools/tools/git/git-arc.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 index cc510c069c3a..00019a19180d 100644 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -47,7 +47,7 @@ .Ar branch Op Ar commit Ns | Ns Ar commit-range .Nm .Cm update -.Op Ar branch Oo Ar commit Ns | Ns Ar commit-range Oc +.Op Ar commit Ns | Ns Ar commit-range Oc .Sh DESCRIPTION The .Nm From owner-dev-commits-src-all@freebsd.org Wed Mar 3 22:25:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE61D552E33 for ; Wed, 3 Mar 2021 22:25:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 4DrT8n4Hrlz3Qvx for ; Wed, 3 Mar 2021 22:25:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x735.google.com with SMTP id g185so6527865qkf.6 for ; Wed, 03 Mar 2021 14:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zD0mdRv+v11ua6jZjZU6vAihX6p/414yPJa8ABaN50w=; b=llgrDZiUYXU1PWFAK42NLlELjvcfwqHfOollg0ShE69lieuSt5hoFiSESiGJRE1vUn 1blnghK1CUAtHzIL3F4ZyAB+W9Zs3FHmhKhAC0PcFjmh5BS+BTX5zsDW72lP4cO6mO++ GzJurBPZpKKI5Qeer8DxbOB9rI4+q+3IFrBcSKssJZAv4nUkDPBfot/hZSF3+tv/80up zC8d4UuM74kgsiWoy/UUdXrauANcP3c2bLZzhmj7ye1NaePiMYfzJxDBODCrd971iocq LqOqsEPngngX1EajPG8RDJSjnskWk0d85vd90CjjbWaMHbZtk5JKwZQAd6q9NvXCWxSz Tg/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zD0mdRv+v11ua6jZjZU6vAihX6p/414yPJa8ABaN50w=; b=qxVbhOnv1b5bkd7DkEMJ0+q41LT8AupI6h72hxNEUx2sTPrWw4hGj43SXD4sylxkoH g1qilzzWXRqm5RKsLHC2zQHDOoJ/MEea9qFr1gJcA9HxAW/jkxePyUR63TTwQuFu62Dy oh3YeX2LC/3HGgxhC4HKXYwgY5La2WCYVqtj4WakiFgymeSjyV/FDLqjcqn44kr0ig5L gvKtG4rZ3XyUnshH3GkCuk1CtiTTpVYm/WNiaKZtCOWXAeO7iCyWnAhMLtloRii9PQ0K MDwrS3ZDWswjb4TtU7uy7HpSYT1FQzE+aJKfopiXfZdg7NP3473CKJoHg7DLPzvzWxur Wlcw== X-Gm-Message-State: AOAM531CgwFdQMBzeZR9LP57WNt5uQRuexLkaSVqhG9UNmOE9gaQpUnN ooBwvK9jdZaq6vUHhf9PNJ58GemOqPzdEOy9nfN6+g== X-Google-Smtp-Source: ABdhPJx0UqejeeifdeJhDh0Wvmb+5L2XDY+G5VVsN6LehnJmTXBjh0d+uhuW7+RWuLXVd6a/cB5Q0FMcF6DDjoR0k74= X-Received: by 2002:a37:7f83:: with SMTP id a125mr1304227qkd.44.1614810328611; Wed, 03 Mar 2021 14:25:28 -0800 (PST) MIME-Version: 1.0 References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> <91a51b75-9872-d202-53c0-fa1a21dc9cb3@freebsd.org> In-Reply-To: <91a51b75-9872-d202-53c0-fa1a21dc9cb3@freebsd.org> From: Warner Losh Date: Wed, 3 Mar 2021 15:25:17 -0700 Message-ID: Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: Nathan Whitehorn Cc: Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DrT8n4Hrlz3Qvx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 22:25:29 -0000 On Wed, Mar 3, 2021 at 10:21 AM Nathan Whitehorn wrote: > > > On 3/3/21 11:53 AM, Warner Losh wrote: > > > > [clipping non-technical pre-history] > Thanks. re-reading it now, I think I was more grumpy than warranted. And for that I apologize. Thanks for omitting it from the rest of the thread. > > > > The installer *does* mount the partition in advance, so checking > > whether > > there is a mounted file system is a perfectly reasonable test to > > do. We > > could also check fstab. I would like to understand what is actually > > wrong here first, though. Especially after this misfire -- which is > > problematic for reasons that are still not clear to me, since > > there are > > a number of standard directories in hier(7) not in mtree -- I want to > > make sure we actually do have consensus about what is changing and > > why. > > > > > > At the top level, we default to having directories in mtree unless > > there's a good reason not to. We disagree as to whether the installer > > should take the presence or absence of the directory as a strong > > enough reason to do something. I don't think that's a good reason. > > > > But leaving that aside, let's say we wanted to reuse the install boot > > part of the installer to update boot blocks as part of installworld. > > If we can talk through that example w/o it in mtree, then we can leave > > it out. The last time I worked through this, though, I thought I'd > > talked myself into needing it. > > > Looking at bootconfig, we could use machdep.bootmethod to determine if > > we need to update the ESP. If we didn't use that, then the ESP > > shouldn't be touched. This is, at the moment, x86 centric, but could > > trivially be added to architectures (I'm happy to add it). This would > > prevent the 'false positive' that's possible in cases where we've > > installed UEFI then downgraded to BIOS because of some problem (though > > purely in the context of the installer, I guess this isn't an issue). > > Even with your approach, we'd bogusly update an ESP (though one could > > argue you might want that). We could also change the code so that > > 'unsupported' architectures just didn't update. This is why I think > > it's a bit fragile to rely only on the directory being present. It > > should have something mounted there. If you wanted to mkfs_dos + mkdir > > efi at the top level, you could check for that directory if you were > > looking for a flag, though that would still update on a BIOS boot the > > ESP, and prevent false positives if run as part of an update. > > I think we would *want* to update an ESP that is mounted but not > currently being used. If I set up a dual BIOS/EFI-boot system for some > reason and happened to install an update while booted from BIOS, I would > be deeply astonished if my configured-by-the-installer EFI bootloader > did not also get updated. > Yea, it's unclear to me what POLA here is, to be honest. Some of that is driven by a deep desire not to accidentally update USB drives that have a bootable image on them as well, so that may overly color my thinking. > (As an aside, I would also much rather the installer use an update > utility to set up the ESP than have the update utility use the installer.) > Agreed. We can work towards that after the release. It would be better if we could accumulate the scripts from a number of different places, find a good way to make them callable from those places more easily and start to move that tribal knowledge back into the base system where it belongs, imho. Baptiste raised an important point years ago that we also need to think about doing that with a way to 'plug in' $NEWEST_CLOUD's packages, containers, layout such that they could provide the details and then the automation would just work with them too: image building, release customization, boot block update, etc. > So here's a proposal, now that everyone is in the CC list: > - We add /boot/efi back to mtree, even though I find it kind of weird to > have it there I think we're too close to the release to have a > conclusion on this. > - We have the installer check for either the ESP directory being an > active mountpoint or being in the in-progress fstab, whichever is > easiest to implement (they are equivalent for the installer). > I'm OK with both of these points. If others are opposed to the first one, I'm willing to see how people react to it in the upgrade path before changing it again. We should get closure on Ed's proposed change here. I think it's good and should go in right after your changes. I'd start on your changes, and give people until the morning to pipe up with any objections. > If that seems OK, I'll post another review for the change. > > > A long-term project I've had has been to try to update the boot blocks > > as part of installworld or maybe as part of installboot. We have > > really poor reuse as a project in this area. Every little > > orchestration thing wrote its own thing, and all of them have done it > > badly. I was hoping to be able to reuse this code, or modify the > > installer to use whatever we come up with there. As part of that, I > > had talked myself into thinking we always needed /boot/efi, but I'm > > having trouble reconstructing why that is now though I know it had to > > do with installed systems and bootstrapping issues... I know I was > > worried about questions about 'why isn't /boot/efi on the system by > > default so I can mount it' for people that have upgraded, but I recall > > there was more to it than that. With it in mtree, an installworld > > (even w/o an ESP update) would create it and people could mount it w/o > > having to mkdir which they might make as $SOMETHING_ELSE. So I guess > > that's a bit of a weak reason to absolutely require it in mtree. > > Thanks a lot for the explanation. I'm agreed entirely about the problem > and the difficulty -- hopefully this set of changes helps at least. > It does. It starts to get people to use the same mount point for the ESP and we can then constrain the problem a bit and where we can't constrain it we can parameterize it. > As for mtree, I was imagining this as something like /home, which is a > standard part of the system but isn't part of mtree since it depends on > local-system policy. It's also different from /home in that we *do* want > it to be a standard place for updates, of course. I think there's really > not a ton of precedent either way: we don't have any other mount points > in there for file systems that may or may not exist depending on > circumstances, as far as I can tell. My worry with having it in mtree is > that having it exist but potentially be a directory rather than an > actual ESP requires that update tools be a little smarter and errors > will be a little less obvious, since updates that don't pay enough > attention will be a bit more likely to splat files there assuming there > is an ESP even if makes no sense. It's a weak consideration either way, > I think. > Yea. After a few hours of reflection, I've found that I could go either way and am having trouble understanding why I was so dead set this morning on a particular way. Chalk it up to me being a little extra grumpy at surprise changes. This one seems less like local policy than /home, but there's still a local aspect: Do I mount by default, and where. I think we should always, though, have a fstab entry as we'll need to update it from time to time. Even Windows has a nominal drive that it uses to mount the ESP, even if it isn't mounted by default. That's used to update it when scripts and such need to do that (or if you're the victim of an upgrade script that did too much that now needs to be undone). I think we should be similar in that regard. This would also let us take the automation of updates to the next level if we can rely on some basic things. Warner > > > > > Warner > > > From owner-dev-commits-src-all@freebsd.org Wed Mar 3 22:34:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B1A45531AC; Wed, 3 Mar 2021 22:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrTMY19nYz3R6X; Wed, 3 Mar 2021 22:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B1D011D5A; Wed, 3 Mar 2021 22:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 123MYnSV031206; Wed, 3 Mar 2021 22:34:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123MYnoa031205; Wed, 3 Mar 2021 22:34:49 GMT (envelope-from git) Date: Wed, 3 Mar 2021 22:34:49 GMT Message-Id: <202103032234.123MYnoa031205@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: 49f6925ca342 - main - ktls: Cache output buffers for software encryption 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: 49f6925ca342b16a057d586107f09747969184f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 22:34:49 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49f6925ca342b16a057d586107f09747969184f5 commit 49f6925ca342b16a057d586107f09747969184f5 Author: Mark Johnston AuthorDate: 2021-03-03 22:30:08 +0000 Commit: Mark Johnston CommitDate: 2021-03-03 22:34:01 +0000 ktls: Cache output buffers for software encryption Maintain a cache of physically contiguous runs of pages for use as output buffers when software encryption is configured and in-place encryption is not possible. This makes allocation and free cheaper since in the common case we avoid touching the vm_page structures for the buffer, and fewer calls into UMA are needed. gallatin@ reports a ~10% absolute decrease in CPU usage with sendfile/KTLS on a Xeon after this change. It is possible that we will not be able to allocate these buffers if physical memory is fragmented. To avoid frequently calling into the physical memory allocator in this scenario, rate-limit allocation attempts after a failure. In the failure case we fall back to the old behaviour of allocating a page at a time. N.B.: this scheme could be simplified, either by simply using malloc() and looking up the PAs of the pages backing the buffer, or by falling back to page by page allocation and creating a mapping in the cache zone. This requires some way to save a mapping of an M_EXTPG page array in the mbuf, though. m_data is not really appropriate. The second approach may be possible by saving the mapping in the plinks union of the first vm_page structure of the array, but this would force a vm_page access when freeing an mbuf. Reviewed by: gallatin, jhb Tested by: gallatin Sponsored by: Ampere Computing Submitted by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D28556 --- sys/kern/uipc_ktls.c | 162 ++++++++++++++++++++++++++++++++++++++-------- sys/opencrypto/ktls_ocf.c | 80 ++++++++++++----------- sys/sys/ktls.h | 6 +- 3 files changed, 180 insertions(+), 68 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 9fc5f8b203c0..5125061e0879 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -82,6 +82,7 @@ struct ktls_wq { STAILQ_HEAD(, mbuf) m_head; STAILQ_HEAD(, socket) so_head; bool running; + int lastallocfail; } __aligned(CACHE_LINE_SIZE); struct ktls_domain_info { @@ -95,6 +96,7 @@ static struct proc *ktls_proc; LIST_HEAD(, ktls_crypto_backend) ktls_backends; static struct rmlock ktls_backends_lock; static uma_zone_t ktls_session_zone; +static uma_zone_t ktls_buffer_zone; static uint16_t ktls_cpuid_lookup[MAXCPU]; SYSCTL_NODE(_kern_ipc, OID_AUTO, tls, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, @@ -116,7 +118,7 @@ SYSCTL_INT(_kern_ipc_tls, OID_AUTO, bind_threads, CTLFLAG_RDTUN, "Bind crypto threads to cores (1) or cores and domains (2) at boot"); static u_int ktls_maxlen = 16384; -SYSCTL_UINT(_kern_ipc_tls, OID_AUTO, maxlen, CTLFLAG_RWTUN, +SYSCTL_UINT(_kern_ipc_tls, OID_AUTO, maxlen, CTLFLAG_RDTUN, &ktls_maxlen, 0, "Maximum TLS record size"); static int ktls_number_threads; @@ -134,6 +136,11 @@ SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, cbc_enable, CTLFLAG_RWTUN, &ktls_cbc_enable, 1, "Enable Support of AES-CBC crypto for kernel TLS"); +static bool ktls_sw_buffer_cache = true; +SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, sw_buffer_cache, CTLFLAG_RDTUN, + &ktls_sw_buffer_cache, 1, + "Enable caching of output buffers for SW encryption"); + 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"); @@ -366,6 +373,51 @@ ktls_get_cpu(struct socket *so) } #endif +static int +ktls_buffer_import(void *arg, void **store, int count, int domain, int flags) +{ + vm_page_t m; + int i; + + KASSERT((ktls_maxlen & PAGE_MASK) == 0, + ("%s: ktls max length %d is not page size-aligned", + __func__, ktls_maxlen)); + + for (i = 0; i < count; i++) { + m = vm_page_alloc_contig_domain(NULL, 0, domain, + VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | + VM_ALLOC_NODUMP | malloc2vm_flags(flags), + atop(ktls_maxlen), 0, ~0ul, PAGE_SIZE, 0, + VM_MEMATTR_DEFAULT); + if (m == NULL) + break; + store[i] = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + } + return (i); +} + +static void +ktls_buffer_release(void *arg __unused, void **store, int count) +{ + vm_page_t m; + int i, j; + + for (i = 0; i < count; i++) { + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)store[i])); + for (j = 0; j < atop(ktls_maxlen); j++) { + (void)vm_page_unwire_noq(m + j); + vm_page_free(m + j); + } + } +} + +static void +ktls_free_mext_contig(struct mbuf *m) +{ + M_ASSERTEXTPG(m); + uma_zfree(ktls_buffer_zone, (void *)PHYS_TO_DMAP(m->m_epg_pa[0])); +} + static void ktls_init(void *dummy __unused) { @@ -385,6 +437,13 @@ ktls_init(void *dummy __unused) NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); + if (ktls_sw_buffer_cache) { + ktls_buffer_zone = uma_zcache_create("ktls_buffers", + roundup2(ktls_maxlen, PAGE_SIZE), NULL, NULL, NULL, NULL, + ktls_buffer_import, ktls_buffer_release, NULL, + UMA_ZONE_FIRSTTOUCH); + } + /* * Initialize the workqueues to run the TLS work. We create a * work queue for each CPU. @@ -1974,6 +2033,30 @@ ktls_enqueue_to_free(struct mbuf *m) wakeup(wq); } +static void * +ktls_buffer_alloc(struct ktls_wq *wq, struct mbuf *m) +{ + void *buf; + + if (m->m_epg_npgs <= 2) + return (NULL); + if (ktls_buffer_zone == NULL) + return (NULL); + if ((u_int)(ticks - wq->lastallocfail) < hz) { + /* + * Rate-limit allocation attempts after a failure. + * ktls_buffer_import() will acquire a per-domain mutex to check + * the free page queues and may fail consistently if memory is + * fragmented. + */ + return (NULL); + } + buf = uma_zalloc(ktls_buffer_zone, M_NOWAIT | M_NORECLAIM); + if (buf == NULL) + wq->lastallocfail = ticks; + return (buf); +} + void ktls_enqueue(struct mbuf *m, struct socket *so, int page_count) { @@ -2006,7 +2089,7 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int page_count) } static __noinline void -ktls_encrypt(struct mbuf *top) +ktls_encrypt(struct ktls_wq *wq, struct mbuf *top) { struct ktls_session *tls; struct socket *so; @@ -2015,6 +2098,7 @@ ktls_encrypt(struct mbuf *top) struct iovec src_iov[1 + btoc(TLS_MAX_MSG_SIZE_V10_2)]; struct iovec dst_iov[1 + btoc(TLS_MAX_MSG_SIZE_V10_2)]; vm_page_t pg; + void *cbuf; int error, i, len, npages, off, total_pages; bool is_anon; @@ -2056,6 +2140,9 @@ ktls_encrypt(struct mbuf *top) KASSERT(npages + m->m_epg_npgs <= total_pages, ("page count mismatch: top %p, total_pages %d, m %p", top, total_pages, m)); + KASSERT(ptoa(m->m_epg_npgs) <= ktls_maxlen, + ("page count %d larger than maximum frame length %d", + m->m_epg_npgs, ktls_maxlen)); /* * Generate source and destination ivoecs to pass to @@ -2072,37 +2159,50 @@ ktls_encrypt(struct mbuf *top) len = m_epg_pagelen(m, i, off); src_iov[i].iov_len = len; src_iov[i].iov_base = - (char *)(void *)PHYS_TO_DMAP(m->m_epg_pa[i]) + - off; + (char *)(void *)PHYS_TO_DMAP(m->m_epg_pa[i]) + off; + } - if (is_anon) { - dst_iov[i].iov_base = src_iov[i].iov_base; - dst_iov[i].iov_len = src_iov[i].iov_len; - continue; - } -retry_page: - pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | VM_ALLOC_WIRED); - if (pg == NULL) { - vm_wait(NULL); - goto retry_page; + if (is_anon) { + memcpy(dst_iov, src_iov, i * sizeof(struct iovec)); + } else if ((cbuf = ktls_buffer_alloc(wq, m)) != NULL) { + len = ptoa(m->m_epg_npgs - 1) + m->m_epg_last_len - + m->m_epg_1st_off; + dst_iov[0].iov_base = (char *)cbuf + m->m_epg_1st_off; + dst_iov[0].iov_len = len; + parray[0] = DMAP_TO_PHYS((vm_offset_t)cbuf); + i = 1; + } else { + cbuf = NULL; + off = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs; i++, off = 0) { + do { + pg = vm_page_alloc(NULL, 0, + VM_ALLOC_NORMAL | + VM_ALLOC_NOOBJ | + VM_ALLOC_NODUMP | + VM_ALLOC_WIRED | + VM_ALLOC_WAITFAIL); + } while (pg == NULL); + + len = m_epg_pagelen(m, i, off); + parray[i] = VM_PAGE_TO_PHYS(pg); + dst_iov[i].iov_base = + (char *)(void *)PHYS_TO_DMAP( + parray[i]) + off; + dst_iov[i].iov_len = len; } - parray[i] = VM_PAGE_TO_PHYS(pg); - dst_iov[i].iov_base = - (char *)(void *)PHYS_TO_DMAP(parray[i]) + off; - dst_iov[i].iov_len = len; } if (__predict_false(m->m_epg_npgs == 0)) { /* TLS 1.0 empty fragment. */ npages++; } else - npages += i; + npages += m->m_epg_npgs; error = (*tls->sw_encrypt)(tls, (const struct tls_record_layer *)m->m_epg_hdr, - m->m_epg_trail, src_iov, dst_iov, i, m->m_epg_seqno, - m->m_epg_record_type); + m->m_epg_trail, src_iov, dst_iov, m->m_epg_npgs, i, + m->m_epg_seqno, m->m_epg_record_type); if (error) { counter_u64_add(ktls_offload_failed_crypto, 1); break; @@ -2118,11 +2218,19 @@ retry_page: m->m_ext.ext_free(m); /* Replace them with the new pages. */ - for (i = 0; i < m->m_epg_npgs; i++) - m->m_epg_pa[i] = parray[i]; + if (cbuf != NULL) { + for (i = 0; i < m->m_epg_npgs; i++) + m->m_epg_pa[i] = parray[0] + ptoa(i); + + /* Contig pages should go back to the cache. */ + m->m_ext.ext_free = ktls_free_mext_contig; + } else { + for (i = 0; i < m->m_epg_npgs; i++) + m->m_epg_pa[i] = parray[i]; - /* Use the basic free routine. */ - m->m_ext.ext_free = mb_free_mext_pgs; + /* Use the basic free routine. */ + m->m_ext.ext_free = mb_free_mext_pgs; + } /* Pages are now writable. */ m->m_epg_flags |= EPG_FLAG_ANON; @@ -2189,7 +2297,7 @@ ktls_work_thread(void *ctx) ktls_free(m->m_epg_tls); uma_zfree(zone_mbuf, m); } else { - ktls_encrypt(m); + ktls_encrypt(wq, m); counter_u64_add(ktls_cnt_tx_queued, -1); } } diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index fd4a230fedea..31d787c2b61b 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -178,15 +178,15 @@ ktls_ocf_dispatch(struct ocf_session *os, struct cryptop *crp) static int ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, - struct iovec *outiov, int iovcnt, uint64_t seqno, + struct iovec *outiov, int iniovcnt, int outiovcnt, uint64_t seqno, uint8_t record_type __unused) { struct uio uio, out_uio; struct tls_mac_data ad; struct cryptop crp; struct ocf_session *os; - struct iovec iov[iovcnt + 2]; - struct iovec out_iov[iovcnt + 1]; + struct iovec iov[iniovcnt + 2]; + struct iovec out_iov[outiovcnt + 1]; int i, error; uint16_t tls_comp_len; uint8_t pad; @@ -219,10 +219,11 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, * at least compute inplace as well while we are here. */ tls_comp_len = 0; - inplace = true; - for (i = 0; i < iovcnt; i++) { + inplace = iniovcnt == outiovcnt; + for (i = 0; i < iniovcnt; i++) { tls_comp_len += iniov[i].iov_len; - if (iniov[i].iov_base != outiov[i].iov_base) + if (inplace && + (i >= outiovcnt || iniov[i].iov_base != outiov[i].iov_base)) inplace = false; } @@ -236,11 +237,11 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, /* First, compute the MAC. */ iov[0].iov_base = &ad; iov[0].iov_len = sizeof(ad); - memcpy(&iov[1], iniov, sizeof(*iniov) * iovcnt); - iov[iovcnt + 1].iov_base = trailer; - iov[iovcnt + 1].iov_len = os->mac_len; + memcpy(&iov[1], iniov, sizeof(*iniov) * iniovcnt); + iov[iniovcnt + 1].iov_base = trailer; + iov[iniovcnt + 1].iov_len = os->mac_len; uio.uio_iov = iov; - uio.uio_iovcnt = iovcnt + 2; + uio.uio_iovcnt = iniovcnt + 2; uio.uio_offset = 0; uio.uio_segflg = UIO_SYSSPACE; uio.uio_td = curthread; @@ -279,10 +280,10 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, * Don't recopy the input iovec, instead just adjust the * trailer length and skip over the AAD vector in the uio. */ - iov[iovcnt + 1].iov_len += pad + 1; + iov[iniovcnt + 1].iov_len += pad + 1; uio.uio_iov = iov + 1; - uio.uio_iovcnt = iovcnt + 1; - uio.uio_resid = tls_comp_len + iov[iovcnt + 1].iov_len; + uio.uio_iovcnt = iniovcnt + 1; + uio.uio_resid = tls_comp_len + iov[iniovcnt + 1].iov_len; KASSERT(uio.uio_resid % AES_BLOCK_LEN == 0, ("invalid encryption size")); @@ -297,10 +298,10 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, memcpy(crp.crp_iv, hdr + 1, AES_BLOCK_LEN); crypto_use_uio(&crp, &uio); if (!inplace) { - memcpy(out_iov, outiov, sizeof(*iniov) * iovcnt); - out_iov[iovcnt] = iov[iovcnt + 1]; + memcpy(out_iov, outiov, sizeof(*iniov) * outiovcnt); + out_iov[outiovcnt] = iov[outiovcnt + 1]; out_uio.uio_iov = out_iov; - out_uio.uio_iovcnt = iovcnt + 1; + out_uio.uio_iovcnt = outiovcnt + 1; out_uio.uio_offset = 0; out_uio.uio_segflg = UIO_SYSSPACE; out_uio.uio_td = curthread; @@ -338,14 +339,14 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, static int ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, - struct iovec *outiov, int iovcnt, uint64_t seqno, + struct iovec *outiov, int iniovcnt, int outiovcnt, uint64_t seqno, uint8_t record_type __unused) { struct uio uio, out_uio, *tag_uio; struct tls_aead_data ad; struct cryptop crp; struct ocf_session *os; - struct iovec iov[iovcnt + 1]; + struct iovec iov[outiovcnt + 1]; int i, error; uint16_t tls_comp_len; bool inplace; @@ -353,13 +354,13 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, os = tls->cipher; uio.uio_iov = iniov; - uio.uio_iovcnt = iovcnt; + uio.uio_iovcnt = iniovcnt; uio.uio_offset = 0; uio.uio_segflg = UIO_SYSSPACE; uio.uio_td = curthread; out_uio.uio_iov = outiov; - out_uio.uio_iovcnt = iovcnt; + out_uio.uio_iovcnt = outiovcnt; out_uio.uio_offset = 0; out_uio.uio_segflg = UIO_SYSSPACE; out_uio.uio_td = curthread; @@ -396,10 +397,11 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, crp.crp_aad_length = sizeof(ad); /* Compute payload length and determine if encryption is in place. */ - inplace = true; + inplace = iniovcnt == outiovcnt; crp.crp_payload_start = 0; - for (i = 0; i < iovcnt; i++) { - if (iniov[i].iov_base != outiov[i].iov_base) + for (i = 0; i < iniovcnt; i++) { + if (inplace && + (i >= outiovcnt || iniov[i].iov_base != outiov[i].iov_base)) inplace = false; crp.crp_payload_length += iniov[i].iov_len; } @@ -412,9 +414,9 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, tag_uio = &out_uio; /* Duplicate iovec and append vector for tag. */ - memcpy(iov, tag_uio->uio_iov, iovcnt * sizeof(struct iovec)); - iov[iovcnt].iov_base = trailer; - iov[iovcnt].iov_len = AES_GMAC_HASH_LEN; + memcpy(iov, tag_uio->uio_iov, outiovcnt * sizeof(struct iovec)); + iov[outiovcnt].iov_base = trailer; + iov[outiovcnt].iov_len = AES_GMAC_HASH_LEN; tag_uio->uio_iov = iov; tag_uio->uio_iovcnt++; crp.crp_digest_start = tag_uio->uio_resid; @@ -510,14 +512,15 @@ ktls_ocf_tls12_aead_decrypt(struct ktls_session *tls, static int ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, - struct iovec *outiov, int iovcnt, uint64_t seqno, uint8_t record_type) + struct iovec *outiov, int iniovcnt, int outiovcnt, uint64_t seqno, + uint8_t record_type) { struct uio uio, out_uio; struct tls_aead_data_13 ad; char nonce[12]; struct cryptop crp; struct ocf_session *os; - struct iovec iov[iovcnt + 1], out_iov[iovcnt + 1]; + struct iovec iov[iniovcnt + 1], out_iov[outiovcnt + 1]; int i, error; bool inplace; @@ -538,10 +541,11 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, crp.crp_aad_length = sizeof(ad); /* Compute payload length and determine if encryption is in place. */ - inplace = true; + inplace = iniovcnt == outiovcnt; crp.crp_payload_start = 0; - for (i = 0; i < iovcnt; i++) { - if (iniov[i].iov_base != outiov[i].iov_base) + for (i = 0; i < iniovcnt; i++) { + if (inplace && (i >= outiovcnt || + iniov[i].iov_base != outiov[i].iov_base)) inplace = false; crp.crp_payload_length += iniov[i].iov_len; } @@ -556,11 +560,11 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, * include the full trailer as input to get the record_type * even if only the first byte is used. */ - memcpy(iov, iniov, iovcnt * sizeof(*iov)); - iov[iovcnt].iov_base = trailer; - iov[iovcnt].iov_len = tls->params.tls_tlen; + memcpy(iov, iniov, iniovcnt * sizeof(*iov)); + iov[iniovcnt].iov_base = trailer; + iov[iniovcnt].iov_len = tls->params.tls_tlen; uio.uio_iov = iov; - uio.uio_iovcnt = iovcnt + 1; + uio.uio_iovcnt = iniovcnt + 1; uio.uio_offset = 0; uio.uio_resid = crp.crp_payload_length + tls->params.tls_tlen - 1; uio.uio_segflg = UIO_SYSSPACE; @@ -569,11 +573,11 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_session *tls, if (!inplace) { /* Duplicate the output iov to append the trailer. */ - memcpy(out_iov, outiov, iovcnt * sizeof(*out_iov)); - out_iov[iovcnt] = iov[iovcnt]; + memcpy(out_iov, outiov, outiovcnt * sizeof(*out_iov)); + out_iov[outiovcnt] = iov[outiovcnt]; out_uio.uio_iov = out_iov; - out_uio.uio_iovcnt = iovcnt + 1; + out_uio.uio_iovcnt = outiovcnt + 1; out_uio.uio_offset = 0; out_uio.uio_resid = crp.crp_payload_length + tls->params.tls_tlen - 1; diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index d3da1286403c..3c43a23af04f 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -164,7 +164,7 @@ struct tls_session_params { #define KTLS_TX 1 #define KTLS_RX 2 -#define KTLS_API_VERSION 7 +#define KTLS_API_VERSION 8 struct iovec; struct ktls_session; @@ -186,8 +186,8 @@ struct ktls_session { union { int (*sw_encrypt)(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, - struct iovec *src, struct iovec *dst, int iovcnt, - uint64_t seqno, uint8_t record_type); + struct iovec *src, struct iovec *dst, int srciovcnt, + int dstiovcnt, uint64_t seqno, uint8_t record_type); int (*sw_decrypt)(struct ktls_session *tls, const struct tls_record_layer *hdr, struct mbuf *m, uint64_t seqno, int *trailer_len); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 22:45:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F35F955365B; Wed, 3 Mar 2021 22: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 4DrTbj6XcTz3hjN; Wed, 3 Mar 2021 22: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 D32DD121B4; Wed, 3 Mar 2021 22: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 123MjLXs044148; Wed, 3 Mar 2021 22: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 123MjLYY044147; Wed, 3 Mar 2021 22:45:21 GMT (envelope-from git) Date: Wed, 3 Mar 2021 22:45:21 GMT Message-Id: <202103032245.123MjLYY044147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 6241b57131a6 - main - hid: add opt_hid.h to modules that use HID_DEBUG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6241b57131a60bc2bd0eda41c145aa9659c2886b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 22:45:22 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6241b57131a60bc2bd0eda41c145aa9659c2886b commit 6241b57131a60bc2bd0eda41c145aa9659c2886b Author: Vladimir Kondratyev AuthorDate: 2021-03-03 22:21:15 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-03-03 22:43:29 +0000 hid: add opt_hid.h to modules that use HID_DEBUG Submitted by: Greg V Reviewed by: imp, wulf MFC after: 1 week Differential revision: https://reviews.freebsd.org/D28995 --- sys/dev/hid/hconf.c | 2 ++ sys/dev/hid/hkbd.c | 1 + sys/modules/hid/hconf/Makefile | 1 + sys/modules/hid/hkbd/Makefile | 2 +- sys/modules/hid/ps4dshock/Makefile | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/hid/hconf.c b/sys/dev/hid/hconf.c index cb0465e71b3e..90cd52d3116c 100644 --- a/sys/dev/hid/hconf.c +++ b/sys/dev/hid/hconf.c @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); * https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections */ +#include "opt_hid.h" + #include #include #include diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 89325f9b2499..775ad677f4de 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ +#include "opt_hid.h" #include "opt_kbd.h" #include "opt_hkbd.h" #include "opt_evdev.h" diff --git a/sys/modules/hid/hconf/Makefile b/sys/modules/hid/hconf/Makefile index 1e5c68fe1848..0ac8d969cd71 100644 --- a/sys/modules/hid/hconf/Makefile +++ b/sys/modules/hid/hconf/Makefile @@ -4,6 +4,7 @@ KMOD= hconf SRCS= hconf.c +SRCS+= opt_hid.h SRCS+= bus_if.h device_if.h .include diff --git a/sys/modules/hid/hkbd/Makefile b/sys/modules/hid/hkbd/Makefile index 38221227d1cd..8bb1c339ac6c 100644 --- a/sys/modules/hid/hkbd/Makefile +++ b/sys/modules/hid/hkbd/Makefile @@ -4,7 +4,7 @@ KMOD= hkbd SRCS= hkbd.c -SRCS+= opt_evdev.h opt_kbd.h opt_hkbd.h +SRCS+= opt_hid.h opt_evdev.h opt_kbd.h opt_hkbd.h SRCS+= bus_if.h device_if.h .include diff --git a/sys/modules/hid/ps4dshock/Makefile b/sys/modules/hid/ps4dshock/Makefile index 688494f33ac6..ab46ba3f2363 100644 --- a/sys/modules/hid/ps4dshock/Makefile +++ b/sys/modules/hid/ps4dshock/Makefile @@ -4,6 +4,7 @@ KMOD= ps4dshock SRCS= ps4dshock.c +SRCS+= opt_hid.h SRCS+= bus_if.h device_if.h usbdevs.h .include From owner-dev-commits-src-all@freebsd.org Wed Mar 3 22:47:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38C6C55399B; Wed, 3 Mar 2021 22:47:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrTff16PGz3j6N; Wed, 3 Mar 2021 22:47:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18E1412392; Wed, 3 Mar 2021 22:47: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 123Mlr82044624; Wed, 3 Mar 2021 22:47:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123Mlrmg044623; Wed, 3 Mar 2021 22:47:53 GMT (envelope-from git) Date: Wed, 3 Mar 2021 22:47:53 GMT Message-Id: <202103032247.123Mlrmg044623@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: e6cfd2939a42 - main - Remove the usr/tests/usr.bin/yacc/yacc directory when removing yacc. 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: e6cfd2939a4261c1f4bf802368cea8faf824c128 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 22:47:54 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e6cfd2939a4261c1f4bf802368cea8faf824c128 commit e6cfd2939a4261c1f4bf802368cea8faf824c128 Author: John Baldwin AuthorDate: 2021-03-03 22:46:45 +0000 Commit: John Baldwin CommitDate: 2021-03-03 22:46:45 +0000 Remove the usr/tests/usr.bin/yacc/yacc directory when removing yacc. MFC after: 1 week --- tools/build/mk/OptionalObsoleteFiles.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 5984645cbc14..44cd4a4281e7 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -9164,6 +9164,7 @@ OLD_FILES+=usr/tests/usr.bin/yacc/yacc/varsyntax_calc1.output OLD_FILES+=usr/tests/usr.bin/yacc/yacc/varsyntax_calc1.tab.c OLD_FILES+=usr/tests/usr.bin/yacc/yacc/varsyntax_calc1.tab.h OLD_FILES+=usr/tests/usr.bin/yacc/yacc_tests +OLD_DIRS+=usr/tests/usr.bin/yacc/yacc OLD_DIRS+=usr/tests/usr.bin/yacc .endif From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:16:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87B3D553D73; Wed, 3 Mar 2021 23:16: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 4DrVHb3TY6z3kJQ; Wed, 3 Mar 2021 23:16: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 6A27C1236F; Wed, 3 Mar 2021 23:16: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 123NGR1s084402; Wed, 3 Mar 2021 23:16:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123NGRLt084401; Wed, 3 Mar 2021 23:16:27 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:16:27 GMT Message-Id: <202103032316.123NGRLt084401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 645eaa2ccaed - main - libkvm: Plug couple of memory leaks and check possible calloc(3) failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 645eaa2ccaed6eea801d07d6a092974fc1713896 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:16:27 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=645eaa2ccaed6eea801d07d6a092974fc1713896 commit 645eaa2ccaed6eea801d07d6a092974fc1713896 Author: Jung-uk Kim AuthorDate: 2021-03-03 23:10:00 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-03 23:10:00 +0000 libkvm: Plug couple of memory leaks and check possible calloc(3) failure First, r204494 introduced dpcpu_off in struct __kvm and it was allocated from _kvm_dpcpu_init() but it was not free(3)'ed from kvm_close(3). Second, r291406 introduced kvm_nlist2(3) and converted kvm_nlist(3) to use the new function but it did not free the temporary buffer. Also, check possible calloc(3) failure while I am in the neighborhood. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29019 --- lib/libkvm/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 95c5a580a2dd..2905302f32f2 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -301,6 +301,8 @@ kvm_close(kvm_t *kd) free(kd->pt_map); if (kd->page_map != NULL) free(kd->page_map); + if (kd->dpcpu_initialized != 0) + free(kd->dpcpu_off); if (kd->sparse_map != MAP_FAILED) munmap(kd->sparse_map, kd->pt_sparse_size); free((void *)kd); @@ -340,6 +342,10 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) if (count == 0) return (0); kl = calloc(count + 1, sizeof(*kl)); + if (kl == NULL) { + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (-1); + } for (i = 0; i < count; i++) kl[i].n_name = nl[i].n_name; nfail = kvm_nlist2(kd, kl); @@ -349,6 +355,7 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) nl[i].n_desc = 0; nl[i].n_value = kl[i].n_value; } + free(kl); return (nfail); } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:21:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D31C5544F0; Wed, 3 Mar 2021 23:21: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 4DrVPG0rBHz3l3p; Wed, 3 Mar 2021 23:21: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 0FC25129B2; Wed, 3 Mar 2021 23:21: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 123NLLWf093467; Wed, 3 Mar 2021 23:21:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123NLLKu093466; Wed, 3 Mar 2021 23:21:21 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:21:21 GMT Message-Id: <202103032321.123NLLKu093466@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: 68c03734484f - main - cryptocheck: Add support for the Poly1305 digest. 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: 68c03734484f679bf2f15fc81359128e331db364 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:21:22 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=68c03734484f679bf2f15fc81359128e331db364 commit 68c03734484f679bf2f15fc81359128e331db364 Author: John Baldwin AuthorDate: 2021-03-03 23:17:00 +0000 Commit: John Baldwin CommitDate: 2021-03-03 23:20:56 +0000 cryptocheck: Add support for the Poly1305 digest. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28758 --- tools/tools/crypto/cryptocheck.c | 90 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 85 insertions(+), 5 deletions(-) diff --git a/tools/tools/crypto/cryptocheck.c b/tools/tools/crypto/cryptocheck.c index fc08396b45f5..389d0cc9f610 100644 --- a/tools/tools/crypto/cryptocheck.c +++ b/tools/tools/crypto/cryptocheck.c @@ -98,6 +98,7 @@ * gmac 128-bit GMAC * gmac192 192-bit GMAC * gmac256 256-bit GMAC + * poly1305 * * Ciphers: * aes-cbc 128-bit AES-CBC @@ -149,10 +150,12 @@ static const struct alg { const char *name; int cipher; int mac; - enum { T_HASH, T_HMAC, T_GMAC, T_CIPHER, T_ETA, T_AEAD } type; + enum { T_HASH, T_HMAC, T_GMAC, T_DIGEST, T_CIPHER, T_ETA, T_AEAD } type; + int key_len; int tag_len; const EVP_CIPHER *(*evp_cipher)(void); const EVP_MD *(*evp_md)(void); + int pkey; } algs[] = { { .name = "sha1", .mac = CRYPTO_SHA1, .type = T_HASH, .evp_md = EVP_sha1 }, @@ -184,6 +187,8 @@ static const struct alg { .tag_len = AES_GMAC_HASH_LEN, .evp_cipher = EVP_aes_192_gcm }, { .name = "gmac256", .mac = CRYPTO_AES_NIST_GMAC, .type = T_GMAC, .tag_len = AES_GMAC_HASH_LEN, .evp_cipher = EVP_aes_256_gcm }, + { .name = "poly1305", .mac = CRYPTO_POLY1305, .type = T_DIGEST, + .key_len = POLY1305_KEY_LEN, .pkey = EVP_PKEY_POLY1305 }, { .name = "aes-cbc", .cipher = CRYPTO_AES_CBC, .type = T_CIPHER, .evp_cipher = EVP_aes_128_cbc }, { .name = "aes-cbc192", .cipher = CRYPTO_AES_CBC, .type = T_CIPHER, @@ -1061,7 +1066,7 @@ openssl_gmac(const struct alg *alg, const EVP_CIPHER *cipher, const char *key, } static bool -ocf_gmac(const struct alg *alg, const char *input, size_t size, const char *key, +ocf_mac(const struct alg *alg, const char *input, size_t size, const char *key, size_t key_len, const char *iv, char *tag, int *cridp) { struct ocf_session ses; @@ -1072,7 +1077,7 @@ ocf_gmac(const struct alg *alg, const char *input, size_t size, const char *key, sop.mackeylen = key_len; sop.mackey = key; sop.mac = alg->mac; - if (!ocf_init_session(&sop, "GMAC", alg->name, &ses)) + if (!ocf_init_session(&sop, "MAC", alg->name, &ses)) return (false); ocf_init_cop(&ses, &cop); @@ -1119,7 +1124,78 @@ run_gmac_test(const struct alg *alg, size_t size) openssl_gmac(alg, cipher, key, iv, buffer, size, control_tag); /* OCF GMAC. */ - if (!ocf_gmac(alg, buffer, size, key, key_len, iv, test_tag, &crid)) + if (!ocf_mac(alg, buffer, size, key, key_len, iv, test_tag, &crid)) + goto out; + if (memcmp(control_tag, test_tag, sizeof(control_tag)) != 0) { + printf("%s (%zu) mismatch:\n", alg->name, size); + printf("control:\n"); + hexdump(control_tag, sizeof(control_tag), NULL, 0); + printf("test (cryptodev device %s):\n", crfind(crid)); + hexdump(test_tag, sizeof(test_tag), NULL, 0); + goto out; + } + + if (verbose) + printf("%s (%zu) matched (cryptodev device %s)\n", + alg->name, size, crfind(crid)); + +out: + free(buffer); + free(key); +} + +static void +openssl_digest(const struct alg *alg, const char *key, u_int key_len, + const char *input, size_t size, char *tag, u_int tag_len) +{ + EVP_MD_CTX *mdctx; + EVP_PKEY *pkey; + size_t len; + + pkey = EVP_PKEY_new_raw_private_key(alg->pkey, NULL, key, key_len); + if (pkey == NULL) + errx(1, "OpenSSL %s (%zu) pkey new failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); + mdctx = EVP_MD_CTX_new(); + if (mdctx == NULL) + errx(1, "OpenSSL %s (%zu) ctx new failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); + if (EVP_DigestSignInit(mdctx, NULL, NULL, NULL, pkey) != 1) + errx(1, "OpenSSL %s (%zu) digest sign init failed: %s", + alg->name, size, ERR_error_string(ERR_get_error(), NULL)); + if (EVP_DigestSignUpdate(mdctx, input, size) != 1) + errx(1, "OpenSSL %s (%zu) digest update failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); + len = tag_len; + if (EVP_DigestSignFinal(mdctx, tag, &len) != 1) + errx(1, "OpenSSL %s (%zu) digest final failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); + EVP_MD_CTX_free(mdctx); + EVP_PKEY_free(pkey); +} + +static void +run_digest_test(const struct alg *alg, size_t size) +{ + char *key, *buffer; + u_int key_len; + int crid; + char control_tag[EVP_MAX_MD_SIZE], test_tag[EVP_MAX_MD_SIZE]; + + memset(control_tag, 0x3c, sizeof(control_tag)); + memset(test_tag, 0x3c, sizeof(test_tag)); + + key_len = alg->key_len; + + key = alloc_buffer(key_len); + buffer = alloc_buffer(size); + + /* OpenSSL Poly1305. */ + openssl_digest(alg, key, key_len, buffer, size, control_tag, + sizeof(control_tag)); + + /* OCF Poly1305. */ + if (!ocf_mac(alg, buffer, size, key, key_len, NULL, test_tag, &crid)) goto out; if (memcmp(control_tag, test_tag, sizeof(control_tag)) != 0) { printf("%s (%zu) mismatch:\n", alg->name, size); @@ -1471,6 +1547,9 @@ run_test(const struct alg *alg, size_t aad_len, size_t size) case T_GMAC: run_gmac_test(alg, size); break; + case T_DIGEST: + run_digest_test(alg, size); + break; case T_CIPHER: run_cipher_test(alg, size); break; @@ -1518,7 +1597,8 @@ run_mac_tests(void) u_int i; for (i = 0; i < nitems(algs); i++) - if (algs[i].type == T_HMAC || algs[i].type == T_GMAC) + if (algs[i].type == T_HMAC || algs[i].type == T_GMAC || + algs[i].type == T_DIGEST) run_test_sizes(&algs[i]); } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:21:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4935C55466A; Wed, 3 Mar 2021 23:21: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 4DrVPH1cTWz3kr7; Wed, 3 Mar 2021 23:21: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 29BE312450; Wed, 3 Mar 2021 23:21: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 123NLN9d093490; Wed, 3 Mar 2021 23:21:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123NLNre093489; Wed, 3 Mar 2021 23:21:23 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:21:23 GMT Message-Id: <202103032321.123NLNre093489@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: 442a29361146 - main - cryptocheck: Free generated IV after each GMAC test. 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: 442a293611461834778d1b7cd2ac170fb3427dcf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:21:23 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=442a293611461834778d1b7cd2ac170fb3427dcf commit 442a293611461834778d1b7cd2ac170fb3427dcf Author: John Baldwin AuthorDate: 2021-03-03 23:17:19 +0000 Commit: John Baldwin CommitDate: 2021-03-03 23:20:57 +0000 cryptocheck: Free generated IV after each GMAC test. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28753 --- tools/tools/crypto/cryptocheck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/crypto/cryptocheck.c b/tools/tools/crypto/cryptocheck.c index 389d0cc9f610..bd075d24e0f5 100644 --- a/tools/tools/crypto/cryptocheck.c +++ b/tools/tools/crypto/cryptocheck.c @@ -1141,6 +1141,7 @@ run_gmac_test(const struct alg *alg, size_t size) out: free(buffer); + free(iv); free(key); } From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:21:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C4CA55471D; Wed, 3 Mar 2021 23:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrVPJ2VV1z3krC; Wed, 3 Mar 2021 23:21: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 46A011281E; Wed, 3 Mar 2021 23:21: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 123NLOWf093508; Wed, 3 Mar 2021 23:21:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123NLOKb093507; Wed, 3 Mar 2021 23:21:24 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:21:24 GMT Message-Id: <202103032321.123NLOKb093507@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: a079e38b08f2 - main - ossl: Add Poly1305 digest support. 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: a079e38b08f2f07c50ba915dae66d099559abdcc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:21:24 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a079e38b08f2f07c50ba915dae66d099559abdcc commit a079e38b08f2f07c50ba915dae66d099559abdcc Author: John Baldwin AuthorDate: 2021-03-03 23:17:29 +0000 Commit: John Baldwin CommitDate: 2021-03-03 23:20:57 +0000 ossl: Add Poly1305 digest support. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28754 --- share/man/man4/ossl.4 | 4 +- sys/conf/files | 1 + sys/conf/files.amd64 | 1 + sys/conf/files.arm64 | 2 + sys/conf/files.i386 | 1 + sys/crypto/openssl/ossl.c | 46 ++++++---- sys/crypto/openssl/ossl.h | 3 +- sys/crypto/openssl/ossl_poly1305.c | 181 +++++++++++++++++++++++++++++++++++++ sys/crypto/openssl/ossl_poly1305.h | 35 +++++++ sys/modules/ossl/Makefile | 4 + 10 files changed, 260 insertions(+), 18 deletions(-) diff --git a/share/man/man4/ossl.4 b/share/man/man4/ossl.4 index ce97a9fc0f71..9c0d7f897d53 100644 --- a/share/man/man4/ossl.4 +++ b/share/man/man4/ossl.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2020 +.Dd March 3, 2021 .Dt OSSL 4 .Os .Sh NAME @@ -74,6 +74,8 @@ driver includes support for the following algorithms: .Pp .Bl -bullet -compact .It +Poly1305 +.It SHA1 .It SHA1-HMAC diff --git a/sys/conf/files b/sys/conf/files index 21990a4a762c..679e76d50d44 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -739,6 +739,7 @@ crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support crypto/des/des_ecb.c optional netsmb crypto/des/des_setkey.c optional netsmb crypto/openssl/ossl.c optional ossl +crypto/openssl/ossl_poly1305.c optional ossl crypto/openssl/ossl_sha1.c optional ossl crypto/openssl/ossl_sha256.c optional ossl crypto/openssl/ossl_sha512.c optional ossl diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index f0c863e0bd2f..d589e5d51367 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -137,6 +137,7 @@ cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni crypto/des/des_enc.c optional netsmb +crypto/openssl/amd64/poly1305-x86_64.S optional ossl crypto/openssl/amd64/sha1-x86_64.S optional ossl crypto/openssl/amd64/sha256-x86_64.S optional ossl crypto/openssl/amd64/sha512-x86_64.S optional ossl diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 3ca830f64f05..b87202eaf887 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -125,6 +125,8 @@ ghashv8-armx.o optional armv8crypto \ crypto/des/des_enc.c optional netsmb crypto/openssl/ossl_aarch64.c optional ossl +crypto/openssl/aarch64/poly1305-armv8.S optional ossl \ + compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}" crypto/openssl/aarch64/sha1-armv8.S optional ossl \ compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}" crypto/openssl/aarch64/sha256-armv8.S optional ossl \ diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 1e2ab5f8c52a..06fb2d8dc0e1 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -77,6 +77,7 @@ compat/linux/linux_vdso.c optional compat_linux compat/linux/linux.c optional compat_linux crypto/aesni/aeskeys_i386.S optional aesni crypto/des/arch/i386/des_enc.S optional netsmb +crypto/openssl/i386/poly1305-x86.S optional ossl crypto/openssl/i386/sha1-586.S optional ossl crypto/openssl/i386/sha256-586.S optional ossl crypto/openssl/i386/sha512-586.S optional ossl diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c index 35f19c9fbca7..229729c27c21 100644 --- a/sys/crypto/openssl/ossl.c +++ b/sys/crypto/openssl/ossl.c @@ -135,6 +135,8 @@ ossl_lookup_hash(const struct crypto_session_params *csp) case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: return (&ossl_hash_sha512); + case CRYPTO_POLY1305: + return (&ossl_hash_poly1305); default: return (NULL); } @@ -159,14 +161,6 @@ ossl_probesession(device_t dev, const struct crypto_session_params *csp) return (CRYPTODEV_PROBE_ACCEL_SOFTWARE); } -static void -ossl_setkey_hmac(struct ossl_session *s, const void *key, int klen) -{ - - hmac_init_ipad(s->hash.axf, key, klen, &s->hash.ictx); - hmac_init_opad(s->hash.axf, key, klen, &s->hash.octx); -} - static int ossl_newsession(device_t dev, crypto_session_t cses, const struct crypto_session_params *csp) @@ -188,8 +182,16 @@ ossl_newsession(device_t dev, crypto_session_t cses, } else { if (csp->csp_auth_key != NULL) { fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); - ossl_setkey_hmac(s, csp->csp_auth_key, - csp->csp_auth_klen); + if (axf->Setkey != NULL) { + axf->Init(&s->hash.ictx); + axf->Setkey(&s->hash.ictx, csp->csp_auth_key, + csp->csp_auth_klen); + } else { + hmac_init_ipad(axf, csp->csp_auth_key, + csp->csp_auth_klen, &s->hash.ictx); + hmac_init_opad(axf, csp->csp_auth_key, + csp->csp_auth_klen, &s->hash.octx); + } fpu_kern_leave(curthread, NULL); } } @@ -218,10 +220,18 @@ ossl_process(device_t dev, struct cryptop *crp, int hint) fpu_entered = true; } - if (crp->crp_auth_key != NULL) - ossl_setkey_hmac(s, crp->crp_auth_key, csp->csp_auth_klen); - - ctx = s->hash.ictx; + if (crp->crp_auth_key == NULL) { + ctx = s->hash.ictx; + } else { + if (axf->Setkey != NULL) { + axf->Init(&ctx); + axf->Setkey(&ctx, crp->crp_auth_key, + csp->csp_auth_klen); + } else { + hmac_init_ipad(axf, crp->crp_auth_key, + csp->csp_auth_klen, &ctx); + } + } if (crp->crp_aad != NULL) error = axf->Update(&ctx, crp->crp_aad, crp->crp_aad_length); @@ -238,8 +248,12 @@ ossl_process(device_t dev, struct cryptop *crp, int hint) axf->Final(digest, &ctx); - if (csp->csp_auth_klen != 0) { - ctx = s->hash.octx; + if (csp->csp_auth_klen != 0 && axf->Setkey == NULL) { + if (crp->crp_auth_key == NULL) + ctx = s->hash.octx; + else + hmac_init_opad(axf, crp->crp_auth_key, + csp->csp_auth_klen, &ctx); axf->Update(&ctx, digest, axf->hashsize); axf->Final(digest, &ctx); } diff --git a/sys/crypto/openssl/ossl.h b/sys/crypto/openssl/ossl.h index 533d497f1be3..55022b10f377 100644 --- a/sys/crypto/openssl/ossl.h +++ b/sys/crypto/openssl/ossl.h @@ -38,9 +38,10 @@ void ossl_cpuid(void); /* Needs to be big enough to hold any hash context. */ struct ossl_hash_context { - uint32_t dummy[54]; + uint32_t dummy[61]; } __aligned(32); +extern struct auth_hash ossl_hash_poly1305; extern struct auth_hash ossl_hash_sha1; extern struct auth_hash ossl_hash_sha224; extern struct auth_hash ossl_hash_sha256; diff --git a/sys/crypto/openssl/ossl_poly1305.c b/sys/crypto/openssl/ossl_poly1305.c new file mode 100644 index 000000000000..8f8c5bc4b6e7 --- /dev/null +++ b/sys/crypto/openssl/ossl_poly1305.c @@ -0,0 +1,181 @@ +/* + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include + +#include +#include + +#include +#include + +#define POLY1305_ASM + +/* From crypto/poly1305/poly1305.c */ + +/* pick 32-bit unsigned integer in little endian order */ +static unsigned int U8TOU32(const unsigned char *p) +{ + return (((unsigned int)(p[0] & 0xff)) | + ((unsigned int)(p[1] & 0xff) << 8) | + ((unsigned int)(p[2] & 0xff) << 16) | + ((unsigned int)(p[3] & 0xff) << 24)); +} + +/* + * Implementations can be classified by amount of significant bits in + * words making up the multi-precision value, or in other words radix + * or base of numerical representation, e.g. base 2^64, base 2^32, + * base 2^26. Complementary characteristic is how wide is the result of + * multiplication of pair of digits, e.g. it would take 128 bits to + * accommodate multiplication result in base 2^64 case. These are used + * interchangeably. To describe implementation that is. But interface + * is designed to isolate this so that low-level primitives implemented + * in assembly can be self-contained/self-coherent. + */ +int poly1305_init(void *ctx, const unsigned char key[16], void *func); +void poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, + unsigned int padbit); +void poly1305_emit(void *ctx, unsigned char mac[16], + const unsigned int nonce[4]); + +static void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32]) +{ + ctx->nonce[0] = U8TOU32(&key[16]); + ctx->nonce[1] = U8TOU32(&key[20]); + ctx->nonce[2] = U8TOU32(&key[24]); + ctx->nonce[3] = U8TOU32(&key[28]); + + /* + * Unlike reference poly1305_init assembly counterpart is expected + * to return a value: non-zero if it initializes ctx->func, and zero + * otherwise. Latter is to simplify assembly in cases when there no + * multiple code paths to switch between. + */ + if (!poly1305_init(ctx->opaque, key, &ctx->func)) { + ctx->func.blocks = poly1305_blocks; + ctx->func.emit = poly1305_emit; + } + + ctx->num = 0; + +} + +#ifdef POLY1305_ASM +/* + * This "eclipses" poly1305_blocks and poly1305_emit, but it's + * conscious choice imposed by -Wshadow compiler warnings. + */ +# define poly1305_blocks (*poly1305_blocks_p) +# define poly1305_emit (*poly1305_emit_p) +#endif + +static void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) +{ +#ifdef POLY1305_ASM + /* + * As documented, poly1305_blocks is never called with input + * longer than single block and padbit argument set to 0. This + * property is fluently used in assembly modules to optimize + * padbit handling on loop boundary. + */ + poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks; +#endif + size_t rem, num; + + if ((num = ctx->num)) { + rem = POLY1305_BLOCK_SIZE - num; + if (len >= rem) { + memcpy(ctx->data + num, inp, rem); + poly1305_blocks(ctx->opaque, ctx->data, POLY1305_BLOCK_SIZE, 1); + inp += rem; + len -= rem; + } else { + /* Still not enough data to process a block. */ + memcpy(ctx->data + num, inp, len); + ctx->num = num + len; + return; + } + } + + rem = len % POLY1305_BLOCK_SIZE; + len -= rem; + + if (len >= POLY1305_BLOCK_SIZE) { + poly1305_blocks(ctx->opaque, inp, len, 1); + inp += len; + } + + if (rem) + memcpy(ctx->data, inp, rem); + + ctx->num = rem; +} + +static void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) +{ +#ifdef POLY1305_ASM + poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks; + poly1305_emit_f poly1305_emit_p = ctx->func.emit; +#endif + size_t num; + + if ((num = ctx->num)) { + ctx->data[num++] = 1; /* pad bit */ + while (num < POLY1305_BLOCK_SIZE) + ctx->data[num++] = 0; + poly1305_blocks(ctx->opaque, ctx->data, POLY1305_BLOCK_SIZE, 0); + } + + poly1305_emit(ctx->opaque, mac, ctx->nonce); + + /* zero out the state */ + OPENSSL_cleanse(ctx, sizeof(*ctx)); +} + +static void +ossl_poly1305_init(void *vctx) +{ +} + +static void +ossl_poly1305_setkey(void *vctx, const uint8_t *key, u_int klen) +{ + MPASS(klen == 32); + Poly1305_Init(vctx, key); +} + +static int +ossl_poly1305_update(void *vctx, const void *buf, u_int len) +{ + Poly1305_Update(vctx, buf, len); + return (0); +} + +static void +ossl_poly1305_final(uint8_t *digest, void *vctx) +{ + Poly1305_Final(vctx, digest); +} + +struct auth_hash ossl_hash_poly1305 = { + .type = CRYPTO_POLY1305, + .name = "OpenSSL-Poly1305", + .hashsize = POLY1305_HASH_LEN, + .ctxsize = sizeof(struct poly1305_context), + .blocksize = POLY1305_BLOCK_SIZE, + .Init = ossl_poly1305_init, + .Setkey = ossl_poly1305_setkey, + .Update = ossl_poly1305_update, + .Final = ossl_poly1305_final, +}; + +_Static_assert(sizeof(struct poly1305_context) <= + sizeof(struct ossl_hash_context), "ossl_hash_context too small"); diff --git a/sys/crypto/openssl/ossl_poly1305.h b/sys/crypto/openssl/ossl_poly1305.h new file mode 100644 index 000000000000..d1b2db6d5cba --- /dev/null +++ b/sys/crypto/openssl/ossl_poly1305.h @@ -0,0 +1,35 @@ +/* + * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* From include/crypto/poly1305.h */ + +#define POLY1305_BLOCK_SIZE 16 + +typedef struct poly1305_context POLY1305; + +/* From crypto/poly1305/poly1305_local.h */ + +typedef void (*poly1305_blocks_f) (void *ctx, const unsigned char *inp, + size_t len, unsigned int padbit); +typedef void (*poly1305_emit_f) (void *ctx, unsigned char mac[16], + const unsigned int nonce[4]); + +struct poly1305_context { + double opaque[24]; /* large enough to hold internal state, declared + * 'double' to ensure at least 64-bit invariant + * alignment across all platforms and + * configurations */ + unsigned int nonce[4]; + unsigned char data[POLY1305_BLOCK_SIZE]; + size_t num; + struct { + poly1305_blocks_f blocks; + poly1305_emit_f emit; + } func; +}; diff --git a/sys/modules/ossl/Makefile b/sys/modules/ossl/Makefile index 6fe8c5a6c812..2ddebefebd1a 100644 --- a/sys/modules/ossl/Makefile +++ b/sys/modules/ossl/Makefile @@ -8,24 +8,28 @@ SRCS= bus_if.h \ cryptodev_if.h \ device_if.h \ ossl.c \ + ossl_poly1305.c \ ossl_sha1.c \ ossl_sha256.c \ ossl_sha512.c \ ${SRCS.${MACHINE_CPUARCH}} SRCS.aarch64= \ + poly1305-armv8.S \ sha1-armv8.S \ sha256-armv8.S \ sha512-armv8.S \ ossl_aarch64.c SRCS.amd64= \ + poly1305-x86_64.S \ sha1-x86_64.S \ sha256-x86_64.S \ sha512-x86_64.S \ ossl_x86.c SRCS.i386= \ + poly1305-x86.S \ sha1-586.S \ sha256-586.S \ sha512-586.S \ From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:21:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 985ED5541E7; Wed, 3 Mar 2021 23:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrVPK4j5Xz3l1x; Wed, 3 Mar 2021 23:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CF701267A; Wed, 3 Mar 2021 23:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 123NLPxx093530; Wed, 3 Mar 2021 23:21:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123NLPOF093529; Wed, 3 Mar 2021 23:21:25 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:21:25 GMT Message-Id: <202103032321.123NLPOF093529@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: a899ce4ba4c4 - main - The ChaCha20 counter is little endian, not big endian. 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: a899ce4ba4c404d342bf892b8b756b66fc65d6b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:21:27 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a899ce4ba4c404d342bf892b8b756b66fc65d6b5 commit a899ce4ba4c404d342bf892b8b756b66fc65d6b5 Author: John Baldwin AuthorDate: 2021-03-03 23:17:37 +0000 Commit: John Baldwin CommitDate: 2021-03-03 23:20:57 +0000 The ChaCha20 counter is little endian, not big endian. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28755 --- share/man/man7/crypto.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/crypto.7 b/share/man/man7/crypto.7 index ccc2d1fc9be3..6e5bd83621aa 100644 --- a/share/man/man7/crypto.7 +++ b/share/man/man7/crypto.7 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 18, 2021 +.Dd March 3, 2021 .Dt CRYPTO 7 .Os .Sh NAME @@ -136,7 +136,7 @@ counter rollover. .Dv CRYPTO_CHACHA20 accepts a 16 byte IV. The first 8 bytes are used as a nonce. -The last 8 bytes are used as 64-bit big-endian block counter. +The last 8 bytes are used as a 64-bit little-endian block counter. .Ss Authenticated Encryption with Associated Data Algorithms AEAD algorithms in OCF combine a stream cipher with an authentication algorithm to provide both secrecy and authentication. From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:21:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEB5D554559; Wed, 3 Mar 2021 23:21: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 4DrVPM0ZbYz3ktg; Wed, 3 Mar 2021 23:21: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 96DD112A28; Wed, 3 Mar 2021 23:21: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 123NLQF1093552; Wed, 3 Mar 2021 23:21:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123NLQGZ093551; Wed, 3 Mar 2021 23:21:26 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:21:26 GMT Message-Id: <202103032321.123NLQGZ093551@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: 92aecd1e6fac - main - ossl: Add ChaCha20 cipher support. 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: 92aecd1e6fac47ffc893f628c1fe289568bb19cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:21:30 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=92aecd1e6fac47ffc893f628c1fe289568bb19cb commit 92aecd1e6fac47ffc893f628c1fe289568bb19cb Author: John Baldwin AuthorDate: 2021-03-03 23:17:43 +0000 Commit: John Baldwin CommitDate: 2021-03-03 23:20:57 +0000 ossl: Add ChaCha20 cipher support. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28756 --- share/man/man4/ossl.4 | 2 + sys/conf/files | 1 + sys/conf/files.amd64 | 1 + sys/conf/files.arm64 | 2 + sys/conf/files.i386 | 1 + sys/crypto/openssl/ossl.c | 82 ++++++++++++++++----- sys/crypto/openssl/ossl.h | 5 ++ sys/crypto/openssl/ossl_chacha.h | 42 +++++++++++ sys/crypto/openssl/ossl_chacha20.c | 141 +++++++++++++++++++++++++++++++++++++ sys/modules/ossl/Makefile | 4 ++ 10 files changed, 262 insertions(+), 19 deletions(-) diff --git a/share/man/man4/ossl.4 b/share/man/man4/ossl.4 index 9c0d7f897d53..2aa4b69eda31 100644 --- a/share/man/man4/ossl.4 +++ b/share/man/man4/ossl.4 @@ -74,6 +74,8 @@ driver includes support for the following algorithms: .Pp .Bl -bullet -compact .It +ChaCha20 +.It Poly1305 .It SHA1 diff --git a/sys/conf/files b/sys/conf/files index 679e76d50d44..60b334f75d3f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -739,6 +739,7 @@ crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support crypto/des/des_ecb.c optional netsmb crypto/des/des_setkey.c optional netsmb crypto/openssl/ossl.c optional ossl +crypto/openssl/ossl_chacha20.c optional ossl crypto/openssl/ossl_poly1305.c optional ossl crypto/openssl/ossl_sha1.c optional ossl crypto/openssl/ossl_sha256.c optional ossl diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index d589e5d51367..c5421f4af4fc 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -137,6 +137,7 @@ cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni crypto/des/des_enc.c optional netsmb +crypto/openssl/amd64/chacha-x86_64.S optional ossl crypto/openssl/amd64/poly1305-x86_64.S optional ossl crypto/openssl/amd64/sha1-x86_64.S optional ossl crypto/openssl/amd64/sha256-x86_64.S optional ossl diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index b87202eaf887..0286ae57b0e0 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -125,6 +125,8 @@ ghashv8-armx.o optional armv8crypto \ crypto/des/des_enc.c optional netsmb crypto/openssl/ossl_aarch64.c optional ossl +crypto/openssl/aarch64/chacha-armv8.S optional ossl \ + compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}" crypto/openssl/aarch64/poly1305-armv8.S optional ossl \ compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}" crypto/openssl/aarch64/sha1-armv8.S optional ossl \ diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 06fb2d8dc0e1..b0827ec0580d 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -77,6 +77,7 @@ compat/linux/linux_vdso.c optional compat_linux compat/linux/linux.c optional compat_linux crypto/aesni/aeskeys_i386.S optional aesni crypto/des/arch/i386/des_enc.S optional netsmb +crypto/openssl/i386/chacha-x86.S optional ossl crypto/openssl/i386/poly1305-x86.S optional ossl crypto/openssl/i386/sha1-586.S optional ossl crypto/openssl/i386/sha256-586.S optional ossl diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c index 229729c27c21..0c863429939c 100644 --- a/sys/crypto/openssl/ossl.c +++ b/sys/crypto/openssl/ossl.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "cryptodev_if.h" @@ -154,6 +155,16 @@ ossl_probesession(device_t dev, const struct crypto_session_params *csp) if (ossl_lookup_hash(csp) == NULL) return (EINVAL); break; + case CSP_MODE_CIPHER: + switch (csp->csp_cipher_alg) { + case CRYPTO_CHACHA20: + if (csp->csp_cipher_klen != CHACHA_KEY_SIZE) + return (EINVAL); + break; + default: + return (EINVAL); + } + break; default: return (EINVAL); } @@ -161,15 +172,12 @@ ossl_probesession(device_t dev, const struct crypto_session_params *csp) return (CRYPTODEV_PROBE_ACCEL_SOFTWARE); } -static int -ossl_newsession(device_t dev, crypto_session_t cses, +static void +ossl_newsession_hash(struct ossl_session *s, const struct crypto_session_params *csp) { - struct ossl_session *s; struct auth_hash *axf; - s = crypto_get_driver_session(cses); - axf = ossl_lookup_hash(csp); s->hash.axf = axf; if (csp->csp_auth_mlen == 0) @@ -195,31 +203,35 @@ ossl_newsession(device_t dev, crypto_session_t cses, fpu_kern_leave(curthread, NULL); } } +} + +static int +ossl_newsession(device_t dev, crypto_session_t cses, + const struct crypto_session_params *csp) +{ + struct ossl_session *s; + + s = crypto_get_driver_session(cses); + switch (csp->csp_mode) { + case CSP_MODE_DIGEST: + ossl_newsession_hash(s, csp); + break; + } + return (0); } static int -ossl_process(device_t dev, struct cryptop *crp, int hint) +ossl_process_hash(struct ossl_session *s, struct cryptop *crp, + const struct crypto_session_params *csp) { struct ossl_hash_context ctx; char digest[HASH_MAX_LEN]; - const struct crypto_session_params *csp; - struct ossl_session *s; struct auth_hash *axf; int error; - bool fpu_entered; - s = crypto_get_driver_session(crp->crp_session); - csp = crypto_get_params(crp->crp_session); axf = s->hash.axf; - if (is_fpu_kern_thread(0)) { - fpu_entered = false; - } else { - fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); - fpu_entered = true; - } - if (crp->crp_auth_key == NULL) { ctx = s->hash.ictx; } else { @@ -273,13 +285,45 @@ ossl_process(device_t dev, struct cryptop *crp, int hint) explicit_bzero(digest, sizeof(digest)); out: + explicit_bzero(&ctx, sizeof(ctx)); + return (error); +} + +static int +ossl_process(device_t dev, struct cryptop *crp, int hint) +{ + const struct crypto_session_params *csp; + struct ossl_session *s; + int error; + bool fpu_entered; + + s = crypto_get_driver_session(crp->crp_session); + csp = crypto_get_params(crp->crp_session); + + if (is_fpu_kern_thread(0)) { + fpu_entered = false; + } else { + fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); + fpu_entered = true; + } + + switch (csp->csp_mode) { + case CSP_MODE_DIGEST: + error = ossl_process_hash(s, crp, csp); + break; + case CSP_MODE_CIPHER: + error = ossl_chacha20(crp, csp); + break; + default: + __assert_unreachable(); + } + if (fpu_entered) fpu_kern_leave(curthread, NULL); crp->crp_etype = error; crypto_done(crp); - explicit_bzero(&ctx, sizeof(ctx)); return (0); } diff --git a/sys/crypto/openssl/ossl.h b/sys/crypto/openssl/ossl.h index 55022b10f377..b7c681d0fb1d 100644 --- a/sys/crypto/openssl/ossl.h +++ b/sys/crypto/openssl/ossl.h @@ -34,6 +34,11 @@ /* Compatibility shims. */ #define OPENSSL_cleanse explicit_bzero +struct cryptop; +struct crypto_session_params; + +int ossl_chacha20(struct cryptop *crp, + const struct crypto_session_params *csp); void ossl_cpuid(void); /* Needs to be big enough to hold any hash context. */ diff --git a/sys/crypto/openssl/ossl_chacha.h b/sys/crypto/openssl/ossl_chacha.h new file mode 100644 index 000000000000..781899c6bdf6 --- /dev/null +++ b/sys/crypto/openssl/ossl_chacha.h @@ -0,0 +1,42 @@ +/* + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* From include/crypto/chacha.h */ + +#ifndef OSSL_CRYPTO_CHACHA_H +#define OSSL_CRYPTO_CHACHA_H + +/* + * ChaCha20_ctr32 encrypts |len| bytes from |inp| with the given key and + * nonce and writes the result to |out|, which may be equal to |inp|. + * The |key| is not 32 bytes of verbatim key material though, but the + * said material collected into 8 32-bit elements array in host byte + * order. Same approach applies to nonce: the |counter| argument is + * pointer to concatenated nonce and counter values collected into 4 + * 32-bit elements. This, passing crypto material collected into 32-bit + * elements as opposite to passing verbatim byte vectors, is chosen for + * efficiency in multi-call scenarios. + */ +void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp, + size_t len, const unsigned int key[8], + const unsigned int counter[4]); +/* + * You can notice that there is no key setup procedure. Because it's + * as trivial as collecting bytes into 32-bit elements, it's reckoned + * that below macro is sufficient. + */ +#define CHACHA_U8TOU32(p) ( \ + ((unsigned int)(p)[0]) | ((unsigned int)(p)[1]<<8) | \ + ((unsigned int)(p)[2]<<16) | ((unsigned int)(p)[3]<<24) ) + +#define CHACHA_KEY_SIZE 32 +#define CHACHA_CTR_SIZE 16 +#define CHACHA_BLK_SIZE 64 + +#endif diff --git a/sys/crypto/openssl/ossl_chacha20.c b/sys/crypto/openssl/ossl_chacha20.c new file mode 100644 index 000000000000..70a0a5718dbd --- /dev/null +++ b/sys/crypto/openssl/ossl_chacha20.c @@ -0,0 +1,141 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Netflix, Inc + * + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include +#include +#include +#include + +#include + +#include +#include + +int +ossl_chacha20(struct cryptop *crp, const struct crypto_session_params *csp) +{ + _Alignas(8) unsigned int key[CHACHA_KEY_SIZE / 4]; + unsigned int counter[CHACHA_CTR_SIZE / 4]; + unsigned char block[CHACHA_BLK_SIZE]; + struct crypto_buffer_cursor cc_in, cc_out; + const unsigned char *in, *inseg, *cipher_key; + unsigned char *out, *outseg; + size_t resid, todo, inlen, outlen; + uint32_t next_counter; + u_int i; + + if (crp->crp_cipher_key != NULL) + cipher_key = crp->crp_cipher_key; + else + cipher_key = csp->csp_cipher_key; + for (i = 0; i < nitems(key); i++) + key[i] = CHACHA_U8TOU32(cipher_key + i * 4); + crypto_read_iv(crp, counter); + for (i = 0; i < nitems(counter); i++) + counter[i] = le32toh(counter[i]); + + resid = crp->crp_payload_length; + crypto_cursor_init(&cc_in, &crp->crp_buf); + crypto_cursor_advance(&cc_in, crp->crp_payload_start); + inseg = crypto_cursor_segbase(&cc_in); + inlen = crypto_cursor_seglen(&cc_in); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + crypto_cursor_init(&cc_out, &crp->crp_obuf); + crypto_cursor_advance(&cc_out, crp->crp_payload_output_start); + } else + cc_out = cc_in; + outseg = crypto_cursor_segbase(&cc_out); + outlen = crypto_cursor_seglen(&cc_out); + while (resid >= CHACHA_BLK_SIZE) { + if (inlen < CHACHA_BLK_SIZE) { + crypto_cursor_copydata(&cc_in, CHACHA_BLK_SIZE, block); + in = block; + inlen = CHACHA_BLK_SIZE; + } else + in = inseg; + if (outlen < CHACHA_BLK_SIZE) { + out = block; + outlen = CHACHA_BLK_SIZE; + } else + out = outseg; + + /* Figure out how many blocks we can encrypt/decrypt at once. */ + todo = rounddown(MIN(inlen, outlen), CHACHA_BLK_SIZE); + +#ifdef __LP64__ + /* ChaCha20_ctr32() assumes length is <= 4GB. */ + todo = (uint32_t)todo; +#endif + + /* Truncate if the 32-bit counter would roll over. */ + next_counter = counter[0] + todo / CHACHA_BLK_SIZE; + if (next_counter < counter[0]) { + todo -= next_counter * CHACHA_BLK_SIZE; + next_counter = 0; + } + + ChaCha20_ctr32(out, in, todo, key, counter); + + counter[0] = next_counter; + if (counter[0] == 0) + counter[1]++; + + if (out == block) { + crypto_cursor_copyback(&cc_out, CHACHA_BLK_SIZE, block); + outseg = crypto_cursor_segbase(&cc_out); + outlen = crypto_cursor_seglen(&cc_out); + } else { + crypto_cursor_advance(&cc_out, todo); + outseg += todo; + outlen -= todo; + } + if (in == block) { + inseg = crypto_cursor_segbase(&cc_in); + inlen = crypto_cursor_seglen(&cc_in); + } else { + crypto_cursor_advance(&cc_in, todo); + inseg += todo; + inlen -= todo; + } + resid -= todo; + } + + if (resid > 0) { + memset(block, 0, sizeof(block)); + crypto_cursor_copydata(&cc_in, resid, block); + ChaCha20_ctr32(block, block, CHACHA_BLK_SIZE, key, counter); + crypto_cursor_copyback(&cc_out, resid, block); + } + + explicit_bzero(block, sizeof(block)); + explicit_bzero(counter, sizeof(counter)); + explicit_bzero(key, sizeof(key)); + return (0); +} diff --git a/sys/modules/ossl/Makefile b/sys/modules/ossl/Makefile index 2ddebefebd1a..dfd82dcf6e1f 100644 --- a/sys/modules/ossl/Makefile +++ b/sys/modules/ossl/Makefile @@ -8,6 +8,7 @@ SRCS= bus_if.h \ cryptodev_if.h \ device_if.h \ ossl.c \ + ossl_chacha20.c \ ossl_poly1305.c \ ossl_sha1.c \ ossl_sha256.c \ @@ -15,6 +16,7 @@ SRCS= bus_if.h \ ${SRCS.${MACHINE_CPUARCH}} SRCS.aarch64= \ + chacha-armv8.S \ poly1305-armv8.S \ sha1-armv8.S \ sha256-armv8.S \ @@ -22,6 +24,7 @@ SRCS.aarch64= \ ossl_aarch64.c SRCS.amd64= \ + chacha-x86_64.S \ poly1305-x86_64.S \ sha1-x86_64.S \ sha256-x86_64.S \ @@ -29,6 +32,7 @@ SRCS.amd64= \ ossl_x86.c SRCS.i386= \ + chacha-x86.S \ poly1305-x86.S \ sha1-586.S \ sha256-586.S \ From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:21:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A60DA554929; Wed, 3 Mar 2021 23:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrVPR0QCDz3kxD; Wed, 3 Mar 2021 23:21: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 B632E12A2A; Wed, 3 Mar 2021 23:21: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 123NLRaX093570; Wed, 3 Mar 2021 23:21:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123NLRW3093569; Wed, 3 Mar 2021 23:21:27 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:21:27 GMT Message-Id: <202103032321.123NLRW3093569@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: 78991a93eb9d - main - ossl: Add support for the ChaCha20 + Poly1305 AEAD cipher from RFC 8439 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: 78991a93eb9dd3074a3fc19b88a7c3e34e1ec703 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:21:33 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=78991a93eb9dd3074a3fc19b88a7c3e34e1ec703 commit 78991a93eb9dd3074a3fc19b88a7c3e34e1ec703 Author: John Baldwin AuthorDate: 2021-03-03 23:17:51 +0000 Commit: John Baldwin CommitDate: 2021-03-03 23:20:57 +0000 ossl: Add support for the ChaCha20 + Poly1305 AEAD cipher from RFC 8439 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28757 --- share/man/man4/ossl.4 | 2 + sys/crypto/openssl/ossl.c | 14 ++ sys/crypto/openssl/ossl.h | 4 + sys/crypto/openssl/ossl_chacha20.c | 306 +++++++++++++++++++++++++++++++++++++ sys/crypto/openssl/ossl_poly1305.c | 8 +- sys/crypto/openssl/ossl_poly1305.h | 5 + 6 files changed, 335 insertions(+), 4 deletions(-) diff --git a/share/man/man4/ossl.4 b/share/man/man4/ossl.4 index 2aa4b69eda31..5929e46e9fe3 100644 --- a/share/man/man4/ossl.4 +++ b/share/man/man4/ossl.4 @@ -76,6 +76,8 @@ driver includes support for the following algorithms: .It ChaCha20 .It +ChaCha20-Poly1305 (RFC 8439) +.It Poly1305 .It SHA1 diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c index 0c863429939c..ad9b93dd960d 100644 --- a/sys/crypto/openssl/ossl.c +++ b/sys/crypto/openssl/ossl.c @@ -165,6 +165,14 @@ ossl_probesession(device_t dev, const struct crypto_session_params *csp) return (EINVAL); } break; + case CSP_MODE_AEAD: + switch (csp->csp_cipher_alg) { + case CRYPTO_CHACHA20_POLY1305: + break; + default: + return (EINVAL); + } + break; default: return (EINVAL); } @@ -314,6 +322,12 @@ ossl_process(device_t dev, struct cryptop *crp, int hint) case CSP_MODE_CIPHER: error = ossl_chacha20(crp, csp); break; + case CSP_MODE_AEAD: + if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) + error = ossl_chacha20_poly1305_encrypt(crp, csp); + else + error = ossl_chacha20_poly1305_decrypt(crp, csp); + break; default: __assert_unreachable(); } diff --git a/sys/crypto/openssl/ossl.h b/sys/crypto/openssl/ossl.h index b7c681d0fb1d..11793dca037a 100644 --- a/sys/crypto/openssl/ossl.h +++ b/sys/crypto/openssl/ossl.h @@ -39,6 +39,10 @@ struct crypto_session_params; int ossl_chacha20(struct cryptop *crp, const struct crypto_session_params *csp); +int ossl_chacha20_poly1305_decrypt(struct cryptop *crp, + const struct crypto_session_params *csp); +int ossl_chacha20_poly1305_encrypt(struct cryptop *crp, + const struct crypto_session_params *csp); void ossl_cpuid(void); /* Needs to be big enough to hold any hash context. */ diff --git a/sys/crypto/openssl/ossl_chacha20.c b/sys/crypto/openssl/ossl_chacha20.c index 70a0a5718dbd..a2bfb52cacd6 100644 --- a/sys/crypto/openssl/ossl_chacha20.c +++ b/sys/crypto/openssl/ossl_chacha20.c @@ -37,6 +37,7 @@ #include #include +#include int ossl_chacha20(struct cryptop *crp, const struct crypto_session_params *csp) @@ -139,3 +140,308 @@ ossl_chacha20(struct cryptop *crp, const struct crypto_session_params *csp) explicit_bzero(key, sizeof(key)); return (0); } + +int +ossl_chacha20_poly1305_encrypt(struct cryptop *crp, + const struct crypto_session_params *csp) +{ + _Alignas(8) unsigned int key[CHACHA_KEY_SIZE / 4]; + unsigned int counter[CHACHA_CTR_SIZE / 4]; + _Alignas(8) unsigned char block[CHACHA_BLK_SIZE]; + unsigned char tag[POLY1305_HASH_LEN]; + POLY1305 auth_ctx; + struct crypto_buffer_cursor cc_in, cc_out; + const unsigned char *in, *inseg, *cipher_key; + unsigned char *out, *outseg; + size_t resid, todo, inlen, outlen; + uint32_t next_counter; + u_int i; + + if (crp->crp_cipher_key != NULL) + cipher_key = crp->crp_cipher_key; + else + cipher_key = csp->csp_cipher_key; + for (i = 0; i < nitems(key); i++) + key[i] = CHACHA_U8TOU32(cipher_key + i * 4); + + crypto_read_iv(crp, counter + 1); + for (i = 1; i < nitems(counter); i++) + counter[i] = le32toh(counter[i]); + + /* Block 0 is used to generate the poly1305 key. */ + counter[0] = 0; + + memset(block, 0, sizeof(block)); + ChaCha20_ctr32(block, block, sizeof(block), key, counter); + Poly1305_Init(&auth_ctx, block); + + /* MAC the AAD. */ + if (crp->crp_aad != NULL) + Poly1305_Update(&auth_ctx, crp->crp_aad, crp->crp_aad_length); + else + crypto_apply(crp, crp->crp_aad_start, crp->crp_aad_length, + ossl_poly1305_update, &auth_ctx); + if (crp->crp_aad_length % 16 != 0) { + /* padding1 */ + memset(block, 0, 16); + Poly1305_Update(&auth_ctx, block, + 16 - crp->crp_aad_length % 16); + } + + /* Encryption starts with block 1. */ + counter[0] = 1; + + /* Do encryption with MAC */ + resid = crp->crp_payload_length; + crypto_cursor_init(&cc_in, &crp->crp_buf); + crypto_cursor_advance(&cc_in, crp->crp_payload_start); + inseg = crypto_cursor_segbase(&cc_in); + inlen = crypto_cursor_seglen(&cc_in); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + crypto_cursor_init(&cc_out, &crp->crp_obuf); + crypto_cursor_advance(&cc_out, crp->crp_payload_output_start); + } else + cc_out = cc_in; + outseg = crypto_cursor_segbase(&cc_out); + outlen = crypto_cursor_seglen(&cc_out); + while (resid >= CHACHA_BLK_SIZE) { + if (inlen < CHACHA_BLK_SIZE) { + crypto_cursor_copydata(&cc_in, CHACHA_BLK_SIZE, block); + in = block; + inlen = CHACHA_BLK_SIZE; + } else + in = inseg; + if (outlen < CHACHA_BLK_SIZE) { + out = block; + outlen = CHACHA_BLK_SIZE; + } else + out = outseg; + + /* Figure out how many blocks we can encrypt/decrypt at once. */ + todo = rounddown(MIN(inlen, outlen), CHACHA_BLK_SIZE); + +#ifdef __LP64__ + /* ChaCha20_ctr32() assumes length is <= 4GB. */ + todo = (uint32_t)todo; +#endif + + /* Truncate if the 32-bit counter would roll over. */ + next_counter = counter[0] + todo / CHACHA_BLK_SIZE; + if (next_counter < counter[0]) { + todo -= next_counter * CHACHA_BLK_SIZE; + next_counter = 0; + } + + ChaCha20_ctr32(out, in, todo, key, counter); + Poly1305_Update(&auth_ctx, out, todo); + + counter[0] = next_counter; + if (counter[0] == 0) + counter[1]++; + + if (out == block) { + crypto_cursor_copyback(&cc_out, CHACHA_BLK_SIZE, block); + outseg = crypto_cursor_segbase(&cc_out); + outlen = crypto_cursor_seglen(&cc_out); + } else { + crypto_cursor_advance(&cc_out, todo); + outseg += todo; + outlen -= todo; + } + if (in == block) { + inseg = crypto_cursor_segbase(&cc_in); + inlen = crypto_cursor_seglen(&cc_in); + } else { + crypto_cursor_advance(&cc_in, todo); + inseg += todo; + inlen -= todo; + } + resid -= todo; + } + + if (resid > 0) { + memset(block, 0, sizeof(block)); + crypto_cursor_copydata(&cc_in, resid, block); + ChaCha20_ctr32(block, block, CHACHA_BLK_SIZE, key, counter); + crypto_cursor_copyback(&cc_out, resid, block); + + /* padding2 */ + todo = roundup2(resid, 16); + memset(block + resid, 0, todo - resid); + Poly1305_Update(&auth_ctx, block, todo); + } + + /* lengths */ + le64enc(block, crp->crp_aad_length); + le64enc(block + 8, crp->crp_payload_length); + Poly1305_Update(&auth_ctx, block, sizeof(uint64_t) * 2); + + Poly1305_Final(&auth_ctx, tag); + crypto_copyback(crp, crp->crp_digest_start, csp->csp_auth_mlen == 0 ? + POLY1305_HASH_LEN : csp->csp_auth_mlen, tag); + + explicit_bzero(&auth_ctx, sizeof(auth_ctx)); + explicit_bzero(tag, sizeof(tag)); + explicit_bzero(block, sizeof(block)); + explicit_bzero(counter, sizeof(counter)); + explicit_bzero(key, sizeof(key)); + return (0); +} + + +int +ossl_chacha20_poly1305_decrypt(struct cryptop *crp, + const struct crypto_session_params *csp) +{ + _Alignas(8) unsigned int key[CHACHA_KEY_SIZE / 4]; + unsigned int counter[CHACHA_CTR_SIZE / 4]; + _Alignas(8) unsigned char block[CHACHA_BLK_SIZE]; + unsigned char tag[POLY1305_HASH_LEN], tag2[POLY1305_HASH_LEN]; + struct poly1305_context auth_ctx; + struct crypto_buffer_cursor cc_in, cc_out; + const unsigned char *in, *inseg, *cipher_key; + unsigned char *out, *outseg; + size_t resid, todo, inlen, outlen; + uint32_t next_counter; + int error; + u_int i, mlen; + + if (crp->crp_cipher_key != NULL) + cipher_key = crp->crp_cipher_key; + else + cipher_key = csp->csp_cipher_key; + for (i = 0; i < nitems(key); i++) + key[i] = CHACHA_U8TOU32(cipher_key + i * 4); + + crypto_read_iv(crp, counter + 1); + for (i = 1; i < nitems(counter); i++) + counter[i] = le32toh(counter[i]); + + /* Block 0 is used to generate the poly1305 key. */ + counter[0] = 0; + + memset(block, 0, sizeof(block)); + ChaCha20_ctr32(block, block, sizeof(block), key, counter); + Poly1305_Init(&auth_ctx, block); + + /* MAC the AAD. */ + if (crp->crp_aad != NULL) + Poly1305_Update(&auth_ctx, crp->crp_aad, crp->crp_aad_length); + else + crypto_apply(crp, crp->crp_aad_start, crp->crp_aad_length, + ossl_poly1305_update, &auth_ctx); + if (crp->crp_aad_length % 16 != 0) { + /* padding1 */ + memset(block, 0, 16); + Poly1305_Update(&auth_ctx, block, + 16 - crp->crp_aad_length % 16); + } + + /* Mac the ciphertext. */ + crypto_apply(crp, crp->crp_payload_start, crp->crp_payload_length, + ossl_poly1305_update, &auth_ctx); + if (crp->crp_payload_length % 16 != 0) { + /* padding2 */ + memset(block, 0, 16); + Poly1305_Update(&auth_ctx, block, + 16 - crp->crp_payload_length % 16); + } + + /* lengths */ + le64enc(block, crp->crp_aad_length); + le64enc(block + 8, crp->crp_payload_length); + Poly1305_Update(&auth_ctx, block, sizeof(uint64_t) * 2); + + Poly1305_Final(&auth_ctx, tag); + mlen = csp->csp_auth_mlen == 0 ? POLY1305_HASH_LEN : csp->csp_auth_mlen; + crypto_copydata(crp, crp->crp_digest_start, mlen, tag2); + if (timingsafe_bcmp(tag, tag2, mlen) != 0) { + error = EBADMSG; + goto out; + } + + /* Decryption starts with block 1. */ + counter[0] = 1; + + resid = crp->crp_payload_length; + crypto_cursor_init(&cc_in, &crp->crp_buf); + crypto_cursor_advance(&cc_in, crp->crp_payload_start); + inseg = crypto_cursor_segbase(&cc_in); + inlen = crypto_cursor_seglen(&cc_in); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + crypto_cursor_init(&cc_out, &crp->crp_obuf); + crypto_cursor_advance(&cc_out, crp->crp_payload_output_start); + } else + cc_out = cc_in; + outseg = crypto_cursor_segbase(&cc_out); + outlen = crypto_cursor_seglen(&cc_out); + while (resid >= CHACHA_BLK_SIZE) { + if (inlen < CHACHA_BLK_SIZE) { + crypto_cursor_copydata(&cc_in, CHACHA_BLK_SIZE, block); + in = block; + inlen = CHACHA_BLK_SIZE; + } else + in = inseg; + if (outlen < CHACHA_BLK_SIZE) { + out = block; + outlen = CHACHA_BLK_SIZE; + } else + out = outseg; + + /* Figure out how many blocks we can encrypt/decrypt at once. */ + todo = rounddown(MIN(inlen, outlen), CHACHA_BLK_SIZE); + +#ifdef __LP64__ + /* ChaCha20_ctr32() assumes length is <= 4GB. */ + todo = (uint32_t)todo; +#endif + + /* Truncate if the 32-bit counter would roll over. */ + next_counter = counter[0] + todo / CHACHA_BLK_SIZE; + if (next_counter < counter[0]) { + todo -= next_counter * CHACHA_BLK_SIZE; + next_counter = 0; + } + + ChaCha20_ctr32(out, in, todo, key, counter); + + counter[0] = next_counter; + if (counter[0] == 0) + counter[1]++; + + if (out == block) { + crypto_cursor_copyback(&cc_out, CHACHA_BLK_SIZE, block); + outseg = crypto_cursor_segbase(&cc_out); + outlen = crypto_cursor_seglen(&cc_out); + } else { + crypto_cursor_advance(&cc_out, todo); + outseg += todo; + outlen -= todo; + } + if (in == block) { + inseg = crypto_cursor_segbase(&cc_in); + inlen = crypto_cursor_seglen(&cc_in); + } else { + crypto_cursor_advance(&cc_in, todo); + inseg += todo; + inlen -= todo; + } + resid -= todo; + } + + if (resid > 0) { + memset(block, 0, sizeof(block)); + crypto_cursor_copydata(&cc_in, resid, block); + ChaCha20_ctr32(block, block, CHACHA_BLK_SIZE, key, counter); + crypto_cursor_copyback(&cc_out, resid, block); + } + + error = 0; +out: + explicit_bzero(&auth_ctx, sizeof(auth_ctx)); + explicit_bzero(tag, sizeof(tag)); + explicit_bzero(block, sizeof(block)); + explicit_bzero(counter, sizeof(counter)); + explicit_bzero(key, sizeof(key)); + return (error); +} diff --git a/sys/crypto/openssl/ossl_poly1305.c b/sys/crypto/openssl/ossl_poly1305.c index 8f8c5bc4b6e7..9d08e84ae5bf 100644 --- a/sys/crypto/openssl/ossl_poly1305.c +++ b/sys/crypto/openssl/ossl_poly1305.c @@ -46,7 +46,7 @@ void poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, void poly1305_emit(void *ctx, unsigned char mac[16], const unsigned int nonce[4]); -static void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32]) +void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32]) { ctx->nonce[0] = U8TOU32(&key[16]); ctx->nonce[1] = U8TOU32(&key[20]); @@ -77,7 +77,7 @@ static void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32]) # define poly1305_emit (*poly1305_emit_p) #endif -static void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) +void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) { #ifdef POLY1305_ASM /* @@ -119,7 +119,7 @@ static void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) ctx->num = rem; } -static void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) +void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) { #ifdef POLY1305_ASM poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks; @@ -152,7 +152,7 @@ ossl_poly1305_setkey(void *vctx, const uint8_t *key, u_int klen) Poly1305_Init(vctx, key); } -static int +int ossl_poly1305_update(void *vctx, const void *buf, u_int len) { Poly1305_Update(vctx, buf, len); diff --git a/sys/crypto/openssl/ossl_poly1305.h b/sys/crypto/openssl/ossl_poly1305.h index d1b2db6d5cba..d0811e0e3f06 100644 --- a/sys/crypto/openssl/ossl_poly1305.h +++ b/sys/crypto/openssl/ossl_poly1305.h @@ -33,3 +33,8 @@ struct poly1305_context { poly1305_emit_f emit; } func; }; + +int ossl_poly1305_update(void *vctx, const void *buf, u_int len); +void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32]); +void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len); +void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:36:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DD9E555084; Wed, 3 Mar 2021 23:36: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 4DrVk838jZz3mQ2; Wed, 3 Mar 2021 23:36: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 5A8E712C1A; Wed, 3 Mar 2021 23:36: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 123Na02L010968; Wed, 3 Mar 2021 23:36:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123Na06i010967; Wed, 3 Mar 2021 23:36:00 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:36:00 GMT Message-Id: <202103032336.123Na06i010967@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: 0dcde5cc1274 - main - growfs: allow operation on RW-mounted filesystems 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: 0dcde5cc12744e5188300711a8829e5e6a9cd0de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:36:00 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0dcde5cc12744e5188300711a8829e5e6a9cd0de commit 0dcde5cc12744e5188300711a8829e5e6a9cd0de Author: Ed Maste AuthorDate: 2021-03-02 22:35:48 +0000 Commit: Ed Maste CommitDate: 2021-03-03 23:35:21 +0000 growfs: allow operation on RW-mounted filesystems growfs supports growing mounted filesystems (writes are temporarily suspended while the grow happens). Drop the check for fs_clean == 0 to restore this case. Leave fs_flags check for FS_UNCLEAN or FS_NEEDSFSCK which represent the state of the filesystem when it was mounted, and fsck should be run first if they are set. PR: 253754 Reviewed by: mckusick MFC after: 3 days Fixes: 6eb925f8450f ("Filesystem utilities that modify the...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29021 --- sbin/growfs/growfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index d1098210f088..510192dada0b 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1461,10 +1461,9 @@ main(int argc, char **argv) } } /* - * Check for unclean filesystem. + * Check for filesystem that was unclean at mount time. */ - if (fs->fs_clean == 0 || - (fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) + if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) errx(1, "%s is not clean - run fsck.\n", *argv); memcpy(&osblock, fs, fs->fs_sbsize); free(fs); From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:45:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F092955525F; Wed, 3 Mar 2021 23:45:18 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 4DrVwt6BYgz3nDS; Wed, 3 Mar 2021 23:45:18 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pl1-x62f.google.com with SMTP id d11so14982652plo.8; Wed, 03 Mar 2021 15:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=N/emB/1YFsG2Bim1x0jlMiiCyVHQVS4Dqw7P70AKORk=; b=WoBPzNkcEDYARXpi7jS4lsFqZpUV0nEoY42dlVcw1yVj3EDtaAgMEwRxa2llJzf7dF +hOb0yt+P2eE4/Yr5alg55xEGpn0FteleOKPZdR6npm/G1TuKfzDbYACb2cSsreArIFF YxJ6qynE12Laov0TiHx5+G347vOIPyn6G01TUjE9rhlWISbTnLPngxAqJJE1I6rJfjNq 7Yyn8Rc2Z4HHovfY2KezzWIn975x6EFCYKdA49q3iVpoB8EFjr1K1ZY7xchfa7G932iQ BdW0djFF0qIu2gTZKED06tbCTCVRZIzDYwTSOswxGz/qmA6HJT/EADEsmIvaC+rE3Jp7 +Tew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :reply-to:subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=N/emB/1YFsG2Bim1x0jlMiiCyVHQVS4Dqw7P70AKORk=; b=W/1pjryuA3h3VHabYiUABfhxdEF8bIt75t2T6Xl09AkCucrzpaHc05trQ1SvBE9yku 3X2a315CORMbRqBowxt+bvlothTtP6vFnHkWKm6z6Tavj4rKTg0HY8ZSoesuK/tFsXhG t14+V3+Pye54iCcaastZH/B/BZFYZyXYDq2qM1Y2/T9DAqwoKiq3CAZsBayrdAOUQPil wqxfaaPIWxY2oHY6wo5YViIZCJsA3tud7vF7kEhHC96KwZouh8Q5I8WBPdRMmveH7zds FhGeDFawUoePKGa0a8w6bCtMWGY8gHTHcCRhA+H/YDqnH6WZm5WLkXaQJxWYTpp/xVyy rfWw== X-Gm-Message-State: AOAM531HMYVR0RNvpMOtjGQ9RzcqGUX4C7FZkQSvxUuUAJKyFzbi7jC3 yPm8xkDT7Cu6Jy8ItiNltyIgV3SPfVU= X-Google-Smtp-Source: ABdhPJzXZBw+mavc57fSyUA0ozyvBteEIDNp43LIArXfwwmvKf/FO4fbiR2GAVSm3BcLAmogdyXxYA== X-Received: by 2002:a17:90a:1696:: with SMTP id o22mr1493447pja.0.1614815117036; Wed, 03 Mar 2021 15:45:17 -0800 (PST) Received: from localhost (167-179-159-58.a7b39f.syd.nbn.aussiebb.net. [167.179.159.58]) by smtp.gmail.com with UTF8SMTPSA id d19sm1232998pjs.55.2021.03.03.15.45.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Mar 2021 15:45:16 -0800 (PST) Sender: Kubilay Kocak Message-ID: <2c9e447a-d139-fb48-d9b5-85bfae1ff30f@FreeBSD.org> Date: Thu, 4 Mar 2021 10:45:11 +1100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Thunderbird/88.0a1 Reply-To: koobs@FreeBSD.org Subject: Re: git: 55deb0a5f089 - main - service(8): use an environment more consistent with init(8) Content-Language: en-US To: Kyle Evans , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103031828.123ISTI5001652@gitrepo.freebsd.org> From: Kubilay Kocak In-Reply-To: <202103031828.123ISTI5001652@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DrVwt6BYgz3nDS 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-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:45:19 -0000 On 4/03/2021 5:28 am, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=55deb0a5f089c8a27cfc1666655b93881c2b47ae > > commit 55deb0a5f089c8a27cfc1666655b93881c2b47ae > Author: Andrew Gierth > AuthorDate: 2021-03-03 18:25:11 +0000 > Commit: Kyle Evans > CommitDate: 2021-03-03 18:25:11 +0000 > > service(8): use an environment more consistent with init(8) > > init(8) sets the "daemon" login class without specifying a pw > entry (so no substitutions are done on the variables). service(8)'s > use of env -L had the effect of specifying root's pw entry, with two > effects: getpwnam and getpwuid are being called, which may not be > entirely safe depending on what nsswitch is up to and what stage of > boot we are at, and substitutions would have been done. > > Fix by teaching env(8) to allow -L -/classname to set the class > environment with no pw entry at all specified, and use it in > service(8). > > PR: 253959 Is MFC'able to stable/* or might there be backward compatibility issue? From owner-dev-commits-src-all@freebsd.org Wed Mar 3 23:52:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DE295551E6; Wed, 3 Mar 2021 23:52: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 4DrW5b262hz3nLr; Wed, 3 Mar 2021 23:52: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 3B37D13281; Wed, 3 Mar 2021 23:52: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 123Nqpie036908; Wed, 3 Mar 2021 23:52:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123Nqptt036907; Wed, 3 Mar 2021 23:52:51 GMT (envelope-from git) Date: Wed, 3 Mar 2021 23:52:51 GMT Message-Id: <202103032352.123Nqptt036907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 483c6da3a20b - main - libkvm: Refine the previous commit (645eaa2ccaed) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 483c6da3a20b2064cd655f7cb19e6b98dee677ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 23:52:51 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=483c6da3a20b2064cd655f7cb19e6b98dee677ff commit 483c6da3a20b2064cd655f7cb19e6b98dee677ff Author: Jung-uk Kim AuthorDate: 2021-03-03 23:50:45 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-03 23:50:45 +0000 libkvm: Refine the previous commit (645eaa2ccaed) Resort free()'ing memory in kvm_close() to make it easier to MFC. MFC after: 3 days --- lib/libkvm/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 2905302f32f2..b98f2f25e619 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -297,12 +297,12 @@ kvm_close(kvm_t *kd) free((void *) kd->argspc); if (kd->argv != 0) free((void *)kd->argv); + if (kd->dpcpu_initialized != 0) + free(kd->dpcpu_off); if (kd->pt_map != NULL) free(kd->pt_map); if (kd->page_map != NULL) free(kd->page_map); - if (kd->dpcpu_initialized != 0) - free(kd->dpcpu_off); if (kd->sparse_map != MAP_FAILED) munmap(kd->sparse_map, kd->pt_sparse_size); free((void *)kd); From owner-dev-commits-src-all@freebsd.org Thu Mar 4 01:32:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07320559EED; Thu, 4 Mar 2021 01:32: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 4DrYK26rCgz4Qsj; Thu, 4 Mar 2021 01:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDA6514713; Thu, 4 Mar 2021 01:32: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 1241Ws1t068392; Thu, 4 Mar 2021 01:32:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1241WsZl068391; Thu, 4 Mar 2021 01:32:54 GMT (envelope-from git) Date: Thu, 4 Mar 2021 01:32:54 GMT Message-Id: <202103040132.1241WsZl068391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 0dcfb6d761cc - stable/12 - getdirentries.2: fix for NFS mounts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0dcfb6d761ccc8bd45b68231f9a5f4ff4c6d989f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 01:32:55 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0dcfb6d761ccc8bd45b68231f9a5f4ff4c6d989f commit 0dcfb6d761ccc8bd45b68231f9a5f4ff4c6d989f Author: Rick Macklem AuthorDate: 2021-02-15 02:16:58 +0000 Commit: Rick Macklem CommitDate: 2021-03-04 01:30:23 +0000 getdirentries.2: fix for NFS mounts It was reported that getdirentries(2) was returning dirents with d_off set to 0 for an NFS mount. This is believed to be correct behaviour at this time (it may change for some NFS mounts in the future), but is inconsistent with what the getdirentries(2) man page says. This patch fixes the man page. This is a content change. PR: 253428 (cherry picked from commit a0698341cd894ba4a640e9a9bb0f72c2133d1228) --- lib/libc/sys/getdirentries.2 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/libc/sys/getdirentries.2 b/lib/libc/sys/getdirentries.2 index f2d1c05240d5..658be9459af5 100644 --- a/lib/libc/sys/getdirentries.2 +++ b/lib/libc/sys/getdirentries.2 @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd February 14, 2021 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -89,7 +89,7 @@ have the same .Fa d_fileno . The .Fa d_off -field returns a cookie which can be used with +field returns a cookie which, if non-zero, can be used with .Xr lseek 2 to position the directory descriptor to the next entry. The @@ -148,14 +148,16 @@ only .Pc , a value returned in the .Fa d_off -field, +field if it is non-zero, or zero. .Sh IMPLEMENTATION NOTES The .Fa d_off -field is being used as a cookie to readdir for nfs servers. -These cookies can be cached and allow to read directory entries at a specific -offset on demand. +field is currently set to 0 by the NFS client, since the +directory offset cookies returned by an NFS server cannot +be used by +.Xr lseek 2 +at this time. .Sh RETURN VALUES If successful, the number of bytes actually transferred is returned. Otherwise, -1 is returned and the global variable From owner-dev-commits-src-all@freebsd.org Thu Mar 4 02:04:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F349B55C690; Thu, 4 Mar 2021 02:04: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 4DrZ1M67yWz4TfV; Thu, 4 Mar 2021 02:04: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 C5D451497B; Thu, 4 Mar 2021 02:04: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 12424NT5008799; Thu, 4 Mar 2021 02:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12424N4a008798; Thu, 4 Mar 2021 02:04:23 GMT (envelope-from git) Date: Thu, 4 Mar 2021 02:04:23 GMT Message-Id: <202103040204.12424N4a008798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: c4ccb6d1be1f - stable/13 - jail: allow root to implicitly widen its cpuset to attach 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c4ccb6d1be1f00ebcda9e83f06db55f9d6c152ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 02:04:24 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c4ccb6d1be1f00ebcda9e83f06db55f9d6c152ac commit c4ccb6d1be1f00ebcda9e83f06db55f9d6c152ac Author: Kyle Evans AuthorDate: 2021-02-26 21:46:47 +0000 Commit: Kyle Evans CommitDate: 2021-03-04 02:04:10 +0000 jail: allow root to implicitly widen its cpuset to attach The default behavior for attaching processes to jails is that the jail's cpuset augments the attaching processes, so that it cannot be used to escalate a user's ability to take advantage of more CPUs than the administrator wanted them to. This is problematic when root needs to manage jails that have disjoint sets with whatever process is attaching, as this would otherwise result in a deadlock. Therefore, if we did not have an appropriate common subset of cpus/domains for our new policy, we now allow the process to simply take on the jail set *if* it has the privilege to widen its mask anyways. With the new logic, root can still usefully cpuset a process that attaches to a jail with the desire of maintaining the set it was given pre-attachment while still retaining the ability to manage child jails without jumping through hoops. A test has been added to demonstrate the issue; cpuset of a process down to just the first CPU and attempting to attach to a jail without access to any of the same CPUs previously resulted in EDEADLK and now results in taking on the jail's mask for privileged users. PR: 253724 (cherry picked from commit 60c4ec806dfd0f79edf8ca3abc04bbb69c0418f7) --- lib/libc/tests/sys/cpuset_test.c | 203 ++++++++++++++++++++++++++++++++++++++- sys/kern/kern_cpuset.c | 8 ++ 2 files changed, 210 insertions(+), 1 deletion(-) diff --git a/lib/libc/tests/sys/cpuset_test.c b/lib/libc/tests/sys/cpuset_test.c index d6dd69e7e3c1..52c0dc877ab8 100644 --- a/lib/libc/tests/sys/cpuset_test.c +++ b/lib/libc/tests/sys/cpuset_test.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2020 Kyle Evans + * Copyright (c) 2020-2021 Kyle Evans * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD"); #include #include #include +#include +#include #include #include #include @@ -64,6 +66,10 @@ typedef void (*jail_test_cb)(struct jail_test_cb_params *); #define FAILURE_JAILSET 44 #define FAILURE_PIDSET 45 #define FAILURE_SEND 46 +#define FAILURE_DEADLK 47 +#define FAILURE_ATTACH 48 +#define FAILURE_BADAFFIN 49 +#define FAILURE_SUCCESS 50 static const char * do_jail_errstr(int error) @@ -80,6 +86,14 @@ do_jail_errstr(int error) return ("Failed to get the pid setid"); case FAILURE_SEND: return ("Failed to send(2) cpuset information"); + case FAILURE_DEADLK: + return ("Deadlock hit trying to attach to jail"); + case FAILURE_ATTACH: + return ("jail_attach(2) failed"); + case FAILURE_BADAFFIN: + return ("Unexpected post-attach affinity"); + case FAILURE_SUCCESS: + return ("jail_attach(2) succeeded, but should have failed."); default: return (NULL); } @@ -444,6 +458,192 @@ ATF_TC_BODY(jail_attach_plain, tc) do_jail_test(1, false, &jail_attach_plain_pro, &jail_attach_jset_epi); } +static int +jail_attach_disjoint_newjail(int fd) +{ + struct iovec iov[2]; + char *name; + int jid; + + if (asprintf(&name, "cpuset_%d", getpid()) == -1) + _exit(42); + + iov[0].iov_base = "name"; + iov[0].iov_len = sizeof("name"); + + iov[1].iov_base = name; + iov[1].iov_len = strlen(name) + 1; + + if ((jid = jail_set(iov, 2, JAIL_CREATE | JAIL_ATTACH)) < 0) + return (FAILURE_JAIL); + + /* Signal that we're ready. */ + write(fd, &jid, sizeof(jid)); + for (;;) { + /* Spin */ + } +} + +static int +wait_jail(int fd, int pfd) +{ + fd_set lset; + struct timeval tv; + int error, jid, maxfd; + + FD_ZERO(&lset); + FD_SET(fd, &lset); + FD_SET(pfd, &lset); + + maxfd = MAX(fd, pfd); + + tv.tv_sec = 5; + tv.tv_usec = 0; + + /* Wait for jid to be written. */ + do { + error = select(maxfd + 1, &lset, NULL, NULL, &tv); + } while (error == -1 && errno == EINTR); + + if (error == 0) { + atf_tc_fail("Jail creator did not respond in time."); + } + + ATF_REQUIRE_MSG(error > 0, "Unexpected error %d from select()", errno); + + if (FD_ISSET(pfd, &lset)) { + /* Process died */ + atf_tc_fail("Jail creator died unexpectedly."); + } + + ATF_REQUIRE(FD_ISSET(fd, &lset)); + ATF_REQUIRE_EQ(sizeof(jid), recv(fd, &jid, sizeof(jid), 0)); + + return (jid); +} + +static int +try_attach_child(int jid, cpuset_t *expected_mask) +{ + cpuset_t mask; + + if (jail_attach(jid) == -1) { + if (errno == EDEADLK) + return (FAILURE_DEADLK); + return (FAILURE_ATTACH); + } + + if (expected_mask == NULL) + return (FAILURE_SUCCESS); + + /* If we had an expected mask, check it against the new process mask. */ + CPU_ZERO(&mask); + if (cpuset_getaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, + -1, sizeof(mask), &mask) != 0) { + return (FAILURE_MASK); + } + + if (CPU_CMP(expected_mask, &mask) != 0) + return (FAILURE_BADAFFIN); + + return (0); +} + +static void +try_attach(int jid, cpuset_t *expected_mask) +{ + const char *errstr; + pid_t pid; + int error, fail, status; + + ATF_REQUIRE(expected_mask != NULL); + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) + _exit(try_attach_child(jid, expected_mask)); + + while ((error = waitpid(pid, &status, 0)) == -1 && errno == EINTR) { + /* Try again. */ + } + + /* Sanity check the exit info. */ + ATF_REQUIRE_EQ(pid, error); + ATF_REQUIRE(WIFEXITED(status)); + if ((fail = WEXITSTATUS(status)) != 0) { + errstr = do_jail_errstr(fail); + if (errstr != NULL) + atf_tc_fail("%s", errstr); + else + atf_tc_fail("Unknown error '%d'", WEXITSTATUS(status)); + } +} + +ATF_TC(jail_attach_disjoint); +ATF_TC_HEAD(jail_attach_disjoint, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test root attachment into completely disjoint jail cpuset."); + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(jail_attach_disjoint, tc) +{ + cpuset_t smask, jmask; + int sockpair[2]; + cpusetid_t setid; + pid_t pid; + int fcpu, jid, pfd, sock, scpu; + + ATF_REQUIRE_EQ(0, cpuset(&setid)); + + skip_ltncpu(2, &jmask); + fcpu = CPU_FFS(&jmask) - 1; + ATF_REQUIRE_EQ(0, socketpair(PF_UNIX, SOCK_STREAM, 0, sockpair)); + + /* We'll wait on the procdesc, too, so we can fail faster if it dies. */ + ATF_REQUIRE((pid = pdfork(&pfd, 0)) != -1); + + if (pid == 0) { + /* First child sets up the jail. */ + sock = sockpair[SP_CHILD]; + close(sockpair[SP_PARENT]); + + _exit(jail_attach_disjoint_newjail(sock)); + } + + close(sockpair[SP_CHILD]); + sock = sockpair[SP_PARENT]; + + ATF_REQUIRE((jid = wait_jail(sock, pfd)) > 0); + + /* + * This process will be clamped down to the first cpu, while the jail + * will simply have the first CPU removed to make it a completely + * disjoint operation. + */ + CPU_ZERO(&smask); + CPU_SET(fcpu, &smask); + CPU_CLR(fcpu, &jmask); + + /* + * We'll test with the first and second cpu set as well. Only the + * second cpu should be used. + */ + scpu = CPU_FFS(&jmask) - 1; + + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_ROOT, CPU_WHICH_JAIL, + jid, sizeof(jmask), &jmask)); + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_CPUSET, + setid, sizeof(smask), &smask)); + + try_attach(jid, &jmask); + + CPU_SET(scpu, &smask); + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_CPUSET, + setid, sizeof(smask), &smask)); + + CPU_CLR(fcpu, &smask); + try_attach(jid, &smask); +} + ATF_TC(badparent); ATF_TC_HEAD(badparent, tc) { @@ -488,6 +688,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, jail_attach_newbase_plain); ATF_TP_ADD_TC(tp, jail_attach_prevbase); ATF_TP_ADD_TC(tp, jail_attach_plain); + ATF_TP_ADD_TC(tp, jail_attach_disjoint); ATF_TP_ADD_TC(tp, badparent); return (atf_no_error()); } diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 18cc0c56d697..19ad3fd20955 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -1255,6 +1255,11 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, * as the parent, then we'll check if the process was previously using * the root set and, if it wasn't, create a new base with the process's * mask applied to it. + * + * If the new root is incompatible with the existing mask, then we allow + * the process to take on the new root if and only if they have + * privilege to widen their mask anyways. Unprivileged processes get + * rejected with EDEADLK. */ if (set != NULL && rebase && nroot != tdroot) { cpusetid_t base_id, root_id; @@ -1265,6 +1270,9 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, if (base_id != root_id) { error = cpuset_setproc_newbase(td, set, nroot, &base, &freelist, &domainlist); + if (error == EDEADLK && + priv_check(td, PRIV_SCHED_CPUSET) == 0) + error = 0; if (error != 0) goto unlock_out; } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 02:42:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 094E455E75C; Thu, 4 Mar 2021 02:42: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 4DrZry6vlMz4X5j; Thu, 4 Mar 2021 02:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0349154ED; Thu, 4 Mar 2021 02:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1242gAdb060454; Thu, 4 Mar 2021 02:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1242gA3Y060453; Thu, 4 Mar 2021 02:42:10 GMT (envelope-from git) Date: Thu, 4 Mar 2021 02:42:10 GMT Message-Id: <202103040242.1242gA3Y060453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 5fdc5c5dbac4 - releng/13.0 - jail: allow root to implicitly widen its cpuset to attach 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5fdc5c5dbac400a2ff05820ba8a63cdec8603c92 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 02:42:11 -0000 The branch releng/13.0 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5fdc5c5dbac400a2ff05820ba8a63cdec8603c92 commit 5fdc5c5dbac400a2ff05820ba8a63cdec8603c92 Author: Kyle Evans AuthorDate: 2021-02-26 21:46:47 +0000 Commit: Kyle Evans CommitDate: 2021-03-04 02:41:48 +0000 jail: allow root to implicitly widen its cpuset to attach The default behavior for attaching processes to jails is that the jail's cpuset augments the attaching processes, so that it cannot be used to escalate a user's ability to take advantage of more CPUs than the administrator wanted them to. This is problematic when root needs to manage jails that have disjoint sets with whatever process is attaching, as this would otherwise result in a deadlock. Therefore, if we did not have an appropriate common subset of cpus/domains for our new policy, we now allow the process to simply take on the jail set *if* it has the privilege to widen its mask anyways. With the new logic, root can still usefully cpuset a process that attaches to a jail with the desire of maintaining the set it was given pre-attachment while still retaining the ability to manage child jails without jumping through hoops. A test has been added to demonstrate the issue; cpuset of a process down to just the first CPU and attempting to attach to a jail without access to any of the same CPUs previously resulted in EDEADLK and now results in taking on the jail's mask for privileged users. PR: 253724 Approved by: re (gjb) (cherry picked from commit 60c4ec806dfd0f79edf8ca3abc04bbb69c0418f7) (cherry picked from commit c4ccb6d1be1f00ebcda9e83f06db55f9d6c152ac) --- lib/libc/tests/sys/cpuset_test.c | 203 ++++++++++++++++++++++++++++++++++++++- sys/kern/kern_cpuset.c | 8 ++ 2 files changed, 210 insertions(+), 1 deletion(-) diff --git a/lib/libc/tests/sys/cpuset_test.c b/lib/libc/tests/sys/cpuset_test.c index d6dd69e7e3c1..52c0dc877ab8 100644 --- a/lib/libc/tests/sys/cpuset_test.c +++ b/lib/libc/tests/sys/cpuset_test.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2020 Kyle Evans + * Copyright (c) 2020-2021 Kyle Evans * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD"); #include #include #include +#include +#include #include #include #include @@ -64,6 +66,10 @@ typedef void (*jail_test_cb)(struct jail_test_cb_params *); #define FAILURE_JAILSET 44 #define FAILURE_PIDSET 45 #define FAILURE_SEND 46 +#define FAILURE_DEADLK 47 +#define FAILURE_ATTACH 48 +#define FAILURE_BADAFFIN 49 +#define FAILURE_SUCCESS 50 static const char * do_jail_errstr(int error) @@ -80,6 +86,14 @@ do_jail_errstr(int error) return ("Failed to get the pid setid"); case FAILURE_SEND: return ("Failed to send(2) cpuset information"); + case FAILURE_DEADLK: + return ("Deadlock hit trying to attach to jail"); + case FAILURE_ATTACH: + return ("jail_attach(2) failed"); + case FAILURE_BADAFFIN: + return ("Unexpected post-attach affinity"); + case FAILURE_SUCCESS: + return ("jail_attach(2) succeeded, but should have failed."); default: return (NULL); } @@ -444,6 +458,192 @@ ATF_TC_BODY(jail_attach_plain, tc) do_jail_test(1, false, &jail_attach_plain_pro, &jail_attach_jset_epi); } +static int +jail_attach_disjoint_newjail(int fd) +{ + struct iovec iov[2]; + char *name; + int jid; + + if (asprintf(&name, "cpuset_%d", getpid()) == -1) + _exit(42); + + iov[0].iov_base = "name"; + iov[0].iov_len = sizeof("name"); + + iov[1].iov_base = name; + iov[1].iov_len = strlen(name) + 1; + + if ((jid = jail_set(iov, 2, JAIL_CREATE | JAIL_ATTACH)) < 0) + return (FAILURE_JAIL); + + /* Signal that we're ready. */ + write(fd, &jid, sizeof(jid)); + for (;;) { + /* Spin */ + } +} + +static int +wait_jail(int fd, int pfd) +{ + fd_set lset; + struct timeval tv; + int error, jid, maxfd; + + FD_ZERO(&lset); + FD_SET(fd, &lset); + FD_SET(pfd, &lset); + + maxfd = MAX(fd, pfd); + + tv.tv_sec = 5; + tv.tv_usec = 0; + + /* Wait for jid to be written. */ + do { + error = select(maxfd + 1, &lset, NULL, NULL, &tv); + } while (error == -1 && errno == EINTR); + + if (error == 0) { + atf_tc_fail("Jail creator did not respond in time."); + } + + ATF_REQUIRE_MSG(error > 0, "Unexpected error %d from select()", errno); + + if (FD_ISSET(pfd, &lset)) { + /* Process died */ + atf_tc_fail("Jail creator died unexpectedly."); + } + + ATF_REQUIRE(FD_ISSET(fd, &lset)); + ATF_REQUIRE_EQ(sizeof(jid), recv(fd, &jid, sizeof(jid), 0)); + + return (jid); +} + +static int +try_attach_child(int jid, cpuset_t *expected_mask) +{ + cpuset_t mask; + + if (jail_attach(jid) == -1) { + if (errno == EDEADLK) + return (FAILURE_DEADLK); + return (FAILURE_ATTACH); + } + + if (expected_mask == NULL) + return (FAILURE_SUCCESS); + + /* If we had an expected mask, check it against the new process mask. */ + CPU_ZERO(&mask); + if (cpuset_getaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, + -1, sizeof(mask), &mask) != 0) { + return (FAILURE_MASK); + } + + if (CPU_CMP(expected_mask, &mask) != 0) + return (FAILURE_BADAFFIN); + + return (0); +} + +static void +try_attach(int jid, cpuset_t *expected_mask) +{ + const char *errstr; + pid_t pid; + int error, fail, status; + + ATF_REQUIRE(expected_mask != NULL); + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) + _exit(try_attach_child(jid, expected_mask)); + + while ((error = waitpid(pid, &status, 0)) == -1 && errno == EINTR) { + /* Try again. */ + } + + /* Sanity check the exit info. */ + ATF_REQUIRE_EQ(pid, error); + ATF_REQUIRE(WIFEXITED(status)); + if ((fail = WEXITSTATUS(status)) != 0) { + errstr = do_jail_errstr(fail); + if (errstr != NULL) + atf_tc_fail("%s", errstr); + else + atf_tc_fail("Unknown error '%d'", WEXITSTATUS(status)); + } +} + +ATF_TC(jail_attach_disjoint); +ATF_TC_HEAD(jail_attach_disjoint, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test root attachment into completely disjoint jail cpuset."); + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(jail_attach_disjoint, tc) +{ + cpuset_t smask, jmask; + int sockpair[2]; + cpusetid_t setid; + pid_t pid; + int fcpu, jid, pfd, sock, scpu; + + ATF_REQUIRE_EQ(0, cpuset(&setid)); + + skip_ltncpu(2, &jmask); + fcpu = CPU_FFS(&jmask) - 1; + ATF_REQUIRE_EQ(0, socketpair(PF_UNIX, SOCK_STREAM, 0, sockpair)); + + /* We'll wait on the procdesc, too, so we can fail faster if it dies. */ + ATF_REQUIRE((pid = pdfork(&pfd, 0)) != -1); + + if (pid == 0) { + /* First child sets up the jail. */ + sock = sockpair[SP_CHILD]; + close(sockpair[SP_PARENT]); + + _exit(jail_attach_disjoint_newjail(sock)); + } + + close(sockpair[SP_CHILD]); + sock = sockpair[SP_PARENT]; + + ATF_REQUIRE((jid = wait_jail(sock, pfd)) > 0); + + /* + * This process will be clamped down to the first cpu, while the jail + * will simply have the first CPU removed to make it a completely + * disjoint operation. + */ + CPU_ZERO(&smask); + CPU_SET(fcpu, &smask); + CPU_CLR(fcpu, &jmask); + + /* + * We'll test with the first and second cpu set as well. Only the + * second cpu should be used. + */ + scpu = CPU_FFS(&jmask) - 1; + + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_ROOT, CPU_WHICH_JAIL, + jid, sizeof(jmask), &jmask)); + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_CPUSET, + setid, sizeof(smask), &smask)); + + try_attach(jid, &jmask); + + CPU_SET(scpu, &smask); + ATF_REQUIRE_EQ(0, cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_CPUSET, + setid, sizeof(smask), &smask)); + + CPU_CLR(fcpu, &smask); + try_attach(jid, &smask); +} + ATF_TC(badparent); ATF_TC_HEAD(badparent, tc) { @@ -488,6 +688,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, jail_attach_newbase_plain); ATF_TP_ADD_TC(tp, jail_attach_prevbase); ATF_TP_ADD_TC(tp, jail_attach_plain); + ATF_TP_ADD_TC(tp, jail_attach_disjoint); ATF_TP_ADD_TC(tp, badparent); return (atf_no_error()); } diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 18cc0c56d697..19ad3fd20955 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -1255,6 +1255,11 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, * as the parent, then we'll check if the process was previously using * the root set and, if it wasn't, create a new base with the process's * mask applied to it. + * + * If the new root is incompatible with the existing mask, then we allow + * the process to take on the new root if and only if they have + * privilege to widen their mask anyways. Unprivileged processes get + * rejected with EDEADLK. */ if (set != NULL && rebase && nroot != tdroot) { cpusetid_t base_id, root_id; @@ -1265,6 +1270,9 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, if (base_id != root_id) { error = cpuset_setproc_newbase(td, set, nroot, &base, &freelist, &domainlist); + if (error == EDEADLK && + priv_check(td, PRIV_SCHED_CPUSET) == 0) + error = 0; if (error != 0) goto unlock_out; } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 03:38:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E2FA55FF68; Thu, 4 Mar 2021 03:38:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drc6V1bTyz4ZjS; Thu, 4 Mar 2021 03:38:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 2477B286EF; Thu, 4 Mar 2021 03:38:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f178.google.com with SMTP id v64so19429469qtd.5; Wed, 03 Mar 2021 19:38:58 -0800 (PST) X-Gm-Message-State: AOAM533FFE/HVOKWIQe9R8ik8xeCeSCgzQ/N1F9RpJ6wPTOFm6C2go/b pVj3luheiAx/6/u83fqB7nGT6+KrCd1at8rieio= X-Google-Smtp-Source: ABdhPJzjikhqxAksAvydvS9msgBM+4lmV+U+O/Y2iSQ7tRoeV+tnz3tY91n2ppK/IgwYjBwn6UKFffFPQCjW9FdJobo= X-Received: by 2002:ac8:5bcb:: with SMTP id b11mr2414038qtb.310.1614829137449; Wed, 03 Mar 2021 19:38:57 -0800 (PST) MIME-Version: 1.0 References: <202103031828.123ISTI5001652@gitrepo.freebsd.org> <2c9e447a-d139-fb48-d9b5-85bfae1ff30f@FreeBSD.org> In-Reply-To: <2c9e447a-d139-fb48-d9b5-85bfae1ff30f@FreeBSD.org> From: Kyle Evans Date: Wed, 3 Mar 2021 21:38:46 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 55deb0a5f089 - main - service(8): use an environment more consistent with init(8) To: Kubilay Kocak Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 03:38:58 -0000 On Wed, Mar 3, 2021 at 5:45 PM Kubilay Kocak wrote: > > On 4/03/2021 5:28 am, Kyle Evans wrote: > > The branch main has been updated by kevans: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=55deb0a5f089c8a27cfc1666655b93881c2b47ae > > > > commit 55deb0a5f089c8a27cfc1666655b93881c2b47ae > > Author: Andrew Gierth > > AuthorDate: 2021-03-03 18:25:11 +0000 > > Commit: Kyle Evans > > CommitDate: 2021-03-03 18:25:11 +0000 > > > > service(8): use an environment more consistent with init(8) > > > > init(8) sets the "daemon" login class without specifying a pw > > entry (so no substitutions are done on the variables). service(8)'s > > use of env -L had the effect of specifying root's pw entry, with two > > effects: getpwnam and getpwuid are being called, which may not be > > entirely safe depending on what nsswitch is up to and what stage of > > boot we are at, and substitutions would have been done. > > > > Fix by teaching env(8) to allow -L -/classname to set the class > > environment with no pw entry at all specified, and use it in > > service(8). > > > > PR: 253959 > > Is MFC'able to stable/* or might there be backward compatibility issue? Indeed, I'll be MFC'ing this in some ~days. Thanks, Kyle Evans From owner-dev-commits-src-all@freebsd.org Thu Mar 4 07:34:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 190E456457B; Thu, 4 Mar 2021 07:34: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 4DrjLF099mz4mMB; Thu, 4 Mar 2021 07:34: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 EC84018E7B; Thu, 4 Mar 2021 07:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1247YSjb045980; Thu, 4 Mar 2021 07:34:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1247YSXV045979; Thu, 4 Mar 2021 07:34:28 GMT (envelope-from git) Date: Thu, 4 Mar 2021 07:34:28 GMT Message-Id: <202103040734.1247YSXV045979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oleksandr Tymoshenko Subject: git: 37cd6c20dbcf - main - cron: consume blanks in system crontabs before options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gonzo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37cd6c20dbcf251e38d6dfb9d3e02022941f6fc7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 07:34:29 -0000 The branch main has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=37cd6c20dbcf251e38d6dfb9d3e02022941f6fc7 commit 37cd6c20dbcf251e38d6dfb9d3e02022941f6fc7 Author: Oleksandr Tymoshenko AuthorDate: 2021-03-04 07:23:31 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-03-04 07:23:31 +0000 cron: consume blanks in system crontabs before options On system crontabs, multiple blanks are not being consumed after reading the username. This change adds blank consumption before parsing any -[qn] options. Without this change, an entry like: * * * * * username -n true # Two spaces between username and option. will fail, as the shell will try to execute (' -n true'), while an entry like: * * * * * username -n true # One space between username and option. works as expected (executes 'true'). For user crontabs, this is not an issue as the preceding (day of week or @shortcut) processing consumes any leading whitespace. PR: 253699 Submitted by: Eric A. Borisch MFC after: 1 week --- usr.sbin/cron/lib/entry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/cron/lib/entry.c b/usr.sbin/cron/lib/entry.c index 66ead885bea8..2693c9c8d07a 100644 --- a/usr.sbin/cron/lib/entry.c +++ b/usr.sbin/cron/lib/entry.c @@ -315,6 +315,9 @@ load_entry(file, error_func, pw, envp) goto eof; } + /* need to have consumed blanks when checking options below */ + Skip_Blanks(ch, file) + unget_char(ch, file); #ifdef LOGIN_CAP if ((s = strrchr(username, '/')) != NULL) { *s = '\0'; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 08:27:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A735E566659; Thu, 4 Mar 2021 08:27: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 4DrkWy4Ksdz4pfZ; Thu, 4 Mar 2021 08:27: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 87CE819E53; Thu, 4 Mar 2021 08:27: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 1248RwNu013528; Thu, 4 Mar 2021 08:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1248Rw69013527; Thu, 4 Mar 2021 08:27:58 GMT (envelope-from git) Date: Thu, 4 Mar 2021 08:27:58 GMT Message-Id: <202103040827.1248Rw69013527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 05e742af6f54 - stable/13 - calculate prr_out correctly when pipe < ssthresh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05e742af6f548364909ed671f0b3774e54dc77d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 08:27:58 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=05e742af6f548364909ed671f0b3774e54dc77d1 commit 05e742af6f548364909ed671f0b3774e54dc77d1 Author: Richard Scheffenegger AuthorDate: 2021-03-01 15:25:46 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-04 08:13:51 +0000 calculate prr_out correctly when pipe < ssthresh Reviewed By: #transport, tuexen MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28998 (cherry picked from commit 0b0f8b359d0b94b09cfec35e5d5de01b23c7fbf1) --- sys/netinet/tcp_input.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index f7ef3ed81da2..0cb99ce8f2c5 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2606,10 +2606,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); else limit = imax(tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit, + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)), del_data) + maxseg; snd_cnt = imin(tp->snd_ssthresh - pipe, limit); } @@ -3982,10 +3984,12 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); else limit = imax(tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit, + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)), del_data) + maxseg; snd_cnt = imin((tp->snd_ssthresh - pipe), limit); } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 08:44:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5986956706E; Thu, 4 Mar 2021 08:44:09 +0000 (UTC) (envelope-from rpokala@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 4Drktd22LZz4qQ9; Thu, 4 Mar 2021 08:44:09 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id AAFCC2AA9E; Thu, 4 Mar 2021 08:44:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.45.21011103 Date: Thu, 04 Mar 2021 00:44:05 -0800 Subject: Re: 8a272653d9fb - main - stress2: Initial import From: Ravi Pokala To: Peter Holm , , , Message-ID: Thread-Topic: 8a272653d9fb - main - stress2: Initial import References: <202103031412.123EC3oa069178@gitrepo.freebsd.org> In-Reply-To: <202103031412.123EC3oa069178@gitrepo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 08:44:09 -0000 -----Original Message----- From: on behalf of Peter Holm Date: 2021-03-03, Wednesday at 06:12 To: , , Subject: git: 8a272653d9fb - main - stress2: Initial import The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=8a272653d9fbd9fc37691c9aad6a05089b4ecb4d commit 8a272653d9fbd9fc37691c9aad6a05089b4ecb4d Author: Peter Holm AuthorDate: 2021-03-03 12:56:56 +0000 Commit: Peter Holm CommitDate: 2021-03-03 14:11:40 +0000 stress2: Initial import Ooo! The (in)famous "stress2" suite is finally in the main src tree! Thanks, Peter! -Ravi (rpokala@) From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:20:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DF0C569196; Thu, 4 Mar 2021 09:20: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 4DrlhT1QRWz4tV1; Thu, 4 Mar 2021 09:20: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 23D381A833; Thu, 4 Mar 2021 09:20: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 1249KP1K087434; Thu, 4 Mar 2021 09:20:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249KPho087433; Thu, 4 Mar 2021 09:20:25 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:20:25 GMT Message-Id: <202103040920.1249KPho087433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 8d0f1438b0d7 - stable/13 - ipfw: make algo name argument optional for some table types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d0f1438b0d73dfa880cfafc5d09beb4e7100a3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:20:25 -0000 The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=8d0f1438b0d73dfa880cfafc5d09beb4e7100a3f commit 8d0f1438b0d73dfa880cfafc5d09beb4e7100a3f Author: Andrey V. Elsukov AuthorDate: 2021-02-25 13:57:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-03-04 09:19:31 +0000 ipfw: make algo name argument optional for some table types Most of table types currently supported by ipfw have only one algorithm implementation. When user creates such tables, allow to omit algo name in arguments. E.g. now it is possible: ipfw table T1 create type number ipfw table T2 create type iface ipfw table T3 create type flow PR: 233072 Sponsored by: Yandex LLC (cherry picked from commit 13ad237a19b7368124483d9d1dc3258c27880fef) --- sbin/ipfw/tables.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 57b8cef00889..81cf7e392586 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -83,6 +83,15 @@ static struct _s_x tabletypes[] = { { NULL, 0 } }; +/* Default algorithms for various table types */ +static struct _s_x tablealgos[] = { + { "addr:radix", IPFW_TABLE_ADDR }, + { "flow:hash", IPFW_TABLE_FLOW }, + { "iface:array", IPFW_TABLE_INTERFACE }, + { "number:array", IPFW_TABLE_NUMBER }, + { NULL, 0 } +}; + static struct _s_x tablevaltypes[] = { { "skipto", IPFW_VTYPE_SKIPTO }, { "pipe", IPFW_VTYPE_PIPE }, @@ -468,8 +477,15 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) } /* Set some defaults to preserve compatibility. */ - if (xi.algoname[0] == '\0' && xi.type == 0) - xi.type = IPFW_TABLE_ADDR; + if (xi.algoname[0] == '\0') { + const char *algo; + + if (xi.type == 0) + xi.type = IPFW_TABLE_ADDR; + algo = match_value(tablealgos, xi.type); + if (algo != NULL) + strlcpy(xi.algoname, algo, sizeof(xi.algoname)); + } if (xi.vmask == 0) xi.vmask = IPFW_VTYPE_LEGACY; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:22:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D121556938B; Thu, 4 Mar 2021 09:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrlkP5VtKz4tnm; Thu, 4 Mar 2021 09:22: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 AFC771A859; Thu, 4 Mar 2021 09:22: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 1249M5WI092334; Thu, 4 Mar 2021 09:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249M5Le092333; Thu, 4 Mar 2021 09:22:05 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:22:05 GMT Message-Id: <202103040922.1249M5Le092333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: f8317f3a4c7d - stable/12 - ipfw: make algo name argument optional for some table types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f8317f3a4c7dc01438328edd21c984d794286ec5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:22:05 -0000 The branch stable/12 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=f8317f3a4c7dc01438328edd21c984d794286ec5 commit f8317f3a4c7dc01438328edd21c984d794286ec5 Author: Andrey V. Elsukov AuthorDate: 2021-02-25 13:57:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-03-04 09:21:28 +0000 ipfw: make algo name argument optional for some table types Most of table types currently supported by ipfw have only one algorithm implementation. When user creates such tables, allow to omit algo name in arguments. E.g. now it is possible: ipfw table T1 create type number ipfw table T2 create type iface ipfw table T3 create type flow PR: 233072 Sponsored by: Yandex LLC (cherry picked from commit 13ad237a19b7368124483d9d1dc3258c27880fef) --- sbin/ipfw/tables.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 57b8cef00889..81cf7e392586 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -83,6 +83,15 @@ static struct _s_x tabletypes[] = { { NULL, 0 } }; +/* Default algorithms for various table types */ +static struct _s_x tablealgos[] = { + { "addr:radix", IPFW_TABLE_ADDR }, + { "flow:hash", IPFW_TABLE_FLOW }, + { "iface:array", IPFW_TABLE_INTERFACE }, + { "number:array", IPFW_TABLE_NUMBER }, + { NULL, 0 } +}; + static struct _s_x tablevaltypes[] = { { "skipto", IPFW_VTYPE_SKIPTO }, { "pipe", IPFW_VTYPE_PIPE }, @@ -468,8 +477,15 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) } /* Set some defaults to preserve compatibility. */ - if (xi.algoname[0] == '\0' && xi.type == 0) - xi.type = IPFW_TABLE_ADDR; + if (xi.algoname[0] == '\0') { + const char *algo; + + if (xi.type == 0) + xi.type = IPFW_TABLE_ADDR; + algo = match_value(tablealgos, xi.type); + if (algo != NULL) + strlcpy(xi.algoname, algo, sizeof(xi.algoname)); + } if (xi.vmask == 0) xi.vmask = IPFW_VTYPE_LEGACY; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:24:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A3425696DA; Thu, 4 Mar 2021 09:24:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drlmz25kDz4v11; Thu, 4 Mar 2021 09:24: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 3AE001AB9B; Thu, 4 Mar 2021 09:24: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 1249OJ0H092799; Thu, 4 Mar 2021 09:24:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249OJrE092797; Thu, 4 Mar 2021 09:24:19 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:24:19 GMT Message-Id: <202103040924.1249OJrE092797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 952ad2822359 - stable/11 - ipfw: make algo name argument optional for some table types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 952ad28223596ef4e323a9a7da81ef3faf1c919a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:24:19 -0000 The branch stable/11 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=952ad28223596ef4e323a9a7da81ef3faf1c919a commit 952ad28223596ef4e323a9a7da81ef3faf1c919a Author: Andrey V. Elsukov AuthorDate: 2021-02-25 13:57:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-03-04 09:23:01 +0000 ipfw: make algo name argument optional for some table types Most of table types currently supported by ipfw have only one algorithm implementation. When user creates such tables, allow to omit algo name in arguments. E.g. now it is possible: ipfw table T1 create type number ipfw table T2 create type iface ipfw table T3 create type flow PR: 233072 Sponsored by: Yandex LLC (cherry picked from commit 13ad237a19b7368124483d9d1dc3258c27880fef) --- sbin/ipfw/tables.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index e914ad63343c..12e5a4cc435f 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -83,6 +83,15 @@ static struct _s_x tabletypes[] = { { NULL, 0 } }; +/* Default algorithms for various table types */ +static struct _s_x tablealgos[] = { + { "addr:radix", IPFW_TABLE_ADDR }, + { "flow:hash", IPFW_TABLE_FLOW }, + { "iface:array", IPFW_TABLE_INTERFACE }, + { "number:array", IPFW_TABLE_NUMBER }, + { NULL, 0 } +}; + static struct _s_x tablevaltypes[] = { { "skipto", IPFW_VTYPE_SKIPTO }, { "pipe", IPFW_VTYPE_PIPE }, @@ -469,8 +478,15 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) } /* Set some defaults to preserve compatibility. */ - if (xi.algoname[0] == '\0' && xi.type == 0) - xi.type = IPFW_TABLE_ADDR; + if (xi.algoname[0] == '\0') { + const char *algo; + + if (xi.type == 0) + xi.type = IPFW_TABLE_ADDR; + algo = match_value(tablealgos, xi.type); + if (algo != NULL) + strlcpy(xi.algoname, algo, sizeof(xi.algoname)); + } if (xi.vmask == 0) xi.vmask = IPFW_VTYPE_LEGACY; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:33:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39DE2569FE3; Thu, 4 Mar 2021 09:33: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 4DrlzP19Yfz3Bmf; Thu, 4 Mar 2021 09:33: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 1B3321AB7A; Thu, 4 Mar 2021 09:33: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 1249XLBN005906; Thu, 4 Mar 2021 09:33:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249XL6Y005905; Thu, 4 Mar 2021 09:33:21 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:33:21 GMT Message-Id: <202103040933.1249XL6Y005905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e7705585fed8 - stable/12 - bridgestp: Ensure we send STP on VLAN interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e7705585fed8ef9612388729a4e3247ceed3f038 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:33:21 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e7705585fed8ef9612388729a4e3247ceed3f038 commit e7705585fed8ef9612388729a4e3247ceed3f038 Author: Kristof Provost AuthorDate: 2021-02-24 15:38:53 +0000 Commit: Kristof Provost CommitDate: 2021-03-04 09:30:26 +0000 bridgestp: Ensure we send STP on VLAN interfaces Reviewed by: donner@ MFC after: 1 week X-MFC-with: 711ed156b94562c3dcb2ee9c1b3f240f960a75d2 Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28916 (cherry picked from commit f5537cd0693c85efdb2180a0a107c51eae15ba39) --- sys/net/bridgestp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index d0259c37bf84..4be8e2f20819 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -2046,7 +2046,7 @@ bstp_reinit(struct bstp_state *bs) */ IFNET_RLOCK_NOSLEEP(); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifp->if_type != IFT_ETHER) + if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN) continue; /* Not Ethernet */ if (ifp->if_bridge != bridgeptr) From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:33:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63F4F569E22; Thu, 4 Mar 2021 09:33: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 4DrlzQ2NlXz3Bmg; Thu, 4 Mar 2021 09:33: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 451381AB7B; Thu, 4 Mar 2021 09:33: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 1249XMff005930; Thu, 4 Mar 2021 09:33:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249XMGE005929; Thu, 4 Mar 2021 09:33:22 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:33:22 GMT Message-Id: <202103040933.1249XMGE005929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: eb4221b9fb91 - stable/12 - bridge tests: Test that we also forward on some interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: eb4221b9fb91980ea43dcf55e6610c6d044954e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:33:22 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=eb4221b9fb91980ea43dcf55e6610c6d044954e7 commit eb4221b9fb91980ea43dcf55e6610c6d044954e7 Author: Kristof Provost AuthorDate: 2021-02-24 15:40:37 +0000 Commit: Kristof Provost CommitDate: 2021-03-04 09:30:26 +0000 bridge tests: Test that we also forward on some interfaces Ensure that we not only block on some interfaces, but also forward on some. Without the previous commit we wound up discarding on all ports, rather than only on the ports needed to break the loop. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28917 (cherry picked from commit 7a4dbffa4205fc274b4884a6332d4831c5791320) --- tests/sys/net/if_bridge_test.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index bc9add68ce25..1f10fe325a2c 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -117,6 +117,15 @@ stp_body() then atf_fail "STP failed to detect bridging loop" fi + + # We must also have at least some forwarding interfaces + a_forwarding=$(jexec a ifconfig ${bridge_a} | grep forwarding) + b_forwarding=$(jexec b ifconfig ${bridge_b} | grep forwarding) + + if [ -z "${a_forwarding}" ] && [ -z "${b_forwarding}" ] + then + atf_fail "STP failed to detect bridging loop" + fi } stp_cleanup() @@ -182,6 +191,15 @@ stp_vlan_body() then atf_fail "STP failed to detect bridging loop" fi + + # We must also have at least some forwarding interfaces + a_forwarding=$(jexec a ifconfig ${bridge_a} | grep forwarding) + b_forwarding=$(jexec b ifconfig ${bridge_b} | grep forwarding) + + if [ -z "${a_forwarding}" ] && [ -z "${b_forwarding}" ] + then + atf_fail "STP failed to detect bridging loop" + fi } stp_vlan_cleanup() From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:33:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22DE9569D42; Thu, 4 Mar 2021 09:33: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 4DrlzQ6DMRz3Bml; Thu, 4 Mar 2021 09:33: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 B5DFD1ABC3; Thu, 4 Mar 2021 09:33: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 1249XM9w006002; Thu, 4 Mar 2021 09:33:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249XMah006001; Thu, 4 Mar 2021 09:33:22 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:33:22 GMT Message-Id: <202103040933.1249XMah006001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 772b39d6309b - stable/13 - bridgestp: Ensure we send STP on VLAN interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 772b39d6309b1d62934870869e65f5334f6af79c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:33:24 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=772b39d6309b1d62934870869e65f5334f6af79c commit 772b39d6309b1d62934870869e65f5334f6af79c Author: Kristof Provost AuthorDate: 2021-02-24 15:38:53 +0000 Commit: Kristof Provost CommitDate: 2021-03-04 09:30:13 +0000 bridgestp: Ensure we send STP on VLAN interfaces Reviewed by: donner@ MFC after: 1 week X-MFC-with: 711ed156b94562c3dcb2ee9c1b3f240f960a75d2 Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28916 (cherry picked from commit f5537cd0693c85efdb2180a0a107c51eae15ba39) --- sys/net/bridgestp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 82524440c241..9e3a3e14ecda 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -2052,7 +2052,7 @@ bstp_reinit(struct bstp_state *bs) */ NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifp->if_type != IFT_ETHER) + if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN) continue; /* Not Ethernet */ if (ifp->if_bridge != bridgeptr) From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:33:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E9B3569C30; Thu, 4 Mar 2021 09:33: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 4DrlzS60jdz3Bwk; Thu, 4 Mar 2021 09:33: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 0873E1AC22; Thu, 4 Mar 2021 09:33: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 1249XNpZ006050; Thu, 4 Mar 2021 09:33:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249XN3e006049; Thu, 4 Mar 2021 09:33:23 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:33:23 GMT Message-Id: <202103040933.1249XN3e006049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9c744d299243 - stable/13 - bridge tests: Test that we also forward on some interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c744d29924323fafa4326d499971edfff55a89c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:33:26 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9c744d29924323fafa4326d499971edfff55a89c commit 9c744d29924323fafa4326d499971edfff55a89c Author: Kristof Provost AuthorDate: 2021-02-24 15:40:37 +0000 Commit: Kristof Provost CommitDate: 2021-03-04 09:30:14 +0000 bridge tests: Test that we also forward on some interfaces Ensure that we not only block on some interfaces, but also forward on some. Without the previous commit we wound up discarding on all ports, rather than only on the ports needed to break the loop. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28917 (cherry picked from commit 7a4dbffa4205fc274b4884a6332d4831c5791320) --- tests/sys/net/if_bridge_test.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index bc9add68ce25..1f10fe325a2c 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -117,6 +117,15 @@ stp_body() then atf_fail "STP failed to detect bridging loop" fi + + # We must also have at least some forwarding interfaces + a_forwarding=$(jexec a ifconfig ${bridge_a} | grep forwarding) + b_forwarding=$(jexec b ifconfig ${bridge_b} | grep forwarding) + + if [ -z "${a_forwarding}" ] && [ -z "${b_forwarding}" ] + then + atf_fail "STP failed to detect bridging loop" + fi } stp_cleanup() @@ -182,6 +191,15 @@ stp_vlan_body() then atf_fail "STP failed to detect bridging loop" fi + + # We must also have at least some forwarding interfaces + a_forwarding=$(jexec a ifconfig ${bridge_a} | grep forwarding) + b_forwarding=$(jexec b ifconfig ${bridge_b} | grep forwarding) + + if [ -z "${a_forwarding}" ] && [ -z "${b_forwarding}" ] + then + atf_fail "STP failed to detect bridging loop" + fi } stp_vlan_cleanup() From owner-dev-commits-src-all@freebsd.org Thu Mar 4 09:45:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DA6956A412; Thu, 4 Mar 2021 09:45: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 4DrmF71jMTz3D5S; Thu, 4 Mar 2021 09:45: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 2D7C91AEAE; Thu, 4 Mar 2021 09:45: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 1249jFHX019399; Thu, 4 Mar 2021 09:45:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1249jF0R019398; Thu, 4 Mar 2021 09:45:15 GMT (envelope-from git) Date: Thu, 4 Mar 2021 09:45:15 GMT Message-Id: <202103040945.1249jF0R019398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: ae608d4ee720 - stable/13 - RACK: fix an issue triggered by using the CDG CC module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae608d4ee7202cc34603e620bc551547e772c4d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 09:45:15 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ae608d4ee7202cc34603e620bc551547e772c4d2 commit ae608d4ee7202cc34603e620bc551547e772c4d2 Author: Michael Tuexen AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen CommitDate: 2021-03-04 09:44:50 +0000 RACK: fix an issue triggered by using the CDG CC module Obtained from: rrs@ PR: 238741 Sponsored by: Netlix, Inc. (cherry picked from commit 99adf230061268175a36061130e6adb0882270e8) --- sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 8e00cae85496..4d1a4cc8a0eb 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -12305,7 +12305,7 @@ again: sb_offset = tp->snd_nxt - tp->snd_una; else sb_offset = 0; - if ((IN_RECOVERY(tp->t_flags) == 0) || rack->rack_no_prr) { + if ((IN_FASTRECOVERY(tp->t_flags) == 0) || rack->rack_no_prr) { if (rack->r_ctl.rc_tlp_new_data) { /* TLP is forcing out new data */ if (rack->r_ctl.rc_tlp_new_data > (uint32_t) (avail - sb_offset)) { @@ -12319,7 +12319,7 @@ again: new_data_tlp = doing_tlp = 1; } else len = rack_what_can_we_send(tp, rack, cwnd_to_use, avail, sb_offset); - if (IN_RECOVERY(tp->t_flags) && (len > segsiz)) { + if (IN_FASTRECOVERY(tp->t_flags) && (len > segsiz)) { /* * For prr=off, we need to send only 1 MSS * at a time. We do this because another sack could From owner-dev-commits-src-all@freebsd.org Thu Mar 4 10:36:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA6D956C085; Thu, 4 Mar 2021 10:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrnNR4yZZz3H4K; Thu, 4 Mar 2021 10:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D1C61B5F0; Thu, 4 Mar 2021 10:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124AadLh085728; Thu, 4 Mar 2021 10:36:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124AadXs085727; Thu, 4 Mar 2021 10:36:39 GMT (envelope-from git) Date: Thu, 4 Mar 2021 10:36:39 GMT Message-Id: <202103041036.124AadXs085727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: dc27d5312b78 - stable/12 - RACK: fix an issue triggered by using the CDG CC module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: dc27d5312b782b72740d71d81435a80dfe8b78bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 10:36:39 -0000 The branch stable/12 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=dc27d5312b782b72740d71d81435a80dfe8b78bd commit dc27d5312b782b72740d71d81435a80dfe8b78bd Author: Michael Tuexen AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen CommitDate: 2021-03-04 10:35:03 +0000 RACK: fix an issue triggered by using the CDG CC module Manually resolved merge conflics. Obtained from: rrs@ PR: 238741 Sponsored by: Netlix, Inc. (cherry picked from commit 99adf230061268175a36061130e6adb0882270e8) --- sys/netinet/tcp_stacks/rack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 1d063a8a1f6f..fd1e3d18de08 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -7383,7 +7383,7 @@ again: sb_offset = tp->snd_nxt - tp->snd_una; else sb_offset = 0; - if (IN_RECOVERY(tp->t_flags) == 0) { + if (IN_FASTRECOVERY(tp->t_flags) == 0) { if (rack->r_ctl.rc_tlp_new_data) { /* TLP is forcing out new data */ if (rack->r_ctl.rc_tlp_new_data > (uint32_t) (avail - sb_offset)) { From owner-dev-commits-src-all@freebsd.org Thu Mar 4 11:01:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0B0856C77F; Thu, 4 Mar 2021 11:01: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 4DrnxJ64stz3JTW; Thu, 4 Mar 2021 11:01: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 C39C11BFC1; Thu, 4 Mar 2021 11:01: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 124B1eml024728; Thu, 4 Mar 2021 11:01:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124B1ekk024727; Thu, 4 Mar 2021 11:01:40 GMT (envelope-from git) Date: Thu, 4 Mar 2021 11:01:40 GMT Message-Id: <202103041101.124B1ekk024727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 43a2f41379f5 - releng/13.0 - RACK: fix an issue triggered by using the CDG CC module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 43a2f41379f5b2a5aea94cc8389b181bf2d35b65 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 11:01:40 -0000 The branch releng/13.0 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=43a2f41379f5b2a5aea94cc8389b181bf2d35b65 commit 43a2f41379f5b2a5aea94cc8389b181bf2d35b65 Author: Michael Tuexen AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen CommitDate: 2021-03-04 11:00:34 +0000 RACK: fix an issue triggered by using the CDG CC module Obtained from: rrs@ Approved by: re (gjb) PR: 238741 Sponsored by: Netlix, Inc. (cherry picked from commit 99adf230061268175a36061130e6adb0882270e8) (cherry picked from commit ae608d4ee7202cc34603e620bc551547e772c4d2) --- sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 8e00cae85496..4d1a4cc8a0eb 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -12305,7 +12305,7 @@ again: sb_offset = tp->snd_nxt - tp->snd_una; else sb_offset = 0; - if ((IN_RECOVERY(tp->t_flags) == 0) || rack->rack_no_prr) { + if ((IN_FASTRECOVERY(tp->t_flags) == 0) || rack->rack_no_prr) { if (rack->r_ctl.rc_tlp_new_data) { /* TLP is forcing out new data */ if (rack->r_ctl.rc_tlp_new_data > (uint32_t) (avail - sb_offset)) { @@ -12319,7 +12319,7 @@ again: new_data_tlp = doing_tlp = 1; } else len = rack_what_can_we_send(tp, rack, cwnd_to_use, avail, sb_offset); - if (IN_RECOVERY(tp->t_flags) && (len > segsiz)) { + if (IN_FASTRECOVERY(tp->t_flags) && (len > segsiz)) { /* * For prr=off, we need to send only 1 MSS * at a time. We do this because another sack could From owner-dev-commits-src-all@freebsd.org Thu Mar 4 12:00:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0A3B56EA27; Thu, 4 Mar 2021 12:00:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrqFb4Wb6z3Nbc; Thu, 4 Mar 2021 12:00: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 8E8841CBB8; Thu, 4 Mar 2021 12:00: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 124C0pKM001074; Thu, 4 Mar 2021 12:00:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124C0p9Z001073; Thu, 4 Mar 2021 12:00:51 GMT (envelope-from git) Date: Thu, 4 Mar 2021 12:00:51 GMT Message-Id: <202103041200.124C0p9Z001073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: b8ffda0a37e1 - releng/13.0 - tcp: various improvements and fixes to PRR - Ensure cwnd doesn't shrink to zero with PRR - use accurate rfc6675_pipe when enabled - Address two incorrect calculations and enhance readability - address second instance of cwnd potentially becoming zero - fix sublte bug due to implicit int to uint typecase in max() - fix bug due to typo in hand-coded CEILING() function by using howmany() macro - use int instead of long, and add a missing long typecast - replace if conditionals with easier to read imax/imin (as in pseudocode) - Avoid accounting left-edge twice in partial ACK. - Include new data sent in PRR calculation - Improve PRR initial transmission timing - Fix prr_out when pipe < ssthresh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b8ffda0a37e126623069bce49e8096dbdb4bfde3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 12:00:51 -0000 The branch releng/13.0 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=b8ffda0a37e126623069bce49e8096dbdb4bfde3 commit b8ffda0a37e126623069bce49e8096dbdb4bfde3 Author: Richard Scheffenegger AuthorDate: 2021-02-19 12:52:06 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-04 11:56:35 +0000 tcp: various improvements and fixes to PRR - Ensure cwnd doesn't shrink to zero with PRR - use accurate rfc6675_pipe when enabled - Address two incorrect calculations and enhance readability - address second instance of cwnd potentially becoming zero - fix sublte bug due to implicit int to uint typecase in max() - fix bug due to typo in hand-coded CEILING() function by using howmany() macro - use int instead of long, and add a missing long typecast - replace if conditionals with easier to read imax/imin (as in pseudocode) - Avoid accounting left-edge twice in partial ACK. - Include new data sent in PRR calculation - Improve PRR initial transmission timing - Fix prr_out when pipe < ssthresh Reviewed By: #transport, kbowling, tuexen Reported by: Liang Tian Approved by: re (gjb) MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28780 Differential Revision: https://reviews.freebsd.org/D28816 Differential Revision: https://reviews.freebsd.org/D28813 Differential Revision: https://reviews.freebsd.org/D28819 Differential Revision: https://reviews.freebsd.org/D28941 Differential Revision: https://reviews.freebsd.org/D28953 Differential Revision: https://reviews.freebsd.org/D28998 (cherry picked from commit 853fd7a2e39802e46bd3d6476529796ac22412d9) (cherry picked from commit c3aa4ba5dfc084e40e4151b25a0d5f8d24a036ba) (cherry picked from commit a8e431e1537d056a3f9e466eaceec28c399c220b) (cherry picked from commit 32ed0ef06b8326271c4665406cac81fa47d0d29c) (cherry picked from commit 48396dc77922c68377ecac0ead2f8b0b5453c451) (cherry picked from commit ffbf1b809ef5080afa130c11fa4afce9fef7e7fe) (cherry picked from commit 31d7a27c6e88c3d5bd0907774ec70176a92da5bb) (cherry picked from commit 25fb4c363b299c26c35158fa059379af4a007253) (cherry picked from commit 9e83a6a556ed8d9a2821de5d5f5c7d4b1292c694) (cherry picked from commit 9596751563dc1819d177fa3ec6660a3bdc18021c) (cherry picked from commit e9071000c9a04e3f685579500e24da9848944bb1) (cherry picked from commit 2b43cd2ea26f758d23e8c009cf7521c4ddec7353) (cherry picked from commit 0b0f8b359d0b94b09cfec35e5d5de01b23c7fbf1) (cherry picked from commit 05e742af6f548364909ed671f0b3774e54dc77d1) --- sys/netinet/tcp_input.c | 95 ++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 459b78cd444a..f2edbecbb079 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2577,8 +2577,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (V_tcp_do_prr && IN_FASTRECOVERY(tp->t_flags) && (tp->t_flags & TF_SACK_PERMIT)) { - long snd_cnt = 0, limit = 0; - long del_data = 0, pipe = 0; + int snd_cnt = 0, limit = 0; + int del_data = 0, pipe = 0; /* * In a duplicate ACK del_data is only the * diff_in_sack. If no SACK is used del_data @@ -2586,45 +2586,41 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, * estimate to be in the network. */ del_data = tp->sackhint.delivered_data; - pipe = (tp->snd_nxt - tp->snd_fack) + - tp->sackhint.sack_bytes_rexmit; + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(tp); + else + pipe = (tp->snd_nxt - tp->snd_fack) + + tp->sackhint.sack_bytes_rexmit; tp->sackhint.prr_delivered += del_data; - if (pipe > tp->snd_ssthresh) { + if (pipe >= tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = - max(1, tp->snd_nxt - tp->snd_una); - snd_cnt = (tp->sackhint.prr_delivered * - tp->snd_ssthresh / - tp->sackhint.recover_fs) + - 1 - tp->sackhint.sack_bytes_rexmit; + imax(1, tp->snd_nxt - tp->snd_una); + snd_cnt = howmany((long)tp->sackhint.prr_delivered * + tp->snd_ssthresh, tp->sackhint.recover_fs) - + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); else - if ((tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit) > - del_data) - limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit + - maxseg; - else - limit = del_data + maxseg; - if ((tp->snd_ssthresh - pipe) < limit) - snd_cnt = tp->snd_ssthresh - pipe; - else - snd_cnt = limit; + limit = imax(tp->sackhint.prr_delivered - + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)), + del_data) + maxseg; + snd_cnt = imin(tp->snd_ssthresh - pipe, limit); } - snd_cnt = max((snd_cnt / maxseg), 0); + snd_cnt = imax(snd_cnt, 0) / maxseg; /* * Send snd_cnt new data into the network in * response to this ACK. If there is a going * to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + - (snd_cnt * maxseg); + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); } else if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -2684,7 +2680,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, * snd_ssthresh is already updated by * cc_cong_signal. */ - tp->sackhint.prr_delivered = 0; + tp->sackhint.prr_delivered = + tp->sackhint.sacked_bytes; tp->sackhint.sack_bytes_rexmit = 0; tp->sackhint.recover_fs = max(1, tp->snd_nxt - tp->snd_una); @@ -3927,7 +3924,7 @@ tcp_mssopt(struct in_conninfo *inc) void tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) { - long snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; + int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); @@ -3939,41 +3936,43 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) * (del_data) and an estimate of how many bytes are in the * network. */ - if (SEQ_GEQ(th->th_ack, tp->snd_una)) - del_data = BYTES_THIS_ACK(tp, th); - del_data += tp->sackhint.delivered_data; - pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; + del_data = tp->sackhint.delivered_data; + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(tp); + else + pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; tp->sackhint.prr_delivered += del_data; /* * Proportional Rate Reduction */ - if (pipe > tp->snd_ssthresh) { + if (pipe >= tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = - max(1, tp->snd_nxt - tp->snd_una); - snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / - tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit; + imax(1, tp->snd_nxt - tp->snd_una); + snd_cnt = howmany((long)tp->sackhint.prr_delivered * + tp->snd_ssthresh, tp->sackhint.recover_fs) - + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); else - if ((tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit) > del_data) - limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit + maxseg; - else - limit = del_data + maxseg; - snd_cnt = min((tp->snd_ssthresh - pipe), limit); + limit = imax(tp->sackhint.prr_delivered - + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)), + del_data) + maxseg; + snd_cnt = imin((tp->snd_ssthresh - pipe), limit); } - snd_cnt = max((snd_cnt / maxseg), 0); + snd_cnt = imax(snd_cnt, 0) / maxseg; /* * Send snd_cnt new data into the network in response to this ack. * If there is going to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg); + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 12:24:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1AFA56FC21; Thu, 4 Mar 2021 12:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drqmw4Bhjz3PyF; Thu, 4 Mar 2021 12:24: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 7EEAF1D0AD; Thu, 4 Mar 2021 12:24: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 124COWpE032291; Thu, 4 Mar 2021 12:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124COWqB032290; Thu, 4 Mar 2021 12:24:32 GMT (envelope-from git) Date: Thu, 4 Mar 2021 12:24:32 GMT Message-Id: <202103041224.124COWqB032290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chris Rees Subject: git: 5ac70383c8b3 - main - elftoolchain: stop leaving tempfiles on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ac70383c8b32eeec80426e837960977971c7c2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 12:24:32 -0000 The branch main has been updated by crees (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5ac70383c8b32eeec80426e837960977971c7c2b commit 5ac70383c8b32eeec80426e837960977971c7c2b Author: Chris Rees AuthorDate: 2021-02-15 11:37:06 +0000 Commit: Chris Rees CommitDate: 2021-03-04 12:24:07 +0000 elftoolchain: stop leaving tempfiles on error Temporary files were not cleaned up, resulting in $TMPDIR or even the current directory becoming littered with ecp.* files. This happened with error and even sometimes on success! Approved by: dim MFC after: 4 weeks Accepted upstream: https://sourceforge.net/p/elftoolchain/code/3918/ Differential Revision: https://reviews.freebsd.org/D28651 --- contrib/elftoolchain/elfcopy/archive.c | 31 ++++++++++---- contrib/elftoolchain/elfcopy/elfcopy.h | 1 + contrib/elftoolchain/elfcopy/main.c | 77 +++++++++++++++++++++++++++------- 3 files changed, 86 insertions(+), 23 deletions(-) diff --git a/contrib/elftoolchain/elfcopy/archive.c b/contrib/elftoolchain/elfcopy/archive.c index 9e23b831fdca..e57caad58e35 100644 --- a/contrib/elftoolchain/elfcopy/archive.c +++ b/contrib/elftoolchain/elfcopy/archive.c @@ -69,9 +69,11 @@ process_ar_obj(struct elfcopy *ecp, struct ar_obj *obj) /* Output to a temporary file. */ create_tempfile(NULL, &tempfile, &fd); - if ((ecp->eout = elf_begin(fd, ELF_C_WRITE, NULL)) == NULL) + if ((ecp->eout = elf_begin(fd, ELF_C_WRITE, NULL)) == NULL) { + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); + } elf_flagelf(ecp->eout, ELF_C_SET, ELF_F_LAYOUT); create_elf(ecp); elf_end(ecp->ein); @@ -80,27 +82,40 @@ process_ar_obj(struct elfcopy *ecp, struct ar_obj *obj) obj->buf = NULL; /* Extract archive symbols. */ - if (lseek(fd, 0, SEEK_SET) < 0) + if (lseek(fd, 0, SEEK_SET) < 0) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "lseek failed for '%s'", tempfile); - if ((ecp->eout = elf_begin(fd, ELF_C_READ, NULL)) == NULL) + } + if ((ecp->eout = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); + } extract_arsym(ecp); elf_end(ecp->eout); - if (fstat(fd, &sb) == -1) + if (fstat(fd, &sb) == -1) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "fstat %s failed", tempfile); - if (lseek(fd, 0, SEEK_SET) < 0) + } + if (lseek(fd, 0, SEEK_SET) < 0) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "lseek %s failed", tempfile); + } obj->size = sb.st_size; - if ((obj->maddr = malloc(obj->size)) == NULL) + if ((obj->maddr = malloc(obj->size)) == NULL) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "memory allocation failed for '%s'", tempfile); - if ((size_t) read(fd, obj->maddr, obj->size) != obj->size) + } + if ((size_t) read(fd, obj->maddr, obj->size) != obj->size) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "read failed for '%s'", tempfile); - if (unlink(tempfile)) + } + if (cleanup_tempfile(tempfile) < 0) err(EXIT_FAILURE, "unlink %s failed", tempfile); free(tempfile); + tempfile = NULL; close(fd); if (strlen(obj->name) > _MAXNAMELEN_SVR4) add_to_ar_str_table(ecp, obj->name); diff --git a/contrib/elftoolchain/elfcopy/elfcopy.h b/contrib/elftoolchain/elfcopy/elfcopy.h index b8845a574428..17d8b803156d 100644 --- a/contrib/elftoolchain/elfcopy/elfcopy.h +++ b/contrib/elftoolchain/elfcopy/elfcopy.h @@ -277,6 +277,7 @@ void add_to_symtab(struct elfcopy *_ecp, const char *_name, unsigned char _st_info, unsigned char _st_other, int _ndx_known); int add_to_inseg_list(struct elfcopy *_ecp, struct section *_sec); void adjust_addr(struct elfcopy *_ecp); +int cleanup_tempfile(char *_fn); void copy_content(struct elfcopy *_ecp); void copy_data(struct section *_s); void copy_phdr(struct elfcopy *_ecp); diff --git a/contrib/elftoolchain/elfcopy/main.c b/contrib/elftoolchain/elfcopy/main.c index c02bb296c4a3..964d3358de60 100644 --- a/contrib/elftoolchain/elfcopy/main.c +++ b/contrib/elftoolchain/elfcopy/main.c @@ -510,6 +510,27 @@ free_elf(struct elfcopy *ecp) } } +/* + * Remove a temporary file, without freeing its filename. + * + * Safe to pass NULL, will just ignore it. + */ +int +cleanup_tempfile(char *fn) +{ + int errno_save, retval; + + if (fn == NULL) + return 0; + errno_save = errno; + if ((retval = unlink(fn)) < 0) { + warn("unlink tempfile %s failed", fn); + errno = errno_save; + return retval; + } + return 0; +} + /* Create a temporary file. */ void create_tempfile(const char *src, char **fn, int *fd) @@ -656,8 +677,10 @@ create_file(struct elfcopy *ecp, const char *src, const char *dst) } #endif - if (lseek(ifd, 0, SEEK_SET) < 0) + if (lseek(ifd, 0, SEEK_SET) < 0) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "lseek failed"); + } /* * If input object is not ELF file, convert it to an intermediate @@ -677,9 +700,12 @@ create_file(struct elfcopy *ecp, const char *src, const char *dst) ecp->oed = ELFDATA2LSB; } create_tempfile(src, &elftemp, &efd); - if ((ecp->eout = elf_begin(efd, ELF_C_WRITE, NULL)) == NULL) + if ((ecp->eout = elf_begin(efd, ELF_C_WRITE, NULL)) == NULL) { + cleanup_tempfile(elftemp); + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); + } elf_flagelf(ecp->eout, ELF_C_SET, ELF_F_LAYOUT); if (ecp->itf == ETF_BINARY) create_elf_from_binary(ecp, ifd, src); @@ -687,31 +713,45 @@ create_file(struct elfcopy *ecp, const char *src, const char *dst) create_elf_from_ihex(ecp, ifd); else if (ecp->itf == ETF_SREC) create_elf_from_srec(ecp, ifd); - else + else { + cleanup_tempfile(elftemp); + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "Internal: invalid target flavour"); + } elf_end(ecp->eout); /* Open intermediate ELF object as new input object. */ close(ifd); - if ((ifd = open(elftemp, O_RDONLY)) == -1) + if ((ifd = open(elftemp, O_RDONLY)) == -1) { + cleanup_tempfile(elftemp); + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "open %s failed", src); + } close(efd); - if (unlink(elftemp) < 0) + if (cleanup_tempfile(elftemp) < 0) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "unlink %s failed", elftemp); + } free(elftemp); + elftemp = NULL; } - if ((ecp->ein = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) + if ((ecp->ein = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) { + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); + } switch (elf_kind(ecp->ein)) { case ELF_K_NONE: + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "file format not recognized"); case ELF_K_ELF: - if ((ecp->eout = elf_begin(ofd, ELF_C_WRITE, NULL)) == NULL) + if ((ecp->eout = elf_begin(ofd, ELF_C_WRITE, NULL)) == NULL) { + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); + } /* elfcopy(1) manage ELF layout by itself. */ elf_flagelf(ecp->eout, ELF_C_SET, ELF_F_LAYOUT); @@ -730,21 +770,21 @@ create_file(struct elfcopy *ecp, const char *src, const char *dst) * Create (another) tempfile for binary/srec/ihex * output object. */ - if (tempfile != NULL) { - if (unlink(tempfile) < 0) - err(EXIT_FAILURE, "unlink %s failed", - tempfile); - free(tempfile); - } + if (cleanup_tempfile(tempfile) < 0) + errx(EXIT_FAILURE, "unlink %s failed", + tempfile); + free(tempfile); create_tempfile(src, &tempfile, &ofd0); /* * Rewind the file descriptor being processed. */ - if (lseek(ofd, 0, SEEK_SET) < 0) + if (lseek(ofd, 0, SEEK_SET) < 0) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "lseek failed for the output object"); + } /* * Call flavour-specific conversion routine. @@ -765,11 +805,13 @@ create_file(struct elfcopy *ecp, const char *src, const char *dst) #if WITH_PE create_pe(ecp, ofd, ofd0); #else + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "PE/EFI support not enabled" " at compile time"); #endif break; default: + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "Internal: unsupported" " output flavour %d", ecp->oec); } @@ -784,6 +826,7 @@ create_file(struct elfcopy *ecp, const char *src, const char *dst) /* XXX: Not yet supported. */ break; default: + cleanup_tempfile(tempfile); errx(EXIT_FAILURE, "file format not supported"); } @@ -802,9 +845,13 @@ copy_done: in_place = 1; } - if (copy_from_tempfile(tempfile, dst, ofd, &tfd, in_place) < 0) + if (copy_from_tempfile(tempfile, dst, ofd, + &tfd, in_place) < 0) { + cleanup_tempfile(tempfile); err(EXIT_FAILURE, "creation of %s failed", dst); + } + /* 'tempfile' has been removed by copy_from_tempfile(). */ free(tempfile); tempfile = NULL; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 12:36:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90F6156FF60; Thu, 4 Mar 2021 12:36: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 4Drr3G3kkhz3Qfk; Thu, 4 Mar 2021 12:36: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 730E51CE64; Thu, 4 Mar 2021 12:36: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 124CawPY045690; Thu, 4 Mar 2021 12:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124CawkY045689; Thu, 4 Mar 2021 12:36:58 GMT (envelope-from git) Date: Thu, 4 Mar 2021 12:36:58 GMT Message-Id: <202103041236.124CawkY045689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fernando Apesteguía Subject: git: 3457dbd52b22 - main - mq_open(2): Fix xref to mq_unlink(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3457dbd52b22daee203ba5a5eb4faf7525f5b165 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 12:36:58 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3457dbd52b22daee203ba5a5eb4faf7525f5b165 commit 3457dbd52b22daee203ba5a5eb4faf7525f5b165 Author: Fernando Apesteguía AuthorDate: 2021-02-24 15:20:57 +0000 Commit: Fernando Apesteguía CommitDate: 2021-03-04 12:32:42 +0000 mq_open(2): Fix xref to mq_unlink(2) mq_unlink(2) was added in acab1d58befaa8f42930bd62c26558e6005e1c13 PR: 215611 Reported by: rwatson@FreeBSD.org Approved by: gbe@ (mentor) Differential Revision: https://reviews.freebsd.org/D28913 --- lib/libc/sys/mq_open.2 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/mq_open.2 b/lib/libc/sys/mq_open.2 index a810ee01cc18..4f1f98e010a5 100644 --- a/lib/libc/sys/mq_open.2 +++ b/lib/libc/sys/mq_open.2 @@ -297,9 +297,9 @@ There is insufficient space for the creation of the new message queue. .Xr mq_receive 2 , .Xr mq_send 2 , .Xr mq_setattr 2 , +.Xr mq_unlink 2 , .Xr mq_timedreceive 3 , .Xr mq_timedsend 3 , -.Xr mq_unlink 3 , .Xr mqueuefs 5 .Sh STANDARDS The @@ -307,9 +307,7 @@ The system call conforms to .St -p1003.1-2004 . .Sh HISTORY -Support for -.Tn POSIX -message queues first appeared in +Support for POSIX message queues first appeared in .Fx 7.0 . .Sh BUGS This implementation places strict requirements on the value of From owner-dev-commits-src-all@freebsd.org Thu Mar 4 13:21:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78239548ADE; Thu, 4 Mar 2021 13:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drs2531msz3kVM; Thu, 4 Mar 2021 13:21: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 5A96E1DA49; Thu, 4 Mar 2021 13:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124DL18B009448; Thu, 4 Mar 2021 13:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124DL11Y009447; Thu, 4 Mar 2021 13:21:01 GMT (envelope-from git) Date: Thu, 4 Mar 2021 13:21:01 GMT Message-Id: <202103041321.124DL11Y009447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 095558ac8949 - stable/13 - sendfile: Use the pager size to determine the file extent when possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 095558ac894977906fbbdf74c34b6d13fea7c8ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 13:21:01 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=095558ac894977906fbbdf74c34b6d13fea7c8ed commit 095558ac894977906fbbdf74c34b6d13fea7c8ed Author: Mark Johnston AuthorDate: 2021-02-25 15:04:44 +0000 Commit: Mark Johnston CommitDate: 2021-03-04 13:19:51 +0000 sendfile: Use the pager size to determine the file extent when possible Previously sendfile would issue a VOP_GETATTR and use the returned size, i.e., the file size. When paging in file data, sendfile_swapin() will use the pager to determine whether it needs to zero-fill, most often because of a hole in a sparse file. An attempt to page in beyond the end of a file is treated this way, and occurs when the requested page is past the end of the pager. In other words, both the file size and pager size were used interchangeably. With ZFS, updates to the pager and file sizes are not synchronized by the exclusive vnode lock, at least partially due to its use of MNTK_SHARED_WRITES. In particular, the pager size is updated after the file size, so in the presence of a writer concurrently extending the file, sendfile could incorrectly instantiate "holes" in the page cache pages backing the file, which manifests as data corruption when reading the file back from the page cache. The on-disk copy is unaffected. Fix this by consistently using the pager size when available. Reported by: dumbbell Reviewed by: chs, kib Tested by: dumbbell, pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28811 (cherry picked from commit faa998f6ff69573fe82765c77c7268ee89ac945e) --- sys/kern/kern_sendfile.c | 55 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 7d7be6f072e9..95bfba0538dc 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -588,28 +588,40 @@ sendfile_getobj(struct thread *td, struct file *fp, vm_object_t *obj_res, goto out; } *bsize = vp->v_mount->mnt_stat.f_iosize; - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0) - goto out; - *obj_size = va.va_size; obj = vp->v_object; if (obj == NULL) { error = EINVAL; goto out; } + + /* + * Use the pager size when available to simplify synchronization + * with filesystems, which otherwise must atomically update both + * the vnode pager size and file size. + */ + if (obj->type == OBJT_VNODE) { + VM_OBJECT_RLOCK(obj); + *obj_size = obj->un_pager.vnp.vnp_size; + } else { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) + goto out; + *obj_size = va.va_size; + VM_OBJECT_RLOCK(obj); + } } else if (fp->f_type == DTYPE_SHM) { error = 0; shmfd = fp->f_data; obj = shmfd->shm_object; + VM_OBJECT_RLOCK(obj); *obj_size = shmfd->shm_size; } else { error = EINVAL; goto out; } - VM_OBJECT_WLOCK(obj); if ((obj->flags & OBJ_DEAD) != 0) { - VM_OBJECT_WUNLOCK(obj); + VM_OBJECT_RUNLOCK(obj); error = EBADF; goto out; } @@ -620,7 +632,7 @@ sendfile_getobj(struct thread *td, struct file *fp, vm_object_t *obj_res, * immediately destroy it. */ vm_object_reference_locked(obj); - VM_OBJECT_WUNLOCK(obj); + VM_OBJECT_RUNLOCK(obj); *obj_res = obj; *vp_res = vp; *shmfd_res = shmfd; @@ -679,7 +691,7 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct shmfd *shmfd; struct sendfile_sync *sfs; struct vattr va; - off_t off, sbytes, rem, obj_size; + off_t off, sbytes, rem, obj_size, nobj_size; int bsize, error, ext_pgs_idx, hdrlen, max_pgs, softerr; #ifdef KERN_TLS int tls_enq_cnt; @@ -852,15 +864,30 @@ retry_space: error = vn_lock(vp, LK_SHARED); if (error != 0) goto done; - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0 || off >= va.va_size) { + + /* + * Check to see if the file size has changed. + */ + if (obj->type == OBJT_VNODE) { + VM_OBJECT_RLOCK(obj); + nobj_size = obj->un_pager.vnp.vnp_size; + VM_OBJECT_RUNLOCK(obj); + } else { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) { + VOP_UNLOCK(vp); + goto done; + } + nobj_size = va.va_size; + } + if (off >= nobj_size) { VOP_UNLOCK(vp); goto done; } - if (va.va_size != obj_size) { - obj_size = va.va_size; - rem = nbytes ? - omin(nbytes + offset, obj_size) : obj_size; + if (nobj_size != obj_size) { + obj_size = nobj_size; + rem = nbytes ? omin(nbytes + offset, obj_size) : + obj_size; rem -= off; } } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 13:21:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C09C5494A2; Thu, 4 Mar 2021 13:21: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 4Drs2641rJz3kVQ; Thu, 4 Mar 2021 13:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D01D1DD96; Thu, 4 Mar 2021 13:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124DL2AO009466; Thu, 4 Mar 2021 13:21:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124DL2h5009465; Thu, 4 Mar 2021 13:21:02 GMT (envelope-from git) Date: Thu, 4 Mar 2021 13:21:02 GMT Message-Id: <202103041321.124DL2h5009465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 05812ed9e71b - stable/13 - buf: Fix the dirtybufthresh check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05812ed9e71b434293989f4e915264e6f3bc7a0d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 13:21:02 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=05812ed9e71b434293989f4e915264e6f3bc7a0d commit 05812ed9e71b434293989f4e915264e6f3bc7a0d Author: Mark Johnston AuthorDate: 2021-02-25 15:04:44 +0000 Commit: Mark Johnston CommitDate: 2021-03-04 13:20:12 +0000 buf: Fix the dirtybufthresh check dirtybufthresh is a watermark, slightly below the high watermark for dirty buffers. When a delayed write is issued, the dirtying thread will start flushing buffers if the dirtybufthresh watermark is reached. This helps ensure that the high watermark is not reached, otherwise performance will degrade as clustering and other optimizations are disabled (see buf_dirty_count_severe()). When the buffer cache was partitioned into "domains", the dirtybufthresh threshold checks were not updated. Fix this. Reported by: Shrikanth R Kamath Reviewed by: rlibby, mckusick, kib, bdrewery Sponsored by: Juniper Networks, Inc., Klara, Inc. Fixes: 3cec5c77d6 Differential Revision: https://reviews.freebsd.org/D28901 (cherry picked from commit 369706a6f887f8ffe1037d78bc31565ec701d72b) --- sys/kern/vfs_bio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 9264388e9a3e..8519afe96633 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2325,11 +2325,13 @@ void bufbdflush(struct bufobj *bo, struct buf *bp) { struct buf *nbp; + struct bufdomain *bd; - if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) { + bd = &bdomain[bo->bo_domain]; + if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh + 10) { (void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread); altbufferflushes++; - } else if (bo->bo_dirty.bv_cnt > dirtybufthresh) { + } else if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh) { BO_LOCK(bo); /* * Try to find a buffer to flush. From owner-dev-commits-src-all@freebsd.org Thu Mar 4 13:25:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4054549768; Thu, 4 Mar 2021 13:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drs6k3vwrz3l23; Thu, 4 Mar 2021 13:25: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 790331E018; Thu, 4 Mar 2021 13:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124DP2Ic012006; Thu, 4 Mar 2021 13:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124DP2WR012005; Thu, 4 Mar 2021 13:25:02 GMT (envelope-from git) Date: Thu, 4 Mar 2021 13:25:02 GMT Message-Id: <202103041325.124DP2WR012005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: a0d921bae9f3 - main - Remove obsolete bc library and dc test files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0d921bae9f3bcdb664f9737e20c0015123f11af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 13:25:02 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=a0d921bae9f3bcdb664f9737e20c0015123f11af commit a0d921bae9f3bcdb664f9737e20c0015123f11af Author: Stefan Eßer AuthorDate: 2021-03-04 13:21:58 +0000 Commit: Stefan Eßer CommitDate: 2021-03-04 13:24:51 +0000 Remove obsolete bc library and dc test files The new bc implementation has the library embedded into the binary and tests in tests/usr.bin/bc instead of tests/ustr.bin/dc. MFC after: 3 days --- ObsoleteFiles.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 5821e9f04e89..59412729ad7e 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,15 @@ # xargs -n1 | sort | uniq -d; # done +# 20210304: remove old bc and dc support and test files +.if !defined(WITHOUT_GH_BC) +OLD_FILES+=usr/share/misc/bc.library +OLD_FILES+=usr/tests/usr.bin/dc/Kyuafile +OLD_FILES+=usr/tests/usr.bin/dc/bcode +OLD_FILES+=usr/tests/usr.bin/dc/inout +OLD_DIRS+=usr/tests/usr.bin/dc +.endif + # 20210302: fmtree removed OLD_FILES+=usr/sbin/fmtree OLD_FILES+=usr/share/man/man8/fmtree.8.gz From owner-dev-commits-src-all@freebsd.org Thu Mar 4 13:43:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B25254A0CB; Thu, 4 Mar 2021 13:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrsWb0J6Mz3mMZ; Thu, 4 Mar 2021 13:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F143F1E05A; Thu, 4 Mar 2021 13:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124Dh64j038223; Thu, 4 Mar 2021 13:43:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Dh6cq038222; Thu, 4 Mar 2021 13:43:06 GMT (envelope-from git) Date: Thu, 4 Mar 2021 13:43:06 GMT Message-Id: <202103041343.124Dh6cq038222@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: fa04db476201 - main - release: fix VMSIZE following 1ca8842f3ad9 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: fa04db476201c4cad5f6a5f67da8f2ef1e1cdad3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 13:43:07 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=fa04db476201c4cad5f6a5f67da8f2ef1e1cdad3 commit fa04db476201c4cad5f6a5f67da8f2ef1e1cdad3 Author: Glen Barber AuthorDate: 2021-03-04 13:39:43 +0000 Commit: Glen Barber CommitDate: 2021-03-04 13:43:02 +0000 release: fix VMSIZE following 1ca8842f3ad9 truncate(1) is not case-sensitive with regard to setting the size of a file. makefs(8), however, does not honor upper-case values. Update release-specific files and the release(7) manual page to reflect this. MFC with: 1ca8842f3ad9 Submitted by: ehem_freebsd_m5p.com (original) Differential Review: https://reviews.freebsd.org/D28979 Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile.vm | 4 ++-- release/release.conf.sample | 4 ++-- release/tools/basic-ci.conf | 2 +- release/tools/ec2.conf | 2 +- release/tools/gce.conf | 2 +- release/tools/vagrant.conf | 2 +- share/man/man7/release.7 | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index d075fa1fb29c..2240a1e5fc57 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -7,8 +7,8 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 4096M -SWAPSIZE?= 1G +VMSIZE?= 4096m +SWAPSIZE?= 1g VMBASE?= vm VHD_DESC= Azure, VirtualPC, Hyper-V, Xen disk image diff --git a/release/release.conf.sample b/release/release.conf.sample index 4de068750228..bd7be15b0227 100644 --- a/release/release.conf.sample +++ b/release/release.conf.sample @@ -99,8 +99,8 @@ PORTBRANCH="main" ## If WITH_VMIMAGES is set to a non-empty value, this is the size of the ## virtual machine disk filesystem. Valid size values are described in -## the truncate(1) manual page. -#VMSIZE="20G" +## the makefs(8) manual page. +#VMSIZE="20g" ## If WITH_VMIMAGES is set to a non-empty value, this is a list of disk ## image formats to create. Valid values are listed in the mkimg(1) diff --git a/release/tools/basic-ci.conf b/release/tools/basic-ci.conf index 19bb2454f78d..9dc05c57d0f4 100644 --- a/release/tools/basic-ci.conf +++ b/release/tools/basic-ci.conf @@ -4,7 +4,7 @@ # # Should be enough for base image, image can be resized in needed -export VMSIZE=5G +export VMSIZE=5g # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="sshd growfs" diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index e726ccadc048..bfda9052421f 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -24,7 +24,7 @@ export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey firstboot_freebsd_ # Note that if this is set to G, we will end up with an GB disk # image since VMSIZE is the size of the UFS partition, not the disk which # it resides within. -export VMSIZE=5000M +export VMSIZE=5000m # No swap space; the ec2_ephemeralswap rc.d script will allocate swap # space on EC2 ephemeral disks. (If they exist -- the T2 low-cost instances diff --git a/release/tools/gce.conf b/release/tools/gce.conf index f156a5bb93eb..113784a7643e 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -4,7 +4,7 @@ # # The default of 3GB is too small for GCE, so override the size here. -export VMSIZE=20G +export VMSIZE=20g # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ diff --git a/release/tools/vagrant.conf b/release/tools/vagrant.conf index c683cf7a07d2..05e7052d46c4 100644 --- a/release/tools/vagrant.conf +++ b/release/tools/vagrant.conf @@ -4,7 +4,7 @@ # # The default of 3GB is too small for Vagrant, so override the size here. -export VMSIZE=8G +export VMSIZE=8g # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap. diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 82c1b83fe3a4..a474de83ec93 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2021 +.Dd March 4, 2021 .Dt RELEASE 7 .Os .Sh NAME @@ -360,9 +360,9 @@ The default value is .It Va VMSIZE Set to change the size of the virtual machine disk capacity. The default value is -.Va 20G . +.Va 20g . See -.Xr truncate 1 +.Xr makefs 8 for valid values. .Pp Virtual machine disk images are, by default, created as sparse images. From owner-dev-commits-src-all@freebsd.org Thu Mar 4 13:51:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2006C54A795; Thu, 4 Mar 2021 13:51:30 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrsjG0T7wz3mpw; Thu, 4 Mar 2021 13:51:30 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614865890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YK1gyegthIL7ghYj4Raa5zmj7FKdftJGJSJXm1aepzo=; b=W3KG1PLanpKSpViEej0Zcm3WLNj01nYw+FxDeC5g7kvYNA3ACCMp8KcqSakg+aZacvt9Kd xN5acKihHbCCA6+clUR4pK5/UBkh+W79N0a4fdDIteqlpFY4u5DIGJMvLWRhib8v/igGu0 K/lvR0gHVDMw1dZXjmN/JAKDSoe1B4V/JaWOl2c8iUug+QqADbm839NdfERMTURdPeIjhn 8fNxo4wn/Q2IX32vVaagV23gLNrnw5NrhukBnii4pqr9XZlg31DwqniXvw2Q/kYXasl4+4 tAfSGWKJZoOSCJ3RS+aUclUDCyAPD4hkho8DxbKOHR6TNZ3tFm9+Ts6A1SCdog== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 9772CDFED; Thu, 4 Mar 2021 13:51:29 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Thu, 4 Mar 2021 13:51:27 +0000 From: Glen Barber To: Nathan Whitehorn Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1ca8842f3ad9 - main - Use makefs(8) in release VM-image generation instead of md(4) and newfs. Message-ID: <20210304135127.GA28425@FreeBSD.org> References: <202102250225.11P2PE1I011966@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: <202102250225.11P2PE1I011966@gitrepo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614865890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YK1gyegthIL7ghYj4Raa5zmj7FKdftJGJSJXm1aepzo=; b=Kueu1m+DYq4WJnE0U2ISbCln3PIFeM1LL6mzlYkttxrdl4GiNNGznMHgS7zlDp7w496uhN i6Y8TGf6B3+poV2c1CYRXM4Q6tRXAz2kTKDguLSofoZ2+R5fSOATeZk8JS1TRkq2Z74DOF REv+KyYGZ3clIB7i5bxcH0fTo55y1gnMaU+zio1WvzP+GEmX3MPD0IRhTwtgxHOw9y77pz gjxGJ8lFd9t2CTJ7jsvKCAJoWLjm0uw+GeQEM8iZ09KmV8WGbfI1znOp0pYu/ZFebiPmlT E5zolYph+/aFyUEdNE3QdiJyf82PbxrLu30OpipQrj6zlO7lEnAHmDb2Z+YWeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614865890; a=rsa-sha256; cv=none; b=qh3qiU45iMQMwkWKpt/4cvzrVs5WiQlsrukR56LolRM/TTg3H2G3bXjTKzmYFbMZAjrEua VMLf8CodLSnGCj9Ko/yl9YuZTH3fTl2RW6/+5DVobitGhTeKhOUI+Woc/5e+dkwq7wR1Fc Rb1Tp1+xMVA5s4syvdD8KWcLVCvh6nnSZKE6sCXvWmWtGGeYAZytXEtRicohC6gGi2RBTp Wi3VNJNaUdYkvVCMupMydeBZcLVPwXolKLAwibVSm7N9K9J+xcH1OzkVGwgLH66PzsN4kU juZp88kVyS0lxm+9kqR1nNOcHbipwcgjKWROwSgjOSNdxxblGGGgXFZNuBS/0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 13:51:30 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 25, 2021 at 02:25:14AM +0000, Nathan Whitehorn wrote: > The branch main has been updated by nwhitehorn: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1ca8842f3ad9725863c9affc04= 4d1974a51818a9 >=20 > commit 1ca8842f3ad9725863c9affc044d1974a51818a9 > Author: Nathan Whitehorn > AuthorDate: 2021-02-25 02:16:56 +0000 > Commit: Nathan Whitehorn > CommitDate: 2021-02-25 02:16:56 +0000 >=20 > Use makefs(8) in release VM-image generation instead of md(4) and new= fs. > =20 > Using makefs instead reduces the privileges needed to build VM images, > simplifies the script (no need to copy files to a fresh image at the = end), > and improves portability by allowing generation of cross-endian image= s. > As a result of the last, this patch also adds support for generation = of > powerpc64 and powerpc64le VM images. > =20 > No other changes to the output. Tested and working for both amd64 and > powerpc64 targets. > =20 > Reviewed by: gjb > Differential Revision: https://reviews.freebsd.org/D28912 If you MFC this to stable/13, please also include fa04db476201. I did not realize this will break virtual machine image builds using the in-tree tools. Glen --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmBA5d8ACgkQAxRYpUeP 4pMQkBAAhy2uLy7+R0hLRJruSdBfXBgUNW+a5gpVAwUx2UHaCRrnv4RUaLwV3ZDL TvQerfV2x7btl+5b4ZcWxLAgZ5bNvhTBbdeuGYcR1EeBqh29COKXh4lCQoJZaRxb s91D/U4By1WvH+FUu+VYjthyZnHjJXS8zx3ZXt0oJPY/9YFjwSfPRfytOUfVnTlF nxvSxd+9F4fbNskIUkH4fRNjIKu/xrnFuD+xzHN1xE8flFh8DimnMM6Zul7pPI1U iXN2VeX9MUcs6felhcuL2Z9Fgyaeb2h53KdgjUAZbTsaHfOH8wNUJDXHEf3loBxp 8ID7/oHkr+TREevq/pFR65XX2rEujydQExQ6zs5Jv2vIOEhsNVGfgyytJuVCF7M6 Yvf//yql+aBUN83hvHsO3lZmAmE7gbl8/MOzjjt5jP5hpgzfpwAU17wMXWgJHcfk 3CC94jdB7eDWts8El7GZKBHRBP0qJsYl7gin0OXwziXvibVeGBQ6R4p3xNxSrST4 Wgy7bcANqr70Xwnjau6LqpGLEShbE0zYZI2gu+YUE506i8aRZJeLbUUM6CRdrRQZ KeU5zYxjy5bLER4dur32Z/xhyvJPHWNKNf4q2HUDB837hqUdr7/hTliwPJr6C+TO 7Dmr5FVJxP3nhNZac6zXI9Y4HXz/IwraJAGsWvLN+Z26iCocq5o= =qP5M -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- From owner-dev-commits-src-all@freebsd.org Thu Mar 4 13:56:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FF6454A8AD; Thu, 4 Mar 2021 13:56: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 4Drspz46Y9z3nSJ; Thu, 4 Mar 2021 13:56: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 802BF1E51F; Thu, 4 Mar 2021 13:56: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 124DuRXS052191; Thu, 4 Mar 2021 13:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124DuRli052190; Thu, 4 Mar 2021 13:56:27 GMT (envelope-from git) Date: Thu, 4 Mar 2021 13:56:27 GMT Message-Id: <202103041356.124DuRli052190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fernando Apesteguía Subject: git: fc1e79740e4a - main - compress(1): warn about link handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc1e79740e4a83013aa0050fc95a991ec9c78e27 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 13:56:27 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fc1e79740e4a83013aa0050fc95a991ec9c78e27 commit fc1e79740e4a83013aa0050fc95a991ec9c78e27 Author: Fernando Apesteguía AuthorDate: 2021-02-09 09:11:22 +0000 Commit: Fernando Apesteguía CommitDate: 2021-03-04 13:52:12 +0000 compress(1): warn about link handling compress(1) handles links badly and does not provide link-handling options. Document this behavior. PR: 84271 Submitted by: garys@opusnet.com Approved by: gbe@ (mentor) Differential Revision: https://reviews.freebsd.org/D28552 --- usr.bin/compress/compress.1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/usr.bin/compress/compress.1 b/usr.bin/compress/compress.1 index de44653775ea..3aa18a963cdc 100644 --- a/usr.bin/compress/compress.1 +++ b/usr.bin/compress/compress.1 @@ -32,7 +32,7 @@ .\" @(#)compress.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 20, 2020 +.Dd March 4, 2021 .Dt COMPRESS 1 .Os .Sh NAME @@ -177,6 +177,13 @@ Compression is generally much better than that achieved by Huffman coding (as used in the historical command pack), or adaptive Huffman coding (as used in the historical command compact), and takes less time to compute. +.Pp +If +.Ar file +is a soft or hard link +.Nm +will replace it with a compressed copy of the file pointed to by the link. +The link's target file is left uncompressed. .Sh EXIT STATUS .Ex -std compress uncompress .Pp @@ -248,6 +255,8 @@ The command appeared in .Bx 4.3 . .Sh BUGS +The program does not handle links well and has no link-handling options. +.Pp Some of these might be considered otherwise-undocumented features. .Pp .Nm compress : From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:06:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29B2654AC6B; Thu, 4 Mar 2021 14:06: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 4Drt2v0d2Xz3prV; Thu, 4 Mar 2021 14:06: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 081851E729; Thu, 4 Mar 2021 14:06: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 124E6khl066609; Thu, 4 Mar 2021 14:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124E6kbl066608; Thu, 4 Mar 2021 14:06:46 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:06:46 GMT Message-Id: <202103041406.124E6kbl066608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0bec69d1898f - stable/12 - buf: Fix the dirtybufthresh check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0bec69d1898ff310aaf4915626e00887d803bfaf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:06:47 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0bec69d1898ff310aaf4915626e00887d803bfaf commit 0bec69d1898ff310aaf4915626e00887d803bfaf Author: Mark Johnston AuthorDate: 2021-02-25 15:04:44 +0000 Commit: Mark Johnston CommitDate: 2021-03-04 14:06:43 +0000 buf: Fix the dirtybufthresh check dirtybufthresh is a watermark, slightly below the high watermark for dirty buffers. When a delayed write is issued, the dirtying thread will start flushing buffers if the dirtybufthresh watermark is reached. This helps ensure that the high watermark is not reached, otherwise performance will degrade as clustering and other optimizations are disabled (see buf_dirty_count_severe()). When the buffer cache was partitioned into "domains", the dirtybufthresh threshold checks were not updated. Fix this. Reported by: Shrikanth R Kamath Reviewed by: rlibby, mckusick, kib, bdrewery Sponsored by: Juniper Networks, Inc., Klara, Inc. Fixes: 3cec5c77d6 Differential Revision: https://reviews.freebsd.org/D28901 (cherry picked from commit 369706a6f887f8ffe1037d78bc31565ec701d72b) --- sys/kern/vfs_bio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index d23a19f37907..6c5286d30871 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2305,11 +2305,13 @@ void bufbdflush(struct bufobj *bo, struct buf *bp) { struct buf *nbp; + struct bufdomain *bd; - if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) { + bd = &bdomain[bo->bo_domain]; + if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh + 10) { (void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread); altbufferflushes++; - } else if (bo->bo_dirty.bv_cnt > dirtybufthresh) { + } else if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh) { BO_LOCK(bo); /* * Try to find a buffer to flush. From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:09:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF50854AEA2; Thu, 4 Mar 2021 14: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 4Drt6L5zq5z3pXd; Thu, 4 Mar 2021 14: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 C0D911E900; Thu, 4 Mar 2021 14: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 124E9k4G067223; Thu, 4 Mar 2021 14: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 124E9k00067222; Thu, 4 Mar 2021 14:09:46 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:09:46 GMT Message-Id: <202103041409.124E9k00067222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 065b9549d356 - releng/13.0 - sendfile: Use the pager size to determine the file extent when possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 065b9549d35676dcd7af45ca3ebd05e9ca082cbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:09:46 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=065b9549d35676dcd7af45ca3ebd05e9ca082cbe commit 065b9549d35676dcd7af45ca3ebd05e9ca082cbe Author: Mark Johnston AuthorDate: 2021-02-25 15:04:44 +0000 Commit: Mark Johnston CommitDate: 2021-03-04 14:09:36 +0000 sendfile: Use the pager size to determine the file extent when possible Previously sendfile would issue a VOP_GETATTR and use the returned size, i.e., the file size. When paging in file data, sendfile_swapin() will use the pager to determine whether it needs to zero-fill, most often because of a hole in a sparse file. An attempt to page in beyond the end of a file is treated this way, and occurs when the requested page is past the end of the pager. In other words, both the file size and pager size were used interchangeably. With ZFS, updates to the pager and file sizes are not synchronized by the exclusive vnode lock, at least partially due to its use of MNTK_SHARED_WRITES. In particular, the pager size is updated after the file size, so in the presence of a writer concurrently extending the file, sendfile could incorrectly instantiate "holes" in the page cache pages backing the file, which manifests as data corruption when reading the file back from the page cache. The on-disk copy is unaffected. Fix this by consistently using the pager size when available. Approved by: re (gjb) Reported by: dumbbell Reviewed by: chs, kib Tested by: dumbbell, pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28811 (cherry picked from commit faa998f6ff69573fe82765c77c7268ee89ac945e) (cherry picked from commit 095558ac894977906fbbdf74c34b6d13fea7c8ed) --- sys/kern/kern_sendfile.c | 55 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 7d7be6f072e9..95bfba0538dc 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -588,28 +588,40 @@ sendfile_getobj(struct thread *td, struct file *fp, vm_object_t *obj_res, goto out; } *bsize = vp->v_mount->mnt_stat.f_iosize; - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0) - goto out; - *obj_size = va.va_size; obj = vp->v_object; if (obj == NULL) { error = EINVAL; goto out; } + + /* + * Use the pager size when available to simplify synchronization + * with filesystems, which otherwise must atomically update both + * the vnode pager size and file size. + */ + if (obj->type == OBJT_VNODE) { + VM_OBJECT_RLOCK(obj); + *obj_size = obj->un_pager.vnp.vnp_size; + } else { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) + goto out; + *obj_size = va.va_size; + VM_OBJECT_RLOCK(obj); + } } else if (fp->f_type == DTYPE_SHM) { error = 0; shmfd = fp->f_data; obj = shmfd->shm_object; + VM_OBJECT_RLOCK(obj); *obj_size = shmfd->shm_size; } else { error = EINVAL; goto out; } - VM_OBJECT_WLOCK(obj); if ((obj->flags & OBJ_DEAD) != 0) { - VM_OBJECT_WUNLOCK(obj); + VM_OBJECT_RUNLOCK(obj); error = EBADF; goto out; } @@ -620,7 +632,7 @@ sendfile_getobj(struct thread *td, struct file *fp, vm_object_t *obj_res, * immediately destroy it. */ vm_object_reference_locked(obj); - VM_OBJECT_WUNLOCK(obj); + VM_OBJECT_RUNLOCK(obj); *obj_res = obj; *vp_res = vp; *shmfd_res = shmfd; @@ -679,7 +691,7 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct shmfd *shmfd; struct sendfile_sync *sfs; struct vattr va; - off_t off, sbytes, rem, obj_size; + off_t off, sbytes, rem, obj_size, nobj_size; int bsize, error, ext_pgs_idx, hdrlen, max_pgs, softerr; #ifdef KERN_TLS int tls_enq_cnt; @@ -852,15 +864,30 @@ retry_space: error = vn_lock(vp, LK_SHARED); if (error != 0) goto done; - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0 || off >= va.va_size) { + + /* + * Check to see if the file size has changed. + */ + if (obj->type == OBJT_VNODE) { + VM_OBJECT_RLOCK(obj); + nobj_size = obj->un_pager.vnp.vnp_size; + VM_OBJECT_RUNLOCK(obj); + } else { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) { + VOP_UNLOCK(vp); + goto done; + } + nobj_size = va.va_size; + } + if (off >= nobj_size) { VOP_UNLOCK(vp); goto done; } - if (va.va_size != obj_size) { - obj_size = va.va_size; - rem = nbytes ? - omin(nbytes + offset, obj_size) : obj_size; + if (nobj_size != obj_size) { + obj_size = nobj_size; + rem = nbytes ? omin(nbytes + offset, obj_size) : + obj_size; rem -= off; } } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:25:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 043E554BA15; Thu, 4 Mar 2021 14:25: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 4DrtSM5kWqz3qZ7; Thu, 4 Mar 2021 14:25: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 AD7431EC92; Thu, 4 Mar 2021 14:25: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 124EPNo1092795; Thu, 4 Mar 2021 14:25:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124EPNbR092794; Thu, 4 Mar 2021 14:25:23 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:25:23 GMT Message-Id: <202103041425.124EPNbR092794@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: 63749bfe96b7 - main - release: sprinkle UNAME_r hacks following c883b6fd8ccd 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: 63749bfe96b792b3a435f84ad81a47888cae1dea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:25:24 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=63749bfe96b792b3a435f84ad81a47888cae1dea commit 63749bfe96b792b3a435f84ad81a47888cae1dea Author: Glen Barber AuthorDate: 2021-03-04 14:22:45 +0000 Commit: Glen Barber CommitDate: 2021-03-04 14:25:18 +0000 release: sprinkle UNAME_r hacks following c883b6fd8ccd Pass UNAME_r override to make(1) for ports builds when building ports for another branch. MFC after: 3 days MFC with: 0be274d37379, 80ab50e1de19, c883b6fd8ccd Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile.azure | 2 +- release/Makefile.ec2 | 2 +- release/Makefile.gce | 2 +- release/Makefile.vagrant | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/release/Makefile.azure b/release/Makefile.azure index de95a944f9c7..32e91833b766 100644 --- a/release/Makefile.azure +++ b/release/Makefile.azure @@ -39,7 +39,7 @@ azure-check-depends: . endif env ASSUME_ALWAYS_YES=yes pkg install -y www/npm . else - make -C ${PORTSDIR}/www/npm BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/www/npm BATCH=1 all install clean . endif . endif npm install -g azure-cli diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index 63552494db95..171de4ee2fa0 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -33,7 +33,7 @@ CW_EC2_PORTINSTALL= cw-ec2-portinstall: .if exists(${PORTSDIR}/net/bsdec2-image-upload/Makefile) - env - PATH=$$PATH make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean + env - UNAME_r=${UNAME_r} PATH=$$PATH make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean .else . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -y diff --git a/release/Makefile.gce b/release/Makefile.gce index 106804de61e3..fac6918eab34 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -48,7 +48,7 @@ gce-check-depends: . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk . else - make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean . endif .endif diff --git a/release/Makefile.vagrant b/release/Makefile.vagrant index 4abcaa891ed3..d49eedacb6c9 100644 --- a/release/Makefile.vagrant +++ b/release/Makefile.vagrant @@ -58,7 +58,7 @@ vagrant-check-depends: . endif env ASSUME_ALWAYS_YES=yes pkg install -y curl . else - make -C ${PORTSDIR}/ftp/curl BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/ftp/curl BATCH=1 all install clean . endif .endif From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:31:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFBCE54BB94; Thu, 4 Mar 2021 14:31:32 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.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 4DrtbQ5rNXz3r3f; Thu, 4 Mar 2021 14:31:30 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1614868281; 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=oWD396mLPxuM0jE7LZLMGvkx/KbG2Ev00kEHXdG5mHA=; b=ptT5Uh3L0XqXvmhPdCJZbYsqSnAejG0sKVLwW7he5L6TXJOLY5OM5Pa+edCxso3IVRuj7c KQlsjhLWcp/vVq+ezHQlao6XYTTG9Kge9aU7ktnMQM6iPGXvPh6uYPQvWE2LYuO8VqeIA0 96xnkngDFIGh8gpBDohBzU80Hb/5XfY= Received: from amy (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id f5d8143d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 4 Mar 2021 14:31:21 +0000 (UTC) Date: Thu, 4 Mar 2021 15:31:21 +0100 From: Emmanuel Vadot To: Nathan Whitehorn Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1ca8842f3ad9 - main - Use makefs(8) in release VM-image generation instead of md(4) and newfs. Message-Id: <20210304153121.f06b268899a145ce97b21784@bidouilliste.com> In-Reply-To: <202102250225.11P2PE1I011966@gitrepo.freebsd.org> References: <202102250225.11P2PE1I011966@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DrtbQ5rNXz3r3f X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=ptT5Uh3L; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; 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]; R_SPF_ALLOW(-0.20)[+mx]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SPAMHAUS_ZRD(0.00)[212.83.155.74:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.83.155.74:from]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:31:32 -0000 On Thu, 25 Feb 2021 02:25:14 GMT Nathan Whitehorn wrote: > The branch main has been updated by nwhitehorn: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1ca8842f3ad9725863c9affc044d1974a51818a9 > > commit 1ca8842f3ad9725863c9affc044d1974a51818a9 > Author: Nathan Whitehorn > AuthorDate: 2021-02-25 02:16:56 +0000 > Commit: Nathan Whitehorn > CommitDate: 2021-02-25 02:16:56 +0000 > > Use makefs(8) in release VM-image generation instead of md(4) and newfs. > > Using makefs instead reduces the privileges needed to build VM images, > simplifies the script (no need to copy files to a fresh image at the end), > and improves portability by allowing generation of cross-endian images. > As a result of the last, this patch also adds support for generation of > powerpc64 and powerpc64le VM images. > > No other changes to the output. Tested and working for both amd64 and > powerpc64 targets. > > Reviewed by: gjb > Differential Revision: https://reviews.freebsd.org/D28912 > --- > release/scripts/mk-vmimage.sh | 2 - > release/tools/vmimage.subr | 177 ++++++++++++++++++------------------------ > 2 files changed, 77 insertions(+), 102 deletions(-) > > diff --git a/release/scripts/mk-vmimage.sh b/release/scripts/mk-vmimage.sh > index cf795e04655b..d5985ceb0d25 100755 > --- a/release/scripts/mk-vmimage.sh > +++ b/release/scripts/mk-vmimage.sh > @@ -93,8 +93,6 @@ main() { > . "${VMCONFIG}" > fi > > - ROOTLABEL="gpt" > - > vm_create_base > vm_install_base > vm_extra_install_base > diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr > index 7bd971013656..6e0c1ea633e2 100644 > --- a/release/tools/vmimage.subr > +++ b/release/tools/vmimage.subr > @@ -12,70 +12,17 @@ scriptdir=$(dirname $(realpath $0)) > export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" > trap "cleanup" INT QUIT TRAP ABRT TERM > > -write_partition_layout() { > - if [ -z "${NOSWAP}" ]; then > - SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" > - fi > - > - BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ > - WITH_UNIFIED_OBJDIR=yes \ > - make -C ${WORLDDIR}/stand -V .OBJDIR)" > - BOOTFILES="$(realpath ${BOOTFILES})" > - > - case "${TARGET}:${TARGET_ARCH}" in > - amd64:amd64 | i386:i386) > - ESP=yes > - SCHEME=gpt > - BOOTPARTS="-b ${BOOTFILES}/i386/pmbr/pmbr \ > - -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot" > - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" > - ;; > - arm64:aarch64 | riscv:riscv64*) > - ESP=yes > - SCHEME=gpt > - BOOTPARTS= > - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" > - ;; > - powerpc:powerpc*) > - ESP=no > - SCHEME=apm > - BOOTPARTS="-p apple-boot/bootfs:=${BOOTFILES}/powerpc/boot1.chrp/boot1.hfs" > - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" > - ;; > - *) > - echo "vmimage.subr: unsupported target '${TARGET}:${TARGET_ARCH}'" >&2 > - exit 1 > - ;; > - esac > - > - if [ ${ESP} = "yes" ]; then > - # Create an ESP > - espfilename=$(mktemp /tmp/efiboot.XXXXXX) > - make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi > - BOOTPARTS="${BOOTPARTS} -p efi/efiesp:=${espfilename}" > - > - # Add this to fstab, requires temporarily remounting the fs > - mddev=$(mdconfig -f ${VMBASE}) > - mount /dev/${mddev} ${DESTDIR} > - mkdir -p ${DESTDIR}/boot/efi > - echo "/dev/${ROOTLABEL}/efiesp /boot/efi msdosfs rw 2 2" \ > - >> ${DESTDIR}/etc/fstab > - umount ${DESTDIR} > - mdconfig -d -u ${mddev} > - fi > - > - mkimg -s ${SCHEME} -f ${VMFORMAT} \ > - ${BOOTPARTS} \ > - ${SWAPOPT} \ > - ${ROOTFSPART} \ > - -o ${VMIMAGE} > - > - if [ ${ESP} = "yes" ]; then > - rm ${espfilename} > - fi > - > - return 0 > -} > +# Platform-specific large-scale setup > +# Most platforms use GPT, so put that as default, then special cases > +PARTSCHEME=gpt > +ROOTLABEL="gpt" > +case "${TARGET}:${TARGET_ARCH}" in > + powerpc:powerpc*) > + PARTSCHEME=mbr > + ROOTLABEL="ufs" > + NOSWAP=yes # Can't label swap partition with MBR, so no swap > + ;; > +esac > > err() { > printf "${@}\n" > @@ -87,10 +34,6 @@ cleanup() { > if [ -c "${DESTDIR}/dev/null" ]; then > umount_loop ${DESTDIR}/dev 2>/dev/null > fi > - umount_loop ${DESTDIR} > - if [ ! -z "${mddev}" ]; then > - mdconfig -d -u ${mddev} > - fi > > return 0 > } > @@ -100,42 +43,12 @@ vm_create_base() { > # written to the formatted disk image with mkimg(1). > > mkdir -p ${DESTDIR} > - truncate -s ${VMSIZE} ${VMBASE} > - mddev=$(mdconfig -f ${VMBASE}) > - newfs -L rootfs /dev/${mddev} > - mount /dev/${mddev} ${DESTDIR} > > return 0 > } > > vm_copy_base() { > - # Creates a new UFS root filesystem and copies the contents of the > - # current root filesystem into it. This produces a "clean" disk > - # image without any remnants of files which were created temporarily > - # during image-creation and have since been deleted (e.g., downloaded > - # package archives). > - > - mkdir -p ${DESTDIR}/old > - mdold=$(mdconfig -f ${VMBASE}) > - mount /dev/${mdold} ${DESTDIR}/old > - > - truncate -s ${VMSIZE} ${VMBASE}.tmp > - mkdir -p ${DESTDIR}/new > - mdnew=$(mdconfig -f ${VMBASE}.tmp) > - newfs -L rootfs /dev/${mdnew} > - mount /dev/${mdnew} ${DESTDIR}/new > - > - tar -cf- -C ${DESTDIR}/old . | tar -xUf- -C ${DESTDIR}/new > - > - umount_loop /dev/${mdold} > - rmdir ${DESTDIR}/old > - mdconfig -d -u ${mdold} > - > - umount_loop /dev/${mdnew} > - rmdir ${DESTDIR}/new > - tunefs -n enable /dev/${mdnew} > - mdconfig -d -u ${mdnew} > - mv ${VMBASE}.tmp ${VMBASE} > + # Defunct > } > > vm_install_base() { > @@ -276,7 +189,71 @@ vm_create_disk() { > echo "Creating image... Please wait." > echo > > - write_partition_layout || return 1 > + if [ -z "${NOSWAP}" ]; then > + SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" > + fi > + > + BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ > + WITH_UNIFIED_OBJDIR=yes \ > + make -C ${WORLDDIR}/stand -V .OBJDIR)" > + BOOTFILES="$(realpath ${BOOTFILES})" > + > + case "${TARGET}:${TARGET_ARCH}" in > + amd64:amd64 | i386:i386) > + ESP=yes > + BOOTPARTS="-b ${BOOTFILES}/i386/pmbr/pmbr \ > + -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot" > + ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" > + MAKEFSARGS="-B little" > + ;; > + arm64:aarch64 | riscv:riscv64*) > + ESP=yes > + BOOTPARTS= > + ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" > + MAKEFSARGS="-B little" > + ;; > + powerpc:powerpc*) > + ESP=no > + BOOTPARTS="-p prepboot:=${BOOTFILES}/powerpc/boot1.chrp/boot1.elf -a 1" > + ROOTFSPART="-p freebsd:=${VMBASE}" > + if [ ${TARGET_ARCH} = powerpc64le ]; then > + MAKEFSARGS="-B little" > + else > + MAKEFSARGS="-B big" > + fi > + ;; > + *) > + echo "vmimage.subr: unsupported target '${TARGET}:${TARGET_ARCH}'" >&2 > + exit 1 > + ;; > + esac > + > + if [ ${ESP} = "yes" ]; then > + # Create an ESP > + espfilename=$(mktemp /tmp/efiboot.XXXXXX) > + make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi > + BOOTPARTS="${BOOTPARTS} -p efi/efiesp:=${espfilename}" > + > + # Add this to fstab > + mkdir -p ${DESTDIR}/boot/efi > + echo "/dev/${ROOTLABEL}/efiesp /boot/efi msdosfs rw 2 2" \ > + >> ${DESTDIR}/etc/fstab > + fi > + > + echo "Building filesystem... Please wait." > + makefs ${MAKEFSARGS} -o label=rootfs -o version=2 -o softupdates=1 \ > + -s ${VMSIZE} ${VMBASE} ${DESTDIR} There should be some -f usage here to reserve some inodes. I'm not remembering the details exactly (same for bapt) but when we were at Gandi we revert using makefs and went back to use mdconfig/newfs because of some problems related to inodes number that -f couldn't fix. I haven't tested myself but I think that the VM image are busted with that change if they do growfs as makefs by default use the same number of inodes as the number of files in the image. Cheers, > + echo "Building final disk image... Please wait." > + mkimg -s ${PARTSCHEME} -f ${VMFORMAT} \ > + ${BOOTPARTS} \ > + ${SWAPOPT} \ > + ${ROOTFSPART} \ > + -o ${VMIMAGE} > + > + if [ ${ESP} = "yes" ]; then > + rm ${espfilename} > + fi > > return 0 > } -- Emmanuel Vadot From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:39:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B8AC54CAD5; Thu, 4 Mar 2021 14:39: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 4Drtn02dTqz3rgm; Thu, 4 Mar 2021 14:39: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 3EA971F009; Thu, 4 Mar 2021 14:39: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 124EdmKI006549; Thu, 4 Mar 2021 14:39:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Edm4S006548; Thu, 4 Mar 2021 14:39:48 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:39:48 GMT Message-Id: <202103041439.124Edm4S006548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: a00bf7d9bba1 - stable/13 - Make DataSN counter of solicited Data-Out local. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a00bf7d9bba1dd359f521b3d11b483e32fb4de2a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:39:48 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a00bf7d9bba1dd359f521b3d11b483e32fb4de2a commit a00bf7d9bba1dd359f521b3d11b483e32fb4de2a Author: Alexander Motin AuthorDate: 2021-02-02 18:37:13 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 14:39:43 +0000 Make DataSN counter of solicited Data-Out local. DataSN for solicited Data-Out is per-R2T. Since we handle whole R2T in one go, we don't need to store it anywhere, especially in global per-command structure. This may allow us to handle multiple R2T per command at once, if we decide, or may be relax locking. Rename the second use of that field to io_referenced_task_tag. MFC after: 1 month (cherry picked from commit 3dd2a7a5ea2f1641c7525f692eed416fa02c28e6) --- sys/dev/iscsi/iscsi.c | 9 ++++----- sys/dev/iscsi/iscsi.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 5e6c80255bff..c4123d9f4aa7 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1018,7 +1018,7 @@ iscsi_pdu_handle_task_response(struct icl_pdu *response) ISCSI_SESSION_WARN(is, "task response 0x%x", bhstmr->bhstmr_response); } else { - aio = iscsi_outstanding_find(is, io->io_datasn); + aio = iscsi_outstanding_find(is, io->io_referenced_task_tag); if (aio != NULL && aio->io_ccb != NULL) iscsi_session_terminate_task(is, aio, CAM_REQ_ABORTED); } @@ -1157,6 +1157,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) struct ccb_scsiio *csio; size_t off, len, total_len; int error; + uint32_t datasn = 0; is = PDU_SESSION(response); @@ -1183,8 +1184,6 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) * XXX: Verify R2TSN. */ - io->io_datasn = 0; - off = ntohl(bhsr2t->bhsr2t_buffer_offset); if (off > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "target requested invalid offset " @@ -1234,7 +1233,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) bhsr2t->bhsr2t_initiator_task_tag; bhsdo->bhsdo_target_transfer_tag = bhsr2t->bhsr2t_target_transfer_tag; - bhsdo->bhsdo_datasn = htonl(io->io_datasn++); + bhsdo->bhsdo_datasn = htonl(datasn++); bhsdo->bhsdo_buffer_offset = htonl(off); error = icl_pdu_append_data(request, csio->data_ptr + off, len, M_NOWAIT); @@ -2204,7 +2203,7 @@ iscsi_action_abort(struct iscsi_session *is, union ccb *ccb) xpt_done(ccb); return; } - io->io_datasn = aio->io_initiator_task_tag; + io->io_referenced_task_tag = aio->io_initiator_task_tag; bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST; diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h index ddd88ffc5289..80ac9d877107 100644 --- a/sys/dev/iscsi/iscsi.h +++ b/sys/dev/iscsi/iscsi.h @@ -45,7 +45,7 @@ struct iscsi_outstanding { union ccb *io_ccb; size_t io_received; uint32_t io_initiator_task_tag; - uint32_t io_datasn; + uint32_t io_referenced_task_tag; void *io_icl_prv; }; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:40:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8829854CD66; Thu, 4 Mar 2021 14:40: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 4Drtp53MmQz3rrH; Thu, 4 Mar 2021 14:40: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 5827C1F010; Thu, 4 Mar 2021 14:40: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 124EejMw014995; Thu, 4 Mar 2021 14:40:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124EejwT014994; Thu, 4 Mar 2021 14:40:45 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:40:45 GMT Message-Id: <202103041440.124EejwT014994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 3e1da9a9f85b - stable/12 - Make DataSN counter of solicited Data-Out local. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3e1da9a9f85bbfbb216829b5de528b86d16c888f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:40:45 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3e1da9a9f85bbfbb216829b5de528b86d16c888f commit 3e1da9a9f85bbfbb216829b5de528b86d16c888f Author: Alexander Motin AuthorDate: 2021-02-02 18:37:13 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 14:40:37 +0000 Make DataSN counter of solicited Data-Out local. DataSN for solicited Data-Out is per-R2T. Since we handle whole R2T in one go, we don't need to store it anywhere, especially in global per-command structure. This may allow us to handle multiple R2T per command at once, if we decide, or may be relax locking. Rename the second use of that field to io_referenced_task_tag. MFC after: 1 month (cherry picked from commit 3dd2a7a5ea2f1641c7525f692eed416fa02c28e6) --- sys/dev/iscsi/iscsi.c | 9 ++++----- sys/dev/iscsi/iscsi.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 0c891a32feea..685b635a4411 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1018,7 +1018,7 @@ iscsi_pdu_handle_task_response(struct icl_pdu *response) ISCSI_SESSION_WARN(is, "task response 0x%x", bhstmr->bhstmr_response); } else { - aio = iscsi_outstanding_find(is, io->io_datasn); + aio = iscsi_outstanding_find(is, io->io_referenced_task_tag); if (aio != NULL && aio->io_ccb != NULL) iscsi_session_terminate_task(is, aio, CAM_REQ_ABORTED); } @@ -1157,6 +1157,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) struct ccb_scsiio *csio; size_t off, len, total_len; int error; + uint32_t datasn = 0; is = PDU_SESSION(response); @@ -1183,8 +1184,6 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) * XXX: Verify R2TSN. */ - io->io_datasn = 0; - off = ntohl(bhsr2t->bhsr2t_buffer_offset); if (off > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "target requested invalid offset " @@ -1234,7 +1233,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) bhsr2t->bhsr2t_initiator_task_tag; bhsdo->bhsdo_target_transfer_tag = bhsr2t->bhsr2t_target_transfer_tag; - bhsdo->bhsdo_datasn = htonl(io->io_datasn++); + bhsdo->bhsdo_datasn = htonl(datasn++); bhsdo->bhsdo_buffer_offset = htonl(off); error = icl_pdu_append_data(request, csio->data_ptr + off, len, M_NOWAIT); @@ -2204,7 +2203,7 @@ iscsi_action_abort(struct iscsi_session *is, union ccb *ccb) xpt_done(ccb); return; } - io->io_datasn = aio->io_initiator_task_tag; + io->io_referenced_task_tag = aio->io_initiator_task_tag; bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST; diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h index 607d0a7386f6..33c892a00d50 100644 --- a/sys/dev/iscsi/iscsi.h +++ b/sys/dev/iscsi/iscsi.h @@ -46,7 +46,7 @@ struct iscsi_outstanding { union ccb *io_ccb; size_t io_received; uint32_t io_initiator_task_tag; - uint32_t io_datasn; + uint32_t io_referenced_task_tag; void *io_icl_prv; }; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:46:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D850A54D0EC; Thu, 4 Mar 2021 14:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drtx93yfyz3sYR; Thu, 4 Mar 2021 14:46: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 783691F03D; Thu, 4 Mar 2021 14:46: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 124EkrBG019178; Thu, 4 Mar 2021 14:46:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124EkrKc019177; Thu, 4 Mar 2021 14:46:53 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:46:53 GMT Message-Id: <202103041446.124EkrKc019177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: f05b724ecb31 - main - Modernize geom_stats_snapshot_get MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f05b724ecb310fb91da1947ae6c68647f58f5f12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:46:54 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f05b724ecb310fb91da1947ae6c68647f58f5f12 commit f05b724ecb310fb91da1947ae6c68647f58f5f12 Author: Alan Somers AuthorDate: 2021-03-03 20:06:38 +0000 Commit: Alan Somers CommitDate: 2021-03-04 14:45:48 +0000 Modernize geom_stats_snapshot_get * A logically useless memset() is used to fault in some memory pages. Change it to explicit_bzero so the compiler won't eliminate it. * Eliminate the second memset. It made sense in the days of the Big Kernel Lock, but not in the days of fine-grained SMP and especially not in the days of VDSO. MFC after: 2 weeks Sponsored by: Axcient Reviewed by: phk Differential Revision: https://reviews.freebsd.org/D29047 --- lib/libgeom/geom_stats.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libgeom/geom_stats.c b/lib/libgeom/geom_stats.c index 450ee491ea1c..7c9191e29686 100644 --- a/lib/libgeom/geom_stats.c +++ b/lib/libgeom/geom_stats.c @@ -136,9 +136,8 @@ geom_stats_snapshot_get(void) free(sp); return (NULL); } - memset(sp->ptr, 0, pagesize * npages); /* page in, cache */ + explicit_bzero(sp->ptr, pagesize * npages); /* page in, cache */ clock_gettime(CLOCK_REALTIME, &sp->time); - memset(sp->ptr, 0, pagesize * npages); /* page in, cache */ memcpy(sp->ptr, statp, pagesize * npages); sp->pages = npages; sp->perpage = spp; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:49:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2779054D793; Thu, 4 Mar 2021 14:49: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 4Drv0j0Yfpz3sx8; Thu, 4 Mar 2021 14:49: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 05F041EC7E; Thu, 4 Mar 2021 14:49: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 124EnuSD019746; Thu, 4 Mar 2021 14:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124EnuIH019745; Thu, 4 Mar 2021 14:49:56 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:49:56 GMT Message-Id: <202103041449.124EnuIH019745@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: 23553d6b940f - main - Fix creating the early arm64 level 2 blocks 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: 23553d6b940f959f47045b544eefcdddf5db0949 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:49:57 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=23553d6b940f959f47045b544eefcdddf5db0949 commit 23553d6b940f959f47045b544eefcdddf5db0949 Author: Andrew Turner AuthorDate: 2021-03-04 14:00:19 +0000 Commit: Andrew Turner CommitDate: 2021-03-04 14:39:12 +0000 Fix creating the early arm64 level 2 blocks In 48ba9b2669e6 we switched from creating level 1 blocks to smaller level 2 blocks when creating the early arm64 page tables. On issue was that they had a different meaning for register x7. The former used it to hold page table attributes, while the latter held just the memory type. This caused these attributes to be incorrectly shifted. Fix this by changing the meaning of x7 to hold the block attributes and fix the only caller that used the old meaning. Most hardware seems to have handled the bits being off however qemu failed to boot as reserved bits that should be zero were being set and qemu fails to clear these when translating from a virtual address to a physical address. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 4d356e8897f0..bd013a870e34 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -430,7 +430,7 @@ common: /* Create the kernel space L2 table */ mov x6, x26 - mov x7, #VM_MEMATTR_WRITE_BACK + mov x7, #(ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x8, #(KERNBASE & L2_BLOCK_MASK) mov x9, x28 bl build_l2_block_pagetable @@ -600,7 +600,7 @@ LEND(link_l1_pagetable) /* * Builds count 2 MiB page table entry * x6 = L2 table - * x7 = Type (0 = Device, 1 = Normal) + * x7 = Block attributes * x8 = VA start * x9 = PA start (trashed) * x10 = Entry count (trashed) @@ -615,8 +615,7 @@ LENTRY(build_l2_block_pagetable) and x11, x11, #Ln_ADDR_MASK /* Build the L2 block entry */ - lsl x12, x7, #2 - orr x12, x12, #L2_BLOCK + orr x12, x7, #L2_BLOCK orr x12, x12, #(ATTR_DEFAULT) orr x12, x12, #(ATTR_S1_UXN) From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:56:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9529354D961; Thu, 4 Mar 2021 14:56:20 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drv8422VFz3t5Y; Thu, 4 Mar 2021 14:56:19 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 124EuBZN056046; Thu, 4 Mar 2021 06:56:11 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 124EuB88056045; Thu, 4 Mar 2021 06:56:11 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103041456.124EuB88056045@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> To: Nathan Whitehorn Date: Thu, 4 Mar 2021 06:56:11 -0800 (PST) CC: Warner Losh , Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Drv8422VFz3t5Y X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:56:20 -0000 > On 3/3/21 10:38 AM, Warner Losh wrote: > > > > > > On Wed, Mar 3, 2021 at 7:13 AM Nathan Whitehorn > > > wrote: > > > > > > > > On 3/3/21 9:05 AM, Brandon Bergren wrote: > > > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: > > >> What am I missing here?? One place I am being told this is run in > > >> an environment that may not even be an EFI booted system, and in > > >> another place it is being used as a test if something is mounted > > >> on it, which should only be true on an EFI booted system. > > > That the script in question is a generic script that runs as > > part of bsdinstall on every platform and has to be universal. > > > > > > The actual *problem* here is that > > usr.sbin/bsdinstall/scripts/bootconfig has a default case that is > > >? ? ? ? ? ? ? *)? ? ? ? ? die "Unsupported arch $(uname -m) for > > UEFI install" > > > > > > which then causes the main script to bail out, leaving the > > system in a half-installed state. > > > > > > If that had just been an exit 0 this would have never been a > > problem, I suppose. > > > > > > Before the original change that broke this, there was a check > > that the script was not running on powerpc or mips platforms > > before running the efi bits, but this got taken out. > > > > > > > Well, incidentally. The bootconfig script needs to know if there > > is an > > ESP it should configure, but the signalling mechanism (the > > presence of > > the ESP mount point) was being broken by mtree making that directory > > unconditionally even on systems that don't use EFI. So then > > bootconfig > > tried to set it up, but failed later on, because there was no EFI > > loader > > to set up. The mtree change makes the ESP mount point only exist on > > systems with an ESP. > > > > > > So you made a unilateral change, without discussion of the bigger > > design, to something without even asking the original person who made > > the change to mtree about it for what sounds like an obscure case in > > the installer that could be solved in a different way? It's trivial > > enough to look at the boot method sysctl and skip the EFI update if we > > didn't boot EFI (and if by change that's not on all systems, it's easy > > enough to add it on all systems). I have no notion about why that > > wasn't considered, at least, before jumping in and taking people by > > surprise. I still do not understand why machdep.bootmethod=EFI was rejected? Is this value not present on ALL platforms that boot in EFI mode? if exist(machdep.bootmethod) && machdep.bootmethod=EFI seems to me to be the best and valid way to make this decision. If that has issues working on a platform we need to fix that issue and not do all this other stuff. > > > > Next time, talk to people first. That's the whole point of having > > review tools, mailing list and git blame. > > > > Warner > > This method of testing was in the original review here posted on Feb. > 23: https://reviews.freebsd.org/D28897 > > The description of the test procedure you're objecting to was even in > the summary! Then we had a discussion by email about the change to mtree > on the committers list on Feb. 28 to resolve a bug affecting PowerPC in > the patch reviewed and approved by you. I then waited several days and > had a long thread for several days on the mailing list about the > approach. coming up with this short patch -- again, as a bug fix to a > reviewed approach. > > We can change the logic -- that's fine! But, to paraphrase, the reason > we have reviews is so people like you can look at the review and note > these kinds of problems when they are reviewed, not after the commit > goes in. There's a significant amount of whiplash when you do get > patches reviewed, approved, and then the person who reviewed and > approved them accuses you of "taking people by surprise". > > The installer *does* mount the partition in advance, so checking whether > there is a mounted file system is a perfectly reasonable test to do. We > could also check fstab. I would like to understand what is actually > wrong here first, though. Especially after this misfire -- which is > problematic for reasons that are still not clear to me, since there are > a number of standard directories in hier(7) not in mtree -- I want to > make sure we actually do have consensus about what is changing and why. These *should* be fixed. ALL directories that are part of a finished FreeBSD system should be present both in hier.7 and in the mtree files, deviating from that should only be allowed if there is some really really grand reasons. If the reason is "architecture foo does not have directory /bar/zap" one could and should create an arch specific mtree file that covers these, having these mkdir's (prefer to see all those changed to install -d's) scattered around all over, IMHO creates maintance and inconsistency issues. > -Nathan -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:02:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C9B554DCC7; Thu, 4 Mar 2021 15:02:43 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.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 4DrvHQ3KmZz3v3C; Thu, 4 Mar 2021 15:02:42 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1614870160; 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=OyN3uMdcH4fbGG7IPk/Vt3Y50tpTcG79lvTU3xGJdpw=; b=n7lLD1/zWRAmUbHl2KBNU9TkD+mQHMnYwu8xLj8sY8no6rbqB4fcfZKbtAohZwsbAm80tu cVh4mtJQevDNWfd8n6k+lRR91Rw+8wdgmyxQcupt+O/mjaqJIaJigE6b01garCryL1B/pw MeG4qfVdx4Y38lTWCyu3IAFTpcJB8GU= Received: from amy (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id d14b9341 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 4 Mar 2021 15:02:40 +0000 (UTC) Date: Thu, 4 Mar 2021 16:02:40 +0100 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Nathan Whitehorn , Warner Losh , Brandon Bergren , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. Message-Id: <20210304160240.494a85605396c0751d7313da@bidouilliste.com> In-Reply-To: <202103041456.124EuB88056045@gndrsh.dnsmgr.net> References: <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> <202103041456.124EuB88056045@gndrsh.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DrvHQ3KmZz3v3C X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:02:43 -0000 On Thu, 4 Mar 2021 06:56:11 -0800 (PST) "Rodney W. Grimes" wrote: > > On 3/3/21 10:38 AM, Warner Losh wrote: > > > > > > > > > On Wed, Mar 3, 2021 at 7:13 AM Nathan Whitehorn > > > > wrote: > > > > > > > > > > > > On 3/3/21 9:05 AM, Brandon Bergren wrote: > > > > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: > > > >> What am I missing here?? One place I am being told this is run in > > > >> an environment that may not even be an EFI booted system, and in > > > >> another place it is being used as a test if something is mounted > > > >> on it, which should only be true on an EFI booted system. > > > > That the script in question is a generic script that runs as > > > part of bsdinstall on every platform and has to be universal. > > > > > > > > The actual *problem* here is that > > > usr.sbin/bsdinstall/scripts/bootconfig has a default case that is > > > >? ? ? ? ? ? ? *)? ? ? ? ? die "Unsupported arch $(uname -m) for > > > UEFI install" > > > > > > > > which then causes the main script to bail out, leaving the > > > system in a half-installed state. > > > > > > > > If that had just been an exit 0 this would have never been a > > > problem, I suppose. > > > > > > > > Before the original change that broke this, there was a check > > > that the script was not running on powerpc or mips platforms > > > before running the efi bits, but this got taken out. > > > > > > > > > > Well, incidentally. The bootconfig script needs to know if there > > > is an > > > ESP it should configure, but the signalling mechanism (the > > > presence of > > > the ESP mount point) was being broken by mtree making that directory > > > unconditionally even on systems that don't use EFI. So then > > > bootconfig > > > tried to set it up, but failed later on, because there was no EFI > > > loader > > > to set up. The mtree change makes the ESP mount point only exist on > > > systems with an ESP. > > > > > > > > > So you made a unilateral change, without discussion of the bigger > > > design, to something without even asking the original person who made > > > the change to mtree about it for what sounds like an obscure case in > > > the installer that could be solved in a different way? It's trivial > > > enough to look at the boot method sysctl and skip the EFI update if we > > > didn't boot EFI (and if by change that's not on all systems, it's easy > > > enough to add it on all systems). I have no notion about why that > > > wasn't considered, at least, before jumping in and taking people by > > > surprise. > > I still do not understand why machdep.bootmethod=EFI was rejected? > Is this value not present on ALL platforms that boot in EFI mode? > if exist(machdep.bootmethod) && machdep.bootmethod=EFI seems to > me to be the best and valid way to make this decision. If that > has issues working on a platform we need to fix that issue and not > do all this other stuff. We need to install and create the efi dir even if the installer is booted in CSM mode, so a user can switch to full uefi mode after and still can boot the FreeBSD that was installed. (The same thing must be done for bios boot code). > > > > > > Next time, talk to people first. That's the whole point of having > > > review tools, mailing list and git blame. > > > > > > Warner > > > > This method of testing was in the original review here posted on Feb. > > 23: https://reviews.freebsd.org/D28897 > > > > The description of the test procedure you're objecting to was even in > > the summary! Then we had a discussion by email about the change to mtree > > on the committers list on Feb. 28 to resolve a bug affecting PowerPC in > > the patch reviewed and approved by you. I then waited several days and > > had a long thread for several days on the mailing list about the > > approach. coming up with this short patch -- again, as a bug fix to a > > reviewed approach. > > > > We can change the logic -- that's fine! But, to paraphrase, the reason > > we have reviews is so people like you can look at the review and note > > these kinds of problems when they are reviewed, not after the commit > > goes in. There's a significant amount of whiplash when you do get > > patches reviewed, approved, and then the person who reviewed and > > approved them accuses you of "taking people by surprise". > > > > The installer *does* mount the partition in advance, so checking whether > > there is a mounted file system is a perfectly reasonable test to do. We > > could also check fstab. I would like to understand what is actually > > wrong here first, though. Especially after this misfire -- which is > > problematic for reasons that are still not clear to me, since there are > > a number of standard directories in hier(7) not in mtree -- I want to > > make sure we actually do have consensus about what is changing and why. > > These *should* be fixed. ALL directories that are part of a finished > FreeBSD system should be present both in hier.7 and in the mtree files, > deviating from that should only be allowed if there is some really > really grand reasons. If the reason is "architecture foo does not > have directory /bar/zap" one could and should create an arch specific > mtree file that covers these, having these mkdir's (prefer to see > all those changed to install -d's) scattered around all over, IMHO > creates maintance and inconsistency issues. > > > -Nathan > -- > Rod Grimes rgrimes@freebsd.org -- Emmanuel Vadot From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:07:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B6FA54E02B; Thu, 4 Mar 2021 15:07: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 4DrvNf3cZXz3vHw; Thu, 4 Mar 2021 15:07: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 6E5861F594; Thu, 4 Mar 2021 15:07: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 124F7EAP046475; Thu, 4 Mar 2021 15:07:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124F7EXu046474; Thu, 4 Mar 2021 15:07:14 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:07:14 GMT Message-Id: <202103041507.124F7EXu046474@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: 5e6989ba4f26 - main - link_elf_obj: Handle init_array sections in KLDs 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: 5e6989ba4f26acafc77baa6055c0a9e7fe683514 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:07:14 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5e6989ba4f26acafc77baa6055c0a9e7fe683514 commit 5e6989ba4f26acafc77baa6055c0a9e7fe683514 Author: Mark Johnston AuthorDate: 2021-03-04 15:02:47 +0000 Commit: Mark Johnston CommitDate: 2021-03-04 15:07:10 +0000 link_elf_obj: Handle init_array sections in KLDs Reuse existing handling for .ctors, print a warning if multiple constructor sections are present. Destructors are not handled as of yet. This is required for KASAN. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29049 --- sys/kern/link_elf_obj.c | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 6b5a6df0a56f..337588bd5c00 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -386,6 +386,8 @@ link_elf_link_preload(linker_class_t cls, const char *filename, #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + case SHT_INIT_ARRAY: + case SHT_FINI_ARRAY: /* Ignore sections not loaded by the loader. */ if (shdr[i].sh_addr == 0) break; @@ -470,6 +472,7 @@ link_elf_link_preload(linker_class_t cls, const char *filename, #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + case SHT_FINI_ARRAY: if (shdr[i].sh_addr == 0) break; ef->progtab[pb].addr = (void *)shdr[i].sh_addr; @@ -479,6 +482,10 @@ link_elf_link_preload(linker_class_t cls, const char *filename, else if (shdr[i].sh_type == SHT_X86_64_UNWIND) ef->progtab[pb].name = "<>"; #endif + else if (shdr[i].sh_type == SHT_INIT_ARRAY) + ef->progtab[pb].name = "<>"; + else if (shdr[i].sh_type == SHT_FINI_ARRAY) + ef->progtab[pb].name = "<>"; else ef->progtab[pb].name = "<>"; ef->progtab[pb].size = shdr[i].sh_size; @@ -525,10 +532,17 @@ link_elf_link_preload(linker_class_t cls, const char *filename, vnet_data_copy(vnet_data, shdr[i].sh_size); ef->progtab[pb].addr = vnet_data; #endif - } else if (ef->progtab[pb].name != NULL && - !strcmp(ef->progtab[pb].name, ".ctors")) { - lf->ctors_addr = ef->progtab[pb].addr; - lf->ctors_size = shdr[i].sh_size; + } else if ((ef->progtab[pb].name != NULL && + strcmp(ef->progtab[pb].name, ".ctors") == 0) || + shdr[i].sh_type == SHT_INIT_ARRAY) { + if (lf->ctors_addr != 0) { + printf( + "%s: multiple ctor sections in %s\n", + __func__, filename); + } else { + lf->ctors_addr = ef->progtab[pb].addr; + lf->ctors_size = shdr[i].sh_size; + } } /* Update all symbol values with the offset. */ @@ -773,6 +787,8 @@ link_elf_load_file(linker_class_t cls, const char *filename, #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + case SHT_INIT_ARRAY: + case SHT_FINI_ARRAY: if ((shdr[i].sh_flags & SHF_ALLOC) == 0) break; ef->nprogtab++; @@ -894,6 +910,8 @@ link_elf_load_file(linker_class_t cls, const char *filename, #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + case SHT_INIT_ARRAY: + case SHT_FINI_ARRAY: if ((shdr[i].sh_flags & SHF_ALLOC) == 0) break; alignmask = shdr[i].sh_addralign - 1; @@ -971,6 +989,8 @@ link_elf_load_file(linker_class_t cls, const char *filename, #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + case SHT_INIT_ARRAY: + case SHT_FINI_ARRAY: if ((shdr[i].sh_flags & SHF_ALLOC) == 0) break; alignmask = shdr[i].sh_addralign - 1; @@ -979,9 +999,18 @@ link_elf_load_file(linker_class_t cls, const char *filename, if (ef->shstrtab != NULL && shdr[i].sh_name != 0) { ef->progtab[pb].name = ef->shstrtab + shdr[i].sh_name; - if (!strcmp(ef->progtab[pb].name, ".ctors")) { - lf->ctors_addr = (caddr_t)mapbase; - lf->ctors_size = shdr[i].sh_size; + if (!strcmp(ef->progtab[pb].name, ".ctors") || + shdr[i].sh_type == SHT_INIT_ARRAY) { + if (lf->ctors_addr != 0) { + printf( + "%s: multiple ctor sections in %s\n", + __func__, filename); + } else { + lf->ctors_addr = + (caddr_t)mapbase; + lf->ctors_size = + shdr[i].sh_size; + } } } else if (shdr[i].sh_type == SHT_PROGBITS) ef->progtab[pb].name = "<>"; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:14:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BAB854E706; Thu, 4 Mar 2021 15:14: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 4DrvXZ0k26z3vpB; Thu, 4 Mar 2021 15:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0141B1F5BD; Thu, 4 Mar 2021 15:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124FE5aq058912; Thu, 4 Mar 2021 15:14:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124FE5We058911; Thu, 4 Mar 2021 15:14:05 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:14:05 GMT Message-Id: <202103041514.124FE5We058911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: ba47eae9819a - stable/12 - amdtemp(4): Refactor shared temperature calculation logic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ba47eae9819a758e693697a780741931dd6546d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:14:06 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=ba47eae9819a758e693697a780741931dd6546d5 commit ba47eae9819a758e693697a780741931dd6546d5 Author: Conrad Meyer AuthorDate: 2020-01-28 01:38:51 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 15:04:52 +0000 amdtemp(4): Refactor shared temperature calculation logic No functional change intended. (cherry picked from commit 02f700029357ddf31b538bbb5a23785d4ca4c7a8) --- sys/dev/amdtemp/amdtemp.c | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index d30fceba5894..023a88b46120 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -651,26 +651,46 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) } static uint32_t -amdtemp_decode_fam10h_to_16h(int32_t sc_offset, uint32_t val) +amdtemp_decode_fam10h_to_17h(int32_t sc_offset, uint32_t val, bool minus49) { uint32_t temp; /* Convert raw register subfield units (0.125C) to units of 0.1C. */ - temp = ((val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT) & - AMDTEMP_REPTMP10H_CURTMP_MASK) * 5 / 4; + temp = (val & AMDTEMP_REPTMP10H_CURTMP_MASK) * 5 / 4; + + if (minus49) + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; + + temp += AMDTEMP_ZERO_C_TO_K + sc_offset * 10; + return (temp); +} + +static uint32_t +amdtemp_decode_fam10h_to_16h(int32_t sc_offset, uint32_t val) +{ + bool minus49; /* * On Family 15h and higher, if CurTmpTjSel is 11b, the range is * adjusted down by 49.0 degrees Celsius. (This adjustment is not * documented in BKDGs prior to family 15h model 00h.) */ - if (CPUID_TO_FAMILY(cpu_id) >= 0x15 && + minus49 = (CPUID_TO_FAMILY(cpu_id) >= 0x15 && ((val >> AMDTEMP_REPTMP10H_TJSEL_SHIFT) & - AMDTEMP_REPTMP10H_TJSEL_MASK) == 0x3) - temp -= AMDTEMP_CURTMP_RANGE_ADJUST; + AMDTEMP_REPTMP10H_TJSEL_MASK) == 0x3); - temp += AMDTEMP_ZERO_C_TO_K + sc_offset * 10; - return (temp); + return (amdtemp_decode_fam10h_to_17h(sc_offset, + val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT, minus49)); +} + +static uint32_t +amdtemp_decode_fam17h_tctl(int32_t sc_offset, uint32_t val) +{ + bool minus49; + + minus49 = ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0); + return (amdtemp_decode_fam10h_to_17h(sc_offset, + val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT, minus49)); } static int32_t @@ -699,16 +719,11 @@ static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) { struct amdtemp_softc *sc = device_get_softc(dev); - uint32_t temp, val; + uint32_t val; int error; error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); KASSERT(error == 0, ("amdsmn_read")); - temp = ((val >> 21) & 0x7ff) * 5 / 4; - if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) - temp -= AMDTEMP_CURTMP_RANGE_ADJUST; - temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; - - return (temp); + return (amdtemp_decode_fam17h_tctl(sc->sc_offset, val)); } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:14:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37DC954E78C; Thu, 4 Mar 2021 15:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrvXb14ysz3w66; Thu, 4 Mar 2021 15:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 183841F6FB; Thu, 4 Mar 2021 15:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124FE7KA058934; Thu, 4 Mar 2021 15:14:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124FE76q058933; Thu, 4 Mar 2021 15:14:07 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:14:07 GMT Message-Id: <202103041514.124FE76q058933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 4b8f69d7805b - stable/12 - amdtemp(4): Add support for Family 17h CCD sensors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4b8f69d7805b17dd8fef910e548dac65076f6ad5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:14:07 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=4b8f69d7805b17dd8fef910e548dac65076f6ad5 commit 4b8f69d7805b17dd8fef910e548dac65076f6ad5 Author: Conrad Meyer AuthorDate: 2020-01-28 01:39:50 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 15:05:09 +0000 amdtemp(4): Add support for Family 17h CCD sensors Probe Family 17h CPUs for up to 4 (Zen, Zen+) or 8 (Zen2) CCD temperature sensors. These were discovered by Ondrej Čerman (https://github.com/ocerman) and collaborators experimentally, and are not currently documented in any datasheet I have access to. (cherry picked from commit c59b9a4f8d2c7a34782a3885f1c76fb1decea174) --- sys/dev/amdsmn/amdsmn.c | 2 +- sys/dev/amdtemp/amdtemp.c | 102 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 94 insertions(+), 10 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 0c4460c1100f..ec09dbc4d8e5 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 -#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 +#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H. */ struct pciid; struct amdsmn_softc { diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 023a88b46120..8eb279c19cb8 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -5,8 +5,7 @@ * Copyright (c) 2009 Norikatsu Shigemura * Copyright (c) 2009-2012 Jung-uk Kim * All rights reserved. - * Copyright (c) 2017-2019 Conrad Meyer - * All rights reserved. + * Copyright (c) 2017-2020 Conrad Meyer . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +60,18 @@ typedef enum { CORE1_SENSOR0, CORE1_SENSOR1, CORE0, - CORE1 + CORE1, + CCD1, + CCD_BASE = CCD1, + CCD2, + CCD3, + CCD4, + CCD5, + CCD6, + CCD7, + CCD8, + CCD_MAX = CCD8, + NUM_CCDS = CCD_MAX - CCD_BASE + 1, } amdsensor_t; struct amdtemp_softc { @@ -96,7 +106,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 -#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 +#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70h. */ static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -149,7 +159,15 @@ static const struct amdtemp_product { * to -49..206C. */ #define AMDTEMP_17H_CUR_TMP 0x59800 -#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) +#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1u << 19) +/* + * The following register set was discovered experimentally by Ondrej Čerman + * and collaborators, but is not (yet) documented in a PPR/OSRR (other than + * the M70H PPR SMN memory map showing [0x59800, +0x314] as allocated to + * SMU::THM). It seems plausible and the Linux sensor folks have adopted it. + */ +#define AMDTEMP_17H_CCD_TMP_BASE 0x59954 +#define AMDTEMP_17H_CCD_TMP_VALID (1u << 11) /* * AMD temperature range adjustment, in deciKelvins (i.e., 49.0 Celsius). @@ -186,6 +204,7 @@ static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); +static void amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t amdtemp_methods[] = { @@ -485,7 +504,9 @@ amdtemp_attach(device_t dev) dev, CORE0_SENSOR0, amdtemp_sysctl, "IK", "Core 0 / Sensor 0 temperature"); - if (sc->sc_ntemps > 1) { + if (family == 0x17) + amdtemp_probe_ccd_sensors17h(dev, model); + else if (sc->sc_ntemps > 1) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "sensor1", CTLTYPE_INT | CTLFLAG_RD, @@ -638,6 +659,8 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) if ((sc->sc_flags & AMDTEMP_FLAG_CS_SWAP) == 0) temp |= AMDTEMP_TTSR_SELCORE; break; + default: + __unreachable(); } pci_write_config(dev, AMDTEMP_THERMTP_STAT, temp, 1); @@ -722,8 +745,69 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) uint32_t val; int error; - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); - KASSERT(error == 0, ("amdsmn_read")); + switch (sensor) { + case CORE0_SENSOR0: + /* Tctl */ + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); + KASSERT(error == 0, ("amdsmn_read")); + return (amdtemp_decode_fam17h_tctl(sc->sc_offset, val)); + case CCD_BASE ... CCD_MAX: + /* Tccd */ + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE + + (((int)sensor - CCD_BASE) * sizeof(val)), &val); + KASSERT(error == 0, ("amdsmn_read2")); + KASSERT((val & AMDTEMP_17H_CCD_TMP_VALID) != 0, + ("sensor %d: not valid", (int)sensor)); + return (amdtemp_decode_fam10h_to_17h(sc->sc_offset, val, true)); + default: +#if 0 + KASSERT(false, ("%s: invalid sensor %d", __func__, + (int)sensor)); + return (-1); +#endif + __unreachable(); + } +} + +static void +amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model) +{ + char sensor_name[16], sensor_descr[32]; + struct amdtemp_softc *sc; + uint32_t maxreg, i, val; + int error; + + switch (model) { + case 0x00 ... 0x1f: /* Zen1, Zen+ */ + maxreg = 4; + break; + case 0x30 ... 0x3f: /* Zen2 TR/Epyc */ + case 0x70 ... 0x7f: /* Zen2 Ryzen */ + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; + default: + device_printf(dev, + "Unrecognized Family 17h Model: %02xh\n", model); + return; + } - return (amdtemp_decode_fam17h_tctl(sc->sc_offset, val)); + sc = device_get_softc(dev); + for (i = 0; i < maxreg; i++) { + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE + + (i * sizeof(val)), &val); + if (error != 0) + continue; + if ((val & AMDTEMP_17H_CCD_TMP_VALID) == 0) + continue; + + snprintf(sensor_name, sizeof(sensor_name), "ccd%u", i); + snprintf(sensor_descr, sizeof(sensor_descr), + "CCD %u temperature (Tccd%u)", i, i); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + sensor_name, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, CCD_BASE + i, amdtemp_sysctl, "IK", sensor_descr); + } } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:14:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE2D254E5A8; Thu, 4 Mar 2021 15:14: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 4DrvXg6ghmz3w1R; Thu, 4 Mar 2021 15:14: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 9A8CC1F5BE; Thu, 4 Mar 2021 15:14: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 124FEALq058996; Thu, 4 Mar 2021 15:14:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124FEA9l058994; Thu, 4 Mar 2021 15:14:10 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:14:10 GMT Message-Id: <202103041514.124FEA9l058994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: c7d9dcb97ab7 - stable/12 - amdsmn(4), amdtemp(4): add support for Family 19h (Zen 3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c7d9dcb97ab74cf6f5116df6622d1eff455f5df1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:14:16 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c7d9dcb97ab74cf6f5116df6622d1eff455f5df1 commit c7d9dcb97ab74cf6f5116df6622d1eff455f5df1 Author: Conrad Meyer AuthorDate: 2020-12-12 19:34:12 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 15:10:50 +0000 amdsmn(4), amdtemp(4): add support for Family 19h (Zen 3) Zen 3 "Vermeer" support, tested on Ryzen 9 5950X. Model numbers from https://en.wikichip.org/wiki/amd/cpuid "Extended Model" column. Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D27552 (cherry picked from commit ea6189d3a470ce9ffb19335f915eab6af0cfef57) --- sys/dev/amdsmn/amdsmn.c | 3 ++- sys/dev/amdtemp/amdtemp.c | 69 ++++++++++++++++++++++++++++++++++------------- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index ebc45256d14d..e83219b02705 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 -#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H. */ +#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 struct pciid; @@ -187,6 +187,7 @@ amdsmn_probe(device_t dev) switch (family) { case 0x15: case 0x17: + case 0x19: break; default: return (ENXIO); diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 5847f9da00e1..48c4341a67cb 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -106,7 +106,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 -#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70h. */ +#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 static const struct amdtemp_product { @@ -207,6 +207,7 @@ static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); static void amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model); +static void amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t amdtemp_methods[] = { @@ -294,6 +295,7 @@ amdtemp_probe(device_t dev) case 0x15: case 0x16: case 0x17: + case 0x19: break; default: return (ENXIO); @@ -451,6 +453,7 @@ amdtemp_attach(device_t dev) sc->sc_gettemp = amdtemp_gettemp; break; case 0x17: + case 0x19: sc->sc_ntemps = 1; sc->sc_gettemp = amdtemp_gettemp17h; needsmn = true; @@ -508,6 +511,8 @@ amdtemp_attach(device_t dev) if (family == 0x17) amdtemp_probe_ccd_sensors17h(dev, model); + else if (family == 0x19) + amdtemp_probe_ccd_sensors19h(dev, model); else if (sc->sc_ntemps > 1) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), @@ -767,28 +772,13 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) } static void -amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model) +amdtemp_probe_ccd_sensors(device_t dev, uint32_t maxreg) { char sensor_name[16], sensor_descr[32]; struct amdtemp_softc *sc; - uint32_t maxreg, i, val; + uint32_t i, val; int error; - switch (model) { - case 0x00 ... 0x1f: /* Zen1, Zen+ */ - maxreg = 4; - break; - case 0x30 ... 0x3f: /* Zen2 TR/Epyc */ - case 0x70 ... 0x7f: /* Zen2 Ryzen */ - maxreg = 8; - _Static_assert((int)NUM_CCDS >= 8, ""); - break; - default: - device_printf(dev, - "Unrecognized Family 17h Model: %02xh\n", model); - return; - } - sc = device_get_softc(dev); for (i = 0; i < maxreg; i++) { error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE + @@ -808,3 +798,46 @@ amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model) dev, CCD_BASE + i, amdtemp_sysctl, "IK", sensor_descr); } } + +static void +amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model) +{ + uint32_t maxreg; + + switch (model) { + case 0x00 ... 0x1f: /* Zen1, Zen+ */ + maxreg = 4; + break; + case 0x30 ... 0x3f: /* Zen2 TR/EPYC */ + case 0x70 ... 0x7f: /* Zen2 Ryzen */ + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; + default: + device_printf(dev, + "Unrecognized Family 17h Model: %02xh\n", model); + return; + } + + amdtemp_probe_ccd_sensors(dev, maxreg); +} + +static void +amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) +{ + uint32_t maxreg; + + switch (model) { + case 0x00 ... 0x0f: /* Zen3 EPYC "Milan" */ + case 0x20 ... 0x2f: /* Zen3 Ryzen "Vermeer" */ + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; + default: + device_printf(dev, + "Unrecognized Family 19h Model: %02xh\n", model); + return; + } + + amdtemp_probe_ccd_sensors(dev, maxreg); +} From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:14:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 893F654E2FB; Thu, 4 Mar 2021 15:14: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 4DrvXh5LYwz3w7y; Thu, 4 Mar 2021 15:14: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 A75FC1F5BF; Thu, 4 Mar 2021 15:14: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 124FEBeG059015; Thu, 4 Mar 2021 15:14:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124FEBnK059014; Thu, 4 Mar 2021 15:14:11 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:14:11 GMT Message-Id: <202103041514.124FEBnK059014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: e549b1bc5373 - stable/12 - amdtemp(4): Add missing Family 17h models MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e549b1bc537377528bf966fef92f72dd1c1be8d3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:14:16 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e549b1bc537377528bf966fef92f72dd1c1be8d3 commit e549b1bc537377528bf966fef92f72dd1c1be8d3 Author: Conrad Meyer AuthorDate: 2020-12-12 19:43:38 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 15:11:02 +0000 amdtemp(4): Add missing Family 17h models Add missing model numbers M20h (Dali, Zen1), M60H (Renoir, Zen2), and M90H (Van Gogh, Zen2). Submitted by: Greg V (cherry picked from commit b499ab877f3d6bf5e2c894edfcfdcf89ce7c79d3) --- sys/dev/amdtemp/amdtemp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 48c4341a67cb..ba7c98bdb278 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -805,11 +805,12 @@ amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model) uint32_t maxreg; switch (model) { - case 0x00 ... 0x1f: /* Zen1, Zen+ */ + case 0x00 ... 0x2f: /* Zen1, Zen+ */ maxreg = 4; break; - case 0x30 ... 0x3f: /* Zen2 TR/EPYC */ - case 0x70 ... 0x7f: /* Zen2 Ryzen */ + case 0x30 ... 0x3f: /* Zen2 TR (Castle Peak)/EPYC (Rome) */ + case 0x60 ... 0x7f: /* Zen2 Ryzen (Renoir APU, Matisse) */ + case 0x90 ... 0x9f: /* Zen2 Ryzen (Van Gogh APU) */ maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); break; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:14:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47D7A54E4C7; Thu, 4 Mar 2021 15:14: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 4DrvXc45jwz3vvQ; Thu, 4 Mar 2021 15:14: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 5DCFF1F52B; Thu, 4 Mar 2021 15:14: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 124FE8FQ058953; Thu, 4 Mar 2021 15:14:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124FE85f058952; Thu, 4 Mar 2021 15:14:08 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:14:08 GMT Message-Id: <202103041514.124FE85f058952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 40c0c3ef1f7d - stable/12 - amdtemp(4): Remove dead code that snuck in with r357190 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 40c0c3ef1f7d1b932e8c22e0a62d2336a4f898e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:14:16 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=40c0c3ef1f7d1b932e8c22e0a62d2336a4f898e9 commit 40c0c3ef1f7d1b932e8c22e0a62d2336a4f898e9 Author: Conrad Meyer AuthorDate: 2020-01-28 03:27:06 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 15:09:18 +0000 amdtemp(4): Remove dead code that snuck in with r357190 I intended to remove this before committing, but neglected to. (cherry picked from commit cc3b01385bfd7e7f67866c4ac0a1b43370d7e6b7) --- sys/dev/amdtemp/amdtemp.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 8eb279c19cb8..38be7d9bd1b5 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -760,11 +760,6 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) ("sensor %d: not valid", (int)sensor)); return (amdtemp_decode_fam10h_to_17h(sc->sc_offset, val, true)); default: -#if 0 - KASSERT(false, ("%s: invalid sensor %d", __func__, - (int)sensor)); - return (-1); -#endif __unreachable(); } } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:14:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1960E54E5AA; Thu, 4 Mar 2021 15:14: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 4DrvXg014Zz3w9f; Thu, 4 Mar 2021 15:14: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 A2CA51F70B; Thu, 4 Mar 2021 15:14: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 124FE9mf058975; Thu, 4 Mar 2021 15:14:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124FE9l3058974; Thu, 4 Mar 2021 15:14:09 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:14:09 GMT Message-Id: <202103041514.124FE9l3058974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 89f349bab6d6 - stable/12 - amdtemp(4), amdsmn(4): Attach to Ryzen 4000 APU (Zen 2, "Renoir") MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 89f349bab6d6e6176704b83bd0ec358f9689a6cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:14:16 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=89f349bab6d6e6176704b83bd0ec358f9689a6cf commit 89f349bab6d6e6176704b83bd0ec358f9689a6cf Author: Conrad Meyer AuthorDate: 2020-09-25 04:16:28 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 15:10:39 +0000 amdtemp(4), amdsmn(4): Attach to Ryzen 4000 APU (Zen 2, "Renoir") PR: 249864 Reported by: Florian Millet Tested by: Florian Millet (cherry picked from commit 5b505170794dfaae633294aaf178bd797b7a1b11) --- sys/dev/amdsmn/amdsmn.c | 9 ++++++++- sys/dev/amdtemp/amdtemp.c | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index ec09dbc4d8e5..ebc45256d14d 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017-2019 Conrad Meyer + * Copyright (c) 2017-2020 Conrad Meyer * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 #define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H. */ +#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 struct pciid; struct amdsmn_softc { @@ -97,6 +98,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M60H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 38be7d9bd1b5..5847f9da00e1 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -107,6 +107,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 #define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70h. */ +#define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -130,6 +131,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M30H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, }; /* From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:17:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5526A54ECA5; Thu, 4 Mar 2021 15:17: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 4Drvcf21Tjz4RKS; Thu, 4 Mar 2021 15:17: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 37BB91F844; Thu, 4 Mar 2021 15:17: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 124FHcI8059656; Thu, 4 Mar 2021 15:17:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124FHcwK059655; Thu, 4 Mar 2021 15:17:38 GMT (envelope-from git) Date: Thu, 4 Mar 2021 15:17:38 GMT Message-Id: <202103041517.124FHcwK059655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: f97f57b51855 - main - simple_mfd: switch to controllable locking for syscon provider. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f97f57b51855cecb9b497a90dfed06dac2c21111 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:17:38 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=f97f57b51855cecb9b497a90dfed06dac2c21111 commit f97f57b51855cecb9b497a90dfed06dac2c21111 Author: Michal Meloun AuthorDate: 2021-03-04 14:09:32 +0000 Commit: Michal Meloun CommitDate: 2021-03-04 15:12:39 +0000 simple_mfd: switch to controllable locking for syscon provider. MFC after 3 weeks --- sys/dev/fdt/simple_mfd.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/sys/dev/fdt/simple_mfd.c b/sys/dev/fdt/simple_mfd.c index 752740cf705e..aedada3079e8 100644 --- a/sys/dev/fdt/simple_mfd.c +++ b/sys/dev/fdt/simple_mfd.c @@ -73,9 +73,9 @@ static int simple_mfd_syscon_modify_4(struct syscon *syscon, bus_size_t offset, #define SYSCON_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_NOTOWNED); static syscon_method_t simple_mfd_syscon_methods[] = { - SYSCONMETHOD(syscon_read_4, simple_mfd_syscon_read_4), - SYSCONMETHOD(syscon_write_4, simple_mfd_syscon_write_4), - SYSCONMETHOD(syscon_modify_4, simple_mfd_syscon_modify_4), + SYSCONMETHOD(syscon_unlocked_read_4, simple_mfd_syscon_read_4), + SYSCONMETHOD(syscon_unlocked_write_4, simple_mfd_syscon_write_4), + SYSCONMETHOD(syscon_unlocked_modify_4, simple_mfd_syscon_modify_4), SYSCONMETHOD_END }; @@ -89,10 +89,8 @@ simple_mfd_syscon_read_4(struct syscon *syscon, bus_size_t offset) uint32_t val; sc = device_get_softc(syscon->pdev); - - SYSCON_LOCK(sc); + SYSCON_ASSERT_LOCKED(sc);; val = bus_read_4(sc->mem_res, offset); - SYSCON_UNLOCK(sc); return (val); } @@ -103,10 +101,8 @@ simple_mfd_syscon_write_4(struct syscon *syscon, bus_size_t offset, struct simple_mfd_softc *sc; sc = device_get_softc(syscon->pdev); - - SYSCON_LOCK(sc); + SYSCON_ASSERT_LOCKED(sc); bus_write_4(sc->mem_res, offset, val); - SYSCON_UNLOCK(sc); return (0); } @@ -118,15 +114,14 @@ simple_mfd_syscon_modify_4(struct syscon *syscon, bus_size_t offset, uint32_t val; sc = device_get_softc(syscon->pdev); - - SYSCON_LOCK(sc); + SYSCON_ASSERT_LOCKED(sc); val = bus_read_4(sc->mem_res, offset); val &= ~clear_bits; val |= set_bits; bus_write_4(sc->mem_res, offset, val); - SYSCON_UNLOCK(sc); return (0); } + static int simple_mfd_syscon_get_handle(device_t dev, struct syscon **syscon) { @@ -139,6 +134,24 @@ simple_mfd_syscon_get_handle(device_t dev, struct syscon **syscon) return (0); } +static void +simple_mfd_syscon_lock(device_t dev) +{ + struct simple_mfd_softc *sc; + + sc = device_get_softc(dev); + SYSCON_LOCK(sc); +} + +static void +simple_mfd_syscon_unlock(device_t dev) +{ + struct simple_mfd_softc *sc; + + sc = device_get_softc(dev); + SYSCON_UNLOCK(sc); +} + static int simple_mfd_probe(device_t dev) { @@ -293,6 +306,9 @@ simple_mfd_add_device(device_t dev, phandle_t node, u_int order, static device_method_t simple_mfd_methods[] = { /* syscon interface */ DEVMETHOD(syscon_get_handle, simple_mfd_syscon_get_handle), + DEVMETHOD(syscon_device_lock, simple_mfd_syscon_lock), + DEVMETHOD(syscon_device_unlock, simple_mfd_syscon_unlock), + /* Device interface */ DEVMETHOD(device_probe, simple_mfd_probe), DEVMETHOD(device_attach, simple_mfd_attach), From owner-dev-commits-src-all@freebsd.org Thu Mar 4 16:55:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EFB2551C4D; Thu, 4 Mar 2021 16:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drxn71qdTz4Y64; Thu, 4 Mar 2021 16:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31B9620BBD; Thu, 4 Mar 2021 16:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124Gt7jx090376; Thu, 4 Mar 2021 16:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Gt763090375; Thu, 4 Mar 2021 16:55:07 GMT (envelope-from git) Date: Thu, 4 Mar 2021 16:55:07 GMT Message-Id: <202103041655.124Gt763090375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: a5dce53b75d8 - main - mvebu_gpio: Multiple fixes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5dce53b75d8750ba95623ad2dbffac4acfd3545 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 16:55:07 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=a5dce53b75d8750ba95623ad2dbffac4acfd3545 commit a5dce53b75d8750ba95623ad2dbffac4acfd3545 Author: Michal Meloun AuthorDate: 2021-03-03 17:28:45 +0000 Commit: Michal Meloun CommitDate: 2021-03-04 16:54:40 +0000 mvebu_gpio: Multiple fixes. - gpio register access primitives - locking in interrupt path - cleanup In cooperation with: mw Reviewed by: mw (initial version) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D29044 Differential Revision: https://reviews.freebsd.org/D28911 --- sys/arm/mv/mvebu_gpio.c | 60 ++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c index f0471b8d019c..c38fbceebf24 100644 --- a/sys/arm/mv/mvebu_gpio.c +++ b/sys/arm/mv/mvebu_gpio.c @@ -83,9 +83,6 @@ __FBSDID("$FreeBSD$"); #define MV_GPIO_MAX_NIRQS 4 #define MV_GPIO_MAX_NPINS 32 -#define RD4(sc, reg) SYSCON_READ_4((sc)->syscon, (reg)) -#define WR4(sc, reg, val) SYSCON_WRITE_4((sc)->syscon, (reg), (val)) - struct mvebu_gpio_irqsrc { struct intr_irqsrc isrc; u_int irq; @@ -127,14 +124,11 @@ static inline void gpio_write(struct mvebu_gpio_softc *sc, bus_size_t reg, struct gpio_pin *pin, uint32_t val) { - uint32_t tmp; int bit; bit = GPIO_BIT(pin->gp_pin); - tmp = 0x100 << bit; /* mask */ - tmp |= (val & 1) << bit; /* value */ SYSCON_WRITE_4(sc->syscon, sc->offset + GPIO_REGNUM(pin->gp_pin) + reg, - tmp); + (val & 1) << bit); } static inline uint32_t @@ -146,9 +140,21 @@ gpio_read(struct mvebu_gpio_softc *sc, bus_size_t reg, struct gpio_pin *pin) bit = GPIO_BIT(pin->gp_pin); val = SYSCON_READ_4(sc->syscon, sc->offset + GPIO_REGNUM(pin->gp_pin) + reg); + return (val >> bit) & 1; } +static inline void +gpio_modify(struct mvebu_gpio_softc *sc, bus_size_t reg, + struct gpio_pin *pin, uint32_t val) +{ + int bit; + + bit = GPIO_BIT(pin->gp_pin); + SYSCON_MODIFY_4(sc->syscon, sc->offset + GPIO_REGNUM(pin->gp_pin) + reg, + 1 << bit, (val & 1) << bit); +} + static void mvebu_gpio_pin_configure(struct mvebu_gpio_softc *sc, struct gpio_pin *pin, unsigned int flags) @@ -305,15 +311,14 @@ mvebu_gpio_pin_toggle(device_t dev, uint32_t pin) */ static inline void intr_modify(struct mvebu_gpio_softc *sc, bus_addr_t reg, - struct mvebu_gpio_irqsrc *mgi, uint32_t val, uint32_t mask) + struct mvebu_gpio_irqsrc *mgi, uint32_t val) { int bit; bit = GPIO_BIT(mgi->irq); - GPIO_LOCK(sc); - val = SYSCON_MODIFY_4(sc->syscon, - sc->offset + GPIO_REGNUM(mgi->irq) + reg, val, mask); - GPIO_UNLOCK(sc); + SYSCON_MODIFY_4(sc->syscon, + sc->offset + GPIO_REGNUM(mgi->irq) + reg, 1 << bit, + (val & 1) << bit); } static inline void @@ -322,18 +327,23 @@ mvebu_gpio_isrc_mask(struct mvebu_gpio_softc *sc, { if (mgi->is_level) - intr_modify(sc, GPIO_INT_LEVEL_MASK, mgi, val, 1); + intr_modify(sc, GPIO_INT_LEVEL_MASK, mgi, val); else - intr_modify(sc, GPIO_INT_MASK, mgi, val, 1); + intr_modify(sc, GPIO_INT_MASK, mgi, val); } static inline void mvebu_gpio_isrc_eoi(struct mvebu_gpio_softc *sc, struct mvebu_gpio_irqsrc *mgi) { + int bit; - if (!mgi->is_level) - intr_modify(sc, GPIO_INT_CAUSE, mgi, 0, 1); + if (!mgi->is_level) { + bit = GPIO_BIT(mgi->irq); + SYSCON_WRITE_4(sc->syscon, + sc->offset + GPIO_REGNUM(mgi->irq) + GPIO_INT_CAUSE, + ~(1 << bit)); + } } static int @@ -596,8 +606,11 @@ mvebu_gpio_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc, mgi->is_level = level; mgi->is_inverted = inverted; - intr_modify(sc, GPIO_DATA_IN_POL, mgi, inverted ? 1 : 0, 1); + + GPIO_LOCK(sc); + intr_modify(sc, GPIO_DATA_IN_POL, mgi, inverted ? 1 : 0); mvebu_gpio_pic_enable_intr(dev, isrc); + GPIO_UNLOCK(sc); return (0); } @@ -641,12 +654,13 @@ mvebu_gpio_intr(void *arg) lvl &= gpio_read(sc, GPIO_INT_LEVEL_MASK, &sc->gpio_pins[i]); edge = gpio_read(sc, GPIO_DATA_IN, &sc->gpio_pins[i]); edge &= gpio_read(sc, GPIO_INT_LEVEL_MASK, &sc->gpio_pins[i]); - if (edge == 0 || lvl == 0) + if (edge == 0 && lvl == 0) continue; mgi = &sc->isrcs[i]; if (!mgi->is_level) mvebu_gpio_isrc_eoi(sc, mgi); + if (intr_isrc_dispatch(&mgi->isrc, tf) != 0) { mvebu_gpio_isrc_mask(sc, mgi, 0); if (mgi->is_level) @@ -776,11 +790,11 @@ mvebu_gpio_attach(device_t dev) snprintf(pin->gp_name, GPIOMAXNAME, "gpio%d", i); /* Init HW */ - gpio_write(sc, GPIO_INT_MASK, pin, 0); - gpio_write(sc, GPIO_INT_LEVEL_MASK, pin, 0); - gpio_write(sc, GPIO_INT_CAUSE, pin, 0); - gpio_write(sc, GPIO_DATA_IN_POL, pin, 1); - gpio_write(sc, GPIO_BLINK_ENA, pin, 0); + gpio_modify(sc, GPIO_INT_MASK, pin, 0); + gpio_modify(sc, GPIO_INT_LEVEL_MASK, pin, 0); + gpio_modify(sc, GPIO_INT_CAUSE, pin, 0); + gpio_modify(sc, GPIO_DATA_IN_POL, pin, 0); + gpio_modify(sc, GPIO_BLINK_ENA, pin, 0); } if (sc->irq_res[0] != NULL) { From owner-dev-commits-src-all@freebsd.org Thu Mar 4 17:44:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CDC355312E; Thu, 4 Mar 2021 17:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrytG1tKhz4bgB; Thu, 4 Mar 2021 17:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3347A2116C; Thu, 4 Mar 2021 17:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124Hic3Q056122; Thu, 4 Mar 2021 17:44:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Hich3056121; Thu, 4 Mar 2021 17:44:38 GMT (envelope-from git) Date: Thu, 4 Mar 2021 17:44:38 GMT Message-Id: <202103041744.124Hich3056121@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 6d85483f4c4d - stable/13 - qeueue.h: Add {SLIST, STAILQ, LIST, TAILQ}_END() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d85483f4c4d5636da141816273d52b145af3df6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 17:44:38 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6d85483f4c4d5636da141816273d52b145af3df6 commit 6d85483f4c4d5636da141816273d52b145af3df6 Author: Alex Richardson AuthorDate: 2021-01-25 14:11:45 +0000 Commit: Alex Richardson CommitDate: 2021-03-04 17:43:48 +0000 qeueue.h: Add {SLIST,STAILQ,LIST,TAILQ}_END() We provide these for compat with other queue.h headers since some software assumes it exists (e.g. the libevent contrib code), but we are not encouraging their use (NULL should be used instead). This fixes the following warning (which should arguable be an error since it results in a function call to an undefined function): .../contrib/libevent/buffer.c:495:16: warning: implicit declaration of function 'LIST_END' is invalid in C99 [-Wimplicit-function-declaration] cbent != LIST_END(&buffer->callbacks); ^ .../contrib/libevent/buffer.c:495:13: warning: comparison between pointer and integer ('struct evbuffer_cb_entry *' and 'int') [-Wpointer-integer-compare] cbent != LIST_END(&buffer->callbacks); ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27151 (cherry picked from commit 8d55837dc1331a5cdacad539b1788ab1070159b4) --- sys/fs/nfs/nfsport.h | 2 ++ sys/sys/queue.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 7d1c3b1c8cea..9f2789f57bec 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -880,9 +880,11 @@ int nfsmsleep(void *, void *, int, const char *, struct timespec *); /* * Some queue.h files don't have these dfined in them. */ +#ifndef LIST_END #define LIST_END(head) NULL #define SLIST_END(head) NULL #define TAILQ_END(head) NULL +#endif /* * This must be defined to be a global variable that increments once diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 14d55905dfc0..25091ec815f1 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -91,6 +91,7 @@ * _CLASS_ENTRY + + + + * _INIT + + + + * _EMPTY + + + + + * _END + + + + * _FIRST + + + + * _NEXT + + + + * _PREV - + - + @@ -305,6 +306,8 @@ struct { \ SLIST_FIRST(head2) = swap_first; \ } while (0) +#define SLIST_END(head) NULL + /* * Singly-linked Tail queue declarations. */ @@ -437,6 +440,9 @@ struct { \ (head2)->stqh_last = &STAILQ_FIRST(head2); \ } while (0) +#define STAILQ_END(head) NULL + + /* * List declarations. */ @@ -611,6 +617,8 @@ struct { \ swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ } while (0) +#define LIST_END(head) NULL + /* * Tail queue declarations. */ @@ -867,4 +875,6 @@ struct { \ (head2)->tqh_last = &(head2)->tqh_first; \ } while (0) +#define TAILQ_END(head) NULL + #endif /* !_SYS_QUEUE_H_ */ From owner-dev-commits-src-all@freebsd.org Thu Mar 4 15:12:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB1EC54E1E3; Thu, 4 Mar 2021 15:12:21 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrvVY1cBvz3vtG; Thu, 4 Mar 2021 15:12:20 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 124FC9rx056115; Thu, 4 Mar 2021 07:12:09 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 124FC8KV056114; Thu, 4 Mar 2021 07:12:08 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103041512.124FC8KV056114@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: <20210304160240.494a85605396c0751d7313da@bidouilliste.com> To: Emmanuel Vadot Date: Thu, 4 Mar 2021 07:12:08 -0800 (PST) CC: rgrimes@freebsd.org, "Rodney W. Grimes" , Nathan Whitehorn , Warner Losh , Brandon Bergren , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4DrvVY1cBvz3vtG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Mailman-Approved-At: Thu, 04 Mar 2021 18:11:07 +0000 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 15:12:21 -0000 > On Thu, 4 Mar 2021 06:56:11 -0800 (PST) > "Rodney W. Grimes" wrote: > > > > On 3/3/21 10:38 AM, Warner Losh wrote: > > > > > > > > > > > > On Wed, Mar 3, 2021 at 7:13 AM Nathan Whitehorn > > > > > wrote: > > > > > > > > > > > > > > > > On 3/3/21 9:05 AM, Brandon Bergren wrote: > > > > > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: > > > > >> What am I missing here?? One place I am being told this is run in > > > > >> an environment that may not even be an EFI booted system, and in > > > > >> another place it is being used as a test if something is mounted > > > > >> on it, which should only be true on an EFI booted system. > > > > > That the script in question is a generic script that runs as > > > > part of bsdinstall on every platform and has to be universal. > > > > > > > > > > The actual *problem* here is that > > > > usr.sbin/bsdinstall/scripts/bootconfig has a default case that is > > > > >? ? ? ? ? ? ? *)? ? ? ? ? die "Unsupported arch $(uname -m) for > > > > UEFI install" > > > > > > > > > > which then causes the main script to bail out, leaving the > > > > system in a half-installed state. > > > > > > > > > > If that had just been an exit 0 this would have never been a > > > > problem, I suppose. > > > > > > > > > > Before the original change that broke this, there was a check > > > > that the script was not running on powerpc or mips platforms > > > > before running the efi bits, but this got taken out. > > > > > > > > > > > > > Well, incidentally. The bootconfig script needs to know if there > > > > is an > > > > ESP it should configure, but the signalling mechanism (the > > > > presence of > > > > the ESP mount point) was being broken by mtree making that directory > > > > unconditionally even on systems that don't use EFI. So then > > > > bootconfig > > > > tried to set it up, but failed later on, because there was no EFI > > > > loader > > > > to set up. The mtree change makes the ESP mount point only exist on > > > > systems with an ESP. > > > > > > > > > > > > So you made a unilateral change, without discussion of the bigger > > > > design, to something without even asking the original person who made > > > > the change to mtree about it for what sounds like an obscure case in > > > > the installer that could be solved in a different way? It's trivial > > > > enough to look at the boot method sysctl and skip the EFI update if we > > > > didn't boot EFI (and if by change that's not on all systems, it's easy > > > > enough to add it on all systems). I have no notion about why that > > > > wasn't considered, at least, before jumping in and taking people by > > > > surprise. > > > > I still do not understand why machdep.bootmethod=EFI was rejected? > > Is this value not present on ALL platforms that boot in EFI mode? > > if exist(machdep.bootmethod) && machdep.bootmethod=EFI seems to > > me to be the best and valid way to make this decision. If that > > has issues working on a platform we need to fix that issue and not > > do all this other stuff. > > We need to install and create the efi dir even if the installer is > booted in CSM mode, so a user can switch to full uefi mode after and > still can boot the FreeBSD that was installed. (The same thing must be > done for bios boot code). Ah, yes, ok, I see that issue, but isnt that driven by the fact the user has selected GPT (EFI) in the disk menu, so could be drive by an installer variable like any other aspect of the installer? Passing around the users install parameters via the file system is fragile as noted else where, this information should be clearly avaliable within the installer script itself. > > > > > > > > > Next time, talk to people first. That's the whole point of having > > > > review tools, mailing list and git blame. > > > > > > > > Warner > > > > > > This method of testing was in the original review here posted on Feb. > > > 23: https://reviews.freebsd.org/D28897 > > > > > > The description of the test procedure you're objecting to was even in > > > the summary! Then we had a discussion by email about the change to mtree > > > on the committers list on Feb. 28 to resolve a bug affecting PowerPC in > > > the patch reviewed and approved by you. I then waited several days and > > > had a long thread for several days on the mailing list about the > > > approach. coming up with this short patch -- again, as a bug fix to a > > > reviewed approach. > > > > > > We can change the logic -- that's fine! But, to paraphrase, the reason > > > we have reviews is so people like you can look at the review and note > > > these kinds of problems when they are reviewed, not after the commit > > > goes in. There's a significant amount of whiplash when you do get > > > patches reviewed, approved, and then the person who reviewed and > > > approved them accuses you of "taking people by surprise". > > > > > > The installer *does* mount the partition in advance, so checking whether > > > there is a mounted file system is a perfectly reasonable test to do. We > > > could also check fstab. I would like to understand what is actually > > > wrong here first, though. Especially after this misfire -- which is > > > problematic for reasons that are still not clear to me, since there are > > > a number of standard directories in hier(7) not in mtree -- I want to > > > make sure we actually do have consensus about what is changing and why. > > > > These *should* be fixed. ALL directories that are part of a finished > > FreeBSD system should be present both in hier.7 and in the mtree files, > > deviating from that should only be allowed if there is some really > > really grand reasons. If the reason is "architecture foo does not > > have directory /bar/zap" one could and should create an arch specific > > mtree file that covers these, having these mkdir's (prefer to see > > all those changed to install -d's) scattered around all over, IMHO > > creates maintance and inconsistency issues. > > > > > -Nathan > > -- > > Rod Grimes rgrimes@freebsd.org > -- > Emmanuel Vadot -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Thu Mar 4 18:44:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE1A7555373; Thu, 4 Mar 2021 18:44:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds0Bs4XpQz4hCR; Thu, 4 Mar 2021 18:44: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 8EAA222596; Thu, 4 Mar 2021 18:44: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 124Ii5cd034930; Thu, 4 Mar 2021 18:44:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Ii5sX034929; Thu, 4 Mar 2021 18:44:05 GMT (envelope-from git) Date: Thu, 4 Mar 2021 18:44:05 GMT Message-Id: <202103041844.124Ii5sX034929@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: 0072e5e0f3a0 - main - sys/arm64/arm64/vfp.c: Fix -Wunused and -Wpointer-sign warnings 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: 0072e5e0f3a0bb3aa06708ba64497ef75021d431 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 18:44:05 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=0072e5e0f3a0bb3aa06708ba64497ef75021d431 commit 0072e5e0f3a0bb3aa06708ba64497ef75021d431 Author: Alex Richardson AuthorDate: 2021-03-04 14:55:29 +0000 Commit: Alex Richardson CommitDate: 2021-03-04 18:25:44 +0000 sys/arm64/arm64/vfp.c: Fix -Wunused and -Wpointer-sign warnings These are off by default but were flagged by my IDE while adding some debugging printfs for D29060. --- sys/arm64/arm64/vfp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 62244ddc80e8..23c782c6dccb 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -102,7 +102,7 @@ vfp_discard(struct thread *td) static void vfp_store(struct vfpstate *state) { - __int128_t *vfp_state; + __uint128_t *vfp_state; uint64_t fpcr, fpsr; vfp_state = state->vfp_regs; @@ -134,7 +134,7 @@ vfp_store(struct vfpstate *state) static void vfp_restore(struct vfpstate *state) { - __int128_t *vfp_state; + __uint128_t *vfp_state; uint64_t fpcr, fpsr; vfp_state = state->vfp_regs; @@ -357,7 +357,7 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx) } int -fpu_kern_thread(u_int flags) +fpu_kern_thread(u_int flags __unused) { struct pcb *pcb = curthread->td_pcb; @@ -372,7 +372,7 @@ fpu_kern_thread(u_int flags) } int -is_fpu_kern_thread(u_int flags) +is_fpu_kern_thread(u_int flags __unused) { struct pcb *curpcb; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 18:44:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11502555504; Thu, 4 Mar 2021 18:44: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 4Ds0Bv6vRQz4hFv; Thu, 4 Mar 2021 18:44:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD29D2251F; Thu, 4 Mar 2021 18:44:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124Ii7n6034970; Thu, 4 Mar 2021 18:44:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Ii7AK034969; Thu, 4 Mar 2021 18:44:07 GMT (envelope-from git) Date: Thu, 4 Mar 2021 18:44:07 GMT Message-Id: <202103041844.124Ii7AK034969@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: 172a624f0c9f - main - Silence annoying and incorrect non-default linker warning with GCC 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: 172a624f0c9fbc47d74fd5178d46f771f82dc6a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 18:44:08 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=172a624f0c9fbc47d74fd5178d46f771f82dc6a0 commit 172a624f0c9fbc47d74fd5178d46f771f82dc6a0 Author: Alex Richardson AuthorDate: 2021-03-04 18:27:37 +0000 Commit: Alex Richardson CommitDate: 2021-03-04 18:27:39 +0000 Silence annoying and incorrect non-default linker warning with GCC The CROSS_TOOLCHAIN GCC .mk files include -B${CROSS_BINUTILS_PREFIX}, so GCC will select the right linker and we don't need to warn. While here also apply 17b8b8fb5fc4acc832dabfe7ef11e3e1d399ad0f to kern.mk. Test Plan: no more warning printed with CROSS_TOOLCHAIN=mips-gcc6 Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D29015 --- share/mk/bsd.sys.mk | 4 ++++ sys/conf/kern.mk | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 497283fc95da..fad487cf5630 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -306,9 +306,13 @@ LDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} .else # GCC does not support an absolute path for -fuse-ld so we just print this # warning instead and let the user add the required symlinks. +# However, we can avoid this warning if -B is set appropriately (e.g. for +# CROSS_TOOLCHAIN=...-gcc). +.if !(${LD:[1]:T} == "ld" && ${CC:tw:M-B${LD:[1]:H}/}) .warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not supported .endif .endif +.endif # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 8f0163a3d0a0..8cc79e6645ad 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -280,19 +280,23 @@ CFLAGS+= -std=${CSTD} # Please keep this if in sync with bsd.sys.mk .if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld") # Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". -# Note: Clang 12+ will prefer --ld-path= over -fuse-ld=. .if ${COMPILER_TYPE} == "clang" -# Note: unlike bsd.sys.mk we can't use LDFLAGS here since that is used for the -# flags required when linking the kernel. We don't need those flags when -# building the vdsos. However, we do need -fuse-ld, so use ${CCLDFLAGS} instead. -# Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld. -CCLDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} +# Note: Clang does not like relative paths for ld so we map ld.lld -> lld. +.if ${COMPILER_VERSION} >= 120000 +LDFLAGS+= --ld-path=${LD:[1]:S/^ld.//1W} +.else +LDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} +.endif .else # GCC does not support an absolute path for -fuse-ld so we just print this # warning instead and let the user add the required symlinks. +# However, we can avoid this warning if -B is set appropriately (e.g. for +# CROSS_TOOLCHAIN=...-gcc). +.if !(${LD:[1]:T} == "ld" && ${CC:tw:M-B${LD:[1]:H}/}) .warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not supported .endif .endif +.endif # Set target-specific linker emulation name. LD_EMULATION_aarch64=aarch64elf From owner-dev-commits-src-all@freebsd.org Thu Mar 4 18:44:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E01A2555493; Thu, 4 Mar 2021 18:44: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 4Ds0Bt5qHlz4hJ6; Thu, 4 Mar 2021 18:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8F7622418; Thu, 4 Mar 2021 18:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124Ii6gI034950; Thu, 4 Mar 2021 18:44:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Ii6w0034949; Thu, 4 Mar 2021 18:44:06 GMT (envelope-from git) Date: Thu, 4 Mar 2021 18:44:06 GMT Message-Id: <202103041844.124Ii6w0034949@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: b2c8cbf992cb - main - Remove unnecessary semicolon from CRITICAL_ASSERT() 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: b2c8cbf992cb0b51118beae9c304580705ae00c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 18:44:07 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b2c8cbf992cb0b51118beae9c304580705ae00c9 commit b2c8cbf992cb0b51118beae9c304580705ae00c9 Author: Alex Richardson AuthorDate: 2021-03-04 15:06:32 +0000 Commit: Alex Richardson CommitDate: 2021-03-04 18:26:50 +0000 Remove unnecessary semicolon from CRITICAL_ASSERT() This fixes off-by-default "empty statement" compiler warnings. --- sys/sys/systm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 72a10c401af9..369b8bdedb51 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -193,7 +193,7 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2); * Assert that a thread is in critical(9) section. */ #define CRITICAL_ASSERT(td) \ - KASSERT((td)->td_critnest >= 1, ("Not in critical section")); + KASSERT((td)->td_critnest >= 1, ("Not in critical section")) /* * If we have already panic'd and this is the thread that called From owner-dev-commits-src-all@freebsd.org Thu Mar 4 18:44:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0499A55541C; Thu, 4 Mar 2021 18:44: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 4Ds0Bx1Wqcz4h4k; Thu, 4 Mar 2021 18:44: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 0E2C02268C; Thu, 4 Mar 2021 18:44: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 124Ii80W034988; Thu, 4 Mar 2021 18:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Ii8AU034987; Thu, 4 Mar 2021 18:44:08 GMT (envelope-from git) Date: Thu, 4 Mar 2021 18:44:08 GMT Message-Id: <202103041844.124Ii8AU034987@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: 6019514b0b53 - main - truss: split counting of syscalls and syscall calling convention 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: 6019514b0b53c3fc151868b88357405b6d67f308 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 18:44:11 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6019514b0b53c3fc151868b88357405b6d67f308 commit 6019514b0b53c3fc151868b88357405b6d67f308 Author: Alex Richardson AuthorDate: 2021-03-04 18:28:25 +0000 Commit: Alex Richardson CommitDate: 2021-03-04 18:30:02 +0000 truss: split counting of syscalls and syscall calling convention This change is a refactoring cleanup to improve support for compat32 syscalls (and compat64 on CHERI systems). Each process ABI now has it's own struct sycall instead of using one global list. The list of all syscalls is replaced with a list of seen syscalls. Looking up the syscall argument passing convention now interates over the fixed-size array instead of using a link-list that's populated on startup so we no longer need the init_syscall() function. The actual functional changes are in D27625. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27636 --- usr.bin/truss/main.c | 1 - usr.bin/truss/setup.c | 19 ++++++----- usr.bin/truss/syscall.h | 25 +++++++++----- usr.bin/truss/syscalls.c | 85 +++++++++++++++++++++++------------------------- 4 files changed, 67 insertions(+), 63 deletions(-) diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index c10301b6680d..1a3aae75be88 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -87,7 +87,6 @@ main(int ac, char **av) trussinfo->strsize = 32; trussinfo->curthread = NULL; LIST_INIT(&trussinfo->proclist); - init_syscalls(); while ((c = getopt(ac, av, "p:o:facedDs:SH")) != -1) { switch (c) { case 'p': /* specified pid */ diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c index d21ec133f483..2ea1bce8919b 100644 --- a/usr.bin/truss/setup.c +++ b/usr.bin/truss/setup.c @@ -463,8 +463,8 @@ enter_syscall(struct trussinfo *info, struct threadinfo *t, fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n", t->proc->abi->type, t->cs.number); - t->cs.nargs = sc->nargs; - assert(sc->nargs <= nitems(t->cs.s_args)); + t->cs.nargs = sc->decode.nargs; + assert(sc->decode.nargs <= nitems(t->cs.s_args)); t->cs.sc = sc; @@ -480,11 +480,12 @@ enter_syscall(struct trussinfo *info, struct threadinfo *t, #endif for (i = 0; i < t->cs.nargs; i++) { #if DEBUG - fprintf(stderr, "0x%lx%s", t->cs.args[sc->args[i].offset], + fprintf(stderr, "0x%lx%s", + t->cs.args[sc->decode.args[i].offset], i < (t->cs.nargs - 1) ? "," : ""); #endif - if (!(sc->args[i].type & OUT)) { - t->cs.s_args[i] = print_arg(&sc->args[i], + if (!(sc->decode.args[i].type & OUT)) { + t->cs.s_args[i] = print_arg(&sc->decode.args[i], t->cs.args, NULL, info); } } @@ -542,19 +543,19 @@ exit_syscall(struct trussinfo *info, struct ptrace_lwpinfo *pl) * Here, we only look for arguments that have OUT masked in -- * otherwise, they were handled in enter_syscall(). */ - for (i = 0; i < sc->nargs; i++) { + for (i = 0; i < sc->decode.nargs; i++) { char *temp; - if (sc->args[i].type & OUT) { + if (sc->decode.args[i].type & OUT) { /* * If an error occurred, then don't bother * getting the data; it may not be valid. */ if (psr.sr_error != 0) { asprintf(&temp, "0x%lx", - t->cs.args[sc->args[i].offset]); + t->cs.args[sc->decode.args[i].offset]); } else { - temp = print_arg(&sc->args[i], + temp = print_arg(&sc->decode.args[i], t->cs.args, psr.sr_retval, info); } t->cs.s_args[i] = temp; diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index af918fed4f1b..fc1630677242 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -218,18 +218,28 @@ enum Argtype { _Static_assert(ARG_MASK > MAX_ARG_TYPE, "ARG_MASK overlaps with Argtype values"); -struct syscall_args { +struct syscall_arg { enum Argtype type; int offset; }; +struct syscall_decode { + const char *name; /* Name for calling convention lookup. */ + /* + * Syscall return type: + * 0: no return value (e.g. exit) + * 1: normal return value (a single int/long/pointer) + * 2: off_t return value (two values for 32-bit ABIs) + */ + u_int ret_type; + u_int nargs; /* number of meaningful arguments */ + struct syscall_arg args[10]; /* Hopefully no syscalls with > 10 args */ +}; + struct syscall { STAILQ_ENTRY(syscall) entries; - const char *name; - u_int ret_type; /* 0, 1, or 2 return values */ - u_int nargs; /* actual number of meaningful arguments */ - /* Hopefully, no syscalls with > 10 args */ - struct syscall_args args[10]; + const char *name; /* Name to be displayed, might be malloc()'d */ + struct syscall_decode decode; struct timespec time; /* Time spent for this call */ int ncalls; /* Number of calls */ int nerror; /* Number of calls that returned with error */ @@ -237,7 +247,7 @@ struct syscall { }; struct syscall *get_syscall(struct threadinfo *, u_int, u_int); -char *print_arg(struct syscall_args *, unsigned long*, register_t *, +char *print_arg(struct syscall_arg *, unsigned long *, register_t *, struct trussinfo *); /* @@ -280,7 +290,6 @@ struct linux_socketcall_args { char args_l_[PADL_(l_ulong)]; l_ulong args; char args_r_[PADR_(l_ulong)]; }; -void init_syscalls(void); void print_syscall(struct trussinfo *); void print_syscall_ret(struct trussinfo *, int, register_t *); void print_summary(struct trussinfo *trussinfo); diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index f52a82ed97c0..91ddc65e457f 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -47,8 +47,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #define _WANT_FREEBSD11_STAT #include @@ -66,8 +68,6 @@ __FBSDID("$FreeBSD$"); #define _WANT_KERNEL_ERRNO #include #include -#include -#include #include #include #include @@ -85,8 +85,13 @@ __FBSDID("$FreeBSD$"); /* * This should probably be in its own file, sorted alphabetically. + * + * Note: We only scan this table on the initial syscall number to calling + * convention lookup, i.e. once each time a new syscall is encountered. This + * is unlikely to be a performance issue, but if it is we could sort this array + * and use a binary search instead. */ -static struct syscall decoded_syscalls[] = { +static const struct syscall_decode decoded_syscalls[] = { /* Native ABI */ { .name = "__acl_aclcheck_fd", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, @@ -706,10 +711,8 @@ static struct syscall decoded_syscalls[] = { { .name = "cloudabi_sys_thread_exit", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { CloudABIMFlags, 1 } } }, { .name = "cloudabi_sys_thread_yield", .ret_type = 1, .nargs = 0 }, - - { .name = 0 }, }; -static STAILQ_HEAD(, syscall) syscalls; +static STAILQ_HEAD(, syscall) seen_syscalls; /* Xlat idea taken from strace */ struct xlat { @@ -969,7 +972,7 @@ print_mask_arg32(bool (*decoder)(FILE *, uint32_t, uint32_t *), FILE *fp, * decoding arguments. */ static void -quad_fixup(struct syscall *sc) +quad_fixup(struct syscall_decode *sc) { int offset, prev; u_int i; @@ -1007,20 +1010,6 @@ quad_fixup(struct syscall *sc) } #endif -void -init_syscalls(void) -{ - struct syscall *sc; - - STAILQ_INIT(&syscalls); - for (sc = decoded_syscalls; sc->name != NULL; sc++) { -#ifndef __LP64__ - quad_fixup(sc); -#endif - STAILQ_INSERT_HEAD(&syscalls, sc, entries); - } -} - static struct syscall * find_syscall(struct procabi *abi, u_int number) { @@ -1040,6 +1029,11 @@ add_syscall(struct procabi *abi, u_int number, struct syscall *sc) { struct extra_syscall *es; +#ifndef __LP64__ + /* FIXME: should be based on syscall ABI not truss ABI */ + quad_fixup(&sc->decode); +#endif + if (number < nitems(abi->syscalls)) { assert(abi->syscalls[number] == NULL); abi->syscalls[number] = sc; @@ -1049,6 +1043,8 @@ add_syscall(struct procabi *abi, u_int number, struct syscall *sc) es->number = number; STAILQ_INSERT_TAIL(&abi->extra_syscalls, es, entries); } + + STAILQ_INSERT_HEAD(&seen_syscalls, sc, entries); } /* @@ -1059,24 +1055,28 @@ struct syscall * get_syscall(struct threadinfo *t, u_int number, u_int nargs) { struct syscall *sc; + const char *sysdecode_name; const char *name; - char *new_name; u_int i; sc = find_syscall(t->proc->abi, number); if (sc != NULL) return (sc); - name = sysdecode_syscallname(t->proc->abi->abi, number); - if (name == NULL) { - asprintf(&new_name, "#%d", number); - name = new_name; - } else - new_name = NULL; - STAILQ_FOREACH(sc, &syscalls, entries) { - if (strcmp(name, sc->name) == 0) { + /* Memory is not explicitly deallocated, it's released on exit(). */ + sysdecode_name = sysdecode_syscallname(t->proc->abi->abi, number); + if (sysdecode_name == NULL) + asprintf(__DECONST(char **, &name), "#%d", number); + else + name = sysdecode_name; + + sc = calloc(1, sizeof(*sc)); + sc->name = name; + + for (i = 0; i < nitems(decoded_syscalls); i++) { + if (strcmp(name, decoded_syscalls[i].name) == 0) { + sc->decode = decoded_syscalls[i]; add_syscall(t->proc->abi, number, sc); - free(new_name); return (sc); } } @@ -1086,21 +1086,15 @@ get_syscall(struct threadinfo *t, u_int number, u_int nargs) fprintf(stderr, "unknown syscall %s -- setting args to %d\n", name, nargs); #endif - - sc = calloc(1, sizeof(struct syscall)); - sc->name = name; - if (new_name != NULL) - sc->unknown = true; - sc->ret_type = 1; - sc->nargs = nargs; + sc->unknown = sysdecode_name == NULL; + sc->decode.ret_type = 1; /* Assume 1 return value. */ + sc->decode.nargs = nargs; for (i = 0; i < nargs; i++) { - sc->args[i].offset = i; + sc->decode.args[i].offset = i; /* Treat all unknown arguments as LongHex. */ - sc->args[i].type = LongHex; + sc->decode.args[i].type = LongHex; } - STAILQ_INSERT_HEAD(&syscalls, sc, entries); add_syscall(t->proc->abi, number, sc); - return (sc); } @@ -1717,7 +1711,7 @@ print_sysctl(FILE *fp, int *oid, size_t len) * an array of all of the system call arguments. */ char * -print_arg(struct syscall_args *sc, unsigned long *args, register_t *retval, +print_arg(struct syscall_arg *sc, unsigned long *args, register_t *retval, struct trussinfo *trussinfo) { FILE *fp; @@ -2992,7 +2986,7 @@ print_syscall_ret(struct trussinfo *trussinfo, int error, register_t *retval) strerror(error)); } #ifndef __LP64__ - else if (sc->ret_type == 2) { + else if (sc->decode.ret_type == 2) { off_t off; #if _BYTE_ORDER == _LITTLE_ENDIAN @@ -3019,7 +3013,7 @@ print_summary(struct trussinfo *trussinfo) fprintf(trussinfo->outfile, "%-20s%15s%8s%8s\n", "syscall", "seconds", "calls", "errors"); ncall = nerror = 0; - STAILQ_FOREACH(sc, &syscalls, entries) + STAILQ_FOREACH(sc, &seen_syscalls, entries) { if (sc->ncalls) { fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", sc->name, (intmax_t)sc->time.tv_sec, @@ -3028,6 +3022,7 @@ print_summary(struct trussinfo *trussinfo) ncall += sc->ncalls; nerror += sc->nerror; } + } fprintf(trussinfo->outfile, "%20s%15s%8s%8s\n", "", "-------------", "-------", "-------"); fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", From owner-dev-commits-src-all@freebsd.org Thu Mar 4 18:57:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E6485557C3; Thu, 4 Mar 2021 18:57:59 +0000 (UTC) (envelope-from nwhitehorn@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 4Ds0Vv3cxpz4jBQ; Thu, 4 Mar 2021 18:57:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:5d1e:c500:751e:7e8c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 14AD42F8E3; Thu, 4 Mar 2021 18:57:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. To: rgrimes@freebsd.org, Emmanuel Vadot Cc: "Rodney W. Grimes" , Warner Losh , Brandon Bergren , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103041512.124FC8KV056114@gndrsh.dnsmgr.net> From: Nathan Whitehorn Message-ID: <11c7fc3b-3b94-c56f-5755-44a5cb7ab884@freebsd.org> Date: Thu, 4 Mar 2021 13:57:58 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <202103041512.124FC8KV056114@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 18:57:59 -0000 On 3/4/21 10:12 AM, Rodney W. Grimes wrote: >> On Thu, 4 Mar 2021 06:56:11 -0800 (PST) >> "Rodney W. Grimes" wrote: >> >>>> On 3/3/21 10:38 AM, Warner Losh wrote: >>>>> >>>>> On Wed, Mar 3, 2021 at 7:13 AM Nathan Whitehorn >>>>> > wrote: >>>>> >>>>> >>>>> >>>>> On 3/3/21 9:05 AM, Brandon Bergren wrote: >>>>> > On Wed, Mar 3, 2021, at 6:53 AM, Rodney W. Grimes wrote: >>>>> >> What am I missing here?? One place I am being told this is run in >>>>> >> an environment that may not even be an EFI booted system, and in >>>>> >> another place it is being used as a test if something is mounted >>>>> >> on it, which should only be true on an EFI booted system. >>>>> > That the script in question is a generic script that runs as >>>>> part of bsdinstall on every platform and has to be universal. >>>>> > >>>>> > The actual *problem* here is that >>>>> usr.sbin/bsdinstall/scripts/bootconfig has a default case that is >>>>> >? ? ? ? ? ? ? *)? ? ? ? ? die "Unsupported arch $(uname -m) for >>>>> UEFI install" >>>>> > >>>>> > which then causes the main script to bail out, leaving the >>>>> system in a half-installed state. >>>>> > >>>>> > If that had just been an exit 0 this would have never been a >>>>> problem, I suppose. >>>>> > >>>>> > Before the original change that broke this, there was a check >>>>> that the script was not running on powerpc or mips platforms >>>>> before running the efi bits, but this got taken out. >>>>> > >>>>> >>>>> Well, incidentally. The bootconfig script needs to know if there >>>>> is an >>>>> ESP it should configure, but the signalling mechanism (the >>>>> presence of >>>>> the ESP mount point) was being broken by mtree making that directory >>>>> unconditionally even on systems that don't use EFI. So then >>>>> bootconfig >>>>> tried to set it up, but failed later on, because there was no EFI >>>>> loader >>>>> to set up. The mtree change makes the ESP mount point only exist on >>>>> systems with an ESP. >>>>> >>>>> >>>>> So you made a unilateral change, without discussion of the bigger >>>>> design, to something without even asking the original person who made >>>>> the change to mtree about it for what sounds like an obscure case in >>>>> the installer that could be solved in a different way? It's trivial >>>>> enough to look at the boot method sysctl and skip the EFI update if we >>>>> didn't boot EFI (and if by change that's not on all systems, it's easy >>>>> enough to add it on all systems). I have no notion about why that >>>>> wasn't considered, at least, before jumping in and taking people by >>>>> surprise. >>> I still do not understand why machdep.bootmethod=EFI was rejected? >>> Is this value not present on ALL platforms that boot in EFI mode? >>> if exist(machdep.bootmethod) && machdep.bootmethod=EFI seems to >>> me to be the best and valid way to make this decision. If that >>> has issues working on a platform we need to fix that issue and not >>> do all this other stuff. >> We need to install and create the efi dir even if the installer is >> booted in CSM mode, so a user can switch to full uefi mode after and >> still can boot the FreeBSD that was installed. (The same thing must be >> done for bios boot code). > Ah, yes, ok, I see that issue, but isnt that driven by the fact > the user has selected GPT (EFI) in the disk menu, so could be > drive by an installer variable like any other aspect of the > installer? Passing around the users install parameters via > the file system is fragile as noted else where, this information > should be clearly avaliable within the installer script itself. > > The installer does not maintain state internally and system configuration is decoupled from partition editing to avoid precisely the kind of fragility you are worried about. -Nathan From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:24:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A05ED55606F; Thu, 4 Mar 2021 19:24: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 4Ds16148RCz4kcx; Thu, 4 Mar 2021 19:24: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 813A922C28; Thu, 4 Mar 2021 19:24: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 124JOvnR087907; Thu, 4 Mar 2021 19:24:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JOvsY087906; Thu, 4 Mar 2021 19:24:57 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:24:57 GMT Message-Id: <202103041924.124JOvsY087906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: def8b2b427ea - stable/13 - FFS extattr: fix handling of the tail MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: def8b2b427ea5bff099e70b2a8351312be9e997a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:24:57 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=def8b2b427ea5bff099e70b2a8351312be9e997a commit def8b2b427ea5bff099e70b2a8351312be9e997a Author: Konstantin Belousov AuthorDate: 2021-03-01 15:24:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:07:25 +0000 FFS extattr: fix handling of the tail (cherry picked from commit 8742817ba62ec604156c139727155d36f5fbad06) --- sys/ufs/ffs/ffs_vnops.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index af03b369a280..582ccccc2e12 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1346,13 +1346,20 @@ ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td) /* Validate disk xattrfile contents. */ for (eap = (void *)eae, eaend = (void *)(eae + easize); eap < eaend; eap = eapnext) { + /* Detect zeroed out tail */ + if (eap->ea_length < sizeof(*eap) || eap->ea_length == 0) { + easize = (const u_char *)eap - eae; + break; + } + eapnext = EXTATTR_NEXT(eap); - /* Bogusly short entry or bogusly long entry. */ - if (eap->ea_length < sizeof(*eap) || eapnext > eaend) { + /* Bogusly long entry. */ + if (eapnext > eaend) { free(eae, M_TEMP); return (EINTEGRITY); } } + ip->i_ea_len = easize; *p = eae; return (0); } @@ -1407,7 +1414,6 @@ ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td) ffs_unlock_ea(vp); return (error); } - ip->i_ea_len = dp->di_extsize; ip->i_ea_error = 0; ip->i_ea_refs++; ffs_unlock_ea(vp); @@ -1426,6 +1432,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td struct ufs2_dinode *dp; size_t ea_len, tlen; int error, i, lcnt; + bool truncate; ip = VTOI(vp); @@ -1436,6 +1443,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td } dp = ip->i_din2; error = ip->i_ea_error; + truncate = false; if (commit && error == 0) { ASSERT_VOP_ELOCKED(vp, "ffs_close_ea commit"); if (cred == NOCRED) @@ -1452,12 +1460,12 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td liovec[0].iov_base = ip->i_ea_area; liovec[0].iov_len = ip->i_ea_len; - for (i = 1, tlen = ea_len; i < lcnt; i++) { + for (i = 1, tlen = ea_len - ip->i_ea_len; i < lcnt; i++) { liovec[i].iov_base = __DECONST(void *, zero_region); liovec[i].iov_len = MIN(ZERO_REGION_SIZE, tlen); tlen -= liovec[i].iov_len; } - MPASS(tlen == ip->i_ea_len); + MPASS(tlen == 0); luio.uio_iov = liovec; luio.uio_offset = 0; @@ -1466,6 +1474,8 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td luio.uio_rw = UIO_WRITE; luio.uio_td = td; error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred); + if (error == 0 && ip->i_ea_len == 0) + truncate = true; } if (--ip->i_ea_refs == 0) { free(ip->i_ea_area, M_TEMP); @@ -1475,7 +1485,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td } ffs_unlock_ea(vp); - if (commit && error == 0 && ip->i_ea_len == 0) + if (truncate) ffs_truncate(vp, 0, IO_EXT, cred); return (error); } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:24:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C64A755659A; Thu, 4 Mar 2021 19:24: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 4Ds16258Ptz4krr; Thu, 4 Mar 2021 19:24: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 A279622A60; Thu, 4 Mar 2021 19:24: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 124JOwDF087930; Thu, 4 Mar 2021 19:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JOweT087929; Thu, 4 Mar 2021 19:24:58 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:24:58 GMT Message-Id: <202103041924.124JOweT087929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: efc5f3d45469 - stable/13 - fhlink(2): the syscalls do not take flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: efc5f3d454696625fdbd363a53df35eeb176f209 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:24:58 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=efc5f3d454696625fdbd363a53df35eeb176f209 commit efc5f3d454696625fdbd363a53df35eeb176f209 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:38:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:10:39 +0000 fhlink(2): the syscalls do not take flag (cherry picked from commit 600756afb532a86a39fb488f5c4fc7e248921655) --- lib/libc/sys/fhlink.2 | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/lib/libc/sys/fhlink.2 b/lib/libc/sys/fhlink.2 index da35d2b103e6..029ec8d7c2eb 100644 --- a/lib/libc/sys/fhlink.2 +++ b/lib/libc/sys/fhlink.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt FHLINK 2 .Os .Sh NAME @@ -95,33 +95,6 @@ the directory associated with the file descriptor .Fa tofd instead of the current working directory. .Pp -Values for -.Fa flag -are constructed by a bitwise-inclusive OR of flags from the following -list, defined in -.In fcntl.h : -.Bl -tag -width indent -.It Dv AT_SYMLINK_FOLLOW -If -.Fa fhp -names a symbolic link, a new link for the target of the symbolic link is -created. -.It Dv AT_BENEATH -Only allow to link to a file which is beneath of the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. -.It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. -See the description of the -.Dv O_RESOLVE_BENEATH -flag in the -.Xr open 2 -manual page. -.El -.Pp If .Fn fhlinkat is passed the special value From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:25:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EEC45566A0; Thu, 4 Mar 2021 19:25: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 4Ds1635Nklz4kjs; Thu, 4 Mar 2021 19:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5D1B22D93; Thu, 4 Mar 2021 19:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124JOxSZ087951; Thu, 4 Mar 2021 19:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JOxvA087949; Thu, 4 Mar 2021 19:24:59 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:24:59 GMT Message-Id: <202103041924.124JOxvA087949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6da53183f9ff - stable/13 - open(2): Remove O_BENEATH and AT_BENEATH MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6da53183f9ff77561f7653ac202be2042638fb10 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:25:00 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6da53183f9ff77561f7653ac202be2042638fb10 commit 6da53183f9ff77561f7653ac202be2042638fb10 Author: Konstantin Belousov AuthorDate: 2021-02-16 03:31:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:10:44 +0000 open(2): Remove O_BENEATH and AT_BENEATH (cherry picked from commit 20e91ca36a56b8db1e6677f577ad011b66dd6eb3) --- lib/libc/sys/access.2 | 24 +++------------ lib/libc/sys/chflags.2 | 29 +++++------------- lib/libc/sys/chmod.2 | 29 +++++------------- lib/libc/sys/chown.2 | 29 +++++------------- lib/libc/sys/getfh.2 | 37 +++++------------------ lib/libc/sys/link.2 | 28 +++++------------ lib/libc/sys/open.2 | 77 ++++++++--------------------------------------- lib/libc/sys/stat.2 | 50 +++++-------------------------- lib/libc/sys/unlink.2 | 29 +++++------------- lib/libc/sys/utimensat.2 | 29 +++++------------- sys/kern/vfs_lookup.c | 78 +++++++----------------------------------------- sys/kern/vfs_syscalls.c | 51 +++++++++++++------------------ sys/kern/vfs_vnops.c | 2 -- sys/sys/fcntl.h | 14 ++++----- sys/sys/namei.h | 5 ---- 15 files changed, 112 insertions(+), 399 deletions(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 1cd7eed1301b..13bfd7e5a88a 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt ACCESS 2 .Os .Sh NAME @@ -120,15 +120,10 @@ list, defined in The checks for accessibility are performed using the effective user and group IDs instead of the real user and group ID as required in a call to .Fn access . -.It Dv AT_BENEATH -Only operate on files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -218,17 +213,6 @@ or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn faccessat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. .El .Sh SEE ALSO .Xr chmod 2 , diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index b6b0b43249c7..a44713904599 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHFLAGS 2 .Os .Sh NAME @@ -94,16 +94,10 @@ defined in If .Fa path names a symbolic link, then the flags of the symbolic link are changed. -.It Dv AT_BENEATH -Only allow to change flags for a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -327,18 +321,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn chflagsat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 1 , diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2 index 1d66408e3891..0127a5b629e4 100644 --- a/lib/libc/sys/chmod.2 +++ b/lib/libc/sys/chmod.2 @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHMOD 2 .Os .Sh NAME @@ -101,16 +101,10 @@ in If .Fa path names a symbolic link, then the mode of the symbolic link is changed. -.It Dv AT_BENEATH -Only allow to change permissions of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -310,18 +304,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fchmodat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chmod 1 , diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2 index 64bfdeaa961c..4c45ce9174bb 100644 --- a/lib/libc/sys/chown.2 +++ b/lib/libc/sys/chown.2 @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHOWN 2 .Os .Sh NAME @@ -118,16 +118,10 @@ list, defined in If .Fa path names a symbolic link, ownership of the symbolic link is changed. -.It Dv AT_BENEATH -Only allow to change ownership of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -252,18 +246,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fchownat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chgrp 1 , diff --git a/lib/libc/sys/getfh.2 b/lib/libc/sys/getfh.2 index 5dc5896af6d8..cd3d54f54d7f 100644 --- a/lib/libc/sys/getfh.2 +++ b/lib/libc/sys/getfh.2 @@ -29,7 +29,7 @@ .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt GETFH 2 .Os .Sh NAME @@ -76,9 +76,7 @@ and .Fn lgetfh except when the .Fa path -specifies a relative path, or the -.Dv AT_BENEATH -flag is provided. +specifies a relative path. For .Fn getfhat and relative @@ -87,13 +85,6 @@ the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. -For -.Dv AT_BENEATH -and absolute -.Fa path , -the status is retrieved from a file specified by the -.Fa path , -but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -105,15 +96,10 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. -.It Dv AT_BENEATH -Only stat files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -140,19 +126,10 @@ bit is set in When .Fn getfhat is called with an absolute -.Fa path -without the -.Dv AT_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv AT_BENEATH -is specified with an absolute .Fa path , -a directory passed by the +it ignores the .Fa fd -argument is used as the topping point for the resolution. +argument. These system calls are restricted to the superuser. .Sh RETURN VALUES .Rv -std diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index c3451da10884..de0efd5e510f 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt LINK 2 .Os .Sh NAME @@ -115,15 +115,10 @@ If .Fa name1 names a symbolic link, a new link for the target of the symbolic link is created. -.It Dv AT_BENEATH -Only allow to link to a file which is beneath of the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -281,18 +276,9 @@ For example, is absolute or includes a ".." component that escapes the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fa linkat -and the absolute path -.Fa name1 -does not have its tail fully contained under the topping directory, -or the relative path -.Fa name1 -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 2 , diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index e43d012770df..e24c823d039a 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt OPEN 2 .Os .Sh NAME @@ -75,9 +75,7 @@ function is equivalent to the .Fn open function except in the case where the .Fa path -specifies a relative path, or the -.Dv O_BENEATH -flag is provided. +specifies a relative path. For .Fn openat and relative @@ -104,28 +102,10 @@ and the behavior is identical to a call to When .Fn openat is called with an absolute -.Fa path -without the -.Dv O_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv O_BENEATH -is specified with an absolute .Fa path , -a directory passed by the -.Fa fd -argument is used as the topping point for the resolution. -When -.Dv O_BENEATH -is specified with a relative path, the +it ignores the .Fa fd -argument is used both as the starting point, and as the topping point -for the resolution. -See the definition of the -.Dv O_BENEATH -flag below. +argument. .Pp In .Xr capsicum 4 @@ -137,9 +117,7 @@ The argument to .Fn openat must be strictly relative to a file descriptor -.Fa fd , -as defined in -.Pa sys/kern/vfs_lookup.c . +.Fa fd . .Fa path must not be an absolute path and must not contain ".." components which cause the path resolution to escape the directory hierarchy @@ -156,9 +134,8 @@ If the .Dv vfs.lookup_cap_dotdot .Xr sysctl 3 MIB is set to zero, ".." components in the paths, -used in capability mode, or with the -.Dv O_BENEATH -flag, are completely disabled. +used in capability mode, +are completely disabled. If the .Dv vfs.lookup_cap_dotdot_nonlocal MIB is set to zero, ".." is not allowed if found on non-local filesystem. @@ -190,8 +167,7 @@ O_TTY_INIT ignored O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open O_VERIFY verify the contents of the file -O_BENEATH require resolved path to be strictly relative to topping directory -O_RESOLVE_BENEATH require walked path to be strictly relative to topping directory +O_RESOLVE_BENEATH path resolution must not cross the fd directory .Ed .Pp Opening a file with @@ -319,32 +295,12 @@ means is implementation specific. The run-time linker (rtld) uses this flag to ensure shared objects have been verified before operating on them. .Pp -.Dv O_BENEATH -returns -.Er ENOTCAPABLE -if the specified path, after resolving all symlinks and ".." -references, does not end up with tail residing in the directory hierarchy of -children beneath the topping directory. -Topping directory is the process current directory if relative -.Fa path -is used for -.Fn open , -and the directory referenced by the -.Fa fd -argument when using -.Fn openat . -.Dv O_BENEATH -allows arbitrary prefix that ends up at the topping directory, -after which all further resolved components must be under it. -.Pp .Dv O_RESOLVE_BENEATH returns .Er ENOTCAPABLE if any intermediate component of the specified relative path does not -reside in the directory hierarchy beneath the topping directory. -Comparing to -.Dv O_BENEATH , -absolute paths or even the temporal escape from beneath of the topping +reside in the directory hierarchy beneath the starting directory. +Absolute paths or even the temporal escape from beneath of the starting directory is not allowed. .Pp When @@ -601,19 +557,12 @@ directory outside of the directory hierarchy specified by and the process is in capability mode. .It Bq Er ENOTCAPABLE The -.Dv O_BENEATH -flag was provided, and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. -.It Bq Er ENOTCAPABLE -The .Dv O_RESOLVE_BENEATH flag was provided, and the relative .Fa path -escapes topping directory. +escapes the +.Ar fd +directory. .El .Sh SEE ALSO .Xr chmod 2 , diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2 index 4759d297e8da..0ed70620af63 100644 --- a/lib/libc/sys/stat.2 +++ b/lib/libc/sys/stat.2 @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt STAT 2 .Os .Sh NAME @@ -84,9 +84,7 @@ and .Fn lstat except when the .Fa path -specifies a relative path, or the -.Dv AT_BENEATH -flag is provided. +specifies a relative path. For .Fn fstatat and relative @@ -95,13 +93,6 @@ the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. -For -.Dv AT_BENEATH -and absolute -.Fa path , -the status is retrieved from a file specified by the -.Fa path , -but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -113,15 +104,8 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. -.It Dv AT_BENEATH -Only stat files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the starting directory. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -148,19 +132,10 @@ bit is set in When .Fn fstatat is called with an absolute -.Fa path -without the -.Dv AT_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv AT_BENEATH -is specified with an absolute .Fa path , -a directory passed by the +it ignores the .Fa fd -argument is used as the topping point for the resolution. +argument. .Pp The .Fa sb @@ -459,18 +434,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fstatat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr access 2 , diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2 index 838d4da68af2..11fff875abad 100644 --- a/lib/libc/sys/unlink.2 +++ b/lib/libc/sys/unlink.2 @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt UNLINK 2 .Os .Sh NAME @@ -92,16 +92,10 @@ Remove the directory entry specified by and .Fa path as a directory, not a normal file. -.It Dv AT_BENEATH -Only unlink files and directories which are beneath of the topping -directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -246,18 +240,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn unlinkat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Pp In addition to the errors returned by diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2 index 3016d1af72aa..d31ee1f1515a 100644 --- a/lib/libc/sys/utimensat.2 +++ b/lib/libc/sys/utimensat.2 @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -146,16 +146,10 @@ names a symbolic link, the symbolic link's times are changed. By default, .Fn utimensat changes the times of the file referenced by the symbolic link. -.It Dv AT_BENEATH -Only allow to change the times of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -290,18 +284,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn utimensat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 2 , diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index ad65ab11bb1d..4ddd7b63ce5c 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -182,13 +182,6 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; cnp = &ndp->ni_cnd; - if ((cnp->cn_flags & BENEATH) != 0 && - (ndp->ni_lcf & NI_LCF_BENEATH_LATCHED) == 0) { - MPASS((ndp->ni_lcf & NI_LCF_LATCH) != 0); - if (dp != ndp->ni_beneath_latch) - return; - ndp->ni_lcf |= NI_LCF_BENEATH_LATCHED; - } nt = malloc(sizeof(*nt), M_NAMEITRACKER, M_WAITOK); vhold(dp); nt->dp = dp; @@ -196,7 +189,7 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) } static void -nameicap_cleanup(struct nameidata *ndp, bool clean_latch) +nameicap_cleanup(struct nameidata *ndp) { struct nameicap_tracker *nt, *nt1; @@ -207,10 +200,6 @@ nameicap_cleanup(struct nameidata *ndp, bool clean_latch) vdrop(nt->dp); free(nt, M_NAMEITRACKER); } - if (clean_latch && (ndp->ni_lcf & NI_LCF_LATCH) != 0) { - ndp->ni_lcf &= ~NI_LCF_LATCH; - vrele(ndp->ni_beneath_latch); - } } /* @@ -230,21 +219,17 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) struct nameicap_tracker *nt; struct mount *mp; - if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp == NULL || - dp->v_type != VDIR) + if (dp == NULL || dp->v_type != VDIR || (ndp->ni_lcf & + NI_LCF_STRICTRELATIVE) == 0) return (0); + if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0) + return (ENOTCAPABLE); mp = dp->v_mount; if (lookup_cap_dotdot_nonlocal == 0 && mp != NULL && (mp->mnt_flag & MNT_LOCAL) == 0) return (ENOTCAPABLE); TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { - if ((ndp->ni_lcf & NI_LCF_LATCH) != 0 && - ndp->ni_beneath_latch == nt->dp) { - ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; - nameicap_cleanup(ndp, false); - return (0); - } if (dp == nt->dp) return (0); } @@ -275,11 +260,6 @@ namei_handle_root(struct nameidata *ndp, struct vnode **dpp) #endif return (ENOTCAPABLE); } - if ((cnp->cn_flags & BENEATH) != 0) { - ndp->ni_lcf |= NI_LCF_BENEATH_ABS; - ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; - nameicap_cleanup(ndp, false); - } while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; @@ -297,7 +277,6 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) struct thread *td; struct pwd *pwd; cap_rights_t rights; - struct filecaps dirfd_caps; int error; bool startdir_used; @@ -410,26 +389,8 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) if (error == 0 && (*dpp)->v_type != VDIR) error = ENOTDIR; } - if (error == 0 && (cnp->cn_flags & BENEATH) != 0) { - if (ndp->ni_dirfd == AT_FDCWD) { - ndp->ni_beneath_latch = pwd->pwd_cdir; - vrefact(ndp->ni_beneath_latch); - } else { - rights = *ndp->ni_rightsneeded; - cap_rights_set_one(&rights, CAP_LOOKUP); - error = fgetvp_rights(td, ndp->ni_dirfd, &rights, - &dirfd_caps, &ndp->ni_beneath_latch); - if (error == 0 && (*dpp)->v_type != VDIR) { - vrele(ndp->ni_beneath_latch); - error = ENOTDIR; - } - } - if (error == 0) - ndp->ni_lcf |= NI_LCF_LATCH; - } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { - if (cnp->cn_pnbuf[0] == '/' || - (ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) { + if (cnp->cn_pnbuf[0] == '/') { error = EINVAL; } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | @@ -452,12 +413,8 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) pwd_drop(pwd); return (error); } - MPASS((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_LATCH)) != - NI_LCF_BENEATH_ABS); - if (((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && - lookup_cap_dotdot != 0) || - ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0 && - (cnp->cn_flags & BENEATH) != 0)) + if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && + lookup_cap_dotdot != 0) ndp->ni_lcf |= NI_LCF_CAP_DOTDOT; SDT_PROBE4(vfs, namei, lookup, entry, *dpp, cnp->cn_pnbuf, cnp->cn_flags, false); @@ -636,16 +593,8 @@ namei(struct nameidata *ndp) for (;;) { ndp->ni_startdir = dp; error = lookup(ndp); - if (error != 0) { - /* - * Override an error to not allow user to use - * BENEATH as an oracle. - */ - if ((ndp->ni_lcf & (NI_LCF_LATCH | - NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) - error = ENOTCAPABLE; + if (error != 0) goto out; - } /* * If not a symbolic link, we're done. @@ -657,12 +606,7 @@ namei(struct nameidata *ndp) namei_cleanup_cnp(cnp); } else cnp->cn_flags |= HASBUF; - if ((ndp->ni_lcf & (NI_LCF_LATCH | - NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) { - NDFREE(ndp, 0); - error = ENOTCAPABLE; - } - nameicap_cleanup(ndp, true); + nameicap_cleanup(ndp); pwd_drop(pwd); if (error == 0) NDVALIDATE(ndp); @@ -739,7 +683,7 @@ out: MPASS(error != 0); SDT_PROBE4(vfs, namei, lookup, return, error, NULL, false, ndp); namei_cleanup_cnp(cnp); - nameicap_cleanup(ndp, true); + nameicap_cleanup(ndp); pwd_drop(pwd); return (error); } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index a51d693446e3..52604d3da829 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -120,8 +120,6 @@ at2cnpflags(u_int at_flags, u_int mask) res = 0; at_flags &= mask; - if ((at_flags & AT_BENEATH) != 0) - res |= BENEATH; if ((at_flags & AT_RESOLVE_BENEATH) != 0) res |= RBENEATH; if ((at_flags & AT_SYMLINK_FOLLOW) != 0) @@ -1500,12 +1498,11 @@ sys_linkat(struct thread *td, struct linkat_args *uap) int flag; flag = uap->flag; - if ((flag & ~(AT_SYMLINK_FOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2, - UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_BENEATH | + UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH))); } @@ -1875,7 +1872,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | - at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH), + at2cnpflags(flag, AT_RESOLVE_BENEATH), pathseg, path, dfd, &cap_unlinkat_rights, td); if ((error = namei(&nd)) != 0) { if (error == EINVAL) @@ -2080,7 +2077,7 @@ kern_accessat(struct thread *td, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_EACCESS | AT_BENEATH | AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_EACCESS | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) return (EINVAL); @@ -2101,7 +2098,7 @@ kern_accessat(struct thread *td, int fd, const char *path, usecred = cred; AUDIT_ARG_VALUE(amode); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1 | at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH), + AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH), pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) goto out; @@ -2392,13 +2389,12 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); - NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_BENEATH | - AT_RESOLVE_BENEATH | AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_RESOLVE_BENEATH | + AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, + pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) return (error); @@ -2716,8 +2712,7 @@ int sys_chflagsat(struct thread *td, struct chflagsat_args *uap) { - if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); return (kern_chflagsat(td, uap->fd, uap->path, UIO_USERSPACE, @@ -2750,7 +2745,7 @@ kern_chflagsat(struct thread *td, int fd, const char *path, *** 167 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:25:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 462A3556707; Thu, 4 Mar 2021 19:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds1675c0Hz4kd7; Thu, 4 Mar 2021 19:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DC1822AB9; Thu, 4 Mar 2021 19:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124JP1RB087998; Thu, 4 Mar 2021 19:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JP18S087997; Thu, 4 Mar 2021 19:25:01 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:25:01 GMT Message-Id: <202103041925.124JP18S087997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 11c6aa5c504d - stable/13 - nameicap_tracker_add: avoid duplicates in the tracker list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11c6aa5c504d76e50dcd9481020c0f350ce0bb00 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:25:06 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=11c6aa5c504d76e50dcd9481020c0f350ce0bb00 commit 11c6aa5c504d76e50dcd9481020c0f350ce0bb00 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:13:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:11:00 +0000 nameicap_tracker_add: avoid duplicates in the tracker list (cherry picked from commit 2388ad7c293fbc89ee239a1adcb87fd158c4e8e9) --- sys/kern/vfs_lookup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 73290e8da05f..cdd4a914239f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -182,6 +182,9 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; cnp = &ndp->ni_cnd; + nt = TAILQ_LAST(&ndp->ni_cap_tracker, nameicap_tracker_head); + if (nt != NULL && nt->dp == dp) + return; nt = malloc(sizeof(*nt), M_NAMEITRACKER, M_WAITOK); vhold(dp); nt->dp = dp; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:25:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1919255670B; Thu, 4 Mar 2021 19:25: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 4Ds1692TMPz4kdC; Thu, 4 Mar 2021 19:25: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 3112D22A62; Thu, 4 Mar 2021 19:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124JP2JR088020; Thu, 4 Mar 2021 19:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JP2X7088019; Thu, 4 Mar 2021 19:25:02 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:25:02 GMT Message-Id: <202103041925.124JP2X7088019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 68230041eb29 - stable/13 - Add nameicap_cleanup_from(), to clean tracker list starting from some element MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 68230041eb292f26132c73de9369e695ab6ada6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:25:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=68230041eb292f26132c73de9369e695ab6ada6e commit 68230041eb292f26132c73de9369e695ab6ada6e Author: Konstantin Belousov AuthorDate: 2021-02-28 00:14:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:11:05 +0000 Add nameicap_cleanup_from(), to clean tracker list starting from some element (cherry picked from commit e8a2862aa0384c75603f801625e309a3dae0ed05) --- sys/kern/vfs_lookup.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index cdd4a914239f..abc01c73e24c 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -192,19 +192,26 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) } static void -nameicap_cleanup(struct nameidata *ndp) +nameicap_cleanup_from(struct nameidata *ndp, struct nameicap_tracker *first) { struct nameicap_tracker *nt, *nt1; - KASSERT(TAILQ_EMPTY(&ndp->ni_cap_tracker) || - (ndp->ni_lcf & NI_LCF_CAP_DOTDOT) != 0, ("not strictrelative")); - TAILQ_FOREACH_SAFE(nt, &ndp->ni_cap_tracker, nm_link, nt1) { + nt = first; + TAILQ_FOREACH_FROM_SAFE(nt, &ndp->ni_cap_tracker, nm_link, nt1) { TAILQ_REMOVE(&ndp->ni_cap_tracker, nt, nm_link); vdrop(nt->dp); free(nt, M_NAMEITRACKER); } } +static void +nameicap_cleanup(struct nameidata *ndp) +{ + KASSERT(TAILQ_EMPTY(&ndp->ni_cap_tracker) || + (ndp->ni_lcf & NI_LCF_CAP_DOTDOT) != 0, ("not strictrelative")); + nameicap_cleanup_from(ndp, NULL); +} + /* * For dotdot lookups in capability mode, only allow the component * lookup to succeed if the resulting directory was already traversed From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:25:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BA17556077; Thu, 4 Mar 2021 19:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds16611Tvz4ks5; Thu, 4 Mar 2021 19:25: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 D7EAD22A61; Thu, 4 Mar 2021 19:25: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 124JP0ZM087976; Thu, 4 Mar 2021 19:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JP0R0087975; Thu, 4 Mar 2021 19:25:00 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:25:00 GMT Message-Id: <202103041925.124JP0R0087975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7a1e21f194e4 - stable/13 - Do not call nameicap_tracker_add() for dotdot case. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7a1e21f194e44d57f4d89012b5d7dd61668d7da8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:25:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7a1e21f194e44d57f4d89012b5d7dd61668d7da8 commit 7a1e21f194e44d57f4d89012b5d7dd61668d7da8 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:12:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:10:55 +0000 Do not call nameicap_tracker_add() for dotdot case. (cherry picked from commit 59e749428111c029116a4302a544c7cc18b33772) --- sys/kern/vfs_lookup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 4ddd7b63ce5c..73290e8da05f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1258,7 +1258,8 @@ success: } } if (ndp->ni_vp != NULL) { - nameicap_tracker_add(ndp, ndp->ni_vp); + if ((cnp->cn_flags & ISDOTDOT) == 0) + nameicap_tracker_add(ndp, ndp->ni_vp); if ((cnp->cn_flags & (FAILIFEXISTS | ISSYMLINK)) == FAILIFEXISTS) goto bad_eexist; } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:25:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F717556718; Thu, 4 Mar 2021 19:25: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 4Ds16C21t5z4kqb; Thu, 4 Mar 2021 19:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3996722C29; Thu, 4 Mar 2021 19:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124JP4S8088038; Thu, 4 Mar 2021 19:25:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JP4kP088037; Thu, 4 Mar 2021 19:25:04 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:25:04 GMT Message-Id: <202103041925.124JP4kP088037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: af188c01b303 - stable/13 - nameicap_check_dotdot: trim tracker on check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af188c01b303f0f13cd3835d5c6a2fa8aecdb9bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:25:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=af188c01b303f0f13cd3835d5c6a2fa8aecdb9bb commit af188c01b303f0f13cd3835d5c6a2fa8aecdb9bb Author: Konstantin Belousov AuthorDate: 2021-02-28 00:15:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:11:09 +0000 nameicap_check_dotdot: trim tracker on check (cherry picked from commit 49c98a4bf3a87ace0df99056fa683805c1645e61) --- sys/kern/vfs_lookup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index abc01c73e24c..b4280f85c5b6 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -240,8 +240,12 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) return (ENOTCAPABLE); TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { - if (dp == nt->dp) + if (dp == nt->dp) { + nt = TAILQ_NEXT(nt, nm_link); + if (nt != NULL) + nameicap_cleanup_from(ndp, nt); return (0); + } } return (ENOTCAPABLE); } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:25:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22A49556780; Thu, 4 Mar 2021 19:25: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 4Ds16D229Bz4kxm; Thu, 4 Mar 2021 19:25: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 4DF6A22E01; Thu, 4 Mar 2021 19:25: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 124JP5Os088060; Thu, 4 Mar 2021 19:25:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JP5Ws088059; Thu, 4 Mar 2021 19:25:05 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:25:05 GMT Message-Id: <202103041925.124JP5Ws088059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e8b0f76b6130 - stable/13 - O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e8b0f76b613033298b07570391b5885346f358d7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:25:10 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e8b0f76b613033298b07570391b5885346f358d7 commit e8b0f76b613033298b07570391b5885346f358d7 Author: Konstantin Belousov AuthorDate: 2021-02-28 23:59:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 19:11:15 +0000 O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path (cherry picked from commit 28cd3a673e0e32b009fd573764956b280d1affe1) --- sys/kern/vfs_lookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b4280f85c5b6..e881e8f909a4 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -405,7 +405,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { if (cnp->cn_pnbuf[0] == '/') { - error = EINVAL; + error = ENOTCAPABLE; } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | NI_LCF_CAP_DOTDOT; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:29:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 116CF556B53; Thu, 4 Mar 2021 19:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds1Bq018gz4ljm; Thu, 4 Mar 2021 19:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E784022BFA; Thu, 4 Mar 2021 19:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124JT6EZ088794; Thu, 4 Mar 2021 19:29:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JT6oD088793; Thu, 4 Mar 2021 19:29:06 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:29:06 GMT Message-Id: <202103041929.124JT6oD088793@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: 466df976babe - main - jail(8): reset to root cpuset before attaching to run commands 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: 466df976babed65f8a8de9e36d7f016a444609af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:29:07 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=466df976babed65f8a8de9e36d7f016a444609af commit 466df976babed65f8a8de9e36d7f016a444609af Author: Kyle Evans AuthorDate: 2021-03-04 19:28:53 +0000 Commit: Kyle Evans CommitDate: 2021-03-04 19:28:53 +0000 jail(8): reset to root cpuset before attaching to run commands Recent changes have made it such that attaching to a jail will augment the attaching process' cpu mask with the jail's cpuset. While this is convenient for allowing the administrator to cpuset arbitrary programs that will attach to a jail, this is decidedly not convenient for executing long-running daemons during jail creation. This change inserts a reset of the process cpuset to the root cpuset between the fork and attach to execute a command. This allows commands executed to have the widest mask possible, and the administrator can cpuset(1) it back down inside the jail as needed. With this applied, one should be able to change a jail's cpuset at exec.poststart in addition to exec.created. The former was made difficult if jail(8) itself was running with a constrained set, as then some processes may have been spawned inside the jail with a non-root set. The latter is the preferred option so that processes starting in the jail are constrained appropriately up front. Note that all system commands are still run with the process' initial cpuset applied. PR: 253724 MFC after: 3 days Reviewed by: jamie Differential Revision: https://reviews.freebsd.org/D29008 --- usr.sbin/jail/command.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index a5c1839849fd..c1d418d6cc69 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -84,6 +85,20 @@ static struct cfstring dummystring = { .len = 1 }; static struct phhead phash[PHASH_SIZE]; static int kq; +static cpusetid_t +root_cpuset_id(void) +{ + static cpusetid_t setid = CPUSET_INVALID; + static int error; + + /* Only try to get the cpuset once. */ + if (error == 0 && setid == CPUSET_INVALID) + error = cpuset_getid(CPU_LEVEL_ROOT, CPU_WHICH_PID, -1, &setid); + if (error != 0) + return (CPUSET_INVALID); + return (setid); +} + /* * Run the next command associated with a jail. */ @@ -283,6 +298,7 @@ run_command(struct cfjail *j) enum intparam comparam; size_t comlen; pid_t pid; + cpusetid_t setid; int argc, bg, clean, consfd, down, fib, i, injail, sjuser, timeout; #if defined(INET) || defined(INET6) char *addr, *extrap, *p, *val; @@ -632,6 +648,10 @@ run_command(struct cfjail *j) injail = comparam == IP_EXEC_START || comparam == IP_COMMAND || comparam == IP_EXEC_STOP; + if (injail) + setid = root_cpuset_id(); + else + setid = CPUSET_INVALID; clean = bool_param(j->intparams[IP_EXEC_CLEAN]); username = string_param(j->intparams[injail ? IP_EXEC_JAIL_USER : IP_EXEC_SYSTEM_USER]); @@ -700,6 +720,19 @@ run_command(struct cfjail *j) jail_warnx(j, "setfib: %s", strerror(errno)); exit(1); } + + /* + * We wouldn't have specialized our affinity, so just setid to + * root. We do this prior to attaching to avoid the kernel + * having to create a transient cpuset that we'll promptly + * free up with a reset to the jail's cpuset. + * + * This is just a best-effort to use as wide of mask as + * possible. + */ + if (setid != CPUSET_INVALID) + (void)cpuset_setid(CPU_WHICH_PID, -1, setid); + if (jail_attach(j->jid) < 0) { jail_warnx(j, "jail_attach: %s", strerror(errno)); exit(1); From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:57:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D85F0557AD4; Thu, 4 Mar 2021 19:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds1q45F94z4pJG; Thu, 4 Mar 2021 19:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A59872336F; Thu, 4 Mar 2021 19:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124Jv4mt027842; Thu, 4 Mar 2021 19:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Jv4kR027841; Thu, 4 Mar 2021 19:57:04 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:57:04 GMT Message-Id: <202103041957.124Jv4kR027841@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: f19323847ca8 - main - pf: Retrieve DSCP value from the IPv6 header 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: f19323847ca894af8a58839f6a2a41691a8e2245 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:57:05 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f19323847ca894af8a58839f6a2a41691a8e2245 commit f19323847ca894af8a58839f6a2a41691a8e2245 Author: Kristof Provost AuthorDate: 2021-03-03 20:33:42 +0000 Commit: Kristof Provost CommitDate: 2021-03-04 19:56:48 +0000 pf: Retrieve DSCP value from the IPv6 header Teach pf to read the DSCP value from the IPv6 header so that we can match on them. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29048 --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 86354e69d11f..f71f89187b58 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6384,7 +6384,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb pd.sidx = (dir == PF_IN) ? 0 : 1; pd.didx = (dir == PF_IN) ? 1 : 0; pd.af = AF_INET6; - pd.tos = 0; + pd.tos = (ntohl(h->ip6_flow) >> 20) & 0xfc; pd.tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr); off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr); From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:57:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5576F557D17; Thu, 4 Mar 2021 19:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds1q570zSz4pJP; Thu, 4 Mar 2021 19:57: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 D942D23262; Thu, 4 Mar 2021 19:57: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 124Jv5dZ027865; Thu, 4 Mar 2021 19:57:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124Jv5FZ027864; Thu, 4 Mar 2021 19:57:05 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:57:05 GMT Message-Id: <202103041957.124Jv5FZ027864@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: bb4a7d94b99f - main - net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros 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: bb4a7d94b99fbf7f59c876ffff8ded5f6a5b5c3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:57:06 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=bb4a7d94b99fbf7f59c876ffff8ded5f6a5b5c3e commit bb4a7d94b99fbf7f59c876ffff8ded5f6a5b5c3e Author: Kristof Provost AuthorDate: 2021-03-04 10:26:40 +0000 Commit: Kristof Provost CommitDate: 2021-03-04 19:56:48 +0000 net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros Introduce convenience macros to retrieve the DSCP, ECN or traffic class bits from an IPv6 header. Use them where appropriate. Reviewed by: ae (previous version), rscheff, tuexen, rgrimes MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29056 --- sys/net/altq/altq_subr.c | 2 +- sys/net/if_stf.c | 4 ++-- sys/netinet/ip6.h | 4 ++++ sys/netinet/tcp_input.c | 2 +- sys/netinet/tcp_lro.c | 2 +- sys/netinet/tcp_stacks/rack_bbr_common.c | 2 +- sys/netinet6/frag6.c | 5 ++--- sys/netinet6/in6_gif.c | 2 +- sys/netinet6/ip6_output.c | 4 ++-- sys/netinet6/sctp6_usrreq.c | 2 +- sys/netpfil/pf/pf.c | 2 +- 11 files changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index 14d9916011da..39f91c4daf63 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -1087,7 +1087,7 @@ altq_extractflow(m, af, flow, filt_bmask) fin6->fi6_family = AF_INET6; fin6->fi6_proto = ip6->ip6_nxt; - fin6->fi6_tclass = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + fin6->fi6_tclass = IPV6_TRAFFIC_CLASS(ip6); fin6->fi6_flowlabel = ip6->ip6_flow & htonl(0x000fffff); fin6->fi6_src = ip6->ip6_src; diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index c3f26db3f6e6..40f8a6f3a30a 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -455,7 +455,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, } } ip6 = mtod(m, struct ip6_hdr *); - tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + tos = IPV6_TRAFFIC_CLASS(ip6); /* * Pickup the right outer dst addr from the list of candidates. @@ -665,7 +665,7 @@ in_stf_input(struct mbuf *m, int off, int proto, void *arg) return (IPPROTO_DONE); } - itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + itos = IPV6_TRAFFIC_CLASS(ip6); if ((ifp->if_flags & IFF_LINK1) != 0) ip_ecn_egress(ECN_ALLOWED, &otos, &itos); else diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index 44c46fd3b71d..1bc79a98e689 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -106,6 +106,10 @@ struct ip6_hdr { #endif #define IPV6_FLOWLABEL_LEN 20 +#define IPV6_TRAFFIC_CLASS(ip6) ((ntohl((ip6)->ip6_flow) >> 20) & 0xff) +#define IPV6_DSCP(ip6) ((ntohl((ip6)->ip6_flow) >> 20) & 0xfc) +#define IPV6_ECN(ip6) ((ntohl((ip6)->ip6_flow) >> 20) & 0x03) + /* * Extension Headers */ diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index eda41d36ab88..89e70df48774 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -688,7 +688,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) /* XXX stat */ goto drop; } - iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + iptos = IPV6_TRAFFIC_CLASS(ip6); } #endif #if defined(INET) && defined(INET6) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index b4d64b8a6893..62f6ad57c0f5 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -1546,7 +1546,7 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, int use_hash) return (error); tcp_data_len = ntohs(ip6->ip6_plen); #ifdef TCPHPTS - iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + iptos = IPV6_TRAFFIC_CLASS(ip6); #endif ip_len = sizeof(*ip6) + tcp_data_len; break; diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index e73a3e60fd64..b86a5d85fc76 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -334,7 +334,7 @@ skip_vnet: m_freem(m); goto skipped_pkt; } - iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + iptos = IPV6_TRAFFIC_CLASS(ip6); break; } #endif diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index f227930743b7..1903b01e03d4 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -554,8 +554,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) q6->ip6q_ttl = IPV6_FRAGTTL; q6->ip6q_src = ip6->ip6_src; q6->ip6q_dst = ip6->ip6_dst; - q6->ip6q_ecn = - (ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK; + q6->ip6q_ecn = IPV6_ECN(ip6); q6->ip6q_unfrglen = -1; /* The 1st fragment has not arrived. */ /* Add the fragemented packet to the bucket. */ @@ -688,7 +687,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) * if CE is set, do not lose CE. * Drop if CE and not-ECT are mixed for the same packet. */ - ecn = (ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK; + ecn = IPV6_ECN(ip6); ecn0 = q6->ip6q_ecn; if (ecn == IPTOS_ECN_CE) { if (ecn0 == IPTOS_ECN_NOTECT) { diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 33cc06d065b8..54cb81c6130f 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -344,7 +344,7 @@ in6_gif_input(struct mbuf *m, int off, int proto, void *arg) gifp = GIF2IFP(sc); if ((gifp->if_flags & IFF_UP) != 0) { ip6 = mtod(m, struct ip6_hdr *); - ecn = (ntohl(ip6->ip6_flow) >> 20) & 0xff; + ecn = IPV6_TRAFFIC_CLASS(ip6); m_adj(m, off); gif_input(m, gifp, proto, ecn); } else { diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 58334788b05b..2b49a9f7c351 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -656,9 +656,9 @@ again: if (opt && opt->ip6po_tclass >= 0) { int mask = 0; - if ((ip6->ip6_flow & htonl(0xfc << 20)) == 0) + if (IPV6_DSCP(ip6) == 0) mask |= 0xfc; - if ((ip6->ip6_flow & htonl(0x03 << 20)) == 0) + if (IPV6_ECN(ip6) == 0) mask |= 0x03; if (mask != 0) ip6->ip6_flow |= htonl((opt->ip6po_tclass & mask) << 20); diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index b544d2975c6a..fcf15e4f81bf 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -141,7 +141,7 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, uint16_t port) if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { goto out; } - ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); + ecn_bits = IPV6_TRAFFIC_CLASS(ip6); if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); compute_crc = 0; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f71f89187b58..c131f810b0ec 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6384,7 +6384,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb pd.sidx = (dir == PF_IN) ? 0 : 1; pd.didx = (dir == PF_IN) ? 1 : 0; pd.af = AF_INET6; - pd.tos = (ntohl(h->ip6_flow) >> 20) & 0xfc; + pd.tos = IPV6_DSCP(h); pd.tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr); off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr); From owner-dev-commits-src-all@freebsd.org Thu Mar 4 19:58:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C458D557DF7; Thu, 4 Mar 2021 19:58: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 4Ds1rq53wqz4phT; Thu, 4 Mar 2021 19:58: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 A0A842337F; Thu, 4 Mar 2021 19:58: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 124JwZN2028193; Thu, 4 Mar 2021 19:58:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124JwZIT028192; Thu, 4 Mar 2021 19:58:35 GMT (envelope-from git) Date: Thu, 4 Mar 2021 19:58:35 GMT Message-Id: <202103041958.124JwZIT028192@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: 448732b8e2d9 - main - altq: Increase maximum number of CBQ and HFSC classes 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: 448732b8e2d9bf4e2656a2e5a9e88cc58b88d4f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:58:35 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=448732b8e2d9bf4e2656a2e5a9e88cc58b88d4f4 commit 448732b8e2d9bf4e2656a2e5a9e88cc58b88d4f4 Author: Kristof Provost AuthorDate: 2021-03-03 10:06:49 +0000 Commit: Kristof Provost CommitDate: 2021-03-04 19:58:22 +0000 altq: Increase maximum number of CBQ and HFSC classes In some configurations we need more classes than ALTQ supports by default. Increase the maximum number of classes we allow. This will only cost us a comparatively trivial amount of memory, so there's little reason not to do so. If ever we find we want even more we may want to consider turning these defines into a tunable, but for now do the easy thing. Reviewed by: donner@ MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29034 --- sys/net/altq/altq_cbq.h | 2 +- sys/net/altq/altq_hfsc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/altq/altq_cbq.h b/sys/net/altq/altq_cbq.h index a319edb72e97..70c07c11d86d 100644 --- a/sys/net/altq/altq_cbq.h +++ b/sys/net/altq/altq_cbq.h @@ -119,7 +119,7 @@ typedef struct _cbq_class_stats_ { #define CBQ_TIMEOUT 10 #define CBQ_LS_TIMEOUT (20 * hz / 1000) -#define CBQ_MAX_CLASSES 256 +#define CBQ_MAX_CLASSES 2048 /* * Define State structures. diff --git a/sys/net/altq/altq_hfsc.h b/sys/net/altq/altq_hfsc.h index 9a4f14ae8fdc..6a3f2205c972 100644 --- a/sys/net/altq/altq_hfsc.h +++ b/sys/net/altq/altq_hfsc.h @@ -60,7 +60,7 @@ struct service_curve_v1 { /* special class handles */ #define HFSC_NULLCLASS_HANDLE 0 -#define HFSC_MAX_CLASSES 64 +#define HFSC_MAX_CLASSES 2048 /* hfsc class flags */ #define HFCF_RED 0x0001 /* use RED */ From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:05:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76353557E7B; Thu, 4 Mar 2021 20:05:44 +0000 (UTC) (envelope-from nwhitehorn@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 4Ds2142sPfz4q3S; Thu, 4 Mar 2021 20:05:44 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:5d1e:c500:751e:7e8c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0B3D25B6; Thu, 4 Mar 2021 20:05:44 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) To: Warner Losh Cc: Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103031253.123CrxKG051357@gndrsh.dnsmgr.net> <14d09680-1036-4a7e-8a0e-c3063cac8bc9@www.fastmail.com> <6e52fee6-a2fd-584f-757e-e77a8f8ea8eb@freebsd.org> <91a51b75-9872-d202-53c0-fa1a21dc9cb3@freebsd.org> From: Nathan Whitehorn Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. Message-ID: <5c413c07-ad22-01e1-ee45-35fbc04a4875@freebsd.org> Date: Thu, 4 Mar 2021 15:05:43 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:05:44 -0000 On 3/3/21 5:25 PM, Warner Losh wrote: > > > On Wed, Mar 3, 2021 at 10:21 AM Nathan Whitehorn=20 > > wrote: > > > > On 3/3/21 11:53 AM, Warner Losh wrote: > > > > [clipping non-technical pre-history] > > > Thanks. re-reading it now, I think I was more grumpy than warranted.=20 > And for that I apologize. Thanks for omitting it from the rest of the=20 > thread. No worries, this happens, especially with the pandemic. I know I've=20 definitely been more prickly this year than normal... > > > >=C2=A0 =C2=A0 =C2=A0The installer *does* mount the partition in ad= vance, so checking > >=C2=A0 =C2=A0 =C2=A0whether > >=C2=A0 =C2=A0 =C2=A0there is a mounted file system is a perfectly = reasonable test to > >=C2=A0 =C2=A0 =C2=A0do. We > >=C2=A0 =C2=A0 =C2=A0could also check fstab. I would like to unders= tand what is > actually > >=C2=A0 =C2=A0 =C2=A0wrong here first, though. Especially after thi= s misfire -- > which is > >=C2=A0 =C2=A0 =C2=A0problematic for reasons that are still not cle= ar to me, since > >=C2=A0 =C2=A0 =C2=A0there are > >=C2=A0 =C2=A0 =C2=A0a number of standard directories in hier(7) no= t in mtree -- > I want to > >=C2=A0 =C2=A0 =C2=A0make sure we actually do have consensus about = what is > changing and > >=C2=A0 =C2=A0 =C2=A0why. > > > > > > At the top level, we default to having directories in mtree unles= s > > there's a good reason not to. We disagree as to whether the > installer > > should take the presence or absence of the directory as a strong > > enough reason to do something. I don't think that's a good reason= =2E > > > > But leaving that aside, let's say we=C2=A0wanted to reuse the ins= tall > boot > > part of the installer to update boot blocks as part of > installworld. > > If we can talk through that example w/o it in mtree, then we can > leave > > it out. The last time I worked through this, though, I thought I'= d > > talked myself into needing it. > > > Looking at bootconfig, we could use machdep.bootmethod to > determine if > > we need to update the ESP. If we didn't use that, then the ESP > > shouldn't be touched. This is, at the moment, x86 centric, but > could > > trivially be added to architectures (I'm happy to add it). This > would > > prevent the 'false positive' that's possible in cases where we've= > > installed UEFI then downgraded to BIOS because of some problem > (though > > purely in the context of the installer, I guess this isn't an > issue). > > Even with your approach, we'd bogusly update an ESP (though one > could > > argue you might want that). We could also change the code so that= > > 'unsupported' architectures just didn't update. This is why I thi= nk > > it's a bit fragile to rely only on the directory being present. I= t > > should have something mounted there. If you wanted to mkfs_dos=C2= =A0+ > mkdir > > efi at the top level, you could check for that directory if you > were > > looking for a flag, though that would still update on a BIOS > boot the > > ESP, and prevent false positives if run as part of an update. > > I think we would *want* to update an ESP that is mounted but not > currently being used. If I set up a dual BIOS/EFI-boot system for > some > reason and happened to install an update while booted from BIOS, I > would > be deeply astonished if my configured-by-the-installer EFI bootload= er > did not also get updated. > > > Yea, it's unclear to me what POLA here is, to be honest. Some of that=20 > is driven by a deep desire not to accidentally update USB drives that=20 > have a bootable image on them as well, so that may overly color my=20 > thinking. Agreed on all counts here. > (As an aside, I would also much rather the installer use an update > utility to set up the ESP than have the update utility use the > installer.) > > > Agreed. We can work towards that after the release. It would be better = > if we could accumulate the scripts from a number of different places,=20 > find a good way to make them callable from those places more easily=20 > and start to move that tribal knowledge back into the base system=20 > where it belongs, imho. Baptiste raised an important point years ago=20 > that we also need to think about doing that with a way to 'plug in'=20 > $NEWEST_CLOUD's packages, containers, layout such that they could=20 > provide the details and then the automation would just work with them=20 > too: image building, release customization, boot block update, etc. > > So here's a proposal, now that everyone is in the CC list: > - We add /boot/efi back to mtree, even though I find it kind of > weird to > have it there I think we're too close to the release to have a > conclusion on this. > - We have the installer check for either the ESP directory being an= > active mountpoint or being in the in-progress fstab, whichever is > easiest to implement (they are equivalent for the installer). > > > I'm OK with both of these points. If others are opposed to the first=20 > one, I'm willing to see how people react to it in the upgrade path=20 > before changing it again. We should get closure on Ed's proposed=20 > change here. I think it's good and should go in right after your=20 > changes. I'd start on your changes, and give people until the morning=20 > to pipe up with any objections. Here's a patch to do this: https://reviews.freebsd.org/D29068 It takes several hours to do the full test of building world, building=20 release ISOs, and running them through qemu, so it will be a while yet=20 before I feel comfortable committing. But it's a two-line diff and the=20 pieces worked independently, so the chances it works are pretty high.=20 Comments appreciated. > If that seems OK, I'll post another review for the change. > > > A long-term project I've had has been to try to update the boot > blocks > > as part of installworld or maybe as part of installboot. We have > > really poor reuse as a project in this area. Every little > > orchestration thing wrote its own thing, and all of them have > done it > > badly. I was hoping to be able to reuse this code, or modify the > > installer to use whatever we come up with there. As part of that,= I > > had talked myself into thinking we always needed /boot/efi, but I= 'm > > having trouble reconstructing why that is now though I know it > had to > > do with installed systems and bootstrapping issues... I know I wa= s > > worried about questions about 'why isn't /boot/efi on the system = by > > default so I can mount it' for people that have upgraded, but I > recall > > there was more to it than that. With it in mtree, an installworld= > > (even w/o an ESP update) would create it and people could mount > it w/o > > having to mkdir which they might make as $SOMETHING_ELSE. So I > guess > > that's a bit of a weak reason to absolutely require it in mtree. > > Thanks a lot for the explanation. I'm agreed entirely about the > problem > and the difficulty -- hopefully this set of changes helps at least.= > > > It does. It starts to get people to use the same mount point for the=20 > ESP and we can then constrain the problem a bit and where we can't=20 > constrain it we can parameterize it. > > As for mtree, I was imagining this as something like /home, which > is a > standard part of the system but isn't part of mtree since it > depends on > local-system policy. It's also different from /home in that we > *do* want > it to be a standard place for updates, of course. I think there's > really > not a ton of precedent either way: we don't have any other mount > points > in there for file systems that may or may not exist depending on > circumstances, as far as I can tell. My worry with having it in > mtree is > that having it exist but potentially be a directory rather than an > actual ESP requires that update tools be a little smarter and error= s > will be a little less obvious, since updates that don't pay enough > attention will be a bit more likely to splat files there assuming > there > is an ESP even if makes no sense. It's a weak consideration either > way, > I think. > > > Yea. After a few hours of reflection, I've found that I could go=20 > either way and am having trouble understanding why I was so dead set=20 > this morning on a particular way. Chalk it up to me being a little=20 > extra grumpy at surprise changes. > > This one seems less like local policy than /home, but there's still a=20 > local aspect: Do I mount by default, and where. I think we should=20 > always, though, have a fstab entry as we'll need to update it from=20 > time to time. Even Windows has a nominal drive that it uses to mount=20 > the ESP, even if it isn't mounted by default. That's used to update it = > when scripts and such need to do that (or if you're the victim of an=20 > upgrade script that did too much that now needs to be undone). I think = > we should be similar in that regard. This would also let us take the=20 > automation of updates to the next level if we can rely on some basic=20 > things. That makes sense to me. There's also still the issue of non-EFI systems, = that differ only by install-time configuration from non-EFI systems. One = of my worries of having /boot/efi always exist is that a non-EFI system=20 may try to "update" the EFI by poking around in the empty /boot/efi and=20 think it has updated/installed something useful but has in reality done=20 nothing. But it's a tricky situation all around. -Nathan > > Warner > > > > > > Warner > > From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95D7D557F51; Thu, 4 Mar 2021 20:08: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 4Ds24W3rplz4qK3; Thu, 4 Mar 2021 20:08: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 772872380E; Thu, 4 Mar 2021 20:08: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 124K8h1m041928; Thu, 4 Mar 2021 20:08:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8hxu041927; Thu, 4 Mar 2021 20:08:43 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:43 GMT Message-Id: <202103042008.124K8hxu041927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3bde9c57df17 - releng/13.0 - FFS extattr: fix handling of the tail 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 3bde9c57df178c5cbe79f0f3f96c86557211fa69 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:43 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3bde9c57df178c5cbe79f0f3f96c86557211fa69 commit 3bde9c57df178c5cbe79f0f3f96c86557211fa69 Author: Konstantin Belousov AuthorDate: 2021-03-01 15:24:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:07:33 +0000 FFS extattr: fix handling of the tail Approved by: re (gjb) (cherry picked from commit 8742817ba62ec604156c139727155d36f5fbad06) --- sys/ufs/ffs/ffs_vnops.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index af03b369a280..582ccccc2e12 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1346,13 +1346,20 @@ ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td) /* Validate disk xattrfile contents. */ for (eap = (void *)eae, eaend = (void *)(eae + easize); eap < eaend; eap = eapnext) { + /* Detect zeroed out tail */ + if (eap->ea_length < sizeof(*eap) || eap->ea_length == 0) { + easize = (const u_char *)eap - eae; + break; + } + eapnext = EXTATTR_NEXT(eap); - /* Bogusly short entry or bogusly long entry. */ - if (eap->ea_length < sizeof(*eap) || eapnext > eaend) { + /* Bogusly long entry. */ + if (eapnext > eaend) { free(eae, M_TEMP); return (EINTEGRITY); } } + ip->i_ea_len = easize; *p = eae; return (0); } @@ -1407,7 +1414,6 @@ ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td) ffs_unlock_ea(vp); return (error); } - ip->i_ea_len = dp->di_extsize; ip->i_ea_error = 0; ip->i_ea_refs++; ffs_unlock_ea(vp); @@ -1426,6 +1432,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td struct ufs2_dinode *dp; size_t ea_len, tlen; int error, i, lcnt; + bool truncate; ip = VTOI(vp); @@ -1436,6 +1443,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td } dp = ip->i_din2; error = ip->i_ea_error; + truncate = false; if (commit && error == 0) { ASSERT_VOP_ELOCKED(vp, "ffs_close_ea commit"); if (cred == NOCRED) @@ -1452,12 +1460,12 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td liovec[0].iov_base = ip->i_ea_area; liovec[0].iov_len = ip->i_ea_len; - for (i = 1, tlen = ea_len; i < lcnt; i++) { + for (i = 1, tlen = ea_len - ip->i_ea_len; i < lcnt; i++) { liovec[i].iov_base = __DECONST(void *, zero_region); liovec[i].iov_len = MIN(ZERO_REGION_SIZE, tlen); tlen -= liovec[i].iov_len; } - MPASS(tlen == ip->i_ea_len); + MPASS(tlen == 0); luio.uio_iov = liovec; luio.uio_offset = 0; @@ -1466,6 +1474,8 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td luio.uio_rw = UIO_WRITE; luio.uio_td = td; error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred); + if (error == 0 && ip->i_ea_len == 0) + truncate = true; } if (--ip->i_ea_refs == 0) { free(ip->i_ea_area, M_TEMP); @@ -1475,7 +1485,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td } ffs_unlock_ea(vp); - if (commit && error == 0 && ip->i_ea_len == 0) + if (truncate) ffs_truncate(vp, 0, IO_EXT, cred); return (error); } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BDAE5582AE; Thu, 4 Mar 2021 20:08: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 4Ds24X44RVz4qGB; Thu, 4 Mar 2021 20:08: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 7EE0923792; Thu, 4 Mar 2021 20:08: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 124K8itq041951; Thu, 4 Mar 2021 20:08:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8iq8041950; Thu, 4 Mar 2021 20:08:44 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:44 GMT Message-Id: <202103042008.124K8iq8041950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9f1e0822cdf4 - releng/13.0 - fhlink(2): the syscalls do not take flag 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9f1e0822cdf4b2d2ab14cbe42ddc71a6603a9644 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:44 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9f1e0822cdf4b2d2ab14cbe42ddc71a6603a9644 commit 9f1e0822cdf4b2d2ab14cbe42ddc71a6603a9644 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:38:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:07:42 +0000 fhlink(2): the syscalls do not take flag Approved by: re (gjb) (cherry picked from commit 600756afb532a86a39fb488f5c4fc7e248921655) --- lib/libc/sys/fhlink.2 | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/lib/libc/sys/fhlink.2 b/lib/libc/sys/fhlink.2 index da35d2b103e6..029ec8d7c2eb 100644 --- a/lib/libc/sys/fhlink.2 +++ b/lib/libc/sys/fhlink.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt FHLINK 2 .Os .Sh NAME @@ -95,33 +95,6 @@ the directory associated with the file descriptor .Fa tofd instead of the current working directory. .Pp -Values for -.Fa flag -are constructed by a bitwise-inclusive OR of flags from the following -list, defined in -.In fcntl.h : -.Bl -tag -width indent -.It Dv AT_SYMLINK_FOLLOW -If -.Fa fhp -names a symbolic link, a new link for the target of the symbolic link is -created. -.It Dv AT_BENEATH -Only allow to link to a file which is beneath of the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. -.It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. -See the description of the -.Dv O_RESOLVE_BENEATH -flag in the -.Xr open 2 -manual page. -.El -.Pp If .Fn fhlinkat is passed the special value From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C702F558074; Thu, 4 Mar 2021 20:08: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 4Ds24Y4x0fz4qGF; Thu, 4 Mar 2021 20:08: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 9BDB8235C9; Thu, 4 Mar 2021 20:08: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 124K8jFs041973; Thu, 4 Mar 2021 20:08:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8jbc041970; Thu, 4 Mar 2021 20:08:45 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:45 GMT Message-Id: <202103042008.124K8jbc041970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 22c1852a04b0 - releng/13.0 - open(2): Remove O_BENEATH and AT_BENEATH 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 22c1852a04b0fec9d91a74cb13de8f2827800029 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:45 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=22c1852a04b0fec9d91a74cb13de8f2827800029 commit 22c1852a04b0fec9d91a74cb13de8f2827800029 Author: Konstantin Belousov AuthorDate: 2021-02-16 03:31:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:07:46 +0000 open(2): Remove O_BENEATH and AT_BENEATH Approved by: re (gjb) (cherry picked from commit 20e91ca36a56b8db1e6677f577ad011b66dd6eb3) --- lib/libc/sys/access.2 | 24 +++------------ lib/libc/sys/chflags.2 | 29 +++++------------- lib/libc/sys/chmod.2 | 29 +++++------------- lib/libc/sys/chown.2 | 29 +++++------------- lib/libc/sys/getfh.2 | 37 +++++------------------ lib/libc/sys/link.2 | 28 +++++------------ lib/libc/sys/open.2 | 77 ++++++++--------------------------------------- lib/libc/sys/stat.2 | 50 +++++-------------------------- lib/libc/sys/unlink.2 | 29 +++++------------- lib/libc/sys/utimensat.2 | 29 +++++------------- sys/kern/vfs_lookup.c | 78 +++++++----------------------------------------- sys/kern/vfs_syscalls.c | 51 +++++++++++++------------------ sys/kern/vfs_vnops.c | 2 -- sys/sys/fcntl.h | 14 ++++----- sys/sys/namei.h | 5 ---- 15 files changed, 112 insertions(+), 399 deletions(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 1cd7eed1301b..13bfd7e5a88a 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt ACCESS 2 .Os .Sh NAME @@ -120,15 +120,10 @@ list, defined in The checks for accessibility are performed using the effective user and group IDs instead of the real user and group ID as required in a call to .Fn access . -.It Dv AT_BENEATH -Only operate on files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -218,17 +213,6 @@ or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn faccessat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. .El .Sh SEE ALSO .Xr chmod 2 , diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index b6b0b43249c7..a44713904599 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHFLAGS 2 .Os .Sh NAME @@ -94,16 +94,10 @@ defined in If .Fa path names a symbolic link, then the flags of the symbolic link are changed. -.It Dv AT_BENEATH -Only allow to change flags for a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -327,18 +321,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn chflagsat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 1 , diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2 index 1d66408e3891..0127a5b629e4 100644 --- a/lib/libc/sys/chmod.2 +++ b/lib/libc/sys/chmod.2 @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHMOD 2 .Os .Sh NAME @@ -101,16 +101,10 @@ in If .Fa path names a symbolic link, then the mode of the symbolic link is changed. -.It Dv AT_BENEATH -Only allow to change permissions of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -310,18 +304,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fchmodat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chmod 1 , diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2 index 64bfdeaa961c..4c45ce9174bb 100644 --- a/lib/libc/sys/chown.2 +++ b/lib/libc/sys/chown.2 @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt CHOWN 2 .Os .Sh NAME @@ -118,16 +118,10 @@ list, defined in If .Fa path names a symbolic link, ownership of the symbolic link is changed. -.It Dv AT_BENEATH -Only allow to change ownership of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -252,18 +246,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fchownat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chgrp 1 , diff --git a/lib/libc/sys/getfh.2 b/lib/libc/sys/getfh.2 index 5dc5896af6d8..cd3d54f54d7f 100644 --- a/lib/libc/sys/getfh.2 +++ b/lib/libc/sys/getfh.2 @@ -29,7 +29,7 @@ .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt GETFH 2 .Os .Sh NAME @@ -76,9 +76,7 @@ and .Fn lgetfh except when the .Fa path -specifies a relative path, or the -.Dv AT_BENEATH -flag is provided. +specifies a relative path. For .Fn getfhat and relative @@ -87,13 +85,6 @@ the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. -For -.Dv AT_BENEATH -and absolute -.Fa path , -the status is retrieved from a file specified by the -.Fa path , -but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -105,15 +96,10 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. -.It Dv AT_BENEATH -Only stat files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -140,19 +126,10 @@ bit is set in When .Fn getfhat is called with an absolute -.Fa path -without the -.Dv AT_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv AT_BENEATH -is specified with an absolute .Fa path , -a directory passed by the +it ignores the .Fa fd -argument is used as the topping point for the resolution. +argument. These system calls are restricted to the superuser. .Sh RETURN VALUES .Rv -std diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index c3451da10884..de0efd5e510f 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt LINK 2 .Os .Sh NAME @@ -115,15 +115,10 @@ If .Fa name1 names a symbolic link, a new link for the target of the symbolic link is created. -.It Dv AT_BENEATH -Only allow to link to a file which is beneath of the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -281,18 +276,9 @@ For example, is absolute or includes a ".." component that escapes the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fa linkat -and the absolute path -.Fa name1 -does not have its tail fully contained under the topping directory, -or the relative path -.Fa name1 -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 2 , diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index e43d012770df..e24c823d039a 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt OPEN 2 .Os .Sh NAME @@ -75,9 +75,7 @@ function is equivalent to the .Fn open function except in the case where the .Fa path -specifies a relative path, or the -.Dv O_BENEATH -flag is provided. +specifies a relative path. For .Fn openat and relative @@ -104,28 +102,10 @@ and the behavior is identical to a call to When .Fn openat is called with an absolute -.Fa path -without the -.Dv O_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv O_BENEATH -is specified with an absolute .Fa path , -a directory passed by the -.Fa fd -argument is used as the topping point for the resolution. -When -.Dv O_BENEATH -is specified with a relative path, the +it ignores the .Fa fd -argument is used both as the starting point, and as the topping point -for the resolution. -See the definition of the -.Dv O_BENEATH -flag below. +argument. .Pp In .Xr capsicum 4 @@ -137,9 +117,7 @@ The argument to .Fn openat must be strictly relative to a file descriptor -.Fa fd , -as defined in -.Pa sys/kern/vfs_lookup.c . +.Fa fd . .Fa path must not be an absolute path and must not contain ".." components which cause the path resolution to escape the directory hierarchy @@ -156,9 +134,8 @@ If the .Dv vfs.lookup_cap_dotdot .Xr sysctl 3 MIB is set to zero, ".." components in the paths, -used in capability mode, or with the -.Dv O_BENEATH -flag, are completely disabled. +used in capability mode, +are completely disabled. If the .Dv vfs.lookup_cap_dotdot_nonlocal MIB is set to zero, ".." is not allowed if found on non-local filesystem. @@ -190,8 +167,7 @@ O_TTY_INIT ignored O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open O_VERIFY verify the contents of the file -O_BENEATH require resolved path to be strictly relative to topping directory -O_RESOLVE_BENEATH require walked path to be strictly relative to topping directory +O_RESOLVE_BENEATH path resolution must not cross the fd directory .Ed .Pp Opening a file with @@ -319,32 +295,12 @@ means is implementation specific. The run-time linker (rtld) uses this flag to ensure shared objects have been verified before operating on them. .Pp -.Dv O_BENEATH -returns -.Er ENOTCAPABLE -if the specified path, after resolving all symlinks and ".." -references, does not end up with tail residing in the directory hierarchy of -children beneath the topping directory. -Topping directory is the process current directory if relative -.Fa path -is used for -.Fn open , -and the directory referenced by the -.Fa fd -argument when using -.Fn openat . -.Dv O_BENEATH -allows arbitrary prefix that ends up at the topping directory, -after which all further resolved components must be under it. -.Pp .Dv O_RESOLVE_BENEATH returns .Er ENOTCAPABLE if any intermediate component of the specified relative path does not -reside in the directory hierarchy beneath the topping directory. -Comparing to -.Dv O_BENEATH , -absolute paths or even the temporal escape from beneath of the topping +reside in the directory hierarchy beneath the starting directory. +Absolute paths or even the temporal escape from beneath of the starting directory is not allowed. .Pp When @@ -601,19 +557,12 @@ directory outside of the directory hierarchy specified by and the process is in capability mode. .It Bq Er ENOTCAPABLE The -.Dv O_BENEATH -flag was provided, and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. -.It Bq Er ENOTCAPABLE -The .Dv O_RESOLVE_BENEATH flag was provided, and the relative .Fa path -escapes topping directory. +escapes the +.Ar fd +directory. .El .Sh SEE ALSO .Xr chmod 2 , diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2 index 4759d297e8da..0ed70620af63 100644 --- a/lib/libc/sys/stat.2 +++ b/lib/libc/sys/stat.2 @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt STAT 2 .Os .Sh NAME @@ -84,9 +84,7 @@ and .Fn lstat except when the .Fa path -specifies a relative path, or the -.Dv AT_BENEATH -flag is provided. +specifies a relative path. For .Fn fstatat and relative @@ -95,13 +93,6 @@ the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. -For -.Dv AT_BENEATH -and absolute -.Fa path , -the status is retrieved from a file specified by the -.Fa path , -but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -113,15 +104,8 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. -.It Dv AT_BENEATH -Only stat files and directories below the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the starting directory. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -148,19 +132,10 @@ bit is set in When .Fn fstatat is called with an absolute -.Fa path -without the -.Dv AT_BENEATH -flag, it ignores the -.Fa fd -argument. -When -.Dv AT_BENEATH -is specified with an absolute .Fa path , -a directory passed by the +it ignores the .Fa fd -argument is used as the topping point for the resolution. +argument. .Pp The .Fa sb @@ -459,18 +434,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn fstatat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr access 2 , diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2 index 838d4da68af2..11fff875abad 100644 --- a/lib/libc/sys/unlink.2 +++ b/lib/libc/sys/unlink.2 @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt UNLINK 2 .Os .Sh NAME @@ -92,16 +92,10 @@ Remove the directory entry specified by and .Fa path as a directory, not a normal file. -.It Dv AT_BENEATH -Only unlink files and directories which are beneath of the topping -directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -246,18 +240,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn unlinkat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Pp In addition to the errors returned by diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2 index 3016d1af72aa..d31ee1f1515a 100644 --- a/lib/libc/sys/utimensat.2 +++ b/lib/libc/sys/utimensat.2 @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 23, 2020 +.Dd February 23, 2021 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -146,16 +146,10 @@ names a symbolic link, the symbolic link's times are changed. By default, .Fn utimensat changes the times of the file referenced by the symbolic link. -.It Dv AT_BENEATH -Only allow to change the times of a file which is beneath of -the topping directory. -See the description of the -.Dv O_BENEATH -flag in the -.Xr open 2 -manual page. .It Dv AT_RESOLVE_BENEATH -Only walks paths below the topping directory. +Only walk paths below the directory specified by the +.Ar fd +descriptor. See the description of the .Dv O_RESOLVE_BENEATH flag in the @@ -290,18 +284,9 @@ is an absolute path, or contained a ".." component leading to a directory outside of the directory hierarchy specified by .Fa fd , -and the process is in capability mode. -.It Bq Er ENOTCAPABLE -The -.Dv AT_BENEATH -flag was provided to -.Fn utimensat , -and the absolute -.Fa path -does not have its tail fully contained under the topping directory, -or the relative -.Fa path -escapes it. +and the process is in capability mode or the +.Dv AT_RESOLVE_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 2 , diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index ad65ab11bb1d..4ddd7b63ce5c 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -182,13 +182,6 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; cnp = &ndp->ni_cnd; - if ((cnp->cn_flags & BENEATH) != 0 && - (ndp->ni_lcf & NI_LCF_BENEATH_LATCHED) == 0) { - MPASS((ndp->ni_lcf & NI_LCF_LATCH) != 0); - if (dp != ndp->ni_beneath_latch) - return; - ndp->ni_lcf |= NI_LCF_BENEATH_LATCHED; - } nt = malloc(sizeof(*nt), M_NAMEITRACKER, M_WAITOK); vhold(dp); nt->dp = dp; @@ -196,7 +189,7 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) } static void -nameicap_cleanup(struct nameidata *ndp, bool clean_latch) +nameicap_cleanup(struct nameidata *ndp) { struct nameicap_tracker *nt, *nt1; @@ -207,10 +200,6 @@ nameicap_cleanup(struct nameidata *ndp, bool clean_latch) vdrop(nt->dp); free(nt, M_NAMEITRACKER); } - if (clean_latch && (ndp->ni_lcf & NI_LCF_LATCH) != 0) { - ndp->ni_lcf &= ~NI_LCF_LATCH; - vrele(ndp->ni_beneath_latch); - } } /* @@ -230,21 +219,17 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) struct nameicap_tracker *nt; struct mount *mp; - if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp == NULL || - dp->v_type != VDIR) + if (dp == NULL || dp->v_type != VDIR || (ndp->ni_lcf & + NI_LCF_STRICTRELATIVE) == 0) return (0); + if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0) + return (ENOTCAPABLE); mp = dp->v_mount; if (lookup_cap_dotdot_nonlocal == 0 && mp != NULL && (mp->mnt_flag & MNT_LOCAL) == 0) return (ENOTCAPABLE); TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { - if ((ndp->ni_lcf & NI_LCF_LATCH) != 0 && - ndp->ni_beneath_latch == nt->dp) { - ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; - nameicap_cleanup(ndp, false); - return (0); - } if (dp == nt->dp) return (0); } @@ -275,11 +260,6 @@ namei_handle_root(struct nameidata *ndp, struct vnode **dpp) #endif return (ENOTCAPABLE); } - if ((cnp->cn_flags & BENEATH) != 0) { - ndp->ni_lcf |= NI_LCF_BENEATH_ABS; - ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; - nameicap_cleanup(ndp, false); - } while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; @@ -297,7 +277,6 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) struct thread *td; struct pwd *pwd; cap_rights_t rights; - struct filecaps dirfd_caps; int error; bool startdir_used; @@ -410,26 +389,8 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) if (error == 0 && (*dpp)->v_type != VDIR) error = ENOTDIR; } - if (error == 0 && (cnp->cn_flags & BENEATH) != 0) { - if (ndp->ni_dirfd == AT_FDCWD) { - ndp->ni_beneath_latch = pwd->pwd_cdir; - vrefact(ndp->ni_beneath_latch); - } else { - rights = *ndp->ni_rightsneeded; - cap_rights_set_one(&rights, CAP_LOOKUP); - error = fgetvp_rights(td, ndp->ni_dirfd, &rights, - &dirfd_caps, &ndp->ni_beneath_latch); - if (error == 0 && (*dpp)->v_type != VDIR) { - vrele(ndp->ni_beneath_latch); - error = ENOTDIR; - } - } - if (error == 0) - ndp->ni_lcf |= NI_LCF_LATCH; - } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { - if (cnp->cn_pnbuf[0] == '/' || - (ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) { + if (cnp->cn_pnbuf[0] == '/') { error = EINVAL; } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | @@ -452,12 +413,8 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) pwd_drop(pwd); return (error); } - MPASS((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_LATCH)) != - NI_LCF_BENEATH_ABS); - if (((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && - lookup_cap_dotdot != 0) || - ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0 && - (cnp->cn_flags & BENEATH) != 0)) + if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && + lookup_cap_dotdot != 0) ndp->ni_lcf |= NI_LCF_CAP_DOTDOT; SDT_PROBE4(vfs, namei, lookup, entry, *dpp, cnp->cn_pnbuf, cnp->cn_flags, false); @@ -636,16 +593,8 @@ namei(struct nameidata *ndp) for (;;) { ndp->ni_startdir = dp; error = lookup(ndp); - if (error != 0) { - /* - * Override an error to not allow user to use - * BENEATH as an oracle. - */ - if ((ndp->ni_lcf & (NI_LCF_LATCH | - NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) - error = ENOTCAPABLE; + if (error != 0) goto out; - } /* * If not a symbolic link, we're done. @@ -657,12 +606,7 @@ namei(struct nameidata *ndp) namei_cleanup_cnp(cnp); } else cnp->cn_flags |= HASBUF; - if ((ndp->ni_lcf & (NI_LCF_LATCH | - NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) { - NDFREE(ndp, 0); - error = ENOTCAPABLE; - } - nameicap_cleanup(ndp, true); + nameicap_cleanup(ndp); pwd_drop(pwd); if (error == 0) NDVALIDATE(ndp); @@ -739,7 +683,7 @@ out: MPASS(error != 0); SDT_PROBE4(vfs, namei, lookup, return, error, NULL, false, ndp); namei_cleanup_cnp(cnp); - nameicap_cleanup(ndp, true); + nameicap_cleanup(ndp); pwd_drop(pwd); return (error); } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index a51d693446e3..52604d3da829 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -120,8 +120,6 @@ at2cnpflags(u_int at_flags, u_int mask) res = 0; at_flags &= mask; - if ((at_flags & AT_BENEATH) != 0) - res |= BENEATH; if ((at_flags & AT_RESOLVE_BENEATH) != 0) res |= RBENEATH; if ((at_flags & AT_SYMLINK_FOLLOW) != 0) @@ -1500,12 +1498,11 @@ sys_linkat(struct thread *td, struct linkat_args *uap) int flag; flag = uap->flag; - if ((flag & ~(AT_SYMLINK_FOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2, - UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_BENEATH | + UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH))); } @@ -1875,7 +1872,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | - at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH), + at2cnpflags(flag, AT_RESOLVE_BENEATH), pathseg, path, dfd, &cap_unlinkat_rights, td); if ((error = namei(&nd)) != 0) { if (error == EINVAL) @@ -2080,7 +2077,7 @@ kern_accessat(struct thread *td, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_EACCESS | AT_BENEATH | AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_EACCESS | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) return (EINVAL); @@ -2101,7 +2098,7 @@ kern_accessat(struct thread *td, int fd, const char *path, usecred = cred; AUDIT_ARG_VALUE(amode); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1 | at2cnpflags(flag, AT_BENEATH | AT_RESOLVE_BENEATH), + AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH), pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) goto out; @@ -2392,13 +2389,12 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); - NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_BENEATH | - AT_RESOLVE_BENEATH | AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_RESOLVE_BENEATH | + AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, + pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) return (error); @@ -2716,8 +2712,7 @@ int sys_chflagsat(struct thread *td, struct chflagsat_args *uap) { - if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH | - AT_RESOLVE_BENEATH)) != 0) + if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); return (kern_chflagsat(td, uap->fd, uap->path, UIO_USERSPACE, *** 169 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65BA15583B2; Thu, 4 Mar 2021 20:08: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 4Ds24b2pfrz4qQ2; Thu, 4 Mar 2021 20:08: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 D877122FF6; Thu, 4 Mar 2021 20:08: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 124K8kYP041991; Thu, 4 Mar 2021 20:08:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8kq7041990; Thu, 4 Mar 2021 20:08:46 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:46 GMT Message-Id: <202103042008.124K8kq7041990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cea301aee3e1 - releng/13.0 - Do not call nameicap_tracker_add() for dotdot case. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: cea301aee3e1dc5f7006f45c5b11bcff315775e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:53 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cea301aee3e1dc5f7006f45c5b11bcff315775e0 commit cea301aee3e1dc5f7006f45c5b11bcff315775e0 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:12:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:07:50 +0000 Do not call nameicap_tracker_add() for dotdot case. Approved by: re (gjb) (cherry picked from commit 59e749428111c029116a4302a544c7cc18b33772) --- sys/kern/vfs_lookup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 4ddd7b63ce5c..73290e8da05f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1258,7 +1258,8 @@ success: } } if (ndp->ni_vp != NULL) { - nameicap_tracker_add(ndp, ndp->ni_vp); + if ((cnp->cn_flags & ISDOTDOT) == 0) + nameicap_tracker_add(ndp, ndp->ni_vp); if ((cnp->cn_flags & (FAILIFEXISTS | ISSYMLINK)) == FAILIFEXISTS) goto bad_eexist; } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 606F2558322; Thu, 4 Mar 2021 20:08: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 4Ds24d5gNyz4qZ7; Thu, 4 Mar 2021 20:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34A7D234C7; Thu, 4 Mar 2021 20:08: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 124K8lMh042013; Thu, 4 Mar 2021 20:08:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8lWo042012; Thu, 4 Mar 2021 20:08:47 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:47 GMT Message-Id: <202103042008.124K8lWo042012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4a5108cdc927 - releng/13.0 - nameicap_tracker_add: avoid duplicates in the tracker list 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 4a5108cdc92795ff035758a79b09cd0376ecec12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:55 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4a5108cdc92795ff035758a79b09cd0376ecec12 commit 4a5108cdc92795ff035758a79b09cd0376ecec12 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:13:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:07:54 +0000 nameicap_tracker_add: avoid duplicates in the tracker list Approved by: re (gjb) (cherry picked from commit 2388ad7c293fbc89ee239a1adcb87fd158c4e8e9) --- sys/kern/vfs_lookup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 73290e8da05f..cdd4a914239f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -182,6 +182,9 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; cnp = &ndp->ni_cnd; + nt = TAILQ_LAST(&ndp->ni_cap_tracker, nameicap_tracker_head); + if (nt != NULL && nt->dp == dp) + return; nt = malloc(sizeof(*nt), M_NAMEITRACKER, M_WAITOK); vhold(dp); nt->dp = dp; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5128F558412; Thu, 4 Mar 2021 20:08: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 4Ds24h0Lgcz4qWp; Thu, 4 Mar 2021 20:08: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 5746B235CA; Thu, 4 Mar 2021 20:08: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 124K8oD5042053; Thu, 4 Mar 2021 20:08:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8oY3042052; Thu, 4 Mar 2021 20:08:50 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:50 GMT Message-Id: <202103042008.124K8oY3042052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8ae87de4df1d - releng/13.0 - nameicap_check_dotdot: trim tracker on check 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 8ae87de4df1ddd748883ab00666a152d3b8e7301 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:56 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ae87de4df1ddd748883ab00666a152d3b8e7301 commit 8ae87de4df1ddd748883ab00666a152d3b8e7301 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:15:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:08:02 +0000 nameicap_check_dotdot: trim tracker on check Approved by: re (gjb) (cherry picked from commit 49c98a4bf3a87ace0df99056fa683805c1645e61) --- sys/kern/vfs_lookup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index abc01c73e24c..b4280f85c5b6 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -240,8 +240,12 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) return (ENOTCAPABLE); TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { - if (dp == nt->dp) + if (dp == nt->dp) { + nt = TAILQ_NEXT(nt, nm_link); + if (nt != NULL) + nameicap_cleanup_from(ndp, nt); return (0); + } } return (ENOTCAPABLE); } From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3324B558323; Thu, 4 Mar 2021 20:08: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 4Ds24f5xxLz4qGb; Thu, 4 Mar 2021 20:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4137422FF7; Thu, 4 Mar 2021 20:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124K8mGJ042035; Thu, 4 Mar 2021 20:08:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8m8T042034; Thu, 4 Mar 2021 20:08:48 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:48 GMT Message-Id: <202103042008.124K8m8T042034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bd7a41bed081 - releng/13.0 - Add nameicap_cleanup_from(), to clean tracker list starting from some element 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: bd7a41bed0818edf233743a96ed1c394e8e34936 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:56 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd7a41bed0818edf233743a96ed1c394e8e34936 commit bd7a41bed0818edf233743a96ed1c394e8e34936 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:14:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:07:58 +0000 Add nameicap_cleanup_from(), to clean tracker list starting from some element Approved by: re (gjb) (cherry picked from commit e8a2862aa0384c75603f801625e309a3dae0ed05) --- sys/kern/vfs_lookup.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index cdd4a914239f..abc01c73e24c 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -192,19 +192,26 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) } static void -nameicap_cleanup(struct nameidata *ndp) +nameicap_cleanup_from(struct nameidata *ndp, struct nameicap_tracker *first) { struct nameicap_tracker *nt, *nt1; - KASSERT(TAILQ_EMPTY(&ndp->ni_cap_tracker) || - (ndp->ni_lcf & NI_LCF_CAP_DOTDOT) != 0, ("not strictrelative")); - TAILQ_FOREACH_SAFE(nt, &ndp->ni_cap_tracker, nm_link, nt1) { + nt = first; + TAILQ_FOREACH_FROM_SAFE(nt, &ndp->ni_cap_tracker, nm_link, nt1) { TAILQ_REMOVE(&ndp->ni_cap_tracker, nt, nm_link); vdrop(nt->dp); free(nt, M_NAMEITRACKER); } } +static void +nameicap_cleanup(struct nameidata *ndp) +{ + KASSERT(TAILQ_EMPTY(&ndp->ni_cap_tracker) || + (ndp->ni_lcf & NI_LCF_CAP_DOTDOT) != 0, ("not strictrelative")); + nameicap_cleanup_from(ndp, NULL); +} + /* * For dotdot lookups in capability mode, only allow the component * lookup to succeed if the resulting directory was already traversed From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:08:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12CC155832A; Thu, 4 Mar 2021 20:08: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 4Ds24h0752z4qMX; Thu, 4 Mar 2021 20:08: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 501A42363C; Thu, 4 Mar 2021 20:08: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 124K8p51042075; Thu, 4 Mar 2021 20:08:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8pZS042074; Thu, 4 Mar 2021 20:08:51 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:51 GMT Message-Id: <202103042008.124K8pZS042074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ac94eec58a1a - releng/13.0 - O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: ac94eec58a1ab6e484bac7d148fc6f96e622d0a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:56 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ac94eec58a1ab6e484bac7d148fc6f96e622d0a7 commit ac94eec58a1ab6e484bac7d148fc6f96e622d0a7 Author: Konstantin Belousov AuthorDate: 2021-02-28 23:59:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:08:07 +0000 O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path Approved by: re (gjb) (cherry picked from commit 28cd3a673e0e32b009fd573764956b280d1affe1) --- sys/kern/vfs_lookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b4280f85c5b6..e881e8f909a4 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -405,7 +405,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { if (cnp->cn_pnbuf[0] == '/') { - error = EINVAL; + error = ENOTCAPABLE; } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | NI_LCF_CAP_DOTDOT; From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:12:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F781558A96; Thu, 4 Mar 2021 20:12: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 4Ds2901n4Lz4rcx; Thu, 4 Mar 2021 20:12: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 2FFAA237B4; Thu, 4 Mar 2021 20:12: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 124KCaxT054788; Thu, 4 Mar 2021 20:12:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124KCaUT054787; Thu, 4 Mar 2021 20:12:36 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:12:36 GMT Message-Id: <202103042012.124KCaUT054787@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: 19587d742264 - main - clang: Fix -gz=zlib options for linker 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: 19587d742264c5caec33d218e9cea6eb78f6c6bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:12:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=19587d742264c5caec33d218e9cea6eb78f6c6bb commit 19587d742264c5caec33d218e9cea6eb78f6c6bb Author: Ed Maste AuthorDate: 2021-03-03 01:35:57 +0000 Commit: Ed Maste CommitDate: 2021-03-04 20:10:03 +0000 clang: Fix -gz=zlib options for linker Clang commit ccb4124a4172bf2cb2e1cd7c253f0f1654fce294: Fix -gz=zlib options for linker gcc translates -gz=zlib to --compress-debug-options=zlib for both assembler and linker but clang only does this for assembler. The linker needs --compress-debug-options=zlib option to compress the debug sections in the generated executable or shared library. Due to this bug, -gz=zlib has no effect on the generated executable or shared library. This patch fixes that. Clang commit 462cf39a5c180621b56f7602270ce33eb7b68d23: [Driver] Fix -gz=zlib options for linker also on FreeBSD ccb4124a4172 fixed translating -gz=zlib to --compress-debug-sections for linker invocation for several ToolChains, but omitted FreeBSD. Approved by: dim MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29028 --- .../clang/lib/Driver/ToolChains/AMDGPU.cpp | 1 + .../clang/lib/Driver/ToolChains/CommonArgs.cpp | 18 ++++++++++++++++++ .../clang/lib/Driver/ToolChains/CommonArgs.h | 4 ++++ .../clang/lib/Driver/ToolChains/FreeBSD.cpp | 1 + .../llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp | 1 + .../llvm-project/clang/lib/Driver/ToolChains/HIP.cpp | 2 ++ 6 files changed, 27 insertions(+) diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/AMDGPU.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/AMDGPU.cpp index bc6d1fcd4a00..10ae76cb4161 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/AMDGPU.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/AMDGPU.cpp @@ -350,6 +350,7 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, std::string Linker = getToolChain().GetProgramPath(getShortName()); ArgStringList CmdArgs; + addLinkerCompressDebugSectionsOption(getToolChain(), Args, CmdArgs); AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA); CmdArgs.push_back("-shared"); CmdArgs.push_back("-o"); diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.cpp index 6b6e276b8ce7..535154e492a7 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -214,6 +214,24 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, } } +void tools::addLinkerCompressDebugSectionsOption( + const ToolChain &TC, const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) { + // GNU ld supports --compress-debug-sections=none|zlib|zlib-gnu|zlib-gabi + // whereas zlib is an alias to zlib-gabi. Therefore -gz=none|zlib|zlib-gnu + // are translated to --compress-debug-sections=none|zlib|zlib-gnu. + // -gz is not translated since ld --compress-debug-sections option requires an + // argument. + if (const Arg *A = Args.getLastArg(options::OPT_gz_EQ)) { + StringRef V = A->getValue(); + if (V == "none" || V == "zlib" || V == "zlib-gnu") + CmdArgs.push_back(Args.MakeArgString("--compress-debug-sections=" + V)); + else + TC.getDriver().Diag(diag::err_drv_unsupported_option_argument) + << A->getOption().getName() << V; + } +} + void tools::AddTargetFeature(const ArgList &Args, std::vector &Features, OptSpecifier OnOpt, OptSpecifier OffOpt, diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.h b/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.h index 29dedec9b09c..0028ea0ca337 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.h +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.h @@ -27,6 +27,10 @@ void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA); +void addLinkerCompressDebugSectionsOption(const ToolChain &TC, + const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs); + void claimNoWarnArgs(const llvm::opt::ArgList &Args); bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp index 909ac5e99212..6d8e25470e28 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -283,6 +283,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs); bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs); + addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp index c8a7fce07ef1..23e7a70f2fa7 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp @@ -568,6 +568,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs); bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs); + addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); // The profile runtime also needs access to system libraries. getToolChain().addProfileRTLibs(Args, CmdArgs); diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/HIP.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/HIP.cpp index 7d17f809690e..228d970c4043 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/HIP.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/HIP.cpp @@ -88,6 +88,8 @@ void AMDGCN::Linker::constructLldCommand(Compilation &C, const JobAction &JA, if (C.getDriver().isSaveTempsEnabled()) LldArgs.push_back("-save-temps"); + addLinkerCompressDebugSectionsOption(TC, Args, LldArgs); + LldArgs.append({"-o", Output.getFilename()}); for (auto Input : Inputs) LldArgs.push_back(Input.getFilename()); From owner-dev-commits-src-all@freebsd.org Thu Mar 4 20:55:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4991855A0E5; Thu, 4 Mar 2021 20:55: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 4Ds36r1dFjz4vHL; Thu, 4 Mar 2021 20:55: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 265A524286; Thu, 4 Mar 2021 20:55: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 124KtmQi008587; Thu, 4 Mar 2021 20:55:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124KtmAI008586; Thu, 4 Mar 2021 20:55:48 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:55:48 GMT Message-Id: <202103042055.124KtmAI008586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 3d4229b5decc - stable/12 - Revert "MFC kern: cpuset: properly rebase when attaching to a jail" 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 3d4229b5decc74b5276fa0b3930ed1552c5f00f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:55:48 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3d4229b5decc74b5276fa0b3930ed1552c5f00f5 commit 3d4229b5decc74b5276fa0b3930ed1552c5f00f5 Author: Kyle Evans AuthorDate: 2021-03-04 20:13:55 +0000 Commit: Kyle Evans CommitDate: 2021-03-04 20:50:34 +0000 Revert "MFC kern: cpuset: properly rebase when attaching to a jail" This behavior change is too invasive to be made between minor versions, back it out in stable/12 -- it will be first introduced in 13.0. The cpuset test has been adjusted to account for the legacy behavior, with a note added as to why it's different and doesn't work if run as-is on 13.0. This reverts commit 7bb960ce6447bd535e0fbb648e4d9edbb1dc067f. --- lib/libc/tests/sys/cpuset_test.c | 11 +++- sys/kern/kern_cpuset.c | 121 +++++++-------------------------------- 2 files changed, 31 insertions(+), 101 deletions(-) diff --git a/lib/libc/tests/sys/cpuset_test.c b/lib/libc/tests/sys/cpuset_test.c index d6dd69e7e3c1..e3332540eb29 100644 --- a/lib/libc/tests/sys/cpuset_test.c +++ b/lib/libc/tests/sys/cpuset_test.c @@ -360,7 +360,16 @@ jail_attach_newbase_epi(struct jail_test_cb_params *cbp) */ ATF_REQUIRE(info->jail_cpuset != cbp->rootid); ATF_REQUIRE(info->jail_cpuset != cbp->setid); - ATF_REQUIRE(info->jail_cpuset != info->jail_child_cpuset); + + /* + * The historical behavior has been that the process will simply take on + * and mask the jail's cpuset. As of FreeBSD 13.0, this behavior will + * change so that an attaching process will rebase its cpuset onto the + * jail's if it had one distinct from its own jail's root, thus breaking + * this condition. + */ + ATF_REQUIRE(info->jail_cpuset == info->jail_child_cpuset); + ATF_REQUIRE_EQ(0, CPU_CMP(mask, &info->jail_tidmask)); } diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 368acdb2be16..e2e45f53c0af 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -1138,63 +1138,14 @@ cpuset_setproc_setthread(struct cpuset *tdset, struct cpuset *set, domainlist); } -static int -cpuset_setproc_newbase(struct thread *td, struct cpuset *set, - struct cpuset *nroot, struct cpuset **nsetp, - struct setlist *cpusets, struct domainlist *domainlist) -{ - struct domainset ndomain; - cpuset_t nmask; - struct cpuset *pbase; - int error; - - pbase = cpuset_getbase(td->td_cpuset); - - /* Copy process mask, then further apply the new root mask. */ - CPU_COPY(&pbase->cs_mask, &nmask); - CPU_AND(&nmask, &nroot->cs_mask); - - domainset_copy(pbase->cs_domain, &ndomain); - DOMAINSET_AND(&ndomain.ds_mask, &set->cs_domain->ds_mask); - - /* Policy is too restrictive, will not work. */ - if (CPU_EMPTY(&nmask) || DOMAINSET_EMPTY(&ndomain.ds_mask)) - return (EDEADLK); - - /* - * Remove pbase from the freelist in advance, it'll be pushed to - * cpuset_ids on success. We assume here that cpuset_create() will not - * touch pbase on failure, and we just enqueue it back to the freelist - * to remain in a consistent state. - */ - pbase = LIST_FIRST(cpusets); - LIST_REMOVE(pbase, cs_link); - error = cpuset_create(&pbase, set, &nmask); - if (error != 0) { - LIST_INSERT_HEAD(cpusets, pbase, cs_link); - return (error); - } - - /* Duplicates some work from above... oh well. */ - pbase->cs_domain = domainset_shadow(set->cs_domain, &ndomain, - domainlist); - *nsetp = pbase; - return (0); -} - /* - * Handle four cases for updating an entire process. + * Handle three cases for updating an entire process. * - * 1) Set is non-null and the process is not rebasing onto a new root. This - * reparents all anonymous sets to the provided set and replaces all - * non-anonymous td_cpusets with the provided set. - * 2) Set is non-null and the process is rebasing onto a new root. This - * creates a new base set if the process previously had its own base set, - * then reparents all anonymous sets either to that set or the provided set - * if one was not created. Non-anonymous sets are similarly replaced. - * 3) Mask is non-null. This replaces or creates anonymous sets for every + * 1) Set is non-null. This reparents all anonymous sets to the provided + * set and replaces all non-anonymous td_cpusets with the provided set. + * 2) Mask is non-null. This replaces or creates anonymous sets for every * thread with the existing base as a parent. - * 4) domain is non-null. This creates anonymous sets for every thread + * 3) domain is non-null. This creates anonymous sets for every thread * and replaces the domain set. * * This is overly complicated because we can't allocate while holding a @@ -1203,15 +1154,15 @@ cpuset_setproc_newbase(struct thread *td, struct cpuset *set, */ static int cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, - struct domainset *domain, bool rebase) + struct domainset *domain) { struct setlist freelist; struct setlist droplist; struct domainlist domainlist; - struct cpuset *base, *nset, *nroot, *tdroot; + struct cpuset *nset; struct thread *td; struct proc *p; - int needed; + int threads; int nfree; int error; @@ -1227,49 +1178,21 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, nfree = 1; LIST_INIT(&droplist); nfree = 0; - base = set; - nroot = NULL; - if (set != NULL) - nroot = cpuset_getroot(set); for (;;) { error = cpuset_which(CPU_WHICH_PID, pid, &p, &td, &nset); if (error) goto out; - tdroot = cpuset_getroot(td->td_cpuset); - needed = p->p_numthreads; - if (set != NULL && rebase && tdroot != nroot) - needed++; - if (nfree >= needed) + if (nfree >= p->p_numthreads) break; + threads = p->p_numthreads; PROC_UNLOCK(p); - if (nfree < needed) { - cpuset_freelist_add(&freelist, needed - nfree); - domainset_freelist_add(&domainlist, needed - nfree); - nfree = needed; + if (nfree < threads) { + cpuset_freelist_add(&freelist, threads - nfree); + domainset_freelist_add(&domainlist, threads - nfree); + nfree = threads; } } PROC_LOCK_ASSERT(p, MA_OWNED); - - /* - * If we're changing roots and the root set is what has been specified - * as the parent, then we'll check if the process was previously using - * the root set and, if it wasn't, create a new base with the process's - * mask applied to it. - */ - if (set != NULL && rebase && nroot != tdroot) { - cpusetid_t base_id, root_id; - - root_id = td->td_ucred->cr_prison->pr_cpuset->cs_id; - base_id = cpuset_getbase(td->td_cpuset)->cs_id; - - if (base_id != root_id) { - error = cpuset_setproc_newbase(td, set, nroot, &base, - &freelist, &domainlist); - if (error != 0) - goto unlock_out; - } - } - /* * Now that the appropriate locks are held and we have enough cpusets, * make sure the operation will succeed before applying changes. The @@ -1280,7 +1203,7 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, thread_lock(td); if (set != NULL) error = cpuset_setproc_test_setthread(td->td_cpuset, - base); + set); else error = cpuset_setproc_test_maskthread(td->td_cpuset, mask, domain); @@ -1296,7 +1219,7 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); if (set != NULL) - error = cpuset_setproc_setthread(td->td_cpuset, base, + error = cpuset_setproc_setthread(td->td_cpuset, set, &nset, &freelist, &domainlist); else error = cpuset_setproc_maskthread(td->td_cpuset, mask, @@ -1311,8 +1234,6 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, unlock_out: PROC_UNLOCK(p); out: - if (base != NULL && base != set) - cpuset_rel(base); while ((nset = LIST_FIRST(&droplist)) != NULL) cpuset_rel_complete(nset); cpuset_freelist_free(&freelist); @@ -1697,7 +1618,7 @@ cpuset_setproc_update_set(struct proc *p, struct cpuset *set) KASSERT(set != NULL, ("[%s:%d] invalid set", __func__, __LINE__)); cpuset_ref(set); - error = cpuset_setproc(p->p_pid, set, NULL, NULL, true); + error = cpuset_setproc(p->p_pid, set, NULL, NULL); if (error) return (error); cpuset_rel(set); @@ -1747,7 +1668,7 @@ sys_cpuset(struct thread *td, struct cpuset_args *uap) return (error); error = copyout(&set->cs_id, uap->setid, sizeof(set->cs_id)); if (error == 0) - error = cpuset_setproc(-1, set, NULL, NULL, false); + error = cpuset_setproc(-1, set, NULL, NULL); cpuset_rel(set); return (error); } @@ -1781,7 +1702,7 @@ kern_cpuset_setid(struct thread *td, cpuwhich_t which, set = cpuset_lookup(setid, td); if (set == NULL) return (ESRCH); - error = cpuset_setproc(id, set, NULL, NULL, false); + error = cpuset_setproc(id, set, NULL, NULL); cpuset_rel(set); return (error); } @@ -2060,7 +1981,7 @@ kern_cpuset_setaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, error = cpuset_setthread(id, mask); break; case CPU_WHICH_PID: - error = cpuset_setproc(id, NULL, mask, NULL, false); + error = cpuset_setproc(id, NULL, mask, NULL); break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: @@ -2349,7 +2270,7 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t level, cpuwhich_t which, error = _cpuset_setthread(id, NULL, &domain); break; case CPU_WHICH_PID: - error = cpuset_setproc(id, NULL, NULL, &domain, false); + error = cpuset_setproc(id, NULL, NULL, &domain); break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: From owner-dev-commits-src-all@freebsd.org Thu Mar 4 21:00:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1B4155A1F8; Thu, 4 Mar 2021 21:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds3Cq5bk7z4vJR; Thu, 4 Mar 2021 21:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A99E823E60; Thu, 4 Mar 2021 21:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124L0739012202; Thu, 4 Mar 2021 21:00:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124L076x012199; Thu, 4 Mar 2021 21:00:07 GMT (envelope-from git) Date: Thu, 4 Mar 2021 21:00:07 GMT Message-Id: <202103042100.124L076x012199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 0d3b3beeb253 - main - riscv: fix errors in some atomic type aliases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d3b3beeb253e09b2b6b3805065594aecc7e2c2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 21:00:07 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=0d3b3beeb253e09b2b6b3805065594aecc7e2c2f commit 0d3b3beeb253e09b2b6b3805065594aecc7e2c2f Author: Mitchell Horne AuthorDate: 2021-03-04 17:52:45 +0000 Commit: Mitchell Horne CommitDate: 2021-03-04 20:59:58 +0000 riscv: fix errors in some atomic type aliases This appears to be a copy-and-paste error that has simply been overlooked. The tree contains only two calls to any of the affected variants, but recent additions to the test suite started exercising the call to atomic_clear_rel_int() in ng_leave_write(), reliably causing panics. Apparently, the issue was inherited from the arm64 atomic header. That instance was addressed in c90baf6817a0, but the fix did not make its way to RISC-V. Note that the particular test case ng_macfilter_test:main still appears to fail on this platform, but this change reduces the panic to a timeout. PR: 253237 Reported by: Jenkins, arichardson Reviewed by: kp, arichardson MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29064 --- sys/riscv/include/atomic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h index d08047593861..d743fce6f1ff 100644 --- a/sys/riscv/include/atomic.h +++ b/sys/riscv/include/atomic.h @@ -288,7 +288,7 @@ atomic_store_rel_32(volatile uint32_t *p, uint32_t val) #define atomic_subtract_acq_int atomic_subtract_acq_32 #define atomic_add_rel_int atomic_add_rel_32 -#define atomic_clear_rel_int atomic_add_rel_32 +#define atomic_clear_rel_int atomic_clear_rel_32 #define atomic_cmpset_rel_int atomic_cmpset_rel_32 #define atomic_fcmpset_rel_int atomic_fcmpset_rel_32 #define atomic_set_rel_int atomic_set_rel_32 @@ -490,7 +490,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val) } #define atomic_add_acq_long atomic_add_acq_64 -#define atomic_clear_acq_long atomic_add_acq_64 +#define atomic_clear_acq_long atomic_clear_acq_64 #define atomic_cmpset_acq_long atomic_cmpset_acq_64 #define atomic_fcmpset_acq_long atomic_fcmpset_acq_64 #define atomic_load_acq_long atomic_load_acq_64 @@ -498,7 +498,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val) #define atomic_subtract_acq_long atomic_subtract_acq_64 #define atomic_add_acq_ptr atomic_add_acq_64 -#define atomic_clear_acq_ptr atomic_add_acq_64 +#define atomic_clear_acq_ptr atomic_clear_acq_64 #define atomic_cmpset_acq_ptr atomic_cmpset_acq_64 #define atomic_fcmpset_acq_ptr atomic_fcmpset_acq_64 #define atomic_load_acq_ptr atomic_load_acq_64 From owner-dev-commits-src-all@freebsd.org Thu Mar 4 21:00:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D490555A33C; Thu, 4 Mar 2021 21:00: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 4Ds3D75hlRz4vlm; Thu, 4 Mar 2021 21:00: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 B6CCF23EE0; Thu, 4 Mar 2021 21:00: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 124L0Nlw017650; Thu, 4 Mar 2021 21:00:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124L0NJ2017649; Thu, 4 Mar 2021 21:00:23 GMT (envelope-from git) Date: Thu, 4 Mar 2021 21:00:23 GMT Message-Id: <202103042100.124L0NJ2017649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 209247b9614f - stable/13 - loader: use display pixel density for font autoselection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 209247b9614f157c17a1e3aebefca4292653536b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 21:00:23 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=209247b9614f157c17a1e3aebefca4292653536b commit 209247b9614f157c17a1e3aebefca4292653536b Author: Toomas Soome AuthorDate: 2021-02-20 08:51:28 +0000 Commit: Toomas Soome CommitDate: 2021-03-04 15:38:37 +0000 loader: use display pixel density for font autoselection Calculate font size from 16 density independent pixels (dp) by using: size = 16 * ppi/160 * display_factor We are specifying font size 16dp, and assuming 1dp = 160ppi. Also apply scaling factor 2 (display_factor). (cherry picked from commit becaac3972f1fde4e3c44516399468ba5ca65c9b) --- stand/common/gfx_fb.c | 110 +++++++++++++++++++++++++++++++++++++++++ stand/common/gfx_fb.h | 2 + stand/efi/libefi/efi_console.c | 23 ++++++--- stand/efi/loader/framebuffer.c | 96 +++++++++++++++++++++++++++++++++-- stand/i386/libi386/vbe.c | 25 ++++++---- 5 files changed, 237 insertions(+), 19 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 02a0a3d2be22..77cf1d39854f 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -1863,6 +1863,113 @@ reset_font_flags(void) } } +/* Return w^2 + h^2 or 0, if the dimensions are unknown */ +static unsigned +edid_diagonal_squared(void) +{ + unsigned w, h; + + if (edid_info == NULL) + return (0); + + w = edid_info->display.max_horizontal_image_size; + h = edid_info->display.max_vertical_image_size; + + /* If either one is 0, we have aspect ratio, not size */ + if (w == 0 || h == 0) + return (0); + + /* + * some monitors encode the aspect ratio instead of the physical size. + */ + if ((w == 16 && h == 9) || (w == 16 && h == 10) || + (w == 4 && h == 3) || (w == 5 && h == 4)) + return (0); + + /* + * translate cm to inch, note we scale by 100 here. + */ + w = w * 100 / 254; + h = h * 100 / 254; + + /* Return w^2 + h^2 */ + return (w * w + h * h); +} + +/* + * calculate pixels per inch. + */ +static unsigned +gfx_get_ppi(void) +{ + unsigned dp, di; + + di = edid_diagonal_squared(); + if (di == 0) + return (0); + + dp = gfx_state.tg_fb.fb_width * + gfx_state.tg_fb.fb_width + + gfx_state.tg_fb.fb_height * + gfx_state.tg_fb.fb_height; + + return (isqrt(dp / di)); +} + +/* + * Calculate font size from density independent pixels (dp): + * ((16dp * ppi) / 160) * display_factor. + * Here we are using fixed constants: 1dp == 160 ppi and + * display_factor 2. + * + * We are rounding font size up and are searching for font which is + * not smaller than calculated size value. + */ +static vt_font_bitmap_data_t * +gfx_get_font(void) +{ + unsigned ppi, size; + vt_font_bitmap_data_t *font = NULL; + struct fontlist *fl, *next; + + /* Text mode is not supported here. */ + if (gfx_state.tg_fb_type == FB_TEXT) + return (NULL); + + ppi = gfx_get_ppi(); + if (ppi == 0) + return (NULL); + + /* + * We will search for 16dp font. + * We are using scale up by 10 for roundup. + */ + size = (16 * ppi * 10) / 160; + /* Apply display factor 2. */ + size = roundup(size * 2, 10) / 10; + + STAILQ_FOREACH(fl, &fonts, font_next) { + next = STAILQ_NEXT(fl, font_next); + + /* + * If this is last font or, if next font is smaller, + * we have our font. Make sure, it actually is loaded. + */ + if (next == NULL || next->font_data->vfbd_height < size) { + font = fl->font_data; + if (font->vfbd_font == NULL || + fl->font_flags == FONT_RELOAD) { + if (fl->font_load != NULL && + fl->font_name != NULL) + font = fl->font_load(fl->font_name); + } + break; + } + } + + return (font); +} + static vt_font_bitmap_data_t * set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) { @@ -1887,6 +1994,9 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) } } + if (font == NULL) + font = gfx_get_font(); + if (font != NULL) { *rows = height / font->vfbd_height; *cols = width / font->vfbd_width; diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index 04076a2c6d38..ac63d7939cef 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -109,6 +109,8 @@ struct vesa_edid_info { uint8_t checksum; } __packed; +extern struct vesa_edid_info *edid_info; + #define STD_TIMINGS 8 #define DET_TIMINGS 4 diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 3cbd121c41da..0c40b362f276 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -952,13 +952,24 @@ cons_update_mode(bool use_gfx_mode) /* * setup_font() can adjust terminal size. - * Note, we do use UEFI terminal dimensions first, - * this is because the font selection will attempt - * to achieve at least this terminal dimension and - * we do not end up with too small font. + * We can see two kind of bad happening. + * We either can get too small console font - requested + * terminal size is large, display resolution is + * large, and we get very small font. + * Or, we can get too large font - requested + * terminal size is small and this will cause large + * font to be selected. + * Now, the setup_font() is updated to consider + * display density and this should give us mostly + * acceptable font. However, the catch is, not all + * display devices will give us display density. + * Still, we do hope, external monitors do - this is + * where the display size will matter the most. + * And for laptop screens, we should still get good + * results by requesting 80x25 terminal. */ - gfx_state.tg_tp.tp_row = rows; - gfx_state.tg_tp.tp_col = cols; + gfx_state.tg_tp.tp_row = 25; + gfx_state.tg_tp.tp_col = 80; setup_font(&gfx_state, fb_height, fb_width); rows = gfx_state.tg_tp.tp_row; cols = gfx_state.tg_tp.tp_col; diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index 509c41844dcb..adb9dfb62cee 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include "bootstrap.h" @@ -47,6 +49,12 @@ static EFI_GUID conout_guid = EFI_CONSOLE_OUT_DEVICE_GUID; EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; +static EFI_GUID active_edid_guid = EFI_EDID_ACTIVE_PROTOCOL_GUID; +static EFI_GUID discovered_edid_guid = EFI_EDID_DISCOVERED_PROTOCOL_GUID; +static EFI_HANDLE gop_handle; + +/* Cached EDID. */ +struct vesa_edid_info *edid_info = NULL; static EFI_GRAPHICS_OUTPUT *gop; static EFI_UGA_DRAW_PROTOCOL *uga; @@ -467,10 +475,71 @@ efifb_from_uga(struct efi_fb *efifb) return (0); } +/* + * Fetch EDID info. Caller must free the buffer. + */ +static struct vesa_edid_info * +efifb_gop_get_edid(EFI_HANDLE h) +{ + const uint8_t magic[] = EDID_MAGIC; + EFI_EDID_ACTIVE_PROTOCOL *edid; + struct vesa_edid_info *edid_infop; + EFI_GUID *guid; + EFI_STATUS status; + size_t size; + + guid = &active_edid_guid; + status = BS->OpenProtocol(h, guid, (void **)&edid, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (status != EFI_SUCCESS || + edid->SizeOfEdid == 0) { + guid = &discovered_edid_guid; + status = BS->OpenProtocol(h, guid, (void **)&edid, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (status != EFI_SUCCESS || + edid->SizeOfEdid == 0) + return (NULL); + } + + size = MAX(sizeof(*edid_infop), edid->SizeOfEdid); + + edid_infop = calloc(1, size); + if (edid_infop == NULL) + return (NULL); + + memcpy(edid_infop, edid->Edid, edid->SizeOfEdid); + + /* Validate EDID */ + if (memcmp(edid_infop, magic, sizeof (magic)) != 0) + goto error; + + if (edid_infop->header.version != 1) + goto error; + + return (edid_infop); +error: + free(edid_infop); + return (NULL); +} + +static bool +efifb_get_edid(edid_res_list_t *res) +{ + bool rv = false; + + if (edid_info == NULL) + edid_info = efifb_gop_get_edid(gop_handle); + + if (edid_info != NULL) + rv = gfx_get_edid_resolution(edid_info, res); + + return (rv); +} + int efi_find_framebuffer(teken_gfx_t *gfx_state) { - EFI_HANDLE h, *hlist; + EFI_HANDLE *hlist; UINTN nhandles, i, hsize; struct efi_fb efifb; EFI_STATUS status; @@ -498,23 +567,25 @@ efi_find_framebuffer(teken_gfx_t *gfx_state) /* * Search for ConOut protocol, if not found, use first handle. */ - h = *hlist; + gop_handle = *hlist; for (i = 0; i < nhandles; i++) { void *dummy = NULL; status = OpenProtocolByHandle(hlist[i], &conout_guid, &dummy); if (status == EFI_SUCCESS) { - h = hlist[i]; + gop_handle = hlist[i]; break; } } - status = OpenProtocolByHandle(h, &gop_guid, (void **)&gop); + status = OpenProtocolByHandle(gop_handle, &gop_guid, (void **)&gop); free(hlist); if (status == EFI_SUCCESS) { gfx_state->tg_fb_type = FB_GOP; gfx_state->tg_private = gop; + if (edid_info == NULL) + edid_info = efifb_gop_get_edid(gop_handle); } else { status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (status == EFI_SUCCESS) { @@ -767,9 +838,25 @@ command_gop(int argc, char *argv[]) } else if (strcmp(argv[1], "off") == 0) { (void) cons_update_mode(false); } else if (strcmp(argv[1], "get") == 0) { + edid_res_list_t res; + if (argc != 2) goto usage; + TAILQ_INIT(&res); efifb_from_gop(&efifb, gop->Mode, gop->Mode->Info); + if (efifb_get_edid(&res)) { + struct resolution *rp; + + printf("EDID"); + while ((rp = TAILQ_FIRST(&res)) != NULL) { + printf(" %dx%d", rp->width, rp->height); + TAILQ_REMOVE(&res, rp, next); + free(rp); + } + printf("\n"); + } else { + printf("no EDID information\n"); + } print_efifb(gop->Mode->Mode, &efifb, 1); printf("\n"); } else if (!strcmp(argv[1], "list")) { @@ -778,6 +865,7 @@ command_gop(int argc, char *argv[]) if (argc != 2) goto usage; + pager_open(); for (mode = 0; mode < gop->Mode->MaxMode; mode++) { status = gop->QueryMode(gop, mode, &infosz, &info); diff --git a/stand/i386/libi386/vbe.c b/stand/i386/libi386/vbe.c index 0e9f6929ac05..ef4daffa8380 100644 --- a/stand/i386/libi386/vbe.c +++ b/stand/i386/libi386/vbe.c @@ -51,6 +51,7 @@ static struct modeinfoblock *vbe_mode; static uint16_t *vbe_mode_list; static size_t vbe_mode_list_size; +struct vesa_edid_info *edid_info = NULL; /* The default VGA color palette format is 6 bits per primary color. */ int palette_format = 6; @@ -836,34 +837,40 @@ vbe_dump_mode(int modenum, struct modeinfoblock *mi) static bool vbe_get_edid(edid_res_list_t *res) { - struct vesa_edid_info *edid_info; + struct vesa_edid_info *edidp; const uint8_t magic[] = EDID_MAGIC; int ddc_caps; bool ret = false; + if (edid_info != NULL) + return (gfx_get_edid_resolution(edid_info, res)); + ddc_caps = biosvbe_ddc_caps(); if (ddc_caps == 0) { return (ret); } - edid_info = bio_alloc(sizeof (*edid_info)); - if (edid_info == NULL) + edidp = bio_alloc(sizeof(*edidp)); + if (edidp == NULL) return (ret); - memset(edid_info, 0, sizeof (*edid_info)); + memset(edidp, 0, sizeof(*edidp)); - if (VBE_ERROR(biosvbe_ddc_read_edid(0, edid_info))) + if (VBE_ERROR(biosvbe_ddc_read_edid(0, edidp))) goto done; - if (memcmp(edid_info, magic, sizeof (magic)) != 0) + if (memcmp(edidp, magic, sizeof(magic)) != 0) goto done; /* Unknown EDID version. */ - if (edid_info->header.version != 1) + if (edidp->header.version != 1) goto done; - ret = gfx_get_edid_resolution(edid_info, res); + ret = gfx_get_edid_resolution(edidp, res); + edid_info = malloc(sizeof(*edid_info)); + if (edid_info != NULL) + memcpy(edid_info, edidp, sizeof (*edid_info)); done: - bio_free(edid_info, sizeof (*edid_info)); + bio_free(edidp, sizeof(*edidp)); return (ret); } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 00:36:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59B4355F2A9; Fri, 5 Mar 2021 00:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds81d264qz56Rk; Fri, 5 Mar 2021 00:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B54326F94; Fri, 5 Mar 2021 00:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1250aber098523; Fri, 5 Mar 2021 00:36:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1250abMV098522; Fri, 5 Mar 2021 00:36:37 GMT (envelope-from git) Date: Fri, 5 Mar 2021 00:36:37 GMT Message-Id: <202103050036.1250abMV098522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 9bf608d00a4f - releng/13.0 - libc: fix buffer overrun in getrpcport(3) 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9bf608d00a4fa2f2028e555cfd1d7e4f8e56bd38 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 00:36:37 -0000 The branch releng/13.0 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=9bf608d00a4fa2f2028e555cfd1d7e4f8e56bd38 commit 9bf608d00a4fa2f2028e555cfd1d7e4f8e56bd38 Author: Edward Tomasz Napierala AuthorDate: 2021-01-31 21:41:55 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-04 23:29:00 +0000 libc: fix buffer overrun in getrpcport(3) Approved by: re (gjb) Reviewed By: markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27332 (cherry picked from commit 5299d64b2b9f7a25e423ef1785d9402a0ef198d3) (cherry picked from commit a3576b6207074ba5182be253c26af72f8fb51759) --- lib/libc/rpc/getrpcport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c index 2b2d459c8887..4abc9a0c16af 100644 --- a/lib/libc/rpc/getrpcport.c +++ b/lib/libc/rpc/getrpcport.c @@ -62,14 +62,14 @@ getrpcport(char *host, int prognum, int versnum, int proto) assert(host != NULL); - if ((hp = gethostbyname(host)) == NULL) + if ((hp = gethostbyname2(host, AF_INET)) == NULL) return (0); memset(&addr, 0, sizeof(addr)); addr.sin_len = sizeof(struct sockaddr_in); addr.sin_family = AF_INET; addr.sin_port = 0; - if (hp->h_length > addr.sin_len) - hp->h_length = addr.sin_len; + if (hp->h_length > sizeof(addr.sin_addr.s_addr)) + hp->h_length = sizeof(addr.sin_addr.s_addr); memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length); /* Inconsistent interfaces need casts! :-( */ return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum, From owner-dev-commits-src-all@freebsd.org Fri Mar 5 00:36:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C2E655F1EC; Fri, 5 Mar 2021 00:36: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 4Ds81f34qGz56Gl; Fri, 5 Mar 2021 00:36:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C6AA26E70; Fri, 5 Mar 2021 00:36:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1250aceo098541; Fri, 5 Mar 2021 00:36:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1250acus098540; Fri, 5 Mar 2021 00:36:38 GMT (envelope-from git) Date: Fri, 5 Mar 2021 00:36:38 GMT Message-Id: <202103050036.1250acus098540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: f122a8719225 - releng/13.0 - Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linux 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f122a871922561b7857ec80745f3e2d9531a8862 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 00:36:38 -0000 The branch releng/13.0 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f122a871922561b7857ec80745f3e2d9531a8862 commit f122a871922561b7857ec80745f3e2d9531a8862 Author: Edward Tomasz Napierala AuthorDate: 2021-02-02 14:40:38 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-04 23:29:08 +0000 Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linux In /etc/rc.d/linux the mounting paths of procfs, sysfs and devfs are hardcoded to "/compat/linux". Switching to the content of compat.linux.emul_path sysctl would allow to switch linuxulator to different place. Approved by: re (gjb) Submitted by: freebsdnewbie_freenet.de Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27807 (cherry picked from commit e40787f900f3c262d5134d342e5a16757dd2193c) (cherry picked from commit 1b2802ed4ed09746d6870080f85d79a9ccd782b0) --- libexec/rc/rc.d/linux | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index 4fe9cee6e751..4381b62cc660 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -18,6 +18,7 @@ stop_cmd=":" linux_start() { local _emul_path _tmpdir + _emul_path="$(sysctl -n compat.linux.emul_path)" load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in @@ -25,11 +26,11 @@ linux_start() load_kld -e 'linux64elf' linux64 ;; esac - if [ -x /compat/linux/sbin/ldconfigDisabled ]; then + if [ -x ${_emul_path}/sbin/ldconfigDisabled ]; then _tmpdir=`mktemp -d -t linux-ldconfig` - /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache - if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then - cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache + ${_emul_path}/sbin/ldconfig -C ${_tmpdir}/ld.so.cache + if ! cmp -s ${_tmpdir}/ld.so.cache ${_emul_path}/etc/ld.so.cache; then + cat ${_tmpdir}/ld.so.cache > ${_emul_path}/etc/ld.so.cache fi rm -rf ${_tmpdir} fi @@ -47,7 +48,6 @@ linux_start() fi if checkyesno linux_mounts_enable; then - _emul_path="/compat/linux" mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc" mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys" mount -o nocover -t devfs devfs "${_emul_path}/dev" From owner-dev-commits-src-all@freebsd.org Fri Mar 5 00:36:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D91B55F315; Fri, 5 Mar 2021 00:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds81g6KyLz56BP; Fri, 5 Mar 2021 00:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9814926BAC; Fri, 5 Mar 2021 00:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1250adJu098563; Fri, 5 Mar 2021 00:36:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1250adOu098562; Fri, 5 Mar 2021 00:36:39 GMT (envelope-from git) Date: Fri, 5 Mar 2021 00:36:39 GMT Message-Id: <202103050036.1250adOu098562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 9d39df7bd9c0 - releng/13.0 - Don't check compat.linux.emul_path before loading linux(4) 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9d39df7bd9c03cca8ad9f90e08f1577db55e4449 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 00:36:40 -0000 The branch releng/13.0 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=9d39df7bd9c03cca8ad9f90e08f1577db55e4449 commit 9d39df7bd9c03cca8ad9f90e08f1577db55e4449 Author: Edward Tomasz Napierala AuthorDate: 2021-02-08 21:52:31 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-04 23:29:15 +0000 Don't check compat.linux.emul_path before loading linux(4) Fix e40787f900f to make libexec/rc/rc.d/linux retrieve the sysctl after loading the kernel module which provides it, not before. Approved by: re (gjb) Reported By: jkim Sponsored By: The FreeBSD Foundation (cherry picked from commit 07cac176fba947381c8111b8e02e8067e7fa542a) (cherry picked from commit 5dc2e1bcf41f853b31b6d08a5c2d643408e890f3) --- libexec/rc/rc.d/linux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index 4381b62cc660..f44a9d02fc8d 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -18,7 +18,6 @@ stop_cmd=":" linux_start() { local _emul_path _tmpdir - _emul_path="$(sysctl -n compat.linux.emul_path)" load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in @@ -26,6 +25,9 @@ linux_start() load_kld -e 'linux64elf' linux64 ;; esac + + _emul_path="$(sysctl -n compat.linux.emul_path)" + if [ -x ${_emul_path}/sbin/ldconfigDisabled ]; then _tmpdir=`mktemp -d -t linux-ldconfig` ${_emul_path}/sbin/ldconfig -C ${_tmpdir}/ld.so.cache From owner-dev-commits-src-all@freebsd.org Fri Mar 5 00:36:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E04E255EC4B; Fri, 5 Mar 2021 00:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds81h6zv7z56VV; Fri, 5 Mar 2021 00:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD44B26BAD; Fri, 5 Mar 2021 00:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1250aeUl098582; Fri, 5 Mar 2021 00:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1250aeL6098581; Fri, 5 Mar 2021 00:36:40 GMT (envelope-from git) Date: Fri, 5 Mar 2021 00:36:40 GMT Message-Id: <202103050036.1250aeL6098581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: fdd7609f1023 - releng/13.0 - linux: fix handling of flags for 32 bit send(2) syscall 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: fdd7609f10236df34c8d8ae2d6f2dae46e0e96cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 00:36:42 -0000 The branch releng/13.0 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=fdd7609f10236df34c8d8ae2d6f2dae46e0e96cf commit fdd7609f10236df34c8d8ae2d6f2dae46e0e96cf Author: Edward Tomasz Napierala AuthorDate: 2021-02-05 17:24:23 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-04 23:29:22 +0000 linux: fix handling of flags for 32 bit send(2) syscall Previously the flags were passed as-is, which could resulted in spurious EAGAIN returned for non-blocking sockets, which broke some Steam games. Approved by: re (gjb) PR: 248065 Reported By: Alex S Tested By: Alex S Reviewed By: emaste MFC After: 3 days Sponsored By: The FreeBSD Foundation (cherry picked from commit f6e8256a965d5b7a7d43034ea31b2430a3b51066) (cherry picked from commit 9d930fb09072d21464288df8c834cb8d0b760073) --- sys/compat/linux/linux_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 5bfcdbb8fd21..c723af9dfba0 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1178,7 +1178,7 @@ linux_send(struct thread *td, struct linux_send_args *args) bsd_args.s = args->s; bsd_args.buf = (caddr_t)PTRIN(args->msg); bsd_args.len = args->len; - bsd_args.flags = args->flags; + bsd_args.flags = linux_to_bsd_msg_flags(args->flags); bsd_args.to = NULL; bsd_args.tolen = 0; error = sys_sendto(td, &bsd_args); From owner-dev-commits-src-all@freebsd.org Fri Mar 5 00:52:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 442B455F8EA; Fri, 5 Mar 2021 00:52: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 4Ds8Md1X0Mz57fZ; Fri, 5 Mar 2021 00:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 277E227169; Fri, 5 Mar 2021 00:52: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 1250qDeK023821; Fri, 5 Mar 2021 00:52:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1250qDsW023820; Fri, 5 Mar 2021 00:52:13 GMT (envelope-from git) Date: Fri, 5 Mar 2021 00:52:13 GMT Message-Id: <202103050052.1250qDsW023820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 60e8939aa85b - releng/13.0 - update to RC1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 60e8939aa85b07f3271dcc01730727dda04c8bf6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 00:52:13 -0000 The branch releng/13.0 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=60e8939aa85b07f3271dcc01730727dda04c8bf6 commit 60e8939aa85b07f3271dcc01730727dda04c8bf6 Author: Glen Barber AuthorDate: 2021-03-05 00:51:39 +0000 Commit: Glen Barber CommitDate: 2021-03-05 00:52:07 +0000 update to RC1 Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 1056611889cf..e2c07563f53b 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="BETA4" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-all@freebsd.org Fri Mar 5 00:53:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D50455FF92; Fri, 5 Mar 2021 00:53: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 4Ds8Pb42KVz57kP; Fri, 5 Mar 2021 00:53: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 7D5F527385; Fri, 5 Mar 2021 00:53: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 1250rtKV024179; Fri, 5 Mar 2021 00:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1250rtTO024178; Fri, 5 Mar 2021 00:53:55 GMT (envelope-from git) Date: Fri, 5 Mar 2021 00:53:55 GMT Message-Id: <202103050053.1250rtTO024178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 5ea5c72f5226 - stable/13 - Remove pointless lun->be_lun checks. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ea5c72f5226a5d06e6e994ab45f889030f35fa4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 00:53:55 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea5c72f5226a5d06e6e994ab45f889030f35fa4 commit 5ea5c72f5226a5d06e6e994ab45f889030f35fa4 Author: Alexander Motin AuthorDate: 2021-02-26 00:45:59 +0000 Commit: Alexander Motin CommitDate: 2021-03-05 00:53:53 +0000 Remove pointless lun->be_lun checks. There is no such thing as LUN without backend, at least for years. MFC after: 1 week (cherry picked from commit a9bd22814f680ce87259d56155204f9294e684ce) --- sys/cam/ctl/ctl.c | 13 +++++-------- sys/cam/ctl/ctl_tpc.c | 6 +++--- sys/cam/ctl/ctl_tpc_local.c | 6 +++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 37962eb3522c..bb8fbf910857 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -11023,16 +11023,15 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, return (CTL_ACTION_BLOCK); case CTL_SER_EXTENT: return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun && lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); + (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); case CTL_SER_EXTENTOPT: if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) != SCP_QUEUE_ALG_UNRESTRICTED) return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun && - lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); + (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); return (CTL_ACTION_PASS); case CTL_SER_EXTENTSEQ: - if (lun->be_lun && lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF) + if (lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF) return (ctl_extent_check_seq(ooa_io, pending_io)); return (CTL_ACTION_PASS); case CTL_SER_PASS: @@ -11276,8 +11275,7 @@ ctl_scsiio_lun_check(struct ctl_lun *lun, } if (entry->pattern & CTL_LUN_PAT_WRITE) { - if (lun->be_lun && - lun->be_lun->flags & CTL_LUN_FLAG_READONLY) { + if (lun->be_lun->flags & CTL_LUN_FLAG_READONLY) { ctl_set_hw_write_protected(ctsio); retval = 1; goto bailout; @@ -13269,8 +13267,7 @@ ctl_serseq_done(union ctl_io *io) { struct ctl_lun *lun = CTL_LUN(io); - if (lun->be_lun == NULL || - lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF) + if (lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF) return; mtx_lock(&lun->lun_lock); io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE; diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c index 456157749c89..d63435b38762 100644 --- a/sys/cam/ctl/ctl_tpc.c +++ b/sys/cam/ctl/ctl_tpc.c @@ -759,12 +759,12 @@ tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss, { if (idx == 0xffff) { - if (ss && list->lun->be_lun) + if (ss) *ss = list->lun->be_lun->blocksize; - if (pb && list->lun->be_lun) + if (pb) *pb = list->lun->be_lun->blocksize << list->lun->be_lun->pblockexp; - if (pbo && list->lun->be_lun) + if (pbo) *pbo = list->lun->be_lun->blocksize * list->lun->be_lun->pblockoff; return (list->lun->lun); diff --git a/sys/cam/ctl/ctl_tpc_local.c b/sys/cam/ctl/ctl_tpc_local.c index 714240fe8228..c2d628033037 100644 --- a/sys/cam/ctl/ctl_tpc_local.c +++ b/sys/cam/ctl/ctl_tpc_local.c @@ -294,12 +294,12 @@ tpcl_resolve(struct ctl_softc *softc, int init_port, lun->lun_devid->len, &cscdid->codeset, cscdid->length + 4) == 0) { lunid = lun->lun; - if (ss && lun->be_lun) + if (ss) *ss = lun->be_lun->blocksize; - if (ps && lun->be_lun) + if (ps) *ps = lun->be_lun->blocksize << lun->be_lun->pblockexp; - if (pso && lun->be_lun) + if (pso) *pso = lun->be_lun->blocksize * lun->be_lun->pblockoff; break; From owner-dev-commits-src-all@freebsd.org Fri Mar 5 00:54:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E140955FF9D; Fri, 5 Mar 2021 00:54: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 4Ds8Pr5cVzz57nb; Fri, 5 Mar 2021 00:54: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 9066227046; Fri, 5 Mar 2021 00:54: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 1250s84G024315; Fri, 5 Mar 2021 00:54:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1250s8qi024314; Fri, 5 Mar 2021 00:54:08 GMT (envelope-from git) Date: Fri, 5 Mar 2021 00:54:08 GMT Message-Id: <202103050054.1250s8qi024314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 3f926f5aed36 - stable/12 - Remove pointless lun->be_lun checks. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3f926f5aed36764246b45d0f2d5353700c4e9efb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 00:54:09 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3f926f5aed36764246b45d0f2d5353700c4e9efb commit 3f926f5aed36764246b45d0f2d5353700c4e9efb Author: Alexander Motin AuthorDate: 2021-02-26 00:45:59 +0000 Commit: Alexander Motin CommitDate: 2021-03-05 00:54:06 +0000 Remove pointless lun->be_lun checks. There is no such thing as LUN without backend, at least for years. MFC after: 1 week (cherry picked from commit a9bd22814f680ce87259d56155204f9294e684ce) --- sys/cam/ctl/ctl.c | 13 +++++-------- sys/cam/ctl/ctl_tpc.c | 6 +++--- sys/cam/ctl/ctl_tpc_local.c | 6 +++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index eba493746589..5ee6810f960a 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -11035,16 +11035,15 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, return (CTL_ACTION_BLOCK); case CTL_SER_EXTENT: return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun && lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); + (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); case CTL_SER_EXTENTOPT: if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) != SCP_QUEUE_ALG_UNRESTRICTED) return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun && - lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); + (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); return (CTL_ACTION_PASS); case CTL_SER_EXTENTSEQ: - if (lun->be_lun && lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF) + if (lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF) return (ctl_extent_check_seq(ooa_io, pending_io)); return (CTL_ACTION_PASS); case CTL_SER_PASS: @@ -11288,8 +11287,7 @@ ctl_scsiio_lun_check(struct ctl_lun *lun, } if (entry->pattern & CTL_LUN_PAT_WRITE) { - if (lun->be_lun && - lun->be_lun->flags & CTL_LUN_FLAG_READONLY) { + if (lun->be_lun->flags & CTL_LUN_FLAG_READONLY) { ctl_set_hw_write_protected(ctsio); retval = 1; goto bailout; @@ -13288,8 +13286,7 @@ ctl_serseq_done(union ctl_io *io) { struct ctl_lun *lun = CTL_LUN(io);; - if (lun->be_lun == NULL || - lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF) + if (lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF) return; mtx_lock(&lun->lun_lock); io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE; diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c index 00fb3a52b3d4..fb9cce5de258 100644 --- a/sys/cam/ctl/ctl_tpc.c +++ b/sys/cam/ctl/ctl_tpc.c @@ -759,12 +759,12 @@ tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss, { if (idx == 0xffff) { - if (ss && list->lun->be_lun) + if (ss) *ss = list->lun->be_lun->blocksize; - if (pb && list->lun->be_lun) + if (pb) *pb = list->lun->be_lun->blocksize << list->lun->be_lun->pblockexp; - if (pbo && list->lun->be_lun) + if (pbo) *pbo = list->lun->be_lun->blocksize * list->lun->be_lun->pblockoff; return (list->lun->lun); diff --git a/sys/cam/ctl/ctl_tpc_local.c b/sys/cam/ctl/ctl_tpc_local.c index f88565db8355..60a8630218af 100644 --- a/sys/cam/ctl/ctl_tpc_local.c +++ b/sys/cam/ctl/ctl_tpc_local.c @@ -295,12 +295,12 @@ tpcl_resolve(struct ctl_softc *softc, int init_port, lun->lun_devid->len, &cscdid->codeset, cscdid->length + 4) == 0) { lunid = lun->lun; - if (ss && lun->be_lun) + if (ss) *ss = lun->be_lun->blocksize; - if (ps && lun->be_lun) + if (ps) *ps = lun->be_lun->blocksize << lun->be_lun->pblockexp; - if (pso && lun->be_lun) + if (pso) *pso = lun->be_lun->blocksize * lun->be_lun->pblockoff; break; From owner-dev-commits-src-all@freebsd.org Fri Mar 5 01:23:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2B63561855; Fri, 5 Mar 2021 01:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds93y56nfz3C6M; Fri, 5 Mar 2021 01:23: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 A269827731; Fri, 5 Mar 2021 01:23: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 1251NgCl064438; Fri, 5 Mar 2021 01:23:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1251NgtZ064436; Fri, 5 Mar 2021 01:23:42 GMT (envelope-from git) Date: Fri, 5 Mar 2021 01:23:42 GMT Message-Id: <202103050123.1251NgtZ064436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 7e166d608eec - stable/13 - ixl(4): Fix VLAN HW filtering MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7e166d608eecf0188bbb7edf6b3d9abffe1dfc6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 01:23:42 -0000 The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=7e166d608eecf0188bbb7edf6b3d9abffe1dfc6b commit 7e166d608eecf0188bbb7edf6b3d9abffe1dfc6b Author: Krzysztof Galazka AuthorDate: 2021-02-03 23:22:55 +0000 Commit: Eric Joyner CommitDate: 2021-03-05 01:23:18 +0000 ixl(4): Fix VLAN HW filtering X700 family of controllers has limited number of available VLAN HW filters. Driver did not handle properly a case when user assigned more VLANs to the interface which had all filters already in use. Fix that by disabling HW filtering when it is impossible to create filters for all requested VLANs. Keep track of registered VLANs using bitstring to be able to re-enable HW filtering when number of requested VLANs drops below the limit. Also switch all allocations to use M_IXL malloc type to ease detecting memory leaks in the driver. Reviewed by: erj Tested by: gowtham.kumar.ks@intel.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28137 (cherry picked from commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa) --- sys/dev/ixl/i40e_osdep.c | 4 +- sys/dev/ixl/iavf.h | 7 + sys/dev/ixl/iavf_vc.c | 20 +- sys/dev/ixl/if_iavf.c | 20 +- sys/dev/ixl/if_ixl.c | 81 ++++--- sys/dev/ixl/ixl.h | 49 ++-- sys/dev/ixl/ixl_iw.c | 8 +- sys/dev/ixl/ixl_pf.h | 19 +- sys/dev/ixl/ixl_pf_iflib.c | 37 +-- sys/dev/ixl/ixl_pf_iov.c | 4 +- sys/dev/ixl/ixl_pf_main.c | 551 ++++++++++++++++++++++++++++++--------------- 11 files changed, 487 insertions(+), 313 deletions(-) diff --git a/sys/dev/ixl/i40e_osdep.c b/sys/dev/ixl/i40e_osdep.c index df6848dff3f2..20eb02c85d67 100644 --- a/sys/dev/ixl/i40e_osdep.c +++ b/sys/dev/ixl/i40e_osdep.c @@ -51,14 +51,14 @@ i40e_dmamap_cb(void *arg, bus_dma_segment_t * segs, int nseg, int error) i40e_status i40e_allocate_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size) { - mem->va = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); + mem->va = malloc(size, M_IXL, M_NOWAIT | M_ZERO); return (mem->va == NULL); } i40e_status i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem) { - free(mem->va, M_DEVBUF); + free(mem->va, M_IXL); mem->va = NULL; return (I40E_SUCCESS); diff --git a/sys/dev/ixl/iavf.h b/sys/dev/ixl/iavf.h index e2a546f450d4..9a7716c5e5a2 100644 --- a/sys/dev/ixl/iavf.h +++ b/sys/dev/ixl/iavf.h @@ -43,6 +43,13 @@ #define IAVF_MAX_QUEUES 16 #define IAVF_AQ_TIMEOUT (1 * hz) +/* MacVlan Flags */ +#define IAVF_FILTER_USED (u16)(1 << 0) +#define IAVF_FILTER_VLAN (u16)(1 << 1) +#define IAVF_FILTER_ADD (u16)(1 << 2) +#define IAVF_FILTER_DEL (u16)(1 << 3) +#define IAVF_FILTER_MC (u16)(1 << 4) + #define IAVF_FLAG_AQ_ENABLE_QUEUES (u32)(1 << 0) #define IAVF_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) #define IAVF_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) diff --git a/sys/dev/ixl/iavf_vc.c b/sys/dev/ixl/iavf_vc.c index 2a77f390faaa..ed9cc8432438 100644 --- a/sys/dev/ixl/iavf_vc.c +++ b/sys/dev/ixl/iavf_vc.c @@ -456,7 +456,7 @@ iavf_add_vlans(struct iavf_sc *sc) /* Get count of VLAN filters to add */ SLIST_FOREACH(f, sc->vlan_filters, next) { - if (f->flags & IXL_FILTER_ADD) + if (f->flags & IAVF_FILTER_ADD) cnt++; } @@ -484,9 +484,9 @@ iavf_add_vlans(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH_SAFE(f, sc->vlan_filters, next, ftmp) { - if (f->flags & IXL_FILTER_ADD) { + if (f->flags & IAVF_FILTER_ADD) { bcopy(&f->vlan, &v->vlan_id[i], sizeof(u16)); - f->flags = IXL_FILTER_USED; + f->flags = IAVF_FILTER_USED; i++; } if (i == cnt) @@ -514,7 +514,7 @@ iavf_del_vlans(struct iavf_sc *sc) /* Get count of VLAN filters to delete */ SLIST_FOREACH(f, sc->vlan_filters, next) { - if (f->flags & IXL_FILTER_DEL) + if (f->flags & IAVF_FILTER_DEL) cnt++; } @@ -542,7 +542,7 @@ iavf_del_vlans(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH_SAFE(f, sc->vlan_filters, next, ftmp) { - if (f->flags & IXL_FILTER_DEL) { + if (f->flags & IAVF_FILTER_DEL) { bcopy(&f->vlan, &v->vlan_id[i], sizeof(u16)); i++; SLIST_REMOVE(sc->vlan_filters, f, iavf_vlan_filter, next); @@ -575,7 +575,7 @@ iavf_add_ether_filters(struct iavf_sc *sc) /* Get count of MAC addresses to add */ SLIST_FOREACH(f, sc->mac_filters, next) { - if (f->flags & IXL_FILTER_ADD) + if (f->flags & IAVF_FILTER_ADD) cnt++; } if (cnt == 0) { /* Should not happen... */ @@ -597,9 +597,9 @@ iavf_add_ether_filters(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH(f, sc->mac_filters, next) { - if (f->flags & IXL_FILTER_ADD) { + if (f->flags & IAVF_FILTER_ADD) { bcopy(f->macaddr, a->list[j].addr, ETHER_ADDR_LEN); - f->flags &= ~IXL_FILTER_ADD; + f->flags &= ~IAVF_FILTER_ADD; j++; iavf_dbg_vc(sc, "ADD: " MAC_FORMAT "\n", @@ -633,7 +633,7 @@ iavf_del_ether_filters(struct iavf_sc *sc) /* Get count of MAC addresses to delete */ SLIST_FOREACH(f, sc->mac_filters, next) { - if (f->flags & IXL_FILTER_DEL) + if (f->flags & IAVF_FILTER_DEL) cnt++; } if (cnt == 0) { @@ -655,7 +655,7 @@ iavf_del_ether_filters(struct iavf_sc *sc) /* Scan the filter array */ SLIST_FOREACH_SAFE(f, sc->mac_filters, next, f_temp) { - if (f->flags & IXL_FILTER_DEL) { + if (f->flags & IAVF_FILTER_DEL) { bcopy(f->macaddr, d->list[j].addr, ETHER_ADDR_LEN); iavf_dbg_vc(sc, "DEL: " MAC_FORMAT "\n", MAC_FORMAT_ARGS(f->macaddr)); diff --git a/sys/dev/ixl/if_iavf.c b/sys/dev/ixl/if_iavf.c index 2079e2d7306b..394656d27a2f 100644 --- a/sys/dev/ixl/if_iavf.c +++ b/sys/dev/ixl/if_iavf.c @@ -663,7 +663,7 @@ iavf_if_init(if_ctx_t ctx) iavf_send_vc_msg(sc, IAVF_FLAG_AQ_DISABLE_QUEUES); bcopy(IF_LLADDR(ifp), tmpaddr, ETHER_ADDR_LEN); - if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && + if (!ixl_ether_is_equal(hw->mac.addr, tmpaddr) && (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { error = iavf_del_mac_filter(sc, hw->mac.addr); if (error == 0) @@ -1233,7 +1233,7 @@ iavf_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) struct iavf_sc *sc = arg; int error; - error = iavf_add_mac_filter(sc, (u8*)LLADDR(sdl), IXL_FILTER_MC); + error = iavf_add_mac_filter(sc, (u8*)LLADDR(sdl), IAVF_FILTER_MC); return (!error); } @@ -1404,7 +1404,7 @@ iavf_if_vlan_register(if_ctx_t ctx, u16 vtag) v = malloc(sizeof(struct iavf_vlan_filter), M_IAVF, M_WAITOK | M_ZERO); SLIST_INSERT_HEAD(sc->vlan_filters, v, next); v->vlan = vtag; - v->flags = IXL_FILTER_ADD; + v->flags = IAVF_FILTER_ADD; iavf_send_vc_msg(sc, IAVF_FLAG_AQ_ADD_VLAN_FILTER); } @@ -1422,7 +1422,7 @@ iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag) SLIST_FOREACH(v, sc->vlan_filters, next) { if (v->vlan == vtag) { - v->flags = IXL_FILTER_DEL; + v->flags = IAVF_FILTER_DEL; ++i; --vsi->num_vlans; } @@ -1624,7 +1624,7 @@ iavf_find_mac_filter(struct iavf_sc *sc, u8 *macaddr) bool match = FALSE; SLIST_FOREACH(f, sc->mac_filters, next) { - if (cmp_etheraddr(f->macaddr, macaddr)) { + if (ixl_ether_is_equal(f->macaddr, macaddr)) { match = TRUE; break; } @@ -1828,9 +1828,9 @@ iavf_init_multi(struct iavf_sc *sc) /* First clear any multicast filters */ SLIST_FOREACH(f, sc->mac_filters, next) { - if ((f->flags & IXL_FILTER_USED) - && (f->flags & IXL_FILTER_MC)) { - f->flags |= IXL_FILTER_DEL; + if ((f->flags & IAVF_FILTER_USED) + && (f->flags & IAVF_FILTER_MC)) { + f->flags |= IAVF_FILTER_DEL; mcnt++; } } @@ -2034,7 +2034,7 @@ iavf_add_mac_filter(struct iavf_sc *sc, u8 *macaddr, u16 flags) MAC_FORMAT_ARGS(macaddr)); bcopy(macaddr, f->macaddr, ETHER_ADDR_LEN); - f->flags |= (IXL_FILTER_ADD | IXL_FILTER_USED); + f->flags |= (IAVF_FILTER_ADD | IAVF_FILTER_USED); f->flags |= flags; return (0); } @@ -2051,7 +2051,7 @@ iavf_del_mac_filter(struct iavf_sc *sc, u8 *macaddr) if (f == NULL) return (ENOENT); - f->flags |= IXL_FILTER_DEL; + f->flags |= IAVF_FILTER_DEL; return (0); } diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 097d4b480891..340565d66bc8 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -127,7 +127,6 @@ static void ixl_if_vflr_handle(if_ctx_t ctx); #endif /*** Other ***/ -static u_int ixl_mc_filter_apply(void *, struct sockaddr_dl *, u_int); static void ixl_save_pf_tunables(struct ixl_pf *); static int ixl_allocate_pci_resources(struct ixl_pf *); static void ixl_setup_ssctx(struct ixl_pf *pf); @@ -862,7 +861,7 @@ ixl_if_detach(if_ctx_t ctx) ixl_pf_qmgr_destroy(&pf->qmgr); ixl_free_pci_resources(pf); - ixl_free_mac_filters(vsi); + ixl_free_filters(&vsi->ftl); INIT_DBG_DEV(dev, "end"); return (0); } @@ -937,9 +936,9 @@ ixl_if_init(if_ctx_t ctx) /* Get the latest mac address... User might use a LAA */ bcopy(IF_LLADDR(vsi->ifp), tmpaddr, ETH_ALEN); - if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && + if (!ixl_ether_is_equal(hw->mac.addr, tmpaddr) && (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { - ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + ixl_del_all_vlan_filters(vsi, hw->mac.addr); bcopy(tmpaddr, hw->mac.addr, ETH_ALEN); ret = i40e_aq_mac_address_write(hw, I40E_AQC_WRITE_TYPE_LAA_ONLY, @@ -948,7 +947,10 @@ ixl_if_init(if_ctx_t ctx) device_printf(dev, "LLA address change failed!!\n"); return; } - ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + /* + * New filters are configured by ixl_reconfigure_filters + * at the end of ixl_init_locked. + */ } iflib_set_mac(ctx, hw->mac.addr); @@ -1385,7 +1387,7 @@ ixl_if_update_admin_status(if_ctx_t ctx) struct i40e_hw *hw = &pf->hw; u16 pending; - if (pf->state & IXL_PF_STATE_ADAPTER_RESETTING) + if (IXL_PF_IS_RESETTING(pf)) ixl_handle_empr_reset(pf); /* @@ -1418,32 +1420,22 @@ ixl_if_multi_set(if_ctx_t ctx) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; - int mcnt, flags; - int del_mcnt; + int mcnt; IOCTL_DEBUGOUT("ixl_if_multi_set: begin"); - mcnt = min(if_llmaddr_count(iflib_get_ifp(ctx)), MAX_MULTICAST_ADDR); /* Delete filters for removed multicast addresses */ - del_mcnt = ixl_del_multi(vsi); - vsi->num_macs -= del_mcnt; + ixl_del_multi(vsi, false); + mcnt = min(if_llmaddr_count(iflib_get_ifp(ctx)), MAX_MULTICAST_ADDR); if (__predict_false(mcnt == MAX_MULTICAST_ADDR)) { i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, TRUE, NULL); + ixl_del_multi(vsi, true); return; } - /* (re-)install filters for all mcast addresses */ - /* XXX: This bypasses filter count tracking code! */ - mcnt = if_foreach_llmaddr(iflib_get_ifp(ctx), ixl_mc_filter_apply, vsi); - if (mcnt > 0) { - vsi->num_macs += mcnt; - flags = (IXL_FILTER_ADD | IXL_FILTER_USED | IXL_FILTER_MC); - ixl_add_hw_filters(vsi, flags, mcnt); - } - ixl_dbg_filter(pf, "%s: filter mac total: %d\n", - __func__, vsi->num_macs); + ixl_add_multi(vsi); IOCTL_DEBUGOUT("ixl_if_multi_set: end"); } @@ -1661,12 +1653,35 @@ ixl_if_vlan_register(if_ctx_t ctx, u16 vtag) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; + if_t ifp = iflib_get_ifp(ctx); if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; + /* + * Keep track of registered VLANS to know what + * filters have to be configured when VLAN_HWFILTER + * capability is enabled. + */ ++vsi->num_vlans; - ixl_add_filter(vsi, hw->mac.addr, vtag); + bit_set(vsi->vlans_map, vtag); + + if ((if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) == 0) + return; + + if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS) + ixl_add_filter(vsi, hw->mac.addr, vtag); + else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS) { + /* + * There is not enough HW resources to add filters + * for all registered VLANs. Re-configure filtering + * to allow reception of all expected traffic. + */ + device_printf(vsi->dev, + "Not enough HW filters for all VLANs. VLAN HW filtering disabled"); + ixl_del_all_vlan_filters(vsi, hw->mac.addr); + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + } } static void @@ -1675,12 +1690,23 @@ ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; + if_t ifp = iflib_get_ifp(ctx); if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; --vsi->num_vlans; - ixl_del_filter(vsi, hw->mac.addr, vtag); + bit_clear(vsi->vlans_map, vtag); + + if ((if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) == 0) + return; + + if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS) + ixl_del_filter(vsi, hw->mac.addr, vtag); + else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS) { + ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + ixl_add_vlan_filters(vsi, hw->mac.addr); + } } static uint64_t @@ -1798,15 +1824,6 @@ ixl_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) } } -static u_int -ixl_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) -{ - struct ixl_vsi *vsi = arg; - - ixl_add_mc_filter(vsi, (u8*)LLADDR(sdl)); - return (1); -} - /* * Sanity check and save off tunable values. */ diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 65e92c470a6c..3eb0fa4f6b5a 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -187,15 +188,15 @@ #define IXL_BULK_LATENCY 2 /* MacVlan Flags */ -#define IXL_FILTER_USED (u16)(1 << 0) -#define IXL_FILTER_VLAN (u16)(1 << 1) -#define IXL_FILTER_ADD (u16)(1 << 2) -#define IXL_FILTER_DEL (u16)(1 << 3) -#define IXL_FILTER_MC (u16)(1 << 4) +#define IXL_FILTER_VLAN (u16)(1 << 0) +#define IXL_FILTER_MC (u16)(1 << 1) /* used in the vlan field of the filter when not a vlan */ #define IXL_VLAN_ANY -1 +/* Maximum number of MAC/VLAN filters supported by HW */ +#define IXL_MAX_VLAN_FILTERS 256 + #define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) #define CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6) #define CSUM_OFFLOAD (CSUM_OFFLOAD_IPV4|CSUM_OFFLOAD_IPV6|CSUM_TSO) @@ -303,16 +304,18 @@ /* For stats sysctl naming */ #define IXL_QUEUE_NAME_LEN 32 +MALLOC_DECLARE(M_IXL); + #define IXL_DEV_ERR(_dev, _format, ...) \ device_printf(_dev, "%s: " _format " (%s:%d)\n", __func__, ##__VA_ARGS__, __FILE__, __LINE__) /* ***************************************************************************** * vendor_info_array - * + * * This array contains the list of Subvendor/Subdevice IDs on which the driver * should load. - * + * ***************************************************************************** */ typedef struct _ixl_vendor_info_t { @@ -328,7 +331,7 @@ typedef struct _ixl_vendor_info_t { ** addresses, vlans, and mac filters all use it. */ struct ixl_mac_filter { - SLIST_ENTRY(ixl_mac_filter) next; + LIST_ENTRY(ixl_mac_filter) ftle; u8 macaddr[ETHER_ADDR_LEN]; s16 vlan; u16 flags; @@ -414,7 +417,7 @@ struct ixl_rx_queue { /* ** Virtual Station Interface */ -SLIST_HEAD(ixl_ftl_head, ixl_mac_filter); +LIST_HEAD(ixl_ftl_head, ixl_mac_filter); struct ixl_vsi { if_ctx_t ctx; if_softc_ctx_t shared; @@ -452,6 +455,8 @@ struct ixl_vsi { /* Contains readylist & stat counter id */ struct i40e_aqc_vsi_properties_data info; +#define IXL_VLANS_MAP_LEN EVL_VLID_MASK + 1 + bitstr_t bit_decl(vlans_map, IXL_VLANS_MAP_LEN); u16 num_vlans; /* Per-VSI stats from hardware */ @@ -478,32 +483,16 @@ struct ixl_vsi { struct sysctl_ctx_list sysctl_ctx; }; -/* -** Creates new filter with given MAC address and VLAN ID -*/ -static inline struct ixl_mac_filter * -ixl_new_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) -{ - struct ixl_mac_filter *f; - - /* create a new empty filter */ - f = malloc(sizeof(struct ixl_mac_filter), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (f) { - SLIST_INSERT_HEAD(&vsi->ftl, f, next); - bcopy(macaddr, f->macaddr, ETHER_ADDR_LEN); - f->vlan = vlan; - f->flags |= (IXL_FILTER_ADD | IXL_FILTER_USED); - } - - return (f); -} +struct ixl_add_maddr_arg { + struct ixl_ftl_head to_add; + struct ixl_vsi *vsi; +}; /* ** Compare two ethernet addresses */ static inline bool -cmp_etheraddr(const u8 *ea1, const u8 *ea2) +ixl_ether_is_equal(const u8 *ea1, const u8 *ea2) { return (bcmp(ea1, ea2, ETHER_ADDR_LEN) == 0); } diff --git a/sys/dev/ixl/ixl_iw.c b/sys/dev/ixl/ixl_iw.c index 6557e9dca4b3..5e2d7cfcb30b 100644 --- a/sys/dev/ixl/ixl_iw.c +++ b/sys/dev/ixl/ixl_iw.c @@ -238,7 +238,7 @@ ixl_iw_pf_attach(struct ixl_pf *pf) } pf_entry = malloc(sizeof(struct ixl_iw_pf_entry), - M_DEVBUF, M_NOWAIT | M_ZERO); + M_IXL, M_NOWAIT | M_ZERO); if (pf_entry == NULL) { device_printf(pf->dev, "%s: failed to allocate memory to attach new PF\n", @@ -289,7 +289,7 @@ ixl_iw_pf_detach(struct ixl_pf *pf) goto out; } LIST_REMOVE(pf_entry, node); - free(pf_entry, M_DEVBUF); + free(pf_entry, M_IXL); ixl_iw_ref_cnt--; out: @@ -414,7 +414,7 @@ ixl_iw_register(struct ixl_iw_ops *ops) taskqueue_start_threads(&ixl_iw.tq, 1, PI_NET, "ixl iw"); ixl_iw.ops = malloc(sizeof(struct ixl_iw_ops), - M_DEVBUF, M_NOWAIT | M_ZERO); + M_IXL, M_NOWAIT | M_ZERO); if (ixl_iw.ops == NULL) { printf("%s: failed to allocate memory\n", __func__); taskqueue_free(ixl_iw.tq); @@ -481,7 +481,7 @@ ixl_iw_unregister(void) taskqueue_drain(ixl_iw.tq, &pf_entry->iw_task); taskqueue_free(ixl_iw.tq); ixl_iw.tq = NULL; - free(ixl_iw.ops, M_DEVBUF); + free(ixl_iw.ops, M_IXL); ixl_iw.ops = NULL; return (0); diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 0521ae5a4bc5..c3fbdc91d358 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -78,7 +78,7 @@ enum ixl_i2c_access_method_t { /* Used in struct ixl_pf's state field */ enum ixl_pf_state { IXL_PF_STATE_RECOVERY_MODE = (1 << 0), - IXL_PF_STATE_ADAPTER_RESETTING = (1 << 1), + IXL_PF_STATE_RESETTING = (1 << 1), IXL_PF_STATE_MDD_PENDING = (1 << 2), IXL_PF_STATE_PF_RESET_REQ = (1 << 3), IXL_PF_STATE_VF_RESET_REQ = (1 << 4), @@ -93,6 +93,8 @@ enum ixl_pf_state { #define IXL_PF_IN_RECOVERY_MODE(pf) \ ((atomic_load_acq_32(&pf->state) & IXL_PF_STATE_RECOVERY_MODE) != 0) +#define IXL_PF_IS_RESETTING(pf) \ + ((atomic_load_acq_32(&pf->state) & IXL_PF_STATE_RESETTING) != 0) struct ixl_vf { struct ixl_vsi vsi; @@ -258,8 +260,6 @@ struct ixl_pf { "\t1 - Enable (VEB)\n" \ "Enabling this will allow VFs in separate VMs to communicate over the hardware bridge." -MALLOC_DECLARE(M_IXL); - /*** Functions / Macros ***/ /* Adjust the level here to 10 or over to print stats messages */ #define I40E_VC_DEBUG(p, level, ...) \ @@ -367,6 +367,8 @@ void ixl_set_queue_tx_itr(struct ixl_tx_queue *); void ixl_add_filter(struct ixl_vsi *, const u8 *, s16 vlan); void ixl_del_filter(struct ixl_vsi *, const u8 *, s16 vlan); +void ixl_add_vlan_filters(struct ixl_vsi *, const u8 *); +void ixl_del_all_vlan_filters(struct ixl_vsi *, const u8 *); void ixl_reconfigure_filters(struct ixl_vsi *vsi); int ixl_disable_rings(struct ixl_pf *, struct ixl_vsi *, struct ixl_pf_qtag *); @@ -391,16 +393,15 @@ void ixl_enable_intr(struct ixl_vsi *); void ixl_disable_rings_intr(struct ixl_vsi *); void ixl_set_promisc(struct ixl_vsi *); void ixl_add_multi(struct ixl_vsi *); -int ixl_del_multi(struct ixl_vsi *); +void ixl_del_multi(struct ixl_vsi *, bool); void ixl_setup_vlan_filters(struct ixl_vsi *); void ixl_init_filters(struct ixl_vsi *); -void ixl_add_hw_filters(struct ixl_vsi *, int, int); -void ixl_del_hw_filters(struct ixl_vsi *, int); +void ixl_free_filters(struct ixl_ftl_head *); +void ixl_add_hw_filters(struct ixl_vsi *, struct ixl_ftl_head *, int); +void ixl_del_hw_filters(struct ixl_vsi *, struct ixl_ftl_head *, int); void ixl_del_default_hw_filters(struct ixl_vsi *); struct ixl_mac_filter * - ixl_find_filter(struct ixl_vsi *, const u8 *, s16); -void ixl_add_mc_filter(struct ixl_vsi *, u8 *); -void ixl_free_mac_filters(struct ixl_vsi *vsi); + ixl_find_filter(struct ixl_ftl_head *, const u8 *, s16); void ixl_update_vsi_stats(struct ixl_vsi *); void ixl_vsi_reset_stats(struct ixl_vsi *); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 4351f65ee5ab..2b3d035fbcfe 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -185,7 +185,7 @@ ixl_msix_adminq(void *arg) } device_printf(dev, "Reset Requested! (%s)\n", reset_type); /* overload admin queue task to check reset progress */ - atomic_set_int(&pf->state, IXL_PF_STATE_ADAPTER_RESETTING); + atomic_set_int(&pf->state, IXL_PF_STATE_RESETTING); do_task = TRUE; } @@ -866,41 +866,6 @@ ixl_set_rss_hlut(struct ixl_pf *pf) } } -/* -** This routine updates vlan filters, called by init -** it scans the filter table and then updates the hw -** after a soft reset. -*/ -void -ixl_setup_vlan_filters(struct ixl_vsi *vsi) -{ - struct ixl_mac_filter *f; - int cnt = 0, flags; - - if (vsi->num_vlans == 0) - return; - /* - ** Scan the filter list for vlan entries, - ** mark them for addition and then call - ** for the AQ update. - */ - SLIST_FOREACH(f, &vsi->ftl, next) { - if (f->flags & IXL_FILTER_VLAN) { - f->flags |= - (IXL_FILTER_ADD | - IXL_FILTER_USED); - cnt++; - } - } - if (cnt == 0) { - printf("setup vlan: no filters found!\n"); - return; - } - flags = IXL_FILTER_VLAN; - flags |= (IXL_FILTER_ADD | IXL_FILTER_USED); - ixl_add_hw_filters(vsi, flags, cnt); -} - /* For PF VSI only */ int ixl_enable_rings(struct ixl_vsi *vsi) diff --git a/sys/dev/ixl/ixl_pf_iov.c b/sys/dev/ixl/ixl_pf_iov.c index 92e434eab9fc..c3cf90d1c4b5 100644 --- a/sys/dev/ixl/ixl_pf_iov.c +++ b/sys/dev/ixl/ixl_pf_iov.c @@ -1025,7 +1025,7 @@ ixl_vf_mac_valid(struct ixl_vf *vf, const uint8_t *addr) * is not its assigned MAC. */ if (!(vf->vf_flags & VF_FLAG_SET_MAC_CAP) && - !(ETHER_IS_MULTICAST(addr) || cmp_etheraddr(addr, vf->mac))) + !(ETHER_IS_MULTICAST(addr) || !ixl_ether_is_equal(addr, vf->mac))) return (EPERM); return (0); @@ -1717,7 +1717,7 @@ ixl_if_iov_uninit(if_ctx_t ctx) if (pf->vfs[i].vsi.seid != 0) i40e_aq_delete_element(hw, pf->vfs[i].vsi.seid, NULL); ixl_pf_qmgr_release(&pf->qmgr, &pf->vfs[i].qtag); - ixl_free_mac_filters(&pf->vfs[i].vsi); + ixl_free_filters(&pf->vfs[i].vsi.ftl); ixl_dbg_iov(pf, "VF %d: %d released\n", i, pf->vfs[i].qtag.num_allocated); ixl_dbg_iov(pf, "Unallocated total: %d\n", ixl_pf_qmgr_get_num_free(&pf->qmgr)); diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index eddd4dfaab0d..2714b1a0e6d8 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -326,7 +326,7 @@ ixl_get_hw_capabilities(struct ixl_pf *pf) len = 40 * sizeof(struct i40e_aqc_list_capabilities_element_resp); retry: if (!(buf = (struct i40e_aqc_list_capabilities_element_resp *) - malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO))) { + malloc(len, M_IXL, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate cap memory\n"); return (ENOMEM); } @@ -334,7 +334,7 @@ retry: /* This populates the hw struct */ status = i40e_aq_discover_capabilities(hw, buf, len, &needed, i40e_aqc_opc_list_func_capabilities, NULL); - free(buf, M_DEVBUF); + free(buf, M_IXL); if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) && (again == TRUE)) { /* retry once with a larger buffer */ @@ -452,12 +452,67 @@ err_out: return (status); } +/* +** Creates new filter with given MAC address and VLAN ID +*/ +static struct ixl_mac_filter * +ixl_new_filter(struct ixl_ftl_head *headp, const u8 *macaddr, s16 vlan) +{ + struct ixl_mac_filter *f; + + /* create a new empty filter */ + f = malloc(sizeof(struct ixl_mac_filter), + M_IXL, M_NOWAIT | M_ZERO); + if (f) { + LIST_INSERT_HEAD(headp, f, ftle); + bcopy(macaddr, f->macaddr, ETHER_ADDR_LEN); + f->vlan = vlan; + } + + return (f); +} + +/** + * ixl_free_filters - Free all filters in given list + * headp - pointer to list head + * + * Frees memory used by each entry in the list. + * Does not remove filters from HW. + */ +void +ixl_free_filters(struct ixl_ftl_head *headp) +{ + struct ixl_mac_filter *f, *nf; + + f = LIST_FIRST(headp); + while (f != NULL) { + nf = LIST_NEXT(f, ftle); + free(f, M_IXL); + f = nf; + } + + LIST_INIT(headp); +} + static u_int ixl_add_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) { - struct ixl_vsi *vsi = arg; + struct ixl_add_maddr_arg *ama = arg; + struct ixl_vsi *vsi = ama->vsi; + const u8 *macaddr = (u8*)LLADDR(sdl); + struct ixl_mac_filter *f; - ixl_add_mc_filter(vsi, (u8*)LLADDR(sdl)); + /* Does one already exist */ + f = ixl_find_filter(&vsi->ftl, macaddr, IXL_VLAN_ANY); + if (f != NULL) + return (0); + + f = ixl_new_filter(&ama->to_add, macaddr, IXL_VLAN_ANY); + if (f == NULL) { + device_printf(vsi->dev, "WARNING: no filter available!!\n"); + return (0); + } + f->flags |= IXL_FILTER_MC; return (1); } @@ -473,28 +528,26 @@ ixl_add_multi(struct ixl_vsi *vsi) { struct ifnet *ifp = vsi->ifp; struct i40e_hw *hw = vsi->hw; - int mcnt = 0, flags; + int mcnt = 0; + struct ixl_add_maddr_arg cb_arg; IOCTL_DEBUGOUT("ixl_add_multi: begin"); - /* - ** First just get a count, to decide if we - ** we simply use multicast promiscuous. - */ mcnt = if_llmaddr_count(ifp); if (__predict_false(mcnt >= MAX_MULTICAST_ADDR)) { - /* delete existing MC filters */ - ixl_del_hw_filters(vsi, mcnt); i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, TRUE, NULL); + /* delete all existing MC filters */ + ixl_del_multi(vsi, true); return; } - mcnt = if_foreach_llmaddr(ifp, ixl_add_maddr, vsi); - if (mcnt > 0) { - flags = (IXL_FILTER_ADD | IXL_FILTER_USED | IXL_FILTER_MC); - ixl_add_hw_filters(vsi, flags, mcnt); - } + cb_arg.vsi = vsi; + LIST_INIT(&cb_arg.to_add); + + mcnt = if_foreach_llmaddr(ifp, ixl_add_maddr, &cb_arg); + if (mcnt > 0) + ixl_add_hw_filters(vsi, &cb_arg.to_add, mcnt); IOCTL_DEBUGOUT("ixl_add_multi: end"); } @@ -504,34 +557,36 @@ ixl_match_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) { struct ixl_mac_filter *f = arg; - if (cmp_etheraddr(f->macaddr, (u8 *)LLADDR(sdl))) + if (ixl_ether_is_equal(f->macaddr, (u8 *)LLADDR(sdl))) return (1); else return (0); } -int -ixl_del_multi(struct ixl_vsi *vsi) +void +ixl_del_multi(struct ixl_vsi *vsi, bool all) { + struct ixl_ftl_head to_del; struct ifnet *ifp = vsi->ifp; - struct ixl_mac_filter *f; + struct ixl_mac_filter *f, *fn; int mcnt = 0; IOCTL_DEBUGOUT("ixl_del_multi: begin"); + LIST_INIT(&to_del); /* Search for removed multicast addresses */ - SLIST_FOREACH(f, &vsi->ftl, next) - if ((f->flags & IXL_FILTER_USED) && - (f->flags & IXL_FILTER_MC) && - (if_foreach_llmaddr(ifp, ixl_match_maddr, f) == 0)) { - f->flags |= IXL_FILTER_DEL; - mcnt++; - } + LIST_FOREACH_SAFE(f, &vsi->ftl, ftle, fn) { + if ((f->flags & IXL_FILTER_MC) == 0 || + (!all && (if_foreach_llmaddr(ifp, ixl_match_maddr, f) == 0))) + continue; - if (mcnt > 0) - ixl_del_hw_filters(vsi, mcnt); + LIST_REMOVE(f, ftle); + LIST_INSERT_HEAD(&to_del, f, ftle); + mcnt++; + } - return (mcnt); + if (mcnt > 0) + ixl_del_hw_filters(vsi, &to_del, mcnt); } void @@ -738,20 +793,6 @@ ixl_switch_config(struct ixl_pf *pf) return (ret); } -void -ixl_free_mac_filters(struct ixl_vsi *vsi) -{ - struct ixl_mac_filter *f; - - while (!SLIST_EMPTY(&vsi->ftl)) { - f = SLIST_FIRST(&vsi->ftl); - SLIST_REMOVE_HEAD(&vsi->ftl, next); - free(f, M_DEVBUF); - } - - vsi->num_hw_filters = 0; -} - void ixl_vsi_add_sysctls(struct ixl_vsi * vsi, const char * sysctl_name, bool queues_sysctls) { @@ -1019,7 +1060,7 @@ ixl_init_filters(struct ixl_vsi *vsi) ixl_dbg_filter(pf, "%s: start\n", __func__); /* Initialize mac filter list for VSI */ - SLIST_INIT(&vsi->ftl); + LIST_INIT(&vsi->ftl); vsi->num_hw_filters = 0; /* Receive broadcast Ethernet frames */ @@ -1045,30 +1086,35 @@ ixl_init_filters(struct ixl_vsi *vsi) #endif } -/* -** This routine adds mulicast filters -*/ void -ixl_add_mc_filter(struct ixl_vsi *vsi, u8 *macaddr) +ixl_reconfigure_filters(struct ixl_vsi *vsi) { - struct ixl_mac_filter *f; + struct i40e_hw *hw = vsi->hw; + struct ixl_ftl_head tmp; + int cnt; - /* Does one already exist */ - f = ixl_find_filter(vsi, macaddr, IXL_VLAN_ANY); - if (f != NULL) - return; + /* + * The ixl_add_hw_filters function adds filters configured + * in HW to a list in VSI. Move all filters to a temporary + * list to avoid corrupting it by concatenating to itself. + */ + LIST_INIT(&tmp); + LIST_CONCAT(&tmp, &vsi->ftl, ixl_mac_filter, ftle); + cnt = vsi->num_hw_filters; + vsi->num_hw_filters = 0; - f = ixl_new_filter(vsi, macaddr, IXL_VLAN_ANY); - if (f != NULL) - f->flags |= IXL_FILTER_MC; - else - printf("WARNING: no filter available!!\n"); -} + ixl_add_hw_filters(vsi, &tmp, cnt); -void -ixl_reconfigure_filters(struct ixl_vsi *vsi) -{ - ixl_add_hw_filters(vsi, IXL_FILTER_USED, vsi->num_macs); + /* Filter could be removed if MAC address was changed */ + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + + if ((if_getcapenable(vsi->ifp) & IFCAP_VLAN_HWFILTER) == 0) + return; + /* + * VLAN HW filtering is enabled, make sure that filters + * for all registered VLAN tags are configured + */ + ixl_add_vlan_filters(vsi, hw->mac.addr); } /* @@ -1082,82 +1128,205 @@ ixl_add_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) struct ixl_mac_filter *f, *tmp; struct ixl_pf *pf; device_t dev; + struct ixl_ftl_head to_add; + int to_add_cnt; *** 551 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Mar 5 01:23:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBF005619CA; Fri, 5 Mar 2021 01:23: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 4Ds93z5ww9z3BqX; Fri, 5 Mar 2021 01:23: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 BE34A27645; Fri, 5 Mar 2021 01:23: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 1251NhbL064457; Fri, 5 Mar 2021 01:23:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1251Nh1t064456; Fri, 5 Mar 2021 01:23:43 GMT (envelope-from git) Date: Fri, 5 Mar 2021 01:23:43 GMT Message-Id: <202103050123.1251Nh1t064456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 8fa11f892256 - stable/13 - ix(4): Report RX errors as sum of all RX error counters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8fa11f89225695c185a8a92c7530e270e77552f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 01:23:43 -0000 The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=8fa11f89225695c185a8a92c7530e270e77552f8 commit 8fa11f89225695c185a8a92c7530e270e77552f8 Author: Piotr Pietruszewski AuthorDate: 2021-03-03 01:21:58 +0000 Commit: Eric Joyner CommitDate: 2021-03-05 01:23:18 +0000 ix(4): Report RX errors as sum of all RX error counters HW keeps track of RX errors using several counters, each for specific type of errors. Report RX errors to OS as sum of all those counters: CRC errors, illegal bytes, checksum, length, undersize, fragment, oversize and jabber errors. Also, add new "rx_errs" sysctl in the dev.ix.N.mac_stats tree. This is to provide an another way to display the sum of RX errors. Signed-off-by: Piotr Pietruszewski Reviewed By: erj Tested By: gowtham.kumar.ks@intel.com Sponsored By: Intel Corporation Differential Revision: https://reviews.freebsd.org/D27191 (cherry picked from commit afb1aa4e6df245d38fd2ba683fa521d5dabe8392) --- sys/dev/ixgbe/if_ix.c | 19 ++++++++++++++++++- sys/dev/ixgbe/ixgbe.h | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 7eb32077f8b0..9f3674cdab5d 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1531,7 +1531,22 @@ ixgbe_update_stats_counters(struct adapter *adapter) IXGBE_SET_OMCASTS(adapter, stats->mptc); IXGBE_SET_COLLISIONS(adapter, 0); IXGBE_SET_IQDROPS(adapter, total_missed_rx); - IXGBE_SET_IERRORS(adapter, stats->crcerrs + stats->rlec); + + /* + * Aggregate following types of errors as RX errors: + * - CRC error count, + * - illegal byte error count, + * - checksum error count, + * - missed packets count, + * - length error count, + * - undersized packets count, + * - fragmented packets count, + * - oversized packets count, + * - jabber count. + */ + IXGBE_SET_IERRORS(adapter, stats->crcerrs + stats->illerrc + stats->xec + + stats->mpc[0] + stats->rlec + stats->ruc + stats->rfc + stats->roc + + stats->rjc); } /* ixgbe_update_stats_counters */ /************************************************************************ @@ -1621,6 +1636,8 @@ ixgbe_add_hw_stats(struct adapter *adapter) CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MAC Statistics"); stat_list = SYSCTL_CHILDREN(stat_node); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "rx_errs", + CTLFLAG_RD, &adapter->ierrors, IXGBE_SYSCTL_DESC_RX_ERRS); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "crc_errs", CTLFLAG_RD, &stats->crcerrs, "CRC Errors"); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "ill_errs", diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 1502c7fb866e..30dd1d5368fb 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -536,6 +536,18 @@ struct adapter { "\t2 - tx pause\n" \ "\t3 - tx and rx pause" +#define IXGBE_SYSCTL_DESC_RX_ERRS \ + "\nSum of the following RX errors counters:\n" \ + " * CRC errors,\n" \ + " * illegal byte error count,\n" \ + " * checksum error count,\n" \ + " * missed packet count,\n" \ + " * length error count,\n" \ + " * undersized packets count,\n" \ + " * fragmented packets count,\n" \ + " * oversized packets count,\n" \ + " * jabber count." + /* Workaround to make 8.0 buildable */ #if __FreeBSD_version >= 800000 && __FreeBSD_version < 800504 static __inline int From owner-dev-commits-src-all@freebsd.org Fri Mar 5 01:23:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CB5D561C1D; Fri, 5 Mar 2021 01:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ds9412K6gz3C6X; Fri, 5 Mar 2021 01:23: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 F1CDA2786E; Fri, 5 Mar 2021 01:23: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 1251NiER064476; Fri, 5 Mar 2021 01:23:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1251NilY064475; Fri, 5 Mar 2021 01:23:44 GMT (envelope-from git) Date: Fri, 5 Mar 2021 01:23:44 GMT Message-Id: <202103050123.1251NilY064475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: b149f7c23d13 - stable/13 - ixl(4): Report RX errors as sum of all RX error counters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b149f7c23d13e73b92c2bf8c3691e3e1ebd833c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 01:23:46 -0000 The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=b149f7c23d13e73b92c2bf8c3691e3e1ebd833c1 commit b149f7c23d13e73b92c2bf8c3691e3e1ebd833c1 Author: Krzysztof Galazka AuthorDate: 2021-03-03 01:33:11 +0000 Commit: Eric Joyner CommitDate: 2021-03-05 01:23:18 +0000 ixl(4): Report RX errors as sum of all RX error counters HW keeps track of RX errors using several counters, each for specific type of errors. Report RX errors to OS as sum of all those counters: CRC errors, illegal bytes, checksum, length, undersize, fragment, oversize and jabber errors. There is no HW counter for frames with invalid L3/L4 checksums so add a SW one. Also add a "rx_errors" sysctl with a copy of netstat IERRORS counter value to make it easier accessible from scripts. Reviewed By: erj Tested By: gowtham.kumar.ks@intel.com Sponsored By: Intel Corporation Differential Revision: https://reviews.freebsd.org/D27639 (cherry picked from commit 9f99061ef9c95b171fc92d34026222bb5e052337) --- sys/dev/ixl/ixl.h | 1 + sys/dev/ixl/ixl_pf_main.c | 15 +++++++++++++-- sys/dev/ixl/ixl_txrx.c | 16 +++++++++------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 3eb0fa4f6b5a..9828760e4ea6 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -390,6 +390,7 @@ struct rx_ring { u64 rx_packets; u64 rx_bytes; u64 desc_errs; + u64 csum_errs; }; /* diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 2714b1a0e6d8..070ddaef522e 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -808,6 +808,11 @@ ixl_vsi_add_sysctls(struct ixl_vsi * vsi, const char * sysctl_name, bool queues_ vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); ixl_add_sysctls_eth_stats(&vsi->sysctl_ctx, vsi_list, &vsi->eth_stats); + /* Copy of netstat RX errors counter for validation purposes */ + SYSCTL_ADD_UQUAD(&vsi->sysctl_ctx, vsi_list, OID_AUTO, "rx_errors", + CTLFLAG_RD, &vsi->ierrors, + "RX packet errors"); + if (queues_sysctls) ixl_vsi_add_queues_stats(vsi, &vsi->sysctl_ctx); } @@ -2183,7 +2188,7 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) struct ixl_pf *pf; struct ifnet *ifp; struct i40e_eth_stats *es; - u64 tx_discards; + u64 tx_discards, csum_errs; struct i40e_hw_port_stats *nsd; @@ -2196,6 +2201,11 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) tx_discards = es->tx_discards + nsd->tx_dropped_link_down; + csum_errs = 0; + for (int i = 0; i < vsi->num_rx_queues; i++) + csum_errs += vsi->rx_queues[i].rxr.csum_errs; + nsd->checksum_error = csum_errs; + /* Update ifnet stats */ IXL_SET_IPACKETS(vsi, es->rx_unicast + es->rx_multicast + @@ -2209,7 +2219,8 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) IXL_SET_OMCASTS(vsi, es->tx_multicast); IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes + - nsd->rx_undersize + nsd->rx_oversize + nsd->rx_fragments + + nsd->checksum_error + nsd->rx_length_errors + + nsd->rx_undersize + nsd->rx_fragments + nsd->rx_oversize + nsd->rx_jabber); IXL_SET_OERRORS(vsi, es->tx_errors); IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c index e589bb8392cd..bdd3cb8725f8 100644 --- a/sys/dev/ixl/ixl_txrx.c +++ b/sys/dev/ixl/ixl_txrx.c @@ -51,7 +51,7 @@ #endif /* Local Prototypes */ -static void ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype); +static u8 ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype); static int ixl_isc_txd_encap(void *arg, if_pkt_info_t pi); static void ixl_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx); @@ -720,7 +720,7 @@ ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) rxr->rx_packets++; if ((if_getcapenable(vsi->ifp) & IFCAP_RXCSUM) != 0) - ixl_rx_checksum(ri, status, error, ptype); + rxr->csum_errs += ixl_rx_checksum(ri, status, error, ptype); ri->iri_flowid = le32toh(cur->wb.qword0.hi_dword.rss); ri->iri_rsstype = ixl_ptype_to_hash(ptype); ri->iri_vtag = vtag; @@ -737,7 +737,7 @@ ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) * doesn't spend time verifying the checksum. * *********************************************************************/ -static void +static u8 ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) { struct i40e_rx_ptype_decoded decoded; @@ -746,7 +746,7 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) /* No L3 or L4 checksum was calculated */ if (!(status & (1 << I40E_RX_DESC_STATUS_L3L4P_SHIFT))) - return; + return (0); decoded = decode_rx_desc_ptype(ptype); @@ -756,7 +756,7 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) if (status & (1 << I40E_RX_DESC_STATUS_IPV6EXADD_SHIFT)) { ri->iri_csum_flags = 0; - return; + return (1); } } @@ -764,17 +764,19 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) /* IPv4 checksum error */ if (error & (1 << I40E_RX_DESC_ERROR_IPE_SHIFT)) - return; + return (1); ri->iri_csum_flags |= CSUM_L3_VALID; ri->iri_csum_flags |= CSUM_L4_CALC; /* L4 checksum error */ if (error & (1 << I40E_RX_DESC_ERROR_L4E_SHIFT)) - return; + return (1); ri->iri_csum_flags |= CSUM_L4_VALID; ri->iri_csum_data |= htons(0xffff); + + return (0); } /* Set Report Status queue fields to 0 */ From owner-dev-commits-src-all@freebsd.org Fri Mar 5 01:23:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08A53561C9B; Fri, 5 Mar 2021 01:23: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 4Ds9432RFWz3C9F; Fri, 5 Mar 2021 01:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 140DE276E5; Fri, 5 Mar 2021 01:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1251NjLk064497; Fri, 5 Mar 2021 01:23:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1251Nj0T064496; Fri, 5 Mar 2021 01:23:45 GMT (envelope-from git) Date: Fri, 5 Mar 2021 01:23:45 GMT Message-Id: <202103050123.1251Nj0T064496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 2b94bda05a6d - stable/13 - ixl(4): Add ability to control link state on ifconfig down MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b94bda05a6d43e89c4a785c0f1cd569a41cb200 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 01:23:48 -0000 The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=2b94bda05a6d43e89c4a785c0f1cd569a41cb200 commit 2b94bda05a6d43e89c4a785c0f1cd569a41cb200 Author: Krzysztof Galazka AuthorDate: 2021-03-03 01:38:51 +0000 Commit: Eric Joyner CommitDate: 2021-03-05 01:23:19 +0000 ixl(4): Add ability to control link state on ifconfig down Add sysctl link_active_on_if_down, which allows user to control if interface is kept in active state when it is brought down with ifconfig. Set it to enabled by default to preserve backwards compatibility. Reviewed by: erj Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D28028 (cherry picked from commit 21802a127d83e8a8c721d69b697e7ddb223d7797) --- sys/dev/ixl/if_ixl.c | 18 +++++++ sys/dev/ixl/ixl_pf.h | 7 +++ sys/dev/ixl/ixl_pf_iflib.c | 2 + sys/dev/ixl/ixl_pf_main.c | 128 ++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 154 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 340565d66bc8..a79648de274f 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -770,6 +770,12 @@ ixl_if_attach_post(if_ctx_t ctx) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); + /* + * Driver may have been reloaded. Ensure that the link state + * is consistent with current settings. + */ + ixl_set_link(pf, (pf->state & IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0); + hw->phy.get_link_info = true; i40e_get_link_status(hw, &pf->link_up); ixl_update_link_status(pf); @@ -961,6 +967,8 @@ ixl_if_init(if_ctx_t ctx) return; } + ixl_set_link(pf, true); + /* Reconfigure multicast filters in HW */ ixl_if_multi_set(ctx); @@ -1003,6 +1011,7 @@ void ixl_if_stop(if_ctx_t ctx) { struct ixl_pf *pf = iflib_get_softc(ctx); + struct ifnet *ifp = iflib_get_ifp(ctx); struct ixl_vsi *vsi = &pf->vsi; INIT_DEBUGOUT("ixl_if_stop: begin\n"); @@ -1019,6 +1028,15 @@ ixl_if_stop(if_ctx_t ctx) ixl_disable_rings_intr(vsi); ixl_disable_rings(pf, vsi, &pf->qtag); + + /* + * Don't set link state if only reconfiguring + * e.g. on MTU change. + */ + if ((if_getflags(ifp) & IFF_UP) == 0 && + (atomic_load_acq_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) == 0) + ixl_set_link(pf, false); } static int diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index c3fbdc91d358..83c764bc617c 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -88,6 +88,7 @@ enum ixl_pf_state { IXL_PF_STATE_EMP_RESET_REQ = (1 << 8), IXL_PF_STATE_FW_LLDP_DISABLED = (1 << 9), IXL_PF_STATE_EEE_ENABLED = (1 << 10), + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN = (1 << 11), }; #define IXL_PF_IN_RECOVERY_MODE(pf) \ @@ -229,6 +230,11 @@ struct ixl_pf { "\t0 - disable\n" \ "\t1 - enable\n" +#define IXL_SYSCTL_HELP_SET_LINK_ACTIVE \ +"\nKeep link active after setting interface down:\n" \ +"\t0 - disable\n" \ +"\t1 - enable\n" + #define IXL_SYSCTL_HELP_READ_I2C \ "\nRead a byte from I2C bus\n" \ "Input: 32-bit value\n" \ @@ -351,6 +357,7 @@ void ixl_pf_reset_stats(struct ixl_pf *); void ixl_get_bus_info(struct ixl_pf *pf); int ixl_aq_get_link_status(struct ixl_pf *, struct i40e_aqc_get_link_status *); +void ixl_set_link(struct ixl_pf *, bool); int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); int ixl_handle_i2c_eeprom_read_cmd(struct ixl_pf *, struct ifreq *ifr); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 2b3d035fbcfe..23d9f30299a9 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -413,6 +413,8 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) /* Print out message if an unqualified module is found */ if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && (pf->advertised_speed) && + (atomic_load_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0 && (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && (!(status->link_info & I40E_AQ_LINK_UP))) device_printf(dev, "Link failed because " diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 070ddaef522e..b546701608f1 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -62,6 +62,7 @@ static int ixl_sysctl_pf_tx_itr(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_pf_rx_itr(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_set_link_active(SYSCTL_HANDLER_ARGS); /* Debug Sysctls */ static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); @@ -385,6 +386,9 @@ retry: break; } + /* Keep link active by default */ + atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + /* Print a subset of the capability information. */ device_printf(dev, "PF-ID[%d]: VFs %d, MSI-X %d, VF MSI-X %d, QPs %d, %s\n", @@ -2499,6 +2503,12 @@ ixl_add_device_sysctls(struct ixl_pf *pf) CTLFLAG_RD | CTLFLAG_MPSAFE, &pf->stats.rx_lpi_count, "RX LPI count"); + SYSCTL_ADD_PROC(ctx, ctx_list, OID_AUTO, + "link_active_on_if_down", + CTLTYPE_INT | CTLFLAG_RWTUN, + pf, 0, ixl_sysctl_set_link_active, "I", + IXL_SYSCTL_HELP_SET_LINK_ACTIVE); + /* Add sysctls meant to print debug information, but don't list them * in "sysctl -a" output. */ debug_node = SYSCTL_ADD_NODE(ctx, ctx_list, @@ -2519,6 +2529,11 @@ ixl_add_device_sysctls(struct ixl_pf *pf) CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pf, 0, ixl_sysctl_link_status, "A", IXL_SYSCTL_HELP_LINK_STATUS); + SYSCTL_ADD_PROC(ctx, debug_list, + OID_AUTO, "phy_abilities_init", + CTLTYPE_STRING | CTLFLAG_RD, + pf, 1, ixl_sysctl_phy_abilities, "A", "Initial PHY Abilities"); + SYSCTL_ADD_PROC(ctx, debug_list, OID_AUTO, "phy_abilities", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, @@ -3107,6 +3122,95 @@ ixl_find_i2c_interface(struct ixl_pf *pf) return (-1); } +void +ixl_set_link(struct ixl_pf *pf, bool enable) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; + enum i40e_status_code aq_error = 0; + u32 phy_type, phy_type_ext; + + /* Get initial capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, TRUE, &abilities, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + phy_type = abilities.phy_type; + phy_type_ext = abilities.phy_type_ext; + + /* Get current capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, FALSE, &abilities, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + /* Prepare new config */ + memset(&config, 0, sizeof(config)); + config.link_speed = abilities.link_speed; + config.abilities = abilities.abilities; + config.eee_capability = abilities.eee_capability; + config.eeer = abilities.eeer_val; + config.low_power_ctrl = abilities.d3_lpan; + config.fec_config = abilities.fec_cfg_curr_mod_ext_info + & I40E_AQ_PHY_FEC_CONFIG_MASK; + config.phy_type = 0; + config.phy_type_ext = 0; + + if (enable) { + config.phy_type = phy_type; + config.phy_type_ext = phy_type_ext; + + config.abilities &= ~(I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX); + + switch (pf->fc) { + case I40E_FC_FULL: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_RX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_TX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX; + break; + default: + break; + } + } + + aq_error = i40e_aq_set_phy_config(hw, &config, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error setting new phy config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + aq_error = i40e_aq_set_link_restart_an(hw, enable, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error set link config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } +} + static char * ixl_phy_type_string(u32 bit_pos, bool ext) { @@ -3265,7 +3369,7 @@ ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS) } status = i40e_aq_get_phy_capabilities(hw, - FALSE, FALSE, &abilities, NULL); + FALSE, arg2 != 0, &abilities, NULL); if (status) { device_printf(dev, "%s: i40e_aq_get_phy_capabilities() status %s, aq error %s\n", @@ -4447,6 +4551,28 @@ ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) return (0); } +static int +ixl_sysctl_set_link_active(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + int error, state; + + state = !!(atomic_load_acq_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + + error = sysctl_handle_int(oidp, &state, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + if (state == 0) + atomic_clear_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + else + atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + + return (0); +} + + int ixl_attach_get_link_status(struct ixl_pf *pf) { From owner-dev-commits-src-all@freebsd.org Fri Mar 5 03:23:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93DDF564489; Fri, 5 Mar 2021 03:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsCkQ3pX1z3K7R; Fri, 5 Mar 2021 03:23: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 7580BFC4; Fri, 5 Mar 2021 03:23: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 1253Ng5D023746; Fri, 5 Mar 2021 03:23:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1253NgQw023745; Fri, 5 Mar 2021 03:23:42 GMT (envelope-from git) Date: Fri, 5 Mar 2021 03:23:42 GMT Message-Id: <202103050323.1253NgQw023745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Peter Grehan Subject: git: 96aabea8bd23 - stable/13 - Import wireguard fixes from pfSense 2.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 96aabea8bd238b503e949753355dc5b6a857aa9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 03:23:42 -0000 The branch stable/13 has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=96aabea8bd238b503e949753355dc5b6a857aa9c commit 96aabea8bd238b503e949753355dc5b6a857aa9c Author: Peter Grehan AuthorDate: 2021-02-27 04:15:04 +0000 Commit: Peter Grehan CommitDate: 2021-03-05 01:23:14 +0000 Import wireguard fixes from pfSense 2.5 Merge the following fixes from https://github.com/pfsense/FreeBSD-src 1940e7d3 Save address of ingress packets to allow wg to work on HA 8f5531f1 Fix connection to IPv6 endpoint 825ed9ee Fix tcpdump for wg IPv6 rx tunnel traffic 2ec232d3 Fix issue with replying to INITIATION messages in server mode ec77593a Return immediately in wg_init if in DETACH'd state 0f0dde6f Remove unnecessary wg debug printf on transmit 2766dc94 Detect and fix case in wg_init() where sockets weren't cleaned up b62cc7ac Close the UDP tunnel sockets when the interface has been stopped Obtained from: pfSense 2.5 Relnotes: yes Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 95331c228a39b44cb96c4d0142ed8afec8a4d063) --- sys/dev/if_wg/module/if_wg_session.c | 45 +++++++++++++++++++++++++++++++++--- sys/dev/if_wg/module/module.c | 23 ++++++++++++++---- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index 54e63d053847..084bc789039d 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1394,8 +1394,8 @@ wg_deliver_in(struct wg_peer *peer) CURVNET_SET(inp->inp_vnet); ip_input(m); CURVNET_RESTORE(); - } else if (version == 6) { - af = AF_INET; + } else if (version == 6) { + af = AF_INET6; BPF_MTAP2(sc->sc_ifp, &af, sizeof(af), m); inp = sotoinpcb(so->so_so6); CURVNET_SET(inp->inp_vnet); @@ -1531,6 +1531,7 @@ wg_handshake(struct wg_softc *sc, struct mbuf *m) peer = CONTAINER_OF(remote, struct wg_peer, p_remote); DPRINTF(sc, "Receiving handshake initiation from peer %llu\n", (unsigned long long)peer->p_id); + wg_peer_set_endpoint_from_tag(peer, t); res = wg_send_response(peer); if (res == 0 && noise_remote_begin_session(&peer->p_remote) == 0) wg_timers_event_session_derived(&peer->p_timers); @@ -1851,6 +1852,40 @@ wg_index_drop(struct wg_softc *sc, uint32_t key0) SLIST_INSERT_HEAD(&peer->p_unused_index, iter, i_unused_entry); } +static int +wg_update_endpoint_addrs(struct wg_endpoint *e, const struct sockaddr *srcsa, + struct ifnet *rcvif) +{ + const struct sockaddr_in *sa4; + const struct sockaddr_in6 *sa6; + int ret = 0; + + /* + * UDP passes a 2-element sockaddr array: first element is the + * source addr/port, second the destination addr/port. + */ + if (srcsa->sa_family == AF_INET) { + sa4 = (const struct sockaddr_in *)srcsa; + e->e_remote.r_sin = sa4[0]; + /* Only update dest if not mcast/bcast */ + if (!(IN_MULTICAST(ntohl(sa4[1].sin_addr.s_addr)) || + sa4[1].sin_addr.s_addr == INADDR_BROADCAST || + in_broadcast(sa4[1].sin_addr, rcvif))) { + e->e_local.l_in = sa4[1].sin_addr; + } + } else if (srcsa->sa_family == AF_INET6) { + sa6 = (const struct sockaddr_in6 *)srcsa; + e->e_remote.r_sin6 = sa6[0]; + /* Only update dest if not multicast */ + if (!IN6_IS_ADDR_MULTICAST(&sa6[1].sin6_addr)) + e->e_local.l_in6 = sa6[1].sin6_addr; + } else { + ret = EAFNOSUPPORT; + } + + return (ret); +} + static void wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, const struct sockaddr *srcsa, void *_sc) @@ -1882,7 +1917,11 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, goto free; } e = wg_mbuf_endpoint_get(m); - e->e_remote.r_sa = *srcsa; + + if (wg_update_endpoint_addrs(e, srcsa, m->m_pkthdr.rcvif)) { + DPRINTF(sc, "unknown family\n"); + goto free; + } verify_endpoint(m); if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); diff --git a/sys/dev/if_wg/module/module.c b/sys/dev/if_wg/module/module.c index 76c7db01cba1..a40a304616c7 100644 --- a/sys/dev/if_wg/module/module.c +++ b/sys/dev/if_wg/module/module.c @@ -255,7 +255,6 @@ wg_transmit(struct ifnet *ifp, struct mbuf *m) peer = wg_route_lookup(&sc->sc_routes, m, OUT); if (__predict_false(peer == NULL)) { rc = ENOKEY; - printf("peer not found - dropping %p\n", m); /* XXX log */ goto err; } @@ -360,8 +359,15 @@ wg_init(if_ctx_t ctx) struct wg_softc *sc; int rc; + if (iflib_in_detach(ctx)) + return; + sc = iflib_get_softc(ctx); ifp = iflib_get_ifp(ctx); + if (sc->sc_socket.so_so4 != NULL) + printf("XXX wg_init, socket non-NULL %p\n", + sc->sc_socket.so_so4); + wg_socket_reinit(sc, NULL, NULL); rc = wg_socket_init(sc); if (rc) return; @@ -377,6 +383,7 @@ wg_stop(if_ctx_t ctx) sc = iflib_get_softc(ctx); ifp = iflib_get_ifp(ctx); if_link_state_change(ifp, LINK_STATE_DOWN); + wg_socket_reinit(sc, NULL, NULL); } static nvlist_t * @@ -386,13 +393,20 @@ wg_peer_to_nvl(struct wg_peer *peer) int i, count; nvlist_t *nvl; caddr_t key; + size_t sa_sz; struct wg_allowedip *aip; + struct wg_endpoint *ep; if ((nvl = nvlist_create(0)) == NULL) return (NULL); key = peer->p_remote.r_public; nvlist_add_binary(nvl, "public-key", key, WG_KEY_SIZE); - nvlist_add_binary(nvl, "endpoint", &peer->p_endpoint.e_remote, sizeof(struct sockaddr)); + ep = &peer->p_endpoint; + if (ep->e_remote.r_sa.sa_family != 0) { + sa_sz = (ep->e_remote.r_sa.sa_family == AF_INET) ? + sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); + nvlist_add_binary(nvl, "endpoint", &ep->e_remote, sa_sz); + } i = count = 0; CK_LIST_FOREACH(rt, &peer->p_routes, r_entry) { count++; @@ -587,13 +601,12 @@ wg_peer_add(struct wg_softc *sc, const nvlist_t *nvl) } if (nvlist_exists_binary(nvl, "endpoint")) { endpoint = nvlist_get_binary(nvl, "endpoint", &size); - if (size != sizeof(*endpoint)) { + if (size > sizeof(peer->p_endpoint.e_remote)) { device_printf(dev, "%s bad length for endpoint %zu\n", __func__, size); err = EBADMSG; goto out; } - memcpy(&peer->p_endpoint.e_remote, endpoint, - sizeof(peer->p_endpoint.e_remote)); + memcpy(&peer->p_endpoint.e_remote, endpoint, size); } if (nvlist_exists_binary(nvl, "pre-shared-key")) { const void *key; From owner-dev-commits-src-all@freebsd.org Fri Mar 5 03:46:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3317E5645C2; Fri, 5 Mar 2021 03:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsDDn0ysDz3L8B; Fri, 5 Mar 2021 03:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 145B21753; Fri, 5 Mar 2021 03:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1253kWLq050047; Fri, 5 Mar 2021 03:46:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1253kW7I050046; Fri, 5 Mar 2021 03:46:32 GMT (envelope-from git) Date: Fri, 5 Mar 2021 03:46:32 GMT Message-Id: <202103050346.1253kW7I050046@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: ff6a7e4ba6bf - main - ktls: Fix CBC encryption when input and output iov sizes are different 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: ff6a7e4ba6bf8be9ead9e1bc5537709243390654 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 03:46:33 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6a7e4ba6bf8be9ead9e1bc5537709243390654 commit ff6a7e4ba6bf8be9ead9e1bc5537709243390654 Author: Mark Johnston AuthorDate: 2021-03-05 03:45:40 +0000 Commit: Mark Johnston CommitDate: 2021-03-05 03:45:40 +0000 ktls: Fix CBC encryption when input and output iov sizes are different Reported by: gallatin Tested by: gallatin Fixes: 49f6925ca Differential Revision: https://reviews.freebsd.org/D29073 --- sys/opencrypto/ktls_ocf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 31d787c2b61b..7414e26bb3e2 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -298,8 +298,8 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, memcpy(crp.crp_iv, hdr + 1, AES_BLOCK_LEN); crypto_use_uio(&crp, &uio); if (!inplace) { - memcpy(out_iov, outiov, sizeof(*iniov) * outiovcnt); - out_iov[outiovcnt] = iov[outiovcnt + 1]; + memcpy(out_iov, outiov, sizeof(*outiov) * outiovcnt); + out_iov[outiovcnt] = iov[iniovcnt + 1]; out_uio.uio_iov = out_iov; out_uio.uio_iovcnt = outiovcnt + 1; out_uio.uio_offset = 0; From owner-dev-commits-src-all@freebsd.org Fri Mar 5 06:29:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BED5567EAF; Fri, 5 Mar 2021 06:29: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 4DsHrt0kpjz3jKt; Fri, 5 Mar 2021 06:29: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 0BD84379F; Fri, 5 Mar 2021 06:29: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 1256TXvF062152; Fri, 5 Mar 2021 06:29:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1256TXDc062151; Fri, 5 Mar 2021 06:29:33 GMT (envelope-from git) Date: Fri, 5 Mar 2021 06:29:33 GMT Message-Id: <202103050629.1256TXDc062151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: 80f39bd95f22 - main - Hyper-V: hn: Store host hash value in flowid MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80f39bd95f22322152709ea5fae3a3c546044c9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 06:29:34 -0000 The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=80f39bd95f22322152709ea5fae3a3c546044c9c commit 80f39bd95f22322152709ea5fae3a3c546044c9c Author: Wei Hu AuthorDate: 2021-02-24 05:07:46 +0000 Commit: Wei Hu CommitDate: 2021-03-05 04:46:54 +0000 Hyper-V: hn: Store host hash value in flowid When rx packet contains hash value sent from host, store it in the mbuf's flowid field so when the same mbuf is on the tx path, the hash value can be used by the host to determine the outgoing network queue. MFC after: 2 weeks Sponsored by: Microsoft --- sys/dev/hyperv/netvsc/if_hn.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 5a57ea796d0e..9243ff226f5b 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -3077,13 +3077,24 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd, if (txr->hn_tx_flags & HN_TX_FLAG_HASHVAL) { /* - * Set the hash value for this packet, so that the host could - * dispatch the TX done event for this packet back to this TX - * ring's channel. + * Set the hash value for this packet. */ pi_data = hn_rndis_pktinfo_append(pkt, HN_RNDIS_PKT_LEN, HN_NDIS_HASH_VALUE_SIZE, HN_NDIS_PKTINFO_TYPE_HASHVAL); - *pi_data = txr->hn_tx_idx; + + if (M_HASHTYPE_ISHASH(m_head)) + /* + * The flowid field contains the hash value host + * set in the rx queue if it is a ip forwarding pkt. + * Set the same hash value so host can send on the + * cpu it was received. + */ + *pi_data = m_head->m_pkthdr.flowid; + else + /* + * Otherwise just put the tx queue index. + */ + *pi_data = txr->hn_tx_idx; } if (m_head->m_flags & M_VLANTAG) { From owner-dev-commits-src-all@freebsd.org Fri Mar 5 08:22:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F276552902; Fri, 5 Mar 2021 08:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsLLh3w1xz3pPf; Fri, 5 Mar 2021 08:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 793495179; Fri, 5 Mar 2021 08:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1258M4Un020586; Fri, 5 Mar 2021 08:22:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1258M414020585; Fri, 5 Mar 2021 08:22:04 GMT (envelope-from git) Date: Fri, 5 Mar 2021 08:22:04 GMT Message-Id: <202103050822.1258M414020585@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: 29698ed90473 - main - pf: Mark struct pf_pdesc as kernel only 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: 29698ed904737ebfd139a21e39e5421cf81badd8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 08:22:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=29698ed904737ebfd139a21e39e5421cf81badd8 commit 29698ed904737ebfd139a21e39e5421cf81badd8 Author: Kristof Provost AuthorDate: 2021-03-03 09:28:14 +0000 Commit: Kristof Provost CommitDate: 2021-03-05 08:21:06 +0000 pf: Mark struct pf_pdesc as kernel only This structure is only used by the kernel module internally. It's not shared with user space, so hide it behind #ifdef _KERNEL. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9c8c642a6ace..3f2075b8f0e2 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -893,6 +893,7 @@ struct pfi_kkif { #define PFI_IFLAG_REFS 0x0001 /* has state references */ #define PFI_IFLAG_SKIP 0x0100 /* skip filtering on interface */ +#ifdef _KERNEL struct pf_pdesc { struct { int done; @@ -932,6 +933,7 @@ struct pf_pdesc { u_int8_t sidx; /* key index for source */ u_int8_t didx; /* key index for destination */ }; +#endif /* flags for RDR options */ #define PF_DPORT_RANGE 0x01 /* Dest port uses range */ From owner-dev-commits-src-all@freebsd.org Fri Mar 5 08:32:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3662552A29; Fri, 5 Mar 2021 08:32:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsLZR5Fnyz3pV1; Fri, 5 Mar 2021 08:32:15 +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 91957662D; Fri, 5 Mar 2021 08:32:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 10010493ED; Fri, 5 Mar 2021 09:32:13 +0100 (CET) From: "Kristof Provost" To: "John Baldwin" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a079e38b08f2 - main - ossl: Add Poly1305 digest support. Date: Fri, 05 Mar 2021 09:32:12 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: <4EB11ECA-1788-49D2-9362-09D955C8D695@FreeBSD.org> In-Reply-To: <202103032321.123NLOKb093507@gitrepo.freebsd.org> References: <202103032321.123NLOKb093507@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 08:32:15 -0000 On 4 Mar 2021, at 0:21, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3Da079e38b08f2f07c50ba915dae66d= 099559abdcc > > commit a079e38b08f2f07c50ba915dae66d099559abdcc > Author: John Baldwin > AuthorDate: 2021-03-03 23:17:29 +0000 > Commit: John Baldwin > CommitDate: 2021-03-03 23:20:57 +0000 > > ossl: Add Poly1305 digest support. > > Reviewed by: cem > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D28754 It looks like this broke the LINT builds: linking kernel ld: error: duplicate symbol: Poly1305_Final >>> defined at ossl_poly1305.c >>> ossl_poly1305.o:(Poly1305_Final) >>> defined at xform_poly1305.c >>> xform_poly1305.o:(.text+0xA0) ld: error: duplicate symbol: Poly1305_Init >>> defined at ossl_poly1305.c >>> ossl_poly1305.o:(Poly1305_Init) >>> defined at xform_poly1305.c >>> xform_poly1305.o:(.text+0x0) ld: error: duplicate symbol: Poly1305_Update >>> defined at ossl_poly1305.c >>> ossl_poly1305.o:(Poly1305_Update) >>> defined at xform_poly1305.c >>> xform_poly1305.o:(.text+0x60) ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden *** [kernel] Error code 1 (See also = https://ci.freebsd.org/job/FreeBSD-main-aarch64-LINT/6074/console ) Best regards Kristof From owner-dev-commits-src-all@freebsd.org Fri Mar 5 08:41:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2169A552FA8; Fri, 5 Mar 2021 08:41:59 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsLnf4K4lz3qSS; Fri, 5 Mar 2021 08:41:58 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 1258ftJG058855; Fri, 5 Mar 2021 00:41:55 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 1258ftai058854; Fri, 5 Mar 2021 00:41:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103050841.1258ftai058854@gndrsh.dnsmgr.net> Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: <5c413c07-ad22-01e1-ee45-35fbc04a4875@freebsd.org> To: Nathan Whitehorn Date: Fri, 5 Mar 2021 00:41:55 -0800 (PST) CC: Warner Losh , Brandon Bergren , "Rodney W. Grimes" , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4DsLnf4K4lz3qSS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 08:41:59 -0000 > On 3/3/21 5:25 PM, Warner Losh wrote: > > > > > > On Wed, Mar 3, 2021 at 10:21 AM Nathan Whitehorn > > > wrote: > > > > > > > > On 3/3/21 11:53 AM, Warner Losh wrote: > > > > > > > [clipping non-technical pre-history] > > > > > > Thanks. re-reading it now, I think I was more grumpy than warranted. > > And for that I apologize. Thanks for omitting it from the rest of the > > thread. > > No worries, this happens, especially with the pandemic. I know I've > definitely been more prickly this year than normal... > > > > > > >? ? ?The installer *does* mount the partition in advance, so checking > > >? ? ?whether > > >? ? ?there is a mounted file system is a perfectly reasonable test to > > >? ? ?do. We > > >? ? ?could also check fstab. I would like to understand what is > > actually > > >? ? ?wrong here first, though. Especially after this misfire -- > > which is > > >? ? ?problematic for reasons that are still not clear to me, since > > >? ? ?there are > > >? ? ?a number of standard directories in hier(7) not in mtree -- > > I want to > > >? ? ?make sure we actually do have consensus about what is > > changing and > > >? ? ?why. > > > > > > > > > At the top level, we default to having directories in mtree unless > > > there's a good reason not to. We disagree as to whether the > > installer > > > should take the presence or absence of the directory as a strong > > > enough reason to do something. I don't think that's a good reason. > > > > > > But leaving that aside, let's say we?wanted to reuse the install > > boot > > > part of the installer to update boot blocks as part of > > installworld. > > > If we can talk through that example w/o it in mtree, then we can > > leave > > > it out. The last time I worked through this, though, I thought I'd > > > talked myself into needing it. > > > > > Looking at bootconfig, we could use machdep.bootmethod to > > determine if > > > we need to update the ESP. If we didn't use that, then the ESP > > > shouldn't be touched. This is, at the moment, x86 centric, but > > could > > > trivially be added to architectures (I'm happy to add it). This > > would > > > prevent the 'false positive' that's possible in cases where we've > > > installed UEFI then downgraded to BIOS because of some problem > > (though > > > purely in the context of the installer, I guess this isn't an > > issue). > > > Even with your approach, we'd bogusly update an ESP (though one > > could > > > argue you might want that). We could also change the code so that > > > 'unsupported' architectures just didn't update. This is why I think > > > it's a bit fragile to rely only on the directory being present. It > > > should have something mounted there. If you wanted to mkfs_dos?+ > > mkdir > > > efi at the top level, you could check for that directory if you > > were > > > looking for a flag, though that would still update on a BIOS > > boot the > > > ESP, and prevent false positives if run as part of an update. > > > > I think we would *want* to update an ESP that is mounted but not > > currently being used. If I set up a dual BIOS/EFI-boot system for > > some > > reason and happened to install an update while booted from BIOS, I > > would > > be deeply astonished if my configured-by-the-installer EFI bootloader > > did not also get updated. > > > > > > Yea, it's unclear to me what POLA here is, to be honest. Some of that > > is driven by a deep desire not to accidentally update USB drives that > > have a bootable image on them as well, so that may overly color my > > thinking. > > Agreed on all counts here. > > > (As an aside, I would also much rather the installer use an update > > utility to set up the ESP than have the update utility use the > > installer.) > > > > > > Agreed. We can work towards that after the release. It would be better > > if we could accumulate the scripts from a number of different places, > > find a good way to make them callable from those places more easily > > and start to move that tribal knowledge back into the base system > > where it belongs, imho. Baptiste raised an important point years ago > > that we also need to think about doing that with a way to 'plug in' > > $NEWEST_CLOUD's packages, containers, layout such that they could > > provide the details and then the automation would just work with them > > too: image building, release customization, boot block update, etc. > > > > So here's a proposal, now that everyone is in the CC list: > > - We add /boot/efi back to mtree, even though I find it kind of > > weird to > > have it there I think we're too close to the release to have a > > conclusion on this. > > - We have the installer check for either the ESP directory being an > > active mountpoint or being in the in-progress fstab, whichever is > > easiest to implement (they are equivalent for the installer). > > > > > > I'm OK with both of these points. If others are opposed to the first > > one, I'm willing to see how people react to it in the upgrade path > > before changing it again. We should get closure on Ed's proposed > > change here. I think it's good and should go in right after your > > changes. I'd start on your changes, and give people until the morning > > to pipe up with any objections. > Here's a patch to do this: > https://reviews.freebsd.org/D29068 > > It takes several hours to do the full test of building world, building > release ISOs, and running them through qemu, so it will be a while yet > before I feel comfortable committing. But it's a two-line diff and the > pieces worked independently, so the chances it works are pretty high. > Comments appreciated. > > > If that seems OK, I'll post another review for the change. > > > > > A long-term project I've had has been to try to update the boot > > blocks > > > as part of installworld or maybe as part of installboot. We have > > > really poor reuse as a project in this area. Every little > > > orchestration thing wrote its own thing, and all of them have > > done it > > > badly. I was hoping to be able to reuse this code, or modify the > > > installer to use whatever we come up with there. As part of that, I > > > had talked myself into thinking we always needed /boot/efi, but I'm > > > having trouble reconstructing why that is now though I know it > > had to > > > do with installed systems and bootstrapping issues... I know I was > > > worried about questions about 'why isn't /boot/efi on the system by > > > default so I can mount it' for people that have upgraded, but I > > recall > > > there was more to it than that. With it in mtree, an installworld > > > (even w/o an ESP update) would create it and people could mount > > it w/o > > > having to mkdir which they might make as $SOMETHING_ELSE. So I > > guess > > > that's a bit of a weak reason to absolutely require it in mtree. > > > > Thanks a lot for the explanation. I'm agreed entirely about the > > problem > > and the difficulty -- hopefully this set of changes helps at least. > > > > > > It does. It starts to get people to use the same mount point for the > > ESP and we can then constrain the problem a bit and where we can't > > constrain it we can parameterize it. > > > > As for mtree, I was imagining this as something like /home, which > > is a > > standard part of the system but isn't part of mtree since it > > depends on > > local-system policy. It's also different from /home in that we > > *do* want > > it to be a standard place for updates, of course. I think there's > > really > > not a ton of precedent either way: we don't have any other mount > > points > > in there for file systems that may or may not exist depending on > > circumstances, as far as I can tell. My worry with having it in > > mtree is > > that having it exist but potentially be a directory rather than an > > actual ESP requires that update tools be a little smarter and errors > > will be a little less obvious, since updates that don't pay enough > > attention will be a bit more likely to splat files there assuming > > there > > is an ESP even if makes no sense. It's a weak consideration either > > way, > > I think. > > > > > > Yea. After a few hours of reflection, I've found that I could go > > either way and am having trouble understanding why I was so dead set > > this morning on a particular way. Chalk it up to me being a little > > extra grumpy at surprise changes. > > > > This one seems less like local policy than /home, but there's still a > > local aspect: Do I mount by default, and where. I think we should > > always, though, have a fstab entry as we'll need to update it from > > time to time. Even Windows has a nominal drive that it uses to mount > > the ESP, even if it isn't mounted by default. That's used to update it > > when scripts and such need to do that (or if you're the victim of an > > upgrade script that did too much that now needs to be undone). I think > > we should be similar in that regard. This would also let us take the > > automation of updates to the next level if we can rely on some basic > > things. > > That makes sense to me. There's also still the issue of non-EFI systems, > that differ only by install-time configuration from non-EFI systems. One > of my worries of having /boot/efi always exist is that a non-EFI system > may try to "update" the EFI by poking around in the empty /boot/efi and > think it has updated/installed something useful but has in reality done > nothing. But it's a tricky situation all around. I would think that during an update, which for me implies a system that is booted and running, that the definative answer to "are we an EFI system that needs to update EFI code" is infact machdep.bootmethod=EFI. Existance/absence of a directory, or an entry in /etc/fstab is a poor quality indicator. Is it even possible to create a dual mode installed FreeBSD system that boots in either BIOS or EFI mode? I know we do that for the installed media, but that is hybrid media, and I do not think that the bsdinstall can create such an installation on a disk. > -Nathan > > Warner > > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Fri Mar 5 08:53:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8204553919; Fri, 5 Mar 2021 08:53:34 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.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 4DsM3200mMz3rJ5; Fri, 5 Mar 2021 08:53:33 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1614934411; 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=k+JMNTn3thk5l1RTBuiFOxEOd+kqrT/KICi8iFnBwIA=; b=ptyf/M7sV40kA3QU1aWFNbjVC4xDq/Hp1GLTTmouGMuu/yicPFNVi9hXYh8J4a5OrDlwpY cK2x41doOMf6vFOPatMrgDU+7untlzwAtXEDC1hV0cvcQdHU2NdWRJKELOraZX33th4aoX p+FvS+mUqL3Lq+weZRgKMLbBieHmWNs= Received: from amy (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 93120cc0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 5 Mar 2021 08:53:31 +0000 (UTC) Date: Fri, 5 Mar 2021 09:53:31 +0100 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Nathan Whitehorn , Warner Losh , Brandon Bergren , Ed Maste , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. Message-Id: <20210305095331.5cbcc0897bdb1221b3440c81@bidouilliste.com> In-Reply-To: <202103050841.1258ftai058854@gndrsh.dnsmgr.net> References: <5c413c07-ad22-01e1-ee45-35fbc04a4875@freebsd.org> <202103050841.1258ftai058854@gndrsh.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DsM3200mMz3rJ5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 08:53:34 -0000 On Fri, 5 Mar 2021 00:41:55 -0800 (PST) "Rodney W. Grimes" wrote: > > On 3/3/21 5:25 PM, Warner Losh wrote: > > > > > > > > > On Wed, Mar 3, 2021 at 10:21 AM Nathan Whitehorn > > > > wrote: > > > > > > > > > > > > On 3/3/21 11:53 AM, Warner Losh wrote: > > > > > > > > > > [clipping non-technical pre-history] > > > > > > > > > Thanks. re-reading it now, I think I was more grumpy than warranted. > > > And for that I apologize. Thanks for omitting it from the rest of the > > > thread. > > > > No worries, this happens, especially with the pandemic. I know I've > > definitely been more prickly this year than normal... > > > > > > > > > >? ? ?The installer *does* mount the partition in advance, so checking > > > >? ? ?whether > > > >? ? ?there is a mounted file system is a perfectly reasonable test to > > > >? ? ?do. We > > > >? ? ?could also check fstab. I would like to understand what is > > > actually > > > >? ? ?wrong here first, though. Especially after this misfire -- > > > which is > > > >? ? ?problematic for reasons that are still not clear to me, since > > > >? ? ?there are > > > >? ? ?a number of standard directories in hier(7) not in mtree -- > > > I want to > > > >? ? ?make sure we actually do have consensus about what is > > > changing and > > > >? ? ?why. > > > > > > > > > > > > At the top level, we default to having directories in mtree unless > > > > there's a good reason not to. We disagree as to whether the > > > installer > > > > should take the presence or absence of the directory as a strong > > > > enough reason to do something. I don't think that's a good reason. > > > > > > > > But leaving that aside, let's say we?wanted to reuse the install > > > boot > > > > part of the installer to update boot blocks as part of > > > installworld. > > > > If we can talk through that example w/o it in mtree, then we can > > > leave > > > > it out. The last time I worked through this, though, I thought I'd > > > > talked myself into needing it. > > > > > > > Looking at bootconfig, we could use machdep.bootmethod to > > > determine if > > > > we need to update the ESP. If we didn't use that, then the ESP > > > > shouldn't be touched. This is, at the moment, x86 centric, but > > > could > > > > trivially be added to architectures (I'm happy to add it). This > > > would > > > > prevent the 'false positive' that's possible in cases where we've > > > > installed UEFI then downgraded to BIOS because of some problem > > > (though > > > > purely in the context of the installer, I guess this isn't an > > > issue). > > > > Even with your approach, we'd bogusly update an ESP (though one > > > could > > > > argue you might want that). We could also change the code so that > > > > 'unsupported' architectures just didn't update. This is why I think > > > > it's a bit fragile to rely only on the directory being present. It > > > > should have something mounted there. If you wanted to mkfs_dos?+ > > > mkdir > > > > efi at the top level, you could check for that directory if you > > > were > > > > looking for a flag, though that would still update on a BIOS > > > boot the > > > > ESP, and prevent false positives if run as part of an update. > > > > > > I think we would *want* to update an ESP that is mounted but not > > > currently being used. If I set up a dual BIOS/EFI-boot system for > > > some > > > reason and happened to install an update while booted from BIOS, I > > > would > > > be deeply astonished if my configured-by-the-installer EFI bootloader > > > did not also get updated. > > > > > > > > > Yea, it's unclear to me what POLA here is, to be honest. Some of that > > > is driven by a deep desire not to accidentally update USB drives that > > > have a bootable image on them as well, so that may overly color my > > > thinking. > > > > Agreed on all counts here. > > > > > (As an aside, I would also much rather the installer use an update > > > utility to set up the ESP than have the update utility use the > > > installer.) > > > > > > > > > Agreed. We can work towards that after the release. It would be better > > > if we could accumulate the scripts from a number of different places, > > > find a good way to make them callable from those places more easily > > > and start to move that tribal knowledge back into the base system > > > where it belongs, imho. Baptiste raised an important point years ago > > > that we also need to think about doing that with a way to 'plug in' > > > $NEWEST_CLOUD's packages, containers, layout such that they could > > > provide the details and then the automation would just work with them > > > too: image building, release customization, boot block update, etc. > > > > > > So here's a proposal, now that everyone is in the CC list: > > > - We add /boot/efi back to mtree, even though I find it kind of > > > weird to > > > have it there I think we're too close to the release to have a > > > conclusion on this. > > > - We have the installer check for either the ESP directory being an > > > active mountpoint or being in the in-progress fstab, whichever is > > > easiest to implement (they are equivalent for the installer). > > > > > > > > > I'm OK with both of these points. If others are opposed to the first > > > one, I'm willing to see how people react to it in the upgrade path > > > before changing it again. We should get closure on Ed's proposed > > > change here. I think it's good and should go in right after your > > > changes. I'd start on your changes, and give people until the morning > > > to pipe up with any objections. > > Here's a patch to do this: > > https://reviews.freebsd.org/D29068 > > > > It takes several hours to do the full test of building world, building > > release ISOs, and running them through qemu, so it will be a while yet > > before I feel comfortable committing. But it's a two-line diff and the > > pieces worked independently, so the chances it works are pretty high. > > Comments appreciated. > > > > > If that seems OK, I'll post another review for the change. > > > > > > > A long-term project I've had has been to try to update the boot > > > blocks > > > > as part of installworld or maybe as part of installboot. We have > > > > really poor reuse as a project in this area. Every little > > > > orchestration thing wrote its own thing, and all of them have > > > done it > > > > badly. I was hoping to be able to reuse this code, or modify the > > > > installer to use whatever we come up with there. As part of that, I > > > > had talked myself into thinking we always needed /boot/efi, but I'm > > > > having trouble reconstructing why that is now though I know it > > > had to > > > > do with installed systems and bootstrapping issues... I know I was > > > > worried about questions about 'why isn't /boot/efi on the system by > > > > default so I can mount it' for people that have upgraded, but I > > > recall > > > > there was more to it than that. With it in mtree, an installworld > > > > (even w/o an ESP update) would create it and people could mount > > > it w/o > > > > having to mkdir which they might make as $SOMETHING_ELSE. So I > > > guess > > > > that's a bit of a weak reason to absolutely require it in mtree. > > > > > > Thanks a lot for the explanation. I'm agreed entirely about the > > > problem > > > and the difficulty -- hopefully this set of changes helps at least. > > > > > > > > > It does. It starts to get people to use the same mount point for the > > > ESP and we can then constrain the problem a bit and where we can't > > > constrain it we can parameterize it. > > > > > > As for mtree, I was imagining this as something like /home, which > > > is a > > > standard part of the system but isn't part of mtree since it > > > depends on > > > local-system policy. It's also different from /home in that we > > > *do* want > > > it to be a standard place for updates, of course. I think there's > > > really > > > not a ton of precedent either way: we don't have any other mount > > > points > > > in there for file systems that may or may not exist depending on > > > circumstances, as far as I can tell. My worry with having it in > > > mtree is > > > that having it exist but potentially be a directory rather than an > > > actual ESP requires that update tools be a little smarter and errors > > > will be a little less obvious, since updates that don't pay enough > > > attention will be a bit more likely to splat files there assuming > > > there > > > is an ESP even if makes no sense. It's a weak consideration either > > > way, > > > I think. > > > > > > > > > Yea. After a few hours of reflection, I've found that I could go > > > either way and am having trouble understanding why I was so dead set > > > this morning on a particular way. Chalk it up to me being a little > > > extra grumpy at surprise changes. > > > > > > This one seems less like local policy than /home, but there's still a > > > local aspect: Do I mount by default, and where. I think we should > > > always, though, have a fstab entry as we'll need to update it from > > > time to time. Even Windows has a nominal drive that it uses to mount > > > the ESP, even if it isn't mounted by default. That's used to update it > > > when scripts and such need to do that (or if you're the victim of an > > > upgrade script that did too much that now needs to be undone). I think > > > we should be similar in that regard. This would also let us take the > > > automation of updates to the next level if we can rely on some basic > > > things. > > > > That makes sense to me. There's also still the issue of non-EFI systems, > > that differ only by install-time configuration from non-EFI systems. One > > of my worries of having /boot/efi always exist is that a non-EFI system > > may try to "update" the EFI by poking around in the empty /boot/efi and > > think it has updated/installed something useful but has in reality done > > nothing. But it's a tricky situation all around. > > I would think that during an update, which for me implies a > system that is booted and running, that the definative answer > to "are we an EFI system that needs to update EFI code" is > infact machdep.bootmethod=EFI. Existance/absence of a directory, > or an entry in /etc/fstab is a poor quality indicator. No, again we should update every boot method for the arch so a user can change the machine boot method and still boot. > Is it even possible to create a dual mode installed FreeBSD > system that boots in either BIOS or EFI mode? I know we do that > for the installed media, but that is hybrid media, and I do > not think that the bsdinstall can create such an installation > on a disk. Of course it is, I use that on all my test machines and bsdinstall does that correctly. > > -Nathan > > > Warner > > > > Warner > -- > Rod Grimes rgrimes@freebsd.org -- Emmanuel Vadot From owner-dev-commits-src-all@freebsd.org Fri Mar 5 09:03:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEF2F553BB2; Fri, 5 Mar 2021 09:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsMGq4cl7z3rtw; Fri, 5 Mar 2021 09:03: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 91A40593D; Fri, 5 Mar 2021 09:03: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 12593lfe073769; Fri, 5 Mar 2021 09:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12593lSp073768; Fri, 5 Mar 2021 09:03:47 GMT (envelope-from git) Date: Fri, 5 Mar 2021 09:03:47 GMT Message-Id: <202103050903.12593lSp073768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 5084dde5f087 - main - pchtherm: fix a wrong bit and a wrong register use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5084dde5f087264cf9a826569d1152c65d88a0fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 09:03:47 -0000 The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=5084dde5f087264cf9a826569d1152c65d88a0fe commit 5084dde5f087264cf9a826569d1152c65d88a0fe Author: Michal Vanco AuthorDate: 2021-03-05 08:55:30 +0000 Commit: Andriy Gapon CommitDate: 2021-03-05 09:01:28 +0000 pchtherm: fix a wrong bit and a wrong register use Probably just copy-paste errors that slipped in. PR: 253915 Reported by: Michal Vanco MFC after: 1 week --- sys/dev/intel/pchtherm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/intel/pchtherm.c b/sys/dev/intel/pchtherm.c index 13f0abc54b63..31d06a1bc26a 100644 --- a/sys/dev/intel/pchtherm.c +++ b/sys/dev/intel/pchtherm.c @@ -163,7 +163,7 @@ static int pchtherm_attach(device_t dev) bus_write_1(sc->tbar, PCHTHERM_REG_TSEL, PCHTHERM_GEN_ENABLE); sc->enable = bus_read_1(sc->tbar, PCHTHERM_REG_TSEL); - if (!(sc->enable & PCHTHERM_REG_TSEL)){ + if (!(sc->enable & PCHTHERM_GEN_ENABLE)) { device_printf(dev, "Sensor enable failed\n"); return 0; } @@ -178,7 +178,7 @@ static int pchtherm_attach(device_t dev) if (bootverbose) { FLAG_PRINT(dev, "SMBus report", val); } - val = bus_read_1(sc->tbar, PCHTHERM_REG_TSC); + val = bus_read_1(sc->tbar, PCHTHERM_REG_TSMIC); if (bootverbose) { FLAG_PRINT(dev, "SMI on alert", val); } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 10:33:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB6AA555DD2 for ; Fri, 5 Mar 2021 10:33: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 4DsPGY4bM8z4SRG; Fri, 5 Mar 2021 10:33: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 8F5156CBE; Fri, 5 Mar 2021 10:33: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 125AXf2Y093009; Fri, 5 Mar 2021 10:33:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125AXfMs093008; Fri, 5 Mar 2021 10:33:41 GMT (envelope-from git) Date: Fri, 5 Mar 2021 10:33:41 GMT Message-Id: <202103051033.125AXfMs093008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Stefan Eßer Subject: git: 1fa9712ce0ef - vendor/bc - bc: Vendor import new version 3.3.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bc X-Git-Reftype: branch X-Git-Commit: 1fa9712ce0ef8cecd4888a67f4a4179c9e19e294 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 10:33:41 -0000 The branch vendor/bc has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=1fa9712ce0ef8cecd4888a67f4a4179c9e19e294 commit 1fa9712ce0ef8cecd4888a67f4a4179c9e19e294 Author: Stefan Eßer AuthorDate: 2021-03-05 10:30:11 +0000 Commit: Stefan Eßer CommitDate: 2021-03-05 10:30:11 +0000 bc: Vendor import new version 3.3.3 --- Makefile.in | 2 +- NEWS.md | 26 +++++++++ gen/lib2.bc | 2 +- karatsuba.py | 10 ++-- manuals/bc.1.md.in | 61 +++++++++++---------- manuals/bc/A.1 | 71 ++++++++++++------------ manuals/bc/A.1.md | 59 ++++++++++---------- manuals/bc/E.1 | 69 ++++++++++++------------ manuals/bc/E.1.md | 55 ++++++++++--------- manuals/bc/EH.1 | 69 ++++++++++++------------ manuals/bc/EH.1.md | 55 ++++++++++--------- manuals/bc/EHN.1 | 69 ++++++++++++------------ manuals/bc/EHN.1.md | 55 ++++++++++--------- manuals/bc/EHNP.1 | 69 ++++++++++++------------ manuals/bc/EHNP.1.md | 55 ++++++++++--------- manuals/bc/EHP.1 | 69 ++++++++++++------------ manuals/bc/EHP.1.md | 55 ++++++++++--------- manuals/bc/EN.1 | 69 ++++++++++++------------ manuals/bc/EN.1.md | 55 ++++++++++--------- manuals/bc/ENP.1 | 69 ++++++++++++------------ manuals/bc/ENP.1.md | 55 ++++++++++--------- manuals/bc/EP.1 | 69 ++++++++++++------------ manuals/bc/EP.1.md | 55 ++++++++++--------- manuals/bc/H.1 | 71 ++++++++++++------------ manuals/bc/H.1.md | 59 ++++++++++---------- manuals/bc/HN.1 | 71 ++++++++++++------------ manuals/bc/HN.1.md | 59 ++++++++++---------- manuals/bc/HNP.1 | 71 ++++++++++++------------ manuals/bc/HNP.1.md | 59 ++++++++++---------- manuals/bc/HP.1 | 71 ++++++++++++------------ manuals/bc/HP.1.md | 59 ++++++++++---------- manuals/bc/N.1 | 71 ++++++++++++------------ manuals/bc/N.1.md | 59 ++++++++++---------- manuals/bc/NP.1 | 71 ++++++++++++------------ manuals/bc/NP.1.md | 59 ++++++++++---------- manuals/bc/P.1 | 71 ++++++++++++------------ manuals/bc/P.1.md | 59 ++++++++++---------- manuals/bcl.3 | 2 +- manuals/bcl.3.md | 76 +++++++++++++------------- manuals/dc.1.md.in | 38 ++++++------- manuals/dc/A.1 | 53 +++++++++--------- manuals/dc/A.1.md | 38 ++++++------- manuals/dc/E.1 | 53 +++++++++--------- manuals/dc/E.1.md | 38 ++++++------- manuals/dc/EH.1 | 53 +++++++++--------- manuals/dc/EH.1.md | 38 ++++++------- manuals/dc/EHN.1 | 53 +++++++++--------- manuals/dc/EHN.1.md | 38 ++++++------- manuals/dc/EHNP.1 | 53 +++++++++--------- manuals/dc/EHNP.1.md | 38 ++++++------- manuals/dc/EHP.1 | 53 +++++++++--------- manuals/dc/EHP.1.md | 38 ++++++------- manuals/dc/EN.1 | 53 +++++++++--------- manuals/dc/EN.1.md | 38 ++++++------- manuals/dc/ENP.1 | 53 +++++++++--------- manuals/dc/ENP.1.md | 38 ++++++------- manuals/dc/EP.1 | 53 +++++++++--------- manuals/dc/EP.1.md | 38 ++++++------- manuals/dc/H.1 | 53 +++++++++--------- manuals/dc/H.1.md | 38 ++++++------- manuals/dc/HN.1 | 53 +++++++++--------- manuals/dc/HN.1.md | 38 ++++++------- manuals/dc/HNP.1 | 53 +++++++++--------- manuals/dc/HNP.1.md | 38 ++++++------- manuals/dc/HP.1 | 53 +++++++++--------- manuals/dc/HP.1.md | 38 ++++++------- manuals/dc/N.1 | 53 +++++++++--------- manuals/dc/N.1.md | 38 ++++++------- manuals/dc/NP.1 | 53 +++++++++--------- manuals/dc/NP.1.md | 38 ++++++------- manuals/dc/P.1 | 53 +++++++++--------- manuals/dc/P.1.md | 38 ++++++------- manuals/header_bc.txt | 2 +- manuals/header_bcl.txt | 2 +- manuals/header_dc.txt | 2 +- src/num.c | 2 +- tests/bc/length.txt | 3 ++ tests/bc/length_results.txt | 5 +- tests/bc/lib2.txt | 6 +++ tests/bc/lib2_results.txt | 6 +++ tests/bc/scripts/bessel.bc | 9 +++- tests/dc/all.txt | 1 + tests/dc/length.txt | 129 ++++++++++++++++++++++++++++++++++++++++++++ tests/dc/length_results.txt | 129 ++++++++++++++++++++++++++++++++++++++++++++ 84 files changed, 2130 insertions(+), 1871 deletions(-) diff --git a/Makefile.in b/Makefile.in index dbb5debd44cc..db8e24967996 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.3.0 +VERSION = 3.3.3 SRC = %%SRC%% OBJ = %%OBJ%% diff --git a/NEWS.md b/NEWS.md index 6a8899200f4a..3a3433077d50 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,31 @@ # News +## 3.3.3 + +This is a production release with one tweak and fixes for manuals. + +The tweak is that `length(0)` returns `1` instead of `0`. In `3.3.1`, I changed +it so `length(0.x)`, where `x` could be any number of digits, returned the +`scale`, but `length(0)` still returned `0` because I believe that `0` has `0` +significant digits. + +After request of FreeBSD and considering the arguments of a mathematician, +compatibility with other `bc`'s, and the expectations of users, I decided to +make the change. + +The fixes for manuals fixed a bug where `--` was rendered as `-`. + +## 3.3.2 + +This is a production release that fixes a divide-by-zero bug in `root()` in the +[extended math library][16]. All previous versions with `root()` have the bug. + +## 3.3.1 + +This is a production release that fixes a bug. + +The bug was in the reporting of number length when the value was 0. + ## 3.3.0 This is a production release that changes one behavior and fixes documentation diff --git a/gen/lib2.bc b/gen/lib2.bc index b0e651eddcbd..399c7ad3d313 100644 --- a/gen/lib2.bc +++ b/gen/lib2.bc @@ -110,7 +110,7 @@ define root(x,n){ if(n<0)sqrt(n) n=n$ if(n==0)x/n - if(n==1)return x + if(x==0||n==1)return x if(n==2)return sqrt(x) s=scale scale=0 diff --git a/karatsuba.py b/karatsuba.py index f8087301f54c..cfab4c4f4fbf 100755 --- a/karatsuba.py +++ b/karatsuba.py @@ -121,20 +121,20 @@ else: p = run([ "make", "clean" ]) -print("Testing \"make -j4\"") +print("Testing \"make -j12\"") if p.returncode != 0: print("make returned an error ({}); exiting...".format(p.returncode)) sys.exit(p.returncode) -p = run([ "make", "-j4" ]) +p = run([ "make", "-j12" ]) if p.returncode == 0: - makecmd = [ "make", "-j4" ] - print("Using \"make -j4\"") + makecmd = [ "make", "-j12" ] + print("Using \"make -j12\"") else: makecmd = [ "make" ] - print("Not using \"make -j4\"") + print("Not using \"make -j12\"") if test_num != 0: mx2 = test_num diff --git a/manuals/bc.1.md.in b/manuals/bc.1.md.in index 1ce83b8237cd..661fcdd45ae4 100644 --- a/manuals/bc.1.md.in +++ b/manuals/bc.1.md.in @@ -34,8 +34,7 @@ bc - arbitrary-precision decimal arithmetic language and calculator # SYNOPSIS -**bc** [**-ghilPqsvVw**] [**--global-stacks**] [**--help**] [**--interactive**] [**--mathlib**] [**--no-prompt**] [**--quiet**] [**--standard**] [**--warn**] [**--version**] [**-e** *expr*] [**--expression**=*expr*...] [**-f** *file*...] [**-file**=*file*...] -[*file*...] +**bc** [**-ghilPqsvVw**] [**-\-global-stacks**] [**-\-help**] [**-\-interactive**] [**-\-mathlib**] [**-\-no-prompt**] [**-\-quiet**] [**-\-standard**] [**-\-warn**] [**-\-version**] [**-e** *expr*] [**-\-expression**=*expr*...] [**-f** *file*...] [**-\-file**=*file*...] [*file*...] # DESCRIPTION @@ -61,7 +60,7 @@ especially) the GNU bc(1). The following are the options that bc(1) accepts. -**-g**, **--global-stacks** +**-g**, **-\-global-stacks** {{ A H N P HN HP NP HNP }} : Turns the globals **ibase**, **obase**, **scale**, and **seed** into stacks. @@ -152,17 +151,17 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-h**, **--help** +**-h**, **-\-help** : Prints a usage message and quits. -**-i**, **--interactive** +**-i**, **-\-interactive** : Forces interactive mode. (See the **INTERACTIVE MODE** section.) This is a **non-portable extension**. -**-l**, **--mathlib** +**-l**, **-\-mathlib** : Sets **scale** (see the **SYNTAX** section) to **20** and loads the included {{ A H N P HN HP NP HNP }} @@ -178,7 +177,7 @@ The following are the options that bc(1) accepts. To learn what is in the library, see the **LIBRARY** section. {{ end }} -**-P**, **--no-prompt** +**-P**, **-\-no-prompt** {{ A E H N EH EN HN EHN }} : Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. @@ -193,36 +192,36 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-q**, **--quiet** +**-q**, **-\-quiet** : This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the **-v**, **-V**, or - **--version** options are given. + **-\-version** options are given. This is a **non-portable extension**. -**-s**, **--standard** +**-s**, **-\-standard** : Process exactly the language defined by the [standard][1] and error if any extensions are used. This is a **non-portable extension**. -**-v**, **-V**, **--version** +**-v**, **-V**, **-\-version** : Print the version information (copyright header) and exit. This is a **non-portable extension**. -**-w**, **--warn** +**-w**, **-\-warn** -: Like **-s** and **--standard**, except that warnings (and not errors) are +: Like **-s** and **-\-standard**, except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. This is a **non-portable extension**. -**-e** *expr*, **--expression**=*expr* +**-e** *expr*, **-\-expression**=*expr* : Evaluates *expr*. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -232,14 +231,14 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**, whether on the + as an argument at least once to **-f** or **-\-file**, whether on the command-line or in **BC_ENV_ARGS**. However, if any other **-e**, - **--expression**, **-f**, or **--file** arguments are given after **-f-** or - equivalent is given, bc(1) will give a fatal error and exit. + **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** + or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. -**-f** *file*, **--file**=*file* +**-f** *file*, **-\-file**=*file* : Reads in *file* and evaluates it, line by line, as though it were read through **stdin**. If expressions are also given (see above), the @@ -248,8 +247,8 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**. However, if any other - **-e**, **--expression**, **-f**, or **--file** arguments are given after + as an argument at least once to **-f** or **-\-file**. However, if any other + **-e**, **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -304,8 +303,8 @@ Identifiers with more than one character (letter) are a **ibase** is a global variable determining how to interpret constant numbers. It is the "input" base, or the number base used for interpreting input numbers. -**ibase** is initially **10**. If the **-s** (**--standard**) and **-w** -(**--warn**) flags were not given on the command line, the max allowable value +**ibase** is initially **10**. If the **-s** (**-\-standard**) and **-w** +(**-\-warn**) flags were not given on the command line, the max allowable value for **ibase** is **36**. Otherwise, it is **16**. The min allowable value for **ibase** is **2**. The max allowable value for **ibase** can be queried in bc(1) programs with the **maxibase()** built-in function. @@ -512,7 +511,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. -**++** **--** +**++** **-\-** : Type: Prefix and Postfix @@ -617,7 +616,7 @@ precedence. The operators will be described in more detail below. -**++** **--** +**++** **-\-** : The prefix and postfix **increment** and **decrement** operators behave exactly like they would in C. They require a named expression (see the @@ -962,12 +961,12 @@ This is a **non-portable extension**. {{ A H N P HN HP NP HNP }} All of the functions below, including the functions in the extended math library (see the *Extended Library* subsection below), are available when the -**-l** or **--mathlib** command-line flags are given, except that the extended +**-l** or **-\-mathlib** command-line flags are given, except that the extended math library is not available when the **-s** option, the **-w** option, or equivalents are given. {{ end }} {{ E EH EN EP EHN EHP ENP EHNP }} -All of the functions below are available when the **-l** or **--mathlib** +All of the functions below are available when the **-l** or **-\-mathlib** command-line flags are given. {{ end }} @@ -1020,8 +1019,8 @@ The [standard][1] defines the following functions for the math library: {{ A H N P HN HP NP HNP }} ## Extended Library -The extended library is *not* loaded when the **-s**/**--standard** or -**-w**/**--warn** options are given since they are not part of the library +The extended library is *not* loaded when the **-s**/**-\-standard** or +**-w**/**-\-warn** options are given since they are not part of the library defined by the [standard][1]. The extended library is a **non-portable extension**. @@ -1705,17 +1704,17 @@ The other statuses will only be returned when bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section), since bc(1) resets its state (see the **RESET** section) and accepts more input when one of those errors occurs in interactive mode. This is also the case when interactive mode is forced by the -**-i** flag or **--interactive** option. +**-i** flag or **-\-interactive** option. These exit statuses allow bc(1) to be used in shell scripting with error checking, and its normal behavior can be forced by using the **-i** flag or -**--interactive** option. +**-\-interactive** option. # INTERACTIVE MODE Per the [standard][1], bc(1) has an interactive mode and a non-interactive mode. Interactive mode is turned on automatically when both **stdin** and **stdout** -are hooked to a terminal, but the **-i** flag and **--interactive** option can +are hooked to a terminal, but the **-i** flag and **-\-interactive** option can turn it on in other cases. In interactive mode, bc(1) attempts to recover from errors (see the **RESET** diff --git a/manuals/bc/A.1 b/manuals/bc/A.1 index d1e80769c855..b38d8d35e71b 100644 --- a/manuals/bc/A.1 +++ b/manuals/bc/A.1 @@ -25,19 +25,18 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "March 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator .SH SYNOPSIS .PP -\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]\[en]global-stacks\f[R]] -[\f[B]\[en]help\f[R]] [\f[B]\[en]interactive\f[R]] -[\f[B]\[en]mathlib\f[R]] [\f[B]\[en]no-prompt\f[R]] -[\f[B]\[en]quiet\f[R]] [\f[B]\[en]standard\f[R]] [\f[B]\[en]warn\f[R]] -[\f[B]\[en]version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] -[\f[B]\[en]expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] -\f[I]file\f[R]\&...] [\f[B]-file\f[R]=\f[I]file\f[R]\&...] +\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]--global-stacks\f[R]] +[\f[B]--help\f[R]] [\f[B]--interactive\f[R]] [\f[B]--mathlib\f[R]] +[\f[B]--no-prompt\f[R]] [\f[B]--quiet\f[R]] [\f[B]--standard\f[R]] +[\f[B]--warn\f[R]] [\f[B]--version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] +[\f[B]--expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] +\f[I]file\f[R]\&...] [\f[B]--file\f[R]=\f[I]file\f[R]\&...] [\f[I]file\f[R]\&...] .SH DESCRIPTION .PP @@ -60,7 +59,7 @@ implementations. .PP The following are the options that bc(1) accepts. .TP -\f[B]-g\f[R], \f[B]\[en]global-stacks\f[R] +\f[B]-g\f[R], \f[B]--global-stacks\f[R] Turns the globals \f[B]ibase\f[R], \f[B]obase\f[R], \f[B]scale\f[R], and \f[B]seed\f[R] into stacks. .RS @@ -152,10 +151,10 @@ is ignored. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-h\f[R], \f[B]\[en]help\f[R] +\f[B]-h\f[R], \f[B]--help\f[R] Prints a usage message and quits. .TP -\f[B]-i\f[R], \f[B]\[en]interactive\f[R] +\f[B]-i\f[R], \f[B]--interactive\f[R] Forces interactive mode. (See the \f[B]INTERACTIVE MODE\f[R] section.) .RS @@ -163,7 +162,7 @@ Forces interactive mode. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-l\f[R], \f[B]\[en]mathlib\f[R] +\f[B]-l\f[R], \f[B]--mathlib\f[R] Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R] and loads the included math library and the extended math library before running any code, including any expressions or files specified on the @@ -173,7 +172,7 @@ command line. To learn what is in the libraries, see the \f[B]LIBRARY\f[R] section. .RE .TP -\f[B]-P\f[R], \f[B]\[en]no-prompt\f[R] +\f[B]-P\f[R], \f[B]--no-prompt\f[R] Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. See the \f[B]TTY MODE\f[R] section) This is mostly for those users that @@ -185,18 +184,18 @@ Most of those users would want to put this option in This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-q\f[R], \f[B]\[en]quiet\f[R] +\f[B]-q\f[R], \f[B]--quiet\f[R] This option is for compatibility with the GNU bc(1) (https://www.gnu.org/software/bc/); it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the -\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]\[en]version\f[R] options are given. +\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]--version\f[R] options are given. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-s\f[R], \f[B]\[en]standard\f[R] +\f[B]-s\f[R], \f[B]--standard\f[R] Process exactly the language defined by the standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html) and error if any extensions are used. @@ -205,15 +204,15 @@ and error if any extensions are used. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-v\f[R], \f[B]-V\f[R], \f[B]\[en]version\f[R] +\f[B]-v\f[R], \f[B]-V\f[R], \f[B]--version\f[R] Print the version information (copyright header) and exit. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-w\f[R], \f[B]\[en]warn\f[R] -Like \f[B]-s\f[R] and \f[B]\[en]standard\f[R], except that warnings (and +\f[B]-w\f[R], \f[B]--warn\f[R] +Like \f[B]-s\f[R] and \f[B]--standard\f[R], except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. .RS @@ -221,7 +220,7 @@ continues normally. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-e\f[R] \f[I]expr\f[R], \f[B]\[en]expression\f[R]=\f[I]expr\f[R] +\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R] Evaluates \f[I]expr\f[R]. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -234,17 +233,17 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]-f\f[R] or \f[B]--file\f[R], whether on the command-line or in \f[B]BC_ENV_ARGS\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-f\f[R] \f[I]file\f[R], \f[B]\[en]file\f[R]=\f[I]file\f[R] +\f[B]-f\f[R] \f[I]file\f[R], \f[B]--file\f[R]=\f[I]file\f[R] Reads in \f[I]file\f[R] and evaluates it, line by line, as though it were read through \f[B]stdin\f[R]. If expressions are also given (see above), the expressions are evaluated @@ -255,9 +254,9 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f\f[R] or \f[B]--file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP @@ -322,8 +321,8 @@ constant numbers. It is the \[lq]input\[rq] base, or the number base used for interpreting input numbers. \f[B]ibase\f[R] is initially \f[B]10\f[R]. -If the \f[B]-s\f[R] (\f[B]\[en]standard\f[R]) and \f[B]-w\f[R] -(\f[B]\[en]warn\f[R]) flags were not given on the command line, the max +If the \f[B]-s\f[R] (\f[B]--standard\f[R]) and \f[B]-w\f[R] +(\f[B]--warn\f[R]) flags were not given on the command line, the max allowable value for \f[B]ibase\f[R] is \f[B]36\f[R]. Otherwise, it is \f[B]16\f[R]. The min allowable value for \f[B]ibase\f[R] is \f[B]2\f[R]. @@ -582,7 +581,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. .TP -\f[B]++\f[R] \f[B]\[en]\f[R] +\f[B]++\f[R] \f[B]--\f[R] Type: Prefix and Postfix .RS .PP @@ -692,7 +691,7 @@ Description: \f[B]boolean or\f[R] .PP The operators will be described in more detail below. .TP -\f[B]++\f[R] \f[B]\[en]\f[R] +\f[B]++\f[R] \f[B]--\f[R] The prefix and postfix \f[B]increment\f[R] and \f[B]decrement\f[R] operators behave exactly like they would in C. They require a named expression (see the \f[I]Named Expressions\f[R] @@ -1138,7 +1137,7 @@ This is a \f[B]non-portable extension\f[R]. .PP All of the functions below, including the functions in the extended math library (see the \f[I]Extended Library\f[R] subsection below), are -available when the \f[B]-l\f[R] or \f[B]\[en]mathlib\f[R] command-line +available when the \f[B]-l\f[R] or \f[B]--mathlib\f[R] command-line flags are given, except that the extended math library is not available when the \f[B]-s\f[R] option, the \f[B]-w\f[R] option, or equivalents are given. @@ -1199,7 +1198,7 @@ Functions\f[R] subsection below). .SS Extended Library .PP The extended library is \f[I]not\f[R] loaded when the -\f[B]-s\f[R]/\f[B]\[en]standard\f[R] or \f[B]-w\f[R]/\f[B]\[en]warn\f[R] +\f[B]-s\f[R]/\f[B]--standard\f[R] or \f[B]-w\f[R]/\f[B]--warn\f[R] options are given since they are not part of the library defined by the standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html). .PP @@ -1957,11 +1956,11 @@ interactive mode (see the \f[B]INTERACTIVE MODE\f[R] section), since bc(1) resets its state (see the \f[B]RESET\f[R] section) and accepts more input when one of those errors occurs in interactive mode. This is also the case when interactive mode is forced by the -\f[B]-i\f[R] flag or \f[B]\[en]interactive\f[R] option. +\f[B]-i\f[R] flag or \f[B]--interactive\f[R] option. .PP These exit statuses allow bc(1) to be used in shell scripting with error checking, and its normal behavior can be forced by using the -\f[B]-i\f[R] flag or \f[B]\[en]interactive\f[R] option. +\f[B]-i\f[R] flag or \f[B]--interactive\f[R] option. .SH INTERACTIVE MODE .PP Per the @@ -1969,7 +1968,7 @@ standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html), bc(1) has an interactive mode and a non-interactive mode. Interactive mode is turned on automatically when both \f[B]stdin\f[R] and \f[B]stdout\f[R] are hooked to a terminal, but the \f[B]-i\f[R] flag -and \f[B]\[en]interactive\f[R] option can turn it on in other cases. +and \f[B]--interactive\f[R] option can turn it on in other cases. .PP In interactive mode, bc(1) attempts to recover from errors (see the \f[B]RESET\f[R] section), and in normal execution, flushes diff --git a/manuals/bc/A.1.md b/manuals/bc/A.1.md index 0cf7a4a0d70e..04f37c6bb724 100644 --- a/manuals/bc/A.1.md +++ b/manuals/bc/A.1.md @@ -34,8 +34,7 @@ bc - arbitrary-precision decimal arithmetic language and calculator # SYNOPSIS -**bc** [**-ghilPqsvVw**] [**--global-stacks**] [**--help**] [**--interactive**] [**--mathlib**] [**--no-prompt**] [**--quiet**] [**--standard**] [**--warn**] [**--version**] [**-e** *expr*] [**--expression**=*expr*...] [**-f** *file*...] [**-file**=*file*...] -[*file*...] +**bc** [**-ghilPqsvVw**] [**-\-global-stacks**] [**-\-help**] [**-\-interactive**] [**-\-mathlib**] [**-\-no-prompt**] [**-\-quiet**] [**-\-standard**] [**-\-warn**] [**-\-version**] [**-e** *expr*] [**-\-expression**=*expr*...] [**-f** *file*...] [**-\-file**=*file*...] [*file*...] # DESCRIPTION @@ -55,7 +54,7 @@ other implementations. The following are the options that bc(1) accepts. -**-g**, **--global-stacks** +**-g**, **-\-global-stacks** : Turns the globals **ibase**, **obase**, **scale**, and **seed** into stacks. @@ -123,17 +122,17 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-h**, **--help** +**-h**, **-\-help** : Prints a usage message and quits. -**-i**, **--interactive** +**-i**, **-\-interactive** : Forces interactive mode. (See the **INTERACTIVE MODE** section.) This is a **non-portable extension**. -**-l**, **--mathlib** +**-l**, **-\-mathlib** : Sets **scale** (see the **SYNTAX** section) to **20** and loads the included math library and the extended math library before running any code, @@ -141,7 +140,7 @@ The following are the options that bc(1) accepts. To learn what is in the libraries, see the **LIBRARY** section. -**-P**, **--no-prompt** +**-P**, **-\-no-prompt** : Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. See the **TTY MODE** section) This is mostly for those users that do not @@ -151,36 +150,36 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-q**, **--quiet** +**-q**, **-\-quiet** : This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the **-v**, **-V**, or - **--version** options are given. + **-\-version** options are given. This is a **non-portable extension**. -**-s**, **--standard** +**-s**, **-\-standard** : Process exactly the language defined by the [standard][1] and error if any extensions are used. This is a **non-portable extension**. -**-v**, **-V**, **--version** +**-v**, **-V**, **-\-version** : Print the version information (copyright header) and exit. This is a **non-portable extension**. -**-w**, **--warn** +**-w**, **-\-warn** -: Like **-s** and **--standard**, except that warnings (and not errors) are +: Like **-s** and **-\-standard**, except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. This is a **non-portable extension**. -**-e** *expr*, **--expression**=*expr* +**-e** *expr*, **-\-expression**=*expr* : Evaluates *expr*. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -190,14 +189,14 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**, whether on the + as an argument at least once to **-f** or **-\-file**, whether on the command-line or in **BC_ENV_ARGS**. However, if any other **-e**, - **--expression**, **-f**, or **--file** arguments are given after **-f-** or - equivalent is given, bc(1) will give a fatal error and exit. + **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** + or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. -**-f** *file*, **--file**=*file* +**-f** *file*, **-\-file**=*file* : Reads in *file* and evaluates it, line by line, as though it were read through **stdin**. If expressions are also given (see above), the @@ -206,8 +205,8 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**. However, if any other - **-e**, **--expression**, **-f**, or **--file** arguments are given after + as an argument at least once to **-f** or **-\-file**. However, if any other + **-e**, **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -262,8 +261,8 @@ Identifiers with more than one character (letter) are a **ibase** is a global variable determining how to interpret constant numbers. It is the "input" base, or the number base used for interpreting input numbers. -**ibase** is initially **10**. If the **-s** (**--standard**) and **-w** -(**--warn**) flags were not given on the command line, the max allowable value +**ibase** is initially **10**. If the **-s** (**-\-standard**) and **-w** +(**-\-warn**) flags were not given on the command line, the max allowable value for **ibase** is **36**. Otherwise, it is **16**. The min allowable value for **ibase** is **2**. The max allowable value for **ibase** can be queried in bc(1) programs with the **maxibase()** built-in function. @@ -453,7 +452,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. -**++** **--** +**++** **-\-** : Type: Prefix and Postfix @@ -551,7 +550,7 @@ precedence. The operators will be described in more detail below. -**++** **--** +**++** **-\-** : The prefix and postfix **increment** and **decrement** operators behave exactly like they would in C. They require a named expression (see the @@ -882,7 +881,7 @@ This is a **non-portable extension**. All of the functions below, including the functions in the extended math library (see the *Extended Library* subsection below), are available when the -**-l** or **--mathlib** command-line flags are given, except that the extended +**-l** or **-\-mathlib** command-line flags are given, except that the extended math library is not available when the **-s** option, the **-w** option, or equivalents are given. @@ -934,8 +933,8 @@ The [standard][1] defines the following functions for the math library: ## Extended Library -The extended library is *not* loaded when the **-s**/**--standard** or -**-w**/**--warn** options are given since they are not part of the library +The extended library is *not* loaded when the **-s**/**-\-standard** or +**-w**/**-\-warn** options are given since they are not part of the library defined by the [standard][1]. The extended library is a **non-portable extension**. @@ -1603,17 +1602,17 @@ The other statuses will only be returned when bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section), since bc(1) resets its state (see the **RESET** section) and accepts more input when one of those errors occurs in interactive mode. This is also the case when interactive mode is forced by the -**-i** flag or **--interactive** option. +**-i** flag or **-\-interactive** option. These exit statuses allow bc(1) to be used in shell scripting with error checking, and its normal behavior can be forced by using the **-i** flag or -**--interactive** option. +**-\-interactive** option. # INTERACTIVE MODE Per the [standard][1], bc(1) has an interactive mode and a non-interactive mode. Interactive mode is turned on automatically when both **stdin** and **stdout** -are hooked to a terminal, but the **-i** flag and **--interactive** option can +are hooked to a terminal, but the **-i** flag and **-\-interactive** option can turn it on in other cases. In interactive mode, bc(1) attempts to recover from errors (see the **RESET** diff --git a/manuals/bc/E.1 b/manuals/bc/E.1 index 597cde782788..9023b07c6b87 100644 --- a/manuals/bc/E.1 +++ b/manuals/bc/E.1 @@ -25,19 +25,18 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "March 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator .SH SYNOPSIS .PP -\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]\[en]global-stacks\f[R]] -[\f[B]\[en]help\f[R]] [\f[B]\[en]interactive\f[R]] -[\f[B]\[en]mathlib\f[R]] [\f[B]\[en]no-prompt\f[R]] -[\f[B]\[en]quiet\f[R]] [\f[B]\[en]standard\f[R]] [\f[B]\[en]warn\f[R]] -[\f[B]\[en]version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] -[\f[B]\[en]expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] -\f[I]file\f[R]\&...] [\f[B]-file\f[R]=\f[I]file\f[R]\&...] +\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]--global-stacks\f[R]] +[\f[B]--help\f[R]] [\f[B]--interactive\f[R]] [\f[B]--mathlib\f[R]] +[\f[B]--no-prompt\f[R]] [\f[B]--quiet\f[R]] [\f[B]--standard\f[R]] +[\f[B]--warn\f[R]] [\f[B]--version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] +[\f[B]--expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] +\f[I]file\f[R]\&...] [\f[B]--file\f[R]=\f[I]file\f[R]\&...] [\f[I]file\f[R]\&...] .SH DESCRIPTION .PP @@ -58,7 +57,7 @@ This bc(1) is a drop-in replacement for \f[I]any\f[R] bc(1), including .PP The following are the options that bc(1) accepts. .PP -\f[B]-g\f[R], \f[B]\[en]global-stacks\f[R] +\f[B]-g\f[R], \f[B]--global-stacks\f[R] .IP .nf \f[C] @@ -115,10 +114,10 @@ This is a **non-portable extension**. \f[R] .fi .TP -\f[B]-h\f[R], \f[B]\[en]help\f[R] +\f[B]-h\f[R], \f[B]--help\f[R] Prints a usage message and quits. .TP -\f[B]-i\f[R], \f[B]\[en]interactive\f[R] +\f[B]-i\f[R], \f[B]--interactive\f[R] Forces interactive mode. (See the \f[B]INTERACTIVE MODE\f[R] section.) .RS @@ -126,7 +125,7 @@ Forces interactive mode. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-l\f[R], \f[B]\[en]mathlib\f[R] +\f[B]-l\f[R], \f[B]--mathlib\f[R] Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R] and loads the included math library before running any code, including any expressions or files specified on the command line. @@ -135,7 +134,7 @@ any expressions or files specified on the command line. To learn what is in the library, see the \f[B]LIBRARY\f[R] section. .RE .TP -\f[B]-P\f[R], \f[B]\[en]no-prompt\f[R] +\f[B]-P\f[R], \f[B]--no-prompt\f[R] Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. See the \f[B]TTY MODE\f[R] section) This is mostly for those users that @@ -147,18 +146,18 @@ Most of those users would want to put this option in This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-q\f[R], \f[B]\[en]quiet\f[R] +\f[B]-q\f[R], \f[B]--quiet\f[R] This option is for compatibility with the GNU bc(1) (https://www.gnu.org/software/bc/); it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the -\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]\[en]version\f[R] options are given. +\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]--version\f[R] options are given. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-s\f[R], \f[B]\[en]standard\f[R] +\f[B]-s\f[R], \f[B]--standard\f[R] Process exactly the language defined by the standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html) and error if any extensions are used. @@ -167,15 +166,15 @@ and error if any extensions are used. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-v\f[R], \f[B]-V\f[R], \f[B]\[en]version\f[R] +\f[B]-v\f[R], \f[B]-V\f[R], \f[B]--version\f[R] Print the version information (copyright header) and exit. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-w\f[R], \f[B]\[en]warn\f[R] -Like \f[B]-s\f[R] and \f[B]\[en]standard\f[R], except that warnings (and +\f[B]-w\f[R], \f[B]--warn\f[R] +Like \f[B]-s\f[R] and \f[B]--standard\f[R], except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. .RS @@ -183,7 +182,7 @@ continues normally. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-e\f[R] \f[I]expr\f[R], \f[B]\[en]expression\f[R]=\f[I]expr\f[R] +\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R] Evaluates \f[I]expr\f[R]. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -196,17 +195,17 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]-f\f[R] or \f[B]--file\f[R], whether on the command-line or in \f[B]BC_ENV_ARGS\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-f\f[R] \f[I]file\f[R], \f[B]\[en]file\f[R]=\f[I]file\f[R] +\f[B]-f\f[R] \f[I]file\f[R], \f[B]--file\f[R]=\f[I]file\f[R] Reads in \f[I]file\f[R] and evaluates it, line by line, as though it were read through \f[B]stdin\f[R]. If expressions are also given (see above), the expressions are evaluated @@ -217,9 +216,9 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f\f[R] or \f[B]--file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP @@ -284,8 +283,8 @@ constant numbers. It is the \[lq]input\[rq] base, or the number base used for interpreting input numbers. \f[B]ibase\f[R] is initially \f[B]10\f[R]. -If the \f[B]-s\f[R] (\f[B]\[en]standard\f[R]) and \f[B]-w\f[R] -(\f[B]\[en]warn\f[R]) flags were not given on the command line, the max +If the \f[B]-s\f[R] (\f[B]--standard\f[R]) and \f[B]-w\f[R] +(\f[B]--warn\f[R]) flags were not given on the command line, the max allowable value for \f[B]ibase\f[R] is \f[B]36\f[R]. Otherwise, it is \f[B]16\f[R]. The min allowable value for \f[B]ibase\f[R] is \f[B]2\f[R]. @@ -445,7 +444,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. .TP *** 11304 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Mar 5 10:33:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E33A4556414 for ; Fri, 5 Mar 2021 10:33: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 4DsPGZ681Lz4S4M; Fri, 5 Mar 2021 10:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB7B96CBF; Fri, 5 Mar 2021 10:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125AXgHO093033; Fri, 5 Mar 2021 10:33:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125AXglV093032; Fri, 5 Mar 2021 10:33:42 GMT (envelope-from git) Date: Fri, 5 Mar 2021 10:33:42 GMT Message-Id: <202103051033.125AXglV093032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Stefan Eßer Subject: git: 8af6510435d0 - Create tag bc/3.3.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/tags/bc/3.3.3 X-Git-Reftype: annotated tag X-Git-Commit: 8af6510435d07c4426c0de1a9d77502acbcd3dc4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 10:33:43 -0000 The annotated tag bc/3.3.3 has been created by se: URL: https://cgit.FreeBSD.org/src/tag/?h=bc/3.3.3 tag bc/3.3.3 Tagger: Stefan Eßer TaggerDate: 2021-03-05 10:32:23 +0000 bc: Tag version 3.3.3 commit 1fa9712ce0ef8cecd4888a67f4a4179c9e19e294 Author: Stefan Eßer AuthorDate: 2021-03-05 10:30:11 +0000 Commit: Stefan Eßer CommitDate: 2021-03-05 10:30:11 +0000 bc: Vendor import new version 3.3.3 From owner-dev-commits-src-all@freebsd.org Fri Mar 5 11:23:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 202C75577C4; Fri, 5 Mar 2021 11:23: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 4DsQNY0Nhsz4X23; Fri, 5 Mar 2021 11:23: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 001667721; Fri, 5 Mar 2021 11:23: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 125BNuQk059015; Fri, 5 Mar 2021 11:23:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125BNubR059014; Fri, 5 Mar 2021 11:23:56 GMT (envelope-from git) Date: Fri, 5 Mar 2021 11:23:56 GMT Message-Id: <202103051123.125BNubR059014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: c4ba4aa54718 - main - libifconfig: Overhaul ifconfig_media_* interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4ba4aa547184ab401204096cdad9def4ab37964 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 11:23:57 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=c4ba4aa547184ab401204096cdad9def4ab37964 commit c4ba4aa547184ab401204096cdad9def4ab37964 Author: Ryan Moeller AuthorDate: 2021-03-02 10:29:17 +0000 Commit: Ryan Moeller CommitDate: 2021-03-05 09:15:55 +0000 libifconfig: Overhaul ifconfig_media_* interfaces Define an ifmedia_t type to use for ifmedia words. Add ifconfig_media_lookup_* functions to lookup ifmedia words by name. Get media options as an array of option names rather than formatting it as a comma-delimited list into a buffer. Sprinkle const on static the static description tables for peace of mind. Don't need to zero memory allocated by calloc. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29029 --- lib/libifconfig/Makefile | 2 +- lib/libifconfig/Symbol.map | 9 +- lib/libifconfig/libifconfig.h | 69 +++++++- lib/libifconfig/libifconfig_media.c | 339 ++++++++++++++++++++++++------------ share/examples/libifconfig/status.c | 27 ++- 5 files changed, 324 insertions(+), 122 deletions(-) diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile index 73dad36c1dc5..c6f006018427 100644 --- a/lib/libifconfig/Makefile +++ b/lib/libifconfig/Makefile @@ -7,7 +7,7 @@ INTERNALLIB= true LIBADD= m SHLIBDIR?= /lib -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map diff --git a/lib/libifconfig/Symbol.map b/lib/libifconfig/Symbol.map index 235092376b11..2d80fb31652a 100644 --- a/lib/libifconfig/Symbol.map +++ b/lib/libifconfig/Symbol.map @@ -26,12 +26,17 @@ FBSD_1.6 { ifconfig_lagg_get_lagg_status; ifconfig_lagg_get_laggport_status; ifconfig_list_cloners; + ifconfig_media_get_downreason; ifconfig_media_get_mediareq; - ifconfig_media_get_options_string; + ifconfig_media_get_mode; + ifconfig_media_get_options; ifconfig_media_get_status; ifconfig_media_get_subtype; ifconfig_media_get_type; - ifconfig_media_get_downreason; + ifconfig_media_lookup_mode; + ifconfig_media_lookup_options; + ifconfig_media_lookup_subtype; + ifconfig_media_lookup_type; ifconfig_open; ifconfig_set_capability; ifconfig_set_description; diff --git a/lib/libifconfig/libifconfig.h b/lib/libifconfig/libifconfig.h index d8245ea13b23..e1cd6d1821a5 100644 --- a/lib/libifconfig/libifconfig.h +++ b/lib/libifconfig/libifconfig.h @@ -202,10 +202,73 @@ int ifconfig_get_ifstatus(ifconfig_handle_t *h, const char *name, */ int ifconfig_media_get_mediareq(ifconfig_handle_t *h, const char *name, struct ifmediareq **ifmr); -const char *ifconfig_media_get_type(int ifmw); -const char *ifconfig_media_get_subtype(int ifmw); + const char *ifconfig_media_get_status(const struct ifmediareq *ifmr); -void ifconfig_media_get_options_string(int ifmw, char *buf, size_t buflen); + +typedef int ifmedia_t; + +#define INVALID_IFMEDIA ((ifmedia_t)-1) + +/** Retrieve the name of a media type + * @param media The media to be named + * @return A pointer to the media type name, or NULL on failure + */ +const char *ifconfig_media_get_type(ifmedia_t media); + +/** Retrieve a media type by its name + * @param name The name of a media type + * @return The media type value, or INVALID_IFMEDIA on failure + */ +ifmedia_t ifconfig_media_lookup_type(const char *name); + +/** Retrieve the name of a media subtype + * @param media The media subtype to be named + * @return A pointer to the media subtype name, or NULL on failure + */ +const char *ifconfig_media_get_subtype(ifmedia_t media); + +/** Retrieve a media subtype by its name + * @param media The top level media type whose subtype we want + * @param name The name of a media subtype + * @return The media subtype value, or INVALID_IFMEDIA on failure + */ +ifmedia_t ifconfig_media_lookup_subtype(ifmedia_t media, const char *name); + +/** Retrieve the name of a media mode + * @param media The media mode to be named + * @return A pointer to the media mode name, or NULL on failure + */ +const char *ifconfig_media_get_mode(ifmedia_t media); + +/** Retrieve a media mode by its name + * @param media The top level media type whose mode we want + * @param name The name of a media mode + * @return The media mode value, or INVALID_IFMEDIA on failure + */ +ifmedia_t ifconfig_media_lookup_mode(ifmedia_t media, const char *name); + +/** Retrieve an array of media options + * @param media The media for which to obtain the options + * @return Pointer to an array of pointers to option names, + * terminated by a NULL pointer, or simply NULL on failure. + * The caller is responsible for freeing the array but not its + * contents. + */ +const char **ifconfig_media_get_options(ifmedia_t media); + +/** Retrieve an array of media options by names + * @param media The top level media type whose options we want + * @param opts Pointer to an array of string pointers naming options + * @param nopts Number of elements in the opts array + * @return Pointer to an array of media options, one for each option named + * in opts. NULL is returned instead with errno set to ENOMEM if + * allocating the return array fails or EINVAL if media is not + * valid. A media option in the array will be INVALID_IFMEDIA + * when lookup failed for the option named in that position in + * opts. The caller is responsible for freeing the array. + */ +ifmedia_t *ifconfig_media_lookup_options(ifmedia_t media, const char **opts, + size_t nopts); /** Retrieve the reason the interface is down * @param h An open ifconfig state object diff --git a/lib/libifconfig/libifconfig_media.c b/lib/libifconfig/libifconfig_media.c index d7ef507604be..e27f5900e3d3 100644 --- a/lib/libifconfig/libifconfig_media.c +++ b/lib/libifconfig/libifconfig_media.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -53,11 +54,9 @@ #include "libifconfig.h" #include "libifconfig_internal.h" - -static struct ifmedia_description *get_toptype_desc(int); -static struct ifmedia_type_to_subtype *get_toptype_ttos(int); -static struct ifmedia_description *get_subtype_desc(int, - struct ifmedia_type_to_subtype *ttos); +static const struct ifmedia_description *lookup_media_desc( + const struct ifmedia_description *, const char *); +static const struct ifmedia_type_to_subtype *get_toptype_ttos(ifmedia_t); #define IFM_OPMODE(x) \ ((x) & (IFM_IEEE80211_ADHOC | IFM_IEEE80211_HOSTAP | \ @@ -65,74 +64,100 @@ static struct ifmedia_description *get_subtype_desc(int, IFM_IEEE80211_MBSS)) #define IFM_IEEE80211_STA 0 -static struct ifmedia_description ifm_type_descriptions[] = +static const struct ifmedia_description + ifm_type_descriptions[] = IFM_TYPE_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_ethernet_descriptions[] = +static const struct ifmedia_description + ifm_subtype_ethernet_descriptions[] = IFM_SUBTYPE_ETHERNET_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_ethernet_aliases[] = +static const struct ifmedia_description + ifm_subtype_ethernet_aliases[] = IFM_SUBTYPE_ETHERNET_ALIASES; -static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] = +static const struct ifmedia_description + ifm_subtype_ethernet_option_descriptions[] = IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = +static const struct ifmedia_description + ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_ieee80211_aliases[] = +static const struct ifmedia_description + ifm_subtype_ieee80211_aliases[] = IFM_SUBTYPE_IEEE80211_ALIASES; -static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] = +static const struct ifmedia_description + ifm_subtype_ieee80211_option_descriptions[] = IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = +static const struct ifmedia_description + ifm_subtype_ieee80211_mode_descriptions[] = IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] = +static const struct ifmedia_description + ifm_subtype_ieee80211_mode_aliases[] = IFM_SUBTYPE_IEEE80211_MODE_ALIASES; -static struct ifmedia_description ifm_subtype_atm_descriptions[] = +static const struct ifmedia_description + ifm_subtype_atm_descriptions[] = IFM_SUBTYPE_ATM_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_atm_aliases[] = +static const struct ifmedia_description + ifm_subtype_atm_aliases[] = IFM_SUBTYPE_ATM_ALIASES; -static struct ifmedia_description ifm_subtype_atm_option_descriptions[] = +static const struct ifmedia_description + ifm_subtype_atm_option_descriptions[] = IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_shared_descriptions[] = +static const struct ifmedia_description + ifm_subtype_shared_descriptions[] = IFM_SUBTYPE_SHARED_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_shared_aliases[] = +static const struct ifmedia_description + ifm_subtype_shared_aliases[] = IFM_SUBTYPE_SHARED_ALIASES; -static struct ifmedia_description ifm_shared_option_descriptions[] = +static const struct ifmedia_description + ifm_shared_option_descriptions[] = IFM_SHARED_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_shared_option_aliases[] = +static const struct ifmedia_description + ifm_shared_option_aliases[] = IFM_SHARED_OPTION_ALIASES; +static const struct ifmedia_description * +lookup_media_desc(const struct ifmedia_description *desc, const char *name) +{ + + for (; desc->ifmt_string != NULL; ++desc) + if (strcasecmp(desc->ifmt_string, name) == 0) + return (desc); + return (NULL); +} + struct ifmedia_type_to_subtype { struct { - struct ifmedia_description *desc; - int alias; + const struct ifmedia_description *desc; + bool alias; } subtypes[5]; struct { - struct ifmedia_description *desc; - int alias; + const struct ifmedia_description *desc; + bool alias; } options[4]; struct { - struct ifmedia_description *desc; - int alias; + const struct ifmedia_description *desc; + bool alias; } modes[3]; }; /* must be in the same order as IFM_TYPE_DESCRIPTIONS */ -static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = +static const struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = { { { @@ -192,83 +217,214 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = }, }; -static struct ifmedia_description * -get_toptype_desc(int ifmw) +static const struct ifmedia_type_to_subtype * +get_toptype_ttos(ifmedia_t media) { - struct ifmedia_description *desc; + const struct ifmedia_description *desc; + const struct ifmedia_type_to_subtype *ttos; - for (desc = ifm_type_descriptions; desc->ifmt_string != NULL; desc++) { - if (IFM_TYPE(ifmw) == desc->ifmt_word) { - break; - } + for (desc = ifm_type_descriptions, ttos = ifmedia_types_to_subtypes; + desc->ifmt_string != NULL; desc++, ttos++) { + if (IFM_TYPE(media) == desc->ifmt_word) + return (ttos); } - - return (desc); + errno = ENOENT; + return (NULL); } -static struct ifmedia_type_to_subtype * -get_toptype_ttos(int ifmw) +const char * +ifconfig_media_get_type(ifmedia_t media) { - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; + const struct ifmedia_description *desc; - for (desc = ifm_type_descriptions, ttos = ifmedia_types_to_subtypes; - desc->ifmt_string != NULL; desc++, ttos++) { - if (IFM_TYPE(ifmw) == desc->ifmt_word) { - break; - } + for (desc = ifm_type_descriptions; desc->ifmt_string != NULL; ++desc) { + if (IFM_TYPE(media) == desc->ifmt_word) + return (desc->ifmt_string); } + errno = ENOENT; + return (NULL); +} + +ifmedia_t +ifconfig_media_lookup_type(const char *name) +{ + const struct ifmedia_description *desc; - return (ttos); + desc = lookup_media_desc(ifm_type_descriptions, name); + return (desc == NULL ? INVALID_IFMEDIA : desc->ifmt_word); } -static struct ifmedia_description * -get_subtype_desc(int ifmw, - struct ifmedia_type_to_subtype *ttos) +const char * +ifconfig_media_get_subtype(ifmedia_t media) { - int i; - struct ifmedia_description *desc; + const struct ifmedia_description *desc; + const struct ifmedia_type_to_subtype *ttos; + + ttos = get_toptype_ttos(media); + if (ttos == NULL) { + errno = EINVAL; + return (NULL); + } - for (i = 0; ttos->subtypes[i].desc != NULL; i++) { - if (ttos->subtypes[i].alias) { + for (size_t i = 0; ttos->subtypes[i].desc != NULL; ++i) { + if (ttos->subtypes[i].alias) continue; - } for (desc = ttos->subtypes[i].desc; - desc->ifmt_string != NULL; desc++) { - if (IFM_SUBTYPE(ifmw) == desc->ifmt_word) { - return (desc); - } + desc->ifmt_string != NULL; ++desc) { + if (IFM_SUBTYPE(media) == desc->ifmt_word) + return (desc->ifmt_string); } } - + errno = ENOENT; return (NULL); } -const char * -ifconfig_media_get_type(int ifmw) +ifmedia_t +ifconfig_media_lookup_subtype(ifmedia_t media, const char *name) { - struct ifmedia_description *desc; + const struct ifmedia_description *desc; + const struct ifmedia_type_to_subtype *ttos; - /*int seen_option = 0, i;*/ + ttos = get_toptype_ttos(media); + if (ttos == NULL) { + errno = EINVAL; + return (INVALID_IFMEDIA); + } - /* Find the top-level interface type. */ - desc = get_toptype_desc(ifmw); - if (desc->ifmt_string == NULL) { - return (""); - } else { - return (desc->ifmt_string); + for (size_t i = 0; ttos->subtypes[i].desc != NULL; ++i) { + desc = lookup_media_desc(ttos->subtypes[i].desc, name); + if (desc != NULL) + return (desc->ifmt_word); } + errno = ENOENT; + return (INVALID_IFMEDIA); } const char * -ifconfig_media_get_subtype(int ifmw) +ifconfig_media_get_mode(ifmedia_t media) { - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; + const struct ifmedia_description *desc; + const struct ifmedia_type_to_subtype *ttos; + + ttos = get_toptype_ttos(media); + if (ttos == NULL) { + errno = EINVAL; + return (NULL); + } - ttos = get_toptype_ttos(ifmw); - desc = get_subtype_desc(ifmw, ttos); - return (desc->ifmt_string); + for (size_t i = 0; ttos->modes[i].desc != NULL; ++i) { + if (ttos->modes[i].alias) + continue; + for (desc = ttos->modes[i].desc; + desc->ifmt_string != NULL; ++desc) { + if (IFM_MODE(media) == desc->ifmt_word) + return (desc->ifmt_string); + } + } + errno = ENOENT; + return (NULL); +} + +ifmedia_t +ifconfig_media_lookup_mode(ifmedia_t media, const char *name) +{ + const struct ifmedia_description *desc; + const struct ifmedia_type_to_subtype *ttos; + + ttos = get_toptype_ttos(media); + if (ttos == NULL) { + errno = EINVAL; + return (INVALID_IFMEDIA); + } + + for (size_t i = 0; ttos->modes[i].desc != NULL; ++i) { + desc = lookup_media_desc(ttos->modes[i].desc, name); + if (desc != NULL) + return (desc->ifmt_word); + } + errno = ENOENT; + return (INVALID_IFMEDIA); +} + +const char ** +ifconfig_media_get_options(ifmedia_t media) +{ + const char **options; + const struct ifmedia_description *desc; + const struct ifmedia_type_to_subtype *ttos; + size_t n; + + ttos = get_toptype_ttos(media); + if (ttos == NULL) { + errno = EINVAL; + return (NULL); + } + + n = 0; + for (size_t i = 0; ttos->options[i].desc != NULL; ++i) { + if (ttos->options[i].alias) + continue; + for (desc = ttos->options[i].desc; + desc->ifmt_string != NULL; ++desc) { + if ((media & desc->ifmt_word) != 0) + ++n; + } + } + if (n == 0) { + errno = ENOENT; + return (NULL); + } + + options = calloc(n + 1, sizeof(*options)); + if (options == NULL) + return (NULL); + + options[n] = NULL; + n = 0; + for (size_t i = 0; ttos->options[i].desc != NULL; ++i) { + if (ttos->options[i].alias) + continue; + for (desc = ttos->options[i].desc; + desc->ifmt_string != NULL; ++desc) { + if ((media & desc->ifmt_word) != 0) { + options[n] = desc->ifmt_string; + ++n; + } + } + } + return (options); +} + +ifmedia_t * +ifconfig_media_lookup_options(ifmedia_t media, const char **opts, size_t nopts) +{ + ifmedia_t *options; + const struct ifmedia_description *desc, *opt; + const struct ifmedia_type_to_subtype *ttos; + + assert(opts != NULL); + assert(nopts > 0); + + ttos = get_toptype_ttos(media); + if (ttos == NULL) { + errno = EINVAL; + return (NULL); + } + + options = calloc(nopts, sizeof(*options)); + if (options == NULL) + return (NULL); + (void)memset(options, INVALID_IFMEDIA, nopts * sizeof(ifmedia_t)); + + for (size_t i = 0; ttos->options[i].desc != NULL; ++i) { + desc = ttos->options[i].desc; + for (size_t j = 0; j < nopts; ++j) { + opt = lookup_media_desc(desc, opts[j]); + if (opt != NULL) + options[j] = opt->ifmt_word; + } + } + return (options); } /*************************************************************************** @@ -295,7 +451,6 @@ ifconfig_media_get_mediareq(ifconfig_handle_t *h, const char *name, h->error.errcode = ENOMEM; return (-1); } - (void)memset(ms, 0, sizeof(*ms)); (void)strlcpy(ms->ifmr.ifm_name, name, sizeof(ms->ifmr.ifm_name)); /* @@ -363,36 +518,6 @@ ifconfig_media_get_status(const struct ifmediareq *ifmr) } } -void -ifconfig_media_get_options_string(int ifmw, char *buf, size_t buflen) -{ - struct ifmedia_type_to_subtype *ttos; - struct ifmedia_description *desc; - int i, seen_option = 0; - size_t len; - - assert(buflen > 0); - buf[0] = '\0'; - ttos = get_toptype_ttos(ifmw); - for (i = 0; ttos->options[i].desc != NULL; i++) { - if (ttos->options[i].alias) { - continue; - } - for (desc = ttos->options[i].desc; - desc->ifmt_string != NULL; desc++) { - if (ifmw & desc->ifmt_word) { - if (seen_option++) { - strlcat(buf, ",", buflen); - } - len = strlcat(buf, desc->ifmt_string, buflen); - assert(len < buflen); - buf += len; - buflen -= len; - } - } - } -} - int ifconfig_media_get_downreason(ifconfig_handle_t *h, const char *name, struct ifdownreason *ifdr) diff --git a/share/examples/libifconfig/status.c b/share/examples/libifconfig/status.c index 62fd3f35c8de..114cf7e87a68 100644 --- a/share/examples/libifconfig/status.c +++ b/share/examples/libifconfig/status.c @@ -406,7 +406,6 @@ print_media(ifconfig_handle_t *lifh, struct ifaddrs *ifa) * tables, finding an entry with the right media subtype */ struct ifmediareq *ifmr; - char opts[80]; if (ifconfig_media_get_mediareq(lifh, ifa->ifa_name, &ifmr) != 0) { if (ifconfig_err_errtype(lifh) != OK) { @@ -419,14 +418,19 @@ print_media(ifconfig_handle_t *lifh, struct ifaddrs *ifa) printf("\tmedia: %s %s", ifconfig_media_get_type(ifmr->ifm_current), ifconfig_media_get_subtype(ifmr->ifm_current)); if (ifmr->ifm_active != ifmr->ifm_current) { + const char **options; + printf(" (%s", ifconfig_media_get_subtype(ifmr->ifm_active)); - ifconfig_media_get_options_string(ifmr->ifm_active, opts, - sizeof(opts)); - if (opts[0] != '\0') { - printf(" <%s>)\n", opts); + options = ifconfig_media_get_options(ifmr->ifm_active); + if (options != NULL && options[0] != NULL) { + printf(" <%s", options[0]); + for (size_t i = 1; options[i] != NULL; ++i) + printf(",%s", options[i]); + printf(">)\n"); } else { printf(")\n"); } + free(options); } else { printf("\n"); } @@ -438,15 +442,20 @@ print_media(ifconfig_handle_t *lifh, struct ifaddrs *ifa) printf("\tsupported media:\n"); for (i = 0; i < ifmr->ifm_count; i++) { + const char **options; + printf("\t\tmedia %s", ifconfig_media_get_subtype(ifmr->ifm_ulist[i])); - ifconfig_media_get_options_string(ifmr->ifm_ulist[i], opts, - sizeof(opts)); - if (opts[0] != '\0') { - printf(" mediaopt %s\n", opts); + options = ifconfig_media_get_options(ifmr->ifm_ulist[i]); + if (options != NULL && options[0] != NULL) { + printf(" mediaopt %s", options[0]); + for (size_t i = 1; options[i] != NULL; ++i) + printf(",%s", options[i]); + printf("\n"); } else { printf("\n"); } + free(options); } free(ifmr); } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 11:23:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39A60557814; Fri, 5 Mar 2021 11:23: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 4DsQNZ18jNz4X4M; Fri, 5 Mar 2021 11:23: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 1A787794E; Fri, 5 Mar 2021 11:23: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 125BNwOW059033; Fri, 5 Mar 2021 11:23:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125BNwPv059032; Fri, 5 Mar 2021 11:23:58 GMT (envelope-from git) Date: Fri, 5 Mar 2021 11:23:58 GMT Message-Id: <202103051123.125BNwPv059032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 2803fa471e77 - main - sbin/ifconfig: Get media status with libifconfig MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2803fa471e77dc8f227fe00bbf075de7feb10022 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 11:23:58 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=2803fa471e77dc8f227fe00bbf075de7feb10022 commit 2803fa471e77dc8f227fe00bbf075de7feb10022 Author: Ryan Moeller AuthorDate: 2021-02-28 20:27:28 +0000 Commit: Ryan Moeller CommitDate: 2021-03-05 09:15:55 +0000 sbin/ifconfig: Get media status with libifconfig Code deduplication. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29030 --- sbin/ifconfig/ifconfig.h | 2 +- sbin/ifconfig/ifieee80211.c | 2 +- sbin/ifconfig/ifmedia.c | 673 ++++++++++++-------------------------------- 3 files changed, 176 insertions(+), 501 deletions(-) diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 61b1137b47ba..ea541c5e9257 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -161,7 +161,7 @@ void sfp_status(int s, struct ifreq *ifr, int verbose); * XXX expose this so modules that neeed to know of any pending * operations on ifmedia can avoid cmd line ordering confusion. */ -struct ifmediareq *ifmedia_getstate(int s); +struct ifmediareq *ifmedia_getstate(void); void print_vhid(const struct ifaddrs *, const char *); diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index bb406469829a..cfaf163f5930 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -239,7 +239,7 @@ getchaninfo(int s) if (get80211(s, IEEE80211_IOC_CHANINFO, chaninfo, IEEE80211_CHANINFO_SIZE(MAXCHAN)) < 0) err(1, "unable to get channel information"); - ifmr = ifmedia_getstate(s); + ifmr = ifmedia_getstate(); gethtconf(s); getvhtconf(s); } diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index cd3600df454c..66eb40254889 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -86,201 +86,103 @@ #include #include +#include + #include "ifconfig.h" -static void domediaopt(const char *, int, int); -static int get_media_subtype(int, const char *); -static int get_media_mode(int, const char *); -static int get_media_options(int, const char *); -static int lookup_media_word(struct ifmedia_description *, const char *); -static void print_media_word(int, int); -static void print_media_word_ifconfig(int); - -static struct ifmedia_description *get_toptype_desc(int); -static struct ifmedia_type_to_subtype *get_toptype_ttos(int); -static struct ifmedia_description *get_subtype_desc(int, - struct ifmedia_type_to_subtype *ttos); - -#define IFM_OPMODE(x) \ - ((x) & (IFM_IEEE80211_ADHOC | IFM_IEEE80211_HOSTAP | \ - IFM_IEEE80211_IBSS | IFM_IEEE80211_WDS | IFM_IEEE80211_MONITOR | \ - IFM_IEEE80211_MBSS)) -#define IFM_IEEE80211_STA 0 +static void domediaopt(const char *, bool, int); +static ifmedia_t get_media_subtype(ifmedia_t, const char *); +static ifmedia_t get_media_mode(ifmedia_t, const char *); +static ifmedia_t get_media_options(ifmedia_t, const char *); +static void print_media(ifmedia_t, bool); +static void print_media_ifconfig(ifmedia_t); static void media_status(int s) { - struct ifmediareq ifmr; - struct ifdownreason ifdr; - int *media_list, i; - bool no_carrier, xmedia; - - (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); - xmedia = true; + struct ifmediareq *ifmr; - /* - * Check if interface supports extended media types. - */ - if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) - xmedia = false; - if (!xmedia && ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { - /* - * Interface doesn't support SIOC{G,S}IFMEDIA. - */ + if (ifconfig_media_get_mediareq(lifh, name, &ifmr) == -1) return; - } - if (ifmr.ifm_count == 0) { + if (ifmr->ifm_count == 0) { warnx("%s: no media types?", name); - return; - } - - media_list = (int *)malloc(ifmr.ifm_count * sizeof(int)); - if (media_list == NULL) - err(1, "malloc"); - ifmr.ifm_ulist = media_list; - - if (xmedia) { - if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) - err(1, "SIOCGIFXMEDIA"); - } else { - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) - err(1, "SIOCGIFMEDIA"); + goto free; } printf("\tmedia: "); - print_media_word(ifmr.ifm_current, 1); - if (ifmr.ifm_active != ifmr.ifm_current) { + print_media(ifmr->ifm_current, true); + if (ifmr->ifm_active != ifmr->ifm_current) { putchar(' '); putchar('('); - print_media_word(ifmr.ifm_active, 0); + print_media(ifmr->ifm_active, false); putchar(')'); } putchar('\n'); - if (ifmr.ifm_status & IFM_AVALID) { - no_carrier = false; - printf("\tstatus: "); - switch (IFM_TYPE(ifmr.ifm_active)) { - case IFM_ETHER: - case IFM_ATM: - if (ifmr.ifm_status & IFM_ACTIVE) - printf("active"); - else - no_carrier = true; - break; - - case IFM_IEEE80211: - if (ifmr.ifm_status & IFM_ACTIVE) { - /* NB: only sta mode associates */ - if (IFM_OPMODE(ifmr.ifm_active) == IFM_IEEE80211_STA) - printf("associated"); - else - printf("running"); - } else - no_carrier = true; - break; - } - if (no_carrier) { - printf("no carrier"); - memset(&ifdr, 0, sizeof(ifdr)); - strlcpy(ifdr.ifdr_name, name, sizeof(ifdr.ifdr_name)); - if (ioctl(s, SIOCGIFDOWNREASON, (caddr_t)&ifdr) == 0) { - switch (ifdr.ifdr_reason) { - case IFDR_REASON_MSG: - printf(" (%s)", ifdr.ifdr_msg); - break; - case IFDR_REASON_VENDOR: - printf(" (vendor code %d)", - ifdr.ifdr_vendor); - break; - default: - break; - } + if (ifmr->ifm_status & IFM_AVALID) { + struct ifdownreason ifdr; + const char *status; + + status = ifconfig_media_get_status(ifmr); + printf("\tstatus: %s", status); + if (strcmp(status, "no carrier") == 0 && + ifconfig_media_get_downreason(lifh, name, &ifdr) == 0) { + switch (ifdr.ifdr_reason) { + case IFDR_REASON_MSG: + printf(" (%s)", ifdr.ifdr_msg); + break; + case IFDR_REASON_VENDOR: + printf(" (vendor code %d)", + ifdr.ifdr_vendor); + break; + default: + break; } } putchar('\n'); } - if (ifmr.ifm_count > 0 && supmedia) { + if (supmedia) { printf("\tsupported media:\n"); - for (i = 0; i < ifmr.ifm_count; i++) { + for (size_t i = 0; i < ifmr->ifm_count; ++i) { printf("\t\t"); - print_media_word_ifconfig(media_list[i]); + print_media_ifconfig(ifmr->ifm_ulist[i]); putchar('\n'); } } - - free(media_list); +free: + free(ifmr); } struct ifmediareq * -ifmedia_getstate(int s) +ifmedia_getstate(void) { - static struct ifmediareq *ifmr = NULL; - int *mwords; - int xmedia = 1; - - if (ifmr == NULL) { - ifmr = (struct ifmediareq *)malloc(sizeof(struct ifmediareq)); - if (ifmr == NULL) - err(1, "malloc"); - - (void) memset(ifmr, 0, sizeof(struct ifmediareq)); - (void) strlcpy(ifmr->ifm_name, name, - sizeof(ifmr->ifm_name)); - - ifmr->ifm_count = 0; - ifmr->ifm_ulist = NULL; - - /* - * We must go through the motions of reading all - * supported media because we need to know both - * the current media type and the top-level type. - */ - - if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) < 0) { - xmedia = 0; - } - if (xmedia == 0 && ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) { - err(1, "SIOCGIFMEDIA"); - } + static struct ifmediareq *ifmr; - if (ifmr->ifm_count == 0) - errx(1, "%s: no media types?", name); - - mwords = (int *)malloc(ifmr->ifm_count * sizeof(int)); - if (mwords == NULL) - err(1, "malloc"); - - ifmr->ifm_ulist = mwords; - if (xmedia) { - if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) < 0) - err(1, "SIOCGIFXMEDIA"); - } else { - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) - err(1, "SIOCGIFMEDIA"); - } - } + if (ifconfig_media_get_mediareq(lifh, name, &ifmr) == -1) + errc(1, ifconfig_err_errno(lifh), + "%s: ifconfig_media_get_mediareq", name); - return ifmr; + if (ifmr->ifm_count == 0) + errx(1, "%s: no media types?", name); + + return (ifmr); } static void setifmediacallback(int s, void *arg) { struct ifmediareq *ifmr = (struct ifmediareq *)arg; - static int did_it = 0; + static bool did_it = false; if (!did_it) { ifr.ifr_media = ifmr->ifm_current; if (ioctl(s, SIOCSIFMEDIA, (caddr_t)&ifr) < 0) err(1, "SIOCSIFMEDIA (media)"); - free(ifmr->ifm_ulist); free(ifmr); - did_it = 1; + did_it = true; } } @@ -290,7 +192,7 @@ setmedia(const char *val, int d, int s, const struct afswtch *afp) struct ifmediareq *ifmr; int subtype; - ifmr = ifmedia_getstate(s); + ifmr = ifmedia_getstate(); /* * We are primarily concerned with the top-level type. @@ -301,7 +203,7 @@ setmedia(const char *val, int d, int s, const struct afswtch *afp) * (I'm assuming that all supported media types for a given * interface will be the same top-level type..) */ - subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); + subtype = get_media_subtype(ifmr->ifm_ulist[0], val); strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | @@ -315,25 +217,25 @@ static void setmediaopt(const char *val, int d, int s, const struct afswtch *afp) { - domediaopt(val, 0, s); + domediaopt(val, false, s); } static void unsetmediaopt(const char *val, int d, int s, const struct afswtch *afp) { - domediaopt(val, 1, s); + domediaopt(val, true, s); } static void -domediaopt(const char *val, int clear, int s) +domediaopt(const char *val, bool clear, int s) { struct ifmediareq *ifmr; - int options; + ifmedia_t options; - ifmr = ifmedia_getstate(s); + ifmr = ifmedia_getstate(); - options = get_media_options(IFM_TYPE(ifmr->ifm_ulist[0]), val); + options = get_media_options(ifmr->ifm_ulist[0], val); strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = ifmr->ifm_current; @@ -356,7 +258,7 @@ setmediainst(const char *val, int d, int s, const struct afswtch *afp) struct ifmediareq *ifmr; int inst; - ifmr = ifmedia_getstate(s); + ifmr = ifmedia_getstate(); inst = atoi(val); if (inst < 0 || inst > (int)IFM_INST_MAX) @@ -375,9 +277,9 @@ setmediamode(const char *val, int d, int s, const struct afswtch *afp) struct ifmediareq *ifmr; int mode; - ifmr = ifmedia_getstate(s); + ifmr = ifmedia_getstate(); - mode = get_media_mode(IFM_TYPE(ifmr->ifm_ulist[0]), val); + mode = get_media_mode(ifmr->ifm_ulist[0], val); strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & ~IFM_MMASK) | mode; @@ -386,320 +288,112 @@ setmediamode(const char *val, int d, int s, const struct afswtch *afp) callback_register(setifmediacallback, (void *)ifmr); } -/********************************************************************** - * A good chunk of this is duplicated from sys/net/if_media.c - **********************************************************************/ - -static struct ifmedia_description ifm_type_descriptions[] = - IFM_TYPE_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_ethernet_descriptions[] = - IFM_SUBTYPE_ETHERNET_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_ethernet_aliases[] = - IFM_SUBTYPE_ETHERNET_ALIASES; - -static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] = - IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = - IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_ieee80211_aliases[] = - IFM_SUBTYPE_IEEE80211_ALIASES; - -static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] = - IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS; - -struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = - IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS; - -struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] = - IFM_SUBTYPE_IEEE80211_MODE_ALIASES; - -static struct ifmedia_description ifm_subtype_atm_descriptions[] = - IFM_SUBTYPE_ATM_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_atm_aliases[] = - IFM_SUBTYPE_ATM_ALIASES; - -static struct ifmedia_description ifm_subtype_atm_option_descriptions[] = - IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_shared_descriptions[] = - IFM_SUBTYPE_SHARED_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_shared_aliases[] = - IFM_SUBTYPE_SHARED_ALIASES; - -static struct ifmedia_description ifm_shared_option_descriptions[] = - IFM_SHARED_OPTION_DESCRIPTIONS; - -static struct ifmedia_description ifm_shared_option_aliases[] = - IFM_SHARED_OPTION_ALIASES; - -struct ifmedia_type_to_subtype { - struct { - struct ifmedia_description *desc; - int alias; - } subtypes[5]; - struct { - struct ifmedia_description *desc; - int alias; - } options[4]; - struct { - struct ifmedia_description *desc; - int alias; - } modes[3]; -}; - -/* must be in the same order as IFM_TYPE_DESCRIPTIONS */ -static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = { - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_ethernet_descriptions[0], 0 }, - { &ifm_subtype_ethernet_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_ethernet_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_ieee80211_descriptions[0], 0 }, - { &ifm_subtype_ieee80211_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_ieee80211_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { &ifm_subtype_ieee80211_mode_descriptions[0], 0 }, - { &ifm_subtype_ieee80211_mode_aliases[0], 0 }, - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_atm_descriptions[0], 0 }, - { &ifm_subtype_atm_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_atm_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, -}; - -static int -get_media_subtype(int type, const char *val) +static ifmedia_t +get_media_subtype(ifmedia_t media, const char *val) { - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; - int rval, i; - - /* Find the top-level interface type. */ - for (desc = ifm_type_descriptions, ttos = ifmedia_types_to_subtypes; - desc->ifmt_string != NULL; desc++, ttos++) - if (type == desc->ifmt_word) - break; - if (desc->ifmt_string == NULL) - errx(1, "unknown media type 0x%x", type); - - for (i = 0; ttos->subtypes[i].desc != NULL; i++) { - rval = lookup_media_word(ttos->subtypes[i].desc, val); - if (rval != -1) - return (rval); + ifmedia_t subtype; + + subtype = ifconfig_media_lookup_subtype(media, val); + if (subtype != INVALID_IFMEDIA) + return (subtype); + switch (errno) { + case EINVAL: + errx(EXIT_FAILURE, "unknown media type 0x%x", media); + case ENOENT: + errx(EXIT_FAILURE, "unknown media subtype: %s", val); + default: + err(EXIT_FAILURE, "ifconfig_media_lookup_subtype"); } - errx(1, "unknown media subtype: %s", val); /*NOTREACHED*/ } -static int -get_media_mode(int type, const char *val) +static ifmedia_t +get_media_mode(ifmedia_t media, const char *val) { - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; - int rval, i; - - /* Find the top-level interface type. */ - for (desc = ifm_type_descriptions, ttos = ifmedia_types_to_subtypes; - desc->ifmt_string != NULL; desc++, ttos++) - if (type == desc->ifmt_word) - break; - if (desc->ifmt_string == NULL) - errx(1, "unknown media mode 0x%x", type); - - for (i = 0; ttos->modes[i].desc != NULL; i++) { - rval = lookup_media_word(ttos->modes[i].desc, val); - if (rval != -1) - return (rval); + ifmedia_t mode; + + mode = ifconfig_media_lookup_mode(media, val); + if (mode != INVALID_IFMEDIA) + return (mode); + switch (errno) { + case EINVAL: + errx(EXIT_FAILURE, "unknown media type 0x%x", media); + case ENOENT: + return (INVALID_IFMEDIA); + default: + err(EXIT_FAILURE, "ifconfig_media_lookup_subtype"); } - return -1; + /*NOTREACHED*/ } -static int -get_media_options(int type, const char *val) +static ifmedia_t +get_media_options(ifmedia_t media, const char *val) { - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; - char *optlist, *optptr; - int option, i, rval = 0; - - /* We muck with the string, so copy it. */ - optlist = strdup(val); - if (optlist == NULL) - err(1, "strdup"); - - /* Find the top-level interface type. */ - for (desc = ifm_type_descriptions, ttos = ifmedia_types_to_subtypes; - desc->ifmt_string != NULL; desc++, ttos++) - if (type == desc->ifmt_word) - break; - if (desc->ifmt_string == NULL) - errx(1, "unknown media type 0x%x", type); + ifmedia_t *options; + const char **optnames; + char *opts, *opt; + size_t nopts; + int rval; /* - * Look up the options in the user-provided comma-separated - * list. + * We muck with the string, so copy it. */ - optptr = optlist; - for (; (optptr = strtok(optptr, ",")) != NULL; optptr = NULL) { - option = -1; - for (i = 0; ttos->options[i].desc != NULL; i++) { - option = lookup_media_word(ttos->options[i].desc, optptr); - if (option != -1) - break; - } - if (option == -1) - errx(1, "unknown option: %s", optptr); - rval |= option; - } - - free(optlist); - return (rval); -} - -static int -lookup_media_word(struct ifmedia_description *desc, const char *val) -{ - - for (; desc->ifmt_string != NULL; desc++) - if (strcasecmp(desc->ifmt_string, val) == 0) - return (desc->ifmt_word); - - return (-1); -} - -static struct ifmedia_description *get_toptype_desc(int ifmw) -{ - struct ifmedia_description *desc; - - for (desc = ifm_type_descriptions; desc->ifmt_string != NULL; desc++) - if (IFM_TYPE(ifmw) == desc->ifmt_word) - break; + opts = strdup(val); + if (opts == NULL) + err(EXIT_FAILURE, "strdup"); - return desc; -} - -static struct ifmedia_type_to_subtype *get_toptype_ttos(int ifmw) -{ - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; - - for (desc = ifm_type_descriptions, ttos = ifmedia_types_to_subtypes; - desc->ifmt_string != NULL; desc++, ttos++) - if (IFM_TYPE(ifmw) == desc->ifmt_word) - break; - - return ttos; -} - -static struct ifmedia_description *get_subtype_desc(int ifmw, - struct ifmedia_type_to_subtype *ttos) -{ - int i; - struct ifmedia_description *desc; - - for (i = 0; ttos->subtypes[i].desc != NULL; i++) { - if (ttos->subtypes[i].alias) - continue; - for (desc = ttos->subtypes[i].desc; - desc->ifmt_string != NULL; desc++) { - if (IFM_SUBTYPE(ifmw) == desc->ifmt_word) - return desc; - } + /* + * Split the comma-delimited list into separate strings. + */ + nopts = 0; + for (opt = opts; (opt = strtok(opt, ",")) != NULL; opt = NULL) + ++nopts; + if (nopts == 0) { + free(opts); + return (0); } - - return NULL; -} - -static struct ifmedia_description *get_mode_desc(int ifmw, - struct ifmedia_type_to_subtype *ttos) -{ - int i; - struct ifmedia_description *desc; - - for (i = 0; ttos->modes[i].desc != NULL; i++) { - if (ttos->modes[i].alias) - continue; - for (desc = ttos->modes[i].desc; - desc->ifmt_string != NULL; desc++) { - if (IFM_MODE(ifmw) == desc->ifmt_word) - return desc; - } + optnames = calloc(nopts, sizeof(*optnames)); + if (optnames == NULL) + err(EXIT_FAILURE, "calloc"); + opt = opts; + for (size_t i = 0; i < nopts; ++i) { + optnames[i] = opt; + opt = strchr(opt, '\0') + 1; } - return NULL; + /* + * Look up the options in the user-provided list. + */ + options = ifconfig_media_lookup_options(media, optnames, nopts); + if (options == NULL) + err(EXIT_FAILURE, "ifconfig_media_lookup_options"); + rval = 0; + for (size_t i = 0; i < nopts; ++i) { + if (options[i] == INVALID_IFMEDIA) + errx(EXIT_FAILURE, "unknown option: %s", optnames[i]); + rval |= options[i]; + } + free(options); + free(optnames); + free(opts); + return (rval); } static void -print_media_word(int ifmw, int print_toptype) +print_media(ifmedia_t media, bool print_toptype) { - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; - int seen_option = 0, i; - - /* Find the top-level interface type. */ - desc = get_toptype_desc(ifmw); - ttos = get_toptype_ttos(ifmw); - if (desc->ifmt_string == NULL) { + const char *val, **options; + + val = ifconfig_media_get_type(media); + if (val == NULL) { printf(""); return; } else if (print_toptype) { - printf("%s", desc->ifmt_string); + printf("%s", val); } - /* - * Don't print the top-level type; it's not like we can - * change it, or anything. - */ - - /* Find subtype. */ - desc = get_subtype_desc(ifmw, ttos); - if (desc == NULL) { + val = ifconfig_media_get_subtype(media); + if (val == NULL) { printf(""); return; } @@ -707,45 +401,34 @@ print_media_word(int ifmw, int print_toptype) if (print_toptype) putchar(' '); - printf("%s", desc->ifmt_string); + printf("%s", val); if (print_toptype) { - desc = get_mode_desc(ifmw, ttos); - if (desc != NULL && strcasecmp("autoselect", desc->ifmt_string)) - printf(" mode %s", desc->ifmt_string); + val = ifconfig_media_get_mode(media); + if (val != NULL && strcasecmp("autoselect", val) != 0) + printf(" mode %s", val); } - /* Find options. */ - for (i = 0; ttos->options[i].desc != NULL; i++) { - if (ttos->options[i].alias) - continue; - for (desc = ttos->options[i].desc; - desc->ifmt_string != NULL; desc++) { - if (ifmw & desc->ifmt_word) { - if (seen_option == 0) - printf(" <"); - printf("%s%s", seen_option++ ? "," : "", - desc->ifmt_string); - } - } + options = ifconfig_media_get_options(media); + if (options != NULL && options[0] != NULL) { + printf(" <%s", options[0]); + for (size_t i = 1; options[i] != NULL; ++i) + printf(",%s", options[i]); + printf(">"); } - printf("%s", seen_option ? ">" : ""); + free(options); - if (print_toptype && IFM_INST(ifmw) != 0) - printf(" instance %d", IFM_INST(ifmw)); + if (print_toptype && IFM_INST(media) != 0) + printf(" instance %d", IFM_INST(media)); } static void -print_media_word_ifconfig(int ifmw) +print_media_ifconfig(ifmedia_t media) { - struct ifmedia_description *desc; - struct ifmedia_type_to_subtype *ttos; - int seen_option = 0, i; - - /* Find the top-level interface type. */ - desc = get_toptype_desc(ifmw); - ttos = get_toptype_ttos(ifmw); - if (desc->ifmt_string == NULL) { + const char *val, **options; + + val = ifconfig_media_get_type(media); + if (val == NULL) { printf(""); return; } @@ -755,36 +438,28 @@ print_media_word_ifconfig(int ifmw) * change it, or anything. */ - /* Find subtype. */ - desc = get_subtype_desc(ifmw, ttos); - if (desc == NULL) { + val = ifconfig_media_get_subtype(media); + if (val == NULL) { printf(""); return; } - printf("media %s", desc->ifmt_string); - - desc = get_mode_desc(ifmw, ttos); - if (desc != NULL) - printf(" mode %s", desc->ifmt_string); - - /* Find options. */ - for (i = 0; ttos->options[i].desc != NULL; i++) { - if (ttos->options[i].alias) - continue; - for (desc = ttos->options[i].desc; - desc->ifmt_string != NULL; desc++) { - if (ifmw & desc->ifmt_word) { - if (seen_option == 0) - printf(" mediaopt "); - printf("%s%s", seen_option++ ? "," : "", - desc->ifmt_string); - } - } + printf("media %s", val); + + val = ifconfig_media_get_mode(media); + if (val != NULL) + printf(" mode %s", val); + + options = ifconfig_media_get_options(media); + if (options != NULL && options[0] != NULL) { + printf(" mediaopt %s", options[0]); + for (size_t i = 1; options[i] != NULL; ++i) + printf(",%s", options[i]); } + free(options); - if (IFM_INST(ifmw) != 0) - printf(" instance %d", IFM_INST(ifmw)); + if (IFM_INST(media) != 0) + printf(" instance %d", IFM_INST(media)); } /********************************************************************** From owner-dev-commits-src-all@freebsd.org Fri Mar 5 11:24:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55EE255767E; Fri, 5 Mar 2021 11:24: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 4DsQNb4Ydlz4Wl8; Fri, 5 Mar 2021 11:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ED917551; Fri, 5 Mar 2021 11:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125BNx59059055; Fri, 5 Mar 2021 11:23:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125BNx09059054; Fri, 5 Mar 2021 11:23:59 GMT (envelope-from git) Date: Fri, 5 Mar 2021 11:23:59 GMT Message-Id: <202103051123.125BNx09059054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 88832d59dec1 - main - sbin/ifconfig: Minor housekeeping MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88832d59dec10e97dd64b44391606776b20e782b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 11:24:02 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=88832d59dec10e97dd64b44391606776b20e782b commit 88832d59dec10e97dd64b44391606776b20e782b Author: Ryan Moeller AuthorDate: 2021-02-28 02:08:43 +0000 Commit: Ryan Moeller CommitDate: 2021-03-05 09:15:55 +0000 sbin/ifconfig: Minor housekeeping Coalesce adjacent lint ifdefs. Fix spelling of nitems. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29022 --- sbin/ifconfig/ifconfig.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index fc5351bd420e..5e114b43c126 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -33,9 +33,6 @@ static const char copyright[] = "@(#) Copyright (c) 1983, 1993\n\ The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint #if 0 static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; #endif @@ -215,8 +212,6 @@ ioctl_ifcreate(int s, struct ifreq *ifr) } } -#define ORDERS_SIZE(x) sizeof(x) / sizeof(x[0]) - static int calcorders(struct ifaddrs *ifa, struct ifa_queue *q) { @@ -246,7 +241,7 @@ calcorders(struct ifaddrs *ifa, struct ifa_queue *q) if (ifa->ifa_addr) { af = ifa->ifa_addr->sa_family; - if (af < ORDERS_SIZE(cur->af_orders) && + if (af < nitems(cur->af_orders) && cur->af_orders[af] == 0) cur->af_orders[af] = ++ord; } @@ -297,8 +292,7 @@ cmpifaddrs(struct ifaddrs *a, struct ifaddrs *b, struct ifa_queue *q) af1 = a->ifa_addr->sa_family; af2 = b->ifa_addr->sa_family; - if (af1 < ORDERS_SIZE(e1->af_orders) && - af2 < ORDERS_SIZE(e1->af_orders)) + if (af1 < nitems(e1->af_orders) && af2 < nitems(e1->af_orders)) return (e1->af_orders[af1] - e1->af_orders[af2]); } @@ -347,8 +341,6 @@ static void setformat(char *input) free(formatstr); } -#undef ORDERS_SIZE - static struct ifaddrs * sortifaddrs(struct ifaddrs *list, int (*compare)(struct ifaddrs *, struct ifaddrs *, struct ifa_queue *), From owner-dev-commits-src-all@freebsd.org Fri Mar 5 11:33:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A3B2557AEB; Fri, 5 Mar 2021 11:33: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 4DsQbt0Dtdz4Xhs; Fri, 5 Mar 2021 11:33: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 EEE4A7742; Fri, 5 Mar 2021 11:33: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 125BXjAe071901; Fri, 5 Mar 2021 11:33:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125BXjkf071900; Fri, 5 Mar 2021 11:33:45 GMT (envelope-from git) Date: Fri, 5 Mar 2021 11:33:45 GMT Message-Id: <202103051133.125BXjkf071900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: 028616d0dd69 - main - bc: Vendor import new version 3.3.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 028616d0dd69a3da7a30cb94d35f040bf2ced6b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 11:33:46 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=028616d0dd69a3da7a30cb94d35f040bf2ced6b9 commit 028616d0dd69a3da7a30cb94d35f040bf2ced6b9 Author: Stefan Eßer AuthorDate: 2021-03-05 10:30:11 +0000 Commit: Stefan Eßer CommitDate: 2021-03-05 11:33:01 +0000 bc: Vendor import new version 3.3.3 --- contrib/bc/Makefile.in | 2 +- contrib/bc/NEWS.md | 26 +++++++ contrib/bc/gen/lib2.bc | 2 +- contrib/bc/karatsuba.py | 10 +-- contrib/bc/manuals/bc.1.md.in | 61 ++++++++-------- contrib/bc/manuals/bc/A.1 | 71 +++++++++--------- contrib/bc/manuals/bc/A.1.md | 59 ++++++++------- contrib/bc/manuals/bc/E.1 | 69 +++++++++--------- contrib/bc/manuals/bc/E.1.md | 55 +++++++------- contrib/bc/manuals/bc/EH.1 | 69 +++++++++--------- contrib/bc/manuals/bc/EH.1.md | 55 +++++++------- contrib/bc/manuals/bc/EHN.1 | 69 +++++++++--------- contrib/bc/manuals/bc/EHN.1.md | 55 +++++++------- contrib/bc/manuals/bc/EHNP.1 | 69 +++++++++--------- contrib/bc/manuals/bc/EHNP.1.md | 55 +++++++------- contrib/bc/manuals/bc/EHP.1 | 69 +++++++++--------- contrib/bc/manuals/bc/EHP.1.md | 55 +++++++------- contrib/bc/manuals/bc/EN.1 | 69 +++++++++--------- contrib/bc/manuals/bc/EN.1.md | 55 +++++++------- contrib/bc/manuals/bc/ENP.1 | 69 +++++++++--------- contrib/bc/manuals/bc/ENP.1.md | 55 +++++++------- contrib/bc/manuals/bc/EP.1 | 69 +++++++++--------- contrib/bc/manuals/bc/EP.1.md | 55 +++++++------- contrib/bc/manuals/bc/H.1 | 71 +++++++++--------- contrib/bc/manuals/bc/H.1.md | 59 ++++++++------- contrib/bc/manuals/bc/HN.1 | 71 +++++++++--------- contrib/bc/manuals/bc/HN.1.md | 59 ++++++++------- contrib/bc/manuals/bc/HNP.1 | 71 +++++++++--------- contrib/bc/manuals/bc/HNP.1.md | 59 ++++++++------- contrib/bc/manuals/bc/HP.1 | 71 +++++++++--------- contrib/bc/manuals/bc/HP.1.md | 59 ++++++++------- contrib/bc/manuals/bc/N.1 | 71 +++++++++--------- contrib/bc/manuals/bc/N.1.md | 59 ++++++++------- contrib/bc/manuals/bc/NP.1 | 71 +++++++++--------- contrib/bc/manuals/bc/NP.1.md | 59 ++++++++------- contrib/bc/manuals/bc/P.1 | 71 +++++++++--------- contrib/bc/manuals/bc/P.1.md | 59 ++++++++------- contrib/bc/manuals/bcl.3 | 2 +- contrib/bc/manuals/bcl.3.md | 76 +++++++++---------- contrib/bc/manuals/dc.1.md.in | 38 +++++----- contrib/bc/manuals/dc/A.1 | 53 +++++++------- contrib/bc/manuals/dc/A.1.md | 38 +++++----- contrib/bc/manuals/dc/E.1 | 53 +++++++------- contrib/bc/manuals/dc/E.1.md | 38 +++++----- contrib/bc/manuals/dc/EH.1 | 53 +++++++------- contrib/bc/manuals/dc/EH.1.md | 38 +++++----- contrib/bc/manuals/dc/EHN.1 | 53 +++++++------- contrib/bc/manuals/dc/EHN.1.md | 38 +++++----- contrib/bc/manuals/dc/EHNP.1 | 53 +++++++------- contrib/bc/manuals/dc/EHNP.1.md | 38 +++++----- contrib/bc/manuals/dc/EHP.1 | 53 +++++++------- contrib/bc/manuals/dc/EHP.1.md | 38 +++++----- contrib/bc/manuals/dc/EN.1 | 53 +++++++------- contrib/bc/manuals/dc/EN.1.md | 38 +++++----- contrib/bc/manuals/dc/ENP.1 | 53 +++++++------- contrib/bc/manuals/dc/ENP.1.md | 38 +++++----- contrib/bc/manuals/dc/EP.1 | 53 +++++++------- contrib/bc/manuals/dc/EP.1.md | 38 +++++----- contrib/bc/manuals/dc/H.1 | 53 +++++++------- contrib/bc/manuals/dc/H.1.md | 38 +++++----- contrib/bc/manuals/dc/HN.1 | 53 +++++++------- contrib/bc/manuals/dc/HN.1.md | 38 +++++----- contrib/bc/manuals/dc/HNP.1 | 53 +++++++------- contrib/bc/manuals/dc/HNP.1.md | 38 +++++----- contrib/bc/manuals/dc/HP.1 | 53 +++++++------- contrib/bc/manuals/dc/HP.1.md | 38 +++++----- contrib/bc/manuals/dc/N.1 | 53 +++++++------- contrib/bc/manuals/dc/N.1.md | 38 +++++----- contrib/bc/manuals/dc/NP.1 | 53 +++++++------- contrib/bc/manuals/dc/NP.1.md | 38 +++++----- contrib/bc/manuals/dc/P.1 | 53 +++++++------- contrib/bc/manuals/dc/P.1.md | 38 +++++----- contrib/bc/manuals/header_bc.txt | 2 +- contrib/bc/manuals/header_bcl.txt | 2 +- contrib/bc/manuals/header_dc.txt | 2 +- contrib/bc/src/num.c | 2 +- contrib/bc/tests/bc/length.txt | 3 + contrib/bc/tests/bc/length_results.txt | 5 +- contrib/bc/tests/bc/lib2.txt | 6 ++ contrib/bc/tests/bc/lib2_results.txt | 6 ++ contrib/bc/tests/bc/scripts/bessel.bc | 9 ++- contrib/bc/tests/dc/all.txt | 1 + contrib/bc/tests/dc/length.txt | 129 +++++++++++++++++++++++++++++++++ contrib/bc/tests/dc/length_results.txt | 129 +++++++++++++++++++++++++++++++++ 84 files changed, 2130 insertions(+), 1871 deletions(-) diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index dbb5debd44cc..db8e24967996 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.3.0 +VERSION = 3.3.3 SRC = %%SRC%% OBJ = %%OBJ%% diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 6a8899200f4a..3a3433077d50 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,31 @@ # News +## 3.3.3 + +This is a production release with one tweak and fixes for manuals. + +The tweak is that `length(0)` returns `1` instead of `0`. In `3.3.1`, I changed +it so `length(0.x)`, where `x` could be any number of digits, returned the +`scale`, but `length(0)` still returned `0` because I believe that `0` has `0` +significant digits. + +After request of FreeBSD and considering the arguments of a mathematician, +compatibility with other `bc`'s, and the expectations of users, I decided to +make the change. + +The fixes for manuals fixed a bug where `--` was rendered as `-`. + +## 3.3.2 + +This is a production release that fixes a divide-by-zero bug in `root()` in the +[extended math library][16]. All previous versions with `root()` have the bug. + +## 3.3.1 + +This is a production release that fixes a bug. + +The bug was in the reporting of number length when the value was 0. + ## 3.3.0 This is a production release that changes one behavior and fixes documentation diff --git a/contrib/bc/gen/lib2.bc b/contrib/bc/gen/lib2.bc index b0e651eddcbd..399c7ad3d313 100644 --- a/contrib/bc/gen/lib2.bc +++ b/contrib/bc/gen/lib2.bc @@ -110,7 +110,7 @@ define root(x,n){ if(n<0)sqrt(n) n=n$ if(n==0)x/n - if(n==1)return x + if(x==0||n==1)return x if(n==2)return sqrt(x) s=scale scale=0 diff --git a/contrib/bc/karatsuba.py b/contrib/bc/karatsuba.py index f8087301f54c..cfab4c4f4fbf 100755 --- a/contrib/bc/karatsuba.py +++ b/contrib/bc/karatsuba.py @@ -121,20 +121,20 @@ else: p = run([ "make", "clean" ]) -print("Testing \"make -j4\"") +print("Testing \"make -j12\"") if p.returncode != 0: print("make returned an error ({}); exiting...".format(p.returncode)) sys.exit(p.returncode) -p = run([ "make", "-j4" ]) +p = run([ "make", "-j12" ]) if p.returncode == 0: - makecmd = [ "make", "-j4" ] - print("Using \"make -j4\"") + makecmd = [ "make", "-j12" ] + print("Using \"make -j12\"") else: makecmd = [ "make" ] - print("Not using \"make -j4\"") + print("Not using \"make -j12\"") if test_num != 0: mx2 = test_num diff --git a/contrib/bc/manuals/bc.1.md.in b/contrib/bc/manuals/bc.1.md.in index 1ce83b8237cd..661fcdd45ae4 100644 --- a/contrib/bc/manuals/bc.1.md.in +++ b/contrib/bc/manuals/bc.1.md.in @@ -34,8 +34,7 @@ bc - arbitrary-precision decimal arithmetic language and calculator # SYNOPSIS -**bc** [**-ghilPqsvVw**] [**--global-stacks**] [**--help**] [**--interactive**] [**--mathlib**] [**--no-prompt**] [**--quiet**] [**--standard**] [**--warn**] [**--version**] [**-e** *expr*] [**--expression**=*expr*...] [**-f** *file*...] [**-file**=*file*...] -[*file*...] +**bc** [**-ghilPqsvVw**] [**-\-global-stacks**] [**-\-help**] [**-\-interactive**] [**-\-mathlib**] [**-\-no-prompt**] [**-\-quiet**] [**-\-standard**] [**-\-warn**] [**-\-version**] [**-e** *expr*] [**-\-expression**=*expr*...] [**-f** *file*...] [**-\-file**=*file*...] [*file*...] # DESCRIPTION @@ -61,7 +60,7 @@ especially) the GNU bc(1). The following are the options that bc(1) accepts. -**-g**, **--global-stacks** +**-g**, **-\-global-stacks** {{ A H N P HN HP NP HNP }} : Turns the globals **ibase**, **obase**, **scale**, and **seed** into stacks. @@ -152,17 +151,17 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-h**, **--help** +**-h**, **-\-help** : Prints a usage message and quits. -**-i**, **--interactive** +**-i**, **-\-interactive** : Forces interactive mode. (See the **INTERACTIVE MODE** section.) This is a **non-portable extension**. -**-l**, **--mathlib** +**-l**, **-\-mathlib** : Sets **scale** (see the **SYNTAX** section) to **20** and loads the included {{ A H N P HN HP NP HNP }} @@ -178,7 +177,7 @@ The following are the options that bc(1) accepts. To learn what is in the library, see the **LIBRARY** section. {{ end }} -**-P**, **--no-prompt** +**-P**, **-\-no-prompt** {{ A E H N EH EN HN EHN }} : Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. @@ -193,36 +192,36 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-q**, **--quiet** +**-q**, **-\-quiet** : This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the **-v**, **-V**, or - **--version** options are given. + **-\-version** options are given. This is a **non-portable extension**. -**-s**, **--standard** +**-s**, **-\-standard** : Process exactly the language defined by the [standard][1] and error if any extensions are used. This is a **non-portable extension**. -**-v**, **-V**, **--version** +**-v**, **-V**, **-\-version** : Print the version information (copyright header) and exit. This is a **non-portable extension**. -**-w**, **--warn** +**-w**, **-\-warn** -: Like **-s** and **--standard**, except that warnings (and not errors) are +: Like **-s** and **-\-standard**, except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. This is a **non-portable extension**. -**-e** *expr*, **--expression**=*expr* +**-e** *expr*, **-\-expression**=*expr* : Evaluates *expr*. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -232,14 +231,14 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**, whether on the + as an argument at least once to **-f** or **-\-file**, whether on the command-line or in **BC_ENV_ARGS**. However, if any other **-e**, - **--expression**, **-f**, or **--file** arguments are given after **-f-** or - equivalent is given, bc(1) will give a fatal error and exit. + **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** + or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. -**-f** *file*, **--file**=*file* +**-f** *file*, **-\-file**=*file* : Reads in *file* and evaluates it, line by line, as though it were read through **stdin**. If expressions are also given (see above), the @@ -248,8 +247,8 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**. However, if any other - **-e**, **--expression**, **-f**, or **--file** arguments are given after + as an argument at least once to **-f** or **-\-file**. However, if any other + **-e**, **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -304,8 +303,8 @@ Identifiers with more than one character (letter) are a **ibase** is a global variable determining how to interpret constant numbers. It is the "input" base, or the number base used for interpreting input numbers. -**ibase** is initially **10**. If the **-s** (**--standard**) and **-w** -(**--warn**) flags were not given on the command line, the max allowable value +**ibase** is initially **10**. If the **-s** (**-\-standard**) and **-w** +(**-\-warn**) flags were not given on the command line, the max allowable value for **ibase** is **36**. Otherwise, it is **16**. The min allowable value for **ibase** is **2**. The max allowable value for **ibase** can be queried in bc(1) programs with the **maxibase()** built-in function. @@ -512,7 +511,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. -**++** **--** +**++** **-\-** : Type: Prefix and Postfix @@ -617,7 +616,7 @@ precedence. The operators will be described in more detail below. -**++** **--** +**++** **-\-** : The prefix and postfix **increment** and **decrement** operators behave exactly like they would in C. They require a named expression (see the @@ -962,12 +961,12 @@ This is a **non-portable extension**. {{ A H N P HN HP NP HNP }} All of the functions below, including the functions in the extended math library (see the *Extended Library* subsection below), are available when the -**-l** or **--mathlib** command-line flags are given, except that the extended +**-l** or **-\-mathlib** command-line flags are given, except that the extended math library is not available when the **-s** option, the **-w** option, or equivalents are given. {{ end }} {{ E EH EN EP EHN EHP ENP EHNP }} -All of the functions below are available when the **-l** or **--mathlib** +All of the functions below are available when the **-l** or **-\-mathlib** command-line flags are given. {{ end }} @@ -1020,8 +1019,8 @@ The [standard][1] defines the following functions for the math library: {{ A H N P HN HP NP HNP }} ## Extended Library -The extended library is *not* loaded when the **-s**/**--standard** or -**-w**/**--warn** options are given since they are not part of the library +The extended library is *not* loaded when the **-s**/**-\-standard** or +**-w**/**-\-warn** options are given since they are not part of the library defined by the [standard][1]. The extended library is a **non-portable extension**. @@ -1705,17 +1704,17 @@ The other statuses will only be returned when bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section), since bc(1) resets its state (see the **RESET** section) and accepts more input when one of those errors occurs in interactive mode. This is also the case when interactive mode is forced by the -**-i** flag or **--interactive** option. +**-i** flag or **-\-interactive** option. These exit statuses allow bc(1) to be used in shell scripting with error checking, and its normal behavior can be forced by using the **-i** flag or -**--interactive** option. +**-\-interactive** option. # INTERACTIVE MODE Per the [standard][1], bc(1) has an interactive mode and a non-interactive mode. Interactive mode is turned on automatically when both **stdin** and **stdout** -are hooked to a terminal, but the **-i** flag and **--interactive** option can +are hooked to a terminal, but the **-i** flag and **-\-interactive** option can turn it on in other cases. In interactive mode, bc(1) attempts to recover from errors (see the **RESET** diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index d1e80769c855..b38d8d35e71b 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -25,19 +25,18 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "March 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator .SH SYNOPSIS .PP -\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]\[en]global-stacks\f[R]] -[\f[B]\[en]help\f[R]] [\f[B]\[en]interactive\f[R]] -[\f[B]\[en]mathlib\f[R]] [\f[B]\[en]no-prompt\f[R]] -[\f[B]\[en]quiet\f[R]] [\f[B]\[en]standard\f[R]] [\f[B]\[en]warn\f[R]] -[\f[B]\[en]version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] -[\f[B]\[en]expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] -\f[I]file\f[R]\&...] [\f[B]-file\f[R]=\f[I]file\f[R]\&...] +\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]--global-stacks\f[R]] +[\f[B]--help\f[R]] [\f[B]--interactive\f[R]] [\f[B]--mathlib\f[R]] +[\f[B]--no-prompt\f[R]] [\f[B]--quiet\f[R]] [\f[B]--standard\f[R]] +[\f[B]--warn\f[R]] [\f[B]--version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] +[\f[B]--expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] +\f[I]file\f[R]\&...] [\f[B]--file\f[R]=\f[I]file\f[R]\&...] [\f[I]file\f[R]\&...] .SH DESCRIPTION .PP @@ -60,7 +59,7 @@ implementations. .PP The following are the options that bc(1) accepts. .TP -\f[B]-g\f[R], \f[B]\[en]global-stacks\f[R] +\f[B]-g\f[R], \f[B]--global-stacks\f[R] Turns the globals \f[B]ibase\f[R], \f[B]obase\f[R], \f[B]scale\f[R], and \f[B]seed\f[R] into stacks. .RS @@ -152,10 +151,10 @@ is ignored. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-h\f[R], \f[B]\[en]help\f[R] +\f[B]-h\f[R], \f[B]--help\f[R] Prints a usage message and quits. .TP -\f[B]-i\f[R], \f[B]\[en]interactive\f[R] +\f[B]-i\f[R], \f[B]--interactive\f[R] Forces interactive mode. (See the \f[B]INTERACTIVE MODE\f[R] section.) .RS @@ -163,7 +162,7 @@ Forces interactive mode. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-l\f[R], \f[B]\[en]mathlib\f[R] +\f[B]-l\f[R], \f[B]--mathlib\f[R] Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R] and loads the included math library and the extended math library before running any code, including any expressions or files specified on the @@ -173,7 +172,7 @@ command line. To learn what is in the libraries, see the \f[B]LIBRARY\f[R] section. .RE .TP -\f[B]-P\f[R], \f[B]\[en]no-prompt\f[R] +\f[B]-P\f[R], \f[B]--no-prompt\f[R] Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. See the \f[B]TTY MODE\f[R] section) This is mostly for those users that @@ -185,18 +184,18 @@ Most of those users would want to put this option in This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-q\f[R], \f[B]\[en]quiet\f[R] +\f[B]-q\f[R], \f[B]--quiet\f[R] This option is for compatibility with the GNU bc(1) (https://www.gnu.org/software/bc/); it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the -\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]\[en]version\f[R] options are given. +\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]--version\f[R] options are given. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-s\f[R], \f[B]\[en]standard\f[R] +\f[B]-s\f[R], \f[B]--standard\f[R] Process exactly the language defined by the standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html) and error if any extensions are used. @@ -205,15 +204,15 @@ and error if any extensions are used. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-v\f[R], \f[B]-V\f[R], \f[B]\[en]version\f[R] +\f[B]-v\f[R], \f[B]-V\f[R], \f[B]--version\f[R] Print the version information (copyright header) and exit. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-w\f[R], \f[B]\[en]warn\f[R] -Like \f[B]-s\f[R] and \f[B]\[en]standard\f[R], except that warnings (and +\f[B]-w\f[R], \f[B]--warn\f[R] +Like \f[B]-s\f[R] and \f[B]--standard\f[R], except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. .RS @@ -221,7 +220,7 @@ continues normally. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-e\f[R] \f[I]expr\f[R], \f[B]\[en]expression\f[R]=\f[I]expr\f[R] +\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R] Evaluates \f[I]expr\f[R]. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -234,17 +233,17 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]-f\f[R] or \f[B]--file\f[R], whether on the command-line or in \f[B]BC_ENV_ARGS\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-f\f[R] \f[I]file\f[R], \f[B]\[en]file\f[R]=\f[I]file\f[R] +\f[B]-f\f[R] \f[I]file\f[R], \f[B]--file\f[R]=\f[I]file\f[R] Reads in \f[I]file\f[R] and evaluates it, line by line, as though it were read through \f[B]stdin\f[R]. If expressions are also given (see above), the expressions are evaluated @@ -255,9 +254,9 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f\f[R] or \f[B]--file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP @@ -322,8 +321,8 @@ constant numbers. It is the \[lq]input\[rq] base, or the number base used for interpreting input numbers. \f[B]ibase\f[R] is initially \f[B]10\f[R]. -If the \f[B]-s\f[R] (\f[B]\[en]standard\f[R]) and \f[B]-w\f[R] -(\f[B]\[en]warn\f[R]) flags were not given on the command line, the max +If the \f[B]-s\f[R] (\f[B]--standard\f[R]) and \f[B]-w\f[R] +(\f[B]--warn\f[R]) flags were not given on the command line, the max allowable value for \f[B]ibase\f[R] is \f[B]36\f[R]. Otherwise, it is \f[B]16\f[R]. The min allowable value for \f[B]ibase\f[R] is \f[B]2\f[R]. @@ -582,7 +581,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. .TP -\f[B]++\f[R] \f[B]\[en]\f[R] +\f[B]++\f[R] \f[B]--\f[R] Type: Prefix and Postfix .RS .PP @@ -692,7 +691,7 @@ Description: \f[B]boolean or\f[R] .PP The operators will be described in more detail below. .TP -\f[B]++\f[R] \f[B]\[en]\f[R] +\f[B]++\f[R] \f[B]--\f[R] The prefix and postfix \f[B]increment\f[R] and \f[B]decrement\f[R] operators behave exactly like they would in C. They require a named expression (see the \f[I]Named Expressions\f[R] @@ -1138,7 +1137,7 @@ This is a \f[B]non-portable extension\f[R]. .PP All of the functions below, including the functions in the extended math library (see the \f[I]Extended Library\f[R] subsection below), are -available when the \f[B]-l\f[R] or \f[B]\[en]mathlib\f[R] command-line +available when the \f[B]-l\f[R] or \f[B]--mathlib\f[R] command-line flags are given, except that the extended math library is not available when the \f[B]-s\f[R] option, the \f[B]-w\f[R] option, or equivalents are given. @@ -1199,7 +1198,7 @@ Functions\f[R] subsection below). .SS Extended Library .PP The extended library is \f[I]not\f[R] loaded when the -\f[B]-s\f[R]/\f[B]\[en]standard\f[R] or \f[B]-w\f[R]/\f[B]\[en]warn\f[R] +\f[B]-s\f[R]/\f[B]--standard\f[R] or \f[B]-w\f[R]/\f[B]--warn\f[R] options are given since they are not part of the library defined by the standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html). .PP @@ -1957,11 +1956,11 @@ interactive mode (see the \f[B]INTERACTIVE MODE\f[R] section), since bc(1) resets its state (see the \f[B]RESET\f[R] section) and accepts more input when one of those errors occurs in interactive mode. This is also the case when interactive mode is forced by the -\f[B]-i\f[R] flag or \f[B]\[en]interactive\f[R] option. +\f[B]-i\f[R] flag or \f[B]--interactive\f[R] option. .PP These exit statuses allow bc(1) to be used in shell scripting with error checking, and its normal behavior can be forced by using the -\f[B]-i\f[R] flag or \f[B]\[en]interactive\f[R] option. +\f[B]-i\f[R] flag or \f[B]--interactive\f[R] option. .SH INTERACTIVE MODE .PP Per the @@ -1969,7 +1968,7 @@ standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html), bc(1) has an interactive mode and a non-interactive mode. Interactive mode is turned on automatically when both \f[B]stdin\f[R] and \f[B]stdout\f[R] are hooked to a terminal, but the \f[B]-i\f[R] flag -and \f[B]\[en]interactive\f[R] option can turn it on in other cases. +and \f[B]--interactive\f[R] option can turn it on in other cases. .PP In interactive mode, bc(1) attempts to recover from errors (see the \f[B]RESET\f[R] section), and in normal execution, flushes diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index 0cf7a4a0d70e..04f37c6bb724 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -34,8 +34,7 @@ bc - arbitrary-precision decimal arithmetic language and calculator # SYNOPSIS -**bc** [**-ghilPqsvVw**] [**--global-stacks**] [**--help**] [**--interactive**] [**--mathlib**] [**--no-prompt**] [**--quiet**] [**--standard**] [**--warn**] [**--version**] [**-e** *expr*] [**--expression**=*expr*...] [**-f** *file*...] [**-file**=*file*...] -[*file*...] +**bc** [**-ghilPqsvVw**] [**-\-global-stacks**] [**-\-help**] [**-\-interactive**] [**-\-mathlib**] [**-\-no-prompt**] [**-\-quiet**] [**-\-standard**] [**-\-warn**] [**-\-version**] [**-e** *expr*] [**-\-expression**=*expr*...] [**-f** *file*...] [**-\-file**=*file*...] [*file*...] # DESCRIPTION @@ -55,7 +54,7 @@ other implementations. The following are the options that bc(1) accepts. -**-g**, **--global-stacks** +**-g**, **-\-global-stacks** : Turns the globals **ibase**, **obase**, **scale**, and **seed** into stacks. @@ -123,17 +122,17 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-h**, **--help** +**-h**, **-\-help** : Prints a usage message and quits. -**-i**, **--interactive** +**-i**, **-\-interactive** : Forces interactive mode. (See the **INTERACTIVE MODE** section.) This is a **non-portable extension**. -**-l**, **--mathlib** +**-l**, **-\-mathlib** : Sets **scale** (see the **SYNTAX** section) to **20** and loads the included math library and the extended math library before running any code, @@ -141,7 +140,7 @@ The following are the options that bc(1) accepts. To learn what is in the libraries, see the **LIBRARY** section. -**-P**, **--no-prompt** +**-P**, **-\-no-prompt** : Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. See the **TTY MODE** section) This is mostly for those users that do not @@ -151,36 +150,36 @@ The following are the options that bc(1) accepts. This is a **non-portable extension**. -**-q**, **--quiet** +**-q**, **-\-quiet** : This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the **-v**, **-V**, or - **--version** options are given. + **-\-version** options are given. This is a **non-portable extension**. -**-s**, **--standard** +**-s**, **-\-standard** : Process exactly the language defined by the [standard][1] and error if any extensions are used. This is a **non-portable extension**. -**-v**, **-V**, **--version** +**-v**, **-V**, **-\-version** : Print the version information (copyright header) and exit. This is a **non-portable extension**. -**-w**, **--warn** +**-w**, **-\-warn** -: Like **-s** and **--standard**, except that warnings (and not errors) are +: Like **-s** and **-\-standard**, except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. This is a **non-portable extension**. -**-e** *expr*, **--expression**=*expr* +**-e** *expr*, **-\-expression**=*expr* : Evaluates *expr*. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -190,14 +189,14 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**, whether on the + as an argument at least once to **-f** or **-\-file**, whether on the command-line or in **BC_ENV_ARGS**. However, if any other **-e**, - **--expression**, **-f**, or **--file** arguments are given after **-f-** or - equivalent is given, bc(1) will give a fatal error and exit. + **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** + or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. -**-f** *file*, **--file**=*file* +**-f** *file*, **-\-file**=*file* : Reads in *file* and evaluates it, line by line, as though it were read through **stdin**. If expressions are also given (see above), the @@ -206,8 +205,8 @@ The following are the options that bc(1) accepts. If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, see the **ENVIRONMENT VARIABLES** section), then after processing all expressions and files, bc(1) will exit, unless **-** (**stdin**) was given - as an argument at least once to **-f** or **--file**. However, if any other - **-e**, **--expression**, **-f**, or **--file** arguments are given after + as an argument at least once to **-f** or **-\-file**. However, if any other + **-e**, **-\-expression**, **-f**, or **-\-file** arguments are given after **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -262,8 +261,8 @@ Identifiers with more than one character (letter) are a **ibase** is a global variable determining how to interpret constant numbers. It is the "input" base, or the number base used for interpreting input numbers. -**ibase** is initially **10**. If the **-s** (**--standard**) and **-w** -(**--warn**) flags were not given on the command line, the max allowable value +**ibase** is initially **10**. If the **-s** (**-\-standard**) and **-w** +(**-\-warn**) flags were not given on the command line, the max allowable value for **ibase** is **36**. Otherwise, it is **16**. The min allowable value for **ibase** is **2**. The max allowable value for **ibase** can be queried in bc(1) programs with the **maxibase()** built-in function. @@ -453,7 +452,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. -**++** **--** +**++** **-\-** : Type: Prefix and Postfix @@ -551,7 +550,7 @@ precedence. The operators will be described in more detail below. -**++** **--** +**++** **-\-** : The prefix and postfix **increment** and **decrement** operators behave exactly like they would in C. They require a named expression (see the @@ -882,7 +881,7 @@ This is a **non-portable extension**. All of the functions below, including the functions in the extended math library (see the *Extended Library* subsection below), are available when the -**-l** or **--mathlib** command-line flags are given, except that the extended +**-l** or **-\-mathlib** command-line flags are given, except that the extended math library is not available when the **-s** option, the **-w** option, or equivalents are given. @@ -934,8 +933,8 @@ The [standard][1] defines the following functions for the math library: ## Extended Library -The extended library is *not* loaded when the **-s**/**--standard** or -**-w**/**--warn** options are given since they are not part of the library +The extended library is *not* loaded when the **-s**/**-\-standard** or +**-w**/**-\-warn** options are given since they are not part of the library defined by the [standard][1]. The extended library is a **non-portable extension**. @@ -1603,17 +1602,17 @@ The other statuses will only be returned when bc(1) is not in interactive mode (see the **INTERACTIVE MODE** section), since bc(1) resets its state (see the **RESET** section) and accepts more input when one of those errors occurs in interactive mode. This is also the case when interactive mode is forced by the -**-i** flag or **--interactive** option. +**-i** flag or **-\-interactive** option. These exit statuses allow bc(1) to be used in shell scripting with error checking, and its normal behavior can be forced by using the **-i** flag or -**--interactive** option. +**-\-interactive** option. # INTERACTIVE MODE Per the [standard][1], bc(1) has an interactive mode and a non-interactive mode. Interactive mode is turned on automatically when both **stdin** and **stdout** -are hooked to a terminal, but the **-i** flag and **--interactive** option can +are hooked to a terminal, but the **-i** flag and **-\-interactive** option can turn it on in other cases. In interactive mode, bc(1) attempts to recover from errors (see the **RESET** diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index 597cde782788..9023b07c6b87 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -25,19 +25,18 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "March 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator .SH SYNOPSIS .PP -\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]\[en]global-stacks\f[R]] -[\f[B]\[en]help\f[R]] [\f[B]\[en]interactive\f[R]] -[\f[B]\[en]mathlib\f[R]] [\f[B]\[en]no-prompt\f[R]] -[\f[B]\[en]quiet\f[R]] [\f[B]\[en]standard\f[R]] [\f[B]\[en]warn\f[R]] -[\f[B]\[en]version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] -[\f[B]\[en]expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] -\f[I]file\f[R]\&...] [\f[B]-file\f[R]=\f[I]file\f[R]\&...] +\f[B]bc\f[R] [\f[B]-ghilPqsvVw\f[R]] [\f[B]--global-stacks\f[R]] +[\f[B]--help\f[R]] [\f[B]--interactive\f[R]] [\f[B]--mathlib\f[R]] +[\f[B]--no-prompt\f[R]] [\f[B]--quiet\f[R]] [\f[B]--standard\f[R]] +[\f[B]--warn\f[R]] [\f[B]--version\f[R]] [\f[B]-e\f[R] \f[I]expr\f[R]] +[\f[B]--expression\f[R]=\f[I]expr\f[R]\&...] [\f[B]-f\f[R] +\f[I]file\f[R]\&...] [\f[B]--file\f[R]=\f[I]file\f[R]\&...] [\f[I]file\f[R]\&...] .SH DESCRIPTION .PP @@ -58,7 +57,7 @@ This bc(1) is a drop-in replacement for \f[I]any\f[R] bc(1), including .PP The following are the options that bc(1) accepts. .PP -\f[B]-g\f[R], \f[B]\[en]global-stacks\f[R] +\f[B]-g\f[R], \f[B]--global-stacks\f[R] .IP .nf \f[C] @@ -115,10 +114,10 @@ This is a **non-portable extension**. \f[R] .fi .TP -\f[B]-h\f[R], \f[B]\[en]help\f[R] +\f[B]-h\f[R], \f[B]--help\f[R] Prints a usage message and quits. .TP -\f[B]-i\f[R], \f[B]\[en]interactive\f[R] +\f[B]-i\f[R], \f[B]--interactive\f[R] Forces interactive mode. (See the \f[B]INTERACTIVE MODE\f[R] section.) .RS @@ -126,7 +125,7 @@ Forces interactive mode. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-l\f[R], \f[B]\[en]mathlib\f[R] +\f[B]-l\f[R], \f[B]--mathlib\f[R] Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R] and loads the included math library before running any code, including any expressions or files specified on the command line. @@ -135,7 +134,7 @@ any expressions or files specified on the command line. To learn what is in the library, see the \f[B]LIBRARY\f[R] section. .RE .TP -\f[B]-P\f[R], \f[B]\[en]no-prompt\f[R] +\f[B]-P\f[R], \f[B]--no-prompt\f[R] Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. See the \f[B]TTY MODE\f[R] section) This is mostly for those users that @@ -147,18 +146,18 @@ Most of those users would want to put this option in This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-q\f[R], \f[B]\[en]quiet\f[R] +\f[B]-q\f[R], \f[B]--quiet\f[R] This option is for compatibility with the GNU bc(1) (https://www.gnu.org/software/bc/); it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the -\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]\[en]version\f[R] options are given. +\f[B]-v\f[R], \f[B]-V\f[R], or \f[B]--version\f[R] options are given. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-s\f[R], \f[B]\[en]standard\f[R] +\f[B]-s\f[R], \f[B]--standard\f[R] Process exactly the language defined by the standard (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html) and error if any extensions are used. @@ -167,15 +166,15 @@ and error if any extensions are used. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-v\f[R], \f[B]-V\f[R], \f[B]\[en]version\f[R] +\f[B]-v\f[R], \f[B]-V\f[R], \f[B]--version\f[R] Print the version information (copyright header) and exit. .RS .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-w\f[R], \f[B]\[en]warn\f[R] -Like \f[B]-s\f[R] and \f[B]\[en]standard\f[R], except that warnings (and +\f[B]-w\f[R], \f[B]--warn\f[R] +Like \f[B]-s\f[R] and \f[B]--standard\f[R], except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. .RS @@ -183,7 +182,7 @@ continues normally. This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-e\f[R] \f[I]expr\f[R], \f[B]\[en]expression\f[R]=\f[I]expr\f[R] +\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R] Evaluates \f[I]expr\f[R]. If multiple expressions are given, they are evaluated in order. If files are given as well (see below), the expressions and files are @@ -196,17 +195,17 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]-f\f[R] or \f[B]--file\f[R], whether on the command-line or in \f[B]BC_ENV_ARGS\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP This is a \f[B]non-portable extension\f[R]. .RE .TP -\f[B]-f\f[R] \f[I]file\f[R], \f[B]\[en]file\f[R]=\f[I]file\f[R] +\f[B]-f\f[R] \f[I]file\f[R], \f[B]--file\f[R]=\f[I]file\f[R] Reads in \f[I]file\f[R] and evaluates it, line by line, as though it were read through \f[B]stdin\f[R]. If expressions are also given (see above), the expressions are evaluated @@ -217,9 +216,9 @@ If this option is given on the command-line (i.e., not in \f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. -However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f\f[R] or \f[B]--file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]--expression\f[R], +\f[B]-f\f[R], or \f[B]--file\f[R] arguments are given after \f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and exit. .PP @@ -284,8 +283,8 @@ constant numbers. It is the \[lq]input\[rq] base, or the number base used for interpreting input numbers. \f[B]ibase\f[R] is initially \f[B]10\f[R]. -If the \f[B]-s\f[R] (\f[B]\[en]standard\f[R]) and \f[B]-w\f[R] -(\f[B]\[en]warn\f[R]) flags were not given on the command line, the max +If the \f[B]-s\f[R] (\f[B]--standard\f[R]) and \f[B]-w\f[R] +(\f[B]--warn\f[R]) flags were not given on the command line, the max allowable value for \f[B]ibase\f[R] is \f[B]36\f[R]. Otherwise, it is \f[B]16\f[R]. The min allowable value for \f[B]ibase\f[R] is \f[B]2\f[R]. @@ -445,7 +444,7 @@ The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. .TP *** 11304 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Mar 5 14:56:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0B4555CA6B; Fri, 5 Mar 2021 14:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsW5m52Cjz4kY8; Fri, 5 Mar 2021 14:56: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 9F9C6125B3; Fri, 5 Mar 2021 14:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125EuSCV035365; Fri, 5 Mar 2021 14:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125EuS8B035364; Fri, 5 Mar 2021 14:56:28 GMT (envelope-from git) Date: Fri, 5 Mar 2021 14:56:28 GMT Message-Id: <202103051456.125EuS8B035364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 6781b8a32e70 - main - zfs: update openzfs version reference to bedbc13da MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6781b8a32e702c694d3f813959d326e36facc19f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 14:56:28 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=6781b8a32e702c694d3f813959d326e36facc19f commit 6781b8a32e702c694d3f813959d326e36facc19f Author: Martin Matuska AuthorDate: 2021-03-05 14:52:04 +0000 Commit: Martin Matuska CommitDate: 2021-03-05 14:55:58 +0000 zfs: update openzfs version reference to bedbc13da It was missed in the latest merge. X-MFC-with: caed7b1c399de04279822028e15b36367e84232f --- sys/modules/zfs/zfs_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h index 0ef2200d1940..ae5316a46f10 100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@ -734,7 +734,7 @@ /* #undef ZFS_IS_GPL_COMPATIBLE */ /* Define the project alias string. */ -#define ZFS_META_ALIAS "zfs-2.0.0-FreeBSD_gbf156c966" +#define ZFS_META_ALIAS "zfs-2.0.0-FreeBSD_gbedbc13da" /* Define the project author. */ #define ZFS_META_AUTHOR "OpenZFS" @@ -764,7 +764,7 @@ #define ZFS_META_NAME "zfs" /* Define the project release. */ -#define ZFS_META_RELEASE "FreeBSD_g9312e0fd1" +#define ZFS_META_RELEASE "FreeBSD_gbedbc13da" /* Define the project version. */ #define ZFS_META_VERSION "2.0.0" From owner-dev-commits-src-all@freebsd.org Fri Mar 5 15:03:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6675055CF48; Fri, 5 Mar 2021 15:03: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 4DsWFT2T50z4lGJ; Fri, 5 Mar 2021 15:03: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 45781123F7; Fri, 5 Mar 2021 15:03: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 125F39pb048641; Fri, 5 Mar 2021 15:03:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125F39jm048640; Fri, 5 Mar 2021 15:03:09 GMT (envelope-from git) Date: Fri, 5 Mar 2021 15:03:09 GMT Message-Id: <202103051503.125F39jm048640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 705d06b289e9 - main - rack: unbreak TCP fast open for the client side MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 705d06b289e9821439b7b694d766cad75bc064e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 15:03:09 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=705d06b289e9821439b7b694d766cad75bc064e5 commit 705d06b289e9821439b7b694d766cad75bc064e5 Author: Michael Tuexen AuthorDate: 2021-03-05 14:57:26 +0000 Commit: Michael Tuexen CommitDate: 2021-03-05 15:03:03 +0000 rack: unbreak TCP fast open for the client side Allow sending user data on the SYN segment. Reviewed by: rrs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29082 Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/rack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 98a6f0f2e924..f5b0de7cbc59 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -12297,7 +12297,8 @@ again: * If sack_rxmit is true we are retransmitting from the scoreboard * in which case len is already set. */ - if ((sack_rxmit == 0) && TCPS_HAVEESTABLISHED(tp->t_state)) { + if ((sack_rxmit == 0) && + (TCPS_HAVEESTABLISHED(tp->t_state) || IS_FASTOPEN(tp->t_flags))) { uint32_t avail; avail = sbavail(sb); From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:06:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9958455F9F5; Fri, 5 Mar 2021 17:06:15 +0000 (UTC) (envelope-from kevans@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 4DsYzW3hPtz4sB4; Fri, 5 Mar 2021 17:06:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 71F60A850; Fri, 5 Mar 2021 17:06:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id b130so2623023qkc.10; Fri, 05 Mar 2021 09:06:15 -0800 (PST) X-Gm-Message-State: AOAM531G3WwEXTiFo8MUnuSCwyBTCG0qRFa5R/EsYy80HDsjzyM1ROSf gzYGut/UGf6F16y5x77TrxhJ8NOMSaZ+seX/Znc= X-Google-Smtp-Source: ABdhPJx/ktmA3DMOSHjItdWL74ZYIdVcndOlnrZrv1BfPE+G5pf674IsTYgHDfyzK6VUB6oENMRFm3c8LOX88f09b3o= X-Received: by 2002:a37:988:: with SMTP id 130mr10671117qkj.120.1614963974909; Fri, 05 Mar 2021 09:06:14 -0800 (PST) MIME-Version: 1.0 References: <202102192213.11JMDoiL080275@gitrepo.freebsd.org> In-Reply-To: <202102192213.11JMDoiL080275@gitrepo.freebsd.org> From: Kyle Evans Date: Fri, 5 Mar 2021 11:06:01 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: d4380c0cdd05 - main - jail: Change both root and working directories in jail_attach(2) To: Jamie Gritton Cc: src-committers , "" , dev-commits-src-main@freebsd.org, jails@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:06:15 -0000 On Fri, Feb 19, 2021 at 4:13 PM Jamie Gritton wrote: > > The branch main has been updated by jamie: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d4380c0cdd0517dc038403dd5c99242ce78bdeb5 > > commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5 > Author: Jamie Gritton > AuthorDate: 2021-02-19 22:13:35 +0000 > Commit: Jamie Gritton > CommitDate: 2021-02-19 22:13:35 +0000 > > jail: Change both root and working directories in jail_attach(2) > > jail_attach(2) performs an internal chroot operation, leaving it up to > the calling process to assure the working directory is inside the jail. > > Add a matching internal chdir operation to the jail's root. Also > ignore kern.chroot_allow_open_directories, and always disallow the > operation if there are any directory descriptors open. > Any reason we shouldn't go ahead and drop the explicit chdir() from jexec(8) and jail(8) now that jail_attach *is* guaranteed to chdir along with its chroot? Thanks, Kyle Evans From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:18:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D47055FF49; Fri, 5 Mar 2021 17:18: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 4DsZFq46Gvz4sx0; Fri, 5 Mar 2021 17:18: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 7FAB514539; Fri, 5 Mar 2021 17:18: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 125HIduf021610; Fri, 5 Mar 2021 17:18:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125HIdrO021609; Fri, 5 Mar 2021 17:18:39 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:18:39 GMT Message-Id: <202103051718.125HIdrO021609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 4a8f3aad37dd - main - tcp: remove incorrect reset of SACK variable in PRR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a8f3aad37dd35c905e34b64b022d60844ba8d01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:18:39 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=4a8f3aad37dd35c905e34b64b022d60844ba8d01 commit 4a8f3aad37dd35c905e34b64b022d60844ba8d01 Author: Richard Scheffenegger AuthorDate: 2021-03-05 16:45:23 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-05 16:45:54 +0000 tcp: remove incorrect reset of SACK variable in PRR Reviewed By: #transport, rrs, tuexen PR: 253848 MFC after: 3 days Sponsored By: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29083 --- sys/netinet/tcp_input.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 89e70df48774..a5d2e1676364 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2693,7 +2693,6 @@ enter_recovery: */ tp->sackhint.prr_delivered = tp->sackhint.sacked_bytes; - tp->sackhint.sack_bytes_rexmit = 0; tp->sackhint.recover_fs = max(1, tp->snd_nxt - tp->snd_una); } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:23:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A31DF5602D6; Fri, 5 Mar 2021 17:23:37 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.3 with cipher TLS_AES_256_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 4DsZMY3G5zz4tKL; Fri, 5 Mar 2021 17:23:37 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) (authenticated bits=0) by gritton.org (8.15.2/8.15.2) with ESMTPA id 125H9l3V072082; Fri, 5 Mar 2021 09:09:47 -0800 (PST) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 05 Mar 2021 09:09:47 -0800 From: James Gritton To: Kyle Evans Cc: src-committers , , dev-commits-src-main@freebsd.org, jails@freebsd.org Subject: Re: git: d4380c0cdd05 - main - jail: Change both root and working directories in jail_attach(2) In-Reply-To: References: <202102192213.11JMDoiL080275@gitrepo.freebsd.org> User-Agent: Roundcube Webmail/1.4.1 Message-ID: <2b8a8650271cb14c0a236aa8a79bac74@freebsd.org> X-Sender: jamie@freebsd.org X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Fri, 05 Mar 2021 09:09:47 -0800 (PST) X-Rspamd-Queue-Id: 4DsZMY3G5zz4tKL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:23:37 -0000 It's superfluous now, as long as the newest kernel is running. The only problem is if people install the new binaries under an older kernel. That's why I've been letting it sit so far. - Jamie On 2021-03-05 09:06, Kyle Evans wrote: > On Fri, Feb 19, 2021 at 4:13 PM Jamie Gritton > wrote: >> >> The branch main has been updated by jamie: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=d4380c0cdd0517dc038403dd5c99242ce78bdeb5 >> >> commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5 >> Author: Jamie Gritton >> AuthorDate: 2021-02-19 22:13:35 +0000 >> Commit: Jamie Gritton >> CommitDate: 2021-02-19 22:13:35 +0000 >> >> jail: Change both root and working directories in jail_attach(2) >> >> jail_attach(2) performs an internal chroot operation, leaving it >> up to >> the calling process to assure the working directory is inside the >> jail. >> >> Add a matching internal chdir operation to the jail's root. Also >> ignore kern.chroot_allow_open_directories, and always disallow the >> operation if there are any directory descriptors open. >> > > Any reason we shouldn't go ahead and drop the explicit chdir() from > jexec(8) and jail(8) now that jail_attach *is* guaranteed to chdir > along with its chroot? > > Thanks, > > Kyle Evans From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:24:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7EAA560784; Fri, 5 Mar 2021 17:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsZNF4sRdz4tgl; Fri, 5 Mar 2021 17:24: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 99B96147A3; Fri, 5 Mar 2021 17:24: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 125HOD39034605; Fri, 5 Mar 2021 17:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125HODvp034604; Fri, 5 Mar 2021 17:24:13 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:24:13 GMT Message-Id: <202103051724.125HODvp034604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 9a13d9dceee2 - main - tcp: remove a superfluous local var in tcp_sack_partialack() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a13d9dceee27fc1bf6fb7e58e83c88707665859 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:24:13 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=9a13d9dceee27fc1bf6fb7e58e83c88707665859 commit 9a13d9dceee27fc1bf6fb7e58e83c88707665859 Author: Richard Scheffenegger AuthorDate: 2021-03-05 17:19:16 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-05 17:20:23 +0000 tcp: remove a superfluous local var in tcp_sack_partialack() No functional change. Reviewed By: #transport, tuexen MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29088 --- sys/netinet/tcp_sack.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 28cd5c93f106..37db30007580 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -832,7 +832,6 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) TAILQ_EMPTY(&tp->snd_holes) && (tp->sackhint.delivered_data > 0)) { struct sackhole *hole; - int maxseg = tcp_maxseg(tp); hole = tcp_sackhole_insert(tp, SEQ_MAX(th->th_ack, tp->snd_max - maxseg), tp->snd_max, NULL); } (void) tp->t_fb->tfb_tcp_output(tp); From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:48:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 116A25609FC; Fri, 5 Mar 2021 17:48:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsZwm00smz3BvY; Fri, 5 Mar 2021 17:48:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E744914CF6; Fri, 5 Mar 2021 17:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125Hmtnr060976; Fri, 5 Mar 2021 17:48:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125Hmt32060975; Fri, 5 Mar 2021 17:48:55 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:48:55 GMT Message-Id: <202103051748.125Hmt32060975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 765cc83260b1 - stable/13 - cxgbetool: correct utilties typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 765cc83260b1c6acca5404b650fe8c1e94a31c16 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:48:56 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=765cc83260b1c6acca5404b650fe8c1e94a31c16 commit 765cc83260b1c6acca5404b650fe8c1e94a31c16 Author: Ed Maste AuthorDate: 2021-01-24 15:21:53 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:40:55 +0000 cxgbetool: correct utilties typo (cherry picked from commit 25611bc0abf8a21f90cf3a702d6163b23bb7bed5) --- usr.sbin/cxgbetool/tcb_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/cxgbetool/tcb_common.c b/usr.sbin/cxgbetool/tcb_common.c index b17889f94a88..c6c3fed19c3e 100644 --- a/usr.sbin/cxgbetool/tcb_common.c +++ b/usr.sbin/cxgbetool/tcb_common.c @@ -169,7 +169,7 @@ tcb_startswith_nc(char *cs, char *ct) /***:----------------------------------------------------------------------- - ***: print utilties + ***: print utilities ***:----------------------------------------------------------------------- */ From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:48:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60439560D45; Fri, 5 Mar 2021 17:48: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 4DsZwp1gKbz3BmX; Fri, 5 Mar 2021 17:48: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 2AFA514BAB; Fri, 5 Mar 2021 17:48: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 125Hmw3G061017; Fri, 5 Mar 2021 17:48:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125Hmw8H061016; Fri, 5 Mar 2021 17:48:58 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:48:58 GMT Message-Id: <202103051748.125Hmw8H061016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 680867cb7029 - stable/13 - newvers.sh: add newline at EOF in generated vers.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 680867cb7029cf60a401603794e202c588172dd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:48:58 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=680867cb7029cf60a401603794e202c588172dd1 commit 680867cb7029cf60a401603794e202c588172dd1 Author: Ed Maste AuthorDate: 2021-01-25 19:53:47 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:46:12 +0000 newvers.sh: add newline at EOF in generated vers.c Previously we omitted the newline, which did not cause a functional issue for the build but resulted in suboptimal output from e.g. `cat vers.c`. (cherry picked from commit 8564660237aec4c679e8b607dbbf861c90fafc4c) --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 0b5b76847320..acbebbd780b7 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -311,7 +311,7 @@ EOF ) vers_content_old=$(cat vers.c 2>/dev/null || true) if [ "$vers_content_new" != "$vers_content_old" ]; then - printf "%s" "$vers_content_new" > vers.c + printf "%s\n" "$vers_content_new" > vers.c fi echo $((v + 1)) > version From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:48:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FFB6560FC0; Fri, 5 Mar 2021 17:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsZwn0v5dz3BmR; Fri, 5 Mar 2021 17:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11A8D14BAA; Fri, 5 Mar 2021 17:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125Hmuth060999; Fri, 5 Mar 2021 17:48:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125HmuaB060998; Fri, 5 Mar 2021 17:48:56 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:48:56 GMT Message-Id: <202103051748.125HmuaB060998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 812a476244c4 - stable/13 - tests/sys/audit: force PIE off MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 812a476244c4c2458942f957cf1188f05459a5d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:48:57 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=812a476244c4c2458942f957cf1188f05459a5d8 commit 812a476244c4c2458942f957cf1188f05459a5d8 Author: Ed Maste AuthorDate: 2021-02-19 01:41:33 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:46:11 +0000 tests/sys/audit: force PIE off df093aa9463b linked against libprivateauditd.a, but that is currently (and incorrectly) built as position-dependent. For now just force PIE off for this test to fix the WITH_PIE build. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4621c4f2fd179eff0923140da9af122c42dbe78b) --- tests/sys/audit/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/audit/Makefile b/tests/sys/audit/Makefile index c2267e52698f..215740020eb5 100644 --- a/tests/sys/audit/Makefile +++ b/tests/sys/audit/Makefile @@ -51,6 +51,7 @@ TEST_METADATA+= required_user="root" TEST_METADATA+= is_exclusive="true" TEST_METADATA+= required_files="/etc/rc.d/auditd /dev/auditpipe" +MK_PIE:= no # XXX libprivateauditd.a is not PIE LDFLAGS+= -lbsm -lutil CFLAGS.process-control.c+= -I${SRCTOP}/tests From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:49:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2F96561012; Fri, 5 Mar 2021 17:49: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 4DsZwr084Zz3BsC; Fri, 5 Mar 2021 17:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BE9F14BAC; Fri, 5 Mar 2021 17:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125Hmx3I061039; Fri, 5 Mar 2021 17:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125Hmx33061038; Fri, 5 Mar 2021 17:48:59 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:48:59 GMT Message-Id: <202103051748.125Hmx33061038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: de40e928fb5a - stable/13 - Cirrus-CI: remove svn2git remnant MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: de40e928fb5ae58567a08372e1ab793b9c4a2a24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:49:03 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=de40e928fb5ae58567a08372e1ab793b9c4a2a24 commit de40e928fb5ae58567a08372e1ab793b9c4a2a24 Author: Ed Maste AuthorDate: 2021-01-29 14:34:27 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:46:12 +0000 Cirrus-CI: remove svn2git remnant Previously Cirrus was skipped on svn_head to avoid running CI on two different branches with identical content. With the transition to git this serves no purpose. Reported by: kevans Sponsored by: The FreeBSD Foundation (cherry picked from commit f17fc5439f517d06ac8976f53354789cde5a7427) --- .cirrus.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 71bd02a2ca8c..c577ca8aeca3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,6 @@ env: CIRRUS_CLONE_DEPTH: 1 task: - only_if: $CIRRUS_BRANCH != 'svn_head' timeout_in: 120m install_script: - pkg install -y qemu42 uefi-edk2-qemu-x86_64 llvm11 From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:52:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FE6A561141; Fri, 5 Mar 2021 17:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dsb0S0hGkz3CW2; Fri, 5 Mar 2021 17:52: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 0A887148FC; Fri, 5 Mar 2021 17:52: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 125Hq7AB072185; Fri, 5 Mar 2021 17:52:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125Hq7nN072184; Fri, 5 Mar 2021 17:52:07 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:52:07 GMT Message-Id: <202103051752.125Hq7nN072184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 31cbc4f946ae - stable/13 - Cirrus-CI: add df/du to track down disk full issues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 31cbc4f946ae0e69dbb76898713a1fc3df1a19f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:52:08 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=31cbc4f946ae0e69dbb76898713a1fc3df1a19f3 commit 31cbc4f946ae0e69dbb76898713a1fc3df1a19f3 Author: Ed Maste AuthorDate: 2021-03-01 03:07:05 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:49:59 +0000 Cirrus-CI: add df/du to track down disk full issues Cirrus-CI: show mounted filesystems and free space at start CI runs have been encountering disk full errors. Add a `df` invocation so that we can see what we're working with. (cherry picked from commit af11c2029006b64da41a78f2e2dcc910e13ce07a) Cirrus-CI: Add more information to help track down disk full issues Execute df(1) before and after the build (reporting in MiB for consistency), and du(1) of /usr/obj. Also include the uname. (cherry picked from commit f2f24008a2b1b3c7a1c4b75e9b9c2d0f08abc27b) --- .cirrus.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index c577ca8aeca3..840e0eb81e23 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,7 +14,9 @@ task: timeout_in: 120m install_script: - pkg install -y qemu42 uefi-edk2-qemu-x86_64 llvm11 - setup_user_script: + setup_script: + - uname -a + - df -m - pw useradd user - mkdir -p /usr/obj/$(pwd -P) - chown user:user /usr/obj/$(pwd -P) @@ -24,3 +26,6 @@ task: - su user -c "make CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages" test_script: - sh tools/boot/ci-qemu-test.sh + post_script: + - df -m + - du -m -s /usr/obj \ No newline at end of file From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:52:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48CB2560D9C; Fri, 5 Mar 2021 17:52: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 4Dsb0T1ffQz3CSc; Fri, 5 Mar 2021 17:52: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 2BA6414F03; Fri, 5 Mar 2021 17:52: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 125Hq9wQ072208; Fri, 5 Mar 2021 17:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125Hq9sw072207; Fri, 5 Mar 2021 17:52:09 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:52:09 GMT Message-Id: <202103051752.125Hq9sw072207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 982cd9620615 - stable/13 - Cirrus-CI: temporarily avoid qemu smoke test boot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 982cd962061552fbeb43e3bce2a5d7fd05231dde Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:52:09 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=982cd962061552fbeb43e3bce2a5d7fd05231dde commit 982cd962061552fbeb43e3bce2a5d7fd05231dde Author: Ed Maste AuthorDate: 2021-03-05 17:49:23 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:51:04 +0000 Cirrus-CI: temporarily avoid qemu smoke test boot Cirrus-CI has been red for some time because we're running out of disk space on the ephemeral GCP VMs. For now remove the package + qemu boot, and just check for build regressions. This change to be reverted once we have identified and addressed the underlying issue. Sponsored by: The FreeBSD Foundation (cherry picked from commit a7d593dd1da27833b5384349700bc3c7bcae6aad) --- .cirrus.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 840e0eb81e23..323567685b68 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,7 +13,7 @@ env: task: timeout_in: 120m install_script: - - pkg install -y qemu42 uefi-edk2-qemu-x86_64 llvm11 + - pkg install -y llvm11 setup_script: - uname -a - df -m @@ -22,10 +22,6 @@ task: - chown user:user /usr/obj/$(pwd -P) script: - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes buildworld buildkernel" - package_script: - - su user -c "make CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages" - test_script: - - sh tools/boot/ci-qemu-test.sh post_script: - df -m - du -m -s /usr/obj \ No newline at end of file From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:52:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 412E4560D9D; Fri, 5 Mar 2021 17:52: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 4Dsb0V3Fnsz3CSm; Fri, 5 Mar 2021 17:52: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 5510214D1A; Fri, 5 Mar 2021 17:52: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 125HqAxO072228; Fri, 5 Mar 2021 17:52:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125HqAbC072227; Fri, 5 Mar 2021 17:52:10 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:52:10 GMT Message-Id: <202103051752.125HqAbC072227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8ea77f39ec17 - stable/13 - bsdinstall: replace multiple ifs with case MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ea77f39ec170d1a8b1cc2bf514dfefe69cf86aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:52:12 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8ea77f39ec170d1a8b1cc2bf514dfefe69cf86aa commit 8ea77f39ec170d1a8b1cc2bf514dfefe69cf86aa Author: Ed Maste AuthorDate: 2021-01-29 19:00:29 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:51:04 +0000 bsdinstall: replace multiple ifs with case Reduce copy-paste and use a more typical construct. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28417 (cherry picked from commit fbc57e2df95b582f7d3287ed3919337bfec5711a) --- usr.sbin/bsdinstall/scripts/hardening | 46 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/hardening b/usr.sbin/bsdinstall/scripts/hardening index 9fea1b6aed5d..58ea0a112e26 100755 --- a/usr.sbin/bsdinstall/scripts/hardening +++ b/usr.sbin/bsdinstall/scripts/hardening @@ -52,38 +52,40 @@ FEATURES=$( dialog --backtitle "FreeBSD Installer" \ exec 3>&- for feature in $FEATURES; do - if [ "$feature" = "hide_uids" ]; then + case "$feature" in + hide_uids) echo security.bsd.see_other_uids=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening - fi - if [ "$feature" = "hide_gids" ]; then + ;; + hide_gids) echo security.bsd.see_other_gids=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening - fi - if [ "$feature" = "hide_jail" ]; then + ;; + hide_jail) echo security.bsd.see_jail_proc=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening - fi - if [ "$feature" = "read_msgbuf" ]; then + ;; + read_msgbuf) echo security.bsd.unprivileged_read_msgbuf=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening - fi - if [ "$feature" = "proc_debug" ]; then + ;; + proc_debug) echo security.bsd.unprivileged_proc_debug=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening - fi - if [ "$feature" = "random_pid" ]; then + ;; + random_pid) echo kern.randompid=1 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening - fi - if [ "$feature" = "clear_tmp" ]; then + ;; + clear_tmp) echo 'clear_tmp_enable="YES"' >> $BSDINSTALL_TMPETC/rc.conf.hardening - fi - if [ "$feature" = "disable_syslogd" ]; then + ;; + disable_syslogd) echo 'syslogd_flags="-ss"' >> $BSDINSTALL_TMPETC/rc.conf.hardening - fi - if [ "$feature" = "disable_sendmail" ]; then + ;; + disable_sendmail) echo 'sendmail_enable="NONE"' >> $BSDINSTALL_TMPETC/rc.conf.hardening - fi - if [ "$feature" = "secure_console" ]; then + ;; + secure_console) sed "s/unknown off secure/unknown off insecure/g" $BSDINSTALL_CHROOT/etc/ttys > $BSDINSTALL_TMPETC/ttys.hardening - fi - if [ "$feature" = "disable_ddtrace" ]; then + ;; + disable_ddtrace) echo 'security.bsd.allow_destructive_dtrace=0' >> $BSDINSTALL_TMPBOOT/loader.conf.hardening - fi + ;; + esac done From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:52:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 966B0561235; Fri, 5 Mar 2021 17:52: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 4Dsb0Y1ys8z3CXm; Fri, 5 Mar 2021 17:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92A64149D0; Fri, 5 Mar 2021 17:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125HqBJf072248; Fri, 5 Mar 2021 17:52:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125HqBAp072247; Fri, 5 Mar 2021 17:52:11 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:52:11 GMT Message-Id: <202103051752.125HqBAp072247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 41b9a5af2e19 - stable/13 - bsdinstall: add knob to set ASLR sysctls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 41b9a5af2e19cc3715028b9a6e45e0a2e1bceb74 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:52:15 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=41b9a5af2e19cc3715028b9a6e45e0a2e1bceb74 commit 41b9a5af2e19cc3715028b9a6e45e0a2e1bceb74 Author: Ed Maste AuthorDate: 2021-01-29 19:15:28 +0000 Commit: Ed Maste CommitDate: 2021-03-05 17:51:04 +0000 bsdinstall: add knob to set ASLR sysctls Reviewed by: mw Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28418 (cherry picked from commit 020f4112559ebf7e94665c9a69f89d21929ce82a) --- usr.sbin/bsdinstall/scripts/hardening | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/usr.sbin/bsdinstall/scripts/hardening b/usr.sbin/bsdinstall/scripts/hardening index 58ea0a112e26..67ee3672712d 100755 --- a/usr.sbin/bsdinstall/scripts/hardening +++ b/usr.sbin/bsdinstall/scripts/hardening @@ -28,6 +28,20 @@ : ${DIALOG_OK=0} +set_aslr_sysctls() +{ + for bit in 32 64; do + if ! sysctl -Nq kern.elf$bit.aslr.enable >/dev/null; then + continue + fi + cat >> $BSDINSTALL_TMPETC/sysctl.conf.hardening <<-EOF + kern.elf$bit.aslr.enable=1 + kern.elf$bit.aslr.pie_enable=1 + kern.elf$bit.aslr.honor_sbrk=0 + EOF + done +} + echo -n > $BSDINSTALL_TMPETC/rc.conf.hardening echo -n > $BSDINSTALL_TMPETC/sysctl.conf.hardening echo -n > $BSDINSTALL_TMPBOOT/loader.conf.hardening @@ -48,6 +62,7 @@ FEATURES=$( dialog --backtitle "FreeBSD Installer" \ "8 disable_sendmail" "Disable Sendmail service" ${disable_sendmail:-off} \ "9 secure_console" "Enable console password prompt" ${secure_console:-off} \ "10 disable_ddtrace" "Disallow DTrace destructive-mode" ${disable_ddtrace:-off} \ + "11 enable_aslr" "Enable address layout randomization" ${enable_aslr:-off} \ 2>&1 1>&3 ) exec 3>&- @@ -86,6 +101,9 @@ for feature in $FEATURES; do disable_ddtrace) echo 'security.bsd.allow_destructive_dtrace=0' >> $BSDINSTALL_TMPBOOT/loader.conf.hardening ;; + enable_aslr) + set_aslr_sysctls + ;; esac done From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:54:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAEE6560DE1; Fri, 5 Mar 2021 17:54: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 4Dsb2s6LNfz3D0D; Fri, 5 Mar 2021 17:54: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 CC85614F08; Fri, 5 Mar 2021 17:54: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 125HsDun073373; Fri, 5 Mar 2021 17:54:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125HsD12073372; Fri, 5 Mar 2021 17:54:13 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:54:13 GMT Message-Id: <202103051754.125HsD12073372@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: 732b69c9f9c8 - main - acpi: Make nexus_acpi quiet on amd64 and i386 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: 732b69c9f9c84408e7e680a93ab91ce76ffef2ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:54:14 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=732b69c9f9c84408e7e680a93ab91ce76ffef2ce commit 732b69c9f9c84408e7e680a93ab91ce76ffef2ce Author: Mark Johnston AuthorDate: 2021-03-05 17:53:30 +0000 Commit: Mark Johnston CommitDate: 2021-03-05 17:54:00 +0000 acpi: Make nexus_acpi quiet on amd64 and i386 Otherwise during attach newbus prints "nexus0", which is not very useful. The generic nexus device is already quiet, as is nexus_acpi on arm64. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/amd64/acpica/acpi_machdep.c | 2 +- sys/i386/acpica/acpi_machdep.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index 60e470d14cbb..7d8b303f6f16 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -262,7 +262,7 @@ nexus_acpi_probe(device_t dev) error = acpi_identify(); if (error) return (error); - + device_quiet(dev); return (BUS_PROBE_DEFAULT); } diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index 63efe4f520fd..e8810ac88009 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -280,7 +280,7 @@ nexus_acpi_probe(device_t dev) error = acpi_identify(); if (error) return (error); - + device_quiet(dev); return (BUS_PROBE_DEFAULT); } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 17:55:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDF535615C6; Fri, 5 Mar 2021 17:55: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 4Dsb4R4zgYz3DDG; Fri, 5 Mar 2021 17:55: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 9E40C14DAE; Fri, 5 Mar 2021 17:55: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 125HtZjT073705; Fri, 5 Mar 2021 17:55:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125HtZsc073704; Fri, 5 Mar 2021 17:55:35 GMT (envelope-from git) Date: Fri, 5 Mar 2021 17:55:35 GMT Message-Id: <202103051755.125HtZsc073704@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: bb6e84c988d3 - main - poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. 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: bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 17:55:35 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff commit bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff Author: John Baldwin AuthorDate: 2021-03-05 17:47:58 +0000 Commit: John Baldwin CommitDate: 2021-03-05 17:55:11 +0000 poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. There currently isn't a need to provide a public interface to a software Poly1305 implementation beyond what is already available via libsodium's APIs and these symbols conflict with symbols shared within the ossl.ko module between ossl_poly1305.c and ossl_chacha20.c. Reported by: se, kp Fixes: 78991a93eb9d Sponsored by: Netflix --- sys/opencrypto/xform_poly1305.c | 43 ++++++++++++----------------------------- sys/opencrypto/xform_poly1305.h | 16 --------------- 2 files changed, 12 insertions(+), 47 deletions(-) diff --git a/sys/opencrypto/xform_poly1305.c b/sys/opencrypto/xform_poly1305.c index bddbb572d682..d8ceab47deca 100644 --- a/sys/opencrypto/xform_poly1305.c +++ b/sys/opencrypto/xform_poly1305.c @@ -4,7 +4,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include @@ -16,16 +15,16 @@ CTASSERT(sizeof(union authctx) >= sizeof(struct poly1305_xform_ctx)); CTASSERT(POLY1305_KEY_LEN == crypto_onetimeauth_poly1305_KEYBYTES); CTASSERT(POLY1305_HASH_LEN == crypto_onetimeauth_poly1305_BYTES); -void -Poly1305_Init(void *polyctx) +static void +xform_Poly1305_Init(void *polyctx) { /* Nop */ } -void -Poly1305_Setkey(struct poly1305_xform_ctx *polyctx, - const uint8_t key[__min_size(POLY1305_KEY_LEN)], size_t klen) +static void +xform_Poly1305_Setkey(void *ctx, const uint8_t *key, u_int klen) { + struct poly1305_xform_ctx *polyctx = ctx; int rc; if (klen != POLY1305_KEY_LEN) @@ -36,16 +35,10 @@ Poly1305_Setkey(struct poly1305_xform_ctx *polyctx, panic("%s: Invariant violated: %d", __func__, rc); } -static void -xform_Poly1305_Setkey(void *ctx, const uint8_t *key, u_int klen) -{ - Poly1305_Setkey(ctx, key, klen); -} - -int -Poly1305_Update(struct poly1305_xform_ctx *polyctx, const void *data, - size_t len) +static int +xform_Poly1305_Update(void *ctx, const void *data, u_int len) { + struct poly1305_xform_ctx *polyctx = ctx; int rc; rc = crypto_onetimeauth_poly1305_update(&polyctx->state, data, len); @@ -54,16 +47,10 @@ Poly1305_Update(struct poly1305_xform_ctx *polyctx, const void *data, return (0); } -static int -xform_Poly1305_Update(void *ctx, const void *data, u_int len) -{ - return (Poly1305_Update(ctx, data, len)); -} - -void -Poly1305_Final(uint8_t digest[__min_size(POLY1305_HASH_LEN)], - struct poly1305_xform_ctx *polyctx) +static void +xform_Poly1305_Final(uint8_t *digest, void *ctx) { + struct poly1305_xform_ctx *polyctx = ctx; int rc; rc = crypto_onetimeauth_poly1305_final(&polyctx->state, digest); @@ -71,12 +58,6 @@ Poly1305_Final(uint8_t digest[__min_size(POLY1305_HASH_LEN)], panic("%s: Invariant violated: %d", __func__, rc); } -static void -xform_Poly1305_Final(uint8_t *digest, void *ctx) -{ - Poly1305_Final(digest, ctx); -} - struct auth_hash auth_hash_poly1305 = { .type = CRYPTO_POLY1305, .name = "Poly-1305", @@ -84,7 +65,7 @@ struct auth_hash auth_hash_poly1305 = { .hashsize = POLY1305_HASH_LEN, .ctxsize = sizeof(struct poly1305_xform_ctx), .blocksize = crypto_onetimeauth_poly1305_BYTES, - .Init = Poly1305_Init, + .Init = xform_Poly1305_Init, .Setkey = xform_Poly1305_Setkey, .Update = xform_Poly1305_Update, .Final = xform_Poly1305_Final, diff --git a/sys/opencrypto/xform_poly1305.h b/sys/opencrypto/xform_poly1305.h deleted file mode 100644 index cca1c6af9395..000000000000 --- a/sys/opencrypto/xform_poly1305.h +++ /dev/null @@ -1,16 +0,0 @@ -/* This file is in the public domain. */ -/* $FreeBSD$ */ -#pragma once - -#include - -struct poly1305_xform_ctx; - -void Poly1305_Init(void *); - -void Poly1305_Setkey(struct poly1305_xform_ctx *, - const uint8_t [__min_size(32)], size_t); - -int Poly1305_Update(struct poly1305_xform_ctx *, const void *, size_t); - -void Poly1305_Final(uint8_t [__min_size(16)], struct poly1305_xform_ctx *); From owner-dev-commits-src-all@freebsd.org Fri Mar 5 18:15:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5EC65622C8; Fri, 5 Mar 2021 18:15:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsbW55JFMz3FmR; Fri, 5 Mar 2021 18:15: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 A86721503E; Fri, 5 Mar 2021 18:15: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 125IFD7F001017; Fri, 5 Mar 2021 18:15:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125IFDNK001016; Fri, 5 Mar 2021 18:15:13 GMT (envelope-from git) Date: Fri, 5 Mar 2021 18:15:13 GMT Message-Id: <202103051815.125IFDNK001016@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: 89b650872bba - main - ktls: Hide initialization message behind bootverbose 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: 89b650872bba2e4bfbc94a200946b461ef69ae22 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 18:15:13 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=89b650872bba2e4bfbc94a200946b461ef69ae22 commit 89b650872bba2e4bfbc94a200946b461ef69ae22 Author: Mark Johnston AuthorDate: 2021-03-05 18:11:02 +0000 Commit: Mark Johnston CommitDate: 2021-03-05 18:11:02 +0000 ktls: Hide initialization message behind bootverbose We don't typically print anything when a subsystem initializes itself, and KTLS is currently disabled by default anyway. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29097 --- sys/kern/uipc_ktls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 5125061e0879..1fd1eca39b59 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -495,7 +495,8 @@ ktls_init(void *dummy __unused) } } - printf("KTLS: Initialized %d threads\n", ktls_number_threads); + if (bootverbose) + printf("KTLS: Initialized %d threads\n", ktls_number_threads); } SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); From owner-dev-commits-src-all@freebsd.org Fri Mar 5 18:15:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3801E562101; Fri, 5 Mar 2021 18:15: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 4DsbW70tyKz3Ff0; Fri, 5 Mar 2021 18:15: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 E77F814F58; Fri, 5 Mar 2021 18:15: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 125IFE8m001038; Fri, 5 Mar 2021 18:15:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125IFEgi001037; Fri, 5 Mar 2021 18:15:14 GMT (envelope-from git) Date: Fri, 5 Mar 2021 18:15:14 GMT Message-Id: <202103051815.125IFEgi001037@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: 4fc60fa9294f - main - opencrypto: Make cryptosoft attach silently 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: 4fc60fa9294f82c7f4e1a0e71f9a17794124217f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 18:15:15 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4fc60fa9294f82c7f4e1a0e71f9a17794124217f commit 4fc60fa9294f82c7f4e1a0e71f9a17794124217f Author: Mark Johnston AuthorDate: 2021-03-05 18:11:25 +0000 Commit: Mark Johnston CommitDate: 2021-03-05 18:11:25 +0000 opencrypto: Make cryptosoft attach silently cryptosoft is always present and doesn't print any useful information when it attaches. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29098 --- sys/opencrypto/cryptosoft.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 947f27a388d1..a09f085a1eef 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -1658,6 +1658,7 @@ static int swcr_probe(device_t dev) { device_set_desc(dev, "software crypto"); + device_quiet(dev); return (BUS_PROBE_NOWILDCARD); } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 18:19:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82FED5623FF; Fri, 5 Mar 2021 18:19:27 +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 4Dsbbz1Qbpz3FtS; Fri, 5 Mar 2021 18:19:26 +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 125IJHbM037030 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 5 Mar 2021 20:19:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 125IJHbM037030 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 125IJHhV037029; Fri, 5 Mar 2021 20:19:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 5 Mar 2021 20:19:17 +0200 From: Konstantin Belousov To: Ryan Moeller Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c4ba4aa54718 - main - libifconfig: Overhaul ifconfig_media_* interfaces Message-ID: References: <202103051123.125BNubR059014@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202103051123.125BNubR059014@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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4Dsbbz1Qbpz3FtS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 18:19:27 -0000 On Fri, Mar 05, 2021 at 11:23:56AM +0000, Ryan Moeller wrote: > The branch main has been updated by freqlabs: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c4ba4aa547184ab401204096cdad9def4ab37964 > > commit c4ba4aa547184ab401204096cdad9def4ab37964 > Author: Ryan Moeller > AuthorDate: 2021-03-02 10:29:17 +0000 > Commit: Ryan Moeller > CommitDate: 2021-03-05 09:15:55 +0000 > > libifconfig: Overhaul ifconfig_media_* interfaces > > Define an ifmedia_t type to use for ifmedia words. > > Add ifconfig_media_lookup_* functions to lookup ifmedia words by name. > > Get media options as an array of option names rather than formatting it > as a comma-delimited list into a buffer. > > Sprinkle const on static the static description tables for peace of > mind. > > Don't need to zero memory allocated by calloc. > > Reviewed by: kp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D29029 > --- > lib/libifconfig/Makefile | 2 +- > lib/libifconfig/Symbol.map | 9 +- > lib/libifconfig/libifconfig.h | 69 +++++++- > lib/libifconfig/libifconfig_media.c | 339 ++++++++++++++++++++++++------------ > share/examples/libifconfig/status.c | 27 ++- > 5 files changed, 324 insertions(+), 122 deletions(-) > > diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile > index 73dad36c1dc5..c6f006018427 100644 > --- a/lib/libifconfig/Makefile > +++ b/lib/libifconfig/Makefile > @@ -7,7 +7,7 @@ INTERNALLIB= true > LIBADD= m > > SHLIBDIR?= /lib > -SHLIB_MAJOR= 1 > +SHLIB_MAJOR= 2 > > VERSION_DEF= ${LIBCSRCDIR}/Versions.def > SYMBOL_MAPS= ${.CURDIR}/Symbol.map libifconfig is marked as internal, but we provide symbol versioning for it, and do it in the normal FreeBSD namespace. On one hand, our policy is to not bump symvered libs and to provide binary compat shims as needed, on the other, this is internal lib. What is the purpose of maintaining symbol versions for it? From owner-dev-commits-src-all@freebsd.org Fri Mar 5 18:24:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DEAA562A82; Fri, 5 Mar 2021 18:24:00 +0000 (UTC) (envelope-from gbe@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 4DsbjD03cXz3GN2; Fri, 5 Mar 2021 18:24:00 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p200300d5d740b9c950bd45a017f3c4cd.dip0.t-ipconnect.de [IPv6:2003:d5:d740:b9c9:50bd:45a0:17f3:c4cd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 98E22A655; Fri, 5 Mar 2021 18:23:59 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Fri, 5 Mar 2021 19:23:56 +0100 From: Gordon Bergling To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 89b650872bba - main - ktls: Hide initialization message behind bootverbose Message-ID: References: <202103051815.125IFDNK001016@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202103051815.125IFDNK001016@gitrepo.freebsd.org> X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 7:18PM up 6 days, 17:39, 4 users, load averages: 0.43, 0.35, 0.27 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 18:24:00 -0000 Hi Mark, is this change not a little bit to aggressive in terms of dmesg cleanup? There are a lot messages about what subsystem is initialized with how many threads, like for example TCP HTPS and TCP BBR. Hiding this information could be suboptimal for some users. --Gordon On Fri, Mar 05, 2021 at 06:15:13PM +0000, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=89b650872bba2e4bfbc94a200946b461ef69ae22 > > commit 89b650872bba2e4bfbc94a200946b461ef69ae22 > Author: Mark Johnston > AuthorDate: 2021-03-05 18:11:02 +0000 > Commit: Mark Johnston > CommitDate: 2021-03-05 18:11:02 +0000 > > ktls: Hide initialization message behind bootverbose > > We don't typically print anything when a subsystem initializes itself, > and KTLS is currently disabled by default anyway. > > Reviewed by: jhb > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D29097 > --- > sys/kern/uipc_ktls.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > index 5125061e0879..1fd1eca39b59 100644 > --- a/sys/kern/uipc_ktls.c > +++ b/sys/kern/uipc_ktls.c > @@ -495,7 +495,8 @@ ktls_init(void *dummy __unused) > } > } > > - printf("KTLS: Initialized %d threads\n", ktls_number_threads); > + if (bootverbose) > + printf("KTLS: Initialized %d threads\n", ktls_number_threads); > } > SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); > > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" -- From owner-dev-commits-src-all@freebsd.org Fri Mar 5 18:26:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 353DF562A28 for ; Fri, 5 Mar 2021 18:26:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsbmH0RZrz3Gtr for ; Fri, 5 Mar 2021 18:26:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82b.google.com with SMTP id j3so2432349qtj.12 for ; Fri, 05 Mar 2021 10:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=flrH113JdFRIVsfg5/2Rd14lVqZVSPGj2e/aMxTbf8M=; b=RRl8I5fwcD+OljjF5gyowa33GtB+slkqw0rZiXaKeJTSozOK+awUeFpF6F5FCLQ2IO FpnlFlEF/NsYUENOjBUIW5+0xyU1D9kyDyMZJKwo66HbkFj/2MYLcSEPmwXJQ0lP3fUP vkp5yhmWUHkPotNfPie+0jibbnRhabCFVb+VXul3yMEdWYQT0SPqhen50Xn7Imb6hP06 RnOMcH11alj+5PdvYG7kimWLfIInXwxDNN6A4TRtAjs+mYRDENa1VWKqRMK26D8VNBKl LlageTBFFp/goiTeUFPmaK7CH7sJ+fk72wXA4Uqq45ftymdzblLaPtnHzyhk1XpHEck9 bJEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=flrH113JdFRIVsfg5/2Rd14lVqZVSPGj2e/aMxTbf8M=; b=Z6pe3VbS9V/tI9AZEWXEB2hXfbJDewDBL+qX+r5/12RLGJA16gd4f2GbWuiJK5xrL3 mP9Fts8CfM4+or9DvzYDliRUm7o0uR1NFBzeZCCnESydPwEVwg4Lig1NJjZGIemiLFBB 2aGN2i+TjdYgt9nAzNixcf65XPuTDfqRzZmqvR1M6LSRKzc5UoK8nfVBa+S94+opvwt/ 5WMtgXmYf8LNaIeuKKEChSo7K/cSy9qz8njIzplN0xtdsdSsAmUB5DL0xESQV5n22Tai 0O+DdUMFJrm06NGAhPEqJy82EmimCtWfApDGQg7nwzvevmxdyiuXzrp4oNeGhFSBJUAj ywcw== X-Gm-Message-State: AOAM531HubcUIAY12POMY+O7hOeyc28MEsWpf8Zt5pWsYvdXMfuZutV5 2rsZBjae5i272WnwQidF3inMaA== X-Google-Smtp-Source: ABdhPJzoQpXvd5HsztiVcTl02JrzEJCFPraoNQVu37rktMGMW5Bp+YGa1vyyVA+c/zs749ourHykKw== X-Received: by 2002:ac8:1301:: with SMTP id e1mr1437825qtj.96.1614968798058; Fri, 05 Mar 2021 10:26:38 -0800 (PST) Received: from mutt-hbsd (pool-100-16-222-53.bltmmd.fios.verizon.net. [100.16.222.53]) by smtp.gmail.com with ESMTPSA id o76sm2325077qke.79.2021.03.05.10.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 10:26:37 -0800 (PST) Date: Fri, 5 Mar 2021 13:26:36 -0500 From: Shawn Webb To: Gordon Bergling Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 89b650872bba - main - ktls: Hide initialization message behind bootverbose Message-ID: <20210305182636.y6gi3injvqvd2yu4@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: <202103051815.125IFDNK001016@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hudbptwoe4hv37it" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DsbmH0RZrz3Gtr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 18:26:39 -0000 --hudbptwoe4hv37it Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I wonder if it'd be worth it to report such data via sysctl. Thoughts? --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc On Fri, Mar 05, 2021 at 07:23:56PM +0100, Gordon Bergling wrote: > Hi Mark, >=20 > is this change not a little bit to aggressive in terms of dmesg cleanup? >=20 > There are a lot messages about what subsystem is initialized with > how many threads, like for example TCP HTPS and TCP BBR. >=20 > Hiding this information could be suboptimal for some users. >=20 > --Gordon >=20 > On Fri, Mar 05, 2021 at 06:15:13PM +0000, Mark Johnston wrote: > > The branch main has been updated by markj: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D89b650872bba2e4bfbc94a20= 0946b461ef69ae22 > >=20 > > commit 89b650872bba2e4bfbc94a200946b461ef69ae22 > > Author: Mark Johnston > > AuthorDate: 2021-03-05 18:11:02 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-03-05 18:11:02 +0000 > >=20 > > ktls: Hide initialization message behind bootverbose > > =20 > > We don't typically print anything when a subsystem initializes itse= lf, > > and KTLS is currently disabled by default anyway. > > =20 > > Reviewed by: jhb > > MFC after: 1 week > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D29097 > > --- > > sys/kern/uipc_ktls.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > >=20 > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > > index 5125061e0879..1fd1eca39b59 100644 > > --- a/sys/kern/uipc_ktls.c > > +++ b/sys/kern/uipc_ktls.c > > @@ -495,7 +495,8 @@ ktls_init(void *dummy __unused) > > } > > } > > =20 > > - printf("KTLS: Initialized %d threads\n", ktls_number_threads); > > + if (bootverbose) > > + printf("KTLS: Initialized %d threads\n", ktls_number_threads); > > } > > SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); > > =20 > > _______________________________________________ > > dev-commits-src-main@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@free= bsd.org" >=20 > --=20 > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd= =2Eorg" --hudbptwoe4hv37it Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmBCd9oACgkQ/y5nonf4 4foCQA//TMnPacsJYnVvGpuO9qQXO/WSYvaTkREdKHzrIK4LV6XAG79dCPlob5xU A+h19EgFGMRkSniQgo6uaFg58T3H+1chiI9+flVgAJyLA+iykvEHdNQQjQ3o7455 v4m/g1uAA1B9ELeM3CyC8gUoDroQzYJQPq7ZU0AtnS4iRlUMEOH9Nv9xhqAntTaG 4JmPaw/MTwvSxzJIahQMCFNw+n1xFezH8BytobVmxdoSV2ikOf0/SPj/e64SFpG1 PIS/4MtIkZr3fAPMWKCenK628K/ckP1bM/1CsOu3x9p2UgDq3r7L7ey3TXda47qE 2NW8fxocoiyDdL0erA+V8lbSIaHiEy4jlSApg3kIUiGkvpyQWeBt7plI2BOMjdHH tZIfvsYsxFV15a0O/19jiuUJao63hNThPRrV47ujikuxw8FsE4UIMqdeqqZTEOmL 1K7dH+mBYe6jWHpBtiZBfAb4T0upFUd+Oqn4MOtzrzi71yx88oY23N0zGPyc/rIa KBC8PHwg4usqo4Duhyi/hAYBrGXbMmRPZaB1eFUIMUvazpe7MWPg356DqrZipAv0 1AJhWEvU75JF5+tQH378KWrcIHbkoTrUY7Vo8/qXpJaLI4XnqSGFWU+GbgKOzizk BpO/WWiwMV//W00zu3zxGcit8dQENr9XT0f0LIFTtpVrt+eWj/g= =hI/6 -----END PGP SIGNATURE----- --hudbptwoe4hv37it-- From owner-dev-commits-src-all@freebsd.org Fri Mar 5 18:36:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CE98562E96; Fri, 5 Mar 2021 18:36:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (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 4Dsbzp1HKcz3HXW; Fri, 5 Mar 2021 18:36:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf29.google.com with SMTP id 2so1498600qvd.0; Fri, 05 Mar 2021 10:36:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+Szi4fsAA/NFPZgOBYl2/WnzQJT323ztjiiuA4xSqEo=; b=tkQAenj1/0WGpCiyPZ8OqbaGUCI5SnmcPxX2XxlWjW9GUlVPafdjQiS4APgxpe6Vjz w1elFZKJxvTa5y+9SgaIf6UA0tDQkKCN2IStYAR2ejgIfWTekWjdI815m1rXdqURd+PS 53tZK3BQCAyavoZkPP8n11clxRRB3UWOU7XG2klsfkjB6JAaSCI66fpMujB1JlB3q1bL KYwMwgO6zPRLx5392qnzBm2cfPtxvakEiWPwaGBliv2ZrzEpMAeFNcWBESGSKUXoNb4D UQIKOoRAZs57cZq6sBrq+W+Xtw+oae5XH/E1HQl+Re7QwreR7nhWsTEbV1r7kTQq3JNI fXEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=+Szi4fsAA/NFPZgOBYl2/WnzQJT323ztjiiuA4xSqEo=; b=gahnWhU2h1niM0qeMV+6I4UOPC2zQFNy5N2SJJtcAPpSpVekGCDcFRiGkM2e5fcXAJ Hh6J2+bwncxaiYQyU3qpaZ7zmhQ7a8OxfAq2fKJ7aNy0abEPG02HTmE90P3LxyLmmjcC khaVI+q/+kjDdyvs6XXka+LColbDcGmEl0RzJb1zXKuJKSExUkCRfEO9OjxMoNVgYaVA paWFjpRm6ltmhmFwL6Y0mupV8l0YiSRXWTLK2gXESqeTsQACF15b3pWDuJcE/6tdrOF/ 690kYMG0iH4yEZWba8NLb9uPZPMyu1hY/gqfySuSu1yqxzoRWwtCjo7d1CtFPNBrijV9 Ka3g== X-Gm-Message-State: AOAM533UyaUBOr65k4fnUR8kIPPdZfh46xzUSgH3pOUhAooZqv/wFm0A qqraWWOLH4OZbxWaHaPX9LSqPfEAFhVneQ== X-Google-Smtp-Source: ABdhPJxz92ghPsIBL7O2OvTd5ak4JdvzMnQUnU1EKZiTRlsK5COqE0iRZofzxvNR8cLelWW7ys4mIQ== X-Received: by 2002:a0c:be86:: with SMTP id n6mr10167295qvi.61.1614969397036; Fri, 05 Mar 2021 10:36:37 -0800 (PST) Received: from nuc ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id j7sm2344774qtr.70.2021.03.05.10.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 10:36:36 -0800 (PST) Sender: Mark Johnston Date: Fri, 5 Mar 2021 13:36:36 -0500 From: Mark Johnston To: Gordon Bergling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 89b650872bba - main - ktls: Hide initialization message behind bootverbose Message-ID: References: <202103051815.125IFDNK001016@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Dsbzp1HKcz3HXW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 18:36:38 -0000 On Fri, Mar 05, 2021 at 07:23:56PM +0100, Gordon Bergling wrote: > Hi Mark, > > is this change not a little bit to aggressive in terms of dmesg cleanup? > > There are a lot messages about what subsystem is initialized with > how many threads, like for example TCP HTPS and TCP BBR. I would argue that that is the exception rather than the norm, and they should be cleaned up too. I just didn't notice since they are not compiled into the kernel. We don't log messages about bufspace threads, taskqueue threads, crypto worker threads, NFSD threads, netgraph threads, pagedaemon threads, etc. This is really an implementation detail and I don't see why it's crucial information that needs to be printed upon each boot. Especially in this case, where KTLS needs to be explicitly be enabled before those threads will ever do anything. > Hiding this information could be suboptimal for some users. There is a kern.ipc.tls.stats.threads sysctl which exposes the same number, so I'm not sure it's really hidden. But why would a user need this information? > On Fri, Mar 05, 2021 at 06:15:13PM +0000, Mark Johnston wrote: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=89b650872bba2e4bfbc94a200946b461ef69ae22 > > > > commit 89b650872bba2e4bfbc94a200946b461ef69ae22 > > Author: Mark Johnston > > AuthorDate: 2021-03-05 18:11:02 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-03-05 18:11:02 +0000 > > > > ktls: Hide initialization message behind bootverbose > > > > We don't typically print anything when a subsystem initializes itself, > > and KTLS is currently disabled by default anyway. > > > > Reviewed by: jhb > > MFC after: 1 week > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D29097 > > --- > > sys/kern/uipc_ktls.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > > index 5125061e0879..1fd1eca39b59 100644 > > --- a/sys/kern/uipc_ktls.c > > +++ b/sys/kern/uipc_ktls.c > > @@ -495,7 +495,8 @@ ktls_init(void *dummy __unused) > > } > > } > > > > - printf("KTLS: Initialized %d threads\n", ktls_number_threads); > > + if (bootverbose) > > + printf("KTLS: Initialized %d threads\n", ktls_number_threads); > > } > > SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); > > > > _______________________________________________ > > dev-commits-src-main@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" > > -- From owner-dev-commits-src-all@freebsd.org Fri Mar 5 18:41:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FAFB562E2B; Fri, 5 Mar 2021 18:41:22 +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 4Dsc5G4CHtz3Hf9; Fri, 5 Mar 2021 18:41:22 +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 17E89A56F; Fri, 5 Mar 2021 18:41:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: a079e38b08f2 - main - ossl: Add Poly1305 digest support. To: Kristof Provost Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103032321.123NLOKb093507@gitrepo.freebsd.org> <4EB11ECA-1788-49D2-9362-09D955C8D695@FreeBSD.org> From: John Baldwin Message-ID: <77a27150-38ea-85cb-8ec5-27dd7054c03d@FreeBSD.org> Date: Fri, 5 Mar 2021 10:41:21 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <4EB11ECA-1788-49D2-9362-09D955C8D695@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 18:41:22 -0000 On 3/5/21 12:32 AM, Kristof Provost wrote: > On 4 Mar 2021, at 0:21, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=a079e38b08f2f07c50ba915dae66d099559abdcc >> >> commit a079e38b08f2f07c50ba915dae66d099559abdcc >> Author: John Baldwin >> AuthorDate: 2021-03-03 23:17:29 +0000 >> Commit: John Baldwin >> CommitDate: 2021-03-03 23:20:57 +0000 >> >> ossl: Add Poly1305 digest support. >> >> Reviewed by: cem >> Sponsored by: Netflix >> Differential Revision: https://reviews.freebsd.org/D28754 > > It looks like this broke the LINT builds: Should be fixed now I believe, sorry about the breakage. All of my testing was with ossl as a module. :-/ -- John Baldwin From owner-dev-commits-src-all@freebsd.org Fri Mar 5 19:20:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D52A563EC4; Fri, 5 Mar 2021 19:20: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 4Dscy415KGz3LDH; Fri, 5 Mar 2021 19:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 143FE15CBD; Fri, 5 Mar 2021 19:20: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 125JKBK4084364; Fri, 5 Mar 2021 19:20:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125JKBMA084361; Fri, 5 Mar 2021 19:20:11 GMT (envelope-from git) Date: Fri, 5 Mar 2021 19:20:11 GMT Message-Id: <202103051920.125JKBMA084361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 8b434feedfa9 - main - Only set delayed inval for procs using PTI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b434feedfa9f71b59b9653c9335700abc019c03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 19:20:12 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=8b434feedfa9f71b59b9653c9335700abc019c03 commit 8b434feedfa9f71b59b9653c9335700abc019c03 Author: Eric van Gyzen AuthorDate: 2021-03-05 16:31:43 +0000 Commit: Eric van Gyzen CommitDate: 2021-03-05 19:20:08 +0000 Only set delayed inval for procs using PTI invltlb_invpcid_pti_handler() was requesting delayed TLB invalidation even for processes that aren't using PTI. With an out-of-tree change to avoid PTI for non-jailed root processes, this caused an assertion failure in pmap_activate_sw_pcid_pti() when context-switching between PTI and non-PTI processes. Reviewed by: bdrewery kib tychon Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D29094 --- sys/amd64/amd64/mp_machdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index aa62c2086fa4..11f2bb8bbfc1 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -851,7 +851,8 @@ invltlb_invpcid_pti_handler(pmap_t smp_tlb_pmap) invpcid(&d, INVPCID_CTXGLOB); } else { invpcid(&d, INVPCID_CTX); - if (smp_tlb_pmap == PCPU_GET(curpmap)) + if (smp_tlb_pmap == PCPU_GET(curpmap) && + smp_tlb_pmap->pm_ucr3 != PMAP_NO_CR3) PCPU_SET(ucr3_load_mask, ~CR3_PCID_SAVE); } } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 19:37:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5042564E17; Fri, 5 Mar 2021 19:37: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 4DsdKZ5fJYz3Mvq; Fri, 5 Mar 2021 19:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4C431604F; Fri, 5 Mar 2021 19:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125Jb6fn006465; Fri, 5 Mar 2021 19:37:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125Jb6ea006464; Fri, 5 Mar 2021 19:37:06 GMT (envelope-from git) Date: Fri, 5 Mar 2021 19:37:06 GMT Message-Id: <202103051937.125Jb6ea006464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: acd98bcb2821 - releng/13.0 - loader: use display pixel density for font autoselection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: acd98bcb28216a5a52c011b02adf074f7131f55b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 19:37:06 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=acd98bcb28216a5a52c011b02adf074f7131f55b commit acd98bcb28216a5a52c011b02adf074f7131f55b Author: Toomas Soome AuthorDate: 2021-02-20 08:51:28 +0000 Commit: Toomas Soome CommitDate: 2021-03-05 13:56:58 +0000 loader: use display pixel density for font autoselection Calculate font size from 16 density independent pixels (dp) by using: size = 16 * ppi/160 * display_factor We are specifying font size 16dp, and assuming 1dp = 160ppi. Also apply scaling factor 2 (display_factor). (cherry picked from commit becaac3972f1fde4e3c44516399468ba5ca65c9b) Approved by: re (gjb) --- stand/common/gfx_fb.c | 110 +++++++++++++++++++++++++++++++++++++++++ stand/common/gfx_fb.h | 2 + stand/efi/libefi/efi_console.c | 23 ++++++--- stand/efi/loader/framebuffer.c | 96 +++++++++++++++++++++++++++++++++-- stand/i386/libi386/vbe.c | 25 ++++++---- 5 files changed, 237 insertions(+), 19 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 02a0a3d2be22..77cf1d39854f 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -1863,6 +1863,113 @@ reset_font_flags(void) } } +/* Return w^2 + h^2 or 0, if the dimensions are unknown */ +static unsigned +edid_diagonal_squared(void) +{ + unsigned w, h; + + if (edid_info == NULL) + return (0); + + w = edid_info->display.max_horizontal_image_size; + h = edid_info->display.max_vertical_image_size; + + /* If either one is 0, we have aspect ratio, not size */ + if (w == 0 || h == 0) + return (0); + + /* + * some monitors encode the aspect ratio instead of the physical size. + */ + if ((w == 16 && h == 9) || (w == 16 && h == 10) || + (w == 4 && h == 3) || (w == 5 && h == 4)) + return (0); + + /* + * translate cm to inch, note we scale by 100 here. + */ + w = w * 100 / 254; + h = h * 100 / 254; + + /* Return w^2 + h^2 */ + return (w * w + h * h); +} + +/* + * calculate pixels per inch. + */ +static unsigned +gfx_get_ppi(void) +{ + unsigned dp, di; + + di = edid_diagonal_squared(); + if (di == 0) + return (0); + + dp = gfx_state.tg_fb.fb_width * + gfx_state.tg_fb.fb_width + + gfx_state.tg_fb.fb_height * + gfx_state.tg_fb.fb_height; + + return (isqrt(dp / di)); +} + +/* + * Calculate font size from density independent pixels (dp): + * ((16dp * ppi) / 160) * display_factor. + * Here we are using fixed constants: 1dp == 160 ppi and + * display_factor 2. + * + * We are rounding font size up and are searching for font which is + * not smaller than calculated size value. + */ +static vt_font_bitmap_data_t * +gfx_get_font(void) +{ + unsigned ppi, size; + vt_font_bitmap_data_t *font = NULL; + struct fontlist *fl, *next; + + /* Text mode is not supported here. */ + if (gfx_state.tg_fb_type == FB_TEXT) + return (NULL); + + ppi = gfx_get_ppi(); + if (ppi == 0) + return (NULL); + + /* + * We will search for 16dp font. + * We are using scale up by 10 for roundup. + */ + size = (16 * ppi * 10) / 160; + /* Apply display factor 2. */ + size = roundup(size * 2, 10) / 10; + + STAILQ_FOREACH(fl, &fonts, font_next) { + next = STAILQ_NEXT(fl, font_next); + + /* + * If this is last font or, if next font is smaller, + * we have our font. Make sure, it actually is loaded. + */ + if (next == NULL || next->font_data->vfbd_height < size) { + font = fl->font_data; + if (font->vfbd_font == NULL || + fl->font_flags == FONT_RELOAD) { + if (fl->font_load != NULL && + fl->font_name != NULL) + font = fl->font_load(fl->font_name); + } + break; + } + } + + return (font); +} + static vt_font_bitmap_data_t * set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) { @@ -1887,6 +1994,9 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) } } + if (font == NULL) + font = gfx_get_font(); + if (font != NULL) { *rows = height / font->vfbd_height; *cols = width / font->vfbd_width; diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index 04076a2c6d38..ac63d7939cef 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -109,6 +109,8 @@ struct vesa_edid_info { uint8_t checksum; } __packed; +extern struct vesa_edid_info *edid_info; + #define STD_TIMINGS 8 #define DET_TIMINGS 4 diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 3cbd121c41da..0c40b362f276 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -952,13 +952,24 @@ cons_update_mode(bool use_gfx_mode) /* * setup_font() can adjust terminal size. - * Note, we do use UEFI terminal dimensions first, - * this is because the font selection will attempt - * to achieve at least this terminal dimension and - * we do not end up with too small font. + * We can see two kind of bad happening. + * We either can get too small console font - requested + * terminal size is large, display resolution is + * large, and we get very small font. + * Or, we can get too large font - requested + * terminal size is small and this will cause large + * font to be selected. + * Now, the setup_font() is updated to consider + * display density and this should give us mostly + * acceptable font. However, the catch is, not all + * display devices will give us display density. + * Still, we do hope, external monitors do - this is + * where the display size will matter the most. + * And for laptop screens, we should still get good + * results by requesting 80x25 terminal. */ - gfx_state.tg_tp.tp_row = rows; - gfx_state.tg_tp.tp_col = cols; + gfx_state.tg_tp.tp_row = 25; + gfx_state.tg_tp.tp_col = 80; setup_font(&gfx_state, fb_height, fb_width); rows = gfx_state.tg_tp.tp_row; cols = gfx_state.tg_tp.tp_col; diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index 509c41844dcb..adb9dfb62cee 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include "bootstrap.h" @@ -47,6 +49,12 @@ static EFI_GUID conout_guid = EFI_CONSOLE_OUT_DEVICE_GUID; EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; +static EFI_GUID active_edid_guid = EFI_EDID_ACTIVE_PROTOCOL_GUID; +static EFI_GUID discovered_edid_guid = EFI_EDID_DISCOVERED_PROTOCOL_GUID; +static EFI_HANDLE gop_handle; + +/* Cached EDID. */ +struct vesa_edid_info *edid_info = NULL; static EFI_GRAPHICS_OUTPUT *gop; static EFI_UGA_DRAW_PROTOCOL *uga; @@ -467,10 +475,71 @@ efifb_from_uga(struct efi_fb *efifb) return (0); } +/* + * Fetch EDID info. Caller must free the buffer. + */ +static struct vesa_edid_info * +efifb_gop_get_edid(EFI_HANDLE h) +{ + const uint8_t magic[] = EDID_MAGIC; + EFI_EDID_ACTIVE_PROTOCOL *edid; + struct vesa_edid_info *edid_infop; + EFI_GUID *guid; + EFI_STATUS status; + size_t size; + + guid = &active_edid_guid; + status = BS->OpenProtocol(h, guid, (void **)&edid, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (status != EFI_SUCCESS || + edid->SizeOfEdid == 0) { + guid = &discovered_edid_guid; + status = BS->OpenProtocol(h, guid, (void **)&edid, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (status != EFI_SUCCESS || + edid->SizeOfEdid == 0) + return (NULL); + } + + size = MAX(sizeof(*edid_infop), edid->SizeOfEdid); + + edid_infop = calloc(1, size); + if (edid_infop == NULL) + return (NULL); + + memcpy(edid_infop, edid->Edid, edid->SizeOfEdid); + + /* Validate EDID */ + if (memcmp(edid_infop, magic, sizeof (magic)) != 0) + goto error; + + if (edid_infop->header.version != 1) + goto error; + + return (edid_infop); +error: + free(edid_infop); + return (NULL); +} + +static bool +efifb_get_edid(edid_res_list_t *res) +{ + bool rv = false; + + if (edid_info == NULL) + edid_info = efifb_gop_get_edid(gop_handle); + + if (edid_info != NULL) + rv = gfx_get_edid_resolution(edid_info, res); + + return (rv); +} + int efi_find_framebuffer(teken_gfx_t *gfx_state) { - EFI_HANDLE h, *hlist; + EFI_HANDLE *hlist; UINTN nhandles, i, hsize; struct efi_fb efifb; EFI_STATUS status; @@ -498,23 +567,25 @@ efi_find_framebuffer(teken_gfx_t *gfx_state) /* * Search for ConOut protocol, if not found, use first handle. */ - h = *hlist; + gop_handle = *hlist; for (i = 0; i < nhandles; i++) { void *dummy = NULL; status = OpenProtocolByHandle(hlist[i], &conout_guid, &dummy); if (status == EFI_SUCCESS) { - h = hlist[i]; + gop_handle = hlist[i]; break; } } - status = OpenProtocolByHandle(h, &gop_guid, (void **)&gop); + status = OpenProtocolByHandle(gop_handle, &gop_guid, (void **)&gop); free(hlist); if (status == EFI_SUCCESS) { gfx_state->tg_fb_type = FB_GOP; gfx_state->tg_private = gop; + if (edid_info == NULL) + edid_info = efifb_gop_get_edid(gop_handle); } else { status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (status == EFI_SUCCESS) { @@ -767,9 +838,25 @@ command_gop(int argc, char *argv[]) } else if (strcmp(argv[1], "off") == 0) { (void) cons_update_mode(false); } else if (strcmp(argv[1], "get") == 0) { + edid_res_list_t res; + if (argc != 2) goto usage; + TAILQ_INIT(&res); efifb_from_gop(&efifb, gop->Mode, gop->Mode->Info); + if (efifb_get_edid(&res)) { + struct resolution *rp; + + printf("EDID"); + while ((rp = TAILQ_FIRST(&res)) != NULL) { + printf(" %dx%d", rp->width, rp->height); + TAILQ_REMOVE(&res, rp, next); + free(rp); + } + printf("\n"); + } else { + printf("no EDID information\n"); + } print_efifb(gop->Mode->Mode, &efifb, 1); printf("\n"); } else if (!strcmp(argv[1], "list")) { @@ -778,6 +865,7 @@ command_gop(int argc, char *argv[]) if (argc != 2) goto usage; + pager_open(); for (mode = 0; mode < gop->Mode->MaxMode; mode++) { status = gop->QueryMode(gop, mode, &infosz, &info); diff --git a/stand/i386/libi386/vbe.c b/stand/i386/libi386/vbe.c index 0e9f6929ac05..ef4daffa8380 100644 --- a/stand/i386/libi386/vbe.c +++ b/stand/i386/libi386/vbe.c @@ -51,6 +51,7 @@ static struct modeinfoblock *vbe_mode; static uint16_t *vbe_mode_list; static size_t vbe_mode_list_size; +struct vesa_edid_info *edid_info = NULL; /* The default VGA color palette format is 6 bits per primary color. */ int palette_format = 6; @@ -836,34 +837,40 @@ vbe_dump_mode(int modenum, struct modeinfoblock *mi) static bool vbe_get_edid(edid_res_list_t *res) { - struct vesa_edid_info *edid_info; + struct vesa_edid_info *edidp; const uint8_t magic[] = EDID_MAGIC; int ddc_caps; bool ret = false; + if (edid_info != NULL) + return (gfx_get_edid_resolution(edid_info, res)); + ddc_caps = biosvbe_ddc_caps(); if (ddc_caps == 0) { return (ret); } - edid_info = bio_alloc(sizeof (*edid_info)); - if (edid_info == NULL) + edidp = bio_alloc(sizeof(*edidp)); + if (edidp == NULL) return (ret); - memset(edid_info, 0, sizeof (*edid_info)); + memset(edidp, 0, sizeof(*edidp)); - if (VBE_ERROR(biosvbe_ddc_read_edid(0, edid_info))) + if (VBE_ERROR(biosvbe_ddc_read_edid(0, edidp))) goto done; - if (memcmp(edid_info, magic, sizeof (magic)) != 0) + if (memcmp(edidp, magic, sizeof(magic)) != 0) goto done; /* Unknown EDID version. */ - if (edid_info->header.version != 1) + if (edidp->header.version != 1) goto done; - ret = gfx_get_edid_resolution(edid_info, res); + ret = gfx_get_edid_resolution(edidp, res); + edid_info = malloc(sizeof(*edid_info)); + if (edid_info != NULL) + memcpy(edid_info, edidp, sizeof (*edid_info)); done: - bio_free(edid_info, sizeof (*edid_info)); + bio_free(edidp, sizeof(*edidp)); return (ret); } From owner-dev-commits-src-all@freebsd.org Fri Mar 5 19:40:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60A05564F19; Fri, 5 Mar 2021 19:40:31 +0000 (UTC) (envelope-from freqlabs@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 4DsdPW2MpTz3N7r; Fri, 5 Mar 2021 19:40:31 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MacBook-Pro.local (69-228-200-148.lightspeed.knvltn.sbcglobal.net [69.228.200.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 124E7ACEF; Fri, 5 Mar 2021 19:40:31 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: git: c4ba4aa54718 - main - libifconfig: Overhaul ifconfig_media_* interfaces To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103051123.125BNubR059014@gitrepo.freebsd.org> From: Ryan Moeller Message-ID: <20c6efb4-8b57-ae78-3808-b49b07ac284d@FreeBSD.org> Date: Fri, 5 Mar 2021 14:40:29 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 19:40:31 -0000 On 3/5/21 1:19 PM, Konstantin Belousov wrote: > On Fri, Mar 05, 2021 at 11:23:56AM +0000, Ryan Moeller wrote: >> The branch main has been updated by freqlabs: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=c4ba4aa547184ab401204096cdad9def4ab37964 >> >> commit c4ba4aa547184ab401204096cdad9def4ab37964 >> Author: Ryan Moeller >> AuthorDate: 2021-03-02 10:29:17 +0000 >> Commit: Ryan Moeller >> CommitDate: 2021-03-05 09:15:55 +0000 >> >> libifconfig: Overhaul ifconfig_media_* interfaces >> >> Define an ifmedia_t type to use for ifmedia words. >> >> Add ifconfig_media_lookup_* functions to lookup ifmedia words by name. >> >> Get media options as an array of option names rather than formatting it >> as a comma-delimited list into a buffer. >> >> Sprinkle const on static the static description tables for peace of >> mind. >> >> Don't need to zero memory allocated by calloc. >> >> Reviewed by: kp >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D29029 >> --- >> lib/libifconfig/Makefile | 2 +- >> lib/libifconfig/Symbol.map | 9 +- >> lib/libifconfig/libifconfig.h | 69 +++++++- >> lib/libifconfig/libifconfig_media.c | 339 ++++++++++++++++++++++++------------ >> share/examples/libifconfig/status.c | 27 ++- >> 5 files changed, 324 insertions(+), 122 deletions(-) >> >> diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile >> index 73dad36c1dc5..c6f006018427 100644 >> --- a/lib/libifconfig/Makefile >> +++ b/lib/libifconfig/Makefile >> @@ -7,7 +7,7 @@ INTERNALLIB= true >> LIBADD= m >> >> SHLIBDIR?= /lib >> -SHLIB_MAJOR= 1 >> +SHLIB_MAJOR= 2 >> >> VERSION_DEF= ${LIBCSRCDIR}/Versions.def >> SYMBOL_MAPS= ${.CURDIR}/Symbol.map > libifconfig is marked as internal, but we provide symbol versioning for it, > and do it in the normal FreeBSD namespace. On one hand, our policy is to > not bump symvered libs and to provide binary compat shims as needed, on the > other, this is internal lib. > > What is the purpose of maintaining symbol versions for it? I have work in progress that changes libifconfig to a private lib. I'm not sure why markj@ added the symbol map, but I've been forced to maintain it for my later changes to work. -Ryan From owner-dev-commits-src-all@freebsd.org Fri Mar 5 19:44:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9E73565096; Fri, 5 Mar 2021 19:44:54 +0000 (UTC) (envelope-from markjdb@gmail.com) 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 4DsdVZ5JV1z3Npb; Fri, 5 Mar 2021 19:44:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x830.google.com with SMTP id j3so2646354qtj.12; Fri, 05 Mar 2021 11:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=y5Qh5X1jPC/kugc3S4uHPl1RjwJ1IDnQBzN6/aJOSRc=; b=RVEwkchKZ2LU5WcAodsdptqN5udkPxoO0o8CxlvcAg6NizfLku9rFvAy5Pj2Y6/BxE zLQo0EOTsngTufag1FTHqN+fjoAFDBakcWC3P4ONQbP3X79JE5MtBBO9ULJVsNiiDlY3 WFOlG1uNMHPmS1nTl7Z4worRWqz6uBu2jrzwXehrGEmS3+ShhXXZ6ktIPjmcieh4YjIE LhZYG6KFsjMsqF+jIAcrvcUNVJXxVBh/8Ise8imzCKk0DCA6ubR2C5NUgkeHJn8PYxsp vfU6xqYZnuDjgt0HJWErYiihBF8QnqrahBYJpxOTwA4rHEE1rIKvXLFtGcVgiv8q7wPU ww2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=y5Qh5X1jPC/kugc3S4uHPl1RjwJ1IDnQBzN6/aJOSRc=; b=tiivttiDMZ1qhme/FkDEbeXXQnrX7ZAn4pX3oBwAwNCp46RFuzd2+EP2TWCGNSoZac MO9+kwVB7ZVYqNMYncBCp5M21hwLgYHR3j2kl2GRCrH/tBEHV5eV484WszKiZf0pcbf4 Eo7hpUwE/IYOI7HgPFh4005idTZLqCZZBcc9gMfZPBoM6kSDbF8FploSWAbmTnjEEAX1 afVHIOIoxB5GGQimz5RDNmEw3CzvvTlBf5r4Hz8mP/muARJt16N0u7KJaZkuGkFfaGft VRp+bkIvA30spaqt+Qb49jH6c9FgVaUjp74zuDruWPrFHM2howE02igvkWNXyQEwZY7V IPLw== X-Gm-Message-State: AOAM530NS9/TJ74r9TPPJLDpa5yp5ZfMydC+IePZFfvHj/A7zIhB7CaC XUYgNHRqoTswKudMmiKCAoYnMWXGQDR/4Q== X-Google-Smtp-Source: ABdhPJyoE5WnyWbKuQP8HL3g/VtT1UnvVpIvMxNHHjFfeaIaLAsBbSRlERWAAOlXsWTDcSszx/gEzQ== X-Received: by 2002:ac8:5892:: with SMTP id t18mr10967828qta.76.1614973487817; Fri, 05 Mar 2021 11:44:47 -0800 (PST) Received: from nuc ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id v187sm2496826qkd.50.2021.03.05.11.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 11:44:47 -0800 (PST) Sender: Mark Johnston Date: Fri, 5 Mar 2021 14:44:50 -0500 From: Mark Johnston To: Ryan Moeller Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c4ba4aa54718 - main - libifconfig: Overhaul ifconfig_media_* interfaces Message-ID: References: <202103051123.125BNubR059014@gitrepo.freebsd.org> <20c6efb4-8b57-ae78-3808-b49b07ac284d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20c6efb4-8b57-ae78-3808-b49b07ac284d@FreeBSD.org> X-Rspamd-Queue-Id: 4DsdVZ5JV1z3Npb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 19:44:55 -0000 On Fri, Mar 05, 2021 at 02:40:29PM -0500, Ryan Moeller wrote: > > On 3/5/21 1:19 PM, Konstantin Belousov wrote: > > On Fri, Mar 05, 2021 at 11:23:56AM +0000, Ryan Moeller wrote: > >> The branch main has been updated by freqlabs: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=c4ba4aa547184ab401204096cdad9def4ab37964 > >> > >> commit c4ba4aa547184ab401204096cdad9def4ab37964 > >> Author: Ryan Moeller > >> AuthorDate: 2021-03-02 10:29:17 +0000 > >> Commit: Ryan Moeller > >> CommitDate: 2021-03-05 09:15:55 +0000 > >> > >> libifconfig: Overhaul ifconfig_media_* interfaces > >> > >> Define an ifmedia_t type to use for ifmedia words. > >> > >> Add ifconfig_media_lookup_* functions to lookup ifmedia words by name. > >> > >> Get media options as an array of option names rather than formatting it > >> as a comma-delimited list into a buffer. > >> > >> Sprinkle const on static the static description tables for peace of > >> mind. > >> > >> Don't need to zero memory allocated by calloc. > >> > >> Reviewed by: kp > >> MFC after: 2 weeks > >> Differential Revision: https://reviews.freebsd.org/D29029 > >> --- > >> lib/libifconfig/Makefile | 2 +- > >> lib/libifconfig/Symbol.map | 9 +- > >> lib/libifconfig/libifconfig.h | 69 +++++++- > >> lib/libifconfig/libifconfig_media.c | 339 ++++++++++++++++++++++++------------ > >> share/examples/libifconfig/status.c | 27 ++- > >> 5 files changed, 324 insertions(+), 122 deletions(-) > >> > >> diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile > >> index 73dad36c1dc5..c6f006018427 100644 > >> --- a/lib/libifconfig/Makefile > >> +++ b/lib/libifconfig/Makefile > >> @@ -7,7 +7,7 @@ INTERNALLIB= true > >> LIBADD= m > >> > >> SHLIBDIR?= /lib > >> -SHLIB_MAJOR= 1 > >> +SHLIB_MAJOR= 2 > >> > >> VERSION_DEF= ${LIBCSRCDIR}/Versions.def > >> SYMBOL_MAPS= ${.CURDIR}/Symbol.map > > libifconfig is marked as internal, but we provide symbol versioning for it, > > and do it in the normal FreeBSD namespace. On one hand, our policy is to > > not bump symvered libs and to provide binary compat shims as needed, on the > > other, this is internal lib. > > > > What is the purpose of maintaining symbol versions for it? > > > I have work in progress that changes libifconfig to a private lib. I'm > not sure why markj@ added the symbol map, but I've been forced to > maintain it for my later changes to work. I added it because there was some discussion of making it a public library, and adding a symbol map was a step towards that. If it is only going to be a private library, then there's indeed no reason to maintain it. From owner-dev-commits-src-all@freebsd.org Fri Mar 5 19:46:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 946CB56516F; Fri, 5 Mar 2021 19:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsdXK3p4Hz3NyQ; Fri, 5 Mar 2021 19:46: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 754C41668F; Fri, 5 Mar 2021 19:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125JkP89019230; Fri, 5 Mar 2021 19:46:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125JkPvR019229; Fri, 5 Mar 2021 19:46:25 GMT (envelope-from git) Date: Fri, 5 Mar 2021 19:46:25 GMT Message-Id: <202103051946.125JkPvR019229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 4a4e9c516cfc - main - cxgbe(4): Fix an assertion that is not valid during attach. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a4e9c516cfc54181264c92276301a45ea4680d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 19:46:25 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=4a4e9c516cfc54181264c92276301a45ea4680d4 commit 4a4e9c516cfc54181264c92276301a45ea4680d4 Author: Navdeep Parhar AuthorDate: 2021-03-05 19:28:18 +0000 Commit: Navdeep Parhar CommitDate: 2021-03-05 19:28:18 +0000 cxgbe(4): Fix an assertion that is not valid during attach. Firmware access from t4_attach takes place without any synchronization. The driver should not panic (debug kernels) if something goes wrong in early communication with the firmware. It should still load so that it's possible to poke around with cxgbetool. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index c9a8b08e8d16..f749fdd937d7 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2875,7 +2875,8 @@ t4_fatal_err(struct adapter *sc, bool fw_error) log(LOG_ALERT, "%s: encountered fatal error, adapter stopped.\n", device_get_nameunit(sc->dev)); if (fw_error) { - ASSERT_SYNCHRONIZED_OP(sc); + if (sc->flags & CHK_MBOX_ACCESS) + ASSERT_SYNCHRONIZED_OP(sc); sc->flags |= ADAP_ERR; } else { ADAPTER_LOCK(sc); From owner-dev-commits-src-all@freebsd.org Fri Mar 5 20:05:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE72E565DB4; Fri, 5 Mar 2021 20:05:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dsdy86T3kz3QGN; Fri, 5 Mar 2021 20:05:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CBB3DBD89; Fri, 5 Mar 2021 20:05:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f180.google.com with SMTP id v64so2744680qtd.5; Fri, 05 Mar 2021 12:05:20 -0800 (PST) X-Gm-Message-State: AOAM532i/zfAYe80enLCtEs580lgzvUHHJCN0wL2iXNqbXeuO81TF3xb N3XslEYAMZiSqYeMGW+K6Xw23aYJGSAtK08gBqs= X-Google-Smtp-Source: ABdhPJxEEG/IGCi4jDFr+wdp/ozPyzcOzFYGHNOVJNbSlsQSDDn0kRBatzyML6zE2Z/LIqw92paHP6kJU6VS3UdH74M= X-Received: by 2002:ac8:5bd1:: with SMTP id b17mr10561631qtb.53.1614974720454; Fri, 05 Mar 2021 12:05:20 -0800 (PST) MIME-Version: 1.0 References: <202103051755.125HtZsc073704@gitrepo.freebsd.org> In-Reply-To: <202103051755.125HtZsc073704@gitrepo.freebsd.org> From: Kyle Evans Date: Fri, 5 Mar 2021 14:05:06 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: bb6e84c988d3 - main - poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. To: John Baldwin Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 20:05:21 -0000 On Fri, Mar 5, 2021 at 11:55 AM John Baldwin wrote: > > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff > > commit bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff > Author: John Baldwin > AuthorDate: 2021-03-05 17:47:58 +0000 > Commit: John Baldwin > CommitDate: 2021-03-05 17:55:11 +0000 > > poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. > > There currently isn't a need to provide a public interface to a > software Poly1305 implementation beyond what is already available via > libsodium's APIs and these symbols conflict with symbols shared within > the ossl.ko module between ossl_poly1305.c and ossl_chacha20.c. > > Reported by: se, kp > Fixes: 78991a93eb9d > Sponsored by: Netflix > --- > sys/opencrypto/xform_poly1305.c | 43 ++++++++++++----------------------------- > sys/opencrypto/xform_poly1305.h | 16 --------------- > 2 files changed, 12 insertions(+), 47 deletions(-) xform_poly1305.h also needs to stop being grouped in ^/include/Makefile (reported by jenkins via np) From owner-dev-commits-src-all@freebsd.org Fri Mar 5 20:07:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44736565CC2; Fri, 5 Mar 2021 20:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dsf121TCPz3QVT; Fri, 5 Mar 2021 20:07: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 255101685A; Fri, 5 Mar 2021 20:07: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 125K7ow2046733; Fri, 5 Mar 2021 20:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125K7oHJ046732; Fri, 5 Mar 2021 20:07:50 GMT (envelope-from git) Date: Fri, 5 Mar 2021 20:07:50 GMT Message-Id: <202103052007.125K7oHJ046732@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: 772c631af81a - main - Add a few missed files to libclang_rt.profile-.a 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: 772c631af81abdb6d498d972bab79d04d3db16d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 20:07:50 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=772c631af81abdb6d498d972bab79d04d3db16d0 commit 772c631af81abdb6d498d972bab79d04d3db16d0 Author: Dimitry Andric AuthorDate: 2021-03-05 20:06:05 +0000 Commit: Dimitry Andric CommitDate: 2021-03-05 20:07:07 +0000 Add a few missed files to libclang_rt.profile-.a Otherwise, programs compiled with -fprofile-instr-generate will encounter undefined symbol errors during linking, for example __llvm_profile_counter_bias, lprofSetRuntimeCounterRelocation and a few others were missing from the profile library. Reported by: ota@j.email.ne.jp PR: 254001 MFC after: 3 days --- lib/libclang_rt/profile/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libclang_rt/profile/Makefile b/lib/libclang_rt/profile/Makefile index c41da991a039..ab3eba28ac96 100644 --- a/lib/libclang_rt/profile/Makefile +++ b/lib/libclang_rt/profile/Makefile @@ -13,8 +13,10 @@ CXXFLAGS+= -fvisibility=default SRCS+= profile/GCDAProfiling.c SRCS+= profile/InstrProfiling.c +SRCS+= profile/InstrProfilingBiasVar.c SRCS+= profile/InstrProfilingBuffer.c SRCS+= profile/InstrProfilingFile.c +SRCS+= profile/InstrProfilingInternal.c SRCS+= profile/InstrProfilingMerge.c SRCS+= profile/InstrProfilingMergeFile.c SRCS+= profile/InstrProfilingNameVar.c From owner-dev-commits-src-all@freebsd.org Fri Mar 5 20:27:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F6B4565F7B; Fri, 5 Mar 2021 20:27:38 +0000 (UTC) (envelope-from se@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 4DsfRt0fgHz3h8p; Fri, 5 Mar 2021 20:27:38 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300cd5f26c90000a9e0dfe348cc0e.dip0.t-ipconnect.de [IPv6:2003:cd:5f26:c900:a9:e0df:e348:cc0e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4F7B8C118; Fri, 5 Mar 2021 20:27:37 +0000 (UTC) (envelope-from se@freebsd.org) To: Kyle Evans , John Baldwin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103051755.125HtZsc073704@gitrepo.freebsd.org> From: Stefan Esser Subject: Re: git: bb6e84c988d3 - main - poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. Message-ID: <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org> Date: Fri, 5 Mar 2021 21:27:35 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BzEcQZ2nusRpdURvGKXTcE63zI1f9CPzu" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 20:27:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BzEcQZ2nusRpdURvGKXTcE63zI1f9CPzu Content-Type: multipart/mixed; boundary="j85mRpT9Yj12HfXzWxaH0rMreDxXIgaOS"; protected-headers="v1" From: Stefan Esser To: Kyle Evans , John Baldwin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org> Subject: Re: git: bb6e84c988d3 - main - poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. References: <202103051755.125HtZsc073704@gitrepo.freebsd.org> In-Reply-To: --j85mRpT9Yj12HfXzWxaH0rMreDxXIgaOS Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable Am 05.03.21 um 21:05 schrieb Kyle Evans: > On Fri, Mar 5, 2021 at 11:55 AM John Baldwin wrote: >> >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dbb6e84c988d3f54eff602ed= 544ceaa9b9fe3e9ff >> >> commit bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff >> Author: John Baldwin >> AuthorDate: 2021-03-05 17:47:58 +0000 >> Commit: John Baldwin >> CommitDate: 2021-03-05 17:55:11 +0000 >> >> poly1305: Don't export generic Poly1305_* symbols from xform_poly= 1305.c. >> >> There currently isn't a need to provide a public interface to a >> software Poly1305 implementation beyond what is already available= via >> libsodium's APIs and these symbols conflict with symbols shared w= ithin >> the ossl.ko module between ossl_poly1305.c and ossl_chacha20.c. >> >> Reported by: se, kp >> Fixes: 78991a93eb9d >> Sponsored by: Netflix >> --- >> sys/opencrypto/xform_poly1305.c | 43 ++++++++++++-------------------= ---------- >> sys/opencrypto/xform_poly1305.h | 16 --------------- >> 2 files changed, 12 insertions(+), 47 deletions(-) >=20 > xform_poly1305.h also needs to stop being grouped in > ^/include/Makefile (reported by jenkins via np) AFAICT, sys/opencrypto/xform_poly1305.h needs to be restored ... It is needed during buildworld (and present in stable/13). --j85mRpT9Yj12HfXzWxaH0rMreDxXIgaOS-- --BzEcQZ2nusRpdURvGKXTcE63zI1f9CPzu Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmBClDcFAwAAAAAACgkQR+u171r99UTc twgAy0d3y7gmaUC8ZWEpJtgBKNbCA8PYAHFOSrTe6KHMewnoZd+kqCgyTptRSsywRNrPd4Xy1f7H Tm4to/+uPWQwo5v6yjn3xCGDQbpN2eK92If8mKhARd5G1ygFTLuzZ/PONch7kZw09+/pY5iACovc dhXliI8MlRppsTr7YE/YaGQeNIWgMgJyMPoaCrRO/ixj0nYK2eJXCZtG5Y2TwnBr+o+E+Nd6kK3X GhwrnCx5fcmi8JqCWiSlenht3V/cibHsbA49Hpc0LVpZp80DPW4S1Z0/rl/X+wEZWTG217hWAe+m yaocY1dLiWy6jicgAa4LNKThDFIbDYg2fhJ42ALk7Q== =Yto1 -----END PGP SIGNATURE----- --BzEcQZ2nusRpdURvGKXTcE63zI1f9CPzu-- From owner-dev-commits-src-all@freebsd.org Fri Mar 5 20:40:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38D30566CE1; Fri, 5 Mar 2021 20:40:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (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 4Dsfl84mxsz3j3q; Fri, 5 Mar 2021 20:40:52 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id IHFgl8RKX2SWTIHFil4rL0; Fri, 05 Mar 2021 13:40:50 -0700 X-Authority-Analysis: v=2.4 cv=fdJod2cF c=1 sm=1 tr=0 ts=60429753 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=dESyimp9J3IA:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=vEtR2WbTRQCnyGjxLlMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=BPzZvq435JnGatEyYwdK:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id B6E0E230; Fri, 5 Mar 2021 12:40:47 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 125Kelsl004737; Fri, 5 Mar 2021 12:40:47 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202103052040.125Kelsl004737@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: Stefan Esser cc: Kyle Evans , John Baldwin , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bb6e84c988d3 - main - poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. In-reply-to: <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org> References: <202103051755.125HtZsc073704@gitrepo.freebsd.org> <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org> Comments: In-reply-to Stefan Esser message dated "Fri, 05 Mar 2021 21:27:35 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 05 Mar 2021 12:40:47 -0800 X-CMAE-Envelope: MS4xfJI/llbE9bRkw0PzZlXdlU6gsNwrqLWgzg2a0h2fJH0NAAFmqMrO0FfhpOs55AMYOtlM2zGOhQxnuUytgN30k9bwOlHNz79QATiCN++ETLC+oO9PzNIE 1HXdcc8eawbZpbEcPWLNTCIBHneJNICoLPHR8YtLslOoUpNAWrbyrtK0qEHYfxShwRkPGWuGdW9cRnxFcZaDYxBDVCShZIXnLlpzJSj2x0uRUm4kHbAqQx2c XBrHq4EqtQp3EdId+Bx+qjrD69MQ+A3qMkAmBTE9ko9eCJs9z7kej/HP7gT0mH/9cF4ZNmb/mnSPM8vyHwwIPNzXtYckBpcwBTSYWbHpoQSAlTWvGtLgJ/1p qczVMQPAf5rNgQsbS7ISWmsyGSFTXQ== X-Rspamd-Queue-Id: 4Dsfl84mxsz3j3q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 20:40:53 -0000 In message <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org>, Stefan Esser wri tes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --BzEcQZ2nusRpdURvGKXTcE63zI1f9CPzu > Content-Type: multipart/mixed; boundary="j85mRpT9Yj12HfXzWxaH0rMreDxXIgaOS"; > protected-headers="v1" > From: Stefan Esser > To: Kyle Evans , John Baldwin > Cc: src-committers , > dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org > Message-ID: <3e76fccd-efeb-1479-7418-7e69bed98915@freebsd.org> > Subject: Re: git: bb6e84c988d3 - main - poly1305: Don't export generic > Poly1305_* symbols from xform_poly1305.c. > References: <202103051755.125HtZsc073704@gitrepo.freebsd.org> > > In-Reply-To: com> > > --j85mRpT9Yj12HfXzWxaH0rMreDxXIgaOS > Content-Type: text/plain; charset=utf-8; format=flowed > Content-Language: de-DE > Content-Transfer-Encoding: quoted-printable > > Am 05.03.21 um 21:05 schrieb Kyle Evans: > > On Fri, Mar 5, 2021 at 11:55 AM John Baldwin wrote: > >> > >> The branch main has been updated by jhb: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dbb6e84c988d3f54eff602ed= > 544ceaa9b9fe3e9ff > >> > >> commit bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff > >> Author: John Baldwin > >> AuthorDate: 2021-03-05 17:47:58 +0000 > >> Commit: John Baldwin > >> CommitDate: 2021-03-05 17:55:11 +0000 > >> > >> poly1305: Don't export generic Poly1305_* symbols from xform_poly= > 1305.c. > >> > >> There currently isn't a need to provide a public interface to a > >> software Poly1305 implementation beyond what is already available= > via > >> libsodium's APIs and these symbols conflict with symbols shared w= > ithin > >> the ossl.ko module between ossl_poly1305.c and ossl_chacha20.c. > >> > >> Reported by: se, kp > >> Fixes: 78991a93eb9d > >> Sponsored by: Netflix > >> --- > >> sys/opencrypto/xform_poly1305.c | 43 ++++++++++++-------------------= > ---------- > >> sys/opencrypto/xform_poly1305.h | 16 --------------- > >> 2 files changed, 12 insertions(+), 47 deletions(-) > >=20 > > xform_poly1305.h also needs to stop being grouped in > > ^/include/Makefile (reported by jenkins via np) > > AFAICT, sys/opencrypto/xform_poly1305.h needs to be restored ... > > It is needed during buildworld (and present in stable/13). Indeed. `xform_poly1305.h' was not built (being made, type OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONE_ALLSRC|DONECYCLE)! `_INCSINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_FO UND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_ACPICAINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_ FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_AGPINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_FOU ND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_CRYPTOINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_ FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_EVDEVINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_F OUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_FS9660INS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_ FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_HIDINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_FOU ND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_HYPERVINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_ FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_PCIINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_FOU ND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_RPCINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_FOU ND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_TEKENINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_F OUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_VERIEXECINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEP S_FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_IPFILTERINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEP S_FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_PFINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_FOUN D|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_NVPAIRINS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_ FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `_MLX5INS' was not built (unmade, type OP_DEPENDS|OP_HAS_COMMANDS|OP_DEPS_FO UND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! `compat' was not built (unmade, type OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_ DEPS_FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONECYCLE)! make[2]: stopped in /opt/src/git-src --- includes_subdir_lib --- make[2]: stopped in /opt/src/git-src --- includes_subdir_bin --- make[2]: stopped in /opt/src/git-src --- includes_subdir_cddl --- make[2]: stopped in /opt/src/git-src --- includes_subdir_kerberos5 --- make[2]: stopped in /opt/src/git-src --- includes_subdir_libexec --- make[2]: stopped in /opt/src/git-src make[1]: stopped in /opt/src/git-src make: stopped in /opt/src/git-src -- 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 owner-dev-commits-src-all@freebsd.org Fri Mar 5 20:46:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 639115674A2; Fri, 5 Mar 2021 20:46:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (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 4Dsft26Ml9z3jkS; Fri, 5 Mar 2021 20:46:50 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id IHLTlwjmyHmS3IHLUlRp3I; Fri, 05 Mar 2021 13:46:49 -0700 X-Authority-Analysis: v=2.4 cv=MaypB7zf c=1 sm=1 tr=0 ts=604298b9 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=dESyimp9J3IA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=53RDwNlWNXt5OqmaG6AA:9 a=CjuIK1q_8ugA:10 a=6naEmYxragMA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=BPzZvq435JnGatEyYwdK:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 1CF0E1E4; Fri, 5 Mar 2021 12:46:47 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 125KkkJ2004952; Fri, 5 Mar 2021 12:46:46 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202103052046.125KkkJ2004952@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: Kyle Evans cc: John Baldwin , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: bb6e84c988d3 - main - poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c. In-reply-to: References: <202103051755.125HtZsc073704@gitrepo.freebsd.org> Comments: In-reply-to Kyle Evans message dated "Fri, 05 Mar 2021 14:05:06 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 05 Mar 2021 12:46:46 -0800 X-CMAE-Envelope: MS4xfFlX2fzk978WU3Zvu2T15k3NY9+Me963oqcf5A46Ua0AURMvqwWqSrJdtPWY2T7XnrEE8gKGoEOOiAKZcotjOcuuLoZZ6o+CJaMXT87+DRlt/bN8E+E9 fRn6WR7CSeIEZ9fQ69SWRYvUh8pk6j6dGbcBtZLX/WjUMzNdXP8Q+drib9Z7IhkSWKHohtezkTX+jkno3fPlvXmie4wItONCRf6AIlK7wFM1cZIqyH09RoC7 J5AqSTP1Tlf1FHWA58HqP9TjlP7TUZEFKajE/VKxQMf3Evj+GlsUaTfvJ4kchsAsUCH2LE71qPx0PDF6spR4sPaB28a95RiHr1Gj2syeZFGrGhxcW91nbXzV UfzSkZbi X-Rspamd-Queue-Id: 4Dsft26Ml9z3jkS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 20:46:51 -0000 In message , Kyle Evans writes: > On Fri, Mar 5, 2021 at 11:55 AM John Baldwin wrote: > > > > The branch main has been updated by jhb: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=bb6e84c988d3f54eff602ed544ceaa > 9b9fe3e9ff > > > > commit bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff > > Author: John Baldwin > > AuthorDate: 2021-03-05 17:47:58 +0000 > > Commit: John Baldwin > > CommitDate: 2021-03-05 17:55:11 +0000 > > > > poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c > . > > > > There currently isn't a need to provide a public interface to a > > software Poly1305 implementation beyond what is already available via > > libsodium's APIs and these symbols conflict with symbols shared within > > the ossl.ko module between ossl_poly1305.c and ossl_chacha20.c. > > > > Reported by: se, kp > > Fixes: 78991a93eb9d > > Sponsored by: Netflix > > --- > > sys/opencrypto/xform_poly1305.c | 43 ++++++++++++------------------------- > ---- > > sys/opencrypto/xform_poly1305.h | 16 --------------- > > 2 files changed, 12 insertions(+), 47 deletions(-) > > xform_poly1305.h also needs to stop being grouped in > ^/include/Makefile (reported by jenkins via np) > This resolves the build failure. -- 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 owner-dev-commits-src-all@freebsd.org Fri Mar 5 20:50:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20D8B566FF3; Fri, 5 Mar 2021 20:50: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 4DsfyL0VRNz3jjj; Fri, 5 Mar 2021 20:50: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 0402B16EED; Fri, 5 Mar 2021 20:50: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 125KoXVV006558; Fri, 5 Mar 2021 20:50:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125KoXhZ006557; Fri, 5 Mar 2021 20:50:33 GMT (envelope-from git) Date: Fri, 5 Mar 2021 20:50:33 GMT Message-Id: <202103052050.125KoXhZ006557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 765d623d606c - main - cxgbe(4): Remove extra blank line. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 765d623d606c0800f2f2689c03edecac473e30a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 20:50:34 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=765d623d606c0800f2f2689c03edecac473e30a9 commit 765d623d606c0800f2f2689c03edecac473e30a9 Author: Navdeep Parhar AuthorDate: 2021-03-05 20:48:39 +0000 Commit: Navdeep Parhar CommitDate: 2021-03-05 20:48:39 +0000 cxgbe(4): Remove extra blank line. No functional change. --- sys/dev/cxgbe/adapter.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index ff9e4eacf112..be890f035635 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -164,7 +164,6 @@ enum { BUF_PACKING_OK = (1 << 6), IS_VF = (1 << 7), KERN_TLS_OK = (1 << 8), - CXGBE_BUSY = (1 << 9), /* port flags */ From owner-dev-commits-src-all@freebsd.org Fri Mar 5 21:52:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3016569364; Fri, 5 Mar 2021 21:52:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DshLM58wFz3nWg; Fri, 5 Mar 2021 21:52:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3CB718126; Fri, 5 Mar 2021 21:52:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125LqxgC090011; Fri, 5 Mar 2021 21:52:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125LqxPF090010; Fri, 5 Mar 2021 21:52:59 GMT (envelope-from git) Date: Fri, 5 Mar 2021 21:52:59 GMT Message-Id: <202103052152.125LqxPF090010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 2c76eebca71b - stable/13 - nfs-over-tls: add user space daemons rpc.tlsclntd and rpc.tlsservd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c76eebca71b8e17881dfcc01faeb0537d87e0af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 21:52:59 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2c76eebca71b8e17881dfcc01faeb0537d87e0af commit 2c76eebca71b8e17881dfcc01faeb0537d87e0af Author: Rick Macklem AuthorDate: 2021-02-18 22:08:19 +0000 Commit: Rick Macklem CommitDate: 2021-03-05 21:49:46 +0000 nfs-over-tls: add user space daemons rpc.tlsclntd and rpc.tlsservd The kernel changes needed for nfs-over-tls have been committed to main. However, nfs-over-tls requires user space daemons to handle the TLS handshake and other non-application data TLS records. There is one daemon (rpc.tlsclntd) for the client side and one daemon (rpc.tlsservd) for the server side, although they share a fair amount of code found in rpc.tlscommon.c and rpc.tlscommon.h. They use a KTLS enabled OpenSSL to perform the actual work and, as such, are only built when MK_OPENSSL_KTLS is set. Communication with the kernel is done via upcall RPCs done on AF_LOCAL sockets and the custom system call rpctls_syscall. Relnotes: yes (cherry picked from commit b9cbc85d727214cf3e13196ab7e7564e53037f77) --- usr.sbin/Makefile | 2 + usr.sbin/rpc.tlsclntd/Makefile | 29 ++ usr.sbin/rpc.tlsclntd/rpc.tlsclntd.8 | 201 ++++++++ usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c | 730 ++++++++++++++++++++++++++++ usr.sbin/rpc.tlsservd/Makefile | 29 ++ usr.sbin/rpc.tlsservd/rpc.tlscommon.c | 295 +++++++++++ usr.sbin/rpc.tlsservd/rpc.tlscommon.h | 68 +++ usr.sbin/rpc.tlsservd/rpc.tlsservd.8 | 348 +++++++++++++ usr.sbin/rpc.tlsservd/rpc.tlsservd.c | 886 ++++++++++++++++++++++++++++++++++ 9 files changed, 2588 insertions(+) diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 39913a327b87..259ab72f2281 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -182,6 +182,8 @@ SUBDIR.${MK_NIS}+= ypserv SUBDIR.${MK_NIS}+= ypset SUBDIR.${MK_NTP}+= ntp SUBDIR.${MK_OPENSSL}+= keyserv +SUBDIR.${MK_OPENSSL_KTLS}+= rpc.tlsclntd +SUBDIR.${MK_OPENSSL_KTLS}+= rpc.tlsservd SUBDIR.${MK_PF}+= ftp-proxy SUBDIR.${MK_PKGBOOTSTRAP}+= pkg SUBDIR.${MK_PMC}+= pmc pmcannotate pmccontrol pmcstat pmcstudy diff --git a/usr.sbin/rpc.tlsclntd/Makefile b/usr.sbin/rpc.tlsclntd/Makefile new file mode 100644 index 000000000000..1c8481a7889c --- /dev/null +++ b/usr.sbin/rpc.tlsclntd/Makefile @@ -0,0 +1,29 @@ +# $FreeBSD$ + +.include + +PROG= rpc.tlsclntd +MAN= rpc.tlsclntd.8 +SRCS= rpc.tlsclntd.c rpc.tlscommon.c rpctlscd.h rpctlscd_svc.c rpctlscd_xdr.c + +CFLAGS+= -I. -I${SRCTOP}/usr.sbin/rpc.tlsservd + +LIBADD= ssl crypto util + +CLEANFILES= rpctlscd_svc.c rpctlscd_xdr.c rpctlscd.h + +RPCSRC= ${SRCTOP}/sys/rpc/rpcsec_tls/rpctlscd.x +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C -M + +rpctlscd_svc.c: ${RPCSRC} rpctlscd.h + ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + +rpctlscd_xdr.c: ${RPCSRC} rpctlscd.h + ${RPCGEN} -c -o ${.TARGET} ${RPCSRC} + +rpctlscd.h: ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + +.PATH: ${SRCTOP}/sys/rpc/rpcsec_tls ${SRCTOP}/usr.sbin/rpc.tlsservd + +.include diff --git a/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.8 b/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.8 new file mode 100644 index 000000000000..23a9d05495c1 --- /dev/null +++ b/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.8 @@ -0,0 +1,201 @@ +.\" Copyright (c) 2008 Isilon Inc http://www.isilon.com/ +.\" Authors: Doug Rabson +.\" Developed with Red Inc: Alfred Perlstein +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.\" Modified from gssd.8 for rpc.tlsclntd.8 by Rick Macklem. +.Dd February 17, 2021 +.Dt RPC.TLSCLNTD 8 +.Os +.Sh NAME +.Nm rpc.tlsclntd +.Nd "Sun RPC over TLS Client Daemon" +.Sh SYNOPSIS +.Nm +.Op Fl C Ar preferred_ciphers +.Op Fl D Ar certdir +.Op Fl d +.Op Fl l Ar CAfile +.Op Fl m +.Op Fl p Ar CApath +.Op Fl r Ar CRLfile +.Op Fl v +.Sh DESCRIPTION +The +.Nm +program provides support for the client side of the kernel Sun RPC over TLS +implementation. +This daemon must be running for the kernel RPC to be able to do a TLS +connection to a server for an NFS over TLS mount. +This daemon requires that the kernel be built with +.Dq options KERNEL_TLS +and be running on an architecture such as +.Dq amd64 +that supports a direct map (not i386) with +.Xr ktls 4 +enabled. +.Pp +If either of the +.Fl l +or +.Fl p +options have been specified, the daemon will require the server's +certificate to verify +and have a Fully Qualified Domain Name (FQDN) in it. +This FQDN must match +the reverse DNS name for the IP address that +the server is using for the TCP connection. +The FQDN may be +in either the DNS field of the subjectAltName or the CN field of the +subjectName in the certificate and +cannot have a wildcard +.Dq * +in it. +.Pp +If a SIGHUP signal is sent to the daemon it will reload the +.Dq CRLfile +and will shut down any extant connections that presented certificates +during TLS handshake that have been revoked. +If the +.Fl r +option was not specified, the SIGHUP signal will be ignored. +.Pp +The daemon will log failed certificate verifications via +.Xr syslogd 8 +using LOG_INFO | LOG_DAEMON when the +.Fl l +or +.Fl p +option has been specified. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl C Ar preferred_ciphers , Fl Fl ciphers= Ns Ar preferred_ciphers +Specify what preferred ciphers are to be used. +If this option is specified, +.Dq SSL_CTX_set_cipher_list() +will be called with +.Dq preferred_ciphers +as the argument. +If this option is not specified, the cipher will be chosen by +.Xr ssl 7 . +.It Fl D Ar certdir , Fl Fl certdir= Ns Ar certdir +Use +.Dq certdir +instead of /etc/rpc.tlsclntd for the +.Fl m +option. +.It Fl d , Fl Fl debuglevel +Run in debug mode. +In this mode, +.Nm +will not fork when it starts. +.It Fl l Ar CAfile , Fl Fl verifylocs= Ns Ar CAfile +This specifies the path name of a CAfile which holds the information +for server certificate verification. +This path name is used in +.Dq SSL_CTX_load_verify_locations(ctx,CAfile,NULL) +and +.Dq SSL_CTX_set0_CA_list(ctx,SSL_load_client_CA_file(CAfile)) +openssl library calls. +Note that this is a path name for the file and is not assumed to be +in +.Dq certdir . +.It Fl m , Fl Fl mutualverf +Enable support for mutual authentication. +A certificate and associated key must be found in /etc/rpc.tlsclntd +(or the directory specified by the +.Fl D +option) +in case a server requests a peer certificate. +The first certificate needs to be in a file named +.Dq cert.pem +and the associated key in a file named +.Dq certkey.pem . +The +.Xr mount_nfs 8 +option +.Fl tlscertname +can be used to override the default certificate for a given +NFS mount, where the files use the alternate naming specified by the option. +If there is a passphrase on the +.Dq certkey.pem +file, this daemon will prompt for the passphrase during startup. +The keys for alternate certificates cannot have passphrases. +.It Fl p Ar CApath , Fl Fl verifydir= Ns Ar CApath +This option is similar to the +.Fl l +option, but specifies the path of a directory with CA +certificates in it. +When this option is used, +.Dq SSL_CTX_set0_CA_list(ctx,SSL_load_client_CA_file()) +is not called, so a list of CA names is not be passed +to the server during the TLS handshake. +The openssl documentation indicates this call is rarely needed. +.It Fl r Ar CRLfile , Fl Fl crl= Ns Ar CRLfile +This option specifies a Certificate Revocation List (CRL) file +that is to be loaded into the verify certificate store and +checked during verification of the server's certificate. +This option is meaningless unless either the +.Fl l +or +.Fl p +have been specified. +.It Fl v , Fl Fl verbose +Run in verbose mode. +In this mode, +.Nm +will log activity messages to syslog using LOG_INFO | LOG_DAEMON or to +stderr, if the +.Fl d +option has also been specified. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr openssl 1 , +.Xr ktls 4 , +.Xr mount_nfs 8 , +.Xr rpc.tlsservd 8 , +.Xr ssl 7 , +.Xr syslogd 8 +.Sh STANDARDS +The implementation is based on the specification in +.Rs +.%B "RFC NNNN" +.%T "Towards Remote Procedure Call Encryption By Default" +.Re +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 13.0 . +.Sh BUGS +This daemon cannot be safely shut down and restarted if there are +any active RPC-over-TLS connections. +Doing so will orphan the KERNEL_TLS connections, so that they +can no longer do upcalls successfully, since the +.Dq SSL * +structures in userspace have been lost. diff --git a/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c b/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c new file mode 100644 index 000000000000..af803f203ffd --- /dev/null +++ b/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c @@ -0,0 +1,730 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Extensively modified from /usr/src/usr.sbin/gssd.c r344402 for + * the client side of kernel RPC-over-TLS by Rick Macklem. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "rpctlscd.h" +#include "rpc.tlscommon.h" + +#ifndef _PATH_RPCTLSCDSOCK +#define _PATH_RPCTLSCDSOCK "/var/run/rpc.tlsclntd.sock" +#endif +#ifndef _PATH_CERTANDKEY +#define _PATH_CERTANDKEY "/etc/rpc.tlsclntd/" +#endif +#ifndef _PATH_RPCTLSCDPID +#define _PATH_RPCTLSCDPID "/var/run/rpc.tlsclntd.pid" +#endif + +/* Global variables also used by rpc.tlscommon.c. */ +int rpctls_debug_level; +bool rpctls_verbose; +SSL_CTX *rpctls_ctx = NULL; +const char *rpctls_verify_cafile = NULL; +const char *rpctls_verify_capath = NULL; +char *rpctls_crlfile = NULL; +bool rpctls_cert = false; +bool rpctls_gothup = false; +struct ssl_list rpctls_ssllist; + +static struct pidfh *rpctls_pfh = NULL; +static const char *rpctls_certdir = _PATH_CERTANDKEY; +static const char *rpctls_ciphers = NULL; +static uint64_t rpctls_ssl_refno = 0; +static uint64_t rpctls_ssl_sec = 0; +static uint64_t rpctls_ssl_usec = 0; + +static void rpctlscd_terminate(int); +static SSL_CTX *rpctls_setupcl_ssl(void); +static SSL *rpctls_connect(SSL_CTX *ctx, int s, char *certname, + u_int certlen, X509 **certp); +static void rpctls_huphandler(int sig __unused); + +extern void rpctlscd_1(struct svc_req *rqstp, SVCXPRT *transp); + +static struct option longopts[] = { + { "certdir", required_argument, NULL, 'D' }, + { "ciphers", required_argument, NULL, 'C' }, + { "debuglevel", no_argument, NULL, 'd' }, + { "verifylocs", required_argument, NULL, 'l' }, + { "mutualverf", no_argument, NULL, 'm' }, + { "verifydir", required_argument, NULL, 'p' }, + { "crl", required_argument, NULL, 'r' }, + { "verbose", no_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 } +}; + +int +main(int argc, char **argv) +{ + /* + * We provide an RPC service on a local-domain socket. The + * kernel rpctls code will upcall to this daemon to do the initial + * TLS handshake. + */ + struct sockaddr_un sun; + int ch, fd, oldmask; + SVCXPRT *xprt; + bool tls_enable; + struct timeval tm; + struct timezone tz; + pid_t otherpid; + size_t tls_enable_len; + + /* Check that another rpctlscd isn't already running. */ + rpctls_pfh = pidfile_open(_PATH_RPCTLSCDPID, 0600, &otherpid); + if (rpctls_pfh == NULL) { + if (errno == EEXIST) + errx(1, "rpctlscd already running, pid: %d.", otherpid); + warn("cannot open or create pidfile"); + } + + /* Check to see that the ktls is enabled. */ + tls_enable_len = sizeof(tls_enable); + if (sysctlbyname("kern.ipc.tls.enable", &tls_enable, &tls_enable_len, + NULL, 0) != 0 || !tls_enable) + errx(1, "Kernel TLS not enabled"); + + /* Get the time when this daemon is started. */ + gettimeofday(&tm, &tz); + rpctls_ssl_sec = tm.tv_sec; + rpctls_ssl_usec = tm.tv_usec; + + rpctls_verbose = false; + while ((ch = getopt_long(argc, argv, "CD:dl:mp:r:v", longopts, NULL)) != + -1) { + switch (ch) { + case 'C': + rpctls_ciphers = optarg; + break; + case 'D': + rpctls_certdir = optarg; + break; + case 'd': + rpctls_debug_level++; + break; + case 'l': + rpctls_verify_cafile = optarg; + break; + case 'm': + rpctls_cert = true; + break; + case 'p': + rpctls_verify_capath = optarg; + break; + case 'r': + rpctls_crlfile = optarg; + break; + case 'v': + rpctls_verbose = true; + break; + default: + fprintf(stderr, "usage: %s " + "[-C/--ciphers preferred_ciphers] " + "[-D/--certdir certdir] [-d/--debuglevel] " + "[-l/--verifylocs CAfile] [-m/--mutualverf] " + "[-p/--verifydir CApath] [-r/--crl CRLfile] " + "[-v/--verbose]\n", argv[0]); + exit(1); + break; + } + } + if (rpctls_crlfile != NULL && rpctls_verify_cafile == NULL && + rpctls_verify_capath == NULL) + errx(1, "-r requires the -l and/or " + "-p options"); + + if (modfind("krpc") < 0) { + /* Not present in kernel, try loading it */ + if (kldload("krpc") < 0 || modfind("krpc") < 0) + errx(1, "Kernel RPC is not available"); + } + + /* + * Set up the SSL_CTX *. + * Do it now, before daemonizing, in case the private key + * is encrypted and requires a passphrase to be entered. + */ + rpctls_ctx = rpctls_setupcl_ssl(); + if (rpctls_ctx == NULL) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't set up TLS context"); + exit(1); + } + err(1, "Can't set up TLS context"); + } + LIST_INIT(&rpctls_ssllist); + + if (!rpctls_debug_level) { + if (daemon(0, 0) != 0) + err(1, "Can't daemonize"); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGHUP, SIG_IGN); + } + signal(SIGTERM, rpctlscd_terminate); + signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, rpctls_huphandler); + + pidfile_write(rpctls_pfh); + + memset(&sun, 0, sizeof sun); + sun.sun_family = AF_LOCAL; + unlink(_PATH_RPCTLSCDSOCK); + strcpy(sun.sun_path, _PATH_RPCTLSCDSOCK); + sun.sun_len = SUN_LEN(&sun); + fd = socket(AF_LOCAL, SOCK_STREAM, 0); + if (fd < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't create local rpctlscd socket"); + exit(1); + } + err(1, "Can't create local rpctlscd socket"); + } + oldmask = umask(S_IXUSR|S_IRWXG|S_IRWXO); + if (bind(fd, (struct sockaddr *)&sun, sun.sun_len) < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't bind local rpctlscd socket"); + exit(1); + } + err(1, "Can't bind local rpctlscd socket"); + } + umask(oldmask); + if (listen(fd, SOMAXCONN) < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't listen on local rpctlscd socket"); + exit(1); + } + err(1, "Can't listen on local rpctlscd socket"); + } + xprt = svc_vc_create(fd, RPC_MAXDATASIZE, RPC_MAXDATASIZE); + if (!xprt) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't create transport for local rpctlscd socket"); + exit(1); + } + err(1, "Can't create transport for local rpctlscd socket"); + } + if (!svc_reg(xprt, RPCTLSCD, RPCTLSCDVERS, rpctlscd_1, NULL)) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't register service for local rpctlscd socket"); + exit(1); + } + err(1, "Can't register service for local rpctlscd socket"); + } + + rpctls_syscall(RPCTLS_SYSC_CLSETPATH, _PATH_RPCTLSCDSOCK); + + rpctls_svc_run(); + + rpctls_syscall(RPCTLS_SYSC_CLSHUTDOWN, ""); + + SSL_CTX_free(rpctls_ctx); + EVP_cleanup(); + return (0); +} + +bool_t +rpctlscd_null_1_svc(__unused void *argp, __unused void *result, + __unused struct svc_req *rqstp) +{ + + rpctls_verbose_out("rpctlscd_null: done\n"); + return (TRUE); +} + +bool_t +rpctlscd_connect_1_svc(struct rpctlscd_connect_arg *argp, + struct rpctlscd_connect_res *result, __unused struct svc_req *rqstp) +{ + int s; + SSL *ssl; + struct ssl_entry *newslp; + X509 *cert; + + rpctls_verbose_out("rpctlsd_connect: started\n"); + /* Get the socket fd from the kernel. */ + s = rpctls_syscall(RPCTLS_SYSC_CLSOCKET, ""); + if (s < 0) { + result->reterr = RPCTLSERR_NOSOCKET; + return (TRUE); + } + + /* Do a TLS connect handshake. */ + ssl = rpctls_connect(rpctls_ctx, s, argp->certname.certname_val, + argp->certname.certname_len, &cert); + if (ssl == NULL) { + rpctls_verbose_out("rpctlsd_connect: can't do TLS " + "handshake\n"); + result->reterr = RPCTLSERR_NOSSL; + } else { + result->reterr = RPCTLSERR_OK; + result->sec = rpctls_ssl_sec; + result->usec = rpctls_ssl_usec; + result->ssl = ++rpctls_ssl_refno; + /* Hard to believe this will ever wrap around.. */ + if (rpctls_ssl_refno == 0) + result->ssl = ++rpctls_ssl_refno; + } + + if (ssl == NULL) { + /* + * For RPC-over-TLS, this upcall is expected + * to close off the socket. + */ + close(s); + return (TRUE); + } + + /* Maintain list of all current SSL *'s */ + newslp = malloc(sizeof(*newslp)); + newslp->refno = rpctls_ssl_refno; + newslp->s = s; + newslp->shutoff = false; + newslp->ssl = ssl; + newslp->cert = cert; + LIST_INSERT_HEAD(&rpctls_ssllist, newslp, next); + return (TRUE); +} + +bool_t +rpctlscd_handlerecord_1_svc(struct rpctlscd_handlerecord_arg *argp, + struct rpctlscd_handlerecord_res *result, __unused struct svc_req *rqstp) +{ + struct ssl_entry *slp; + int ret; + char junk; + + slp = NULL; + if (argp->sec == rpctls_ssl_sec && argp->usec == + rpctls_ssl_usec) { + LIST_FOREACH(slp, &rpctls_ssllist, next) { + if (slp->refno == argp->ssl) + break; + } + } + + if (slp != NULL) { + rpctls_verbose_out("rpctlscd_handlerecord fd=%d\n", + slp->s); + /* + * An SSL_read() of 0 bytes should fail, but it should + * handle the non-application data record before doing so. + */ + ret = SSL_read(slp->ssl, &junk, 0); + if (ret <= 0) { + /* Check to see if this was a close alert. */ + ret = SSL_get_shutdown(slp->ssl); + if ((ret & (SSL_SENT_SHUTDOWN | + SSL_RECEIVED_SHUTDOWN)) == SSL_RECEIVED_SHUTDOWN) + SSL_shutdown(slp->ssl); + } else { + if (rpctls_debug_level == 0) + syslog(LOG_ERR, "SSL_read returned %d", ret); + else + fprintf(stderr, "SSL_read returned %d\n", ret); + } + result->reterr = RPCTLSERR_OK; + } else + result->reterr = RPCTLSERR_NOSSL; + return (TRUE); +} + +bool_t +rpctlscd_disconnect_1_svc(struct rpctlscd_disconnect_arg *argp, + struct rpctlscd_disconnect_res *result, __unused struct svc_req *rqstp) +{ + struct ssl_entry *slp; + int ret; + + slp = NULL; + if (argp->sec == rpctls_ssl_sec && argp->usec == + rpctls_ssl_usec) { + LIST_FOREACH(slp, &rpctls_ssllist, next) { + if (slp->refno == argp->ssl) + break; + } + } + + if (slp != NULL) { + rpctls_verbose_out("rpctlscd_disconnect: fd=%d closed\n", + slp->s); + LIST_REMOVE(slp, next); + if (!slp->shutoff) { + ret = SSL_get_shutdown(slp->ssl); + /* + * Do an SSL_shutdown() unless a close alert has + * already been sent. + */ + if ((ret & SSL_SENT_SHUTDOWN) == 0) + SSL_shutdown(slp->ssl); + } + SSL_free(slp->ssl); + if (slp->cert != NULL) + X509_free(slp->cert); + /* + * For RPC-over-TLS, this upcall is expected + * to close off the socket. + */ + if (!slp->shutoff) + shutdown(slp->s, SHUT_WR); + close(slp->s); + free(slp); + result->reterr = RPCTLSERR_OK; + } else + result->reterr = RPCTLSERR_NOCLOSE; + return (TRUE); +} + +int +rpctlscd_1_freeresult(__unused SVCXPRT *transp, __unused xdrproc_t xdr_result, + __unused caddr_t result) +{ + + return (TRUE); +} + +static void +rpctlscd_terminate(int sig __unused) +{ + + rpctls_syscall(RPCTLS_SYSC_CLSHUTDOWN, ""); + pidfile_remove(rpctls_pfh); + exit(0); +} + +static SSL_CTX * +rpctls_setupcl_ssl(void) +{ + SSL_CTX *ctx; + long flags; + char path[PATH_MAX]; + size_t len, rlen; + int ret; + + SSL_library_init(); + SSL_load_error_strings(); + OpenSSL_add_all_algorithms(); + + ctx = SSL_CTX_new(TLS_client_method()); + if (ctx == NULL) { + rpctls_verbose_out("rpctls_setupcl_ssl: SSL_CTX_new " + "failed\n"); + return (NULL); + } + SSL_CTX_set_ecdh_auto(ctx, 1); + + if (rpctls_ciphers != NULL) { + /* + * Set preferred ciphers, since KERN_TLS only supports a + * few of them. + */ + ret = SSL_CTX_set_cipher_list(ctx, rpctls_ciphers); + if (ret == 0) { + rpctls_verbose_out("rpctls_setupcl_ssl: " + "SSL_CTX_set_cipher_list failed: %s\n", + rpctls_ciphers); + SSL_CTX_free(ctx); + return (NULL); + } + } + + /* + * If rpctls_cert is true, a certificate and key exists in + * rpctls_certdir, so that it can do mutual authentication. + */ + if (rpctls_cert) { + /* Get the cert.pem and certkey.pem files. */ + len = strlcpy(path, rpctls_certdir, sizeof(path)); + rlen = sizeof(path) - len; + if (strlcpy(&path[len], "cert.pem", rlen) != 8) { + SSL_CTX_free(ctx); + return (NULL); + } + ret = SSL_CTX_use_certificate_file(ctx, path, + SSL_FILETYPE_PEM); + if (ret != 1) { + rpctls_verbose_out("rpctls_setupcl_ssl: can't use " + "certificate file path=%s ret=%d\n", path, ret); + SSL_CTX_free(ctx); + return (NULL); + } + if (strlcpy(&path[len], "certkey.pem", rlen) != 11) { + SSL_CTX_free(ctx); + return (NULL); + } + ret = SSL_CTX_use_PrivateKey_file(ctx, path, + SSL_FILETYPE_PEM); + if (ret != 1) { + rpctls_verbose_out("rpctls_setupcl_ssl: Can't use " + "private key path=%s ret=%d\n", path, ret); + SSL_CTX_free(ctx); + return (NULL); + } + } + + if (rpctls_verify_cafile != NULL || rpctls_verify_capath != NULL) { + if (rpctls_crlfile != NULL) { + ret = rpctls_loadcrlfile(ctx); + if (ret == 0) { + rpctls_verbose_out("rpctls_setupcl_ssl: " + "Load CRLfile failed\n"); + SSL_CTX_free(ctx); + return (NULL); + } + } +#if OPENSSL_VERSION_NUMBER >= 0x30000000 + ret = 1; + if (rpctls_verify_cafile != NULL) + ret = SSL_CTX_load_verify_file(ctx, + rpctls_verify_cafile); + if (ret != 0 && rpctls_verify_capath != NULL) + ret = SSL_CTX_load_verify_dir(ctx, + rpctls_verify_capath); +#else + ret = SSL_CTX_load_verify_locations(ctx, + rpctls_verify_cafile, rpctls_verify_capath); +#endif + if (ret == 0) { + rpctls_verbose_out("rpctls_setupcl_ssl: " + "Can't load verify locations\n"); + SSL_CTX_free(ctx); + return (NULL); + } + /* + * The man page says that the + * SSL_CTX_set0_CA_list() call is not normally + * needed, but I believe it is harmless. + */ + if (rpctls_verify_cafile != NULL) + SSL_CTX_set0_CA_list(ctx, + SSL_load_client_CA_file(rpctls_verify_cafile)); + } + + /* RPC-over-TLS must use TLSv1.3, according to the IETF draft.*/ +#ifdef notyet + flags = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | + SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2; +#else + flags = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1_3; +#endif + SSL_CTX_set_options(ctx, flags); + SSL_CTX_clear_mode(ctx, SSL_MODE_NO_KTLS_TX | SSL_MODE_NO_KTLS_RX); + return (ctx); +} + +static SSL * +rpctls_connect(SSL_CTX *ctx, int s, char *certname, u_int certlen, X509 **certp) +{ + SSL *ssl; + X509 *cert; + struct sockaddr_storage ad; + struct sockaddr *sad; + char hostnam[NI_MAXHOST], path[PATH_MAX]; + int gethostret, ret; + char *cp, *cp2; + size_t len, rlen; + long verfret; + + *certp = NULL; + sad = (struct sockaddr *)&ad; + ssl = SSL_new(ctx); + if (ssl == NULL) { + rpctls_verbose_out("rpctls_connect: " + "SSL_new failed\n"); + return (NULL); + } + if (SSL_set_fd(ssl, s) != 1) { + rpctls_verbose_out("rpctls_connect: " + "SSL_set_fd failed\n"); + SSL_free(ssl); + return (NULL); + } + + /* + * If rpctls_cert is true and certname is set, a alternate certificate + * and key exists in files named .pem and key.pem + * in rpctls_certdir that is to be used for mutual authentication. + */ + if (rpctls_cert && certlen > 0) { + len = strlcpy(path, rpctls_certdir, sizeof(path)); + rlen = sizeof(path) - len; + if (rlen <= certlen) { + SSL_free(ssl); + return (NULL); + } + memcpy(&path[len], certname, certlen); + rlen -= certlen; + len += certlen; + path[len] = '\0'; + if (strlcpy(&path[len], ".pem", rlen) != 4) { + SSL_free(ssl); + return (NULL); + } + ret = SSL_use_certificate_file(ssl, path, SSL_FILETYPE_PEM); + if (ret != 1) { + rpctls_verbose_out("rpctls_connect: can't use " + "certificate file path=%s ret=%d\n", path, ret); + SSL_free(ssl); + return (NULL); + } + if (strlcpy(&path[len], "key.pem", rlen) != 7) { + SSL_free(ssl); + return (NULL); + } + ret = SSL_use_PrivateKey_file(ssl, path, SSL_FILETYPE_PEM); + if (ret != 1) { + rpctls_verbose_out("rpctls_connect: Can't use " + "private key path=%s ret=%d\n", path, ret); + SSL_free(ssl); + return (NULL); + } + } + + ret = SSL_connect(ssl); + if (ret != 1) { + rpctls_verbose_out("rpctls_connect: " + "SSL_connect failed %d\n", + ret); + SSL_free(ssl); + return (NULL); + } + + cert = SSL_get_peer_certificate(ssl); + if (cert == NULL) { + rpctls_verbose_out("rpctls_connect: get peer" + " certificate failed\n"); + SSL_free(ssl); + return (NULL); + } + gethostret = rpctls_gethost(s, sad, hostnam, sizeof(hostnam)); + if (gethostret == 0) + hostnam[0] = '\0'; + verfret = SSL_get_verify_result(ssl); + if (verfret == X509_V_OK && (rpctls_verify_cafile != NULL || + rpctls_verify_capath != NULL) && (gethostret == 0 || + rpctls_checkhost(sad, cert, X509_CHECK_FLAG_NO_WILDCARDS) != 1)) + verfret = X509_V_ERR_HOSTNAME_MISMATCH; + if (verfret != X509_V_OK && (rpctls_verify_cafile != NULL || + rpctls_verify_capath != NULL)) { + if (verfret != X509_V_OK) { + cp = X509_NAME_oneline(X509_get_issuer_name(cert), + NULL, 0); + cp2 = X509_NAME_oneline(X509_get_subject_name(cert), + NULL, 0); + if (rpctls_debug_level == 0) + syslog(LOG_INFO | LOG_DAEMON, + "rpctls_connect: client IP %s " + "issuerName=%s subjectName=%s verify " + "failed %s\n", hostnam, cp, cp2, + X509_verify_cert_error_string(verfret)); + else + fprintf(stderr, *** 1698 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Mar 5 21:57:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB23D5695F7; Fri, 5 Mar 2021 21:57: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 4DshRf6KGfz3ndc; Fri, 5 Mar 2021 21:57: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 BD4CB18128; Fri, 5 Mar 2021 21:57: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 125LvYUi090825; Fri, 5 Mar 2021 21:57:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125LvYHB090824; Fri, 5 Mar 2021 21:57:34 GMT (envelope-from git) Date: Fri, 5 Mar 2021 21:57:34 GMT Message-Id: <202103052157.125LvYHB090824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 59f6f5e23c1a - stable/13 - nfs-over-tls: add rc scripts for rpc.tlsclntd and rpc.tlsservd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 59f6f5e23c1a33ce0b335b52870fdd9c0223284a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 21:57:35 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=59f6f5e23c1a33ce0b335b52870fdd9c0223284a commit 59f6f5e23c1a33ce0b335b52870fdd9c0223284a Author: Rick Macklem AuthorDate: 2021-02-18 22:38:01 +0000 Commit: Rick Macklem CommitDate: 2021-03-05 21:55:44 +0000 nfs-over-tls: add rc scripts for rpc.tlsclntd and rpc.tlsservd Add rc.d scripts that control the recently committed rpc.tlsclntd(8) and rpc.tlsservd(8) daemons. (cherry picked from commit 2f48313ab26ef257ca8d46052a33fb6ad6abdb4f) --- libexec/rc/rc.conf | 4 ++++ libexec/rc/rc.d/Makefile | 4 ++++ libexec/rc/rc.d/tlsclntd | 21 +++++++++++++++++++++ libexec/rc/rc.d/tlsservd | 25 +++++++++++++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 56d6bb30f811..53bd8c81c2d7 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -385,6 +385,10 @@ nfscbd_enable="NO" # NFSv4 client side callback daemon nfscbd_flags="" # Flags for nfscbd nfsuserd_enable="NO" # NFSv4 user/group name mapping daemon nfsuserd_flags="" # Flags for nfsuserd +tlsclntd_enable="NO" # Run rpc.tlsclntd needed for NFS-over-TLS mount +tlsclntd_flags="" # Flags for rpc.tlsclntd +tlsservd_enable="NO" # Run rpc.tlsservd needed for NFS-over-TLS nfsd +tlsservd_flags="" # Flags for rpc.tlsservd ### Network Time Services options: ### timed_enable="NO" # Run the time daemon (or NO). diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index a8277e08932c..1a61e89aa215 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -271,6 +271,10 @@ _opensm= opensm .if ${MK_OPENSSL} != "no" CONFS+= keyserv +.if ${MK_OPENSSL_KTLS} != "no" +CONFS+= tlsclntd \ + tlsservd +.endif .endif .if ${MK_OPENSSH} != "no" diff --git a/libexec/rc/rc.d/tlsclntd b/libexec/rc/rc.d/tlsclntd new file mode 100755 index 000000000000..4566ceb67abd --- /dev/null +++ b/libexec/rc/rc.d/tlsclntd @@ -0,0 +1,21 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: tlsclntd +# REQUIRE: NETWORKING root mountcritlocal sysctl +# BEFORE: nfscbd +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="tlsclntd" +desc="NFS over TLS client side daemon" +rcvar="tlsclntd_enable" +command="/usr/sbin/rpc.${name}" +pidfile="/var/run/rpc.${name}.pid" + +load_rc_config $name + +run_rc_command "$1" diff --git a/libexec/rc/rc.d/tlsservd b/libexec/rc/rc.d/tlsservd new file mode 100755 index 000000000000..cca28ed60ffe --- /dev/null +++ b/libexec/rc/rc.d/tlsservd @@ -0,0 +1,25 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: tlsservd +# REQUIRE: NETWORKING root mountcritlocal sysctl +# BEFORE: nfsd +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="tlsservd" +desc="NFS over TLS server side daemon" +rcvar="tlsservd_enable" +command="/usr/sbin/rpc.${name}" + +pidfile="/var/run/rpc.${name}.pid" +required_files="/etc/rpc.tlsservd/cert.pem /etc/rpc.tlsservd/certkey.pem" +extra_commands="reload" + + +load_rc_config $name + +run_rc_command "$1" From owner-dev-commits-src-all@freebsd.org Fri Mar 5 22:02:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 776BE569BC8; Fri, 5 Mar 2021 22:02: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 4DshY031Fzz3nyh; Fri, 5 Mar 2021 22:02: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 5A2FD18209; Fri, 5 Mar 2021 22:02: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 125M2CoJ002982; Fri, 5 Mar 2021 22:02:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125M2CKd002981; Fri, 5 Mar 2021 22:02:12 GMT (envelope-from git) Date: Fri, 5 Mar 2021 22:02:12 GMT Message-Id: <202103052202.125M2CKd002981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Scott Long Subject: git: afbee98232f4 - main - Remove xform_poly1305.h from the build, it is not necessary. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: scottl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afbee98232f41fc05fa8a5b9a8cda4c4c65ff448 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 22:02:12 -0000 The branch main has been updated by scottl: URL: https://cgit.FreeBSD.org/src/commit/?id=afbee98232f41fc05fa8a5b9a8cda4c4c65ff448 commit afbee98232f41fc05fa8a5b9a8cda4c4c65ff448 Author: Scott Long AuthorDate: 2021-03-05 21:28:10 +0000 Commit: Scott Long CommitDate: 2021-03-05 21:28:10 +0000 Remove xform_poly1305.h from the build, it is not necessary. --- include/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/Makefile b/include/Makefile index b6eb63e5ef15..3a34ddb8aa18 100644 --- a/include/Makefile +++ b/include/Makefile @@ -115,8 +115,7 @@ OPENCRYPTO= _cryptodev.h \ xform.h \ xform_auth.h \ xform_comp.h \ - xform_enc.h \ - xform_poly1305.h + xform_enc.h OPENCRYPTODIR= ${INCLUDEDIR}/crypto .PATH: ${SRCTOP}/sys/dev/pci From owner-dev-commits-src-all@freebsd.org Fri Mar 5 23:07:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C52156AA58; Fri, 5 Mar 2021 23:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dsk0q1JRcz3sQy; Fri, 5 Mar 2021 23:07: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 1FD3C18E91; Fri, 5 Mar 2021 23:07: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 125N7tXJ083981; Fri, 5 Mar 2021 23:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125N7t8s083980; Fri, 5 Mar 2021 23:07:55 GMT (envelope-from git) Date: Fri, 5 Mar 2021 23:07:55 GMT Message-Id: <202103052307.125N7t8s083980@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: fef845097190 - main - netmap: Stop printing a line to the dmesg in netmap_init() 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: fef845097190f0ecb783d6c75a9398c4e4a4c0e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 23:07:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fef845097190f0ecb783d6c75a9398c4e4a4c0e1 commit fef845097190f0ecb783d6c75a9398c4e4a4c0e1 Author: Mark Johnston AuthorDate: 2021-03-05 23:07:47 +0000 Commit: Mark Johnston CommitDate: 2021-03-05 23:07:47 +0000 netmap: Stop printing a line to the dmesg in netmap_init() netmap is compiled into the kernel by default so initialization was always reported, and netmap uses a formatting convention not used in the rest of the kernel. Reviewed by: vmaffione MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29099 --- sys/dev/netmap/netmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index b711e0d2497e..f37900712046 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -4347,7 +4347,9 @@ netmap_init(void) if (error) goto fail; +#if !defined(__FreeBSD__) || defined(KLD_MODULE) nm_prinf("netmap: loaded module"); +#endif return (0); fail: netmap_fini(); From owner-dev-commits-src-all@freebsd.org Fri Mar 5 23:42:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65A2F56B926; Fri, 5 Mar 2021 23:42: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 4Dskmh2VNJz3vRj; Fri, 5 Mar 2021 23:42: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 48A17194AF; Fri, 5 Mar 2021 23:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 125NgSaq035312; Fri, 5 Mar 2021 23:42:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 125NgSFQ035311; Fri, 5 Mar 2021 23:42:28 GMT (envelope-from git) Date: Fri, 5 Mar 2021 23:42:28 GMT Message-Id: <202103052342.125NgSFQ035311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: e53138694aa4 - main - tcp: Add prr_out in preparation for PRR/nonSACK and LRD MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e53138694aa41c24c17847afe959225ce0eeff91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 23:42:28 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=e53138694aa41c24c17847afe959225ce0eeff91 commit e53138694aa41c24c17847afe959225ce0eeff91 Author: Richard Scheffenegger AuthorDate: 2021-03-05 23:36:48 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-05 23:38:22 +0000 tcp: Add prr_out in preparation for PRR/nonSACK and LRD Reviewed By: #transport, kbowling MFC after: 3 days Sponsored By: Netapp, Inc. Differential Revision: https://reviews.freebsd.org/D29058 --- sys/netinet/tcp_input.c | 21 ++++++++------------- sys/netinet/tcp_output.c | 8 ++++++++ sys/netinet/tcp_var.h | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index a5d2e1676364..7dfe1dbd4e4f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -510,6 +510,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) } /* XXXLAS: EXIT_RECOVERY ? */ tp->t_bytes_acked = 0; + tp->sackhint.prr_out = 0; } /* @@ -2595,17 +2596,14 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, imax(1, tp->snd_nxt - tp->snd_una); snd_cnt = howmany((long)tp->sackhint.prr_delivered * tp->snd_ssthresh, tp->sackhint.recover_fs) - - (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->snd_recover)); + tp->sackhint.prr_out; } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->snd_recover)); + tp->sackhint.prr_out; else limit = imax(tp->sackhint.prr_delivered - - (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->snd_recover)), + tp->sackhint.prr_out, del_data) + maxseg; snd_cnt = imin(tp->snd_ssthresh - pipe, limit); } @@ -3972,18 +3970,15 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) imax(1, tp->snd_nxt - tp->snd_una); snd_cnt = howmany((long)tp->sackhint.prr_delivered * tp->snd_ssthresh, tp->sackhint.recover_fs) - - (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->snd_recover)); + tp->sackhint.prr_out; } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - - (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->snd_recover)); + tp->sackhint.prr_out; else limit = imax(tp->sackhint.prr_delivered - - (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->snd_recover)), - del_data) + maxseg; + tp->sackhint.prr_out, del_data) + + maxseg; snd_cnt = imin((tp->snd_ssthresh - pipe), limit); } snd_cnt = imax(snd_cnt, 0) / maxseg; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index b4c7ab0a1ab7..d4b5a328e2a6 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1236,6 +1236,14 @@ send: p->rxmit += len; tp->sackhint.sack_bytes_rexmit += len; } + if (IN_RECOVERY(tp->t_flags)) { + /* + * Account all bytes transmitted while + * IN_RECOVERY, simplifying PRR and + * Lost Retransmit Detection + */ + tp->sackhint.prr_out += len; + } th->th_ack = htonl(tp->rcv_nxt); if (optlen) { bcopy(opt, th + 1, optlen); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 30009fa18205..8cd0c828ad66 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -115,7 +115,7 @@ struct sackhint { */ uint32_t recover_fs; /* Flight Size at the start of Loss recovery */ uint32_t prr_delivered; /* Total bytes delivered using PRR */ - uint32_t _pad[1]; /* TBD */ + uint32_t prr_out; /* Bytes sent during IN_RECOVERY */ }; #define SEGQ_EMPTY(tp) TAILQ_EMPTY(&(tp)->t_segq) From owner-dev-commits-src-all@freebsd.org Sat Mar 6 01:12:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5421856D9E9; Sat, 6 Mar 2021 01:12: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 4Dsmmf1B0nz4V3F; Sat, 6 Mar 2021 01:12: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 BAA611A7DA; Sat, 6 Mar 2021 01:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1261CXRO053500; Sat, 6 Mar 2021 01:12:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1261CXqi053499; Sat, 6 Mar 2021 01:12:33 GMT (envelope-from git) Date: Sat, 6 Mar 2021 01:12:33 GMT Message-Id: <202103060112.1261CXqi053499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b5920128c7eb - stable/13 - growfs: allow operation on RW-mounted filesystems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b5920128c7ebcf5060605928263a54b31b317993 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 01:12:34 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b5920128c7ebcf5060605928263a54b31b317993 commit b5920128c7ebcf5060605928263a54b31b317993 Author: Ed Maste AuthorDate: 2021-03-02 22:35:48 +0000 Commit: Ed Maste CommitDate: 2021-03-06 01:12:12 +0000 growfs: allow operation on RW-mounted filesystems growfs supports growing mounted filesystems (writes are temporarily suspended while the grow happens). Drop the check for fs_clean == 0 to restore this case. Leave fs_flags check for FS_UNCLEAN or FS_NEEDSFSCK which represent the state of the filesystem when it was mounted, and fsck should be run first if they are set. PR: 253754 Reviewed by: mckusick Fixes: 6eb925f8450f ("Filesystem utilities that modify the...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29021 (cherry picked from commit 0dcde5cc12744e5188300711a8829e5e6a9cd0de) --- sbin/growfs/growfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index d1098210f088..510192dada0b 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1461,10 +1461,9 @@ main(int argc, char **argv) } } /* - * Check for unclean filesystem. + * Check for filesystem that was unclean at mount time. */ - if (fs->fs_clean == 0 || - (fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) + if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) errx(1, "%s is not clean - run fsck.\n", *argv); memcpy(&osblock, fs, fs->fs_sbsize); free(fs); From owner-dev-commits-src-all@freebsd.org Sat Mar 6 01:13:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE69356DEC0; Sat, 6 Mar 2021 01:13: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 4Dsmnj4cCHz4VtX; Sat, 6 Mar 2021 01:13: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 8F33D1A7DF; Sat, 6 Mar 2021 01:13: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 1261DTRb053758; Sat, 6 Mar 2021 01:13:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1261DTUV053757; Sat, 6 Mar 2021 01:13:29 GMT (envelope-from git) Date: Sat, 6 Mar 2021 01:13:29 GMT Message-Id: <202103060113.1261DTUV053757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 56d80e35a333 - stable/12 - growfs: allow operation on RW-mounted filesystems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 56d80e35a3338e10e7670823f264cd82443c9d1e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 01:13:29 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=56d80e35a3338e10e7670823f264cd82443c9d1e commit 56d80e35a3338e10e7670823f264cd82443c9d1e Author: Ed Maste AuthorDate: 2021-03-02 22:35:48 +0000 Commit: Ed Maste CommitDate: 2021-03-06 01:13:09 +0000 growfs: allow operation on RW-mounted filesystems growfs supports growing mounted filesystems (writes are temporarily suspended while the grow happens). Drop the check for fs_clean == 0 to restore this case. Leave fs_flags check for FS_UNCLEAN or FS_NEEDSFSCK which represent the state of the filesystem when it was mounted, and fsck should be run first if they are set. PR: 253754 Reviewed by: mckusick Fixes: 6eb925f8450f ("Filesystem utilities that modify the...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29021 (cherry picked from commit 0dcde5cc12744e5188300711a8829e5e6a9cd0de) --- sbin/growfs/growfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 919ce86cc7b6..d1e42ed7c3d0 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1443,10 +1443,9 @@ main(int argc, char **argv) } } /* - * Check for unclean filesystem. + * Check for filesystem that was unclean at mount time. */ - if (fs->fs_clean == 0 || - (fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) + if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) errx(1, "%s is not clean - run fsck.\n", *argv); memcpy(&osblock, fs, fs->fs_sbsize); free(fs); From owner-dev-commits-src-all@freebsd.org Sat Mar 6 01:39:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A98DF56FB28; Sat, 6 Mar 2021 01:39: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 4DsnMx4RCqz4Y2g; Sat, 6 Mar 2021 01:39: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 8ABE81AC55; Sat, 6 Mar 2021 01:39: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 1261df4I081178; Sat, 6 Mar 2021 01:39:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1261dfjD081177; Sat, 6 Mar 2021 01:39:41 GMT (envelope-from git) Date: Sat, 6 Mar 2021 01:39:41 GMT Message-Id: <202103060139.1261dfjD081177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: d08b8680e12a - main - ice(4): Update to version 0.28.1-k MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d08b8680e12ad692736c84238dcf45c70c228914 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 01:39:41 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=d08b8680e12ad692736c84238dcf45c70c228914 commit d08b8680e12ad692736c84238dcf45c70c228914 Author: Eric Joyner AuthorDate: 2021-02-23 01:45:09 +0000 Commit: Eric Joyner CommitDate: 2021-03-06 01:33:39 +0000 ice(4): Update to version 0.28.1-k This updates the driver to align with the version included in the "Intel Ethernet Adapter Complete Driver Pack", version 25.6. There are no major functional changes; this mostly contains bug fixes and changes to prepare for new features. This version of the driver uses the previously committed ice_ddp package 1.3.19.0. Signed-off-by: Eric Joyner Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D28640 --- sys/conf/files.amd64 | 2 + sys/conf/files.arm64 | 2 + sys/dev/ice/ice_adminq_cmd.h | 107 ++-- sys/dev/ice/ice_alloc.h | 2 +- sys/dev/ice/ice_bitops.h | 4 +- sys/dev/ice/ice_common.c | 135 ++--- sys/dev/ice/ice_common.h | 17 +- sys/dev/ice/ice_common_sysctls.h | 2 +- sys/dev/ice/ice_common_txrx.h | 2 +- sys/dev/ice/ice_controlq.c | 2 +- sys/dev/ice/ice_controlq.h | 6 +- sys/dev/ice/ice_dcb.c | 40 +- sys/dev/ice/ice_dcb.h | 2 +- sys/dev/ice/ice_devids.h | 2 +- sys/dev/ice/ice_drv_info.h | 27 +- sys/dev/ice/ice_features.h | 2 +- sys/dev/ice/ice_flex_pipe.c | 57 +- sys/dev/ice/ice_flex_pipe.h | 2 +- sys/dev/ice/ice_flex_type.h | 11 +- sys/dev/ice/ice_flow.c | 243 +++++---- sys/dev/ice/ice_flow.h | 36 +- sys/dev/ice/ice_hw_autogen.h | 2 +- sys/dev/ice/ice_iflib.h | 2 +- sys/dev/ice/ice_iflib_recovery_txrx.c | 2 +- sys/dev/ice/ice_iflib_sysctls.h | 2 +- sys/dev/ice/ice_iflib_txrx.c | 2 +- sys/dev/ice/ice_lan_tx_rx.h | 2 +- sys/dev/ice/ice_lib.c | 56 +- sys/dev/ice/ice_lib.h | 2 +- sys/dev/ice/ice_nvm.c | 954 +++++++++++++++++++++++++++++----- sys/dev/ice/ice_nvm.h | 24 +- sys/dev/ice/ice_opts.h | 2 +- sys/dev/ice/ice_osdep.c | 2 +- sys/dev/ice/ice_osdep.h | 2 +- sys/dev/ice/ice_protocol_type.h | 27 +- sys/dev/ice/ice_resmgr.c | 2 +- sys/dev/ice/ice_resmgr.h | 2 +- sys/dev/ice/ice_rss.h | 2 +- sys/dev/ice/ice_sbq_cmd.h | 2 +- sys/dev/ice/ice_sched.c | 562 ++++++++++++-------- sys/dev/ice/ice_sched.h | 31 +- sys/dev/ice/ice_sriov.c | 407 ++++++++++++++- sys/dev/ice/ice_sriov.h | 23 +- sys/dev/ice/ice_status.h | 2 +- sys/dev/ice/ice_strings.c | 2 +- sys/dev/ice/ice_switch.c | 70 ++- sys/dev/ice/ice_switch.h | 4 +- sys/dev/ice/ice_type.h | 266 ++++++++-- sys/dev/ice/ice_vlan_mode.c | 72 +++ sys/dev/ice/ice_vlan_mode.h | 60 +++ sys/dev/ice/if_ice_iflib.c | 2 +- sys/dev/ice/virtchnl.h | 287 +++++++++- sys/dev/ice/virtchnl_inline_ipsec.h | 16 +- sys/modules/ice/Makefile | 2 +- 54 files changed, 2881 insertions(+), 717 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index c5421f4af4fc..00362da407cb 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -191,6 +191,8 @@ dev/ice/ice_sriov.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_vlan_mode.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 0286ae57b0e0..dd1d96c49aba 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -205,6 +205,8 @@ dev/ice/ice_sriov.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_vlan_mode.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index 8d8c025fdd37..9179b0ce1226 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -166,6 +166,7 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_LOGI_TO_PHYSI_PORT_MAP 0x0073 #define ICE_AQC_CAPS_SKU 0x0074 #define ICE_AQC_CAPS_PORT_MAP 0x0075 +#define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076 #define ICE_AQC_CAPS_NVM_MGMT 0x0080 u8 major_ver; @@ -1449,6 +1450,7 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_ACT_PORT_OPT_INVAL BIT(2) #define ICE_AQ_LINK_FEAT_ID_OR_CONFIG_ID_INVAL BIT(3) #define ICE_AQ_LINK_TOPO_CRITICAL_SDP_ERR BIT(4) +#define ICE_AQ_LINK_MODULE_POWER_UNSUPPORTED BIT(5) u8 link_info; #define ICE_AQ_LINK_UP BIT(0) /* Link Status */ #define ICE_AQ_LINK_FAULT BIT(1) @@ -1496,7 +1498,7 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_CFG_PACING_TYPE_FIXED ICE_AQ_CFG_PACING_TYPE_M /* External Device Power Ability */ u8 power_desc; -#define ICE_AQ_PWR_CLASS_M 0x3 +#define ICE_AQ_PWR_CLASS_M 0x3F #define ICE_AQ_LINK_PWR_BASET_LOW_HIGH 0 #define ICE_AQ_LINK_PWR_BASET_HIGH 1 #define ICE_AQ_LINK_PWR_QSFP_CLASS_1 0 @@ -1860,7 +1862,9 @@ struct ice_aqc_mdio { #define ICE_AQC_MDIO_DEV_M (0x1F << ICE_AQC_MDIO_DEV_S) #define ICE_AQC_MDIO_CLAUSE_22 BIT(5) #define ICE_AQC_MDIO_CLAUSE_45 BIT(6) - u8 rsvd; + u8 mdio_bus_address; +#define ICE_AQC_MDIO_BUS_ADDR_S 0 +#define ICE_AQC_MDIO_BUS_ADDR_M (0x1F << ICE_AQC_MDIO_BUS_ADDR_S) __le16 offset; __le16 data; /* Input in write cmd, output in read cmd. */ u8 rsvd1[4]; @@ -2001,6 +2005,22 @@ struct ice_aqc_sff_eeprom { __le32 addr_low; }; +/* SW Set GPIO command (indirect 0x6EF) + * SW Get GPIO command (indirect 0x6F0) + */ +struct ice_aqc_sw_gpio { + __le16 gpio_ctrl_handle; +#define ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_S 0 +#define ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_M (0x3FF << ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_S) + u8 gpio_num; +#define ICE_AQC_SW_GPIO_NUMBER_S 0 +#define ICE_AQC_SW_GPIO_NUMBER_M (0x1F << ICE_AQC_SW_GPIO_NUMBER_S) + u8 gpio_params; +#define ICE_AQC_SW_GPIO_PARAMS_DIRECTION BIT(1) +#define ICE_AQC_SW_GPIO_PARAMS_VALUE BIT(0) + u8 rsvd[12]; +}; + /* NVM Read command (indirect 0x0701) * NVM Erase commands (direct 0x0702) * NVM Write commands (indirect 0x0703) @@ -2027,6 +2047,9 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_REVERT_LAST_ACTIV BIT(6) /* Write Activate only */ #define ICE_AQC_NVM_ACTIV_SEL_MASK MAKEMASK(0x7, 3) #define ICE_AQC_NVM_FLASH_ONLY BIT(7) +#define ICE_AQC_NVM_POR_FLAG 0 /* Used by NVM Write completion on ARQ */ +#define ICE_AQC_NVM_PERST_FLAG 1 +#define ICE_AQC_NVM_EMPR_FLAG 2 __le16 module_typeid; __le16 length; #define ICE_AQC_NVM_ERASE_LEN 0xFFFF @@ -2056,32 +2079,22 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LLDP_STATUS_M_LEN 4 /* In Bits */ #define ICE_AQC_NVM_LLDP_STATUS_RD_LEN 4 /* In Bytes */ -/* The result of netlist NVM read comes in a TLV format. The actual data - * (netlist header) starts from word offset 1 (byte 2). The FW strips - * out the type field from the TLV header so all the netlist fields - * should adjust their offset value by 1 word (2 bytes) in order to map - * their correct location. +#define ICE_AQC_NVM_MINSREV_MOD_ID 0x130 + +/* Used for reading and writing MinSRev using 0x0701 and 0x0703. Note that the + * type field is excluded from the section when reading and writing from + * a module using the module_typeid field with these AQ commands. */ -#define ICE_AQC_NVM_LINK_TOPO_NETLIST_MOD_ID 0x11B -#define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN_OFFSET 1 -#define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN 2 /* In bytes */ -#define ICE_AQC_NVM_NETLIST_NODE_COUNT_OFFSET 2 -#define ICE_AQC_NVM_NETLIST_NODE_COUNT_LEN 2 /* In bytes */ -#define ICE_AQC_NVM_NETLIST_NODE_COUNT_M MAKEMASK(0x3FF, 0) -#define ICE_AQC_NVM_NETLIST_ID_BLK_START_OFFSET 5 -#define ICE_AQC_NVM_NETLIST_ID_BLK_LEN 0x30 /* In words */ - -/* netlist ID block field offsets (word offsets) */ -#define ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_LOW 2 -#define ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_HIGH 3 -#define ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_LOW 4 -#define ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_HIGH 5 -#define ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_LOW 6 -#define ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_HIGH 7 -#define ICE_AQC_NVM_NETLIST_ID_BLK_REV_LOW 8 -#define ICE_AQC_NVM_NETLIST_ID_BLK_REV_HIGH 9 -#define ICE_AQC_NVM_NETLIST_ID_BLK_SHA_HASH 0xA -#define ICE_AQC_NVM_NETLIST_ID_BLK_CUST_VER 0x2F +struct ice_aqc_nvm_minsrev { + __le16 length; + __le16 validity; +#define ICE_AQC_NVM_MINSREV_NVM_VALID BIT(0) +#define ICE_AQC_NVM_MINSREV_OROM_VALID BIT(1) + __le16 nvm_minsrev_l; + __le16 nvm_minsrev_h; + __le16 orom_minsrev_l; + __le16 orom_minsrev_h; +}; /* Used for 0x0704 as well as for 0x0705 commands */ struct ice_aqc_nvm_cfg { @@ -2114,7 +2127,7 @@ struct ice_aqc_nvm_checksum { u8 rsvd2[12]; }; -/** +/* * Send to PF command (indirect 0x0801) ID is only used by PF * * Send to VF command (indirect 0x0802) ID is only used by PF @@ -2541,6 +2554,7 @@ struct ice_pkg_ver { }; #define ICE_PKG_NAME_SIZE 32 +#define ICE_SEG_ID_SIZE 28 #define ICE_SEG_NAME_SIZE 28 struct ice_aqc_get_pkg_info { @@ -2589,6 +2603,35 @@ struct ice_aqc_set_health_status_config { u8 reserved[15]; }; +#define ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_STRICT 0x101 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_TYPE 0x102 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_QUAL 0x103 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_COMM 0x104 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_CONFLICT 0x105 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_NOT_PRESENT 0x106 +#define ICE_AQC_HEALTH_STATUS_INFO_MOD_UNDERUTILIZED 0x107 +#define ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_LENIENT 0x108 +#define ICE_AQC_HEALTH_STATUS_ERR_INVALID_LINK_CFG 0x10B +#define ICE_AQC_HEALTH_STATUS_ERR_PORT_ACCESS 0x10C +#define ICE_AQC_HEALTH_STATUS_ERR_PORT_UNREACHABLE 0x10D +#define ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_MOD_LIMITED 0x10F +#define ICE_AQC_HEALTH_STATUS_ERR_PARALLEL_FAULT 0x110 +#define ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_PHY_LIMITED 0x111 +#define ICE_AQC_HEALTH_STATUS_ERR_NETLIST_TOPO 0x112 +#define ICE_AQC_HEALTH_STATUS_ERR_NETLIST 0x113 +#define ICE_AQC_HEALTH_STATUS_ERR_TOPO_CONFLICT 0x114 +#define ICE_AQC_HEALTH_STATUS_ERR_LINK_HW_ACCESS 0x115 +#define ICE_AQC_HEALTH_STATUS_ERR_LINK_RUNTIME 0x116 +#define ICE_AQC_HEALTH_STATUS_ERR_DNL_INIT 0x117 +#define ICE_AQC_HEALTH_STATUS_INFO_RECOVERY 0x500 +#define ICE_AQC_HEALTH_STATUS_ERR_FLASH_ACCESS 0x501 +#define ICE_AQC_HEALTH_STATUS_ERR_NVM_AUTH 0x502 +#define ICE_AQC_HEALTH_STATUS_ERR_OROM_AUTH 0x503 +#define ICE_AQC_HEALTH_STATUS_ERR_DDP_AUTH 0x504 +#define ICE_AQC_HEALTH_STATUS_ERR_NVM_COMPAT 0x505 +#define ICE_AQC_HEALTH_STATUS_ERR_OROM_COMPAT 0x506 +#define ICE_AQC_HEALTH_STATUS_ERR_DCB_MIB 0x509 + /* Get Health Status codes (indirect 0xFF21) */ struct ice_aqc_get_supported_health_status_codes { __le16 health_code_count; @@ -2630,8 +2673,8 @@ struct ice_aqc_clear_health_status { * @opcode: AQ command opcode * @datalen: length in bytes of indirect/external data buffer * @retval: return value from firmware - * @cookie_h: opaque data high-half - * @cookie_l: opaque data low-half + * @cookie_high: opaque data high-half + * @cookie_low: opaque data low-half * @params: command-specific parameters * * Descriptor format for commands the driver posts on the Admin Transmit Queue @@ -2920,6 +2963,8 @@ enum ice_adminq_opc { ice_aqc_opc_set_gpio = 0x06EC, ice_aqc_opc_get_gpio = 0x06ED, ice_aqc_opc_sff_eeprom = 0x06EE, + ice_aqc_opc_sw_set_gpio = 0x06EF, + ice_aqc_opc_sw_get_gpio = 0x06F0, /* NVM commands */ ice_aqc_opc_nvm_read = 0x0701, diff --git a/sys/dev/ice/ice_alloc.h b/sys/dev/ice/ice_alloc.h index 1d9b9169eb02..b281958be793 100644 --- a/sys/dev/ice/ice_alloc.h +++ b/sys/dev/ice/ice_alloc.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index 7c8cf6cb90f5..a7f729060b78 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -423,7 +423,7 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) { u16 i; - for (i = pos; i < num_bits; i++) + for (i = pos; i < pos + num_bits; i++) ice_set_bit(i, dst); } diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index 20689f4893d4..5e2e4340c75c 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -265,7 +265,7 @@ ice_aq_get_link_topo_handle(struct ice_port_info *pi, u8 node_type, return ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd); } -/* +/** * ice_is_media_cage_present * @pi: port information structure * @@ -704,13 +704,14 @@ static void ice_get_itr_intrl_gran(struct ice_hw *hw) void ice_print_rollback_msg(struct ice_hw *hw) { char nvm_str[ICE_NVM_VER_LEN] = { 0 }; - struct ice_nvm_info *nvm = &hw->nvm; struct ice_orom_info *orom; + struct ice_nvm_info *nvm; - orom = &nvm->orom; + orom = &hw->flash.orom; + nvm = &hw->flash.nvm; SNPRINTF(nvm_str, sizeof(nvm_str), "%x.%02x 0x%x %d.%d.%d", - nvm->major_ver, nvm->minor_ver, nvm->eetrack, orom->major, + nvm->major, nvm->minor, nvm->eetrack, orom->major, orom->build, orom->patch); ice_warn(hw, "Firmware rollback mode detected. Current version is NVM: %s, FW: %d.%d. Device may exhibit limited functionality. Refer to the Intel(R) Ethernet Adapters and Devices User Guide for details on firmware rollback mode\n", @@ -805,8 +806,7 @@ enum ice_status ice_init_hw(struct ice_hw *hw) ICE_AQC_REPORT_TOPO_CAP, pcaps, NULL); ice_free(hw, pcaps); if (status) - ice_debug(hw, ICE_DBG_PHY, "%s: Get PHY capabilities failed, continuing anyway\n", - __func__); + ice_debug(hw, ICE_DBG_PHY, "Get PHY capabilities failed, continuing anyway\n"); /* Initialize port_info struct with link information */ status = ice_aq_get_link_info(hw->port_info, false, NULL, NULL); @@ -850,6 +850,9 @@ enum ice_status ice_init_hw(struct ice_hw *hw) if (status) goto err_unroll_fltr_mgmt_struct; ice_init_lock(&hw->tnl_lock); + + ice_init_vlan_mode_ops(hw); + return ICE_SUCCESS; err_unroll_fltr_mgmt_struct: @@ -1701,7 +1704,7 @@ ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries, if (!buf) return ICE_ERR_PARAM; - if (buf_size < (num_entries * sizeof(buf->elem[0]))) + if (buf_size < FLEX_ARRAY_SIZE(buf, elem, num_entries)) return ICE_ERR_PARAM; ice_fill_dflt_direct_cmd_desc(&desc, opc); @@ -1982,6 +1985,16 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, case ICE_AQC_CAPS_NVM_VER: break; case ICE_AQC_CAPS_NVM_MGMT: + caps->sec_rev_disabled = + (number & ICE_NVM_MGMT_SEC_REV_DISABLED) ? + true : false; + ice_debug(hw, ICE_DBG_INIT, "%s: sec_rev_disabled = %d\n", prefix, + caps->sec_rev_disabled); + caps->update_disabled = + (number & ICE_NVM_MGMT_UPDATE_DISABLED) ? + true : false; + ice_debug(hw, ICE_DBG_INIT, "%s: update_disabled = %d\n", prefix, + caps->update_disabled); caps->nvm_unified_update = (number & ICE_NVM_MGMT_UNIFIED_UPD_SUPPORT) ? true : false; @@ -2389,26 +2402,25 @@ void ice_set_safe_mode_caps(struct ice_hw *hw) { struct ice_hw_func_caps *func_caps = &hw->func_caps; struct ice_hw_dev_caps *dev_caps = &hw->dev_caps; - u32 valid_func, rxq_first_id, txq_first_id; - u32 msix_vector_first_id, max_mtu; + struct ice_hw_common_caps cached_caps; u32 num_funcs; /* cache some func_caps values that should be restored after memset */ - valid_func = func_caps->common_cap.valid_functions; - txq_first_id = func_caps->common_cap.txq_first_id; - rxq_first_id = func_caps->common_cap.rxq_first_id; - msix_vector_first_id = func_caps->common_cap.msix_vector_first_id; - max_mtu = func_caps->common_cap.max_mtu; + cached_caps = func_caps->common_cap; /* unset func capabilities */ memset(func_caps, 0, sizeof(*func_caps)); +#define ICE_RESTORE_FUNC_CAP(name) \ + func_caps->common_cap.name = cached_caps.name + /* restore cached values */ - func_caps->common_cap.valid_functions = valid_func; - func_caps->common_cap.txq_first_id = txq_first_id; - func_caps->common_cap.rxq_first_id = rxq_first_id; - func_caps->common_cap.msix_vector_first_id = msix_vector_first_id; - func_caps->common_cap.max_mtu = max_mtu; + ICE_RESTORE_FUNC_CAP(valid_functions); + ICE_RESTORE_FUNC_CAP(txq_first_id); + ICE_RESTORE_FUNC_CAP(rxq_first_id); + ICE_RESTORE_FUNC_CAP(msix_vector_first_id); + ICE_RESTORE_FUNC_CAP(max_mtu); + ICE_RESTORE_FUNC_CAP(nvm_unified_update); /* one Tx and one Rx queue in safe mode */ func_caps->common_cap.num_rxq = 1; @@ -2419,22 +2431,22 @@ void ice_set_safe_mode_caps(struct ice_hw *hw) func_caps->guar_num_vsi = 1; /* cache some dev_caps values that should be restored after memset */ - valid_func = dev_caps->common_cap.valid_functions; - txq_first_id = dev_caps->common_cap.txq_first_id; - rxq_first_id = dev_caps->common_cap.rxq_first_id; - msix_vector_first_id = dev_caps->common_cap.msix_vector_first_id; - max_mtu = dev_caps->common_cap.max_mtu; + cached_caps = dev_caps->common_cap; num_funcs = dev_caps->num_funcs; /* unset dev capabilities */ memset(dev_caps, 0, sizeof(*dev_caps)); +#define ICE_RESTORE_DEV_CAP(name) \ + dev_caps->common_cap.name = cached_caps.name + /* restore cached values */ - dev_caps->common_cap.valid_functions = valid_func; - dev_caps->common_cap.txq_first_id = txq_first_id; - dev_caps->common_cap.rxq_first_id = rxq_first_id; - dev_caps->common_cap.msix_vector_first_id = msix_vector_first_id; - dev_caps->common_cap.max_mtu = max_mtu; + ICE_RESTORE_DEV_CAP(valid_functions); + ICE_RESTORE_DEV_CAP(txq_first_id); + ICE_RESTORE_DEV_CAP(rxq_first_id); + ICE_RESTORE_DEV_CAP(msix_vector_first_id); + ICE_RESTORE_DEV_CAP(max_mtu); + ICE_RESTORE_DEV_CAP(nvm_unified_update); dev_caps->num_funcs = num_funcs; /* one Tx and one Rx queue per function in safe mode */ @@ -2480,7 +2492,7 @@ ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_manage_mac_write); cmd->flags = flags; - ice_memcpy(cmd->mac_addr, mac_addr, ETH_ALEN, ICE_NONDMA_TO_DMA); + ice_memcpy(cmd->mac_addr, mac_addr, ETH_ALEN, ICE_NONDMA_TO_NONDMA); return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); } @@ -2816,6 +2828,11 @@ enum ice_status ice_update_link_info(struct ice_port_info *pi) status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP, pcaps, NULL); + if (status == ICE_SUCCESS) + ice_memcpy(li->module_type, &pcaps->module_type, + sizeof(li->module_type), + ICE_NONDMA_TO_NONDMA); + ice_free(hw, pcaps); } @@ -3379,7 +3396,7 @@ ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_sff_eeprom); cmd = &desc.params.read_write_sff_param; - desc.flags = CPU_TO_LE16(ICE_AQ_FLAG_RD | ICE_AQ_FLAG_BUF); + desc.flags = CPU_TO_LE16(ICE_AQ_FLAG_RD); cmd->lport_num = (u8)(lport & 0xff); cmd->lport_num_valid = (u8)((lport >> 8) & 0x01); cmd->i2c_bus_addr = CPU_TO_LE16(((bus_addr >> 1) & @@ -3399,23 +3416,33 @@ ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, /** * __ice_aq_get_set_rss_lut * @hw: pointer to the hardware structure - * @vsi_id: VSI FW index - * @lut_type: LUT table type - * @lut: pointer to the LUT buffer provided by the caller - * @lut_size: size of the LUT buffer - * @glob_lut_idx: global LUT index + * @params: RSS LUT parameters * @set: set true to set the table, false to get the table * * Internal function to get (0x0B05) or set (0x0B03) RSS look up table */ static enum ice_status -__ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut, - u16 lut_size, u8 glob_lut_idx, bool set) +__ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *params, bool set) { + u16 flags = 0, vsi_id, lut_type, lut_size, glob_lut_idx, vsi_handle; struct ice_aqc_get_set_rss_lut *cmd_resp; struct ice_aq_desc desc; enum ice_status status; - u16 flags = 0; + u8 *lut; + + if (!params) + return ICE_ERR_PARAM; + + vsi_handle = params->vsi_handle; + lut = params->lut; + + if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) + return ICE_ERR_PARAM; + + lut_size = params->lut_size; + lut_type = params->lut_type; + glob_lut_idx = params->global_lut_id; + vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); cmd_resp = &desc.params.get_set_rss_lut; @@ -3492,43 +3519,27 @@ ice_aq_get_set_rss_lut_exit: /** * ice_aq_get_rss_lut * @hw: pointer to the hardware structure - * @vsi_handle: software VSI handle - * @lut_type: LUT table type - * @lut: pointer to the LUT buffer provided by the caller - * @lut_size: size of the LUT buffer + * @get_params: RSS LUT parameters used to specify which RSS LUT to get * * get the RSS lookup table, PF or VSI type */ enum ice_status -ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, - u8 *lut, u16 lut_size) +ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params) { - if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) - return ICE_ERR_PARAM; - - return __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle), - lut_type, lut, lut_size, 0, false); + return __ice_aq_get_set_rss_lut(hw, get_params, false); } /** * ice_aq_set_rss_lut * @hw: pointer to the hardware structure - * @vsi_handle: software VSI handle - * @lut_type: LUT table type - * @lut: pointer to the LUT buffer provided by the caller - * @lut_size: size of the LUT buffer + * @set_params: RSS LUT parameters used to specify how to set the RSS LUT * * set the RSS lookup table, PF or VSI type */ enum ice_status -ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, - u8 *lut, u16 lut_size) +ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params) { - if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) - return ICE_ERR_PARAM; - - return __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle), - lut_type, lut, lut_size, 0, true); + return __ice_aq_get_set_rss_lut(hw, set_params, true); } /** diff --git a/sys/dev/ice/ice_common.h b/sys/dev/ice/ice_common.h index 84a39b7e9b8a..3a28816fb131 100644 --- a/sys/dev/ice/ice_common.h +++ b/sys/dev/ice/ice_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,11 +117,9 @@ ice_write_tx_drbell_q_ctx(struct ice_hw *hw, u32 tx_drbell_q_index); enum ice_status -ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut, - u16 lut_size); +ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params); enum ice_status -ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut, - u16 lut_size); +ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params); enum ice_status ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle, struct ice_aqc_get_set_rss_keys *keys); @@ -240,13 +238,6 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, struct ice_sq_cd *cd); enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle); void ice_replay_post(struct ice_hw *hw); -void ice_sched_replay_agg_vsi_preinit(struct ice_hw *hw); -void ice_sched_replay_agg(struct ice_hw *hw); -enum ice_status ice_sched_replay_tc_node_bw(struct ice_port_info *pi); -enum ice_status ice_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle); -enum ice_status ice_sched_replay_root_node_bw(struct ice_port_info *pi); -enum ice_status -ice_sched_replay_q_bw(struct ice_port_info *pi, struct ice_q_ctx *q_ctx); struct ice_q_ctx * ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle); void @@ -277,7 +268,7 @@ enum ice_status ice_get_cur_lldp_persist_status(struct ice_hw *hw, u32 *lldp_status); enum ice_status ice_get_dflt_lldp_persist_status(struct ice_hw *hw, u32 *lldp_status); -enum ice_status ice_get_netlist_ver_info(struct ice_hw *hw); +enum ice_status ice_get_netlist_ver_info(struct ice_hw *hw, struct ice_netlist_info *netlist); enum ice_status ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, struct ice_sq_cd *cd); diff --git a/sys/dev/ice/ice_common_sysctls.h b/sys/dev/ice/ice_common_sysctls.h index 82ead3fcfecc..17c2fce72ee7 100644 --- a/sys/dev/ice/ice_common_sysctls.h +++ b/sys/dev/ice/ice_common_sysctls.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_common_txrx.h b/sys/dev/ice/ice_common_txrx.h index 8fb3d49288d8..d5e6182c2212 100644 --- a/sys/dev/ice/ice_common_txrx.h +++ b/sys/dev/ice/ice_common_txrx.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c index 3caab15e0e41..ee8d7f5c3e8f 100644 --- a/sys/dev/ice/ice_controlq.c +++ b/sys/dev/ice/ice_controlq.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.h b/sys/dev/ice/ice_controlq.h index 0da6b025fc8c..947f1d6d1767 100644 --- a/sys/dev/ice/ice_controlq.h +++ b/sys/dev/ice/ice_controlq.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,8 +60,8 @@ enum ice_ctl_q { ICE_CTL_Q_MAILBOX, }; -/* Control Queue timeout settings - max delay 250ms */ -#define ICE_CTL_Q_SQ_CMD_TIMEOUT 2500 /* Count 2500 times */ +/* Control Queue timeout settings - max delay 1s */ +#define ICE_CTL_Q_SQ_CMD_TIMEOUT 10000 /* Count 10000 times */ #define ICE_CTL_Q_SQ_CMD_USEC 100 /* Check every 100usec */ #define ICE_CTL_Q_ADMIN_INIT_TIMEOUT 10 /* Count 10 times */ #define ICE_CTL_Q_ADMIN_INIT_MSEC 100 /* Check every 100msec */ diff --git a/sys/dev/ice/ice_dcb.c b/sys/dev/ice/ice_dcb.c index b6275c5d07e8..abe0237eb88f 100644 --- a/sys/dev/ice/ice_dcb.c +++ b/sys/dev/ice/ice_dcb.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -994,22 +994,27 @@ ice_aq_set_dcb_parameters(struct ice_hw *hw, bool dcb_enable, /** * ice_cee_to_dcb_cfg * @cee_cfg: pointer to CEE configuration struct - * @dcbcfg: DCB configuration struct + * @pi: port information structure * * Convert CEE configuration from firmware to DCB configuration */ static void ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, - struct ice_dcbx_cfg *dcbcfg) + struct ice_port_info *pi) { u32 status, tlv_status = LE32_TO_CPU(cee_cfg->tlv_status); u32 ice_aqc_cee_status_mask, ice_aqc_cee_status_shift; + u8 i, j, err, sync, oper, app_index, ice_app_sel_type; u16 app_prio = LE16_TO_CPU(cee_cfg->oper_app_prio); - u8 i, err, sync, oper, app_index, ice_app_sel_type; u16 ice_aqc_cee_app_mask, ice_aqc_cee_app_shift; + struct ice_dcbx_cfg *cmp_dcbcfg, *dcbcfg; u16 ice_app_prot_id_type; - /* CEE PG data to ETS config */ + dcbcfg = &pi->qos_cfg.local_dcbx_cfg; + dcbcfg->dcbx_mode = ICE_DCBX_MODE_CEE; + dcbcfg->tlv_status = tlv_status; + + /* CEE PG data */ dcbcfg->etscfg.maxtcs = cee_cfg->oper_num_tc; /* Note that the FW creates the oper_prio_tc nibbles reversed @@ -1036,10 +1041,16 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, } } - /* CEE PFC data to ETS config */ + /* CEE PFC data */ dcbcfg->pfc.pfcena = cee_cfg->oper_pfc_en; dcbcfg->pfc.pfccap = ICE_MAX_TRAFFIC_CLASS; + /* CEE APP TLV data */ + if (dcbcfg->app_mode == ICE_DCBX_APPS_NON_WILLING) + cmp_dcbcfg = &pi->qos_cfg.desired_dcbx_cfg; + else + cmp_dcbcfg = &pi->qos_cfg.remote_dcbx_cfg; + app_index = 0; for (i = 0; i < 3; i++) { if (i == 0) { @@ -1058,6 +1069,18 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, ice_aqc_cee_app_shift = ICE_AQC_CEE_APP_ISCSI_S; ice_app_sel_type = ICE_APP_SEL_TCPIP; ice_app_prot_id_type = ICE_APP_PROT_ID_ISCSI; + + for (j = 0; j < cmp_dcbcfg->numapps; j++) { + u16 prot_id = cmp_dcbcfg->app[j].prot_id; + u8 sel = cmp_dcbcfg->app[j].selector; + + if (sel == ICE_APP_SEL_TCPIP && + (prot_id == ICE_APP_PROT_ID_ISCSI || + prot_id == ICE_APP_PROT_ID_ISCSI_860)) { + ice_app_prot_id_type = prot_id; + break; + } + } } else { /* FIP APP */ ice_aqc_cee_status_mask = ICE_AQC_CEE_FIP_STATUS_M; @@ -1148,11 +1171,8 @@ enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi) ret = ice_aq_get_cee_dcb_cfg(pi->hw, &cee_cfg, NULL); if (ret == ICE_SUCCESS) { /* CEE mode */ - dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; - dcbx_cfg->dcbx_mode = ICE_DCBX_MODE_CEE; - dcbx_cfg->tlv_status = LE32_TO_CPU(cee_cfg.tlv_status); - ice_cee_to_dcb_cfg(&cee_cfg, dcbx_cfg); ret = ice_get_ieee_or_cee_dcb_cfg(pi, ICE_DCBX_MODE_CEE); + ice_cee_to_dcb_cfg(&cee_cfg, pi); } else if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) { /* CEE mode not enabled try querying IEEE data */ dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; diff --git a/sys/dev/ice/ice_dcb.h b/sys/dev/ice/ice_dcb.h index 88c49c89fbd2..85d6b399cf11 100644 --- a/sys/dev/ice/ice_dcb.h +++ b/sys/dev/ice/ice_dcb.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_devids.h b/sys/dev/ice/ice_devids.h index a110133823df..8611fc170816 100644 --- a/sys/dev/ice/ice_devids.h +++ b/sys/dev/ice/ice_devids.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 9ed3e3e2fb0e..340d53e4a671 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,16 +63,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "0.26.16-k"; +const char ice_driver_version[] = "0.28.1-k"; const uint8_t ice_major_version = 0; -const uint8_t ice_minor_version = 26; -const uint8_t ice_patch_version = 16; +const uint8_t ice_minor_version = 28; +const uint8_t ice_patch_version = 1; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 0.26.16-k") + PVID(vendor, devid, name " - 0.28.1-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 0.26.16-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 0.28.1-k") /** * @var ice_vendor_info_array @@ -113,20 +113,11 @@ static pci_vendor_info_t ice_vendor_info_array[] = { PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP, ICE_INTEL_VENDOR_ID, 0x0008, 0, "Intel(R) Ethernet Network Adapter E810-C-Q2 for OCP3.0"), + PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP, + ICE_INTEL_VENDOR_ID, 0x000D, 0, + "Intel(R) Ethernet Network Adapter E810-L-Q2 for OCP3.0"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP, "Intel(R) Ethernet Controller E810-C for QSFP"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0001, 0, - "Intel(R) Ethernet Network Adapter E810-L-1"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0002, 0, - "Intel(R) Ethernet Network Adapter E810-L-2"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0003, 0, - "Intel(R) Ethernet Network Adapter E810-L-1"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0004, 0, - "Intel(R) Ethernet Network Adapter E810-L-2"), PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, ICE_INTEL_VENDOR_ID, 0x0005, 0, "Intel(R) Ethernet Network Adapter E810-XXV-4"), diff --git a/sys/dev/ice/ice_features.h b/sys/dev/ice/ice_features.h index f5ea542d8626..dcb096509f73 100644 --- a/sys/dev/ice/ice_features.h +++ b/sys/dev/ice/ice_features.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_pipe.c b/sys/dev/ice/ice_flex_pipe.c index 6a02239eca5c..e8e4403a23fe 100644 --- a/sys/dev/ice/ice_flex_pipe.c +++ b/sys/dev/ice/ice_flex_pipe.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1057,6 +1057,13 @@ ice_dwnld_cfg_bufs(struct ice_hw *hw, struct ice_buf *bufs, u32 count) break; } + if (!status) { + status = ice_set_vlan_mode(hw); + if (status) + ice_debug(hw, ICE_DBG_PKG, "Failed to set VLAN mode: err %d\n", + status); + } + ice_release_global_cfg_lock(hw); return status; @@ -1126,34 +1133,40 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg) static enum ice_status ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr) { - struct ice_global_metadata_seg *meta_seg; struct ice_generic_seg_hdr *seg_hdr; ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); if (!pkg_hdr) return ICE_ERR_PARAM; - meta_seg = (struct ice_global_metadata_seg *) - ice_find_seg_in_pkg(hw, SEGMENT_TYPE_METADATA, pkg_hdr); - if (meta_seg) { - hw->pkg_ver = meta_seg->pkg_ver; - ice_memcpy(hw->pkg_name, meta_seg->pkg_name, - sizeof(hw->pkg_name), ICE_NONDMA_TO_NONDMA); + seg_hdr = (struct ice_generic_seg_hdr *) + ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr); + if (seg_hdr) { + struct ice_meta_sect *meta; + struct ice_pkg_enum state; + + ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM); + + /* Get package information from the Metadata Section */ + meta = (struct ice_meta_sect *) + ice_pkg_enum_section((struct ice_seg *)seg_hdr, &state, + ICE_SID_METADATA); + if (!meta) { + ice_debug(hw, ICE_DBG_INIT, "Did not find ice metadata section in package\n"); + return ICE_ERR_CFG; + } + + hw->pkg_ver = meta->ver; + ice_memcpy(hw->pkg_name, meta->name, sizeof(meta->name), + ICE_NONDMA_TO_NONDMA); ice_debug(hw, ICE_DBG_PKG, "Pkg: %d.%d.%d.%d, %s\n", - meta_seg->pkg_ver.major, meta_seg->pkg_ver.minor, - meta_seg->pkg_ver.update, meta_seg->pkg_ver.draft, - meta_seg->pkg_name); - } else { - ice_debug(hw, ICE_DBG_INIT, "Did not find metadata segment in driver package\n"); - return ICE_ERR_CFG; - } + meta->ver.major, meta->ver.minor, meta->ver.update, + meta->ver.draft, meta->name); - seg_hdr = ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr); - if (seg_hdr) { - hw->ice_pkg_ver = seg_hdr->seg_format_ver; - ice_memcpy(hw->ice_pkg_name, seg_hdr->seg_id, - sizeof(hw->ice_pkg_name), ICE_NONDMA_TO_NONDMA); + hw->ice_seg_fmt_ver = seg_hdr->seg_format_ver; + ice_memcpy(hw->ice_seg_id, seg_hdr->seg_id, + sizeof(hw->ice_seg_id), ICE_NONDMA_TO_NONDMA); ice_debug(hw, ICE_DBG_PKG, "Ice Seg: %d.%d.%d.%d, %s\n", *** 4742 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat Mar 6 01:44:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A03F56FC98; Sat, 6 Mar 2021 01: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 4DsnSx34Qpz4Yf8; Sat, 6 Mar 2021 01: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 5BCB51AF2F; Sat, 6 Mar 2021 01: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 1261i15U093307; Sat, 6 Mar 2021 01:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1261i1UM093306; Sat, 6 Mar 2021 01:44:01 GMT (envelope-from git) Date: Sat, 6 Mar 2021 01:44:01 GMT Message-Id: <202103060144.1261i1UM093306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 0bdc21952ae6 - stable/11 - arcmsr(4): Fixed no action of hot plugging device on type_F adapter. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 0bdc21952ae606b9f33fc455986f5a8cc61ab189 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 01:44:01 -0000 The branch stable/11 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=0bdc21952ae606b9f33fc455986f5a8cc61ab189 commit 0bdc21952ae606b9f33fc455986f5a8cc61ab189 Author: Xin LI AuthorDate: 2021-03-03 06:57:20 +0000 Commit: Xin LI CommitDate: 2021-03-06 01:43:42 +0000 arcmsr(4): Fixed no action of hot plugging device on type_F adapter. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 3 days (cherry picked from commit 5842073a9b7471831e0da48d29dd984d575f4e9e) --- sys/dev/arcmsr/arcmsr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index e228f358f480..c2027eb8e987 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -80,6 +80,7 @@ ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller +** 1.50.00.01 02/26/2021 Ching Huang Fixed no action of hot plugging device on type_F adapter ****************************************************************************************** */ @@ -137,7 +138,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.01 2021-02-26" #include /* ************************************************************************** @@ -1901,7 +1902,10 @@ static void arcmsr_hbe_message_isr(struct AdapterControlBlock *acb) { u_int32_t outbound_message; CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); - outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + if (acb->adapter_type == ACB_ADAPTER_TYPE_E) + outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + else + outbound_message = acb->msgcode_rwbuffer[0]; if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) arcmsr_dr_handle( acb ); } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 01:45:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9148356FEEE; Sat, 6 Mar 2021 01: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 4DsnVT3hW8z4Ylh; Sat, 6 Mar 2021 01: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 6708F1ADD7; Sat, 6 Mar 2021 01: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 1261jLFk093628; Sat, 6 Mar 2021 01: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 1261jLl4093627; Sat, 6 Mar 2021 01:45:21 GMT (envelope-from git) Date: Sat, 6 Mar 2021 01:45:21 GMT Message-Id: <202103060145.1261jLl4093627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 0824ed18916c - stable/12 - arcmsr(4): Fixed no action of hot plugging device on type_F adapter. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0824ed18916cf8310adf4d4754d1de7746f75d53 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 01:45:21 -0000 The branch stable/12 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=0824ed18916cf8310adf4d4754d1de7746f75d53 commit 0824ed18916cf8310adf4d4754d1de7746f75d53 Author: Xin LI AuthorDate: 2021-03-03 06:57:20 +0000 Commit: Xin LI CommitDate: 2021-03-06 01:45:02 +0000 arcmsr(4): Fixed no action of hot plugging device on type_F adapter. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 3 days (cherry picked from commit 5842073a9b7471831e0da48d29dd984d575f4e9e) --- sys/dev/arcmsr/arcmsr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index 8a250da05cab..16fe5ee959e6 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -82,6 +82,7 @@ ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller +** 1.50.00.01 02/26/2021 Ching Huang Fixed no action of hot plugging device on type_F adapter ****************************************************************************************** */ @@ -139,7 +140,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.01 2021-02-26" #include /* ************************************************************************** @@ -1903,7 +1904,10 @@ static void arcmsr_hbe_message_isr(struct AdapterControlBlock *acb) { u_int32_t outbound_message; CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); - outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + if (acb->adapter_type == ACB_ADAPTER_TYPE_E) + outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + else + outbound_message = acb->msgcode_rwbuffer[0]; if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) arcmsr_dr_handle( acb ); } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 01:46:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4313570106; Sat, 6 Mar 2021 01:46: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 4DsnWN4ldjz4YkH; Sat, 6 Mar 2021 01:46: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 95D3F1AEDB; Sat, 6 Mar 2021 01:46: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 1261k84f093861; Sat, 6 Mar 2021 01:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1261k8gh093860; Sat, 6 Mar 2021 01:46:08 GMT (envelope-from git) Date: Sat, 6 Mar 2021 01:46:08 GMT Message-Id: <202103060146.1261k8gh093860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: e298c1c3c257 - stable/13 - arcmsr(4): Fixed no action of hot plugging device on type_F adapter. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e298c1c3c257446eba06945a0b4755ca30387012 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 01:46:08 -0000 The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=e298c1c3c257446eba06945a0b4755ca30387012 commit e298c1c3c257446eba06945a0b4755ca30387012 Author: Xin LI AuthorDate: 2021-03-03 06:57:20 +0000 Commit: Xin LI CommitDate: 2021-03-06 01:46:04 +0000 arcmsr(4): Fixed no action of hot plugging device on type_F adapter. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 3 days (cherry picked from commit 5842073a9b7471831e0da48d29dd984d575f4e9e) --- sys/dev/arcmsr/arcmsr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index cba2a956ff37..f2217deb1ce0 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -82,6 +82,7 @@ ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller +** 1.50.00.01 02/26/2021 Ching Huang Fixed no action of hot plugging device on type_F adapter ****************************************************************************************** */ @@ -139,7 +140,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.01 2021-02-26" #include /* ************************************************************************** @@ -1902,7 +1903,10 @@ static void arcmsr_hbe_message_isr(struct AdapterControlBlock *acb) { u_int32_t outbound_message; CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); - outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + if (acb->adapter_type == ACB_ADAPTER_TYPE_E) + outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + else + outbound_message = acb->msgcode_rwbuffer[0]; if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) arcmsr_dr_handle( acb ); } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 02:01:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5A825705EC; Sat, 6 Mar 2021 02:01: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 4Dsns567wwz4ZSX; Sat, 6 Mar 2021 02:01: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 C63E21B3A0; Sat, 6 Mar 2021 02:01: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 12621T15020364; Sat, 6 Mar 2021 02:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12621TX9020363; Sat, 6 Mar 2021 02:01:29 GMT (envelope-from git) Date: Sat, 6 Mar 2021 02:01:29 GMT Message-Id: <202103060201.12621TX9020363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: e77cf2a4ab32 - main - Restore /boot/efi to mtree. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e77cf2a4ab32a381df3c06d25b8b4f650047c3f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 02:01:30 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=e77cf2a4ab32a381df3c06d25b8b4f650047c3f2 commit e77cf2a4ab32a381df3c06d25b8b4f650047c3f2 Author: Nathan Whitehorn AuthorDate: 2021-03-06 01:57:50 +0000 Commit: Nathan Whitehorn CommitDate: 2021-03-06 02:01:11 +0000 Restore /boot/efi to mtree. Instead of whether /boot/efi exists, which it now always does, including on systems that don't and can't use EFI, use whether /boot/efi is present in fstab to signal to the installer that it is a valid ESP and should be configured. This has essentially the same semantics, but allows /boot/efi to be created unconditionally. Reviewed by: bdragon, imp Tested by: bdragon (ppc64) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29068 --- etc/mtree/BSD.root.dist | 2 ++ usr.sbin/bsdinstall/scripts/bootconfig | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index 1dc9e179b0fc..f734f7891429 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -18,6 +18,8 @@ rockchip tags=package=runtime .. .. + efi + .. firmware .. loader.conf.d tags=package=bootloader diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 088d88ca9b2f..a592142d87a2 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -47,7 +47,7 @@ if [ `uname -m` == powerpc ]; then fi # Update the ESP (EFI System Partition) with the new bootloader if we have an ESP -if [ -d "$BSDINSTALL_CHROOT/boot/efi" ]; then +if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then case $(uname -m) in arm64) ARCHBOOTNAME=aa64 ;; amd64) ARCHBOOTNAME=x64 ;; From owner-dev-commits-src-all@freebsd.org Sat Mar 6 02:07:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9753C5703ED; Sat, 6 Mar 2021 02:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsnzW3gJ0z4bHp; Sat, 6 Mar 2021 02:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70C061B3BE; Sat, 6 Mar 2021 02:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1262739h021345; Sat, 6 Mar 2021 02:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126273wA021344; Sat, 6 Mar 2021 02:07:03 GMT (envelope-from git) Date: Sat, 6 Mar 2021 02:07:03 GMT Message-Id: <202103060207.126273wA021344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a552da13fc8f - stable/13 - kcsan: add atomic_interrupt_fence MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a552da13fc8f803ffc51755436441f3c14e3c817 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 02:07:03 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a552da13fc8f803ffc51755436441f3c14e3c817 commit a552da13fc8f803ffc51755436441f3c14e3c817 Author: Mateusz Guzik AuthorDate: 2021-03-01 07:42:15 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-06 02:06:55 +0000 kcsan: add atomic_interrupt_fence (cherry picked from commit 2c1c1255e41ac3fecd79f9f704c934642f34fd60) --- sys/sys/_cscan_atomic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/_cscan_atomic.h b/sys/sys/_cscan_atomic.h index aed96580e1e4..b458c24841bf 100644 --- a/sys/sys/_cscan_atomic.h +++ b/sys/sys/_cscan_atomic.h @@ -373,6 +373,7 @@ void kcsan_atomic_thread_fence_seq_cst(void); #define atomic_thread_fence_acq_rel kcsan_atomic_thread_fence_acq_rel #define atomic_thread_fence_rel kcsan_atomic_thread_fence_rel #define atomic_thread_fence_seq_cst kcsan_atomic_thread_fence_seq_cst +#define atomic_interrupt_fence __compiler_membar #endif /* !KCSAN_RUNTIME */ From owner-dev-commits-src-all@freebsd.org Sat Mar 6 02:07:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9E79570C56; Sat, 6 Mar 2021 02:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsnzX4HQWz4bLB; Sat, 6 Mar 2021 02:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 864AD1B338; Sat, 6 Mar 2021 02:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 126274WN021365; Sat, 6 Mar 2021 02:07:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126274uN021364; Sat, 6 Mar 2021 02:07:04 GMT (envelope-from git) Date: Sat, 6 Mar 2021 02:07:04 GMT Message-Id: <202103060207.126274uN021364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c10e0a4656bf - stable/13 - Use atomic_interrupt_fence() instead of bare __compiler_membar() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c10e0a4656bfe650bb3bf46fcf026a8a51a34a69 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 02:07:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c10e0a4656bfe650bb3bf46fcf026a8a51a34a69 commit c10e0a4656bfe650bb3bf46fcf026a8a51a34a69 Author: Konstantin Belousov AuthorDate: 2021-02-26 23:54:17 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-06 02:06:55 +0000 Use atomic_interrupt_fence() instead of bare __compiler_membar() (cherry picked from commit b5449c92b489445635c7962875ce73b2c9211bba) --- sys/kern/kern_rmlock.c | 32 +++++++++++++++----------------- sys/sys/kpilite.h | 5 ++--- sys/sys/mount.h | 4 ++-- sys/sys/sched.h | 4 ++-- sys/sys/systm.h | 6 +++--- 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 9135709d88cf..f661e209b633 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -366,7 +366,7 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) * Check to see if the IPI granted us the lock after all. The load of * rmp_flags must happen after the tracker is removed from the list. */ - __compiler_membar(); + atomic_interrupt_fence(); if (tracker->rmp_flags) { /* Just add back tracker - we hold the lock. */ rm_tracker_add(pc, tracker); @@ -448,7 +448,7 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) td->td_critnest++; /* critical_enter(); */ - __compiler_membar(); + atomic_interrupt_fence(); pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ @@ -456,7 +456,7 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) sched_pin(); - __compiler_membar(); + atomic_interrupt_fence(); td->td_critnest--; @@ -873,17 +873,15 @@ db_show_rm(const struct lock_object *lock) * Concurrent writers take turns taking the lock while going off cpu. If this is * of concern for your usecase, this is not the right primitive. * - * Neither rms_rlock nor rms_runlock use fences. Instead compiler barriers are - * inserted to prevert reordering of generated code. Execution ordering is - * provided with the use of an IPI handler. + * Neither rms_rlock nor rms_runlock use thread fences. Instead interrupt + * fences are inserted to ensure ordering with the code executed in the IPI + * handler. * * No attempt is made to track which CPUs read locked at least once, * consequently write locking sends IPIs to all of them. This will become a * problem at some point. The easiest way to lessen it is to provide a bitmap. */ -#define rms_int_membar() __compiler_membar() - #define RMS_NOOWNER ((void *)0x1) #define RMS_TRANSIENT ((void *)0x2) #define RMS_FLAGMASK 0xf @@ -1030,14 +1028,14 @@ rms_rlock(struct rmslock *rms) critical_enter(); pcpu = rms_int_pcpu(rms); rms_int_influx_enter(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); if (__predict_false(rms->writers > 0)) { rms_rlock_fallback(rms); return; } - rms_int_membar(); + atomic_interrupt_fence(); rms_int_readers_inc(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); rms_int_influx_exit(rms, pcpu); critical_exit(); } @@ -1052,15 +1050,15 @@ rms_try_rlock(struct rmslock *rms) critical_enter(); pcpu = rms_int_pcpu(rms); rms_int_influx_enter(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); if (__predict_false(rms->writers > 0)) { rms_int_influx_exit(rms, pcpu); critical_exit(); return (0); } - rms_int_membar(); + atomic_interrupt_fence(); rms_int_readers_inc(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); rms_int_influx_exit(rms, pcpu); critical_exit(); return (1); @@ -1092,14 +1090,14 @@ rms_runlock(struct rmslock *rms) critical_enter(); pcpu = rms_int_pcpu(rms); rms_int_influx_enter(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); if (__predict_false(rms->writers > 0)) { rms_runlock_fallback(rms); return; } - rms_int_membar(); + atomic_interrupt_fence(); rms_int_readers_dec(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); rms_int_influx_exit(rms, pcpu); critical_exit(); } diff --git a/sys/sys/kpilite.h b/sys/sys/kpilite.h index 8742ef5cfbe8..2a7e9743f799 100644 --- a/sys/sys/kpilite.h +++ b/sys/sys/kpilite.h @@ -38,7 +38,7 @@ sched_pin_lite(struct thread_lite *td) KASSERT((struct thread *)td == curthread, ("sched_pin called on non curthread")); td->td_pinned++; - __compiler_membar(); + atomic_interrupt_fence(); } static __inline void @@ -47,9 +47,8 @@ sched_unpin_lite(struct thread_lite *td) KASSERT((struct thread *)td == curthread, ("sched_unpin called on non curthread")); KASSERT(td->td_pinned > 0, ("sched_unpin called on non pinned thread")); - __compiler_membar(); + atomic_interrupt_fence(); td->td_pinned--; - __compiler_membar(); } #endif #endif diff --git a/sys/sys/mount.h b/sys/sys/mount.h index f965dd72d7ba..98d50161bed5 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1086,7 +1086,7 @@ void resume_all_fs(void); _mpcpu = vfs_mount_pcpu(mp); \ MPASS(mpcpu->mntp_thread_in_ops == 0); \ _mpcpu->mntp_thread_in_ops = 1; \ - __compiler_membar(); \ + atomic_interrupt_fence(); \ if (__predict_false(mp->mnt_vfs_ops > 0)) { \ vfs_op_thread_exit_crit(mp, _mpcpu); \ _retval_crit = false; \ @@ -1106,7 +1106,7 @@ void resume_all_fs(void); #define vfs_op_thread_exit_crit(mp, _mpcpu) do { \ MPASS(_mpcpu == vfs_mount_pcpu(mp)); \ MPASS(_mpcpu->mntp_thread_in_ops == 1); \ - __compiler_membar(); \ + atomic_interrupt_fence(); \ _mpcpu->mntp_thread_in_ops = 0; \ } while (0) diff --git a/sys/sys/sched.h b/sys/sys/sched.h index d734ec61266e..64651ffa9c90 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -173,13 +173,13 @@ static __inline void sched_pin(void) { curthread->td_pinned++; - __compiler_membar(); + atomic_interrupt_fence(); } static __inline void sched_unpin(void) { - __compiler_membar(); + atomic_interrupt_fence(); curthread->td_pinned--; } diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 5de12e5bc1e5..72a10c401af9 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -284,7 +284,7 @@ critical_enter(void) td = (struct thread_lite *)curthread; td->td_critnest++; - __compiler_membar(); + atomic_interrupt_fence(); } static __inline void @@ -295,9 +295,9 @@ critical_exit(void) td = (struct thread_lite *)curthread; KASSERT(td->td_critnest != 0, ("critical_exit: td_critnest == 0")); - __compiler_membar(); + atomic_interrupt_fence(); td->td_critnest--; - __compiler_membar(); + atomic_interrupt_fence(); if (__predict_false(td->td_owepreempt)) critical_exit_preempt(); From owner-dev-commits-src-all@freebsd.org Sat Mar 6 03:46:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFD0E57390B; Sat, 6 Mar 2021 03:46: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 4Dsr9k4v00z4hXB; Sat, 6 Mar 2021 03:46: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 9A62D1C84D; Sat, 6 Mar 2021 03:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1263k2Rh053564; Sat, 6 Mar 2021 03:46:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1263k2uU053563; Sat, 6 Mar 2021 03:46:02 GMT (envelope-from git) Date: Sat, 6 Mar 2021 03:46:02 GMT Message-Id: <202103060346.1263k2uU053563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 6ed39db2573b - main - Do not exit ctl_be_block_worker() prematurely. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ed39db2573bb808ac2c206cd6c831f0be86219c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 03:46:02 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6ed39db2573bb808ac2c206cd6c831f0be86219c commit 6ed39db2573bb808ac2c206cd6c831f0be86219c Author: Alexander Motin AuthorDate: 2021-03-06 03:39:52 +0000 Commit: Alexander Motin CommitDate: 2021-03-06 03:45:47 +0000 Do not exit ctl_be_block_worker() prematurely. Return while there are any I/Os in a queue may result in them stuck indefinitely, since there is only one taskqueue task for all of them. I think I've reproduced this by switching ha_role to secondary under heavy load. MFC after: 3 days --- sys/cam/ctl/ctl_backend_block.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 3663bff10f2a..9f96c157d5ae 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -1672,7 +1672,7 @@ ctl_be_block_worker(void *context, int pending) if (cbe_lun->flags & CTL_LUN_FLAG_NO_MEDIA) { ctl_set_busy(&io->scsiio); ctl_complete_beio(beio); - return; + continue; } be_lun->dispatch(be_lun, beio); continue; @@ -1685,7 +1685,7 @@ ctl_be_block_worker(void *context, int pending) if (cbe_lun->flags & CTL_LUN_FLAG_NO_MEDIA) { ctl_set_busy(&io->scsiio); ctl_config_write_done(io); - return; + continue; } ctl_be_block_cw_dispatch(be_lun, io); continue; @@ -1698,7 +1698,7 @@ ctl_be_block_worker(void *context, int pending) if (cbe_lun->flags & CTL_LUN_FLAG_NO_MEDIA) { ctl_set_busy(&io->scsiio); ctl_config_read_done(io); - return; + continue; } ctl_be_block_cr_dispatch(be_lun, io); continue; @@ -1711,7 +1711,7 @@ ctl_be_block_worker(void *context, int pending) if (cbe_lun->flags & CTL_LUN_FLAG_NO_MEDIA) { ctl_set_busy(&io->scsiio); ctl_data_submit_done(io); - return; + continue; } ctl_be_block_dispatch(be_lun, io); continue; From owner-dev-commits-src-all@freebsd.org Sat Mar 6 04:59:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49758575010; Sat, 6 Mar 2021 04:59: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 4Dsspm1Mwfz4lY4; Sat, 6 Mar 2021 04:59: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 1E5651D755; Sat, 6 Mar 2021 04:59: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 1264xiFq046432; Sat, 6 Mar 2021 04:59:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1264xiF5046431; Sat, 6 Mar 2021 04:59:44 GMT (envelope-from git) Date: Sat, 6 Mar 2021 04:59:44 GMT Message-Id: <202103060459.1264xiF5046431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 85ec7f28cba3 - releng/13.0 - arcmsr(4): Fixed no action of hot plugging device on type_F adapter. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 85ec7f28cba326dc1460ada971e85671cf5a6c75 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 04:59:44 -0000 The branch releng/13.0 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=85ec7f28cba326dc1460ada971e85671cf5a6c75 commit 85ec7f28cba326dc1460ada971e85671cf5a6c75 Author: Xin LI AuthorDate: 2021-03-03 06:57:20 +0000 Commit: Xin LI CommitDate: 2021-03-06 04:59:21 +0000 arcmsr(4): Fixed no action of hot plugging device on type_F adapter. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Approved by: re (gjb) (cherry picked from commit 5842073a9b7471831e0da48d29dd984d575f4e9e) (cherry picked from commit e298c1c3c257446eba06945a0b4755ca30387012) --- sys/dev/arcmsr/arcmsr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index cba2a956ff37..f2217deb1ce0 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -82,6 +82,7 @@ ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller +** 1.50.00.01 02/26/2021 Ching Huang Fixed no action of hot plugging device on type_F adapter ****************************************************************************************** */ @@ -139,7 +140,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.01 2021-02-26" #include /* ************************************************************************** @@ -1902,7 +1903,10 @@ static void arcmsr_hbe_message_isr(struct AdapterControlBlock *acb) { u_int32_t outbound_message; CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); - outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + if (acb->adapter_type == ACB_ADAPTER_TYPE_E) + outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + else + outbound_message = acb->msgcode_rwbuffer[0]; if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) arcmsr_dr_handle( acb ); } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 05:25:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C83257603D; Sat, 6 Mar 2021 05:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DstNH26Sfz4mxD; Sat, 6 Mar 2021 05:25: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 3B5FD1E11E; Sat, 6 Mar 2021 05:25: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 1265PJdx085190; Sat, 6 Mar 2021 05:25:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1265PJ9I085189; Sat, 6 Mar 2021 05:25:19 GMT (envelope-from git) Date: Sat, 6 Mar 2021 05:25:19 GMT Message-Id: <202103060525.1265PJ9I085189@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: ead7697f04c0 - main - Restore AT_RESOLVE_BENEATH support for funlinkat(2)/unlinkat(2). 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: ead7697f04c036853535a4281cec9aa09ef21270 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 05:25:19 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ead7697f04c036853535a4281cec9aa09ef21270 commit ead7697f04c036853535a4281cec9aa09ef21270 Author: Konstantin Belousov AuthorDate: 2021-03-05 02:07:57 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-06 05:24:18 +0000 Restore AT_RESOLVE_BENEATH support for funlinkat(2)/unlinkat(2). MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/vfs_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index fec9566cb415..3db34c3689de 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1809,7 +1809,7 @@ kern_funlinkat_ex(struct thread *td, int dfd, const char *path, int fd, int flag, enum uio_seg pathseg, ino_t oldinum) { - if ((flag & ~AT_REMOVEDIR) != 0) + if ((flag & ~(AT_REMOVEDIR | AT_RESOLVE_BENEATH)) != 0) return (EINVAL); if ((flag & AT_REMOVEDIR) != 0) From owner-dev-commits-src-all@freebsd.org Sat Mar 6 05:25:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E4185761C1; Sat, 6 Mar 2021 05:25: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 4DstNJ2hd1z4mxF; Sat, 6 Mar 2021 05:25: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 4FBB31DF98; Sat, 6 Mar 2021 05:25: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 1265PKmj085210; Sat, 6 Mar 2021 05:25:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1265PKDK085209; Sat, 6 Mar 2021 05:25:20 GMT (envelope-from git) Date: Sat, 6 Mar 2021 05:25:20 GMT Message-Id: <202103060525.1265PKDK085209@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: f5e930b369c6 - main - atomic(9): note that atomic_interrupt_fence first appeared in 13.0 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: f5e930b369c6ea7a3f81d8e5b52cc395bb7b4187 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 05:25:20 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f5e930b369c6ea7a3f81d8e5b52cc395bb7b4187 commit f5e930b369c6ea7a3f81d8e5b52cc395bb7b4187 Author: Konstantin Belousov AuthorDate: 2021-03-06 05:21:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-06 05:24:18 +0000 atomic(9): note that atomic_interrupt_fence first appeared in 13.0 MFC after: 3 days Sponsored by: The FreeBSD Foundation --- share/man/man9/atomic.9 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index 397a8fcd6b18..ebc6ed791f37 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2021 +.Dd March 6, 2021 .Dt ATOMIC 9 .Os .Sh NAME @@ -612,3 +612,8 @@ and .Fn atomic_store were added in .Fx 12.0 . +.Pp +The +.Fn atomic_interrupt_fence +operation was added in +.Fx 13.0 . From owner-dev-commits-src-all@freebsd.org Sat Mar 6 06:13:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBC58552A06; Sat, 6 Mar 2021 06:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DsvRM5FsKz4ry4; Sat, 6 Mar 2021 06:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A72711E995; Sat, 6 Mar 2021 06:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1266D3tx051171; Sat, 6 Mar 2021 06:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1266D3NS051170; Sat, 6 Mar 2021 06:13:03 GMT (envelope-from git) Date: Sat, 6 Mar 2021 06:13:03 GMT Message-Id: <202103060613.1266D3NS051170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Peter Grehan Subject: git: 9705c012c1f0 - releng/13.0 - Import wireguard fixes from pfSense 2.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9705c012c1f0c7a9ac0f6c8618bebe3e66280a8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 06:13:03 -0000 The branch releng/13.0 has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=9705c012c1f0c7a9ac0f6c8618bebe3e66280a8a commit 9705c012c1f0c7a9ac0f6c8618bebe3e66280a8a Author: Peter Grehan AuthorDate: 2021-02-27 04:15:04 +0000 Commit: Peter Grehan CommitDate: 2021-03-06 04:12:29 +0000 Import wireguard fixes from pfSense 2.5 Merge the following fixes from https://github.com/pfsense/FreeBSD-src 1940e7d3 Save address of ingress packets to allow wg to work on HA 8f5531f1 Fix connection to IPv6 endpoint 825ed9ee Fix tcpdump for wg IPv6 rx tunnel traffic 2ec232d3 Fix issue with replying to INITIATION messages in server mode ec77593a Return immediately in wg_init if in DETACH'd state 0f0dde6f Remove unnecessary wg debug printf on transmit 2766dc94 Detect and fix case in wg_init() where sockets weren't cleaned up b62cc7ac Close the UDP tunnel sockets when the interface has been stopped Approved by: re (kib) Obtained from: pfSense 2.5 Relnotes: yes Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 96aabea8bd238b503e949753355dc5b6a857aa9c) --- sys/dev/if_wg/module/if_wg_session.c | 45 +++++++++++++++++++++++++++++++++--- sys/dev/if_wg/module/module.c | 23 ++++++++++++++---- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/sys/dev/if_wg/module/if_wg_session.c b/sys/dev/if_wg/module/if_wg_session.c index 54e63d053847..084bc789039d 100644 --- a/sys/dev/if_wg/module/if_wg_session.c +++ b/sys/dev/if_wg/module/if_wg_session.c @@ -1394,8 +1394,8 @@ wg_deliver_in(struct wg_peer *peer) CURVNET_SET(inp->inp_vnet); ip_input(m); CURVNET_RESTORE(); - } else if (version == 6) { - af = AF_INET; + } else if (version == 6) { + af = AF_INET6; BPF_MTAP2(sc->sc_ifp, &af, sizeof(af), m); inp = sotoinpcb(so->so_so6); CURVNET_SET(inp->inp_vnet); @@ -1531,6 +1531,7 @@ wg_handshake(struct wg_softc *sc, struct mbuf *m) peer = CONTAINER_OF(remote, struct wg_peer, p_remote); DPRINTF(sc, "Receiving handshake initiation from peer %llu\n", (unsigned long long)peer->p_id); + wg_peer_set_endpoint_from_tag(peer, t); res = wg_send_response(peer); if (res == 0 && noise_remote_begin_session(&peer->p_remote) == 0) wg_timers_event_session_derived(&peer->p_timers); @@ -1851,6 +1852,40 @@ wg_index_drop(struct wg_softc *sc, uint32_t key0) SLIST_INSERT_HEAD(&peer->p_unused_index, iter, i_unused_entry); } +static int +wg_update_endpoint_addrs(struct wg_endpoint *e, const struct sockaddr *srcsa, + struct ifnet *rcvif) +{ + const struct sockaddr_in *sa4; + const struct sockaddr_in6 *sa6; + int ret = 0; + + /* + * UDP passes a 2-element sockaddr array: first element is the + * source addr/port, second the destination addr/port. + */ + if (srcsa->sa_family == AF_INET) { + sa4 = (const struct sockaddr_in *)srcsa; + e->e_remote.r_sin = sa4[0]; + /* Only update dest if not mcast/bcast */ + if (!(IN_MULTICAST(ntohl(sa4[1].sin_addr.s_addr)) || + sa4[1].sin_addr.s_addr == INADDR_BROADCAST || + in_broadcast(sa4[1].sin_addr, rcvif))) { + e->e_local.l_in = sa4[1].sin_addr; + } + } else if (srcsa->sa_family == AF_INET6) { + sa6 = (const struct sockaddr_in6 *)srcsa; + e->e_remote.r_sin6 = sa6[0]; + /* Only update dest if not multicast */ + if (!IN6_IS_ADDR_MULTICAST(&sa6[1].sin6_addr)) + e->e_local.l_in6 = sa6[1].sin6_addr; + } else { + ret = EAFNOSUPPORT; + } + + return (ret); +} + static void wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, const struct sockaddr *srcsa, void *_sc) @@ -1882,7 +1917,11 @@ wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb, goto free; } e = wg_mbuf_endpoint_get(m); - e->e_remote.r_sa = *srcsa; + + if (wg_update_endpoint_addrs(e, srcsa, m->m_pkthdr.rcvif)) { + DPRINTF(sc, "unknown family\n"); + goto free; + } verify_endpoint(m); if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); diff --git a/sys/dev/if_wg/module/module.c b/sys/dev/if_wg/module/module.c index 76c7db01cba1..a40a304616c7 100644 --- a/sys/dev/if_wg/module/module.c +++ b/sys/dev/if_wg/module/module.c @@ -255,7 +255,6 @@ wg_transmit(struct ifnet *ifp, struct mbuf *m) peer = wg_route_lookup(&sc->sc_routes, m, OUT); if (__predict_false(peer == NULL)) { rc = ENOKEY; - printf("peer not found - dropping %p\n", m); /* XXX log */ goto err; } @@ -360,8 +359,15 @@ wg_init(if_ctx_t ctx) struct wg_softc *sc; int rc; + if (iflib_in_detach(ctx)) + return; + sc = iflib_get_softc(ctx); ifp = iflib_get_ifp(ctx); + if (sc->sc_socket.so_so4 != NULL) + printf("XXX wg_init, socket non-NULL %p\n", + sc->sc_socket.so_so4); + wg_socket_reinit(sc, NULL, NULL); rc = wg_socket_init(sc); if (rc) return; @@ -377,6 +383,7 @@ wg_stop(if_ctx_t ctx) sc = iflib_get_softc(ctx); ifp = iflib_get_ifp(ctx); if_link_state_change(ifp, LINK_STATE_DOWN); + wg_socket_reinit(sc, NULL, NULL); } static nvlist_t * @@ -386,13 +393,20 @@ wg_peer_to_nvl(struct wg_peer *peer) int i, count; nvlist_t *nvl; caddr_t key; + size_t sa_sz; struct wg_allowedip *aip; + struct wg_endpoint *ep; if ((nvl = nvlist_create(0)) == NULL) return (NULL); key = peer->p_remote.r_public; nvlist_add_binary(nvl, "public-key", key, WG_KEY_SIZE); - nvlist_add_binary(nvl, "endpoint", &peer->p_endpoint.e_remote, sizeof(struct sockaddr)); + ep = &peer->p_endpoint; + if (ep->e_remote.r_sa.sa_family != 0) { + sa_sz = (ep->e_remote.r_sa.sa_family == AF_INET) ? + sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); + nvlist_add_binary(nvl, "endpoint", &ep->e_remote, sa_sz); + } i = count = 0; CK_LIST_FOREACH(rt, &peer->p_routes, r_entry) { count++; @@ -587,13 +601,12 @@ wg_peer_add(struct wg_softc *sc, const nvlist_t *nvl) } if (nvlist_exists_binary(nvl, "endpoint")) { endpoint = nvlist_get_binary(nvl, "endpoint", &size); - if (size != sizeof(*endpoint)) { + if (size > sizeof(peer->p_endpoint.e_remote)) { device_printf(dev, "%s bad length for endpoint %zu\n", __func__, size); err = EBADMSG; goto out; } - memcpy(&peer->p_endpoint.e_remote, endpoint, - sizeof(peer->p_endpoint.e_remote)); + memcpy(&peer->p_endpoint.e_remote, endpoint, size); } if (nvlist_exists_binary(nvl, "pre-shared-key")) { const void *key; From owner-dev-commits-src-all@freebsd.org Sat Mar 6 06:50:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CF0F559887; Sat, 6 Mar 2021 06:50:49 +0000 (UTC) (envelope-from gbe@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 4DswGx0Q6Pz4vnc; Sat, 6 Mar 2021 06:50:49 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p200300d5d740b9c950bd45a017f3c4cd.dip0.t-ipconnect.de [IPv6:2003:d5:d740:b9c9:50bd:45a0:17f3:c4cd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 7E6ED20EDC; Sat, 6 Mar 2021 06:50:48 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Sat, 6 Mar 2021 07:50:47 +0100 From: Gordon Bergling To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 89b650872bba - main - ktls: Hide initialization message behind bootverbose Message-ID: References: <202103051815.125IFDNK001016@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 7:39AM up 7 days, 5:59, 4 users, load averages: 0.22, 0.24, 0.23 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 06:50:49 -0000 On Fri, Mar 05, 2021 at 01:36:36PM -0500, Mark Johnston wrote: > On Fri, Mar 05, 2021 at 07:23:56PM +0100, Gordon Bergling wrote: > > Hi Mark, > > > > is this change not a little bit to aggressive in terms of dmesg cleanup? > > > > There are a lot messages about what subsystem is initialized with > > how many threads, like for example TCP HTPS and TCP BBR. > > I would argue that that is the exception rather than the norm, and they > should be cleaned up too. I just didn't notice since they are not > compiled into the kernel. > > We don't log messages about bufspace threads, taskqueue threads, crypto > worker threads, NFSD threads, netgraph threads, pagedaemon threads, etc. > This is really an implementation detail and I don't see why it's crucial > information that needs to be printed upon each boot. Especially in this > case, where KTLS needs to be explicitly be enabled before those threads > will ever do anything. > > > Hiding this information could be suboptimal for some users. > > There is a kern.ipc.tls.stats.threads sysctl which exposes the same > number, so I'm not sure it's really hidden. But why would a user need > this information? As a developer I am not a regular user, because I scan the dmesg output for LORs and such things. Your right at this point, that a normal user wouldn't spend time watching out on how many threads a subsystem uses. --Gordon > > On Fri, Mar 05, 2021 at 06:15:13PM +0000, Mark Johnston wrote: > > > The branch main has been updated by markj: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=89b650872bba2e4bfbc94a200946b461ef69ae22 > > > > > > commit 89b650872bba2e4bfbc94a200946b461ef69ae22 > > > Author: Mark Johnston > > > AuthorDate: 2021-03-05 18:11:02 +0000 > > > Commit: Mark Johnston > > > CommitDate: 2021-03-05 18:11:02 +0000 > > > > > > ktls: Hide initialization message behind bootverbose > > > > > > We don't typically print anything when a subsystem initializes itself, > > > and KTLS is currently disabled by default anyway. > > > > > > Reviewed by: jhb > > > MFC after: 1 week > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D29097 > > > --- > > > sys/kern/uipc_ktls.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > > > index 5125061e0879..1fd1eca39b59 100644 > > > --- a/sys/kern/uipc_ktls.c > > > +++ b/sys/kern/uipc_ktls.c > > > @@ -495,7 +495,8 @@ ktls_init(void *dummy __unused) > > > } > > > } > > > > > > - printf("KTLS: Initialized %d threads\n", ktls_number_threads); > > > + if (bootverbose) > > > + printf("KTLS: Initialized %d threads\n", ktls_number_threads); > > > } > > > SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); From owner-dev-commits-src-all@freebsd.org Sat Mar 6 08:59:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2984F55D7FD; Sat, 6 Mar 2021 08:59: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 4Dsz7d0hmZz3KXv; Sat, 6 Mar 2021 08:59: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 069B7205FD; Sat, 6 Mar 2021 08:59: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 1268xedE063569; Sat, 6 Mar 2021 08:59:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1268xeb1063568; Sat, 6 Mar 2021 08:59:40 GMT (envelope-from git) Date: Sat, 6 Mar 2021 08:59:40 GMT Message-Id: <202103060859.1268xeb1063568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 6a3095aa6d03 - main - loader_4th: brand image is aligned right MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a3095aa6d0350dda89bac66d26f22a01e2257c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 08:59:41 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=6a3095aa6d0350dda89bac66d26f22a01e2257c4 commit 6a3095aa6d0350dda89bac66d26f22a01e2257c4 Author: Toomas Soome AuthorDate: 2021-03-06 08:54:08 +0000 Commit: Toomas Soome CommitDate: 2021-03-06 08:59:35 +0000 loader_4th: brand image is aligned right With screen border removed, I forgot to update forth brand image coordinates to avoid image alignment. --- stand/forth/brand-fbsd.4th | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/forth/brand-fbsd.4th b/stand/forth/brand-fbsd.4th index b8e43e601c96..84245ef232b6 100644 --- a/stand/forth/brand-fbsd.4th +++ b/stand/forth/brand-fbsd.4th @@ -38,7 +38,7 @@ s" term-putimage" sfind if \ note, we use 0, 0 for image upper left as origin, \ and 0, 7 for lower right to preserve aspect ratio - >r 0 0 0 0 7 + >r 0 1 1 0 7 s" /boot/images/freebsd-brand-rev.png" r> execute if 2drop exit then else From owner-dev-commits-src-all@freebsd.org Sat Mar 6 09:07:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5687855DF6B; Sat, 6 Mar 2021 09:07:07 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DszJC10PFz3L6h; Sat, 6 Mar 2021 09:07:07 +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 C235D21EB2; Sat, 6 Mar 2021 09:07:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 443C14B318; Sat, 6 Mar 2021 10:07:04 +0100 (CET) From: "Kristof Provost" To: "Mark Johnston" Cc: "Ryan Moeller" , "Konstantin Belousov" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c4ba4aa54718 - main - libifconfig: Overhaul ifconfig_media_* interfaces Date: Sat, 06 Mar 2021 10:07:03 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: In-Reply-To: References: <202103051123.125BNubR059014@gitrepo.freebsd.org> <20c6efb4-8b57-ae78-3808-b49b07ac284d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 09:07:07 -0000 On 5 Mar 2021, at 20:44, Mark Johnston wrote: > On Fri, Mar 05, 2021 at 02:40:29PM -0500, Ryan Moeller wrote: >> >> On 3/5/21 1:19 PM, Konstantin Belousov wrote: >>> On Fri, Mar 05, 2021 at 11:23:56AM +0000, Ryan Moeller wrote: >>>> The branch main has been updated by freqlabs: >>>> >>>> URL: = >>>> https://cgit.FreeBSD.org/src/commit/?id=3Dc4ba4aa547184ab401204096cd= ad9def4ab37964 >>>> >>>> commit c4ba4aa547184ab401204096cdad9def4ab37964 >>>> Author: Ryan Moeller >>>> AuthorDate: 2021-03-02 10:29:17 +0000 >>>> Commit: Ryan Moeller >>>> CommitDate: 2021-03-05 09:15:55 +0000 >>>> >>>> libifconfig: Overhaul ifconfig_media_* interfaces >>>> >>>> Define an ifmedia_t type to use for ifmedia words. >>>> >>>> Add ifconfig_media_lookup_* functions to lookup ifmedia words = >>>> by name. >>>> >>>> Get media options as an array of option names rather than = >>>> formatting it >>>> as a comma-delimited list into a buffer. >>>> >>>> Sprinkle const on static the static description tables for = >>>> peace of >>>> mind. >>>> >>>> Don't need to zero memory allocated by calloc. >>>> >>>> Reviewed by: kp >>>> MFC after: 2 weeks >>>> Differential Revision: https://reviews.freebsd.org/D29029 >>>> --- >>>> lib/libifconfig/Makefile | 2 +- >>>> lib/libifconfig/Symbol.map | 9 +- >>>> lib/libifconfig/libifconfig.h | 69 +++++++- >>>> lib/libifconfig/libifconfig_media.c | 339 = >>>> ++++++++++++++++++++++++------------ >>>> share/examples/libifconfig/status.c | 27 ++- >>>> 5 files changed, 324 insertions(+), 122 deletions(-) >>>> >>>> diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile >>>> index 73dad36c1dc5..c6f006018427 100644 >>>> --- a/lib/libifconfig/Makefile >>>> +++ b/lib/libifconfig/Makefile >>>> @@ -7,7 +7,7 @@ INTERNALLIB=3D true >>>> LIBADD=3D m >>>> >>>> SHLIBDIR?=3D /lib >>>> -SHLIB_MAJOR=3D 1 >>>> +SHLIB_MAJOR=3D 2 >>>> >>>> VERSION_DEF=3D ${LIBCSRCDIR}/Versions.def >>>> SYMBOL_MAPS=3D ${.CURDIR}/Symbol.map >>> libifconfig is marked as internal, but we provide symbol versioning = >>> for it, >>> and do it in the normal FreeBSD namespace. On one hand, our policy = >>> is to >>> not bump symvered libs and to provide binary compat shims as needed, = >>> on the >>> other, this is internal lib. >>> >>> What is the purpose of maintaining symbol versions for it? >> >> >> I have work in progress that changes libifconfig to a private lib. = >> I'm >> not sure why markj@ added the symbol map, but I've been forced to >> maintain it for my later changes to work. > > I added it because there was some discussion of making it a public > library, and adding a symbol map was a step towards that. If it is = > only > going to be a private library, then there's indeed no reason to = > maintain > it. Historically it=E2=80=99s been the aspiration (passive voice, because whi= le = these have been my hopes I=E2=80=99ve not done any of the work) to make t= his a = public library, so e.g. appliance vendors could have a better way to = configure the system than doing `system(=E2=80=9Cifconfig em0 = 10.0.0.1/24=E2=80=9D);`. Libifconfig is making progress thanks to Ryan=E2=80=99s work, but it=E2=80= =99s not = yet ready for that sort of use. Given that, it makes sense to keep it as an internal library for now, = and breaking the API is fine. I still hope that we=E2=80=99ll get it to t= he = point where it=E2=80=99ll be ready for public consumption (with stable AP= I). So I think the symbol map is mostly aspirational right now. If it=E2=80=99= s a = maintenance burden I guess we can remove it, and re-add it when the time = comes. Best regards, Kristof From owner-dev-commits-src-all@freebsd.org Sat Mar 6 09:07:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59EAE55D9F4; Sat, 6 Mar 2021 09:07: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 4DszJT1rlRz3LG1; Sat, 6 Mar 2021 09:07: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 2F57220E64; Sat, 6 Mar 2021 09:07: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 12697LrZ076690; Sat, 6 Mar 2021 09:07:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12697LWC076689; Sat, 6 Mar 2021 09:07:21 GMT (envelope-from git) Date: Sat, 6 Mar 2021 09:07:21 GMT Message-Id: <202103060907.12697LWC076689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 99e1b2d79868 - stable/13 - loader_4th: brand image is aligned right MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 99e1b2d79868eb8bad371b6d4d64fa1aab99fbc4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 09:07:21 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=99e1b2d79868eb8bad371b6d4d64fa1aab99fbc4 commit 99e1b2d79868eb8bad371b6d4d64fa1aab99fbc4 Author: Toomas Soome AuthorDate: 2021-03-06 08:54:08 +0000 Commit: Toomas Soome CommitDate: 2021-03-06 09:06:51 +0000 loader_4th: brand image is aligned right With screen border removed, I forgot to update forth brand image coordinates to avoid image alignment. (cherry picked from commit 6a3095aa6d0350dda89bac66d26f22a01e2257c4) --- stand/forth/brand-fbsd.4th | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/forth/brand-fbsd.4th b/stand/forth/brand-fbsd.4th index b8e43e601c96..84245ef232b6 100644 --- a/stand/forth/brand-fbsd.4th +++ b/stand/forth/brand-fbsd.4th @@ -38,7 +38,7 @@ s" term-putimage" sfind if \ note, we use 0, 0 for image upper left as origin, \ and 0, 7 for lower right to preserve aspect ratio - >r 0 0 0 0 7 + >r 0 1 1 0 7 s" /boot/images/freebsd-brand-rev.png" r> execute if 2drop exit then else From owner-dev-commits-src-all@freebsd.org Sat Mar 6 09:36:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7212A55F132; Sat, 6 Mar 2021 09:36:36 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "vtr.rulingia.com", Issuer "R3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DszyC2qR6z3N6k; Sat, 6 Mar 2021 09:36:31 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.16.1/8.15.2) with ESMTPS id 1269aNOc066892 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 6 Mar 2021 20:36:28 +1100 (AEDT) (envelope-from peter@rulingia.com) DKIM-Filter: OpenDKIM Filter v2.10.3 vtr.rulingia.com 1269aNOc066892 X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.16.1/8.16.1) with ESMTPS id 1269aHsg039531 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Mar 2021 20:36:18 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.16.1/8.16.1/Submit) id 1269aHgI039530; Sat, 6 Mar 2021 20:36:17 +1100 (AEDT) (envelope-from peter) Date: Sat, 6 Mar 2021 20:36:17 +1100 From: Peter Jeremy To: Oleksandr Tymoshenko Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: f76393a6305b - stable/13 - armv8crypto: add AES-GCM support Message-ID: References: <202101230635.10N6Zf9L012423@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3AtvwTlPa3p/4zAP" Content-Disposition: inline In-Reply-To: <202101230635.10N6Zf9L012423@gitrepo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp X-Rspamd-Queue-Id: 4DszyC2qR6z3N6k X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.10 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[rulingia.com:s=default]; FREEFALL_USER(0.00)[peter]; 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.20)[multipart/signed,text/plain]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; SPAMHAUS_ZRD(0.00)[2001:19f0:5801:ebe:5400:1ff:fe53:30fd:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[rulingia.com:+]; DMARC_POLICY_ALLOW(-0.50)[rulingia.com,quarantine]; NEURAL_HAM_SHORT(-1.00)[-1.000]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:19f0:5801:ebe:5400:1ff:fe53:30fd:from]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-branches,dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 09:36:36 -0000 --3AtvwTlPa3p/4zAP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-Jan-23 06:35:41 +0000, Oleksandr Tymoshenko wro= te: >The branch stable/13 has been updated by gonzo: > >URL: https://cgit.FreeBSD.org/src/commit/?id=3Df76393a6305b67c0f3439ba684c= 5d49a2aafe2a0 > >commit f76393a6305b67c0f3439ba684c5d49a2aafe2a0 >Author: Oleksandr Tymoshenko >AuthorDate: 2021-01-13 06:27:10 +0000 >Commit: Oleksandr Tymoshenko >CommitDate: 2021-01-23 06:34:37 +0000 > > armv8crypto: add AES-GCM support > =20 > Add support for AES-GCM using OpenSSL's accelerated routines. This breaks geli using AES-XTS 128. I have a geli partition last written on 12-stable about a year ago. I can read it successfully on a RockPro64 (RK3399) running 13.0-ALPHA2 (c256201-g02611ef8ee9) but it fails on 13.0-BETA4 (releng/13.0-n244592-e32bc253629) as well as releng/13.0 60e8939aa85b and main 028616d0dd69. If I start with releng/13.0 60e8939aa85b and revert f76393a6305b, the problem goes away. By "fail": geli attaches without issue but the .eli device returns garbage (though the garbage is consistent between reboots). --=20 Peter Jeremy --3AtvwTlPa3p/4zAP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmBDTRFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzTDfA//RsGsPQIl42ll++Q4pJugOvVFsfET8J4T0bCX5x5gtU1592oriis3qDZp zVx4VvIZphUryy7hoYLjN3BKpFnlz8BY+RJOIXreRBzT8AQgXRLSHSNs58/hQJCs FO+DQnOkSTdC4rPn1sCnqQuJUhv8+wiK4FnPCq4mNM2BxNa4D710XV0zYFFRBlAJ xVFLYa2Uuf0mmhq8LSFUXlEGgdesYANJ1420IwUBv5lAFxRHn+6SM3jLtDK9OQQV h5OC9bPPRuekqtvpA0RUXzfWf5zKMqaTvufdAOaYA2ct+7A1bEsCOe9HFlKeIHUm fTXOh6f0PHY5Vtp5bBqZL+aDFEzpHkMAi19zKYRKR7kYlwy7vJHd4DBUJJLTlLE8 JpAAQO/r0oA6I3AsdekF9uRHChZko4Hq9dtRgKtimTr1kXZWLTV9ISDmshn9SZZn Cb5EXr6Ky3PUrNifgOd/3WnSDFvXXBERkXw3er9I5TGup2SoSj/6jX3iaRGjWiGv fBNKPV7+mGAX4MuK2E5PZUQbGgo73hvECVGiI654yvYivfpSmEFeXuxi5vqCz696 rDt3qYrc4lNYjqTpy92NlKmSs0G9btGqYtICkK3soDSFAF+Cwhv3hMjLrxZMEZXC H/f2ynnMqeTGe65USA00P8KWCWAcUEFBVb4eR9D7rb3qz/Tdlsk= =eC4u -----END PGP SIGNATURE----- --3AtvwTlPa3p/4zAP-- From owner-dev-commits-src-all@freebsd.org Sat Mar 6 09:37:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D70355F2D1; Sat, 6 Mar 2021 09:37: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 4DszzM1WN1z3NMh; Sat, 6 Mar 2021 09:37: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 1FD2920D65; Sat, 6 Mar 2021 09: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 1269bYY4016052; Sat, 6 Mar 2021 09: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 1269bYJ9016051; Sat, 6 Mar 2021 09:37:34 GMT (envelope-from git) Date: Sat, 6 Mar 2021 09:37:34 GMT Message-Id: <202103060937.1269bYJ9016051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: bafab32168c8 - releng/13.0 - loader_4th: brand image is aligned right MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: bafab32168c82f979151c912f2c61b100a64b7c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 09:37:35 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=bafab32168c82f979151c912f2c61b100a64b7c8 commit bafab32168c82f979151c912f2c61b100a64b7c8 Author: Toomas Soome AuthorDate: 2021-03-06 08:54:08 +0000 Commit: Toomas Soome CommitDate: 2021-03-06 09:37:16 +0000 loader_4th: brand image is aligned right With screen border removed, I forgot to update forth brand image coordinates to avoid image alignment. (cherry picked from commit 6a3095aa6d0350dda89bac66d26f22a01e2257c4) Approved by: re (delphij) --- stand/forth/brand-fbsd.4th | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/forth/brand-fbsd.4th b/stand/forth/brand-fbsd.4th index b8e43e601c96..84245ef232b6 100644 --- a/stand/forth/brand-fbsd.4th +++ b/stand/forth/brand-fbsd.4th @@ -38,7 +38,7 @@ s" term-putimage" sfind if \ note, we use 0, 0 for image upper left as origin, \ and 0, 7 for lower right to preserve aspect ratio - >r 0 0 0 0 7 + >r 0 1 1 0 7 s" /boot/images/freebsd-brand-rev.png" r> execute if 2drop exit then else From owner-dev-commits-src-all@freebsd.org Sat Mar 6 10:19:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 017DA56041F; Sat, 6 Mar 2021 10:19: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 4Dt0w66Py3z3QT2; Sat, 6 Mar 2021 10:19: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 CACE3218C1; Sat, 6 Mar 2021 10:19: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 126AJo27069169; Sat, 6 Mar 2021 10:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126AJoUe069168; Sat, 6 Mar 2021 10:19:50 GMT (envelope-from git) Date: Sat, 6 Mar 2021 10:19:50 GMT Message-Id: <202103061019.126AJoUe069168@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: b4e3f3c2de6e - main - pfctl: Add missing 'va' code point name 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: b4e3f3c2de6e6dc614f99615e50d0d87f3367ca0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 10:19:51 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4e3f3c2de6e6dc614f99615e50d0d87f3367ca0 commit b4e3f3c2de6e6dc614f99615e50d0d87f3367ca0 Author: Kristof Provost AuthorDate: 2021-03-04 12:50:28 +0000 Commit: Kristof Provost CommitDate: 2021-03-06 09:07:55 +0000 pfctl: Add missing 'va' code point name Add the 'va' (voice-admit, RFC5865) symbolic name. Reviewed by: rgrimes, gbe (man page) MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29069 --- sbin/pfctl/parse.y | 3 ++- share/man/man5/pf.conf.5 | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 1182dde3b079..9db85538feaf 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -6342,7 +6342,8 @@ map_tos(char *s, int *val) { "lowdelay", IPTOS_LOWDELAY }, { "netcontrol", IPTOS_PREC_NETCONTROL }, { "reliability", IPTOS_RELIABILITY }, - { "throughput", IPTOS_THROUGHPUT } + { "throughput", IPTOS_THROUGHPUT }, + { "va", IPTOS_DSCP_VA } }; const struct keywords *p; diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 8846199deccb..d31d20e29bea 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -681,6 +681,7 @@ given as one of .Ar reliability , or one of the DiffServ Code Points: .Ar ef , +.Ar va , .Ar af11 No ... Ar af43 , .Ar cs0 No ... Ar cs7 ; or as either hex or decimal. @@ -1737,6 +1738,7 @@ given as one of .Ar reliability , or one of the DiffServ Code Points: .Ar ef , +.Ar va , .Ar af11 No ... Ar af43 , .Ar cs0 No ... Ar cs7 ; or as either hex or decimal. From owner-dev-commits-src-all@freebsd.org Sat Mar 6 10:19:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AFD9560421; Sat, 6 Mar 2021 10:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dt0w76x0Jz3QG1; Sat, 6 Mar 2021 10:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0DA2218C2; Sat, 6 Mar 2021 10:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 126AJpeD069192; Sat, 6 Mar 2021 10:19:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126AJpTG069191; Sat, 6 Mar 2021 10:19:51 GMT (envelope-from git) Date: Sat, 6 Mar 2021 10:19:51 GMT Message-Id: <202103061019.126AJpTG069191@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: 9d3b2bcf7610 - main - pf tests: Test tos/dscp matching 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: 9d3b2bcf761041bbe79da3de25f2e4142d90b46a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 10:19:52 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d3b2bcf761041bbe79da3de25f2e4142d90b46a commit 9d3b2bcf761041bbe79da3de25f2e4142d90b46a Author: Kristof Provost AuthorDate: 2021-03-03 20:15:39 +0000 Commit: Kristof Provost CommitDate: 2021-03-06 09:08:44 +0000 pf tests: Test tos/dscp matching MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29078 --- tests/sys/netpfil/pf/Makefile | 3 +- tests/sys/netpfil/pf/tos.sh | 95 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index f00f64d849d2..132b681226dc 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -22,7 +22,8 @@ ATF_TESTS_SH+= altq \ set_tos \ src_track \ synproxy \ - table + table \ + tos ${PACKAGE}FILES+= CVE-2019-5597.py \ CVE-2019-5598.py \ diff --git a/tests/sys/netpfil/pf/tos.sh b/tests/sys/netpfil/pf/tos.sh new file mode 100644 index 000000000000..4e2832ba3317 --- /dev/null +++ b/tests/sys/netpfil/pf/tos.sh @@ -0,0 +1,95 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'tos matching test' + atf_set require.user root +} + +v4_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "pass" \ + "block in tos va" + + atf_check -s exit:0 -o ignore ping -t 1 -c 1 192.0.2.2 + atf_check -s exit:2 -o ignore ping -t 1 -c 1 -z 0xb0 192.0.2.2 +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'IPv6 tos matching test' + atf_set require.user root +} + +v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8:42::1/64 up no_dad -ifdisabled + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 \ + up no_dad -ifdisabled + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "pass" \ + "block in tos va" + + atf_check -s exit:0 -o ignore ping6 -t 1 -c 1 2001:db8:42::2 + atf_check -s exit:2 -o ignore ping6 -t 1 -c 1 -z 176 2001:db8:42::2 +} + +v6_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" + atf_add_test_case "v6" +} From owner-dev-commits-src-all@freebsd.org Sat Mar 6 10:24:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8770B560A85; Sat, 6 Mar 2021 10:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dt11Q3Bpsz3RKm; Sat, 6 Mar 2021 10:24: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 55C5321E90; Sat, 6 Mar 2021 10:24: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 126AOQw6081237; Sat, 6 Mar 2021 10:24:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126AOQIX081236; Sat, 6 Mar 2021 10:24:26 GMT (envelope-from git) Date: Sat, 6 Mar 2021 10:24:26 GMT Message-Id: <202103061024.126AOQIX081236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: d708f23ebb06 - main - loader: cursor off should restore display content MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d708f23ebb06cfc9cf8f96f17a43eb63653b818a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 10:24:26 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=d708f23ebb06cfc9cf8f96f17a43eb63653b818a commit d708f23ebb06cfc9cf8f96f17a43eb63653b818a Author: Toomas Soome AuthorDate: 2021-03-06 10:19:43 +0000 Commit: Toomas Soome CommitDate: 2021-03-06 10:23:54 +0000 loader: cursor off should restore display content When drawing cursor, we should store original display content because there may be image data we would like to restore when the cursor is removed. PR: 254054 Reported by: Jose Luis Duran MFC after: 3 days --- stand/common/gfx_fb.c | 38 ++++++++++++++++++++++++++++++++++++++ stand/common/gfx_fb.h | 2 ++ 2 files changed, 40 insertions(+) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 77cf1d39854f..3eae0a3a859e 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -978,6 +978,7 @@ gfx_fb_fill(void *arg, const teken_rect_t *r, teken_char_t c, static void gfx_fb_cursor_draw(teken_gfx_t *state, const teken_pos_t *p, bool on) { + unsigned x, y, width, height; const uint8_t *glyph; int idx; @@ -985,10 +986,47 @@ gfx_fb_cursor_draw(teken_gfx_t *state, const teken_pos_t *p, bool on) if (idx >= state->tg_tp.tp_col * state->tg_tp.tp_row) return; + width = state->tg_font.vf_width; + height = state->tg_font.vf_height; + x = state->tg_origin.tp_col + p->tp_col * width; + y = state->tg_origin.tp_row + p->tp_row * height; + + /* + * Save original display content to preserve image data. + */ + if (on) { + if (state->tg_cursor_image == NULL || + state->tg_cursor_size != width * height * 4) { + free(state->tg_cursor_image); + state->tg_cursor_size = width * height * 4; + state->tg_cursor_image = malloc(state->tg_cursor_size); + } + if (state->tg_cursor_image != NULL) { + if (gfxfb_blt(state->tg_cursor_image, + GfxFbBltVideoToBltBuffer, x, y, 0, 0, + width, height, 0) != 0) { + free(state->tg_cursor_image); + state->tg_cursor_image = NULL; + } + } + } else { + /* + * Restore display from tg_cursor_image. + * If there is no image, restore char from screen_buffer. + */ + if (state->tg_cursor_image != NULL && + gfxfb_blt(state->tg_cursor_image, GfxFbBltBufferToVideo, + 0, 0, x, y, width, height, 0) == 0) { + state->tg_cursor = *p; + return; + } + } + glyph = font_lookup(&state->tg_font, screen_buffer[idx].c, &screen_buffer[idx].a); gfx_bitblt_bitmap(state, glyph, &screen_buffer[idx].a, 0xff, on); gfx_fb_printchar(state, p); + state->tg_cursor = *p; } diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index ac63d7939cef..89b060a02cf9 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -210,6 +210,8 @@ typedef struct teken_gfx { teken_t tg_teken; /* Teken core */ teken_pos_t tg_cursor; /* Where cursor was drawn */ bool tg_cursor_visible; + uint8_t *tg_cursor_image; /* Memory for cursor */ + size_t tg_cursor_size; teken_pos_t tg_tp; /* Terminal dimensions */ teken_pos_t tg_origin; /* Point of origin in pixels */ uint8_t *tg_glyph; /* Memory for glyph */ From owner-dev-commits-src-all@freebsd.org Sat Mar 6 10:33:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C2CF560DD1; Sat, 6 Mar 2021 10:33:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_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 4Dt1Cs14kbz3hGr; Sat, 6 Mar 2021 10:33:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 29201260202; Sat, 6 Mar 2021 11:33:21 +0100 (CET) Subject: Re: git: 600eade2fb4f - main - Add ifa_try_ref() to simplify ifa handling inside epoch. To: "Alexander V. Chernikov" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102162018.11GKIs1U039108@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <938ca724-5f45-1d94-c22e-df348abdd030@selasky.org> Date: Sat, 6 Mar 2021 11:33:03 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <202102162018.11GKIs1U039108@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Dt1Cs14kbz3hGr X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.25 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; 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]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; ARC_NA(0.00)[]; DMARC_NA(0.00)[selasky.org]; SPAMHAUS_ZRD(0.00)[88.99.82.50:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RBL_DBL_DONT_QUERY_IPS(0.00)[88.99.82.50:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.948]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 10:33:30 -0000 On 2/16/21 9:18 PM, Alexander V. Chernikov wrote: > The branch main has been updated by melifaro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=600eade2fb4faacfcd408a01140ef15f85f0c817 > > commit 600eade2fb4faacfcd408a01140ef15f85f0c817 > Author: Alexander V. Chernikov > AuthorDate: 2021-02-16 20:12:58 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2021-02-16 20:14:50 +0000 > > Add ifa_try_ref() to simplify ifa handling inside epoch. > > More and more code migrates from lock-based protection to the NET_EPOCH > umbrella. It requires some logic changes, including, notably, refcount > handling. > > When we have an `ifa` pointer and we're running inside epoch we're > guaranteed that this pointer will not be freed. > However, the following case can still happen: > * in thread 1 we drop to 0 refcount for ifa and schedule its deletion. > * in thread 2 we use this ifa and reference it > * destroy callout kicks in > * unhappy user reports bug > > To address it, new `ifa_try_ref()` function is added, allowing to return > failure when we try to reference `ifa` with 0 refcount. > Additionally, existing `ifa_ref()` is enforced with `KASSERT` to provide > cleaner error in such scenarious. > > Reviewed By: rstone, donner > Differential Revision: https://reviews.freebsd.org/D28639 > MFC after: 1 week > --- > sys/net/if.c | 12 +++++++++++- > sys/net/if_var.h | 1 + > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/sys/net/if.c b/sys/net/if.c > index c85cfab19bf6..948be6876b65 100644 > --- a/sys/net/if.c > +++ b/sys/net/if.c > @@ -1857,8 +1857,18 @@ fail: > void > ifa_ref(struct ifaddr *ifa) > { > + u_int old; > > - refcount_acquire(&ifa->ifa_refcnt); > + old = refcount_acquire(&ifa->ifa_refcnt); > + KASSERT(old > 0, ("%s: ifa %p has 0 refs", __func__, ifa)); > +} > + > +int > +ifa_try_ref(struct ifaddr *ifa) > +{ > + > + NET_EPOCH_ASSERT(); > + return (refcount_acquire_if_not_zero(&ifa->ifa_refcnt)); > } > > static void > diff --git a/sys/net/if_var.h b/sys/net/if_var.h > index 9ecdfb684296..291a7781d73c 100644 > --- a/sys/net/if_var.h > +++ b/sys/net/if_var.h > @@ -577,6 +577,7 @@ struct ifaddr { > struct ifaddr * ifa_alloc(size_t size, int flags); > void ifa_free(struct ifaddr *ifa); > void ifa_ref(struct ifaddr *ifa); > +int ifa_try_ref(struct ifaddr *ifa); I think you should add __result_use_check for this prototype!? --HPS From owner-dev-commits-src-all@freebsd.org Sat Mar 6 10:33:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5275560C35; Sat, 6 Mar 2021 10:33:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_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 4Dt1DP3YDpz3hNV; Sat, 6 Mar 2021 10:33:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 32CA9260202; Sat, 6 Mar 2021 11:33:49 +0100 (CET) Subject: Re: git: 7563019bc693 - main - Add if_try_ref() to simplify refcount handling inside epoch. To: "Alexander V. Chernikov" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102222338.11MNcBem084739@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <1db9ff12-55d7-da4d-dde9-d7e9045fffc4@selasky.org> Date: Sat, 6 Mar 2021 11:33:34 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <202102222338.11MNcBem084739@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Dt1DP3YDpz3hNV X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.28 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c17:6c4b::2:from]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c17:6c4b::2:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.981]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 10:33:58 -0000 On 2/23/21 12:38 AM, Alexander V. Chernikov wrote: > The branch main has been updated by melifaro: > diff --git a/sys/net/if_var.h b/sys/net/if_var.h > index 291a7781d73c..33a737880a8d 100644 > --- a/sys/net/if_var.h > +++ b/sys/net/if_var.h > @@ -661,6 +661,7 @@ void if_link_state_change(struct ifnet *, int); > int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); > void if_ref(struct ifnet *); > void if_rele(struct ifnet *); > +bool if_try_ref(struct ifnet *); I think you should add __result_use_check for this prototype!? > int if_setlladdr(struct ifnet *, const u_char *, int); > int if_tunnel_check_nesting(struct ifnet *, struct mbuf *, uint32_t, int); > void if_up(struct ifnet *); > --HPS From owner-dev-commits-src-all@freebsd.org Sat Mar 6 10:41:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BDFF560FB6; Sat, 6 Mar 2021 10:41: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 4Dt1NX44rvz3hvk; Sat, 6 Mar 2021 10:41: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 7F6C322103; Sat, 6 Mar 2021 10:41: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 126Af0SK003185; Sat, 6 Mar 2021 10:41:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126Af0Eq003184; Sat, 6 Mar 2021 10:41:00 GMT (envelope-from git) Date: Sat, 6 Mar 2021 10:41:00 GMT Message-Id: <202103061041.126Af0Eq003184@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: c743a6bd4fc0 - main - Implement mallocarray_domainset(9) variant of mallocarray(9). 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: c743a6bd4fc0d1be30f9bc9996333ac0ba079563 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 10:41:00 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=c743a6bd4fc0d1be30f9bc9996333ac0ba079563 commit c743a6bd4fc0d1be30f9bc9996333ac0ba079563 Author: Hans Petter Selasky AuthorDate: 2021-03-06 10:25:12 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-06 10:38:55 +0000 Implement mallocarray_domainset(9) variant of mallocarray(9). Reviewed by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- share/man/man9/Makefile | 1 + share/man/man9/malloc.9 | 13 ++++++++++++- sys/kern/kern_malloc.c | 11 +++++++++++ sys/sys/malloc.h | 3 +++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 64e234c3d696..fb010231d710 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1391,6 +1391,7 @@ MLINKS+=make_dev.9 destroy_dev.9 \ MLINKS+=malloc.9 free.9 \ malloc.9 malloc_domainset.9 \ malloc.9 mallocarray.9 \ + malloc.9 mallocarray_domainset.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ malloc.9 realloc.9 \ diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9 index 097688d7ea38..b8c6e504e0c0 100644 --- a/share/man/man9/malloc.9 +++ b/share/man/man9/malloc.9 @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd October 30, 2020 +.Dd March 6, 2021 .Dt MALLOC 9 .Os .Sh NAME @@ -70,6 +70,8 @@ .Fn malloc_domainset "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" .Ft void * .Fn malloc_domainset_exec "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" +.Ft void * +.Fn mallocarray_domainset "size_t nmemb" "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" .Sh DESCRIPTION The .Fn malloc @@ -102,6 +104,15 @@ entries whose size is specified by .Fa size . .Pp The +.Fn mallocarray_domainset +variant allocates memory from a specific +.Xr numa 4 +domain using the specified domain selection policy. +See +.Xr domainset 9 +for some example policies. +.Pp +The .Fn free function releases memory at address .Fa addr diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index eff9e62c9a10..48383358e3ad 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -804,6 +804,17 @@ mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) return (malloc(size * nmemb, type, flags)); } +void * +mallocarray_domainset(size_t nmemb, size_t size, struct malloc_type *type, + struct domainset *ds, int flags) +{ + + if (WOULD_OVERFLOW(nmemb, size)) + panic("mallocarray_domainset: %zu * %zu overflowed", nmemb, size); + + return (malloc_domainset(size * nmemb, type, ds, flags)); +} + #ifdef INVARIANTS static void free_save_type(void *addr, struct malloc_type *mtp, u_long size) diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 54a05e94a3a2..0c585c5a0dcf 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -246,6 +246,9 @@ void *malloc_domainset(size_t size, struct malloc_type *type, void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size2(1, 2); +void *mallocarray_domainset(size_t nmemb, size_t size, struct malloc_type *type, + struct domainset *ds, int flags) __malloc_like __result_use_check + __alloc_size2(1, 2); void *malloc_exec(size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1); void *malloc_domainset_exec(size_t size, struct malloc_type *type, From owner-dev-commits-src-all@freebsd.org Sat Mar 6 11:34:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 493EA562BBD; Sat, 6 Mar 2021 11:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dt2Yj1cK3z3mHW; Sat, 6 Mar 2021 11:34: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 2A1E122C9A; Sat, 6 Mar 2021 11:34: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 126BY1gp073406; Sat, 6 Mar 2021 11:34:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126BY1KE073405; Sat, 6 Mar 2021 11:34:01 GMT (envelope-from git) Date: Sat, 6 Mar 2021 11:34:01 GMT Message-Id: <202103061134.126BY1KE073405@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: e797dc58bd29 - main - arm64: Add support for bcm2838 RNG 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: e797dc58bd29c5bc0873fc620fc11d5332f90e7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 11:34:01 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e797dc58bd29c5bc0873fc620fc11d5332f90e7f commit e797dc58bd29c5bc0873fc620fc11d5332f90e7f Author: Gordon Bergling AuthorDate: 2021-03-06 11:28:35 +0000 Commit: Gordon Bergling CommitDate: 2021-03-06 11:28:35 +0000 arm64: Add support for bcm2838 RNG The hardware random number generator of the RPi4 differs slightly from the version found on the RPi3. This commit extends the existing bcm2835_rng driver to function on the RPi4. Submitted by: James Mintram Reviewed by: markm, cem, delphij Approved by: csprng(cem, markm) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22493 --- sys/arm/broadcom/bcm2835/bcm2835_rng.c | 174 +++++++++++++++++++++++++-------- 1 file changed, 133 insertions(+), 41 deletions(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_rng.c b/sys/arm/broadcom/bcm2835/bcm2835_rng.c index b73580c5eb53..c403bc3542e0 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_rng.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_rng.c @@ -69,21 +69,26 @@ static device_probe_t bcm2835_rng_probe; #define RNG_RBG2X 0x00000002 /* RBG 2X SPEED */ #define RNG_RBGEN_BIT 0x00000001 /* Enable RNG bit */ -#define RNG_STATUS 0x04 /* RNG status register */ -#define RND_VAL_SHIFT 24 /* Shift for valid words */ -#define RND_VAL_MASK 0x000000ff /* Number valid words mask */ -#define RND_VAL_WARM_CNT 0x40000 /* RNG Warm Up count */ -#define RND_WARM_CNT 0xfffff /* RNG Warm Up Count mask */ +#define BCM2835_RNG_STATUS 0x04 /* BCM2835 RNG status register */ +#define BCM2838_RNG_STATUS 0x18 /* BCM2838 RNG status register */ -#define RNG_DATA 0x08 /* RNG Data Register */ +#define BCM2838_RNG_COUNT 0x24 /* How many values available */ +#define BCM2838_COUNT_VAL_MASK 0x000000ff + +#define BCM2835_RND_VAL_SHIFT 24 /* Shift for valid words */ +#define BCM2835_RND_VAL_MASK 0x000000ff /* Number valid words mask */ +#define BCM2835_RND_VAL_WARM_CNT 0x40000 /* RNG Warm Up count */ +#define BCM2835_RND_WARM_CNT 0xfffff /* RNG Warm Up Count mask */ + +#define BCM2835_RNG_DATA 0x08 /* RNG Data Register */ +#define BCM2838_RNG_DATA 0x20 #define RNG_FF_THRES 0x0c #define RNG_FF_THRES_MASK 0x0000001f -#define RNG_INT_MASK 0x10 -#define RNG_INT_OFF_BIT 0x00000001 +#define BCM2835_RNG_INT_MASK 0x10 +#define BCM2835_RNG_INT_OFF_BIT 0x00000001 #define RNG_FF_DEFAULT 0x10 /* FIFO threshold default */ - #define RNG_FIFO_WORDS (RNG_FF_DEFAULT / sizeof(uint32_t)) #define RNG_NUM_OSCILLATORS 6 @@ -91,11 +96,55 @@ static device_probe_t bcm2835_rng_probe; #define RNG_CALLOUT_TICKS (hz * 4) +struct bcm_rng_conf { + bus_size_t control_reg; + bus_size_t status_reg; + bus_size_t count_reg; + bus_size_t data_reg; + bus_size_t intr_mask_reg; + uint32_t intr_disable_bit; + uint32_t count_value_shift; + uint32_t count_value_mask; + uint32_t warmup_count; + bool allow_2x_mode; + bool can_diagnose; + /* XXX diag regs */ +}; + +static const struct bcm_rng_conf bcm2835_rng_conf = { + .control_reg = RNG_CTRL, + .status_reg = BCM2835_RNG_STATUS, + .count_reg = BCM2835_RNG_STATUS, /* Same register */ + .data_reg = BCM2835_RNG_DATA, + .intr_mask_reg = BCM2835_RNG_INT_MASK, + .intr_disable_bit = BCM2835_RNG_INT_OFF_BIT, + .count_value_shift = BCM2835_RND_VAL_SHIFT, + .count_value_mask = BCM2835_RND_VAL_MASK, + .warmup_count = BCM2835_RND_VAL_WARM_CNT, + .allow_2x_mode = true, + .can_diagnose = true +}; + +static const struct bcm_rng_conf bcm2838_rng_conf = { + .control_reg = RNG_CTRL, + .status_reg = BCM2838_RNG_STATUS, + .count_reg = BCM2838_RNG_COUNT, + .data_reg = BCM2838_RNG_DATA, + .intr_mask_reg = 0, + .intr_disable_bit = 0, + .count_value_shift = 0, + .count_value_mask = BCM2838_COUNT_VAL_MASK, + .warmup_count = 0, + .allow_2x_mode = false, + .can_diagnose = false +}; + struct bcm2835_rng_softc { device_t sc_dev; struct resource * sc_mem_res; struct resource * sc_irq_res; void * sc_intr_hdl; + struct bcm_rng_conf const* conf; uint32_t sc_buf[RNG_FIFO_WORDS]; struct callout sc_rngto; int sc_stall_count; @@ -104,8 +153,15 @@ struct bcm2835_rng_softc { }; static struct ofw_compat_data compat_data[] = { - {"broadcom,bcm2835-rng", 1}, - {"brcm,bcm2835-rng", 1}, + {"broadcom,bcm2835-rng", (uintptr_t)&bcm2835_rng_conf}, + {"brcm,bcm2835-rng", (uintptr_t)&bcm2835_rng_conf}, + + {"brcm,bcm2711-rng200", (uintptr_t)&bcm2838_rng_conf}, + {"brcm,bcm2838-rng", (uintptr_t)&bcm2838_rng_conf}, + {"brcm,bcm2838-rng200", (uintptr_t)&bcm2838_rng_conf}, + {"brcm,bcm7211-rng", (uintptr_t)&bcm2838_rng_conf}, + {"brcm,bcm7278-rng", (uintptr_t)&bcm2838_rng_conf}, + {"brcm,iproc-rng200", (uintptr_t)&bcm2838_rng_conf}, {NULL, 0} }; @@ -144,8 +200,12 @@ bcm2835_rng_dump_registers(struct bcm2835_rng_softc *sc, struct sbuf *sbp) uint32_t comblk2_osc, comblk1_osc, jclk_byp_div, val; int i; + if (!sc->conf->can_diagnose) + /* Not implemented. */ + return; + /* Display RNG control register contents */ - val = bcm2835_rng_read4(sc, RNG_CTRL); + val = bcm2835_rng_read4(sc, sc->conf->control_reg); sbuf_printf(sbp, "RNG_CTRL (%08x)\n", val); comblk2_osc = (val & RNG_COMBLK2_OSC) >> RNG_COMBLK2_OSC_SHIFT; @@ -181,20 +241,20 @@ bcm2835_rng_dump_registers(struct bcm2835_rng_softc *sc, struct sbuf *sbp) sbuf_cat(sbp, " RNG_RBGEN_BIT: RBG enabled\n"); /* Display RNG status register contents */ - val = bcm2835_rng_read4(sc, RNG_STATUS); + val = bcm2835_rng_read4(sc, sc->conf->status_reg); sbuf_printf(sbp, "RNG_CTRL (%08x)\n", val); sbuf_printf(sbp, " RND_VAL: %02x\n", - (val >> RND_VAL_SHIFT) & RND_VAL_MASK); - sbuf_printf(sbp, " RND_WARM_CNT: %05x\n", val & RND_WARM_CNT); + (val >> sc->conf->count_value_shift) & sc->conf->count_value_mask); + sbuf_printf(sbp, " RND_WARM_CNT: %05x\n", val & sc->conf->warmup_count); /* Display FIFO threshold register contents */ val = bcm2835_rng_read4(sc, RNG_FF_THRES); sbuf_printf(sbp, "RNG_FF_THRES: %05x\n", val & RNG_FF_THRES_MASK); /* Display interrupt mask register contents */ - val = bcm2835_rng_read4(sc, RNG_INT_MASK); + val = bcm2835_rng_read4(sc, sc->conf->intr_mask_reg); sbuf_printf(sbp, "RNG_INT_MASK: interrupt %s\n", - ((val & RNG_INT_OFF_BIT) != 0) ? "disabled" : "enabled"); + ((val & sc->conf->intr_disable_bit) != 0) ? "disabled" : "enabled"); } static void @@ -203,9 +263,9 @@ bcm2835_rng_disable_intr(struct bcm2835_rng_softc *sc) uint32_t mask; /* Set the interrupt off bit in the interrupt mask register */ - mask = bcm2835_rng_read4(sc, RNG_INT_MASK); - mask |= RNG_INT_OFF_BIT; - bcm2835_rng_write4(sc, RNG_INT_MASK, mask); + mask = bcm2835_rng_read4(sc, sc->conf->intr_mask_reg); + mask |= sc->conf->intr_disable_bit; + bcm2835_rng_write4(sc, sc->conf->intr_mask_reg, mask); } static void @@ -214,17 +274,20 @@ bcm2835_rng_start(struct bcm2835_rng_softc *sc) uint32_t ctrl; /* Disable the interrupt */ - bcm2835_rng_disable_intr(sc); + if (sc->conf->intr_mask_reg) + bcm2835_rng_disable_intr(sc); /* Set the warmup count */ - bcm2835_rng_write4(sc, RNG_STATUS, RND_VAL_WARM_CNT); + if (sc->conf->warmup_count > 0) + bcm2835_rng_write4(sc, sc->conf->status_reg, + sc->conf->warmup_count); /* Enable the RNG */ - ctrl = bcm2835_rng_read4(sc, RNG_CTRL); + ctrl = bcm2835_rng_read4(sc, sc->conf->control_reg); ctrl |= RNG_RBGEN_BIT; - if (sc->sc_rbg2x) + if (sc->sc_rbg2x && sc->conf->allow_2x_mode) ctrl |= RNG_RBG2X; - bcm2835_rng_write4(sc, RNG_CTRL, ctrl); + bcm2835_rng_write4(sc, sc->conf->control_reg, ctrl); } static void @@ -233,16 +296,39 @@ bcm2835_rng_stop(struct bcm2835_rng_softc *sc) uint32_t ctrl; /* Disable the RNG */ - ctrl = bcm2835_rng_read4(sc, RNG_CTRL); + ctrl = bcm2835_rng_read4(sc, sc->conf->control_reg); ctrl &= ~RNG_RBGEN_BIT; - bcm2835_rng_write4(sc, RNG_CTRL, ctrl); + bcm2835_rng_write4(sc, sc->conf->control_reg, ctrl); +} + +static void +bcm2835_rng_enqueue_harvest(struct bcm2835_rng_softc *sc, uint32_t nread) +{ + char *sc_buf_chunk; + uint32_t chunk_size; + uint32_t cnt; + + chunk_size = sizeof(((struct harvest_event *)0)->he_entropy); + cnt = nread * sizeof(uint32_t); + sc_buf_chunk = (void*)sc->sc_buf; + + while (cnt > 0) { + uint32_t size; + + size = MIN(cnt, chunk_size); + + random_harvest_queue(sc_buf_chunk, size, RANDOM_PURE_BROADCOM); + + sc_buf_chunk += size; + cnt -= size; + } } static void bcm2835_rng_harvest(void *arg) { uint32_t *dest; - uint32_t status; + uint32_t hwcount; u_int cnt, nread, num_avail, num_words; int seen_underrun, num_stalls; struct bcm2835_rng_softc *sc = arg; @@ -250,11 +336,13 @@ bcm2835_rng_harvest(void *arg) dest = sc->sc_buf; nread = num_words = 0; seen_underrun = num_stalls = 0; + for (cnt = sizeof(sc->sc_buf) / sizeof(uint32_t); cnt > 0; cnt -= num_words) { - /* Read status register to find out how many words available */ - status = bcm2835_rng_read4(sc, RNG_STATUS); - num_avail = (status >> RND_VAL_SHIFT) & RND_VAL_MASK; + /* Read count register to find out how many words available */ + hwcount = bcm2835_rng_read4(sc, sc->conf->count_reg); + num_avail = (hwcount >> sc->conf->count_value_shift) & + sc->conf->count_value_mask; /* If we have none... */ if (num_avail == 0) { @@ -282,15 +370,13 @@ bcm2835_rng_harvest(void *arg) /* Pull MIN(num_avail, cnt) words from the FIFO */ num_words = (num_avail > cnt) ? cnt : num_avail; - bcm2835_rng_read_multi4(sc, RNG_DATA, dest, + bcm2835_rng_read_multi4(sc, sc->conf->data_reg, dest, num_words); dest += num_words; nread += num_words; } - cnt = nread * sizeof(uint32_t); - if (cnt > 0) - random_harvest_queue(sc->sc_buf, cnt, RANDOM_PURE_BROADCOM); + bcm2835_rng_enqueue_harvest(sc, nread); callout_reset(&sc->sc_rngto, RNG_CALLOUT_TICKS, bcm2835_rng_harvest, sc); } @@ -347,7 +433,7 @@ bcm2835_rng_probe(device_t dev) if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "Broadcom BCM2835 RNG"); + device_set_desc(dev, "Broadcom BCM2835/BCM2838 RNG"); return (BUS_PROBE_DEFAULT); } @@ -363,13 +449,18 @@ bcm2835_rng_attach(device_t dev) error = 0; sc = device_get_softc(dev); sc->sc_dev = dev; + + sc->conf = (void const*)ofw_bus_search_compatible(dev, compat_data)->ocd_data; + KASSERT(sc->conf != NULL, ("bcm2835_rng_attach: sc->conf == NULL")); + sc->sc_stall_count = RNG_STALL_COUNT_DEFAULT; /* Initialize callout */ callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); - TUNABLE_INT_FETCH("bcmrng.2xspeed", &sc->sc_rbg2x); TUNABLE_INT_FETCH("bcmrng.stall_count", &sc->sc_stall_count); + if (sc->conf->allow_2x_mode) + TUNABLE_INT_FETCH("bcmrng.2xspeed", &sc->sc_rbg2x); /* Allocate memory resources */ rid = 0; @@ -402,9 +493,10 @@ bcm2835_rng_attach(device_t dev) SYSCTL_ADD_LONG(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "underrun", CTLFLAG_RD, &sc->sc_underrun, "Number of FIFO underruns"); - SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "2xspeed", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, - sysctl_bcm2835_rng_2xspeed, "I", "Enable RBG 2X SPEED"); + if (sc->conf->allow_2x_mode) + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "2xspeed", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_bcm2835_rng_2xspeed, "I", "Enable RBG 2X SPEED"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "stall_count", CTLFLAG_RW, &sc->sc_stall_count, RNG_STALL_COUNT_DEFAULT, "Number of underruns to assume RNG stall"); @@ -414,7 +506,7 @@ bcm2835_rng_attach(device_t dev) sysctl_bcm2835_rng_dump, "S", "Dump RNG registers"); #endif - /* + /* * Schedule the initial harvesting one second from now, which should give the * hardware RNG plenty of time to generate the first random bytes. */ From owner-dev-commits-src-all@freebsd.org Sat Mar 6 14:01:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4039C568C61; Sat, 6 Mar 2021 14:01:39 +0000 (UTC) (envelope-from freqlabs@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 4Dt5r31Jzmz4QlS; Sat, 6 Mar 2021 14:01:39 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:68aa:d6bf:9070:399b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D2ED92456B; Sat, 6 Mar 2021 14:01:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: git: c4ba4aa54718 - main - libifconfig: Overhaul ifconfig_media_* interfaces To: Kristof Provost , Mark Johnston Cc: Ryan Moeller , Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103051123.125BNubR059014@gitrepo.freebsd.org> <20c6efb4-8b57-ae78-3808-b49b07ac284d@FreeBSD.org> From: Ryan Moeller Message-ID: Date: Sat, 6 Mar 2021 09:01:37 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 14:01:39 -0000 On 3/6/21 4:07 AM, Kristof Provost wrote: > > On 5 Mar 2021, at 20:44, Mark Johnston wrote: > > On Fri, Mar 05, 2021 at 02:40:29PM -0500, Ryan Moeller wrote: > > On 3/5/21 1:19 PM, Konstantin Belousov wrote: > > On Fri, Mar 05, 2021 at 11:23:56AM +0000, Ryan Moeller wrote: > > The branch main has been updated by freqlabs: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=c4ba4aa547184ab401204096cdad9def4ab37964 > > > commit c4ba4aa547184ab401204096cdad9def4ab37964 > Author: Ryan Moeller > AuthorDate: 2021-03-02 10:29:17 +0000 > Commit: Ryan Moeller > CommitDate: 2021-03-05 09:15:55 +0000 > > libifconfig: Overhaul ifconfig_media_* interfaces > > Define an ifmedia_t type to use for ifmedia words. > > Add ifconfig_media_lookup_* functions to lookup > ifmedia words by name. > > Get media options as an array of option names rather > than formatting it > as a comma-delimited list into a buffer. > > Sprinkle const on static the static description tables > for peace of > mind. > > Don't need to zero memory allocated by calloc. > > Reviewed by: kp > MFC after: 2 weeks > Differential Revision: > https://reviews.freebsd.org/D29029 > > --- > lib/libifconfig/Makefile | 2 +- > lib/libifconfig/Symbol.map | 9 +- > lib/libifconfig/libifconfig.h | 69 +++++++- > lib/libifconfig/libifconfig_media.c | 339 > ++++++++++++++++++++++++------------ > share/examples/libifconfig/status.c | 27 ++- > 5 files changed, 324 insertions(+), 122 deletions(-) > > diff --git a/lib/libifconfig/Makefile > b/lib/libifconfig/Makefile > index 73dad36c1dc5..c6f006018427 100644 > --- a/lib/libifconfig/Makefile > +++ b/lib/libifconfig/Makefile > @@ -7,7 +7,7 @@ INTERNALLIB= true > LIBADD= m > > SHLIBDIR?= /lib > -SHLIB_MAJOR= 1 > +SHLIB_MAJOR= 2 > > VERSION_DEF= ${LIBCSRCDIR}/Versions.def > SYMBOL_MAPS= ${.CURDIR}/Symbol.map > > libifconfig is marked as internal, but we provide symbol > versioning for it, > and do it in the normal FreeBSD namespace. On one hand, > our policy is to > not bump symvered libs and to provide binary compat shims > as needed, on the > other, this is internal lib. > > What is the purpose of maintaining symbol versions for it? > > I have work in progress that changes libifconfig to a private > lib. I'm > not sure why markj@ added the symbol map, but I've been forced to > maintain it for my later changes to work. > > I added it because there was some discussion of making it a public > library, and adding a symbol map was a step towards that. If it is > only > going to be a private library, then there's indeed no reason to > maintain > it. > > Historically it’s been the aspiration (passive voice, because while > these have been my hopes I’ve not done any of the work) to make this a > public library, so e.g. appliance vendors could have a better way to > configure the system than doing |system(“ifconfig em0 10.0.0.1/24”);|. > Libifconfig is making progress thanks to Ryan’s work, but it’s not yet > ready for that sort of use. > > Given that, it makes sense to keep it as an internal library for now, > and breaking the API is fine. I still hope that we’ll get it to the > point where it’ll be ready for public consumption (with stable API). > > So I think the symbol map is mostly aspirational right now. If it’s a > maintenance burden I guess we can remove it, and re-add it when the > time comes. > > Best regards, > Kristof > Speaking for myself, I don't find it too much of a burden to keep on top of Symbol.map, but it does feel awkward bumping SHLIB_MAJOR if I don't have to. If it's not necessary to do so for a private library then I will gladly keep it at 2 or even drop it back to 1 if that is preferred while I'm still fleshing out the API. I do have the library switched from internal to private in my local branch so it can be shared with the libifconfig bindings for flua that I've been keeping in sync with the library. From owner-dev-commits-src-all@freebsd.org Sat Mar 6 14:44:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C89C7569D4C; Sat, 6 Mar 2021 14:44: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 4Dt6p159bhz4SyQ; Sat, 6 Mar 2021 14:44: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 A05D725600; Sat, 6 Mar 2021 14:44: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 126EivVX023214; Sat, 6 Mar 2021 14:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126Eivsp023213; Sat, 6 Mar 2021 14:44:57 GMT (envelope-from git) Date: Sat, 6 Mar 2021 14:44:57 GMT Message-Id: <202103061444.126Eivsp023213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tai-hwa Liang Subject: git: 092f3f081265 - main - net: fixing a memory leak in if_deregister_com_alloc() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avatar X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 092f3f081265c68cd8de0234ba8e46560ccc061e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 14:44:57 -0000 The branch main has been updated by avatar: URL: https://cgit.FreeBSD.org/src/commit/?id=092f3f081265c68cd8de0234ba8e46560ccc061e commit 092f3f081265c68cd8de0234ba8e46560ccc061e Author: Tai-hwa Liang AuthorDate: 2021-03-06 14:36:35 +0000 Commit: Tai-hwa Liang CommitDate: 2021-03-06 14:43:16 +0000 net: fixing a memory leak in if_deregister_com_alloc() Drain the callbacks upon if_deregister_com_alloc() such that the if_com_free[type] won't be nullified before if_destroy(). Taking fwip(4) as an example, before this fix, kldunload if_fwip will go through the following: 1. fwip_detach() 2. if_free() -> schedule if_destroy() through NET_EPOCH_CALL 3. fwip_detach() returns 4. firewire_modevent(MOD_UNLOAD) -> if_deregister_com_alloc() 5. kernel complains about: Warning: memory type fw_com leaked memory on destroy (1 allocations, 64 bytes leaked). 6. EPOCH runs if_destroy() -> if_free_internal()i By this time, if_com_free[if_alloctype] is NULL since it's already nullified by if_deregister_com_alloc(); hence, firewire_free() won't have a chance to release the allocated fw_com. Reviewed by: hselasky, glebius MFC after: 2 weeks --- sys/net/if.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index 9d5e9e26b4bb..86c60cfcfa7f 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4055,6 +4055,14 @@ if_deregister_com_alloc(u_char type) ("if_deregister_com_alloc: %d not registered", type)); KASSERT(if_com_free[type] != NULL, ("if_deregister_com_alloc: %d free not registered", type)); + + /* + * Ensure all pending EPOCH(9) callbacks have been executed. This + * fixes issues about late invocation of if_destroy(), which leads + * to memory leak from if_com_alloc[type] allocated if_l2com. + */ + epoch_drain_callbacks(net_epoch_preempt); + if_com_alloc[type] = NULL; if_com_free[type] = NULL; } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 17:45:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F49656DAF1; Sat, 6 Mar 2021 17:45: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 4DtBpR72cDz4cVx; Sat, 6 Mar 2021 17:45: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 E076C2744D; Sat, 6 Mar 2021 17:45: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 126HjZwp061278; Sat, 6 Mar 2021 17:45:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126HjZT4061277; Sat, 6 Mar 2021 17:45:35 GMT (envelope-from git) Date: Sat, 6 Mar 2021 17:45:35 GMT Message-Id: <202103061745.126HjZT4061277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: eb8bf6bb4204 - main - Fix 'make bmake' top-level bootstrapping. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb8bf6bb4204c302e2329b68c8a930be5d44bc9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 17:45:36 -0000 The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=eb8bf6bb4204c302e2329b68c8a930be5d44bc9c commit eb8bf6bb4204c302e2329b68c8a930be5d44bc9c Author: Bryan Drewery AuthorDate: 2021-03-06 17:45:08 +0000 Commit: Bryan Drewery CommitDate: 2021-03-06 17:45:08 +0000 Fix 'make bmake' top-level bootstrapping. Fixes: ee10666327b62 --- Makefile | 2 +- usr.bin/bmake/Makefile.inc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1a1739acb0fe..3b37b7e1f669 100644 --- a/Makefile +++ b/Makefile @@ -458,7 +458,7 @@ MMAKE= ${MMAKEENV} ${MAKE} \ OBJTOP=${MYMAKE:H}/obj \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ - MAN= -DNO_SHARED \ + MK_MAN=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WERROR=no \ -DNO_SUBDIR \ DESTDIR= PROGNAME=${MYMAKE:T} diff --git a/usr.bin/bmake/Makefile.inc b/usr.bin/bmake/Makefile.inc index 9960f0ceeb2d..8e10a654a754 100644 --- a/usr.bin/bmake/Makefile.inc +++ b/usr.bin/bmake/Makefile.inc @@ -9,9 +9,11 @@ .if exists(${.CURDIR}/tests) PROG= make +.if ${PROGNAME:U} != "bmake" LINKS= ${BINDIR}/make ${BINDIR}/bmake MLINKS= ${MAN} b${MAN} .endif +.endif .if !defined(MK_SHARED_TOOLCHAIN) || ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?= YES From owner-dev-commits-src-all@freebsd.org Sat Mar 6 19:38:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E30157128F; Sat, 6 Mar 2021 19:38: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 4DtFJs45l6z4l7R; Sat, 6 Mar 2021 19:38: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 7B669E9A; Sat, 6 Mar 2021 19:38: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 126JcbAR007034; Sat, 6 Mar 2021 19:38:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126JcbeD007033; Sat, 6 Mar 2021 19:38:37 GMT (envelope-from git) Date: Sat, 6 Mar 2021 19:38:37 GMT Message-Id: <202103061938.126JcbeD007033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: eda8f0575dda - stable/13 - libkvm: Plug couple of memory leaks and check possible calloc(3) failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eda8f0575dda15346116d3be84b205c51c83e20b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 19:38:37 -0000 The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=eda8f0575dda15346116d3be84b205c51c83e20b commit eda8f0575dda15346116d3be84b205c51c83e20b Author: Jung-uk Kim AuthorDate: 2021-03-03 23:10:00 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-06 19:32:51 +0000 libkvm: Plug couple of memory leaks and check possible calloc(3) failure First, r204494 introduced dpcpu_off in struct __kvm and it was allocated from _kvm_dpcpu_init() but it was not free(3)'ed from kvm_close(3). Second, r291406 introduced kvm_nlist2(3) and converted kvm_nlist(3) to use the new function but it did not free the temporary buffer. Also, check possible calloc(3) failure while I am in the neighborhood. Differential Revision: https://reviews.freebsd.org/D29019 (cherry picked from commit 645eaa2ccaed6eea801d07d6a092974fc1713896) (cherry picked from commit 483c6da3a20b2064cd655f7cb19e6b98dee677ff) --- lib/libkvm/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 95c5a580a2dd..b98f2f25e619 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -297,6 +297,8 @@ kvm_close(kvm_t *kd) free((void *) kd->argspc); if (kd->argv != 0) free((void *)kd->argv); + if (kd->dpcpu_initialized != 0) + free(kd->dpcpu_off); if (kd->pt_map != NULL) free(kd->pt_map); if (kd->page_map != NULL) @@ -340,6 +342,10 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) if (count == 0) return (0); kl = calloc(count + 1, sizeof(*kl)); + if (kl == NULL) { + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (-1); + } for (i = 0; i < count; i++) kl[i].n_name = nl[i].n_name; nfail = kvm_nlist2(kd, kl); @@ -349,6 +355,7 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) nl[i].n_desc = 0; nl[i].n_value = kl[i].n_value; } + free(kl); return (nfail); } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 19:38:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4100C5711A1; Sat, 6 Mar 2021 19:38: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 4DtFK22RYvz4lM0; Sat, 6 Mar 2021 19:38: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 1714CE9B; Sat, 6 Mar 2021 19:38: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 126Jci4Y007154; Sat, 6 Mar 2021 19:38:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126JcimQ007153; Sat, 6 Mar 2021 19:38:44 GMT (envelope-from git) Date: Sat, 6 Mar 2021 19:38:44 GMT Message-Id: <202103061938.126JcimQ007153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 24ee1eb2b680 - stable/12 - libkvm: Plug couple of memory leaks and check possible calloc(3) failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 24ee1eb2b680b5ee1e6943f6dbc76d98a640d9d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 19:38:47 -0000 The branch stable/12 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=24ee1eb2b680b5ee1e6943f6dbc76d98a640d9d8 commit 24ee1eb2b680b5ee1e6943f6dbc76d98a640d9d8 Author: Jung-uk Kim AuthorDate: 2021-03-03 23:10:00 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-06 19:35:10 +0000 libkvm: Plug couple of memory leaks and check possible calloc(3) failure First, r204494 introduced dpcpu_off in struct __kvm and it was allocated from _kvm_dpcpu_init() but it was not free(3)'ed from kvm_close(3). Second, r291406 introduced kvm_nlist2(3) and converted kvm_nlist(3) to use the new function but it did not free the temporary buffer. Also, check possible calloc(3) failure while I am in the neighborhood. Differential Revision: https://reviews.freebsd.org/D29019 (cherry picked from commit 645eaa2ccaed6eea801d07d6a092974fc1713896) (cherry picked from commit 483c6da3a20b2064cd655f7cb19e6b98dee677ff) --- lib/libkvm/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 2f35f26df1ca..2a148399a211 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -295,6 +295,8 @@ kvm_close(kvm_t *kd) free((void *) kd->argspc); if (kd->argv != 0) free((void *)kd->argv); + if (kd->dpcpu_initialized != 0) + free(kd->dpcpu_off); if (kd->pt_map != NULL) free(kd->pt_map); if (kd->page_map != NULL) @@ -338,6 +340,10 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) if (count == 0) return (0); kl = calloc(count + 1, sizeof(*kl)); + if (kl == NULL) { + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (-1); + } for (i = 0; i < count; i++) kl[i].n_name = nl[i].n_name; nfail = kvm_nlist2(kd, kl); @@ -347,6 +353,7 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) nl[i].n_desc = 0; nl[i].n_value = kl[i].n_value; } + free(kl); return (nfail); } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 19:46:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFD1A5711F7; Sat, 6 Mar 2021 19:46: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 4DtFVG61Bfz4lwy; Sat, 6 Mar 2021 19:46: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 C12201153; Sat, 6 Mar 2021 19:46: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 126JkklS019857; Sat, 6 Mar 2021 19:46:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126JkkjE019856; Sat, 6 Mar 2021 19:46:46 GMT (envelope-from git) Date: Sat, 6 Mar 2021 19:46:46 GMT Message-Id: <202103061946.126JkkjE019856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8d25741b633a - releng/13.0 - growfs: allow operation on RW-mounted filesystems 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 8d25741b633af6652fe8bfff1cb157a31e66cc60 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 19:46:46 -0000 The branch releng/13.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8d25741b633af6652fe8bfff1cb157a31e66cc60 commit 8d25741b633af6652fe8bfff1cb157a31e66cc60 Author: Ed Maste AuthorDate: 2021-03-02 22:35:48 +0000 Commit: Ed Maste CommitDate: 2021-03-06 19:46:31 +0000 growfs: allow operation on RW-mounted filesystems growfs supports growing mounted filesystems (writes are temporarily suspended while the grow happens). Drop the check for fs_clean == 0 to restore this case. Leave fs_flags check for FS_UNCLEAN or FS_NEEDSFSCK which represent the state of the filesystem when it was mounted, and fsck should be run first if they are set. PR: 253754 Reviewed by: mckusick Approved by: re (gjb) Fixes: 6eb925f8450f ("Filesystem utilities that modify the...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29021 (cherry picked from commit 0dcde5cc12744e5188300711a8829e5e6a9cd0de) (cherry picked from commit b5920128c7ebcf5060605928263a54b31b317993) --- sbin/growfs/growfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index d1098210f088..510192dada0b 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1461,10 +1461,9 @@ main(int argc, char **argv) } } /* - * Check for unclean filesystem. + * Check for filesystem that was unclean at mount time. */ - if (fs->fs_clean == 0 || - (fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) + if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) errx(1, "%s is not clean - run fsck.\n", *argv); memcpy(&osblock, fs, fs->fs_sbsize); free(fs); From owner-dev-commits-src-all@freebsd.org Sat Mar 6 20:04:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBCC657156F; Sat, 6 Mar 2021 20:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtFvH5QP4z4mZl; Sat, 6 Mar 2021 20:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD103117D; Sat, 6 Mar 2021 20:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 126K4xlh047753; Sat, 6 Mar 2021 20:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126K4xXj047752; Sat, 6 Mar 2021 20:04:59 GMT (envelope-from git) Date: Sat, 6 Mar 2021 20:04:59 GMT Message-Id: <202103062004.126K4xXj047752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 859105d755ce - stable/11 - libkvm: Plug couple of memory leaks and check possible calloc(3) failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 859105d755ce0ead5ab356c67a6234b10650477f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 20:04:59 -0000 The branch stable/11 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=859105d755ce0ead5ab356c67a6234b10650477f commit 859105d755ce0ead5ab356c67a6234b10650477f Author: Jung-uk Kim AuthorDate: 2021-03-03 23:10:00 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-06 20:04:32 +0000 libkvm: Plug couple of memory leaks and check possible calloc(3) failure First, r204494 introduced dpcpu_off in struct __kvm and it was allocated from _kvm_dpcpu_init() but it was not free(3)'ed from kvm_close(3). Second, r291406 introduced kvm_nlist2(3) and converted kvm_nlist(3) to use the new function but it did not free the temporary buffer. Also, check possible calloc(3) failure while I am in the neighborhood. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29019 (cherry picked from commit 645eaa2ccaed6eea801d07d6a092974fc1713896) --- lib/libkvm/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index d6cc7d847ee6..66f38cef41f6 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -559,6 +559,8 @@ kvm_close(kvm_t *kd) free((void *) kd->argspc); if (kd->argv != 0) free((void *)kd->argv); + if (kd->dpcpu_initialized != 0) + free(kd->dpcpu_off); free((void *)kd); return (error); @@ -797,6 +799,10 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) if (count == 0) return (0); kl = calloc(count + 1, sizeof(*kl)); + if (kl == NULL) { + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (-1); + } for (i = 0; i < count; i++) kl[i].n_name = nl[i].n_name; nfail = kvm_nlist2(kd, kl); @@ -806,6 +812,7 @@ kvm_nlist(kvm_t *kd, struct nlist *nl) nl[i].n_desc = 0; nl[i].n_value = kl[i].n_value; } + free(kl); return (nfail); } From owner-dev-commits-src-all@freebsd.org Sat Mar 6 20:25:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F23455720EE; Sat, 6 Mar 2021 20:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtGLS6WVHz4nVN; Sat, 6 Mar 2021 20:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D29911838; Sat, 6 Mar 2021 20:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 126KP48D074202; Sat, 6 Mar 2021 20:25:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126KP4vj074201; Sat, 6 Mar 2021 20:25:04 GMT (envelope-from git) Date: Sat, 6 Mar 2021 20:25:04 GMT Message-Id: <202103062025.126KP4vj074201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 2fa2d50ead44 - releng/13.0 - zfs: fix overly broad locking in spa_vdev_config_exit() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 2fa2d50ead44d148482a05284f5c3524475c8e6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 20:25:05 -0000 The branch releng/13.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=2fa2d50ead44d148482a05284f5c3524475c8e6e commit 2fa2d50ead44d148482a05284f5c3524475c8e6e Author: Martin Matuska AuthorDate: 2021-03-03 01:25:03 +0000 Commit: Martin Matuska CommitDate: 2021-03-06 20:23:22 +0000 zfs: fix overly broad locking in spa_vdev_config_exit() Resolves a deadlock which can occur when the ZED or zpool command attaches a new device. From the openzfs 75a089ed3 commit message: Calling vdev_free() only requires the we acquire the spa config SCL_STATE_ALL locks, not the SCL_ALL locks. In particular, we need need to avoid taking the SCL_CONFIG lock (included in SCL_ALL) as a writer since this can lead to a deadlock. The txg_sync_thread() may block in spa_txg_history_init_io() when taking the SCL_CONFIG lock as a reading when it detects there's a pending writer. Obtained from: openzfs/zfs@75a089ed34befb8d11df9be92a4438cc49554bf6 Approved by: re (delphij) (cherry picked from commit f08e17c8a251210b58d63b52bfe1a77dccff6e78) --- sys/contrib/openzfs/module/zfs/spa_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/spa_misc.c b/sys/contrib/openzfs/module/zfs/spa_misc.c index f49be8eec01a..f11ec0f60574 100644 --- a/sys/contrib/openzfs/module/zfs/spa_misc.c +++ b/sys/contrib/openzfs/module/zfs/spa_misc.c @@ -1275,9 +1275,9 @@ spa_vdev_config_exit(spa_t *spa, vdev_t *vd, uint64_t txg, int error, char *tag) */ vdev_autotrim_stop_wait(vd); - spa_config_enter(spa, SCL_ALL, spa, RW_WRITER); + spa_config_enter(spa, SCL_STATE_ALL, spa, RW_WRITER); vdev_free(vd); - spa_config_exit(spa, SCL_ALL, spa); + spa_config_exit(spa, SCL_STATE_ALL, spa); } /* From owner-dev-commits-src-all@freebsd.org Sat Mar 6 20:25:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BB42572299; Sat, 6 Mar 2021 20:25: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 4DtGLn0hVdz4ndM; Sat, 6 Mar 2021 20:25: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 0AD9215E3; Sat, 6 Mar 2021 20:25: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 126KPKWE074346; Sat, 6 Mar 2021 20:25:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126KPK2D074345; Sat, 6 Mar 2021 20:25:20 GMT (envelope-from git) Date: Sat, 6 Mar 2021 20:25:20 GMT Message-Id: <202103062025.126KPK2D074345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: e33a2b2905a8 - releng/13.0 - zfs: fix vdev_rebuild_thread deadlock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: e33a2b2905a886e98ab4b8f8d83ed30f6d8bb254 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 20:25:21 -0000 The branch releng/13.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=e33a2b2905a886e98ab4b8f8d83ed30f6d8bb254 commit e33a2b2905a886e98ab4b8f8d83ed30f6d8bb254 Author: Martin Matuska AuthorDate: 2021-03-03 01:28:56 +0000 Commit: Martin Matuska CommitDate: 2021-03-06 20:23:22 +0000 zfs: fix vdev_rebuild_thread deadlock From the openzfs 8e43fa12c commit message: The metaslab_disable() call may block waiting for a txg sync. Therefore it's important that vdev_rebuild_thread release the SCL_CONFIG read lock it is holding before this call. Failure to do so can result in the txg_sync thread getting blocked waiting for this lock which results in a deadlock. Obtained from: openzfs/zfs@8e43fa12c571878f32119122771888ab9092a75a Approved by: re (delphij) (cherry picked from commit c7069063144395b025c0ef178431eb2cafdbe1ca) --- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/zfs/vdev_rebuild.c b/sys/contrib/openzfs/module/zfs/vdev_rebuild.c index 784d1af15a81..112c04d0ba04 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_rebuild.c +++ b/sys/contrib/openzfs/module/zfs/vdev_rebuild.c @@ -804,8 +804,8 @@ vdev_rebuild_thread(void *arg) ASSERT0(range_tree_space(vr->vr_scan_tree)); /* Disable any new allocations to this metaslab */ - metaslab_disable(msp); spa_config_exit(spa, SCL_CONFIG, FTAG); + metaslab_disable(msp); mutex_enter(&msp->ms_sync_lock); mutex_enter(&msp->ms_lock); From owner-dev-commits-src-all@freebsd.org Sat Mar 6 20:25:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADB69571FD9; Sat, 6 Mar 2021 20:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtGM14ZgFz4p1q; Sat, 6 Mar 2021 20:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9079618A2; Sat, 6 Mar 2021 20:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 126KPX2Z074478; Sat, 6 Mar 2021 20:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126KPXxC074477; Sat, 6 Mar 2021 20:25:33 GMT (envelope-from git) Date: Sat, 6 Mar 2021 20:25:33 GMT Message-Id: <202103062025.126KPXxC074477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: d2faf2e6b2d4 - releng/13.0 - zfs: fix assert in FreeBSD-specific dmu_read_pages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: d2faf2e6b2d43eafbae27a6d4909984c260e2631 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 20:25:33 -0000 The branch releng/13.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=d2faf2e6b2d43eafbae27a6d4909984c260e2631 commit d2faf2e6b2d43eafbae27a6d4909984c260e2631 Author: Martin Matuska AuthorDate: 2021-03-03 01:32:59 +0000 Commit: Martin Matuska CommitDate: 2021-03-06 20:23:22 +0000 zfs: fix assert in FreeBSD-specific dmu_read_pages From the openzfs 2e160dee9 commit message: The function has three similar pieces of code: for read-behind pages, requested pages and read-ahead pages. All three pieces had an assert to ensure that the page is not mapped. Later the assert was relaxed to require that the page is not mapped for writing. But that was done in two places out of three. This change fixes the third piece, read-ahead. Obtained from: openzfs/zfs@2e160dee97a4badbc318561f76ea56451c916d2f Approved by: re (delphij) (cherry picked from commit 19049a2b2bd7119ef7b34102513f6bbfdf9ff862) --- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c index 8e412d9c1359..fb8f560316ea 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c @@ -319,7 +319,7 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, break; } ASSERT(m->dirty == 0); - ASSERT(!pmap_page_is_mapped(m)); + ASSERT(!pmap_page_is_write_mapped(m)); ASSERT(db->db_size > PAGE_SIZE); bufoff = IDX_TO_OFF(m->pindex) % db->db_size; From owner-dev-commits-src-all@freebsd.org Sat Mar 6 20:25:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA29E572496; Sat, 6 Mar 2021 20:25: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 4DtGMD47qXz4p6c; Sat, 6 Mar 2021 20:25: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 334971839; Sat, 6 Mar 2021 20:25: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 126KPhYS074606; Sat, 6 Mar 2021 20:25:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126KPhlN074605; Sat, 6 Mar 2021 20:25:43 GMT (envelope-from git) Date: Sat, 6 Mar 2021 20:25:43 GMT Message-Id: <202103062025.126KPhlN074605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: eed4d02d7ff7 - releng/13.0 - zfs: cancel TRIM or initialize on FAULTED non-writeable vdevs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: eed4d02d7ff7067259a23b7ccabc8c2253f1eff0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 20:25:44 -0000 The branch releng/13.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=eed4d02d7ff7067259a23b7ccabc8c2253f1eff0 commit eed4d02d7ff7067259a23b7ccabc8c2253f1eff0 Author: Martin Matuska AuthorDate: 2021-03-03 01:38:09 +0000 Commit: Martin Matuska CommitDate: 2021-03-06 20:23:23 +0000 zfs: cancel TRIM or initialize on FAULTED non-writeable vdevs From the openzfs commit message: When a device which is actively trimming or initializing becomes FAULTED, and therefore no longer writable, cancel the active TRIM or initialization. When the device is merely taken offline with `zpool offline` then stop the operation but do not cancel it. When the device is brought back online the operation will be resumed if possible. Obtained from: openzfs/zfs@bedbc13daa6dfe9e0221bfadb8d8db2378deaacc Approved by: re (delphij) (cherry picked from commit dc2743434f6cc73ca8ec1d551aba03a678eac804) --- sys/contrib/openzfs/module/zfs/vdev_initialize.c | 10 +++- sys/contrib/openzfs/module/zfs/vdev_trim.c | 15 ++++-- sys/contrib/openzfs/tests/runfiles/common.run | 2 + .../cli_root/zpool_initialize/Makefile.am | 1 + ...zpool_initialize_fault_export_import_online.ksh | 59 ++++++++++++++++++++ .../functional/cli_root/zpool_trim/Makefile.am | 1 + .../zpool_trim_fault_export_import_online.ksh | 62 ++++++++++++++++++++++ 7 files changed, 144 insertions(+), 6 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/vdev_initialize.c b/sys/contrib/openzfs/module/zfs/vdev_initialize.c index 083ad2861b5b..e9156c32f384 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_initialize.c +++ b/sys/contrib/openzfs/module/zfs/vdev_initialize.c @@ -553,8 +553,14 @@ vdev_initialize_thread(void *arg) vd->vdev_initialize_tree = NULL; mutex_enter(&vd->vdev_initialize_lock); - if (!vd->vdev_initialize_exit_wanted && vdev_writeable(vd)) { - vdev_initialize_change_state(vd, VDEV_INITIALIZE_COMPLETE); + if (!vd->vdev_initialize_exit_wanted) { + if (vdev_writeable(vd)) { + vdev_initialize_change_state(vd, + VDEV_INITIALIZE_COMPLETE); + } else if (vd->vdev_faulted) { + vdev_initialize_change_state(vd, + VDEV_INITIALIZE_CANCELED); + } } ASSERT(vd->vdev_initialize_thread != NULL || vd->vdev_initialize_inflight == 0); diff --git a/sys/contrib/openzfs/module/zfs/vdev_trim.c b/sys/contrib/openzfs/module/zfs/vdev_trim.c index 895957bda195..deea7fedd770 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_trim.c +++ b/sys/contrib/openzfs/module/zfs/vdev_trim.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2016 by Delphix. All rights reserved. * Copyright (c) 2019 by Lawrence Livermore National Security, LLC. + * Copyright (c) 2021 Hewlett Packard Enterprise Development LP */ #include @@ -930,10 +931,16 @@ vdev_trim_thread(void *arg) range_tree_destroy(ta.trim_tree); mutex_enter(&vd->vdev_trim_lock); - if (!vd->vdev_trim_exit_wanted && vdev_writeable(vd)) { - vdev_trim_change_state(vd, VDEV_TRIM_COMPLETE, - vd->vdev_trim_rate, vd->vdev_trim_partial, - vd->vdev_trim_secure); + if (!vd->vdev_trim_exit_wanted) { + if (vdev_writeable(vd)) { + vdev_trim_change_state(vd, VDEV_TRIM_COMPLETE, + vd->vdev_trim_rate, vd->vdev_trim_partial, + vd->vdev_trim_secure); + } else if (vd->vdev_faulted) { + vdev_trim_change_state(vd, VDEV_TRIM_CANCELED, + vd->vdev_trim_rate, vd->vdev_trim_partial, + vd->vdev_trim_secure); + } } ASSERT(vd->vdev_trim_thread != NULL || vd->vdev_trim_inflight[0] == 0); diff --git a/sys/contrib/openzfs/tests/runfiles/common.run b/sys/contrib/openzfs/tests/runfiles/common.run index c0bfc09ac5b3..290b9ffba65c 100644 --- a/sys/contrib/openzfs/tests/runfiles/common.run +++ b/sys/contrib/openzfs/tests/runfiles/common.run @@ -413,6 +413,7 @@ tags = ['functional', 'cli_root', 'zpool_labelclear'] [tests/functional/cli_root/zpool_initialize] tests = ['zpool_initialize_attach_detach_add_remove', + 'zpool_initialize_fault_export_import_online', 'zpool_initialize_import_export', 'zpool_initialize_offline_export_import_online', 'zpool_initialize_online_offline', @@ -477,6 +478,7 @@ tags = ['functional', 'cli_root', 'zpool_sync'] [tests/functional/cli_root/zpool_trim] tests = ['zpool_trim_attach_detach_add_remove', + 'zpool_trim_fault_export_import_online', 'zpool_trim_import_export', 'zpool_trim_multiple', 'zpool_trim_neg', 'zpool_trim_offline_export_import_online', 'zpool_trim_online_offline', 'zpool_trim_partial', 'zpool_trim_rate', 'zpool_trim_rate_neg', diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am index 2ebc376d9cb9..3968902ec36d 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am @@ -2,6 +2,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_init dist_pkgdata_SCRIPTS = \ cleanup.ksh \ zpool_initialize_attach_detach_add_remove.ksh \ + zpool_initialize_fault_export_import_online.ksh \ zpool_initialize_import_export.ksh \ zpool_initialize_offline_export_import_online.ksh \ zpool_initialize_online_offline.ksh \ diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh new file mode 100755 index 000000000000..11b8a483e662 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh @@ -0,0 +1,59 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2021 Lawrence Livermore National Security, LLC. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_initialize/zpool_initialize.kshlib + +# +# DESCRIPTION: +# Miscellaneous complex sequences of operations function as expected. +# +# STRATEGY: +# 1. Create a pool with a two-way mirror. +# 2. Start initializing, fault, export, import, online and verify along +# the way that the initializing was cancelled and not restarted. +# + +DISK1="$(echo $DISKS | cut -d' ' -f1)" +DISK2="$(echo $DISKS | cut -d' ' -f2)" + +log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2 + +log_must zpool initialize $TESTPOOL $DISK1 +progress="$(initialize_progress $TESTPOOL $DISK1)" +[[ -z "$progress" ]] && log_fail "Initializing did not start" + +log_must zpool offline -f $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_must zpool export $TESTPOOL +log_must zpool import $TESTPOOL + +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_must zpool online $TESTPOOL $DISK1 +log_must zpool clear $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "ONLINE" +log_must eval "zpool status -i $TESTPOOL | grep $DISK1 | grep uninitialized" + +log_pass "Initializing behaves as expected at each step of:" \ + "initialize + fault + export + import + online" diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am index d2d3b4ae88bb..0411ab4e0070 100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am @@ -3,6 +3,7 @@ dist_pkgdata_SCRIPTS = \ setup.ksh \ cleanup.ksh \ zpool_trim_attach_detach_add_remove.ksh \ + zpool_trim_fault_export_import_online.ksh \ zpool_trim_import_export.ksh \ zpool_trim_multiple.ksh \ zpool_trim_neg.ksh \ diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh new file mode 100755 index 000000000000..6bb9fc346daf --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh @@ -0,0 +1,62 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2019 by Tim Chase. All rights reserved. +# Copyright (c) 2021 Lawrence Livermore National Security, LLC. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_trim/zpool_trim.kshlib + +# +# DESCRIPTION: +# Miscellaneous complex sequences of operations function as expected. +# +# STRATEGY: +# 1. Create a pool with a two-way mirror. +# 2. Start trimming, fault, export, import, online and verify along +# the way that the trim was cancelled and not restarted. +# + +DISK1="$(echo $DISKS | cut -d' ' -f1)" +DISK2="$(echo $DISKS | cut -d' ' -f2)" + +log_must zpool create -f $TESTPOOL mirror $DISK1 $DISK2 + +log_must zpool trim -r 128M $TESTPOOL $DISK1 +progress="$(trim_progress $TESTPOOL $DISK1)" +[[ -z "$progress" ]] && log_fail "Trimming did not start" + +log_must zpool offline -f $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep untrimmed" + +log_must zpool export $TESTPOOL +log_must zpool import $TESTPOOL + +# Note: the expected state here is unsupported since the faulted device +# cannot be checked to determine if it supports TRIM. +log_must check_vdev_state $TESTPOOL $DISK1 "FAULTED" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep unsupported" + +log_must zpool online $TESTPOOL $DISK1 +log_must zpool clear $TESTPOOL $DISK1 +log_must check_vdev_state $TESTPOOL $DISK1 "ONLINE" +log_must eval "zpool status -t $TESTPOOL | grep $DISK1 | grep untrimmed" + +log_pass "Trimming behaves as expected at each step of:" \ + "trim + fault + export + import + online" From owner-dev-commits-src-all@freebsd.org Sat Mar 6 20:58:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE372572AF9; Sat, 6 Mar 2021 20:58: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 4DtH4w5yWCz4qkV; Sat, 6 Mar 2021 20:58: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 BB6BB1EB2; Sat, 6 Mar 2021 20:58: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 126KwOw6014350; Sat, 6 Mar 2021 20:58:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126KwOMT014349; Sat, 6 Mar 2021 20:58:24 GMT (envelope-from git) Date: Sat, 6 Mar 2021 20:58:24 GMT Message-Id: <202103062058.126KwOMT014349@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: cd84c82c6ad7 - main - linux: add support for SO_PEERGROUPS 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: cd84c82c6ad73c804b828bad9caec176e41ab79d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 20:58:24 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=cd84c82c6ad73c804b828bad9caec176e41ab79d commit cd84c82c6ad73c804b828bad9caec176e41ab79d Author: Edward Tomasz Napierala AuthorDate: 2021-02-07 21:29:32 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-06 19:48:58 +0000 linux: add support for SO_PEERGROUPS The su(8) and sudo(8) from Ubuntu Bionic use it. Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28165 --- sys/compat/linux/linux_socket.c | 46 ++++++++++++++++++++++++++++++++++++++++- sys/compat/linux/linux_socket.h | 1 + 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index a4c5bf0b581e..e9f95098a407 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1863,6 +1863,43 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) return (error); } +static int +linux_getsockopt_so_peergroups(struct thread *td, + struct linux_getsockopt_args *args) +{ + struct xucred xu; + socklen_t xulen, len; + int error, i; + + xulen = sizeof(xu); + error = kern_getsockopt(td, args->s, 0, + LOCAL_PEERCRED, &xu, UIO_SYSSPACE, &xulen); + if (error != 0) + return (error); + + len = xu.cr_ngroups * sizeof(l_gid_t); + if (args->optlen < len) { + error = copyout(&len, PTRIN(args->optlen), sizeof(len)); + if (error == 0) + error = ERANGE; + return (error); + } + + /* + * "- 1" to skip the primary group. + */ + for (i = 0; i < xu.cr_ngroups - 1; i++) { + error = copyout(xu.cr_groups + i + 1, + (void *)(args->optval + i * sizeof(l_gid_t)), + sizeof(l_gid_t)); + if (error != 0) + return (error); + } + + error = copyout(&len, PTRIN(args->optlen), sizeof(len)); + return (error); +} + static int linux_getsockopt_so_peersec(struct thread *td, struct linux_getsockopt_args *args) @@ -1899,8 +1936,15 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) level = linux_to_bsd_sockopt_level(args->level); switch (level) { case SOL_SOCKET: - if (args->optname == LINUX_SO_PEERSEC) + switch (args->optname) { + case LINUX_SO_PEERGROUPS: + return (linux_getsockopt_so_peergroups(td, args)); + case LINUX_SO_PEERSEC: return (linux_getsockopt_so_peersec(td, args)); + default: + break; + } + name = linux_to_bsd_so_sockopt(args->optname); switch (name) { case LOCAL_CREDS_PERSISTENT: diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index 32a19a348312..398f184c5e81 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -199,6 +199,7 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #define LINUX_SO_SNDBUFFORCE 32 #define LINUX_SO_RCVBUFFORCE 33 #define LINUX_SO_PROTOCOL 38 +#define LINUX_SO_PEERGROUPS 59 /* Socket options */ #define LINUX_IP_TOS 1 From owner-dev-commits-src-all@freebsd.org Sat Mar 6 21:47:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AED80573B20; Sat, 6 Mar 2021 21:47: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 4DtJ9c4YxNz4t15; Sat, 6 Mar 2021 21:47: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 8F71828CB; Sat, 6 Mar 2021 21:47: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 126LlWjq079867; Sat, 6 Mar 2021 21:47:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126LlWMl079866; Sat, 6 Mar 2021 21:47:32 GMT (envelope-from git) Date: Sat, 6 Mar 2021 21:47:32 GMT Message-Id: <202103062147.126LlWMl079866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: bad9fa56620e - main - [PowerPC] Fix AP bringup on 32-bit AIM SMP MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad9fa56620eb82395c5ab66d300e91a0222dde2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 21:47:32 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=bad9fa56620eb82395c5ab66d300e91a0222dde2 commit bad9fa56620eb82395c5ab66d300e91a0222dde2 Author: Brandon Bergren AuthorDate: 2021-03-06 21:26:16 +0000 Commit: Brandon Bergren CommitDate: 2021-03-06 21:46:28 +0000 [PowerPC] Fix AP bringup on 32-bit AIM SMP In r361544, the pmap drivers were converted to ifuncs. When doing so, this changed the call type of pmap functions to be called via the secure-plt stubs. These stubs depend on the TOC base being loaded to r30 to run properly. On SMP AIM (i.e. a dual processor G4 or running 32-bit on G5), since the APs were being started up from the reset vector instead of going through __start, they had never had r30 initialized properly, so when the cpu_reset code in trap_subr32.S attempted to branch to pmap_cpu_bootstrap(), it was loading the target from the wrong location. Ensure r30 is set up directly in the cpu_reset trap code, so we can make PLT calls as normal. Fixes boot on my SMP G4. Reviewed by: jhibbits MFC after: 3 days Sponsored by: Tag1 Consulting, Inc. --- sys/powerpc/aim/trap_subr32.S | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S index 710a222fd84c..9664dcc92d2d 100644 --- a/sys/powerpc/aim/trap_subr32.S +++ b/sys/powerpc/aim/trap_subr32.S @@ -316,6 +316,7 @@ cpu_reset: 1: mflr %r1 addi %r1,%r1,(124-16)@l + lwz %r30,TRAP_TOCBASE(0) bl CNAME(cpudep_ap_early_bootstrap) lis %r3,1@l From owner-dev-commits-src-all@freebsd.org Sun Mar 7 00:25:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B749577469; Sun, 7 Mar 2021 00:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtMhF35stz3JQY; Sun, 7 Mar 2021 00:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 596654BCD; Sun, 7 Mar 2021 00:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1270PndV090256; Sun, 7 Mar 2021 00:25:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1270Pns5090255; Sun, 7 Mar 2021 00:25:49 GMT (envelope-from git) Date: Sun, 7 Mar 2021 00:25:49 GMT Message-Id: <202103070025.1270Pns5090255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 05083436a6e5 - stable/13 - Fix diroffdiroff, probably copy/paste bug. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05083436a6e5ca19e0caed4dd34ced8d172303a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 00:25:49 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=05083436a6e5ca19e0caed4dd34ced8d172303a4 commit 05083436a6e5ca19e0caed4dd34ced8d172303a4 Author: Alexander Motin AuthorDate: 2021-02-28 14:07:13 +0000 Commit: Alexander Motin CommitDate: 2021-03-07 00:25:45 +0000 Fix diroffdiroff, probably copy/paste bug. Too long name looks bad in `vmstat -m`. MFC after: 1 week (cherry picked from commit d01032736cf067d63e66d6428ffc08e47652600f) --- sys/fs/nfs/nfs_commonport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index a7ce2d4bd015..47038980c640 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -123,7 +123,7 @@ MALLOC_DEFINE(M_NEWNFSCLLOCKOWNER, "NFSCL lckown", "NFSCL Lock Owner"); MALLOC_DEFINE(M_NEWNFSCLLOCK, "NFSCL lck", "NFSCL Lock"); MALLOC_DEFINE(M_NEWNFSV4NODE, "NEWNFSnode", "NFS vnode"); MALLOC_DEFINE(M_NEWNFSDIRECTIO, "NEWdirectio", "NFS Direct IO buffer"); -MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroffdiroff", +MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroff", "NFS directory offset data"); MALLOC_DEFINE(M_NEWNFSDROLLBACK, "NFSD rollback", "NFS local lock rollback"); From owner-dev-commits-src-all@freebsd.org Sun Mar 7 00:26:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AA565773A7; Sun, 7 Mar 2021 00:26: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 4DtMhl0DcCz3Jcr; Sun, 7 Mar 2021 00:26: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 EF1344A54; Sun, 7 Mar 2021 00:26: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 1270QEJ4090424; Sun, 7 Mar 2021 00:26:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1270QET5090423; Sun, 7 Mar 2021 00:26:14 GMT (envelope-from git) Date: Sun, 7 Mar 2021 00:26:14 GMT Message-Id: <202103070026.1270QET5090423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: bff56d9cff25 - stable/12 - Fix diroffdiroff, probably copy/paste bug. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bff56d9cff25231d6f05a9d6e40b43838da821db Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 00:26:15 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=bff56d9cff25231d6f05a9d6e40b43838da821db commit bff56d9cff25231d6f05a9d6e40b43838da821db Author: Alexander Motin AuthorDate: 2021-02-28 14:07:13 +0000 Commit: Alexander Motin CommitDate: 2021-03-07 00:26:08 +0000 Fix diroffdiroff, probably copy/paste bug. Too long name looks bad in `vmstat -m`. MFC after: 1 week (cherry picked from commit d01032736cf067d63e66d6428ffc08e47652600f) --- sys/fs/nfs/nfs_commonport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 1a1e64cd823b..214ad51f759d 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -119,7 +119,7 @@ MALLOC_DEFINE(M_NEWNFSCLLOCKOWNER, "NFSCL lckown", "NFSCL Lock Owner"); MALLOC_DEFINE(M_NEWNFSCLLOCK, "NFSCL lck", "NFSCL Lock"); MALLOC_DEFINE(M_NEWNFSV4NODE, "NEWNFSnode", "NFS vnode"); MALLOC_DEFINE(M_NEWNFSDIRECTIO, "NEWdirectio", "NFS Direct IO buffer"); -MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroffdiroff", +MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroff", "NFS directory offset data"); MALLOC_DEFINE(M_NEWNFSDROLLBACK, "NFSD rollback", "NFS local lock rollback"); From owner-dev-commits-src-all@freebsd.org Sun Mar 7 00:31:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABB485778BD; Sun, 7 Mar 2021 00:31: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 4DtMpS4W4Fz3JqK; Sun, 7 Mar 2021 00:31: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 8DB5E4B41; Sun, 7 Mar 2021 00:31: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 1270VCoR098626; Sun, 7 Mar 2021 00:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1270VCPq098625; Sun, 7 Mar 2021 00:31:12 GMT (envelope-from git) Date: Sun, 7 Mar 2021 00:31:12 GMT Message-Id: <202103070031.1270VCPq098625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Murray Subject: git: cc011d871957 - main - Remove the never-installed setchannel(1) utility. It only work(s|ed) with the never-committed cxm(4) driver and the now-removed bktr(4) driver. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc011d87195798c0c279eb4486795f0a1ee7ad7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 00:31:12 -0000 The branch main has been updated by markm: URL: https://cgit.FreeBSD.org/src/commit/?id=cc011d87195798c0c279eb4486795f0a1ee7ad7f commit cc011d87195798c0c279eb4486795f0a1ee7ad7f Author: Mark Murray AuthorDate: 2021-03-06 23:07:04 +0000 Commit: Mark Murray CommitDate: 2021-03-07 00:06:42 +0000 Remove the never-installed setchannel(1) utility. It only work(s|ed) with the never-committed cxm(4) driver and the now-removed bktr(4) driver. --- usr.bin/setchannel/Makefile | 5 - usr.bin/setchannel/Makefile.depend | 15 -- usr.bin/setchannel/setchannel.1 | 104 -------------- usr.bin/setchannel/setchannel.c | 287 ------------------------------------- 4 files changed, 411 deletions(-) diff --git a/usr.bin/setchannel/Makefile b/usr.bin/setchannel/Makefile deleted file mode 100644 index 0ffb33078592..000000000000 --- a/usr.bin/setchannel/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -PROG= setchannel - -.include diff --git a/usr.bin/setchannel/Makefile.depend b/usr.bin/setchannel/Makefile.depend deleted file mode 100644 index c729e17c52db..000000000000 --- a/usr.bin/setchannel/Makefile.depend +++ /dev/null @@ -1,15 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/setchannel/setchannel.1 b/usr.bin/setchannel/setchannel.1 deleted file mode 100644 index 604b7e315541..000000000000 --- a/usr.bin/setchannel/setchannel.1 +++ /dev/null @@ -1,104 +0,0 @@ -.\"- -.\" Copyright (C) 2004-2006 The FreeBSD Project. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $Id: cxm.4,v 1.1 2004/10/16 00:12:35 mavetju Exp $ -.\" $FreeBSD$ -.\" -.Dd November 30, 2006 -.Dt PVR250-SETCHANNEL 1 -.Os -.Sh NAME -.Nm pvr250-setchannel -.Nd Hauppage PVR250/350 channel selector -.Sh SYNOPSIS -.Cd pvr250-setchannel [-a {on | off}] [-c | -r | -s | -t] [-g geom] [-m channel_set] [channel | freq] -.Sh DESCRIPTION -.Nm -provides support for selecting channels on Hauppauge WinTV cards, -including the PVR 150, PVR 250, PVR 350 and PVR 500. -.Pp -The following options are available: -.Bl -tag -width indent -.It Fl a Cm on -Enable AFC. -.It Fl a Cm off -Disable AFC. -.It Fl c -Select composite input. -.It Fl d -Select the tuner unit number. -This is appended to the base device file name -.Pa /dev/cxm -to form a device name such as -.Pa /dev/cxm0 -or -.Pa /dev/cxm1 . -.It Fl r -Select radio input. -.It Fl s -Select svideo input. -.It Fl t -Select tuner. -.It Fl g Cm geom -Select geometry. -The first resolution is for NTSC, the second for PAL. -.Pp - VCD: 352x240 or 352x288 - SVCD: 480x480 or 480x576 - DVD (half D1): 352x480 or 352x576 - DVD (full D1): 720x480 or 720x576 -.It Fl m Cm channel-set -Select channel set and system. -.Pp - 0 = Tuner Default - 1 = US Broadcast (NTSC) - 2 = US Cable (NTSC) - 4 = Western Europe (PAL) - 5 = Japan Broadcast (NTSC) - 6 = Japan Cable (NTSC) - 8 = Australia (PAL) - 9 = France (SECAM) -.It Cm channel -Channel number to set. -.It Cm freq -Frequency in MHz (must include decimal point). -.El -.Sh SEE ALSO -.Xr bktr 4 , -.Xr cxm 4 , -.Xr meteor 4 -.Sh HISTORY -The -.Nm -program first appeared in the -multimedia mailing-list in January 2004. -The -.Nm -program first appeared in the FreeBSD Ports collection in October 2004. -.Sh AUTHORS -.An -nosplit -This program is made by -.An John Wehle -.Pp -This man page is made by -.An Edwin Groothuis diff --git a/usr.bin/setchannel/setchannel.c b/usr.bin/setchannel/setchannel.c deleted file mode 100644 index a229290c864a..000000000000 --- a/usr.bin/setchannel/setchannel.c +++ /dev/null @@ -1,287 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003, 2004, 2005 - * John Wehle . All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* Set the channel of the tuner card. */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static void -usage(void) -{ - printf - ("Usage: setchannel [-a {on|off}] [-c | -r | -s | -t] " - "[-g geom] [-m chnl_set] [chnl | freq]\n" - " -a Enable / disable AFC.\n" - " -c Select composite input.\n" - " -d Select tuner unit number.\n" - " -r Select radio input.\n" - " -s Select svideo input.\n" - " -t Select tuner.\n" - " -g Select geometry.\n" - " 352x240 or 352x288 = VCD\n" - " 480x480 or 480x576 = SVCD\n" - " 352x480 or 352x576 = DVD (half D1)\n" - " 720x480 or 720x576 = DVD (full D1)\n" - " -m Select channel set / system.\n" - " 0 = Tuner Default\n" - " %u = US Broadcast / NTSC\n" - " %u = US Cable / NTSC\n" - " %u = Western Europe / PAL\n" - " %u = Japan Broadcast / NTSC\n" - " %u = Japan Cable / NTSC\n" - " %u = Australia / PAL\n" - " %u = France / SECAM\n" - " chnl Channel\n" - " freq Frequency in MHz (must include decimal point).\n", - CHNLSET_NABCST, CHNLSET_CABLEIRC, CHNLSET_WEUROPE, CHNLSET_JPNBCST, - CHNLSET_JPNCABLE, CHNLSET_AUSTRALIA, CHNLSET_FRANCE); -} - -#define DEVNAME_BASE "/dev/cxm" -char dev_name[16]; - -int -main(int argc, char *argv[]) -{ - char *ptr; - char *endptr; - int afc; - int audio; - int c; - int channel_set; - int i; - int status; - int unit; - int tfd; - unsigned int channel; - unsigned int fraction; - unsigned int freq; - unsigned int x_size; - unsigned int y_size; - unsigned long device; - struct bktr_capture_area cap; - - afc = -1; - audio = -1; - channel = 0; - channel_set = -1; - device = 0; - freq = 0; - status = 0; - unit = 0; - x_size = 0; - y_size = 0; - - while ((c = getopt(argc, argv, "a:cd:rg:m:st")) != -1) - switch (c) { - - case 'a': - if (strcasecmp(optarg, "on") == 0) - afc = 1; - else if (strcasecmp(optarg, "off") == 0) - afc = 0; - else { - usage(); - exit(1); - } - break; - - case 'c': - device = METEOR_INPUT_DEV2; - audio = -1; - break; - - case 'd': - unit = atoi(optarg); - break; - - case 'r': - device = 0; - audio = AUDIO_INTERN; - break; - - case 's': - device = METEOR_INPUT_DEV_SVIDEO; - audio = -1; - break; - - case 't': - device = METEOR_INPUT_DEV1; - audio = -1; - break; - - case 'g': - if (sscanf(optarg, "%ux%u", &x_size, &y_size) != 2 - || x_size == 0 || y_size == 0) { - usage(); - exit(1); - } - break; - - case 'm': - channel_set = atoi(optarg); - if (channel_set < 0 || channel_set > CHNLSET_MAX) { - usage(); - exit(1); - } - break; - - default: - usage(); - exit(1); - } - - if (optind < argc) { - - /* - * A number containing a decimal point is the frequency in MHz. - */ - - if ((ptr = strchr(argv[optind], '.')) != NULL) { - freq = strtol(argv[optind], &endptr, 10) * 1000; - if (ptr != endptr) { - usage(); - exit(1); - } - - ptr++; - - fraction = strtol(ptr, &endptr, 10); - if (!isdigit(*ptr) || *endptr != '\0') { - usage(); - exit(1); - } - - for (i = endptr - ptr; i > 3; i--) - fraction /= 10; - for (; i < 3; i++) - fraction *= 10; - - freq += fraction; - } - - /* An integer is the channel. */ - else - channel = atoi(argv[optind]); - } - - if (afc == -1 && audio == -1 && !device && x_size == 0 && y_size == 0 - && channel_set == -1 && !channel && !freq) { - usage(); - exit(1); - } - - sprintf(dev_name, DEVNAME_BASE "%d", unit); - tfd = open(dev_name, O_RDONLY); - if (tfd < 0) { - fprintf(stderr, "Can't open %s: %s (%d)\n", dev_name, - strerror(errno), errno); - exit(1); - } - - if (afc != -1) - if (ioctl(tfd, TVTUNER_SETAFC, &afc) < 0) { - perror("ioctl(tfd, TVTUNER_SETAFC) failed."); - status = 1; - } - - if (device) - if (ioctl(tfd, METEORSINPUT, &device) < 0) { - perror("ioctl(tfd, METEORSINPUT) failed."); - status = 1; - } - - if (audio != -1) - if (ioctl(tfd, BT848_SAUDIO, &audio) < 0) { - perror("ioctl(tfd, BT848_SAUDIO) failed."); - status = 1; - } - - if (ioctl(tfd, BT848_GAUDIO, &audio) < 0) { - perror("ioctl(tfd, BT848_GAUDIO) failed."); - status = 1; - } - - if (x_size && y_size) { - memset(&cap, 0, sizeof(cap)); - cap.x_size = x_size; - cap.y_size = y_size; - if (ioctl(tfd, BT848_SCAPAREA, &cap) < 0) { - perror("ioctl(tfd, BT848_SCAPAREA) failed."); - status = 1; - } - } - - if (channel_set != -1) - if (ioctl(tfd, TVTUNER_SETTYPE, &channel_set) < 0) { - perror("ioctl(tfd, TVTUNER_SETTYPE) failed."); - status = 1; - } - - if (channel) { - if (ioctl(tfd, TVTUNER_SETCHNL, &channel) < 0) { - perror("ioctl(tfd, TVTUNER_SETCHNL) failed."); - status = 1; - } - } else if (freq) { - if (audio == AUDIO_INTERN) { - /* Convert from kHz to MHz * 100 */ - freq = freq / 10; - - if (ioctl(tfd, RADIO_SETFREQ, &freq) < 0) { - perror("ioctl(tfd, RADIO_SETFREQ) failed."); - status = 1; - } - } else { - /* Convert from kHz to MHz * 16 */ - freq = (freq * 16) / 1000; - - if (ioctl(tfd, TVTUNER_SETFREQ, &freq) < 0) { - perror("ioctl(tfd, TVTUNER_SETFREQ) failed."); - status = 1; - } - } - } - - close(tfd); - exit(status); -} From owner-dev-commits-src-all@freebsd.org Sun Mar 7 00:31:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB4BB5777E7; Sun, 7 Mar 2021 00:31: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 4DtMpT57V7z3Jn5; Sun, 7 Mar 2021 00:31: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 A3A0E4AEE; Sun, 7 Mar 2021 00:31: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 1270VDRw098646; Sun, 7 Mar 2021 00:31:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1270VDLF098645; Sun, 7 Mar 2021 00:31:13 GMT (envelope-from git) Date: Sun, 7 Mar 2021 00:31:13 GMT Message-Id: <202103070031.1270VDLF098645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Murray Subject: git: fbf8e3245201 - main - Remove references to the now-removed bktr(4) driver. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbf8e32452016cf83be4288c41811d9e125dbcbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 00:31:14 -0000 The branch main has been updated by markm: URL: https://cgit.FreeBSD.org/src/commit/?id=fbf8e32452016cf83be4288c41811d9e125dbcbe commit fbf8e32452016cf83be4288c41811d9e125dbcbe Author: Mark Murray AuthorDate: 2021-03-06 23:15:09 +0000 Commit: Mark Murray CommitDate: 2021-03-07 00:09:22 +0000 Remove references to the now-removed bktr(4) driver. --- share/examples/etc/make.conf | 2 +- share/man/man4/iicbus.4 | 4 +--- share/man/man4/smbus.4 | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf index a7afe4d8b6eb..bd8ca5d2cb4c 100644 --- a/share/examples/etc/make.conf +++ b/share/examples/etc/make.conf @@ -135,7 +135,7 @@ #MODULES_OVERRIDE= linux ipfw # # The list of modules to never build, applied *after* MODULES_OVERRIDE. -#WITHOUT_MODULES= bktr plip +#WITHOUT_MODULES= plip # # If you do not want unformatted manual pages to be compressed # when they are installed: diff --git a/share/man/man4/iicbus.4 b/share/man/man4/iicbus.4 index 698a7897c84a..b96e6eb2ab9b 100644 --- a/share/man/man4/iicbus.4 +++ b/share/man/man4/iicbus.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd March 7, 2021 .Dt IICBUS 4 .Os .Sh NAME @@ -101,7 +101,6 @@ Some I2C interfaces are available: .It Sy pcf Ta "Philips PCF8584 master/slave interface" .It Sy iicbb Ta "generic bit-banging master-only driver" .It Sy lpbb Ta "parallel port specific bit-banging interface" -.It Sy bktr Ta "Brooktree848 video chipset, hardware and software master-only interface" .El .Sh BUS FREQUENCY CONFIGURATION The operating frequency of an I2C bus may be fixed or configurable. @@ -149,7 +148,6 @@ or the .Va I2CRSTCARD ioctl to make the change take effect. .Sh SEE ALSO -.Xr bktr 4 , .Xr fdt 4 , .Xr iic 4 , .Xr iicbb 4 , diff --git a/share/man/man4/smbus.4 b/share/man/man4/smbus.4 index 1d23117f0ac6..1a117d52fd8a 100644 --- a/share/man/man4/smbus.4 +++ b/share/man/man4/smbus.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 1998 +.Dd March 7, 2021 .Dt SMBUS 4 .Os .Sh NAME @@ -34,13 +34,12 @@ .Cd "device smbus" .Pp .Cd "device iicsmb" -.Cd "device bktr" .Sh DESCRIPTION The .Em smbus system provides a uniform, modular and architecture-independent system for the implementation of drivers to control various SMB devices -and to utilize different SMB controllers (I2C, PIIX4, Brooktree848, vm86...). +and to utilize different SMB controllers (I2C, PIIX4, vm86...). .Sh System Management Bus The .Em System Management Bus @@ -61,7 +60,6 @@ The SMBus may share the same host device and physical bus as ACCESS bus components provided that an appropriate electrical bridge is provided between the internal SMB devices and external ACCESS bus devices. .Sh SEE ALSO -.Xr bktr 4 , .Xr iicbus 4 , .Xr iicsmb 4 , .Xr smb 4 From owner-dev-commits-src-all@freebsd.org Sun Mar 7 02:32:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FE0855561D; Sun, 7 Mar 2021 02:32:26 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0a-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtQVJ4PH9z3jYd; Sun, 7 Mar 2021 02:32:24 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108156.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1272U4df000475; Sat, 6 Mar 2021 18:32:22 -0800 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by mx0a-00273201.pphosted.com with ESMTP id 3749murn4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 06 Mar 2021 18:32:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bpn/NRhsPQgSerQzznv+ZUKvNict8CgVunUywJAxAw8prCNs69JJqYmYSQ53wqo5UAJ+KJecI3QiG5I5iOH8aPo6S0TKKOGeD4fEa2OYLq+Qn7uBmAw8eMa4EIxnT1Klf1sSIYSYYbb1Rzyswst5KjEnuxXdb21Irb5OYctOEb7Hp6ZxhHm1sAfKzM48BkK9LqKLl4lKWXDS0R/jR7hkwp5kWkcAfgf2cGW1svLx1ADG8Jc7YQhFpDaVR/1dl+m4JJbU68/HDm/zu4Fw5mh2iWhLXVCgl6TdQtl0xLXRuLwDQYp9UJ0MKi+hh+MEZXNovIQNPzAJe7Qkpri+HjqNTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mtpGCwEk3NZPSaAx9UNBiX9OGJNaPkm48x5/d53bnK8=; b=Vr9xtmW3+5gl4vGJZ/auLJH+qLUdBFDtB2dlsn4iL3awwC3u/zw9o3dL/oUaNBEMB/yh3XsOvqLYthzgqzuDsiZcZ8KzECIY2/ZKQAAZDhidBg9dmvammSTY9sqTHqi/7pTZbW5WIy6EvVDAOP4IYqKafnjdgZds9/3RvP5inHtXZax0wlBXYQnT1Nli2gKxC5Imcn+Of8HyJzBBDMxKJQpyyQiVuYJ0RHCVxzDVsLzcaT4ppOwRW+TijNHL6KoIa9nE5Z/I5mHPQ1vm0dF0GbHUclGptAU2uhDkCHM90nhBAp81n9PCUdq/KLvOHSW9M+vcQNTEaljTTjZpi4E9Sg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.12) smtp.rcpttodomain=freebsd.org smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none Received: from BN9PR03CA0423.namprd03.prod.outlook.com (2603:10b6:408:113::8) by SA0PR05MB7497.namprd05.prod.outlook.com (2603:10b6:806:b7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.13; Sun, 7 Mar 2021 02:32:20 +0000 Received: from BN8NAM12FT037.eop-nam12.prod.protection.outlook.com (2603:10b6:408:113:cafe::54) by BN9PR03CA0423.outlook.office365.com (2603:10b6:408:113::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Sun, 7 Mar 2021 02:32:20 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.12) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from P-EXFEND-EQX-01.jnpr.net (66.129.239.12) by BN8NAM12FT037.mail.protection.outlook.com (10.13.182.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3912.9 via Frontend Transport; Sun, 7 Mar 2021 02:32:20 +0000 Received: from P-EXBEND-EQX-02.jnpr.net (10.104.8.53) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 6 Mar 2021 18:32:19 -0800 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXBEND-EQX-02.jnpr.net (10.104.8.53) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 6 Mar 2021 18:32:19 -0800 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sat, 6 Mar 2021 18:32:19 -0800 Received: from kaos.jnpr.net (kaos.jnpr.net [172.23.255.201]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 1272WIsw021177; Sat, 6 Mar 2021 18:32:19 -0800 (envelope-from sjg@juniper.net) Received: by kaos.jnpr.net (Postfix, from userid 1377) id 9A0B42F738; Sat, 6 Mar 2021 18:32:18 -0800 (PST) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 987A92F6AA; Sat, 6 Mar 2021 18:32:18 -0800 (PST) To: Warner Losh CC: Nathan Whitehorn , Ed Maste , "Rodney W. Grimes" , Brandon Bergren , src-committers , "" , , Subject: Re: git: 2c26d77d989a - main - Remove /boot/efi from mtree, missed in 0b7472b3d8d2. In-Reply-To: References: <202103021856.122IuYgV048086@gndrsh.dnsmgr.net> <3d947e4c-a529-0b27-a8d7-415600783e53@freebsd.org> Comments: In-reply-to: Warner Losh message dated "Wed, 03 Mar 2021 08:24:05 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 27.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <91117.1615084338.1@kaos.jnpr.net> Date: Sat, 6 Mar 2021 18:32:18 -0800 Message-ID: <93128.1615084338@kaos.jnpr.net> X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aa6161be-1a21-4bbd-c9aa-08d8e1113bae X-MS-TrafficTypeDiagnostic: SA0PR05MB7497: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I/JxvGpUGDMc66WV8+0XzgBEViC+sPASEmhfzE9s5Jx2eNpH7Tnnx0DCRSzpETk4ReZ0GCq56BK7v8OnFWHOextKXrJVtbLmlzfoyDf086dJbSgTjSXpbZTp1s31oEakGRkV/hAtqNjvzXX9ztaEByfZEML/RV+FlGbHb/m4wjTxL4g6xDmBum0y+nYEqZVSQbRPbZDccNSZQ53PvrA97wn96fCjv6Q9WTOzGOCQXcXktZHyaa2R+6FWEUgozGtiRNITqfdBh5o0uXEz4KwMlGty+9afTpou+VfzRJV2gRcxtoI9F+KcEXQrRWpofmiRYAIvvQy1vVZk3DE7x1jXVPHYQ09UFuLxt+NnkvUgPmLfGGdFrlcnVKQeF0dOGNLQAXMvjLLCNC+neW72LLzx/QaQxcrSXsMh+pwSxISIMbeAVFa6JlmdLi6/eQPr1rjlw9t7wNsCc7r8VMivTVXNjtcXKnjijdSpZch7LxP19V1PruGzYOpSAOjlUbAMUlb/ZEFsRY3DQ83Dl8B4sO41I1t+51lQVcOBMcR8fmsdj2oieH0dcS86PlnyoClJgq7Yh/7wwhC/dqNbhnU36lJKOvV7BvJSAYlR/a75P2UFLyWOXGOt0Axt9PQo31erRhL7IqAyrPuotRN0+R+pkIPYvHZqeAOYq9Am4wncMqc0JVyX/XcSM8FUOirabf7SYIdg X-Forefront-Antispam-Report: CIP:66.129.239.12; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:P-EXFEND-EQX-01.jnpr.net; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(136003)(376002)(39860400002)(346002)(396003)(46966006)(36840700001)(7696005)(107886003)(2906002)(5660300002)(70586007)(86362001)(4744005)(82740400003)(54906003)(478600001)(6266002)(82310400003)(26005)(186003)(4326008)(8936002)(36860700001)(8676002)(55016002)(336012)(316002)(356005)(70206006)(9686003)(81166007)(7126003)(47076005)(6916009)(36900700001); DIR:OUT; SFP:1102; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2021 02:32:20.3400 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa6161be-1a21-4bbd-c9aa-08d8e1113bae X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[P-EXFEND-EQX-01.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT037.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR05MB7497 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-06_08:2021-03-03, 2021-03-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 bulkscore=0 spamscore=0 priorityscore=1501 phishscore=0 impostorscore=0 mlxlogscore=828 adultscore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1011 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103070014 X-Rspamd-Queue-Id: 4DtQVJ4PH9z3jYd X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.33 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RBL_DBL_DONT_QUERY_IPS(0.00)[208.84.65.16:from]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017,juniper.net:s=selector1]; FREEFALL_USER(0.00)[sjg]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:208.84.65.16]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.77)[0.771]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; SPAMHAUS_ZRD(0.00)[208.84.65.16:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[juniper.net:+]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; RCPT_COUNT_SEVEN(0.00)[9]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:26211, ipnet:208.84.65.0/24, country:US]; RCVD_COUNT_SEVEN(0.00)[11]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_IN_DNSWL_LOW(-0.10)[208.84.65.16:from] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 02:32:26 -0000 > The problem here is that the installer needs to know if an ESP has been > made. If /boot/efi is supposed to be the mountpoint for an ESP, its > presence seemed like a reasonable way to signal that. Here are some options: I haven't followed the thread so this may not quite be on point but FWIW in my installer etc, I use `kenv -q efi-version` to know if dealing with EFI. --sjg From owner-dev-commits-src-all@freebsd.org Sun Mar 7 02:51:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCC285561C5; Sun, 7 Mar 2021 02:51: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 4DtQwG4pv9z3kkZ; Sun, 7 Mar 2021 02:51: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 9804A6AB8; Sun, 7 Mar 2021 02: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 1272pQfd082675; Sun, 7 Mar 2021 02: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 1272pQb8082674; Sun, 7 Mar 2021 02:51:26 GMT (envelope-from git) Date: Sun, 7 Mar 2021 02:51:26 GMT Message-Id: <202103070251.1272pQb8082674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 2fc640d5bc0a - main - poly1305: Chase xform_poly1305.h removal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fc640d5bc0a17024dc1eb996ab00af42a5c6dbd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 02:51:26 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=2fc640d5bc0a17024dc1eb996ab00af42a5c6dbd commit 2fc640d5bc0a17024dc1eb996ab00af42a5c6dbd Author: Jung-uk Kim AuthorDate: 2021-03-07 02:47:03 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-07 02:47:03 +0000 poly1305: Chase xform_poly1305.h removal It was missed in bb6e84c988d3 and afbee98232f4. --- ObsoleteFiles.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 59412729ad7e..8dd33475fe44 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20210305: removed Poly1305_* symbols +OLD_FILES+=usr/include/crypto/xform_poly1305.h + # 20210304: remove old bc and dc support and test files .if !defined(WITHOUT_GH_BC) OLD_FILES+=usr/share/misc/bc.library From owner-dev-commits-src-all@freebsd.org Sun Mar 7 06:29:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA7EB55AF34; Sun, 7 Mar 2021 06:29: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 4DtWlj6J3Lz4R1J; Sun, 7 Mar 2021 06:29: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 CB26311A29; Sun, 7 Mar 2021 06:29: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 1276TLDt064698; Sun, 7 Mar 2021 06:29:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1276TLVZ064697; Sun, 7 Mar 2021 06:29:21 GMT (envelope-from git) Date: Sun, 7 Mar 2021 06:29:21 GMT Message-Id: <202103070629.1276TLVZ064697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 6bb140e3ca89 - main - bhyvectl: print a better error message when vm_open() fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6bb140e3ca895a148f32c93d50f93619bf735f73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 06:29:22 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=6bb140e3ca895a148f32c93d50f93619bf735f73 commit 6bb140e3ca895a148f32c93d50f93619bf735f73 Author: Robert Wing AuthorDate: 2021-03-07 06:19:30 +0000 Commit: Robert Wing CommitDate: 2021-03-07 06:19:30 +0000 bhyvectl: print a better error message when vm_open() fails Use errno to print a more descriptive error message when vm_open() fails libvmm: preserve errno when vm_device_open() fails vm_destroy() squashes errno by making a dive into sysctlbyname() - we can safely skip vm_destroy() here since it's not doing any critical clean up at this point. Replace vm_destroy() with a free() call. PR: 250671 MFC after: 3 days Submitted by: marko@apache.org Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D29109 --- lib/libvmmapi/vmmapi.c | 2 +- usr.sbin/bhyvectl/bhyvectl.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index b36ad1c84423..7d46a85b1cd5 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -133,7 +133,7 @@ vm_open(const char *name) return (vm); err: - vm_destroy(vm); + free(vm); return (NULL); } diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 68cc958e66ec..0f7b9533fe4b 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1950,7 +1950,9 @@ main(int argc, char *argv[]) if (!error) { ctx = vm_open(vmname); if (ctx == NULL) { - printf("VM:%s is not created.\n", vmname); + fprintf(stderr, + "vm_open: %s could not be opened: %s\n", + vmname, strerror(errno)); exit (1); } } From owner-dev-commits-src-all@freebsd.org Sun Mar 7 11:31:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32596563B27; Sun, 7 Mar 2021 11:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtfSJ0vSxz4hGd; Sun, 7 Mar 2021 11:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12223155DE; Sun, 7 Mar 2021 11:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 127BVSWe069546; Sun, 7 Mar 2021 11:31:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127BVS7r069545; Sun, 7 Mar 2021 11:31:28 GMT (envelope-from git) Date: Sun, 7 Mar 2021 11:31:28 GMT Message-Id: <202103071131.127BVS7r069545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: 01c6d7918985 - main - mvebu_gpio: Fix settings of gpio pin direction. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01c6d7918985c6e8610d6245af0f745ced86ffd5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 11:31:28 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=01c6d7918985c6e8610d6245af0f745ced86ffd5 commit 01c6d7918985c6e8610d6245af0f745ced86ffd5 Author: Michal Meloun AuthorDate: 2021-03-07 08:50:57 +0000 Commit: Michal Meloun CommitDate: 2021-03-07 10:41:30 +0000 mvebu_gpio: Fix settings of gpio pin direction. Data Output Enable Control register is inverted – 0 means output direction. Reflect this fact in code. MFC after: 3 weeks --- sys/arm/mv/mvebu_gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c index c38fbceebf24..21766f57c9b6 100644 --- a/sys/arm/mv/mvebu_gpio.c +++ b/sys/arm/mv/mvebu_gpio.c @@ -167,10 +167,10 @@ mvebu_gpio_pin_configure(struct mvebu_gpio_softc *sc, struct gpio_pin *pin, pin->gp_flags &= ~(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT); if (flags & GPIO_PIN_OUTPUT) { pin->gp_flags |= GPIO_PIN_OUTPUT; - gpio_write(sc, GPIO_CONTROL_SET, pin, 1); + gpio_write(sc, GPIO_CONTROL_CLR, pin, 1); } else { pin->gp_flags |= GPIO_PIN_INPUT; - gpio_write(sc, GPIO_CONTROL_CLR, pin, 1); + gpio_write(sc, GPIO_CONTROL_SET, pin, 1); } } @@ -785,7 +785,7 @@ mvebu_gpio_attach(device_t dev) else pin->gp_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; pin->gp_flags = - gpio_read(sc, GPIO_CONTROL, &sc->gpio_pins[i]) != 0 ? + gpio_read(sc, GPIO_CONTROL, &sc->gpio_pins[i]) == 0 ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; snprintf(pin->gp_name, GPIOMAXNAME, "gpio%d", i); From owner-dev-commits-src-all@freebsd.org Sun Mar 7 15:13:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07C9956977A; Sun, 7 Mar 2021 15:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtlMz6qsyz4tMC; Sun, 7 Mar 2021 15:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD3121879C; Sun, 7 Mar 2021 15:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 127FD3q6060855; Sun, 7 Mar 2021 15:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127FD3UQ060854; Sun, 7 Mar 2021 15:13:03 GMT (envelope-from git) Date: Sun, 7 Mar 2021 15:13:03 GMT Message-Id: <202103071513.127FD3UQ060854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4663b1baa8ac - stable/13 - Add an entry for NFS-over-TLS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4663b1baa8acc35e3bf0ae8dde1ce534c86268e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 15:13:04 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4663b1baa8acc35e3bf0ae8dde1ce534c86268e3 commit 4663b1baa8acc35e3bf0ae8dde1ce534c86268e3 Author: Rick Macklem AuthorDate: 2021-03-07 15:11:50 +0000 Commit: Rick Macklem CommitDate: 2021-03-07 15:11:50 +0000 Add an entry for NFS-over-TLS. --- RELNOTES | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/RELNOTES b/RELNOTES index 602170394523..40fae9249b53 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,15 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +2c76eebca71b, 59f6f5e23c1a: + Add two daemons rpc.tlsclntd(8) and rpc.tlsservd(8) that provide + support for NFS-over-TLS as described in the Internet Draft titled + "Towards Remote Procedure Call Encryption By Default". + These daemons are only built when WITH_OPENSSL_KTLS is specified + and are only tested on amd64 at this time. + They use KTLS to encrypt/decrypt all NFS RPC message traffic, plus + optional verification of machine identity via X.509 certificates. + f76393a6305b6: Add AES-GCM support to armv8crypto(4) providing accelerated support for KTLS, IPsec, and other crypto API consumers. From owner-dev-commits-src-all@freebsd.org Sun Mar 7 16:18:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CF0956B423; Sun, 7 Mar 2021 16:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dtmqw3g6gz3DK4; Sun, 7 Mar 2021 16:18: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 70D1B191B9; Sun, 7 Mar 2021 16:18: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 127GIqY3040298; Sun, 7 Mar 2021 16:18:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127GIqLp040297; Sun, 7 Mar 2021 16:18:52 GMT (envelope-from git) Date: Sun, 7 Mar 2021 16:18:52 GMT Message-Id: <202103071618.127GIqLp040297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: abbf5f02fa1a - stable/13 - [skip ci] Add RELNOTES entries for aio_writev and fusefs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: abbf5f02fa1ac0c7de2d4a0f7161f78fb1eba8db Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 16:18:52 -0000 The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=abbf5f02fa1ac0c7de2d4a0f7161f78fb1eba8db commit abbf5f02fa1ac0c7de2d4a0f7161f78fb1eba8db Author: Alan Somers AuthorDate: 2021-03-07 16:17:41 +0000 Commit: Alan Somers CommitDate: 2021-03-07 16:17:41 +0000 [skip ci] Add RELNOTES entries for aio_writev and fusefs --- RELNOTES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RELNOTES b/RELNOTES index 40fae9249b53..320d947c24e7 100644 --- a/RELNOTES +++ b/RELNOTES @@ -39,6 +39,14 @@ f76393a6305b6: Add AES-XTS support to armv8crypto(4) providing accelerated software support for the default GELI cipher on arm64 systems. +022ca2fc7fe0: + Add aio_writev(2) and aio_readv(2), vectored analogues of aio_write(2) + and aio_read(2). + +92bbfe1f0d1f: + The fusefs(5) protocol has been updated to 7.28. Support for + FUSE_COPY_FILE_RANGE and FUSE_LSEEK is added. + r368667: GDB 6.1.1 was removed. Users of crashinfo(8) should install the gdb package or devel/gdb port. From owner-dev-commits-src-all@freebsd.org Sun Mar 7 17:33:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FD4A56D841; Sun, 7 Mar 2021 17:33: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 4DtpTk2jmkz3JM7; Sun, 7 Mar 2021 17:33: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 504FA19F4D; Sun, 7 Mar 2021 17:33: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 127HXEP4044224; Sun, 7 Mar 2021 17:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127HXEjR044223; Sun, 7 Mar 2021 17:33:14 GMT (envelope-from git) Date: Sun, 7 Mar 2021 17:33:14 GMT Message-Id: <202103071733.127HXEjR044223@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: 4287fa844f5e - main - TEST gitrepo-dev 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: 4287fa844f5e8f0021ada77c81ce96f9b547fccf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 17:33:14 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=4287fa844f5e8f0021ada77c81ce96f9b547fccf commit 4287fa844f5e8f0021ada77c81ce96f9b547fccf Author: Li-Wen Hsu AuthorDate: 2021-03-05 06:22:09 +0000 Commit: Li-Wen Hsu CommitDate: 2021-03-07 12:52:38 +0000 TEST gitrepo-dev --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index aad363baf9ea..481a079c3314 100644 --- a/README +++ b/README @@ -1,3 +1,4 @@ +TEST This is the top level of the FreeBSD source directory. This file was last revised on: $FreeBSD$ From owner-dev-commits-src-all@freebsd.org Sun Mar 7 17:34:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96CDE56D6F6; Sun, 7 Mar 2021 17:34: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 4DtpWG3tbPz3JvS; Sun, 7 Mar 2021 17:34: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 786381A4EB; Sun, 7 Mar 2021 17:34: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 127HYY0j044532; Sun, 7 Mar 2021 17:34:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127HYY6d044531; Sun, 7 Mar 2021 17:34:34 GMT (envelope-from git) Date: Sun, 7 Mar 2021 17:34:34 GMT Message-Id: <202103071734.127HYY6d044531@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: 2c75196236fc - main - Revert "TEST gitrepo-dev" 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: 2c75196236fc1c8516df64c5a97467b96bfa1da2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 17:34:34 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=2c75196236fc1c8516df64c5a97467b96bfa1da2 commit 2c75196236fc1c8516df64c5a97467b96bfa1da2 Author: Li-Wen Hsu AuthorDate: 2021-03-07 17:34:21 +0000 Commit: Li-Wen Hsu CommitDate: 2021-03-07 17:34:21 +0000 Revert "TEST gitrepo-dev" This reverts commit 4287fa844f5e8f0021ada77c81ce96f9b547fccf. --- README | 1 - 1 file changed, 1 deletion(-) diff --git a/README b/README index 481a079c3314..aad363baf9ea 100644 --- a/README +++ b/README @@ -1,4 +1,3 @@ -TEST This is the top level of the FreeBSD source directory. This file was last revised on: $FreeBSD$ From owner-dev-commits-src-all@freebsd.org Sun Mar 7 17:47:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD8D356DBC8; Sun, 7 Mar 2021 17:47: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 4Dtpp05m8Zz3KDw; Sun, 7 Mar 2021 17:47: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 B43DD1A370; Sun, 7 Mar 2021 17:47: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 127HlKUG058582; Sun, 7 Mar 2021 17:47:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127HlKDQ058581; Sun, 7 Mar 2021 17:47:20 GMT (envelope-from git) Date: Sun, 7 Mar 2021 17:47:20 GMT Message-Id: <202103071747.127HlKDQ058581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3fca90af438a - main - net80211: ratectl header guard against multiple inclusions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fca90af438ac4232d6b33ee4874297089997dd6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 17:47:20 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3fca90af438ac4232d6b33ee4874297089997dd6 commit 3fca90af438ac4232d6b33ee4874297089997dd6 Author: Bjoern A. Zeeb AuthorDate: 2021-03-07 17:35:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-07 17:35:58 +0000 net80211: ratectl header guard against multiple inclusions Add missing #ifndef/#define/#endif guards against multiple inclusions to ieee80211_ratectl.h as they are missing. MFC after: 3 days Sponsored-by: Rubicon Communications, LLC ("Netgate") --- sys/net80211/ieee80211_ratectl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/net80211/ieee80211_ratectl.h b/sys/net80211/ieee80211_ratectl.h index d147421a0364..6890e74bf518 100644 --- a/sys/net80211/ieee80211_ratectl.h +++ b/sys/net80211/ieee80211_ratectl.h @@ -27,6 +27,9 @@ * $FreeBSD$ */ +#ifndef _NET80211_IEEE80211_RATECTL_H_ +#define _NET80211_IEEE80211_RATECTL_H_ + enum ieee80211_ratealgs { IEEE80211_RATECTL_AMRR = 0, IEEE80211_RATECTL_RSSADAPT = 1, @@ -169,3 +172,5 @@ ieee80211_ratectl_node_stats(struct ieee80211_node *ni, struct sbuf *s) return; vap->iv_rate->ir_node_stats(ni, s); } + +#endif /* _NET80211_IEEE80211_RATECTL_H_ */ From owner-dev-commits-src-all@freebsd.org Sun Mar 7 18:44:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3436B56F50E; Sun, 7 Mar 2021 18:44:08 +0000 (UTC) (envelope-from crees@bayofrum.net) Received: from mail56c50.megamailservers.eu (mail168c50.megamailservers.eu [91.136.10.178]) (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 4Dtr3W06F5z3NVn; Sun, 7 Mar 2021 18:44:06 +0000 (UTC) (envelope-from crees@bayofrum.net) X-Authenticated-User: crees@uwclub.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1615142638; bh=MiEJIWh2PndqNKC6+ZcTntqfLdJ444BkTjaqoxAJVlQ=; h=Date:From:To:Subject:In-Reply-To:References:From; b=PWcWYS++DEShEx2B+Z4+KtmroZOB6q1V1CH2NC3cN+IDkVEkWWiwh5vJ7LVytWP2M DnJwOHd11NCwixnwhtTFcQ8mV5szdxVcV4hwlQOCFP06U7sfuYdNLcGtlavj+UhtUC FDsoLiLFRaN96EMKhyBq9fsrEx4yNU4YK8kIqBZ4= Feedback-ID: crees@bayofrum. Received: from pegasus.bayofrum.net (81-178-238-223.dsl.pipex.com [81.178.238.223]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 127Ihuc4029810; Sun, 7 Mar 2021 18:43:58 +0000 X-Spam-Status: No X-bayofrum-MailScanner-From: crees@bayofrum.net X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-ID: 6EE1135B3.A761C X-bayofrum-MailScanner-Information: Please contact the ISP for more information Received: from www.bayofrum.net (unknown [192.168.1.70]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id 6EE1135B3; Sun, 7 Mar 2021 18:43:50 +0000 (GMT) MIME-Version: 1.0 Date: Sun, 07 Mar 2021 13:43:50 -0500 From: Chris Rees To: dev-commits-src-all@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, dev-commits-src-main@freebsd.org, Rick Parrish Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-Reply-To: <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <74fde23ead6719ac4e56dacb51bca6ed@bayofrum.net> X-Sender: crees@bayofrum.net Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-CTCH-RefID: str=0001.0A742F21.60451EEE.0026:SCFSTAT83439264, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: -4.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=UaYvt5aN c=1 sm=1 tr=0 a=VPjlEbx5XC2baNimRf67MQ==:117 a=VPjlEbx5XC2baNimRf67MQ==:17 a=kj9zAlcOel0A:10 a=dESyimp9J3IA:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=wYKsyiGUE8vJ2gENuAgA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=BPzZvq435JnGatEyYwdK:22 X-Origin-Country: GB X-Rspamd-Queue-Id: 4Dtr3W06F5z3NVn X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=megamailservers.eu header.s=maildub header.b=PWcWYS++; dmarc=none; spf=none (mx1.freebsd.org: domain of crees@bayofrum.net has no SPF policy when checking 91.136.10.178) smtp.mailfrom=crees@bayofrum.net X-Spamd-Result: default: False [-3.03 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[megamailservers.eu:+]; NEURAL_HAM_SHORT(-0.73)[-0.728]; FREEMAIL_TO(0.00)[freebsd.org,gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[91.136.10.178:from]; ASN(0.00)[asn:9115, ipnet:91.136.0.0/17, country:CA]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[81.178.238.223:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[megamailservers.eu:s=maildub]; FREEFALL_USER(0.00)[crees]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bayofrum.net]; SPAMHAUS_ZRD(0.00)[91.136.10.178:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MAILMAN_DEST(0.00)[dev-commits-src-main,dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 18:44:08 -0000 Forgot to CC the actual author! On 2021-02-23 17:03, Chris Rees wrote: > Hi, > > On 23 February 2021 10:27:34 GMT, Baptiste Daroussin > wrote: >> The branch main has been updated by bapt: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=77e1ccbee3ed6c837929e4e232fd07f95bfc8294 >> >> commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 >> Author: Rick Parrish >> AuthorDate: 2021-02-07 06:15:21 +0000 >> Commit: Baptiste Daroussin >> CommitDate: 2021-02-23 10:16:53 +0000 >> >> rc: implement parallel boot >> >> take advantage of the rcorder -p argument to implement parallel >> booting in rc. >> >> According to the author non scientific tests: >> on a Core 2 Duo with spinning disk: >> >> | Services enabled | before | after | saving | >> | 0 | 8s | 8s | 0 | >> | 1 | 13s | 13s | 0 | >> | 2 | 17s | 13s | 5 | >> | 3 | 23s | 13s | 10 | >> | 4 | 28s | 13s | 15 | >> | 5 | 33s | 13s | 20 | >> >> PR: 249192 >> MFC after: 3 weeks >> --- >> libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- >> 1 file changed, 34 insertions(+), 15 deletions(-) >> >> diff --git a/libexec/rc/rc b/libexec/rc/rc >> index 35db4a850516..722d7fe35884 100644 >> --- a/libexec/rc/rc >> +++ b/libexec/rc/rc >> @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then >> skip_firstboot="-s firstboot" >> fi >> >> +# rc_parallel_start default is "NO" >> +rc_parallel_start=${rc_parallel_start:-NO} > > Should this go in defaults/rc.conf? I think this should be in defaults/rc.conf-- the load_rc_config line is above it. Incidentally, is the plan for this to go into 13 *and* 12, or just 13? It's an exciting step! Chris From owner-dev-commits-src-all@freebsd.org Sun Mar 7 19:30:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67D28570BB2; Sun, 7 Mar 2021 19:30: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 4Dts562Yqfz3QpT; Sun, 7 Mar 2021 19:30: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 4AF741B86A; Sun, 7 Mar 2021 19:30: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 127JUYhZ097666; Sun, 7 Mar 2021 19:30:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127JUY9j097665; Sun, 7 Mar 2021 19:30:34 GMT (envelope-from git) Date: Sun, 7 Mar 2021 19:30:34 GMT Message-Id: <202103071930.127JUY9j097665@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: f7bfe310191c - main - wg(4): Fix an example in the manual page 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: f7bfe310191c8292da51c8da166a521ff16e0e46 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 19:30:34 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f7bfe310191c8292da51c8da166a521ff16e0e46 commit f7bfe310191c8292da51c8da166a521ff16e0e46 Author: Gordon Bergling AuthorDate: 2021-03-07 19:27:59 +0000 Commit: Gordon Bergling CommitDate: 2021-03-07 19:27:59 +0000 wg(4): Fix an example in the manual page The example in the manual page of wg(4) for connecting to a peer was missing the 'public-key' ifconfig(8) keyword and for the addressed peer the port must be specified. PR: 253866 Reported by: Sergey Akhmatov Reviewed by: debdrup MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29115 --- share/man/man4/wg.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 index 2a13b98f45e9..760584e3a386 100644 --- a/share/man/man4/wg.4 +++ b/share/man/man4/wg.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2021 +.Dd March 7, 2021 .Dt WG 4 .Os .Sh NAME @@ -184,7 +184,7 @@ $ ifconfig wg0 | awk '/public-key/ { print $2 }'` .Pp Connect to a specific endpoint using its public-key and set the allowed IP address .Bd -literal -offset indent -# ifconfig wg0 peer '7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=' endpoint 10.0.1.100 allowed-ips 192.168.2.100/32 +# ifconfig wg0 peer public-key '7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw=' endpoint 10.0.1.100:54321 allowed-ips 192.168.2.100/32 .Ed .Sh DIAGNOSTICS The From owner-dev-commits-src-all@freebsd.org Sun Mar 7 20:08:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BD2E571B93; Sun, 7 Mar 2021 20:08: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 4DtsxP0HrPz3jWJ; Sun, 7 Mar 2021 20:08: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 F10B81C502; Sun, 7 Mar 2021 20:08: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 127K8uEU042977; Sun, 7 Mar 2021 20:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127K8u3V042976; Sun, 7 Mar 2021 20:08:56 GMT (envelope-from git) Date: Sun, 7 Mar 2021 20:08:56 GMT Message-Id: <202103072008.127K8u3V042976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oleksandr Tymoshenko Subject: git: 748be78e60cc - main - armv8crypto: fix AES-XTS regression introduced by ed9b7f44 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gonzo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 748be78e60ccc4a26325a636347debb1f7e6749b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 20:08:57 -0000 The branch main has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=748be78e60ccc4a26325a636347debb1f7e6749b commit 748be78e60ccc4a26325a636347debb1f7e6749b Author: Oleksandr Tymoshenko AuthorDate: 2021-03-07 20:03:47 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-03-07 20:03:47 +0000 armv8crypto: fix AES-XTS regression introduced by ed9b7f44 Initialization of the XTS key schedule was accidentally dropped when adding AES-GCM support so all-zero schedule was used instead. This rendered previously created GELI partitions unusable. This change restores proper XTS key schedule initialization. Reported by: Peter Jeremy MFC after: immediately --- sys/crypto/armv8/armv8_crypto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c index 24f6eff5608d..95bb96124323 100644 --- a/sys/crypto/armv8/armv8_crypto.c +++ b/sys/crypto/armv8/armv8_crypto.c @@ -305,6 +305,9 @@ armv8_crypto_cipher_setup(struct armv8_crypto_session *ses, aes_v8_set_decrypt_key(key, keylen * 8, &ses->dec_schedule); + if (csp->csp_cipher_alg == CRYPTO_AES_XTS) + aes_v8_set_encrypt_key(key + keylen, keylen * 8, &ses->xts_schedule); + if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16) { memset(H.c, 0, sizeof(H.c)); aes_v8_encrypt(H.c, H.c, &ses->enc_schedule); From owner-dev-commits-src-all@freebsd.org Sun Mar 7 20:57:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB78457353C; Sun, 7 Mar 2021 20:57: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 4Dtv1k5NWYz3mQr; Sun, 7 Mar 2021 20:57: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 AB8CC1C94A; Sun, 7 Mar 2021 20:57: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 127Kvk60008326; Sun, 7 Mar 2021 20:57:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127Kvkfk008325; Sun, 7 Mar 2021 20:57:46 GMT (envelope-from git) Date: Sun, 7 Mar 2021 20:57:46 GMT Message-Id: <202103072057.127Kvkfk008325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Oleksandr Tymoshenko Subject: git: 4ecfdf7b47b2 - stable/13 - armv8crypto: fix AES-XTS regression introduced by ed9b7f44 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gonzo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ecfdf7b47b2ca6ef038610339a96586d04de5ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 20:57:46 -0000 The branch stable/13 has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=4ecfdf7b47b2ca6ef038610339a96586d04de5ab commit 4ecfdf7b47b2ca6ef038610339a96586d04de5ab Author: Oleksandr Tymoshenko AuthorDate: 2021-03-07 20:03:47 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-03-07 20:41:15 +0000 armv8crypto: fix AES-XTS regression introduced by ed9b7f44 Initialization of the XTS key schedule was accidentally dropped when adding AES-GCM support so all-zero schedule was used instead. This rendered previously created GELI partitions unusable. This change restores proper XTS key schedule initialization. Reported by: Peter Jeremy MFC after: immediately (cherry picked from commit 748be78e60ccc4a26325a636347debb1f7e6749b) --- sys/crypto/armv8/armv8_crypto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c index 24f6eff5608d..95bb96124323 100644 --- a/sys/crypto/armv8/armv8_crypto.c +++ b/sys/crypto/armv8/armv8_crypto.c @@ -305,6 +305,9 @@ armv8_crypto_cipher_setup(struct armv8_crypto_session *ses, aes_v8_set_decrypt_key(key, keylen * 8, &ses->dec_schedule); + if (csp->csp_cipher_alg == CRYPTO_AES_XTS) + aes_v8_set_encrypt_key(key + keylen, keylen * 8, &ses->xts_schedule); + if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16) { memset(H.c, 0, sizeof(H.c)); aes_v8_encrypt(H.c, H.c, &ses->enc_schedule); From owner-dev-commits-src-all@freebsd.org Sun Mar 7 21:39:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72F9D5754EB; Sun, 7 Mar 2021 21:39: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 4Dtvy01x6Xz3qw3; Sun, 7 Mar 2021 21:39: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 356051D676; Sun, 7 Mar 2021 21:39: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 127LdaVj061413; Sun, 7 Mar 2021 21:39:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127Ldasq061412; Sun, 7 Mar 2021 21:39:36 GMT (envelope-from git) Date: Sun, 7 Mar 2021 21:39:36 GMT Message-Id: <202103072139.127Ldasq061412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: bdd61b6914f1 - stable/13 - jail(8): reset to root cpuset before attaching to run commands 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bdd61b6914f1f961b5f414b2d5cc623a5a829b89 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 21:39:36 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bdd61b6914f1f961b5f414b2d5cc623a5a829b89 commit bdd61b6914f1f961b5f414b2d5cc623a5a829b89 Author: Kyle Evans AuthorDate: 2021-03-04 19:28:53 +0000 Commit: Kyle Evans CommitDate: 2021-03-07 21:39:29 +0000 jail(8): reset to root cpuset before attaching to run commands Recent changes have made it such that attaching to a jail will augment the attaching process' cpu mask with the jail's cpuset. While this is convenient for allowing the administrator to cpuset arbitrary programs that will attach to a jail, this is decidedly not convenient for executing long-running daemons during jail creation. This change inserts a reset of the process cpuset to the root cpuset between the fork and attach to execute a command. This allows commands executed to have the widest mask possible, and the administrator can cpuset(1) it back down inside the jail as needed. With this applied, one should be able to change a jail's cpuset at exec.poststart in addition to exec.created. The former was made difficult if jail(8) itself was running with a constrained set, as then some processes may have been spawned inside the jail with a non-root set. The latter is the preferred option so that processes starting in the jail are constrained appropriately up front. Note that all system commands are still run with the process' initial cpuset applied. PR: 253724 (cherry picked from commit 466df976babed65f8a8de9e36d7f016a444609af) --- usr.sbin/jail/command.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index a5c1839849fd..c1d418d6cc69 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -84,6 +85,20 @@ static struct cfstring dummystring = { .len = 1 }; static struct phhead phash[PHASH_SIZE]; static int kq; +static cpusetid_t +root_cpuset_id(void) +{ + static cpusetid_t setid = CPUSET_INVALID; + static int error; + + /* Only try to get the cpuset once. */ + if (error == 0 && setid == CPUSET_INVALID) + error = cpuset_getid(CPU_LEVEL_ROOT, CPU_WHICH_PID, -1, &setid); + if (error != 0) + return (CPUSET_INVALID); + return (setid); +} + /* * Run the next command associated with a jail. */ @@ -283,6 +298,7 @@ run_command(struct cfjail *j) enum intparam comparam; size_t comlen; pid_t pid; + cpusetid_t setid; int argc, bg, clean, consfd, down, fib, i, injail, sjuser, timeout; #if defined(INET) || defined(INET6) char *addr, *extrap, *p, *val; @@ -632,6 +648,10 @@ run_command(struct cfjail *j) injail = comparam == IP_EXEC_START || comparam == IP_COMMAND || comparam == IP_EXEC_STOP; + if (injail) + setid = root_cpuset_id(); + else + setid = CPUSET_INVALID; clean = bool_param(j->intparams[IP_EXEC_CLEAN]); username = string_param(j->intparams[injail ? IP_EXEC_JAIL_USER : IP_EXEC_SYSTEM_USER]); @@ -700,6 +720,19 @@ run_command(struct cfjail *j) jail_warnx(j, "setfib: %s", strerror(errno)); exit(1); } + + /* + * We wouldn't have specialized our affinity, so just setid to + * root. We do this prior to attaching to avoid the kernel + * having to create a transient cpuset that we'll promptly + * free up with a reset to the jail's cpuset. + * + * This is just a best-effort to use as wide of mask as + * possible. + */ + if (setid != CPUSET_INVALID) + (void)cpuset_setid(CPU_WHICH_PID, -1, setid); + if (jail_attach(j->jid) < 0) { jail_warnx(j, "jail_attach: %s", strerror(errno)); exit(1); From owner-dev-commits-src-all@freebsd.org Sun Mar 7 21:39:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AA9757547F; Sun, 7 Mar 2021 21:39: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 4Dtvy12X7Pz3rDP; Sun, 7 Mar 2021 21:39: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 49CD11D677; Sun, 7 Mar 2021 21:39: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 127Ldb1A061434; Sun, 7 Mar 2021 21:39:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127Ldb9e061433; Sun, 7 Mar 2021 21:39:37 GMT (envelope-from git) Date: Sun, 7 Mar 2021 21:39:37 GMT Message-Id: <202103072139.127Ldb9e061433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 872ec7e5b6f3 - stable/13 - service(8): use an environment more consistent with init(8) 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 872ec7e5b6f35d84745b49c02f58572632de22ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 21:39:37 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=872ec7e5b6f35d84745b49c02f58572632de22ed commit 872ec7e5b6f35d84745b49c02f58572632de22ed Author: Andrew Gierth AuthorDate: 2021-03-03 18:25:11 +0000 Commit: Kyle Evans CommitDate: 2021-03-07 21:39:30 +0000 service(8): use an environment more consistent with init(8) init(8) sets the "daemon" login class without specifying a pw entry (so no substitutions are done on the variables). service(8)'s use of env -L had the effect of specifying root's pw entry, with two effects: getpwnam and getpwuid are being called, which may not be entirely safe depending on what nsswitch is up to and what stage of boot we are at, and substitutions would have been done. Fix by teaching env(8) to allow -L -/classname to set the class environment with no pw entry at all specified, and use it in service(8). PR: 253959 (cherry picked from commit 55deb0a5f089c8a27cfc1666655b93881c2b47ae) (cherry picked from commit 0c1a5eaae83267365330437adb60f44e1a622a2b) --- usr.bin/env/env.1 | 7 ++++++- usr.bin/env/env.c | 25 ++++++++++++++++--------- usr.sbin/service/service.sh | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/usr.bin/env/env.1 b/usr.bin/env/env.1 index 8c0527608506..9aff9508e47b 100644 --- a/usr.bin/env/env.1 +++ b/usr.bin/env/env.1 @@ -31,7 +31,7 @@ .\" From FreeBSD: src/usr.bin/printenv/printenv.1,v 1.17 2002/11/26 17:33:35 ru Exp .\" $FreeBSD$ .\" -.Dd November 11, 2020 +.Dd March 3, 2021 .Dt ENV 1 .Os .Sh NAME @@ -104,6 +104,11 @@ is used, then the specified user's .Pa ~/.login_conf is read as well. The user may be specified by name or by uid. +If a username of +.Sq Li \&- +is given, then no user lookup will be done, the login class will default to +.Sq Li default +if not explicitly given, and no substitutions will be done on the values. .\" -P .It Fl P Ar altpath Search the set of directories as specified by diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c index e408577ea7a4..a0f55d665a9a 100644 --- a/usr.bin/env/env.c +++ b/usr.bin/env/env.c @@ -144,16 +144,23 @@ main(int argc, char **argv) login_class = strchr(login_name, '/'); if (login_class) *login_class++ = '\0'; - pw = getpwnam(login_name); - if (pw == NULL) { - char *endp = NULL; - errno = 0; - uid = strtoul(login_name, &endp, 10); - if (errno == 0 && *endp == '\0') - pw = getpwuid(uid); + if (*login_name != '\0' && strcmp(login_name, "-") != 0) { + pw = getpwnam(login_name); + if (pw == NULL) { + char *endp = NULL; + errno = 0; + uid = strtoul(login_name, &endp, 10); + if (errno == 0 && *endp == '\0') + pw = getpwuid(uid); + } + if (pw == NULL) + errx(EXIT_FAILURE, "no such user: %s", login_name); } - if (pw == NULL) - errx(EXIT_FAILURE, "no such user: %s", login_name); + /* + * Note that it is safe for pw to be null here; the libutil + * code handles that, bypassing substitution of $ and using + * the class "default" if no class name is given either. + */ if (login_class != NULL) { lc = login_getclass(login_class); if (lc == NULL) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 42a50fcf61b9..df2869f98a6c 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -165,7 +165,7 @@ cd / for dir in /etc/rc.d $local_startup; do if [ -x "$dir/$script" ]; then [ -n "$VERBOSE" ] && echo "$script is located in $dir" - exec env -i -L 0/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" + exec env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" fi done From owner-dev-commits-src-all@freebsd.org Sun Mar 7 22:18:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B54D75774DA; Sun, 7 Mar 2021 22:18: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 4DtwpN4KkCz4TPt; Sun, 7 Mar 2021 22:18:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E9C01DF5F; Sun, 7 Mar 2021 22:18:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 127MI2ek014076; Sun, 7 Mar 2021 22:18:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127MI28p014075; Sun, 7 Mar 2021 22:18:02 GMT (envelope-from git) Date: Sun, 7 Mar 2021 22:18:02 GMT Message-Id: <202103072218.127MI28p014075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: d5be41beb7c4 - main - Fix dpdk/ldradix fib lookup algorithm preference calculation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5be41beb7c44119730791d92782d8e77174d312 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 22:18:06 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d5be41beb7c44119730791d92782d8e77174d312 commit d5be41beb7c44119730791d92782d8e77174d312 Author: Alexander V. Chernikov AuthorDate: 2021-03-07 22:05:34 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-07 22:17:53 +0000 Fix dpdk/ldradix fib lookup algorithm preference calculation. The current preference number were copied from IPv4 code, assuming 500k routes to be the full-view. Adjust with the current reality (100k full-view). Reported by: Marek Zarychta MFC after: 3 days --- sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c | 4 ++-- sys/netinet6/in6_fib_algo.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c b/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c index 250e3e1bde4a..17d35c16346d 100644 --- a/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c +++ b/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c @@ -129,8 +129,8 @@ rte6_get_pref(const struct rib_rtable_info *rinfo) return (1); else if (rinfo->num_prefixes < 1000) return (rinfo->num_prefixes / 10); - else if (rinfo->num_prefixes < 500000) - return (100 + rinfo->num_prefixes / 3334); + else if (rinfo->num_prefixes < 100000) + return (100 + rinfo->num_prefixes / 667); else return (250); } diff --git a/sys/netinet6/in6_fib_algo.c b/sys/netinet6/in6_fib_algo.c index c9df9387af37..04d194273168 100644 --- a/sys/netinet6/in6_fib_algo.c +++ b/sys/netinet6/in6_fib_algo.c @@ -118,8 +118,8 @@ lradix6_get_pref(const struct rib_rtable_info *rinfo) if (rinfo->num_prefixes < 10) return (255); - else if (rinfo->num_prefixes < 100000) - return (255 - rinfo->num_prefixes / 394); + else if (rinfo->num_prefixes < 10000) + return (255 - rinfo->num_prefixes / 40); else return (1); } From owner-dev-commits-src-all@freebsd.org Sun Mar 7 22:56:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66078552687 for ; Sun, 7 Mar 2021 22:56:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (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 4DtxfV3PYmz4kBb; Sun, 7 Mar 2021 22:56:18 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oo1-f53.google.com with SMTP id x19so1783059ooj.10; Sun, 07 Mar 2021 14:56:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QWiFtCSory0vRv+5Fro2sHPDZW35HflfV3K2neH8FGg=; b=MJA/2T1cwf0nzeu/gE62hpAS9QvmkHqIUaEAdFSXlQ4aolRbMuJSKF4rT5oi4J37dH wHbh2VugjjdZAAb2NQ4k1IwGudtScMlyD+PdSDOf4NyBz123lnLlAuiWS3y3k42chRgL hiwRdFNVMA51UusjNjSSvWzD9zeYze019u80KCSrzUAIhx0bFA97q4+74Cx4MOHX0b7M 2AtM9x6hCvePdwV6OHQ7uf1MDLKggVYUVoJFlmxuFh3gcwG83LEHe66gk8nFgZs4lNMV tbg0beGDc+nr78CMeCxO+6Xcl+RpeS2i0E88UgTJNnl9jbwDer98jgancyXWaeCOagHt EH8Q== X-Gm-Message-State: AOAM531aH8pyEH32M30LQ14tnNlMURSasZ0rFK/zR2AHj9VHPnqgoZtv 1qGhdLHw4x3JaFh8YcLAfo8w2qPhh5mN1wee4wf+IhDV18M= X-Google-Smtp-Source: ABdhPJxzSELyxye/VioGtXXrWhar+DVAI+NfW7nxvp3gW9xhgf7Lk5zv7lxgT7HhaDOPJeSmIUJBpl9c1KGvoNxT5K4= X-Received: by 2002:a4a:9c17:: with SMTP id y23mr1015297ooj.74.1615157777145; Sun, 07 Mar 2021 14:56:17 -0800 (PST) MIME-Version: 1.0 References: <202102140010.11E0AYsC083685@gitrepo.freebsd.org> In-Reply-To: <202102140010.11E0AYsC083685@gitrepo.freebsd.org> From: Alan Somers Date: Sun, 7 Mar 2021 15:56:05 -0700 Message-ID: Subject: Re: git: 69d9cc88d213 - vendor/openzfs - Update OpenZFS to master-c1c31a835 To: Martin Matuska Cc: src-committers , dev-commits-src-all@freebsd.org X-Rspamd-Queue-Id: 4DtxfV3PYmz4kBb X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.161.53 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-1.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; ARC_NA(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.161.53:from]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.161.53:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.161.53:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.161.53:from]; NEURAL_SPAM_SHORT(1.00)[1.000]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; MAILMAN_DEST(0.00)[dev-commits-src-all]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 22:56:19 -0000 On Sat, Feb 13, 2021 at 5:10 PM Martin Matuska wrote: > The branch vendor/openzfs has been updated by mm: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=69d9cc88d213f3d95526636743f15371f2fa6c2c > > commit 69d9cc88d213f3d95526636743f15371f2fa6c2c > Author: Martin Matuska > AuthorDate: 2021-02-14 00:09:23 +0000 > Commit: Martin Matuska > CommitDate: 2021-02-14 00:09:23 +0000 > > Update OpenZFS to master-c1c31a835 > > Discussed with: mjguzik > Is there any plan to MFC this (and/or a later OpenZFS integration) to stable/13 ? From owner-dev-commits-src-all@freebsd.org Sun Mar 7 23:22:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E116A55330A for ; Sun, 7 Mar 2021 23:22:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [144.76.20.103]) by mx1.freebsd.org (Postfix) with ESMTP id 4DtyF854RJz4mBq; Sun, 7 Mar 2021 23:22:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id A8B101DDF7C; Mon, 8 Mar 2021 00:22:46 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by mail.vx.sk (amavisd-new, unix socket) with LMTP id 6Ap0ZzOMK1kO; Mon, 8 Mar 2021 00:22:46 +0100 (CET) Received: from [10.9.8.122] (188-167-101-78.dynamic.chello.sk [188.167.101.78]) by mail.vx.sk (Postfix) with ESMTPSA id 677841DDF76; Mon, 8 Mar 2021 00:22:46 +0100 (CET) To: Alan Somers Cc: src-committers , dev-commits-src-all@freebsd.org References: <202102140010.11E0AYsC083685@gitrepo.freebsd.org> From: Martin Matuska Subject: Re: git: 69d9cc88d213 - vendor/openzfs - Update OpenZFS to master-c1c31a835 Message-ID: Date: Mon, 8 Mar 2021 00:22:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Rspamd-Queue-Id: 4DtyF854RJz4mBq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 23:22:52 -0000 I am intentionally postponing a MFC of the latest OpenZFS merges to=20 stable/13 to keep the code as close as possible to releng/13.0. This has = allowed wider testing coverage for individual fixes that had been going=20 to be backported. As you might have noticed there has been quite a bunch of backports to=20 provide 13.0-RELEASE with as stable OpenZFS as possible. Due to our=20 release policy I didn't backport any of the new features, where the most = shiny ones are the zpool compatibility property and parallelized vdev=20 loading (a blessing for every administrator of large JBOD storages). Anyway are moving to a "late" RC stage now so I will gladly drop a small = OpenZFS MFC bomb on stable/13 in the upcoming days On 7. 3. 2021 23:56, Alan Somers wrote: > On Sat, Feb 13, 2021 at 5:10 PM Martin Matuska > wrote: > > The branch vendor/openzfs has been updated by mm: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D69d9cc88d213f3d9552663674= 3f15371f2fa6c2c > > > commit 69d9cc88d213f3d95526636743f15371f2fa6c2c > Author:=C2=A0 =C2=A0 =C2=A0Martin Matuska > AuthorDate: 2021-02-14 00:09:23 +0000 > Commit:=C2=A0 =C2=A0 =C2=A0Martin Matuska > CommitDate: 2021-02-14 00:09:23 +0000 > > =C2=A0 =C2=A0 Update OpenZFS to master-c1c31a835 > > =C2=A0 =C2=A0 Discussed with: mjguzik > > > Is there any plan to MFC this (and/or a later OpenZFS integration) to=20 > stable/13 ? From owner-dev-commits-src-all@freebsd.org Sun Mar 7 23:27:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C3DD5533E9; Sun, 7 Mar 2021 23:27: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 4DtyLS5pQGz4mmr; Sun, 7 Mar 2021 23:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA8C01EC75; Sun, 7 Mar 2021 23:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 127NRSMq006209; Sun, 7 Mar 2021 23:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127NRSLU006208; Sun, 7 Mar 2021 23:27:28 GMT (envelope-from git) Date: Sun, 7 Mar 2021 23:27:28 GMT Message-Id: <202103072327.127NRSLU006208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 576313b983dc - main - dumpon: do not print errno for resolver failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 576313b983dca243d7ba6af8b57517bed419ecb4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 23:27:29 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=576313b983dca243d7ba6af8b57517bed419ecb4 commit 576313b983dca243d7ba6af8b57517bed419ecb4 Author: Eric van Gyzen AuthorDate: 2021-03-05 16:39:53 +0000 Commit: Eric van Gyzen CommitDate: 2021-03-07 23:23:04 +0000 dumpon: do not print errno for resolver failure When the netdump host name fails to resolve, don't print errno, since it's irrelevant. We might as well use a different exit status, too. Sponsored by: Dell EMC Isilon --- sbin/dumpon/dumpon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index 2b710a611af3..183ce5f08cb3 100644 --- a/sbin/dumpon/dumpon.c +++ b/sbin/dumpon/dumpon.c @@ -532,10 +532,11 @@ main(int argc, char *argv[]) hints.ai_protocol = IPPROTO_UDP; res = NULL; error = getaddrinfo(server, NULL, &hints, &res); - if (error != 0) - err(1, "%s", gai_strerror(error)); - if (res == NULL) - errx(1, "failed to resolve '%s'", server); + if (error != 0) { + if (error == EAI_SYSTEM) + err(EX_OSERR, "%s", gai_strerror(error)); + errx(EX_NOHOST, "%s", gai_strerror(error)); + } server = inet_ntoa( ((struct sockaddr_in *)(void *)res->ai_addr)->sin_addr); freeaddrinfo(res); From owner-dev-commits-src-all@freebsd.org Sun Mar 7 23:30:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18FBD55369B; Sun, 7 Mar 2021 23:30: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 4DtyPq3SS2z4mrd; Sun, 7 Mar 2021 23:30: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 448FA1EBF0; Sun, 7 Mar 2021 23:30: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 127NUNl0014086; Sun, 7 Mar 2021 23:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 127NUNMQ014085; Sun, 7 Mar 2021 23:30:23 GMT (envelope-from git) Date: Sun, 7 Mar 2021 23:30:23 GMT Message-Id: <202103072330.127NUNMQ014085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 0424d9ebeb17 - main - decryptcore: do not include sys/sysctl.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0424d9ebeb17d669f680c696f0d741b714461b4c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2021 23:30:24 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=0424d9ebeb17d669f680c696f0d741b714461b4c commit 0424d9ebeb17d669f680c696f0d741b714461b4c Author: Eric van Gyzen AuthorDate: 2021-03-05 16:38:37 +0000 Commit: Eric van Gyzen CommitDate: 2021-03-07 23:29:03 +0000 decryptcore: do not include sys/sysctl.h It's not needed. Removing it is a small improvement in portability. Sponsored by: Dell EMC Isilon --- sbin/decryptcore/decryptcore.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sbin/decryptcore/decryptcore.c b/sbin/decryptcore/decryptcore.c index cc1807b18a80..fc6599fb0ecc 100644 --- a/sbin/decryptcore/decryptcore.c +++ b/sbin/decryptcore/decryptcore.c @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include